@zeniai/web-app-ui 4.14.39-dev → 4.14.39-mohali
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/assets/{ACHDetailsPage-B5qIuZya-Dqn8ZaVl.js → ACHDetailsPage-B5qIuZya-BWHKWW61.js} +1 -1
- package/dist/assets/{AIPerformancePage-BHB45mP--CWtWN8JR.js → AIPerformancePage-BHB45mP--BTR5uGqz.js} +1 -1
- package/dist/assets/{AccountInfoPage-Cd5xYT1g-BylH1aam.js → AccountInfoPage-Cd5xYT1g-By8wNUIl.js} +1 -1
- package/dist/assets/{AccountInfoPageContent-CJ7ycVIK-3aE5KJwU.js → AccountInfoPageContent-CJ7ycVIK-BM1tsyhR.js} +1 -1
- package/dist/assets/{AccountLockedInfoModal-Dox7IuAX-C5qPLBPz.js → AccountLockedInfoModal-Dox7IuAX-myDBikQM.js} +1 -1
- package/dist/assets/{AccountReconDetailsDrawerPage-Bqty08m0-Dbr-jmu7.js → AccountReconDetailsDrawerPage-Bqty08m0-BEwn6Bkg.js} +1 -1
- package/dist/assets/{AccountRow-D1cjRJJD-Dsnq1o4t.js → AccountRow-D1cjRJJD-pCF07R4u.js} +1 -1
- package/dist/assets/{AccountsPromoCardStack-Bs3naJHM-DvbUMPbJ.js → AccountsPromoCardStack-Bs3naJHM-DGCYaWJc.js} +1 -1
- package/dist/assets/{AddAddressForCardDrawer-DZkBMJfp-DwU9s4jD.js → AddAddressForCardDrawer-DZkBMJfp-COYmkts2.js} +1 -1
- package/dist/assets/{AddToWalletPage-CyRfqVDB-DtRghMSs.js → AddToWalletPage-CyRfqVDB-DBl8NFrM.js} +1 -1
- package/dist/assets/{AddressRoutes-DbIoDD0z.js → AddressRoutes-i0umv5jA.js} +1 -1
- package/dist/assets/{AddressScreen-Duz_V-eF.js → AddressScreen-DApTkhik.js} +1 -1
- package/dist/assets/{AgingReportsPage-xBFff3BM-B936IQ2N.js → AgingReportsPage-xBFff3BM-CS2GTKN6.js} +1 -1
- package/dist/assets/{AiCfoScreen-DkKXC6Fw.js → AiCfoScreen-CFxFgebG.js} +1 -1
- package/dist/assets/{AllUserItems-BJf6WPDo-D0H1tMjG.js → AllUserItems-BJf6WPDo-Mh2XiQuz.js} +1 -1
- package/dist/assets/{ApAgingDetailPage-CjBrPyi8-Dy0hX-gn.js → ApAgingDetailPage-CjBrPyi8-BWEQvYgn.js} +1 -1
- package/dist/assets/{AppBasePage-CqDm-hnV-DluaESRo.js → AppBasePage-CqDm-hnV-DFjJyrbf.js} +1 -1
- package/dist/assets/{AppDrawerContent-CVVWj66i-D4zioU_X.js → AppDrawerContent-CVVWj66i-cHYP4oNj.js} +1 -1
- package/dist/assets/{ApprovalRulesSettingsPage-Cckd2uVA-Bu-mEOHu.js → ApprovalRulesSettingsPage-Cckd2uVA-B6-AYkhY.js} +1 -1
- package/dist/assets/{ArAgingChart-CBsqOd-4-CVCl4d59.js → ArAgingChart-CBsqOd-4-UPj4OnDk.js} +1 -1
- package/dist/assets/{ArAgingDetailPage-i7JObt60-CsyQx3rL.js → ArAgingDetailPage-i7JObt60-HLzHfSLq.js} +1 -1
- package/dist/assets/{AttachmentView-CzC4skJ3-D2ObdnK2.js → AttachmentView-CzC4skJ3-DHopBzZW.js} +1 -1
- package/dist/assets/{BalancesInsightWithToolTip-B6umvmgL-B94s6jgr.js → BalancesInsightWithToolTip-B6umvmgL-DHVUBayZ.js} +1 -1
- package/dist/assets/{BankAccountSection-Di4sF52j-BobhPzIF.js → BankAccountSection-Di4sF52j-zNwdSC-j.js} +1 -1
- package/dist/assets/{BankAccountWarningSection-Cled-2cR-CypxFFmY.js → BankAccountWarningSection-Cled-2cR-C-C4CgFY.js} +1 -1
- package/dist/assets/{BankConnectionsSettingsPage-Ccnzq7st-DGOhp4FX.js → BankConnectionsSettingsPage-Ccnzq7st-lI-ABkXZ.js} +1 -1
- package/dist/assets/{BillDetailPage-XXOwBfO1-DauaxUA2.js → BillDetailPage-XXOwBfO1-CdWlnw8n.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-S9Y_fMTz.js → BillPayApprovalRoutes-B2PD1uYA.js} +1 -1
- package/dist/assets/{BillPayApprovalRuleDetailPage-DFZ0csaT-1KbX_IY6.js → BillPayApprovalRuleDetailPage-DFZ0csaT-CYWOmV-D.js} +1 -1
- package/dist/assets/{BillPayApprovalRulesPage-COCypDcS-BjGZEACH.js → BillPayApprovalRulesPage-COCypDcS-DW3PLflc.js} +1 -1
- package/dist/assets/{BillPayPromoPage-DOE2YIqC-C8ApdrdB.js → BillPayPromoPage-DOE2YIqC-DtPeSVQz.js} +1 -1
- package/dist/assets/{BillPayRoutes-Bz92yFGI.js → BillPayRoutes-BNH0AMcb.js} +1 -1
- package/dist/assets/{BillPaySetUpPage-BCJbZDsV-BF2fTyNr.js → BillPaySetUpPage-BCJbZDsV-CkWADXOA.js} +1 -1
- package/dist/assets/{BillingSettingsPage-iImtlEmO-CBp1rdfh.js → BillingSettingsPage-iImtlEmO-DP1E2lvc.js} +1 -1
- package/dist/assets/{BillsBulkReviewDrawerPage-B11GWM_0-Crsw24X2.js → BillsBulkReviewDrawerPage-B11GWM_0-DbmnLq9U.js} +1 -1
- package/dist/assets/{BoxItem-Bxa1M4QU-BEQbjRW-.js → BoxItem-Bxa1M4QU-C_cwMPAw.js} +1 -1
- package/dist/assets/{BusinessVerificationPage-DSuJFoW1-mYZPYqnm.js → BusinessVerificationPage-DSuJFoW1-DeOUAbt5.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BlaiKu4I.js → BusinessVerificationPageScreen-Bl-5vp1w.js} +1 -1
- package/dist/assets/{BusyIndication-9zDqSKBP-WSsX6_uU.js → BusyIndication-9zDqSKBP-DJ3Vfbyo.js} +1 -1
- package/dist/assets/{CardNumberSubText-_ZZbaz_k-D2s6-wsQ.js → CardNumberSubText-_ZZbaz_k-BlPsWhfy.js} +1 -1
- package/dist/assets/{CashbackDetailPage-DAZXitLt-Dn6UduwT.js → CashbackDetailPage-DAZXitLt-CgTbLL9O.js} +1 -1
- package/dist/assets/{ChargeCardDetailPage-B1VIpASk-D0l4y1IR.js → ChargeCardDetailPage-B1VIpASk-DP05fMJ6.js} +1 -1
- package/dist/assets/{ChargeCardListPage-BOBepN-x-BtfglwWz.js → ChargeCardListPage-BOBepN-x-BdXPwP2x.js} +1 -1
- package/dist/assets/{ChargeCardListTable-YznzSsJo-KwncCUaT.js → ChargeCardListTable-YznzSsJo-DstpQqaj.js} +1 -1
- package/dist/assets/{ChargeCardPaymentHistoryPage--jOwsMla-DQFHZBZ2.js → ChargeCardPaymentHistoryPage--jOwsMla-O4pmiKbh.js} +1 -1
- package/dist/assets/{ChargeCardPromoPage-DIfakIOK-CUSVcG-Z.js → ChargeCardPromoPage-DIfakIOK-BZrA1EKm.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-PKJBtykP.js → ChargeCardRoutes-DEAS2W6j.js} +1 -1
- package/dist/assets/{ChargeCardSetupPage-0bpVkeJs-yW1xF9DG.js → ChargeCardSetupPage-0bpVkeJs-D0GFhYcn.js} +1 -1
- package/dist/assets/{ChargeCardStatementsPage-ChWyQlw6-BDnJUrTu.js → ChargeCardStatementsPage-ChWyQlw6-D184bwrU.js} +1 -1
- package/dist/assets/{CheckDepositDrawerPage-BS7hnyZn-C-RoPs-w.js → CheckDepositDrawerPage-BS7hnyZn-B4P5pcJ0.js} +1 -1
- package/dist/assets/{CollapsableReportTable-DNfFkAts-CoCUKzx3.js → CollapsableReportTable-DNfFkAts-CWXZiWkJ.js} +1 -1
- package/dist/assets/{CompanyOfficerDetailsSection-CrOIN4IW-wL1QY22J.js → CompanyOfficerDetailsSection-CrOIN4IW-DvuaTkO6.js} +1 -1
- package/dist/assets/{CompanyPassportCard-CkzYFTrp-DRHCWpeb.js → CompanyPassportCard-CkzYFTrp-CHeq443C.js} +1 -1
- package/dist/assets/{CompanyPassportPage-FE6yli6h-Dd4_9uh3.js → CompanyPassportPage-FE6yli6h-C5GRhZQI.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-BxfK5qi-.js → CompanyPassportScreen-DW2uvsaa.js} +1 -1
- package/dist/assets/{CompleteProfile-Cb8i1XgZ-BjB2Cj8T.js → CompleteProfile-Cb8i1XgZ-Dva3Z577.js} +1 -1
- package/dist/assets/{ConfettiBurst-BZCXEGYA-2D0_Pemr.js → ConfettiBurst-BZCXEGYA-DIkp5z2k.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-Wp_pgh6b.js → ConnectionAuthScreen-Cv2kgMPl.js} +1 -1
- package/dist/assets/{ConstrainedInnerElement-CgdnMeoA-CE1VZ_Vz.js → ConstrainedInnerElement-CgdnMeoA-LlisdtHN.js} +1 -1
- package/dist/assets/{CreateOrEditVendorPage-CzpSgxbO-k7E9cu5j.js → CreateOrEditVendorPage-CzpSgxbO-PvdVJUZ5.js} +1 -1
- package/dist/assets/{CreditCardPaymentDrawerPage-c_q0MsSO-dQfGXEwP.js → CreditCardPaymentDrawerPage-c_q0MsSO-BOiAgHoB.js} +1 -1
- package/dist/assets/{CurrencySelectField-BAh7SHrG-BY-wwlD4.js → CurrencySelectField-BAh7SHrG-BsFodvV2.js} +1 -1
- package/dist/assets/{CustomerOnboardingActivationPage-f3Aa6E5r-CsLUjIve.js → CustomerOnboardingActivationPage-f3Aa6E5r-BQCnyqe_.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-CTt5imV9.js +1 -0
- package/dist/assets/CustomerOnboardingContainerPage-CWAtSu08-B-QWGTWE.js +1 -0
- package/dist/assets/{CustomerOnboardingDetailPageSkeleton-DYuiWn8s-Cjt3eU6d.js → CustomerOnboardingDetailPageSkeleton-DYuiWn8s-yDo1E_es.js} +1 -1
- package/dist/assets/{CustomerOnboardingNoStepsPage-Bh_F0-oC-wTFuOqC8.js → CustomerOnboardingNoStepsPage-Bh_F0-oC-BvywdKwc.js} +1 -1
- package/dist/assets/{CustomerOnboardingPage-B9hSO88_-DWmXd-Uc.js → CustomerOnboardingPage-B9hSO88_-B7VeeYtq.js} +1 -1
- package/dist/assets/{CustomerOnboardingProductSuitePage-CG0HKCpQ-GHwnhZEx.js → CustomerOnboardingProductSuitePage-CG0HKCpQ-D8L1OoHO.js} +1 -1
- package/dist/assets/{CustomerOnboardingRoutes-liI38PH4.js → CustomerOnboardingRoutes-DkpEl7xR.js} +1 -1
- package/dist/assets/{Dashboard-BJ_oIHab-R3_sy9De.js → Dashboard-BJ_oIHab-bdJ9cQSe.js} +1 -1
- package/dist/assets/{DashboardReportPage-BemzMw2e-DvGvflyG.js → DashboardReportPage-BemzMw2e-CarBrWI5.js} +1 -1
- package/dist/assets/{DashboardRoutes-C7dEIbTS.js → DashboardRoutes-HcCANGzR.js} +1 -1
- package/dist/assets/{DashboardSidebarBackgroundAnimation-BtA5oEGG-DP44-3NB.js → DashboardSidebarBackgroundAnimation-BtA5oEGG-CnJGJPOM.js} +1 -1
- package/dist/assets/{DefaultTenantHome-CkG7rrVy.js → DefaultTenantHome-B00izDE9.js} +1 -1
- package/dist/assets/{DepositAccTransactionItem-CyFi1P_L-VEy51_-P.js → DepositAccTransactionItem-CyFi1P_L-_zu9sEHc.js} +1 -1
- package/dist/assets/{DepositAccTransactionListPage-DvBRRUdZ-FPrNb8c2.js → DepositAccTransactionListPage-DvBRRUdZ-DkbsDbqL.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-CgfzlsVD.js → DomesticWireDetailScreen-D2XofLzf.js} +1 -1
- package/dist/assets/{DomesticWireDetailsPage-DCDo3aHI-DZy_Auc2.js → DomesticWireDetailsPage-DCDo3aHI-DNAivMaH.js} +1 -1
- package/dist/assets/{DownloadOverlay-D_lL1sPW-DBEVtdkQ.js → DownloadOverlay-D_lL1sPW-CXcUoHg5.js} +1 -1
- package/dist/assets/{DrawerPage-DesxXhZk-qxdDcPRN.js → DrawerPage-DesxXhZk-J42eURwa.js} +1 -1
- package/dist/assets/{DrawerScreen-IScn_gPb.js → DrawerScreen-DtHtMz11.js} +1 -1
- package/dist/assets/{EditPeoplePage-QvPy_Six-pqhLCmsP.js → EditPeoplePage-QvPy_Six-BsGTj4sw.js} +1 -1
- package/dist/assets/{EditReimbursementDetailPage-C0ZDkboO-Ds7tBMbu.js → EditReimbursementDetailPage-C0ZDkboO-Zy0QEPVw.js} +1 -1
- package/dist/assets/{EntityDetailPage-l7nXIsyF-D-OEpTX_.js → EntityDetailPage-l7nXIsyF-gLIS1quB.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-DCBMx6-C.js → EntityDetailRoutes-7thpA8hT.js} +1 -1
- package/dist/assets/{EntitySummarySection-BwX0a4JL-CYDWshdA.js → EntitySummarySection-BwX0a4JL-CqtzqxH7.js} +1 -1
- package/dist/assets/{ExpenseAutomationOverviewPage-EdyHjbff-QECZrSJL.js → ExpenseAutomationOverviewPage-EdyHjbff-DGvFpjx8.js} +1 -1
- package/dist/assets/{ExpenseAutomationPage-DA22Qofw-QWboM4Rp.js → ExpenseAutomationPage-DA22Qofw-D0J1t88o.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-DVcJr4np.js → ExpenseAutomationRoutes-BZlrywi-.js} +1 -1
- package/dist/assets/{ExpressPayPage-EMP6inpX-C812vhu_.js → ExpressPayPage-EMP6inpX-CCsjlc8j.js} +1 -1
- package/dist/assets/{FeaturePreviewPage-SYJm-3aR-BnuhMtuP.js → FeaturePreviewPage-SYJm-3aR-BlpFYjD7.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-C3Y9pgiz.js → FeaturePreviewScreen-Bk9iW7O-.js} +1 -1
- package/dist/assets/{FollowStepsSection-BxESVqJD-BFhnhk7r.js → FollowStepsSection-BxESVqJD-B4YXiq5E.js} +1 -1
- package/dist/assets/{GlobalReviewListPage-D5_ACa-q-DZo6UglL.js → GlobalReviewListPage-D5_ACa-q-DixQI1AJ.js} +1 -1
- package/dist/assets/{InformationCardStack-B_qQUEYD-DRekqbq_.js → InformationCardStack-B_qQUEYD-BkeRCagH.js} +1 -1
- package/dist/assets/{InsightsCardStack-BsQzoVzj-BI_nQIXQ.js → InsightsCardStack-BsQzoVzj-gcpn2goe.js} +1 -1
- package/dist/assets/{InsightsSection-B6CNlTNH-BFr6MnTG.js → InsightsSection-B6CNlTNH-BbWu4CoQ.js} +1 -1
- package/dist/assets/{IntegrationsSettingsPage-DP6fAccq-CigqZ0SM.js → IntegrationsSettingsPage-DP6fAccq-DQlcVhcM.js} +1 -1
- package/dist/assets/{InternationalWireSwiftDetailsPage-VdG7bDZi-Rlu68XJQ.js → InternationalWireSwiftDetailsPage-VdG7bDZi-BYy836YQ.js} +1 -1
- package/dist/assets/{InternationalWireVerificationPage-COC6lZml-CR1f2JQF.js → InternationalWireVerificationPage-COC6lZml-CMFkOHr1.js} +1 -1
- package/dist/assets/{InviteFormPage-DN02jRy5-UECY6Ai9.js → InviteFormPage-DN02jRy5-yYyYYAXY.js} +1 -1
- package/dist/assets/{InvitePageListView-CP4K9tJi-CrsR5dUL.js → InvitePageListView-CP4K9tJi-DTtx4vPJ.js} +1 -1
- package/dist/assets/{InvitePeoplePage-VTM6kM1u-DEUyoj-n.js → InvitePeoplePage-VTM6kM1u-BbP41Ah4.js} +1 -1
- package/dist/assets/{InvoiceUploadSection-it-ZYl1N-gndqObmu.js → InvoiceUploadSection-it-ZYl1N-CCUfq98I.js} +1 -1
- package/dist/assets/{IssueChargeCardPage-CVfuvGey-DLZauQU0.js → IssueChargeCardPage-CVfuvGey-B1ov-u3j.js} +1 -1
- package/dist/assets/{LabeledAddressValue-DDrQcHIE-CrQXufeN.js → LabeledAddressValue-DDrQcHIE-CbyeJIn7.js} +1 -1
- package/dist/assets/{LabeledAddressValueField-BgWwd5Gw-BjdQu4oY.js → LabeledAddressValueField-BgWwd5Gw-OwNJCJIh.js} +1 -1
- package/dist/assets/{LabeledControlledCheckBoxField-CcPO1k23-wgZTidrw.js → LabeledControlledCheckBoxField-CcPO1k23-DPvpZEVi.js} +1 -1
- package/dist/assets/{LabeledCountryMultiSelectField-BYYjzwUG-Dh1nhUsB.js → LabeledCountryMultiSelectField-BYYjzwUG-L1R0Hv-k.js} +1 -1
- package/dist/assets/{LabeledCreatableSingleSelectField-CISYMojq-C0CA90PE.js → LabeledCreatableSingleSelectField-CISYMojq-C-aCk7rm.js} +1 -1
- package/dist/assets/{LabeledDocumentField-C_bcFxdY-rxfuitkN.js → LabeledDocumentField-C_bcFxdY-T4bTBndm.js} +1 -1
- package/dist/assets/{LabeledDropDownFormattedTextField-ScGGCap8-5XDDElAU.js → LabeledDropDownFormattedTextField-ScGGCap8-zRBCNCAK.js} +1 -1
- package/dist/assets/{LabeledEmailInputField-BppuWRbl-BqM5ToGw.js → LabeledEmailInputField-BppuWRbl-rYJIUMBy.js} +1 -1
- package/dist/assets/{LabeledNameField-mxSNQk3k-DSUzbE3j.js → LabeledNameField-mxSNQk3k-BwZireNV.js} +1 -1
- package/dist/assets/{LabeledSingleSelectField-C6ctNzkA-DJY2_gU-.js → LabeledSingleSelectField-C6ctNzkA-DmsB82vW.js} +1 -1
- package/dist/assets/{LabeledText-C8Y7EOsX-BG8Z0MTH.js → LabeledText-C8Y7EOsX-DwTQVJVt.js} +1 -1
- package/dist/assets/{LabeledUserSingleSelectWithSubtitlesField-C8JxAcOT-eV0BTiQT.js → LabeledUserSingleSelectWithSubtitlesField-C8JxAcOT-DKqlyQmJ.js} +1 -1
- package/dist/assets/{LabeledZeniRolesDropDownField-BZtreVpj-BQKcvtGQ.js → LabeledZeniRolesDropDownField-BZtreVpj-C0kqEM3_.js} +1 -1
- package/dist/assets/{LinkJETransactionPage-CKq4oiX9-BMq1iE01.js → LinkJETransactionPage-CKq4oiX9-CQarkUoE.js} +1 -1
- package/dist/assets/{LockCardPage-CZENNby7-fCE1WXTx.js → LockCardPage-CZENNby7-Cee2SE9c.js} +1 -1
- package/dist/assets/{LowBalancePopup-1727S1ri-CiFxrWZ6.js → LowBalancePopup-1727S1ri-f2rHahyZ.js} +1 -1
- package/dist/assets/{MagicLinkACHDetailsPage-BSOlSfNu-C5Jji5Bc.js → MagicLinkACHDetailsPage-BSOlSfNu-BT_MNQgV.js} +1 -1
- package/dist/assets/{MagicLinkDomesticWireDetailsPage-D1DTPo0E-DNJbU9wA.js → MagicLinkDomesticWireDetailsPage-D1DTPo0E-BbiHs6vy.js} +1 -1
- package/dist/assets/{MagicLinkInternationalWireDetailsPage-D_wo_2nm-BDPVvMNI.js → MagicLinkInternationalWireDetailsPage-D_wo_2nm-R0--su1U.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-BBf-u6YU.js → MagicLinkRoutes-BRfw_LFb.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-BGYMIMGW.js → MagicLinkSignInScreen-BgXb-Qsc.js} +1 -1
- package/dist/assets/{MagicLinkSuccessPage-QMkZgQLG-0gaJkIUo.js → MagicLinkSuccessPage-QMkZgQLG-CRVTSvm-.js} +1 -1
- package/dist/assets/{MagicLinkTitleSection-CARU1oLQ-D-x2cYul.js → MagicLinkTitleSection-CARU1oLQ-mlVnAW2-.js} +1 -1
- package/dist/assets/{MailingDetailsSection-ByOPaJ05-C__aFJd6.js → MailingDetailsSection-ByOPaJ05-7jrl2Qgx.js} +1 -1
- package/dist/assets/{MobileAppDrawer-TF-9OTZ8.js → MobileAppDrawer-D6zuu_M2.js} +1 -1
- package/dist/assets/{MoreMenuButton-BsBKwXvk-DeCIVX9G.js → MoreMenuButton-BsBKwXvk-Bfmamp7e.js} +1 -1
- package/dist/assets/{MyBankConnectionsSettingsPage-BdgIIhL1-DSKnFya9.js → MyBankConnectionsSettingsPage-BdgIIhL1-DPhfXAPl.js} +1 -1
- package/dist/assets/{MyPendingActivationChargeCardListPage-CX38bDdq-CKY6khDW.js → MyPendingActivationChargeCardListPage-CX38bDdq-CqboqotB.js} +1 -1
- package/dist/assets/{MyProfileSettingsPage-DYu0Fx6I-MQ1Uu5yx.js → MyProfileSettingsPage-DYu0Fx6I-BqnUbVc5.js} +1 -1
- package/dist/assets/{NavBarWithPicker-CGGEvLwe-xLu9BDbC.js → NavBarWithPicker-CGGEvLwe-CUbmEgtr.js} +1 -1
- package/dist/assets/{NavigationArrow-CTNkKUtV-Cv--eO3H.js → NavigationArrow-CTNkKUtV-C6GHmmzo.js} +1 -1
- package/dist/assets/{NavigationDots-Dvce3gHt-B5IBT8ql.js → NavigationDots-Dvce3gHt-DW4VxzwL.js} +1 -1
- package/dist/assets/{NewGlobalMerchantPage-D_f7z47T-DZeAHBD8.js → NewGlobalMerchantPage-D_f7z47T-cf9nYDBn.js} +1 -1
- package/dist/assets/{NoDataChart-CrKeqWSr-aTXx8C4D.js → NoDataChart-CrKeqWSr-G74DMHNg.js} +1 -1
- package/dist/assets/{NoDataTable-4vPXmPYF-MAxQ6k5D.js → NoDataTable-4vPXmPYF-CaxZ13RD.js} +1 -1
- package/dist/assets/{NotFoundPage-BLWPU1wU-BDFevjLh.js → NotFoundPage-BLWPU1wU-tisGDcv0.js} +1 -1
- package/dist/assets/{NotFoundScreen-BOQb1xUE.js → NotFoundScreen-ikiXbHj3.js} +1 -1
- package/dist/assets/{NotificationRoutes-CHyP48D4.js → NotificationRoutes-DwbPSzN6.js} +1 -1
- package/dist/assets/{NotificationSettingsPage-CDiDLX3A-CdiPU3_w.js → NotificationSettingsPage-CDiDLX3A-A5SrSjVk.js} +1 -1
- package/dist/assets/{NotificationsListConfig-B5pDa4cJ-C0GWEb8S.js → NotificationsListConfig-B5pDa4cJ-rP783D2h.js} +1 -1
- package/dist/assets/{NotificationsPage-Ccl7Dny1-CsnU2sZr.js → NotificationsPage-Ccl7Dny1-DcuX4J1G.js} +1 -1
- package/dist/assets/{OpExByVendorPage-spd-nKV4-Cz37eGG7.js → OpExByVendorPage-spd-nKV4-FzoKQPOl.js} +1 -1
- package/dist/assets/{OverlayContainerPage-BG9y5C0t-DvO1fY_N.js → OverlayContainerPage-BG9y5C0t-Cc20iSRQ.js} +1 -1
- package/dist/assets/{PandLWithForecastPage-TSoe4Z7F-xn1jaFoi.js → PandLWithForecastPage-TSoe4Z7F-BNeJQ7Xo.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DWeIYgqG.js → PandLWithForecastRoutes-VAcw1HSG.js} +1 -1
- package/dist/assets/{PaymentAccountSetupBillingAddressSection-9ma8SpIa-BDBHBe3a.js → PaymentAccountSetupBillingAddressSection-9ma8SpIa-CW2iadXX.js} +1 -1
- package/dist/assets/{PeoplePage-b5_I0qOw-lWi2XLJ6.js → PeoplePage-b5_I0qOw-ht3-9ADb.js} +1 -1
- package/dist/assets/{PeopleRoutes-D96ZRShY.js → PeopleRoutes-DmpmiR4Z.js} +1 -1
- package/dist/assets/{PerformanceRoutes-w_Iip8ae.js → PerformanceRoutes-CZmcoZOr.js} +1 -1
- package/dist/assets/{Preview-C2zvk1tu.js → Preview-DpEarlTH.js} +1 -1
- package/dist/assets/{ProductsCarousel-C3M0ocdF-2raBZnNq.js → ProductsCarousel-C3M0ocdF-yvCtS1oI.js} +1 -1
- package/dist/assets/{PromoBaseCards-BOGJI2ws-Cm4e0wPQ.js → PromoBaseCards-BOGJI2ws-sgQWsMLW.js} +1 -1
- package/dist/assets/{QBOConnectionDialog-CmpnnuzP-BhhJabU7.js → QBOConnectionDialog-CmpnnuzP-DNy9QKqs.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CCeXLrlB.js → QBOConnectionScreen-n9RNm4Ls.js} +1 -1
- package/dist/assets/{QBOSetupSection-DjnN9dgv-6umyaC6d.js → QBOSetupSection-DjnN9dgv-DYaHb-KP.js} +1 -1
- package/dist/assets/{ReferralListScreen-DY8vZLmY.js → ReferralListScreen-Cah_P_FB.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-kgV17rI7.js → ReimbursementApprovalRoutes-D33t4DVj.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailPage-D5NXjrO9-Bjrjwfbm.js → ReimbursementApprovalRuleDetailPage-D5NXjrO9-DA3N1XGv.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CrQlcAIE.js → ReimbursementApprovalRuleDetailScreen-Dc9f9QId.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRulesPage-BsCTIqUJ-CQyWyznw.js → ReimbursementApprovalRulesPage-BsCTIqUJ-BADCjAFQ.js} +1 -1
- package/dist/assets/{ReimbursementDetailPage-BbyxE2uL-DAWO6MN3.js → ReimbursementDetailPage-BbyxE2uL-a3uiU3Ob.js} +1 -1
- package/dist/assets/{ReimbursementPromoPage-CyEgwqcf-D5kNu4r7.js → ReimbursementPromoPage-CyEgwqcf-CLeGQPDO.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-9PVCls-1.js → ReimbursementRoutes-CtJbALZM.js} +1 -1
- package/dist/assets/{ReimbursementSetUpPage-RETPkEQd-zKPq6P2O.js → ReimbursementSetUpPage-RETPkEQd-DD6LwTIt.js} +1 -1
- package/dist/assets/{ReimbursementsBulkReviewDrawerPage-DnmYl0FM-Cp5RXmHi.js → ReimbursementsBulkReviewDrawerPage-DnmYl0FM-DQZjFSjr.js} +1 -1
- package/dist/assets/{ReloadCard-Bdoo0XiI-CgAT4eqC.js → ReloadCard-Bdoo0XiI-BYCbbFTr.js} +1 -1
- package/dist/assets/{ReportTableViewSelector-Bc1K7mU_-CRH7B2Xe.js → ReportTableViewSelector-Bc1K7mU_-DUQ4nq8T.js} +1 -1
- package/dist/assets/{ReportsPage-BOTHMLWh-DYARtx-l.js → ReportsPage-BOTHMLWh-CeYEhfQ6.js} +1 -1
- package/dist/assets/{ReportsRoutes-DAq_Kk7t.js → ReportsRoutes-Frsi-Q8Y.js} +1 -1
- package/dist/assets/{RevenueChart-DvyZ3aO7-D41DyD4f.js → RevenueChart-DvyZ3aO7-Bd1tqtpy.js} +1 -1
- package/dist/assets/{ReviewDetailsPage-BIMg1n2e-w51F2KtJ.js → ReviewDetailsPage-BIMg1n2e-yv64CAZS.js} +1 -1
- package/dist/assets/{ReviewOverlay-CxwoiOLC-C8uqNFMN.js → ReviewOverlay-CxwoiOLC-Cd9Dp_pi.js} +1 -1
- package/dist/assets/{RewardsRoutes-2CDMw_SM.js → RewardsRoutes-CrrVzM3-.js} +1 -1
- package/dist/assets/{RoleWithToolTip-Ct3_VuDM-zYFjvA-a.js → RoleWithToolTip-Ct3_VuDM-DhtqjWvU.js} +1 -1
- package/dist/assets/{ScheduleDetailsFixedAssetsPage-DiL5Dozk-DjOTIJE4.js → ScheduleDetailsFixedAssetsPage-DiL5Dozk-DludZhWE.js} +1 -1
- package/dist/assets/{ScheduleDetailsPage-5FWpLRtd-DdkQQcuL.js → ScheduleDetailsPage-5FWpLRtd-CEoz8_x8.js} +1 -1
- package/dist/assets/{ScheduleSequenceTable-R3-PsXES-F_YuqAKO.js → ScheduleSequenceTable-R3-PsXES-CrwCgbwO.js} +1 -1
- package/dist/assets/{ScreenRoutes-D-VUXgUA.js → ScreenRoutes-C63hP5Jd.js} +2 -2
- package/dist/assets/{SetUpAccountSection-CctbMmoK-BIwzDeUn.js → SetUpAccountSection-CctbMmoK-CrAp2Rha.js} +1 -1
- package/dist/assets/{SettingsRoutes-BCFW0mUs.js → SettingsRoutes-DS8pR7BM.js} +1 -1
- package/dist/assets/{SetupPagesScreen-D_H5m3yT.js → SetupPagesScreen-DMeRMOUQ.js} +1 -1
- package/dist/assets/{SignIn-CmgmnRm4-BefvH7_D.js → SignIn-CmgmnRm4-CLeKP_mg.js} +1 -1
- package/dist/assets/{SignInScreen-DNDiNfUZ.js → SignInScreen-9kJpSL2F.js} +1 -1
- package/dist/assets/{SignOutScreen-CGgsrBqm.js → SignOutScreen-Bl46PB7k.js} +1 -1
- package/dist/assets/{SpendManagementListViewPage-CFUxCqkU-DWVJ8T34.js → SpendManagementListViewPage-CFUxCqkU-BWMLeiXB.js} +3 -3
- package/dist/assets/{SpendManagementPerTabPage-C-kqNTci-61EpQHHf.js → SpendManagementPerTabPage-C-kqNTci-DpdXSMEn.js} +1 -1
- package/dist/assets/{SpendManagementSection-CIz4nE_w-CLtvB3Jo.js → SpendManagementSection-CIz4nE_w-EjDUgL9k.js} +1 -1
- package/dist/assets/{StatementItem-vVtoBN2w-CGfe2rf-.js → StatementItem-vVtoBN2w-CNjZ6vSP.js} +1 -1
- package/dist/assets/{StatementsPage-As5WOnMR-C07ZcwWR.js → StatementsPage-As5WOnMR-DNxGulXT.js} +1 -1
- package/dist/assets/{StatusSwitcher-Bv-ozN6U-BMGDezKv.js → StatusSwitcher-Bv-ozN6U-C5Nu_MEh.js} +1 -1
- package/dist/assets/{SubTabSwitcher-D7QeM6nb-C5vo1QLg.js → SubTabSwitcher-D7QeM6nb-Bd7HbwXr.js} +1 -1
- package/dist/assets/{SuccessAnimation-hijccO_0-CXGCZdn9.js → SuccessAnimation-hijccO_0-C5KKfhSL.js} +1 -1
- package/dist/assets/{SummaryCard-C2qoTsAY-LkZgmc3l.js → SummaryCard-C2qoTsAY-DRgZWvFQ.js} +1 -1
- package/dist/assets/{TaskDetailPage-QMk4DTDK-DuNonnMy.js → TaskDetailPage-QMk4DTDK-CzxOHbSw.js} +1 -1
- package/dist/assets/{TaskListScreen-DXCPcaMg.js → TaskListScreen-WJ_oZff3.js} +1 -1
- package/dist/assets/{TaskManagementPage-BJwp32Ph-D-u68mRD.js → TaskManagementPage-BJwp32Ph-DQqYstM3.js} +1 -1
- package/dist/assets/{TaskRoutes-Biii2LFo.js → TaskRoutes-KVOJeUTF.js} +1 -1
- package/dist/assets/{TimeRangeSwitcher-D00bDDhP-BG1zi2IK.js → TimeRangeSwitcher-D00bDDhP-B7Ov8u4I.js} +1 -1
- package/dist/assets/{TimeframeSwitcher-DA99HdHt-BQziHQmj.js → TimeframeSwitcher-DA99HdHt-DpnlgY1W.js} +1 -1
- package/dist/assets/{TimeframeSwitcherWithToggle-DyggDIQj-BfhUUfrK.js → TimeframeSwitcherWithToggle-DyggDIQj-dXidpIRI.js} +1 -1
- package/dist/assets/{TopExCard-Z1WabZ8c-CBwSMJxd.js → TopExCard-Z1WabZ8c-sEidG-Jj.js} +1 -1
- package/dist/assets/{TopExDetailPage-CzHG4f9E-gwAj-hq_.js → TopExDetailPage-CzHG4f9E-BHJTdjtp.js} +1 -1
- package/dist/assets/{TransactionActivityLogPage-CGKnjNfU-BApvDmwN.js → TransactionActivityLogPage-CGKnjNfU-CfLMExSb.js} +1 -1
- package/dist/assets/{TransactionDetailPage-1-mLOWSz-rzQ235mE.js → TransactionDetailPage-1-mLOWSz-DcOhNptF.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-C36yIgf5.js → TransactionDetailRoutes-dBKV5I0G.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-B9QxqSWW.js → TransactionDetailScreen-vq5zw3s_.js} +1 -1
- package/dist/assets/{TransactionList-BB-xoIGm-Cfa3U35Q.js → TransactionList-BB-xoIGm-VG7PQewQ.js} +1 -1
- package/dist/assets/{TransactionListBig-C5Sf5Xh--ILOBUs5F.js → TransactionListBig-C5Sf5Xh--DoCKCPqR.js} +1 -1
- package/dist/assets/{TransactionListPage-Cj7h1Ros-C0trpcRO.js → TransactionListPage-Cj7h1Ros-v78cTbWl.js} +1 -1
- package/dist/assets/{TransactionListRoutes-DYDLTelW.js → TransactionListRoutes-B8c0yDN7.js} +1 -1
- package/dist/assets/{TransactionVendorDetailPage-SsrSOk3O-DvVZeIE6.js → TransactionVendorDetailPage-SsrSOk3O-CQRR7Gxj.js} +1 -1
- package/dist/assets/{TransferDrawerPage-BvKZ7vHF-gusMX693.js → TransferDrawerPage-BvKZ7vHF-DhOO5Djd.js} +1 -1
- package/dist/assets/{TreasuryOverviewPage-DwvjMR4_-v_PwtYfB.js → TreasuryOverviewPage-DwvjMR4_-Dy5JtyPY.js} +1 -1
- package/dist/assets/{TreasuryPromoPage-CtTFvSQW-CBUcln_7.js → TreasuryPromoPage-CtTFvSQW-DDzc-yUe.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BL7M49IT.js → TreasuryRoutes-BjirOq5w.js} +1 -1
- package/dist/assets/{TreasuryStatementsPage-Catz8shX-B10cgIs5.js → TreasuryStatementsPage-Catz8shX-BLfZBc5X.js} +1 -1
- package/dist/assets/{TreasuryTaxLetterPage-D8hzCL5o-8bU6d1vy.js → TreasuryTaxLetterPage-D8hzCL5o-B24wpuDP.js} +1 -1
- package/dist/assets/{TrendChart-Bnp4Pcdf-CsoTufL2.js → TrendChart-Bnp4Pcdf-DyT9Pbcv.js} +1 -1
- package/dist/assets/{TrendWithTransactions-3D1FvM8G-Dwn_v3ES.js → TrendWithTransactions-3D1FvM8G-DbCHqjUQ.js} +1 -1
- package/dist/assets/{UncategorizedAccountsMappingPage-DbyY-dYB-DJ-xU1nq.js → UncategorizedAccountsMappingPage-DbyY-dYB-DDygYAcn.js} +1 -1
- package/dist/assets/{UnitIntegrationPage-CTzme1te-Kzmir-JV.js → UnitIntegrationPage-CTzme1te-E-PRVs2f.js} +1 -1
- package/dist/assets/{UploadAdditionalDocumentOverlay-Wl4Spdpn-vi85vqk-.js → UploadAdditionalDocumentOverlay-Wl4Spdpn-t6sc9Jy9.js} +1 -1
- package/dist/assets/{Vendor2FAPopup-D0zYKkIv-Corqbsks.js → Vendor2FAPopup-D0zYKkIv-CcCDxzpN.js} +1 -1
- package/dist/assets/{VendorACHDetailsPage-YYX9aQdw-DWmocppw.js → VendorACHDetailsPage-YYX9aQdw-Xgtau_lZ.js} +1 -1
- package/dist/assets/{VendorDetailPage-Br9wIOnI-D1eJIjzb.js → VendorDetailPage-Br9wIOnI-Dvn8_zNT.js} +1 -1
- package/dist/assets/{VendorDomesticWireDetailsPage-BpPgQRHI-BpbupYob.js → VendorDomesticWireDetailsPage-BpPgQRHI-BGGIbVgJ.js} +1 -1
- package/dist/assets/{VendorFiling1099EditablePage-himC7iD3-DuTr9_9d.js → VendorFiling1099EditablePage-himC7iD3-B4nRVhEz.js} +1 -1
- package/dist/assets/{VendorFirstReviewPage-BbknTCBD-DB1g9Qot.js → VendorFirstReviewPage-BbknTCBD-DMZtHaZD.js} +1 -1
- package/dist/assets/{VendorInternationalWireDetailsPage-CS595Xgc-CmEESHX6.js → VendorInternationalWireDetailsPage-CS595Xgc-DVL2WVbJ.js} +1 -1
- package/dist/assets/{VendorInternationalWireSwiftDetailsPage-yhTjWXvw-D43LaVfJ.js → VendorInternationalWireSwiftDetailsPage-yhTjWXvw-DXzCK7R2.js} +1 -1
- package/dist/assets/{VendorsAccountsSection-CgSJu8wq-CW2zmnnP.js → VendorsAccountsSection-CgSJu8wq-Br9V_xZx.js} +1 -1
- package/dist/assets/{VendorsRoutes-C4N6gRBp.js → VendorsRoutes-wqogIAiJ.js} +1 -1
- package/dist/assets/{VerifyDevice-Dvf0JsNN-CSGpw0v_.js → VerifyDevice-Dvf0JsNN-C8PIVnmh.js} +1 -1
- package/dist/assets/{VideoPlayer-VAzOGCDL-BYL37uoQ.js → VideoPlayer-VAzOGCDL-CQ-F6ZYB.js} +1 -1
- package/dist/assets/{VideoPopup-BqvZ-XIh-DBw1PWZ3.js → VideoPopup-BqvZ-XIh-BRa78_cs.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-DNU9Mqxk.js → WiseConfirmationScreen-fmoJ8aym.js} +1 -1
- package/dist/assets/{ZeniAccountDetailPage-GcwTJdB8-_6oIn_wc.js → ZeniAccountDetailPage-GcwTJdB8-CFcHGro5.js} +1 -1
- package/dist/assets/{ZeniAccountListViewPage-CdwO0Duy-G5U6kbnQ.js → ZeniAccountListViewPage-CdwO0Duy-BIEpP_x1.js} +1 -1
- package/dist/assets/{ZeniAccountNavBarPieces-BrSIfL36-CgdxCVoA.js → ZeniAccountNavBarPieces-BrSIfL36-mbWADvrC.js} +1 -1
- package/dist/assets/{ZeniAccountPromoPage-JrcedQYB-BtfY6t2a.js → ZeniAccountPromoPage-JrcedQYB-CoLzZRX3.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-uUgaZh13.js → ZeniAccountRoutes-BEMe66tt.js} +1 -1
- package/dist/assets/{ZeniAccountSetupPage-TKBfbgzJ-Ovrdcrt5.js → ZeniAccountSetupPage-TKBfbgzJ-AFFqmHLs.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-CPFcfx6A.js → ZeniAccountStatementScreen-D26Qkk4B.js} +1 -1
- package/dist/assets/{ZeniAvatar-Bzhq25CU-DO1x3yqH.js → ZeniAvatar-Bzhq25CU-B99_6YEt.js} +1 -1
- package/dist/assets/{ZeniCopyright-DglqrTpl-iRqjfc19.js → ZeniCopyright-DglqrTpl-DZ7269q9.js} +1 -1
- package/dist/assets/{ZeniDatePicker-BHXPxPnI-CRe89Wst.js → ZeniDatePicker-BHXPxPnI-3TUixdQt.js} +1 -1
- package/dist/assets/{ZeniTransferAmountSlider-BcaZZuAw-BeVI8Qc_.js → ZeniTransferAmountSlider-BcaZZuAw-Txv0Xrn5.js} +1 -1
- package/dist/assets/{accountMappingHelper-BVO1DeGB.js → accountMappingHelper-DG-4_iJq.js} +1 -1
- package/dist/assets/{add-to-wallet-DgdBD8_G-CV8RMwhX.js → add-to-wallet-DgdBD8_G-DgIZrzUE.js} +1 -1
- package/dist/assets/{analytics-CZ3wLx3P.js → analytics-5lp27QV6.js} +1 -1
- package/dist/assets/{analyticsHelper-CAYdbjhS-CB8PHHr8.js → analyticsHelper-CAYdbjhS-Mdn5LyGO.js} +1 -1
- package/dist/assets/{analyticsHelper-RqmdZ4w4.js → analyticsHelper-YBzaJab4.js} +1 -1
- package/dist/assets/{arrow-south-east-round-PEovUgvH-DB6pjtdO.js → arrow-south-east-round-PEovUgvH-CJ4vNxl8.js} +1 -1
- package/dist/assets/{auto-transfer-rule-mbafm5D3-CrxycPHV.js → auto-transfer-rule-mbafm5D3-DRWIqF2E.js} +1 -1
- package/dist/assets/{avatar-Dz7aEm3d-B1h__iIh.js → avatar-Dz7aEm3d-DP6fbxRB.js} +1 -1
- package/dist/assets/{bank-letter-BOcVjN6J-B0RfZgcz.js → bank-letter-BOcVjN6J-DycrnP8v.js} +1 -1
- package/dist/assets/{calculateSize-B2w5JPEU-BqvYgtxt.js → calculateSize-B2w5JPEU-BEy6I0xe.js} +1 -1
- package/dist/assets/{chartTypes-CD3vrBsI-4eICteeW.js → chartTypes-CD3vrBsI-tT4Uc4OB.js} +1 -1
- package/dist/assets/{clock-CJkylEKt-o4osYW2f.js → clock-CJkylEKt-CFJ24M_y.js} +1 -1
- package/dist/assets/{common-BpxEACHl-SqfXrkK_.js → common-BpxEACHl-DJrchDx2.js} +1 -1
- package/dist/assets/{commonDimensions-Oz1tdAcx-Cf4qEJmU.js → commonDimensions-Oz1tdAcx-BqTGlffv.js} +1 -1
- package/dist/assets/{commonTypes-5tEXwrX4-F6mC0EfI.js → commonTypes-5tEXwrX4-CWUtm8pk.js} +1 -1
- package/dist/assets/{core-CVVdXRky.js → core-Bup_6r8s.js} +1 -1
- package/dist/assets/{dash.all.min-C2vle8BQ.js → dash.all.min-Bm2mSDc0.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Da8IsQO4.js → decodeURIComponentSafe-DN4PY86A.js} +1 -1
- package/dist/assets/{dnd-CcRW__D6.js → dnd-6DI5OLjD.js} +1 -1
- package/dist/assets/{dollar-round-D18u7nlm-BkHqkGHG.js → dollar-round-D18u7nlm-D-YAdqzN.js} +1 -1
- package/dist/assets/{downloadPdf-Dsuxeias-CPZEuUrl.js → downloadPdf-Dsuxeias-Bh_UlPCl.js} +1 -1
- package/dist/assets/{empty-M26y6UyA.js → empty-DaEjrIPL.js} +1 -1
- package/dist/assets/{empty-BHbH22vT.js → empty-pzpqBeQU.js} +1 -1
- package/dist/assets/{epic-CiCSO3K5.js → epic-DfsKOE3-.js} +1 -1
- package/dist/assets/{filter-cZIFUNvj-BeqNUW3e.js → filter-cZIFUNvj-DpLTtq1K.js} +1 -1
- package/dist/assets/{getLocaleForTenant-DBVI4ovb.js → getLocaleForTenant-BUtXm3SM.js} +1 -1
- package/dist/assets/{gift-box-Cmt9OgIZ-CR0qdQnT.js → gift-box-Cmt9OgIZ-CF-m_VkT.js} +1 -1
- package/dist/assets/{graphic-no-data-l-DU4J8fDt-CslJm2fU.js → graphic-no-data-l-DU4J8fDt-6cwGHfUj.js} +1 -1
- package/dist/assets/{graphic-no-data-net-burn-l-CzmycA0m-Cj977U7E.js → graphic-no-data-net-burn-l-CzmycA0m-CyAeI3ri.js} +1 -1
- package/dist/assets/{handshake-BPg58FML-tq0X0Kiz.js → handshake-BPg58FML-MIOutm04.js} +1 -1
- package/dist/assets/{helper-Ckm10Uko-U81O1HXL.js → helper-Ckm10Uko-CASYaqd_.js} +1 -1
- package/dist/assets/{hyperlink-DQyCeXx2-D504LM2b.js → hyperlink-DQyCeXx2-CW4eETGG.js} +1 -1
- package/dist/assets/{index-jI4vB8VC.js → index-Br5jO2cX.js} +1 -1
- package/dist/assets/{index-uxYir9Bm.js → index-By1nWfzb.js} +1 -1
- package/dist/assets/{index-BngCC-zG.js → index-CpaD5zWS.js} +6 -6
- package/dist/assets/{index-DiKwyzh3.js → index-Doj_Dvf5.js} +1 -1
- package/dist/assets/{index-ClO_SXUU.js → index-DqxDpr80.js} +1 -1
- package/dist/assets/{index-BZOQWoRX.js → index-Dzd5jEzs.js} +1 -1
- package/dist/assets/{lexical-DPtIv0jk.js → lexical-cxjQsXy3.js} +1 -1
- package/dist/assets/{liveblocks-CHs9GmLG.js → liveblocks-DC1MsMik.js} +1 -1
- package/dist/assets/{lottie-D68Xb3aQ.js → lottie-BQVzdLy7.js} +1 -1
- package/dist/assets/{mapLoadingInProgressToTreeNode-jcHEi-mv-cRyD83dc.js → mapLoadingInProgressToTreeNode-jcHEi-mv-UiIaPjU8.js} +1 -1
- package/dist/assets/{mapSectionWithAcOnlyToTreeNode-Cgyt68f3-C2AYKRBA.js → mapSectionWithAcOnlyToTreeNode-Cgyt68f3-VmgA45AR.js} +1 -1
- package/dist/assets/{mapSpacerToTreeNode-XgUp1xUb-VRJ6un-L.js → mapSpacerToTreeNode-XgUp1xUb-BelX8Fbk.js} +1 -1
- package/dist/assets/{mapTimeframeBalancesToTreeNode-Bre8FfBF-XT9mQqpQ.js → mapTimeframeBalancesToTreeNode-Bre8FfBF-D5DrZE9V.js} +1 -1
- package/dist/assets/{mapTimeframeBalancesToTreeNode-DOyCX6ij-CGvd2Wmc.js → mapTimeframeBalancesToTreeNode-DOyCX6ij-DI0yRMub.js} +1 -1
- package/dist/assets/{mapTimeframeHeaderLoadingInProgressToTreeNode-D2IvFyR5-BVVmyoym.js → mapTimeframeHeaderLoadingInProgressToTreeNode-D2IvFyR5-Deecbpwe.js} +1 -1
- package/dist/assets/{media-player-D-MhIu5T.js → media-player-CQ6yBzQ2.js} +2 -2
- package/dist/assets/{money-2cg1MuG4-DZxnWrWu.js → money-2cg1MuG4-B3FwBIwT.js} +1 -1
- package/dist/assets/{mui-DyGc7Pg8.js → mui-CrML1f8O.js} +1 -1
- package/dist/assets/{page-detail-CWX5S47F-CXX81aXy.js → page-detail-CWX5S47F-14Y1GYN1.js} +1 -1
- package/dist/assets/{page-summary-D7_VQHwN-V_V9hbFl.js → page-summary-D7_VQHwN-g6tBufQw.js} +1 -1
- package/dist/assets/{panelSelectedMixin-Cddsb26L-bdcPTs-R.js → panelSelectedMixin-Cddsb26L-Anmi9mqw.js} +1 -1
- package/dist/assets/{pathToGoBack-CsNBJVc2.js → pathToGoBack-DeYc4T8U.js} +1 -1
- package/dist/assets/{pdf-BxqSCr4b.js → pdf-70cGw_kx.js} +3 -3
- package/dist/assets/{pdf-lib-jHogAi_2.js → pdf-lib-DL3pvGjy.js} +1 -1
- package/dist/assets/{plaid-xWfKHEqu.js → plaid-DUNGunmx.js} +1 -1
- package/dist/assets/{pusher-pngVK7xY.js → pusher-DKklLNX6.js} +1 -1
- package/dist/assets/{radio-default-CiSgisfh-sLqGTxQv.js → radio-default-CiSgisfh-RS3VdzyB.js} +1 -1
- package/dist/assets/{react-DyZ9MM_3.js → react-BDHQfx9m.js} +3 -3
- package/dist/assets/{react-B3z4onjT.js → react-CKGaejfg.js} +1 -1
- package/dist/assets/{react-BC4BTRLG.js → react-Ca8D4O0H.js} +1 -1
- package/dist/assets/{react-BuoJ-wtg.js → react-Ch54ajFj.js} +1 -1
- package/dist/assets/{react-DpxbyLPn.js → react-CwmRDC4k.js} +1 -1
- package/dist/assets/{react-BElDOWJc.js → react-D0OY7EyT.js} +1 -1
- package/dist/assets/{react-mv5GPJR4.js → react-DT2HJ4dl.js} +1 -1
- package/dist/assets/{react-CuUL9Ybl.js → react-EWoztr7a.js} +1 -1
- package/dist/assets/{recharts-CMjB5mmq.js → recharts-CtJQnN36.js} +1 -1
- package/dist/assets/{routePaths-B2Ez8xiG.js → routePaths-BjVGjzDi.js} +1 -1
- package/dist/assets/{sentry-CHlUi953.js → sentry-ByK32NK-.js} +1 -1
- package/dist/assets/{shield-DOlUxcFf-u1WG480f.js → shield-DOlUxcFf-BbNjyTlv.js} +1 -1
- package/dist/assets/{spend-limit-D6SyboD4-DKcfJ6au.js → spend-limit-D6SyboD4-uBFgkcqC.js} +1 -1
- package/dist/assets/{toCOABalancesWithID-aLNB35t7-DBx2vR3D.js → toCOABalancesWithID-aLNB35t7-7Tt_7ik0.js} +1 -1
- package/dist/assets/{toChartData-DUL6vnzJ-CHvhrhF4.js → toChartData-DUL6vnzJ-BQL-gYy0.js} +1 -1
- package/dist/assets/{transaction-placeholder-CpOwZAMG-BRNI97Lv.js → transaction-placeholder-CpOwZAMG-Bg0WD2U2.js} +1 -1
- package/dist/assets/{undo-b_3XZ5CX-CHRencVP.js → undo-b_3XZ5CX-C5q__jVa.js} +1 -1
- package/dist/assets/{unlock-BPWn2I5L-BfuVrsIJ.js → unlock-BPWn2I5L-AQif6k_b.js} +1 -1
- package/dist/assets/{upload-reimbursement-receipt-O2N8vcO7-vYnAE0FP.js → upload-reimbursement-receipt-O2N8vcO7-DZGMxr87.js} +1 -1
- package/dist/assets/{uploadAttachment-Ck4wivBR-D3iFmRh8.js → uploadAttachment-Ck4wivBR-CXra5vkU.js} +1 -1
- package/dist/assets/{uploadReceipts-CIgkuVpu-DQDaRUPe.js → uploadReceipts-CIgkuVpu-CCRs-PGP.js} +1 -1
- package/dist/assets/{url-7B3Yv5Zc.js → url-CE2hYXFA.js} +1 -1
- package/dist/assets/{url-CDjIygfF.js → url-vR1N1m0Y.js} +1 -1
- package/dist/assets/{useDeviceId-CPhY1yO5.js → useDeviceId-DqxaPeP2.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-D3BmEojQ.js → useInitialThreadRequest-D0uUtC-2.js} +1 -1
- package/dist/assets/{useLongPress-GCK2COYQ-C-ro8Pxu.js → useLongPress-GCK2COYQ-D5CT9_nV.js} +1 -1
- package/dist/assets/{usp-line-BBd1wKwW-BHKdiO38.js → usp-line-BBd1wKwW-CN9IBf07.js} +1 -1
- package/dist/assets/{utils-BpkJZQMI.js → utils-DtsUvZkm.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-D4jXMzEn.js → withTransactionSidePanel-p7FrtPWC.js} +1 -1
- package/dist/assets/{zeni-epic-state-D8D2Skiq.js → zeni-epic-state-BYs-FQva.js} +3 -3
- package/dist/assets/{zeni-icon-only-BUIVMYdQ.js → zeni-icon-only-BrsSXXFP.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-CTK0e_jx.js +0 -1
- package/dist/assets/CustomerOnboardingContainerPage-CWAtSu08-CHM5gdzL.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as v}from"./pdf-
|
|
1
|
+
import{j as v}from"./pdf-70cGw_kx.js";import{a as h,c as ha,g as Hm,b as ge,R as Wm}from"./sentry-ByK32NK-.js";import{X as dd,r as di}from"./core-Bup_6r8s.js";import{I as du,J as fu,K as zm,L as ts}from"./zeni-epic-state-BYs-FQva.js";import{t as $m,d as qm}from"./recharts-CtJQnN36.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="89275a1d-0370-4c5c-9a19-bad9f93f6094",e._sentryDebugIdIdentifier="sentry-dbid-89275a1d-0370-4c5c-9a19-bad9f93f6094")}catch{}})();function HD(e){const[t,n]=h.useState(!1);return h.useEffect(()=>{n(!0)},[]),v.jsx(h.Suspense,{fallback:e.fallback,children:t?typeof e.children=="function"?e.children():e.children:e.fallback})}var Km=Object.defineProperty,ns="2.23.0",fo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:ha!==void 0?ha:{};function rs(e,t,n){const r=Symbol.for(e),o=`${t} (${n})`;fo[r]?fo[r]===o||function(i){console.error(i)}(["Multiple copies of Liveblocks are being loaded in your project. This will cause issues! See https://liveblocks.io/docs/errors/dupes ","","Conflicts:",`- ${e} ${fo[r]} (already loaded)`,`- ${e} ${o} (trying to load this now)`].join(`
|
|
2
2
|
`)):fo[r]=o}function pa(e){const t=e.editedAt?new Date(e.editedAt):void 0,n=new Date(e.createdAt),r=e.reactions.map(o=>({...o,createdAt:new Date(o.createdAt)}));if(e.body)return{...e,reactions:r,createdAt:n,editedAt:t};{const o=new Date(e.deletedAt);return{...e,reactions:r,createdAt:n,editedAt:t,deletedAt:o}}}function en(e){const t=new Date(e.createdAt),n=new Date(e.updatedAt),r=e.comments.map(o=>pa(o));return{...e,createdAt:t,updatedAt:n,comments:r}}function vn(e){const t=new Date(e.notifiedAt),n=e.readAt?new Date(e.readAt):null;if("activities"in e){const r=e.activities.map(o=>({...o,createdAt:new Date(o.createdAt)}));return{...e,notifiedAt:t,readAt:n,activities:r}}return{...e,notifiedAt:t,readAt:n}}function ji(e){const t=new Date(e.deletedAt);return{...e,deletedAt:t}}function Ri(e){const t=new Date(e.deletedAt);return{...e,deletedAt:t}}var sn={};((e,t)=>{for(var n in t)Km(e,n,{get:t[n],enumerable:!0})})(sn,{error:()=>no,errorWithTitle:()=>md,warn:()=>at,warnWithTitle:()=>Gm});var fd="background:#0e0d12;border-radius:9999px;color:#fff;padding:3px 7px;font-family:sans-serif;font-weight:600;";function hd(e){return typeof window>"u"?console[e]:(t,...n)=>console[e]("%cLiveblocks",fd,t,...n)}var at=hd("warn"),no=hd("error");function pd(e){return typeof window>"u"?console[e]:(t,n,...r)=>console[e](`%cLiveblocks%c ${t}`,fd,"font-weight:600",n,...r)}var Gm=pd("warn"),md=pd("error");function Zt(e){return e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}function ma(e){return Zt(e)&&typeof e.startsWith=="string"}function Yt(e){throw new Error(e)}function ga(e){return Object.entries(e)}function fi(e){try{return JSON.parse(e)}catch{return}}function Sr(e){return JSON.parse(JSON.stringify(e))}function va(e){return e.filter(t=>t!=null)}function Vr(e){const t={...e};return Object.keys(e).forEach(n=>{const r=n;t[r]===void 0&&delete t[r]}),t}function Xm(e){return new Promise(t=>setTimeout(t,e))}async function hu(e,t,n){let r;const o=new Promise((i,a)=>{r=setTimeout(()=>{a(new Error(n))},t)});return Promise.race([e,o]).finally(()=>clearTimeout(r))}function pu(e){let t=null;return()=>(t===null&&(t=e().catch(n=>{throw setTimeout(()=>{t=null},5e3),n})),t)}var ir=class gd extends Error{response;details;constructor(t,n,r){super(t),this.name="HttpError",this.response=n,this.details=r}static async fromResponse(t){let n;try{n=await t.text()}catch{}const r=n?fi(n):void 0;let o;Zt(r)&&(o=r);let i,a="";a||=typeof o?.message=="string"?o.message:"",a||=typeof o?.error=="string"?o.error:"",r===void 0&&(a||=n||""),a||=t.statusText;try{i=new URL(t.url).pathname}catch{}return a+=i!==void 0?` (got status ${t.status} from ${i})`:` (got status ${t.status})`,new gd(a,t,o)}get status(){return this.response.status}},Zm=e=>e instanceof ir&&e.status>=400&&e.status<500;async function Ir(e,t,n,r=Zm){const o=n.length>0?n[n.length-1]:0;let i=0;for(;;){i++;try{return await e()}catch(s){if(r(s))throw s;if(i>=t)throw new Error(`Failed after ${t} attempts: ${String(s)}`)}const a=n[i-1]??o;at(`Attempt ${i} was unsuccessful. Retrying in ${a} milliseconds.`),await Xm(a)}}function vd(){let e,t;return[new Promise((n,r)=>{e=n,t=r}),e,t]}function yd(){const[e,t,n]=vd();return{promise:e,resolve:t,reject:n}}function ke(){const e=new Set;function t(o){return e.add(o),()=>e.delete(o)}function n(o){const i=t(a=>(i(),o(a)));return i}async function r(o){let i;return new Promise(a=>{i=t(s=>{(o===void 0||o(s))&&a(s)})}).finally(()=>i?.())}return{notify:function(o){let i=!1;for(const a of e)a(o),i=!0;return i},subscribe:t,subscribeOnce:n,count:function(){return e.size},waitUntil:r,[Symbol.dispose]:()=>{e.clear()},observable:{subscribe:t,subscribeOnce:n,waitUntil:r}}}var yn=Symbol("kSinks"),Go=Symbol("kTrigger"),qn=null,Dn=null;function rt(e){if(qn===null){qn=new Set;try{e()}finally{for(const t of qn)t[Go]();qn=null}}else e()}function os(e){qn||Yt("Expected to be in an active batch"),qn.add(e)}function bd(e,t){let n=!1;const r={...e};return Object.keys(t).forEach(o=>{const i=o,a=t[i];r[i]!==a&&(a===void 0?delete r[i]:r[i]=a,n=!0)}),n?r:e}var is=class{equals;#e;[yn];constructor(e){this.equals=e??Object.is,this.#e=ke(),this[yn]=new Set,this.get=this.get.bind(this),this.subscribe=this.subscribe.bind(this),this.subscribeOnce=this.subscribeOnce.bind(this)}[Symbol.dispose](){this.#e[Symbol.dispose](),this.#e="(disposed)",this.equals="(disposed)"}get hasWatchers(){if(this.#e.count()>0)return!0;for(const e of this[yn])if(e.hasWatchers)return!0;return!1}[Go](){this.#e.notify();for(const e of this[yn])os(e)}subscribe(e){return this.#e.count()===0&&this.get(),this.#e.subscribe(e)}subscribeOnce(e){const t=this.subscribe(()=>(t(),e()));return t}waitUntil(){throw new Error("waitUntil not supported on Signals")}markSinksDirty(){for(const e of this[yn])e.markDirty()}addSink(e){this[yn].add(e)}removeSink(e){this[yn].delete(e)}asReadonly(){return this}},jt=class extends is{#e;constructor(e,t){super(t),this.#e=e}[Symbol.dispose](){super[Symbol.dispose](),this.#e="(disposed)"}get(){return Dn?.add(this),this.#e}set(e){rt(()=>{typeof e=="function"&&(e=e(this.#e)),this.equals(this.#e,e)||(this.#e=e,this.markSinksDirty(),os(this))})}},Ym=class extends jt{constructor(e){super(Vr(e))}set(){throw new Error("Don't call .set() directly, use .patch()")}patch(e){super.set(t=>bd(t,e))}},Jm=Symbol(),Ke=class ya extends is{#e;#t;#n;#r;#i;static from(...t){const n=t.pop();if(typeof n!="function"&&Yt("Invalid .from() call, last argument expected to be a function"),typeof t[t.length-1]=="function"){const r=n,o=t.pop();return new ya(t,o,r)}return new ya(t,n)}constructor(t,n,r){super(r),this.#t=!0,this.#e=Jm,this.#r=t,this.#n=new Set,this.#i=n}[Symbol.dispose](){for(const t of this.#n)t.removeSink(this);this.#e="(disposed)",this.#n="(disposed)",this.#r="(disposed)",this.#i="(disposed)"}get isDirty(){return this.#t}#o(){const t=Dn;let n;Dn=new Set;try{n=this.#i(...this.#r.map(r=>r.get()))}finally{const r=this.#n;this.#n=new Set;for(const o of Dn)this.#n.add(o),r.delete(o);for(const o of r)o.removeSink(this);for(const o of this.#n)o.addSink(this);Dn=t}return this.#t=!1,!this.equals(this.#e,n)&&(this.#e=n,!0)}markDirty(){this.#t||(this.#t=!0,this.markSinksDirty())}get(){return this.#t&&this.#o(),Dn?.add(this),this.#e}[Go](){this.hasWatchers&&this.#o()&&super[Go]()}},On=class extends is{#e;constructor(e){super(),this.#e=e}[Symbol.dispose](){super[Symbol.dispose](),this.#e="(disposed)"}get(){return Dn?.add(this),this.#e}mutate(e){rt(()=>{const t=!e||e(this.#e);t!==null&&typeof t=="object"&&"then"in t&&Yt("MutableSignal.mutate() does not support async callbacks"),t!==!1&&(this.markSinksDirty(),os(this))})}};function Qm(e,t){return t===null||typeof t!="object"||Array.isArray(t)?t:Object.keys(t).sort().reduce((n,r)=>(n[r]=t[r],n),{})}function Tn(e){return JSON.stringify(e,Qm)}function qt(e){try{return JSON.stringify(e)}catch(t){throw console.error(`Could not stringify: ${t.message}`),console.error(e),t}}var eg=class{input;resolve;reject;promise;constructor(e){this.input=e;const{promise:t,resolve:n,reject:r}=yd();this.promise=t,this.resolve=n,this.reject=r}},Fr=class{#e=[];#t;#n;#r;#i;error=!1;constructor(e,t){this.#t=e,this.#n=t.size??50,this.#r=t.delay}#o(){this.#i!==void 0&&(clearTimeout(this.#i),this.#i=void 0)}#s(){this.#e.length===this.#n?this.#a():this.#e.length===1&&(this.#o(),this.#i=setTimeout(()=>{this.#a()},this.#r))}async#a(){if(this.#e.length===0)return;const e=this.#e.splice(0),t=e.map(n=>n.input);try{const n=await this.#t(t);this.error=!1,e.forEach((r,o)=>{const i=n?.[o];Array.isArray(n)?e.length!==n.length?r.reject(new Error(`Callback must return an array of the same length as the number of provided items. Expected ${e.length}, but got ${n.length}.`)):i instanceof Error?r.reject(i):r.resolve(i):r.reject(new Error("Callback must return an array."))})}catch(n){this.error=!0,e.forEach(r=>{r.reject(n)})}}get(e){const t=this.#e.find(r=>Tn(r.input)===Tn(e));if(t)return t.promise;const n=new eg(e);return this.#e.push(n),this.#s(),n.promise}clear(){this.#e=[],this.error=!1,this.#o()}};function ba(e){const t=new On(new Map);function n(o){return Tn(o)}function r(o,i){t.mutate(a=>{a.set(o,i)})}return{subscribe:t.subscribe,enqueue:async function(o){const i=n(o);if(!t.get().has(i))try{r(i,{isLoading:!0}),r(i,{isLoading:!1,data:await e.get(o)})}catch(a){r(i,{isLoading:!1,error:a})}},getItemState:function(o){const i=n(o);return t.get().get(i)},invalidate:function(o){t.mutate(i=>{if(Array.isArray(o))for(const a of o)i.delete(n(a));else i.clear()})},batch:e,_cacheKeys:function(){return[...t.get().keys()]}}}var mr=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>t+((n&=63)<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"),"");function as(e){return`${e}_${mr()}`}function wd(){return as("th")}function Xo(){return as("cm")}function Cd(){return as("at")}var vt=class extends Map{#e;constructor(e,t){super(t),this.#e=e}getOrCreate(e,t){if(super.has(e))return super.get(e);{const n=(t??this.#e??Yt("DefaultMap used without a factory function"))(e);return this.set(e,n),n}}},tg=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function mu(e){let t=[];const n=Object.entries(e),r=[],o=[],i=[];return n.forEach(([a,s])=>{if(!tg.test(a))throw new Error("Key must only contain letters, numbers, _");yu(s)?r.push([a,s]):Zt(s)&&(ma(s)?o.push([a,s]):i.push([a,s]))}),t=[...gu(r),...vu(o)],i.forEach(([a,s])=>{const u=Object.entries(s),c=[],l=[];u.forEach(([d,p])=>{if(ng(d))throw new Error("Key cannot be empty");yu(p)?c.push([bu(a,d),p]):ma(p)&&l.push([bu(a,d),p])}),t=[...t,...gu(c),...vu(l)]}),t.map(({key:a,operator:s,value:u})=>`${a}${s}${Dd(u)}`).join(" ")}var gu=e=>{const t=[];return e.forEach(([n,r])=>{t.push({key:n,operator:":",value:r})}),t},vu=e=>{const t=[];return e.forEach(([n,r])=>{"startsWith"in r&&typeof r.startsWith=="string"&&t.push({key:n,operator:"^",value:r.startsWith})}),t},yu=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null,bu=(e,t)=>t?`${e}[${Dd(t)}]`:e,ng=e=>!e||e.toString().trim()==="";function Dd(e){const t=JSON.stringify(e);return typeof e!="string"||t.includes("'")?t:`'${t.slice(1,-1).replace(/\\"/g,'"')}'`}function rg(e,t,n){const r=new URL(t,e);return n!==void 0&&(r.search=(n instanceof URLSearchParams?n:function(o){const i=new URLSearchParams;for(const[a,s]of Object.entries(o))s!=null&&i.set(a,s.toString());return i}(n)).toString()),r.toString()}function we(e,...t){return e.reduce((n,r,o)=>n+encodeURIComponent(t[o-1]??"")+r)}function og({baseUrl:e,authManager:t,fetchPolyfill:n}){const r=new ig(e,n),o=new vt(u=>ba(new Fr(async c=>{const l=c.flat(),{urls:d}=await r.post(we`/v2/c/rooms/${u}/attachments/presigned-urls`,await t.getAuthValue({requestedScope:"comments:read",roomId:u}),{attachmentIds:l});return d.map(p=>p??new Error("There was an error while getting this attachment's URL"))},{delay:50})));function i(u){return o.getOrCreate(u)}const a=new vt(u=>new Fr(async c=>{const l=c.flat();return await r.post(we`/v2/c/rooms/${u}/inbox-notifications/read`,await t.getAuthValue({requestedScope:"comments:read",roomId:u}),{inboxNotificationIds:l}),l},{delay:50})),s=new Fr(async u=>{const c=u.flat();return await async function(l){await r.post(we`/v2/c/inbox-notifications/read`,await t.getAuthValue({requestedScope:"comments:read"}),{inboxNotificationIds:l})}(c),c},{delay:50});return{getThreads:async function(u){let c;u.query&&(c=mu(u.query));try{const l=await r.get(we`/v2/c/rooms/${u.roomId}/threads`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),{cursor:u.cursor,query:c,limit:50});return{threads:l.data.map(en),inboxNotifications:l.inboxNotifications.map(vn),nextCursor:l.meta.nextCursor,requestedAt:new Date(l.meta.requestedAt),permissionHints:l.meta.permissionHints}}catch(l){if(l instanceof ir&&l.status===404)return{threads:[],inboxNotifications:[],nextCursor:null,requestedAt:new Date(Date.now()-216e5),permissionHints:{}};throw l}},getThreadsSince:async function(u){const c=await r.get(we`/v2/c/rooms/${u.roomId}/threads/delta`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),{since:u.since.toISOString()},{signal:u.signal});return{threads:{updated:c.data.map(en),deleted:c.deletedThreads.map(ji)},inboxNotifications:{updated:c.inboxNotifications.map(vn),deleted:c.deletedInboxNotifications.map(Ri)},requestedAt:new Date(c.meta.requestedAt),permissionHints:c.meta.permissionHints}},createThread:async function(u){const c=u.commentId??Xo(),l=u.threadId??wd();return en(await r.post(we`/v2/c/rooms/${u.roomId}/threads`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),{id:l,comment:{id:c,body:u.body,attachmentIds:u.attachmentIds},metadata:u.metadata}))},getThread:async function(u){const c=await r.rawGet(we`/v2/c/rooms/${u.roomId}/thread-with-notification/${u.threadId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}));if(c.ok){const l=await c.json();return{thread:en(l.thread),inboxNotification:l.inboxNotification?vn(l.inboxNotification):void 0}}if(c.status===404)return{thread:void 0,inboxNotification:void 0};throw new Error(`There was an error while getting thread ${u.threadId}.`)},deleteThread:async function(u){await r.delete(we`/v2/c/rooms/${u.roomId}/threads/${u.threadId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}))},editThreadMetadata:async function(u){return await r.post(we`/v2/c/rooms/${u.roomId}/threads/${u.threadId}/metadata`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),u.metadata)},createComment:async function(u){const c=u.commentId??Xo();return pa(await r.post(we`/v2/c/rooms/${u.roomId}/threads/${u.threadId}/comments`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),{id:c,body:u.body,attachmentIds:u.attachmentIds}))},editComment:async function(u){return pa(await r.post(we`/v2/c/rooms/${u.roomId}/threads/${u.threadId}/comments/${u.commentId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),{body:u.body,attachmentIds:u.attachmentIds}))},deleteComment:async function(u){await r.delete(we`/v2/c/rooms/${u.roomId}/threads/${u.threadId}/comments/${u.commentId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}))},addReaction:async function(u){return l=await r.post(we`/v2/c/rooms/${u.roomId}/threads/${u.threadId}/comments/${u.commentId}/reactions`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),{emoji:u.emoji}),{...l,createdAt:new Date(l.createdAt)};var l},removeReaction:async function(u){await r.delete(we`/v2/c/rooms/${u.roomId}/threads/${u.threadId}/comments/${u.commentId}/reactions/${u.emoji}`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}))},markThreadAsResolved:async function(u){await r.post(we`/v2/c/rooms/${u.roomId}/threads/${u.threadId}/mark-as-resolved`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}))},markThreadAsUnresolved:async function(u){await r.post(we`/v2/c/rooms/${u.roomId}/threads/${u.threadId}/mark-as-unresolved`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}))},markRoomInboxNotificationAsRead:async function(u){return a.getOrCreate(u.roomId).get(u.inboxNotificationId)},getNotificationSettings:async function(u){return r.get(we`/v2/c/rooms/${u.roomId}/notification-settings`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),void 0,{signal:u.signal})},updateNotificationSettings:async function(u){return r.post(we`/v2/c/rooms/${u.roomId}/notification-settings`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),u.settings)},createTextMention:async function(u){await r.rawPost(we`/v2/c/rooms/${u.roomId}/text-mentions`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),{userId:u.userId,mentionId:u.mentionId})},deleteTextMention:async function(u){await r.rawDelete(we`/v2/c/rooms/${u.roomId}/text-mentions/${u.mentionId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}))},getTextVersion:async function(u){return r.rawGet(we`/v2/c/rooms/${u.roomId}/y-version/${u.versionId}`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}))},createTextVersion:async function(u){await r.rawPost(we`/v2/c/rooms/${u.roomId}/version`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}))},reportTextEditor:async function(u){await r.rawPost(we`/v2/c/rooms/${u.roomId}/text-metadata`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),{type:u.type,rootKey:u.rootKey})},listTextVersions:async function(u){const c=await r.get(we`/v2/c/rooms/${u.roomId}/versions`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}));return{versions:c.versions.map(({createdAt:l,...d})=>({createdAt:new Date(l),...d})),requestedAt:new Date(c.meta.requestedAt)}},listTextVersionsSince:async function(u){const c=await r.get(we`/v2/c/rooms/${u.roomId}/versions/delta`,await t.getAuthValue({requestedScope:"comments:read",roomId:u.roomId}),{since:u.since.toISOString()},{signal:u.signal});return{versions:c.versions.map(({createdAt:l,...d})=>({createdAt:new Date(l),...d})),requestedAt:new Date(c.meta.requestedAt)}},getAttachmentUrl:function(u){return i(u.roomId).batch.get(u.attachmentId)},uploadAttachment:async function(u){const c=u.roomId,l=u.signal,d=u.attachment,p=l?new DOMException(`Upload of attachment ${u.attachment.id} was aborted.`,"AbortError"):void 0;if(l?.aborted)throw p;const m=f=>{if(l?.aborted)throw p;if(f instanceof ir&&f.status===413)throw f;return!1},g=5242880,y=[2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3];if(d.size<=g)return Ir(async()=>r.putBlob(we`/v2/c/rooms/${c}/attachments/${d.id}/upload/${encodeURIComponent(d.name)}`,await t.getAuthValue({requestedScope:"comments:read",roomId:c}),d.file,{fileSize:d.size},{signal:l}),10,y,m);{let f;const b=[],C=await Ir(async()=>r.post(we`/v2/c/rooms/${c}/attachments/${d.id}/multipart/${encodeURIComponent(d.name)}`,await t.getAuthValue({requestedScope:"comments:read",roomId:c}),void 0,{signal:l},{fileSize:d.size}),10,y,m);try{f=C.uploadId;const D=function(B){const O=[];let S=0;for(;S<B.size;){const k=Math.min(S+g,B.size);O.push({partNumber:O.length+1,part:B.slice(S,k)}),S=k}return O}(d.file);if(l?.aborted)throw p;const E=function(B,O){const S=[];for(let k=0,T=B.length;k<T;k+=O)S.push(B.slice(k,k+O));return S}(D,5);for(const B of E){const O=[];for(const{part:S,partNumber:k}of B)O.push(Ir(async()=>r.putBlob(we`/v2/c/rooms/${c}/attachments/${d.id}/multipart/${C.uploadId}/${String(k)}`,await t.getAuthValue({requestedScope:"comments:read",roomId:c}),S,void 0,{signal:l}),10,y,m));b.push(...await Promise.all(O))}if(l?.aborted)throw p;const A=b.sort((B,O)=>B.partNumber-O.partNumber);return r.post(we`/v2/c/rooms/${c}/attachments/${d.id}/multipart/${f}/complete`,await t.getAuthValue({requestedScope:"comments:read",roomId:c}),{parts:A},{signal:l})}catch(D){if(f&&D?.name&&(D.name==="AbortError"||D.name==="TimeoutError"))try{await r.rawDelete(we`/v2/c/rooms/${c}/attachments/${d.id}/multipart/${f}`,await t.getAuthValue({requestedScope:"comments:read",roomId:c}))}catch{}throw D}}},getOrCreateAttachmentUrlsStore:i,streamStorage:async function(u){return await(await r.rawGet(we`/v2/c/rooms/${u.roomId}/storage`,await t.getAuthValue({requestedScope:"room:read",roomId:u.roomId}))).json()},sendMessages:async function(u){return r.rawPost(we`/v2/c/rooms/${u.roomId}/send-message`,await t.getAuthValue({requestedScope:"room:read",roomId:u.roomId}),{nonce:u.nonce,messages:u.messages})},getInboxNotifications:async function(u){const c=await r.get(we`/v2/c/inbox-notifications`,await t.getAuthValue({requestedScope:"comments:read"}),{cursor:u?.cursor,limit:50});return{inboxNotifications:c.inboxNotifications.map(vn),threads:c.threads.map(en),nextCursor:c.meta.nextCursor,requestedAt:new Date(c.meta.requestedAt)}},getInboxNotificationsSince:async function(u){const c=await r.get(we`/v2/c/inbox-notifications/delta`,await t.getAuthValue({requestedScope:"comments:read"}),{since:u.since.toISOString()},{signal:u.signal});return{inboxNotifications:{updated:c.inboxNotifications.map(vn),deleted:c.deletedInboxNotifications.map(Ri)},threads:{updated:c.threads.map(en),deleted:c.deletedThreads.map(ji)},requestedAt:new Date(c.meta.requestedAt)}},getUnreadInboxNotificationsCount:async function(){const{count:u}=await r.get(we`/v2/c/inbox-notifications/count`,await t.getAuthValue({requestedScope:"comments:read"}));return u},markAllInboxNotificationsAsRead:async function(){await r.post(we`/v2/c/inbox-notifications/read`,await t.getAuthValue({requestedScope:"comments:read"}),{inboxNotificationIds:"all"})},markInboxNotificationAsRead:async function(u){await s.get(u)},deleteAllInboxNotifications:async function(){await r.delete(we`/v2/c/inbox-notifications`,await t.getAuthValue({requestedScope:"comments:read"}))},deleteInboxNotification:async function(u){await r.delete(we`/v2/c/inbox-notifications/${u}`,await t.getAuthValue({requestedScope:"comments:read"}))},getUserNotificationSettings:async function(u){return r.get(we`/v2/c/notification-settings`,await t.getAuthValue({requestedScope:"comments:read"}),void 0,{signal:u?.signal})},updateUserNotificationSettings:async function(u){return r.post(we`/v2/c/notification-settings`,await t.getAuthValue({requestedScope:"comments:read"}),u)},getUserThreads_experimental:async function(u){let c;u?.query&&(c=mu(u.query));const l=await r.get(we`/v2/c/threads`,await t.getAuthValue({requestedScope:"comments:read"}),{cursor:u?.cursor,query:c,limit:50});return{threads:l.threads.map(en),inboxNotifications:l.inboxNotifications.map(vn),nextCursor:l.meta.nextCursor,requestedAt:new Date(l.meta.requestedAt),permissionHints:l.meta.permissionHints}},getUserThreadsSince_experimental:async function(u){const c=await r.get(we`/v2/c/threads/delta`,await t.getAuthValue({requestedScope:"comments:read"}),{since:u.since.toISOString()},{signal:u.signal});return{threads:{updated:c.threads.map(en),deleted:c.deletedThreads.map(ji)},inboxNotifications:{updated:c.inboxNotifications.map(vn),deleted:c.deletedInboxNotifications.map(Ri)},requestedAt:new Date(c.meta.requestedAt),permissionHints:c.meta.permissionHints}},executeContextualPrompt:async function(u){const c=await r.post(we`/v2/c/rooms/${u.roomId}/ai/contextual-prompt`,await t.getAuthValue({requestedScope:"room:read",roomId:u.roomId}),{prompt:u.prompt,context:{beforeSelection:u.context.beforeSelection,selection:u.context.selection,afterSelection:u.context.afterSelection},previous:u.previous},{signal:u.signal});if(!c||c.content.length===0)throw new Error("No content returned from server");return c.content[0].text}}}function Ed(e){return e.type==="public"?e.publicApiKey:e.token.raw}var ig=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}async#n(e,t,n,r){e.startsWith("/v2/c/")||Yt("This client can only be used to make /v2/c/* requests");const o=rg(this.#e,e,r);return await this.#t(o,{...n,headers:{"Content-Type":"application/json; charset=utf-8",...n?.headers,Authorization:`Bearer ${Ed(t)}`,"X-LB-Client":ns}})}async#r(e,t,n,r){const o=await this.#n(e,t,n,r);if(!o.ok)throw await ir.fromResponse(o);let i;try{i=await o.json()}catch{i={}}return i}async rawGet(e,t,n,r){return await this.#n(e,t,r,n)}async rawPost(e,t,n){return await this.#n(e,t,{method:"POST",body:qt(n)})}async rawDelete(e,t){return await this.#n(e,t,{method:"DELETE"})}async get(e,t,n,r){return await this.#r(e,t,r,n)}async post(e,t,n,r,o){return await this.#r(e,t,{...r,method:"POST",body:qt(n)},o)}async delete(e,t){return await this.#r(e,t,{method:"DELETE"})}async putBlob(e,t,n,r,o){return await this.#r(e,t,{...o,method:"PUT",headers:{"Content-Type":"application/octet-stream"},body:n},r)}};function ft(e,t){throw new Error(t)}function me(e,t="Expected value to be non-nullable"){return e}var ag=class{#e;constructor(e){this.#e=e}get current(){return this.#e}allowPatching(e){const t=this;let n=!0;e({...this.#e,patch(r){if(!n)throw new Error("Can no longer patch stale context");t.#e=Object.assign({},t.#e,r);for(const o of Object.entries(r)){const[i,a]=o;i!=="patch"&&(this[i]=a)}}}),n=!1}},sg=1,Ad=class{id;#e;#t;#n;#r;#i;#o;events;#s;#a;#l;get#f(){const e=this.#n.values()[Symbol.iterator]().next();if(e.done)throw new Error("No states defined yet");return e.value}get currentState(){if(this.#r===null)throw this.#e===0?new Error("Not started yet"):new Error("Already stopped");return this.#r}start(){if(this.#e!==0)throw new Error("State machine has already started");return this.#e=1,this.#r=this.#f,this.#c(null),this}stop(){if(this.#e!==1)throw new Error("Cannot stop a state machine that hasn't started yet");this.#d(null),this.#e=2,this.#r=null}constructor(e){this.id=sg++,this.#e=0,this.#r=null,this.#n=new Set,this.#a=new Map,this.#s=[],this.#l=new Set,this.#i=new Map,this.#t=new ag(e),this.#o={didReceiveEvent:ke(),willTransition:ke(),didIgnoreEvent:ke(),willExitState:ke(),didEnterState:ke()},this.events={didReceiveEvent:this.#o.didReceiveEvent.observable,willTransition:this.#o.willTransition.observable,didIgnoreEvent:this.#o.didIgnoreEvent.observable,willExitState:this.#o.willExitState.observable,didEnterState:this.#o.didEnterState.observable}}get context(){return this.#t.current}addState(e){if(this.#e!==0)throw new Error("Already started");return this.#n.add(e),this}onEnter(e,t){if(this.#e!==0)throw new Error("Already started");if(this.#a.has(e))throw new Error(`enter/exit function for ${e} already exists`);return this.#a.set(e,t),this}onEnterAsync(e,t,n,r,o){return this.onEnter(e,()=>{const i=new AbortController,a=i.signal,s=o?setTimeout(()=>{const c=new Error("Timed out");this.#u({type:"ASYNC_ERROR",reason:c},r)},o):void 0;let u=!1;return t(this.#t.current,a).then(c=>{a.aborted||(u=!0,this.#u({type:"ASYNC_OK",data:c},n))},c=>{a.aborted||(u=!0,this.#u({type:"ASYNC_ERROR",reason:c},r))}),()=>{clearTimeout(s),u||i.abort()}})}#h(e){const t=[];if(e==="*")for(const n of this.#n)t.push(n);else if(e.endsWith(".*")){const n=e.slice(0,-1);for(const r of this.#n)r.startsWith(n)&&t.push(r)}else{const n=e;this.#n.has(n)&&t.push(n)}if(t.length===0)throw new Error(`No states match ${JSON.stringify(e)}`);return t}addTransitions(e,t){if(this.#e!==0)throw new Error("Already started");for(const n of this.#h(e)){let r=this.#i.get(n);r===void 0&&(r=new Map,this.#i.set(n,r));for(const[o,i]of Object.entries(t)){if(r.has(o))throw new Error(`Trying to set transition "${o}" on "${n}" (via "${e}"), but a transition already exists there.`);const a=i;if(this.#l.add(o),a!==void 0){const s=typeof a=="function"?a:()=>a;r.set(o,s)}}}return this}addTimedTransition(e,t,n){return this.onEnter(e,()=>{const r=typeof t=="function"?t(this.#t.current):t,o=setTimeout(()=>{this.#u({type:"TIMER"},n)},r);return()=>{clearTimeout(o)}})}#p(e){return this.#i.get(this.currentState)?.get(e)}#d(e){this.#o.willExitState.notify(this.currentState),this.#t.allowPatching(t=>{e=e??this.#s.length;for(let n=0;n<e;n++)this.#s.pop()?.(t)})}#c(e){const t=function(n,r){const o=n.split(".");if(r<1||r>o.length+1)throw new Error("Invalid number of levels");const i=[];r>o.length&&i.push("*");for(let a=o.length-r+1;a<o.length;a++){const s=o.slice(0,a);s.length>0&&i.push(s.join(".")+".*")}return i.push(n),i}(this.currentState,e??this.currentState.split(".").length+1);this.#t.allowPatching(n=>{for(const r of t){const o=this.#a.get(r),i=o?.(n);typeof i=="function"?this.#s.push(i):this.#s.push(null)}}),this.#o.didEnterState.notify(this.currentState)}send(e){if(!this.#l.has(e.type))throw new Error(`Invalid event ${JSON.stringify(e.type)}`);if(this.#e===2)return;const t=this.#p(e.type);if(t!==void 0)return this.#u(e,t);this.#o.didIgnoreEvent.notify(e)}#u(e,t){this.#o.didReceiveEvent.notify(e);const n=this.currentState,r=(typeof t=="function"?t:()=>t)(e,this.#t.current);let o,i;if(r===null)return void this.#o.didIgnoreEvent.notify(e);if(typeof r=="string"?o=r:(o=r.target,i=Array.isArray(r.effect)?r.effect:[r.effect]),!this.#n.has(o))throw new Error(`Invalid next state name: ${JSON.stringify(o)}`);this.#o.willTransition.notify({from:n,to:o});const[a,s]=function(u,c){if(u===c)return[0,0];const l=u.split("."),d=c.split("."),p=Math.min(l.length,d.length);let m=0;for(;m<p&&l[m]===d[m];m++);return[l.length-m,d.length-m]}(this.currentState,o);if(a>0&&this.#d(a),this.#r=o,i!==void 0){const u=i;this.#t.allowPatching(c=>{for(const l of u)typeof l=="function"?l(c,e):c.patch(l)})}s>0&&this.#c(s)}},zt=(e=>(e[e.UPDATE_PRESENCE=100]="UPDATE_PRESENCE",e[e.USER_JOINED=101]="USER_JOINED",e[e.USER_LEFT=102]="USER_LEFT",e[e.BROADCASTED_EVENT=103]="BROADCASTED_EVENT",e[e.ROOM_STATE=104]="ROOM_STATE",e[e.INITIAL_STORAGE_STATE=200]="INITIAL_STORAGE_STATE",e[e.UPDATE_STORAGE=201]="UPDATE_STORAGE",e[e.REJECT_STORAGE_OP=299]="REJECT_STORAGE_OP",e[e.UPDATE_YDOC=300]="UPDATE_YDOC",e[e.THREAD_CREATED=400]="THREAD_CREATED",e[e.THREAD_DELETED=407]="THREAD_DELETED",e[e.THREAD_METADATA_UPDATED=401]="THREAD_METADATA_UPDATED",e[e.THREAD_UPDATED=408]="THREAD_UPDATED",e[e.COMMENT_CREATED=402]="COMMENT_CREATED",e[e.COMMENT_EDITED=403]="COMMENT_EDITED",e[e.COMMENT_DELETED=404]="COMMENT_DELETED",e[e.COMMENT_REACTION_ADDED=405]="COMMENT_REACTION_ADDED",e[e.COMMENT_REACTION_REMOVED=406]="COMMENT_REACTION_REMOVED",e))(zt||{});function wu(e){return e===4999||e>=4e3&&e<4100}function Cu(e){return e===1013||e>=4200&&e<4300}function xd(e){switch(e.currentState){case"@ok.connected":case"@ok.awaiting-pong":return"connected";case"@idle.initial":return"initial";case"@auth.busy":case"@auth.backoff":case"@connecting.busy":case"@connecting.backoff":case"@idle.zombie":return e.context.successCount>0?"reconnecting":"connecting";case"@idle.failed":return"disconnected";default:return ft(0,"Unknown state")}}var Od=[250,500,1e3,2e3,4e3,8e3,1e4],ho=Od[0]-1,ug=[2e3,3e4,6e4,3e5],En=class extends Error{constructor(e){super(e)}};function Bd(e,t){return t.find(n=>n>e)??t[t.length-1]}function Mn(e){e.patch({backoffDelay:Bd(e.backoffDelay,Od)})}function Du(e){e.patch({backoffDelay:Bd(e.backoffDelay,ug)})}function Eu(e){e.patch({successCount:0})}function $n(e,t){const n=e===2?no:e===1?at:()=>{};return()=>{n(t)}}function Au(e){const t="Connection to Liveblocks websocket server";return n=>{e instanceof Error?at(`${t} could not be established. ${String(e)}`):at(kd(e)?`${t} closed prematurely (code: ${e.code}). Retrying in ${n.backoffDelay}ms.`:`${t} could not be established.`)}}function _i(e){const t=[`code: ${e.code}`];return e.reason&&t.push(`reason: ${e.reason}`),n=>{at(`Connection to Liveblocks websocket server closed (${t.join(", ")}). Retrying in ${n.backoffDelay}ms.`)}}var cg=$n(1,"Connection to WebSocket closed permanently. Won't retry.");function kd(e){return!(e instanceof Error)&&e.type==="close"}var po=e=>t=>t.patch(e);function lg(e,t){const n=function(){const b=ke();let C=null;return{...b,notify:function(D){return C!==null?(C.push(D),!1):b.notify(D)},pause:function(){C=[]},unpause:function(){if(C!==null){for(const D of C)b.notify(D);C=null}},[Symbol.dispose]:()=>{b[Symbol.dispose](),C!==null&&(C.length=0)}}}();n.pause();const r=ke();function o(b,C){return()=>{r.notify({message:b,code:C})}}const i=new Ad({successCount:0,authValue:null,socket:null,backoffDelay:ho}).addState("@idle.initial").addState("@idle.failed").addState("@idle.zombie").addState("@auth.busy").addState("@auth.backoff").addState("@connecting.busy").addState("@connecting.backoff").addState("@ok.connected").addState("@ok.awaiting-pong");i.addTransitions("*",{RECONNECT:{target:"@auth.backoff",effect:[Mn,Eu]},DISCONNECT:"@idle.initial"}),i.onEnter("@idle.*",Eu).addTransitions("@idle.*",{CONNECT:(b,C)=>C.authValue!==null?"@connecting.busy":"@auth.busy"}),i.addTransitions("@auth.backoff",{NAVIGATOR_ONLINE:{target:"@auth.busy",effect:po({backoffDelay:ho})}}).addTimedTransition("@auth.backoff",b=>b.backoffDelay,"@auth.busy").onEnterAsync("@auth.busy",()=>hu(e.authenticate(),1e4,"Timed out during auth"),b=>({target:"@connecting.busy",effect:po({authValue:b.data})}),b=>b.reason instanceof En?{target:"@idle.failed",effect:[$n(2,b.reason.message),o(b.reason.message,-1)]}:{target:"@auth.backoff",effect:[Mn,$n(2,`Authentication failed: ${b.reason instanceof Error?b.reason.message:String(b.reason)}`)]});const a=b=>i.send({type:"EXPLICIT_SOCKET_ERROR",event:b}),s=b=>i.send({type:"EXPLICIT_SOCKET_CLOSE",event:b}),u=b=>b.data==="pong"?i.send({type:"PONG"}):n.notify(b);function c(b){b&&(b.removeEventListener("error",a),b.removeEventListener("close",s),b.removeEventListener("message",u),b.close())}i.addTransitions("@connecting.backoff",{NAVIGATOR_ONLINE:{target:"@connecting.busy",effect:po({backoffDelay:ho})}}).addTimedTransition("@connecting.backoff",b=>b.backoffDelay,"@connecting.busy").onEnterAsync("@connecting.busy",async(b,C)=>{let D=null,E=null;return hu(new Promise((A,B)=>{if(b.authValue===null)throw new Error("No auth authValue");const O=e.createSocket(b.authValue);function S(R){D=R,O.removeEventListener("message",u),B(R)}E=O;const[k,T]=vd();function F(R){fi(R.data)?.type===104&&T()}t.waitForActorId||T(),O.addEventListener("message",u),t.waitForActorId&&O.addEventListener("message",F),O.addEventListener("error",S),O.addEventListener("close",S),O.addEventListener("open",()=>{O.addEventListener("error",a),O.addEventListener("close",s);const R=()=>{O.removeEventListener("error",S),O.removeEventListener("close",S),O.removeEventListener("message",F)};k.then(()=>{A([O,R])})})}),1e4,"Timed out during websocket connection").then(([A,B])=>{if(B(),C.aborted)throw new Error("Aborted");if(D)throw D;return A}).catch(A=>{throw c(E),A})},b=>({target:"@ok.connected",effect:po({socket:b.data,backoffDelay:ho})}),b=>{const C=b.reason;if(C instanceof En)return{target:"@idle.failed",effect:[$n(2,C.message),o(C.message,-1)]};if(kd(C)){if(C.code===4109)return"@auth.busy";if(Cu(C.code))return{target:"@connecting.backoff",effect:[Du,Au(C)]};if(wu(C.code))return{target:"@idle.failed",effect:[$n(2,C.reason),o(C.reason,C.code)]}}return{target:"@auth.backoff",effect:[Mn,Au(C)]}});const l={target:"@ok.awaiting-pong",effect:b=>{b.socket?.send("ping")}},d=()=>(typeof document<"u"?document:void 0)?.visibilityState==="hidden"&&e.canZombie()?"@idle.zombie":l;if(i.addTimedTransition("@ok.connected",3e4,d).addTransitions("@ok.connected",{NAVIGATOR_OFFLINE:d,WINDOW_GOT_FOCUS:l}),i.addTransitions("@idle.zombie",{WINDOW_GOT_FOCUS:"@connecting.backoff"}),i.onEnter("@ok.*",b=>{b.patch({successCount:b.successCount+1});const C=setTimeout(n.unpause,0);return D=>{c(D.socket),D.patch({socket:null}),clearTimeout(C),n.pause()}}).addTransitions("@ok.awaiting-pong",{PONG:"@ok.connected"}).addTimedTransition("@ok.awaiting-pong",2e3,{target:"@connecting.busy",effect:$n(1,"Received no pong from server, assume implicit connection loss.")}).addTransitions("@ok.*",{EXPLICIT_SOCKET_ERROR:(b,C)=>C.socket?.readyState===1?null:{target:"@connecting.backoff",effect:Mn},EXPLICIT_SOCKET_CLOSE:b=>{return wu(b.event.code)?{target:"@idle.failed",effect:[cg,o(b.event.reason,b.event.code)]}:(C=b.event.code)>=4100&&C<4200?b.event.code===4109?"@auth.busy":{target:"@auth.backoff",effect:[Mn,_i(b.event)]}:Cu(b.event.code)?{target:"@connecting.backoff",effect:[Du,_i(b.event)]}:{target:"@connecting.backoff",effect:[Mn,_i(b.event)]};var C}}),typeof document<"u"){const b=typeof document<"u"?document:void 0,C=typeof window<"u"?window:void 0,D=C??b;i.onEnter("*",E=>{function A(){i.send({type:"NAVIGATOR_OFFLINE"})}function B(){i.send({type:"NAVIGATOR_ONLINE"})}function O(){b?.visibilityState==="visible"&&i.send({type:"WINDOW_GOT_FOCUS"})}return C?.addEventListener("online",B),C?.addEventListener("offline",A),D?.addEventListener("visibilitychange",O),()=>{D?.removeEventListener("visibilitychange",O),C?.removeEventListener("online",B),C?.removeEventListener("offline",A),c(E.socket)}})}const p=[],{statusDidChange:m,didConnect:g,didDisconnect:y,unsubscribe:f}=function(b){const C=ke(),D=ke(),E=ke();let A=null;const B=b.events.didEnterState.subscribe(()=>{const O=xd(b);O!==A&&C.notify(O),A==="connected"&&O!=="connected"?E.notify():A!=="connected"&&O==="connected"&&D.notify(),A=O});return{statusDidChange:C.observable,didConnect:D.observable,didDisconnect:E.observable,unsubscribe:B}}(i);return p.push(f),t.enableDebugLogging&&p.push(function(b){const C=new Date().getTime();function D(...A){at(`${((new Date().getTime()-C)/1e3).toFixed(2)} [FSM #${b.id}]`,...A)}const E=[b.events.didReceiveEvent.subscribe(A=>D(`Event ${A.type}`)),b.events.willTransition.subscribe(({from:A,to:B})=>D("Transitioning",A,"→",B)),b.events.didIgnoreEvent.subscribe(A=>D("Ignored event",A.type,A,"(current state won't handle it)"))];return()=>{for(const A of E)A()}}(i)),i.start(),{machine:i,cleanups:p,events:{statusDidChange:m,didConnect:g,didDisconnect:y,onMessage:n.observable,onConnectionError:r.observable}}}var dg=class{#e;#t;events;constructor(e,t=!1,n=!0){const{machine:r,events:o,cleanups:i}=lg(e,{waitForActorId:n,enableDebugLogging:t});this.#e=r,this.events=o,this.#t=i}getStatus(){try{return xd(this.#e)}catch{return"initial"}}get authValue(){return this.#e.context.authValue}connect(){this.#e.send({type:"CONNECT"})}reconnect(){this.#e.send({type:"RECONNECT"})}disconnect(){this.#e.send({type:"DISCONNECT"})}destroy(){let e;for(this.#e.stop();e=this.#t.pop();)e()}send(e){const t=this.#e.context?.socket;t===null?at("Cannot send: not connected yet",e):t.readyState!==1?at("Cannot send: WebSocket no longer open",e):t.send(e)}_privateSendMachineEvent(e){this.#e.send(e)}},wa=(e=>(e.Read="room:read",e.Write="room:write",e.PresenceWrite="room:presence:write",e.CommentsWrite="comments:write",e.CommentsRead="comments:read",e))(wa||{});function Ca(e){return e.includes("room:write")}function Sd(e){return e.includes("comments:write")||e.includes("room:write")}function xu(e){const t=e.split(".");if(t.length!==3)throw new Error("Authentication error: invalid JWT token");const n=fi(function(o){try{const i=o.replace(/-/g,"+").replace(/_/g,"/");return decodeURIComponent(atob(i).split("").map(function(a){return"%"+("00"+a.charCodeAt(0).toString(16)).slice(-2)}).join(""))}catch{return atob(o)}}(t[1]));if(!n||!Zt(r=n)||r.k!=="acc"&&r.k!=="id"&&r.k!=="sec-legacy")throw new Error("Authentication error: expected a valid token but did not get one. Hint: if you are using a callback, ensure the room is passed when creating the token. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientCallback");var r;return{raw:e,parsed:n}}function fg(e,t){const n=function(c){const{publicApiKey:l,authEndpoint:d}=c;if(d!==void 0&&l!==void 0)throw new Error("You cannot simultaneously use `publicApiKey` and `authEndpoint` options. Please pick one and leave the other option unspecified. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClient");if(typeof l=="string"){if(l.startsWith("sk_"))throw new Error("Invalid `publicApiKey` option. The value you passed is a secret key, which should not be used from the client. Please only ever pass a public key here. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientPublicKey");if(!l.startsWith("pk_"))throw new Error("Invalid key. Please use the public key format: pk_<public key>. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientPublicKey");return{type:"public",publicApiKey:l}}if(typeof d=="string")return{type:"private",url:d};if(typeof d=="function")return{type:"custom",callback:d};throw d!==void 0?new Error("The `authEndpoint` option must be a string or a function. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientAuthEndpoint"):new Error("Invalid Liveblocks client options. Please provide either a `publicApiKey` or `authEndpoint` option. They cannot both be empty. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClient")}(e),r=new Set,o=[],i=[],a=new Map;function s(c,l){return c==="comments:read"?l.includes("comments:read")||l.includes("comments:write")||l.includes("room:read")||l.includes("room:write"):c==="room:read"&&(l.includes("room:read")||l.includes("room:write"))}async function u(c){const l=e.polyfills?.fetch??(typeof window>"u"?void 0:window.fetch);if(n.type==="private"){if(l===void 0)throw new En("To use Liveblocks client in a non-DOM environment with a url as auth endpoint, you need to provide a fetch polyfill.");const d=xu((await async function(p,m,g){const y=await p(m,{method:"POST",headers:{"Content-Type":"application/json"},body:qt(g)});if(!y.ok){const C=`${(await y.text()).trim()||"reason not provided in auth response"} (${y.status} returned by POST ${m})`;throw y.status===401||y.status===403?new En(`Unauthorized: ${C}`):new Error(`Failed to authenticate: ${C}`)}let f;try{f=await y.json()}catch(C){throw new Error(`Expected a JSON response when doing a POST request on "${m}". ${String(C)}`)}if(!Zt(f)||typeof f.token!="string")throw new Error(`Expected a JSON response of the form \`{ token: "..." }\` when doing a POST request on "${m}", but got ${qt(f)}`);const{token:b}=f;return{token:b}}(l,n.url,{room:c.roomId})).token);if(r.has(d.raw))throw new En("The same Liveblocks auth token was issued from the backend before. Caching Liveblocks tokens is not supported.");return t?.(d.parsed),d}if(n.type==="custom"){const d=await n.callback(c.roomId);if(d&&typeof d=="object"){if(typeof d.token=="string"){const p=xu(d.token);return t?.(p.parsed),p}if(typeof d.error=="string"){const p=`Authentication failed: ${"reason"in d&&typeof d.reason=="string"?d.reason:"Forbidden"}`;throw d.error==="forbidden"?new En(p):new Error(p)}}throw new Error('Your authentication callback function should return a token, but it did not. Hint: the return value should look like: { token: "..." }')}throw new Error("Unexpected authentication type. Must be private or custom.")}return{reset:function(){r.clear(),o.length=0,i.length=0,a.clear()},getAuthValue:async function(c){if(n.type==="public")return{type:"public",publicApiKey:n.publicApiKey};const l=function(p){const m=Math.ceil(Date.now()/1e3);for(let g=o.length-1;g>=0;g--){const y=o[g];if(i[g]<=m)o.splice(g,1),i.splice(g,1);else{if(y.parsed.k==="id")return y;if(y.parsed.k==="acc"){if(!p.roomId&&Object.entries(y.parsed.perms).length===0)return y;for(const[f,b]of Object.entries(y.parsed.perms))if(p.roomId){if(f.includes("*")&&p.roomId.startsWith(f.replace("*",""))||p.roomId===f&&s(p.requestedScope,b))return y}else if(f.includes("*")&&s(p.requestedScope,b))return y}}}}(c);if(l!==void 0)return{type:"secret",token:l};let d;c.roomId?(d=a.get(c.roomId),d===void 0&&(d=u(c),a.set(c.roomId,d))):(d=a.get("liveblocks-user-token"),d===void 0&&(d=u(c),a.set("liveblocks-user-token",d)));try{const p=await d,m=30,g=Math.floor(Date.now()/1e3)+(p.parsed.exp-p.parsed.iat)-m;return r.add(p.raw),p.parsed.k!=="sec-legacy"&&(o.push(p),i.push(g)),{type:"secret",token:p}}finally{c.roomId?a.delete(c.roomId):a.delete("liveblocks-user-token")}}}}var Oe=Symbol();ke().observable;var Tr=Symbol("user-notification-settings-plain");function Zo(e){const t=["email","slack","teams","webPush"],n={[Tr]:{value:e,enumerable:!1}};for(const r of t)n[r]={enumerable:!0,get(){const o=this[Tr][r];return o===void 0?(no(`In order to use the '${r}' channel, please set up your project first. For more information: https://liveblocks.io/docs/errors/enable-a-notification-channel`),null):o}};return function(r,o){return o!==void 0?Object.create(r,o):Object.create(r)}(null,n)}function hg(e,t){const n=Zo({...e[Tr]});for(const o of(r=t,Object.keys(r))){const i=t[o];if(i!==void 0){const a=Object.fromEntries(ga(i).filter(([,s])=>s!==void 0));n[Tr][o]={...n[Tr][o],...a}}}var r;return n}var un=32,An=126,ss=us(0),Ro=us(1),pg=ss+us(-1);function us(e){const t=un+(e<0?95+e:e);if(t<un||t>An)throw new Error(`Invalid n value: ${e}`);return String.fromCharCode(t)}function Vt(e,t){return e!==void 0&&t!==void 0?function(n,r){if(n<r)return Da(n,r);if(n>r)return Da(r,n);throw new Error("Cannot compute value between two equal positions")}(e,t):e!==void 0?function(n){for(let r=0;r<=n.length-1;r++){const o=n.charCodeAt(r);if(!(o>=An))return n.substring(0,r)+String.fromCharCode(o+1)}return n+Ro}(e):t!==void 0?function(n){const r=n.length-1;for(let o=0;o<=r;o++){const i=n.charCodeAt(o);if(!(i<=un))return o===r?i===33?n.substring(0,o)+pg:n.substring(0,o)+String.fromCharCode(i-1):n.substring(0,o+1)}return Ro}(t):Ro}function Da(e,t){let n=0;const r=e.length,o=t.length;for(;;){const i=n<r?e.charCodeAt(n):un,a=n<o?t.charCodeAt(n):An;if(i!==a){if(a-i==1){const s=n+1;let u=e.substring(0,s);return u.length<s&&(u+=ss.repeat(s-u.length)),u+Da(e.substring(s),"")}return mg(e,n)+String.fromCharCode(a+i>>1)}n++}}function mg(e,t){return t<e.length?e.substring(0,t):e+ss.repeat(t-e.length)}function Hr(e){return function(t){if(t==="")return!1;const n=t.length-1,r=t.charCodeAt(n);if(r<33||r>An)return!1;for(let o=0;o<n;o++){const i=t.charCodeAt(o);if(i<un||i>An)return!1}return!0}(e)?e:function(t){const n=[];for(let r=0;r<t.length;r++){const o=t.charCodeAt(r);n.push(o<un?un:o>An?An:o)}for(;n.length>0&&n[n.length-1]===un;)n.length--;return n.length>0?String.fromCharCode(...n):Ro}(e)}function gg(e,t){const{getCurrentConnectionId:n,onDispatch:r,isStorageWritable:o=()=>!0}=t;let i=0,a=0;const s=new Map;return{roomId:e,nodes:s,getNode:u=>s.get(u),addNode:(u,c)=>{s.set(u,c)},deleteNode:u=>{s.delete(u)},generateId:()=>`${n()}:${i++}`,generateOpId:()=>`${n()}:${a++}`,dispatch(u,c,l){r?.(u,c,l)},assertStorageIsWritable:()=>{if(!o())throw new Error("Cannot write to storage with a read only user, please ensure the user has write permissions")}}}function Ou(e,t,n=Hr(t)){return Object.freeze({type:"HasParent",node:e,key:t,pos:n})}var Bu=Object.freeze({type:"NoParent"}),hi=class{#e;#t;#n=Bu;_getParentKeyOrThrow(){switch(this.parent.type){case"HasParent":return this.parent.key;case"NoParent":throw new Error("Parent key is missing");case"Orphaned":return this.parent.oldKey;default:return ft(this.parent,"Unknown state")}}get _parentPos(){switch(this.parent.type){case"HasParent":return this.parent.pos;case"NoParent":throw new Error("Parent key is missing");case"Orphaned":return this.parent.oldPos;default:return ft(this.parent,"Unknown state")}}get _pool(){return this.#e}get roomId(){return this.#e?this.#e.roomId:null}get _id(){return this.#t}get parent(){return this.#n}get _parentKey(){switch(this.parent.type){case"HasParent":return this.parent.key;case"NoParent":return null;case"Orphaned":return this.parent.oldKey;default:return ft(this.parent,"Unknown state")}}_apply(e,t){return e.type===5&&this.parent.type==="HasParent"?this.parent.node._detachChild(this):{modified:!1}}_setParentLink(e,t){switch(this.parent.type){case"HasParent":if(this.parent.node!==e)throw new Error("Cannot set parent: node already has a parent");return void(this.#n=Ou(e,t));case"Orphaned":case"NoParent":return void(this.#n=Ou(e,t));default:return ft(this.parent,"Unknown state")}}_attach(e,t){if(this.#t||this.#e)throw new Error("Cannot attach node: already attached");t.addNode(e,this),this.#t=e,this.#e=t}_detach(){switch(this.#e&&this.#t&&this.#e.deleteNode(this.#t),this.parent.type){case"HasParent":this.#n=function(e,t=Hr(e)){return Object.freeze({type:"Orphaned",oldKey:e,oldPos:t})}(this.parent.key,this.parent.pos);break;case"NoParent":this.#n=Bu;break;case"Orphaned":break;default:ft(this.parent,"Unknown state")}this.#e=void 0}#r;#i;#o;invalidate(){this.#r===void 0&&this.#o===void 0||(this.#r=void 0,this.#o=void 0,this.parent.type==="HasParent"&&this.parent.node.invalidate())}toTreeNode(e){return this.#o!==void 0&&this.#i===e||(this.#i=e,this.#o=this._toTreeNode(e)),this.#o}toImmutable(){return this.#r===void 0&&(this.#r=this._toImmutable()),this.#r}};function vg(e){return e.type===0&&!function(t){return t.parentId!==void 0&&t.parentKey!==void 0}(e)}var pn=class Id extends hi{#e;constructor(t){super(),this.#e=t}get data(){return this.#e}static _deserialize([t,n],r,o){const i=new Id(n.data);return i._attach(t,o),i}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize register if parentId or parentKey is undefined");return[{type:8,opId:r?.generateOpId(),id:this._id,parentId:t,parentKey:n,data:this.data}]}_serialize(){if(this.parent.type!=="HasParent")throw new Error("Cannot serialize LiveRegister if parent is missing");return{type:3,parentId:me(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key,data:this.data}}_attachChild(t){throw new Error("Method not implemented.")}_detachChild(t){throw new Error("Method not implemented.")}_apply(t,n){return super._apply(t,n)}_toTreeNode(t){return{type:"Json",id:this._id??mr(),key:t,payload:this.#e}}_toImmutable(){return this.#e}clone(){return Sr(this.data)}};function yg(e,t){const n=e._parentPos,r=t._parentPos;return n===r?0:n<r?-1:1}var gr=class Ea extends hi{#e;#t;#n;constructor(t){let n;super(),this.#e=[],this.#t=new WeakSet,this.#n=new Map;for(const r of t){const o=Vt(n),i=Zn(r);i._setParentLink(this,o),this.#e.push(i),n=o}}static _deserialize([t],n,r){const o=new Ea([]);o._attach(t,r);const i=n.get(t);if(i===void 0)return o;for(const[a,s]of i){const u=jd([a,s],n,r);u._setParentLink(o,s.parentKey),o._insertAndSort(u)}return o}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize item is not attached");const o=[],i={id:this._id,opId:r?.generateOpId(),type:2,parentId:t,parentKey:n};o.push(i);for(const a of this.#e){const s=a._getParentKeyOrThrow(),u=go(a._toOps(this._id,s,r),void 0),c=u[0].opId;c!==void 0&&this.#n.set(s,c),o.push(...u)}return o}_insertAndSort(t){this.#e.push(t),this._sortItems()}_sortItems(){this.#e.sort(yg),this.invalidate()}_indexOfPosition(t){return this.#e.findIndex(n=>n._getParentKeyOrThrow()===t)}_attach(t,n){super._attach(t,n);for(const r of this.#e)r._attach(n.generateId(),n)}_detach(){super._detach();for(const t of this.#e)t._detach()}#r(t){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const{id:n,parentKey:r}=t,o=Ar(t);o._attach(n,this._pool),o._setParentLink(this,r);const i=t.deletedId,a=this._indexOfPosition(r);if(a!==-1){const s=this.#e[a];if(s._id===i)return s._detach(),this.#e[a]=o,{modified:Ie(this,[Ln(a,o)]),reverse:[]};{this.#t.add(s),this.#e[a]=o;const u=[Ln(a,o)],c=this.#o(t.deletedId);return c&&u.push(c),{modified:Ie(this,u),reverse:[]}}}{const s=[],u=this.#o(t.deletedId);return u&&s.push(u),this._insertAndSort(o),s.push(Ot(this._indexOfPosition(r),o)),{reverse:[],modified:Ie(this,s)}}}#i(t){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const n=[],r=this.#o(t.deletedId);r&&n.push(r);const o=this.#n.get(t.parentKey);if(o!==void 0){if(o!==t.opId)return n.length===0?{modified:!1}:{modified:Ie(this,n),reverse:[]};this.#n.delete(t.parentKey)}const i=this._indexOfPosition(t.parentKey),a=this.#e.find(s=>s._id===t.id);if(a!==void 0){if(a._parentKey===t.parentKey)return{modified:n.length>0&&Ie(this,n),reverse:[]};if(i!==-1){this.#t.add(this.#e[i]);const[c]=this.#e.splice(i,1);n.push(mo(i,c))}const s=this.#e.indexOf(a);a._setParentLink(this,t.parentKey),this._sortItems();const u=this.#e.indexOf(a);return u!==s&&n.push(bn(s,u,a)),{modified:n.length>0&&Ie(this,n),reverse:[]}}{const s=this._pool.getNode(t.id);if(s&&this.#t.has(s)){s._setParentLink(this,t.parentKey),this.#t.delete(s),this._insertAndSort(s);const u=this.#e.indexOf(s);return{modified:Ie(this,[i===-1?Ot(u,s):Ln(u,s),...n]),reverse:[]}}{i!==-1&&this.#e.splice(i,1);const{newItem:u,newIndex:c}=this.#c(t,t.parentKey);return{modified:Ie(this,[i===-1?Ot(c,u):Ln(c,u),...n]),reverse:[]}}}}#o(t){if(t===void 0||this._pool===void 0)return null;const n=this._pool.getNode(t);if(n===void 0)return null;const r=this._detachChild(n);return r.modified===!1?null:r.modified.updates[0]}#s(t){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const n=Hr(t.parentKey),r=this._indexOfPosition(n);r!==-1&&this.#u(r,n);const{newItem:o,newIndex:i}=this.#c(t,n);return{modified:Ie(this,[Ot(i,o)]),reverse:[]}}#a(t){const n=this.#e.find(i=>i._id===t.id),r=Hr(t.parentKey),o=this._indexOfPosition(r);if(n){if(n._parentKey===r)return{modified:!1};{const i=this.#e.indexOf(n);o!==-1&&this.#u(o,r),n._setParentLink(this,r),this._sortItems();const a=this._indexOfPosition(r);return a===i?{modified:!1}:{modified:Ie(this,[bn(i,a,n)]),reverse:[]}}}{const i=me(this._pool).getNode(t.id);if(i&&this.#t.has(i))return i._setParentLink(this,r),this.#t.delete(i),this._insertAndSort(i),{modified:Ie(this,[Ot(this._indexOfPosition(r),i)]),reverse:[]};{o!==-1&&this.#u(o,r);const{newItem:a,newIndex:s}=this.#c(t,r);return{modified:Ie(this,[Ot(s,a)]),reverse:[]}}}}#l(t){const{id:n,parentKey:r}=t,o=Ar(t);if(this._pool?.getNode(n)!==void 0)return{modified:!1};o._attach(n,me(this._pool)),o._setParentLink(this,r);const i=this._indexOfPosition(r);let a=r;if(i!==-1){const s=this.#e[i]?._parentPos,u=this.#e[i+1]?._parentPos;a=Vt(s,u),o._setParentLink(this,a)}return this._insertAndSort(o),{modified:Ie(this,[Ot(this._indexOfPosition(a),o)]),reverse:[{type:5,id:n}]}}#f(t){const{id:n,parentKey:r}=t,o=Ar(t);if(this._pool?.getNode(n)!==void 0)return{modified:!1};this.#n.set(r,me(t.opId));const i=this._indexOfPosition(r);o._attach(n,me(this._pool)),o._setParentLink(this,r);const a=r;if(i!==-1){const s=this.#e[i];s._detach(),this.#e[i]=o;const u=go(s._toOps(me(this._id),r,this._pool),t.id),c=[Ln(i,o)],l=this.#o(t.deletedId);return l&&c.push(l),{modified:Ie(this,c),reverse:u}}return this._insertAndSort(o),this.#o(t.deletedId),{reverse:[{type:5,id:n}],modified:Ie(this,[Ot(this._indexOfPosition(a),o)])}}_attachChild(t,n){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");let r;return r=t.intent==="set"?n===1?this.#r(t):n===2?this.#i(t):this.#f(t):n===1?this.#s(t):n===2?this.#a(t):this.#l(t),r.modified!==!1&&this.invalidate(),r}_detachChild(t){if(t){const n=me(t._parentKey),r=t._toOps(me(this._id),n,this._pool),o=this.#e.indexOf(t);if(o===-1)return{modified:!1};const[i]=this.#e.splice(o,1);return this.invalidate(),t._detach(),{modified:Ie(this,[mo(o,i)]),reverse:r}}return{modified:!1}}#h(t,n){if(this.#t.has(n))return this.#t.delete(n),n._setParentLink(this,t),this._insertAndSort(n),{modified:Ie(this,[Ot(this.#e.indexOf(n),n)]),reverse:[]};if(t===n._parentKey)return{modified:!1};const r=this._indexOfPosition(t);if(r===-1){const o=this.#e.indexOf(n);n._setParentLink(this,t),this._sortItems();const i=this.#e.indexOf(n);return i===o?{modified:!1}:{modified:Ie(this,[bn(o,i,n)]),reverse:[]}}{this.#e[r]._setParentLink(this,Vt(t,this.#e[r+1]?._parentPos));const o=this.#e.indexOf(n);n._setParentLink(this,t),this._sortItems();const i=this.#e.indexOf(n);return i===o?{modified:!1}:{modified:Ie(this,[bn(o,i,n)]),reverse:[]}}}#p(t,n){const r=me(n._parentKey);if(this.#t.has(n)){const o=this._indexOfPosition(t);return this.#t.delete(n),o!==-1&&this.#e[o]._setParentLink(this,Vt(t,this.#e[o+1]?._parentPos)),n._setParentLink(this,t),this._insertAndSort(n),{modified:!1}}{if(t===r)return{modified:!1};const o=this.#e.indexOf(n),i=this._indexOfPosition(t);i!==-1&&this.#e[i]._setParentLink(this,Vt(t,this.#e[i+1]?._parentPos)),n._setParentLink(this,t),this._sortItems();const a=this.#e.indexOf(n);return o===a?{modified:!1}:{modified:Ie(this,[bn(o,a,n)]),reverse:[]}}}#d(t,n){const r=me(n._parentKey),o=this.#e.indexOf(n),i=this._indexOfPosition(t);i!==-1&&this.#e[i]._setParentLink(this,Vt(t,this.#e[i+1]?._parentPos)),n._setParentLink(this,t),this._sortItems();const a=this.#e.indexOf(n);return o===a?{modified:!1}:{modified:Ie(this,[bn(o,a,n)]),reverse:[{type:1,id:me(n._id),parentKey:r}]}}_setChildKey(t,n,r){return r===1?this.#h(t,n):r===2?this.#p(t,n):this.#d(t,n)}_apply(t,n){return super._apply(t,n)}_serialize(){if(this.parent.type!=="HasParent")throw new Error("Cannot serialize LiveList if parent is missing");return{type:1,parentId:me(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key}}get length(){return this.#e.length}push(t){return this._pool?.assertStorageIsWritable(),this.insert(t,this.length)}insert(t,n){if(this._pool?.assertStorageIsWritable(),n<0||n>this.#e.length)throw new Error(`Cannot insert list item at index "${n}". index should be between 0 and ${this.#e.length}`);const r=Vt(this.#e[n-1]?this.#e[n-1]._parentPos:void 0,this.#e[n]?this.#e[n]._parentPos:void 0),o=Zn(t);if(o._setParentLink(this,r),this._insertAndSort(o),this._pool&&this._id){const i=this._pool.generateId();o._attach(i,this._pool),this._pool.dispatch(o._toOps(this._id,r,this._pool),[{type:5,id:i}],new Map([[this._id,Ie(this,[Ot(n,o)])]]))}}move(t,n){if(this._pool?.assertStorageIsWritable(),n<0)throw new Error("targetIndex cannot be less than 0");if(n>=this.#e.length)throw new Error("targetIndex cannot be greater or equal than the list length");if(t<0)throw new Error("index cannot be less than 0");if(t>=this.#e.length)throw new Error("index cannot be greater or equal than the list length");let r=null,o=null;t<n?(o=n===this.#e.length-1?void 0:this.#e[n+1]._parentPos,r=this.#e[n]._parentPos):(o=this.#e[n]._parentPos,r=n===0?void 0:this.#e[n-1]._parentPos);const i=Vt(r,o),a=this.#e[t],s=a._getParentKeyOrThrow();if(a._setParentLink(this,i),this._sortItems(),this._pool&&this._id){const u=new Map([[this._id,Ie(this,[bn(t,n,a)])]]);this._pool.dispatch([{type:1,id:me(a._id),opId:this._pool.generateOpId(),parentKey:i}],[{type:1,id:me(a._id),parentKey:s}],u)}}delete(t){if(this._pool?.assertStorageIsWritable(),t<0||t>=this.#e.length)throw new Error(`Cannot delete list item at index "${t}". index should be between 0 and ${this.#e.length-1}`);const n=this.#e[t];n._detach();const[r]=this.#e.splice(t,1);if(this.invalidate(),this._pool){const o=n._id;if(o){const i=new Map;i.set(me(this._id),Ie(this,[mo(t,r)])),this._pool.dispatch([{id:o,opId:this._pool.generateOpId(),type:5}],n._toOps(me(this._id),n._getParentKeyOrThrow()),i)}}}clear(){if(this._pool?.assertStorageIsWritable(),this._pool){const t=[],n=[],r=[];for(const i of this.#e){i._detach();const a=i._id;a&&(t.push({type:5,id:a,opId:this._pool.generateOpId()}),n.push(...i._toOps(me(this._id),i._getParentKeyOrThrow())),r.push(mo(0,i)))}this.#e=[],this.invalidate();const o=new Map;o.set(me(this._id),Ie(this,r)),this._pool.dispatch(t,n,o)}else{for(const t of this.#e)t._detach();this.#e=[],this.invalidate()}}set(t,n){if(this._pool?.assertStorageIsWritable(),t<0||t>=this.#e.length)throw new Error(`Cannot set list item at index "${t}". index should be between 0 and ${this.#e.length-1}`);const r=this.#e[t],o=r._getParentKeyOrThrow(),i=r._id;r._detach();const a=Zn(n);if(a._setParentLink(this,o),this.#e[t]=a,this.invalidate(),this._pool&&this._id){const s=this._pool.generateId();a._attach(s,this._pool);const u=new Map;u.set(this._id,Ie(this,[Ln(t,a)]));const c=go(a._toOps(this._id,o,this._pool),i);this.#n.set(o,me(c[0].opId));const l=go(r._toOps(this._id,o,void 0),s);this._pool.dispatch(c,l,u)}}toArray(){return this.#e.map(t=>Bn(t))}every(t){return this.toArray().every(t)}filter(t){return this.toArray().filter(t)}find(t){return this.toArray().find(t)}findIndex(t){return this.toArray().findIndex(t)}forEach(t){return this.toArray().forEach(t)}get(t){if(!(t<0||t>=this.#e.length))return Bn(this.#e[t])}indexOf(t,n){return this.toArray().indexOf(t,n)}lastIndexOf(t,n){return this.toArray().lastIndexOf(t,n)}map(t){return this.#e.map((n,r)=>t(Bn(n),r))}some(t){return this.toArray().some(t)}[Symbol.iterator](){return new bg(this.#e)}#c(t,n){const r=Ar(t);return r._attach(t.id,me(this._pool)),r._setParentLink(this,n),this._insertAndSort(r),{newItem:r,newIndex:this._indexOfPosition(n)}}#u(t,n){const r=Vt(n,this.#e.length>t+1?this.#e[t+1]?._parentPos:void 0);this.#e[t]._setParentLink(this,r)}_toTreeNode(t){return{type:"LiveList",id:this._id??mr(),key:t,payload:this.#e.map((n,r)=>n.toTreeNode(r.toString()))}}toImmutable(){return super.toImmutable()}_toImmutable(){return this.#e.map(n=>n.toImmutable())}clone(){return new Ea(this.#e.map(t=>t.clone()))}},bg=class{#e;constructor(e){this.#e=e[Symbol.iterator]()}[Symbol.iterator](){return this}next(){const e=this.#e.next();return e.done?{done:!0,value:void 0}:{value:Bn(e.value)}}};function Ie(e,t){return{node:e,type:"LiveList",updates:t}}function Ln(e,t){return{index:e,type:"set",item:t instanceof pn?t.data:t}}function mo(e,t){return{type:"delete",index:e,deletedItem:t instanceof pn?t.data:t}}function Ot(e,t){return{index:e,type:"insert",item:t instanceof pn?t.data:t}}function bn(e,t,n){return{type:"move",index:t,item:n instanceof pn?n.data:n,previousIndex:e}}function go(e,t){return e.map((n,r)=>r===0?{...n,intent:"set",deletedId:t}:n)}var vr=class Aa extends hi{#e;#t;constructor(t){if(super(),this.#t=new Map,t){const n=[];for(const[r,o]of t){const i=Zn(o);i._setParentLink(this,r),n.push([r,i])}this.#e=new Map(n)}else this.#e=new Map}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize item is not attached");const o=[],i={id:this._id,opId:r?.generateOpId(),type:7,parentId:t,parentKey:n};o.push(i);for(const[a,s]of this.#e)o.push(...s._toOps(this._id,a,r));return o}static _deserialize([t,n],r,o){const i=new Aa;i._attach(t,o);const a=r.get(t);if(a===void 0)return i;for(const[s,u]of a){const c=jd([s,u],r,o);c._setParentLink(i,u.parentKey),i.#e.set(u.parentKey,c),i.invalidate()}return i}_attach(t,n){super._attach(t,n);for(const[r,o]of this.#e)Ue(o)&&o._attach(n.generateId(),n)}_attachChild(t,n){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const{id:r,parentKey:o,opId:i}=t,a=o,s=Ar(t);if(this._pool.getNode(r)!==void 0)return{modified:!1};if(n===2){const l=this.#t.get(a);if(l===i)return this.#t.delete(a),{modified:!1};if(l!==void 0)return{modified:!1}}else n===1&&this.#t.delete(a);const u=this.#e.get(a);let c;if(u){const l=me(this._id);c=u._toOps(l,a),u._detach()}else c=[{type:5,id:r}];return s._setParentLink(this,a),s._attach(r,this._pool),this.#e.set(a,s),this.invalidate(),{modified:{node:this,type:"LiveMap",updates:{[a]:{type:"update"}}},reverse:c}}_detach(){super._detach();for(const t of this.#e.values())t._detach()}_detachChild(t){const n=me(this._id),r=me(t._parentKey),o=t._toOps(n,r,this._pool);for(const[i,a]of this.#e)a===t&&(this.#e.delete(i),this.invalidate());return t._detach(),{modified:{node:this,type:"LiveMap",updates:{[r]:{type:"delete"}}},reverse:o}}_serialize(){if(this.parent.type!=="HasParent")throw new Error("Cannot serialize LiveMap if parent is missing");return{type:2,parentId:me(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key}}get(t){const n=this.#e.get(t);if(n!==void 0)return Bn(n)}set(t,n){this._pool?.assertStorageIsWritable();const r=this.#e.get(t);r&&r._detach();const o=Zn(n);if(o._setParentLink(this,t),this.#e.set(t,o),this.invalidate(),this._pool&&this._id){const i=this._pool.generateId();o._attach(i,this._pool);const a=new Map;a.set(this._id,{node:this,type:"LiveMap",updates:{[t]:{type:"update"}}});const s=o._toOps(this._id,t,this._pool);this.#t.set(t,me(s[0].opId)),this._pool.dispatch(o._toOps(this._id,t,this._pool),r?r._toOps(this._id,t):[{type:5,id:i}],a)}}get size(){return this.#e.size}has(t){return this.#e.has(t)}delete(t){this._pool?.assertStorageIsWritable();const n=this.#e.get(t);if(n===void 0)return!1;if(n._detach(),this.#e.delete(t),this.invalidate(),this._pool&&n._id){const r=me(this._id),o=new Map;o.set(r,{node:this,type:"LiveMap",updates:{[t]:{type:"delete"}}}),this._pool.dispatch([{type:5,id:n._id,opId:this._pool.generateOpId()}],n._toOps(r,t),o)}return!0}entries(){const t=this.#e.entries();return{[Symbol.iterator](){return this},next(){const n=t.next();return n.done?{done:!0,value:void 0}:{value:[n.value[0],Bn(n.value[1])]}}}}[Symbol.iterator](){return this.entries()}keys(){return this.#e.keys()}values(){const t=this.#e.values();return{[Symbol.iterator](){return this},next(){const n=t.next();return n.done?{done:!0,value:void 0}:{value:Bn(n.value)}}}}forEach(t){for(const n of this)t(n[1],n[0],this)}_toTreeNode(t){return{type:"LiveMap",id:this._id??mr(),key:t,payload:Array.from(this.#e.entries()).map(([n,r])=>r.toTreeNode(n))}}toImmutable(){return super.toImmutable()}_toImmutable(){const t=new Map;for(const[n,r]of this.#e)t.set(n,r.toImmutable());return t}clone(){return new Aa(Array.from(this.#e).map(([t,n])=>[t,n.clone()]))}},Rn=class Er extends hi{#e;#t;static#n(t){const n=new Map;let r=null;for(const[o,i]of t)if(vg(i))r=[o,i];else{const a=[o,i],s=n.get(i.parentId);s!==void 0?s.push(a):n.set(i.parentId,[a])}if(r===null)throw new Error("Root can't be null");return[r,n]}static _fromItems(t,n){const[r,o]=Er.#n(t);return Er._deserialize(r,o,n)}constructor(t={}){super(),this.#t=new Map;const n=Vr(t);for(const r of Object.keys(n)){const o=n[r];Ue(o)&&o._setParentLink(this,r)}this.#e=new Map(Object.entries(n))}_toOps(t,n,r){if(this._id===void 0)throw new Error("Cannot serialize item is not attached");const o=r?.generateOpId(),i=[],a={type:4,id:this._id,opId:o,parentId:t,parentKey:n,data:{}};i.push(a);for(const[s,u]of this.#e)Ue(u)?i.push(...u._toOps(this._id,s,r)):a.data[s]=u;return i}static _deserialize([t,n],r,o){const i=new Er(n.data);return i._attach(t,o),this._deserializeChildren(i,r,o)}static _deserializeChildren(t,n,r){const o=n.get(me(t._id));if(o===void 0)return t;for(const[i,a]of o){const s=wg([i,a],n,r);Kn(s)&&s._setParentLink(t,a.parentKey),t.#e.set(a.parentKey,s),t.invalidate()}return t}_attach(t,n){super._attach(t,n);for(const[r,o]of this.#e)Ue(o)&&o._attach(n.generateId(),n)}_attachChild(t,n){if(this._pool===void 0)throw new Error("Can't attach child if managed pool is not present");const{id:r,opId:o,parentKey:i}=t,a=Fd(t);if(this._pool.getNode(r)!==void 0)return this.#t.get(i)===o&&this.#t.delete(i),{modified:!1};if(n===0)this.#t.set(i,me(o));else if(this.#t.get(i)!==void 0)return this.#t.get(i)===o?(this.#t.delete(i),{modified:!1}):{modified:!1};const s=me(this._id),u=this.#e.get(i);let c;return Ue(u)?(c=u._toOps(s,i),u._detach()):c=u===void 0?[{type:6,id:s,key:i}]:[{type:3,id:s,data:{[i]:u}}],this.#e.set(i,a),this.invalidate(),Kn(a)&&(a._setParentLink(this,i),a._attach(r,this._pool)),{reverse:c,modified:{node:this,type:"LiveObject",updates:{[i]:{type:"update"}}}}}_detachChild(t){if(t){const n=me(this._id),r=me(t._parentKey),o=t._toOps(n,r,this._pool);for(const[i,a]of this.#e)a===t&&(this.#e.delete(i),this.invalidate());return t._detach(),{modified:{node:this,type:"LiveObject",updates:{[r]:{type:"delete"}}},reverse:o}}return{modified:!1}}_detach(){super._detach();for(const t of this.#e.values())Ue(t)&&t._detach()}_apply(t,n){return t.type===3?this.#r(t,n):t.type===6?this.#i(t,n):super._apply(t,n)}_serialize(){const t={};for(const[n,r]of this.#e)Ue(r)||(t[n]=r);return this.parent.type==="HasParent"&&this.parent.node._id?{type:0,parentId:this.parent.node._id,parentKey:this.parent.key,data:t}:{type:0,data:t}}#r(t,n){let r=!1;const o=me(this._id),i=[],a={type:3,id:o,data:{}};for(const u in t.data){const c=this.#e.get(u);Ue(c)?(i.push(...c._toOps(o,u)),c._detach()):c!==void 0?a.data[u]=c:c===void 0&&i.push({type:6,id:o,key:u})}const s={};for(const u in t.data){const c=t.data[u];if(c===void 0)continue;if(n)this.#t.set(u,me(t.opId));else{if(this.#t.get(u)!==void 0){if(this.#t.get(u)===t.opId){this.#t.delete(u);continue}continue}r=!0}const l=this.#e.get(u);Ue(l)&&l._detach(),r=!0,s[u]={type:"update"},this.#e.set(u,c),this.invalidate()}return Object.keys(a.data).length!==0&&i.unshift(a),r?{modified:{node:this,type:"LiveObject",updates:s},reverse:i}:{modified:!1}}#i(t,n){const r=t.key;if(this.#e.has(r)===!1)return{modified:!1};if(!n&&this.#t.get(r)!==void 0)return{modified:!1};const o=this.#e.get(r),i=me(this._id);let a=[];return Ue(o)?(a=o._toOps(i,t.key),o._detach()):o!==void 0&&(a=[{type:3,id:i,data:{[r]:o}}]),this.#e.delete(r),this.invalidate(),{modified:{node:this,type:"LiveObject",updates:{[t.key]:{type:"delete"}}},reverse:a}}toObject(){return Object.fromEntries(this.#e)}set(t,n){this._pool?.assertStorageIsWritable(),this.update({[t]:n})}get(t){return this.#e.get(t)}delete(t){this._pool?.assertStorageIsWritable();const n=t,r=this.#e.get(n);if(r===void 0)return;if(this._pool===void 0||this._id===void 0)return Ue(r)&&r._detach(),this.#e.delete(n),void this.invalidate();let o;Ue(r)?(r._detach(),o=r._toOps(this._id,n)):o=[{type:3,data:{[n]:r},id:this._id}],this.#e.delete(n),this.invalidate();const i=new Map;i.set(this._id,{node:this,type:"LiveObject",updates:{[t]:{type:"delete"}}}),this._pool.dispatch([{type:6,key:n,id:this._id,opId:this._pool.generateOpId()}],o,i)}update(t){if(this._pool?.assertStorageIsWritable(),this._pool===void 0||this._id===void 0){for(const c in t){const l=t[c];if(l===void 0)continue;const d=this.#e.get(c);Ue(d)&&d._detach(),Ue(l)&&l._setParentLink(this,c),this.#e.set(c,l),this.invalidate()}return}const n=[],r=[],o=this._pool.generateOpId(),i={},a={id:this._id,type:3,data:{}},s={};for(const c in t){const l=t[c];if(l===void 0)continue;const d=this.#e.get(c);if(Ue(d)?(r.push(...d._toOps(this._id,c)),d._detach()):d===void 0?r.push({type:6,id:this._id,key:c}):a.data[c]=d,Ue(l)){l._setParentLink(this,c),l._attach(this._pool.generateId(),this._pool);const p=l._toOps(this._id,c,this._pool),m=p.find(g=>g.parentId===this._id);m&&this.#t.set(c,me(m.opId)),n.push(...p)}else i[c]=l,this.#t.set(c,o);this.#e.set(c,l),this.invalidate(),s[c]={type:"update"}}Object.keys(a.data).length!==0&&r.unshift(a),Object.keys(i).length!==0&&n.unshift({opId:o,id:this._id,type:3,data:i});const u=new Map;u.set(this._id,{node:this,type:"LiveObject",updates:s}),this._pool.dispatch(n,r,u)}toImmutable(){return super.toImmutable()}toTreeNode(t){return super.toTreeNode(t)}_toTreeNode(t){const n=this._id??mr();return{type:"LiveObject",id:n,key:t,payload:Array.from(this.#e.entries()).map(([r,o])=>Ue(o)?o.toTreeNode(r):{type:"Json",id:`${n}:${r}`,key:r,payload:o})}}_toImmutable(){const t={};for(const[n,r]of this.#e)t[n]=Kn(r)?r.toImmutable():r;return t}clone(){return new Er(Object.fromEntries(Array.from(this.#e).map(([t,n])=>[t,Kn(n)?n.clone():Sr(n)])))}};function Ar(e){return Zn(Fd(e))}function Fd(e){switch(e.type){case 8:return e.data;case 4:return new Rn(e.data);case 7:return new vr;case 2:return new gr([]);default:return ft(0,"Unknown creation Op")}}function Td(e,t){return e===t||e.parent.type==="HasParent"&&Td(e.parent.node,t)}function jd([e,t],n,r){switch(t.type){case 0:return Rn._deserialize([e,t],n,r);case 1:return gr._deserialize([e,t],n,r);case 2:return vr._deserialize([e,t],n,r);case 3:return pn._deserialize([e,t],n,r);default:throw new Error("Unexpected CRDT type")}}function wg([e,t],n,r){switch(t.type){case 0:return Rn._deserialize([e,t],n,r);case 1:return gr._deserialize([e,t],n,r);case 2:return vr._deserialize([e,t],n,r);case 3:return t.data;default:throw new Error("Unexpected CRDT type")}}function Kn(e){return Rd(e)||function(t){return t instanceof vr}(e)||function(t){return t instanceof Rn}(e)}function Ue(e){return Kn(e)||function(t){return t instanceof pn}(e)}function Rd(e){return e instanceof gr}function Bn(e){return e instanceof pn?e.data:e instanceof gr||e instanceof vr||e instanceof Rn?e:ft(0,"Unknown AbstractCrdt")}function Zn(e){return e instanceof Rn||e instanceof vr||e instanceof gr?e:new pn(e)}function Ni(e,t){return e===void 0?t:e.type==="LiveObject"&&t.type==="LiveObject"?function(n,r){const o=n.updates;for(const[i,a]of ga(r.updates))o[i]=a;return{...r,updates:o}}(e,t):e.type==="LiveMap"&&t.type==="LiveMap"?function(n,r){const o=n.updates;for(const[i,a]of ga(r.updates))o[i]=a;return{...r,updates:o}}(e,t):e.type==="LiveList"&&t.type==="LiveList"?function(n,r){const o=n.updates;return{...r,updates:o.concat(r.updates)}}(e,t):t}var Pi=class{#e;#t;#n;#r;constructor(){this.#e={},this.#t=0,this.#n=1,this.#r=0}get length(){return this.#r}*[Symbol.iterator](){const e=this.#r,t=this.#t;for(let n=0;n<e;n++)yield this.#e[t+n]}push(e){const t=Array.isArray(e)?e:[e];this.#n>Number.MAX_SAFE_INTEGER-t.length-1&&Yt("Deque full");for(const n of t)this.#e[this.#n++-1]=n;this.#r+=t.length}pop(){if(this.#r<1)return;this.#n--;const e=this.#e[this.#n-1];return delete this.#e[this.#n-1],this.#r--,e}pushLeft(e){const t=Array.isArray(e)?e:[e];this.#t<Number.MIN_SAFE_INTEGER+t.length&&Yt("Deque full");for(let n=t.length-1;n>=0;n--)this.#e[--this.#t]=t[n];this.#r+=t.length}popLeft(){if(this.#r<1)return;const e=this.#e[this.#t];return delete this.#e[this.#t],this.#t++,this.#r--,e}};function ku(e){return Array.isArray(e)}var Cg=class{#e;#t;signal;constructor(){this.#e=new On({connections:new Map,presences:new Map}),this.signal=Ke.from(this.#e,e=>va(Array.from(this.#e.get().presences.keys()).map(t=>this.getUser(Number(t))))),this.#t=new Map}get(){return this.signal.get()}connectionIds(){return this.#e.get().connections.keys()}clearOthers(){this.#e.mutate(e=>{e.connections.clear(),e.presences.clear(),this.#t.clear()})}#n(e){const t=this.#e.get(),n=t.connections.get(e),r=t.presences.get(e);if(n!==void 0&&r!==void 0)return function(o,i){const{connectionId:a,id:s,info:u}=o,c=Ca(o.scopes);return Vr({connectionId:a,id:s,info:u,canWrite:c,canComment:Sd(o.scopes),isReadOnly:!c,presence:i})}(n,r)}getUser(e){const t=this.#t.get(e);if(t)return t;const n=this.#n(e);return n?(this.#t.set(e,n),n):void 0}#r(e){this.#t.delete(e)}setConnection(e,t,n,r){this.#e.mutate(o=>(o.connections.set(e,{connectionId:e,id:t,info:n,scopes:r}),!!o.presences.has(e)&&this.#r(e)))}removeConnection(e){this.#e.mutate(t=>{t.connections.delete(e),t.presences.delete(e),this.#r(e)})}setOther(e,t){this.#e.mutate(n=>(n.presences.set(e,Vr(t)),!!n.connections.has(e)&&this.#r(e)))}patchOther(e,t){this.#e.mutate(n=>{const r=n.presences.get(e);if(r===void 0)return!1;const o=bd(r,t);return r!==o&&(n.presences.set(e,o),this.#r(e))})}},_d=class Nd extends Error{context;constructor(t,n,r){super(t,{cause:r}),this.context=n,this.name="LiveblocksError"}get roomId(){return this.context.roomId}get code(){return this.context.code}static from(t,n){return new Nd(function(r){switch(r.type){case"ROOM_CONNECTION_ERROR":switch(r.code){case 4001:return"Not allowed to connect to the room";case 4005:return"Room is already full";case 4006:return"Kicked out of the room, because the room ID changed";default:return"Could not connect to the room"}case"CREATE_THREAD_ERROR":return"Could not create new thread";case"DELETE_THREAD_ERROR":return"Could not delete thread";case"EDIT_THREAD_METADATA_ERROR":return"Could not edit thread metadata";case"MARK_THREAD_AS_RESOLVED_ERROR":return"Could not mark thread as resolved";case"MARK_THREAD_AS_UNRESOLVED_ERROR":return"Could not mark thread as unresolved";case"CREATE_COMMENT_ERROR":return"Could not create new comment";case"EDIT_COMMENT_ERROR":return"Could not edit comment";case"DELETE_COMMENT_ERROR":return"Could not delete comment";case"ADD_REACTION_ERROR":return"Could not add reaction";case"REMOVE_REACTION_ERROR":return"Could not remove reaction";case"MARK_INBOX_NOTIFICATION_AS_READ_ERROR":return"Could not mark inbox notification as read";case"DELETE_INBOX_NOTIFICATION_ERROR":return"Could not delete inbox notification";case"MARK_ALL_INBOX_NOTIFICATIONS_AS_READ_ERROR":return"Could not mark all inbox notifications as read";case"DELETE_ALL_INBOX_NOTIFICATIONS_ERROR":return"Could not delete all inbox notifications";case"UPDATE_NOTIFICATION_SETTINGS_ERROR":return"Could not update notification settings";case"UPDATE_USER_NOTIFICATION_SETTINGS_ERROR":return"Could not update user notification settings";default:return ft(0,"Unhandled case")}}(t),t,n)}},Su=1048064;function Iu(e,t){return{type:"User",id:`${t.connectionId}`,key:e,payload:{connectionId:t.connectionId,id:t.id,info:t.info,presence:t.presence,isReadOnly:!t.canWrite}}}function Dg(e,t){const n=t.roomId,r=e.initialPresence,o=e.initialStorage,i=t.roomHttpClient,[a,s]=function(){const x=typeof document<"u"?document:void 0,L={current:null};function V(){L.current=x?.visibilityState==="hidden"?L.current??Date.now():null}return x?.addEventListener("visibilitychange",V),[L,()=>{x?.removeEventListener("visibilitychange",V)}]}(),u={...t.delegates,canZombie:()=>t.backgroundKeepAliveTimeout!==void 0&&a.current!==null&&Date.now()>a.current+t.backgroundKeepAliveTimeout&&Q()!=="synchronizing"},c=new dg(u,t.enableDebugLogging),l={buffer:{flushTimerID:void 0,lastFlushedAt:0,presenceUpdates:{type:"full",data:r},messages:[],storageOperations:[]},staticSessionInfoSig:new jt(null),dynamicSessionInfoSig:new jt(null),myPresence:new Ym(r),others:new Cg,initialStorage:o,idFactory:null,yjsProvider:void 0,yjsProviderDidChange:ke(),pool:gg(n,{getCurrentConnectionId:function(){const x=l.dynamicSessionInfoSig.get();if(x)return x.actor;throw new Error("Internal. Tried to get connection id but connection was never open")},onDispatch:function(x,L,V){if(l.activeBatch){for(const Y of x)l.activeBatch.ops.push(Y);for(const[Y,ne]of V)l.activeBatch.updates.storageUpdates.set(Y,Ni(l.activeBatch.updates.storageUpdates.get(Y),ne));l.activeBatch.reverseOps.pushLeft(L)}else k(L),l.redoStack.length=0,ie(x),T({storageUpdates:V})},isStorageWritable:function(){const x=l.dynamicSessionInfoSig.get()?.scopes;return x===void 0||Ca(x)}}),root:void 0,undoStack:[],redoStack:[],pausedHistory:null,activeBatch:null,unacknowledgedOps:new Map};let d,p,m=!1;c.events.onMessage.subscribe(function(x){if(typeof x.data!="string")return;const L=function(Y){const ne=fi(Y);return ne===void 0?null:ku(ne)?va(ne.map(fe=>J(fe))):va([J(ne)])}(x.data);if(L===null||L.length===0)return;const V={storageUpdates:new Map,others:[]};for(const Y of L)switch(Y.type){case 101:{const ne=U(Y);ne&&V.others.push(ne);break}case 100:{const ne=P(Y);ne&&V.others.push(ne);break}case 103:{const ne=l.others.get();g.customEvent.notify({connectionId:Y.actor,user:Y.actor<0?null:ne.find(fe=>fe.connectionId===Y.actor)??null,event:Y.event});break}case 102:{const ne=H(Y);ne&&V.others.push(ne);break}case 300:g.ydoc.notify(Y);break;case 104:V.others.push(G(Y));break;case 200:pe(Y);break;case 201:{const ne=F(Y.ops,!1);for(const[fe,xe]of ne.updates.storageUpdates)V.storageUpdates.set(fe,Ni(V.storageUpdates.get(fe),xe));break}case 299:md("Storage mutation rejection error",Y.reason);break;case 400:case 407:case 401:case 408:case 405:case 406:case 402:case 403:case 404:g.comments.notify(Y)}T(V)}),c.events.statusDidChange.subscribe(function(x){const L=c.authValue;if(L!==null){const V=Ed(L);if(V!==d)if(d=V,L.type==="secret"){const Y=L.token.parsed;l.staticSessionInfoSig.set({userId:Y.k==="sec-legacy"?Y.id:Y.uid,userInfo:Y.k==="sec-legacy"?Y.info:Y.ui})}else l.staticSessionInfoSig.set({userId:void 0,userInfo:void 0})}g.status.notify(x),A()}),c.events.statusDidChange.subscribe(function(x){x==="reconnecting"?p=setTimeout(()=>{g.lostConnection.notify("lost"),m=!0,l.others.clearOthers(),T({others:[{type:"reset"}]})},t.lostConnectionTimeout):(clearTimeout(p),m&&(x==="disconnected"?g.lostConnection.notify("failed"):g.lostConnection.notify("restored"),m=!1))}),c.events.didConnect.subscribe(function(){l.buffer.presenceUpdates={type:"full",data:{...l.myPresence.get()}},de!==null&&I({flush:!1}),X()}),c.events.didDisconnect.subscribe(function(){clearTimeout(l.buffer.flushTimerID)}),c.events.onConnectionError.subscribe(({message:x,code:L})=>{const V=new _d(x,{type:"ROOM_CONNECTION_ERROR",code:L,roomId:n});t.errorEventSource.notify(V)});const g={status:ke(),lostConnection:ke(),customEvent:ke(),self:ke(),myPresence:ke(),others:ke(),storageBatch:ke(),history:ke(),storageDidLoad:ke(),storageStatus:ke(),ydoc:ke(),comments:ke(),roomWillDestroy:ke()};function*y(x){const{ops:L,...V}=x;if(L.length<2)throw new Error("Cannot split ops into smaller chunks");const Y=Math.floor(L.length/2),ne=L.slice(0,Y),fe=L.slice(Y);for(const xe of[ne,fe]){const De={ops:xe,...V},Fe=qt([De]);b(Fe)?yield*y(De):yield Fe}}function*f(x){if(x.length<2){if(x[0].type===201)return void(yield*y(x[0]));throw new Error("Cannot split into chunks smaller than the allowed message size")}const L=Math.floor(x.length/2),V=x.slice(0,L),Y=x.slice(L);for(const ne of[V,Y]){const fe=qt(ne);b(fe)?yield*f(ne):yield fe}}function b(x){return!(4*x.length<Su)&&new TextEncoder().encode(x).length>=Su}function C(x){const L=t.largeMessageStrategy??"default",V=qt(x);if(!b(V))return c.send(V);switch(L){case"default":return void no("Message is too large for websockets, not sending. Configure largeMessageStrategy option to deal with this.");case"split":at("Message is too large for websockets, splitting into smaller chunks");for(const Y of f(x))c.send(Y);return;case"experimental-fallback-to-http":{at("Message is too large for websockets, so sending over HTTP instead");const Y=l.dynamicSessionInfoSig.get()?.nonce??Yt("Session is not authorized to send message over HTTP");return void i.sendMessages({roomId:n,nonce:Y,messages:x}).then(ne=>{ne.ok||ne.status!==403||c.reconnect()})}}}const D=Ke.from(l.staticSessionInfoSig,l.dynamicSessionInfoSig,l.myPresence,(x,L,V)=>{if(x===null||L===null)return null;{const Y=Ca(L.scopes);return{connectionId:L.actor,id:x.userId,info:x.userInfo,presence:V,canWrite:Y,canComment:Sd(L.scopes)}}});let E;function A(){const x=D.get();x!==null&&x!==E&&(g.self.notify(x),E=x)}const B=Ke.from(D,x=>x!==null?Iu("Me",x):null);function O(x){if(x.items.length===0)throw new Error("Internal error: cannot load storage without items");l.root!==void 0?function(ne){if(l.root===void 0)return;const fe=new Map;for(const[De,Fe]of l.pool.nodes)fe.set(De,Fe._serialize());const xe=function(De,Fe){const $e=[];return De.forEach((Se,Me)=>{Fe.get(Me)||$e.push({type:5,id:Me})}),Fe.forEach((Se,Me)=>{const xt=De.get(Me);if(xt)Se.type===0&&(xt.type===0&&qt(Se.data)===qt(xt.data)||$e.push({type:3,id:Me,data:Se.data})),Se.parentKey!==xt.parentKey&&$e.push({type:1,id:Me,parentKey:me(Se.parentKey,"Parent key must not be missing")});else switch(Se.type){case 3:$e.push({type:8,id:Me,parentId:Se.parentId,parentKey:Se.parentKey,data:Se.data});break;case 1:$e.push({type:2,id:Me,parentId:Se.parentId,parentKey:Se.parentKey});break;case 0:if(Se.parentId===void 0||Se.parentKey===void 0)throw new Error("Internal error. Cannot serialize storage root into an operation");$e.push({type:4,id:Me,parentId:Se.parentId,parentKey:Se.parentKey,data:Se.data});break;case 2:$e.push({type:7,id:Me,parentId:Se.parentId,parentKey:Se.parentKey})}}),$e}(fe,new Map(ne));T(F(xe,!1).updates)}(x.items):l.root=Rn._fromItems(x.items,l.pool);const L=D.get()?.canWrite??!0,V=l.undoStack.length;for(const ne in l.initialStorage)l.root.get(ne)===void 0&&(L?l.root.set(ne,(Y=l.initialStorage[ne])===void 0?void 0:Kn(Y)?Y.clone():Sr(Y)):at(`Attempted to populate missing storage key '${ne}', but current user has no write access`));var Y;l.undoStack.length=V}function S(x){l.undoStack.length>=50&&l.undoStack.shift(),l.undoStack.push(x),W()}function k(x){l.pausedHistory!==null?l.pausedHistory.pushLeft(x):S(x)}function T(x){const L=x.storageUpdates,V=x.others;if(V!==void 0&&V.length>0){const Y=l.others.get();for(const ne of V)g.others.notify({...ne,others:Y})}if(x.presence&&(A(),g.myPresence.notify(l.myPresence.get())),L!==void 0&&L.size>0){const Y=Array.from(L.values());g.storageBatch.notify(Y)}ce()}function F(x,L){const V={reverse:new Pi,storageUpdates:new Map,presence:!1},Y=new Set,ne=x.map(fe=>fe.type==="presence"||fe.opId?fe:{...fe,opId:l.pool.generateOpId()});for(const fe of ne)if(fe.type==="presence"){const xe={type:"presence",data:{}};for(const De in fe.data)xe.data[De]=l.myPresence.get()[De];if(l.myPresence.patch(fe.data),l.buffer.presenceUpdates===null)l.buffer.presenceUpdates={type:"partial",data:fe.data};else for(const De in fe.data)l.buffer.presenceUpdates.data[De]=fe.data[De];V.reverse.pushLeft(xe),V.presence=!0}else{let xe;if(L)xe=0;else{const Fe=me(fe.opId);xe=l.unacknowledgedOps.delete(Fe)?2:1}const De=R(fe,xe);if(De.modified){const Fe=De.modified.node._id;Fe&&Y.has(Fe)||(V.storageUpdates.set(me(De.modified.node._id),Ni(V.storageUpdates.get(me(De.modified.node._id)),De.modified)),V.reverse.pushLeft(De.reverse)),fe.type!==2&&fe.type!==7&&fe.type!==4||Y.add(me(fe.id))}}return{ops:ne,reverse:Array.from(V.reverse),updates:{storageUpdates:V.storageUpdates,presence:V.presence}}}function R(x,L){if(function(V){return V.type===5&&V.id==="ACK"}(x))return{modified:!1};switch(x.type){case 6:case 3:case 5:{const V=l.pool.nodes.get(x.id);return V===void 0?{modified:!1}:V._apply(x,L===0)}case 1:{const V=l.pool.nodes.get(x.id);return V===void 0?{modified:!1}:V.parent.type==="HasParent"&&Rd(V.parent.node)?V.parent.node._setChildKey(Hr(x.parentKey),V,L):{modified:!1}}case 4:case 2:case 7:case 8:{if(x.parentId===void 0)return{modified:!1};const V=l.pool.nodes.get(x.parentId);return V===void 0?{modified:!1}:V._attachChild(x,L)}}}function P(x){if(x.targetActor!==void 0){const V=l.others.getUser(x.actor);l.others.setOther(x.actor,x.data);const Y=l.others.getUser(x.actor);if(V===void 0&&Y!==void 0)return{type:"enter",user:Y}}else l.others.patchOther(x.actor,x.data);const L=l.others.getUser(x.actor);return L?{type:"update",updates:x.data,user:L}:void 0}function H(x){const L=l.others.getUser(x.actor);return L?(l.others.removeConnection(x.actor),{type:"leave",user:L}):null}function G(x){l.dynamicSessionInfoSig.set({actor:x.actor,nonce:x.nonce,scopes:x.scopes}),l.idFactory=function(L){let V=0;return()=>`${L}:${V++}`}(x.actor),A();for(const L of l.others.connectionIds())x.users[L]===void 0&&l.others.removeConnection(L);for(const L in x.users){const V=x.users[L],Y=Number(L);l.others.setConnection(Y,V.id,V.info,V.scopes)}return{type:"reset"}}function Z(){return l.undoStack.length>0}function $(){return l.redoStack.length>0}function W(){g.history.notify({canUndo:Z(),canRedo:$()})}function U(x){l.others.setConnection(x.actor,x.id,x.info,x.scopes),l.buffer.messages.push({type:100,data:l.myPresence.get(),targetActor:x.actor}),X();const L=l.others.getUser(x.actor);return L?{type:"enter",user:L}:void 0}function J(x){return function(L){return!function(V){return V===null||typeof V=="string"||typeof V=="number"||typeof V=="boolean"}(L)&&!ku(L)}(x)?x:null}function X(){const x=l.buffer.storageOperations;if(x.length>0){for(const Y of x)l.unacknowledgedOps.set(me(Y.opId),Y);ce()}if(c.getStatus()!=="connected")return void(l.buffer.storageOperations=[]);const L=Date.now(),V=L-l.buffer.lastFlushedAt;if(V>=t.throttleDelay){const Y=function(){const ne=[];l.buffer.presenceUpdates&&ne.push(l.buffer.presenceUpdates.type==="full"?{type:100,targetActor:-1,data:l.buffer.presenceUpdates.data}:{type:100,data:l.buffer.presenceUpdates.data});for(const fe of l.buffer.messages)ne.push(fe);return l.buffer.storageOperations.length>0&&ne.push({type:201,ops:l.buffer.storageOperations}),ne}();if(Y.length===0)return;C(Y),l.buffer={flushTimerID:void 0,lastFlushedAt:L,messages:[],storageOperations:[],presenceUpdates:null}}else clearTimeout(l.buffer.flushTimerID),l.buffer.flushTimerID=setTimeout(X,t.throttleDelay-V)}function ie(x){const{storageOperations:L}=l.buffer;for(const V of x)L.push(V);X()}let de=null,ee=null;function pe(x){const L=new Map(l.unacknowledgedOps);O(x),function(V){if(V.size===0)return;const Y=[],ne=F(Array.from(V.values()),!0);Y.push({type:201,ops:ne.ops}),T(ne.updates),C(Y)}(L),ee?.(),ce(),g.storageDidLoad.notify()}function I(x){const L=l.buffer.messages;t.unstable_streamData?async function(){c.authValue&&pe({items:await i.streamStorage({roomId:n})})}():L.some(V=>V.type===200)||L.push({type:200}),x.flush&&X()}function N(){return de===null&&(I({flush:!0}),de=new Promise(x=>{ee=x}),ce()),de}function _(){const x=l.root;return x!==void 0?x:(N(),null)}async function K(){return l.root!==void 0?Promise.resolve({root:l.root}):(await N(),{root:me(l.root)})}const oe=t.createSyncSource();function Q(){return l.root===void 0?de===null?"not-loaded":"loading":l.unacknowledgedOps.size===0?"synchronized":"synchronizing"}let ue=Q();function ce(){const x=Q();ue!==x&&(ue=x,g.storageStatus.notify(x)),oe.setSyncStatus(x==="synchronizing"?"synchronizing":"synchronized")}function he(){return D.get()!==null}function be(){return _()!==null}const le=Ke.from(l.others.signal,x=>x.map((L,V)=>Iu(`Other ${V}`,L))),Ae={status:g.status.observable,lostConnection:g.lostConnection.observable,customEvent:g.customEvent.observable,others:g.others.observable,self:g.self.observable,myPresence:g.myPresence.observable,storage:g.storageBatch.observable,storageBatch:g.storageBatch.observable,history:g.history.observable,storageDidLoad:g.storageDidLoad.observable,storageStatus:g.storageStatus.observable,ydoc:g.ydoc.observable,comments:g.comments.observable,roomWillDestroy:g.roomWillDestroy.observable},re=t.createSyncSource();function Ce(x){return re.setSyncStatus(x==="synchronizing"?"synchronizing":"synchronized")}return Object.defineProperty({[Oe]:{get presenceBuffer(){return Sr(l.buffer.presenceUpdates?.data??null)},get undoStack(){return Sr(l.undoStack)},get nodeCount(){return l.pool.nodes.size},getYjsProvider:()=>l.yjsProvider,setYjsProvider(x){l.yjsProvider?.off("status",Ce),l.yjsProvider=x,x?.on("status",Ce),l.yjsProviderDidChange.notify()},yjsProviderDidChange:l.yjsProviderDidChange.observable,reportTextEditor:async function(x,L){await i.reportTextEditor({roomId:n,type:x,rootKey:L})},createTextMention:async function(x,L){return i.createTextMention({roomId:n,userId:x,mentionId:L})},deleteTextMention:async function(x){return i.deleteTextMention({roomId:n,mentionId:x})},listTextVersions:async function(){return i.listTextVersions({roomId:n})},listTextVersionsSince:async function(x){return i.listTextVersionsSince({roomId:n,since:x.since,signal:x.signal})},getTextVersion:async function(x){return i.getTextVersion({roomId:n,versionId:x})},createTextVersion:async function(){return i.createTextVersion({roomId:n})},executeContextualPrompt:async function(x){return i.executeContextualPrompt({roomId:n,...x})},getSelf_forDevTools:()=>B.get(),getOthers_forDevTools:()=>le.get(),simulate:{explicitClose:x=>c._privateSendMachineEvent({type:"EXPLICIT_SOCKET_CLOSE",event:x}),rawSend:x=>c.send(x)},attachmentUrlsStore:i.getOrCreateAttachmentUrlsStore(n)},id:n,subscribe:Eg(n,Ae,t.errorEventSource),connect:()=>c.connect(),reconnect:()=>c.reconnect(),disconnect:()=>c.disconnect(),destroy:()=>{const{roomWillDestroy:x,...L}=g;for(const V of Object.values(L))V[Symbol.dispose]();g.roomWillDestroy.notify(),l.yjsProvider?.off("status",Ce),oe.destroy(),re.destroy(),s(),c.destroy(),x[Symbol.dispose]()},updatePresence:function(x,L){const V={};l.buffer.presenceUpdates===null&&(l.buffer.presenceUpdates={type:"partial",data:{}});for(const Y in x){const ne=x[Y];ne!==void 0&&(l.buffer.presenceUpdates.data[Y]=ne,V[Y]=l.myPresence.get()[Y])}l.myPresence.patch(x),l.activeBatch?(L?.addToHistory&&l.activeBatch.reverseOps.pushLeft({type:"presence",data:V}),l.activeBatch.updates.presence=!0):(X(),L?.addToHistory&&k([{type:"presence",data:V}]),T({presence:!0}))},updateYDoc:function(x,L,V){const Y={type:301,update:x,guid:L,v2:V};l.buffer.messages.push(Y),g.ydoc.notify(Y),X()},broadcastEvent:function(x,L={shouldQueueEventIfNotReady:!1}){(c.getStatus()==="connected"||L.shouldQueueEventIfNotReady)&&(l.buffer.messages.push({type:103,event:x}),X())},batch:function(x){if(l.activeBatch)return x();let L;l.activeBatch={ops:[],updates:{storageUpdates:new Map,presence:!1,others:[]},reverseOps:new Pi};try{L=x()}finally{const V=l.activeBatch;l.activeBatch=null,V.reverseOps.length>0&&k(Array.from(V.reverseOps)),V.ops.length>0&&(l.redoStack.length=0),V.ops.length>0&&ie(V.ops),T(V.updates),X()}return L},history:{undo:function(){if(l.activeBatch)throw new Error("undo is not allowed during a batch");const x=l.undoStack.pop();if(x===void 0)return;l.pausedHistory=null;const L=F(x,!0);T(L.updates),l.redoStack.push(L.reverse),W();for(const V of L.ops)V.type!=="presence"&&l.buffer.storageOperations.push(V);X()},redo:function(){if(l.activeBatch)throw new Error("redo is not allowed during a batch");const x=l.redoStack.pop();if(x===void 0)return;l.pausedHistory=null;const L=F(x,!0);T(L.updates),l.undoStack.push(L.reverse),W();for(const V of L.ops)V.type!=="presence"&&l.buffer.storageOperations.push(V);X()},canUndo:Z,canRedo:$,clear:function(){l.undoStack.length=0,l.redoStack.length=0},pause:function(){l.pausedHistory===null&&(l.pausedHistory=new Pi)},resume:function(){const x=l.pausedHistory;l.pausedHistory=null,x!==null&&x.length>0&&S(Array.from(x))}},fetchYDoc:function(x,L,V){l.buffer.messages.find(Y=>Y.type===300&&Y.vector===x&&Y.guid===L&&Y.v2===V)||l.buffer.messages.push({type:300,vector:x,guid:L,v2:V}),X()},getStorage:K,getStorageSnapshot:_,getStorageStatus:Q,isPresenceReady:he,isStorageReady:be,waitUntilPresenceReady:pu(async function(){for(;!he();){const{promise:x,resolve:L}=yd(),V=Ae.self.subscribeOnce(L),Y=Ae.status.subscribeOnce(L);await x,V(),Y()}}),waitUntilStorageReady:pu(async function(){for(;!be();)await K()}),events:Ae,getStatus:()=>c.getStatus(),getSelf:()=>D.get(),getPresence:()=>l.myPresence.get(),getOthers:()=>l.others.get(),getThreads:async function(x){return i.getThreads({roomId:n,query:x?.query,cursor:x?.cursor})},getThreadsSince:async function(x){return i.getThreadsSince({roomId:n,since:x.since,signal:x.signal})},getThread:async function(x){return i.getThread({roomId:n,threadId:x})},createThread:async function(x){return i.createThread({roomId:n,threadId:x.threadId,commentId:x.commentId,metadata:x.metadata,body:x.body,attachmentIds:x.attachmentIds})},deleteThread:async function(x){return i.deleteThread({roomId:n,threadId:x})},editThreadMetadata:async function({metadata:x,threadId:L}){return i.editThreadMetadata({roomId:n,threadId:L,metadata:x})},markThreadAsResolved:async function(x){return i.markThreadAsResolved({roomId:n,threadId:x})},markThreadAsUnresolved:async function(x){return i.markThreadAsUnresolved({roomId:n,threadId:x})},createComment:async function(x){return i.createComment({roomId:n,threadId:x.threadId,commentId:x.commentId,body:x.body,attachmentIds:x.attachmentIds})},editComment:async function(x){return i.editComment({roomId:n,threadId:x.threadId,commentId:x.commentId,body:x.body,attachmentIds:x.attachmentIds})},deleteComment:async function({threadId:x,commentId:L}){return i.deleteComment({roomId:n,threadId:x,commentId:L})},addReaction:async function({threadId:x,commentId:L,emoji:V}){return i.addReaction({roomId:n,threadId:x,commentId:L,emoji:V})},removeReaction:async function({threadId:x,commentId:L,emoji:V}){return await i.removeReaction({roomId:n,threadId:x,commentId:L,emoji:V})},prepareAttachment:function(x){return{type:"localAttachment",status:"idle",id:Cd(),name:x.name,size:x.size,mimeType:x.type,file:x}},uploadAttachment:async function(x,L={}){return i.uploadAttachment({roomId:n,attachment:x,signal:L.signal})},getAttachmentUrl:function(x){return i.getAttachmentUrl({roomId:n,attachmentId:x})},getNotificationSettings:function(x){return i.getNotificationSettings({roomId:n,signal:x?.signal})},updateNotificationSettings:function(x){return i.updateNotificationSettings({roomId:n,settings:x})},markInboxNotificationAsRead:async function(x){await i.markRoomInboxNotificationAsRead({roomId:n,inboxNotificationId:x})}},Oe,{enumerable:!1})}function Eg(e,t,n){function r(o,i){return t.storageBatch.subscribe(a=>{const s=a.filter(u=>Td(u.node,o));s.length>0&&i(s)})}return function(o,i,a){if(typeof o=="string"&&((s=o)==="my-presence"||s==="others"||s==="event"||s==="error"||s==="history"||s==="status"||s==="storage-status"||s==="lost-connection"||s==="connection"||s==="comments")){if(typeof i!="function")throw new Error("Second argument must be a callback function");const u=i;switch(o){case"event":return t.customEvent.subscribe(u);case"my-presence":return t.myPresence.subscribe(u);case"others":{const c=u;return t.others.subscribe(l=>{const{others:d,...p}=l;return c(d,p)})}case"error":return n.subscribe(c=>{if(c.roomId===e)return u(c)});case"status":return t.status.subscribe(u);case"lost-connection":return t.lostConnection.subscribe(u);case"history":return t.history.subscribe(u);case"storage-status":return t.storageStatus.subscribe(u);case"comments":return t.comments.subscribe(u);default:return ft(0,`"${String(o)}" is not a valid event name`)}}var s;if(i===void 0||typeof o=="function"){if(typeof o=="function"){const u=o;return t.storageBatch.subscribe(u)}throw new Error("Please specify a listener callback")}if(Ue(o)){const u=o;return a?.isDeep?r(u,i):function(c,l){return t.storageBatch.subscribe(d=>{for(const p of d)p.node._id===c._id&&l(p.node)})}(u,i)}throw new Error(`${String(o)} is not a value that can be subscribed to.`)}}function Ag(e,t){return async()=>t.getAuthValue({requestedScope:"room:read",roomId:e})}function xg(e,t,n){return r=>{const o=n??(typeof WebSocket>"u"?void 0:WebSocket);if(o===void 0)throw new En("To use Liveblocks client in a non-DOM environment, you need to provide a WebSocket polyfill.");const i=new URL(t);if(i.protocol=i.protocol==="http:"?"ws":"wss",i.pathname="/v7",i.searchParams.set("roomId",e),r.type==="secret")i.searchParams.set("tok",r.token.raw);else{if(r.type!=="public")return ft(0,"Unhandled case");i.searchParams.set("pubkey",r.publicApiKey)}return i.searchParams.set("version",ns),new o(i.toString())}}function Og(e){const t=e,n=Mi("throttle",t.throttle??100,16,1e3),r=function(k){return Mi("lostConnectionTimeout",k,200,3e4,1e3)}(t.lostConnectionTimeout??5e3),o=function(k){return k===void 0?void 0:Mi("backgroundKeepAliveTimeout",k,15e3)}(t.backgroundKeepAliveTimeout),i=function(k){return typeof k=="string"&&k.startsWith("http")?k:"https://api.liveblocks.io"}(t.baseUrl),a=new jt(void 0),s=fg(e,k=>{const T=k.k==="sec-legacy"?k.id:k.uid;a.set(()=>T)}),u=t.polyfills?.fetch||globalThis.fetch?.bind(globalThis),c=og({baseUrl:i,fetchPolyfill:u,authManager:s}),l=new Map;function d(k){const T=()=>{const F=T;var R;k.unsubs.delete(F)?k.unsubs.size===0&&((R=k.room).id,l.delete(R.id),R.destroy()):at("This leave function was already called. Calling it more than once has no effect.")};return k.unsubs.add(T),{room:k.room,leave:T}}const p=t.resolveUsers,m=Fu(()=>!p,"Set the resolveUsers option in createClient to specify user info."),g=ba(new Fr(async k=>{const T=k.flat(),F=await p?.({userIds:T});return m(),F??T.map(()=>{})},{delay:50})),y=t.resolveRoomsInfo,f=Fu(()=>!y,"Set the resolveRoomsInfo option in createClient to specify room info."),b=ba(new Fr(async k=>{const T=k.flat(),F=await y?.({roomIds:T});return f(),F??T.map(()=>{})},{delay:50})),C=new Map,D=[],E=new jt("synchronized"),A=ke();function B(){E.set(D.some(k=>k.get()==="synchronizing")?"synchronizing":D.some(k=>k.get()==="has-local-changes")?"has-local-changes":"synchronized")}function O(){const k=new jt("synchronized");D.push(k);const T=k.subscribe(()=>B());return{setSyncStatus:function(F){k.set(F)},destroy:function(){T();const F=D.findIndex(R=>R===k);if(F>-1){const[R]=D.splice(F,1);R.get()!=="synchronized"&&B()}}}}{const k=F=>{t.preventUnsavedChanges&&E.get()!=="synchronized"&&F.preventDefault()};(typeof window<"u"?window:void 0)?.addEventListener("beforeunload",k)}const S=Object.defineProperty({enterRoom:function(k,...T){const F=l.get(k);if(F!==void 0)return d(F);const R=T[0]??{},P=Dg({initialPresence:(typeof R.initialPresence=="function"?R.initialPresence(k):R.initialPresence)??{},initialStorage:(typeof R.initialStorage=="function"?R.initialStorage(k):R.initialStorage)??{}},{roomId:k,throttleDelay:n,lostConnectionTimeout:r,backgroundKeepAliveTimeout:o,polyfills:t.polyfills,delegates:t.mockedDelegates??{createSocket:xg(k,i,t.polyfills?.WebSocket),authenticate:Ag(k,s)},enableDebugLogging:t.enableDebugLogging,baseUrl:i,errorEventSource:A,largeMessageStrategy:t.largeMessageStrategy??(t.unstable_fallbackToHTTP?"experimental-fallback-to-http":void 0),unstable_streamData:!!t.unstable_streamData,roomHttpClient:c,createSyncSource:O}),H={room:P,unsubs:new Set};if(l.set(k,H),R.autoConnect??!0){if(typeof atob>"u"){if(t.polyfills?.atob===void 0)throw new Error("You need to polyfill atob to use the client in your environment. Please follow the instructions at https://liveblocks.io/docs/errors/liveblocks-client/atob-polyfill");ha.atob=t.polyfills.atob}P.connect()}return d(H)},getRoom:function(k){return l.get(k)?.room||null},logout:function(){s.reset(),a.set(()=>{});for(const{room:T}of l.values())(k=T.getStatus())!=="initial"&&k!=="disconnected"&&T.reconnect();var k},getInboxNotifications:c.getInboxNotifications,getInboxNotificationsSince:c.getInboxNotificationsSince,getUnreadInboxNotificationsCount:c.getUnreadInboxNotificationsCount,markAllInboxNotificationsAsRead:c.markAllInboxNotificationsAsRead,markInboxNotificationAsRead:c.markInboxNotificationAsRead,deleteAllInboxNotifications:c.deleteAllInboxNotifications,deleteInboxNotification:c.deleteInboxNotification,getNotificationSettings:async function(k){return Zo(await c.getUserNotificationSettings(k))},updateNotificationSettings:async function(k){return Zo(await c.updateUserNotificationSettings(k))},resolvers:{invalidateUsers:function(k){g.invalidate(k)},invalidateRoomsInfo:function(k){b.invalidate(k)},invalidateMentionSuggestions:function(){C.clear()}},getSyncStatus:function(){const k=E.get();return k==="synchronizing"?k:"synchronized"},events:{error:A,syncStatus:E},[Oe]:{currentUserId:a,mentionSuggestionsCache:C,resolveMentionSuggestions:t.resolveMentionSuggestions,usersStore:g,roomsInfoStore:b,getRoomIds:()=>Array.from(l.keys()),httpClient:c,as:()=>S,createSyncSource:O,emitError:(k,T)=>{const F=_d.from(k,T);A.notify(F)||no(F.message)}}},Oe,{enumerable:!1});return S}function Mi(e,t,n,r,o){if(typeof t!="number"||t<n||r!==void 0&&t>r)throw new Error(r!==void 0?`${e} should be between ${o??n} and ${r}.`:`${e} should be at least ${o??n}.`);return t}function Fu(e,...t){return()=>{}}new RegExp(Object.keys({"&":"&","<":"<",">":">",'"':""","'":"'"}).map(e=>`\\${e}`).join("|"),"g");new RegExp(Object.keys({_:"\\_","*":"\\*","#":"\\#","`":"\\`","~":"\\~","!":"\\!","|":"\\|","(":"\\(",")":"\\)","{":"\\{","}":"\\}","[":"\\[","]":"\\]"}).map(e=>`\\${e}`).join("|"),"g");var Li=[1e3,2e3,4e3,8e3,1e4];function Yn(e,t,n){const r=performance.now(),o=typeof document<"u"?document:void 0,i=typeof window<"u"?window:void 0,a=n?.maxStaleTimeMs??Number.POSITIVE_INFINITY,s={inForeground:o?.visibilityState!=="hidden",lastSuccessfulPollAt:r,count:0,backoff:0};function u(){return s.count>0&&s.inForeground}const c=new Ad({}).addState("@idle").addState("@enabled").addState("@polling");function l(){u()?c.send({type:"START"}):c.send({type:"STOP"})}function d(){performance.now()-s.lastSuccessfulPollAt>a&&c.send({type:"POLL"})}function p(g){s.inForeground=g,l(),d()}function m(){p(o?.visibilityState!=="hidden")}return c.addTransitions("@idle",{START:"@enabled"}),c.addTransitions("@enabled",{STOP:"@idle",POLL:"@polling"}),c.addTimedTransition("@enabled",()=>{const g=s.lastSuccessfulPollAt+t;return Math.max(0,g-performance.now())+s.backoff},"@polling"),c.onEnterAsync("@polling",async(g,y)=>{await e(y),y.aborted||(s.lastSuccessfulPollAt=performance.now())},()=>({target:u()?"@enabled":"@idle",effect:()=>{s.backoff=0}}),()=>({target:u()?"@enabled":"@idle",effect:()=>{s.backoff=Li.find(g=>g>s.backoff)??Li[Li.length-1]}}),3e4),o?.addEventListener("visibilitychange",m),i?.addEventListener("online",m),i?.addEventListener("focus",d),c.start(),{inc:function(){s.count++,l()},dec:function(){s.count--,s.count<0&&(s.count=0),l()},pollNowIfStale:d,setInForeground:p}}function Tt(e,t){if(Object.is(e,t))return!0;const n=Array.isArray(e),r=Array.isArray(t);return n||r?!(!n||!r)&&function(o,i){if(o.length!==i.length)return!1;for(let a=0;a<o.length;a++)if(!Object.is(o[a],i[a]))return!1;return!0}(e,t):function(o,i){if(!Zt(o)||!Zt(i))return!1;const a=Object.keys(o);return a.length===Object.keys(i).length&&a.every(s=>Object.prototype.hasOwnProperty.call(i,s)&&Object.is(o[s],i[s]))}(e,t)}var Tu=class _o{#e;#t;constructor(t,n){this.#t=n,this.#e=t}static from(t,n){const r=new _o([],n);for(const o of t)r.add(o);return r}static fromAlreadySorted(t,n){return new _o(t,n)}clone(){return new _o(this.#e.slice(),this.#t)}add(t){const n=function(r,o,i){let a=0,s=r.length;for(;a<s;){const u=a+(s-a>>1);i(o,r[u])?s=u:a=u+1}return a}(this.#e,t,this.#t);this.#e.splice(n,0,t)}remove(t){const n=this.#e.indexOf(t);return n>=0&&(this.#e.splice(n,1),!0)}get length(){return this.#e.length}*filter(t){for(const n of this.#e)t(n)&&(yield n)}[Symbol.iterator](){return this.#e[Symbol.iterator]()}};rs("@liveblocks/core",ns,"esm");rs("@liveblocks/client","2.23.0","esm");var Pd=h.createContext(null);function cs(e,t,n,r,o){const i=h.useRef(null);let a;i.current===null?(a={hasValue:!1,value:null},i.current=a):a=i.current;const[s,u]=h.useMemo(()=>{let l,d,p=!1;const m=y=>{if(!p){p=!0,l=y;const C=r(y);if(o!==void 0&&a.hasValue){const D=a.value;if(o(D,C))return d=D,D}return d=C,C}const f=d;if(function(C,D){return C===D&&(C!==0||1/C==1/D)||C!=C&&D!=D}(l,y))return f;const b=r(y);return o!==void 0&&o(f,b)?(l=y,f):(l=y,d=b,b)},g=n===void 0?null:n;return[()=>m(t()),g===null?void 0:()=>m(g())]},[t,n,r,o]),c=h.useSyncExternalStore(e,s,u);return h.useEffect(()=>{a.hasValue=!0,a.value=c},[c]),h.useDebugValue(c),c}var Bg=e=>e;function yr(e,t,n){return cs(e.subscribe,e.get,e.get,t??Bg,n)}var dt={NOTIFICATIONS_POLL_INTERVAL:6e4,NOTIFICATIONS_MAX_STALE_TIME:5e3,ROOM_THREADS_POLL_INTERVAL:3e5,ROOM_THREADS_MAX_STALE_TIME:5e3,USER_THREADS_POLL_INTERVAL:6e4,USER_THREADS_MAX_STALE_TIME:3e4,HISTORY_VERSIONS_POLL_INTERVAL:6e4,HISTORY_VERSIONS_MAX_STALE_TIME:5e3,NOTIFICATION_SETTINGS_POLL_INTERVAL:6e4,NOTIFICATION_SETTINGS_MAX_STALE_TIME:5e3,USER_NOTIFICATION_SETTINGS_INTERVAL:3e5,USER_NOTIFICATION_SETTINGS_MAX_STALE_TIME:6e4},Yo=Object.freeze({isLoading:!0}),Md=e=>Object.freeze({isLoading:!1,error:e});function Jn(e,t){return arguments.length===1?Object.freeze({isLoading:!1,data:e}):Object.freeze({isLoading:!1,[e]:t})}var kg=e=>e;function nt(e){return h.useReducer(kg,e)[0]}function vo(e){const t=nt(e);if(typeof t=="function"){const n=function(r){const o=h.useRef(r);return h.useEffect(()=>{o.current=r},[r]),o}(e);return h.useCallback((...r)=>n.current(...r),[n])}return t}function ls(e){const t=new Set;t.add("constructor");let n=e.constructor.prototype;do for(const r of Reflect.ownKeys(n)){if(t.has(r))continue;typeof Reflect.getOwnPropertyDescriptor(n,r)?.value=="function"&&(t.add(r),e[r]=e[r].bind(e))}while((n=Reflect.getPrototypeOf(n))&&n!==Object.prototype)}function ju(e,t){if(!Zt(e)||!Zt(t))return Tt(e,t);const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&Tt(e[r],t[r]))}function Sg(e){return t=>function(n,r){return r.resolved===void 0||n.resolved===r.resolved}(t,e)&&function(n,r){const o=n.metadata;return r.metadata===void 0||Object.entries(r.metadata).every(([i,a])=>a===void 0||function(s,u){return u===null?s===void 0:ma(u)?typeof s=="string"&&s.startsWith(u.startsWith):s===u}(o[i],a))}(t,e)}var Ig=class Ld{#e;#t;#n;signal;constructor(){this.#t=Tu.from([],(t,n)=>{const r=t.createdAt,o=n.createdAt;return r<o||r===o&&t.id<n.id}),this.#n=Tu.from([],(t,n)=>{const r=n.updatedAt,o=t.updatedAt;return r<o||r===o&&n.id<t.id}),this.#e=new Map,this.signal=new On(this)}clone(){const t=new Ld;return t.#e=new Map(this.#e),t.#t=this.#t.clone(),t.#n=this.#n.clone(),t}get(t){const n=this.getEvenIfDeleted(t);return n?.deletedAt?void 0:n}getEvenIfDeleted(t){return this.#e.get(t)}upsert(t){this.signal.mutate(()=>{const n=(t=function(o){return o.deletedAt&&o.comments.length>0?{...o,comments:[]}:o.comments.some(i=>!i.deletedAt)?o:{...o,deletedAt:new Date,comments:[]}}(t)).id,r=this.#e.get(n);if(r){if(r.deletedAt)return!1;this.#t.remove(r),this.#n.remove(r)}return t.deletedAt||(this.#t.add(t),this.#n.add(t)),this.#e.set(n,t),!0})}upsertIfNewer(t){const n=this.get(t.id);(!n||t.updatedAt>=n.updatedAt)&&this.upsert(t)}applyDelta(t,n){rt(()=>{for(const r of t)this.upsertIfNewer(r);for(const{id:r,deletedAt:o}of n)this.getEvenIfDeleted(r)&&this.delete(r,o)})}delete(t,n){const r=this.#e.get(t);r&&!r.deletedAt&&this.upsert({...r,deletedAt:n,updatedAt:n})}findMany(t,n,r){const o=r==="desc"?this.#n:this.#t,i=[];return t!==void 0&&i.push(a=>a.roomId===t),i.push(Sg(n)),Array.from(o.filter(a=>i.every(s=>s(a))))}};function Ud(e){if("status"in e)return e;const t=e;return t.status="pending",t.then(n=>{t.status="fulfilled",t.value=n},n=>{t.status="rejected",t.reason=n}),t}var Fg=Promise.resolve(),Ui=class{#e;signal;#t;#n;constructor(e){this.#e=new jt(Yo),this.#t=e,this.#n=null,this.signal=this.#e.asReadonly(),ls(this)}get(){return this.#e.get()}#r(e){const t=this.#e.get();t.data!==void 0&&this.#e.set(Jn({...t.data,...e}))}async#i(){const e=this.#e.get();if(e.data?.cursor&&!e.data.isFetchingMore){this.#r({isFetchingMore:!0});try{const t=await this.#t(e.data.cursor);this.#r({cursor:t,hasFetchedAll:t===null,fetchMoreError:void 0,isFetchingMore:!1})}catch(t){this.#r({isFetchingMore:!1,fetchMoreError:t})}}}fetchMore(){return this.#e.get().data?.cursor?(this.#n||(this.#n=this.#i().finally(()=>{this.#n=null})),this.#n):Fg}#o=null;waitUntilLoaded(){if(this.#o)return this.#o;const e=Ud(Ir(()=>this.#t(void 0),5,[5e3,5e3,1e4,15e3]));return e.then(t=>{this.#e.set(Jn({cursor:t,hasFetchedAll:t===null,isFetchingMore:!1,fetchMoreError:void 0,fetchMore:this.fetchMore}))},t=>{this.#e.set(Md(t)),setTimeout(()=>{this.#o=null,this.#e.set(Yo)},5e3)}),this.#o=e,this.#o}},Vi=class{#e;signal;#t;constructor(e){this.#e=new jt(Yo),this.signal=this.#e.asReadonly(),this.#t=e,ls(this)}get(){return this.#e.get()}#n=null;waitUntilLoaded(){if(this.#n)return this.#n;const e=Ud(Ir(()=>this.#t(),5,[5e3,5e3,1e4,15e3]));return e.then(()=>{this.#e.set(Jn(void 0))},t=>{this.#e.set(Md(t)),setTimeout(()=>{this.#n=null,this.#e.set(Yo)},5e3)}),this.#n=e,e}};function Tg(e){const t=new On(new Map);return{signal:Ke.from(t,e,(n,r)=>function(o,i){const a=Object.fromEntries(o);for(const s of i)switch(s.type){case"update-notification-settings":{const u=a[s.roomId];if(u===void 0)break;a[s.roomId]={...u,...s.settings}}}return a}(n,r)),update:function(n,r){t.mutate(o=>{o.set(n,r)})}}}function jg(e){const t=new jt(Zo({}));return{signal:Ke.from(t,e,(n,r)=>function(o,i){let a=o;for(const s of i)s.type==="update-user-notification-settings"&&(a=hg(a,s.settings));return a}(n,r)),update:function(n){t.set(n)}}}var Rg=class{#e;threads;notifications;roomNotificationSettings;historyVersions;permissionHints;userNotificationSettings;optimisticUpdates;outputs;#t=null;#n;#r=new Map;#i=null;#o=new Map;#s;constructor(e){this.#e=e[Oe].as(),this.optimisticUpdates=function(l){const d=new jt([]),p=l[Oe].createSyncSource();return d.subscribe(()=>p.setSyncStatus(d.get().length>0?"synchronizing":"synchronized")),{signal:d.asReadonly(),add:function(m){const g=mr(),y={...m,id:g};return d.set(f=>[...f,y]),g},remove:function(m){d.set(g=>g.filter(y=>y.id!==m))}}}(this.#e),this.permissionHints=function(){const l=new On(new vt(()=>new Set));return{signal:l.asReadonly(),update:function(d){l.mutate(p=>{for(const[m,g]of Object.entries(d)){const y=p.getOrCreate(m);for(const f of g)y.add(f)}})}}}(),this.#n=new Ui(async l=>{const d=await this.#e.getInboxNotifications({cursor:l});return this.updateThreadifications(d.threads,d.inboxNotifications),this.#t===null&&(this.#t=d.requestedAt),d.nextCursor}),this.userNotificationSettings=jg(this.optimisticUpdates.signal),this.#s=new Vi(async()=>{const l=await this.#e.getNotificationSettings();this.userNotificationSettings.update(l)}),this.threads=new Ig,this.notifications=function(){const l=new On(new Map);return{signal:l.asReadonly(),markAllRead:function(d){l.mutate(p=>{for(const m of p.values())m.readAt=d})},markRead:function(d,p){l.mutate(m=>{const g=m.get(d);return!!g&&(m.set(d,{...g,readAt:p}),!0)})},delete:function(d){l.mutate(p=>p.delete(d))},applyDelta:function(d,p){l.mutate(m=>{let g=!1;for(const y of d){const f=m.get(y.id);f&&_g(f,y)===1||(m.set(y.id,y),g=!0)}for(const y of p)m.delete(y.id),g=!0;return g})},clear:function(){l.mutate(d=>d.clear())},updateAssociatedNotification:function(d){l.mutate(p=>{const m=function(g,y){for(const f of g)if(y(f))return f}(p.values(),g=>g.kind==="thread"&&g.threadId===d.threadId);return!!m&&(p.set(m.id,{...m,notifiedAt:d.createdAt,readAt:d.createdAt}),!0)})},upsert:function(d){l.mutate(p=>{p.set(d.id,d)})}}}(),this.roomNotificationSettings=Tg(this.optimisticUpdates.signal),this.historyVersions=function(){const l=new On(new vt(()=>new Map));return{signal:Ke.from(l,d=>Object.fromEntries([...d].map(([p,m])=>[p,Object.fromEntries(m)]))),update:function(d,p){l.mutate(m=>{const g=m.getOrCreate(d);for(const y of p)g.set(y.id,y)})}}}();const t=Ke.from(this.threads.signal,this.notifications.signal,this.optimisticUpdates.signal,(l,d,p)=>function(m,g,y){const f=m.clone();let b=Object.fromEntries(g);for(const C of y)switch(C.type){case"create-thread":f.upsert(C.thread);break;case"edit-thread-metadata":{const D=f.get(C.threadId);if(D===void 0||D.updatedAt>C.updatedAt)break;f.upsert({...D,updatedAt:C.updatedAt,metadata:{...D.metadata,...C.metadata}});break}case"mark-thread-as-resolved":{const D=f.get(C.threadId);if(D===void 0)break;f.upsert({...D,resolved:!0});break}case"mark-thread-as-unresolved":{const D=f.get(C.threadId);if(D===void 0)break;f.upsert({...D,resolved:!1});break}case"create-comment":{const D=f.get(C.comment.threadId);if(D===void 0)break;f.upsert(yo(D,C.comment));const E=Object.values(b).find(A=>A.kind==="thread"&&A.threadId===D.id);if(E===void 0)break;b[E.id]={...E,notifiedAt:C.comment.createdAt,readAt:C.comment.createdAt};break}case"edit-comment":{const D=f.get(C.comment.threadId);if(D===void 0)break;f.upsert(yo(D,C.comment));break}case"delete-comment":{const D=f.get(C.threadId);if(D===void 0)break;f.upsert(Ru(D,C.commentId,C.deletedAt));break}case"delete-thread":{const D=f.get(C.threadId);if(D===void 0)break;f.upsert({...D,deletedAt:C.deletedAt,updatedAt:C.deletedAt,comments:[]});break}case"add-reaction":{const D=f.get(C.threadId);if(D===void 0)break;f.upsert(_u(D,C.commentId,C.reaction));break}case"remove-reaction":{const D=f.get(C.threadId);if(D===void 0)break;f.upsert(Nu(D,C.commentId,C.emoji,C.userId,C.removedAt));break}case"mark-inbox-notification-as-read":{const D=b[C.inboxNotificationId];if(D===void 0)break;b[C.inboxNotificationId]={...D,readAt:C.readAt};break}case"mark-all-inbox-notifications-as-read":for(const D in b){const E=b[D];if(E===void 0)break;b[D]={...E,readAt:C.readAt}}break;case"delete-inbox-notification":delete b[C.inboxNotificationId];break;case"delete-all-inbox-notifications":b={}}return{sortedNotifications:Object.values(b).filter(C=>C.kind!=="thread"||f.get(C.threadId)!==void 0).sort((C,D)=>D.notifiedAt.getTime()-C.notifiedAt.getTime()),notificationsById:b,threadsDB:f}}(l,d,p)),n=Ke.from(t,l=>l.threadsDB),r=Ke.from(t,l=>({sortedNotifications:l.sortedNotifications,notificationsById:l.notificationsById}),Tt),o=new vt(l=>{const d=JSON.parse(l),p=new Ui(async m=>{const g=await this.#e[Oe].httpClient.getUserThreads_experimental({cursor:m,query:d});return this.updateThreadifications(g.threads,g.inboxNotifications),this.permissionHints.update(g.permissionHints),this.#i===null&&(this.#i=g.requestedAt),g.nextCursor});return{signal:Ke.from(()=>{const m=p.get();if(m.isLoading||m.error)return m;const g=this.outputs.threads.get().findMany(void 0,d??{},"desc"),y=m.data;return{isLoading:!1,threads:g,hasFetchedAll:y.hasFetchedAll,isFetchingMore:y.isFetchingMore,fetchMoreError:y.fetchMoreError,fetchMore:y.fetchMore}},ju),waitUntilLoaded:p.waitUntilLoaded}}),i=new vt(l=>{const[d,p]=JSON.parse(l),m=new Ui(async g=>{const y=await this.#e[Oe].httpClient.getThreads({roomId:d,cursor:g,query:p});this.updateThreadifications(y.threads,y.inboxNotifications),this.permissionHints.update(y.permissionHints);const f=this.#r.get(d);return(f===void 0||f>y.requestedAt)&&this.#r.set(d,y.requestedAt),y.nextCursor});return{signal:Ke.from(()=>{const g=m.get();if(g.isLoading||g.error)return g;const y=this.outputs.threads.get().findMany(d,p??{},"asc"),f=g.data;return{isLoading:!1,threads:y,hasFetchedAll:f.hasFetchedAll,isFetchingMore:f.isFetchingMore,fetchMoreError:f.fetchMoreError,fetchMore:f.fetchMore}},ju),waitUntilLoaded:m.waitUntilLoaded}}),a={signal:Ke.from(()=>{const l=this.#n.get();if(l.isLoading||l.error)return l;const d=l.data;return{isLoading:!1,inboxNotifications:this.outputs.notifications.get().sortedNotifications,hasFetchedAll:d.hasFetchedAll,isFetchingMore:d.isFetchingMore,fetchMoreError:d.fetchMoreError,fetchMore:d.fetchMore}}),waitUntilLoaded:this.#n.waitUntilLoaded},s=new vt(l=>{const d=new Vi(async()=>{const p=this.#e.getRoom(l);if(p===null)throw new Error(`Room '${l}' is not available on client`);const m=await p.getNotificationSettings();this.roomNotificationSettings.update(l,m)});return{signal:Ke.from(()=>{const p=d.get();return p.isLoading||p.error?p:Jn("settings",me(this.roomNotificationSettings.signal.get()[l]))},Tt),waitUntilLoaded:d.waitUntilLoaded}}),u=new vt(l=>{const d=new Vi(async()=>{const p=this.#e.getRoom(l);if(p===null)throw new Error(`Room '${l}' is not available on client`);const m=await p[Oe].listTextVersions();this.historyVersions.update(l,m.versions);const g=this.#o.get(l);(g===void 0||g>m.requestedAt)&&this.#o.set(l,m.requestedAt)});return{signal:Ke.from(()=>{const p=d.get();return p.isLoading||p.error?p:Jn("versions",Object.values(this.historyVersions.signal.get()[l]??{}))},Tt),waitUntilLoaded:d.waitUntilLoaded}}),c={signal:Ke.from(()=>{const l=this.#s.get();return l.isLoading||l.error?l:Jn("settings",me(this.userNotificationSettings.signal.get()))},Tt),waitUntilLoaded:this.#s.waitUntilLoaded};this.outputs={threadifications:t,threads:n,loadingRoomThreads:i,loadingUserThreads:o,notifications:r,loadingNotifications:a,settingsByRoomId:s,versionsByRoomId:u,userNotificationSettings:c},ls(this)}markInboxNotificationRead(e,t,n){rt(()=>{this.optimisticUpdates.remove(n),this.notifications.markRead(e,t)})}markAllInboxNotificationsRead(e,t){rt(()=>{this.optimisticUpdates.remove(e),this.notifications.markAllRead(t)})}deleteInboxNotification(e,t){rt(()=>{this.optimisticUpdates.remove(t),this.notifications.delete(e)})}deleteAllInboxNotifications(e){rt(()=>{this.optimisticUpdates.remove(e),this.notifications.clear()})}createThread(e,t){rt(()=>{this.optimisticUpdates.remove(e),this.threads.upsert(t)})}#a(e,t,n,r){rt(()=>{t!==null&&this.optimisticUpdates.remove(t);const o=this.threads,i=o.get(e);i&&(r&&i.updatedAt>r||o.upsert(n(i)))})}patchThread(e,t,n,r){return this.#a(e,t,o=>({...o,...Vr(n)}),r)}addReaction(e,t,n,r,o){this.#a(e,t,i=>_u(i,n,r),o)}removeReaction(e,t,n,r,o,i){this.#a(e,t,a=>Nu(a,n,r,o,i),i)}deleteThread(e,t){return this.#a(e,t,n=>({...n,updatedAt:new Date,deletedAt:new Date}))}createComment(e,t){rt(()=>{this.optimisticUpdates.remove(t);const n=this.threads.get(e.threadId);n&&(this.threads.upsert(yo(n,e)),this.notifications.updateAssociatedNotification(e))})}editComment(e,t,n){return this.#a(e,t,r=>yo(r,n))}deleteComment(e,t,n,r){return this.#a(e,t,o=>Ru(o,n,r),r)}updateThreadifications(e,t,n=[],r=[]){rt(()=>{this.threads.applyDelta(e,n),this.notifications.applyDelta(t,r)})}updateRoomNotificationSettings(e,t,n){rt(()=>{this.optimisticUpdates.remove(t),this.roomNotificationSettings.update(e,n)})}async fetchNotificationsDeltaUpdate(e){const t=this.#t;if(t===null)return;const n=await this.#e.getInboxNotificationsSince({since:t,signal:e});t<n.requestedAt&&(this.#t=n.requestedAt),this.updateThreadifications(n.threads.updated,n.inboxNotifications.updated,n.threads.deleted,n.inboxNotifications.deleted)}async fetchRoomThreadsDeltaUpdate(e,t){const n=this.#r.get(e);if(n===void 0)return;const r=await this.#e[Oe].httpClient.getThreadsSince({roomId:e,since:n,signal:t});this.updateThreadifications(r.threads.updated,r.inboxNotifications.updated,r.threads.deleted,r.inboxNotifications.deleted),this.permissionHints.update(r.permissionHints),n<r.requestedAt&&this.#r.set(e,r.requestedAt)}async fetchUserThreadsDeltaUpdate(e){const t=this.#i;if(t===null)return;const n=await this.#e[Oe].httpClient.getUserThreadsSince_experimental({since:t,signal:e});t<n.requestedAt&&(this.#t=n.requestedAt),this.updateThreadifications(n.threads.updated,n.inboxNotifications.updated,n.threads.deleted,n.inboxNotifications.deleted),this.permissionHints.update(n.permissionHints)}async fetchRoomVersionsDeltaUpdate(e,t){const n=this.#o.get(e);if(n===void 0)return;const r=me(this.#e.getRoom(e),`Room with id ${e} is not available on client`),o=await r[Oe].listTextVersionsSince({since:n,signal:t});this.historyVersions.update(e,o.versions),n<o.requestedAt&&this.#o.set(e,o.requestedAt)}async refreshRoomNotificationSettings(e,t){const n=me(this.#e.getRoom(e),`Room with id ${e} is not available on client`),r=await n.getNotificationSettings({signal:t});this.roomNotificationSettings.update(e,r)}async refreshUserNotificationSettings(e){const t=await this.#e.getNotificationSettings({signal:e});this.userNotificationSettings.update(t)}updateUserNotificationSettings_confirmOptimisticUpdate(e,t){rt(()=>{this.optimisticUpdates.remove(t),this.userNotificationSettings.update(e)})}};function _g(e,t){return e.notifiedAt>t.notifiedAt?1:e.notifiedAt<t.notifiedAt?-1:e.readAt&&t.readAt?e.readAt>t.readAt?1:e.readAt<t.readAt?-1:0:e.readAt||t.readAt?e.readAt?1:-1:0}function yo(e,t){if(e.deletedAt!==void 0)return e;if(t.threadId!==e.id)return sn.warn(`Comment ${t.id} does not belong to thread ${e.id}`),e;const n=e.comments.find(r=>r.id===t.id);if(n===void 0){const r=new Date(Math.max(e.updatedAt.getTime(),t.createdAt.getTime()));return{...e,updatedAt:r,comments:[...e.comments,t]}}if(n.deletedAt!==void 0)return e;if(n.editedAt===void 0||t.editedAt===void 0||n.editedAt<=t.editedAt){const r=e.comments.map(o=>o.id===t.id?t:o);return{...e,updatedAt:new Date(Math.max(e.updatedAt.getTime(),t.editedAt?.getTime()||t.createdAt.getTime())),comments:r}}return e}function Ru(e,t,n){if(e.deletedAt!==void 0)return e;const r=e.comments.find(i=>i.id===t);if(r===void 0||r.deletedAt!==void 0)return e;const o=e.comments.map(i=>i.id===t?{...i,deletedAt:n,body:void 0,attachments:[]}:i);return o.every(i=>i.deletedAt!==void 0)?{...e,deletedAt:n,updatedAt:n}:{...e,updatedAt:n,comments:o}}function _u(e,t,n){if(e.deletedAt!==void 0)return e;const r=e.comments.find(i=>i.id===t);if(r===void 0||r.deletedAt!==void 0)return e;const o=e.comments.map(i=>i.id===t?{...i,reactions:Ng(i.reactions,n)}:i);return{...e,updatedAt:new Date(Math.max(n.createdAt.getTime(),e.updatedAt.getTime())),comments:o}}function Nu(e,t,n,r,o){if(e.deletedAt!==void 0)return e;const i=e.comments.find(s=>s.id===t);if(i===void 0||i.deletedAt!==void 0)return e;const a=e.comments.map(s=>s.id===t?{...s,reactions:s.reactions.map(u=>u.emoji===n?{...u,users:u.users.filter(c=>c.id!==r)}:u).filter(u=>u.users.length>0)}:s);return{...e,updatedAt:new Date(Math.max(o.getTime(),e.updatedAt.getTime())),comments:a}}function Ng(e,t){const n=e.find(r=>r.emoji===t.emoji);return n===void 0?[...e,{emoji:t.emoji,createdAt:t.createdAt,users:[{id:t.userId}]}]:n.users.some(r=>r.id===t.userId)===!1?e.map(r=>r.emoji===t.emoji?{...r,users:[...r.users,{id:t.userId}]}:r):e}var Vd=h.createContext(null);function Pg(e){return new Error(`resolveUsers didn't return anything for user '${e}'`)}function Mg(e){return e}var Pu=new WeakMap,Mu=new WeakMap;function Hd(e){let t=Pu.get(e);return t||(t=new Rg(e),Pu.set(e,t)),t}function ds(e){let t=Mu.get(e);return t||(t=function(n){const r=Hd(n),o=Yn(async s=>{try{return await r.fetchNotificationsDeltaUpdate(s)}catch(u){throw console.warn(`Polling new inbox notifications failed: ${String(u)}`),u}},dt.NOTIFICATIONS_POLL_INTERVAL,{maxStaleTimeMs:dt.NOTIFICATIONS_MAX_STALE_TIME}),i=Yn(async s=>{try{return await r.fetchUserThreadsDeltaUpdate(s)}catch(u){throw console.warn(`Polling new user threads failed: ${String(u)}`),u}},dt.USER_THREADS_POLL_INTERVAL,{maxStaleTimeMs:dt.USER_THREADS_MAX_STALE_TIME}),a=Yn(async s=>{try{return await r.refreshUserNotificationSettings(s)}catch(u){throw console.warn(`Polling new user notification settings failed: ${String(u)}`),u}},dt.USER_NOTIFICATION_SETTINGS_INTERVAL,{maxStaleTimeMs:dt.USER_NOTIFICATION_SETTINGS_MAX_STALE_TIME});return{store:r,notificationsPoller:o,userThreadsPoller:i,userNotificationSettingsPoller:a}}(e),Mu.set(e,t)),t}function Lg(e,t){const n=e[Oe].usersStore,r=h.useCallback(()=>n.getItemState(t),[n,t]),o=h.useCallback(a=>function(s,u){return s===void 0||s?.isLoading?s??{isLoading:!0}:s.error?s:s.data?{isLoading:!1,user:s.data}:{isLoading:!1,error:Pg(u)}}(a,t),[t]),i=cs(n.subscribe,r,r,o,Tt);return h.useEffect(()=>{n.enqueue(t)}),i}function fs(){return h.useContext(Vd)}function je(){return fs()??Yt("LiveblocksProvider is missing from the React tree.")}function Ug(e){return function(t){const n=fs();if(!t?.allowNesting&&n!==null)throw new Error("You cannot nest multiple LiveblocksProvider instances in the same React tree.")}(e),v.jsx(Vd.Provider,{value:e.client,children:e.children})}function WD(e){const{children:t,...n}=e,r={publicApiKey:nt(n.publicApiKey),throttle:nt(n.throttle),lostConnectionTimeout:nt(n.lostConnectionTimeout),backgroundKeepAliveTimeout:nt(n.backgroundKeepAliveTimeout),polyfills:nt(n.polyfills),largeMessageStrategy:nt(n.largeMessageStrategy),unstable_fallbackToHTTP:nt(n.unstable_fallbackToHTTP),unstable_streamData:nt(n.unstable_streamData),preventUnsavedChanges:nt(n.preventUnsavedChanges),authEndpoint:vo(n.authEndpoint),resolveMentionSuggestions:vo(n.resolveMentionSuggestions),resolveUsers:vo(n.resolveUsers),resolveRoomsInfo:vo(n.resolveRoomsInfo),baseUrl:nt(n.baseUrl),enableDebugLogging:nt(n.enableDebugLogging)},o=h.useMemo(()=>Og(r),[]);return v.jsx(Ug,{client:o,children:t})}function zD(){return function(e,t,n){const{store:r,notificationsPoller:o}=ds(e);return h.useEffect(()=>{r.outputs.loadingNotifications.waitUntilLoaded()}),h.useEffect(()=>(o.inc(),o.pollNowIfStale(),()=>{o.dec()}),[o]),yr(r.outputs.loadingNotifications.signal,t,n)}(je(),Mg,Tt)}function $D(){return e=je(),h.useCallback(t=>{const{store:n}=ds(e),r=new Date,o=n.optimisticUpdates.add({type:"mark-inbox-notification-as-read",inboxNotificationId:t,readAt:r});e.markInboxNotificationAsRead(t).then(()=>{n.markInboxNotificationRead(t,r,o)},i=>{n.optimisticUpdates.remove(o),e[Oe].emitError({type:"MARK_INBOX_NOTIFICATION_AS_READ_ERROR",inboxNotificationId:t},i)})},[e]);var e}var Wd=function(e){return Lg(je(),e)},qD=function(e={}){const t=je(),{store:n,userThreadsPoller:r}=ds(t),o=Tn(e.query??{});return h.useEffect(()=>{n.outputs.loadingUserThreads.getOrCreate(o).waitUntilLoaded()}),h.useEffect(()=>(r.inc(),r.pollNowIfStale(),()=>{r.dec()}),[r]),yr(n.outputs.loadingUserThreads.getOrCreate(o).signal)};function Vg(e,t){h.useEffect(()=>{(function(n,r){if(n===!1||!r.threads||typeof window>"u")return;const o=window.location.hash.slice(1);if(!o.startsWith("cm_"))return;const i=document.getElementById(o);i!==null&&r.threads.flatMap(a=>a.comments).some(a=>a.id===o)&&i.scrollIntoView()})(e,t)},[t.isLoading])}function pi(e){const t=e[Oe].currentUserId.get();return t===void 0?"anonymous":t}var Lu=new WeakMap;function st(e){let t=Lu.get(e);return t||(t=function(n){const r=Hd(n);function o(u,c,l){if(r.optimisticUpdates.remove(u),!(l instanceof ir))throw l;if(l.status===403){const d=[l.message,l.details?.suggestion,l.details?.docs].filter(Boolean).join(`
|
|
3
3
|
`);sn.error(d)}n[Oe].emitError(c,l)}const i=new vt(u=>Yn(async c=>{try{return await r.fetchRoomThreadsDeltaUpdate(u,c)}catch(l){throw sn.warn(`Polling new threads for '${u}' failed: ${String(l)}`),l}},dt.ROOM_THREADS_POLL_INTERVAL,{maxStaleTimeMs:dt.ROOM_THREADS_MAX_STALE_TIME})),a=new vt(u=>Yn(async c=>{try{return await r.fetchRoomVersionsDeltaUpdate(u,c)}catch(l){throw sn.warn(`Polling new history versions for '${u}' failed: ${String(l)}`),l}},dt.HISTORY_VERSIONS_POLL_INTERVAL,{maxStaleTimeMs:dt.HISTORY_VERSIONS_MAX_STALE_TIME})),s=new vt(u=>Yn(async c=>{try{return await r.refreshRoomNotificationSettings(u,c)}catch(l){throw sn.warn(`Polling notification settings for '${u}' failed: ${String(l)}`),l}},dt.NOTIFICATION_SETTINGS_POLL_INTERVAL,{maxStaleTimeMs:dt.NOTIFICATION_SETTINGS_MAX_STALE_TIME}));return{store:r,onMutationFailure:o,getOrCreateThreadsPollerForRoomId:i.getOrCreate.bind(i),getOrCreateVersionsPollerForRoomId:a.getOrCreate.bind(a),getOrCreateNotificationsSettingsPollerForRoomId:s.getOrCreate.bind(s)}}(e),Lu.set(e,t)),t}function Hg(e){const t=je(),{id:n,stableEnterRoom:r}=e,o=nt({initialPresence:e.initialPresence,initialStorage:e.initialStorage,autoConnect:e.autoConnect??typeof window<"u"}),[{room:i},a]=h.useState(()=>r(n,{...o,autoConnect:!1}));return h.useEffect(()=>{const{store:s}=st(t);return i.events.comments.subscribe(u=>{(async function(c){if(c.type===zt.THREAD_DELETED)return void s.deleteThread(c.threadId,null);const l=await i.getThread(c.threadId);if(!l.thread)return void s.deleteThread(c.threadId,null);const{thread:d,inboxNotification:p}=l,m=s.outputs.threads.get().getEvenIfDeleted(c.threadId);switch(c.type){case zt.COMMENT_EDITED:case zt.THREAD_METADATA_UPDATED:case zt.THREAD_UPDATED:case zt.COMMENT_REACTION_ADDED:case zt.COMMENT_REACTION_REMOVED:case zt.COMMENT_DELETED:if(!m)break;s.updateThreadifications([d],p?[p]:[]);break;case zt.COMMENT_CREATED:s.updateThreadifications([d],p?[p]:[])}})(u)})},[t,i]),h.useEffect(()=>{const s=r(n,o);a(s);const{room:u,leave:c}=s;return o.autoConnect&&u.connect(),()=>{c()}},[n,o,r]),v.jsx(Pd.Provider,{value:i,children:e.children})}function hs(e){const t=h.useContext(Pd);if(t===null&&!e?.allowOutsideRoom)throw new Error("RoomProvider is missing from the React tree.");return t}function ps(){return je()[Oe].resolveMentionSuggestions}function zd(e){const t=je();return h.useCallback(n=>{const r=n.body,o=n.metadata??{},i=n.attachments,a=wd(),s=Xo(),u=new Date,c={id:s,threadId:a,roomId:e,createdAt:u,type:"comment",userId:pi(t),body:r,reactions:[],attachments:i??[]},l={id:a,type:"thread",createdAt:u,updatedAt:u,roomId:e,metadata:o,comments:[c],resolved:!1},{store:d,onMutationFailure:p}=st(t),m=d.optimisticUpdates.add({type:"create-thread",thread:l,roomId:e}),g=i?.map(y=>y.id);return t[Oe].httpClient.createThread({roomId:e,threadId:a,commentId:s,body:r,metadata:o,attachmentIds:g}).then(y=>{d.createThread(m,y)},y=>p(m,{type:"CREATE_THREAD_ERROR",roomId:e,threadId:a,commentId:s,body:r,metadata:o},y)),l},[t,e])}function $d(e){const t=je();return h.useCallback(({threadId:n,commentId:r,body:o,attachments:i})=>{const a=new Date,{store:s,onMutationFailure:u}=st(t),c=s.outputs.threads.get().getEvenIfDeleted(n);if(c===void 0)return void sn.warn(`Internal unexpected behavior. Cannot edit comment in thread "${n}" because the thread does not exist in the cache.`);const l=c.comments.find(m=>m.id===r);if(l===void 0||l.deletedAt!==void 0)return void sn.warn(`Internal unexpected behavior. Cannot edit comment "${r}" in thread "${n}" because the comment does not exist in the cache.`);const d=s.optimisticUpdates.add({type:"edit-comment",comment:{...l,editedAt:a,body:o,attachments:i??[]}}),p=i?.map(m=>m.id);t[Oe].httpClient.editComment({roomId:e,threadId:n,commentId:r,body:o,attachmentIds:p}).then(m=>{s.editComment(n,d,m)},m=>u(d,{type:"EDIT_COMMENT_ERROR",roomId:e,threadId:n,commentId:r,body:o},m))},[t,e])}function qd(e){const t=je();return h.useCallback(({threadId:n,commentId:r,emoji:o})=>{const i=new Date,a=pi(t),{store:s,onMutationFailure:u}=st(t),c=s.optimisticUpdates.add({type:"add-reaction",threadId:n,commentId:r,reaction:{emoji:o,userId:a,createdAt:i}});t[Oe].httpClient.addReaction({roomId:e,threadId:n,commentId:r,emoji:o}).then(l=>{s.addReaction(n,c,r,l,i)},l=>u(c,{type:"ADD_REACTION_ERROR",roomId:e,threadId:n,commentId:r,emoji:o},l))},[t,e])}function Kd(e){const t=je();return h.useCallback(({threadId:n,commentId:r,emoji:o})=>{const i=pi(t),a=new Date,{store:s,onMutationFailure:u}=st(t),c=s.optimisticUpdates.add({type:"remove-reaction",threadId:n,commentId:r,emoji:o,userId:i,removedAt:a});t[Oe].httpClient.removeReaction({roomId:e,threadId:n,commentId:r,emoji:o}).then(()=>{s.removeReaction(n,c,r,o,i,a)},l=>u(c,{type:"REMOVE_REACTION_ERROR",roomId:e,threadId:n,commentId:r,emoji:o},l))},[t,e])}function Wg(e){return e===void 0||e?.isLoading?e??{isLoading:!0}:e.error?e:(e.data,{isLoading:!1,url:e.data})}function mi(e,t){const n=je()[Oe].httpClient.getOrCreateAttachmentUrlsStore(t),r=h.useCallback(()=>n.getItemState(e),[n,e]);return h.useEffect(()=>{n.enqueue(e)},[n,e]),cs(n.subscribe,r,r,Wg,Tt)}var zg=new Set,KD=function(e){const t=je(),[n]=h.useState(()=>new Map),r=h.useCallback((o,i)=>{const a=n.get(o);if(a)return a;const s=t.enterRoom(o,i),u=s.leave;return s.leave=()=>{u(),n.delete(o)},n.set(o,s),s},[t,n]);return v.jsx(Hg,{...e,stableEnterRoom:r})},Gd=hs,GD=function(){return zd(hs().id)},XD=function(e={}){const{scrollOnLoad:t=!0}=e,n=je(),r=hs(),{store:o,getOrCreateThreadsPollerForRoomId:i}=st(n),a=(s=r.id,u=e.query,Tn([s,u??{}]));var s,u;const c=i(r.id);h.useEffect(()=>{o.outputs.loadingRoomThreads.getOrCreate(a).waitUntilLoaded()}),h.useEffect(()=>(c.inc(),c.pollNowIfStale(),()=>c.dec()),[c]);const l=yr(o.outputs.loadingRoomThreads.getOrCreate(a).signal);return Vg(t,l),l};rs("@liveblocks/react","2.23.0","esm");var Nt=typeof window<"u"?h.useLayoutEffect:h.useEffect;function $g(e,t){const[n,r]=h.useState(),o=h.useRef(),i=ps(),a=je()[Oe].mentionSuggestionsCache;return h.useEffect(()=>{if(t===void 0||!i)return;const s={text:t,roomId:e},u=Tn(s);let c,l=!1;const d=async()=>{try{o.current=performance.now();const p=await i(s);l||(r(p),a.set(u,p))}catch(p){console.error(p?.message)}};return a.has(u)?r(a.get(u)):!o.current||Math.abs(performance.now()-o.current)>500?d():c=window.setTimeout(()=>{d()},500),()=>{l=!0,window.clearTimeout(c)}},[t,e,i,a]),n}function qg(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function wt(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>t.current?.(...n),[])}function ro({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:u,onChange:c}){const l=h.useState(u),[d]=l,p=h.useRef(d),m=wt(c);return h.useEffect(()=>{p.current!==d&&(m(d),p.current=d)},[d,p,m]),l}({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=wt(n);return[a,h.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&s(c)}else o(u)},[i,e,o,s])]}function Kg(...e){return t=>e.forEach(n=>function(r,o){typeof r=="function"?r(o):r!=null&&(r.current=o)}(n,t))}var Xd=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(Xg);if(i){const a=i.props.children,s=o.map(u=>u===i?h.Children.count(a)>1?h.Children.only(null):h.isValidElement(a)?a.props.children:null:u);return v.jsx(xa,{...r,ref:t,children:h.isValidElement(a)?h.cloneElement(a,void 0,s):null})}return v.jsx(xa,{...r,ref:t,children:n})});Xd.displayName="Slot";var xa=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=function(i){let a=Object.getOwnPropertyDescriptor(i.props,"ref")?.get,s=a&&"isReactWarning"in a&&a.isReactWarning;return s?i.ref:(a=Object.getOwnPropertyDescriptor(i,"ref")?.get,s=a&&"isReactWarning"in a&&a.isReactWarning,s?i.props.ref:i.props.ref||i.ref)}(n);return h.cloneElement(n,{...Zg(r,n.props),ref:t?Kg(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});xa.displayName="SlotClone";var Gg=({children:e})=>v.jsx(v.Fragment,{children:e});function Xg(e){return h.isValidElement(e)&&e.type===Gg}function Zg(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}var Yg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Xd:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(s,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Zd=h.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[a=!1,s]=ro({prop:n,onChange:o,defaultProp:r});return v.jsx(Yg.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:qg(e.onClick,()=>{e.disabled||s(!a)})})});Zd.displayName="Toggle";var ms=Zd;function Be(...e){return e.filter(t=>typeof t=="string"||typeof t=="number").join(" ")}function Ne({children:e,className:t,...n}){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",role:"presentation",className:Be("lb-icon",t),...n,children:e})}function Jg(e){return v.jsx(Ne,{...e,children:v.jsx("path",{d:"M16 6L8 14L4 10"})})}function gs(e){return v.jsxs(Ne,{...e,children:[v.jsx("path",{d:"M15 5L5 15"}),v.jsx("path",{d:"M5 5L15 15"})]})}function Qg(e){return v.jsx(Ne,{...e,children:v.jsx("path",{d:"M4.5 6.5h11M14 6.5V14a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 6 14V6.5M7.5 6.5V5a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1.5"})})}function ev(e){return v.jsx(Ne,{...e,children:v.jsx("path",{d:"m11.784 5.797-6.13 6.138a4 4 0 0 0-1.03 1.775L4 16l2.285-.624a4 4 0 0 0 1.776-1.032l6.145-6.152m-2.422-2.395 1.244-1.246c.608-.608 1.826-.81 2.53-.104.7.7.499 1.893-.122 2.515l-1.23 1.23m-2.422-2.395 2.422 2.395"})})}function tv(e){return v.jsxs(Ne,{fill:"currentColor",...e,children:[v.jsx("circle",{cx:5,cy:10,r:.75}),v.jsx("circle",{cx:10,cy:10,r:.75}),v.jsx("circle",{cx:15,cy:10,r:.75})]})}function Uu(e){return v.jsxs(Ne,{...e,children:[v.jsx("path",{d:"M11 3.07A7 7 0 1 0 16.93 9"}),v.jsx("path",{d:"M7.5 11.5S8.25 13 10 13s2.5-1.5 2.5-1.5M8 8h0"}),v.jsx("path",{d:"M12 8h0"}),v.jsx("path",{d:"M13 5h4m-2-2v4"}),v.jsx("circle",{cx:"8",cy:"8",r:".25"}),v.jsx("circle",{cx:"12",cy:"8",r:".25"})]})}function Vu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gi(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Vu(o,t);return n||typeof i!="function"||(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Vu(e[o],null)}}}}function We(...e){return h.useCallback(gi(...e),e)}var Re=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(nv);if(i){const a=i.props.children,s=o.map(u=>u===i?h.Children.count(a)>1?h.Children.only(null):h.isValidElement(a)?a.props.children:null:u);return v.jsx(Oa,{...r,ref:t,children:h.isValidElement(a)?h.cloneElement(a,void 0,s):null})}return v.jsx(Oa,{...r,ref:t,children:n})});Re.displayName="Slot";var Oa=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=function(a){let s=Object.getOwnPropertyDescriptor(a.props,"ref")?.get,u=s&&"isReactWarning"in s&&s.isReactWarning;return u?a.ref:(s=Object.getOwnPropertyDescriptor(a,"ref")?.get,u=s&&"isReactWarning"in s&&s.isReactWarning,u?a.props.ref:a.props.ref||a.ref)}(n),i=function(a,s){const u={...s};for(const c in s){const l=a[c],d=s[c];/^on[A-Z]/.test(c)?l&&d?u[c]=(...p)=>{d(...p),l(...p)}:l&&(u[c]=l):c==="style"?u[c]={...l,...d}:c==="className"&&(u[c]=[l,d].filter(Boolean).join(" "))}return{...a,...u}}(r,n.props);return n.type!==h.Fragment&&(i.ref=t?gi(t,o):o),h.cloneElement(n,i)}return h.Children.count(n)>1?h.Children.only(null):null});Oa.displayName="SlotClone";var vs=({children:e})=>v.jsx(v.Fragment,{children:e});function nv(e){return h.isValidElement(e)&&e.type===vs}const rv=h.forwardRef(({emoji:e,style:t,asChild:n,...r},o)=>{const i=n?Re:"span";return v.jsx(i,{role:"img","aria-label":e,"data-emoji":e,style:{...t,fontFamily:"'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1em",whiteSpace:"nowrap"},...r,ref:o,children:e})}),ys=h.forwardRef(({className:e,...t},n)=>v.jsx(rv,{className:Be("lb-emoji",e),...t,ref:n}));function Hi(e,t,n){return e===1?t:n??`${t}s`}const ov={locale:"en",dir:"ltr",USER_SELF:"you",USER_UNKNOWN:"Anonymous",LIST_REMAINING:e=>`${e} more`,LIST_REMAINING_USERS:e=>`${e} ${Hi(e,"other")}`,LIST_REMAINING_COMMENTS:e=>`${e} more ${Hi(e,"comment")}`,EMOJI_PICKER_SEARCH_PLACEHOLDER:"Search…",EMOJI_PICKER_EMPTY:"No emoji found.",EMOJI_PICKER_ERROR:()=>"There was an error while getting the list of emoji.",EMOJI_PICKER_CHANGE_SKIN_TONE:"Change skin tone",ATTACHMENT_TOO_LARGE:e=>e?`The file is larger than ${e}`:"The file is too large",ATTACHMENT_ERROR:()=>"The file couldn’t be uploaded.",COMPOSER_INSERT_MENTION:"Mention someone",COMPOSER_INSERT_EMOJI:"Add emoji",COMPOSER_ATTACH_FILES:"Attach files",COMPOSER_REMOVE_ATTACHMENT:"Remove attachment",COMPOSER_PLACEHOLDER:"Write a comment…",COMPOSER_SEND:"Send",COMPOSER_TOGGLE_MARK:e=>{switch(e){case"bold":return"Bold";case"italic":return"Italic";case"strikethrough":return"Strikethrough";case"code":return"Inline code";default:return ft(0,"Unexpected mark")}},COMMENT_EDITED:"(edited)",COMMENT_DELETED:"This comment has been deleted.",COMMENT_MORE:"More",COMMENT_EDIT:"Edit comment",COMMENT_EDIT_COMPOSER_PLACEHOLDER:"Edit comment…",COMMENT_EDIT_COMPOSER_CANCEL:"Cancel",COMMENT_EDIT_COMPOSER_SAVE:"Save",COMMENT_DELETE:"Delete comment",COMMENT_DELETE_ATTACHMENT:"Delete attachment",COMMENT_ADD_REACTION:"Add reaction",COMMENT_REACTION_LIST:(e,t)=>v.jsxs(v.Fragment,{children:[e," reacted with ",v.jsx(ys,{emoji:t})]}),COMMENT_REACTION_DESCRIPTION:(e,t)=>`${t} ${Hi(t,"reaction")}, react with ${e}`,THREAD_RESOLVE:"Resolve thread",THREAD_UNRESOLVE:"Re-open thread",THREAD_NEW_INDICATOR:"New",THREAD_NEW_INDICATOR_DESCRIPTION:"New comments",THREAD_COMPOSER_PLACEHOLDER:"Reply to thread…",THREAD_COMPOSER_SEND:"Reply",INBOX_NOTIFICATION_MORE:"More",INBOX_NOTIFICATION_MARK_AS_READ:"Mark as read",INBOX_NOTIFICATION_DELETE:"Delete notification",INBOX_NOTIFICATION_THREAD_COMMENTS_LIST:(e,t)=>v.jsxs(v.Fragment,{children:[e," commented",t?v.jsxs(v.Fragment,{children:[" in ",t]}):v.jsx(v.Fragment,{children:" in a thread"})]}),INBOX_NOTIFICATION_THREAD_MENTION:(e,t)=>v.jsxs(v.Fragment,{children:[e," mentioned you",t?v.jsxs(v.Fragment,{children:[" in ",t]}):null]}),INBOX_NOTIFICATION_TEXT_MENTION:(e,t)=>v.jsxs(v.Fragment,{children:[e," mentioned you",t?v.jsxs(v.Fragment,{children:[" in ",t]}):null]}),HISTORY_VERSION_PREVIEW_AUTHORS_LIST:e=>v.jsxs(v.Fragment,{children:["Edits from ",e]}),HISTORY_VERSION_PREVIEW_RESTORE:"Restore",HISTORY_VERSION_PREVIEW_EMPTY:"No content.",HISTORY_VERSION_PREVIEW_ERROR:()=>"There was an error while getting this version."},iv=h.createContext(void 0);function mt(e){const t=h.useContext(iv);return h.useMemo(()=>({...ov,...t,...e}),[t,e])}function Hu(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ve(e){var t,n;return Hu(e)!==!1&&((t=e.constructor)===void 0||Hu(n=t.prototype)!==!1&&n.hasOwnProperty("isPrototypeOf")!==!1)}var av={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var o=j.transform(n,t,{affinity:r});e.current=o,o==null&&e.unref()}}},sv={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var o=Ee.transform(n,t,{affinity:r});e.current=o,o==null&&e.unref()}}},uv={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var o=M.transform(n,t,{affinity:r});e.current=o,o==null&&e.unref()}}},Jo=new WeakMap,Qo=new WeakMap,jr=new WeakMap,Wu=new WeakMap,zu=new WeakMap,$u=new WeakMap,qu=new WeakMap,j={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=j.levels(e,t);return r=n?r.slice(1):r.slice(0,-1)},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r];if(o!==t[r])break;n.push(o)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return j.equals(r,o)&&i>a},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return j.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return j.equals(r,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>j.compare(e,t)===1,isAncestor:(e,t)=>e.length<t.length&&j.compare(e,t)===0,isBefore:(e,t)=>j.compare(e,t)===-1,isChild:(e,t)=>e.length===t.length+1&&j.compare(e,t)===0,isCommon:(e,t)=>e.length<=t.length&&j.compare(e,t)===0,isDescendant:(e,t)=>e.length>t.length&&j.compare(e,t)===0,isParent:(e,t)=>e.length+1===t.length&&j.compare(e,t)===0,isPath:e=>Array.isArray(e)&&(e.length===0||typeof e[0]=="number"),isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&j.equals(n,r)},levels(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(e.length===0)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(e.length===0)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(e.length===0)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!j.isAncestor(t,e)&&!j.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(e.length===0)return r;switch(t.type){case"insert_node":var{path:i}=t;(j.equals(i,r)||j.endsBefore(i,r)||j.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(j.equals(a,r)||j.isAncestor(a,r))return null;j.endsBefore(a,r)&&(r[a.length-1]-=1);break;case"merge_node":var{path:s,position:u}=t;j.equals(s,r)||j.endsBefore(s,r)?r[s.length-1]-=1:j.isAncestor(s,r)&&(r[s.length-1]-=1,r[s.length]+=u);break;case"split_node":var{path:c,position:l}=t;if(j.equals(c,r)){if(o==="forward")r[r.length-1]+=1;else if(o!=="backward")return null}else j.endsBefore(c,r)?r[c.length-1]+=1:j.isAncestor(c,r)&&e[c.length]>=l&&(r[c.length-1]+=1,r[c.length]-=l);break;case"move_node":var{path:d,newPath:p}=t;if(j.equals(d,p))return r;if(j.isAncestor(d,r)||j.equals(d,r)){var m=p.slice();return j.endsBefore(d,p)&&d.length<p.length&&(m[d.length-1]-=1),m.concat(r.slice(d.length))}j.isSibling(d,p)&&(j.isAncestor(p,r)||j.equals(p,r))?j.endsBefore(d,r)?r[d.length-1]-=1:r[d.length-1]+=1:j.endsBefore(p,r)||j.equals(p,r)||j.isAncestor(p,r)?(j.endsBefore(d,r)&&(r[d.length-1]-=1),r[p.length-1]+=1):j.endsBefore(d,r)&&(j.equals(p,r)&&(r[p.length-1]+=1),r[d.length-1]-=1)}return r}};function Rr(e){return Rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(e)}function cv(e){var t=function(n,r){if(Rr(n)!=="object"||n===null)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var i=o.call(n,r);if(Rr(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return Rr(t)==="symbol"?t:String(t)}function Je(e,t,n){return(t=cv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ku(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ku(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var lv={transform(e,t){e.children=du(e.children);var n=e.selection&&du(e.selection);try{n=((r,o,i)=>{switch(i.type){case"insert_node":var{path:a,node:s}=i,u=te.parent(r,a),c=a[a.length-1];if(c>u.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(a,"] because the destination is past the end of the node."));if(u.children.splice(c,0,s),o)for(var[l,d]of M.points(o))o[d]=Ee.transform(l,i);break;case"insert_text":var{path:p,offset:m,text:g}=i;if(g.length===0)break;var y=te.leaf(r,p),f=y.text.slice(0,m),b=y.text.slice(m);if(y.text=f+g+b,o)for(var[C,D]of M.points(o))o[D]=Ee.transform(C,i);break;case"merge_node":var{path:E}=i,A=te.get(r,E),B=j.previous(E),O=te.get(r,B),S=te.parent(r,E),k=E[E.length-1];if(se.isText(A)&&se.isText(O))O.text+=A.text;else{if(se.isText(A)||se.isText(O))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(E,"] to nodes of different interfaces: ").concat(He.stringify(A)," ").concat(He.stringify(O)));O.children.push(...A.children)}if(S.children.splice(k,1),o)for(var[T,F]of M.points(o))o[F]=Ee.transform(T,i);break;case"move_node":var{path:R,newPath:P}=i;if(j.isAncestor(R,P))throw new Error("Cannot move a path [".concat(R,"] to new path [").concat(P,"] because the destination is inside itself."));var H=te.get(r,R),G=te.parent(r,R),Z=R[R.length-1];G.children.splice(Z,1);var $=j.transform(R,i),W=te.get(r,j.parent($)),U=$[$.length-1];if(W.children.splice(U,0,H),o)for(var[J,X]of M.points(o))o[X]=Ee.transform(J,i);break;case"remove_node":var{path:ie}=i,de=ie[ie.length-1];if(te.parent(r,ie).children.splice(de,1),o)for(var[ee,pe]of M.points(o)){var I=Ee.transform(ee,i);if(o!=null&&I!=null)o[pe]=I;else{var N=void 0,_=void 0;for(var[K,oe]of te.texts(r)){if(j.compare(oe,ie)!==-1){_=[K,oe];break}N=[K,oe]}var Q=!1;N&&_&&(Q=j.equals(_[1],ie)?!j.hasPrevious(_[1]):j.common(N[1],ie).length<j.common(_[1],ie).length),N&&!Q?(ee.path=N[1],ee.offset=N[0].text.length):_?(ee.path=_[1],ee.offset=0):o=null}}break;case"remove_text":var{path:ue,offset:ce,text:he}=i;if(he.length===0)break;var be=te.leaf(r,ue),le=be.text.slice(0,ce),Ae=be.text.slice(ce+he.length);if(be.text=le+Ae,o)for(var[re,Ce]of M.points(o))o[Ce]=Ee.transform(re,i);break;case"set_node":var{path:x,properties:L,newProperties:V}=i;if(x.length===0)throw new Error("Cannot set properties on the root node!");var Y=te.get(r,x);for(var ne in V){if(ne==="children"||ne==="text")throw new Error('Cannot set the "'.concat(ne,'" property of nodes!'));var fe=V[ne];fe==null?delete Y[ne]:Y[ne]=fe}for(var xe in L)V.hasOwnProperty(xe)||delete Y[xe];break;case"set_selection":var{newProperties:De}=i;if(De==null)o=De;else{if(o==null){if(!M.isRange(De))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(He.stringify(De)," when there is no current selection."));o=Cr({},De)}for(var Fe in De){var $e=De[Fe];if($e==null){if(Fe==="anchor"||Fe==="focus")throw new Error('Cannot remove the "'.concat(Fe,'" selection property'));delete o[Fe]}else o[Fe]=$e}}break;case"split_node":var{path:Se,position:Me,properties:xt}=i;if(Se.length===0)throw new Error('Cannot apply a "split_node" operation at path ['.concat(Se,"] because the root node cannot be split."));var Ti,gn=te.get(r,Se),Rm=te.parent(r,Se),_m=Se[Se.length-1];if(se.isText(gn)){var Nm=gn.text.slice(0,Me),Pm=gn.text.slice(Me);gn.text=Nm,Ti=Cr(Cr({},xt),{},{text:Pm})}else{var Mm=gn.children.slice(0,Me),Lm=gn.children.slice(Me);gn.children=Mm,Ti=Cr(Cr({},xt),{},{children:Lm})}if(Rm.children.splice(_m+1,0,Ti),o)for(var[Um,Vm]of M.points(o))o[Vm]=Ee.transform(Um,i)}return o})(e,n,t)}finally{e.children=fu(e.children),e.selection=n?zm(n)?fu(n):n:null}}},dv={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},fv={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},Yd=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(Ve(r)&&Ve(o)){if(!Yd(r,o))return!1}else if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==o[i])return!1}else if(r!==o)return!1}for(var a in t)if(e[a]===void 0&&t[a]!==void 0)return!1;return!0};function Kt(e,t){if(e==null)return{};var n,r,o=function(a,s){if(a==null)return{};var u,c,l={},d=Object.keys(a);for(c=0;c<d.length;c++)u=d[c],s.indexOf(u)>=0||(l[u]=a[u]);return l}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var hv=["anchor","focus"];function Gu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}var M={edges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return M.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=M.edges(e);return t},equals:(e,t)=>Ee.equals(e.anchor,t.anchor)&&Ee.equals(e.focus,t.focus),surrounds(e,t){var n=M.intersection(e,t);return!!n&&M.equals(n,t)},includes(e,t){if(M.isRange(t)){if(M.includes(e,t.anchor)||M.includes(e,t.focus))return!0;var[n,r]=M.edges(e),[o,i]=M.edges(t);return Ee.isBefore(n,o)&&Ee.isAfter(r,i)}var[a,s]=M.edges(e),u=!1,c=!1;return Ee.isPoint(t)?(u=Ee.compare(t,a)>=0,c=Ee.compare(t,s)<=0):(u=j.compare(t,a.path)>=0,c=j.compare(t,s.path)<=0),u&&c},intersection(e,t){var n=Kt(e,hv),[r,o]=M.edges(e),[i,a]=M.edges(t),s=Ee.isBefore(r,i)?i:r,u=Ee.isBefore(o,a)?o:a;return Ee.isBefore(u,s)?null:function(c){for(var l=1;l<arguments.length;l++){var d=arguments[l]!=null?arguments[l]:{};l%2?Gu(Object(d),!0).forEach(function(p){Je(c,p,d[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):Gu(Object(d)).forEach(function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))})}return c}({anchor:s,focus:u},n)},isBackward(e){var{anchor:t,focus:n}=e;return Ee.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return Ee.equals(t,n)},isExpanded:e=>!M.isCollapsed(e),isForward:e=>!M.isBackward(e),isRange:e=>Ve(e)&&Ee.isPoint(e.anchor)&&Ee.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=M.edges(e);return t},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return ts(e,r=>{if(r===null)return null;var o,i,{affinity:a="inward"}=n;if(a==="inward"){var s=M.isCollapsed(r);M.isForward(r)?(o="forward",i=s?o:"backward"):(o="backward",i=s?o:"forward")}else a==="outward"?M.isForward(r)?(o="backward",i="forward"):(o="forward",i="backward"):(o=a,i=a);var u=Ee.transform(r.anchor,t,{affinity:o}),c=Ee.transform(r.focus,t,{affinity:i});if(!u||!c)return null;r.anchor=u,r.focus=c})}},Xu=e=>Ve(e)&&te.isNodeList(e.children)&&!w.isEditor(e),ae={isAncestor:e=>Ve(e)&&te.isNodeList(e.children),isElement:Xu,isElementList:e=>Array.isArray(e)&&e.every(t=>ae.isElement(t)),isElementProps:e=>e.children!==void 0,isElementType:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"type";return Xu(e)&&e[n]===t},matches(e,t){for(var n in t)if(n!=="children"&&e[n]!==t[n])return!1;return!0}},pv=["children"],mv=["text"],Zu=new WeakMap,te={ancestor(e,t){var n=te.get(e,t);if(se.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(He.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of j.ancestors(t,n)){var o=[te.ancestor(e,r),r];yield o}}()},child(e,t){if(se.isText(e))throw new Error("Cannot get the child of a text node: ".concat(He.stringify(e)));var n=e.children[t];if(n==null)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(He.stringify(e)));return n},children(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=te.ancestor(e,t),{children:i}=o,a=r?i.length-1:0;r?a>=0:a<i.length;){var s=te.child(o,a),u=t.concat(a);yield[s,u],a=r?a-1:a+1}}()},common(e,t,n){var r=j.common(t,n);return[te.get(e,r),r]},descendant(e,t){var n=te.get(e,t);if(w.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(He.stringify(n)));return n},descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of te.nodes(e,t))r.length!==0&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of te.nodes(e,t))ae.isElement(n)&&(yield[n,r])}()},extractProps:e=>ae.isAncestor(e)?Kt(e,pv):Kt(e,mv),first(e,t){for(var n=t.slice(),r=te.get(e,n);r&&!se.isText(r)&&r.children.length!==0;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(se.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(He.stringify(e)));var n=ts({children:e.children},r=>{var[o,i]=M.edges(t),a=te.nodes(r,{reverse:!0,pass:p=>{var[,m]=p;return!M.includes(t,m)}});for(var[,s]of a){if(!M.includes(t,s)){var u=te.parent(r,s),c=s[s.length-1];u.children.splice(c,1)}if(j.equals(s,i.path)){var l=te.leaf(r,s);l.text=l.text.slice(0,i.offset)}if(j.equals(s,o.path)){var d=te.leaf(r,s);d.text=d.text.slice(o.offset)}}w.isEditor(r)&&(r.selection=null)});return n.children},get(e,t){var n=te.getIf(e,t);if(n===void 0)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(He.stringify(e)));return n},getIf(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(se.isText(n)||!n.children[o])return;n=n.children[o]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(se.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isNode:e=>se.isText(e)||ae.isElement(e)||w.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=Zu.get(e);if(t!==void 0)return t;var n=e.every(r=>te.isNode(r));return Zu.set(e,n),n},last(e,t){for(var n=t.slice(),r=te.get(e,n);r&&!se.isText(r)&&r.children.length!==0;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=te.get(e,t);if(!se.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(He.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of j.levels(t,n)){var o=te.get(e,r);yield[o,r]}}()},matches:(e,t)=>ae.isElement(e)&&ae.isElementProps(t)&&ae.matches(e,t)||se.isText(e)&&se.isTextProps(t)&&se.matches(e,t),nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,a=new Set,s=[],u=e;!i||!(r?j.isBefore(s,i):j.isAfter(s,i));)if(a.has(u)||(yield[u,s]),a.has(u)||se.isText(u)||u.children.length===0||n!=null&&n([u,s])!==!1){if(s.length===0)break;if(!r){var c=j.next(s);if(te.has(e,c)){s=c,u=te.get(e,s);continue}}r&&s[s.length-1]!==0?(s=j.previous(s),u=te.get(e,s)):(s=j.parent(s),u=te.get(e,s),a.add(u))}else{a.add(u);var l=r?u.children.length-1:0;j.isAncestor(s,o)&&(l=o[s.length]),s=s.concat(l),u=te.get(e,s)}}()},parent(e,t){var n=j.parent(t),r=te.get(e,n);if(se.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:e=>se.isText(e)?e.text:e.children.map(te.string).join(""),texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of te.nodes(e,t))se.isText(n)&&(yield[n,r])}()}};function Yu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yu(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var cn={isNodeOperation:e=>cn.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!Ve(e))return!1;switch(e.type){case"insert_node":case"remove_node":return j.isPath(e.path)&&te.isNode(e.node);case"insert_text":case"remove_text":return typeof e.offset=="number"&&typeof e.text=="string"&&j.isPath(e.path);case"merge_node":return typeof e.position=="number"&&j.isPath(e.path)&&Ve(e.properties);case"move_node":return j.isPath(e.path)&&j.isPath(e.newPath);case"set_node":return j.isPath(e.path)&&Ve(e.properties)&&Ve(e.newProperties);case"set_selection":return e.properties===null&&M.isRange(e.newProperties)||e.newProperties===null&&M.isRange(e.properties)||Ve(e.properties)&&Ve(e.newProperties);case"split_node":return j.isPath(e.path)&&typeof e.position=="number"&&Ve(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(t=>cn.isOperation(t)),isSelectionOperation:e=>cn.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>cn.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Pe(Pe({},e),{},{type:"remove_node"});case"insert_text":return Pe(Pe({},e),{},{type:"remove_text"});case"merge_node":return Pe(Pe({},e),{},{type:"split_node",path:j.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(j.equals(t,n))return e;if(j.isSibling(n,t))return Pe(Pe({},e),{},{path:t,newPath:n});var r=j.transform(n,e),o=j.transform(j.next(n),e);return Pe(Pe({},e),{},{path:r,newPath:o});case"remove_node":return Pe(Pe({},e),{},{type:"insert_node"});case"remove_text":return Pe(Pe({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return Pe(Pe({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:s,newProperties:u}=e;return Pe(Pe({},e),{},s==null?{properties:u,newProperties:null}:u==null?{properties:null,newProperties:s}:{properties:u,newProperties:s});case"split_node":return Pe(Pe({},e),{},{type:"merge_node",path:j.next(e.path)})}}},Ju=new WeakMap,w={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:e=>(t=>{var n=Ju.get(t);if(n!==void 0)return n;if(!Ve(t))return!1;var r=typeof t.addMark=="function"&&typeof t.apply=="function"&&typeof t.deleteFragment=="function"&&typeof t.insertBreak=="function"&&typeof t.insertSoftBreak=="function"&&typeof t.insertFragment=="function"&&typeof t.insertNode=="function"&&typeof t.insertText=="function"&&typeof t.isElementReadOnly=="function"&&typeof t.isInline=="function"&&typeof t.isSelectable=="function"&&typeof t.isVoid=="function"&&typeof t.normalizeNode=="function"&&typeof t.onChange=="function"&&typeof t.removeMark=="function"&&typeof t.getDirtyPaths=="function"&&(t.marks===null||Ve(t.marks))&&(t.selection===null||M.isRange(t.selection))&&te.isNodeList(t.children)&&cn.isOperationList(t.operations);return Ju.set(t,r),r})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,n)=>e.shouldMergeNodesRemovePrevNode(t,n)},gv={isSpan:e=>Array.isArray(e)&&e.length===2&&e.every(j.isPath)};function Qu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ec(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qu(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Ee={compare(e,t){var n=j.compare(e.path,t.path);return n===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>Ee.compare(e,t)===1,isBefore:(e,t)=>Ee.compare(e,t)===-1,equals:(e,t)=>e.offset===t.offset&&j.equals(e.path,t.path),isPoint:e=>Ve(e)&&typeof e.offset=="number"&&j.isPath(e.path),transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return ts(e,r=>{if(r===null)return null;var{affinity:o="forward"}=n,{path:i,offset:a}=r;switch(t.type){case"insert_node":case"move_node":r.path=j.transform(i,t,n);break;case"insert_text":j.equals(t.path,i)&&(t.offset<a||t.offset===a&&o==="forward")&&(r.offset+=t.text.length);break;case"merge_node":j.equals(t.path,i)&&(r.offset+=t.position),r.path=j.transform(i,t,n);break;case"remove_text":j.equals(t.path,i)&&t.offset<=a&&(r.offset-=Math.min(a-t.offset,t.text.length));break;case"remove_node":if(j.equals(t.path,i)||j.isAncestor(t.path,i))return null;r.path=j.transform(i,t,n);break;case"split_node":if(j.equals(t.path,i)){if(t.position===a&&o==null)return null;(t.position<a||t.position===a&&o==="forward")&&(r.offset-=t.position,r.path=j.transform(i,t,ec(ec({},n),{},{affinity:"forward"})))}else r.path=j.transform(i,t,n)}})}},tc=void 0,He={setScrubber(e){tc=e},stringify:e=>JSON.stringify(e,tc)},vv=["text"],yv=["anchor","focus"];function nc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ht(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nc(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ve,se={equals(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{loose:r=!1}=n;function o(i){return Kt(i,vv)}return Yd(r?o(e):e,r?o(t):t)},isText:e=>Ve(e)&&typeof e.text=="string",isTextList:e=>Array.isArray(e)&&e.every(t=>se.isText(t)),isTextProps:e=>e.text!==void 0,matches(e,t){for(var n in t)if(n!=="text"&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[Ht({},e)];for(var r of t){var o=Kt(r,yv),[i,a]=M.edges(r),s=[],u=0,c=i.offset,l=a.offset;for(var d of n){var{length:p}=d.text,m=u;if(u+=p,c<=m&&u<=l)Object.assign(d,o),s.push(d);else if(c!==l&&(c===u||l===m)||c>u||l<m||l===m&&m!==0)s.push(d);else{var g=d,y=void 0,f=void 0;if(l<u){var b=l-m;f=Ht(Ht({},g),{},{text:g.text.slice(b)}),g=Ht(Ht({},g),{},{text:g.text.slice(0,b)})}if(c>m){var C=c-m;y=Ht(Ht({},g),{},{text:g.text.slice(0,C)}),g=Ht(Ht({},g),{},{text:g.text.slice(C)})}Object.assign(g,o),y&&s.push(y),s.push(g),f&&s.push(f)}}n=s}return n}},bs=e=>e.selection?e.selection:e.children.length>0?w.end(e,[]):[0],Un=(e,t)=>{var[n]=w.node(e,t);return r=>r===n},Ba=function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=!t,r=t?Ev(e):e,o=ve.None,i=ve.None,a=0,s=null;for(var u of r){var c=u.codePointAt(0);if(!c)break;var l=_v(u,c);if([o,i]=n?[i,l]:[l,o],Gn(o,ve.ZWJ)&&Gn(i,ve.ExtPict)&&!Lv(n?e.substring(0,a):e.substring(0,e.length-a))||Gn(o,ve.RI)&&Gn(i,ve.RI)&&!(s=s!==null?!s:!!n||Vv(e.substring(0,e.length-a)))||o!==ve.None&&i!==ve.None&&Pv(o,i))break;a+=u.length}return a||1},bv=/\s/,wv=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,Cv=/['\u2018\u2019]/,ka=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},Dv=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(bv.test(t))return!1;if(Cv.test(t)){var o=Ba(n,r),[i,a]=ka(n,o,r);if(e(i,a,r))return!0}return!wv.test(t)},Ev=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var r=e.charAt(t-n);if(xv(r.charCodeAt(0))){var o=e.charAt(t-n-1);if(Av(o.charCodeAt(0))){yield o+r,n++;continue}}yield r}},Av=e=>e>=55296&&e<=56319,xv=e=>e>=56320&&e<=57343;(function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"})(ve||(ve={}));var Ov=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,Bv=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,kv=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,Sv=/^[\u1100-\u115F\uA960-\uA97C]$/,Iv=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,Fv=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Tv=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,jv=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,Rv=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,_v=(e,t)=>{var n=ve.Any;return e.search(Ov)!==-1&&(n|=ve.Extend),t===8205&&(n|=ve.ZWJ),t>=127462&&t<=127487&&(n|=ve.RI),e.search(Bv)!==-1&&(n|=ve.Prepend),e.search(kv)!==-1&&(n|=ve.SpacingMark),e.search(Sv)!==-1&&(n|=ve.L),e.search(Iv)!==-1&&(n|=ve.V),e.search(Fv)!==-1&&(n|=ve.T),e.search(Tv)!==-1&&(n|=ve.LV),e.search(jv)!==-1&&(n|=ve.LVT),e.search(Rv)!==-1&&(n|=ve.ExtPict),n};function Gn(e,t){return!!(e&t)}var Nv=[[ve.L,ve.L|ve.V|ve.LV|ve.LVT],[ve.LV|ve.V,ve.V|ve.T],[ve.LVT|ve.T,ve.T],[ve.Any,ve.Extend|ve.ZWJ],[ve.Any,ve.SpacingMark],[ve.Prepend,ve.Any],[ve.ZWJ,ve.ExtPict],[ve.RI,ve.RI]];function Pv(e,t){return Nv.findIndex(n=>Gn(e,n[0])&&Gn(t,n[1]))===-1}var Mv=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,Lv=e=>e.search(Mv)!==-1,Uv=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Vv=e=>{var t=e.match(Uv);return t!==null&&t[0].length/2%2==1},Hv={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};w.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:o=bs(e)}=n;if(j.isPath(o)&&(o=w.range(e,o)),M.isRange(o))if(M.isCollapsed(o))o=o.anchor;else{var i=M.end(o);if(!r&&w.void(e,{at:i}))return;var a=M.start(o),s=w.pointRef(e,a),u=w.pointRef(e,i);z.delete(e,{at:o,voids:r});var c=s.unref(),l=u.unref();o=c||l,z.setSelection(e,{anchor:o,focus:o})}if(!(!r&&w.void(e,{at:o})||w.elementReadOnly(e,{at:o}))){var{path:d,offset:p}=o;t.length>0&&e.apply({type:"insert_text",path:d,offset:p,text:t})}})}};function rc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function bo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rc(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var z=bo(bo(bo(bo({},lv),dv),fv),Hv),No=new WeakMap;function Jd(e,t,n){var r,o,i=Jo.get(e)||[],a=Qo.get(e)||new Set,s=l=>{if(l){var d=l.join(",");o.has(d)||(o.add(d),r.push(l))}};if(n)for(var u of(r=[],o=new Set,i))s(n(u));else r=i,o=a;for(var c of t)s(c);Jo.set(e,r),Qo.set(e,o)}var Wv=(e,t)=>{for(var n of w.pathRefs(e))av.transform(n,t);for(var r of w.pointRefs(e))sv.transform(r,t);for(var o of w.rangeRefs(e))uv.transform(o,t);if(!(a=>No.get(a)||!1)(e)){var i=j.operationCanTransformPath(t)?a=>j.transform(a,t):void 0;Jd(e,e.getDirtyPaths(t),i)}z.transform(e,t),e.operations.push(t),w.normalize(e,{operation:t}),t.type==="set_selection"&&(e.marks=null),jr.get(e)||(jr.set(e,!0),Promise.resolve().then(()=>{jr.set(e,!1),e.onChange({operation:t}),e.operations=[]}))};function oc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ic(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oc(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ac(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function sc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ac(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ac(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function cc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uc(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function dc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lc(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function hc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fc(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}var Qd=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:r,marks:o}=e;if(r){if(o){var i=function(a){for(var s=1;s<arguments.length;s++){var u=arguments[s]!=null?arguments[s]:{};s%2?pc(Object(u),!0).forEach(function(c){Je(a,c,u[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(u)):pc(Object(u)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(u,c))})}return a}({text:t},o);z.insertNodes(e,i,{at:n.at,voids:n.voids})}else z.insertText(e,t,n);e.marks=null}},zv=["text"],$v=["text"],qv=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{force:n=!1,operation:r}=t,o=u=>Jo.get(u)||[],i=u=>{var c=o(u).pop(),l=c.join(",");return(d=>Qo.get(d)||new Set)(u).delete(l),c};if(w.isNormalizing(e)){if(n){var a=Array.from(te.nodes(e),u=>{var[,c]=u;return c}),s=new Set(a.map(u=>u.join(",")));Jo.set(e,a),Qo.set(e,s)}o(e).length!==0&&w.withoutNormalizing(e,()=>{for(var u of o(e))if(te.has(e,u)){var c=w.node(e,u),[l,d]=c;ae.isElement(l)&&l.children.length===0&&e.normalizeNode(c,{operation:r})}for(var p=o(e),m=p.length,g=0;p.length!==0;){if(!e.shouldNormalize({dirtyPaths:p,iteration:g,initialDirtyPathsLength:m,operation:r}))return;var y=i(e);if(te.has(e,y)){var f=w.node(e,y);e.normalizeNode(f,{operation:r})}g++,p=o(e)}})}};function Kv(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:i=!1,ignoreNonSelectable:a=!1}=t;if(n){var s=w.range(e,n),[u,c]=M.edges(s),l=o?c:u,d=!1,p="",m=0,g=0,y=0;for(var[f,b]of w.nodes(e,{at:n,reverse:o,voids:i,ignoreNonSelectable:a})){if(ae.isElement(f)){if(!i&&(e.isVoid(f)||e.isElementReadOnly(f))){yield w.start(e,b);continue}if(e.isInline(f))continue;if(w.hasInlines(e,f)){var C=j.isAncestor(b,c.path)?c:w.end(e,b),D=j.isAncestor(b,u.path)?u:w.start(e,b);p=w.string(e,{anchor:D,focus:C},{voids:i}),d=!0}}if(se.isText(f)){var E=j.equals(b,l.path);for(E?(g=o?l.offset:f.text.length-l.offset,y=l.offset):(g=f.text.length,y=o?g:0),(E||d||r==="offset")&&(yield{path:b,offset:y},d=!1);;){if(m===0){if(p==="")break;m=A(p,r,o),p=ka(p,m,o)[1]}if(y=o?y-m:y+m,(g-=m)<0){m=-g;break}m=0,yield{path:b,offset:y}}}}}function A(B,O,S){return O==="character"?Ba(B,S):O==="word"?function(k){for(var T=arguments.length>1&&arguments[1]!==void 0&&arguments[1],F=0,R=!1;k.length>0;){var P=Ba(k,T),[H,G]=ka(k,P,T);if(Dv(H,G,T))R=!0,F+=P;else{if(R)break;F+=P}k=G}return F}(B,S):O==="line"||O==="block"?B.length:1}}()}function mc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}var Gv=(e,t)=>{var{selection:n}=e;if(n){var r=(l,d)=>{if(!se.isText(l))return!1;var[p,m]=w.parent(e,d);return!e.isVoid(p)||e.markableVoid(p)},o=M.isExpanded(n),i=!1;if(!o){var[a,s]=w.node(e,n);if(a&&r(a,s)){var[u]=w.parent(e,s);i=u&&e.markableVoid(u)}}if(o||i)z.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var c=function(l){for(var d=1;d<arguments.length;d++){var p=arguments[d]!=null?arguments[d]:{};d%2?mc(Object(p),!0).forEach(function(m){Je(l,m,p[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(p)):mc(Object(p)).forEach(function(m){Object.defineProperty(l,m,Object.getOwnPropertyDescriptor(p,m))})}return l}({},w.marks(e)||{});delete c[t],e.marks=c,jr.get(e)||e.onChange()}}};function gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function vc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gc(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Xv=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};w.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest",batchDirty:a=!0}=n,{at:s,match:u,select:c}=n;if(te.isNode(t)&&(t=[t]),t.length!==0){var[l]=t;if(s||(s=bs(e),c!==!1&&(c=!0)),c==null&&(c=!1),M.isRange(s))if(r||(s=w.unhangRange(e,s,{voids:o})),M.isCollapsed(s))s=s.anchor;else{var[,d]=M.edges(s),p=w.pointRef(e,d);z.delete(e,{at:s}),s=p.unref()}if(Ee.isPoint(s)){u==null&&(u=se.isText(l)?k=>se.isText(k):e.isInline(l)?k=>se.isText(k)||w.isInline(e,k):k=>ae.isElement(k)&&w.isBlock(e,k));var[m]=w.nodes(e,{at:s.path,match:u,mode:i,voids:o});if(!m)return;var[,g]=m,y=w.pathRef(e,g),f=w.isEnd(e,s,g);z.splitNodes(e,{at:s,match:u,mode:i,voids:o});var b=y.unref();s=f?j.next(b):b}var C=j.parent(s),D=s[s.length-1];if(o||!w.void(e,{at:C})){if(a){var E=[],A=j.levels(C);((k,T,F)=>{var R=No.get(k)||!1;No.set(k,!0);try{T(),F()}finally{No.set(k,R)}})(e,()=>{var k=function(){var F=C.concat(D);D++;var R={type:"insert_node",path:F,node:T};e.apply(R),s=j.next(s),E.push(R),se.isText?A.push(...Array.from(te.nodes(T),P=>{var[,H]=P;return F.concat(H)})):A.push(F)};for(var T of t)k()},()=>{Jd(e,A,k=>{var T=k;for(var F of E)if(j.operationCanTransformPath(F)&&!(T=j.transform(T,F)))return null;return T})})}else for(var B of t){var O=C.concat(D);D++,e.apply({type:"insert_node",path:O,node:B}),s=j.next(s)}if(s=j.previous(s),c){var S=w.end(e,s);S&&z.select(e,S)}}}})},Zv=["text"],Yv=["children"],ef=(e,t)=>{if(ae.isElement(t)){var n=t;return!!w.isVoid(e,t)||n.children.length===1&&ef(e,n.children[0])}return!w.isEditor(t)},Jv=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};w.withoutNormalizing(e,()=>{var{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection,height:a=0,always:s=!1}=t;if(o==null&&(o=G=>ae.isElement(G)&&w.isBlock(e,G)),M.isRange(i)&&(i=((G,Z)=>{if(M.isCollapsed(Z))return Z.anchor;var[,$]=M.edges(Z),W=w.pointRef(G,$);return z.delete(G,{at:Z}),W.unref()})(e,i)),j.isPath(i)){var u=i,c=w.point(e,u),[l]=w.parent(e,u);o=G=>G===l,a=c.path.length-u.length+1,i=c,s=!0}if(i){var d,p=w.pointRef(e,i,{affinity:"backward"});try{var[m]=w.nodes(e,{at:i,match:o,mode:n,voids:r});if(!m)return;var g=w.void(e,{at:i,mode:"highest"});if(!r&&g){var[y,f]=g;if(ae.isElement(y)&&e.isInline(y)){var b=w.after(e,f);if(!b){var C=j.next(f);z.insertNodes(e,{text:""},{at:C,voids:r}),b=w.point(e,C)}i=b,s=!0}a=i.path.length-f.length+1,s=!0}d=w.pointRef(e,i);var D=i.path.length-a,[,E]=m,A=i.path.slice(0,D),B=a===0?i.offset:i.path[D]+0;for(var[O,S]of w.levels(e,{at:A,reverse:!0,voids:r})){var k=!1;if(S.length<E.length||S.length===0||!r&&ae.isElement(O)&&w.isVoid(e,O))break;var T=p.current,F=w.isEnd(e,T,S);if(s||!p||!w.isEdge(e,T,S)){k=!0;var R=te.extractProps(O);e.apply({type:"split_node",path:S,position:B,properties:R})}B=S[S.length-1]+(k||F?1:0)}if(t.at==null){var P=d.current||w.end(e,[]);z.select(e,P)}}finally{var H;p.unref(),(H=d)===null||H===void 0||H.unref()}}})};function yc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function bc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yc(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var tf=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Wv(e,...n)},addMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i,a)=>{var{selection:s}=o;if(s){var u=(y,f)=>{if(!se.isText(y))return!1;var[b,C]=w.parent(o,f);return!o.isVoid(b)||o.markableVoid(b)},c=M.isExpanded(s),l=!1;if(!c){var[d,p]=w.node(o,s);if(d&&u(d,p)){var[m]=w.parent(o,p);l=m&&o.markableVoid(m)}}if(c||l)z.setNodes(o,{[i]:a},{match:u,split:!0,voids:!0});else{var g=ic(ic({},w.marks(o)||{}),{},{[i]:a});o.marks=g,jr.get(o)||o.onChange()}}})(e,...n)},deleteBackward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var{selection:a}=o;a&&M.isCollapsed(a)&&z.delete(o,{unit:i,reverse:!0})})(e,...n)},deleteForward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var{selection:a}=o;a&&M.isCollapsed(a)&&z.delete(o,{unit:i})})(e,...n)},deleteFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var{direction:i="forward"}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:a}=o;a&&M.isExpanded(a)&&z.delete(o,{reverse:i==="backward"})}(e,...n)},getFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(o=>{var{selection:i}=o;return i?te.fragment(o,i):[]})(e,...n)},insertBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(o=>{z.splitNodes(o,{always:!0})})(e,...n)},insertSoftBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(o=>{z.splitNodes(o,{always:!0})})(e,...n)},insertFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};w.withoutNormalizing(o,()=>{var{hanging:s=!1,voids:u=!1}=a,{at:c=bs(o),batchDirty:l=!0}=a;if(i.length){if(M.isRange(c))if(s||(c=w.unhangRange(o,c,{voids:u})),M.isCollapsed(c))c=c.anchor;else{var[,d]=M.edges(c);if(!u&&w.void(o,{at:d}))return;var p=w.pointRef(o,d);z.delete(o,{at:c}),c=p.unref()}else j.isPath(c)&&(c=w.start(o,c));if(u||!w.void(o,{at:c})){var m=w.above(o,{at:c,match:I=>ae.isElement(I)&&w.isInline(o,I),mode:"highest",voids:u});if(m){var[,g]=m;w.isEnd(o,c,g)?c=w.after(o,g):w.isStart(o,c,g)&&(c=w.before(o,g))}var y=w.above(o,{match:I=>ae.isElement(I)&&w.isBlock(o,I),at:c,voids:u}),[,f]=y,b=w.isStart(o,c,f),C=w.isEnd(o,c,f),D=b&&C,E=!b||b&&C,A=!C,[,B]=te.first({children:i},[]),[,O]=te.last({children:i},[]),S=[],k=I=>{var[N,_]=I;return!(_.length===0||!D&&(E&&j.isAncestor(_,B)&&ae.isElement(N)&&!o.isVoid(N)&&!o.isInline(N)||A&&j.isAncestor(_,O)&&ae.isElement(N)&&!o.isVoid(N)&&!o.isInline(N)))};for(var T of te.nodes({children:i},{pass:k}))k(T)&&S.push(T);var F=[],R=[],P=[],H=!0,G=!1;for(var[Z]of S)ae.isElement(Z)&&!o.isInline(Z)?(H=!1,G=!0,R.push(Z)):H?F.push(Z):P.push(Z);var[$]=w.nodes(o,{at:c,match:I=>se.isText(I)||w.isInline(o,I),mode:"highest",voids:u}),[,W]=$,U=w.isStart(o,c,W),J=w.isEnd(o,c,W),X=w.pathRef(o,C&&!P.length?j.next(f):f),ie=w.pathRef(o,J?j.next(W):W);z.splitNodes(o,{at:c,match:I=>G?ae.isElement(I)&&w.isBlock(o,I):se.isText(I)||w.isInline(o,I),mode:G?"lowest":"highest",always:G&&(!b||F.length>0)&&(!C||P.length>0),voids:u});var de,ee=w.pathRef(o,!U||U&&J?j.next(W):W);if(z.insertNodes(o,F,{at:ee.current,match:I=>se.isText(I)||w.isInline(o,I),mode:"highest",voids:u,batchDirty:l}),D&&!F.length&&R.length&&!P.length&&z.delete(o,{at:f,voids:u}),z.insertNodes(o,R,{at:X.current,match:I=>ae.isElement(I)&&w.isBlock(o,I),mode:"lowest",voids:u,batchDirty:l}),z.insertNodes(o,P,{at:ie.current,match:I=>se.isText(I)||w.isInline(o,I),mode:"highest",voids:u,batchDirty:l}),!a.at&&(P.length>0&&ie.current?de=j.previous(ie.current):R.length>0&&X.current?de=j.previous(X.current):ee.current&&(de=j.previous(ee.current)),de)){var pe=w.end(o,de);z.select(o,pe)}ee.unref(),X.unref(),ie.unref()}}})}(e,...n)},insertNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i,a)=>{z.insertNodes(o,i,a)})(e,...n)},insertText:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Qd(e,...n)},normalizeNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var[a,s]=i;if(!se.isText(a))if(ae.isElement(a)&&a.children.length===0)z.insertNodes(o,{text:""},{at:s.concat(0),voids:!0});else for(var u=!w.isEditor(a)&&ae.isElement(a)&&(o.isInline(a)||a.children.length===0||se.isText(a.children[0])||o.isInline(a.children[0])),c=0,l=0;l<a.children.length;l++,c++){var d=te.get(o,s);if(!se.isText(d)){var p=d.children[c],m=d.children[c-1],g=l===a.children.length-1;(se.isText(p)||ae.isElement(p)&&o.isInline(p))!==u?(z.removeNodes(o,{at:s.concat(c),voids:!0}),c--):ae.isElement(p)?o.isInline(p)&&(m!=null&&se.isText(m)?g&&(z.insertNodes(o,{text:""},{at:s.concat(c+1),voids:!0}),c++):(z.insertNodes(o,{text:""},{at:s.concat(c),voids:!0}),c++)):(se.isText(p)||"children"in p||(p.children=[]),m!=null&&se.isText(m)&&(se.equals(p,m,{loose:!0})?(z.mergeNodes(o,{at:s.concat(c),voids:!0}),c--):m.text===""?(z.removeNodes(o,{at:s.concat(c-1),voids:!0}),c--):p.text===""&&(z.removeNodes(o,{at:s.concat(c),voids:!0}),c--)))}}})(e,...n)},removeMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Gv(e,...n)},getDirtyPaths:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{switch(i.type){case"insert_text":case"remove_text":case"set_node":var{path:a}=i;return j.levels(a);case"insert_node":var{node:s,path:u}=i,c=j.levels(u),l=se.isText(s)?[]:Array.from(te.nodes(s),k=>{var[,T]=k;return u.concat(T)});return[...c,...l];case"merge_node":var{path:d}=i;return[...j.ancestors(d),j.previous(d)];case"move_node":var{path:p,newPath:m}=i;if(j.equals(p,m))return[];var g=[],y=[];for(var f of j.ancestors(p)){var b=j.transform(f,i);g.push(b)}for(var C of j.ancestors(m)){var D=j.transform(C,i);y.push(D)}var E=y[y.length-1],A=m[m.length-1],B=E.concat(A);return[...g,...y,B];case"remove_node":var{path:O}=i;return[...j.ancestors(O)];case"split_node":var{path:S}=i;return[...j.levels(S),j.next(S)];default:return[]}})(e,...n)},shouldNormalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var{iteration:a,initialDirtyPathsLength:s}=i,u=42*s;if(a>u)throw new Error("Could not completely normalize the editor after ".concat(u," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0})(e,...n)},above:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{voids:a=!1,mode:s="lowest",at:u=o.selection,match:c}=i;if(u){var l=w.path(o,u),d=s==="lowest";for(var[p,m]of w.levels(o,{at:l,voids:a,match:c,reverse:d}))if(!se.isText(p)){if(M.isRange(u)){if(j.isAncestor(m,u.anchor.path)&&j.isAncestor(m,u.focus.path))return[p,m]}else if(!j.equals(l,m))return[p,m]}}}(e,...n)},after:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u={anchor:w.point(o,i,{edge:"end"}),focus:w.end(o,[])},{distance:c=1}=s,l=0;for(var d of w.positions(o,sc(sc({},s),{},{at:u}))){if(l>c)break;l!==0&&(a=d),l++}return a}(e,...n)},before:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u={anchor:w.start(o,[]),focus:w.point(o,i,{edge:"start"})},{distance:c=1}=s,l=0;for(var d of w.positions(o,cc(cc({},s),{},{at:u,reverse:!0}))){if(l>c)break;l!==0&&(a=d),l++}return a}(e,...n)},collapse:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{edge:a="anchor"}=i,{selection:s}=o;if(s){if(a==="anchor")z.select(o,s.anchor);else if(a==="focus")z.select(o,s.focus);else if(a==="start"){var[u]=M.edges(s);z.select(o,u)}else if(a==="end"){var[,c]=M.edges(s);z.select(o,c)}}}(e,...n)},delete:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};w.withoutNormalizing(o,()=>{var a,s,{reverse:u=!1,unit:c="character",distance:l=1,voids:d=!1}=i,{at:p=o.selection,hanging:m=!1}=i;if(p){var g=!1;if(M.isRange(p)&&M.isCollapsed(p)&&(g=!0,p=p.anchor),Ee.isPoint(p)){var y=w.void(o,{at:p,mode:"highest"});if(!d&&y){var[,f]=y;p=f}else{var b={unit:c,distance:l};p={anchor:p,focus:u?w.before(o,p,b)||w.start(o,[]):w.after(o,p,b)||w.end(o,[])},m=!0}}if(j.isPath(p))z.removeNodes(o,{at:p,voids:d});else if(!M.isCollapsed(p)){if(!m){var[,C]=M.edges(p),D=w.end(o,[]);Ee.equals(C,D)||(p=w.unhangRange(o,p,{voids:d}))}var[E,A]=M.edges(p),B=w.above(o,{match:le=>ae.isElement(le)&&w.isBlock(o,le),at:E,voids:d}),O=w.above(o,{match:le=>ae.isElement(le)&&w.isBlock(o,le),at:A,voids:d}),S=B&&O&&!j.equals(B[1],O[1]),k=j.equals(E.path,A.path),T=d?null:(a=w.void(o,{at:E,mode:"highest"}))!==null&&a!==void 0?a:w.elementReadOnly(o,{at:E,mode:"highest"}),F=d?null:(s=w.void(o,{at:A,mode:"highest"}))!==null&&s!==void 0?s:w.elementReadOnly(o,{at:A,mode:"highest"});if(T){var R=w.before(o,E);R&&B&&j.isAncestor(B[1],R.path)&&(E=R)}if(F){var P=w.after(o,A);P&&O&&j.isAncestor(O[1],P.path)&&(A=P)}var H,G=[];for(var Z of w.nodes(o,{at:p,voids:d})){var[$,W]=Z;H&&j.compare(W,H)===0||(!d&&ae.isElement($)&&(w.isVoid(o,$)||w.isElementReadOnly(o,$))||!j.isCommon(W,E.path)&&!j.isCommon(W,A.path))&&(G.push(Z),H=W)}var U=Array.from(G,le=>{var[,Ae]=le;return w.pathRef(o,Ae)}),J=w.pointRef(o,E),X=w.pointRef(o,A),ie="";if(!k&&!T){var de=J.current,[ee]=w.leaf(o,de),{path:pe}=de,{offset:I}=E,N=ee.text.slice(I);N.length>0&&(o.apply({type:"remove_text",path:pe,offset:I,text:N}),ie=N)}if(U.reverse().map(le=>le.unref()).filter(le=>le!==null).forEach(le=>z.removeNodes(o,{at:le,voids:d})),!F){var _=X.current,[K]=w.leaf(o,_),{path:oe}=_,Q=k?E.offset:0,ue=K.text.slice(Q,A.offset);ue.length>0&&(o.apply({type:"remove_text",path:oe,offset:Q,text:ue}),ie=ue)}!k&&S&&X.current&&J.current&&z.mergeNodes(o,{at:X.current,hanging:!0,voids:d}),g&&u&&c==="character"&&ie.length>1&&ie.match(/[\u0E00-\u0E7F]+/)&&z.insertText(o,ie.slice(0,ie.length-l));var ce=J.unref(),he=X.unref(),be=u?ce||he:he||ce;i.at==null&&be&&z.select(o,be)}}})}(e,...n)},deselect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(o=>{var{selection:i}=o;i&&o.apply({type:"set_selection",properties:i,newProperties:null})})(e,...n)},edges:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>[w.start(o,i),w.end(o,i)])(e,...n)},elementReadOnly:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return w.above(o,dc(dc({},i),{},{match:a=>ae.isElement(a)&&w.isElementReadOnly(o,a)}))}(e,...n)},end:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>w.point(o,i,{edge:"end"}))(e,...n)},first:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var a=w.path(o,i,{edge:"start"});return w.node(o,a)})(e,...n)},fragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var a=w.range(o,i);return te.fragment(o,a)})(e,...n)},getMarks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var{marks:i,selection:a}=o;if(!a)return null;var{anchor:s,focus:u}=a;if(i)return i;if(M.isExpanded(a)){if(M.isBackward(a)&&([u,s]=[s,u]),w.isEnd(o,s,s.path)){var c=w.after(o,s);c&&(s=c)}var[l]=w.nodes(o,{match:se.isText,at:{anchor:s,focus:u}});if(l){var[d]=l;return Kt(d,zv)}return{}}var{path:p}=s,[m]=w.leaf(o,p);if(s.offset===0){var g=w.previous(o,{at:p,match:se.isText}),y=w.above(o,{match:E=>ae.isElement(E)&&w.isVoid(o,E)&&o.markableVoid(E)});if(!y){var f=w.above(o,{match:E=>ae.isElement(E)&&w.isBlock(o,E)});if(g&&f){var[b,C]=g,[,D]=f;j.isAncestor(D,C)&&(m=b)}}}return Kt(m,$v)}(e,...n)},hasBlocks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>i.children.some(a=>ae.isElement(a)&&w.isBlock(o,a)))(e,...n)},hasInlines:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>i.children.some(a=>se.isText(a)||w.isInline(o,a)))(e,...n)},hasPath:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>te.has(o,i))(e,...n)},hasTexts:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>i.children.every(a=>se.isText(a)))(e,...n)},insertNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xv(e,...n)},isBlock:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>!o.isInline(i))(e,...n)},isEdge:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i,a)=>w.isStart(o,i,a)||w.isEnd(o,i,a))(e,...n)},isEmpty:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var{children:a}=i,[s]=a;return a.length===0||a.length===1&&se.isText(s)&&s.text===""&&!o.isVoid(i)})(e,...n)},isEnd:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i,a)=>{var s=w.end(o,a);return Ee.equals(i,s)})(e,...n)},isNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(o=>{var i=Wu.get(o);return i===void 0||i})(e,...n)},isStart:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i,a)=>{if(i.offset!==0)return!1;var s=w.start(o,a);return Ee.equals(i,s)})(e,...n)},last:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var a=w.path(o,i,{edge:"end"});return w.node(o,a)})(e,...n)},leaf:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=w.path(o,i,a);return[te.leaf(o,s),s]}(e,...n)},levels:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:a=o.selection,reverse:s=!1,voids:u=!1}=i,{match:c}=i;if(c==null&&(c=()=>!0),a){var l=[],d=w.path(o,a);for(var[p,m]of te.levels(o,d))if(c(p,m)&&(l.push([p,m]),!u&&ae.isElement(p)&&w.isVoid(o,p)))break;s&&l.reverse(),yield*l}}()}(e,...n)},liftNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};w.withoutNormalizing(o,()=>{var{at:a=o.selection,mode:s="lowest",voids:u=!1}=i,{match:c}=i;if(c==null&&(c=j.isPath(a)?Un(o,a):O=>ae.isElement(O)&&w.isBlock(o,O)),a){var l=w.nodes(o,{at:a,match:c,mode:s,voids:u}),d=Array.from(l,O=>{var[,S]=O;return w.pathRef(o,S)});for(var p of d){var m=p.unref();if(m.length<2)throw new Error("Cannot lift node at a path [".concat(m,"] because it has a depth of less than `2`."));var g=w.node(o,j.parent(m)),[y,f]=g,b=m[m.length-1],{length:C}=y.children;if(C===1){var D=j.next(f);z.moveNodes(o,{at:m,to:D,voids:u}),z.removeNodes(o,{at:f,voids:u})}else if(b===0)z.moveNodes(o,{at:m,to:f,voids:u});else if(b===C-1){var E=j.next(f);z.moveNodes(o,{at:m,to:E,voids:u})}else{var A=j.next(m),B=j.next(f);z.splitNodes(o,{at:A,voids:u}),z.moveNodes(o,{at:m,to:B,voids:u})}}}})}(e,...n)},mergeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};w.withoutNormalizing(o,()=>{var{match:a,at:s=o.selection}=i,{hanging:u=!1,voids:c=!1,mode:l="lowest"}=i;if(s){if(a==null)if(j.isPath(s)){var[d]=w.parent(o,s);a=P=>d.children.includes(P)}else a=P=>ae.isElement(P)&&w.isBlock(o,P);if(!u&&M.isRange(s)&&(s=w.unhangRange(o,s,{voids:c})),M.isRange(s))if(M.isCollapsed(s))s=s.anchor;else{var[,p]=M.edges(s),m=w.pointRef(o,p);z.delete(o,{at:s}),s=m.unref(),i.at==null&&z.select(o,s)}var[g]=w.nodes(o,{at:s,match:a,voids:c,mode:l}),y=w.previous(o,{at:s,match:a,voids:c,mode:l});if(g&&y){var[f,b]=g,[C,D]=y;if(b.length!==0&&D.length!==0){var E,A,B=j.next(D),O=j.common(b,D),S=j.isSibling(b,D),k=Array.from(w.levels(o,{at:b}),P=>{var[H]=P;return H}).slice(O.length).slice(0,-1),T=w.above(o,{at:b,mode:"highest",match:P=>k.includes(P)&&ef(o,P)}),F=T&&w.pathRef(o,T[1]);if(se.isText(f)&&se.isText(C)){var R=Kt(f,Zv);A=C.text.length,E=R}else{if(!ae.isElement(f)||!ae.isElement(C))throw new Error("Cannot merge the node at path [".concat(b,"] with the previous sibling because it is not the same kind: ").concat(He.stringify(f)," ").concat(He.stringify(C)));R=Kt(f,Yv),A=C.children.length,E=R}S||z.moveNodes(o,{at:b,to:B,voids:c}),F&&z.removeNodes(o,{at:F.current,voids:c}),w.shouldMergeNodesRemovePrevNode(o,y,g)?z.removeNodes(o,{at:D,voids:c}):o.apply({type:"merge_node",path:B,position:A,properties:E}),F&&F.unref()}}}})}(e,...n)},move:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:a}=o,{distance:s=1,unit:u="character",reverse:c=!1}=i,{edge:l=null}=i;if(a){l==="start"&&(l=M.isBackward(a)?"focus":"anchor"),l==="end"&&(l=M.isBackward(a)?"anchor":"focus");var{anchor:d,focus:p}=a,m={distance:s,unit:u,ignoreNonSelectable:!0},g={};if(l==null||l==="anchor"){var y=c?w.before(o,d,m):w.after(o,d,m);y&&(g.anchor=y)}if(l==null||l==="focus"){var f=c?w.before(o,p,m):w.after(o,p,m);f&&(g.focus=f)}z.setSelection(o,g)}}(e,...n)},moveNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{w.withoutNormalizing(o,()=>{var{to:a,at:s=o.selection,mode:u="lowest",voids:c=!1}=i,{match:l}=i;if(s){l==null&&(l=j.isPath(s)?Un(o,s):b=>ae.isElement(b)&&w.isBlock(o,b));var d=w.pathRef(o,a),p=w.nodes(o,{at:s,match:l,mode:u,voids:c}),m=Array.from(p,b=>{var[,C]=b;return w.pathRef(o,C)});for(var g of m){var y=g.unref(),f=d.current;y.length!==0&&o.apply({type:"move_node",path:y,newPath:f}),d.current&&j.isSibling(f,y)&&j.isAfter(f,y)&&(d.current=j.next(d.current))}d.unref()}})})(e,...n)},next:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:a="lowest",voids:s=!1}=i,{match:u,at:c=o.selection}=i;if(c){var l=w.after(o,c,{voids:s});if(l){var[,d]=w.last(o,[]),p=[l.path,d];if(j.isPath(c)&&c.length===0)throw new Error("Cannot get the next node from the root node!");if(u==null)if(j.isPath(c)){var[m]=w.parent(o,c);u=y=>m.children.includes(y)}else u=()=>!0;var[g]=w.nodes(o,{at:p,match:u,mode:a,voids:s});return g}}}(e,...n)},node:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=w.path(o,i,a),u=te.get(o,s);return[u,s]}(e,...n)},nodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:a=o.selection,mode:s="all",universal:u=!1,reverse:c=!1,voids:l=!1,ignoreNonSelectable:d=!1}=i,{match:p}=i;if(p||(p=()=>!0),a){var m,g;if(gv.isSpan(a))m=a[0],g=a[1];else{var y=w.path(o,a,{edge:"start"}),f=w.path(o,a,{edge:"end"});m=c?f:y,g=c?y:f}var b,C=te.nodes(o,{reverse:c,from:m,to:g,pass:S=>{var[k]=S;return!(!ae.isElement(k)||(l||!w.isVoid(o,k)&&!w.isElementReadOnly(o,k))&&(!d||w.isSelectable(o,k)))}}),D=[];for(var[E,A]of C)if(!d||!ae.isElement(E)||w.isSelectable(o,E)){var B=b&&j.compare(A,b[1])===0;if(s!=="highest"||!B){if(p(E,A))if(s==="lowest"&&B)b=[E,A];else{var O=s==="lowest"?b:[E,A];O&&(u?D.push(O):yield O),b=[E,A]}else if(u&&!B&&se.isText(E))return}}s==="lowest"&&b&&(u?D.push(b):yield b),u&&(yield*D)}}()}(e,...n)},normalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return qv(e,...n)},parent:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=w.path(o,i,a),u=j.parent(s);return w.node(o,u)}(e,...n)},path:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{depth:s,edge:u}=a;if(j.isPath(i)){if(u==="start"){var[,c]=te.first(o,i);i=c}else if(u==="end"){var[,l]=te.last(o,i);i=l}}return M.isRange(i)&&(i=u==="start"?M.start(i):u==="end"?M.end(i):j.common(i.anchor.path,i.focus.path)),Ee.isPoint(i)&&(i=i.path),s!=null&&(i=i.slice(0,s)),i}(e,...n)},pathRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:s="forward"}=a,u={current:i,affinity:s,unref(){var{current:c}=u;return w.pathRefs(o).delete(u),u.current=null,c}};return w.pathRefs(o).add(u),u}(e,...n)},pathRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(o=>{var i=zu.get(o);return i||(i=new Set,zu.set(o,i)),i})(e,...n)},point:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{edge:s="start"}=a;if(j.isPath(i)){var u;if(s==="end"){var[,c]=te.last(o,i);u=c}else{var[,l]=te.first(o,i);u=l}var d=te.get(o,u);if(!se.isText(d))throw new Error("Cannot get the ".concat(s," point in the node at path [").concat(i,"] because it has no ").concat(s," text node."));return{path:u,offset:s==="end"?d.text.length:0}}if(M.isRange(i)){var[p,m]=M.edges(i);return s==="start"?p:m}return i}(e,...n)},pointRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:s="forward"}=a,u={current:i,affinity:s,unref(){var{current:c}=u;return w.pointRefs(o).delete(u),u.current=null,c}};return w.pointRefs(o).add(u),u}(e,...n)},pointRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(o=>{var i=$u.get(o);return i||(i=new Set,$u.set(o,i)),i})(e,...n)},positions:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Kv(e,...n)},previous:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:a="lowest",voids:s=!1}=i,{match:u,at:c=o.selection}=i;if(c){var l=w.before(o,c,{voids:s});if(l){var[,d]=w.first(o,[]),p=[l.path,d];if(j.isPath(c)&&c.length===0)throw new Error("Cannot get the previous node from the root node!");if(u==null)if(j.isPath(c)){var[m]=w.parent(o,c);u=y=>m.children.includes(y)}else u=()=>!0;var[g]=w.nodes(o,{reverse:!0,at:p,match:u,mode:a,voids:s});return g}}}(e,...n)},range:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i,a)=>M.isRange(i)&&!a?i:{anchor:w.start(o,i),focus:w.end(o,a||i)})(e,...n)},rangeRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{affinity:s="forward"}=a,u={current:i,affinity:s,unref(){var{current:c}=u;return w.rangeRefs(o).delete(u),u.current=null,c}};return w.rangeRefs(o).add(u),u}(e,...n)},rangeRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(o=>{var i=qu.get(o);return i||(i=new Set,qu.set(o,i)),i})(e,...n)},removeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};w.withoutNormalizing(o,()=>{var{hanging:a=!1,voids:s=!1,mode:u="lowest"}=i,{at:c=o.selection,match:l}=i;if(c){l==null&&(l=j.isPath(c)?Un(o,c):f=>ae.isElement(f)&&w.isBlock(o,f)),!a&&M.isRange(c)&&(c=w.unhangRange(o,c,{voids:s}));var d=w.nodes(o,{at:c,match:l,mode:u,voids:s}),p=Array.from(d,f=>{var[,b]=f;return w.pathRef(o,b)});for(var m of p){var g=m.unref();if(g){var[y]=w.node(o,g);o.apply({type:"remove_node",path:g,node:y})}}}})}(e,...n)},select:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var{selection:a}=o;if(i=w.range(o,i),a)z.setSelection(o,i);else{if(!M.isRange(i))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(He.stringify(i)));o.apply({type:"set_selection",properties:a,newProperties:i})}})(e,...n)},setNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};w.withoutNormalizing(o,()=>{var{match:s,at:u=o.selection,compare:c,merge:l}=a,{hanging:d=!1,mode:p="lowest",split:m=!1,voids:g=!1}=a;if(u){if(s==null&&(s=j.isPath(u)?Un(o,u):F=>ae.isElement(F)&&w.isBlock(o,F)),!d&&M.isRange(u)&&(u=w.unhangRange(o,u,{voids:g})),m&&M.isRange(u)){if(M.isCollapsed(u)&&w.leaf(o,u.anchor)[0].text.length>0)return;var y=w.rangeRef(o,u,{affinity:"inward"}),[f,b]=M.edges(u),C=p==="lowest"?"lowest":"highest",D=w.isEnd(o,b,b.path);z.splitNodes(o,{at:b,match:s,mode:C,voids:g,always:!D});var E=w.isStart(o,f,f.path);z.splitNodes(o,{at:f,match:s,mode:C,voids:g,always:!E}),u=y.unref(),a.at==null&&z.select(o,u)}for(var[A,B]of(c||(c=(F,R)=>F!==R),w.nodes(o,{at:u,match:s,mode:p,voids:g}))){var O={},S={};if(B.length!==0){var k=!1;for(var T in i)T!=="children"&&T!=="text"&&c(i[T],A[T])&&(k=!0,A.hasOwnProperty(T)&&(O[T]=A[T]),l?i[T]!=null&&(S[T]=l(A[T],i[T])):i[T]!=null&&(S[T]=i[T]));k&&o.apply({type:"set_node",path:B,properties:O,newProperties:S})}}}})}(e,...n)},setNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{Wu.set(o,i)})(e,...n)},setPoint:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:s}=o,{edge:u="both"}=a;if(s){u==="start"&&(u=M.isBackward(s)?"focus":"anchor"),u==="end"&&(u=M.isBackward(s)?"anchor":"focus");var{anchor:c,focus:l}=s,d=u==="anchor"?c:l;z.setSelection(o,{[u==="anchor"?"anchor":"focus"]:vc(vc({},d),i)})}}(e,...n)},setSelection:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var{selection:a}=o,s={},u={};if(a){for(var c in i)(c==="anchor"&&i.anchor!=null&&!Ee.equals(i.anchor,a.anchor)||c==="focus"&&i.focus!=null&&!Ee.equals(i.focus,a.focus)||c!=="anchor"&&c!=="focus"&&i[c]!==a[c])&&(s[c]=a[c],u[c]=i[c]);Object.keys(s).length>0&&o.apply({type:"set_selection",properties:s,newProperties:u})}})(e,...n)},splitNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Jv(e,...n)},start:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>w.point(o,i,{edge:"start"}))(e,...n)},string:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:s=!1}=a,u=w.range(o,i),[c,l]=M.edges(u),d="";for(var[p,m]of w.nodes(o,{at:u,match:se.isText,voids:s})){var g=p.text;j.equals(m,l.path)&&(g=g.slice(0,l.offset)),j.equals(m,c.path)&&(g=g.slice(c.offset)),d+=g}return d}(e,...n)},unhangRange:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{voids:s=!1}=a,[u,c]=M.edges(i);if(u.offset!==0||c.offset!==0||M.isCollapsed(i)||j.hasPrevious(c.path))return i;var l=w.above(o,{at:c,match:f=>ae.isElement(f)&&w.isBlock(o,f),voids:s}),d=l?l[1]:[],p={anchor:w.start(o,u),focus:c},m=!0;for(var[g,y]of w.nodes(o,{at:p,match:se.isText,reverse:!0,voids:s}))if(m)m=!1;else if(g.text!==""||j.isBefore(y,d)){c={path:y,offset:g.text.length};break}return{anchor:u,focus:c}}(e,...n)},unsetNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(i)||(i=[i]);var s={};for(var u of i)s[u]=null;z.setNodes(o,s,a)}(e,...n)},unwrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};w.withoutNormalizing(o,()=>{var{mode:a="lowest",split:s=!1,voids:u=!1}=i,{at:c=o.selection,match:l}=i;if(c){l==null&&(l=j.isPath(c)?Un(o,c):f=>ae.isElement(f)&&w.isBlock(o,f)),j.isPath(c)&&(c=w.range(o,c));var d=M.isRange(c)?w.rangeRef(o,c):null,p=w.nodes(o,{at:c,match:l,mode:a,voids:u}),m=Array.from(p,f=>{var[,b]=f;return w.pathRef(o,b)}).reverse(),g=function(){var f=y.unref(),[b]=w.node(o,f),C=w.range(o,f);s&&d&&(C=M.intersection(d.current,C)),z.liftNodes(o,{at:C,match:D=>ae.isAncestor(b)&&b.children.includes(D),voids:u})};for(var y of m)g();d&&d.unref()}})}(e,...n)},void:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return w.above(o,hc(hc({},i),{},{match:a=>ae.isElement(a)&&w.isVoid(o,a)}))}(e,...n)},withoutNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var a=w.isNormalizing(o);w.setNormalizing(o,!1);try{i()}finally{w.setNormalizing(o,a)}w.normalize(o)})(e,...n)},wrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};w.withoutNormalizing(o,()=>{var{mode:s="lowest",split:u=!1,voids:c=!1}=a,{match:l,at:d=o.selection}=a;if(d){if(l==null&&(l=j.isPath(d)?Un(o,d):o.isInline(i)?C=>ae.isElement(C)&&w.isInline(o,C)||se.isText(C):C=>ae.isElement(C)&&w.isBlock(o,C)),u&&M.isRange(d)){var[p,m]=M.edges(d),g=w.rangeRef(o,d,{affinity:"inward"});z.splitNodes(o,{at:m,match:l,voids:c}),z.splitNodes(o,{at:p,match:l,voids:c}),d=g.unref(),a.at==null&&z.select(o,d)}var y=Array.from(w.nodes(o,{at:d,match:o.isInline(i)?C=>ae.isElement(C)&&w.isBlock(o,C):C=>w.isEditor(C),mode:"lowest",voids:c})),f=function(){var C=M.isRange(d)?M.intersection(d,w.range(o,b)):d;if(!C)return 0;var D=Array.from(w.nodes(o,{at:C,match:l,mode:s,voids:c}));if(D.length>0){var[E]=D,A=D[D.length-1],[,B]=E,[,O]=A;if(B.length===0&&O.length===0)return 0;var S=j.equals(B,O)?j.parent(B):j.common(B,O),k=w.range(o,B,O),T=w.node(o,S),[F]=T,R=S.length+1,P=j.next(O.slice(0,R)),H=bc(bc({},i),{},{children:[]});z.insertNodes(o,H,{at:P,voids:c}),z.moveNodes(o,{at:k,match:G=>ae.isAncestor(F)&&F.children.includes(G),to:P.concat(0),voids:c})}};for(var[,b]of y)f()}})}(e,...n)},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((o,i)=>{var[a,s]=i;return ae.isElement(a)&&w.isEmpty(o,a)||se.isText(a)&&a.text===""&&s[s.length-1]!==0})(e,...n)}};return e};function Wr(e,t,n={}){const{filterVoids:r}=n,o=w.before(e,t,{unit:"character",voids:r});if(o){const i=w.range(e,o,M.isRange(t)?M.start(t):t),a=w.string(e,i);return{range:i,text:a,void:a.length===0}}}function ws(e,t,n={}){const{filterVoids:r}=n,o=w.after(e,t,{unit:"character",voids:r});if(o){const i=w.range(e,o,M.isRange(t)?M.end(t):t),a=w.string(e,i);return{range:i,text:a,void:a.length===0}}}const Qv=/\s/;function ei(e){return!!e&&Qv.test(e)}const wc={direction:"before",allowConsecutiveWhitespace:!0};function nf(e,t,n=[" "],r=wc){const{include:o,direction:i,ignoreTerminator:a,allowConsecutiveWhitespace:s}={...wc,...r};let[u,c]=M.edges(t),l=u,d=!1;function p(m){const g=m==="after"?w.after(e,l,{unit:"character"}):w.before(e,l,{unit:"character"});if(!g||j.compare(g.path,l.path)!==0)return!1;const y=g&&w.string(e,m==="after"?{anchor:l,focus:g}:{anchor:g,focus:l}),f=y&&y[m==="after"?0:y.length-1];return!(!s&&d&&ei(f))&&!(!g||!f||n.includes(f)&&!a?.(f,g,m))&&(d=ei(f),l=g,l.offset!==0)}if(i!=="before"){for(l=c;p("after"););c=l}if(i!=="after"){for(l=u;p("before"););u=l}return o?{anchor:i==="before"||i==="both"?w.before(e,u,{unit:"offset"})??u:u,focus:i==="after"||i==="both"?w.after(e,c,{unit:"offset"})??c:c}:{anchor:u,focus:c}}function ar(e){return!e.trim()}const fn="@";function xr(e){return ae.isElement(e)&&e.type==="mention"}function rf(e){return"type"in e&&e.type==="mention"}function of(e){return"type"in e&&e.type==="link"}function af(e){return e.startsWith("http://")||e.startsWith("https://")?e:e.startsWith("www.")?"https://"+e:void 0}const sf=h.forwardRef(({children:e,asChild:t,...n},r)=>{const o=t?Re:"span";return v.jsx(o,{...n,ref:r,children:e})}),uf=h.forwardRef(({children:e,asChild:t,...n},r)=>{const o=t?Re:"a";return v.jsx(o,{target:"_blank",rel:"noopener noreferrer nofollow",...n,ref:r,children:e})}),e0={Mention:({userId:e})=>v.jsxs(sf,{children:[fn,e]}),Link:({href:e,children:t})=>v.jsx(uf,{href:e,children:t})},t0=h.forwardRef(({body:e,components:t,style:n,asChild:r,...o},i)=>{const a=r?Re:"div",{Mention:s,Link:u}=h.useMemo(()=>({...e0,...t}),[t]);return e&&e?.content?v.jsx(a,{...o,style:{whiteSpace:"break-spaces",...n},ref:i,children:e.content.map((c,l)=>c.type==="paragraph"?v.jsx("p",{style:{minHeight:"1lh"},children:c.children.map((d,p)=>{if(rf(d))return d.id?v.jsx(s,{userId:d.id},p):null;if(of(d)){const g=af(d.url)??d.url;return v.jsx(u,{href:g,children:d.text??d.url},p)}let m=d.text;return d.bold&&(m=v.jsx("strong",{children:m},p)),d.italic&&(m=v.jsx("em",{children:m},p)),d.strikethrough&&(m=v.jsx("s",{children:m},p)),d.code&&(m=v.jsx("code",{children:m},p)),v.jsx("span",{children:m},p)})},l):null)}):null});var Wi,Cc,n0={isHistory:e=>Ve(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||cn.isOperationList(e.redos[0].operations))&&(e.undos.length===0||cn.isOperationList(e.undos[0].operations))},zi=new WeakMap,wn=new WeakMap,wo=new WeakMap,St={isHistoryEditor:e=>n0.isHistory(e.history)&&w.isEditor(e),isMerging:e=>wn.get(e),isSplittingOnce:e=>wo.get(e),setSplittingOnce(e,t){wo.set(e,t)},isSaving:e=>zi.get(e),redo(e){e.redo()},undo(e){e.undo()},withMerging(e,t){var n=St.isMerging(e);wn.set(e,!0),t(),wn.set(e,n)},withNewBatch(e,t){var n=St.isMerging(e);wn.set(e,!0),wo.set(e,!0),t(),wn.set(e,n),wo.delete(e)},withoutMerging(e,t){var n=St.isMerging(e);wn.set(e,!1),t(),wn.set(e,n)},withoutSaving(e,t){var n=St.isSaving(e);zi.set(e,!1),t(),zi.set(e,n)}},r0=(e,t)=>!(!t||e.type!=="insert_text"||t.type!=="insert_text"||e.offset!==t.offset+t.text.length||!j.equals(e.path,t.path))||!(!t||e.type!=="remove_text"||t.type!=="remove_text"||e.offset+e.text.length!==t.offset||!j.equals(e.path,t.path)),o0=(e,t)=>e.type!=="set_selection";const cf=Hm(function(){if(Cc)return Wi;Cc=1,Wi=function(o){return o=String(o||""),n.test(o)?"rtl":r.test(o)?"ltr":"neutral"};var e="֑-߿יִ-﷽ﹰ-ﻼ",t="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",n=new RegExp("^[^"+t+"]*["+e+"]"),r=new RegExp("^[^"+e+"]*["+t+"]");return Wi}()),Dc=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Ec=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",$i=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Ec(n.overflowY,t)||Ec(n.overflowX,t)||(r=>{const o=(i=>{if(!i.ownerDocument||!i.ownerDocument.defaultView)return null;try{return i.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!o&&(o.clientHeight<r.scrollHeight||o.clientWidth<r.scrollWidth)})(e)}return!1},Co=(e,t,n,r,o,i,a,s)=>i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0,i0=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},Ac=(e,t)=>{var n,r,o,i;if(typeof document>"u")return[];const{scrollMode:a,block:s,inline:u,boundary:c,skipOverflowHiddenElements:l}=t,d=typeof c=="function"?c:Z=>Z!==c;if(!Dc(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,m=[];let g=e;for(;Dc(g)&&d(g);){if(g=i0(g),g===p){m.push(g);break}g!=null&&g===document.body&&$i(g)&&!$i(document.documentElement)||g!=null&&$i(g,l)&&m.push(g)}const y=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,f=(i=(o=window.visualViewport)==null?void 0:o.height)!=null?i:innerHeight,{scrollX:b,scrollY:C}=window,{height:D,width:E,top:A,right:B,bottom:O,left:S}=e.getBoundingClientRect(),{top:k,right:T,bottom:F,left:R}=(Z=>{const $=window.getComputedStyle(Z);return{top:parseFloat($.scrollMarginTop)||0,right:parseFloat($.scrollMarginRight)||0,bottom:parseFloat($.scrollMarginBottom)||0,left:parseFloat($.scrollMarginLeft)||0}})(e);let P=s==="start"||s==="nearest"?A-k:s==="end"?O+F:A+D/2-k+F,H=u==="center"?S+E/2-R+T:u==="end"?B+T:S-R;const G=[];for(let Z=0;Z<m.length;Z++){const $=m[Z],{height:W,width:U,top:J,right:X,bottom:ie,left:de}=$.getBoundingClientRect();if(a==="if-needed"&&A>=0&&S>=0&&O<=f&&B<=y&&A>=J&&O<=ie&&S>=de&&B<=X)return G;const ee=getComputedStyle($),pe=parseInt(ee.borderLeftWidth,10),I=parseInt(ee.borderTopWidth,10),N=parseInt(ee.borderRightWidth,10),_=parseInt(ee.borderBottomWidth,10);let K=0,oe=0;const Q="offsetWidth"in $?$.offsetWidth-$.clientWidth-pe-N:0,ue="offsetHeight"in $?$.offsetHeight-$.clientHeight-I-_:0,ce="offsetWidth"in $?$.offsetWidth===0?0:U/$.offsetWidth:0,he="offsetHeight"in $?$.offsetHeight===0?0:W/$.offsetHeight:0;if(p===$)K=s==="start"?P:s==="end"?P-f:s==="nearest"?Co(C,C+f,f,I,_,C+P,C+P+D,D):P-f/2,oe=u==="start"?H:u==="center"?H-y/2:u==="end"?H-y:Co(b,b+y,y,pe,N,b+H,b+H+E,E),K=Math.max(0,K+C),oe=Math.max(0,oe+b);else{K=s==="start"?P-J-I:s==="end"?P-ie+_+ue:s==="nearest"?Co(J,ie,W,I,_+ue,P,P+D,D):P-(J+W/2)+ue/2,oe=u==="start"?H-de-pe:u==="center"?H-(de+U/2)+Q/2:u==="end"?H-X+N+Q:Co(de,X,U,pe,N+Q,H,H+E,E);const{scrollLeft:be,scrollTop:le}=$;K=he===0?0:Math.max(0,Math.min(le+K/he,$.scrollHeight-W/he+ue)),oe=ce===0?0:Math.max(0,Math.min(be+oe/ce,$.scrollWidth-U/ce+Q)),P+=le-K,H+=be-oe}G.push({el:$,top:K,left:oe})}return G};function a0(e,t){if(!e.isConnected||!(o=>{let i=o;for(;i&&i.parentNode;){if(i.parentNode===document)return!0;i=i.parentNode instanceof ShadowRoot?i.parentNode.host:i.parentNode}return!1})(e))return;const n=(o=>{const i=window.getComputedStyle(o);return{top:parseFloat(i.scrollMarginTop)||0,right:parseFloat(i.scrollMarginRight)||0,bottom:parseFloat(i.scrollMarginBottom)||0,left:parseFloat(i.scrollMarginLeft)||0}})(e);if((o=>typeof o=="object"&&typeof o.behavior=="function")(t))return t.behavior(Ac(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:o,top:i,left:a}of Ac(e,(s=>s===!1?{block:"end",inline:"nearest"}:(u=>u===Object(u)&&Object.keys(u).length!==0)(s)?s:{block:"start",inline:"nearest"})(t))){const s=i-n.top+n.bottom,u=a-n.left+n.right;o.scroll({top:s,left:u,behavior:r})}}var zr,kn=[],xc="ResizeObserver loop completed with undelivered notifications.";(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(zr||(zr={}));var qi,Oc,Sn=function(e){return Object.freeze(e)},s0=function(e,t){this.inlineSize=e,this.blockSize=t,Sn(this)},lf=function(){function e(t,n,r,o){return this.x=t,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Sn(this)}return e.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Cs=function(e){return e instanceof SVGElement&&"getBBox"in e},df=function(e){if(Cs(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||e.getClientRects().length)},Bc=function(e){var t;if(e instanceof Element)return!0;var n=(t=e?.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},_r=typeof window<"u"?window:{},Do=new WeakMap,kc=/auto|scroll/,u0=/^tb|vertical/,c0=/msie|trident/i.test(_r.navigator&&_r.navigator.userAgent),Bt=function(e){return parseFloat(e||"0")},Qn=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new s0((n?t:e)||0,(n?e:t)||0)},Sc=Sn({devicePixelContentBoxSize:Qn(),borderBoxSize:Qn(),contentBoxSize:Qn(),contentRect:new lf(0,0,0,0)}),ff=function(e,t){if(t===void 0&&(t=!1),Do.has(e)&&!t)return Do.get(e);if(df(e))return Do.set(e,Sc),Sc;var n=getComputedStyle(e),r=Cs(e)&&e.ownerSVGElement&&e.getBBox(),o=!c0&&n.boxSizing==="border-box",i=u0.test(n.writingMode||""),a=!r&&kc.test(n.overflowY||""),s=!r&&kc.test(n.overflowX||""),u=r?0:Bt(n.paddingTop),c=r?0:Bt(n.paddingRight),l=r?0:Bt(n.paddingBottom),d=r?0:Bt(n.paddingLeft),p=r?0:Bt(n.borderTopWidth),m=r?0:Bt(n.borderRightWidth),g=r?0:Bt(n.borderBottomWidth),y=d+c,f=u+l,b=(r?0:Bt(n.borderLeftWidth))+m,C=p+g,D=s?e.offsetHeight-C-e.clientHeight:0,E=a?e.offsetWidth-b-e.clientWidth:0,A=o?y+b:0,B=o?f+C:0,O=r?r.width:Bt(n.width)-A-E,S=r?r.height:Bt(n.height)-B-D,k=O+y+E+b,T=S+f+D+C,F=Sn({devicePixelContentBoxSize:Qn(Math.round(O*devicePixelRatio),Math.round(S*devicePixelRatio),i),borderBoxSize:Qn(k,T,i),contentBoxSize:Qn(O,S,i),contentRect:new lf(d,u,O,S)});return Do.set(e,F),F},hf=function(e,t,n){var r=ff(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case zr.DEVICE_PIXEL_CONTENT_BOX:return a;case zr.BORDER_BOX:return o;default:return i}},l0=function(e){var t=ff(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Sn([t.borderBoxSize]),this.contentBoxSize=Sn([t.contentBoxSize]),this.devicePixelContentBoxSize=Sn([t.devicePixelContentBoxSize])},pf=function(e){if(df(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},d0=function(){var e=1/0,t=[];kn.forEach(function(o){if(o.activeTargets.length!==0){var i=[];o.activeTargets.forEach(function(a){var s=new l0(a.target),u=pf(a.target);i.push(s),a.lastReportedSize=hf(a.target,a.observedBox),u<e&&(e=u)}),t.push(function(){o.callback.call(o.observer,i,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++)(0,r[n])();return e},Ic=function(e){kn.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(pf(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},f0=function(){var e,t=0;for(Ic(t);kn.some(function(n){return n.activeTargets.length>0});)t=d0(),Ic(t);return kn.some(function(n){return n.skippedTargets.length>0})&&(typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:xc}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=xc),window.dispatchEvent(e)),t>0},Fc=[],h0=function(e){if(!qi){var t=0,n=document.createTextNode("");new MutationObserver(function(){return Fc.splice(0).forEach(function(r){return r()})}).observe(n,{characterData:!0}),qi=function(){n.textContent="".concat(t?t--:t++)}}Fc.push(e),qi()},Sa=0,p0={attributes:!0,characterData:!0,childList:!0,subtree:!0},Tc=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],jc=function(e){return e===void 0&&(e=0),Date.now()+e},Ki=!1,Ia=new(function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=250),!Ki){Ki=!0;var r,o=jc(t);r=function(){var i=!1;try{i=f0()}finally{if(Ki=!1,t=o-jc(),!Sa)return;i?n.run(1e3):t>0?n.run(t):n.start()}},h0(function(){requestAnimationFrame(r)})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,p0)};document.body?n():_r.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Tc.forEach(function(n){return _r.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Tc.forEach(function(n){return _r.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}()),Rc=function(e){!Sa&&e>0&&Ia.start(),!(Sa+=e)&&Ia.stop()},m0=function(){function e(t,n){this.target=t,this.observedBox=n||zr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t,n=hf(this.target,this.observedBox,!0);return t=this.target,Cs(t)||function(r){switch(r.tagName){case"INPUT":if(r.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||getComputedStyle(t).display!=="inline"||(this.lastReportedSize=n),this.lastReportedSize.inlineSize!==n.inlineSize||this.lastReportedSize.blockSize!==n.blockSize},e}(),g0=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Eo=new WeakMap,_c=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Ao=function(){function e(){}return e.connect=function(t,n){var r=new g0(t,n);Eo.set(t,r)},e.observe=function(t,n,r){var o=Eo.get(t),i=o.observationTargets.length===0;_c(o.observationTargets,n)<0&&(i&&kn.push(o),o.observationTargets.push(new m0(n,r&&r.box)),Rc(1),Ia.schedule())},e.unobserve=function(t,n){var r=Eo.get(t),o=_c(r.observationTargets,n),i=r.observationTargets.length===1;o>=0&&(i&&kn.splice(kn.indexOf(r),1),r.observationTargets.splice(o,1),Rc(-1))},e.disconnect=function(t){var n=this,r=Eo.get(t);r.observationTargets.slice().forEach(function(o){return n.unobserve(t,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),v0=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ao.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Bc(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ao.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Bc(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ao.unobserve(this,t)},e.prototype.disconnect=function(){Ao.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),gt={},Gi=function(){if(Oc)return gt;Oc=1,Object.defineProperty(gt,"__esModule",{value:!0});for(var e=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},n={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:e?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},r={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)r["f"+o]=111+o;function i(l,d,p){d&&!("byKey"in d)&&(p=d,d=null),Array.isArray(l)||(l=[l]);var m=l.map(function(y){return a(y,d)}),g=function(y){return m.some(function(f){return s(f,y)})};return p==null?g:g(p)}function a(l,d){var p=d&&d.byKey,m={},g=(l=l.replace("++","+add")).split("+"),y=g.length;for(var f in t)m[t[f]]=!1;var b=!0,C=!1,D=void 0;try{for(var E,A=g[Symbol.iterator]();!(b=(E=A.next()).done);b=!0){var B=E.value,O=B.endsWith("?")&&B.length>1;O&&(B=B.slice(0,-1));var S=c(B),k=t[S];if(B.length>1&&!k&&!n[B]&&!r[S])throw new TypeError('Unknown modifier: "'+B+'"');y!==1&&k||(p?m.key=S:m.which=u(B)),k&&(m[k]=!O||null)}}catch(T){C=!0,D=T}finally{try{!b&&A.return&&A.return()}finally{if(C)throw D}}return m}function s(l,d){for(var p in l){var m=l[p],g=void 0;if(m!=null&&((g=p==="key"&&d.key!=null?d.key.toLowerCase():p==="which"?m===91&&d.which===93?91:d.which:d[p])!=null||m!==!1)&&g!==m)return!1}return!0}function u(l){return l=c(l),r[l]||l.toUpperCase().charCodeAt(0)}function c(l){return l=l.toLowerCase(),l=n[l]||l}return gt.default=i,gt.isHotkey=i,gt.isCodeHotkey=function(l,d){return i(l,d)},gt.isKeyHotkey=function(l,d){return i(l,{byKey:!0},d)},gt.parseHotkey=a,gt.compareHotkey=s,gt.toKeyCode=u,gt.toKeyName=c,gt}();function sr(e,t){if(e==null)return{};var n,r,o=function(a,s){if(a==null)return{};var u,c,l={},d=Object.keys(a);for(c=0;c<d.length;c++)u=d[c],s.indexOf(u)>=0||(l[u]=a[u]);return l}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Nr(e){return Nr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nr(e)}function y0(e){var t=function(n,r){if(Nr(n)!=="object"||n===null)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var i=o.call(n,r);if(Nr(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return Nr(t)==="symbol"?t:String(t)}function ht(e,t,n){return(t=y0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xi,Zi,Ds=h.createContext(null),Ut=()=>{var e=h.useContext(Ds);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},mf=parseInt(ge.version.split(".")[0],10),gf=typeof navigator<"u"&&typeof window<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Nc=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),Ye=typeof navigator<"u"&&/Android/.test(navigator.userAgent),Xn=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Cn=typeof navigator<"u"&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),b0=typeof navigator<"u"&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),vf=typeof navigator<"u"&&/Chrome/i.test(navigator.userAgent),w0=typeof navigator<"u"&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),C0=Ye&&typeof navigator<"u"&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),D0=typeof navigator<"u"&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),E0=typeof navigator<"u"&&/.*UCBrowser/.test(navigator.userAgent),A0=typeof navigator<"u"&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),Po=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0);typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&/Version\/(\d+)/.test(navigator.userAgent)&&(Xi=navigator.userAgent.match(/Version\/(\d+)/))!==null&&Xi!==void 0&&Xi[1]&&parseInt((Zi=navigator.userAgent.match(/Version\/(\d+)/))===null||Zi===void 0?void 0:Zi[1],10);var tn=(!w0||!C0)&&!b0&&typeof globalThis<"u"&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges=="function",er=new WeakMap,Es=new WeakMap,As=new WeakMap,yf=new WeakMap,Mo=new WeakMap,Fa=new WeakMap,$r=new WeakMap,In=new WeakMap,ti=new WeakMap,vi=new WeakMap,Ta=new WeakMap,ln=new WeakMap,xn=new WeakMap,Pr=new WeakMap,ja=new WeakMap,xs=new WeakMap,bt=new WeakMap,Gt=new WeakMap,et=new WeakMap,on=new WeakMap,an=new WeakMap,bf=new WeakMap,ur=Symbol("placeholder"),wf=Symbol("mark-placeholder"),Cf=globalThis.Node,x0=globalThis.Text,Os=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,lt=e=>hn(e)&&e.nodeType===1,hn=e=>{var t=Os(e);return!!t&&e instanceof t.Node},Ra=e=>{var t=e&&e.anchorNode&&Os(e.anchorNode);return!!t&&e instanceof t.Selection},Df=e=>hn(e)&&e.nodeType===3,Ef=(e,t,n)=>{for(var r,{childNodes:o}=e,i=o[t],a=t,s=!1,u=!1;(hn(r=i)&&r.nodeType===8||lt(i)&&i.childNodes.length===0||lt(i)&&i.getAttribute("contenteditable")==="false")&&(!s||!u);)a>=o.length?(s=!0,a=t-1,n="backward"):a<0?(u=!0,a=t+1,n="forward"):(i=o[a],t=a,a+=n==="forward"?1:-1);return[i,t]},O0=(e,t,n)=>{var[r]=Ef(e,t,n);return r},Af=e=>{var t="";if(Df(e)&&e.nodeValue)return e.nodeValue;if(lt(e)){for(var n of Array.from(e.childNodes))t+=Af(n);var r=getComputedStyle(e).getPropertyValue("display");r!=="block"&&r!=="list"&&e.tagName!=="BR"||(t+=`
|
|
4
4
|
`)}return t},B0=/data-slate-fragment="(.+?)"/m,Mr=e=>e.getSelection!=null?e.getSelection():document.getSelection(),Bs=(e,t,n)=>{var{target:r}=t;if(lt(r)&&r.matches('[contentEditable="false"]'))return!1;var{document:o}=q.getWindow(e);if(o.contains(r))return q.hasDOMNode(e,r,{editable:!0});var i=n.find(a=>{var{addedNodes:s,removedNodes:u}=a;for(var c of s)if(c===r||c.contains(r))return!0;for(var l of u)if(l===r||l.contains(r))return!0});return!(!i||i===t)&&Bs(e,i,n)},Pc=(e,t)=>!!(e.compareDocumentPosition(t)&Cf.DOCUMENT_POSITION_PRECEDING),k0=0;class S0{constructor(){ht(this,"id",void 0),this.id="".concat(k0++)}}var q={androidPendingDiffs:e=>et.get(e),androidScheduleFlush:e=>{var t;(t=xs.get(e))===null||t===void 0||t()},blur:e=>{var t=q.toDOMNode(e,e),n=q.findDocumentOrShadowRoot(e);ln.set(e,!1),n.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,n=q.findDocumentOrShadowRoot(e),r=Mr(n);r&&r.rangeCount>0&&r.removeAllRanges(),t&&z.deselect(e)},findDocumentOrShadowRoot:e=>{var t=q.toDOMNode(e,e),n=t.getRootNode();return n instanceof Document||n instanceof ShadowRoot?n:t.ownerDocument},findEventRange:(e,t)=>{"nativeEvent"in t&&(t=t.nativeEvent);var{clientX:n,clientY:r,target:o}=t;if(n==null||r==null)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var i,a=q.toSlateNode(e,t.target),s=q.findPath(e,a);if(ae.isElement(a)&&w.isVoid(e,a)){var u=o.getBoundingClientRect(),c=e.isInline(a)?n-u.left<u.left+u.width-n:r-u.top<u.top+u.height-r,l=w.point(e,s,{edge:c?"start":"end"}),d=c?w.before(e,l):w.after(e,l);if(d)return w.range(e,d)}var{document:p}=q.getWindow(e);if(p.caretRangeFromPoint)i=p.caretRangeFromPoint(n,r);else{var m=p.caretPositionFromPoint(n,r);m&&((i=p.createRange()).setStart(m.offsetNode,m.offset),i.setEnd(m.offsetNode,m.offset))}if(!i)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));return q.toSlateRange(e,i,{exactMatch:!1,suppressThrow:!1})},findKey:(e,t)=>{var n=ti.get(t);return n||(n=new S0,ti.set(t,n)),n},findPath:(e,t)=>{for(var n=[],r=t;;){var o=As.get(r);if(o==null){if(w.isEditor(r))return n;break}var i=Es.get(r);if(i==null)break;n.unshift(i),r=o}throw new Error("Unable to find the path for Slate node: ".concat(He.stringify(t)))},focus:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{retries:5};if(!ln.get(e)){if(t.retries<=0)throw new Error("Could not set focus, editor seems stuck with pending operations");if(e.operations.length>0)setTimeout(()=>{q.focus(e,{retries:t.retries-1})},10);else{var n=q.toDOMNode(e,e),r=q.findDocumentOrShadowRoot(e);if(r.activeElement!==n){if(e.selection&&r instanceof Document){var o=Mr(r),i=q.toDOMRange(e,e.selection);o?.removeAllRanges(),o?.addRange(i)}e.selection||z.select(e,w.start(e,[])),ln.set(e,!0),n.focus({preventScroll:!0})}}}},getWindow:e=>{var t=yf.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},hasDOMNode:function(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{editable:o=!1}=r,i=q.toDOMNode(e,e);try{n=lt(t)?t:t.parentElement}catch(a){if(a instanceof Error&&!a.message.includes('Permission denied to access property "nodeType"'))throw a}return!!n&&!(n.closest("[data-slate-editor]")!==i||o&&!n.isContentEditable&&(typeof n.isContentEditable!="boolean"||n.closest('[contenteditable="false"]')!==i)&&!n.getAttribute("data-slate-zero-width"))},hasEditableTarget:(e,t)=>hn(t)&&q.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:n,focus:r}=t;return w.hasPath(e,n.path)&&w.hasPath(e,r.path)},hasSelectableTarget:(e,t)=>q.hasEditableTarget(e,t)||q.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>hn(t)&&q.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!xn.get(e),isFocused:e=>!!ln.get(e),isReadOnly:e=>!!Ta.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(Ta.get(e))return!1;var n=q.hasTarget(e,t)&&q.toSlateNode(e,t);return ae.isElement(n)&&w.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n=vi.get(e),r=w.isEditor(t)?Mo.get(e):n?.get(q.findKey(e,t));if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(He.stringify(t)));return r},toDOMPoint:(e,t)=>{var n,[r]=w.node(e,t.path),o=q.toDOMNode(e,r);w.void(e,{at:t})&&(t={path:t.path,offset:0});for(var i=Array.from(o.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),a=0,s=0;s<i.length;s++){var u=i[s],c=u.childNodes[0];if(c!=null&&c.textContent!=null){var{length:l}=c.textContent,d=u.getAttribute("data-slate-length"),p=a+(d==null?l:parseInt(d,10)),m=i[s+1];if(t.offset===p&&m!=null&&m.hasAttribute("data-slate-mark-placeholder")){var g,y=m.childNodes[0];n=[y instanceof x0?y:m,(g=m.textContent)!==null&&g!==void 0&&g.startsWith("\uFEFF")?1:0];break}if(t.offset<=p){n=[c,Math.min(l,Math.max(0,t.offset-a))];break}a=p}}if(!n)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(He.stringify(t)));return n},toDOMRange:(e,t)=>{var{anchor:n,focus:r}=t,o=M.isBackward(t),i=q.toDOMPoint(e,n),a=M.isCollapsed(t)?i:q.toDOMPoint(e,r),s=q.getWindow(e).document.createRange(),[u,c]=o?a:i,[l,d]=o?i:a,p=!!(lt(u)?u:u.parentElement).getAttribute("data-slate-zero-width"),m=!!(lt(l)?l:l.parentElement).getAttribute("data-slate-zero-width");return s.setStart(u,p?1:c),s.setEnd(l,m?1:d),s},toSlateNode:(e,t)=>{var n=lt(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?$r.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},toSlatePoint:(e,t,n)=>{var{exactMatch:r,suppressThrow:o,searchDirection:i="backward"}=n,[a,s]=r?t:(W=>{var[U,J]=W;if(lt(U)&&U.childNodes.length){var X=J===U.childNodes.length,ie=X?J-1:J;for([U,ie]=Ef(U,ie,X?"backward":"forward"),X=ie<J;lt(U)&&U.childNodes.length;){var de=X?U.childNodes.length-1:0;U=O0(U,de,X?"backward":"forward")}J=X&&U.textContent!=null?U.textContent.length:0}return[U,J]})(t),u=a.parentNode,c=null,l=0;if(u){var d,p,m=q.toDOMNode(e,e),g=u.closest('[data-slate-void="true"]'),y=g&&m.contains(g)?g:null,f=u.closest('[contenteditable="false"]'),b=f&&m.contains(f)?f:null,C=u.closest("[data-slate-leaf]"),D=null;if(C){if(c=C.closest('[data-slate-node="text"]')){var E=q.getWindow(e).document.createRange();E.setStart(c,0),E.setEnd(a,s);var A=E.cloneContents();[...Array.prototype.slice.call(A.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(A.querySelectorAll("[contenteditable=false]"))].forEach(W=>{Ye&&!r&&W.hasAttribute("data-slate-zero-width")&&W.textContent.length>0&&W.textContext!=="\uFEFF"?W.textContent.startsWith("\uFEFF")&&(W.textContent=W.textContent.slice(1)):W.parentNode.removeChild(W)}),l=A.textContent.length,D=c}}else if(y){for(var B=y.querySelectorAll("[data-slate-leaf]"),O=0;O<B.length;O++){var S=B[O];if(q.hasDOMNode(e,S)){C=S;break}}C?(c=C.closest('[data-slate-node="text"]'),l=(D=C).textContent.length,D.querySelectorAll("[data-slate-zero-width]").forEach(W=>{l-=W.textContent.length})):l=1}else if(b){var k,T,F=W=>W?W.querySelectorAll("[data-slate-leaf]:not(:scope [data-slate-editor] [data-slate-leaf])"):[],R=b.closest('[data-slate-node="element"]');i==="forward"?C=(k=[...F(R),...F(R?.nextElementSibling)].find(W=>((U,J)=>!!(U.compareDocumentPosition(J)&Cf.DOCUMENT_POSITION_FOLLOWING))(b,W)))!==null&&k!==void 0?k:null:C=(T=[...F(R?.previousElementSibling),...F(R)].findLast(W=>Pc(b,W)))!==null&&T!==void 0?T:null,C&&(c=C.closest('[data-slate-node="text"]'),D=C,i==="forward"?l=0:(l=D.textContent.length,D.querySelectorAll("[data-slate-zero-width]").forEach(W=>{l-=W.textContent.length})))}D&&l===D.textContent.length&&Ye&&D.getAttribute("data-slate-zero-width")==="z"&&(d=D.textContent)!==null&&d!==void 0&&d.startsWith("\uFEFF")&&(u.hasAttribute("data-slate-zero-width")||Xn&&(p=D.textContent)!==null&&p!==void 0&&p.endsWith(`
|