@recombine-ai/bosun 0.3.12 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/_app/immutable/assets/0.B5gApcUL.css +1 -0
- package/build/client/_app/immutable/assets/0.B5gApcUL.css.br +0 -0
- package/build/client/_app/immutable/assets/0.B5gApcUL.css.gz +0 -0
- package/build/client/_app/immutable/chunks/8B3OPwlB.js +1 -0
- package/build/client/_app/immutable/chunks/8B3OPwlB.js.br +2 -0
- package/build/client/_app/immutable/chunks/8B3OPwlB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B3ux6SZZ.js +1 -0
- package/build/client/_app/immutable/chunks/B3ux6SZZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/B3ux6SZZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B5-6Ezv3.js +1 -0
- package/build/client/_app/immutable/chunks/B5-6Ezv3.js.br +2 -0
- package/build/client/_app/immutable/chunks/B5-6Ezv3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BA8mqPb-.js +1 -0
- package/build/client/_app/immutable/chunks/BA8mqPb-.js.br +0 -0
- package/build/client/_app/immutable/chunks/BA8mqPb-.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BCG4zvjp.js +2 -0
- package/build/client/_app/immutable/chunks/BCG4zvjp.js.br +0 -0
- package/build/client/_app/immutable/chunks/BCG4zvjp.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{oeB0PCTX.js → BMYSavKM.js} +1 -1
- package/build/client/_app/immutable/chunks/BMYSavKM.js.br +0 -0
- package/build/client/_app/immutable/chunks/BMYSavKM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{TO5ESkEd.js → BY8d35y9.js} +1 -1
- package/build/client/_app/immutable/chunks/BY8d35y9.js.br +0 -0
- package/build/client/_app/immutable/chunks/BY8d35y9.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CFwu9ET3.js → BdZ7JhAm.js} +1 -1
- package/build/client/_app/immutable/chunks/BdZ7JhAm.js.br +0 -0
- package/build/client/_app/immutable/chunks/BdZ7JhAm.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BWo2H__f.js → BmadykGs.js} +3 -3
- package/build/client/_app/immutable/chunks/BmadykGs.js.br +0 -0
- package/build/client/_app/immutable/chunks/BmadykGs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bmb8cHfR.js +1 -0
- package/build/client/_app/immutable/chunks/Bmb8cHfR.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bmb8cHfR.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bx2X1niE.js +1 -0
- package/build/client/_app/immutable/chunks/Bx2X1niE.js.br +2 -0
- package/build/client/_app/immutable/chunks/Bx2X1niE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C-xhOnoy.js +1 -0
- package/build/client/_app/immutable/chunks/C-xhOnoy.js.br +0 -0
- package/build/client/_app/immutable/chunks/C-xhOnoy.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C1FmrZbK.js +1 -0
- package/build/client/_app/immutable/chunks/C1FmrZbK.js.br +0 -0
- package/build/client/_app/immutable/chunks/C1FmrZbK.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Bdb5tyDH.js → C4mbwMvt.js} +1 -1
- package/build/client/_app/immutable/chunks/C4mbwMvt.js.br +0 -0
- package/build/client/_app/immutable/chunks/C4mbwMvt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C5HWpeo9.js +1 -0
- package/build/client/_app/immutable/chunks/C5HWpeo9.js.br +0 -0
- package/build/client/_app/immutable/chunks/C5HWpeo9.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CdzpH-Ca.js → CAFoob5N.js} +1 -1
- package/build/client/_app/immutable/chunks/CAFoob5N.js.br +0 -0
- package/build/client/_app/immutable/chunks/CAFoob5N.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Bk1rEq7o.js → CGinwM47.js} +1 -1
- package/build/client/_app/immutable/chunks/CGinwM47.js.br +0 -0
- package/build/client/_app/immutable/chunks/CGinwM47.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CI-reiW2.js +1 -0
- package/build/client/_app/immutable/chunks/CI-reiW2.js.br +0 -0
- package/build/client/_app/immutable/chunks/CI-reiW2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C_ZSt1CI.js +2 -0
- package/build/client/_app/immutable/chunks/C_ZSt1CI.js.br +0 -0
- package/build/client/_app/immutable/chunks/C_ZSt1CI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CVHvdSBf.js → CfbYRn5k.js} +1 -1
- package/build/client/_app/immutable/chunks/CfbYRn5k.js.br +0 -0
- package/build/client/_app/immutable/chunks/{CVHvdSBf.js.gz → CfbYRn5k.js.gz} +0 -0
- package/build/client/_app/immutable/chunks/{CNMNmz2q.js → CrxwEwqu.js} +1 -1
- package/build/client/_app/immutable/chunks/CrxwEwqu.js.br +0 -0
- package/build/client/_app/immutable/chunks/CrxwEwqu.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CsYbWoTD.js +8 -0
- package/build/client/_app/immutable/chunks/CsYbWoTD.js.br +0 -0
- package/build/client/_app/immutable/chunks/CsYbWoTD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CIIE25ox.js → CwmAWymP.js} +1 -1
- package/build/client/_app/immutable/chunks/CwmAWymP.js.br +0 -0
- package/build/client/_app/immutable/chunks/CwmAWymP.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CxPv-oiS.js +1 -0
- package/build/client/_app/immutable/chunks/CxPv-oiS.js.br +0 -0
- package/build/client/_app/immutable/chunks/CxPv-oiS.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DOatwnEt.js → DDMPVpvs.js} +1 -1
- package/build/client/_app/immutable/chunks/DDMPVpvs.js.br +0 -0
- package/build/client/_app/immutable/chunks/DDMPVpvs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DGa-EyU2.js +1 -0
- package/build/client/_app/immutable/chunks/DGa-EyU2.js.br +0 -0
- package/build/client/_app/immutable/chunks/DGa-EyU2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BfHUxT3G.js → DLQqXQ6R.js} +7 -7
- package/build/client/_app/immutable/chunks/DLQqXQ6R.js.br +0 -0
- package/build/client/_app/immutable/chunks/DLQqXQ6R.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DQA6NP5y.js +2 -0
- package/build/client/_app/immutable/chunks/DQA6NP5y.js.br +0 -0
- package/build/client/_app/immutable/chunks/DQA6NP5y.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{HPBQctDD.js → DRIMs3uA.js} +1 -1
- package/build/client/_app/immutable/chunks/DRIMs3uA.js.br +0 -0
- package/build/client/_app/immutable/chunks/DRIMs3uA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{ByQey8Oa.js → DUeN9t8P.js} +1 -1
- package/build/client/_app/immutable/chunks/DUeN9t8P.js.br +0 -0
- package/build/client/_app/immutable/chunks/DUeN9t8P.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{KDW88ZZa.js → DWH0347h.js} +1 -1
- package/build/client/_app/immutable/chunks/DWH0347h.js.br +0 -0
- package/build/client/_app/immutable/chunks/DWH0347h.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BnxfhlSj.js → DZxMt77D.js} +1 -1
- package/build/client/_app/immutable/chunks/DZxMt77D.js.br +0 -0
- package/build/client/_app/immutable/chunks/DZxMt77D.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DaR1ExPh.js +1 -0
- package/build/client/_app/immutable/chunks/DaR1ExPh.js.br +0 -0
- package/build/client/_app/immutable/chunks/DaR1ExPh.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{rtsVMmSs.js → DjDhNM9l.js} +1 -1
- package/build/client/_app/immutable/chunks/DjDhNM9l.js.br +0 -0
- package/build/client/_app/immutable/chunks/DjDhNM9l.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dl6q6wVH.js +1 -0
- package/build/client/_app/immutable/chunks/Dl6q6wVH.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dl6q6wVH.js.gz +0 -0
- package/build/client/_app/immutable/chunks/JA_7cQFn.js +1 -0
- package/build/client/_app/immutable/chunks/JA_7cQFn.js.br +0 -0
- package/build/client/_app/immutable/chunks/JA_7cQFn.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BqROrg0C.js → OMeqFb0I.js} +1 -1
- package/build/client/_app/immutable/chunks/OMeqFb0I.js.br +0 -0
- package/build/client/_app/immutable/chunks/OMeqFb0I.js.gz +0 -0
- package/build/client/_app/immutable/chunks/WMLo4l1V.js +4 -0
- package/build/client/_app/immutable/chunks/WMLo4l1V.js.br +0 -0
- package/build/client/_app/immutable/chunks/WMLo4l1V.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Ct9HfpvA.js → ZGfwyPNq.js} +1 -1
- package/build/client/_app/immutable/chunks/ZGfwyPNq.js.br +0 -0
- package/build/client/_app/immutable/chunks/ZGfwyPNq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DSfxalyG.js → bynEV6cE.js} +1 -1
- package/build/client/_app/immutable/chunks/bynEV6cE.js.br +0 -0
- package/build/client/_app/immutable/chunks/bynEV6cE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/i_HX2z3K.js +1 -0
- package/build/client/_app/immutable/chunks/i_HX2z3K.js.br +0 -0
- package/build/client/_app/immutable/chunks/i_HX2z3K.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{yWz0pZR0.js → wDFujNbC.js} +1 -1
- package/build/client/_app/immutable/chunks/wDFujNbC.js.br +0 -0
- package/build/client/_app/immutable/chunks/wDFujNbC.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CZPhtqrs.js → wtOMB7ao.js} +3 -3
- package/build/client/_app/immutable/chunks/wtOMB7ao.js.br +0 -0
- package/build/client/_app/immutable/chunks/wtOMB7ao.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.DQ_2_Lfy.js +2 -0
- package/build/client/_app/immutable/entry/app.DQ_2_Lfy.js.br +0 -0
- package/build/client/_app/immutable/entry/app.DQ_2_Lfy.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.DvKwzZNe.js +1 -0
- package/build/client/_app/immutable/entry/start.DvKwzZNe.js.br +2 -0
- package/build/client/_app/immutable/entry/start.DvKwzZNe.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.CwdXLzyE.js → 0.CgivU_tm.js} +1 -1
- package/build/client/_app/immutable/nodes/0.CgivU_tm.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.CgivU_tm.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.DP8kLfpI.js +1 -0
- package/build/client/_app/immutable/nodes/1.DP8kLfpI.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DP8kLfpI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{13.DaAF9e8t.js → 14.zP-B7lEl.js} +1 -1
- package/build/client/_app/immutable/nodes/14.zP-B7lEl.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.zP-B7lEl.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{14.BcXGBqPj.js → 15.B2GzYnI3.js} +3 -3
- package/build/client/_app/immutable/nodes/15.B2GzYnI3.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.B2GzYnI3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.Bhgshf0y.js +35 -0
- package/build/client/_app/immutable/nodes/2.Bhgshf0y.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.Bhgshf0y.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.0QEF0Tq5.js +1 -0
- package/build/client/_app/immutable/nodes/3.0QEF0Tq5.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.0QEF0Tq5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.DBO0gLSr.js +1 -0
- package/build/client/_app/immutable/nodes/4.DBO0gLSr.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.DBO0gLSr.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.CqUx8Ggk.js → 5.CZiuS-IZ.js} +1 -1
- package/build/client/_app/immutable/nodes/5.CZiuS-IZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.CZiuS-IZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.CkeP1yO3.js +1 -0
- package/build/client/_app/immutable/nodes/6.CkeP1yO3.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.CkeP1yO3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.CB2Z5SOz.js +2 -0
- package/build/client/_app/immutable/nodes/7.CB2Z5SOz.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.CB2Z5SOz.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.B6QVJ_di.js → 8.BAhMFXe7.js} +2 -2
- package/build/client/_app/immutable/nodes/8.BAhMFXe7.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.BAhMFXe7.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.D7VQfn4o.js +6 -0
- package/build/client/_app/immutable/nodes/9.D7VQfn4o.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.D7VQfn4o.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/0-bATz_nPm.js +9 -0
- package/build/server/chunks/0-bATz_nPm.js.map +1 -0
- package/build/server/chunks/1-B8t1doqY.js +9 -0
- package/build/server/chunks/1-B8t1doqY.js.map +1 -0
- package/build/server/chunks/{9-W6XYayeK.js → 10-DZjMDIvS.js} +3 -3
- package/build/server/chunks/10-DZjMDIvS.js.map +1 -0
- package/build/server/chunks/{10-C7WLHR92.js → 11-D6F4I8KX.js} +3 -3
- package/build/server/chunks/{10-C7WLHR92.js.map → 11-D6F4I8KX.js.map} +1 -1
- package/build/server/chunks/{11-CPYwUx-7.js → 12-2vbUmx0n.js} +3 -3
- package/build/server/chunks/{11-CPYwUx-7.js.map → 12-2vbUmx0n.js.map} +1 -1
- package/build/server/chunks/{12-C5OSs5Op.js → 13-11CHqz2G.js} +3 -3
- package/build/server/chunks/{12-C5OSs5Op.js.map → 13-11CHqz2G.js.map} +1 -1
- package/build/server/chunks/{13-DPcsc1p-.js → 14-C4iOZL2L.js} +3 -3
- package/build/server/chunks/14-C4iOZL2L.js.map +1 -0
- package/build/server/chunks/15-BrQMoggr.js +9 -0
- package/build/server/chunks/15-BrQMoggr.js.map +1 -0
- package/build/server/chunks/2-B0R4hYal.js +9 -0
- package/build/server/chunks/2-B0R4hYal.js.map +1 -0
- package/build/server/chunks/3-DV-OHzXy.js +9 -0
- package/build/server/chunks/3-DV-OHzXy.js.map +1 -0
- package/build/server/chunks/4-ClIdwABM.js +9 -0
- package/build/server/chunks/4-ClIdwABM.js.map +1 -0
- package/build/server/chunks/5-BznYQ30T.js +9 -0
- package/build/server/chunks/5-BznYQ30T.js.map +1 -0
- package/build/server/chunks/{6-uS_X9B0s.js → 6-B6C38HXu.js} +7 -3
- package/build/server/chunks/6-B6C38HXu.js.map +1 -0
- package/build/server/chunks/7-BgYWIBj-.js +9 -0
- package/build/server/chunks/7-BgYWIBj-.js.map +1 -0
- package/build/server/chunks/8-NaJ61xSe.js +9 -0
- package/build/server/chunks/8-NaJ61xSe.js.map +1 -0
- package/build/server/chunks/9-oaBsE2zR.js +9 -0
- package/build/server/chunks/9-oaBsE2zR.js.map +1 -0
- package/build/server/chunks/{ChatStepTrace-B5HQ8Zv3.js → ChatStepTrace-BIghWRaw.js} +3 -59
- package/build/server/chunks/ChatStepTrace-BIghWRaw.js.map +1 -0
- package/build/server/chunks/Dropdown-Bz9eHilg.js +61 -0
- package/build/server/chunks/Dropdown-Bz9eHilg.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-Svi5xbzP.js → _layout.svelte-B6NfHVfy.js} +2 -2
- package/build/server/chunks/{_layout.svelte-Svi5xbzP.js.map → _layout.svelte-B6NfHVfy.js.map} +1 -1
- package/build/server/chunks/{_layout.svelte-Fo2hGNeP.js → _layout.svelte-BKnunWZl.js} +129 -14
- package/build/server/chunks/_layout.svelte-BKnunWZl.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-h89mGXIj.js → _layout.svelte-WXSvPGRU.js} +2 -2
- package/build/server/chunks/{_layout.svelte-h89mGXIj.js.map → _layout.svelte-WXSvPGRU.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-CnjXZO9K.js → _page.svelte-CLBi-ypL.js} +2 -2
- package/build/server/chunks/{_page.svelte-CnjXZO9K.js.map → _page.svelte-CLBi-ypL.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-Hg-ZSzf1.js → _page.svelte-CLiLwJTq.js} +4 -3
- package/build/server/chunks/_page.svelte-CLiLwJTq.js.map +1 -0
- package/build/server/chunks/{_page.svelte-CC26hDwf.js → _page.svelte-CdczF37D.js} +3 -2
- package/build/server/chunks/_page.svelte-CdczF37D.js.map +1 -0
- package/build/server/chunks/_page.svelte-Ck9Utnoc.js +60 -0
- package/build/server/chunks/_page.svelte-Ck9Utnoc.js.map +1 -0
- package/build/server/chunks/{_page.svelte-Dl3GoTy1.js → _page.svelte-DBrprjQP.js} +5 -4
- package/build/server/chunks/_page.svelte-DBrprjQP.js.map +1 -0
- package/build/server/chunks/{error.svelte-zyW9aOoU.js → error.svelte-DP2oBSvv.js} +2 -2
- package/build/server/chunks/{error.svelte-zyW9aOoU.js.map → error.svelte-DP2oBSvv.js.map} +1 -1
- package/build/server/chunks/{index3-DeV2OWZf.js → index3-CpMl6FwG.js} +7 -2
- package/build/server/chunks/index3-CpMl6FwG.js.map +1 -0
- package/build/server/index.js +1 -1
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +32 -24
- package/build/server/manifest.js.map +1 -1
- package/package.json +1 -1
- package/src/backend/lib/get-agent-factories.ts +13 -2
- package/src/backend/lib/get-root-path.ts +30 -5
- package/src/backend/lib/import-nonce.ts +10 -0
- package/src/backend/region/router.ts +67 -0
- package/src/backend/roleplay/agents.ts +51 -11
- package/src/backend/roleplay/old-server.ts +4 -1
- package/src/backend/server.ts +3 -1
- package/src/backend/tests/academy.ts +37 -24
- package/src/backend/tests/emulate-agents.ts +20 -1
- package/src/backend/tests/router.ts +220 -38
- package/build/client/_app/immutable/assets/0.DsZUjxNX.css +0 -1
- package/build/client/_app/immutable/assets/0.DsZUjxNX.css.br +0 -0
- package/build/client/_app/immutable/assets/0.DsZUjxNX.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BTlUd_Lo.js +0 -8
- package/build/client/_app/immutable/chunks/BTlUd_Lo.js.br +0 -0
- package/build/client/_app/immutable/chunks/BTlUd_Lo.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BVDwc-2z.js +0 -1
- package/build/client/_app/immutable/chunks/BVDwc-2z.js.br +0 -0
- package/build/client/_app/immutable/chunks/BVDwc-2z.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BWo2H__f.js.br +0 -0
- package/build/client/_app/immutable/chunks/BWo2H__f.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BXkrt826.js +0 -1
- package/build/client/_app/immutable/chunks/BXkrt826.js.br +0 -0
- package/build/client/_app/immutable/chunks/BXkrt826.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bdb5tyDH.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bdb5tyDH.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BfHUxT3G.js.br +0 -0
- package/build/client/_app/immutable/chunks/BfHUxT3G.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bk1rEq7o.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bk1rEq7o.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BkclRFLx.js +0 -3
- package/build/client/_app/immutable/chunks/BkclRFLx.js.br +0 -0
- package/build/client/_app/immutable/chunks/BkclRFLx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BnxfhlSj.js.br +0 -0
- package/build/client/_app/immutable/chunks/BnxfhlSj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BqROrg0C.js.br +0 -0
- package/build/client/_app/immutable/chunks/BqROrg0C.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ByQey8Oa.js.br +0 -0
- package/build/client/_app/immutable/chunks/ByQey8Oa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CFwu9ET3.js.br +0 -0
- package/build/client/_app/immutable/chunks/CFwu9ET3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CIIE25ox.js.br +0 -0
- package/build/client/_app/immutable/chunks/CIIE25ox.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CNMNmz2q.js.br +0 -0
- package/build/client/_app/immutable/chunks/CNMNmz2q.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CNvyTQrC.js +0 -1
- package/build/client/_app/immutable/chunks/CNvyTQrC.js.br +0 -2
- package/build/client/_app/immutable/chunks/CNvyTQrC.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CVHvdSBf.js.br +0 -0
- package/build/client/_app/immutable/chunks/CYiRxJxs.js +0 -1
- package/build/client/_app/immutable/chunks/CYiRxJxs.js.br +0 -0
- package/build/client/_app/immutable/chunks/CYiRxJxs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CZPhtqrs.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZPhtqrs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CdzpH-Ca.js.br +0 -0
- package/build/client/_app/immutable/chunks/CdzpH-Ca.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cf8q8_nj.js +0 -1
- package/build/client/_app/immutable/chunks/Cf8q8_nj.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cf8q8_nj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cg3F7Z11.js +0 -1
- package/build/client/_app/immutable/chunks/Cg3F7Z11.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cg3F7Z11.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CpSIcnXs.js +0 -1
- package/build/client/_app/immutable/chunks/CpSIcnXs.js.br +0 -0
- package/build/client/_app/immutable/chunks/CpSIcnXs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Ct9HfpvA.js.br +0 -0
- package/build/client/_app/immutable/chunks/Ct9HfpvA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D42t-LiJ.js +0 -4
- package/build/client/_app/immutable/chunks/D42t-LiJ.js.br +0 -0
- package/build/client/_app/immutable/chunks/D42t-LiJ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DJPBfZIx.js +0 -1
- package/build/client/_app/immutable/chunks/DJPBfZIx.js.br +0 -0
- package/build/client/_app/immutable/chunks/DJPBfZIx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DOatwnEt.js.br +0 -0
- package/build/client/_app/immutable/chunks/DOatwnEt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DQqJYxgt.js +0 -1
- package/build/client/_app/immutable/chunks/DQqJYxgt.js.br +0 -0
- package/build/client/_app/immutable/chunks/DQqJYxgt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DSfxalyG.js.br +0 -0
- package/build/client/_app/immutable/chunks/DSfxalyG.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DujX6kBV.js +0 -2
- package/build/client/_app/immutable/chunks/DujX6kBV.js.br +0 -0
- package/build/client/_app/immutable/chunks/DujX6kBV.js.gz +0 -0
- package/build/client/_app/immutable/chunks/HPBQctDD.js.br +0 -0
- package/build/client/_app/immutable/chunks/HPBQctDD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Jaf1TUfw.js +0 -1
- package/build/client/_app/immutable/chunks/Jaf1TUfw.js.br +0 -2
- package/build/client/_app/immutable/chunks/Jaf1TUfw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/KDW88ZZa.js.br +0 -0
- package/build/client/_app/immutable/chunks/KDW88ZZa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/TO5ESkEd.js.br +0 -0
- package/build/client/_app/immutable/chunks/TO5ESkEd.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ZH2wGpZM.js +0 -1
- package/build/client/_app/immutable/chunks/ZH2wGpZM.js.br +0 -0
- package/build/client/_app/immutable/chunks/ZH2wGpZM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/axPa8Xqj.js +0 -1
- package/build/client/_app/immutable/chunks/axPa8Xqj.js.br +0 -0
- package/build/client/_app/immutable/chunks/axPa8Xqj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/oeB0PCTX.js.br +0 -0
- package/build/client/_app/immutable/chunks/oeB0PCTX.js.gz +0 -0
- package/build/client/_app/immutable/chunks/rtsVMmSs.js.br +0 -0
- package/build/client/_app/immutable/chunks/rtsVMmSs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/uS7H_Vea.js +0 -1
- package/build/client/_app/immutable/chunks/uS7H_Vea.js.br +0 -0
- package/build/client/_app/immutable/chunks/uS7H_Vea.js.gz +0 -0
- package/build/client/_app/immutable/chunks/yWz0pZR0.js.br +0 -0
- package/build/client/_app/immutable/chunks/yWz0pZR0.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.yCT9HX-q.js +0 -2
- package/build/client/_app/immutable/entry/app.yCT9HX-q.js.br +0 -0
- package/build/client/_app/immutable/entry/app.yCT9HX-q.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.FbJeJ8ru.js +0 -1
- package/build/client/_app/immutable/entry/start.FbJeJ8ru.js.br +0 -2
- package/build/client/_app/immutable/entry/start.FbJeJ8ru.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.CwdXLzyE.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.CwdXLzyE.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.CJSJdR2U.js +0 -1
- package/build/client/_app/immutable/nodes/1.CJSJdR2U.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.CJSJdR2U.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.DaAF9e8t.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.DaAF9e8t.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.BcXGBqPj.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.BcXGBqPj.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.DISE-c5q.js +0 -35
- package/build/client/_app/immutable/nodes/2.DISE-c5q.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DISE-c5q.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.BtAUfPNQ.js +0 -1
- package/build/client/_app/immutable/nodes/3.BtAUfPNQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.BtAUfPNQ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.DylMSvDw.js +0 -1
- package/build/client/_app/immutable/nodes/4.DylMSvDw.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.DylMSvDw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.CqUx8Ggk.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.CqUx8Ggk.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.CPYhLc46.js +0 -1
- package/build/client/_app/immutable/nodes/6.CPYhLc46.js.br +0 -4
- package/build/client/_app/immutable/nodes/6.CPYhLc46.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.B6QVJ_di.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.B6QVJ_di.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.DhQWMEsP.js +0 -6
- package/build/client/_app/immutable/nodes/8.DhQWMEsP.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.DhQWMEsP.js.gz +0 -0
- package/build/server/chunks/0-DnZ1CmpH.js +0 -9
- package/build/server/chunks/0-DnZ1CmpH.js.map +0 -1
- package/build/server/chunks/1-BW2Kegam.js +0 -9
- package/build/server/chunks/1-BW2Kegam.js.map +0 -1
- package/build/server/chunks/13-DPcsc1p-.js.map +0 -1
- package/build/server/chunks/14-Ddk1gksy.js +0 -9
- package/build/server/chunks/14-Ddk1gksy.js.map +0 -1
- package/build/server/chunks/2-Co5sKQqN.js +0 -9
- package/build/server/chunks/2-Co5sKQqN.js.map +0 -1
- package/build/server/chunks/3-Czp3KEzr.js +0 -9
- package/build/server/chunks/3-Czp3KEzr.js.map +0 -1
- package/build/server/chunks/4-BML64sIA.js +0 -9
- package/build/server/chunks/4-BML64sIA.js.map +0 -1
- package/build/server/chunks/5-9yHXJzTj.js +0 -9
- package/build/server/chunks/5-9yHXJzTj.js.map +0 -1
- package/build/server/chunks/6-uS_X9B0s.js.map +0 -1
- package/build/server/chunks/7-CgqcRvLC.js +0 -9
- package/build/server/chunks/7-CgqcRvLC.js.map +0 -1
- package/build/server/chunks/8-CddjGDu2.js +0 -9
- package/build/server/chunks/8-CddjGDu2.js.map +0 -1
- package/build/server/chunks/9-W6XYayeK.js.map +0 -1
- package/build/server/chunks/ChatStepTrace-B5HQ8Zv3.js.map +0 -1
- package/build/server/chunks/_layout.svelte-Fo2hGNeP.js.map +0 -1
- package/build/server/chunks/_page.svelte-CC26hDwf.js.map +0 -1
- package/build/server/chunks/_page.svelte-Dl3GoTy1.js.map +0 -1
- package/build/server/chunks/_page.svelte-Hg-ZSzf1.js.map +0 -1
- package/build/server/chunks/index3-DeV2OWZf.js.map +0 -1
- /package/build/client/_app/immutable/assets/{14.C5apk4jm.css → 15.C5apk4jm.css} +0 -0
- /package/build/client/_app/immutable/assets/{14.C5apk4jm.css.br → 15.C5apk4jm.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{14.C5apk4jm.css.gz → 15.C5apk4jm.css.gz} +0 -0
- /package/build/client/_app/immutable/assets/{7.DlSPCZj0.css → 8.DlSPCZj0.css} +0 -0
- /package/build/client/_app/immutable/assets/{7.DlSPCZj0.css.br → 8.DlSPCZj0.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{7.DlSPCZj0.css.gz → 8.DlSPCZj0.css.gz} +0 -0
- /package/build/client/_app/immutable/assets/{8.BX46PfEJ.css → 9.BX46PfEJ.css} +0 -0
- /package/build/client/_app/immutable/assets/{8.BX46PfEJ.css.br → 9.BX46PfEJ.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{8.BX46PfEJ.css.gz → 9.BX46PfEJ.css.gz} +0 -0
- /package/build/client/_app/immutable/assets/{bosun-theme.tn0RQdqM.css → Modal.tn0RQdqM.css} +0 -0
- /package/build/client/_app/immutable/assets/{bosun-theme.tn0RQdqM.css.br → Modal.tn0RQdqM.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{bosun-theme.tn0RQdqM.css.gz → Modal.tn0RQdqM.css.gz} +0 -0
- /package/build/client/_app/immutable/assets/{ChatStepTrace.NFJFjHv0.css → chat-content.NFJFjHv0.css} +0 -0
- /package/build/client/_app/immutable/assets/{ChatStepTrace.NFJFjHv0.css.br → chat-content.NFJFjHv0.css.br} +0 -0
- /package/build/client/_app/immutable/assets/{ChatStepTrace.NFJFjHv0.css.gz → chat-content.NFJFjHv0.css.gz} +0 -0
- /package/build/client/_app/immutable/nodes/{9.BVI-eEdV.js → 10.BVI-eEdV.js} +0 -0
- /package/build/client/_app/immutable/nodes/{9.BVI-eEdV.js.br → 10.BVI-eEdV.js.br} +0 -0
- /package/build/client/_app/immutable/nodes/{9.BVI-eEdV.js.gz → 10.BVI-eEdV.js.gz} +0 -0
- /package/build/client/_app/immutable/nodes/{10.BHSGZYEC.js → 11.BHSGZYEC.js} +0 -0
- /package/build/client/_app/immutable/nodes/{10.BHSGZYEC.js.br → 11.BHSGZYEC.js.br} +0 -0
- /package/build/client/_app/immutable/nodes/{10.BHSGZYEC.js.gz → 11.BHSGZYEC.js.gz} +0 -0
- /package/build/client/_app/immutable/nodes/{11.CZ_7M4AF.js → 12.CZ_7M4AF.js} +0 -0
- /package/build/client/_app/immutable/nodes/{11.CZ_7M4AF.js.br → 12.CZ_7M4AF.js.br} +0 -0
- /package/build/client/_app/immutable/nodes/{11.CZ_7M4AF.js.gz → 12.CZ_7M4AF.js.gz} +0 -0
- /package/build/client/_app/immutable/nodes/{12.DRr2l3NZ.js → 13.DRr2l3NZ.js} +0 -0
- /package/build/client/_app/immutable/nodes/{12.DRr2l3NZ.js.br → 13.DRr2l3NZ.js.br} +0 -0
- /package/build/client/_app/immutable/nodes/{12.DRr2l3NZ.js.gz → 13.DRr2l3NZ.js.gz} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DLQqXQ6R.js","../chunks/C1FmrZbK.js","../assets/editor.BMIWPGx3.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Ut=Object.defineProperty;var Vt=(V,R,_)=>R in V?Ut(V,R,{enumerable:!0,configurable:!0,writable:!0,value:_}):V[R]=_;var Ee=(V,R,_)=>Vt(V,typeof R!="symbol"?R+"":R,_);import"../chunks/CWj6FrbW.js";import{o as xt,a as Nt,s as Re,b as Wt}from"../chunks/DQA6NP5y.js";import{p as ut,h as B,e as Ke,i as ke,u as We,f as me,d as ae,r as oe,b as re,c as ft,B as wt,s as ye,n as Be,t as Me,l as Fe,k as Ve,o as Qe,a as Ce,X as $t,bq as Ht,g as Et}from"../chunks/CfbYRn5k.js";import{i as Se}from"../chunks/Dl6q6wVH.js";import{k as Gt,M as qt}from"../chunks/CsYbWoTD.js";import{r as Pt,d as zt,e as at,i as _t,I as Qt}from"../chunks/BCG4zvjp.js";import{s as Yt}from"../chunks/C_ZSt1CI.js";import{a as Jt}from"../chunks/DGa-EyU2.js";import{P as lt,g as Rt,s as Xt}from"../chunks/BA8mqPb-.js";import{B as mt}from"../chunks/wtOMB7ao.js";import{d as kt,e as Zt,f as en,g as tn,D as nn}from"../chunks/Bmb8cHfR.js";import{T as bt,a as et}from"../chunks/JA_7cQFn.js";import{C as rn,P as Ot}from"../chunks/BmadykGs.js";import{g as st,r as on}from"../chunks/C5HWpeo9.js";import{p as $e}from"../chunks/B3ux6SZZ.js";import{t as ct}from"../chunks/BEJ5fU19.js";import{_ as It}from"../chunks/C1FmrZbK.js";import{b as Ft}from"../chunks/Bx2X1niE.js";import{e as Bt,a as Mt,c as sn}from"../chunks/CxPv-oiS.js";import{p as yt}from"../chunks/wDFujNbC.js";import{A as an}from"../chunks/i_HX2z3K.js";import{g as ln}from"../chunks/8B3OPwlB.js";import"../chunks/B5-6Ezv3.js";import{i as cn}from"../chunks/OMeqFb0I.js";import{c as Tt,a as un}from"../chunks/CI-reiW2.js";var fn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pn(V){return V&&V.__esModule&&Object.prototype.hasOwnProperty.call(V,"default")?V.default:V}const hn=globalThis.__sveltekit_jwr3jv.env;class dn{constructor(R){Ee(this,"ws",null);Ee(this,"openHandler",null);Ee(this,"closeHandler",null);Ee(this,"errorHandler",null);Ee(this,"messageHandler",null);Ee(this,"retries",0);Ee(this,"maxRetries",5);Ee(this,"retryDelay",500);Ee(this,"retryTimeout",null);Ee(this,"isOpen",!1);Ee(this,"isDestroyed",!1);Ee(this,"agentsLoaded",!1);Ee(this,"init",()=>{if(!this.isOpen){this.agentsLoaded=!1,console.log(`Initializing websocket connection with [${this.wsUrl}]`);try{this.ws=new WebSocket(this.wsUrl)}catch{this.retryConnect();return}this.isDestroyed=!1,this.ws.onmessage=R=>{var P,O,y,k,f,i,m,T;const _=JSON.parse(R.data);_.channel==="error"?(P=this.errorHandler)==null||P.call(this,_.message):_.channel==="app-events"?(console.log("MSG:",_.event.type),_.event.type==="agents-loaded"&&(this.agentsLoaded=!0)):_.channel==="log"?console.log(`MSG: log [${_.message.severity}]`,_.message.message):_.channel==="api-call-trace"?console.log("MSG: api-call-trace",(O=_.trace)==null?void 0:O.operationName,(y=_.trace)==null?void 0:y.method,(k=_.trace)==null?void 0:k.path):_.channel==="conversational-trace"&&console.log("MSG: conversational-trace",(f=_.trace)==null?void 0:f.eventName,(i=_.trace)==null?void 0:i.role,(m=_.trace)==null?void 0:m.medium),(T=this.messageHandler)==null||T.call(this,_)},this.ws.onerror=R=>{var _;console.error("Websocket error:",R),(_=this.ws)==null||_.close(),this.retryConnect()},this.ws.onclose=()=>{console.log("Websocket closed"),this.isOpen=!1,this.retryConnect()},this.ws.onopen=()=>{var R;this.retries=0,this.isOpen=!0,this.retryTimeout&&clearTimeout(this.retryTimeout),(R=this.openHandler)==null||R.call(this),console.log("Websocket connected")}}});Ee(this,"destroy",()=>{var R;this.isDestroyed=!0,(R=this.ws)==null||R.close()});Ee(this,"onOpen",R=>{this.openHandler=R,this.isOpen&&R()});Ee(this,"onClose",R=>{this.closeHandler=R,this.isOpen||R()});Ee(this,"onError",R=>{this.errorHandler=R});Ee(this,"onMessage",R=>{this.messageHandler=R});Ee(this,"sendMessage",R=>{var _;R.channel,(_=this.ws)==null||_.send(JSON.stringify(R))});Ee(this,"isReady",()=>this.isOpen&&this.agentsLoaded);Ee(this,"retryConnect",()=>{var R,_;this.isDestroyed||(!this.isOpen&&this.retries<this.maxRetries?(this.retries++,this.init(),this.retryTimeout=setTimeout(this.retryConnect,this.retryDelay)):((R=this.errorHandler)==null||R.call(this,"WebSocket Error, please reload the browser"),(_=this.closeHandler)==null||_.call(this)))});this.wsUrl=R}}const vn=hn.PUBLIC_WS_HOST??"ws://localhost:8080",Ze=new dn(vn);var mn=me('<div class="flex h-full flex-col"><div class="h-full w-full"></div></div>');function gn(V,R){ut(R,!0);let _=Ke(null),P=null,O=[],y=!1,k;xt(async()=>{if(!k)return;Bt();const f=await It(()=>import("../chunks/DLQqXQ6R.js").then(i=>i.e),__vite__mapDeps([0,1,2]),import.meta.url);y||(Mt(f),ke(_,f.editor.create(k,{value:R.schema??"",language:"typescript",theme:"bosun-dark",lineNumbers:"off",automaticLayout:!0,minimap:{enabled:!1},matchBrackets:"never",bracketPairColorization:{enabled:!1},guides:{highlightActiveBracketPair:!1,bracketPairs:!1,bracketPairsHorizontal:!1},occurrencesHighlight:"off",selectionHighlight:!1,unicodeHighlight:{ambiguousCharacters:!1,nonBasicASCII:!1,invisibleCharacters:!1,includeStrings:!1,includeComments:!1},autoClosingQuotes:"never"}),!0),P=B(_).getModel(),O.push(B(_).onDidChangeModelContent(()=>{if(!B(_))return;const i=B(_).getValue();i!==R.schema&&R.onChange(i)})))}),Nt(()=>{y=!0;for(const i of O)try{i.dispose()}catch{}O=[];const f=P;P=null;try{if(B(_)){try{B(_).setModel(null)}catch{}B(_).dispose()}}finally{ke(_,null)}try{f==null||f.dispose()}catch{}}),We(()=>{if(!B(_))return;const f=R.schema??"";B(_).getValue()!==f&&B(_).setValue(f)}),lt(V,{get class(){return`overflow-hidden ${R.class??""}`},children:(f,i)=>{var m=mn(),T=ae(m);Ft(T,D=>k=D,()=>k),oe(m),re(f,m)}}),ft()}function yn(V,R){return V.languages.registerCompletionItemProvider("markdown",{triggerCharacters:[" ","."],provideCompletionItems:(_,P)=>{const O=_.getValueInRange({startLineNumber:P.lineNumber,startColumn:1,endLineNumber:P.lineNumber,endColumn:P.column}),y=O.match(/\{%\s*(if|elif|for)\s+([^%]*)$/),k=O.match(/\{\{\s*([^}]*)$/);if(y||k){let i="";y?i=y[2].trim():k&&(i=k[1].trim());const{keys:m,lastPartLength:T}=_n(R,i);return{suggestions:m.map(K=>({label:K,kind:V.languages.CompletionItemKind.Variable,insertText:K,range:{startLineNumber:P.lineNumber,endLineNumber:P.lineNumber,startColumn:P.column-T,endColumn:P.column}}))}}const f=O.match(/\{%\s*([^%]*)$/);if(f){const i=f[1].trim();return{suggestions:["if","elif","else","endif","for","endfor"].filter(T=>T.startsWith(i)).map((T,D)=>({label:T,kind:V.languages.CompletionItemKind.Keyword,insertText:T,sortText:String(D).padStart(2,"0"),range:{startLineNumber:P.lineNumber,endLineNumber:P.lineNumber,startColumn:P.column-i.length,endColumn:P.column}}))}}return{suggestions:[]}}})}function _n(V,R){let _=V,P=[],O=0;if(R==="")P=Object.keys(V??{}),O=0;else if(R.includes(".")){const y=R.split("."),k=y.pop()||"";O=k.length;for(const f of y)if(_&&typeof _=="object"&&f in _)_=_[f];else{_=null;break}_&&typeof _=="object"&&(P=Object.keys(_).filter(f=>f.startsWith(k)))}else O=R.length,P=Object.keys(V??{}).filter(y=>y.startsWith(R));return{keys:P,lastPartLength:O}}var Kt={exports:{}};/*! Browser bundle of nunjucks 3.2.4 */(function(V,R){(function(P,O){V.exports=O()})(typeof self<"u"?self:fn,function(){return function(_){var P={};function O(y){if(P[y])return P[y].exports;var k=P[y]={i:y,l:!1,exports:{}};return _[y].call(k.exports,k,k.exports,O),k.l=!0,k.exports}return O.m=_,O.c=P,O.d=function(y,k,f){O.o(y,k)||Object.defineProperty(y,k,{configurable:!1,enumerable:!0,get:f})},O.n=function(y){var k=y&&y.__esModule?function(){return y.default}:function(){return y};return O.d(k,"a",k),k},O.o=function(y,k){return Object.prototype.hasOwnProperty.call(y,k)},O.p="",O(O.s=11)}([function(_,m,O){var y=Array.prototype,k=Object.prototype,f={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},i=/[&"'<>\\]/g,m=_.exports={};function T(d,A){return k.hasOwnProperty.call(d,A)}m.hasOwnProp=T;function D(d){return f[d]}function K(d,A,j){if(j.Update||(j=new m.TemplateError(j)),j.Update(d),!A){var U=j;j=new Error(U.message),j.name=U.name}return j}m._prettifyError=K;function I(d,A,j){var U,z;d instanceof Error&&(z=d,d=z.name+": "+z.message),Object.setPrototypeOf?(U=new Error(d),Object.setPrototypeOf(U,I.prototype)):(U=this,Object.defineProperty(U,"message",{enumerable:!1,writable:!0,value:d})),Object.defineProperty(U,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(U,this.constructor);var ie;if(z){var G=Object.getOwnPropertyDescriptor(z,"stack");ie=G&&(G.get||function(){return G.value}),ie||(ie=function(){return z.stack})}else{var le=new Error(d).stack;ie=function(){return le}}return Object.defineProperty(U,"stack",{get:function(){return ie.call(U)}}),Object.defineProperty(U,"cause",{value:z}),U.lineno=A,U.colno=j,U.firstUpdate=!0,U.Update=function(Z){var ce="("+(Z||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?ce+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(ce+=" [Line "+this.lineno+"]")),ce+=`
|
|
3
|
+
`,this.firstUpdate&&(ce+=" "),this.message=ce+(this.message||""),this.firstUpdate=!1,this},U}Object.setPrototypeOf?Object.setPrototypeOf(I.prototype,Error.prototype):I.prototype=Object.create(Error.prototype,{constructor:{value:I}}),m.TemplateError=I;function x(d){return d.replace(i,D)}m.escape=x;function C(d){return k.toString.call(d)==="[object Function]"}m.isFunction=C;function e(d){return k.toString.call(d)==="[object Array]"}m.isArray=e;function n(d){return k.toString.call(d)==="[object String]"}m.isString=n;function r(d){return k.toString.call(d)==="[object Object]"}m.isObject=r;function h(d){return d?typeof d=="string"?d.split("."):[d]:[]}function c(d){var A=h(d);return function(U){for(var z=U,ie=0;ie<A.length;ie++){var G=A[ie];if(T(z,G))z=z[G];else return}return z}}m.getAttrGetter=c;function p(d,A,j){for(var U={},z=C(A)?A:c(A),ie=0;ie<d.length;ie++){var G=d[ie],le=z(G,ie);if(le===void 0&&j===!0)throw new TypeError('groupby: attribute "'+A+'" resolved to undefined');(U[le]||(U[le]=[])).push(G)}return U}m.groupBy=p;function t(d){return Array.prototype.slice.call(d)}m.toArray=t;function o(d){var A=[];if(!d)return A;for(var j=d.length,U=t(arguments).slice(1),z=-1;++z<j;)w(U,d[z])===-1&&A.push(d[z]);return A}m.without=o;function l(d,A){for(var j="",U=0;U<A;U++)j+=d;return j}m.repeat=l;function s(d,A,j){if(d!=null){if(y.forEach&&d.forEach===y.forEach)d.forEach(A,j);else if(d.length===+d.length)for(var U=0,z=d.length;U<z;U++)A.call(j,d[U],U,d)}}m.each=s;function a(d,A){var j=[];if(d==null)return j;if(y.map&&d.map===y.map)return d.map(A);for(var U=0;U<d.length;U++)j[j.length]=A(d[U],U);return d.length===+d.length&&(j.length=d.length),j}m.map=a;function v(d,A,j){var U=-1;function z(){U++,U<d.length?A(d[U],U,z,j):j()}z()}m.asyncIter=v;function u(d,A,j){var U=S(d||{}),z=U.length,ie=-1;function G(){ie++;var le=U[ie];ie<z?A(le,d[le],ie,z,G):j()}G()}m.asyncFor=u;function w(d,A,j){return Array.prototype.indexOf.call(d||[],A,j)}m.indexOf=w;function S(d){var A=[];for(var j in d)T(d,j)&&A.push(j);return A}m.keys=S;function L(d){return S(d).map(function(A){return[A,d[A]]})}m._entries=L;function N(d){return S(d).map(function(A){return d[A]})}m._values=N;function F(d,A){return d=d||{},S(A).forEach(function(j){d[j]=A[j]}),d}m._assign=m.extend=F;function g(d,A){if(e(A)||n(A))return A.indexOf(d)!==-1;if(r(A))return d in A;throw new Error('Cannot use "in" operator to search for "'+d+'" in unexpected types.')}m.inOperator=g},function(_,P,O){function y(n,r){for(var h=0;h<r.length;h++){var c=r[h];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(n,f(c.key),c)}}function k(n,r,h){return r&&y(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n}function f(n){var r=i(n,"string");return typeof r=="symbol"?r:String(r)}function i(n,r){if(typeof n!="object"||n===null)return n;var h=n[Symbol.toPrimitive];if(h!==void 0){var c=h.call(n,r);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function m(n,r){n.prototype=Object.create(r.prototype),n.prototype.constructor=n,T(n,r)}function T(n,r){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,p){return c.__proto__=p,c},T(n,r)}var D=O(16),K=O(0);function I(n,r){return typeof n!="function"||typeof r!="function"?r:function(){var c=this.parent;this.parent=n;var p=r.apply(this,arguments);return this.parent=c,p}}function x(n,r,h){h=h||{},K.keys(h).forEach(function(p){h[p]=I(n.prototype[p],h[p])});var c=function(p){m(t,p);function t(){return p.apply(this,arguments)||this}return k(t,[{key:"typename",get:function(){return r}}]),t}(n);return K._assign(c.prototype,h),c}var C=function(){function n(){this.init.apply(this,arguments)}var r=n.prototype;return r.init=function(){},n.extend=function(c,p){return typeof c=="object"&&(p=c,c="anonymous"),x(this,c,p)},k(n,[{key:"typename",get:function(){return this.constructor.name}}]),n}(),e=function(n){m(r,n);function r(){var c,p;return p=n.call(this)||this,(c=p).init.apply(c,arguments),p}var h=r.prototype;return h.init=function(){},r.extend=function(p,t){return typeof p=="object"&&(t=p,p="anonymous"),x(this,p,t)},k(r,[{key:"typename",get:function(){return this.constructor.name}}]),r}(D);_.exports={Obj:C,EmitterObj:e}},function(_,P,O){var y=O(0),k=Array.from,f=typeof Symbol=="function"&&Symbol.iterator&&typeof k=="function",i=function(){function a(u,w){this.variables=Object.create(null),this.parent=u,this.topLevel=!1,this.isolateWrites=w}var v=a.prototype;return v.set=function(w,S,L){var N=w.split("."),F=this.variables,g=this;if(L&&(g=this.resolve(N[0],!0))){g.set(w,S);return}for(var d=0;d<N.length-1;d++){var A=N[d];F[A]||(F[A]={}),F=F[A]}F[N[N.length-1]]=S},v.get=function(w){var S=this.variables[w];return S!==void 0?S:null},v.lookup=function(w){var S=this.parent,L=this.variables[w];return L!==void 0?L:S&&S.lookup(w)},v.resolve=function(w,S){var L=S&&this.isolateWrites?void 0:this.parent,N=this.variables[w];return N!==void 0?this:L&&L.resolve(w)},v.push=function(w){return new a(this,w)},v.pop=function(){return this.parent},a}();function m(a,v,u){return function(){for(var S=arguments.length,L=new Array(S),N=0;N<S;N++)L[N]=arguments[N];var F=I(L),g,d=K(L);if(F>a.length)g=L.slice(0,a.length),L.slice(g.length,F).forEach(function(U,z){z<v.length&&(d[v[z]]=U)}),g.push(d);else if(F<a.length){g=L.slice(0,F);for(var A=F;A<a.length;A++){var j=a[A];g.push(d[j]),delete d[j]}g.push(d)}else g=L;return u.apply(this,g)}}function T(a){return a.__keywords=!0,a}function D(a){return a&&Object.prototype.hasOwnProperty.call(a,"__keywords")}function K(a){var v=a.length;if(v){var u=a[v-1];if(D(u))return u}return{}}function I(a){var v=a.length;if(v===0)return 0;var u=a[v-1];return D(u)?v-1:v}function x(a){if(typeof a!="string")return a;this.val=a,this.length=a.length}x.prototype=Object.create(String.prototype,{length:{writable:!0,configurable:!0,value:0}}),x.prototype.valueOf=function(){return this.val},x.prototype.toString=function(){return this.val};function C(a,v){return a instanceof x?new x(v):v.toString()}function e(a){var v=typeof a;return v==="string"?new x(a):v!=="function"?a:function(w){var S=a.apply(this,arguments);return typeof S=="string"?new x(S):S}}function n(a,v){return a=a??"",v&&!(a instanceof x)&&(a=y.escape(a.toString())),a}function r(a,v,u){if(a==null)throw new y.TemplateError("attempted to output null or undefined value",v+1,u+1);return a}function h(a,v){if(a!=null)return typeof a[v]=="function"?function(){for(var u=arguments.length,w=new Array(u),S=0;S<u;S++)w[S]=arguments[S];return a[v].apply(a,w)}:a[v]}function c(a,v,u,w){if(a){if(typeof a!="function")throw new Error("Unable to call `"+v+"`, which is not a function")}else throw new Error("Unable to call `"+v+"`, which is undefined or falsey");return a.apply(u,w)}function p(a,v,u){var w=v.lookup(u);return w!==void 0?w:a.lookup(u)}function t(a,v,u){return a.lineno?a:new y.TemplateError(a,v,u)}function o(a,v,u,w){if(y.isArray(a)){var S=a.length;y.asyncIter(a,function(N,F,g){switch(v){case 1:u(N,F,S,g);break;case 2:u(N[0],N[1],F,S,g);break;case 3:u(N[0],N[1],N[2],F,S,g);break;default:N.push(F,S,g),u.apply(this,N)}},w)}else y.asyncFor(a,function(N,F,g,d,A){u(N,F,g,d,A)},w)}function l(a,v,u,w){var S=0,L,N;function F(z,ie){S++,N[z]=ie,S===L&&w(null,N.join(""))}if(y.isArray(a))if(L=a.length,N=new Array(L),L===0)w(null,"");else for(var g=0;g<a.length;g++){var d=a[g];switch(v){case 1:u(d,g,L,F);break;case 2:u(d[0],d[1],g,L,F);break;case 3:u(d[0],d[1],d[2],g,L,F);break;default:d.push(g,L,F),u.apply(this,d)}}else{var A=y.keys(a||{});if(L=A.length,N=new Array(L),L===0)w(null,"");else for(var j=0;j<A.length;j++){var U=A[j];u(U,a[U],j,L,F)}}}function s(a){return typeof a!="object"||a===null||y.isArray(a)?a:f&&Symbol.iterator in a?k(a):a}_.exports={Frame:i,makeMacro:m,makeKeywordArgs:T,numArgs:I,suppressValue:n,ensureDefined:r,memberLookup:h,contextOrFrameLookup:p,callWrap:c,handleError:t,isArray:y.isArray,keys:y.keys,SafeString:x,copySafeness:C,markSafe:e,asyncEach:o,asyncAll:l,inOperator:y.inOperator,fromIterator:s}},function(_,P,O){function y(X,ee){for(var ve=0;ve<ee.length;ve++){var de=ee[ve];de.enumerable=de.enumerable||!1,de.configurable=!0,"value"in de&&(de.writable=!0),Object.defineProperty(X,f(de.key),de)}}function k(X,ee,ve){return ee&&y(X.prototype,ee),Object.defineProperty(X,"prototype",{writable:!1}),X}function f(X){var ee=i(X,"string");return typeof ee=="symbol"?ee:String(ee)}function i(X,ee){if(typeof X!="object"||X===null)return X;var ve=X[Symbol.toPrimitive];if(ve!==void 0){var de=ve.call(X,ee);if(typeof de!="object")return de;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(X)}function m(X,ee){X.prototype=Object.create(ee.prototype),X.prototype.constructor=X,T(X,ee)}function T(X,ee){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(de,E){return de.__proto__=E,de},T(X,ee)}var D=O(1),K=D.Obj;function I(X,ee,ve){X instanceof ee&&ve.push(X),X instanceof x&&X.findAll(ee,ve)}var x=function(X){m(ee,X);function ee(){return X.apply(this,arguments)||this}var ve=ee.prototype;return ve.init=function(E,W){for(var H=arguments,se=this,fe=arguments.length,xe=new Array(fe>2?fe-2:0),Ae=2;Ae<fe;Ae++)xe[Ae-2]=arguments[Ae];this.lineno=E,this.colno=W,this.fields.forEach(function(Oe,Ue){var Ie=H[Ue+2];Ie===void 0&&(Ie=null),se[Oe]=Ie})},ve.findAll=function(E,W){var H=this;return W=W||[],this instanceof e?this.children.forEach(function(se){return I(se,E,W)}):this.fields.forEach(function(se){return I(H[se],E,W)}),W},ve.iterFields=function(E){var W=this;this.fields.forEach(function(H){E(W[H],H)})},ee}(K),C=function(X){m(ee,X);function ee(){return X.apply(this,arguments)||this}return k(ee,[{key:"typename",get:function(){return"Value"}},{key:"fields",get:function(){return["value"]}}]),ee}(x),e=function(X){m(ee,X);function ee(){return X.apply(this,arguments)||this}var ve=ee.prototype;return ve.init=function(E,W,H){X.prototype.init.call(this,E,W,H||[])},ve.addChild=function(E){this.children.push(E)},k(ee,[{key:"typename",get:function(){return"NodeList"}},{key:"fields",get:function(){return["children"]}}]),ee}(x),n=e.extend("Root"),r=C.extend("Literal"),h=C.extend("Symbol"),c=e.extend("Group"),p=e.extend("Array"),t=x.extend("Pair",{fields:["key","value"]}),o=e.extend("Dict"),l=x.extend("LookupVal",{fields:["target","val"]}),s=x.extend("If",{fields:["cond","body","else_"]}),a=s.extend("IfAsync"),v=x.extend("InlineIf",{fields:["cond","body","else_"]}),u=x.extend("For",{fields:["arr","name","body","else_"]}),w=u.extend("AsyncEach"),S=u.extend("AsyncAll"),L=x.extend("Macro",{fields:["name","args","body"]}),N=L.extend("Caller"),F=x.extend("Import",{fields:["template","target","withContext"]}),g=function(X){m(ee,X);function ee(){return X.apply(this,arguments)||this}var ve=ee.prototype;return ve.init=function(E,W,H,se,fe){X.prototype.init.call(this,E,W,H,se||new e,fe)},k(ee,[{key:"typename",get:function(){return"FromImport"}},{key:"fields",get:function(){return["template","names","withContext"]}}]),ee}(x),d=x.extend("FunCall",{fields:["name","args"]}),A=d.extend("Filter"),j=A.extend("FilterAsync",{fields:["name","args","symbol"]}),U=o.extend("KeywordArgs"),z=x.extend("Block",{fields:["name","body"]}),ie=x.extend("Super",{fields:["blockName","symbol"]}),G=x.extend("TemplateRef",{fields:["template"]}),le=G.extend("Extends"),be=x.extend("Include",{fields:["template","ignoreMissing"]}),Z=x.extend("Set",{fields:["targets","value"]}),ce=x.extend("Switch",{fields:["expr","cases","default"]}),Q=x.extend("Case",{fields:["cond","body"]}),J=e.extend("Output"),Y=x.extend("Capture",{fields:["body"]}),pe=r.extend("TemplateData"),we=x.extend("UnaryOp",{fields:["target"]}),_e=x.extend("BinOp",{fields:["left","right"]}),Le=_e.extend("In"),b=_e.extend("Is"),M=_e.extend("Or"),q=_e.extend("And"),$=we.extend("Not"),te=_e.extend("Add"),ne=_e.extend("Concat"),he=_e.extend("Sub"),ue=_e.extend("Mul"),ge=_e.extend("Div"),Ne=_e.extend("FloorDiv"),Pe=_e.extend("Mod"),De=_e.extend("Pow"),gt=we.extend("Neg"),pt=we.extend("Pos"),rt=x.extend("Compare",{fields:["expr","ops"]}),it=x.extend("CompareOperand",{fields:["expr","type"]}),ot=x.extend("CallExtension",{init:function(ee,ve,de,E){this.parent(),this.extName=ee.__name||ee,this.prop=ve,this.args=de||new e,this.contentArgs=E||[],this.autoescape=ee.autoescape},fields:["extName","prop","args","contentArgs"]}),ht=ot.extend("CallExtensionAsync");function ze(X,ee,ve){var de=X.split(`
|
|
4
|
+
`);de.forEach(function(E,W){E&&(ve&&W>0||!ve)&&process.stdout.write(" ".repeat(ee));var H=W===de.length-1?"":`
|
|
5
|
+
`;process.stdout.write(""+E+H)})}function Ye(X,ee){if(ee=ee||0,ze(X.typename+": ",ee),X instanceof e)ze(`
|
|
6
|
+
`),X.children.forEach(function(E){Ye(E,ee+2)});else if(X instanceof ot)ze(X.extName+"."+X.prop+`
|
|
7
|
+
`),X.args&&Ye(X.args,ee+2),X.contentArgs&&X.contentArgs.forEach(function(E){Ye(E,ee+2)});else{var ve=[],de=null;X.iterFields(function(E,W){E instanceof x?ve.push([W,E]):(de=de||{},de[W]=E)}),de?ze(JSON.stringify(de,null,2)+`
|
|
8
|
+
`,null,!0):ze(`
|
|
9
|
+
`),ve.forEach(function(E){var W=E[0],H=E[1];ze("["+W+"] =>",ee+2),Ye(H,ee+4)})}}_.exports={Node:x,Root:n,NodeList:e,Value:C,Literal:r,Symbol:h,Group:c,Array:p,Pair:t,Dict:o,Output:J,Capture:Y,TemplateData:pe,If:s,IfAsync:a,InlineIf:v,For:u,AsyncEach:w,AsyncAll:S,Macro:L,Caller:N,Import:F,FromImport:g,FunCall:d,Filter:A,FilterAsync:j,KeywordArgs:U,Block:z,Super:ie,Extends:le,Include:be,Set:Z,Switch:ce,Case:Q,LookupVal:l,BinOp:_e,In:Le,Is:b,Or:M,And:q,Not:$,Add:te,Concat:ne,Sub:he,Mul:ue,Div:ge,FloorDiv:Ne,Mod:Pe,Pow:De,Neg:gt,Pos:pt,Compare:rt,CompareOperand:it,CallExtension:ot,CallExtensionAsync:ht,printNodes:Ye}},function(_,P){},function(_,P,O){function y(r,h){r.prototype=Object.create(h.prototype),r.prototype.constructor=r,k(r,h)}function k(r,h){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,t){return p.__proto__=t,p},k(r,h)}var f=O(8),i=O(17),m=O(3),T=O(0),D=T.TemplateError,K=O(2),I=K.Frame,x=O(1),C=x.Obj,e={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},n=function(r){y(h,r);function h(){return r.apply(this,arguments)||this}var c=h.prototype;return c.init=function(t,o){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=o},c.fail=function(t,o,l){throw o!==void 0&&(o+=1),l!==void 0&&(l+=1),new D(t,o,l)},c._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},c._popBuffer=function(){this.buffer=this.bufferStack.pop()},c._emit=function(t){this.codebuf.push(t)},c._emitLine=function(t){this._emit(t+`
|
|
10
|
+
`)},c._emitLines=function(){for(var t=this,o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];l.forEach(function(a){return t._emitLine(a)})},c._emitFuncBegin=function(t,o){this.buffer="output",this._scopeClosers="",this._emitLine("function "+o+"(env, context, frame, runtime, cb) {"),this._emitLine("var lineno = "+t.lineno+";"),this._emitLine("var colno = "+t.colno+";"),this._emitLine("var "+this.buffer+' = "";'),this._emitLine("try {")},c._emitFuncEnd=function(t){t||this._emitLine("cb(null, "+this.buffer+");"),this._closeScopeLevels(),this._emitLine("} catch (e) {"),this._emitLine(" cb(runtime.handleError(e, lineno, colno));"),this._emitLine("}"),this._emitLine("}"),this.buffer=null},c._addScopeLevel=function(){this._scopeClosers+="})"},c._closeScopeLevels=function(){this._emitLine(this._scopeClosers+";"),this._scopeClosers=""},c._withScopedSyntax=function(t){var o=this._scopeClosers;this._scopeClosers="",t.call(this),this._closeScopeLevels(),this._scopeClosers=o},c._makeCallback=function(t){var o=this._tmpid();return"function("+o+(t?","+t:"")+`) {
|
|
11
|
+
if(`+o+") { cb("+o+"); return; }"},c._tmpid=function(){return this.lastId++,"t_"+this.lastId},c._templateName=function(){return this.templateName==null?"undefined":JSON.stringify(this.templateName)},c._compileChildren=function(t,o){var l=this;t.children.forEach(function(s){l.compile(s,o)})},c._compileAggregate=function(t,o,l,s){var a=this;l&&this._emit(l),t.children.forEach(function(v,u){u>0&&a._emit(","),a.compile(v,o)}),s&&this._emit(s)},c._compileExpression=function(t,o){this.assertType(t,m.Literal,m.Symbol,m.Group,m.Array,m.Dict,m.FunCall,m.Caller,m.Filter,m.LookupVal,m.Compare,m.InlineIf,m.In,m.Is,m.And,m.Or,m.Not,m.Add,m.Concat,m.Sub,m.Mul,m.Div,m.FloorDiv,m.Mod,m.Pow,m.Neg,m.Pos,m.Compare,m.NodeList),this.compile(t,o)},c.assertType=function(t){for(var o=arguments.length,l=new Array(o>1?o-1:0),s=1;s<o;s++)l[s-1]=arguments[s];l.some(function(a){return t instanceof a})||this.fail("assertType: invalid type: "+t.typename,t.lineno,t.colno)},c.compileCallExtension=function(t,o,l){var s=this,a=t.args,v=t.contentArgs,u=typeof t.autoescape=="boolean"?t.autoescape:!0;if(l||this._emit(this.buffer+" += runtime.suppressValue("),this._emit('env.getExtension("'+t.extName+'")["'+t.prop+'"]('),this._emit("context"),(a||v)&&this._emit(","),a&&(a instanceof m.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),a.children.forEach(function(S,L){s._compileExpression(S,o),(L!==a.children.length-1||v.length)&&s._emit(",")})),v.length&&v.forEach(function(S,L){if(L>0&&s._emit(","),S){s._emitLine("function(cb) {"),s._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var N=s._pushBuffer();s._withScopedSyntax(function(){s.compile(S,o),s._emitLine("cb(null, "+N+");")}),s._popBuffer(),s._emitLine("return "+N+";"),s._emitLine("}")}else s._emit("null")}),l){var w=this._tmpid();this._emitLine(", "+this._makeCallback(w)),this._emitLine(this.buffer+" += runtime.suppressValue("+w+", "+u+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+u+` && env.opts.autoescape);
|
|
12
|
+
`)},c.compileCallExtensionAsync=function(t,o){this.compileCallExtension(t,o,!0)},c.compileNodeList=function(t,o){this._compileChildren(t,o)},c.compileLiteral=function(t){if(typeof t.value=="string"){var o=t.value.replace(/\\/g,"\\\\");o=o.replace(/"/g,'\\"'),o=o.replace(/\n/g,"\\n"),o=o.replace(/\r/g,"\\r"),o=o.replace(/\t/g,"\\t"),o=o.replace(/\u2028/g,"\\u2028"),this._emit('"'+o+'"')}else t.value===null?this._emit("null"):this._emit(t.value.toString())},c.compileSymbol=function(t,o){var l=t.value,s=o.lookup(l);s?this._emit(s):this._emit('runtime.contextOrFrameLookup(context, frame, "'+l+'")')},c.compileGroup=function(t,o){this._compileAggregate(t,o,"(",")")},c.compileArray=function(t,o){this._compileAggregate(t,o,"[","]")},c.compileDict=function(t,o){this._compileAggregate(t,o,"{","}")},c.compilePair=function(t,o){var l=t.key,s=t.value;l instanceof m.Symbol?l=new m.Literal(l.lineno,l.colno,l.value):l instanceof m.Literal&&typeof l.value=="string"||this.fail("compilePair: Dict keys must be strings or names",l.lineno,l.colno),this.compile(l,o),this._emit(": "),this._compileExpression(s,o)},c.compileInlineIf=function(t,o){this._emit("("),this.compile(t.cond,o),this._emit("?"),this.compile(t.body,o),this._emit(":"),t.else_!==null?this.compile(t.else_,o):this._emit('""'),this._emit(")")},c.compileIn=function(t,o){this._emit("runtime.inOperator("),this.compile(t.left,o),this._emit(","),this.compile(t.right,o),this._emit(")")},c.compileIs=function(t,o){var l=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+l+'").call(context, '),this.compile(t.left,o),t.right.args&&(this._emit(","),this.compile(t.right.args,o)),this._emit(") === true")},c._binOpEmitter=function(t,o,l){this.compile(t.left,o),this._emit(l),this.compile(t.right,o)},c.compileOr=function(t,o){return this._binOpEmitter(t,o," || ")},c.compileAnd=function(t,o){return this._binOpEmitter(t,o," && ")},c.compileAdd=function(t,o){return this._binOpEmitter(t,o," + ")},c.compileConcat=function(t,o){return this._binOpEmitter(t,o,' + "" + ')},c.compileSub=function(t,o){return this._binOpEmitter(t,o," - ")},c.compileMul=function(t,o){return this._binOpEmitter(t,o," * ")},c.compileDiv=function(t,o){return this._binOpEmitter(t,o," / ")},c.compileMod=function(t,o){return this._binOpEmitter(t,o," % ")},c.compileNot=function(t,o){this._emit("!"),this.compile(t.target,o)},c.compileFloorDiv=function(t,o){this._emit("Math.floor("),this.compile(t.left,o),this._emit(" / "),this.compile(t.right,o),this._emit(")")},c.compilePow=function(t,o){this._emit("Math.pow("),this.compile(t.left,o),this._emit(", "),this.compile(t.right,o),this._emit(")")},c.compileNeg=function(t,o){this._emit("-"),this.compile(t.target,o)},c.compilePos=function(t,o){this._emit("+"),this.compile(t.target,o)},c.compileCompare=function(t,o){var l=this;this.compile(t.expr,o),t.ops.forEach(function(s){l._emit(" "+e[s.type]+" "),l.compile(s.expr,o)})},c.compileLookupVal=function(t,o){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,o),this._emit("),"),this._compileExpression(t.val,o),this._emit(")")},c._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},c.compileFunCall=function(t,o){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,o),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,o,"[","])"),this._emit(")")},c.compileFilter=function(t,o){var l=t.name;this.assertType(l,m.Symbol),this._emit('env.getFilter("'+l.value+'").call(context, '),this._compileAggregate(t.args,o),this._emit(")")},c.compileFilterAsync=function(t,o){var l=t.name,s=t.symbol.value;this.assertType(l,m.Symbol),o.set(s,s),this._emit('env.getFilter("'+l.value+'").call(context, '),this._compileAggregate(t.args,o),this._emitLine(", "+this._makeCallback(s)),this._addScopeLevel()},c.compileKeywordArgs=function(t,o){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,o),this._emit(")")},c.compileSet=function(t,o){var l=this,s=[];t.targets.forEach(function(a){var v=a.value,u=o.lookup(v);u==null&&(u=l._tmpid(),l._emitLine("var "+u+";")),s.push(u)}),t.value?(this._emit(s.join(" = ")+" = "),this._compileExpression(t.value,o),this._emitLine(";")):(this._emit(s.join(" = ")+" = "),this.compile(t.body,o),this._emitLine(";")),t.targets.forEach(function(a,v){var u=s[v],w=a.value;l._emitLine('frame.set("'+w+'", '+u+", true);"),l._emitLine("if(frame.topLevel) {"),l._emitLine('context.setVariable("'+w+'", '+u+");"),l._emitLine("}"),w.charAt(0)!=="_"&&(l._emitLine("if(frame.topLevel) {"),l._emitLine('context.addExport("'+w+'", '+u+");"),l._emitLine("}"))})},c.compileSwitch=function(t,o){var l=this;this._emit("switch ("),this.compile(t.expr,o),this._emit(") {"),t.cases.forEach(function(s,a){l._emit("case "),l.compile(s.cond,o),l._emit(": "),l.compile(s.body,o),s.body.children.length&&l._emitLine("break;")}),t.default&&(this._emit("default:"),this.compile(t.default,o)),this._emit("}")},c.compileIf=function(t,o,l){var s=this;this._emit("if("),this._compileExpression(t.cond,o),this._emitLine(") {"),this._withScopedSyntax(function(){s.compile(t.body,o),l&&s._emit("cb()")}),t.else_?(this._emitLine(`}
|
|
13
|
+
else {`),this._withScopedSyntax(function(){s.compile(t.else_,o),l&&s._emit("cb()")})):l&&(this._emitLine(`}
|
|
14
|
+
else {`),this._emit("cb()")),this._emitLine("}")},c.compileIfAsync=function(t,o){this._emit("(function(cb) {"),this.compileIf(t,o,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},c._emitLoopBindings=function(t,o,l,s){var a=this,v=[{name:"index",val:l+" + 1"},{name:"index0",val:l},{name:"revindex",val:s+" - "+l},{name:"revindex0",val:s+" - "+l+" - 1"},{name:"first",val:l+" === 0"},{name:"last",val:l+" === "+s+" - 1"},{name:"length",val:s}];v.forEach(function(u){a._emitLine('frame.set("loop.'+u.name+'", '+u.val+");")})},c.compileFor=function(t,o){var l=this,s=this._tmpid(),a=this._tmpid(),v=this._tmpid();if(o=o.push(),this._emitLine("frame = frame.push();"),this._emit("var "+v+" = "),this._compileExpression(t.arr,o),this._emitLine(";"),this._emit("if("+v+") {"),this._emitLine(v+" = runtime.fromIterator("+v+");"),t.name instanceof m.Array){this._emitLine("var "+s+";"),this._emitLine("if(runtime.isArray("+v+")) {"),this._emitLine("var "+a+" = "+v+".length;"),this._emitLine("for("+s+"=0; "+s+" < "+v+".length; "+s+"++) {"),t.name.children.forEach(function(g,d){var A=l._tmpid();l._emitLine("var "+A+" = "+v+"["+s+"]["+d+"];"),l._emitLine('frame.set("'+g+'", '+v+"["+s+"]["+d+"]);"),o.set(t.name.children[d].value,A)}),this._emitLoopBindings(t,v,s,a),this._withScopedSyntax(function(){l.compile(t.body,o)}),this._emitLine("}"),this._emitLine("} else {");var u=t.name.children,w=u[0],S=u[1],L=this._tmpid(),N=this._tmpid();o.set(w.value,L),o.set(S.value,N),this._emitLine(s+" = -1;"),this._emitLine("var "+a+" = runtime.keys("+v+").length;"),this._emitLine("for(var "+L+" in "+v+") {"),this._emitLine(s+"++;"),this._emitLine("var "+N+" = "+v+"["+L+"];"),this._emitLine('frame.set("'+w.value+'", '+L+");"),this._emitLine('frame.set("'+S.value+'", '+N+");"),this._emitLoopBindings(t,v,s,a),this._withScopedSyntax(function(){l.compile(t.body,o)}),this._emitLine("}"),this._emitLine("}")}else{var F=this._tmpid();o.set(t.name.value,F),this._emitLine("var "+a+" = "+v+".length;"),this._emitLine("for(var "+s+"=0; "+s+" < "+v+".length; "+s+"++) {"),this._emitLine("var "+F+" = "+v+"["+s+"];"),this._emitLine('frame.set("'+t.name.value+'", '+F+");"),this._emitLoopBindings(t,v,s,a),this._withScopedSyntax(function(){l.compile(t.body,o)}),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+a+") {"),this.compile(t.else_,o),this._emitLine("}")),this._emitLine("frame = frame.pop();")},c._compileAsyncLoop=function(t,o,l){var s=this,a=this._tmpid(),v=this._tmpid(),u=this._tmpid(),w=l?"asyncAll":"asyncEach";if(o=o.push(),this._emitLine("frame = frame.push();"),this._emit("var "+u+" = runtime.fromIterator("),this._compileExpression(t.arr,o),this._emitLine(");"),t.name instanceof m.Array){var S=t.name.children.length;this._emit("runtime."+w+"("+u+", "+S+", function("),t.name.children.forEach(function(F){s._emit(F.value+",")}),this._emit(a+","+v+",next) {"),t.name.children.forEach(function(F){var g=F.value;o.set(g,g),s._emitLine('frame.set("'+g+'", '+g+");")})}else{var L=t.name.value;this._emitLine("runtime."+w+"("+u+", 1, function("+L+", "+a+", "+v+",next) {"),this._emitLine('frame.set("'+L+'", '+L+");"),o.set(L,L)}this._emitLoopBindings(t,u,a,v),this._withScopedSyntax(function(){var F;l&&(F=s._pushBuffer()),s.compile(t.body,o),s._emitLine("next("+a+(F?","+F:"")+");"),l&&s._popBuffer()});var N=this._tmpid();this._emitLine("}, "+this._makeCallback(N)),this._addScopeLevel(),l&&this._emitLine(this.buffer+" += "+N+";"),t.else_&&(this._emitLine("if (!"+u+".length) {"),this.compile(t.else_,o),this._emitLine("}")),this._emitLine("frame = frame.pop();")},c.compileAsyncEach=function(t,o){this._compileAsyncLoop(t,o)},c.compileAsyncAll=function(t,o){this._compileAsyncLoop(t,o,!0)},c._compileMacro=function(t,o){var l=this,s=[],a=null,v="macro_"+this._tmpid(),u=o!==void 0;t.args.children.forEach(function(g,d){d===t.args.children.length-1&&g instanceof m.Dict?a=g:(l.assertType(g,m.Symbol),s.push(g))});var w=[].concat(s.map(function(g){return"l_"+g.value}),["kwargs"]),S=s.map(function(g){return'"'+g.value+'"'}),L=(a&&a.children||[]).map(function(g){return'"'+g.key.value+'"'}),N;u?N=o.push(!0):N=new I,this._emitLines("var "+v+" = runtime.makeMacro(","["+S.join(", ")+"], ","["+L.join(", ")+"], ","function ("+w.join(", ")+") {","var callerFrame = frame;","frame = "+(u?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),s.forEach(function(g){l._emitLine('frame.set("'+g.value+'", l_'+g.value+");"),N.set(g.value,"l_"+g.value)}),a&&a.children.forEach(function(g){var d=g.key.value;l._emit('frame.set("'+d+'", '),l._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+d+'")'),l._emit(' ? kwargs["'+d+'"] : '),l._compileExpression(g.value,N),l._emit(");")});var F=this._pushBuffer();return this._withScopedSyntax(function(){l.compile(t.body,N)}),this._emitLine("frame = "+(u?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+F+");"),this._emitLine("});"),this._popBuffer(),v},c.compileMacro=function(t,o){var l=this._compileMacro(t),s=t.name.value;o.set(s,l),o.parent?this._emitLine('frame.set("'+s+'", '+l+");"):(t.name.value.charAt(0)!=="_"&&this._emitLine('context.addExport("'+s+'");'),this._emitLine('context.setVariable("'+s+'", '+l+");"))},c.compileCaller=function(t,o){this._emit("(function (){");var l=this._compileMacro(t,o);this._emit("return "+l+";})()")},c._compileGetTemplate=function(t,o,l,s){var a=this._tmpid(),v=this._templateName(),u=this._makeCallback(a),w=l?"true":"false",S=s?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,o),this._emitLine(", "+w+", "+v+", "+S+", "+u),a},c.compileImport=function(t,o){var l=t.target.value,s=this._compileGetTemplate(t,o,!1,!1);this._addScopeLevel(),this._emitLine(s+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(s)),this._addScopeLevel(),o.set(l,s),o.parent?this._emitLine('frame.set("'+l+'", '+s+");"):this._emitLine('context.setVariable("'+l+'", '+s+");")},c.compileFromImport=function(t,o){var l=this,s=this._compileGetTemplate(t,o,!1,!1);this._addScopeLevel(),this._emitLine(s+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(s)),this._addScopeLevel(),t.names.children.forEach(function(a){var v,u,w=l._tmpid();a instanceof m.Pair?(v=a.key.value,u=a.value.value):(v=a.value,u=v),l._emitLine("if(Object.prototype.hasOwnProperty.call("+s+', "'+v+'")) {'),l._emitLine("var "+w+" = "+s+"."+v+";"),l._emitLine("} else {"),l._emitLine(`cb(new Error("cannot import '`+v+`'")); return;`),l._emitLine("}"),o.set(u,w),o.parent?l._emitLine('frame.set("'+u+'", '+w+");"):l._emitLine('context.setVariable("'+u+'", '+w+");")})},c.compileBlock=function(t){var o=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(o)),this._emitLine(this.buffer+" += "+o+";"),this._addScopeLevel()},c.compileSuper=function(t,o){var l=t.blockName.value,s=t.symbol.value,a=this._makeCallback(s);this._emitLine('context.getSuper(env, "'+l+'", b_'+l+", frame, runtime, "+a),this._emitLine(s+" = runtime.markSafe("+s+");"),this._addScopeLevel(),o.set(s,s)},c.compileExtends=function(t,o){var l=this._tmpid(),s=this._compileGetTemplate(t,o,!0,!1);this._emitLine("parentTemplate = "+s),this._emitLine("for(var "+l+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+l+", parentTemplate.blocks["+l+"]);"),this._emitLine("}"),this._addScopeLevel()},c.compileInclude=function(t,o){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var l=this._compileGetTemplate(t,o,!1,t.ignoreMissing);this._emitLine("callback(null,"+l+");});"),this._emitLine("});");var s=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(s)),this._emitLine("callback(null,"+s+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},c.compileTemplateData=function(t,o){this.compileLiteral(t,o)},c.compileCapture=function(t,o){var l=this,s=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax(function(){l.compile(t.body,o)}),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=s},c.compileOutput=function(t,o){var l=this,s=t.children;s.forEach(function(a){a instanceof m.TemplateData?a.value&&(l._emit(l.buffer+" += "),l.compileLiteral(a,o),l._emitLine(";")):(l._emit(l.buffer+" += runtime.suppressValue("),l.throwOnUndefined&&l._emit("runtime.ensureDefined("),l.compile(a,o),l.throwOnUndefined&&l._emit(","+t.lineno+","+t.colno+")"),l._emit(`, env.opts.autoescape);
|
|
15
|
+
`))})},c.compileRoot=function(t,o){var l=this;o&&this.fail("compileRoot: root node can't have frame"),o=new I,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,o),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var s=[],a=t.findAll(m.Block);a.forEach(function(v,u){var w=v.name.value;if(s.indexOf(w)!==-1)throw new Error('Block "'+w+'" defined more than once.');s.push(w),l._emitFuncBegin(v,"b_"+w);var S=new I;l._emitLine("var frame = frame.push(true);"),l.compile(v.body,S),l._emitFuncEnd()}),this._emitLine("return {"),a.forEach(function(v,u){var w="b_"+v.name.value;l._emitLine(w+": "+w+",")}),this._emitLine(`root: root
|
|
16
|
+
};`)},c.compile=function(t,o){var l=this["compile"+t.typename];l?l.call(this,t,o):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},c.getCode=function(){return this.codebuf.join("")},h}(C);_.exports={compile:function(h,c,p,t,o){o===void 0&&(o={});var l=new n(t,o.throwOnUndefined),s=(p||[]).map(function(v){return v.preprocess}).filter(function(v){return!!v}),a=s.reduce(function(v,u){return u(v)},h);return l.compile(i.transform(f.parse(a,p,o),c,t)),l.getCode()},Compiler:n}},function(_,P,O){function y(T,D){T.prototype=Object.create(D.prototype),T.prototype.constructor=T,k(T,D)}function k(T,D){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(I,x){return I.__proto__=x,I},k(T,D)}var f=O(4),i=O(1),m=i.EmitterObj;_.exports=function(T){y(D,T);function D(){return T.apply(this,arguments)||this}var K=D.prototype;return K.resolve=function(x,C){return f.resolve(f.dirname(x),C)},K.isRelative=function(x){return x.indexOf("./")===0||x.indexOf("../")===0},D}(m)},function(_,P,O){function y(S,L){S.prototype=Object.create(L.prototype),S.prototype.constructor=S,k(S,L)}function k(S,L){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(F,g){return F.__proto__=g,F},k(S,L)}var f=O(12),i=O(15),m=O(0),T=O(5),D=O(18),K=O(10),I=K.FileSystemLoader,x=K.WebLoader,C=K.PrecompiledLoader,e=O(20),n=O(21),r=O(1),h=r.Obj,c=r.EmitterObj,p=O(2),t=p.handleError,o=p.Frame,l=O(22);function s(S,L,N){f(function(){S(L,N)})}var a={type:"code",obj:{root:function(L,N,F,g,d){try{d(null,"")}catch(A){d(t(A,null,null))}}}},v=function(S){y(L,S);function L(){return S.apply(this,arguments)||this}var N=L.prototype;return N.init=function(g,d){var A=this;d=this.opts=d||{},this.opts.dev=!!d.dev,this.opts.autoescape=d.autoescape!=null?d.autoescape:!0,this.opts.throwOnUndefined=!!d.throwOnUndefined,this.opts.trimBlocks=!!d.trimBlocks,this.opts.lstripBlocks=!!d.lstripBlocks,this.loaders=[],g?this.loaders=m.isArray(g)?g:[g]:I?this.loaders=[new I("views")]:x&&(this.loaders=[new x("/views")]),typeof window<"u"&&window.nunjucksPrecompiled&&this.loaders.unshift(new C(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=n(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],m._entries(D).forEach(function(j){var U=j[0],z=j[1];return A.addFilter(U,z)}),m._entries(e).forEach(function(j){var U=j[0],z=j[1];return A.addTest(U,z)})},N._initLoaders=function(){var g=this;this.loaders.forEach(function(d){d.cache={},typeof d.on=="function"&&(d.on("update",function(A,j){d.cache[A]=null,g.emit("update",A,j,d)}),d.on("load",function(A,j){g.emit("load",A,j,d)}))})},N.invalidateCache=function(){this.loaders.forEach(function(g){g.cache={}})},N.addExtension=function(g,d){return d.__name=g,this.extensions[g]=d,this.extensionsList.push(d),this},N.removeExtension=function(g){var d=this.getExtension(g);d&&(this.extensionsList=m.without(this.extensionsList,d),delete this.extensions[g])},N.getExtension=function(g){return this.extensions[g]},N.hasExtension=function(g){return!!this.extensions[g]},N.addGlobal=function(g,d){return this.globals[g]=d,this},N.getGlobal=function(g){if(typeof this.globals[g]>"u")throw new Error("global not found: "+g);return this.globals[g]},N.addFilter=function(g,d,A){var j=d;return A&&this.asyncFilters.push(g),this.filters[g]=j,this},N.getFilter=function(g){if(!this.filters[g])throw new Error("filter not found: "+g);return this.filters[g]},N.addTest=function(g,d){return this.tests[g]=d,this},N.getTest=function(g){if(!this.tests[g])throw new Error("test not found: "+g);return this.tests[g]},N.resolveTemplate=function(g,d,A){var j=g.isRelative&&d?g.isRelative(A):!1;return j&&g.resolve?g.resolve(d,A):A},N.getTemplate=function(g,d,A,j,U){var z=this,ie=this,G=null;if(g&&g.raw&&(g=g.raw),m.isFunction(A)&&(U=A,A=null,d=d||!1),m.isFunction(d)&&(U=d,d=!1),g instanceof w)G=g;else{if(typeof g!="string")throw new Error("template names must be a string: "+g);for(var le=0;le<this.loaders.length;le++){var be=this.loaders[le];if(G=be.cache[this.resolveTemplate(be,A,g)],G)break}}if(G)if(d&&G.compile(),U){U(null,G);return}else return G;var Z,ce=function(J,Y){if(!Y&&!J&&!j&&(J=new Error("template not found: "+g)),J)if(U){U(J);return}else throw J;var pe;Y?(pe=new w(Y.src,z,Y.path,d),Y.noCache||(Y.loader.cache[g]=pe)):pe=new w(a,z,"",d),U?U(null,pe):Z=pe};return m.asyncIter(this.loaders,function(Q,J,Y,pe){function we(_e,Le){_e?pe(_e):Le?(Le.loader=Q,pe(null,Le)):Y()}g=ie.resolveTemplate(Q,A,g),Q.async?Q.getSource(g,we):we(null,Q.getSource(g))},ce),Z},N.express=function(g){return l(this,g)},N.render=function(g,d,A){m.isFunction(d)&&(A=d,d=null);var j=null;return this.getTemplate(g,function(U,z){if(U&&A)s(A,U);else{if(U)throw U;j=z.render(d,A)}}),j},N.renderString=function(g,d,A,j){m.isFunction(A)&&(j=A,A={}),A=A||{};var U=new w(g,this,A.path);return U.render(d,j)},N.waterfall=function(g,d,A){return i(g,d,A)},L}(c),u=function(S){y(L,S);function L(){return S.apply(this,arguments)||this}var N=L.prototype;return N.init=function(g,d,A){var j=this;this.env=A||new v,this.ctx=m.extend({},g),this.blocks={},this.exported=[],m.keys(d).forEach(function(U){j.addBlock(U,d[U])})},N.lookup=function(g){return g in this.env.globals&&!(g in this.ctx)?this.env.globals[g]:this.ctx[g]},N.setVariable=function(g,d){this.ctx[g]=d},N.getVariables=function(){return this.ctx},N.addBlock=function(g,d){return this.blocks[g]=this.blocks[g]||[],this.blocks[g].push(d),this},N.getBlock=function(g){if(!this.blocks[g])throw new Error('unknown block "'+g+'"');return this.blocks[g][0]},N.getSuper=function(g,d,A,j,U,z){var ie=m.indexOf(this.blocks[d]||[],A),G=this.blocks[d][ie+1],le=this;if(ie===-1||!G)throw new Error('no super block available for "'+d+'"');G(g,le,j,U,z)},N.addExport=function(g){this.exported.push(g)},N.getExported=function(){var g=this,d={};return this.exported.forEach(function(A){d[A]=g.ctx[A]}),d},L}(h),w=function(S){y(L,S);function L(){return S.apply(this,arguments)||this}var N=L.prototype;return N.init=function(g,d,A,j){if(this.env=d||new v,m.isObject(g))switch(g.type){case"code":this.tmplProps=g.obj;break;case"string":this.tmplStr=g.obj;break;default:throw new Error("Unexpected template object type "+g.type+"; expected 'code', or 'string'")}else if(m.isString(g))this.tmplStr=g;else throw new Error("src must be a string or an object describing the source");if(this.path=A,j)try{this._compile()}catch(U){throw m._prettifyError(this.path,this.env.opts.dev,U)}else this.compiled=!1},N.render=function(g,d,A){var j=this;typeof g=="function"?(A=g,g={}):typeof d=="function"&&(A=d,d=null);var U=!d;try{this.compile()}catch(Z){var z=m._prettifyError(this.path,this.env.opts.dev,Z);if(A)return s(A,z);throw z}var ie=new u(g||{},this.blocks,this.env),G=d?d.push(!0):new o;G.topLevel=!0;var le=null,be=!1;return this.rootRenderFunc(this.env,ie,G,p,function(Z,ce){if(!(be&&A&&typeof ce<"u"))if(Z&&(Z=m._prettifyError(j.path,j.env.opts.dev,Z),be=!0),A)U?s(A,Z,ce):A(Z,ce);else{if(Z)throw Z;le=ce}}),le},N.getExported=function(g,d,A){typeof g=="function"&&(A=g,g={}),typeof d=="function"&&(A=d,d=null);try{this.compile()}catch(z){if(A)return A(z);throw z}var j=d?d.push():new o;j.topLevel=!0;var U=new u(g||{},this.blocks,this.env);this.rootRenderFunc(this.env,U,j,p,function(z){z?A(z,null):A(null,U.getExported())})},N.compile=function(){this.compiled||this._compile()},N._compile=function(){var g;if(this.tmplProps)g=this.tmplProps;else{var d=T.compile(this.tmplStr,this.env.asyncFilters,this.env.extensionsList,this.path,this.env.opts),A=new Function(d);g=A()}this.blocks=this._getBlocks(g),this.rootRenderFunc=g.root,this.compiled=!0},N._getBlocks=function(g){var d={};return m.keys(g).forEach(function(A){A.slice(0,2)==="b_"&&(d[A.slice(2)]=g[A])}),d},L}(h);_.exports={Environment:v,Template:w}},function(_,P,O){function y(K,I){K.prototype=Object.create(I.prototype),K.prototype.constructor=K,k(K,I)}function k(K,I){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,e){return C.__proto__=e,C},k(K,I)}var f=O(9),i=O(3),m=O(1).Obj,T=O(0),D=function(K){y(I,K);function I(){return K.apply(this,arguments)||this}var x=I.prototype;return x.init=function(e){this.tokens=e,this.peeked=null,this.breakOnBlocks=null,this.dropLeadingWhitespace=!1,this.extensions=[]},x.nextToken=function(e){var n;if(this.peeked)if(!e&&this.peeked.type===f.TOKEN_WHITESPACE)this.peeked=null;else return n=this.peeked,this.peeked=null,n;if(n=this.tokens.nextToken(),!e)for(;n&&n.type===f.TOKEN_WHITESPACE;)n=this.tokens.nextToken();return n},x.peekToken=function(){return this.peeked=this.peeked||this.nextToken(),this.peeked},x.pushToken=function(e){if(this.peeked)throw new Error("pushToken: can only push one token on between reads");this.peeked=e},x.error=function(e,n,r){if(n===void 0||r===void 0){var h=this.peekToken()||{};n=h.lineno,r=h.colno}return n!==void 0&&(n+=1),r!==void 0&&(r+=1),new T.TemplateError(e,n,r)},x.fail=function(e,n,r){throw this.error(e,n,r)},x.skip=function(e){var n=this.nextToken();return!n||n.type!==e?(this.pushToken(n),!1):!0},x.expect=function(e){var n=this.nextToken();return n.type!==e&&this.fail("expected "+e+", got "+n.type,n.lineno,n.colno),n},x.skipValue=function(e,n){var r=this.nextToken();return!r||r.type!==e||r.value!==n?(this.pushToken(r),!1):!0},x.skipSymbol=function(e){return this.skipValue(f.TOKEN_SYMBOL,e)},x.advanceAfterBlockEnd=function(e){var n;return e||(n=this.peekToken(),n||this.fail("unexpected end of file"),n.type!==f.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),e=this.nextToken().value),n=this.nextToken(),n&&n.type===f.TOKEN_BLOCK_END?n.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0):this.fail("expected block end in "+e+" statement"),n},x.advanceAfterVariableEnd=function(){var e=this.nextToken();e&&e.type===f.TOKEN_VARIABLE_END?this.dropLeadingWhitespace=e.value.charAt(e.value.length-this.tokens.tags.VARIABLE_END.length-1)==="-":(this.pushToken(e),this.fail("expected variable end"))},x.parseFor=function(){var e=this.peekToken(),n,r;this.skipSymbol("for")?(n=new i.For(e.lineno,e.colno),r="endfor"):this.skipSymbol("asyncEach")?(n=new i.AsyncEach(e.lineno,e.colno),r="endeach"):this.skipSymbol("asyncAll")?(n=new i.AsyncAll(e.lineno,e.colno),r="endall"):this.fail("parseFor: expected for{Async}",e.lineno,e.colno),n.name=this.parsePrimary(),n.name instanceof i.Symbol||this.fail("parseFor: variable name expected for loop");var h=this.peekToken().type;if(h===f.TOKEN_COMMA){var c=n.name;for(n.name=new i.Array(c.lineno,c.colno),n.name.addChild(c);this.skip(f.TOKEN_COMMA);){var p=this.parsePrimary();n.name.addChild(p)}}return this.skipSymbol("in")||this.fail('parseFor: expected "in" keyword for loop',e.lineno,e.colno),n.arr=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n.body=this.parseUntilBlocks(r,"else"),this.skipSymbol("else")&&(this.advanceAfterBlockEnd("else"),n.else_=this.parseUntilBlocks(r)),this.advanceAfterBlockEnd(),n},x.parseMacro=function(){var e=this.peekToken();this.skipSymbol("macro")||this.fail("expected macro");var n=this.parsePrimary(!0),r=this.parseSignature(),h=new i.Macro(e.lineno,e.colno,n,r);return this.advanceAfterBlockEnd(e.value),h.body=this.parseUntilBlocks("endmacro"),this.advanceAfterBlockEnd(),h},x.parseCall=function(){var e=this.peekToken();this.skipSymbol("call")||this.fail("expected call");var n=this.parseSignature(!0)||new i.NodeList,r=this.parsePrimary();this.advanceAfterBlockEnd(e.value);var h=this.parseUntilBlocks("endcall");this.advanceAfterBlockEnd();var c=new i.Symbol(e.lineno,e.colno,"caller"),p=new i.Caller(e.lineno,e.colno,c,n,h),t=r.args.children;t[t.length-1]instanceof i.KeywordArgs||t.push(new i.KeywordArgs);var o=t[t.length-1];return o.addChild(new i.Pair(e.lineno,e.colno,c,p)),new i.Output(e.lineno,e.colno,[r])},x.parseWithContext=function(){var e=this.peekToken(),n=null;return this.skipSymbol("with")?n=!0:this.skipSymbol("without")&&(n=!1),n!==null&&(this.skipSymbol("context")||this.fail("parseFrom: expected context after with/without",e.lineno,e.colno)),n},x.parseImport=function(){var e=this.peekToken();this.skipSymbol("import")||this.fail("parseImport: expected import",e.lineno,e.colno);var n=this.parseExpression();this.skipSymbol("as")||this.fail('parseImport: expected "as" keyword',e.lineno,e.colno);var r=this.parseExpression(),h=this.parseWithContext(),c=new i.Import(e.lineno,e.colno,n,r,h);return this.advanceAfterBlockEnd(e.value),c},x.parseFrom=function(){var e=this.peekToken();this.skipSymbol("from")||this.fail("parseFrom: expected from");var n=this.parseExpression();this.skipSymbol("import")||this.fail("parseFrom: expected import",e.lineno,e.colno);for(var r=new i.NodeList,h;;){var c=this.peekToken();if(c.type===f.TOKEN_BLOCK_END){r.children.length||this.fail("parseFrom: Expected at least one import name",e.lineno,e.colno),c.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0),this.nextToken();break}r.children.length>0&&!this.skip(f.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",e.lineno,e.colno);var p=this.parsePrimary();if(p.value.charAt(0)==="_"&&this.fail("parseFrom: names starting with an underscore cannot be imported",p.lineno,p.colno),this.skipSymbol("as")){var t=this.parsePrimary();r.addChild(new i.Pair(p.lineno,p.colno,p,t))}else r.addChild(p);h=this.parseWithContext()}return new i.FromImport(e.lineno,e.colno,n,r,h)},x.parseBlock=function(){var e=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",e.lineno,e.colno);var n=new i.Block(e.lineno,e.colno);n.name=this.parsePrimary(),n.name instanceof i.Symbol||this.fail("parseBlock: variable name expected",e.lineno,e.colno),this.advanceAfterBlockEnd(e.value),n.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(n.name.value);var r=this.peekToken();return r||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(r.value),n},x.parseExtends=function(){var e="extends",n=this.peekToken();this.skipSymbol(e)||this.fail("parseTemplateRef: expected "+e);var r=new i.Extends(n.lineno,n.colno);return r.template=this.parseExpression(),this.advanceAfterBlockEnd(n.value),r},x.parseInclude=function(){var e="include",n=this.peekToken();this.skipSymbol(e)||this.fail("parseInclude: expected "+e);var r=new i.Include(n.lineno,n.colno);return r.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(r.ignoreMissing=!0),this.advanceAfterBlockEnd(n.value),r},x.parseIf=function(){var e=this.peekToken(),n;this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?n=new i.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?n=new i.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),n.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n.body=this.parseUntilBlocks("elif","elseif","else","endif");var r=this.peekToken();switch(r&&r.value){case"elseif":case"elif":n.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),n.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":n.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return n},x.parseSet=function(){var e=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",e.lineno,e.colno);for(var n=new i.Set(e.lineno,e.colno,[]),r;(r=this.parsePrimary())&&(n.targets.push(r),!!this.skip(f.TOKEN_COMMA)););return this.skipValue(f.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(e.value)):this.skip(f.TOKEN_BLOCK_END)?(n.body=new i.Capture(e.lineno,e.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",e.lineno,e.colno),n},x.parseSwitch=function(){var e="switch",n="endswitch",r="case",h="default",c=this.peekToken();!this.skipSymbol(e)&&!this.skipSymbol(r)&&!this.skipSymbol(h)&&this.fail('parseSwitch: expected "switch," "case" or "default"',c.lineno,c.colno);var p=this.parseExpression();this.advanceAfterBlockEnd(e),this.parseUntilBlocks(r,h,n);var t=this.peekToken(),o=[],l;do{this.skipSymbol(r);var s=this.parseExpression();this.advanceAfterBlockEnd(e);var a=this.parseUntilBlocks(r,h,n);o.push(new i.Case(t.line,t.col,s,a)),t=this.peekToken()}while(t&&t.value===r);switch(t.value){case h:this.advanceAfterBlockEnd(),l=this.parseUntilBlocks(n),this.advanceAfterBlockEnd();break;case n:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new i.Switch(c.lineno,c.colno,p,o,l)},x.parseStatement=function(){var e=this.peekToken(),n;if(e.type!==f.TOKEN_SYMBOL&&this.fail("tag name expected",e.lineno,e.colno),this.breakOnBlocks&&T.indexOf(this.breakOnBlocks,e.value)!==-1)return null;switch(e.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var r=0;r<this.extensions.length;r++){var h=this.extensions[r];if(T.indexOf(h.tags||[],e.value)!==-1)return h.parse(this,i,f)}this.fail("unknown block tag: "+e.value,e.lineno,e.colno)}return n},x.parseRaw=function(e){e=e||"raw";for(var n="end"+e,r=new RegExp("([\\s\\S]*?){%\\s*("+e+"|"+n+")\\s*(?=%})%}"),h=1,c="",p=null,t=this.advanceAfterBlockEnd();(p=this.tokens._extractRegex(r))&&h>0;){var o=p[0],l=p[1],s=p[2];s===e?h+=1:s===n&&(h-=1),h===0?(c+=l,this.tokens.backN(o.length-l.length)):c+=o}return new i.Output(t.lineno,t.colno,[new i.TemplateData(t.lineno,t.colno,c)])},x.parsePostfix=function(e){for(var n,r=this.peekToken();r;){if(r.type===f.TOKEN_LEFT_PAREN)e=new i.FunCall(r.lineno,r.colno,e,this.parseSignature());else if(r.type===f.TOKEN_LEFT_BRACKET)n=this.parseAggregate(),n.children.length>1&&this.fail("invalid index"),e=new i.LookupVal(r.lineno,r.colno,e,n.children[0]);else if(r.type===f.TOKEN_OPERATOR&&r.value==="."){this.nextToken();var h=this.nextToken();h.type!==f.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+h.value,h.lineno,h.colno),n=new i.Literal(h.lineno,h.colno,h.value),e=new i.LookupVal(r.lineno,r.colno,e,n)}else break;r=this.peekToken()}return e},x.parseExpression=function(){var e=this.parseInlineIf();return e},x.parseInlineIf=function(){var e=this.parseOr();if(this.skipSymbol("if")){var n=this.parseOr(),r=e;e=new i.InlineIf(e.lineno,e.colno),e.body=r,e.cond=n,this.skipSymbol("else")?e.else_=this.parseOr():e.else_=null}return e},x.parseOr=function(){for(var e=this.parseAnd();this.skipSymbol("or");){var n=this.parseAnd();e=new i.Or(e.lineno,e.colno,e,n)}return e},x.parseAnd=function(){for(var e=this.parseNot();this.skipSymbol("and");){var n=this.parseNot();e=new i.And(e.lineno,e.colno,e,n)}return e},x.parseNot=function(){var e=this.peekToken();return this.skipSymbol("not")?new i.Not(e.lineno,e.colno,this.parseNot()):this.parseIn()},x.parseIn=function(){for(var e=this.parseIs();;){var n=this.nextToken();if(!n)break;var r=n.type===f.TOKEN_SYMBOL&&n.value==="not";if(r||this.pushToken(n),this.skipSymbol("in")){var h=this.parseIs();e=new i.In(e.lineno,e.colno,e,h),r&&(e=new i.Not(e.lineno,e.colno,e))}else{r&&this.pushToken(n);break}}return e},x.parseIs=function(){var e=this.parseCompare();if(this.skipSymbol("is")){var n=this.skipSymbol("not"),r=this.parseCompare();e=new i.Is(e.lineno,e.colno,e,r),n&&(e=new i.Not(e.lineno,e.colno,e))}return e},x.parseCompare=function(){for(var e=["==","===","!=","!==","<",">","<=",">="],n=this.parseConcat(),r=[];;){var h=this.nextToken();if(h)if(e.indexOf(h.value)!==-1)r.push(new i.CompareOperand(h.lineno,h.colno,this.parseConcat(),h.value));else{this.pushToken(h);break}else break}return r.length?new i.Compare(r[0].lineno,r[0].colno,n,r):n},x.parseConcat=function(){for(var e=this.parseAdd();this.skipValue(f.TOKEN_TILDE,"~");){var n=this.parseAdd();e=new i.Concat(e.lineno,e.colno,e,n)}return e},x.parseAdd=function(){for(var e=this.parseSub();this.skipValue(f.TOKEN_OPERATOR,"+");){var n=this.parseSub();e=new i.Add(e.lineno,e.colno,e,n)}return e},x.parseSub=function(){for(var e=this.parseMul();this.skipValue(f.TOKEN_OPERATOR,"-");){var n=this.parseMul();e=new i.Sub(e.lineno,e.colno,e,n)}return e},x.parseMul=function(){for(var e=this.parseDiv();this.skipValue(f.TOKEN_OPERATOR,"*");){var n=this.parseDiv();e=new i.Mul(e.lineno,e.colno,e,n)}return e},x.parseDiv=function(){for(var e=this.parseFloorDiv();this.skipValue(f.TOKEN_OPERATOR,"/");){var n=this.parseFloorDiv();e=new i.Div(e.lineno,e.colno,e,n)}return e},x.parseFloorDiv=function(){for(var e=this.parseMod();this.skipValue(f.TOKEN_OPERATOR,"//");){var n=this.parseMod();e=new i.FloorDiv(e.lineno,e.colno,e,n)}return e},x.parseMod=function(){for(var e=this.parsePow();this.skipValue(f.TOKEN_OPERATOR,"%");){var n=this.parsePow();e=new i.Mod(e.lineno,e.colno,e,n)}return e},x.parsePow=function(){for(var e=this.parseUnary();this.skipValue(f.TOKEN_OPERATOR,"**");){var n=this.parseUnary();e=new i.Pow(e.lineno,e.colno,e,n)}return e},x.parseUnary=function(e){var n=this.peekToken(),r;return this.skipValue(f.TOKEN_OPERATOR,"-")?r=new i.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(f.TOKEN_OPERATOR,"+")?r=new i.Pos(n.lineno,n.colno,this.parseUnary(!0)):r=this.parsePrimary(),e||(r=this.parseFilter(r)),r},x.parsePrimary=function(e){var n=this.nextToken(),r,h=null;if(n?n.type===f.TOKEN_STRING?r=n.value:n.type===f.TOKEN_INT?r=parseInt(n.value,10):n.type===f.TOKEN_FLOAT?r=parseFloat(n.value):n.type===f.TOKEN_BOOLEAN?n.value==="true"?r=!0:n.value==="false"?r=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===f.TOKEN_NONE?r=null:n.type===f.TOKEN_REGEX&&(r=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),r!==void 0?h=new i.Literal(n.lineno,n.colno,r):n.type===f.TOKEN_SYMBOL?h=new i.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),h=this.parseAggregate()),e||(h=this.parsePostfix(h)),h)return h;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},x.parseFilterName=function(){for(var e=this.expect(f.TOKEN_SYMBOL),n=e.value;this.skipValue(f.TOKEN_OPERATOR,".");)n+="."+this.expect(f.TOKEN_SYMBOL).value;return new i.Symbol(e.lineno,e.colno,n)},x.parseFilterArgs=function(e){if(this.peekToken().type===f.TOKEN_LEFT_PAREN){var n=this.parsePostfix(e);return n.args.children}return[]},x.parseFilter=function(e){for(;this.skip(f.TOKEN_PIPE);){var n=this.parseFilterName();e=new i.Filter(n.lineno,n.colno,n,new i.NodeList(n.lineno,n.colno,[e].concat(this.parseFilterArgs(e))))}return e},x.parseFilterStatement=function(){var e=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var n=this.parseFilterName(),r=this.parseFilterArgs(n);this.advanceAfterBlockEnd(e.value);var h=new i.Capture(n.lineno,n.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var c=new i.Filter(n.lineno,n.colno,n,new i.NodeList(n.lineno,n.colno,[h].concat(r)));return new i.Output(n.lineno,n.colno,[c])},x.parseAggregate=function(){var e=this.nextToken(),n;switch(e.type){case f.TOKEN_LEFT_PAREN:n=new i.Group(e.lineno,e.colno);break;case f.TOKEN_LEFT_BRACKET:n=new i.Array(e.lineno,e.colno);break;case f.TOKEN_LEFT_CURLY:n=new i.Dict(e.lineno,e.colno);break;default:return null}for(;;){var r=this.peekToken().type;if(r===f.TOKEN_RIGHT_PAREN||r===f.TOKEN_RIGHT_BRACKET||r===f.TOKEN_RIGHT_CURLY){this.nextToken();break}if(n.children.length>0&&(this.skip(f.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),n instanceof i.Dict){var h=this.parsePrimary();this.skip(f.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var c=this.parseExpression();n.addChild(new i.Pair(h.lineno,h.colno,h,c))}else{var p=this.parseExpression();n.addChild(p)}}return n},x.parseSignature=function(e,n){var r=this.peekToken();if(!n&&r.type!==f.TOKEN_LEFT_PAREN){if(e)return null;this.fail("expected arguments",r.lineno,r.colno)}r.type===f.TOKEN_LEFT_PAREN&&(r=this.nextToken());for(var h=new i.NodeList(r.lineno,r.colno),c=new i.KeywordArgs(r.lineno,r.colno),p=!1;;){if(r=this.peekToken(),!n&&r.type===f.TOKEN_RIGHT_PAREN){this.nextToken();break}else if(n&&r.type===f.TOKEN_BLOCK_END)break;if(p&&!this.skip(f.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",r.lineno,r.colno);else{var t=this.parseExpression();this.skipValue(f.TOKEN_OPERATOR,"=")?c.addChild(new i.Pair(t.lineno,t.colno,t,this.parseExpression())):h.addChild(t)}p=!0}return c.children.length&&h.addChild(c),h},x.parseUntilBlocks=function(){for(var e=this.breakOnBlocks,n=arguments.length,r=new Array(n),h=0;h<n;h++)r[h]=arguments[h];this.breakOnBlocks=r;var c=this.parse();return this.breakOnBlocks=e,c},x.parseNodes=function(){for(var e,n=[];e=this.nextToken();)if(e.type===f.TOKEN_DATA){var r=e.value,h=this.peekToken(),c=h&&h.value;this.dropLeadingWhitespace&&(r=r.replace(/^\s*/,""),this.dropLeadingWhitespace=!1),h&&(h.type===f.TOKEN_BLOCK_START&&c.charAt(c.length-1)==="-"||h.type===f.TOKEN_VARIABLE_START&&c.charAt(this.tokens.tags.VARIABLE_START.length)==="-"||h.type===f.TOKEN_COMMENT&&c.charAt(this.tokens.tags.COMMENT_START.length)==="-")&&(r=r.replace(/\s*$/,"")),n.push(new i.Output(e.lineno,e.colno,[new i.TemplateData(e.lineno,e.colno,r)]))}else if(e.type===f.TOKEN_BLOCK_START){this.dropLeadingWhitespace=!1;var p=this.parseStatement();if(!p)break;n.push(p)}else if(e.type===f.TOKEN_VARIABLE_START){var t=this.parseExpression();this.dropLeadingWhitespace=!1,this.advanceAfterVariableEnd(),n.push(new i.Output(e.lineno,e.colno,[t]))}else e.type===f.TOKEN_COMMENT?this.dropLeadingWhitespace=e.value.charAt(e.value.length-this.tokens.tags.COMMENT_END.length-1)==="-":this.fail("Unexpected token at top-level: "+e.type,e.lineno,e.colno);return n},x.parse=function(){return new i.NodeList(0,0,this.parseNodes())},x.parseAsRoot=function(){return new i.Root(0,0,this.parseNodes())},I}(m);_.exports={parse:function(I,x,C){var e=new D(f.lex(I,C));return x!==void 0&&(e.extensions=x),e.parseAsRoot()},Parser:D}},function(_,P,O){var y=O(0),k=`
|
|
17
|
+
\r `,f="()[]{}%*-+~/#,:|.<>=!",i="0123456789",m="{%",T="%}",D="{{",K="}}",I="{#",x="#}",C="string",e="whitespace",n="data",r="block-start",h="block-end",c="variable-start",p="variable-end",t="comment",o="left-paren",l="right-paren",s="left-bracket",a="right-bracket",v="left-curly",u="right-curly",w="operator",S="comma",L="colon",N="tilde",F="pipe",g="int",d="float",A="boolean",j="none",U="symbol",z="special",ie="regex";function G(be,Z,ce,Q){return{type:be,value:Z,lineno:ce,colno:Q}}var le=function(){function be(ce,Q){this.str=ce,this.index=0,this.len=ce.length,this.lineno=0,this.colno=0,this.in_code=!1,Q=Q||{};var J=Q.tags||{};this.tags={BLOCK_START:J.blockStart||m,BLOCK_END:J.blockEnd||T,VARIABLE_START:J.variableStart||D,VARIABLE_END:J.variableEnd||K,COMMENT_START:J.commentStart||I,COMMENT_END:J.commentEnd||x},this.trimBlocks=!!Q.trimBlocks,this.lstripBlocks=!!Q.lstripBlocks}var Z=be.prototype;return Z.nextToken=function(){var Q=this.lineno,J=this.colno,Y;if(this.in_code){var pe=this.current();if(this.isFinished())return null;if(pe==='"'||pe==="'")return G(C,this._parseString(pe),Q,J);if(Y=this._extract(k))return G(e,Y,Q,J);if((Y=this._extractString(this.tags.BLOCK_END))||(Y=this._extractString("-"+this.tags.BLOCK_END)))return this.in_code=!1,this.trimBlocks&&(pe=this.current(),pe===`
|
|
18
|
+
`?this.forward():pe==="\r"&&(this.forward(),pe=this.current(),pe===`
|
|
19
|
+
`?this.forward():this.back())),G(h,Y,Q,J);if((Y=this._extractString(this.tags.VARIABLE_END))||(Y=this._extractString("-"+this.tags.VARIABLE_END)))return this.in_code=!1,G(p,Y,Q,J);if(pe==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var we="";!this.isFinished();)if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}else we+=this.current(),this.forward();for(var _e=["g","i","m","y"],Le="";!this.isFinished();){var b=_e.indexOf(this.current())!==-1;if(b)Le+=this.current(),this.forward();else break}return G(ie,{body:we,flags:Le},Q,J)}else if(f.indexOf(pe)!==-1){this.forward();var M=["==","===","!=","!==","<=",">=","//","**"],q=pe+this.current(),$;switch(y.indexOf(M,q)!==-1&&(this.forward(),pe=q,y.indexOf(M,q+this.current())!==-1&&(pe=q+this.current(),this.forward())),pe){case"(":$=o;break;case")":$=l;break;case"[":$=s;break;case"]":$=a;break;case"{":$=v;break;case"}":$=u;break;case",":$=S;break;case":":$=L;break;case"~":$=N;break;case"|":$=F;break;default:$=w}return G($,pe,Q,J)}else if(Y=this._extractUntil(k+f),Y.match(/^[-+]?[0-9]+$/))if(this.current()==="."){this.forward();var te=this._extract(i);return G(d,Y+"."+te,Q,J)}else return G(g,Y,Q,J);else{if(Y.match(/^(true|false)$/))return G(A,Y,Q,J);if(Y==="none")return G(j,Y,Q,J);if(Y==="null")return G(j,Y,Q,J);if(Y)return G(U,Y,Q,J);throw new Error("Unexpected value while parsing: "+Y)}}else{var ne=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((Y=this._extractString(this.tags.BLOCK_START+"-"))||(Y=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,G(r,Y,Q,J);if((Y=this._extractString(this.tags.VARIABLE_START+"-"))||(Y=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,G(c,Y,Q,J);Y="";var he,ue=!1;for(this._matches(this.tags.COMMENT_START)&&(ue=!0,Y=this._extractString(this.tags.COMMENT_START));(he=this._extractUntil(ne))!==null;)if(Y+=he,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!ue){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=Y.length){var ge=Y.slice(-this.colno);if(/^\s+$/.test(ge)&&(Y=Y.slice(0,-this.colno),!Y.length))return this.nextToken()}break}else if(this._matches(this.tags.COMMENT_END)){if(!ue)throw new Error("unexpected end of comment");Y+=this._extractString(this.tags.COMMENT_END);break}else Y+=this.current(),this.forward();if(he===null&&ue)throw new Error("expected end of comment, got end of file");return G(ue?t:n,Y,Q,J)}},Z._parseString=function(Q){this.forward();for(var J="";!this.isFinished()&&this.current()!==Q;){var Y=this.current();if(Y==="\\"){switch(this.forward(),this.current()){case"n":J+=`
|
|
20
|
+
`;break;case"t":J+=" ";break;case"r":J+="\r";break;default:J+=this.current()}this.forward()}else J+=Y,this.forward()}return this.forward(),J},Z._matches=function(Q){if(this.index+Q.length>this.len)return null;var J=this.str.slice(this.index,this.index+Q.length);return J===Q},Z._extractString=function(Q){return this._matches(Q)?(this.forwardN(Q.length),Q):null},Z._extractUntil=function(Q){return this._extractMatching(!0,Q||"")},Z._extract=function(Q){return this._extractMatching(!1,Q)},Z._extractMatching=function(Q,J){if(this.isFinished())return null;var Y=J.indexOf(this.current());if(Q&&Y===-1||!Q&&Y!==-1){var pe=this.current();this.forward();for(var we=J.indexOf(this.current());(Q&&we===-1||!Q&&we!==-1)&&!this.isFinished();)pe+=this.current(),this.forward(),we=J.indexOf(this.current());return pe}return""},Z._extractRegex=function(Q){var J=this.currentStr().match(Q);return J?(this.forwardN(J[0].length),J):null},Z.isFinished=function(){return this.index>=this.len},Z.forwardN=function(Q){for(var J=0;J<Q;J++)this.forward()},Z.forward=function(){this.index++,this.previous()===`
|
|
21
|
+
`?(this.lineno++,this.colno=0):this.colno++},Z.backN=function(Q){for(var J=0;J<Q;J++)this.back()},Z.back=function(){if(this.index--,this.current()===`
|
|
22
|
+
`){this.lineno--;var Q=this.src.lastIndexOf(`
|
|
23
|
+
`,this.index-1);Q===-1?this.colno=this.index:this.colno=this.index-Q}else this.colno--},Z.current=function(){return this.isFinished()?"":this.str.charAt(this.index)},Z.currentStr=function(){return this.isFinished()?"":this.str.substr(this.index)},Z.previous=function(){return this.str.charAt(this.index-1)},be}();_.exports={lex:function(Z,ce){return new le(Z,ce)},TOKEN_STRING:C,TOKEN_WHITESPACE:e,TOKEN_DATA:n,TOKEN_BLOCK_START:r,TOKEN_BLOCK_END:h,TOKEN_VARIABLE_START:c,TOKEN_VARIABLE_END:p,TOKEN_COMMENT:t,TOKEN_LEFT_PAREN:o,TOKEN_RIGHT_PAREN:l,TOKEN_LEFT_BRACKET:s,TOKEN_RIGHT_BRACKET:a,TOKEN_LEFT_CURLY:v,TOKEN_RIGHT_CURLY:u,TOKEN_OPERATOR:w,TOKEN_COMMA:S,TOKEN_COLON:L,TOKEN_TILDE:N,TOKEN_PIPE:F,TOKEN_INT:g,TOKEN_FLOAT:d,TOKEN_BOOLEAN:A,TOKEN_NONE:j,TOKEN_SYMBOL:U,TOKEN_SPECIAL:z,TOKEN_REGEX:ie}},function(_,P,O){function y(D,K){D.prototype=Object.create(K.prototype),D.prototype.constructor=D,k(D,K)}function k(D,K){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},k(D,K)}var f=O(6),i=O(19),m=i.PrecompiledLoader,T=function(D){y(K,D);function K(x,C){var e;return e=D.call(this)||this,e.baseURL=x||".",C=C||{},e.useCache=!!C.useCache,e.async=!!C.async,e}var I=K.prototype;return I.resolve=function(C,e){throw new Error("relative templates not support in the browser yet")},I.getSource=function(C,e){var n=this,r=this.useCache,h;return this.fetch(this.baseURL+"/"+C,function(c,p){if(c)if(e)e(c.content);else if(c.status===404)h=null;else throw c.content;else h={src:p,path:C,noCache:!r},n.emit("load",C,h),e&&e(null,h)}),h},I.fetch=function(C,e){if(typeof window>"u")throw new Error("WebLoader can only by used in a browser");var n=new XMLHttpRequest,r=!0;n.onreadystatechange=function(){n.readyState===4&&r&&(r=!1,n.status===0||n.status===200?e(null,n.responseText):e({status:n.status,content:n.responseText}))},C+=(C.indexOf("?")===-1?"?":"&")+"s="+new Date().getTime(),n.open("GET",C,this.async),n.send()},K}(f);_.exports={WebLoader:T,PrecompiledLoader:m}},function(_,P,O){var y=O(0),k=O(7),f=k.Environment,i=k.Template,m=O(6),T=O(10),D=O(23),K=O(5),I=O(8),x=O(9),C=O(2),e=O(3),n=O(25),r;function h(c,p){p=p||{},y.isObject(c)&&(p=c,c=null);var t;return T.FileSystemLoader?t=new T.FileSystemLoader(c,{watch:p.watch,noCache:p.noCache}):T.WebLoader&&(t=new T.WebLoader(c,{useCache:p.web&&p.web.useCache,async:p.web&&p.web.async})),r=new f(t,p),p&&p.express&&r.express(p.express),r}_.exports={Environment:f,Template:i,Loader:m,FileSystemLoader:T.FileSystemLoader,NodeResolveLoader:T.NodeResolveLoader,PrecompiledLoader:T.PrecompiledLoader,WebLoader:T.WebLoader,compiler:K,parser:I,lexer:x,runtime:C,lib:y,nodes:e,installJinjaCompat:n,configure:h,reset:function(){r=void 0},compile:function(p,t,o,l){return r||h(),new i(p,t,o,l)},render:function(p,t,o){return r||h(),r.render(p,t,o)},renderString:function(p,t,o){return r||h(),r.renderString(p,t,o)},precompile:D?D.precompile:void 0,precompileString:D?D.precompileString:void 0}},function(_,P,O){var y=O(13),k=[],f=[],i=y.makeRequestCallFromTimer(m);function m(){if(f.length)throw f.shift()}_.exports=T;function T(K){var I;k.length?I=k.pop():I=new D,I.task=K,y(I)}function D(){this.task=null}D.prototype.call=function(){try{this.task.call()}catch(K){T.onerror?T.onerror(K):(f.push(K),i())}finally{this.task=null,k[k.length]=this}}},function(_,P,O){(function(y){_.exports=k;function k(e){f.length||i(),f[f.length]=e}var f=[],i,m=0,T=1024;function D(){for(;m<f.length;){var e=m;if(m=m+1,f[e].call(),m>T){for(var n=0,r=f.length-m;n<r;n++)f[n]=f[n+m];f.length-=m,m=0}}f.length=0,m=0}var K=typeof y<"u"?y:self,I=K.MutationObserver||K.WebKitMutationObserver;typeof I=="function"?i=x(D):i=C(D),k.requestFlush=i;function x(e){var n=1,r=new I(e),h=document.createTextNode("");return r.observe(h,{characterData:!0}),function(){n=-n,h.data=n}}function C(e){return function(){var r=setTimeout(c,0),h=setInterval(c,50);function c(){clearTimeout(r),clearInterval(h),e()}}}k.makeRequestCallFromTimer=C}).call(P,O(14))},function(_,P){var O;O=function(){return this}();try{O=O||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(O=window)}_.exports=O},function(_,P,O){var y,k;(function(f){var i=function(){var I=Array.prototype.slice.call(arguments);typeof I[0]=="function"&&I[0].apply(null,I.splice(1))},m=function(I){typeof setImmediate=="function"?setImmediate(I):typeof process<"u"&&process.nextTick?process.nextTick(I):setTimeout(I,0)},T=function(I){var x=function(C){var e=function(){return I.length&&I[C].apply(null,arguments),e.next()};return e.next=function(){return C<I.length-1?x(C+1):null},e};return x(0)},D=Array.isArray||function(I){return Object.prototype.toString.call(I)==="[object Array]"},K=function(I,x,C){var e=C?m:i;if(x=x||function(){},!D(I)){var n=new Error("First argument to waterfall must be an array of functions");return x(n)}if(!I.length)return x();var r=function(h){return function(c){if(c)x.apply(null,arguments),x=function(){};else{var p=Array.prototype.slice.call(arguments,1),t=h.next();t?p.push(r(t)):p.push(x),e(function(){h.apply(null,p)})}}};r(T(I))()};y=[],k=(function(){return K}).apply(P,y),k!==void 0&&(_.exports=k)})()},function(_,P,O){var y=typeof Reflect=="object"?Reflect:null,k=y&&typeof y.apply=="function"?y.apply:function(a,v,u){return Function.prototype.apply.call(a,v,u)},f;y&&typeof y.ownKeys=="function"?f=y.ownKeys:Object.getOwnPropertySymbols?f=function(a){return Object.getOwnPropertyNames(a).concat(Object.getOwnPropertySymbols(a))}:f=function(a){return Object.getOwnPropertyNames(a)};function i(s){console&&console.warn&&console.warn(s)}var m=Number.isNaN||function(a){return a!==a};function T(){T.init.call(this)}_.exports=T,_.exports.once=t,T.EventEmitter=T,T.prototype._events=void 0,T.prototype._eventsCount=0,T.prototype._maxListeners=void 0;var D=10;function K(s){if(typeof s!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof s)}Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return D},set:function(s){if(typeof s!="number"||s<0||m(s))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+s+".");D=s}}),T.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},T.prototype.setMaxListeners=function(a){if(typeof a!="number"||a<0||m(a))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+a+".");return this._maxListeners=a,this};function I(s){return s._maxListeners===void 0?T.defaultMaxListeners:s._maxListeners}T.prototype.getMaxListeners=function(){return I(this)},T.prototype.emit=function(a){for(var v=[],u=1;u<arguments.length;u++)v.push(arguments[u]);var w=a==="error",S=this._events;if(S!==void 0)w=w&&S.error===void 0;else if(!w)return!1;if(w){var L;if(v.length>0&&(L=v[0]),L instanceof Error)throw L;var N=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw N.context=L,N}var F=S[a];if(F===void 0)return!1;if(typeof F=="function")k(F,this,v);else for(var g=F.length,d=h(F,g),u=0;u<g;++u)k(d[u],this,v);return!0};function x(s,a,v,u){var w,S,L;if(K(v),S=s._events,S===void 0?(S=s._events=Object.create(null),s._eventsCount=0):(S.newListener!==void 0&&(s.emit("newListener",a,v.listener?v.listener:v),S=s._events),L=S[a]),L===void 0)L=S[a]=v,++s._eventsCount;else if(typeof L=="function"?L=S[a]=u?[v,L]:[L,v]:u?L.unshift(v):L.push(v),w=I(s),w>0&&L.length>w&&!L.warned){L.warned=!0;var N=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");N.name="MaxListenersExceededWarning",N.emitter=s,N.type=a,N.count=L.length,i(N)}return s}T.prototype.addListener=function(a,v){return x(this,a,v,!1)},T.prototype.on=T.prototype.addListener,T.prototype.prependListener=function(a,v){return x(this,a,v,!0)};function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function e(s,a,v){var u={fired:!1,wrapFn:void 0,target:s,type:a,listener:v},w=C.bind(u);return w.listener=v,u.wrapFn=w,w}T.prototype.once=function(a,v){return K(v),this.on(a,e(this,a,v)),this},T.prototype.prependOnceListener=function(a,v){return K(v),this.prependListener(a,e(this,a,v)),this},T.prototype.removeListener=function(a,v){var u,w,S,L,N;if(K(v),w=this._events,w===void 0)return this;if(u=w[a],u===void 0)return this;if(u===v||u.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete w[a],w.removeListener&&this.emit("removeListener",a,u.listener||v));else if(typeof u!="function"){for(S=-1,L=u.length-1;L>=0;L--)if(u[L]===v||u[L].listener===v){N=u[L].listener,S=L;break}if(S<0)return this;S===0?u.shift():c(u,S),u.length===1&&(w[a]=u[0]),w.removeListener!==void 0&&this.emit("removeListener",a,N||v)}return this},T.prototype.off=T.prototype.removeListener,T.prototype.removeAllListeners=function(a){var v,u,w;if(u=this._events,u===void 0)return this;if(u.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):u[a]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete u[a]),this;if(arguments.length===0){var S=Object.keys(u),L;for(w=0;w<S.length;++w)L=S[w],L!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=u[a],typeof v=="function")this.removeListener(a,v);else if(v!==void 0)for(w=v.length-1;w>=0;w--)this.removeListener(a,v[w]);return this};function n(s,a,v){var u=s._events;if(u===void 0)return[];var w=u[a];return w===void 0?[]:typeof w=="function"?v?[w.listener||w]:[w]:v?p(w):h(w,w.length)}T.prototype.listeners=function(a){return n(this,a,!0)},T.prototype.rawListeners=function(a){return n(this,a,!1)},T.listenerCount=function(s,a){return typeof s.listenerCount=="function"?s.listenerCount(a):r.call(s,a)},T.prototype.listenerCount=r;function r(s){var a=this._events;if(a!==void 0){var v=a[s];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}T.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]};function h(s,a){for(var v=new Array(a),u=0;u<a;++u)v[u]=s[u];return v}function c(s,a){for(;a+1<s.length;a++)s[a]=s[a+1];s.pop()}function p(s){for(var a=new Array(s.length),v=0;v<a.length;++v)a[v]=s[v].listener||s[v];return a}function t(s,a){return new Promise(function(v,u){function w(L){s.removeListener(a,S),u(L)}function S(){typeof s.removeListener=="function"&&s.removeListener("error",w),v([].slice.call(arguments))}l(s,a,S,{once:!0}),a!=="error"&&o(s,w,{once:!0})})}function o(s,a,v){typeof s.on=="function"&&l(s,"error",a,v)}function l(s,a,v,u){if(typeof s.on=="function")u.once?s.once(a,v):s.on(a,v);else if(typeof s.addEventListener=="function")s.addEventListener(a,function w(S){u.once&&s.removeEventListener(a,w),v(S)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof s)}},function(_,P,O){var y=O(3),k=O(0),f=0;function i(){return"hole_"+f++}function m(r,h){for(var c=null,p=0;p<r.length;p++){var t=h(r[p]);t!==r[p]&&(c||(c=r.slice()),c[p]=t)}return c||r}function T(r,h,c){if(!(r instanceof y.Node))return r;if(!c){var p=h(r);if(p&&p!==r)return p}if(r instanceof y.NodeList){var t=m(r.children,function(v){return T(v,h,c)});t!==r.children&&(r=new y[r.typename](r.lineno,r.colno,t))}else if(r instanceof y.CallExtension){var o=T(r.args,h,c),l=m(r.contentArgs,function(v){return T(v,h,c)});(o!==r.args||l!==r.contentArgs)&&(r=new y[r.typename](r.extName,r.prop,o,l))}else{var s=r.fields.map(function(v){return r[v]}),a=m(s,function(v){return T(v,h,c)});a!==s&&(r=new y[r.typename](r.lineno,r.colno),a.forEach(function(v,u){r[r.fields[u]]=v}))}return c&&h(r)||r}function D(r,h){return T(r,h,!0)}function K(r,h,c){var p=[],t=D(c?r[c]:r,function(o){var l;return o instanceof y.Block?o:((o instanceof y.Filter&&k.indexOf(h,o.name.value)!==-1||o instanceof y.CallExtensionAsync)&&(l=new y.Symbol(o.lineno,o.colno,i()),p.push(new y.FilterAsync(o.lineno,o.colno,o.name,o.args,l))),l)});return c?r[c]=t:r=t,p.length?(p.push(r),new y.NodeList(r.lineno,r.colno,p)):r}function I(r,h){return D(r,function(c){return c instanceof y.Output?K(c,h):c instanceof y.Set?K(c,h,"value"):c instanceof y.For?K(c,h,"arr"):c instanceof y.If?K(c,h,"cond"):c instanceof y.CallExtension?K(c,h,"args"):void 0})}function x(r){return T(r,function(h){if(h instanceof y.Block){var c=!1,p=i();h.body=T(h.body,function(t){if(t instanceof y.FunCall&&t.name.value==="super")return c=!0,new y.Symbol(t.lineno,t.colno,p)}),c&&h.body.children.unshift(new y.Super(0,0,h.name,new y.Symbol(0,0,p)))}})}function C(r){return D(r,function(h){if(!(!(h instanceof y.If)&&!(h instanceof y.For))){var c=!1;if(T(h,function(p){if(p instanceof y.FilterAsync||p instanceof y.IfAsync||p instanceof y.AsyncEach||p instanceof y.AsyncAll||p instanceof y.CallExtensionAsync)return c=!0,p}),c){if(h instanceof y.If)return new y.IfAsync(h.lineno,h.colno,h.cond,h.body,h.else_);if(h instanceof y.For&&!(h instanceof y.AsyncAll))return new y.AsyncEach(h.lineno,h.colno,h.arr,h.name,h.body,h.else_)}}})}function e(r,h){return C(x(I(r,h)))}function n(r,h){return e(r,h||[])}_.exports={transform:n}},function(_,f,O){var y=O(0),k=O(2),f=_.exports={};function i(b,M){return b==null||b===!1?M:b}f.abs=Math.abs;function m(b){return b!==b}function T(b,M,q){var $,te=[],ne=[];for($=0;$<b.length;$++)$%M===0&&ne.length&&(te.push(ne),ne=[]),ne.push(b[$]);if(ne.length){if(q)for($=ne.length;$<M;$++)ne.push(q);te.push(ne)}return te}f.batch=T;function D(b){b=i(b,"");var M=b.toLowerCase();return k.copySafeness(b,M.charAt(0).toUpperCase()+M.slice(1))}f.capitalize=D;function K(b,M){if(b=i(b,""),M=M||80,b.length>=M)return b;var q=M-b.length,$=y.repeat(" ",q/2-q%2),te=y.repeat(" ",q/2);return k.copySafeness(b,$+b+te)}f.center=K;function I(b,M,q){return q?b||M:b!==void 0?b:M}f.default=I;function x(b,M,q){if(!y.isObject(b))throw new y.TemplateError("dictsort filter: val must be an object");var $=[];for(var te in b)$.push([te,b[te]]);var ne;if(q===void 0||q==="key")ne=0;else if(q==="value")ne=1;else throw new y.TemplateError("dictsort filter: You can only sort by either key or value");return $.sort(function(he,ue){var ge=he[ne],Ne=ue[ne];return M||(y.isString(ge)&&(ge=ge.toUpperCase()),y.isString(Ne)&&(Ne=Ne.toUpperCase())),ge>Ne?1:ge===Ne?0:-1}),$}f.dictsort=x;function C(b,M){return JSON.stringify(b,null,M)}f.dump=C;function e(b){return b instanceof k.SafeString?b:(b=b??"",k.markSafe(y.escape(b.toString())))}f.escape=e;function n(b){return b instanceof k.SafeString?b:(b=b??"",k.markSafe(b.toString()))}f.safe=n;function r(b){return b[0]}f.first=r;function h(b){return b=b??"",k.markSafe(y.escape(b.toString()))}f.forceescape=h;function c(b,M){return y.groupBy(b,M,this.env.opts.throwOnUndefined)}f.groupby=c;function p(b,M,q){if(b=i(b,""),b==="")return"";M=M||4;var $=b.split(`
|
|
24
|
+
`),te=y.repeat(" ",M),ne=$.map(function(he,ue){return ue===0&&!q?he:""+te+he}).join(`
|
|
25
|
+
`);return k.copySafeness(b,ne)}f.indent=p;function t(b,M,q){return M=M||"",q&&(b=y.map(b,function($){return $[q]})),b.join(M)}f.join=t;function o(b){return b[b.length-1]}f.last=o;function l(b){var M=i(b,"");return M!==void 0?typeof Map=="function"&&M instanceof Map||typeof Set=="function"&&M instanceof Set?M.size:y.isObject(M)&&!(M instanceof k.SafeString)?y.keys(M).length:M.length:0}f.length=l;function s(b){if(y.isString(b))return b.split("");if(y.isObject(b))return y._entries(b||{}).map(function(M){var q=M[0],$=M[1];return{key:q,value:$}});if(y.isArray(b))return b;throw new y.TemplateError("list filter: type not iterable")}f.list=s;function a(b){return b=i(b,""),b.toLowerCase()}f.lower=a;function v(b){return b==null?"":k.copySafeness(b,b.replace(/\r\n|\n/g,`<br />
|
|
26
|
+
`))}f.nl2br=v;function u(b){return b[Math.floor(Math.random()*b.length)]}f.random=u;function w(b){function M(q,$,te){$===void 0&&($="truthy");var ne=this,he=ne.env.getTest($);return y.toArray(q).filter(function(ge){return he.call(ne,ge,te)===b})}return M}f.reject=w(!1);function S(b,M){return b.filter(function(q){return!q[M]})}f.rejectattr=S,f.select=w(!0);function L(b,M){return b.filter(function(q){return!!q[M]})}f.selectattr=L;function N(b,M,q,$){var te=b;if(M instanceof RegExp)return b.replace(M,q);typeof $>"u"&&($=-1);var ne="";if(typeof M=="number")M=""+M;else if(typeof M!="string")return b;if(typeof b=="number"&&(b=""+b),typeof b!="string"&&!(b instanceof k.SafeString))return b;if(M==="")return ne=q+b.split("").join(q)+q,k.copySafeness(b,ne);var he=b.indexOf(M);if($===0||he===-1)return b;for(var ue=0,ge=0;he>-1&&($===-1||ge<$);)ne+=b.substring(ue,he)+q,ue=he+M.length,ge++,he=b.indexOf(M,ue);return ue<b.length&&(ne+=b.substring(ue)),k.copySafeness(te,ne)}f.replace=N;function F(b){var M;return y.isString(b)?M=s(b):M=y.map(b,function(q){return q}),M.reverse(),y.isString(b)?k.copySafeness(b,M.join("")):M}f.reverse=F;function g(b,M,q){M=M||0;var $=Math.pow(10,M),te;return q==="ceil"?te=Math.ceil:q==="floor"?te=Math.floor:te=Math.round,te(b*$)/$}f.round=g;function d(b,M,q){for(var $=Math.floor(b.length/M),te=b.length%M,ne=[],he=0,ue=0;ue<M;ue++){var ge=he+ue*$;ue<te&&he++;var Ne=he+(ue+1)*$,Pe=b.slice(ge,Ne);q&&ue>=te&&Pe.push(q),ne.push(Pe)}return ne}f.slice=d;function A(b,M,q){return q===void 0&&(q=0),M&&(b=y.map(b,function($){return $[M]})),q+b.reduce(function($,te){return $+te},0)}f.sum=A,f.sort=k.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(M,q,$,te){var ne=this,he=y.map(M,function(ge){return ge}),ue=y.getAttrGetter(te);return he.sort(function(ge,Ne){var Pe=te?ue(ge):ge,De=te?ue(Ne):Ne;if(ne.env.opts.throwOnUndefined&&te&&(Pe===void 0||De===void 0))throw new TypeError('sort: attribute "'+te+'" resolved to undefined');return!$&&y.isString(Pe)&&y.isString(De)&&(Pe=Pe.toLowerCase(),De=De.toLowerCase()),Pe<De?q?1:-1:Pe>De?q?-1:1:0}),he});function j(b){return k.copySafeness(b,b)}f.string=j;function U(b,M){b=i(b,"");var q=/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,$=ie(b.replace(q,"")),te="";return M?te=$.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,`
|
|
27
|
+
`).replace(/\n\n\n+/g,`
|
|
28
|
+
|
|
29
|
+
`):te=$.replace(/\s+/gi," "),k.copySafeness(b,te)}f.striptags=U;function z(b){b=i(b,"");var M=b.split(" ").map(function(q){return D(q)});return k.copySafeness(b,M.join(" "))}f.title=z;function ie(b){return k.copySafeness(b,b.replace(/^\s*|\s*$/g,""))}f.trim=ie;function G(b,M,q,$){var te=b;if(b=i(b,""),M=M||255,b.length<=M)return b;if(q)b=b.substring(0,M);else{var ne=b.lastIndexOf(" ",M);ne===-1&&(ne=M),b=b.substring(0,ne)}return b+=$??"...",k.copySafeness(te,b)}f.truncate=G;function le(b){return b=i(b,""),b.toUpperCase()}f.upper=le;function be(b){var M=encodeURIComponent;if(y.isString(b))return M(b);var q=y.isArray(b)?b:y._entries(b);return q.map(function($){var te=$[0],ne=$[1];return M(te)+"="+M(ne)}).join("&")}f.urlencode=be;var Z=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,ce=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,Q=/^https?:\/\/.*$/,J=/^www\./,Y=/\.(?:org|net|com)(?:\:|\/|$)/;function pe(b,M,q){m(M)&&(M=1/0);var $=q===!0?' rel="nofollow"':"",te=b.split(/(\s+)/).filter(function(ne){return ne&&ne.length}).map(function(ne){var he=ne.match(Z),ue=he?he[1]:ne,ge=ue.substr(0,M);return Q.test(ue)?'<a href="'+ue+'"'+$+">"+ge+"</a>":J.test(ue)?'<a href="http://'+ue+'"'+$+">"+ge+"</a>":ce.test(ue)?'<a href="mailto:'+ue+'">'+ue+"</a>":Y.test(ue)?'<a href="http://'+ue+'"'+$+">"+ge+"</a>":ne});return te.join("")}f.urlize=pe;function we(b){b=i(b,"");var M=b?b.match(/\w+/g):null;return M?M.length:null}f.wordcount=we;function _e(b,M){var q=parseFloat(b);return m(q)?M:q}f.float=_e;var Le=k.makeMacro(["value","default","base"],[],function(M,q,$){$===void 0&&($=10);var te=parseInt(M,$);return m(te)?q:te});f.int=Le,f.d=f.default,f.e=f.escape},function(_,P,O){function y(m,T){m.prototype=Object.create(T.prototype),m.prototype.constructor=m,k(m,T)}function k(m,T){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(K,I){return K.__proto__=I,K},k(m,T)}var f=O(6),i=function(m){y(T,m);function T(K){var I;return I=m.call(this)||this,I.precompiled=K||{},I}var D=T.prototype;return D.getSource=function(I){return this.precompiled[I]?{src:{type:"code",obj:this.precompiled[I]},path:I}:null},T}(f);_.exports={PrecompiledLoader:i}},function(_,P,O){var y=O(2).SafeString;function k(u){return typeof u=="function"}P.callable=k;function f(u){return u!==void 0}P.defined=f;function i(u,w){return u%w===0}P.divisibleby=i;function m(u){return u instanceof y}P.escaped=m;function T(u,w){return u===w}P.equalto=T,P.eq=P.equalto,P.sameas=P.equalto;function D(u){return u%2===0}P.even=D;function K(u){return!u}P.falsy=K;function I(u,w){return u>=w}P.ge=I;function x(u,w){return u>w}P.greaterthan=x,P.gt=P.greaterthan;function C(u,w){return u<=w}P.le=C;function e(u,w){return u<w}P.lessthan=e,P.lt=P.lessthan;function n(u){return u.toLowerCase()===u}P.lower=n;function r(u,w){return u!==w}P.ne=r;function h(u){return u===null}P.null=h;function c(u){return typeof u=="number"}P.number=c;function p(u){return u%2===1}P.odd=p;function t(u){return typeof u=="string"}P.string=t;function o(u){return!!u}P.truthy=o;function l(u){return u===void 0}P.undefined=l;function s(u){return u.toUpperCase()===u}P.upper=s;function a(u){return typeof Symbol<"u"?!!u[Symbol.iterator]:Array.isArray(u)||typeof u=="string"}P.iterable=a;function v(u){var w=u!=null&&typeof u=="object"&&!Array.isArray(u);return Set?w&&!(u instanceof Set):w}P.mapping=v},function(_,P,O){function y(i){var m=-1;return{current:null,reset:function(){m=-1,this.current=null},next:function(){return m++,m>=i.length&&(m=0),this.current=i[m],this.current}}}function k(i){i=i||",";var m=!0;return function(){var T=m?"":i;return m=!1,T}}function f(){return{range:function(m,T,D){typeof T>"u"?(T=m,m=0,D=1):D||(D=1);var K=[];if(D>0)for(var I=m;I<T;I+=D)K.push(I);else for(var x=m;x>T;x+=D)K.push(x);return K},cycler:function(){return y(Array.prototype.slice.call(arguments))},joiner:function(m){return k(m)}}}_.exports=f},function(_,P,O){var y=O(4);_.exports=function(f,i){function m(T,D){if(this.name=T,this.path=T,this.defaultEngine=D.defaultEngine,this.ext=y.extname(T),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=(this.defaultEngine[0]!=="."?".":"")+this.defaultEngine)}return m.prototype.render=function(D,K){f.render(this.name,D,K)},i.set("view",m),i.set("nunjucksEnv",f),f}},function(_,P,O){var y=O(4),k=O(4),f=O(0),i=f._prettifyError,m=O(5),T=O(7),D=T.Environment,K=O(24);function I(n,r){return Array.isArray(r)?r.some(function(h){return n.match(h)}):!1}function x(n,r){r=r||{},r.isString=!0;var h=r.env||new D([]),c=r.wrapper||K;if(!r.name)throw new Error('the "name" option is required when compiling a string');return c([e(n,r.name,h)],r)}function C(n,r){r=r||{};var h=r.env||new D([]),c=r.wrapper||K;if(r.isString)return x(n,r);var p=y.existsSync(n)&&y.statSync(n),t=[],o=[];function l(v){y.readdirSync(v).forEach(function(u){var w=k.join(v,u),S=w.substr(k.join(n,"/").length),L=y.statSync(w);L&&L.isDirectory()?(S+="/",I(S,r.exclude)||l(w)):I(S,r.include)&&o.push(w)})}if(p.isFile())t.push(e(y.readFileSync(n,"utf-8"),r.name||n,h));else if(p.isDirectory()){l(n);for(var s=0;s<o.length;s++){var a=o[s].replace(k.join(n,"/"),"");try{t.push(e(y.readFileSync(o[s],"utf-8"),a,h))}catch(v){if(r.force)console.error(v);else throw v}}}return c(t,r)}function e(n,r,h){h=h||new D([]);var c=h.asyncFilters,p=h.extensionsList,t;r=r.replace(/\\/g,"/");try{t=m.compile(n,c,p,r,h.opts)}catch(o){throw i(r,!1,o)}return{name:r,template:t}}_.exports={precompile:C,precompileString:x}},function(_,P,O){function y(k,f){var i="";f=f||{};for(var m=0;m<k.length;m++){var T=JSON.stringify(k[m].name),D=k[m].template;i+="(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["+T+`] = (function() {
|
|
30
|
+
`+D+`
|
|
31
|
+
})();
|
|
32
|
+
`,f.asFunction&&(i+="return function(ctx, cb) { return nunjucks.render("+T+`, ctx, cb); }
|
|
33
|
+
`),i+=`})();
|
|
34
|
+
`}return i}_.exports=y},function(_,P,O){function y(){var k=this.runtime,f=this.lib,i=this.compiler.Compiler,m=this.parser.Parser,T=this.nodes,D=this.lexer,K=k.contextOrFrameLookup,I=k.memberLookup,x,C;i&&(x=i.prototype.assertType),m&&(C=m.prototype.parseAggregate);function e(){k.contextOrFrameLookup=K,k.memberLookup=I,i&&(i.prototype.assertType=x),m&&(m.prototype.parseAggregate=C)}k.contextOrFrameLookup=function(l,s,a){var v=K.apply(this,arguments);if(v!==void 0)return v;switch(a){case"True":return!0;case"False":return!1;case"None":return null;default:return}};function n(o){return{index:o.index,lineno:o.lineno,colno:o.colno}}if(T&&i&&m){var r=T.Node.extend("Slice",{fields:["start","stop","step"],init:function(l,s,a,v,u){a=a||new T.Literal(l,s,null),v=v||new T.Literal(l,s,null),u=u||new T.Literal(l,s,1),this.parent(l,s,a,v,u)}});i.prototype.assertType=function(l){l instanceof r||x.apply(this,arguments)},i.prototype.compileSlice=function(l,s){this._emit("("),this._compileExpression(l.start,s),this._emit("),("),this._compileExpression(l.stop,s),this._emit("),("),this._compileExpression(l.step,s),this._emit(")")},m.prototype.parseAggregate=function(){var l=this,s=n(this.tokens);s.colno--,s.index--;try{return C.apply(this)}catch(F){var a=n(this.tokens),v=function(){return f._assign(l.tokens,a),F};f._assign(this.tokens,s),this.peeked=!1;var u=this.peekToken();if(u.type!==D.TOKEN_LEFT_BRACKET)throw v();this.nextToken();for(var w=new r(u.lineno,u.colno),S=!1,L=0;L<=w.fields.length&&!this.skip(D.TOKEN_RIGHT_BRACKET);L++){if(L===w.fields.length)if(S)this.fail("parseSlice: too many slice components",u.lineno,u.colno);else break;if(this.skip(D.TOKEN_COLON))S=!0;else{var N=w.fields[L];w[N]=this.parseExpression(),S=this.skip(D.TOKEN_COLON)||S}}if(!S)throw v();return new T.Array(u.lineno,u.colno,[w])}}}function h(o,l,s,a){o=o||[],l===null&&(l=a<0?o.length-1:0),s===null?s=a<0?-1:o.length:s<0&&(s+=o.length),l<0&&(l+=o.length);for(var v=[],u=l;!(u<0||u>o.length||a>0&&u>=s||a<0&&u<=s);u+=a)v.push(k.memberLookup(o,u));return v}function c(o,l){return Object.prototype.hasOwnProperty.call(o,l)}var p={pop:function(l){if(l===void 0)return this.pop();if(l>=this.length||l<0)throw new Error("KeyError");return this.splice(l,1)},append:function(l){return this.push(l)},remove:function(l){for(var s=0;s<this.length;s++)if(this[s]===l)return this.splice(s,1);throw new Error("ValueError")},count:function(l){for(var s=0,a=0;a<this.length;a++)this[a]===l&&s++;return s},index:function(l){var s;if((s=this.indexOf(l))===-1)throw new Error("ValueError");return s},find:function(l){return this.indexOf(l)},insert:function(l,s){return this.splice(l,0,s)}},t={items:function(){return f._entries(this)},values:function(){return f._values(this)},keys:function(){return f.keys(this)},get:function(l,s){var a=this[l];return a===void 0&&(a=s),a},has_key:function(l){return c(this,l)},pop:function(l,s){var a=this[l];if(a===void 0&&s!==void 0)a=s;else{if(a===void 0)throw new Error("KeyError");delete this[l]}return a},popitem:function(){var l=f.keys(this);if(!l.length)throw new Error("KeyError");var s=l[0],a=this[s];return delete this[s],[s,a]},setdefault:function(l,s){return s===void 0&&(s=null),l in this||(this[l]=s),this[l]},update:function(l){return f._assign(this,l),null}};return t.iteritems=t.items,t.itervalues=t.values,t.iterkeys=t.keys,k.memberLookup=function(l,s,a){return arguments.length===4?h.apply(this,arguments):(l=l||{},f.isArray(l)&&c(p,s)?p[s].bind(l):f.isObject(l)&&c(t,s)?t[s].bind(l):I.apply(this,arguments))},e}_.exports=y}])})})(Kt);var bn=Kt.exports;const Lt=pn(bn);var xn=(V,R)=>R(V.currentTarget.checked),wn=me('<label class="absolute right-6 top-1 z-10 inline-flex cursor-pointer items-center gap-2 bg-transparent text-rc-gray-100 focus:outline-none focus:ring-0"><input type="checkbox" class="checkbox svelte-1br1z62"/> <span>Preview</span></label>'),En=me('<div class="flex justify-end"><!></div>'),kn=me('<div class="prompt-editor flex h-full flex-col"><div class="relative flex-1"><div class="h-full w-full"></div> <!></div> <!></div>');function On(V,R){ut(R,!0);let _=Ke(null),P,O=yt(R,"readOnly",3,!1),y=yt(R,"showPreviewToggle",3,!0),k=yt(R,"preview",3,null),f=!1,i=null,m=null,T=!1,D=null,K=[],I=null,x=null,C=0;const e=24;let n=Ke(!1);const r=Fe(()=>k()!==null?k():B(n));function h(S,L){const N=S.getLayoutInfo(),F=Number((N==null?void 0:N.contentWidth)??0);if(!Number.isFinite(F)||F<=0)return 80;const g=S.getOption(L.editor.EditorOption.fontInfo),d=Number(g==null?void 0:g.typicalHalfwidthCharacterWidth)||Number(g==null?void 0:g.typicalFullwidthCharacterWidth)||7;if(!Number.isFinite(d)||d<=0)return 80;const A=Math.floor((F-e)/d);return Math.max(20,A)}function c(){!B(_)||!m||x==null&&(x=requestAnimationFrame(()=>{if(x=null,!B(_)||!m)return;const S=h(B(_),m);S!==C&&(C=S,B(_).updateOptions({wordWrap:"bounded",wordWrapColumn:S}))}))}xt(()=>{if(!P)return;Bt();let S=!1;return It(()=>import("../chunks/DLQqXQ6R.js").then(L=>L.e),__vite__mapDeps([0,1,2]),import.meta.url).then(L=>{if(S)return;m=L,Mt(L),ke(_,L.editor.create(P,{value:"",language:"markdown",theme:"bosun-dark",lineNumbers:"off",fontSize:14,fontFamily:'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',automaticLayout:!0,minimap:{enabled:!1},wordBasedSuggestions:"off",wordWrap:"bounded",wordWrapColumn:120,wrappingStrategy:"advanced",matchBrackets:"never",bracketPairColorization:{enabled:!0},guides:{highlightActiveBracketPair:!1,bracketPairs:!1,bracketPairsHorizontal:!1},occurrencesHighlight:"off",selectionHighlight:!1,unicodeHighlight:{ambiguousCharacters:!1,nonBasicASCII:!1,invisibleCharacters:!1,includeStrings:!1,includeComments:!1},autoClosingQuotes:"never",padding:{top:32},readOnly:O()}),!0),D=B(_).getModel(),c(),K.push(B(_).onDidLayoutChange(()=>c())),ct.agents.context.query({agentId:R.agentId}).then(g=>{S||(I==null||I.dispose(),I=yn(L,g))}),i=sn(L,B(_));const N=R.prompt??"";f=!0,B(_).setValue(N),f=!1,requestAnimationFrame(()=>{i==null||i.update()});const F=t(R.onPromptChanged,500);if(K.push(B(_).onDidChangeModelContent(()=>{if(B(_)&&(i==null||i.update(),!f))try{const g=B(_).getValue();if(g===R.prompt)return;F(g)}catch(g){console.error("Error updating prompt",g)}})),T=!0,R.onEditorReady)try{R.onEditorReady(B(_),L)}catch(g){console.error("PromptEditor onEditorReady error",g)}}).catch(L=>{console.error("Error initializing Monaco editor:",L)}),()=>{S=!0,x!=null&&cancelAnimationFrame(x),x=null,clearTimeout(p);try{I==null||I.dispose()}catch{}I=null;for(const N of K)try{N.dispose()}catch{}K=[],i==null||i.dispose(),i=null;const L=D;if(D=null,B(_)){try{B(_).setModel(null)}catch{}B(_).dispose(),ke(_,null)}try{L==null||L.dispose()}catch{}}}),We(()=>{if(!B(_)||!T)return;const S=B(_).getValue(),L=R.prompt??"";if(S!==L){f=!0;try{B(_).setValue(L),i==null||i.update()}finally{f=!1}}}),We(()=>{!B(_)||!T||B(_).updateOptions({readOnly:O()})});let p;function t(S,L=300){return(...N)=>{clearTimeout(p),p=setTimeout(()=>{S(...N)},L)}}function o(S,L){return Lt.configure({autoescape:!1,trimBlocks:!0,lstripBlocks:!0}),Lt.renderString(S,L||{})}let l="",s=0;function a(S){var L;if(k()!==null){(L=R.onPreviewChange)==null||L.call(R,S);return}ke(n,S,!0)}function v(){if(s+=1,!!B(_)){f=!0;try{l&&(B(_).setValue(l),l=""),B(_).updateOptions({readOnly:O()})}finally{f=!1}}}async function u(){if(!B(_)||O())return;l=B(_).getValue();const S=s+=1;let L=null;try{L=await ct.agents.context.query({agentId:R.agentId})}catch(F){console.error("Failed to load agent context for preview:",F),L=null}if(S!==s||!B(_)||!B(r))return;const N=o(l,L||{});f=!0;try{B(_).setValue(N),B(_).updateOptions({readOnly:!0})}finally{f=!1}}let w=Ke(!1);We(()=>{if(!B(_)||!T)return;const S=!!B(r)&&!O();S!==B(w)&&(ke(w,S,!0),S?u():v())}),lt(V,{get class(){return`relative overflow-hidden ${R.class??""}`},children:(S,L)=>{var N=kn(),F=ae(N),g=ae(F);Ft(g,z=>P=z,()=>P);var d=ye(g,2);{var A=z=>{var ie=wn(),G=ae(ie);Pt(G),G.__change=[xn,a],Be(2),oe(ie),Me(()=>zt(G,B(r))),re(z,ie)};Se(d,z=>{y()&&!O()&&z(A)})}oe(F);var j=ye(F,2);{var U=z=>{var ie=En(),G=ae(ie);mt(G,{variant:"secondary",get onclick(){return R.onSchemaClick},class:"absolute bottom-2 right-6 !font-medium",children:(le,be)=>{Be();var Z=Ve("Schema");re(le,Z)},$$slots:{default:!0}}),oe(ie),re(z,ie)};Se(j,z=>{R.showSchemaButton&&R.onSchemaClick&&z(U)})}oe(N),re(S,N)}}),ft()}wt(["change"]);var Tn=me("<!> <!>",1),Ln=me('<div class="flex h-full items-center justify-center text-sm text-rc-gray-300">Loading</div>'),Sn=me('<pre class="whitespace-pre-wrap font-mono text-xs text-rc-gray-200"> </pre>'),An=me('<div class="flex h-full flex-col gap-3"><div class="text-sm text-red-400"> </div></div>'),Cn=me('<pre class="whitespace-pre-wrap font-mono text-xs text-rc-gray-200"> </pre>'),Nn=(V,R,_)=>R.focusQuote(B(_).quote),Pn=me('<button type="button" class="rounded-md border border-rc-gray-700 bg-rc-gray-900/40 px-3 py-2 text-left hover:border-rc-gray-500"><div class="flex items-center justify-between text-xs text-rc-gray-400"><div> </div> <div> </div></div> <div class="whitespace-pre-wrap break-words text-sm text-rc-gray-100"> </div></button>'),Rn=me('<div class="flex flex-col gap-2"></div>'),In=me('<div class="text-sm text-rc-gray-300">No quotes returned.</div>'),Fn=me('<div class="mb-3 text-sm font-semibold text-rc-gray-100"> </div> <!>',1),Bn=(V,R,_)=>R.focusQuote(_),Mn=me('<button type="button" class="rounded-md border border-rc-gray-700 bg-rc-gray-900/40 px-3 py-2 text-left hover:border-rc-gray-500"><div class="whitespace-pre-wrap break-words text-sm text-rc-gray-100"> </div></button>'),Kn=me('<div class="mt-3 flex flex-col gap-2"></div>'),jn=me('<div class="rounded-md border border-rc-gray-700 bg-rc-gray-900/40 p-3"><div class="flex items-start justify-between gap-3"><div class="text-xs font-semibold text-rc-gray-400"></div> <div class="text-xs text-rc-gray-500"> </div></div> <div class="mt-1 whitespace-pre-wrap break-words text-sm text-rc-gray-100"> </div> <!></div>'),Dn=me('<div class="flex flex-col gap-3"></div>'),Un=me('<div class="text-sm text-rc-gray-300">No issues found.</div>'),Vn=me('<div class="mb-3 text-sm font-semibold text-rc-gray-100"> </div> <!>',1),Wn=me('<div class="border-b border-rc-gray-700 px-2 py-1"><!></div> <div class="min-h-0 flex-1 overflow-auto p-3"><!></div>',1);function $n(V,R){ut(R,!0);const{state:_,actions:P}=Rt();let O=Ke("results"),y=Ke(null);We(()=>{var T;const m=((T=_.edit.popover)==null?void 0:T.requestId)??null;m!==B(y)&&(ke(y,m,!0),ke(O,"results"))});var k=Qe(),f=Ce(k);{var i=m=>{const T=Fe(()=>_.edit.popover);var D=Wn(),K=Ce(D),I=ae(K);bt(I,{get value(){return B(O)},ariaLabel:"Popover tabs",onChange:({value:r})=>ke(O,r,!0),children:(r,h)=>{var c=Tn(),p=Ce(c);et(p,{value:"results",children:(o,l)=>{Be();var s=Ve("Results");re(o,s)},$$slots:{default:!0}});var t=ye(p,2);et(t,{value:"raw",children:(o,l)=>{Be();var s=Ve("Raw");re(o,s)},$$slots:{default:!0}}),re(r,c)},$$slots:{default:!0}}),oe(K);var x=ye(K,2),C=ae(x);{var e=r=>{var h=Ln();re(r,h)},n=r=>{var h=Qe(),c=Ce(h);{var p=o=>{var l=Qe(),s=Ce(l);{var a=u=>{const w=Fe(()=>{var N;return typeof((N=B(T).data)==null?void 0:N.raw)=="string"?B(T).data.raw:B(T).error});var S=Sn(),L=ae(S,!0);oe(S),Me(()=>Re(L,B(w)||"—")),re(u,S)},v=u=>{var w=An(),S=ae(w),L=ae(S,!0);oe(S),oe(w),Me(()=>Re(L,B(T).error)),re(u,w)};Se(s,u=>{B(O)==="raw"?u(a):u(v,!1)})}re(o,l)},t=o=>{const l=Fe(()=>B(T).data);var s=Qe(),a=Ce(s);{var v=w=>{var S=Cn(),L=ae(S,!0);oe(S),Me(()=>{var N;return Re(L,typeof((N=B(l))==null?void 0:N.raw)=="string"?B(l).raw:"—")}),re(w,S)},u=w=>{var S=Qe(),L=Ce(S);{var N=g=>{var d=Fn(),A=Ce(d),j=ae(A,!0);oe(A);var U=ye(A,2);{var z=G=>{var le=Rn();at(le,23,()=>B(l).quotes,be=>be.quote,(be,Z,ce)=>{var Q=Pn();Q.__click=[Nn,P,Z];var J=ae(Q),Y=ae(J),pe=ae(Y);oe(Y);var we=ye(Y,2),_e=ae(we);oe(we),oe(J);var Le=ye(J,2),b=ae(Le,!0);oe(Le),oe(Q),Me(()=>{Re(pe,`Quote ${B(ce)+1}`),Re(_e,`x${B(Z).count??""}/10`),Re(b,B(Z).quote)}),re(be,Q)}),oe(le),re(G,le)},ie=G=>{var le=In();re(G,le)};Se(U,G=>{var le;Array.isArray((le=B(l))==null?void 0:le.quotes)&&B(l).quotes.length>0?G(z):G(ie,!1)})}Me(()=>{var G;return Re(j,((G=B(l))==null?void 0:G.title)??"Analysis")}),re(g,d)},F=g=>{var d=Vn(),A=Ce(d),j=ae(A,!0);oe(A);var U=ye(A,2);{var z=G=>{var le=Dn();at(le,21,()=>B(l).issues,_t,(be,Z,ce)=>{var Q=jn(),J=ae(Q),Y=ae(J);Y.textContent=`Issue ${ce+1}`;var pe=ye(Y,2),we=ae(pe,!0);oe(pe),oe(J);var _e=ye(J,2),Le=ae(_e,!0);oe(_e);var b=ye(_e,2);{var M=q=>{var $=Kn();at($,20,()=>B(Z).contradictingQuotes,te=>te,(te,ne)=>{var he=Mn();he.__click=[Bn,P,ne];var ue=ae(he),ge=ae(ue,!0);oe(ue),oe(he),Me(()=>Re(ge,ne)),re(te,he)}),oe($),re(q,$)};Se(b,q=>{B(Z).contradictingQuotes&&B(Z).contradictingQuotes.length>0&&q(M)})}oe(Q),Me(()=>{Re(we,B(Z).type),Re(Le,B(Z).reason)}),re(be,Q)}),oe(le),re(G,le)},ie=G=>{var le=Un();re(G,le)};Se(U,G=>{var le;Array.isArray((le=B(l))==null?void 0:le.issues)&&B(l).issues.length>0?G(z):G(ie,!1)})}Me(()=>{var G;return Re(j,((G=B(l))==null?void 0:G.title)??"Prompt issues")}),re(g,d)};Se(L,g=>{B(T).kind==="analyze"?g(N):g(F,!1)},!0)}re(w,S)};Se(a,w=>{B(O)==="raw"?w(v):w(u,!1)})}re(o,s)};Se(c,o=>{B(T).status==="error"?o(p):o(t,!1)},!0)}re(r,h)};Se(C,r=>{B(T).status==="loading"?r(e):r(n,!1)})}oe(x),re(m,D)};Se(f,m=>{_.edit.popover&&m(i)})}re(V,k),ft()}wt(["click"]);var Hn=me('<div class="min-h-0 flex-1 overflow-hidden p-3"><!></div>');function Gn(V,R){ut(R,!1);const _=Rt(),P=$t(_.state),O=_.actions;function y(i){Ht(P,B(P).context=i),O.sendAppEvent({type:"context-updated",context:i})}cn();var k=Hn(),f=ae(k);rn(f,{class:"h-full min-h-0 border-thin border-rc-gray-650 shadow-inner-white-soft backdrop-blur-3xl focus:outline-none focus:ring-0",get context(){return B(P).context},onContextChanged:y,suppressErrors:!0}),oe(k),re(V,k),ft()}function qn(V){try{return decodeURIComponent(V)}catch{return V}}function jt(V){var y;const _=(((y=String(V||"").split("?")[0])==null?void 0:y.split("#")[0])??"").split("/").filter(Boolean);if(_[0]!=="edit")return{agentId:null,tab:null};if(_.length===1)return{agentId:null,tab:null};const P=qn(_[1]??""),O=_[2]??null;return O?O==="roleplay"?{agentId:P,tab:"roleplay"}:O==="tests"?{agentId:P,tab:"tests"}:O==="configure"?{agentId:P,tab:"configure"}:{agentId:P,tab:null}:{agentId:P,tab:"roleplay"}}function zn(V){return{tab:jt(V.pathname).tab??"roleplay",popover:null,highlights:null,requestSeq:0}}function Qn(V,R){const P=jt(R.pathname).tab??"roleplay";return{...V,tab:P,popover:null,highlights:null}}function Yn(V,R){const _=V.requestSeq+1;return{...V,requestSeq:_,popover:{kind:R.kind,status:"loading",requestId:_},highlights:null}}function Jn(V,R){return!V.popover||V.popover.requestId!==R.requestId?V:{...V,popover:{...V.popover,status:"ready",data:R.data,error:void 0}}}function Xn(V,R){return!V.popover||V.popover.requestId!==R.requestId?V:{...V,popover:{...V.popover,status:"error",error:String(R.error||"Unknown error"),data:R.data}}}function Zn(V){return{...V,popover:null,highlights:null}}function er(V,R){return{...V,highlights:{quotes:R??[],focusQuote:null,focusNonce:0}}}function tr(V,R){const _=String(R||"");if(!_)return V;const P=V.highlights??{quotes:[],focusQuote:null,focusNonce:0};return{...V,highlights:{...P,focusQuote:_,focusNonce:(P.focusNonce??0)+1}}}function nr(V,R){const _=String(V??""),P=rr(R),O=Ct(_);for(const y of P){const k=St(_,y);if(k.length>0)return k;const f=At(_,y);if(f.length>0)return f;const i=Ct(y);if(O!==_||i!==y){const m=St(O,i);if(m.length>0)return m;const T=At(O,i);if(T.length>0)return T}}return[]}function St(V,R){const _=String(R??"");if(!_)return[];const P=[];let O=0;for(;O<=V.length-_.length;){const y=V.indexOf(_,O);if(y===-1)break;P.push({start:y,end:y+_.length}),O=y+1}return P}function At(V,R){const _=String(R??"");if(!_.trim())return[];const P=ir(_).replace(/\s+/g,"\\s+");let O;try{O=new RegExp(`(?=(${P}))`,"gu")}catch{return[]}const y=[];let k;for(;(k=O.exec(V))!==null;){const f=k.index,i=k[1]??"",m=f+i.length;m>f&&y.push({start:f,end:m}),O.lastIndex===f&&(O.lastIndex+=1)}return y}function rr(V){const R=String(V??""),_=R.trim(),P=new Set;for(const k of[R,_])k&&P.add(k);const O=_.replace(/^[-*•]\s+/,"");O&&O!==_&&P.add(O);const y=_.replace(/^(?:\(?\d+\)?[.)]|[a-zA-Z][.)])\s+/,"");return y&&y!==_&&P.add(y),[...P].filter(k=>k.trim().length>0)}function Ct(V){return String(V??"").replace(/\r/g,`
|
|
35
|
+
`).replace(/[\u00A0\u2007\u202F\u2009\u200A\u200B\uFEFF]/g," ").replace(/[\u201C\u201D\u201E\u00AB\u00BB]/g,'"').replace(/[\u2018\u2019]/g,"'").replace(/[\u2013\u2014]/g,"-")}function ir(V){return V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function or(V,R){const _=V.createDecorationsCollection(),P=V.createDecorationsCollection();let O=null,y=new Map,k=new Map,f=0;function i(){y=new Map,k=new Map,f=0}function m(e,n,r){return Number.isNaN(e)?n:Math.max(n,Math.min(r,e))}function T(e){const n=m(e,1,10);return`rgba(220, 38, 38, ${m(.22+n*.06,.28,.82)})`}function D(e,n){const r=String(e??"");if(!r)return[];const h=y.get(r);if(h)return h;const c=nr(n,r);return y.set(r,c),c}function K(e){const n=V.getModel();if(!n)return;const r=n.getValue()??"",h=[],c=[...e||[]].sort((p,t)=>(p.count||0)-(t.count||0));for(const p of c){const t=String(p.quote||"");if(!t)continue;const o=m(Number(p.count||0),1,10),l=T(o),s=D(t,r);for(const a of s){const v=n.getPositionAt(a.start),u=n.getPositionAt(a.end);h.push({range:new R.Range(v.lineNumber,v.column,u.lineNumber,u.column),options:{inlineClassName:`analysis-quote analysis-quote-l${o}`,overviewRuler:{color:l,position:R.editor.OverviewRulerLane.Center}}})}}_.set(h)}function I(e){const n=V.getModel();if(!n)return;const r=n.getValue()??"",h=D(e,r);if(h.length===0)return;const p=((k.get(e)??-1)+1)%h.length;k.set(e,p);const t=h[p],o=n.getPositionAt(t.start),l=n.getPositionAt(t.end),s=new R.Range(o.lineNumber,o.column,l.lineNumber,l.column);P.set([{range:s,options:{inlineClassName:"analysis-quote-focus"}}]),V.setSelection(s),V.revealRangeInCenter(s,R.editor.ScrollType.Smooth),V.focus()}function x(e){if(O=e,!O){_.clear(),P.clear(),i();return}K(O.quotes||[]),O.focusQuote&&O.focusNonce!==f?(f=O.focusNonce,I(O.focusQuote)):O.focusQuote||P.clear()}const C=V.onDidChangeModelContent(()=>{O&&(y=new Map,P.clear(),K(O.quotes||[]))});return{setHighlights:x,dispose:()=>{try{C.dispose(),_.clear(),P.clear()}finally{O=null,i()}}}}var sr=me("<!> <!>",1),ar=me('<span class="truncate"> </span> <!>',1),lr=me('<div class="mt-1 overflow-hidden rounded-lg border border-rc-gray-110 bg-rc-gray-930 shadow-inner-white-soft backdrop-blur-2xl" role="listbox" aria-label="Region"></div>'),cr=me('<span class="text-sm text-rc-gray-300">Region</span> <div><!> <!></div>',1),ur=me('<div class="p-2 text-rc-gray-400">Connecting…</div>'),fr=me('<div class="p-2 text-rc-gray-400">No steps</div>'),pr=(V,R,_)=>R(B(_).name),hr=me('<button><span class="block truncate"> </span></button>'),dr=me('<div class="rc-scroll min-h-0 flex-1 overflow-auto p-2"><!></div>'),vr=me("<!> <!> <!>",1),mr=me('<div class="border-b border-rc-gray-700 p-2"><!></div> <div class="min-h-0 flex-1"><!></div> <!> <!>',1),gr=me('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 pb-3 pr-4 pt-2"><nav class="flex flex-none items-center bg-rc-gray-980"><div class="flex w-1/3 justify-start"></div> <div class="flex w-1/3 justify-center"><!></div> <div class="flex w-1/3 items-center justify-end gap-2 pr-2"><!></div></nav> <div class="flex-1 overflow-hidden"><div class="grid h-full w-full grid-cols-[minmax(140px,2fr)_minmax(0,10fr)_minmax(0,11fr)]"><!> <div class="flex h-full min-w-0 flex-col"><div class="flex h-14 flex-none items-center justify-between gap-3 border-b border-rc-gray-700 p-2"><div class="min-w-0"><div class="truncate font-semibold text-rc-gray-100"> </div></div> <div class="flex items-center gap-3"><label class="inline-flex items-center gap-2 text-rc-gray-300"><input type="checkbox" aria-label="Preview rendered prompt" class="h-4 w-4 appearance-none rounded border border-rc-gray-300 bg-rc-gray-600 !accent-rc-gray-600 outline-none ring-0 checked:border-rc-gray-200 checked:bg-rc-gray-600 hover:border-rc-gray-200 hover:bg-rc-gray-600 focus:outline-none focus:ring-0 active:border-rc-gray-200 active:bg-rc-gray-600 disabled:cursor-not-allowed disabled:opacity-50"/> <span>Preview</span></label> <!></div></div> <div class="min-h-0 flex-1"><!></div></div> <!></div></div></div></div> <!>',1);function $r(V,R){ut(R,!0);const{onError:_}=ln();let P=Ke(Et([]));const O=E=>{try{return E?decodeURIComponent(E):""}catch{return E||""}},y=E=>encodeURIComponent(E);function k(E){return O(E).trim().replace(/^\/+|\/+$/g,"")}const f=Fe(()=>k(R.params.agent)),i=Et({agentId:k(R.params.agent),region:null,availableRegions:[],defaultRegion:null,wsLoaded:!1,steps:[],currentStep:null,prompt:"",context:null,promptContext:null,agentStates:[],currentState:null,contextPopoverOpen:!1,edit:zn({pathname:$e.url.pathname})});let m=null,T=null;const D="region-dropdown";let K=Ke(!1),I=Ke(null);We(()=>{const E=i.availableRegions,W=i.region;(!E.length||!W||!E.includes(W))&&ke(K,!1)});function x(E,W){if(typeof window>"u")return;const H=new URL(window.location.href);W===null?H.searchParams.delete(E):H.searchParams.set(E,W),on(H.toString(),{})}function C(E){Ze.sendMessage({channel:"app-events",event:E})}async function e(E){try{const W=await ct.regionConfig.meta.query({agent:E});if(!W){i.availableRegions=[],i.defaultRegion=null,i.region=null,x("region",null);return}if(i.availableRegions=W.availableRegions,i.defaultRegion=W.defaultRegion??null,!Array.isArray(W.availableRegions)||W.availableRegions.length===0){i.region=null,x("region",null);return}const H=($e.url.searchParams.get("region")||"").trim()||null,se=H&&W.availableRegions.includes(H)&&H||W.defaultRegion&&W.availableRegions.includes(W.defaultRegion)&&W.defaultRegion||W.availableRegions[0]||null;i.region=se,x("region",se)}catch(W){console.error("Failed to load region config meta",W),i.availableRegions=[],i.defaultRegion=null,i.region=null,x("region",null)}}We(()=>{const E=B(f);E&&E!==T&&(T=E,e(E))});function n(E){var W;F(),i.currentStep=i.steps.find(H=>H.name===E)||null,i.prompt=((W=i.currentStep)==null?void 0:W.prompt)??"",i.currentStep?(x("step",i.currentStep.name),C({type:"step-selected",step:i.currentStep.name})):x("step",null)}function r(E){i.prompt=E,C({type:"prompt-updated",prompt:E})}const h=Fe(()=>{var E;return((E=i.currentStep)==null?void 0:E.schema)??null}),c=Fe(()=>!!B(h)&&B(h).trim().length>0);let p=Ke(!1);function t(){B(h)&&ke(p,!0)}function o({value:E}){if(E===i.edit.tab)return;F();const W=$e.url.searchParams.get("step"),H=$e.url.searchParams.get("region"),se=`/edit/${y(i.agentId)}/${E}`,fe=new URLSearchParams;W&&fe.set("step",W),H&&fe.set("region",H);const xe=fe.size?`${se}?${fe.toString()}`:se;st(xe)}const l=Fe(()=>{const E=$e.url.pathname.split("/")[1];return E==="traces"?"view":E});function s({value:E}){if(E!==B(l)){if(F(),E==="edit")return st("/edit");if(E==="view")return st("/view");st("/"+E)}}function a(E){var W;return i.contextPopoverOpen=!1,i.edit=Yn(i.edit,{kind:E}),((W=i.edit.popover)==null?void 0:W.requestId)??0}function v(E,W){i.edit=Jn(i.edit,{requestId:E,data:W})}function u(E,W,H){i.edit=Xn(i.edit,{requestId:E,error:W,data:H})}function w(){i.edit=Zn(i.edit)}function S(){w(),i.contextPopoverOpen=!0}function L(){i.contextPopoverOpen=!1}function N(){i.contextPopoverOpen?L():S()}function F(){w(),L()}function g(E){return E==="analyze"?"Analyze":"Find issues"}function d(E){i.edit=er(i.edit,E)}function A(E){i.edit=tr(i.edit,E)}let j=null,U=Ke(!1),z=null;We(()=>{var W;const E=((W=i.currentStep)==null?void 0:W.name)??null;E!==z&&(z=E,ke(U,!1))});function ie(E,W){j==null||j.dispose(),j=or(E,W),j.setHighlights(i.edit.highlights)}We(()=>{const E=i.edit.highlights;j==null||j.setHighlights(E)});let G=Ke("");We(()=>{const E=$e.url.toString();E!==B(G)&&(ke(G,E,!0),i.edit=Qn(i.edit,{pathname:$e.url.pathname}),i.contextPopoverOpen=!1)});function le(E,W,H){return Math.max(W,Math.min(H,E))}function be(E){const W=new Map;for(const H of E||[])for(const se of H.contradictingQuotes||[]){const fe=String(se||"").trim();fe&&W.set(fe,(W.get(fe)||0)+1)}return[...W.entries()].map(([H,se])=>({quote:H,count:le(se,1,10)})).sort((H,se)=>se.count-H.count||H.quote.localeCompare(se.quote))}let Z=Ke(!1);async function ce(){var W;if(B(Z)||!i.currentStep)return;ke(Z,!0);const E=a("findIssues");try{const H=await ct.tests.findPromptIssues.mutate({agent:i.agentId,step:i.currentStep.name,prompt:i.prompt??""}),se=be(H.issues||[]);if(((W=i.edit.popover)==null?void 0:W.requestId)!==E)return;d(se);let fe=null;try{fe=JSON.stringify(H.raw,null,2)}catch{fe=null}v(E,{title:`Prompt issues — ${i.currentStep.name}`,issues:H.issues,raw:fe})}catch(H){console.error(H);const se=typeof(H==null?void 0:H.message)=="string"?H.message:(()=>{try{return JSON.stringify(H)}catch{return String(H)}})();u(E,se||"Failed to find issues in this prompt",{title:`Prompt issues failed — ${i.currentStep.name}`,raw:se})}finally{ke(Z,!1)}}function Q(E){F();const W=$e.url.searchParams.get("step"),H=$e.url.searchParams.get("region"),se=`/edit/${y(E)}/${i.edit.tab}`,fe=new URLSearchParams;W&&fe.set("step",W),H&&fe.set("region",H);const xe=fe.size?`${se}?${fe.toString()}`:se;st(xe)}function J(E){!E||E===i.region||(i.region=E,x("region",E))}Xt({state:i,actions:{openPopover:a,setPopoverReady:v,setPopoverError:u,closePopover:w,setHighlightQuotes:d,focusQuote:A,openContextPopover:S,closeContextPopover:L,toggleContextPopover:N,sendAppEvent:C,sendChatMessage:E=>Ze.sendMessage({channel:"chat",message:E}),selectState:E=>{F(),i.currentState=E,kt(),Tt(),C({type:"select-agent",agent:i.agentId,state:E,region:i.region})}}}),xt(async()=>{try{ke(P,await ct.agents.list.query(),!0)}catch(E){console.error("Failed to load agents",E)}Ze.onClose(()=>{i.wsLoaded=!1,i.steps=[],i.currentStep=null,i.prompt="",i.context=null,i.promptContext=null,i.agentStates=[],i.currentState=null,i.contextPopoverOpen=!1,m=null}),Ze.onError(E=>_(E)),Ze.onMessage(E=>{if(E.channel==="app-events"){if(E.event.type==="agents-loaded"){i.wsLoaded=!0;return}if(E.event.type==="context-updated"){i.context=E.event.context,E.event.promptContext&&(i.promptContext=E.event.promptContext);return}if(E.event.type==="prompt-updated"){i.prompt=E.event.prompt??"";return}if(E.event.type==="update-states"){const W=i.agentStates.length;i.agentStates=E.event.states,(!i.currentState&&i.agentStates.length>0||i.agentStates.length>W)&&(i.currentState=i.agentStates[i.agentStates.length-1].id);return}if(E.event.type==="agent-selected"){i.steps=E.event.agent.steps;const W=($e.url.searchParams.get("step")||"").trim()||null,H=W?i.steps.find(xe=>xe.name===W)??null:null,se=i.steps.find(xe=>xe.name.toLowerCase()==="main")??i.steps[0]??null,fe=H??se;i.currentStep=fe,i.prompt=(fe==null?void 0:fe.prompt)??"",fe?(fe.name!==W&&x("step",fe.name),C({type:"step-selected",step:fe.name})):x("step",null);return}return}if(E.channel==="log"){un(E.message);return}if(E.channel==="step-trace"){Zt(E.trace);return}if(E.channel==="api-call-trace"){en(E.trace);return}if(E.channel==="conversational-trace"){tn(E.trace);return}if(E.channel==="error"){_(E.message);return}}),Ze.init(),i.wsLoaded=Ze.isReady()}),Nt(()=>{j==null||j.dispose(),j=null}),We(()=>{if(i.agentId=B(f),!i.wsLoaded||!i.agentId||i.availableRegions.length>0&&!i.region)return;const E=`${i.agentId}::${i.region??""}`;m!==E&&(m=E,kt(),Tt(),F(),i.currentState=null,i.agentStates=[],i.context=null,i.promptContext=null,i.steps=[],i.currentStep=null,i.prompt="",C({type:"select-agent",agent:i.agentId,region:i.region}))});var Y=gr(),pe=Ce(Y),we=ae(pe);an(we,{className:"flex-none",get agents(){return B(P)},get currentAgent(){return i.agentId},onAgentClick:Q});var _e=ye(we,2),Le=ae(_e),b=ye(ae(Le),2),M=ae(b);bt(M,{get value(){return B(l)},ariaLabel:"Top tabs",onChange:s,children:(E,W)=>{var H=sr(),se=Ce(H);et(se,{value:"edit",children:(xe,Ae)=>{Be();var Oe=Ve("Edit");re(xe,Oe)},$$slots:{default:!0}});var fe=ye(se,2);et(fe,{value:"view",children:(xe,Ae)=>{Be();var Oe=Ve("View");re(xe,Oe)},$$slots:{default:!0}}),re(E,H)},$$slots:{default:!0}}),oe(b);var q=ye(b,2),$=ae(q);{var te=E=>{var W=cr(),H=ye(Ce(W),2),se=ae(H);mt(se,{variant:"secondary",size:"small",get"aria-expanded"(){return B(K)},"aria-haspopup":"listbox","aria-controls":D,onclick:xe=>{xe.stopPropagation(),ke(K,!B(K))},class:"flex w-32 items-center justify-between gap-1 !px-3 !py-1",get el(){return B(I)},set el(xe){ke(I,xe,!0)},children:(xe,Ae)=>{var Oe=ar(),Ue=Ce(Oe),Ie=ae(Ue,!0);oe(Ue);var Je=ye(Ue,2);{let Te=Fe(()=>"size-5 text-rc-gray-400 transition-transform duration-200 "+(B(K)?"rotate-180":""));Qt(Je,{name:"chevron-down",get class(){return B(Te)}})}Me(()=>Re(Ie,i.region)),re(xe,Oe)},$$slots:{default:!0}});var fe=ye(se,2);nn(fe,{id:D,get open(){return B(K)},onClose:()=>ke(K,!1),get anchorEl(){return B(I)},placement:"bottom-end",offset:[0,1],children:Ae=>{var Oe=lr();at(Oe,21,()=>i.availableRegions,_t,(Ue,Ie)=>{{let Je=Fe(()=>B(Ie)===i.region),Te=Fe(()=>`w-full rounded-none py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400 ${B(Ie)===i.region?"bg-rc-gray-800 text-rc-gray-100":"text-rc-gray-200"}`);mt(Ue,{variant:"ghost",size:"small",role:"option",get"aria-selected"(){return B(Je)},onclick:je=>{je.stopPropagation(),ke(K,!1),J(B(Ie))},get class(){return B(Te)},children:(je,He)=>{Be();var Ge=Ve();Me(()=>Re(Ge,B(Ie))),re(je,Ge)},$$slots:{default:!0}})}}),oe(Oe),re(Ae,Oe)},$$slots:{default:!0}}),oe(H),re(E,W)};Se($,E=>{i.availableRegions.length>0&&i.region&&E(te)})}oe(q),oe(Le);var ne=ye(Le,2),he=ae(ne),ue=ae(he);lt(ue,{class:"flex h-full min-w-0 flex-col !rounded-none p-0",children:(E,W)=>{var H=dr(),se=ae(H);{var fe=Ae=>{var Oe=ur();re(Ae,Oe)},xe=Ae=>{var Oe=Qe(),Ue=Ce(Oe);{var Ie=Te=>{var je=fr();re(Te,je)},Je=Te=>{var je=Qe(),He=Ce(je);at(He,17,()=>i.steps,_t,(Ge,tt)=>{var Xe=hr();Xe.__click=[pr,n,tt];var dt=ae(Xe),qe=ae(dt,!0);oe(dt),oe(Xe),Me(()=>{var nt;Yt(Xe,1,`my-1 w-full rounded-lg px-3 py-2 text-left text-rc-gray-200 hover:bg-rc-gray-700 ${B(tt).name===((nt=i.currentStep)==null?void 0:nt.name)?"bg-rc-gray-600":"bg-transparent"}`),Re(qe,B(tt).name)}),re(Ge,Xe)}),re(Te,je)};Se(Ue,Te=>{i.steps.length===0?Te(Ie):Te(Je,!1)},!0)}re(Ae,Oe)};Se(se,Ae=>{i.wsLoaded?Ae(xe,!1):Ae(fe)})}oe(H),re(E,H)}});var ge=ye(ue,2),Ne=ae(ge),Pe=ae(Ne),De=ae(Pe),gt=ae(De,!0);oe(De),oe(Pe);var pt=ye(Pe,2),rt=ae(pt),it=ae(rt);Pt(it),Be(2),oe(rt);var ot=ye(rt,2);{let E=Fe(()=>!i.currentStep||B(Z));mt(ot,{variant:"secondary",get disabled(){return B(E)},onclick:ce,children:(W,H)=>{Be();var se=Ve("Find issues");re(W,se)},$$slots:{default:!0}})}oe(pt),oe(Ne);var ht=ye(Ne,2),ze=ae(ht);{var Ye=E=>{var W=Qe(),H=Ce(W);Gt(H,()=>i.currentStep.name,se=>{{let fe=Fe(()=>i.prompt??"");On(se,{class:"h-full min-w-0 border-thin border-rc-gray-650 bg-rc-gray-800 shadow-inner-white-soft backdrop-blur-3xl focus:outline-none focus:ring-0",get prompt(){return B(fe)},get agentId(){return i.agentId},onPromptChanged:r,get showSchemaButton(){return B(c)},onSchemaClick:t,showPreviewToggle:!1,get preview(){return B(U)},onEditorReady:ie})}}),re(E,W)},X=E=>{lt(E,{class:"flex h-full min-w-0 items-center justify-center !rounded-none p-4 text-sm text-rc-gray-400",children:(W,H)=>{Be();var se=Ve("Select a step to edit its prompt");re(W,se)}})};Se(ze,E=>{i.currentStep?E(Ye):E(X,!1)})}oe(ht),oe(ge);var ee=ye(ge,2);lt(ee,{class:"relative flex h-full min-w-0 flex-col overflow-hidden !rounded-none p-0",children:(E,W)=>{var H=mr(),se=Ce(H),fe=ae(se);bt(fe,{get value(){return i.edit.tab},ariaLabel:"Mode tabs",onChange:o,children:(Te,je)=>{var He=vr(),Ge=Ce(He);et(Ge,{value:"roleplay",children:(qe,nt)=>{Be();var vt=Ve("Roleplay");re(qe,vt)},$$slots:{default:!0}});var tt=ye(Ge,2);et(tt,{value:"tests",children:(qe,nt)=>{Be();var vt=Ve("Tests");re(qe,vt)},$$slots:{default:!0}});var Xe=ye(tt,2);{var dt=qe=>{et(qe,{value:"configure",children:(nt,vt)=>{Be();var Dt=Ve("Configure");re(nt,Dt)},$$slots:{default:!0}})};Se(Xe,qe=>{i.defaultRegion!==null&&qe(dt)})}re(Te,He)},$$slots:{default:!0}}),oe(se);var xe=ye(se,2),Ae=ae(xe);Wt(Ae,()=>R.children),oe(xe);var Oe=ye(xe,2);{var Ue=Te=>{{const je=Ge=>{$n(Ge,{})};let He=Fe(()=>g(i.edit.popover.kind));Ot(Te,{get title(){return B(He)},onClose:w,children:je})}};Se(Oe,Te=>{i.edit.popover&&Te(Ue)})}var Ie=ye(Oe,2);{var Je=Te=>{Ot(Te,{title:"Edit context",onClose:L,children:He=>{Gn(He,{})}})};Se(Ie,Te=>{i.contextPopoverOpen&&Te(Je)})}re(E,H)}}),oe(he),oe(ne),oe(_e),oe(pe);var ve=ye(pe,2);{var de=E=>{qt(E,{title:"Schema",class:"!w-[80vw] !max-w-5xl",get open(){return B(p)},set open(H){ke(p,H,!0)},children:H=>{gn(H,{class:"h-[70vh] min-w-0",get schema(){return B(h)},onChange:console.log})},$$slots:{default:!0}})};Se(ve,E=>{B(h)&&E(de)})}Me(()=>{var E;Re(gt,((E=i.currentStep)==null?void 0:E.name)??"Prompt"),it.disabled=!i.currentStep}),Jt(it,()=>B(U),E=>ke(U,E)),re(V,Y),ft()}wt(["click"]);export{$r as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{o as kt,b as Ct,s as b}from"../chunks/DQA6NP5y.js";import{B as Pt,p as At,e as u,g as Ge,f as S,j as Tt,l as U,d as s,s as l,t as E,h as t,b as d,c as Lt,i as o,a as pe,k as T,$ as Nt,n as L,r,o as Oe}from"../chunks/CfbYRn5k.js";import{i as G}from"../chunks/Dl6q6wVH.js";import{b as Qe,s as Re,e as Ve,i as We,I as Dt}from"../chunks/BCG4zvjp.js";import{s as Et}from"../chunks/C_ZSt1CI.js";import{p as jt}from"../chunks/wDFujNbC.js";import{g as N}from"../chunks/C5HWpeo9.js";import{p as $}from"../chunks/B3ux6SZZ.js";import{B as O}from"../chunks/wtOMB7ao.js";import{I as Mt}from"../chunks/BdZ7JhAm.js";import{T as Bt,p as He,m as Ft,g as zt}from"../chunks/W8E9z4jl.js";import{T as Ut,a as qe}from"../chunks/JA_7cQFn.js";import{A as Gt}from"../chunks/i_HX2z3K.js";import{g as Ot}from"../chunks/8B3OPwlB.js";async function Qt(v,f,g,p,x,Q){const w=v.target.value;o(f,w,!0),He(w),g.setSourceId(w),o(p,null),await N(t(x)),await Q()}function Rt(v,f,g){const p=v.target.value;o(f,p,!0),o(g,parseInt(t(f),10)||20,!0)}async function Vt(v,f,g,p,x){v==null||v.preventDefault(),v==null||v.stopPropagation(),o(f,""),o(g,[],!0),o(p,null),await x()}var Wt=S("<!> <!>",1),qt=S("<option> </option>"),Ht=S("<option> </option>"),Jt=S('<button type="button" aria-label="Clear search" class="absolute right-2 top-1/2 flex -translate-y-1/2 items-center justify-center rounded p-1 text-rc-gray-200 hover:bg-rc-gray-600 hover:text-rc-gray-100 focus:outline-none"><!></button>'),Kt=S('<p class="py-8 text-center text-rc-gray-200">Loading...</p>'),Xt=S('<p class="py-8 text-center text-rc-gray-300">No conversations found</p>'),Yt=(v,f,g)=>f(t(g),v),Zt=S('<li><div class="flex w-full flex-col gap-2"><div class="flex w-full items-center justify-between"><div class="text-gray-300"> </div> <div class="flex items-center gap-2"><span class="text-xs text-rc-gray-300"> </span> <span class="font-semibold text-rc-gray-100"> </span></div></div> <div class="flex items-center justify-between gap-4"><div class="text-sm"><span class="text-rc-gray-200">Conversation Id:</span> <span class="text-rc-green-200"> </span></div> <p class="text-sm text-gray-400"> </p></div></div></li>'),ea=S('<ul class="space-y-2"></ul>'),ta=v=>v.stopPropagation(),aa=S('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 pb-3 pr-4 pt-2"><nav class="flex flex-none flex-col bg-rc-gray-980"><div class="flex items-center justify-center"><!></div> <div class="flex flex-wrap items-center gap-4"><div class="flex-1"><label class="block"><div class="flex gap-2"><select class="select svelte-1uk1thp" aria-label="Telescope source"><!></select> <div class="relative"><!><!></div> <!></div></label></div> <div class="hidden items-center gap-2"><div class="text-rc-gray-200">Sort:</div> <!></div> <div class="hidden items-center gap-2"><div class="text-rc-gray-200">Page size:</div> <select class="rounded-sm border border-rc-gray-300 bg-rc-gray-700 p-2 pr-8 text-rc-gray-100"><option>5</option><option>10</option><option>20</option><option>50</option></select></div> <div class="flex items-center gap-3"><div class="flex items-center gap-2"><!> <!> <div class="text-sm text-rc-gray-200"> </div></div></div> <div class="ml-auto whitespace-nowrap text-sm"><span class="text-gray-400">API Mode:</span> <span class="font-semibold text-rc-green-200"> </span></div></div></nav> <main class="flex flex-1 overflow-hidden"><div class="flex h-full w-1/3 flex-col"><div class="flex-none border-b border-rc-gray-300/40 p-4"><h2 class="text-lg font-semibold text-rc-gray-100">Conversations</h2></div> <div class="rc-scroll min-h-0 flex-1 overflow-scroll px-3 py-4"><!></div></div> <div class="flex h-full w-2/3 flex-col bg-rc-gray-980"><!></div></main></div></div>');function ha(v,f){At(f,!0);const g=new Bt(fetch);let p=u(void 0),x=u(null),Q=u(""),w=u(""),R=u(20),V=u("20"),j=u(!0),I=u(Ge([])),C=u(null),M=u(!1),W=u(null),fe=u(0),k=u(Ge([])),D=u(""),B=u(!1),q=u(null),ge=jt(f,"useMock",3,!1);const{onError:Je}=Ot();function Ke(e){return new Date(e).toLocaleString()}function Xe(e){const a=Math.floor(e/60),n=e%60;return`${a}:${String(n).padStart(2,"0")}`}async function Ye(e,a=t(R),n){return ge()?Ft.fetchConversations(a,e,n??void 0):g.getConversations({phoneNumber:e,limit:Number(a),lastConversationId:n??void 0})}async function F(){o(I,[],!0),o(C,null),await H()}async function Ze(){o(B,!0),o(q,null);try{const e=await fetch("/traces/api/sources");if(!e.ok)throw new Error(`Failed to load sources (${e.status})`);const a=await e.json(),n=Array.isArray(a)?a:[];if(o(k,n.filter(i=>i&&typeof i.id=="string"&&typeof i.label=="string"),!0),!t(k).length)throw new Error("No sources returned");const c=zt(),m=c&&t(k).some(i=>i.id===c)?c:t(k)[0].id;o(D,m,!0),He(m),g.setSourceId(m)}catch(e){console.error("Failed to load Telescope sources:",e),o(q,(e==null?void 0:e.message)??"Failed to load Telescope sources",!0),o(k,[],!0),o(D,""),g.setSourceId(void 0)}finally{o(B,!1)}}async function H(){o(M,!0),o(W,null);try{const e=await Ye(t(w)||void 0,t(R),t(C)??void 0);let a=Array.isArray(e.items)?e.items.slice():[];a=a.filter(n=>!!(n!=null&&n.phoneNumber)),o(p,{limit:e.limit,items:a,lastConversationId:e.lastConversationId},!0),o(fe,a.length,!0),o(C,e.lastConversationId??null,!0),o(M,!1)}catch(e){o(M,!1),o(W,e.message||"Unknown error",!0),Je(`Error loading conversations: ${t(W)}`),console.error("Load page error:",e)}}async function et(){var e;(e=t(p))!=null&&e.lastConversationId&&(t(I).push(t(p).lastConversationId),o(C,t(p).lastConversationId,!0),await H())}async function tt(){t(I).length&&(t(I).pop(),o(C,t(I).length?t(I)[t(I).length-1]:null,!0),await H())}function at(){var e;o(j,!t(j)),(e=t(p))!=null&&e.items&&t(p).items.sort((a,n)=>t(j)?n.createdAt-a.createdAt:a.createdAt-n.createdAt)}async function rt(e,a){var c;if(a==null||a.stopPropagation(),$.params.conversationId&&$.params.conversationId===e.conversationId||!$.params.conversationId&&((c=t(x))==null?void 0:c.conversationId)===e.conversationId){o(x,null),await N(t(J));return}o(x,e,!0),await N(`${t(J)}/conversations/${e.conversationId}/traces`)}async function _e(){await F()}const me=U(()=>{const e=$.url.pathname.split("/")[1];return e==="traces"?"view":e}),J=U(()=>$.url.pathname.startsWith("/view")?"/view":"/traces");function st({value:e}){if(e!==t(me)){if(e==="edit")return N("/edit");if(e==="view")return N("/view");N("/"+e)}}kt(()=>{const e=new URLSearchParams(window.location.search);o(Q,e.get("agent")??"",!0),(async()=>(await Ze(),await F()))()});var K=aa();Tt(e=>{Nt.title="Bosun: Telescope"});var he=s(K);Gt(he,{agents:[],currentAgent:"",onSelect:()=>{},showAgents:!1,className:"flex-none"});var xe=l(he,2),X=s(xe),Y=s(X),ot=s(Y);Ut(ot,{get value(){return t(me)},ariaLabel:"Top tabs",onChange:st,children:(e,a)=>{var n=Wt(),c=pe(n);qe(c,{value:"edit",children:(i,_)=>{L();var h=T("Edit");d(i,h)},$$slots:{default:!0}});var m=l(c,2);qe(m,{value:"view",children:(i,_)=>{L();var h=T("View");d(i,h)},$$slots:{default:!0}}),d(e,n)},$$slots:{default:!0}}),r(Y);var ye=l(Y,2),Z=s(ye),be=s(Z),we=s(be),P=s(we);P.__change=[Qt,D,g,x,J,F];var nt=s(P);{var lt=e=>{var a=Oe(),n=pe(a);Ve(n,17,()=>t(k),We,(c,m)=>{var i=qt(),_=s(i,!0);r(i);var h={};E(()=>{b(_,t(m).label),h!==(h=t(m).id)&&(i.value=(i.__value=t(m).id)??"")}),d(c,i)}),d(e,a)},it=e=>{var a=Ht(),n=s(a,!0);r(a),a.value=a.__value="",E(()=>b(n,t(B)?"Loading…":"No sources")),d(e,a)};G(nt,e=>{t(k).length?e(lt):e(it,!1)})}r(P);var ee=l(P,2),Ie=s(ee);Mt(Ie,{class:"w-56 rounded-r-none !border !border-rc-gray-500 !p-2 !pr-8 hover:border-rc-gray-400",placeholder:"Search by phone...",onkeydown:e=>{e.key==="Enter"&&(e.preventDefault(),e.stopPropagation(),_e())},get value(){return t(w)},set value(e){o(w,e,!0)}});var ct=l(Ie);{var dt=e=>{var a=Jt();a.__click=[Vt,w,I,C,F];var n=s(a);Dt(n,{name:"close",width:18,height:18}),r(a),d(e,a)};G(ct,e=>{t(w)&&e(dt)})}r(ee);var vt=l(ee,2);O(vt,{onclick:_e,children:(e,a)=>{L();var n=T("Search");d(e,n)},$$slots:{default:!0}}),r(we),r(be),r(Z);var te=l(Z,2),ut=l(s(te),2);O(ut,{onclick:at,children:(e,a)=>{L();var n=T();E(()=>b(n,t(j)?"Newest first":"Oldest first")),d(e,n)},$$slots:{default:!0}}),r(te);var ae=l(te,2),z=l(s(ae),2);z.__change=[Rt,V,R];var re=s(z);re.value=re.__value="5";var se=l(re);se.value=se.__value="10";var oe=l(se);oe.value=oe.__value="20";var $e=l(oe);$e.value=$e.__value="50",r(z),r(ae);var ne=l(ae,2),Se=s(ne),ke=s(Se);{let e=U(()=>t(I).length===0&&!t(C));O(ke,{onclick:tt,get disabled(){return t(e)},children:(a,n)=>{L();var c=T("Prev");d(a,c)},$$slots:{default:!0}})}var Ce=l(ke,2);{let e=U(()=>{var a;return!((a=t(p))!=null&&a.items.length)});O(Ce,{onclick:et,get disabled(){return t(e)},children:(a,n)=>{L();var c=T("Next");d(a,c)},$$slots:{default:!0}})}var Pe=l(Ce,2),pt=s(Pe);r(Pe),r(Se),r(ne);var Ae=l(ne,2),Te=l(s(Ae),2),ft=s(Te,!0);r(Te),r(Ae),r(ye),r(X);var Le=l(X,2),le=s(Le),Ne=l(s(le),2),gt=s(Ne);{var _t=e=>{var a=Kt();d(e,a)},mt=e=>{var a=Oe(),n=pe(a);{var c=i=>{var _=Xt();d(i,_)},m=i=>{var _=ea();Ve(_,21,()=>t(p).items,We,(h,y)=>{var A=Zt();A.__click=[Yt,rt,y];var De=s(A),ce=s(De),de=s(ce),xt=s(de,!0);r(de);var Ee=l(de,2),ve=s(Ee),yt=s(ve,!0);r(ve);var je=l(ve,2),bt=s(je,!0);r(je),r(Ee),r(ce);var Me=l(ce,2),ue=s(Me),Be=l(s(ue),2),wt=s(Be,!0);r(Be),r(ue);var Fe=l(ue,2),It=s(Fe);r(Fe),r(Me),r(De),r(A),E(($t,St)=>{var ze,Ue;Et(A,1,`cursor-pointer rounded-lg p-3 transition-colors ${($.params.conversationId?t(y).conversationId===$.params.conversationId:t(y).conversationId===((ze=t(x))==null?void 0:ze.conversationId))?"bg-rc-gray-600":"bg-rc-gray-700 hover:bg-rc-gray-650"}`,"svelte-1uk1thp"),Re(A,"aria-selected",$.params.conversationId?t(y).conversationId===$.params.conversationId:t(y).conversationId===((Ue=t(x))==null?void 0:Ue.conversationId)),b(xt,$t),b(yt,t(y).medium),b(bt,t(y).phoneNumber),b(wt,t(y).conversationId),b(It,`Duration: ${St??""}`)},[()=>Ke(t(y).createdAt),()=>Xe(t(y).duration??0)]),d(h,A)}),r(_),d(i,_)};G(n,i=>{var _,h;(h=(_=t(p))==null?void 0:_.items)!=null&&h.length?i(m,!1):i(c)},!0)}d(e,a)};G(gt,e=>{t(M)?e(_t):e(mt,!1)})}r(Ne),r(le);var ie=l(le,2);ie.__click=[ta];var ht=s(ie);Ct(ht,()=>f.children),r(ie),r(Le),r(xe),r(K),E(()=>{P.disabled=t(B)||!t(k).length,Re(P,"title",t(q)??"Telescope source"),b(pt,`Items: ${t(fe)??""}`),b(ft,ge()?"Mock (local)":"Live")}),Qe(P,()=>t(D),e=>o(D,e)),Qe(z,()=>t(V),e=>o(V,e)),d(v,K),Lt()}Pt(["change","click"]);export{ha as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{s as w,o as N}from"../chunks/DQA6NP5y.js";import{B as F,p as _,u as S,f as m,s as b,b as d,c as A,d as o,r as l,t as j,h as c,e as q,g as B,j as H,$ as M,i as O}from"../chunks/CfbYRn5k.js";import{e as P,c as R,A as z}from"../chunks/i_HX2z3K.js";import{e as D,i as E,c as G,s as I}from"../chunks/BCG4zvjp.js";import{s as J}from"../chunks/C_ZSt1CI.js";import{g as K}from"../chunks/8B3OPwlB.js";import{t as L}from"../chunks/BEJ5fU19.js";var Q=(g,e,n)=>e.onAgentClick(c(n),g),T=m('<button><span class="agent-name svelte-16acuk9"> </span></button>'),U=m('<div class="agent-grid-container svelte-16acuk9"><div class="agent-grid svelte-16acuk9"><!> <button class="agent-card new-agent svelte-16acuk9" aria-label="Create new agent"><span class="agent-name agent-name_new svelte-16acuk9">New Agent</span></button></div></div>');function V(g,e){_(e,!0),S(()=>{P(e.agents)});const n=a=>a.split("/").at(-1)??a;var r=U(),i=o(r),v=o(i);D(v,17,()=>e.agents,E,(a,t)=>{var s=T();let f;s.__click=[Q,e,t];var p=o(s),k=o(p,!0);l(p),l(s),j((h,x,y,C)=>{f=J(s,1,"agent-card svelte-16acuk9",null,f,h),G(s,`--agent-color: ${x??""}`),I(s,"aria-label",y),w(k,C)},[()=>({active:c(t)===e.currentAgent}),()=>R(c(t)),()=>`Open ${n(c(t))}`,()=>n(c(t))]),d(a,s)});var u=b(v,2);u.__click=function(...a){var t;(t=e.onNewAgent)==null||t.apply(this,a)},l(i),l(r),d(g,r),A()}F(["click"]);var W=m('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 py-3 pr-4"><div class="flex-1"><!></div></div></div>');function ne(g,e){_(e,!0);const{onAgentSelect:n}=K();let r=q(B([]));N(async()=>{O(r,await L.agents.list.query(),!0)});var i=W();H(s=>{M.title="Recombine Agents Hub"});var v=o(i);z(v,{className:"flex-none border-r-thin border-r-rc-gray-600",get agents(){return c(r)},currentAgent:"",get onAgentClick(){return n},initiallyCollapsed:!1,hoverCollapse:!1});var u=b(v,2),a=o(u),t=o(a);V(t,{get agents(){return c(r)},currentAgent:"",get onAgentClick(){return n}}),l(a),l(u),l(i),d(g,i),A()}export{ne as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/CWj6FrbW.js";import{o as L}from"../chunks/
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{o as L}from"../chunks/DQA6NP5y.js";import{p as M,e as b,g as N,u as U,h as t,i as _,f as C,j as V,b as r,c as z,$ as D,d as i,s as y,a as G,k as A,l as H,n as l,r as c}from"../chunks/CfbYRn5k.js";import{g as d}from"../chunks/C5HWpeo9.js";import{g as I}from"../chunks/8B3OPwlB.js";import{t as J}from"../chunks/BEJ5fU19.js";import{A as K}from"../chunks/i_HX2z3K.js";import{T as O,a as T}from"../chunks/JA_7cQFn.js";import{p as w}from"../chunks/B3ux6SZZ.js";var Q=C("<!> <!>",1),R=C('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 pb-3 pr-4 pt-2"><nav class="flex flex-none items-center justify-center bg-rc-gray-980"><!></nav> <main class="flex-1 pr-80 pt-40"><div class="flex h-full items-start justify-center text-rc-gray-200">Select an agent on the left panel to start editing</div></main></div></div>');function ne(S,k){M(k,!0);const{onAgentSelect:f,onError:E}=I();let a=b(N([])),p=b(!1);const g=H(()=>w.url.pathname.split("/")[1]);function j({value:e}){if(e!==t(g)){if(e==="edit")return d("/edit");if(e==="view")return d("/view");d("/"+e)}}function P(e){f(e)}U(()=>{t(p)||w.url.pathname==="/edit"&&t(a).length&&(_(p,!0),f(t(a)[0]))}),L(async()=>{try{_(a,await J.agents.list.query(),!0)}catch(e){const h=e instanceof Error?e.message:e?String(e):"Unknown error";console.error("Failed to load agents:",e),E(`Failed to load agents: ${h}`)}});var s=R();V(e=>{D.title="Bosun: Edit"});var u=i(s);K(u,{className:"flex-none",get agents(){return t(a)},currentAgent:"",onAgentClick:P});var m=y(u,2),v=i(m),F=i(v);O(F,{get value(){return t(g)},ariaLabel:"Top tabs",onChange:j,children:(e,h)=>{var $=Q(),x=G($);T(x,{value:"edit",children:(n,B)=>{l();var o=A("Edit");r(n,o)},$$slots:{default:!0}});var q=y(x,2);T(q,{value:"view",children:(n,B)=>{l();var o=A("View");r(n,o)},$$slots:{default:!0}}),r(e,$)},$$slots:{default:!0}}),c(v),l(2),c(m),c(s),r(S,s),z()}export{ne as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a}from"../chunks/hp4PFHFv.js";function i({url:t,params:n}){const o=t.searchParams.get("step"),r=t.searchParams.get("region"),s=`/edit/${encodeURIComponent(n.agent)}/roleplay`,e=new URLSearchParams;o&&e.set("step",o),r&&e.set("region",r),a(307,e.size?`${s}?${e.toString()}`:s)}const g=Object.freeze(Object.defineProperty({__proto__:null,load:i},Symbol.toStringTag,{value:"Module"}));export{g as universal};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DLQqXQ6R.js","../chunks/C1FmrZbK.js","../assets/editor.BMIWPGx3.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as ie}from"../chunks/C1FmrZbK.js";import"../chunks/CWj6FrbW.js";import{o as le,a as ne,s as D}from"../chunks/DQA6NP5y.js";import{p as ce,u as ve,h as e,e as v,c as de,i as a,f as d,a as H,s as P,d as g,r as _,b as i,o as ue,t as I}from"../chunks/CfbYRn5k.js";import{i as h}from"../chunks/Dl6q6wVH.js";import{b as fe}from"../chunks/Bx2X1niE.js";import{g as me,P as pe}from"../chunks/BA8mqPb-.js";import{e as ge,a as _e}from"../chunks/CxPv-oiS.js";import{t as W}from"../chunks/BEJ5fU19.js";var he=d("<span>Saving…</span>"),xe=d("<span>Saved</span>"),ye=d('<div class="text-rc-gray-400">Loading…</div>'),be=d('<div class="text-rc-red-500"> </div>'),Ce=d('<div class="text-rc-red-500 mb-2 text-xs"> </div>'),Ee=d('<div class="text-rc-red-500 mb-2 text-xs"> </div>'),Se=d('<!> <!> <div class="min-h-0 flex-1"></div>',1),ke=d('<div class="flex flex-none items-center justify-between gap-3 pb-2"><div class="min-w-0"><div class="truncate font-semibold text-rc-gray-100">Region config</div> <div class="truncate text-xs text-rc-gray-400">Edits `region-config.json` in the project</div></div> <div class="flex items-center gap-3 text-xs text-rc-gray-400"><!></div></div> <!>',1);function De(z,F){ce(F,!0);const{actions:R}=me();let s=v(null),w,A=null,j=[],T=null,B=!1,x=v(""),M=v(""),N=v(!0),y=v(null),b=v(null),C=v(!1),p=v(null),E=null;const q=800;function O(){E&&(clearTimeout(E),E=null)}function Q(t){O(),E=setTimeout(()=>{U(t)},q)}async function U(t){if(!e(C)&&t!==e(M)){try{JSON.parse(t)}catch{return}a(C,!0),a(p,null);try{await W.regionConfig.save.mutate({text:t}),a(M,t,!0),R.sendAppEvent({type:"reload-project"})}catch(l){console.error(l),a(p,"Failed to save region config")}finally{a(C,!1)}}}le(async()=>{try{ge();const t=await ie(()=>import("../chunks/DLQqXQ6R.js").then(n=>n.e),__vite__mapDeps([0,1,2]),import.meta.url);if(B)return;T=t,_e(t),a(N,!0),a(y,null);const l=await W.regionConfig.get.query();if(B)return;a(x,l,!0),a(M,l,!0),a(s,t.editor.create(w,{value:l,language:"json",theme:"bosun-dark",automaticLayout:!0,lineNumbers:"on",minimap:{enabled:!1},wordWrap:"on",matchBrackets:"never",bracketPairColorization:{enabled:!1},guides:{highlightActiveBracketPair:!1,bracketPairs:!1,bracketPairsHorizontal:!1},occurrencesHighlight:"off",selectionHighlight:!1,unicodeHighlight:{ambiguousCharacters:!1,nonBasicASCII:!1,invisibleCharacters:!1,includeStrings:!1,includeComments:!1},autoClosingQuotes:"never",padding:{top:12}}),!0),A=e(s).getModel(),j.push(e(s).onDidChangeModelContent(()=>{if(!e(s))return;const n=e(s).getValue();a(x,n,!0),a(p,null);try{JSON.parse(n),a(b,null),Q(n)}catch{O(),a(b,"Invalid JSON")}}))}catch(t){console.error(t),a(y,"Failed to load region config")}finally{a(N,!1)}}),ne(()=>{B=!0,O();for(const l of j)try{l.dispose()}catch{}j=[];const t=A;A=null;try{if(e(s)){try{e(s).setModel(null)}catch{}e(s).dispose()}}finally{a(s,null)}try{t==null||t.dispose()}catch{}T=null}),ve(()=>{e(s)&&e(x)!==e(s).getValue()&&e(s).setValue(e(x))}),pe(z,{class:"flex h-full min-h-0 flex-col !rounded-none p-2",children:(t,l)=>{var n=ke(),S=H(n),J=P(g(S),2),G=g(J);{var K=r=>{var c=he();i(r,c)},X=r=>{var c=xe();i(r,c)};h(G,r=>{e(C)?r(K):r(X,!1)})}_(J),_(S);var Y=P(S,2);{var Z=r=>{var c=ye();i(r,c)},$=r=>{var c=ue(),ee=H(c);{var te=f=>{var m=be(),k=g(m,!0);_(m),I(()=>D(k,e(y))),i(f,m)},ae=f=>{var m=Se(),k=H(m);{var re=o=>{var u=Ce(),V=g(u,!0);_(u),I(()=>D(V,e(b))),i(o,u)};h(k,o=>{e(b)&&o(re)})}var L=P(k,2);{var se=o=>{var u=Ee(),V=g(u,!0);_(u),I(()=>D(V,e(p))),i(o,u)};h(L,o=>{e(p)&&o(se)})}var oe=P(L,2);fe(oe,o=>w=o,()=>w),i(f,m)};h(ee,f=>{e(y)?f(te):f(ae,!1)},!0)}i(r,c)};h(Y,r=>{e(N)?r(Z):r($,!1)})}i(t,n)}}),de()}export{De as component};
|
|
Binary file
|
|
Binary file
|