@worktango/ai-assistant 1.0.150 → 1.0.151
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/{Absenteeism-grqUjGkl.mjs → Absenteeism-CkPwfPFy.mjs} +1 -1
- package/dist/{ActivityFeed-D3XrtY0b.mjs → ActivityFeed-f2G_5lQC.mjs} +1 -1
- package/dist/{AddUser-C3xlmtw4.mjs → AddUser-TRCPy4J_.mjs} +1 -1
- package/dist/{Admin-BcBo773D.mjs → Admin-DcEaxE4F.mjs} +1 -1
- package/dist/{Admin-CBslXHx0.mjs → Admin-SLXL5URz.mjs} +1 -1
- package/dist/{AiGeneral-CRt8dWYg.mjs → AiGeneral-BdcIjlfu.mjs} +1 -1
- package/dist/{AiScoring-DclE5W4D.mjs → AiScoring-DNXjjwpu.mjs} +1 -1
- package/dist/{AiText-CZ2T4CT5.mjs → AiText-CpcbyAtI.mjs} +1 -1
- package/dist/{Anniversary-D5IYTK9o.mjs → Anniversary-CBw4dHJy.mjs} +1 -1
- package/dist/{Appreciation-CeAcJlti.mjs → Appreciation-uqlyh2c2.mjs} +1 -1
- package/dist/{ArrowDown-CWiEF6JI.mjs → ArrowDown-DDSdwgPe.mjs} +1 -1
- package/dist/{ArrowLeft-DUCppYgP.mjs → ArrowLeft-Bmryci1E.mjs} +1 -1
- package/dist/{ArrowRight-BLbxd_Tb.mjs → ArrowRight-CwIHXTes.mjs} +1 -1
- package/dist/{ArrowUp-B-IS_jZm.mjs → ArrowUp-BxZbok-k.mjs} +1 -1
- package/dist/{Attachment-DKZZnHXG.mjs → Attachment-Co5oKhnx.mjs} +1 -1
- package/dist/{BadgeBolt-CaB-zgZx.mjs → BadgeBolt-DCGOK7Vb.mjs} +1 -1
- package/dist/{BadgeCompass-CGPiaGp1.mjs → BadgeCompass-BICjXBIi.mjs} +1 -1
- package/dist/{BadgeCrown-BKIZBGdP.mjs → BadgeCrown-F2xrew8L.mjs} +1 -1
- package/dist/{BadgeDiamond-DXsF6bkX.mjs → BadgeDiamond-C6wbkV_q.mjs} +1 -1
- package/dist/{BadgeHeart-Y0I7VjKT.mjs → BadgeHeart-BHMCT1UK.mjs} +1 -1
- package/dist/{BadgePeak-sEOVs5Ml.mjs → BadgePeak-hnqjDlSQ.mjs} +1 -1
- package/dist/{BadgeRocket-DYmC7vS9.mjs → BadgeRocket-_iIemeS5.mjs} +1 -1
- package/dist/{BadgeStar-DbigickY.mjs → BadgeStar-CG2ndowo.mjs} +1 -1
- package/dist/{BadgeTrophy-BE8kseZH.mjs → BadgeTrophy-mPVkMrTh.mjs} +1 -1
- package/dist/{BeQuickDontHurry-CEMkrP-8.mjs → BeQuickDontHurry-ZlthmBfa.mjs} +1 -1
- package/dist/{Birthday-Cse4K_qx.mjs → Birthday-3mngPIPb.mjs} +1 -1
- package/dist/{BrandPromise-C9YN_3L-.mjs → BrandPromise-BdWsedjp.mjs} +1 -1
- package/dist/{BrandVision-BdhrKBjd.mjs → BrandVision-djOh6PUH.mjs} +1 -1
- package/dist/{BubbleGraph-Cv_5F1CU.mjs → BubbleGraph-DTqIlsPE.mjs} +1 -1
- package/dist/{Calendar-aWmrc1zk.mjs → Calendar-NWe491B9.mjs} +1 -1
- package/dist/{CaretDn-CKIQvXhb.mjs → CaretDn-ClEqxs5e.mjs} +1 -1
- package/dist/{CaretDown-ByE3vgF7.mjs → CaretDown-Bh3T2Ru7.mjs} +1 -1
- package/dist/{CaretLeft-Dwu2zD6B.mjs → CaretLeft-BI5f2gnx.mjs} +1 -1
- package/dist/{CaretRight-BKeMwyP_.mjs → CaretRight-8E1OfW_4.mjs} +1 -1
- package/dist/{CaretUp-Dfp_gvAl.mjs → CaretUp-RneHmD0f.mjs} +1 -1
- package/dist/{ChallengeAccepted-CNdAmzMw.mjs → ChallengeAccepted-BsAh6D7z.mjs} +1 -1
- package/dist/{CheckIn-yiy07_zT.mjs → CheckIn-C4hUL2u3.mjs} +1 -1
- package/dist/{CheckIns-C1KYL7mI.mjs → CheckIns-TEx-iVOL.mjs} +1 -1
- package/dist/{CheckSeal-PVEIVJzw.mjs → CheckSeal-jW2NDDuM.mjs} +1 -1
- package/dist/{Checkmark-C1NIO3ID.mjs → Checkmark-Cp2oE2XE.mjs} +1 -1
- package/dist/{Clock-CrWXdvYC.mjs → Clock-B1mok0x-.mjs} +1 -1
- package/dist/{Close-CjroJqjp.mjs → Close-nILbc6Iq.mjs} +1 -1
- package/dist/{CloudDownload-3VgTbr1U.mjs → CloudDownload-nmKc4eOM.mjs} +1 -1
- package/dist/{Comment-BAvnrdrf.mjs → Comment-DoQ3C3Tx.mjs} +1 -1
- package/dist/{Comments-CzX0xJjB.mjs → Comments-DgfemqvQ.mjs} +1 -1
- package/dist/{Connections-Cf_atklL.mjs → Connections-ByfkNnWB.mjs} +1 -1
- package/dist/{Copy-CNw1mL4_.mjs → Copy-Qulxl_Ny.mjs} +1 -1
- package/dist/{CustomQuestion-INbQZ7rb.mjs → CustomQuestion-C0ijhnNl.mjs} +1 -1
- package/dist/{CustomerSuccess-CbxFylYq.mjs → CustomerSuccess-DQTaEY96.mjs} +1 -1
- package/dist/{DatePicker-C-cU7oTj.mjs → DatePicker-B-X8MVmm.mjs} +1 -1
- package/dist/{Dot-X9G237_f.mjs → Dot-BRKqSYlo.mjs} +1 -1
- package/dist/{Download-D95TVSpM.mjs → Download-BqSnnKkG.mjs} +1 -1
- package/dist/{Drag-BtsJjcac.mjs → Drag-BjqX9gqj.mjs} +1 -1
- package/dist/{DragIndicator-BbWIBF3T.mjs → DragIndicator-B_BzGhM1.mjs} +1 -1
- package/dist/{Earn-CA5xr5bj.mjs → Earn-CZ0PP_9_.mjs} +1 -1
- package/dist/{Email-B6oE-UYD.mjs → Email-BAfA9qAx.mjs} +1 -1
- package/dist/{EmojiDisplay-CGLAP8xh.mjs → EmojiDisplay-Cqgv3Otf.mjs} +2 -2
- package/dist/{EmojiPicker-DhjjmBfE.mjs → EmojiPicker-CDEdjVkG.mjs} +2 -2
- package/dist/{EnpsSurvey-BMzKlLw1.mjs → EnpsSurvey-DE9ZS5Dz.mjs} +1 -1
- package/dist/{Expired-SLJqRBEx.mjs → Expired-DxYvHEKE.mjs} +1 -1
- package/dist/{Eye-Cm_W7hrZ.mjs → Eye-Bi2YCl3J.mjs} +1 -1
- package/dist/{Feedback-B8fILkOI.mjs → Feedback-BeIepjdF.mjs} +1 -1
- package/dist/{Feedback-CY4EBDx5.mjs → Feedback-CnL8HXy4.mjs} +1 -1
- package/dist/{Filter-B9zKtx-z.mjs → Filter-DlQ0F6yt.mjs} +1 -1
- package/dist/{Flag-Dq-LP6Ow.mjs → Flag-DDzHMCJq.mjs} +1 -1
- package/dist/{Giphy-CJE4P3Rp.mjs → Giphy-AmPv7BRM.mjs} +1 -1
- package/dist/{GoalCount-DPzhxCEu.mjs → GoalCount-B1Gi03DQ.mjs} +1 -1
- package/dist/{GoalPercent-CnhgI0Ds.mjs → GoalPercent-B_ZHSmwl.mjs} +1 -1
- package/dist/{GoalTask-DcOql8Q4.mjs → GoalTask-DSRZroQZ.mjs} +1 -1
- package/dist/{GoalTask-GQsA3BVQ.mjs → GoalTask-DlrV22Rq.mjs} +1 -1
- package/dist/{Goals-Yq8ujsgK.mjs → Goals-CBI4r2Qj.mjs} +1 -1
- package/dist/{Goals-DrOr6yw7.mjs → Goals-D3ja-L8S.mjs} +1 -1
- package/dist/{Growth-ClAn5PLY.mjs → Growth-DvakfeWS.mjs} +1 -1
- package/dist/{Hamburger-BjuL11iJ.mjs → Hamburger-VW1BbsbY.mjs} +1 -1
- package/dist/{HandExpanded-Bgw8cdsj.mjs → HandExpanded-DRcEru03.mjs} +1 -1
- package/dist/{Help-Co0fLXCd.mjs → Help-DaOYHVkf.mjs} +1 -1
- package/dist/{HighFive-BFwB3q3X.mjs → HighFive-B3ZanloK.mjs} +1 -1
- package/dist/{HighFive-CdQBjEOX.mjs → HighFive-C_vr8Gya.mjs} +1 -1
- package/dist/{Home-BUkciUhN.mjs → Home-CXx7KiIk.mjs} +1 -1
- package/dist/{Home-BqQLybF5.mjs → Home-DCzqM4zz.mjs} +1 -1
- package/dist/{HorizontalLine-n89jB1wW.mjs → HorizontalLine-CmJfpcFj.mjs} +1 -1
- package/dist/{Hourglass-UCYiwbGg.mjs → Hourglass-C29sn53U.mjs} +1 -1
- package/dist/{Image-DLaCgjBc.mjs → Image-ddNzXHvR.mjs} +1 -1
- package/dist/{ImageFile-CnVNkdvl.mjs → ImageFile-CCB2osTF.mjs} +1 -1
- package/dist/{InGoodCompany-Dfkpp-66.mjs → InGoodCompany-DluqCdPh.mjs} +1 -1
- package/dist/{Incentives-Cmlmma6B.mjs → Incentives-DWU55Q6a.mjs} +1 -1
- package/dist/{Infinite-CAq4_SOi.mjs → Infinite-CZKjYGLC.mjs} +1 -1
- package/dist/{Info-DDCHwV4Y.mjs → Info-BDGdsh9F.mjs} +1 -1
- package/dist/{Insights-CkaCO900.mjs → Insights-CoWzmjBr.mjs} +1 -1
- package/dist/{Insights-DezMORNt.mjs → Insights-f-TbUq8S.mjs} +1 -1
- package/dist/{Integrations-DQewF5NH.mjs → Integrations-HzXlSihJ.mjs} +1 -1
- package/dist/{KazooLogo-CoKLUa2e.mjs → KazooLogo-TAukipTh.mjs} +1 -1
- package/dist/{KnowYourAudience-CH5kbIAE.mjs → KnowYourAudience-XBR5JwOU.mjs} +1 -1
- package/dist/{Launch-BfqN9sxX.mjs → Launch-GH5hlBhe.mjs} +1 -1
- package/dist/{Link-CFAF-YOc.mjs → Link-DAcqDtRp.mjs} +1 -1
- package/dist/{LinkArrow-Btjw8QC1.mjs → LinkArrow-D3mLJkPb.mjs} +1 -1
- package/dist/{Loading-BqN7v_l4.mjs → Loading-BIdm37rI.mjs} +1 -1
- package/dist/{Lock-BaxXcayI.mjs → Lock-CXM94q5J.mjs} +1 -1
- package/dist/{Management-B6Kh908p.mjs → Management-B4piRXCT.mjs} +1 -1
- package/dist/{MeatballMenu-DUpx2wYJ.mjs → MeatballMenu-e0mIIICq.mjs} +1 -1
- package/dist/{MediaError-DES6RMim.mjs → MediaError-C8C9ESgR.mjs} +1 -1
- package/dist/{Messages-zSuU5z4w.mjs → Messages-BuWdkFmG.mjs} +1 -1
- package/dist/{Microphone-BxJl9AIT.mjs → Microphone-GqPTAt9O.mjs} +1 -1
- package/dist/{Mobile-BUOig3ja.mjs → Mobile-C5mjnhx-.mjs} +1 -1
- package/dist/{Moon-BUXBkmmo.mjs → Moon-DS1GkZ1k.mjs} +1 -1
- package/dist/{Nomination-DspSZS6P.mjs → Nomination-BQV8K2cX.mjs} +1 -1
- package/dist/{NominationsAndAwards-Chc0NMri.mjs → NominationsAndAwards-_vFjKyF7.mjs} +1 -1
- package/dist/{Notification-BRdN6SUR.mjs → Notification-CHvvUSwG.mjs} +1 -1
- package/dist/{Okrs-DqALjX8E.mjs → Okrs-xP0MwwX_.mjs} +1 -1
- package/dist/{Pause-717k5aVV.mjs → Pause-pF12M-yX.mjs} +1 -1
- package/dist/{PeerToPeer-wtDBQWfS.mjs → PeerToPeer-D1f-Vblo.mjs} +1 -1
- package/dist/{Pencil-2_tCeTNM.mjs → Pencil-wdSvrRZa.mjs} +1 -1
- package/dist/{People-Xe2DFWgv.mjs → People-BeJGH5D4.mjs} +1 -1
- package/dist/{PerformanceManagement-Cei-Um3m.mjs → PerformanceManagement-BqiOOn3p.mjs} +1 -1
- package/dist/{Pin-CzWKrCb0.mjs → Pin-CbgToAwl.mjs} +1 -1
- package/dist/{PinnedIconAward-wlNPH503.mjs → PinnedIconAward-aXF8iRdM.mjs} +1 -1
- package/dist/{PinnedIconBrightIdea-DrVrpd88.mjs → PinnedIconBrightIdea-EZwT8H7D.mjs} +1 -1
- package/dist/{PinnedIconBullseye-DxVunFOw.mjs → PinnedIconBullseye-BUQ-xTqs.mjs} +1 -1
- package/dist/{PinnedIconChampagne-By3CrMZN.mjs → PinnedIconChampagne-B9XDRj1G.mjs} +1 -1
- package/dist/{PinnedIconCheer-D61RHkXC.mjs → PinnedIconCheer-CBHskYZw.mjs} +1 -1
- package/dist/{PinnedIconCrown-Dut4TsrY.mjs → PinnedIconCrown-Cya0sKRo.mjs} +1 -1
- package/dist/{PinnedIconDiamond-BgMIm45C.mjs → PinnedIconDiamond-C29LEvAc.mjs} +1 -1
- package/dist/{PinnedIconHoleInOne-JInaztnN.mjs → PinnedIconHoleInOne-Cbzt2bv2.mjs} +1 -1
- package/dist/{PinnedIconMedal-ByWlY6J5.mjs → PinnedIconMedal-DKIZBlhF.mjs} +1 -1
- package/dist/{PinnedIconMetrics-BBGWArPF.mjs → PinnedIconMetrics-DEahPcNB.mjs} +1 -1
- package/dist/{PinnedIconPin-CXuxhvtT.mjs → PinnedIconPin-CT-YFZKK.mjs} +1 -1
- package/dist/{PinnedIconRockAndRoll-DdcZWDdN.mjs → PinnedIconRockAndRoll-BmgmbS8N.mjs} +1 -1
- package/dist/{PinnedIconRocket-DdDeMasy.mjs → PinnedIconRocket-Bm0nQL0B.mjs} +1 -1
- package/dist/{PinnedIconStrength-DqDVLW3x.mjs → PinnedIconStrength-BDiAXTL2.mjs} +1 -1
- package/dist/{PinnedIconTeddyBear-Cz1mynhG.mjs → PinnedIconTeddyBear-CUm_PB1u.mjs} +1 -1
- package/dist/{PlatformLogo-D0cz9ip6.mjs → PlatformLogo-BEU09G96.mjs} +1 -1
- package/dist/{Plus-fyVKuada.mjs → Plus-Rcy6n47A.mjs} +1 -1
- package/dist/{Popper-DelDTs0J.mjs → Popper-EQB5Ai8Z.mjs} +1 -1
- package/dist/{PrivateEye-UvkzrJlT.mjs → PrivateEye-Y27dpeJX.mjs} +1 -1
- package/dist/{PrivatePushPin-BokCVbJN.mjs → PrivatePushPin-D_2UHIFG.mjs} +1 -1
- package/dist/{Processing-9PvPLJ7r.mjs → Processing-B5OuekU1.mjs} +1 -1
- package/dist/{Productivity-BK_4r2bC.mjs → Productivity-hpQliO9f.mjs} +1 -1
- package/dist/{ProgressCircle-CG-OnaH5.mjs → ProgressCircle-C5lCOBGt.mjs} +1 -1
- package/dist/{PulseSurvey-ByJHXfPk.mjs → PulseSurvey-CNkOnOOf.mjs} +1 -1
- package/dist/{PushPin-DEd9kRbS.mjs → PushPin-1AGSeg2D.mjs} +1 -1
- package/dist/{QrCode-CnMpP7rB.mjs → QrCode-CG1BoMDm.mjs} +1 -1
- package/dist/{QuotesLeft-Cqqz0its.mjs → QuotesLeft-0t5FDtsZ.mjs} +1 -1
- package/dist/{QuotesRight-DJEj-ykz.mjs → QuotesRight-D2hXXyz4.mjs} +1 -1
- package/dist/{Recognition-DmIW3Ts6.mjs → Recognition-Cn5SlLwN.mjs} +1 -1
- package/dist/{Recognition-CXtzkfH9.mjs → Recognition-D86dp37f.mjs} +1 -1
- package/dist/{Retention-DRL3f0KR.mjs → Retention-DKCnb6fJ.mjs} +1 -1
- package/dist/{Rewards-BC3CJl_M.mjs → Rewards--pBd1mFQ.mjs} +1 -1
- package/dist/{Rewards-5z3A77tt.mjs → Rewards-Czsse-sP.mjs} +1 -1
- package/dist/{RewardsCatalog-DSJT0-IC.mjs → RewardsCatalog-C1V7-VJ8.mjs} +1 -1
- package/dist/{Roadmap-BR0ajNkn.mjs → Roadmap-Dpmuc7rt.mjs} +1 -1
- package/dist/{Search-DbDAwtBe.mjs → Search-C49Xidv4.mjs} +1 -1
- package/dist/{Security-AnaWROck.mjs → Security-CTgrYC-V.mjs} +1 -1
- package/dist/{SendRecognition-BXZpm2yD.mjs → SendRecognition-4ebhnRx_.mjs} +1 -1
- package/dist/{ShareLink-DjBN7KHH.mjs → ShareLink-BCu1Mzy8.mjs} +1 -1
- package/dist/{SidebarCollapse-xBnbTIp5.mjs → SidebarCollapse-CfDpFHPm.mjs} +1 -1
- package/dist/{Skill-CxPuEuy6.mjs → Skill-Bu_aRVik.mjs} +1 -1
- package/dist/{Skills-qNX20aih.mjs → Skills-C1JxlzXO.mjs} +1 -1
- package/dist/{Smiley-D6ibOZDR.mjs → Smiley-D36oWuz8.mjs} +1 -1
- package/dist/{Stop-BlsBwbXm.mjs → Stop-CoohNGkk.mjs} +1 -1
- package/dist/{Sun-CmxU120W.mjs → Sun-PNYqFdd7.mjs} +1 -1
- package/dist/{Survey-Cth2Sn51.mjs → Survey-BLips00k.mjs} +1 -1
- package/dist/{Surveys-5InbwfbN.mjs → Surveys-CyJYVbq-.mjs} +1 -1
- package/dist/{SyncUps-D6HemHVy.mjs → SyncUps-DnKUBE95.mjs} +1 -1
- package/dist/{Syncs-BadrobQr.mjs → Syncs-CmzCPck4.mjs} +1 -1
- package/dist/{TalentReview-CT89eBwz.mjs → TalentReview-D-BbpaKJ.mjs} +1 -1
- package/dist/{TalentReview-DQ_LC8tt.mjs → TalentReview-K8f_gwKl.mjs} +1 -1
- package/dist/{TalentReviewInsights-Cq6qHlrc.mjs → TalentReviewInsights-B6YA_uAa.mjs} +1 -1
- package/dist/{TaskCompleted-BzExmiCi.mjs → TaskCompleted-gXERKJFR.mjs} +1 -1
- package/dist/{Team-K9bYJ_Oh.mjs → Team-no1KJNvs.mjs} +1 -1
- package/dist/{Teams-CmF0FLk5.mjs → Teams-B8ccn5Ta.mjs} +1 -1
- package/dist/{TextBold-C6-SvXTg.mjs → TextBold-C3XIzMy5.mjs} +1 -1
- package/dist/{TextBulletList-Cgaeb98w.mjs → TextBulletList-_1giVn6d.mjs} +1 -1
- package/dist/{TextInput-B3KMLoRy.mjs → TextInput-CN4Zhe0K.mjs} +1 -1
- package/dist/{TextItalic-CwNpj8EG.mjs → TextItalic-Bep_LWsq.mjs} +1 -1
- package/dist/{TextNumberList-BWwOq1hr.mjs → TextNumberList-D0pAEgp0.mjs} +1 -1
- package/dist/{TextUnderline-wX2UTskC.mjs → TextUnderline-B5EOK0nF.mjs} +1 -1
- package/dist/{ThumbsDown-CVmNf8Q-.mjs → ThumbsDown-D6lrnTug.mjs} +1 -1
- package/dist/{ThumbsUp-CQe0LGI9.mjs → ThumbsUp-sc_YMUaw.mjs} +1 -1
- package/dist/{Toggle-CMZNTX5b.mjs → Toggle-C3fr09k3.mjs} +1 -1
- package/dist/{Translate-Lz11O8Yk.mjs → Translate-CWXqBLnh.mjs} +1 -1
- package/dist/{Trash-CIGVIsPv.mjs → Trash-D2gTVIrO.mjs} +1 -1
- package/dist/{TrendDown-SpE-2xL8.mjs → TrendDown-B5YqPFGe.mjs} +1 -1
- package/dist/{TrendUp-hwTzV05R.mjs → TrendUp-tX7PzF-M.mjs} +1 -1
- package/dist/{Trophy-iyeFIu6X.mjs → Trophy-DXJA-i8F.mjs} +1 -1
- package/dist/{Undo-C86O0kxU.mjs → Undo-Bon0MOpG.mjs} +1 -1
- package/dist/{Unplugged-DHhz5e9_.mjs → Unplugged-CGUWmwEa.mjs} +1 -1
- package/dist/{UpDownCaret-lQOQSiPZ.mjs → UpDownCaret-BS4YXo2V.mjs} +1 -1
- package/dist/{Upload-BlctitcY.mjs → Upload-DQ6PV2Od.mjs} +1 -1
- package/dist/{VerifiedCheckmark-ClrfVleH.mjs → VerifiedCheckmark-CfNG5IN5.mjs} +1 -1
- package/dist/{VerticalLine-D4KgZ_48.mjs → VerticalLine-CD45Fzxm.mjs} +1 -1
- package/dist/{Warning-BuD-WbUV.mjs → Warning-Dg2mvK_s.mjs} +1 -1
- package/dist/{WarningNoOutline-CbKelN4v.mjs → WarningNoOutline-BH3U4Y3p.mjs} +1 -1
- package/dist/{YesAnd-B-vBqb3B.mjs → YesAnd-Dz_mBQZG.mjs} +1 -1
- package/dist/{emoji-DyerfTFY.mjs → emoji-D40bjuKP.mjs} +1 -1
- package/dist/{react-apexcharts.min-BGO9eW-D.mjs → react-apexcharts.min-D7Sa2fx5.mjs} +1 -1
- package/dist/react.es.js +1 -1
- package/dist/react.umd.js +1 -1
- package/dist/{reactComponent-Mblg1UyC.mjs → reactComponent-BvBmtSxj.mjs} +223 -218
- package/package.json +1 -1
- package/sharedTypes.ts +5 -0
package/dist/react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as o, v as e, w as a, x as n, y as p, G as i, z as A, B as g, D as l, E as m, F as r, H as u } from "./reactComponent-
|
|
1
|
+
import { A as o, v as e, w as a, x as n, y as p, G as i, z as A, B as g, D as l, E as m, F as r, H as u } from "./reactComponent-BvBmtSxj.mjs";
|
|
2
2
|
export {
|
|
3
3
|
o as AiAssistant,
|
|
4
4
|
e as AiAssistantSettingsComponent,
|
package/dist/react.umd.js
CHANGED
|
@@ -235,7 +235,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o
|
|
|
235
235
|
}
|
|
236
236
|
`;function hz(t){const e={...Kr,...t};return Ul(dz,e)}function gz({originalSetMessages:t,propRefs:e}){return i=>{t(a=>{const r=typeof i=="function"?i(a):i;return e.current.messages=r,r})}}function _z({retry:t}){const e=()=>{window.location.reload()};return h.jsxs(rt,{direction:"column",gap:"24px",children:[h.jsx(h3,{}),h.jsx(St,{}),h.jsxs(rt,{direction:"row",gap:"8px",alignItems:"center",children:[h.jsx(It,{icon:"warning"}),h.jsxs(bt,{children:["Error calling LLM API. If this persists, try"," ",h.jsx("a",{href:"#",onClick:e,"data-testid":"connection-error-refresh-page",children:"refreshing the page"}),"."]})]}),h.jsxs(rt,{justifyContent:"flex-end",gap:"8px",children:[h.jsx(yi,{onClick:e,variant:"system",size:"small","data-testid":"connection-error-refresh-page-button",children:"Refresh Page"}),h.jsx(yi,{onClick:t,variant:"primary","data-testid":"connection-error-retry-button",children:"Retry"})]})]})}class cz{static parse(e){return e.trim().split(`
|
|
237
237
|
`).map(a=>JSON.parse(a))}static stringify(e){return e.map(i=>JSON.stringify(i)).join(`
|
|
238
|
-
`)}}const Ea={kazooUrlStrategy:t=>t,pulseUrlStrategy:t=>t,llmCallUrlStrategy:()=>"/api/api-ai-assistant/v1/chat",llmRegionStrategy:()=>{},pulseBearerTokenStrategy:()=>null,screenshotMainContentSelector:"#root",structuredResponseUrlStrategy:()=>"/api/api-ai-assistant/v1/structured-response",synthesizeUrlStrategy:()=>"/api/api-ai-assistant/v1/tts",transcribeUrlStrategy:()=>"/api/api-ai-assistant/v1/stt"};function Oy(){return Ea.synthesizeUrlStrategy()}function Ty(){return Ea.transcribeUrlStrategy()}function qy(){return Ea.llmCallUrlStrategy()}function VF(){return Ea.llmRegionStrategy()}function Iy(){return Ea.structuredResponseUrlStrategy()}function KF(t){return Ea.kazooUrlStrategy(t)}function Fz(t){return Ea.pulseUrlStrategy(t)}function Rl(){return Ea.pulseBearerTokenStrategy()}function Py(){return Ea.screenshotMainContentSelector}function mz(t){Ea.screenshotMainContentSelector=t}function Az(t){Ea.kazooUrlStrategy=t}function pz(t){Ea.llmCallUrlStrategy=t}function bz(t){Ea.llmRegionStrategy=t}function yz(t){Ea.pulseUrlStrategy=t}function kz(t){Ea.pulseBearerTokenStrategy=t}function wz(t){Ea.structuredResponseUrlStrategy=t}function Cz(t){Ea.synthesizeUrlStrategy=t}function xz(t){Ea.transcribeUrlStrategy=t}const vz=Object.freeze(Object.defineProperty({__proto__:null,getKazooUrl:KF,getLlmCallUrl:qy,getLlmRegion:VF,getPulseBearerToken:Rl,getPulseUrl:Fz,getScreenshotMainContentSelector:Py,getStructuredResponseUrl:Iy,getSynthesizeUrl:Oy,getTranscribeUrl:Ty,setKazooUrlStrategy:Az,setLlmCallUrlStrategy:pz,setLlmRegionStrategy:bz,setPulseBearerTokenStrategy:kz,setPulseUrlStrategy:yz,setScreenshotMainContentSelector:mz,setStructuredResponseUrlStrategy:wz,setSynthesizeUrlStrategy:Cz,setTranscribeUrlStrategy:xz},Symbol.toStringTag,{value:"Module"}));async function XF({model:t,temperature:e,stream:i,messages:a,tools:r,onChunk:n,onError:o,onComplete:s,systemInstruction:l}){const u=Rl(),f=VF();try{const d=await fetch(qy(),{method:"POST",body:JSON.stringify({model:t,temperature:e,stream:i,messages:a,tools:r,systemInstruction:l,...f?{region:f}:{}}),credentials:u?void 0:"include",headers:{"Content-Type":"application/json",Accept:i?"text/event-stream":"application/json",...u?{Authorization:`Bearer ${u}`}:{}}});if(!d||!d.ok)throw new Error("Unable to connect to LLM API. Please try again.");if(i){const _=d.body?.getReader();if(!_)throw new Error("Unexpected client error. Response body reader not available.");const F=new TextDecoder,c=[],m=n||(p=>{c.push(p)}),A=1e4;for(;A>0;){const{done:p,value:C}=await _.read();if(p)break;const k=F.decode(C),b=cz.parse(k);for(const w of b)m(w)}return s?.(),c}return(await d.json()).parts}catch(d){const g=d instanceof Error?d:new Error("Unexpected error calling LLM API");throw o?.(g),g}}function Dz(t){const e=[];let i=0;for(;i<t.length;){const a=t[i];if(a.role==="TOOL"){const r=Ez(t,i);i+=r.length,e.push({id:r[0].id,role:"model",parts:r.map(n=>({type:"toolCall",toolName:n.metadata?.toolName,args:n.metadata?.toolArgs}))},{id:r[0].id,role:"tool",parts:r.map(n=>({type:"toolResult",result:n.messageText,toolName:n.metadata?.toolName,args:n.metadata?.toolArgs}))});continue}a.role==="USER"?e.push({id:a.id,role:"user",parts:[{type:"text",text:a.messageText}]}):a.role==="MODEL"&&e.push({id:a.id,role:"model",parts:[{type:"text",text:a.messageText}]}),i++}return e}function Ez(t,e){const i=t[e],a=i.metadata?.parallelGroupId;if(a==null)return[i];const r=[];for(let n=e;n<t.length;n++){const o=t[n];if(o.role!=="TOOL"||o.metadata?.parallelGroupId!==a)break;r.push(o)}return r}async function Hy({propRefs:t,conversationId:e}){if(!t.current.getFollowUpSuggestions)return;const i=t.current.getConversationById(e);if(!i||!i.messages?.length)return;const a=Date.now();Uy.set(e,a),t.current.setFollowUpSuggestionsByConversationId(o=>({...o,[e]:[{type:"loading"}]}));const r=await t.current.getFollowUpSuggestions({conversation:i}).catch(o=>(console.log("Error getting follow up suggestions",o),[])),n=Uy.get(e);n&&a!==n||t.current.setFollowUpSuggestionsByConversationId(o=>({...o,[e]:r.map(s=>({id:s.fullPrompt||s.title,title:s.title,className:s.className,onClick:()=>{t.current.handleSendUserMessage({conversationId:e,messageText:Qe(s.fullPrompt,s.title)})}}))}))}const Uy=new Map;async function Bz({toolCalls:t,propRefs:e,debugInfo:i,conversationId:a,appendMessageToConversation:r}){await LS(async n=>{if(t.length===0||!e.current.isMounted)return n();const o=[],s=`tool-status-${a}`;for(const f of t){const d=e.current.tools?.find(F=>F.name===f.toolName);if(!d){e.current.onError?.(new Error(`Tool ${f.toolName} not found`)),i.current.push({time:new Date,message:`Tool ${f.toolName} not found`,data:{toolCall:f,tools:e.current.tools},level:"error"});continue}let g=f.args;const _=f.args;if(g?.args)for(;g?.args;)g=g.args;try{e.current.setMessages(A=>{const p={...A},C=[...Qe(p[a]?.messages,[])],k=C.findIndex(w=>w.id===s),b={id:s,role:"TOOL",conversationId:a,messageText:f.toolName,metadata:{toolName:f.toolName,displayName:d.displayName,pastTenseDisplayName:d.pastTenseDisplayName,toolArgs:_,loading:!0}};return k!==-1?C[k]=b:C.push(b),p[a]={...p[a],messages:C},p}),i.current.push({time:new Date,level:"info",message:"Fulfilling tool call",data:{toolCall:f}});const F=Date.now(),c=await d.fulfill(g),m=Date.now();typeof c=="string"?(o.push({type:"toolResult",toolName:f.toolName,args:_,result:c}),i.current.push({time:new Date,level:"info",message:"Tool call fulfilled",data:{toolCall:f,durationMs:m-F,result:c}})):(o.push({type:"toolResult",toolName:f.toolName,result:`Tool ${f.toolName} returned the following file`,args:_}),o.push({type:"file",toolName:f.toolName,fileUri:c?.fileUri,mimeType:c?.mimeType,args:_}),i.current.push({time:new Date,level:"info",message:"Tool call fulfilled with file",data:{toolCall:f,durationMs:m-F,result:c}}))}catch(F){i.current.push({time:new Date,message:"Error calling tool",level:"error",data:{toolCall:f,error:{message:F.message,stack:F.stack}}}),o.push({type:"toolResult",toolName:f.toolName,result:JSON.stringify({error:{message:F.message,stack:F.stack}}),args:_})}}if(!e.current.isMounted)return n();const l=t.length>1?Df():void 0,u=o.map(f=>({id:Df(),role:"TOOL",conversationId:a,messageText:f.type==="toolResult"?f.result:"file",metadata:{toolName:f.toolName,toolArgs:f.args,parallelGroupId:l}}));e.current.setMessages(f=>{const d={...f},g=Qe(d[a]?.messages,[]).filter(_=>_.id!==s);return d[a]={...d[a],messages:[...g,...u]},e.current.messages=d,d}),await Promise.all(u.map(async f=>{await r({variables:{input:{conversationId:a,message:{id:f.id,role:"TOOL",messageText:f.messageText,metadata:f.metadata}}}})})),await e.current.sendMessages(a),n()})}function Sz({setConnectionError:t,propRefs:e,debugInfo:i,appendMessageToConversation:a}){return async function r(n){if(!e.current.isMounted)return!1;t(null),e.current.setMessages(s=>({...s,[n]:{...s[n],isLoading:!0}}));try{e.current.onBeforeLlmCall&&e.current.onBeforeLlmCall()}catch(s){i.current.push({time:new Date,message:"Error calling onBeforeLlmCall",data:s,level:"error"})}let o;try{e.current.systemInstruction&&(i.current.push({time:new Date,message:"Getting system instruction",level:"info"}),o=await e.current.systemInstruction(),i.current.push({time:new Date,message:"System instruction",data:o,level:"info"}))}catch(s){i.current.push({time:new Date,message:"Error getting system instruction",data:s,level:"error"}),e.current.onError?.(s)}e.current.setFollowUpSuggestionsByConversationId(s=>({...s,[n]:[]}));try{const s={type:"text",text:""},l=[],u=Df();return await XF({model:e.current.model,temperature:e.current.temperature,stream:!0,messages:Dz(Qe(e.current.getConversationById(n)?.messages,[])),tools:e.current.tools,systemInstruction:o,onChunk:f=>{f.type==="text"?s.text+=f.text:f.type==="toolCall"&&l.push(f),e.current.setMessages(d=>{const g=d[n];if(!g)return console.error(`Invariant violation: currentConversation is undefined for conversationId ${n}`,d),d;const _=Qe(g.messages,[]),F=_[_.length-1];return F?.role==="MODEL"?F.messageText=s.text:s.text&&_.push({id:u,role:"MODEL",conversationId:n,messageText:s.text}),g.messages=_,{...d,[n]:Ju(g)}}),e.current.onChunkAdded?.()}}),s.text&&await a({variables:{input:{conversationId:n,message:{id:u,role:"MODEL",messageText:s.text}}}}),jz({condition:!!e.current.onAfterLlmCall,conversationId:n,callbackToInvoke:e.current.onAfterLlmCall,callbackName:"onAfterLlmCall",debugInfo:i,onError:e.current.onError,propRefs:e}),await Bz({conversationId:n,toolCalls:l,propRefs:e,debugInfo:i,appendMessageToConversation:a}),await Hy({propRefs:e,conversationId:n}),!0}catch(s){if(!e.current.isMounted)return!1;const l=ks(ii(t,null),ii(r,n));return i.current.push({time:new Date,message:"Error calling LLM API",data:s,level:"error"}),t({message:h.jsx(_z,{retry:l}),retry:l}),e.current.onError?.(s),!1}finally{e.current.setMessages(s=>({...s,[n]:{...s[n],isLoading:!1}}))}}}function jz({condition:t,conversationId:e,callbackToInvoke:i,callbackName:a,debugInfo:r,onError:n,propRefs:o}){if(!(!t||!i)){r.current.push({time:new Date,message:`Calling ${a}`,level:"info"});try{const s=o.current.messages;i(s[e].messages)}catch(s){r.current.push({time:new Date,message:`Error calling ${a}`,data:s,level:"error"}),n&&n(s)}finally{r.current.push({time:new Date,message:`Finished calling ${a}`,level:"info"})}}}async function Ry(t,e){const i=Rl(),a=await fetch(Oy(),{method:"POST",body:JSON.stringify({text:t,voice:e}),credentials:i?void 0:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...i?{Authorization:`Bearer ${i}`}:{}}});if(!a||!a.ok)throw new Error("Unable to connect to LLM API. Please try again.");const r=await a.json();if(!r.synthesis)throw new Error("No synthesis data received.");return r.synthesis}async function Lz(t){const e=Rl(),i=await fetch(Ty(),{method:"POST",body:JSON.stringify({audio:t}),credentials:e?void 0:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...e?{Authorization:`Bearer ${e}`}:{}}});if(!i||!i.ok)throw new Error("Unable to connect to LLM API. Please try again.");const a=await i.json();if(!a.transcription)throw new Error("No transcription data received.");return a.transcription}function Mz({model:t,initialMessages:e,temperature:i,onAfterLlmCall:a,onBeforeLlmCall:r,onError:n,tools:o,onChunkAdded:s,systemInstruction:l,onSelectedConversationChange:u,onSelectedConversationLoaded:f,initialConversationId:d,getFollowUpSuggestions:g,getChatTitle:_,initialPrompt:F}){const[c,m]=M.useState(!1),[A,p]=M.useState(!1),[C,k]=M.useState(!1),[b,w]=M.useState("Aoede"),[x,v]=M.useState(null),[E,D]=M.useState(!1),[L,q]=M.useState(!1),[R,I]=M.useState(!1),[P,T]=M.useState(Oz({initialConversationId:d})),[$,H]=M.useState(Tz({initialMessages:e,selectedConversationId:P})),V=M.useRef({onAfterLlmCall:a,onBeforeLlmCall:r,onError:n,tools:o,model:t,temperature:i,isMounted:!0,systemInstruction:l,onChunkAdded:s,getConversationById:Mi,setFollowUpSuggestionsByConversationId:Mi,getFollowUpSuggestions:g,handleSendUserMessage:Mi,setPrompt:Mi,selectedConversationId:P,onSelectedConversationLoaded:f,onSelectedConversationChange:u,messages:$,sendMessages:Mi,setMessages:Mi}),y=M.useCallback(gz({originalSetMessages:H,propRefs:V}),[H]),[B,G]=M.useState(!1),[S,Q]=M.useState(""),te=M.useRef(void 0);te.current=f;const[K,Z]=M.useState({}),[ee,ae]=M.useState(qz({initialPrompt:F,selectedConversationId:P})),O=M.useRef([]),[se]=W$(),{refetch:W}=nz({fetchPolicy:"cache-and-network",onCompleted:Iz({propRefs:V})}),[de]=fz();V.current.getConversationById=At=>V.current.messages[At],V.current.setFollowUpSuggestionsByConversationId=Z,V.current.setPrompt=Nz({setPromptByConversationId:ae,selectedConversationId:P}),V.current.onAfterLlmCall=a,V.current.onBeforeLlmCall=r,V.current.onError=n,V.current.tools=o,V.current.model=t,V.current.temperature=i,V.current.systemInstruction=l,V.current.onChunkAdded=s,V.current.isMounted=!0,V.current.onSelectedConversationChange=u,V.current.selectedConversationId=P,V.current.getFollowUpSuggestions=g,V.current.setMessages=y;const{loading:pe,data:ce}=Y$({skip:P===void 0,variables:{input:{conversationId:Qe(P,"")}},fetchPolicy:"cache-and-network",onCompleted:Pz({selectedConversationId:P,propRefs:V,setVoiceOutputPlaying:I}),onError:Mi});M.useEffect(()=>()=>{V.current.isMounted=!1},[]),M.useEffect(Qz({propRefs:V,selectedConversationId:P,messages:$}),[P,ce]);const Ce=M.useCallback(ii(T,void 0),[]),be=M.useCallback(Rz({propRefs:V,updateConversationTitle:de}),[de]),qe=M.useCallback($z({setIsTranscribingSpeech:q}),[]),Be=M.useCallback(zz(),[]),Ve=M.useCallback(Sz({propRefs:V,debugInfo:O,setConnectionError:v,appendMessageToConversation:se}),[]);V.current.sendMessages=Ve;const Le=M.useCallback(Uz({setSelectedConversationId:T,appendMessageToConversation:se,propRefs:V}),[T,O,se,V]),Ze=Hz({selectedConversationId:P,setPromptByConversationId:ae,getChatTitle:_,sendUserMessage:Le,updateTitle:be});V.current.handleSendUserMessage=Ze;const at=Qe(K[Qe(P,"")],[]),tt=Qe(ee[Qe(P,"")],"");return{messages:$,setMessages:y,isVoiceInputEnabled:c,setIsVoiceInputEnabled:m,isVoiceOutputEnabled:A,setIsVoiceOutputEnabled:p,voiceOutputVoice:b,setVoiceOutputVoice:w,getSpeech:Be,getTranscription:qe,debugInfo:O.current,sendUserMessage:Le,connectionError:x,followUpSuggestions:at,voiceInputProcessing:E,setVoiceInputProcessing:D,voiceInputTranscribing:L,setVoiceInputTranscribing:q,voiceOutputPlaying:R,setVoiceOutputPlaying:I,isCoachModeEnabled:C,setIsCoachModeEnabled:k,promptByConversationId:ee,prompt:tt,setPromptByConversationId:ae,setPrompt:V.current.setPrompt,selectedConversationId:P,isSearching:B,searchQuery:S,setIsSearching:G,setSearchQuery:Q,isLoadingConversation:pe,selectedConversation:$[Qe(P,"")],createNewConversation:Ce,setSelectedConversationId:T,updateTitle:be,refetchConversations:W,handleSendUserMessage:Ze,propRefs:V}}function Oz({initialConversationId:t}){if(t)return t}function Tz({initialMessages:t,selectedConversationId:e=""}){return e?{[e]:{id:e,title:"",updatedAt:new Date,isLoading:!1,messages:Qe(t,[])}}:{}}function qz({initialPrompt:t,selectedConversationId:e}){return e?{[e]:Qe(t,"")}:{"":Qe(t,"")}}function Iz({propRefs:t}){return e=>{if(e?.getConversations){const i=Date.now(),a=Ju(e.getConversations).map(r=>({id:r.id,title:r.title,updatedAt:new Date(Qe(r.updatedAt,i))}));t.current.setMessages(r=>{const n=Ju(r);for(const o of a){const s=o.id,l=r[s],u=Qe(a.find(f=>f.id===s),{});n[s]={...l,...u}}return n})}}}function Pz({selectedConversationId:t,propRefs:e,setVoiceOutputPlaying:i}){return a=>{if(i(!1),!a?.aiAssistantConversation)return;const r=Ju(a.aiAssistantConversation.messages);e.current.setMessages(n=>{if(!t)return n;const o=n[t];if(!o)return console.error(`Invariant violation: conversation is undefined for conversationId ${t}`,n),n;o.messages=Qe(o.messages,[]);let s;for(const l of r){const u=o.messages.findIndex(d=>d.id===l.id),f=o.messages[u];typeof f<"u"?f.messageText=l.messageText:o.messages.splice(o.messages.findIndex(d=>d.id===s)+1,0,l),s=l.id}return{...n,[t]:Ju(o)}}),setTimeout(()=>{e.current.onSelectedConversationLoaded?.(t,e.current.selectedConversationId,e.current.messages)},10)}}function Hz({selectedConversationId:t,sendUserMessage:e,setPromptByConversationId:i,getChatTitle:a,updateTitle:r}){return async({conversationId:n=t,messageText:o})=>{if(!o)return;const s=n===void 0;try{const{id:l}=await e({message:o});if(i(u=>({...u,[l]:""})),s){const u=await a(o);u&&u!=="New Chat"&&await r(l,u)}}catch(l){console.error(l)}}}function Uz({propRefs:t,setSelectedConversationId:e,appendMessageToConversation:i}){return async({message:a,skipAppendingUserMessageToConversation:r=!1})=>{const n=!t.current.selectedConversationId,o=t.current.selectedConversationId||Df();t.current.selectedConversationId=o;const s=t.current.getConversationById(o),l={id:Df(),role:"USER",messageText:a,conversationId:o},f={...Ju(s||{id:o,title:"New Chat",updatedAt:new Date,isLoading:!0,messages:[]}),messages:[...Qe(s?.messages,[]),l],isLoading:!0};t.current.setMessages(_=>({..._,[o]:f})),n&&(e(o),t.current.selectedConversationId=o);const d=[];!r&&d.push(i({variables:{input:{conversationId:o,message:{id:l.id,role:"USER",messageText:a}}}}));const g=new Promise((_,F)=>{jS(10).then(()=>{t.current.sendMessages(o).then(_).catch(F)})});return d.push(g),await Promise.all(d),{id:o}}}function Rz({propRefs:t,updateConversationTitle:e}){return async(i,a)=>{t.current.setMessages(r=>({...r,[i]:{...r[i],title:a,isUpdatingTitle:!0}})),await e({variables:{input:{conversationId:i,title:a}}}),t.current.setMessages(r=>({...r,[i]:{...r[i],isUpdatingTitle:!1}}))}}function Nz({setPromptByConversationId:t,selectedConversationId:e}){return(i=Qe(e,""),a)=>{t(typeof a=="function"?r=>({...r,[i]:a(r[i])}):r=>({...r,[i]:a}))}}function Qz({propRefs:t,selectedConversationId:e,messages:i}){return()=>{if(t.current?.onSelectedConversationChange?.(e,i),!e)return;const a=setTimeout(()=>{Hy({propRefs:t,conversationId:e})},500);return()=>clearTimeout(a)}}function $z({setIsTranscribingSpeech:t}){return async e=>{t(!0);const i=await Lz(e);return t(!1),i}}function zz(){return async t=>await Ry(t)}const na={"ai-assistant-textarea":"AiAssistantComponent-module_ai-assistant-textarea_dJrtB","textarea-container":"AiAssistantComponent-module_textarea-container_4eE9f","coach-mode-enabled":"AiAssistantComponent-module_coach-mode-enabled_UjNKm","ai-assistant-popup-container":"AiAssistantComponent-module_ai-assistant-popup-container_OH04M","ai-assistant-chat-history-container":"AiAssistantComponent-module_ai-assistant-chat-history-container_mIJ3y","ai-assistant-chat-history-header":"AiAssistantComponent-module_ai-assistant-chat-history-header_aR6OI","ai-assistant-chat-history-button":"AiAssistantComponent-module_ai-assistant-chat-history-button_Q34D6","conversation-selected":"AiAssistantComponent-module_conversation-selected_-ijIe","ai-assistant-chat-history-button-text":"AiAssistantComponent-module_ai-assistant-chat-history-button-text_cAi5Q","placeholder-content":"AiAssistantComponent-module_placeholder-content_8vmjp","placeholder-text":"AiAssistantComponent-module_placeholder-text_8edUF","loading-container":"AiAssistantComponent-module_loading-container_7BNjW","messages-scroll-container":"AiAssistantComponent-module_messages-scroll-container_8O6Kb","ai-assistant-send-btn":"AiAssistantComponent-module_ai-assistant-send-btn_h2wdX","ai-assistant-search-input-container":"AiAssistantComponent-module_ai-assistant-search-input-container_lUZKm","voice-input-processing":"AiAssistantComponent-module_voice-input-processing_2zY1J","voice-input-transcribing":"AiAssistantComponent-module_voice-input-transcribing_k6mLe"};function Wz({messages:t,selectedConversationId:e,onConversationSelect:i,loading:a=!1}){const{recentConversations:r,olderConversations:n}=M.useMemo(()=>{const o=Object.values(t),s=new Date().getTime()-10080*60*1e3,l=o.filter(f=>f.updatedAt.getTime()>s),u=o.filter(f=>f.updatedAt.getTime()<=s);return{recentConversations:l,olderConversations:u}},[t]);return a?h.jsx(go,{centered:!0,size:"small"}):h.jsxs(rt,{direction:"column",gap:"24px",testId:"chat-history",children:[h.jsx(rt,{direction:"column",gap:"8px",children:h.jsx(Ny,{conversations:r,selectedConversationId:e,onConversationSelect:i,title:"Past 7 days"})}),h.jsx(Ny,{conversations:n,selectedConversationId:e,onConversationSelect:i,title:"Past 30 days"})]})}function Ny({conversations:t,selectedConversationId:e,onConversationSelect:i,title:a,loadMoreThreshold:r=10}){const[n,o]=M.useState(!1),s=Object.values(t),l=!n&&s.length>r,u=n?s.length:r,f=s.slice(0,u);return f.length===0?null:h.jsxs(rt,{direction:"column",gap:"8px",children:[h.jsx("span",{className:na["ai-assistant-chat-history-header"],children:a}),f.map(d=>h.jsx(yi,{variant:"transparent",size:"small",className:me(na["ai-assistant-chat-history-button"],e===d.id&&na["conversation-selected"]),onClick:()=>i(d.id),children:d.isLoading?h.jsxs("span",{className:me(na["ai-assistant-chat-history-button-text"]),children:[h.jsx("div",{style:{display:"inline-block"},children:h.jsx(go,{size:"extraSmall"})})," ",d.title]}):h.jsx("span",{className:na["ai-assistant-chat-history-button-text"],children:d.title})},d.id)),l&&h.jsx(yi,{icon:"arrow_down",iconAlignment:"right",variant:"system",size:"small",onClick:()=>o(!0),"data-testid":"chat-history-load-more",children:"Load More"})]})}function Gz(t){return t?"arrow_up":"arrow_down"}function Vz(t){return t.level==="error"?"warning_no_outline":"info"}function Kz(t){return t.level==="warn"?"yellow":"gray"}function Xz(t){return t.level==="error"?"red":"transparent"}function Yz({debugInfo:t}){const[,e]=M.useState(0),i=M.useCallback(()=>e(l=>l+1),[]),a=M.useRef([]),r=M.useCallback(l=>{a.current.push(l),i()},[]),n=M.useCallback(l=>{a.current=a.current.filter(u=>u!==l),i()},[]),o=M.useCallback(l=>{a.current.includes(l)?n(l):r(l)},[r,n]),s=M.useCallback(l=>a.current.includes(l),[]);return h.jsx(rt,{direction:"column",gap:"8px","test-id":"debug-data",children:t.map((l,u)=>h.jsx(Hu,{style:{borderTop:`1px solid ${Xz(l)}`},children:h.jsxs(rt,{direction:"column",gap:"8px",children:[h.jsxs(rt,{gap:"12px",alignItems:"center",justifyContent:"space-between",children:[h.jsx("div",{children:h.jsx(It,{icon:Vz(l),color:Kz(l)})}),h.jsxs(Sf,{grow:1,children:[h.jsx("div",{children:l.message}),l.time?h.jsx(Of,{size:"extraSmall",children:l.time.toLocaleString()}):null]}),h.jsx("div",{children:h.jsx(yi,{variant:"primary_inverted",size:"small",icon:Gz(s(u)),onClick:ii(o,u),children:s(u)?"Collapse":"Expand"})})]}),s(u)&&h.jsx("textarea",{value:JSON.stringify(l,null,2),readOnly:!0,"data-testid":"debug-textarea",style:{minWidth:"100%",height:"100%",minHeight:"200px",maxWidth:"100%"}})]})},u))})}const Qy={"follow-up-suggestion-pill":"FollowUpSuggestions-module_follow-up-suggestion-pill_mkFc2","loading-state":"FollowUpSuggestions-module_loading-state_Wtgo0"};function Zz({followUpSuggestions:t}){return!t||t.length===0?null:h.jsx(rt,{gap:"5px",alignItems:"center",justifyContent:"flex-start",wrap:"wrap",style:{marginBottom:"10px"},children:t.map(e=>h.jsx(Jz,{suggestion:e},`${e?.id}-${e.type}`))})}function Jz({suggestion:t}){const e=`follow-up-suggestion-pill-${t.id}`;if(t.type==="loading")return h.jsxs(rt,{gap:"8px",alignItems:"center",className:Qy["loading-state"],children:[h.jsx(go,{size:"extraSmall"}),h.jsx(bt,{size:"small",color:"tertiary",children:"Preparing follow-up suggestions..."})]});const i=()=>{t.onClick()};return h.jsx(yi,{onClick:i,size:"small",variant:"chip",className:me(Qy["follow-up-suggestion-pill"],t.className),"data-testid":e,children:t.title},t.id)}const $y=document.createElement("i");function zy(t){const e="&"+t+";";$y.innerHTML=e;const i=$y.textContent;return i.charCodeAt(i.length-1)===59&&t!=="semi"||i===e?!1:i}function wo(t,e,i,a){const r=t.length;let n=0,o;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,i=i>0?i:0,a.length<1e4)o=Array.from(a),o.unshift(e,i),t.splice(...o);else for(i&&t.splice(e,i);n<a.length;)o=a.slice(n,n+1e4),o.unshift(e,0),t.splice(...o),n+=1e4,e+=1e4}function ir(t,e){return t.length>0?(wo(t,t.length,0,e),t):e}const YF={}.hasOwnProperty;function eW(t){const e={};let i=-1;for(;++i<t.length;)tW(e,t[i]);return e}function tW(t,e){let i;for(i in e){const r=(YF.call(t,i)?t[i]:void 0)||(t[i]={}),n=e[i];let o;if(n)for(o in n){YF.call(r,o)||(r[o]=[]);const s=n[o];iW(r[o],Array.isArray(s)?s:s?[s]:[])}}}function iW(t,e){let i=-1;const a=[];for(;++i<e.length;)(e[i].add==="after"?t:a).push(e[i]);wo(t,0,0,a)}function aW(t){const e={};let i=-1;for(;++i<t.length;)rW(e,t[i]);return e}function rW(t,e){let i;for(i in e){const r=(YF.call(t,i)?t[i]:void 0)||(t[i]={}),n=e[i];let o;if(n)for(o in n)r[o]=n[o]}}function nW(t,e){const i=Number.parseInt(t,e);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}const oW={'"':"quot","&":"amp","<":"lt",">":"gt"};function Wy(t){return t.replace(/["&<>]/g,e);function e(i){return"&"+oW[i]+";"}}function Bd(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Co=Ps(/[A-Za-z]/),Xr=Ps(/[\dA-Za-z]/),sW=Ps(/[#-'*+\--9=?A-Z^-~]/);function ZF(t){return t!==null&&(t<32||t===127)}const JF=Ps(/\d/),lW=Ps(/[\dA-Fa-f]/),uW=Ps(/[!-/:-@[-`{-~]/);function gt(t){return t!==null&&t<-2}function ar(t){return t!==null&&(t<0||t===32)}function Rt(t){return t===-2||t===-1||t===32}const fW=Ps(new RegExp("\\p{P}|\\p{S}","u")),dW=Ps(/\s/);function Ps(t){return e;function e(i){return i!==null&&i>-1&&t.test(String.fromCharCode(i))}}function e_(t,e){const i=Wy(hW(t||""));if(!e)return i;const a=i.indexOf(":"),r=i.indexOf("?"),n=i.indexOf("#"),o=i.indexOf("/");return a<0||o>-1&&a>o||r>-1&&a>r||n>-1&&a>n||e.test(i.slice(0,a))?i:""}function hW(t){const e=[];let i=-1,a=0,r=0;for(;++i<t.length;){const n=t.charCodeAt(i);let o="";if(n===37&&Xr(t.charCodeAt(i+1))&&Xr(t.charCodeAt(i+2)))r=2;else if(n<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(n))||(o=String.fromCharCode(n));else if(n>55295&&n<57344){const s=t.charCodeAt(i+1);n<56320&&s>56319&&s<57344?(o=String.fromCharCode(n,s),r=1):o="�"}else o=String.fromCharCode(n);o&&(e.push(t.slice(a,i),encodeURIComponent(o)),a=i+r+1,o=""),r&&(i+=r,r=0)}return e.join("")+t.slice(a)}const Gy={}.hasOwnProperty,Vy=/^(https?|ircs?|mailto|xmpp)$/i,gW=/^https?$/i;function _W(t){const e=t||{};let i=!0;const a={},r=[[]],n=[],o=[],l=aW([{enter:{blockQuote:P,codeFenced:V,codeFencedFenceInfo:m,codeFencedFenceMeta:m,codeIndented:G,codeText:_e,content:Ve,definition:pe,definitionDestinationString:Ce,definitionLabelString:m,definitionTitleString:m,emphasis:xa,htmlFlow:ji,htmlText:ha,image:Q,label:m,link:te,listItemMarker:L,listItemValue:D,listOrdered:v,listUnordered:E,paragraph:$,reference:m,resource:ae,resourceDestinationString:O,resourceTitleString:m,setextHeading:Ze,strong:Bt},exit:{atxHeading:tt,atxHeadingSequence:Le,autolinkEmail:X,autolinkProtocol:ia,blockQuote:T,characterEscapeValue:Kt,characterReferenceMarkerHexadecimal:qt,characterReferenceMarkerNumeric:qt,characterReferenceValue:si,codeFenced:S,codeFencedFence:B,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:_t,codeIndented:S,codeText:xe,codeTextData:Kt,data:Kt,definition:Be,definitionDestinationString:be,definitionLabelString:ce,definitionTitleString:qe,emphasis:Ge,hardBreakEscape:Xt,hardBreakTrailing:Xt,htmlFlow:Xi,htmlFlowData:Kt,htmlText:Xi,htmlTextData:Kt,image:de,label:Z,labelText:K,lineEnding:ve,link:de,listOrdered:q,listUnordered:R,paragraph:H,reference:x,referenceString:ee,resource:x,resourceDestinationString:se,resourceTitleString:W,setextHeading:Vt,setextHeadingLineSequence:At,setextHeadingText:at,strong:ct,thematicBreak:oi}},...e.htmlExtensions||[]]),u={definitions:a,tightStack:o},f={buffer:m,encode:w,getData:c,lineEndingIfNeeded:b,options:e,raw:C,resume:A,setData:F,tag:p};let d=e.defaultLineEnding;return g;function g(z){let re=-1,he=0;const ke=[];let De=[],Ke=[];for(;++re<z.length;)!d&&(z[re][1].type==="lineEnding"||z[re][1].type==="lineEndingBlank")&&(d=z[re][2].sliceSerialize(z[re][1])),(z[re][1].type==="listOrdered"||z[re][1].type==="listUnordered")&&(z[re][0]==="enter"?ke.push(re):_(z.slice(ke.pop(),re))),z[re][1].type==="definition"&&(z[re][0]==="enter"?(Ke=ir(Ke,z.slice(he,re)),he=re):(De=ir(De,z.slice(he,re+1)),he=re+1));De=ir(De,Ke),De=ir(De,z.slice(he)),re=-1;const Te=De;for(l.enter.null&&l.enter.null.call(f);++re<z.length;){const lt=l[Te[re][0]],He=Te[re][1].type,Je=lt[He];Gy.call(lt,He)&&Je&&Je.call({sliceSerialize:Te[re][2].sliceSerialize,...f},Te[re][1])}return l.exit.null&&l.exit.null.call(f),r[0].join("")}function _(z){const re=z.length;let he=0,ke=0,De=!1,Ke;for(;++he<re;){const Te=z[he];if(Te[1]._container)Ke=void 0,Te[0]==="enter"?ke++:ke--;else switch(Te[1].type){case"listItemPrefix":{Te[0]==="exit"&&(Ke=!0);break}case"linePrefix":break;case"lineEndingBlank":{Te[0]==="enter"&&!ke&&(Ke?Ke=void 0:De=!0);break}default:Ke=void 0}}z[0][1]._loose=De}function F(z,re){u[z]=re}function c(z){return u[z]}function m(){r.push([])}function A(){return r.pop().join("")}function p(z){i&&(F("lastWasTag",!0),r[r.length-1].push(z))}function C(z){F("lastWasTag"),r[r.length-1].push(z)}function k(){C(d||`
|
|
238
|
+
`)}}const Ea={kazooUrlStrategy:t=>t,pulseUrlStrategy:t=>t,llmCallUrlStrategy:()=>"/api/api-ai-assistant/v1/chat",llmRegionStrategy:()=>{},pulseBearerTokenStrategy:()=>null,screenshotMainContentSelector:"#root",structuredResponseUrlStrategy:()=>"/api/api-ai-assistant/v1/structured-response",synthesizeUrlStrategy:()=>"/api/api-ai-assistant/v1/tts",transcribeUrlStrategy:()=>"/api/api-ai-assistant/v1/stt"};function Oy(){return Ea.synthesizeUrlStrategy()}function Ty(){return Ea.transcribeUrlStrategy()}function qy(){return Ea.llmCallUrlStrategy()}function VF(){return Ea.llmRegionStrategy()}function Iy(){return Ea.structuredResponseUrlStrategy()}function KF(t){return Ea.kazooUrlStrategy(t)}function Fz(t){return Ea.pulseUrlStrategy(t)}function Rl(){return Ea.pulseBearerTokenStrategy()}function Py(){return Ea.screenshotMainContentSelector}function mz(t){Ea.screenshotMainContentSelector=t}function Az(t){Ea.kazooUrlStrategy=t}function pz(t){Ea.llmCallUrlStrategy=t}function bz(t){Ea.llmRegionStrategy=t}function yz(t){Ea.pulseUrlStrategy=t}function kz(t){Ea.pulseBearerTokenStrategy=t}function wz(t){Ea.structuredResponseUrlStrategy=t}function Cz(t){Ea.synthesizeUrlStrategy=t}function xz(t){Ea.transcribeUrlStrategy=t}const vz=Object.freeze(Object.defineProperty({__proto__:null,getKazooUrl:KF,getLlmCallUrl:qy,getLlmRegion:VF,getPulseBearerToken:Rl,getPulseUrl:Fz,getScreenshotMainContentSelector:Py,getStructuredResponseUrl:Iy,getSynthesizeUrl:Oy,getTranscribeUrl:Ty,setKazooUrlStrategy:Az,setLlmCallUrlStrategy:pz,setLlmRegionStrategy:bz,setPulseBearerTokenStrategy:kz,setPulseUrlStrategy:yz,setScreenshotMainContentSelector:mz,setStructuredResponseUrlStrategy:wz,setSynthesizeUrlStrategy:Cz,setTranscribeUrlStrategy:xz},Symbol.toStringTag,{value:"Module"}));async function XF({model:t,temperature:e,stream:i,messages:a,tools:r,onChunk:n,onError:o,onComplete:s,systemInstruction:l}){const u=Rl(),f=VF();try{const d=await fetch(qy(),{method:"POST",body:JSON.stringify({model:t,temperature:e,stream:i,messages:a,tools:r,systemInstruction:l,...f?{region:f}:{}}),credentials:u?void 0:"include",headers:{"Content-Type":"application/json",Accept:i?"text/event-stream":"application/json",...u?{Authorization:`Bearer ${u}`}:{}}});if(!d||!d.ok)throw new Error("Unable to connect to LLM API. Please try again.");if(i){const _=d.body?.getReader();if(!_)throw new Error("Unexpected client error. Response body reader not available.");const F=new TextDecoder,c=[],m=n||(p=>{c.push(p)}),A=1e4;for(;A>0;){const{done:p,value:C}=await _.read();if(p)break;const k=F.decode(C),b=cz.parse(k);for(const w of b)m(w)}return s?.(),c}return(await d.json()).parts}catch(d){const g=d instanceof Error?d:new Error("Unexpected error calling LLM API");throw o?.(g),g}}function Dz(t){const e=[];let i=0;for(;i<t.length;){const a=t[i];if(a.role==="TOOL"){const r=Ez(t,i);i+=r.length,e.push({id:r[0].id,role:"model",parts:r.map(n=>({type:"toolCall",toolName:n.metadata?.toolName,args:n.metadata?.toolArgs,thoughtSignature:n.metadata?.thoughtSignature}))},{id:r[0].id,role:"tool",parts:r.map(n=>({type:"toolResult",result:n.messageText,toolName:n.metadata?.toolName,args:n.metadata?.toolArgs}))});continue}a.role==="USER"?e.push({id:a.id,role:"user",parts:[{type:"text",text:a.messageText}]}):a.role==="MODEL"&&e.push({id:a.id,role:"model",parts:[{type:"text",text:a.messageText}]}),i++}return e}function Ez(t,e){const i=t[e],a=i.metadata?.parallelGroupId;if(a==null)return[i];const r=[];for(let n=e;n<t.length;n++){const o=t[n];if(o.role!=="TOOL"||o.metadata?.parallelGroupId!==a)break;r.push(o)}return r}async function Hy({propRefs:t,conversationId:e}){if(!t.current.getFollowUpSuggestions)return;const i=t.current.getConversationById(e);if(!i||!i.messages?.length)return;const a=Date.now();Uy.set(e,a),t.current.setFollowUpSuggestionsByConversationId(o=>({...o,[e]:[{type:"loading"}]}));const r=await t.current.getFollowUpSuggestions({conversation:i}).catch(o=>(console.log("Error getting follow up suggestions",o),[])),n=Uy.get(e);n&&a!==n||t.current.setFollowUpSuggestionsByConversationId(o=>({...o,[e]:r.map(s=>({id:s.fullPrompt||s.title,title:s.title,className:s.className,onClick:()=>{t.current.handleSendUserMessage({conversationId:e,messageText:Qe(s.fullPrompt,s.title)})}}))}))}const Uy=new Map;async function Bz({toolCalls:t,propRefs:e,debugInfo:i,conversationId:a,appendMessageToConversation:r}){await LS(async n=>{if(t.length===0||!e.current.isMounted)return n();const o=[],s=`tool-status-${a}`;for(const f of t){const d=e.current.tools?.find(F=>F.name===f.toolName);if(!d){e.current.onError?.(new Error(`Tool ${f.toolName} not found`)),i.current.push({time:new Date,message:`Tool ${f.toolName} not found`,data:{toolCall:f,tools:e.current.tools},level:"error"});continue}let g=f.args;const _=f.args;if(g?.args)for(;g?.args;)g=g.args;try{e.current.setMessages(A=>{const p={...A},C=[...Qe(p[a]?.messages,[])],k=C.findIndex(w=>w.id===s),b={id:s,role:"TOOL",conversationId:a,messageText:f.toolName,metadata:{toolName:f.toolName,displayName:d.displayName,pastTenseDisplayName:d.pastTenseDisplayName,toolArgs:_,loading:!0}};return k!==-1?C[k]=b:C.push(b),p[a]={...p[a],messages:C},p}),i.current.push({time:new Date,level:"info",message:"Fulfilling tool call",data:{toolCall:f}});const F=Date.now(),c=await d.fulfill(g),m=Date.now();typeof c=="string"?(o.push({type:"toolResult",toolName:f.toolName,args:_,result:c,thoughtSignature:f.thoughtSignature}),i.current.push({time:new Date,level:"info",message:"Tool call fulfilled",data:{toolCall:f,durationMs:m-F,result:c}})):(o.push({type:"toolResult",toolName:f.toolName,result:`Tool ${f.toolName} returned the following file`,args:_,thoughtSignature:f.thoughtSignature}),o.push({type:"file",toolName:f.toolName,fileUri:c?.fileUri,mimeType:c?.mimeType,args:_,thoughtSignature:f.thoughtSignature}),i.current.push({time:new Date,level:"info",message:"Tool call fulfilled with file",data:{toolCall:f,durationMs:m-F,result:c}}))}catch(F){i.current.push({time:new Date,message:"Error calling tool",level:"error",data:{toolCall:f,error:{message:F.message,stack:F.stack}}}),o.push({type:"toolResult",toolName:f.toolName,result:JSON.stringify({error:{message:F.message,stack:F.stack}}),args:_})}}if(!e.current.isMounted)return n();const l=t.length>1?Df():void 0,u=o.map(f=>({id:Df(),role:"TOOL",conversationId:a,messageText:f.type==="toolResult"?f.result:"file",metadata:{toolName:f.toolName,toolArgs:f.args,thoughtSignature:f.thoughtSignature,parallelGroupId:l}}));e.current.setMessages(f=>{const d={...f},g=Qe(d[a]?.messages,[]).filter(_=>_.id!==s);return d[a]={...d[a],messages:[...g,...u]},e.current.messages=d,d}),await Promise.all(u.map(async f=>{await r({variables:{input:{conversationId:a,message:{id:f.id,role:"TOOL",messageText:f.messageText,metadata:f.metadata}}}})})),await e.current.sendMessages(a),n()})}function Sz({setConnectionError:t,propRefs:e,debugInfo:i,appendMessageToConversation:a}){return async function r(n){if(!e.current.isMounted)return!1;t(null),e.current.setMessages(s=>({...s,[n]:{...s[n],isLoading:!0}}));try{e.current.onBeforeLlmCall&&e.current.onBeforeLlmCall()}catch(s){i.current.push({time:new Date,message:"Error calling onBeforeLlmCall",data:s,level:"error"})}let o;try{e.current.systemInstruction&&(i.current.push({time:new Date,message:"Getting system instruction",level:"info"}),o=await e.current.systemInstruction(),i.current.push({time:new Date,message:"System instruction",data:o,level:"info"}))}catch(s){i.current.push({time:new Date,message:"Error getting system instruction",data:s,level:"error"}),e.current.onError?.(s)}e.current.setFollowUpSuggestionsByConversationId(s=>({...s,[n]:[]}));try{const s={type:"text",text:""},l=[],u=Df();return await XF({model:e.current.model,temperature:e.current.temperature,stream:!0,messages:Dz(Qe(e.current.getConversationById(n)?.messages,[])),tools:e.current.tools,systemInstruction:o,onChunk:f=>{f.type==="text"?s.text+=f.text:f.type==="toolCall"&&l.push(f),e.current.setMessages(d=>{const g=d[n];if(!g)return console.error(`Invariant violation: currentConversation is undefined for conversationId ${n}`,d),d;const _=Qe(g.messages,[]),F=_[_.length-1];return F?.role==="MODEL"?F.messageText=s.text:s.text&&_.push({id:u,role:"MODEL",conversationId:n,messageText:s.text}),g.messages=_,{...d,[n]:Ju(g)}}),e.current.onChunkAdded?.()}}),s.text&&await a({variables:{input:{conversationId:n,message:{id:u,role:"MODEL",messageText:s.text}}}}),jz({condition:!!e.current.onAfterLlmCall,conversationId:n,callbackToInvoke:e.current.onAfterLlmCall,callbackName:"onAfterLlmCall",debugInfo:i,onError:e.current.onError,propRefs:e}),await Bz({conversationId:n,toolCalls:l,propRefs:e,debugInfo:i,appendMessageToConversation:a}),await Hy({propRefs:e,conversationId:n}),!0}catch(s){if(!e.current.isMounted)return!1;const l=ks(ii(t,null),ii(r,n));return i.current.push({time:new Date,message:"Error calling LLM API",data:s,level:"error"}),t({message:h.jsx(_z,{retry:l}),retry:l}),e.current.onError?.(s),!1}finally{e.current.setMessages(s=>({...s,[n]:{...s[n],isLoading:!1}}))}}}function jz({condition:t,conversationId:e,callbackToInvoke:i,callbackName:a,debugInfo:r,onError:n,propRefs:o}){if(!(!t||!i)){r.current.push({time:new Date,message:`Calling ${a}`,level:"info"});try{const s=o.current.messages;i(s[e].messages)}catch(s){r.current.push({time:new Date,message:`Error calling ${a}`,data:s,level:"error"}),n&&n(s)}finally{r.current.push({time:new Date,message:`Finished calling ${a}`,level:"info"})}}}async function Ry(t,e){const i=Rl(),a=await fetch(Oy(),{method:"POST",body:JSON.stringify({text:t,voice:e}),credentials:i?void 0:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...i?{Authorization:`Bearer ${i}`}:{}}});if(!a||!a.ok)throw new Error("Unable to connect to LLM API. Please try again.");const r=await a.json();if(!r.synthesis)throw new Error("No synthesis data received.");return r.synthesis}async function Lz(t){const e=Rl(),i=await fetch(Ty(),{method:"POST",body:JSON.stringify({audio:t}),credentials:e?void 0:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...e?{Authorization:`Bearer ${e}`}:{}}});if(!i||!i.ok)throw new Error("Unable to connect to LLM API. Please try again.");const a=await i.json();if(!a.transcription)throw new Error("No transcription data received.");return a.transcription}function Mz({model:t,initialMessages:e,temperature:i,onAfterLlmCall:a,onBeforeLlmCall:r,onError:n,tools:o,onChunkAdded:s,systemInstruction:l,onSelectedConversationChange:u,onSelectedConversationLoaded:f,initialConversationId:d,getFollowUpSuggestions:g,getChatTitle:_,initialPrompt:F}){const[c,m]=M.useState(!1),[A,p]=M.useState(!1),[C,k]=M.useState(!1),[b,w]=M.useState("Aoede"),[x,v]=M.useState(null),[E,D]=M.useState(!1),[L,q]=M.useState(!1),[R,I]=M.useState(!1),[P,T]=M.useState(Oz({initialConversationId:d})),[$,H]=M.useState(Tz({initialMessages:e,selectedConversationId:P})),V=M.useRef({onAfterLlmCall:a,onBeforeLlmCall:r,onError:n,tools:o,model:t,temperature:i,isMounted:!0,systemInstruction:l,onChunkAdded:s,getConversationById:Mi,setFollowUpSuggestionsByConversationId:Mi,getFollowUpSuggestions:g,handleSendUserMessage:Mi,setPrompt:Mi,selectedConversationId:P,onSelectedConversationLoaded:f,onSelectedConversationChange:u,messages:$,sendMessages:Mi,setMessages:Mi}),y=M.useCallback(gz({originalSetMessages:H,propRefs:V}),[H]),[B,G]=M.useState(!1),[S,Q]=M.useState(""),te=M.useRef(void 0);te.current=f;const[K,Z]=M.useState({}),[ee,ae]=M.useState(qz({initialPrompt:F,selectedConversationId:P})),O=M.useRef([]),[se]=W$(),{refetch:W}=nz({fetchPolicy:"cache-and-network",onCompleted:Iz({propRefs:V})}),[de]=fz();V.current.getConversationById=At=>V.current.messages[At],V.current.setFollowUpSuggestionsByConversationId=Z,V.current.setPrompt=Nz({setPromptByConversationId:ae,selectedConversationId:P}),V.current.onAfterLlmCall=a,V.current.onBeforeLlmCall=r,V.current.onError=n,V.current.tools=o,V.current.model=t,V.current.temperature=i,V.current.systemInstruction=l,V.current.onChunkAdded=s,V.current.isMounted=!0,V.current.onSelectedConversationChange=u,V.current.selectedConversationId=P,V.current.getFollowUpSuggestions=g,V.current.setMessages=y;const{loading:pe,data:ce}=Y$({skip:P===void 0,variables:{input:{conversationId:Qe(P,"")}},fetchPolicy:"cache-and-network",onCompleted:Pz({selectedConversationId:P,propRefs:V,setVoiceOutputPlaying:I}),onError:Mi});M.useEffect(()=>()=>{V.current.isMounted=!1},[]),M.useEffect(Qz({propRefs:V,selectedConversationId:P,messages:$}),[P,ce]);const Ce=M.useCallback(ii(T,void 0),[]),be=M.useCallback(Rz({propRefs:V,updateConversationTitle:de}),[de]),qe=M.useCallback($z({setIsTranscribingSpeech:q}),[]),Be=M.useCallback(zz(),[]),Ve=M.useCallback(Sz({propRefs:V,debugInfo:O,setConnectionError:v,appendMessageToConversation:se}),[]);V.current.sendMessages=Ve;const Le=M.useCallback(Uz({setSelectedConversationId:T,appendMessageToConversation:se,propRefs:V}),[T,O,se,V]),Ze=Hz({selectedConversationId:P,setPromptByConversationId:ae,getChatTitle:_,sendUserMessage:Le,updateTitle:be});V.current.handleSendUserMessage=Ze;const at=Qe(K[Qe(P,"")],[]),tt=Qe(ee[Qe(P,"")],"");return{messages:$,setMessages:y,isVoiceInputEnabled:c,setIsVoiceInputEnabled:m,isVoiceOutputEnabled:A,setIsVoiceOutputEnabled:p,voiceOutputVoice:b,setVoiceOutputVoice:w,getSpeech:Be,getTranscription:qe,debugInfo:O.current,sendUserMessage:Le,connectionError:x,followUpSuggestions:at,voiceInputProcessing:E,setVoiceInputProcessing:D,voiceInputTranscribing:L,setVoiceInputTranscribing:q,voiceOutputPlaying:R,setVoiceOutputPlaying:I,isCoachModeEnabled:C,setIsCoachModeEnabled:k,promptByConversationId:ee,prompt:tt,setPromptByConversationId:ae,setPrompt:V.current.setPrompt,selectedConversationId:P,isSearching:B,searchQuery:S,setIsSearching:G,setSearchQuery:Q,isLoadingConversation:pe,selectedConversation:$[Qe(P,"")],createNewConversation:Ce,setSelectedConversationId:T,updateTitle:be,refetchConversations:W,handleSendUserMessage:Ze,propRefs:V}}function Oz({initialConversationId:t}){if(t)return t}function Tz({initialMessages:t,selectedConversationId:e=""}){return e?{[e]:{id:e,title:"",updatedAt:new Date,isLoading:!1,messages:Qe(t,[])}}:{}}function qz({initialPrompt:t,selectedConversationId:e}){return e?{[e]:Qe(t,"")}:{"":Qe(t,"")}}function Iz({propRefs:t}){return e=>{if(e?.getConversations){const i=Date.now(),a=Ju(e.getConversations).map(r=>({id:r.id,title:r.title,updatedAt:new Date(Qe(r.updatedAt,i))}));t.current.setMessages(r=>{const n=Ju(r);for(const o of a){const s=o.id,l=r[s],u=Qe(a.find(f=>f.id===s),{});n[s]={...l,...u}}return n})}}}function Pz({selectedConversationId:t,propRefs:e,setVoiceOutputPlaying:i}){return a=>{if(i(!1),!a?.aiAssistantConversation)return;const r=Ju(a.aiAssistantConversation.messages);e.current.setMessages(n=>{if(!t)return n;const o=n[t];if(!o)return console.error(`Invariant violation: conversation is undefined for conversationId ${t}`,n),n;o.messages=Qe(o.messages,[]);let s;for(const l of r){const u=o.messages.findIndex(d=>d.id===l.id),f=o.messages[u];typeof f<"u"?f.messageText=l.messageText:o.messages.splice(o.messages.findIndex(d=>d.id===s)+1,0,l),s=l.id}return{...n,[t]:Ju(o)}}),setTimeout(()=>{e.current.onSelectedConversationLoaded?.(t,e.current.selectedConversationId,e.current.messages)},10)}}function Hz({selectedConversationId:t,sendUserMessage:e,setPromptByConversationId:i,getChatTitle:a,updateTitle:r}){return async({conversationId:n=t,messageText:o})=>{if(!o)return;const s=n===void 0;try{const{id:l}=await e({message:o});if(i(u=>({...u,[l]:""})),s){const u=await a(o);u&&u!=="New Chat"&&await r(l,u)}}catch(l){console.error(l)}}}function Uz({propRefs:t,setSelectedConversationId:e,appendMessageToConversation:i}){return async({message:a,skipAppendingUserMessageToConversation:r=!1})=>{const n=!t.current.selectedConversationId,o=t.current.selectedConversationId||Df();t.current.selectedConversationId=o;const s=t.current.getConversationById(o),l={id:Df(),role:"USER",messageText:a,conversationId:o},f={...Ju(s||{id:o,title:"New Chat",updatedAt:new Date,isLoading:!0,messages:[]}),messages:[...Qe(s?.messages,[]),l],isLoading:!0};t.current.setMessages(_=>({..._,[o]:f})),n&&(e(o),t.current.selectedConversationId=o);const d=[];!r&&d.push(i({variables:{input:{conversationId:o,message:{id:l.id,role:"USER",messageText:a}}}}));const g=new Promise((_,F)=>{jS(10).then(()=>{t.current.sendMessages(o).then(_).catch(F)})});return d.push(g),await Promise.all(d),{id:o}}}function Rz({propRefs:t,updateConversationTitle:e}){return async(i,a)=>{t.current.setMessages(r=>({...r,[i]:{...r[i],title:a,isUpdatingTitle:!0}})),await e({variables:{input:{conversationId:i,title:a}}}),t.current.setMessages(r=>({...r,[i]:{...r[i],isUpdatingTitle:!1}}))}}function Nz({setPromptByConversationId:t,selectedConversationId:e}){return(i=Qe(e,""),a)=>{t(typeof a=="function"?r=>({...r,[i]:a(r[i])}):r=>({...r,[i]:a}))}}function Qz({propRefs:t,selectedConversationId:e,messages:i}){return()=>{if(t.current?.onSelectedConversationChange?.(e,i),!e)return;const a=setTimeout(()=>{Hy({propRefs:t,conversationId:e})},500);return()=>clearTimeout(a)}}function $z({setIsTranscribingSpeech:t}){return async e=>{t(!0);const i=await Lz(e);return t(!1),i}}function zz(){return async t=>await Ry(t)}const na={"ai-assistant-textarea":"AiAssistantComponent-module_ai-assistant-textarea_dJrtB","textarea-container":"AiAssistantComponent-module_textarea-container_4eE9f","coach-mode-enabled":"AiAssistantComponent-module_coach-mode-enabled_UjNKm","ai-assistant-popup-container":"AiAssistantComponent-module_ai-assistant-popup-container_OH04M","ai-assistant-chat-history-container":"AiAssistantComponent-module_ai-assistant-chat-history-container_mIJ3y","ai-assistant-chat-history-header":"AiAssistantComponent-module_ai-assistant-chat-history-header_aR6OI","ai-assistant-chat-history-button":"AiAssistantComponent-module_ai-assistant-chat-history-button_Q34D6","conversation-selected":"AiAssistantComponent-module_conversation-selected_-ijIe","ai-assistant-chat-history-button-text":"AiAssistantComponent-module_ai-assistant-chat-history-button-text_cAi5Q","placeholder-content":"AiAssistantComponent-module_placeholder-content_8vmjp","placeholder-text":"AiAssistantComponent-module_placeholder-text_8edUF","loading-container":"AiAssistantComponent-module_loading-container_7BNjW","messages-scroll-container":"AiAssistantComponent-module_messages-scroll-container_8O6Kb","ai-assistant-send-btn":"AiAssistantComponent-module_ai-assistant-send-btn_h2wdX","ai-assistant-search-input-container":"AiAssistantComponent-module_ai-assistant-search-input-container_lUZKm","voice-input-processing":"AiAssistantComponent-module_voice-input-processing_2zY1J","voice-input-transcribing":"AiAssistantComponent-module_voice-input-transcribing_k6mLe"};function Wz({messages:t,selectedConversationId:e,onConversationSelect:i,loading:a=!1}){const{recentConversations:r,olderConversations:n}=M.useMemo(()=>{const o=Object.values(t),s=new Date().getTime()-10080*60*1e3,l=o.filter(f=>f.updatedAt.getTime()>s),u=o.filter(f=>f.updatedAt.getTime()<=s);return{recentConversations:l,olderConversations:u}},[t]);return a?h.jsx(go,{centered:!0,size:"small"}):h.jsxs(rt,{direction:"column",gap:"24px",testId:"chat-history",children:[h.jsx(rt,{direction:"column",gap:"8px",children:h.jsx(Ny,{conversations:r,selectedConversationId:e,onConversationSelect:i,title:"Past 7 days"})}),h.jsx(Ny,{conversations:n,selectedConversationId:e,onConversationSelect:i,title:"Past 30 days"})]})}function Ny({conversations:t,selectedConversationId:e,onConversationSelect:i,title:a,loadMoreThreshold:r=10}){const[n,o]=M.useState(!1),s=Object.values(t),l=!n&&s.length>r,u=n?s.length:r,f=s.slice(0,u);return f.length===0?null:h.jsxs(rt,{direction:"column",gap:"8px",children:[h.jsx("span",{className:na["ai-assistant-chat-history-header"],children:a}),f.map(d=>h.jsx(yi,{variant:"transparent",size:"small",className:me(na["ai-assistant-chat-history-button"],e===d.id&&na["conversation-selected"]),onClick:()=>i(d.id),children:d.isLoading?h.jsxs("span",{className:me(na["ai-assistant-chat-history-button-text"]),children:[h.jsx("div",{style:{display:"inline-block"},children:h.jsx(go,{size:"extraSmall"})})," ",d.title]}):h.jsx("span",{className:na["ai-assistant-chat-history-button-text"],children:d.title})},d.id)),l&&h.jsx(yi,{icon:"arrow_down",iconAlignment:"right",variant:"system",size:"small",onClick:()=>o(!0),"data-testid":"chat-history-load-more",children:"Load More"})]})}function Gz(t){return t?"arrow_up":"arrow_down"}function Vz(t){return t.level==="error"?"warning_no_outline":"info"}function Kz(t){return t.level==="warn"?"yellow":"gray"}function Xz(t){return t.level==="error"?"red":"transparent"}function Yz({debugInfo:t}){const[,e]=M.useState(0),i=M.useCallback(()=>e(l=>l+1),[]),a=M.useRef([]),r=M.useCallback(l=>{a.current.push(l),i()},[]),n=M.useCallback(l=>{a.current=a.current.filter(u=>u!==l),i()},[]),o=M.useCallback(l=>{a.current.includes(l)?n(l):r(l)},[r,n]),s=M.useCallback(l=>a.current.includes(l),[]);return h.jsx(rt,{direction:"column",gap:"8px","test-id":"debug-data",children:t.map((l,u)=>h.jsx(Hu,{style:{borderTop:`1px solid ${Xz(l)}`},children:h.jsxs(rt,{direction:"column",gap:"8px",children:[h.jsxs(rt,{gap:"12px",alignItems:"center",justifyContent:"space-between",children:[h.jsx("div",{children:h.jsx(It,{icon:Vz(l),color:Kz(l)})}),h.jsxs(Sf,{grow:1,children:[h.jsx("div",{children:l.message}),l.time?h.jsx(Of,{size:"extraSmall",children:l.time.toLocaleString()}):null]}),h.jsx("div",{children:h.jsx(yi,{variant:"primary_inverted",size:"small",icon:Gz(s(u)),onClick:ii(o,u),children:s(u)?"Collapse":"Expand"})})]}),s(u)&&h.jsx("textarea",{value:JSON.stringify(l,null,2),readOnly:!0,"data-testid":"debug-textarea",style:{minWidth:"100%",height:"100%",minHeight:"200px",maxWidth:"100%"}})]})},u))})}const Qy={"follow-up-suggestion-pill":"FollowUpSuggestions-module_follow-up-suggestion-pill_mkFc2","loading-state":"FollowUpSuggestions-module_loading-state_Wtgo0"};function Zz({followUpSuggestions:t}){return!t||t.length===0?null:h.jsx(rt,{gap:"5px",alignItems:"center",justifyContent:"flex-start",wrap:"wrap",style:{marginBottom:"10px"},children:t.map(e=>h.jsx(Jz,{suggestion:e},`${e?.id}-${e.type}`))})}function Jz({suggestion:t}){const e=`follow-up-suggestion-pill-${t.id}`;if(t.type==="loading")return h.jsxs(rt,{gap:"8px",alignItems:"center",className:Qy["loading-state"],children:[h.jsx(go,{size:"extraSmall"}),h.jsx(bt,{size:"small",color:"tertiary",children:"Preparing follow-up suggestions..."})]});const i=()=>{t.onClick()};return h.jsx(yi,{onClick:i,size:"small",variant:"chip",className:me(Qy["follow-up-suggestion-pill"],t.className),"data-testid":e,children:t.title},t.id)}const $y=document.createElement("i");function zy(t){const e="&"+t+";";$y.innerHTML=e;const i=$y.textContent;return i.charCodeAt(i.length-1)===59&&t!=="semi"||i===e?!1:i}function wo(t,e,i,a){const r=t.length;let n=0,o;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,i=i>0?i:0,a.length<1e4)o=Array.from(a),o.unshift(e,i),t.splice(...o);else for(i&&t.splice(e,i);n<a.length;)o=a.slice(n,n+1e4),o.unshift(e,0),t.splice(...o),n+=1e4,e+=1e4}function ir(t,e){return t.length>0?(wo(t,t.length,0,e),t):e}const YF={}.hasOwnProperty;function eW(t){const e={};let i=-1;for(;++i<t.length;)tW(e,t[i]);return e}function tW(t,e){let i;for(i in e){const r=(YF.call(t,i)?t[i]:void 0)||(t[i]={}),n=e[i];let o;if(n)for(o in n){YF.call(r,o)||(r[o]=[]);const s=n[o];iW(r[o],Array.isArray(s)?s:s?[s]:[])}}}function iW(t,e){let i=-1;const a=[];for(;++i<e.length;)(e[i].add==="after"?t:a).push(e[i]);wo(t,0,0,a)}function aW(t){const e={};let i=-1;for(;++i<t.length;)rW(e,t[i]);return e}function rW(t,e){let i;for(i in e){const r=(YF.call(t,i)?t[i]:void 0)||(t[i]={}),n=e[i];let o;if(n)for(o in n)r[o]=n[o]}}function nW(t,e){const i=Number.parseInt(t,e);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}const oW={'"':"quot","&":"amp","<":"lt",">":"gt"};function Wy(t){return t.replace(/["&<>]/g,e);function e(i){return"&"+oW[i]+";"}}function Bd(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Co=Ps(/[A-Za-z]/),Xr=Ps(/[\dA-Za-z]/),sW=Ps(/[#-'*+\--9=?A-Z^-~]/);function ZF(t){return t!==null&&(t<32||t===127)}const JF=Ps(/\d/),lW=Ps(/[\dA-Fa-f]/),uW=Ps(/[!-/:-@[-`{-~]/);function gt(t){return t!==null&&t<-2}function ar(t){return t!==null&&(t<0||t===32)}function Rt(t){return t===-2||t===-1||t===32}const fW=Ps(new RegExp("\\p{P}|\\p{S}","u")),dW=Ps(/\s/);function Ps(t){return e;function e(i){return i!==null&&i>-1&&t.test(String.fromCharCode(i))}}function e_(t,e){const i=Wy(hW(t||""));if(!e)return i;const a=i.indexOf(":"),r=i.indexOf("?"),n=i.indexOf("#"),o=i.indexOf("/");return a<0||o>-1&&a>o||r>-1&&a>r||n>-1&&a>n||e.test(i.slice(0,a))?i:""}function hW(t){const e=[];let i=-1,a=0,r=0;for(;++i<t.length;){const n=t.charCodeAt(i);let o="";if(n===37&&Xr(t.charCodeAt(i+1))&&Xr(t.charCodeAt(i+2)))r=2;else if(n<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(n))||(o=String.fromCharCode(n));else if(n>55295&&n<57344){const s=t.charCodeAt(i+1);n<56320&&s>56319&&s<57344?(o=String.fromCharCode(n,s),r=1):o="�"}else o=String.fromCharCode(n);o&&(e.push(t.slice(a,i),encodeURIComponent(o)),a=i+r+1,o=""),r&&(i+=r,r=0)}return e.join("")+t.slice(a)}const Gy={}.hasOwnProperty,Vy=/^(https?|ircs?|mailto|xmpp)$/i,gW=/^https?$/i;function _W(t){const e=t||{};let i=!0;const a={},r=[[]],n=[],o=[],l=aW([{enter:{blockQuote:P,codeFenced:V,codeFencedFenceInfo:m,codeFencedFenceMeta:m,codeIndented:G,codeText:_e,content:Ve,definition:pe,definitionDestinationString:Ce,definitionLabelString:m,definitionTitleString:m,emphasis:xa,htmlFlow:ji,htmlText:ha,image:Q,label:m,link:te,listItemMarker:L,listItemValue:D,listOrdered:v,listUnordered:E,paragraph:$,reference:m,resource:ae,resourceDestinationString:O,resourceTitleString:m,setextHeading:Ze,strong:Bt},exit:{atxHeading:tt,atxHeadingSequence:Le,autolinkEmail:X,autolinkProtocol:ia,blockQuote:T,characterEscapeValue:Kt,characterReferenceMarkerHexadecimal:qt,characterReferenceMarkerNumeric:qt,characterReferenceValue:si,codeFenced:S,codeFencedFence:B,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:_t,codeIndented:S,codeText:xe,codeTextData:Kt,data:Kt,definition:Be,definitionDestinationString:be,definitionLabelString:ce,definitionTitleString:qe,emphasis:Ge,hardBreakEscape:Xt,hardBreakTrailing:Xt,htmlFlow:Xi,htmlFlowData:Kt,htmlText:Xi,htmlTextData:Kt,image:de,label:Z,labelText:K,lineEnding:ve,link:de,listOrdered:q,listUnordered:R,paragraph:H,reference:x,referenceString:ee,resource:x,resourceDestinationString:se,resourceTitleString:W,setextHeading:Vt,setextHeadingLineSequence:At,setextHeadingText:at,strong:ct,thematicBreak:oi}},...e.htmlExtensions||[]]),u={definitions:a,tightStack:o},f={buffer:m,encode:w,getData:c,lineEndingIfNeeded:b,options:e,raw:C,resume:A,setData:F,tag:p};let d=e.defaultLineEnding;return g;function g(z){let re=-1,he=0;const ke=[];let De=[],Ke=[];for(;++re<z.length;)!d&&(z[re][1].type==="lineEnding"||z[re][1].type==="lineEndingBlank")&&(d=z[re][2].sliceSerialize(z[re][1])),(z[re][1].type==="listOrdered"||z[re][1].type==="listUnordered")&&(z[re][0]==="enter"?ke.push(re):_(z.slice(ke.pop(),re))),z[re][1].type==="definition"&&(z[re][0]==="enter"?(Ke=ir(Ke,z.slice(he,re)),he=re):(De=ir(De,z.slice(he,re+1)),he=re+1));De=ir(De,Ke),De=ir(De,z.slice(he)),re=-1;const Te=De;for(l.enter.null&&l.enter.null.call(f);++re<z.length;){const lt=l[Te[re][0]],He=Te[re][1].type,Je=lt[He];Gy.call(lt,He)&&Je&&Je.call({sliceSerialize:Te[re][2].sliceSerialize,...f},Te[re][1])}return l.exit.null&&l.exit.null.call(f),r[0].join("")}function _(z){const re=z.length;let he=0,ke=0,De=!1,Ke;for(;++he<re;){const Te=z[he];if(Te[1]._container)Ke=void 0,Te[0]==="enter"?ke++:ke--;else switch(Te[1].type){case"listItemPrefix":{Te[0]==="exit"&&(Ke=!0);break}case"linePrefix":break;case"lineEndingBlank":{Te[0]==="enter"&&!ke&&(Ke?Ke=void 0:De=!0);break}default:Ke=void 0}}z[0][1]._loose=De}function F(z,re){u[z]=re}function c(z){return u[z]}function m(){r.push([])}function A(){return r.pop().join("")}function p(z){i&&(F("lastWasTag",!0),r[r.length-1].push(z))}function C(z){F("lastWasTag"),r[r.length-1].push(z)}function k(){C(d||`
|
|
239
239
|
`)}function b(){const z=r[r.length-1],re=z[z.length-1],he=re?re.charCodeAt(re.length-1):null;he===10||he===13||he===null||k()}function w(z){return c("ignoreEncode")?z:Wy(z)}function x(){A()}function v(z){o.push(!z._loose),b(),p("<ol"),F("expectFirstItem",!0)}function E(z){o.push(!z._loose),b(),p("<ul"),F("expectFirstItem",!0)}function D(z){if(c("expectFirstItem")){const re=Number.parseInt(this.sliceSerialize(z),10);re!==1&&p(' start="'+w(String(re))+'"')}}function L(){c("expectFirstItem")?p(">"):I(),b(),p("<li>"),F("expectFirstItem"),F("lastWasTag")}function q(){I(),o.pop(),k(),p("</ol>")}function R(){I(),o.pop(),k(),p("</ul>")}function I(){c("lastWasTag")&&!c("slurpAllLineEndings")&&b(),p("</li>"),F("slurpAllLineEndings")}function P(){o.push(!1),b(),p("<blockquote>")}function T(){o.pop(),b(),p("</blockquote>"),F("slurpAllLineEndings")}function $(){o[o.length-1]||(b(),p("<p>")),F("slurpAllLineEndings")}function H(){o[o.length-1]?F("slurpAllLineEndings",!0):p("</p>")}function V(){b(),p("<pre><code"),F("fencesCount",0)}function y(){const z=A();p(' class="language-'+z+'"')}function B(){const z=c("fencesCount")||0;z||(p(">"),F("slurpOneLineEnding",!0)),F("fencesCount",z+1)}function G(){b(),p("<pre><code>")}function S(){const z=c("fencesCount");z!==void 0&&z<2&&u.tightStack.length>0&&!c("lastWasTag")&&k(),c("flowCodeSeenData")&&b(),p("</code></pre>"),z!==void 0&&z<2&&b(),F("flowCodeSeenData"),F("fencesCount"),F("slurpOneLineEnding")}function Q(){n.push({image:!0}),i=void 0}function te(){n.push({})}function K(z){n[n.length-1].labelId=this.sliceSerialize(z)}function Z(){n[n.length-1].label=A()}function ee(z){n[n.length-1].referenceId=this.sliceSerialize(z)}function ae(){m(),n[n.length-1].destination=""}function O(){m(),F("ignoreEncode",!0)}function se(){n[n.length-1].destination=A(),F("ignoreEncode")}function W(){n[n.length-1].title=A()}function de(){let z=n.length-1;const re=n[z],he=re.referenceId||re.labelId,ke=re.destination===void 0?a[Bd(he)]:re;for(i=!0;z--;)if(n[z].image){i=void 0;break}re.image?(p('<img src="'+e_(ke.destination,e.allowDangerousProtocol?void 0:gW)+'" alt="'),C(re.label),p('"')):p('<a href="'+e_(ke.destination,e.allowDangerousProtocol?void 0:Vy)+'"'),p(ke.title?' title="'+ke.title+'"':""),re.image?p(" />"):(p(">"),C(re.label),p("</a>")),n.pop()}function pe(){m(),n.push({})}function ce(z){A(),n[n.length-1].labelId=this.sliceSerialize(z)}function Ce(){m(),F("ignoreEncode",!0)}function be(){n[n.length-1].destination=A(),F("ignoreEncode")}function qe(){n[n.length-1].title=A()}function Be(){const z=n[n.length-1],re=Bd(z.labelId);A(),Gy.call(a,re)||(a[re]=n[n.length-1]),n.pop()}function Ve(){F("slurpAllLineEndings",!0)}function Le(z){c("headingRank")||(F("headingRank",this.sliceSerialize(z).length),b(),p("<h"+c("headingRank")+">"))}function Ze(){m(),F("slurpAllLineEndings")}function at(){F("slurpAllLineEndings",!0)}function tt(){p("</h"+c("headingRank")+">"),F("headingRank")}function At(z){F("headingRank",this.sliceSerialize(z).charCodeAt(0)===61?1:2)}function Vt(){const z=A();b(),p("<h"+c("headingRank")+">"),C(z),p("</h"+c("headingRank")+">"),F("slurpAllLineEndings"),F("headingRank")}function Kt(z){C(w(this.sliceSerialize(z)))}function ve(z){if(!c("slurpAllLineEndings")){if(c("slurpOneLineEnding")){F("slurpOneLineEnding");return}if(c("inCodeText")){C(" ");return}C(w(this.sliceSerialize(z)))}}function _t(z){C(w(this.sliceSerialize(z))),F("flowCodeSeenData",!0)}function Xt(){p("<br />")}function ji(){b(),ha()}function Xi(){F("ignoreEncode")}function ha(){e.allowDangerousHtml&&F("ignoreEncode",!0)}function xa(){p("<em>")}function Bt(){p("<strong>")}function _e(){F("inCodeText",!0),p("<code>")}function xe(){F("inCodeText"),p("</code>")}function Ge(){p("</em>")}function ct(){p("</strong>")}function oi(){b(),p("<hr />")}function qt(z){F("characterReferenceType",z.type)}function si(z){const re=this.sliceSerialize(z),he=c("characterReferenceType")?nW(re,c("characterReferenceType")==="characterReferenceMarkerNumeric"?10:16):zy(re);C(w(he)),F("characterReferenceType")}function ia(z){const re=this.sliceSerialize(z);p('<a href="'+e_(re,e.allowDangerousProtocol?void 0:Vy)+'">'),C(w(re)),p("</a>")}function X(z){const re=this.sliceSerialize(z);p('<a href="'+e_("mailto:"+re)+'">'),C(w(re)),p("</a>")}}function ri(t,e,i,a){const r=a?a-1:Number.POSITIVE_INFINITY;let n=0;return o;function o(l){return Rt(l)?(t.enter(i),s(l)):e(l)}function s(l){return Rt(l)&&n++<r?(t.consume(l),s):(t.exit(i),e(l))}}const cW={tokenize:FW};function FW(t){const e=t.attempt(this.parser.constructs.contentInitial,a,r);let i;return e;function a(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),ri(t,e,"linePrefix")}function r(s){return t.enter("paragraph"),n(s)}function n(s){const l=t.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=l),i=l,o(s)}function o(s){if(s===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(s);return}return gt(s)?(t.consume(s),t.exit("chunkText"),n):(t.consume(s),o)}}const mW={tokenize:AW},Ky={tokenize:pW};function AW(t){const e=this,i=[];let a=0,r,n,o;return s;function s(C){if(a<i.length){const k=i[a];return e.containerState=k[1],t.attempt(k[0].continuation,l,u)(C)}return u(C)}function l(C){if(a++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&p();const k=e.events.length;let b=k,w;for(;b--;)if(e.events[b][0]==="exit"&&e.events[b][1].type==="chunkFlow"){w=e.events[b][1].end;break}A(a);let x=k;for(;x<e.events.length;)e.events[x][1].end={...w},x++;return wo(e.events,b+1,0,e.events.slice(k)),e.events.length=x,u(C)}return s(C)}function u(C){if(a===i.length){if(!r)return g(C);if(r.currentConstruct&&r.currentConstruct.concrete)return F(C);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Ky,f,d)(C)}function f(C){return r&&p(),A(a),g(C)}function d(C){return e.parser.lazy[e.now().line]=a!==i.length,o=e.now().offset,F(C)}function g(C){return e.containerState={},t.attempt(Ky,_,F)(C)}function _(C){return a++,i.push([e.currentConstruct,e.containerState]),g(C)}function F(C){if(C===null){r&&p(),A(0),t.consume(C);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:n}),c(C)}function c(C){if(C===null){m(t.exit("chunkFlow"),!0),A(0),t.consume(C);return}return gt(C)?(t.consume(C),m(t.exit("chunkFlow")),a=0,e.interrupt=void 0,s):(t.consume(C),c)}function m(C,k){const b=e.sliceStream(C);if(k&&b.push(null),C.previous=n,n&&(n.next=C),n=C,r.defineSkip(C.start),r.write(b),e.parser.lazy[C.start.line]){let w=r.events.length;for(;w--;)if(r.events[w][1].start.offset<o&&(!r.events[w][1].end||r.events[w][1].end.offset>o))return;const x=e.events.length;let v=x,E,D;for(;v--;)if(e.events[v][0]==="exit"&&e.events[v][1].type==="chunkFlow"){if(E){D=e.events[v][1].end;break}E=!0}for(A(a),w=x;w<e.events.length;)e.events[w][1].end={...D},w++;wo(e.events,v+1,0,e.events.slice(x)),e.events.length=w}}function A(C){let k=i.length;for(;k-- >C;){const b=i[k];e.containerState=b[1],b[0].exit.call(e,t)}i.length=C}function p(){r.write([null]),n=void 0,r=void 0,e.containerState._closeFlow=void 0}}function pW(t,e,i){return ri(t,t.attempt(this.parser.constructs.document,e,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xy(t){if(t===null||ar(t)||dW(t))return 1;if(fW(t))return 2}function e4(t,e,i){const a=[];let r=-1;for(;++r<t.length;){const n=t[r].resolveAll;n&&!a.includes(n)&&(e=n(e,i),a.push(n))}return e}const t4={name:"attention",resolveAll:bW,tokenize:yW};function bW(t,e){let i=-1,a,r,n,o,s,l,u,f;for(;++i<t.length;)if(t[i][0]==="enter"&&t[i][1].type==="attentionSequence"&&t[i][1]._close){for(a=i;a--;)if(t[a][0]==="exit"&&t[a][1].type==="attentionSequence"&&t[a][1]._open&&e.sliceSerialize(t[a][1]).charCodeAt(0)===e.sliceSerialize(t[i][1]).charCodeAt(0)){if((t[a][1]._close||t[i][1]._open)&&(t[i][1].end.offset-t[i][1].start.offset)%3&&!((t[a][1].end.offset-t[a][1].start.offset+t[i][1].end.offset-t[i][1].start.offset)%3))continue;l=t[a][1].end.offset-t[a][1].start.offset>1&&t[i][1].end.offset-t[i][1].start.offset>1?2:1;const d={...t[a][1].end},g={...t[i][1].start};Yy(d,-l),Yy(g,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...t[a][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...t[i][1].start},end:g},n={type:l>1?"strongText":"emphasisText",start:{...t[a][1].end},end:{...t[i][1].start}},r={type:l>1?"strong":"emphasis",start:{...o.start},end:{...s.end}},t[a][1].end={...o.start},t[i][1].start={...s.end},u=[],t[a][1].end.offset-t[a][1].start.offset&&(u=ir(u,[["enter",t[a][1],e],["exit",t[a][1],e]])),u=ir(u,[["enter",r,e],["enter",o,e],["exit",o,e],["enter",n,e]]),u=ir(u,e4(e.parser.constructs.insideSpan.null,t.slice(a+1,i),e)),u=ir(u,[["exit",n,e],["enter",s,e],["exit",s,e],["exit",r,e]]),t[i][1].end.offset-t[i][1].start.offset?(f=2,u=ir(u,[["enter",t[i][1],e],["exit",t[i][1],e]])):f=0,wo(t,a-1,i-a+3,u),i=a+u.length-f-2;break}}for(i=-1;++i<t.length;)t[i][1].type==="attentionSequence"&&(t[i][1].type="data");return t}function yW(t,e){const i=this.parser.constructs.attentionMarkers.null,a=this.previous,r=Xy(a);let n;return o;function o(l){return n=l,t.enter("attentionSequence"),s(l)}function s(l){if(l===n)return t.consume(l),s;const u=t.exit("attentionSequence"),f=Xy(l),d=!f||f===2&&r||i.includes(l),g=!r||r===2&&f||i.includes(a);return u._open=!!(n===42?d:d&&(r||!g)),u._close=!!(n===42?g:g&&(f||!d)),e(l)}}function Yy(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const kW={name:"autolink",tokenize:wW};function wW(t,e,i){let a=0;return r;function r(_){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(_),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),n}function n(_){return Co(_)?(t.consume(_),o):_===64?i(_):u(_)}function o(_){return _===43||_===45||_===46||Xr(_)?(a=1,s(_)):u(_)}function s(_){return _===58?(t.consume(_),a=0,l):(_===43||_===45||_===46||Xr(_))&&a++<32?(t.consume(_),s):(a=0,u(_))}function l(_){return _===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(_),t.exit("autolinkMarker"),t.exit("autolink"),e):_===null||_===32||_===60||ZF(_)?i(_):(t.consume(_),l)}function u(_){return _===64?(t.consume(_),f):sW(_)?(t.consume(_),u):i(_)}function f(_){return Xr(_)?d(_):i(_)}function d(_){return _===46?(t.consume(_),a=0,f):_===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(_),t.exit("autolinkMarker"),t.exit("autolink"),e):g(_)}function g(_){if((_===45||Xr(_))&&a++<63){const F=_===45?g:d;return t.consume(_),F}return i(_)}}const t_={partial:!0,tokenize:CW};function CW(t,e,i){return a;function a(n){return Rt(n)?ri(t,r,"linePrefix")(n):r(n)}function r(n){return n===null||gt(n)?e(n):i(n)}}const Zy={continuation:{tokenize:vW},exit:DW,name:"blockQuote",tokenize:xW};function xW(t,e,i){const a=this;return r;function r(o){if(o===62){const s=a.containerState;return s.open||(t.enter("blockQuote",{_container:!0}),s.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),n}return i(o)}function n(o){return Rt(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function vW(t,e,i){const a=this;return r;function r(o){return Rt(o)?ri(t,n,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):n(o)}function n(o){return t.attempt(Zy,e,i)(o)}}function DW(t){t.exit("blockQuote")}const Jy={name:"characterEscape",tokenize:EW};function EW(t,e,i){return a;function a(n){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(n),t.exit("escapeMarker"),r}function r(n){return uW(n)?(t.enter("characterEscapeValue"),t.consume(n),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):i(n)}}const ek={name:"characterReference",tokenize:BW};function BW(t,e,i){const a=this;let r=0,n,o;return s;function s(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),l}function l(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),n=31,o=Xr,f(d))}function u(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),n=6,o=lW,f):(t.enter("characterReferenceValue"),n=7,o=JF,f(d))}function f(d){if(d===59&&r){const g=t.exit("characterReferenceValue");return o===Xr&&!zy(a.sliceSerialize(g))?i(d):(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(d)&&r++<n?(t.consume(d),f):i(d)}}const tk={partial:!0,tokenize:jW},ik={concrete:!0,name:"codeFenced",tokenize:SW};function SW(t,e,i){const a=this,r={partial:!0,tokenize:b};let n=0,o=0,s;return l;function l(w){return u(w)}function u(w){const x=a.events[a.events.length-1];return n=x&&x[1].type==="linePrefix"?x[2].sliceSerialize(x[1],!0).length:0,s=w,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),f(w)}function f(w){return w===s?(o++,t.consume(w),f):o<3?i(w):(t.exit("codeFencedFenceSequence"),Rt(w)?ri(t,d,"whitespace")(w):d(w))}function d(w){return w===null||gt(w)?(t.exit("codeFencedFence"),a.interrupt?e(w):t.check(tk,c,k)(w)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||gt(w)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),d(w)):Rt(w)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ri(t,_,"whitespace")(w)):w===96&&w===s?i(w):(t.consume(w),g)}function _(w){return w===null||gt(w)?d(w):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),F(w))}function F(w){return w===null||gt(w)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),d(w)):w===96&&w===s?i(w):(t.consume(w),F)}function c(w){return t.attempt(r,k,m)(w)}function m(w){return t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),A}function A(w){return n>0&&Rt(w)?ri(t,p,"linePrefix",n+1)(w):p(w)}function p(w){return w===null||gt(w)?t.check(tk,c,k)(w):(t.enter("codeFlowValue"),C(w))}function C(w){return w===null||gt(w)?(t.exit("codeFlowValue"),p(w)):(t.consume(w),C)}function k(w){return t.exit("codeFenced"),e(w)}function b(w,x,v){let E=0;return D;function D(P){return w.enter("lineEnding"),w.consume(P),w.exit("lineEnding"),L}function L(P){return w.enter("codeFencedFence"),Rt(P)?ri(w,q,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):q(P)}function q(P){return P===s?(w.enter("codeFencedFenceSequence"),R(P)):v(P)}function R(P){return P===s?(E++,w.consume(P),R):E>=o?(w.exit("codeFencedFenceSequence"),Rt(P)?ri(w,I,"whitespace")(P):I(P)):v(P)}function I(P){return P===null||gt(P)?(w.exit("codeFencedFence"),x(P)):v(P)}}}function jW(t,e,i){const a=this;return r;function r(o){return o===null?i(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),n)}function n(o){return a.parser.lazy[a.now().line]?i(o):e(o)}}const i4={name:"codeIndented",tokenize:MW},LW={partial:!0,tokenize:OW};function MW(t,e,i){const a=this;return r;function r(u){return t.enter("codeIndented"),ri(t,n,"linePrefix",5)(u)}function n(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?o(u):i(u)}function o(u){return u===null?l(u):gt(u)?t.attempt(LW,o,l)(u):(t.enter("codeFlowValue"),s(u))}function s(u){return u===null||gt(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),s)}function l(u){return t.exit("codeIndented"),e(u)}}function OW(t,e,i){const a=this;return r;function r(o){return a.parser.lazy[a.now().line]?i(o):gt(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r):ri(t,n,"linePrefix",5)(o)}function n(o){const s=a.events[a.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(o):gt(o)?r(o):i(o)}}const TW={name:"codeText",previous:IW,resolve:qW,tokenize:PW};function qW(t){let e=t.length-4,i=3,a,r;if((t[i][1].type==="lineEnding"||t[i][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(a=i;++a<e;)if(t[a][1].type==="codeTextData"){t[i][1].type="codeTextPadding",t[e][1].type="codeTextPadding",i+=2,e-=2;break}}for(a=i-1,e++;++a<=e;)r===void 0?a!==e&&t[a][1].type!=="lineEnding"&&(r=a):(a===e||t[a][1].type==="lineEnding")&&(t[r][1].type="codeTextData",a!==r+2&&(t[r][1].end=t[a-1][1].end,t.splice(r+2,a-r-2),e-=a-r-2,a=r+2),r=void 0);return t}function IW(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function PW(t,e,i){let a=0,r,n;return o;function o(d){return t.enter("codeText"),t.enter("codeTextSequence"),s(d)}function s(d){return d===96?(t.consume(d),a++,s):(t.exit("codeTextSequence"),l(d))}function l(d){return d===null?i(d):d===32?(t.enter("space"),t.consume(d),t.exit("space"),l):d===96?(n=t.enter("codeTextSequence"),r=0,f(d)):gt(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),l):(t.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||gt(d)?(t.exit("codeTextData"),l(d)):(t.consume(d),u)}function f(d){return d===96?(t.consume(d),r++,f):r===a?(t.exit("codeTextSequence"),t.exit("codeText"),e(d)):(n.type="codeTextData",u(d))}}class HW{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,i){const a=i??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(e,a):e>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(e,i,a){const r=i||0;this.setCursor(Math.trunc(e));const n=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return a&&Sd(this.left,a),n.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Sd(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Sd(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const i=this.left.splice(e,Number.POSITIVE_INFINITY);Sd(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Sd(this.left,i.reverse())}}}function Sd(t,e){let i=0;if(e.length<1e4)t.push(...e);else for(;i<e.length;)t.push(...e.slice(i,i+1e4)),i+=1e4}function ak(t){const e={};let i=-1,a,r,n,o,s,l,u;const f=new HW(t);for(;++i<f.length;){for(;i in e;)i=e[i];if(a=f.get(i),i&&a[1].type==="chunkFlow"&&f.get(i-1)[1].type==="listItemPrefix"&&(l=a[1]._tokenizer.events,n=0,n<l.length&&l[n][1].type==="lineEndingBlank"&&(n+=2),n<l.length&&l[n][1].type==="content"))for(;++n<l.length&&l[n][1].type!=="content";)l[n][1].type==="chunkText"&&(l[n][1]._isInFirstContentOfListItem=!0,n++);if(a[0]==="enter")a[1].contentType&&(Object.assign(e,UW(f,i)),i=e[i],u=!0);else if(a[1]._container){for(n=i,r=void 0;n--;)if(o=f.get(n),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(r&&(f.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=n);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;r&&(a[1].end={...f.get(r)[1].start},s=f.slice(r,i),s.unshift(a),f.splice(r,i-r+1,s))}}return wo(t,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function UW(t,e){const i=t.get(e)[1],a=t.get(e)[2];let r=e-1;const n=[];let o=i._tokenizer;o||(o=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const s=o.events,l=[],u={};let f,d,g=-1,_=i,F=0,c=0;const m=[c];for(;_;){for(;t.get(++r)[1]!==_;);n.push(r),_._tokenizer||(f=a.sliceStream(_),_.next||f.push(null),d&&o.defineSkip(_.start),_._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(f),_._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=_,_=_.next}for(_=i;++g<s.length;)s[g][0]==="exit"&&s[g-1][0]==="enter"&&s[g][1].type===s[g-1][1].type&&s[g][1].start.line!==s[g][1].end.line&&(c=g+1,m.push(c),_._tokenizer=void 0,_.previous=void 0,_=_.next);for(o.events=[],_?(_._tokenizer=void 0,_.previous=void 0):m.pop(),g=m.length;g--;){const A=s.slice(m[g],m[g+1]),p=n.pop();l.push([p,p+A.length-1]),t.splice(p,2,A)}for(l.reverse(),g=-1;++g<l.length;)u[F+l[g][0]]=F+l[g][1],F+=l[g][1]-l[g][0]-1;return u}const RW={resolve:QW,tokenize:$W},NW={partial:!0,tokenize:zW};function QW(t){return ak(t),t}function $W(t,e){let i;return a;function a(s){return t.enter("content"),i=t.enter("chunkContent",{contentType:"content"}),r(s)}function r(s){return s===null?n(s):gt(s)?t.check(NW,o,n)(s):(t.consume(s),r)}function n(s){return t.exit("chunkContent"),t.exit("content"),e(s)}function o(s){return t.consume(s),t.exit("chunkContent"),i.next=t.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,r}}function zW(t,e,i){const a=this;return r;function r(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),ri(t,n,"linePrefix")}function n(o){if(o===null||gt(o))return i(o);const s=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(o):t.interrupt(a.parser.constructs.flow,i,e)(o)}}function rk(t,e,i,a,r,n,o,s,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return d;function d(A){return A===60?(t.enter(a),t.enter(r),t.enter(n),t.consume(A),t.exit(n),g):A===null||A===32||A===41||ZF(A)?i(A):(t.enter(a),t.enter(o),t.enter(s),t.enter("chunkString",{contentType:"string"}),c(A))}function g(A){return A===62?(t.enter(n),t.consume(A),t.exit(n),t.exit(r),t.exit(a),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),_(A))}function _(A){return A===62?(t.exit("chunkString"),t.exit(s),g(A)):A===null||A===60||gt(A)?i(A):(t.consume(A),A===92?F:_)}function F(A){return A===60||A===62||A===92?(t.consume(A),_):_(A)}function c(A){return!f&&(A===null||A===41||ar(A))?(t.exit("chunkString"),t.exit(s),t.exit(o),t.exit(a),e(A)):f<u&&A===40?(t.consume(A),f++,c):A===41?(t.consume(A),f--,c):A===null||A===32||A===40||ZF(A)?i(A):(t.consume(A),A===92?m:c)}function m(A){return A===40||A===41||A===92?(t.consume(A),c):c(A)}}function nk(t,e,i,a,r,n){const o=this;let s=0,l;return u;function u(_){return t.enter(a),t.enter(r),t.consume(_),t.exit(r),t.enter(n),f}function f(_){return s>999||_===null||_===91||_===93&&!l||_===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?i(_):_===93?(t.exit(n),t.enter(r),t.consume(_),t.exit(r),t.exit(a),e):gt(_)?(t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),f):(t.enter("chunkString",{contentType:"string"}),d(_))}function d(_){return _===null||_===91||_===93||gt(_)||s++>999?(t.exit("chunkString"),f(_)):(t.consume(_),l||(l=!Rt(_)),_===92?g:d)}function g(_){return _===91||_===92||_===93?(t.consume(_),s++,d):d(_)}}function ok(t,e,i,a,r,n){let o;return s;function s(g){return g===34||g===39||g===40?(t.enter(a),t.enter(r),t.consume(g),t.exit(r),o=g===40?41:g,l):i(g)}function l(g){return g===o?(t.enter(r),t.consume(g),t.exit(r),t.exit(a),e):(t.enter(n),u(g))}function u(g){return g===o?(t.exit(n),l(o)):g===null?i(g):gt(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),ri(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===o||g===null||gt(g)?(t.exit("chunkString"),u(g)):(t.consume(g),g===92?d:f)}function d(g){return g===o||g===92?(t.consume(g),f):f(g)}}function jd(t,e){let i;return a;function a(r){return gt(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),i=!0,a):Rt(r)?ri(t,a,i?"linePrefix":"lineSuffix")(r):e(r)}}const WW={name:"definition",tokenize:VW},GW={partial:!0,tokenize:KW};function VW(t,e,i){const a=this;let r;return n;function n(_){return t.enter("definition"),o(_)}function o(_){return nk.call(a,t,s,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(_)}function s(_){return r=Bd(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),_===58?(t.enter("definitionMarker"),t.consume(_),t.exit("definitionMarker"),l):i(_)}function l(_){return ar(_)?jd(t,u)(_):u(_)}function u(_){return rk(t,f,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(_)}function f(_){return t.attempt(GW,d,d)(_)}function d(_){return Rt(_)?ri(t,g,"whitespace")(_):g(_)}function g(_){return _===null||gt(_)?(t.exit("definition"),a.parser.defined.push(r),e(_)):i(_)}}function KW(t,e,i){return a;function a(s){return ar(s)?jd(t,r)(s):i(s)}function r(s){return ok(t,n,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function n(s){return Rt(s)?ri(t,o,"whitespace")(s):o(s)}function o(s){return s===null||gt(s)?e(s):i(s)}}const XW={name:"hardBreakEscape",tokenize:YW};function YW(t,e,i){return a;function a(n){return t.enter("hardBreakEscape"),t.consume(n),r}function r(n){return gt(n)?(t.exit("hardBreakEscape"),e(n)):i(n)}}const ZW={name:"headingAtx",resolve:JW,tokenize:eG};function JW(t,e){let i=t.length-2,a=3,r,n;return t[a][1].type==="whitespace"&&(a+=2),i-2>a&&t[i][1].type==="whitespace"&&(i-=2),t[i][1].type==="atxHeadingSequence"&&(a===i-1||i-4>a&&t[i-2][1].type==="whitespace")&&(i-=a+1===i?2:4),i>a&&(r={type:"atxHeadingText",start:t[a][1].start,end:t[i][1].end},n={type:"chunkText",start:t[a][1].start,end:t[i][1].end,contentType:"text"},wo(t,a,i-a+1,[["enter",r,e],["enter",n,e],["exit",n,e],["exit",r,e]])),t}function eG(t,e,i){let a=0;return r;function r(f){return t.enter("atxHeading"),n(f)}function n(f){return t.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&a++<6?(t.consume(f),o):f===null||ar(f)?(t.exit("atxHeadingSequence"),s(f)):i(f)}function s(f){return f===35?(t.enter("atxHeadingSequence"),l(f)):f===null||gt(f)?(t.exit("atxHeading"),e(f)):Rt(f)?ri(t,s,"whitespace")(f):(t.enter("atxHeadingText"),u(f))}function l(f){return f===35?(t.consume(f),l):(t.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||ar(f)?(t.exit("atxHeadingText"),s(f)):(t.consume(f),u)}}const tG=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],sk=["pre","script","style","textarea"],iG={concrete:!0,name:"htmlFlow",resolveTo:nG,tokenize:oG},aG={partial:!0,tokenize:lG},rG={partial:!0,tokenize:sG};function nG(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function oG(t,e,i){const a=this;let r,n,o,s,l;return u;function u(S){return f(S)}function f(S){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(S),d}function d(S){return S===33?(t.consume(S),g):S===47?(t.consume(S),n=!0,c):S===63?(t.consume(S),r=3,a.interrupt?e:y):Co(S)?(t.consume(S),o=String.fromCharCode(S),m):i(S)}function g(S){return S===45?(t.consume(S),r=2,_):S===91?(t.consume(S),r=5,s=0,F):Co(S)?(t.consume(S),r=4,a.interrupt?e:y):i(S)}function _(S){return S===45?(t.consume(S),a.interrupt?e:y):i(S)}function F(S){const Q="CDATA[";return S===Q.charCodeAt(s++)?(t.consume(S),s===Q.length?a.interrupt?e:q:F):i(S)}function c(S){return Co(S)?(t.consume(S),o=String.fromCharCode(S),m):i(S)}function m(S){if(S===null||S===47||S===62||ar(S)){const Q=S===47,te=o.toLowerCase();return!Q&&!n&&sk.includes(te)?(r=1,a.interrupt?e(S):q(S)):tG.includes(o.toLowerCase())?(r=6,Q?(t.consume(S),A):a.interrupt?e(S):q(S)):(r=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(S):n?p(S):C(S))}return S===45||Xr(S)?(t.consume(S),o+=String.fromCharCode(S),m):i(S)}function A(S){return S===62?(t.consume(S),a.interrupt?e:q):i(S)}function p(S){return Rt(S)?(t.consume(S),p):D(S)}function C(S){return S===47?(t.consume(S),D):S===58||S===95||Co(S)?(t.consume(S),k):Rt(S)?(t.consume(S),C):D(S)}function k(S){return S===45||S===46||S===58||S===95||Xr(S)?(t.consume(S),k):b(S)}function b(S){return S===61?(t.consume(S),w):Rt(S)?(t.consume(S),b):C(S)}function w(S){return S===null||S===60||S===61||S===62||S===96?i(S):S===34||S===39?(t.consume(S),l=S,x):Rt(S)?(t.consume(S),w):v(S)}function x(S){return S===l?(t.consume(S),l=null,E):S===null||gt(S)?i(S):(t.consume(S),x)}function v(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||ar(S)?b(S):(t.consume(S),v)}function E(S){return S===47||S===62||Rt(S)?C(S):i(S)}function D(S){return S===62?(t.consume(S),L):i(S)}function L(S){return S===null||gt(S)?q(S):Rt(S)?(t.consume(S),L):i(S)}function q(S){return S===45&&r===2?(t.consume(S),T):S===60&&r===1?(t.consume(S),$):S===62&&r===4?(t.consume(S),B):S===63&&r===3?(t.consume(S),y):S===93&&r===5?(t.consume(S),V):gt(S)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(aG,G,R)(S)):S===null||gt(S)?(t.exit("htmlFlowData"),R(S)):(t.consume(S),q)}function R(S){return t.check(rG,I,G)(S)}function I(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),P}function P(S){return S===null||gt(S)?R(S):(t.enter("htmlFlowData"),q(S))}function T(S){return S===45?(t.consume(S),y):q(S)}function $(S){return S===47?(t.consume(S),o="",H):q(S)}function H(S){if(S===62){const Q=o.toLowerCase();return sk.includes(Q)?(t.consume(S),B):q(S)}return Co(S)&&o.length<8?(t.consume(S),o+=String.fromCharCode(S),H):q(S)}function V(S){return S===93?(t.consume(S),y):q(S)}function y(S){return S===62?(t.consume(S),B):S===45&&r===2?(t.consume(S),y):q(S)}function B(S){return S===null||gt(S)?(t.exit("htmlFlowData"),G(S)):(t.consume(S),B)}function G(S){return t.exit("htmlFlow"),e(S)}}function sG(t,e,i){const a=this;return r;function r(o){return gt(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),n):i(o)}function n(o){return a.parser.lazy[a.now().line]?i(o):e(o)}}function lG(t,e,i){return a;function a(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(t_,e,i)}}const uG={name:"htmlText",tokenize:fG};function fG(t,e,i){const a=this;let r,n,o;return s;function s(y){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(y),l}function l(y){return y===33?(t.consume(y),u):y===47?(t.consume(y),b):y===63?(t.consume(y),C):Co(y)?(t.consume(y),v):i(y)}function u(y){return y===45?(t.consume(y),f):y===91?(t.consume(y),n=0,F):Co(y)?(t.consume(y),p):i(y)}function f(y){return y===45?(t.consume(y),_):i(y)}function d(y){return y===null?i(y):y===45?(t.consume(y),g):gt(y)?(o=d,$(y)):(t.consume(y),d)}function g(y){return y===45?(t.consume(y),_):d(y)}function _(y){return y===62?T(y):y===45?g(y):d(y)}function F(y){const B="CDATA[";return y===B.charCodeAt(n++)?(t.consume(y),n===B.length?c:F):i(y)}function c(y){return y===null?i(y):y===93?(t.consume(y),m):gt(y)?(o=c,$(y)):(t.consume(y),c)}function m(y){return y===93?(t.consume(y),A):c(y)}function A(y){return y===62?T(y):y===93?(t.consume(y),A):c(y)}function p(y){return y===null||y===62?T(y):gt(y)?(o=p,$(y)):(t.consume(y),p)}function C(y){return y===null?i(y):y===63?(t.consume(y),k):gt(y)?(o=C,$(y)):(t.consume(y),C)}function k(y){return y===62?T(y):C(y)}function b(y){return Co(y)?(t.consume(y),w):i(y)}function w(y){return y===45||Xr(y)?(t.consume(y),w):x(y)}function x(y){return gt(y)?(o=x,$(y)):Rt(y)?(t.consume(y),x):T(y)}function v(y){return y===45||Xr(y)?(t.consume(y),v):y===47||y===62||ar(y)?E(y):i(y)}function E(y){return y===47?(t.consume(y),T):y===58||y===95||Co(y)?(t.consume(y),D):gt(y)?(o=E,$(y)):Rt(y)?(t.consume(y),E):T(y)}function D(y){return y===45||y===46||y===58||y===95||Xr(y)?(t.consume(y),D):L(y)}function L(y){return y===61?(t.consume(y),q):gt(y)?(o=L,$(y)):Rt(y)?(t.consume(y),L):E(y)}function q(y){return y===null||y===60||y===61||y===62||y===96?i(y):y===34||y===39?(t.consume(y),r=y,R):gt(y)?(o=q,$(y)):Rt(y)?(t.consume(y),q):(t.consume(y),I)}function R(y){return y===r?(t.consume(y),r=void 0,P):y===null?i(y):gt(y)?(o=R,$(y)):(t.consume(y),R)}function I(y){return y===null||y===34||y===39||y===60||y===61||y===96?i(y):y===47||y===62||ar(y)?E(y):(t.consume(y),I)}function P(y){return y===47||y===62||ar(y)?E(y):i(y)}function T(y){return y===62?(t.consume(y),t.exit("htmlTextData"),t.exit("htmlText"),e):i(y)}function $(y){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),H}function H(y){return Rt(y)?ri(t,V,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):V(y)}function V(y){return t.enter("htmlTextData"),o(y)}}const a4={name:"labelEnd",resolveAll:_G,resolveTo:cG,tokenize:FG},dG={tokenize:mG},hG={tokenize:AG},gG={tokenize:pG};function _G(t){let e=-1;const i=[];for(;++e<t.length;){const a=t[e][1];if(i.push(t[e]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const r=a.type==="labelImage"?4:2;a.type="data",e+=r}}return t.length!==i.length&&wo(t,0,t.length,i),t}function cG(t,e){let i=t.length,a=0,r,n,o,s;for(;i--;)if(r=t[i][1],n){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;t[i][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(o){if(t[i][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(n=i,r.type!=="labelLink")){a=2;break}}else r.type==="labelEnd"&&(o=i);const l={type:t[n][1].type==="labelLink"?"link":"image",start:{...t[n][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[n][1].start},end:{...t[o][1].end}},f={type:"labelText",start:{...t[n+a+2][1].end},end:{...t[o-2][1].start}};return s=[["enter",l,e],["enter",u,e]],s=ir(s,t.slice(n+1,n+a+3)),s=ir(s,[["enter",f,e]]),s=ir(s,e4(e.parser.constructs.insideSpan.null,t.slice(n+a+4,o-3),e)),s=ir(s,[["exit",f,e],t[o-2],t[o-1],["exit",u,e]]),s=ir(s,t.slice(o+1)),s=ir(s,[["exit",l,e]]),wo(t,n,t.length,s),t}function FG(t,e,i){const a=this;let r=a.events.length,n,o;for(;r--;)if((a.events[r][1].type==="labelImage"||a.events[r][1].type==="labelLink")&&!a.events[r][1]._balanced){n=a.events[r][1];break}return s;function s(g){return n?n._inactive?d(g):(o=a.parser.defined.includes(Bd(a.sliceSerialize({start:n.end,end:a.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),l):i(g)}function l(g){return g===40?t.attempt(dG,f,o?f:d)(g):g===91?t.attempt(hG,f,o?u:d)(g):o?f(g):d(g)}function u(g){return t.attempt(gG,f,d)(g)}function f(g){return e(g)}function d(g){return n._balanced=!0,i(g)}}function mG(t,e,i){return a;function a(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),r}function r(d){return ar(d)?jd(t,n)(d):n(d)}function n(d){return d===41?f(d):rk(t,o,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return ar(d)?jd(t,l)(d):f(d)}function s(d){return i(d)}function l(d){return d===34||d===39||d===40?ok(t,u,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function u(d){return ar(d)?jd(t,f)(d):f(d)}function f(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):i(d)}}function AG(t,e,i){const a=this;return r;function r(s){return nk.call(a,t,n,o,"reference","referenceMarker","referenceString")(s)}function n(s){return a.parser.defined.includes(Bd(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?e(s):i(s)}function o(s){return i(s)}}function pG(t,e,i){return a;function a(n){return t.enter("reference"),t.enter("referenceMarker"),t.consume(n),t.exit("referenceMarker"),r}function r(n){return n===93?(t.enter("referenceMarker"),t.consume(n),t.exit("referenceMarker"),t.exit("reference"),e):i(n)}}const bG={name:"labelStartImage",resolveAll:a4.resolveAll,tokenize:yG};function yG(t,e,i){const a=this;return r;function r(s){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(s),t.exit("labelImageMarker"),n}function n(s){return s===91?(t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelImage"),o):i(s)}function o(s){return s===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(s):e(s)}}const kG={name:"labelStartLink",resolveAll:a4.resolveAll,tokenize:wG};function wG(t,e,i){const a=this;return r;function r(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),n}function n(o){return o===94&&"_hiddenFootnoteSupport"in a.parser.constructs?i(o):e(o)}}const r4={name:"lineEnding",tokenize:CG};function CG(t,e){return i;function i(a){return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ri(t,e,"linePrefix")}}const i_={name:"thematicBreak",tokenize:xG};function xG(t,e,i){let a=0,r;return n;function n(u){return t.enter("thematicBreak"),o(u)}function o(u){return r=u,s(u)}function s(u){return u===r?(t.enter("thematicBreakSequence"),l(u)):a>=3&&(u===null||gt(u))?(t.exit("thematicBreak"),e(u)):i(u)}function l(u){return u===r?(t.consume(u),a++,l):(t.exit("thematicBreakSequence"),Rt(u)?ri(t,s,"whitespace")(u):s(u))}}const Dr={continuation:{tokenize:BG},exit:jG,name:"list",tokenize:EG},vG={partial:!0,tokenize:LG},DG={partial:!0,tokenize:SG};function EG(t,e,i){const a=this,r=a.events[a.events.length-1];let n=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return s;function s(_){const F=a.containerState.type||(_===42||_===43||_===45?"listUnordered":"listOrdered");if(F==="listUnordered"?!a.containerState.marker||_===a.containerState.marker:JF(_)){if(a.containerState.type||(a.containerState.type=F,t.enter(F,{_container:!0})),F==="listUnordered")return t.enter("listItemPrefix"),_===42||_===45?t.check(i_,i,u)(_):u(_);if(!a.interrupt||_===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(_)}return i(_)}function l(_){return JF(_)&&++o<10?(t.consume(_),l):(!a.interrupt||o<2)&&(a.containerState.marker?_===a.containerState.marker:_===41||_===46)?(t.exit("listItemValue"),u(_)):i(_)}function u(_){return t.enter("listItemMarker"),t.consume(_),t.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||_,t.check(t_,a.interrupt?i:f,t.attempt(vG,g,d))}function f(_){return a.containerState.initialBlankLine=!0,n++,g(_)}function d(_){return Rt(_)?(t.enter("listItemPrefixWhitespace"),t.consume(_),t.exit("listItemPrefixWhitespace"),g):i(_)}function g(_){return a.containerState.size=n+a.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(_)}}function BG(t,e,i){const a=this;return a.containerState._closeFlow=void 0,t.check(t_,r,n);function r(s){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ri(t,e,"listItemIndent",a.containerState.size+1)(s)}function n(s){return a.containerState.furtherBlankLines||!Rt(s)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,o(s)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,t.attempt(DG,e,o)(s))}function o(s){return a.containerState._closeFlow=!0,a.interrupt=void 0,ri(t,t.attempt(Dr,e,i),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function SG(t,e,i){const a=this;return ri(t,r,"listItemIndent",a.containerState.size+1);function r(n){const o=a.events[a.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===a.containerState.size?e(n):i(n)}}function jG(t){t.exit(this.containerState.type)}function LG(t,e,i){const a=this;return ri(t,r,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(n){const o=a.events[a.events.length-1];return!Rt(n)&&o&&o[1].type==="listItemPrefixWhitespace"?e(n):i(n)}}const lk={name:"setextUnderline",resolveTo:MG,tokenize:OG};function MG(t,e){let i=t.length,a,r,n;for(;i--;)if(t[i][0]==="enter"){if(t[i][1].type==="content"){a=i;break}t[i][1].type==="paragraph"&&(r=i)}else t[i][1].type==="content"&&t.splice(i,1),!n&&t[i][1].type==="definition"&&(n=i);const o={type:"setextHeading",start:{...t[a][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",n?(t.splice(r,0,["enter",o,e]),t.splice(n+1,0,["exit",t[a][1],e]),t[a][1].end={...t[n][1].end}):t[a][1]=o,t.push(["exit",o,e]),t}function OG(t,e,i){const a=this;let r;return n;function n(u){let f=a.events.length,d;for(;f--;)if(a.events[f][1].type!=="lineEnding"&&a.events[f][1].type!=="linePrefix"&&a.events[f][1].type!=="content"){d=a.events[f][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||d)?(t.enter("setextHeadingLine"),r=u,o(u)):i(u)}function o(u){return t.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===r?(t.consume(u),s):(t.exit("setextHeadingLineSequence"),Rt(u)?ri(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||gt(u)?(t.exit("setextHeadingLine"),e(u)):i(u)}}const TG={tokenize:qG};function qG(t){const e=this,i=t.attempt(t_,a,t.attempt(this.parser.constructs.flowInitial,r,ri(t,t.attempt(this.parser.constructs.flow,r,t.attempt(RW,r)),"linePrefix")));return i;function a(n){if(n===null){t.consume(n);return}return t.enter("lineEndingBlank"),t.consume(n),t.exit("lineEndingBlank"),e.currentConstruct=void 0,i}function r(n){if(n===null){t.consume(n);return}return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),e.currentConstruct=void 0,i}}const IG={resolveAll:fk()},PG=uk("string"),HG=uk("text");function uk(t){return{resolveAll:fk(t==="text"?UG:void 0),tokenize:e};function e(i){const a=this,r=this.parser.constructs[t],n=i.attempt(r,o,s);return o;function o(f){return u(f)?n(f):s(f)}function s(f){if(f===null){i.consume(f);return}return i.enter("data"),i.consume(f),l}function l(f){return u(f)?(i.exit("data"),n(f)):(i.consume(f),l)}function u(f){if(f===null)return!0;const d=r[f];let g=-1;if(d)for(;++g<d.length;){const _=d[g];if(!_.previous||_.previous.call(a,a.previous))return!0}return!1}}}function fk(t){return e;function e(i,a){let r=-1,n;for(;++r<=i.length;)n===void 0?i[r]&&i[r][1].type==="data"&&(n=r,r++):(!i[r]||i[r][1].type!=="data")&&(r!==n+2&&(i[n][1].end=i[r-1][1].end,i.splice(n+2,r-n-2),r=n+2),n=void 0);return t?t(i,a):i}}function UG(t,e){let i=0;for(;++i<=t.length;)if((i===t.length||t[i][1].type==="lineEnding")&&t[i-1][1].type==="data"){const a=t[i-1][1],r=e.sliceStream(a);let n=r.length,o=-1,s=0,l;for(;n--;){const u=r[n];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(u===-2)l=!0,s++;else if(u!==-1){n++;break}}if(e._contentTypeTextTrailing&&i===t.length&&(s=0),s){const u={type:i===t.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:n?o:a.start._bufferIndex+o,_index:a.start._index+n,line:a.end.line,column:a.end.column-s,offset:a.end.offset-s},end:{...a.end}};a.end={...u.start},a.start.offset===a.end.offset?Object.assign(a,u):(t.splice(i,0,["enter",u,e],["exit",u,e]),i+=2)}i++}return t}const RG=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:WW},disable:{null:[]},document:{42:Dr,43:Dr,45:Dr,48:Dr,49:Dr,50:Dr,51:Dr,52:Dr,53:Dr,54:Dr,55:Dr,56:Dr,57:Dr,62:Zy},flow:{35:ZW,42:i_,45:[lk,i_],60:iG,61:lk,95:i_,96:ik,126:ik},flowInitial:{[-2]:i4,[-1]:i4,32:i4},insideSpan:{null:[t4,IG]},string:{38:ek,92:Jy},text:{[-5]:r4,[-4]:r4,[-3]:r4,33:bG,38:ek,42:t4,60:[kW,uG],91:kG,92:[XW,Jy],93:a4,95:t4,96:TW}},Symbol.toStringTag,{value:"Module"}));function NG(t,e,i){let a={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const r={},n=[];let o=[],s=[];const l={attempt:x(b),check:x(w),consume:p,enter:C,exit:k,interrupt:x(w,{interrupt:!0})},u={code:null,containerState:{},defineSkip:c,events:[],now:F,parser:t,previous:null,sliceSerialize:g,sliceStream:_,write:d};let f=e.tokenize.call(u,l);return e.resolveAll&&n.push(e),u;function d(L){return o=ir(o,L),m(),o[o.length-1]!==null?[]:(v(e,0),u.events=e4(n,u.events,u),u.events)}function g(L,q){return $G(_(L),q)}function _(L){return QG(o,L)}function F(){const{_bufferIndex:L,_index:q,line:R,column:I,offset:P}=a;return{_bufferIndex:L,_index:q,line:R,column:I,offset:P}}function c(L){r[L.line]=L.column,D()}function m(){let L;for(;a._index<o.length;){const q=o[a._index];if(typeof q=="string")for(L=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===L&&a._bufferIndex<q.length;)A(q.charCodeAt(a._bufferIndex));else A(q)}}function A(L){f=f(L)}function p(L){gt(L)?(a.line++,a.column=1,a.offset+=L===-3?2:1,D()):L!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===o[a._index].length&&(a._bufferIndex=-1,a._index++)),u.previous=L}function C(L,q){const R=q||{};return R.type=L,R.start=F(),u.events.push(["enter",R,u]),s.push(R),R}function k(L){const q=s.pop();return q.end=F(),u.events.push(["exit",q,u]),q}function b(L,q){v(L,q.from)}function w(L,q){q.restore()}function x(L,q){return R;function R(I,P,T){let $,H,V,y;return Array.isArray(I)?G(I):"tokenize"in I?G([I]):B(I);function B(K){return Z;function Z(ee){const ae=ee!==null&&K[ee],O=ee!==null&&K.null,se=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(O)?O:O?[O]:[]];return G(se)(ee)}}function G(K){return $=K,H=0,K.length===0?T:S(K[H])}function S(K){return Z;function Z(ee){return y=E(),V=K,K.partial||(u.currentConstruct=K),K.name&&u.parser.constructs.disable.null.includes(K.name)?te():K.tokenize.call(q?Object.assign(Object.create(u),q):u,l,Q,te)(ee)}}function Q(K){return L(V,y),P}function te(K){return y.restore(),++H<$.length?S($[H]):T}}}function v(L,q){L.resolveAll&&!n.includes(L)&&n.push(L),L.resolve&&wo(u.events,q,u.events.length-q,L.resolve(u.events.slice(q),u)),L.resolveTo&&(u.events=L.resolveTo(u.events,u))}function E(){const L=F(),q=u.previous,R=u.currentConstruct,I=u.events.length,P=Array.from(s);return{from:I,restore:T};function T(){a=L,u.previous=q,u.currentConstruct=R,u.events.length=I,s=P,D()}}function D(){a.line in r&&a.column<2&&(a.column=r[a.line],a.offset+=r[a.line]-1)}}function QG(t,e){const i=e.start._index,a=e.start._bufferIndex,r=e.end._index,n=e.end._bufferIndex;let o;if(i===r)o=[t[i].slice(a,n)];else{if(o=t.slice(i,r),a>-1){const s=o[0];typeof s=="string"?o[0]=s.slice(a):o.shift()}n>0&&o.push(t[r].slice(0,n))}return o}function $G(t,e){let i=-1;const a=[];let r;for(;++i<t.length;){const n=t[i];let o;if(typeof n=="string")o=n;else switch(n){case-5:{o="\r";break}case-4:{o=`
|
|
240
240
|
`;break}case-3:{o=`\r
|
|
241
241
|
`;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&r)continue;o=" ";break}default:o=String.fromCharCode(n)}r=n===-2,a.push(o)}return a.join("")}function zG(t){const a={constructs:eW([RG,...(t||{}).extensions||[]]),content:r(cW),defined:[],document:r(mW),flow:r(TG),lazy:{},string:r(PG),text:r(HG)};return a;function r(n){return o;function o(s){return NG(a,n,s)}}}function WG(t){for(;!ak(t););return t}const dk=/[\0\t\n\r]/g;function GG(){let t=1,e="",i=!0,a;return r;function r(n,o,s){const l=[];let u,f,d,g,_;for(n=e+(typeof n=="string"?n.toString():new TextDecoder(o||void 0).decode(n)),d=0,e="",i&&(n.charCodeAt(0)===65279&&d++,i=void 0);d<n.length;){if(dk.lastIndex=d,u=dk.exec(n),g=u&&u.index!==void 0?u.index:n.length,_=n.charCodeAt(g),!u){e=n.slice(d);break}if(_===10&&d===g&&a)l.push(-3),a=void 0;else switch(a&&(l.push(-5),a=void 0),d<g&&(l.push(n.slice(d,g)),t+=g-d),_){case 0:{l.push(65533),t++;break}case 9:{for(f=Math.ceil(t/4)*4,l.push(-2);t++<f;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:a=!0,t=1}d=g+1}return s&&(a&&l.push(-5),e&&l.push(e),l.push(null)),l}}function VG(t,e,i){return typeof e!="string"&&(i=e,e=void 0),_W(i)(WG(zG(i).document().write(GG()(t,e,!0))))}const n4={none:"",left:' align="left"',right:' align="right"',center:' align="center"'};function KG(){return{enter:{table(t){const e=t._align;this.lineEndingIfNeeded(),this.tag("<table>"),this.setData("tableAlign",e)},tableBody(){this.tag("<tbody>")},tableData(){const t=this.getData("tableAlign"),e=this.getData("tableColumn"),i=n4[t[e]];i===void 0?this.buffer():(this.lineEndingIfNeeded(),this.tag("<td"+i+">"))},tableHead(){this.lineEndingIfNeeded(),this.tag("<thead>")},tableHeader(){const t=this.getData("tableAlign"),e=this.getData("tableColumn"),i=n4[t[e]];this.lineEndingIfNeeded(),this.tag("<th"+i+">")},tableRow(){this.setData("tableColumn",0),this.lineEndingIfNeeded(),this.tag("<tr>")}},exit:{codeTextData(t){let e=this.sliceSerialize(t);this.getData("tableAlign")&&(e=e.replace(/\\([\\|])/g,XG)),this.raw(this.encode(e))},table(){this.setData("tableAlign"),this.setData("slurpAllLineEndings"),this.lineEndingIfNeeded(),this.tag("</table>")},tableBody(){this.lineEndingIfNeeded(),this.tag("</tbody>")},tableData(){const t=this.getData("tableAlign"),e=this.getData("tableColumn");e in t?(this.tag("</td>"),this.setData("tableColumn",e+1)):this.resume()},tableHead(){this.lineEndingIfNeeded(),this.tag("</thead>")},tableHeader(){const t=this.getData("tableColumn");this.tag("</th>"),this.setData("tableColumn",t+1)},tableRow(){const t=this.getData("tableAlign");let e=this.getData("tableColumn");for(;e<t.length;)this.lineEndingIfNeeded(),this.tag("<td"+n4[t[e]]+"></td>"),e++;this.setData("tableColumn",e),this.lineEndingIfNeeded(),this.tag("</tr>")}}}}function XG(t,e){return e==="|"?e:t}class YG{constructor(){this.map=[]}add(e,i,a){ZG(this,e,i,a)}consume(e){if(this.map.sort(function(n,o){return n[0]-o[0]}),this.map.length===0)return;let i=this.map.length;const a=[];for(;i>0;)i-=1,a.push(e.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),e.length=this.map[i][0];a.push(e.slice()),e.length=0;let r=a.pop();for(;r;){for(const n of r)e.push(n);r=a.pop()}this.map.length=0}}function ZG(t,e,i,a){let r=0;if(!(i===0&&a.length===0)){for(;r<t.map.length;){if(t.map[r][0]===e){t.map[r][1]+=i,t.map[r][2].push(...a);return}r+=1}t.map.push([e,i,a])}}function JG(t,e){let i=!1;const a=[];for(;e<t.length;){const r=t[e];if(i){if(r[0]==="enter")r[1].type==="tableContent"&&a.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const n=a.length-1;a[n]=a[n]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(i=!0);e+=1}return a}function eV(){return{flow:{null:{name:"table",tokenize:tV,resolveAll:iV}}}}function tV(t,e,i){const a=this;let r=0,n=0,o;return s;function s(D){let L=a.events.length-1;for(;L>-1;){const I=a.events[L][1].type;if(I==="lineEnding"||I==="linePrefix")L--;else break}const q=L>-1?a.events[L][1].type:null,R=q==="tableHead"||q==="tableRow"?w:l;return R===w&&a.parser.lazy[a.now().line]?i(D):R(D)}function l(D){return t.enter("tableHead"),t.enter("tableRow"),u(D)}function u(D){return D===124||(o=!0,n+=1),f(D)}function f(D){return D===null?i(D):gt(D)?n>1?(n=0,a.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(D),t.exit("lineEnding"),_):i(D):Rt(D)?ri(t,f,"whitespace")(D):(n+=1,o&&(o=!1,r+=1),D===124?(t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),o=!0,f):(t.enter("data"),d(D)))}function d(D){return D===null||D===124||ar(D)?(t.exit("data"),f(D)):(t.consume(D),D===92?g:d)}function g(D){return D===92||D===124?(t.consume(D),d):d(D)}function _(D){return a.interrupt=!1,a.parser.lazy[a.now().line]?i(D):(t.enter("tableDelimiterRow"),o=!1,Rt(D)?ri(t,F,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):F(D))}function F(D){return D===45||D===58?m(D):D===124?(o=!0,t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),c):b(D)}function c(D){return Rt(D)?ri(t,m,"whitespace")(D):m(D)}function m(D){return D===58?(n+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(D),t.exit("tableDelimiterMarker"),A):D===45?(n+=1,A(D)):D===null||gt(D)?k(D):b(D)}function A(D){return D===45?(t.enter("tableDelimiterFiller"),p(D)):b(D)}function p(D){return D===45?(t.consume(D),p):D===58?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(D),t.exit("tableDelimiterMarker"),C):(t.exit("tableDelimiterFiller"),C(D))}function C(D){return Rt(D)?ri(t,k,"whitespace")(D):k(D)}function k(D){return D===124?F(D):D===null||gt(D)?!o||r!==n?b(D):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(D)):b(D)}function b(D){return i(D)}function w(D){return t.enter("tableRow"),x(D)}function x(D){return D===124?(t.enter("tableCellDivider"),t.consume(D),t.exit("tableCellDivider"),x):D===null||gt(D)?(t.exit("tableRow"),e(D)):Rt(D)?ri(t,x,"whitespace")(D):(t.enter("data"),v(D))}function v(D){return D===null||D===124||ar(D)?(t.exit("data"),x(D)):(t.consume(D),D===92?E:v)}function E(D){return D===92||D===124?(t.consume(D),v):v(D)}}function iV(t,e){let i=-1,a=!0,r=0,n=[0,0,0,0],o=[0,0,0,0],s=!1,l=0,u,f,d;const g=new YG;for(;++i<t.length;){const _=t[i],F=_[1];_[0]==="enter"?F.type==="tableHead"?(s=!1,l!==0&&(hk(g,e,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},F.start),end:Object.assign({},F.end)},g.add(i,0,[["enter",u,e]])):F.type==="tableRow"||F.type==="tableDelimiterRow"?(a=!0,d=void 0,n=[0,0,0,0],o=[0,i+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},F.start),end:Object.assign({},F.end)},g.add(i,0,[["enter",f,e]])),r=F.type==="tableDelimiterRow"?2:f?3:1):r&&(F.type==="data"||F.type==="tableDelimiterMarker"||F.type==="tableDelimiterFiller")?(a=!1,o[2]===0&&(n[1]!==0&&(o[0]=o[1],d=a_(g,e,n,r,void 0,d),n=[0,0,0,0]),o[2]=i)):F.type==="tableCellDivider"&&(a?a=!1:(n[1]!==0&&(o[0]=o[1],d=a_(g,e,n,r,void 0,d)),n=o,o=[n[1],i,0,0])):F.type==="tableHead"?(s=!0,l=i):F.type==="tableRow"||F.type==="tableDelimiterRow"?(l=i,n[1]!==0?(o[0]=o[1],d=a_(g,e,n,r,i,d)):o[1]!==0&&(d=a_(g,e,o,r,i,d)),r=0):r&&(F.type==="data"||F.type==="tableDelimiterMarker"||F.type==="tableDelimiterFiller")&&(o[3]=i)}for(l!==0&&hk(g,e,l,u,f),g.consume(e.events),i=-1;++i<e.events.length;){const _=e.events[i];_[0]==="enter"&&_[1].type==="table"&&(_[1]._align=JG(e.events,i))}return t}function a_(t,e,i,a,r,n){const o=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",s="tableContent";i[0]!==0&&(n.end=Object.assign({},y1(e.events,i[0])),t.add(i[0],0,[["exit",n,e]]));const l=y1(e.events,i[1]);if(n={type:o,start:Object.assign({},l),end:Object.assign({},l)},t.add(i[1],0,[["enter",n,e]]),i[2]!==0){const u=y1(e.events,i[2]),f=y1(e.events,i[3]),d={type:s,start:Object.assign({},u),end:Object.assign({},f)};if(t.add(i[2],0,[["enter",d,e]]),a!==2){const g=e.events[i[2]],_=e.events[i[3]];if(g[1].end=Object.assign({},_[1].end),g[1].type="chunkText",g[1].contentType="text",i[3]>i[2]+1){const F=i[2]+1,c=i[3]-i[2]-1;t.add(F,c,[])}}t.add(i[3]+1,0,[["exit",d,e]])}return r!==void 0&&(n.end=Object.assign({},y1(e.events,r)),t.add(r,0,[["exit",n,e]]),n=void 0),n}function hk(t,e,i,a,r){const n=[],o=y1(e.events,i);r&&(r.end=Object.assign({},o),n.push(["exit",r,e])),a.end=Object.assign({},o),n.push(["exit",a,e]),t.add(i+1,0,n)}function y1(t,e){const i=t[e],a=i[0]==="enter"?"start":"end";return i[1][a]}function o4(t){return VG(t,{extensions:[eV()],htmlExtensions:[KG()]})}function aV(t){const e=/\[([^\]]+)\]\((https?:\/\/[^")]+)\)(?:\s*\n\s*([^\n]+))?/g,i=[];let a;for(;(a=e.exec(t))!==null;)i.push({name:a[1],url:a[2],pageInfo:a[3]?.trim()});return i}function rV(t){return t.replace(/<?Source[s]*>?[:]?(\s*)((\[[^\]]+\]\([^)]+\)(?:\s*\n\s*[^\n]+)?[, ]*)+)(?:\s*<\/Source[s]*>)?/gi,"")}const gk={feedbackRecorded:"GenAIRatingComponent-module_feedbackRecorded_mY3rB",ratingButtons:"GenAIRatingComponent-module_ratingButtons_qza7g"},nV=t=>{if(t==="thumbs_up")return"THUMBS_UP";if(t==="thumbs_down")return"THUMBS_DOWN"},oV=t=>{switch(t){case"thumbs_up":return"Provide positive AI feedback";case"thumbs_down":return"Provide negative AI feedback";case"comment":return"Report an issue with AI response";default:return""}},sV=t=>{switch(t){case"thumbs_up":case"thumbs_down":return h.jsxs(h.Fragment,{children:["Additional details"," ",h.jsx("span",{style:{color:"#666",fontWeight:"normal"},children:"(optional)"})]});case"comment":return"Issue details";default:return""}},lV=t=>{switch(t){case"thumbs_up":return"Why was this response good?";case"thumbs_down":return"Why was this response bad?";case"comment":return"Provide more details for the product and engineering team";default:return""}},uV=()=>"Submitting this report will allow WorkTango to review the entire current conversation for future improvements to our responses.",fV=({feedbackType:t,comment:e})=>!(!t||t==="comment"&&!e.trim()),dV=({setIsModalOpen:t,setHasSubmittedFeedback:e,successToast:i})=>{hg.flushSync(()=>{t(!1),e(!0)}),i("Thank you for providing feedback!")},hV=({feedbackType:t,comment:e,responseType:i,responseId:a,genAiMessage:r,genAiMessageTimestamp:n})=>({responseType:i,responseId:a,genAiMessage:r,genAiMessageTimestamp:n,userRating:nV(t),userComment:e.trim()||void 0}),gV=async({feedbackType:t,comment:e,input:i,onSubmitRating:a,onSuccess:r})=>{if(fV({feedbackType:t,comment:e}))try{await a(i),r()}catch{}};function _V({onIconClick:t,className:e}){return h.jsxs(rt,{gap:"8px",alignItems:"center",className:e,children:[h.jsx(vs,{content:"Good response",children:h.jsx(Yi,{icon:"thumbs_up",iconSize:16,containerSize:24,onClick:()=>t("thumbs_up"),"data-testid":"thumbs-up-button",variant:"system"})}),h.jsx(vs,{content:"Bad response",children:h.jsx(Yi,{icon:"thumbs_down",iconSize:16,containerSize:24,onClick:()=>t("thumbs_down"),"data-testid":"thumbs-down-button",variant:"system"})}),h.jsx(vs,{content:"Report an issue",children:h.jsx(Yi,{icon:"comment",iconSize:16,containerSize:24,onClick:()=>t("comment"),"data-testid":"comment-button",variant:"system"})})]})}function cV({isModalOpen:t,feedbackType:e,comment:i,setComment:a,handleModalClose:r,handleSubmit:n,isLoading:o,error:s}){return t?h.jsxs(KL,{isOpen:t,modalTitle:oV(e),onClose:r,size:"medium",children:[h.jsx(k9,{id:"rating-comment",label:sV(e),value:i,onChange:a,fullWidth:!0,placeholder:lV(e),"data-testid":"rating-comment-textarea"}),h.jsx(bt,{size:"small",paragraph:!1,color:"var(--confetti-text-secondary)",children:uV()}),h.jsx(St,{size:"medium"}),h.jsxs(rt,{justifyContent:"flex-start",gap:"8px",children:[h.jsx(yi,{variant:"primary",onClick:n,disabled:o||e==="comment"&&!i.trim(),"data-testid":"send-feedback-button",children:o?"Sending...":"Send feedback"}),h.jsx(yi,{variant:"secondary",onClick:r,"data-testid":"cancel-button",children:"Cancel"})]}),s&&h.jsxs(h.Fragment,{children:[h.jsx(St,{size:"small"}),h.jsx("div",{style:{color:"#d32f2f",fontSize:"14px",textAlign:"center"},"data-testid":"error-message",children:"Failed to submit feedback. Please try again."})]})]}):null}function s4({responseType:t,responseId:e,genAiMessage:i,genAiMessageTimestamp:a,onSubmitRating:r,isLoading:n=!1,error:o,aiResponseRating:s}){const[l,u]=M.useState(!1),[f,d]=M.useState(null),[g,_]=M.useState(""),[F,c]=M.useState(!1),{success:m}=Zg(),A=s||F,p=b=>{d(b),_(""),u(!0)},C=()=>{u(!1),d(null),_("")},k=async()=>{const b=hV({feedbackType:f,comment:g,responseType:t,responseId:e,genAiMessage:i,genAiMessageTimestamp:a});await gV({feedbackType:f,comment:g,input:b,onSubmitRating:r,onSuccess:()=>dV({setIsModalOpen:u,setHasSubmittedFeedback:c,successToast:m})})};return A?h.jsx("div",{"data-testid":"feedback-recorded-message",className:gk.feedbackRecorded,children:h.jsx(bt,{size:"small",paragraph:!0,children:"Your feedback was recorded."})}):h.jsxs(h.Fragment,{children:[h.jsx(_V,{onIconClick:p,className:gk.ratingButtons}),h.jsx(cV,{isModalOpen:l,feedbackType:f,comment:g,setComment:_,handleModalClose:C,handleSubmit:k,isLoading:n,error:o})]})}const Ko={userMessageContainer:"MessageRenderers-module_userMessageContainer_t-c-z",assistantMessageContainer:"MessageRenderers-module_assistantMessageContainer_Q01NL",audioOutputButton:"MessageRenderers-module_audioOutputButton_31Doo",synthesizing:"MessageRenderers-module_synthesizing_PWwm0",playing:"MessageRenderers-module_playing_Qktyu",userMessage:"MessageRenderers-module_userMessage_hXgT1",assistantMessage:"MessageRenderers-module_assistantMessage_4H2Dy",iconWrapper:"MessageRenderers-module_iconWrapper_Ai6Pd"};function FV({message:t,isStreaming:e=!1,getSpeech:i=Mi,isVoiceOutputEnabled:a=!1,setVoiceOutputPlaying:r=Mi,enableResponseRating:n=!1}){const o=t.messageText,s=M.useRef(e),[l,u]=M.useState(null),[f,d]=M.useState(o),g=Tg(),_=M.useRef(null),F=M.useRef(new Date().toISOString()),[c,{loading:m,error:A}]=jy();M.useEffect(()=>{const v=setTimeout(()=>{const E=rV(o);d(E);const D=aV(o);if(!D.length){u(null);return}u(h.jsxs("div",{style:{marginTop:16},children:[h.jsx("div",{style:{fontWeight:600,marginBottom:4},children:"Sources:"}),h.jsx("div",{style:{border:"1px solid #e0e0e0",borderRadius:8,padding:8,background:"#fafbfc",fontSize:14,maxWidth:"fit-content"},children:D.map((L,q)=>h.jsxs("div",{style:{marginBottom:8},children:[h.jsx("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",style:{color:"#2a5cdb",fontWeight:500,textDecoration:"underline",display:"block",marginBottom:2,padding:"4px",fontSize:12},children:L.name}),L.pageInfo&&h.jsx("div",{style:{fontSize:12,color:"#666",padding:"0 4px"},children:L.pageInfo})]},q))})]}))},50);return()=>{clearTimeout(v)}},[o]);const[p,C]=M.useState("idle"),k=M.useCallback(async()=>{C("synthesizing");const v=await yV(f,i);if(!v){r(!1),C("idle");return}const E=new AudioContext,D=v,L=new Uint8Array(D.data),q=L.buffer.slice(L.byteOffset,L.byteOffset+L.byteLength),R=await E.decodeAudioData(q),I=E.createBufferSource();I.buffer=R,I.connect(E.destination),_.current=I,I.start(),I.onended=()=>{g()&&(C("idle"),r(!1))},C("playing"),r(!0)},[i,f,g,r]),b=M.useCallback(async()=>{e||await k()},[e,k]),w=M.useCallback(()=>{_.current&&(_.current.stop(),_.current=null)},[]);M.useEffect(()=>{if(s.current===!0&&e===!1&&a){const v=setTimeout(()=>k().then(Mi),10);return()=>{clearTimeout(v),_.current?.stop()}}},[e,a,k]),M.useEffect(RS(w),[w]);const x=M.useCallback(async v=>(await c({variables:{input:v}})).data?.createOrUpdateAiResponseRating,[c]);return o.trim()?h.jsx("div",{className:Ko.assistantMessageContainer,children:h.jsx("div",{children:h.jsxs(rt,{alignItems:"flex-start",gap:"8px",children:[h.jsxs(rt,{gap:"12px",direction:"column",children:[h.jsx("div",{className:Ko.iconWrapper,children:h.jsx(It,{icon:"ai_general",size:24,color:"#3094ED",variant:"filled"})}),a&&!e&&h.jsx(AV,{synthesizingSpeechStatus:p,handleGetSpeech:b,handleStop:w})]}),h.jsxs(Eg,{className:Ko.assistantMessage,children:[s.current?h.jsx(pV,{text:f}):h.jsx("div",{className:"markdown",dangerouslySetInnerHTML:{__html:o4(f)}}),l,!e&&n&&h.jsx(s4,{responseType:"WTC_MESSAGE",responseId:t.id,genAiMessage:o,genAiMessageTimestamp:F.current,onSubmitRating:x,isLoading:m,error:A,aiResponseRating:t.aiResponseRating})]})]})})},"text"):null}const mV={idle:h.jsxs(h.Fragment,{children:["⏵",h.jsx("span",{className:"screen-reader-only",children:"Play"})]}),playing:h.jsxs(h.Fragment,{children:["⏹",h.jsx("span",{className:"screen-reader-only",children:"Stop"})]})};function AV({synthesizingSpeechStatus:t,handleGetSpeech:e,handleStop:i}){return h.jsx(yi,{onClick:t==="idle"?e:i,variant:"system",size:"small",title:me({Play:t==="idle",Stop:t==="playing",Synthesizing:t==="synthesizing"}),"data-testid":"assistant-message-play-button",disabled:t==="synthesizing",className:me(Ko.audioOutputButton,{[Ko.synthesizing]:t==="synthesizing",[Ko.playing]:t==="playing"}),children:t==="synthesizing"?h.jsx(go,{size:"small"}):h.jsx("div",{style:{position:"absolute",display:"block",left:"50%",top:"50%",transform:"translate(-50%, -50%)",color:"#fff",fontSize:12},children:mV[t]})})}function pV({text:t}){const[e,i]=M.useState(""),a=Tg(),r=M.useRef({text:t,textToRender:e});return r.current.text=t,r.current.textToRender=e,M.useEffect(()=>bV({isMounted:a,propRefs:r,setTextToRender:i}),[]),h.jsx("div",{className:"markdown",dangerouslySetInnerHTML:{__html:o4(e)}})}function bV({isMounted:t,propRefs:e,setTextToRender:i}){let a=null,r=null;function n(){a&&clearInterval(a),r&&cancelAnimationFrame(r),a=null,r=null}let o=!1;function s(){o||(o=!0,r=requestAnimationFrame(()=>{if(!t())return;const d=e.current.text.slice(e.current.textToRender.length,e.current.textToRender.length+8);d.length&&i(e.current.textToRender+d),o=!1}))}function l(){o||!t()||a||(e.current.textToRender!==e.current.text?a=setInterval(s,20):n())}const u=setInterval(l,100);return()=>{n(),clearInterval(u)}}const _k=new Map;async function yV(t,e){let i=_k.get(t);return i||(i=await e(t),i?(_k.set(t,i),i):null)}function kV({message:t,showDebugInfo:e=!1}){const i=t.metadata?.loading,a=t.metadata?.displayName,r=t.metadata?.toolName,n=a||(r?`Calling ${r}`:"Processing"),o=t.metadata?.pastTenseDisplayName||n;return i?h.jsx(Eg,{children:h.jsxs("div",{style:{marginLeft:"24px"},children:[h.jsxs(rt,{gap:"8px",alignItems:"center",children:[h.jsx(It,{icon:"loading",size:16}),h.jsxs(bt,{color:"var(--confetti-text-secondary)",bold:!0,children:[n,"..."]})]}),h.jsx(St,{size:"small"}),h.jsx(a5,{num:4}),h.jsx(St,{size:"medium"}),h.jsx(a5,{num:4})]})}):e?h.jsx(Eg,{children:h.jsx("div",{style:{marginLeft:"24px"},children:h.jsxs(rt,{gap:"8px",alignItems:"center",children:[h.jsx(bt,{color:"var(--confetti-text-secondary)",bold:!0,children:o}),h.jsx(vs,{content:h.jsx("pre",{style:{margin:0,padding:"8px",maxWidth:"400px",maxHeight:"300px",overflow:"auto"},children:JSON.stringify(t,null,2)}),children:h.jsx(It,{icon:"info",size:16})})]})})}):null}const wV=oe({module:()=>Promise.resolve().then(()=>Ige),component:t=>t.default}),CV={half:"300px",full:"560px"};function xV({message:t,chatSize:e}){const i=[],a=t.messageText,r=t.metadata?.toolName;if(typeof a!="string"||!a?.includes("###chart_data_end###"))return;const n=a.split(/###chart_data###|###chart_data_end###/);if(!(n.length===3))return;const s=JSON.parse(n[1].trim()),l=`${r}-${s.type}-${t.id}`;return i.push(h.jsx("div",{style:{width:CV[e]},children:h.jsx(wV,{type:s.type,options:{...s.options,chart:{...s.options?.chart,id:l,animations:{enabled:!1},zoom:{enabled:!0},toolbar:{show:!0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0}}}},series:s.series})},l)),h.jsx(Eg,{children:h.jsx(rt,{justifyContent:"flex-start",style:{marginLeft:"24px"},direction:"column",children:i})})}function vV({message:t,showDebugInfo:e=!1,chatSize:i="half"}){return h.jsxs("div",{className:Ko.assistantMessageContainer,children:[h.jsx(kV,{message:t,showDebugInfo:e}),h.jsx(xV,{message:t,chatSize:i})]})}function DV({message:t}){const e=t.messageText,i=[];return e&&i.push(h.jsx(rt,{justifyContent:"flex-end",style:{width:"100%"},className:Ko.userMessageContainer,children:h.jsx(Hu,{noShadow:!0,withBorder:!0,className:Ko.userMessage,children:h.jsx("div",{className:"markdown",dangerouslySetInnerHTML:{__html:o4(e)}})})},"text")),i.length===0?null:h.jsx(h.Fragment,{children:i})}const EV=({onExitSearch:t,onSearch:e})=>h.jsxs(rt,{direction:"row",gap:"8px",testId:"search-conversations",className:na["ai-assistant-search-input-container"],children:[h.jsx(Qf,{id:"search-conversations",onChange:e,placeholder:"Find chat","data-testid":"search-conversations-input",fullWidth:!0,autoFocus:!0}),h.jsx(Yi,{icon:"close",system:!0,size:"small",title:"Exit search","data-testid":"search-exit-button",onClick:t})]});function BV({onExit:t,isPlaying:e}){const i=M.useRef(null),a=M.useRef();return M.useEffect(()=>{if(!i.current)return;const r=i.current,n=r.getContext("2d");if(!n)return;const o=32,s=r.width/o-2,l=Array(o).fill(0).map(()=>Math.random()*.3+.1),u=Array(o).fill(.1),f=Array(o).fill(.1);let d=0;const g=()=>{if(n.clearRect(0,0,r.width,r.height),n.fillStyle="#4285f4",e&&d%3===0){const _=Math.floor(Math.random()*o),F=Math.random()*.8+.2;for(let c=0;c<o;c++){const m=Math.abs(c-_),A=Math.max(0,1-m/8);u[c]=l[c]+A*F*Math.random()}}else e||u.fill(.1);for(let _=0;_<o;_++){f[_]+=(u[_]-f[_])*.3;const F=f[_]*r.height*.7,c=_*(s+2)+2,m=(r.height-F)/2;n.fillRect(c,m,s,F)}d++,a.current=requestAnimationFrame(g)};return g(),()=>{a.current&&cancelAnimationFrame(a.current)}},[e]),h.jsxs("div",{className:"audio-visualizer-container",children:[h.jsx("style",{children:SV}),h.jsx("canvas",{ref:i,width:200,height:60,className:"audio-canvas"}),h.jsx("button",{className:"exit-voice-mode",onClick:()=>t(!1),children:"✕ Exit voice mode"})]})}const SV=`
|