@recombine-ai/platform 0.8.0-test.2 → 0.8.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/agent/experiment.d.ts +21 -0
- package/build/agent/experiment.d.ts.map +1 -0
- package/build/agent/experiment.js +29 -0
- package/build/agent/index.d.ts +2 -0
- package/build/agent/index.d.ts.map +1 -1
- package/build/agent/index.js +1 -0
- package/build/bosun/index.d.ts +1 -0
- package/build/bosun/index.d.ts.map +1 -1
- package/build/bosun/interfaces/agent.d.ts +1 -0
- package/build/bosun/interfaces/agent.d.ts.map +1 -1
- package/build/bosun/interfaces/project.d.ts +25 -0
- package/build/bosun/interfaces/project.d.ts.map +1 -0
- package/build/bosun/interfaces/project.js +1 -0
- package/build/bosun-app/backend/server.js +252 -60
- package/build/bosun-app/backend/server.js.map +2 -2
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{CR5IRTqC.js → AmpxVxY6.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/AmpxVxY6.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/AmpxVxY6.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{DjDpMqch.js → B-5g3xS8.js} +20 -20
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B-5g3xS8.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B-5g3xS8.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{BBk8_Xpk.js → B1MxGo6p.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B1MxGo6p.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B1MxGo6p.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{joiJcRPz.js → BqH4VDQz.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BqH4VDQz.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BqH4VDQz.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{B3N9vN4_.js → CQvDMTjY.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CQvDMTjY.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CQvDMTjY.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{C0rPkxmP.js → CVZT6n14.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CVZT6n14.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CVZT6n14.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{D89azUgT.js → CWPN78Jk.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CWPN78Jk.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CWPN78Jk.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{ouMvMh56.js → CkstLsmI.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CkstLsmI.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CkstLsmI.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{C3cROXCy.js → CuwQtXBl.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CuwQtXBl.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CuwQtXBl.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{BEdAvgYp.js → D9YsE4-8.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D9YsE4-8.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D9YsE4-8.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{Diqx_kju.js → DK7_9Rr4.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DK7_9Rr4.js.br +3 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DK7_9Rr4.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{Bwiy-Sk7.js → O3fJLrRA.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/O3fJLrRA.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/O3fJLrRA.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/{DJnDF3d9.js → dL_jwANm.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/dL_jwANm.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/dL_jwANm.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/w7_NKWP1.js +3 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/w7_NKWP1.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/w7_NKWP1.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/{app.DYrvpbQq.js → app.Bq7QRKSZ.js} +2 -2
- package/build/bosun-app/frontend/client/_app/immutable/entry/app.Bq7QRKSZ.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/app.Bq7QRKSZ.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/start.Ct26YHfm.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/start.Ct26YHfm.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/start.Ct26YHfm.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/{0.DXIuJQso.js → 0.CIBqOQKB.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/nodes/0.CIBqOQKB.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/0.CIBqOQKB.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/{1.CsX5iplT.js → 1.Dv78wD0F.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/nodes/1.Dv78wD0F.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/1.Dv78wD0F.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/10.Htrpia-u.js +35 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/10.Htrpia-u.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/10.Htrpia-u.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/{17.BIO8m3DR.js → 17.DmVfus5a.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/nodes/17.DmVfus5a.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/17.DmVfus5a.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/18.DvJVYeXp.js +11 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/18.DvJVYeXp.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/18.DvJVYeXp.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/2.tyuQRxDb.js +35 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/2.tyuQRxDb.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/2.tyuQRxDb.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/3.B0NtJamE.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/3.B0NtJamE.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/3.B0NtJamE.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/{4.BzhaMuo5.js → 4.DKTRRObl.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/nodes/4.DKTRRObl.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/4.DKTRRObl.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/{5.BG8ylHWg.js → 5.D9SClLPX.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/nodes/5.D9SClLPX.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/5.D9SClLPX.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/{6.DkDEANSN.js → 6.DdAs7BvU.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/nodes/6.DdAs7BvU.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/6.DdAs7BvU.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/{8.3fEbISY6.js → 8.DNEyJy0a.js} +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/nodes/8.DNEyJy0a.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/8.DNEyJy0a.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/9.DcyIUk-F.js +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/9.DcyIUk-F.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/9.DcyIUk-F.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/version.json +1 -1
- package/build/bosun-app/frontend/client/_app/version.json.br +0 -0
- package/build/bosun-app/frontend/client/_app/version.json.gz +0 -0
- package/build/bosun-app/frontend/handler.js +4 -4
- package/build/bosun-app/frontend/index.js +4 -4
- package/build/bosun-app/frontend/server/chunks/chunks/{ChatStepTrace.js-VTtwaKGp.js → ChatStepTrace.js-BY0y3Vbb.js} +3 -1
- package/build/bosun-app/frontend/server/chunks/chunks/ChatStepTrace.js-BY0y3Vbb.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/{internal.js-B7oaNMJQ.js → internal.js-CTNBeiir.js} +2 -2
- package/build/bosun-app/frontend/server/chunks/chunks/{internal.js-B7oaNMJQ.js.map → internal.js-CTNBeiir.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/chunks/{source-selection.js-D5B8gfq2.js → source-selection.js-DFpObbhz.js} +3 -1
- package/build/bosun-app/frontend/server/chunks/chunks/source-selection.js-DFpObbhz.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/{_layout.svelte.js-B2wHKJV7.js → _layout.svelte.js-b9Q5TFEZ.js} +134 -24
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/_layout.svelte.js-b9Q5TFEZ.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/roleplay/{_page.svelte.js-DDcIjgZD.js → _page.svelte.js-Chv8ybaj.js} +10 -4
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/roleplay/_page.svelte.js-Chv8ybaj.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/tests/{_page.svelte.js-UVUg89-t.js → _page.svelte.js-Dkst1C_3.js} +3 -1
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/tests/_page.svelte.js-Dkst1C_3.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/latency/{_page.svelte.js-SjAtxtA0.js → _page.svelte.js-DFZznMhQ.js} +2 -2
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/latency/{_page.svelte.js-SjAtxtA0.js.map → _page.svelte.js-DFZznMhQ.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/traces/{_page.svelte.js-DiZKDT2v.js → _page.svelte.js-Bxdn8vG5.js} +7 -3
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/traces/_page.svelte.js-Bxdn8vG5.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/{_layout.svelte.js-CfkCQ2Th.js → _layout.svelte.js-DhdYiNVL.js} +61 -9
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_layout.svelte.js-DhdYiNVL.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/{handler-D9QLNo8w.js → handler-kZm9DU-v.js} +3 -3
- package/build/bosun-app/frontend/server/chunks/{handler-D9QLNo8w.js.map → handler-kZm9DU-v.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/{index.js-B0gyG8Jr.js → index.js-BYV_PeV-.js} +2 -2
- package/build/bosun-app/frontend/server/chunks/{index.js-B0gyG8Jr.js.map → index.js-BYV_PeV-.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/{manifest.js-BJwjpIJ3.js → manifest.js-DknJwtFc.js} +14 -14
- package/build/bosun-app/frontend/server/chunks/{manifest.js-BJwjpIJ3.js.map → manifest.js-DknJwtFc.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{0.js-CzIAnGix.js → 0.js-B947oA7Q.js} +2 -2
- package/build/bosun-app/frontend/server/chunks/nodes/{0.js-CzIAnGix.js.map → 0.js-B947oA7Q.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{1.js-dcMNeOrp.js → 1.js-D-bO8SBw.js} +2 -2
- package/build/bosun-app/frontend/server/chunks/nodes/{1.js-dcMNeOrp.js.map → 1.js-D-bO8SBw.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{10.js-BJiZIzMv.js → 10.js-BPINRsAS.js} +3 -3
- package/build/bosun-app/frontend/server/chunks/nodes/{10.js-BJiZIzMv.js.map → 10.js-BPINRsAS.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{17.js-D2Tp888g.js → 17.js-BvBqWcLx.js} +3 -3
- package/build/bosun-app/frontend/server/chunks/nodes/{17.js-D2Tp888g.js.map → 17.js-BvBqWcLx.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{18.js-u_njdfH1.js → 18.js-BEfVGplP.js} +3 -3
- package/build/bosun-app/frontend/server/chunks/nodes/{18.js-u_njdfH1.js.map → 18.js-BEfVGplP.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{2.js-CmkWii-m.js → 2.js-XaMsKwVG.js} +3 -3
- package/build/bosun-app/frontend/server/chunks/nodes/{2.js-CmkWii-m.js.map → 2.js-XaMsKwVG.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{3.js-CEcqDZwI.js → 3.js-9Rmo9ovG.js} +3 -3
- package/build/bosun-app/frontend/server/chunks/nodes/{3.js-CEcqDZwI.js.map → 3.js-9Rmo9ovG.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{4.js-DoWmHMTv.js → 4.js-DHzNp2kw.js} +2 -2
- package/build/bosun-app/frontend/server/chunks/nodes/{4.js-DoWmHMTv.js.map → 4.js-DHzNp2kw.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{5.js-hFh1mvzS.js → 5.js-BtTetd8U.js} +2 -2
- package/build/bosun-app/frontend/server/chunks/nodes/{5.js-hFh1mvzS.js.map → 5.js-BtTetd8U.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{6.js-C9qNqJg2.js → 6.js-dyYItn4O.js} +2 -2
- package/build/bosun-app/frontend/server/chunks/nodes/{6.js-C9qNqJg2.js.map → 6.js-dyYItn4O.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{8.js-Btfm0qj5.js → 8.js-D5qfNA9r.js} +2 -2
- package/build/bosun-app/frontend/server/chunks/nodes/{8.js-Btfm0qj5.js.map → 8.js-D5qfNA9r.js.map} +1 -1
- package/build/bosun-app/frontend/server/chunks/nodes/{9.js-Ca7GzK3u.js → 9.js-CxI4tPnx.js} +3 -3
- package/build/bosun-app/frontend/server/chunks/nodes/{9.js-Ca7GzK3u.js.map → 9.js-CxI4tPnx.js.map} +1 -1
- package/build/call-control/call-control.d.ts.map +1 -1
- package/build/call-control/call-control.js +0 -2
- package/build/call-control/index.d.ts +0 -1
- package/build/call-control/index.d.ts.map +1 -1
- package/build/call-control/index.js +0 -1
- package/build/call-control/schemas.generated.d.ts +2 -1
- package/build/call-control/schemas.generated.d.ts.map +1 -1
- package/build/call-control/schemas.generated.js +4 -4
- package/build/call-control/types.d.ts +156 -3
- package/build/call-control/types.d.ts.map +1 -1
- package/build/call-control/types.js +3 -3
- package/build/engine/interfaces/other.d.ts +1 -1
- package/build/engine/interfaces/other.d.ts.map +1 -1
- package/build/telescope/api.d.ts.map +1 -1
- package/build/telescope/api.js +8 -2
- package/build/telescope/index.d.ts +1 -1
- package/build/telescope/index.d.ts.map +1 -1
- package/build/telescope/interfaces/conversation.d.ts +8 -0
- package/build/telescope/interfaces/conversation.d.ts.map +1 -1
- package/build/telescope/interfaces/event-tracer.d.ts +8 -0
- package/build/telescope/interfaces/event-tracer.d.ts.map +1 -1
- package/build/telescope/interfaces/storage.d.ts +2 -2
- package/build/telescope/interfaces/storage.d.ts.map +1 -1
- package/build/telescope/interfaces/telescope.d.ts +1 -0
- package/build/telescope/interfaces/telescope.d.ts.map +1 -1
- package/build/telescope/stub-storage.d.ts +2 -2
- package/build/telescope/stub-storage.d.ts.map +1 -1
- package/build/telescope/stub-storage.js +3 -8
- package/build/telescope/tracers/event-tracer.d.ts.map +1 -1
- package/build/telescope/tracers/event-tracer.js +5 -0
- package/build/text-agent-handlers/incoming-message.js +1 -1
- package/build/text-agent-handlers/index.d.ts +1 -0
- package/build/text-agent-handlers/index.d.ts.map +1 -1
- package/build/text-agent-handlers/index.js +1 -0
- package/build/text-agent-handlers/instrument.d.ts +1 -0
- package/build/text-agent-handlers/instrument.d.ts.map +1 -1
- package/build/text-agent-handlers/instrument.js +6 -2
- package/build/text-agent-handlers/jobs-handler.js +1 -1
- package/build/text-agent-handlers/jobs.d.ts +1 -0
- package/build/text-agent-handlers/jobs.d.ts.map +1 -1
- package/build/text-agent-handlers/message-acceptor.d.ts +4 -0
- package/build/text-agent-handlers/message-acceptor.d.ts.map +1 -1
- package/build/text-agent-handlers/message-acceptor.js +8 -2
- package/build/text-agent-handlers/ports.d.ts +2 -1
- package/build/text-agent-handlers/ports.d.ts.map +1 -1
- package/build/text-agent-handlers/ports.js +6 -5
- package/build/text-agent-handlers/variant-scheduler.d.ts +3 -0
- package/build/text-agent-handlers/variant-scheduler.d.ts.map +1 -0
- package/build/text-agent-handlers/variant-scheduler.js +9 -0
- package/build/voice-agent-api/index.d.ts +2 -0
- package/build/voice-agent-api/index.d.ts.map +1 -1
- package/build/voice-agent-api/index.js +1 -0
- package/build/voice-agent-api/route-resolver.d.ts +19 -0
- package/build/voice-agent-api/route-resolver.d.ts.map +1 -0
- package/build/voice-agent-api/route-resolver.js +57 -0
- package/build/voice-agent-api/voice-http.d.ts +8 -4
- package/build/voice-agent-api/voice-http.d.ts.map +1 -1
- package/build/voice-agent-api/voice-http.js +31 -32
- package/package.json +1 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B3N9vN4_.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B3N9vN4_.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BBk8_Xpk.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BBk8_Xpk.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BEdAvgYp.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BEdAvgYp.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BaP19BGR.js +0 -3
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BaP19BGR.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BaP19BGR.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bwiy-Sk7.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bwiy-Sk7.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C0rPkxmP.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C0rPkxmP.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C3cROXCy.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C3cROXCy.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CR5IRTqC.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CR5IRTqC.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D89azUgT.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D89azUgT.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DJnDF3d9.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DJnDF3d9.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Diqx_kju.js.br +0 -1
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Diqx_kju.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DjDpMqch.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DjDpMqch.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/joiJcRPz.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/joiJcRPz.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ouMvMh56.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ouMvMh56.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/app.DYrvpbQq.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/app.DYrvpbQq.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/start.ZRGJFDNa.js +0 -1
- package/build/bosun-app/frontend/client/_app/immutable/entry/start.ZRGJFDNa.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/start.ZRGJFDNa.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/0.DXIuJQso.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/0.DXIuJQso.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/1.CsX5iplT.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/1.CsX5iplT.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/10.D6gFo5CY.js +0 -35
- package/build/bosun-app/frontend/client/_app/immutable/nodes/10.D6gFo5CY.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/10.D6gFo5CY.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/17.BIO8m3DR.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/17.BIO8m3DR.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/18.D4L67K6t.js +0 -11
- package/build/bosun-app/frontend/client/_app/immutable/nodes/18.D4L67K6t.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/18.D4L67K6t.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/2.6RK8LtTD.js +0 -35
- package/build/bosun-app/frontend/client/_app/immutable/nodes/2.6RK8LtTD.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/2.6RK8LtTD.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/3.CbcbRLFb.js +0 -1
- package/build/bosun-app/frontend/client/_app/immutable/nodes/3.CbcbRLFb.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/3.CbcbRLFb.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/4.BzhaMuo5.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/4.BzhaMuo5.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/5.BG8ylHWg.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/5.BG8ylHWg.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/6.DkDEANSN.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/6.DkDEANSN.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/8.3fEbISY6.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/8.3fEbISY6.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/9.CoX3jzbC.js +0 -2
- package/build/bosun-app/frontend/client/_app/immutable/nodes/9.CoX3jzbC.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/9.CoX3jzbC.js.gz +0 -0
- package/build/bosun-app/frontend/server/chunks/chunks/ChatStepTrace.js-VTtwaKGp.js.map +0 -1
- package/build/bosun-app/frontend/server/chunks/chunks/source-selection.js-D5B8gfq2.js.map +0 -1
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/_layout.svelte.js-B2wHKJV7.js.map +0 -1
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/roleplay/_page.svelte.js-DDcIjgZD.js.map +0 -1
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/tests/_page.svelte.js-UVUg89-t.js.map +0 -1
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/traces/_page.svelte.js-DiZKDT2v.js.map +0 -1
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_layout.svelte.js-CfkCQ2Th.js.map +0 -1
- package/build/call-control/voice-agent-config.d.ts +0 -155
- package/build/call-control/voice-agent-config.d.ts.map +0 -1
- package/build/call-control/voice-agent-config.js +0 -53
|
@@ -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 yr=Object.defineProperty;var _r=(N,T,l)=>T in N?yr(N,T,{enumerable:!0,configurable:!0,writable:!0,value:l}):N[T]=l;var je=(N,T,l)=>_r(N,typeof T!="symbol"?T+"":T,l);import{a as J,f as me,d as Zt,b as Ft,t as $e,c as Rt}from"../chunks/CCYriF4C.js";import{o as en,a as Dn}from"../chunks/DnMQeiTY.js";import{p as bt,j as v,a as Et,n as _e,br as xr,y as re,d as Je,c as ie,r as ne,w as Re,s as pe,o as De,t as Ke,f as Ue,a4 as wr,bh as br,_ as Er,x as wn,T as bn}from"../chunks/CR-uVjxM.js";import{s as Ie}from"../chunks/B0nqNj93.js";import{i as Me}from"../chunks/BQIf5msi.js";import{M as Gt,k as kr,R as Sr}from"../chunks/CuwQtXBl.js";import{e as _t,i as It}from"../chunks/DuQdgMax.js";import{s as Or}from"../chunks/9mOMnnWN.js";import{a as Lr,r as jn,f as Tr,c as Ar}from"../chunks/AmpxVxY6.js";import{s as Cr}from"../chunks/C9yBjdYI.js";import{b as Pr,a as Nr}from"../chunks/B9pMb6OP.js";import{P as Lt,g as $n,s as Rr}from"../chunks/CHCMKZAC.js";import{B as Ye}from"../chunks/BqH4VDQz.js";import{d as En,e as Ir,f as Fr,g as Mr,D as kn}from"../chunks/CkstLsmI.js";import{I as Sn}from"../chunks/B1MxGo6p.js";import{T as Jt,a as yt}from"../chunks/D9YsE4-8.js";import{b as tn}from"../chunks/ClLUwVGq.js";import{p as ct,r as Br}from"../chunks/BcbX6huO.js";import{p as Qt,l as Kr,C as Dr,P as On}from"../chunks/BW6P0Ecp.js";import{r as jr,g as Ot}from"../chunks/CQvDMTjY.js";import{p as Qe}from"../chunks/DK7_9Rr4.js";import{e as Yt,t as rt}from"../chunks/CWPN78Jk.js";import{i as $r}from"../chunks/DgGeUDDh.js";import{_ as Vn}from"../chunks/C1FmrZbK.js";import{e as Un,a as Wn,c as Vr}from"../chunks/BU7aeYn4.js";import{A as Ur}from"../chunks/CVZT6n14.js";import{g as Wr}from"../chunks/Dba0_Upf.js";import"../chunks/DXsF11_5.js";import{i as Hr}from"../chunks/Bp8N7Z1t.js";import{c as Ln,a as qr}from"../chunks/B1dhmiqQ.js";var zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gr(N){return N&&N.__esModule&&Object.prototype.hasOwnProperty.call(N,"default")?N.default:N}var Qr=new Set(["$$slots","$$events","$$legacy","class","value","variant","el"]),Yr=me("<textarea></textarea>");function Jr(N,T){bt(T,!0);let l=ct(T,"class",3,""),S=ct(T,"value",15,""),w=ct(T,"variant",3,"config"),h=ct(T,"el",15),E=Br(T,Qr),f=_e(()=>w()==="chat"?`textarea-chat ${l()}`:`textarea-config ${l()}`);var e=Yr();xr(e),Lr(e,()=>({class:v(f),...E}),void 0,void 0,void 0,"svelte-1ilrf3m"),tn(e,_=>h(_),()=>h()),Pr(e,S),J(N,e),Et()}class Xr{constructor(T){je(this,"ws",null);je(this,"openHandler",null);je(this,"closeHandler",null);je(this,"errorHandler",null);je(this,"messageHandler",null);je(this,"retries",0);je(this,"maxRetries",5);je(this,"retryDelay",500);je(this,"retryTimeout",null);je(this,"isOpen",!1);je(this,"isDestroyed",!1);je(this,"agentsLoaded",!1);je(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=T=>{var S,w,h,E,f,e,_,L;const l=JSON.parse(T.data);l.channel==="error"?(S=this.errorHandler)==null||S.call(this,l.message):l.channel==="app-events"?(console.log("MSG:",l.event.type),l.event.type==="agents-loaded"&&(this.agentsLoaded=!0)):l.channel==="log"?console.log(`MSG: log [${l.message.severity}]`,l.message.message):l.channel==="api-call-trace"?console.log("MSG: api-call-trace",(w=l.trace)==null?void 0:w.operationName,(h=l.trace)==null?void 0:h.method,(E=l.trace)==null?void 0:E.path):l.channel==="conversational-trace"&&console.log("MSG: conversational-trace",(f=l.trace)==null?void 0:f.eventName,(e=l.trace)==null?void 0:e.role,(_=l.trace)==null?void 0:_.medium),(L=this.messageHandler)==null||L.call(this,l)},this.ws.onerror=T=>{var l;console.error("Websocket error:",T),(l=this.ws)==null||l.close(),this.retryConnect()},this.ws.onclose=()=>{console.log("Websocket closed"),this.isOpen=!1,this.retryConnect()},this.ws.onopen=()=>{var T;this.retries=0,this.isOpen=!0,this.retryTimeout&&clearTimeout(this.retryTimeout),(T=this.openHandler)==null||T.call(this),console.log("Websocket connected")}}});je(this,"destroy",()=>{var T;this.isDestroyed=!0,(T=this.ws)==null||T.close()});je(this,"onOpen",T=>{this.openHandler=T,this.isOpen&&T()});je(this,"onClose",T=>{this.closeHandler=T,this.isOpen||T()});je(this,"onError",T=>{this.errorHandler=T});je(this,"onMessage",T=>{this.messageHandler=T});je(this,"sendMessage",T=>{var l;T.channel,(l=this.ws)==null||l.send(JSON.stringify(T))});je(this,"isReady",()=>this.isOpen&&this.agentsLoaded);je(this,"retryConnect",()=>{var T,l;this.isDestroyed||(!this.isOpen&&this.retries<this.maxRetries?(this.retries++,this.init(),this.retryTimeout=setTimeout(this.retryConnect,this.retryDelay)):((T=this.errorHandler)==null||T.call(this,"WebSocket Error, please reload the browser"),(l=this.closeHandler)==null||l.call(this)))});this.wsUrl=T}}const Zr=Yt.PUBLIC_WS_HOST??`ws://${Yt.PUBLIC_WS_HOSTNAME??"localhost"}:${Yt.PUBLIC_WS_PORT??"8080"}`,gt=new Xr(Zr);var ei=me('<div class="flex h-full flex-col"><div class="h-full w-full"></div></div>');function ti(N,T){bt(T,!0);let l=Re(null),S=null,w=[],h=!1,E;en(async()=>{if(!E)return;Un();const f=await Vn(()=>import("../chunks/DLQqXQ6R.js").then(e=>e.e),__vite__mapDeps([0,1,2]),import.meta.url);h||(Wn(f),re(l,f.editor.create(E,{value:T.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),S=v(l).getModel(),w.push(v(l).onDidChangeModelContent(()=>{if(!v(l))return;const e=v(l).getValue();e!==T.schema&&T.onChange(e)})))}),Dn(()=>{h=!0;for(const e of w)try{e.dispose()}catch{}w=[];const f=S;S=null;try{if(v(l)){try{v(l).setModel(null)}catch{}v(l).dispose()}}finally{re(l,null)}try{f==null||f.dispose()}catch{}}),Je(()=>{if(!v(l))return;const f=T.schema??"";v(l).getValue()!==f&&v(l).setValue(f)}),Lt(N,{get class(){return`overflow-hidden ${T.class??""}`},children:(f,e)=>{var _=ei(),L=ie(_);tn(L,U=>E=U,()=>E),ne(_),J(f,_)}}),Et()}function ni(N,T){return N.languages.registerCompletionItemProvider("markdown",{triggerCharacters:[" ","."],provideCompletionItems:(l,S)=>{const w=l.getValueInRange({startLineNumber:S.lineNumber,startColumn:1,endLineNumber:S.lineNumber,endColumn:S.column}),h=w.match(/\{%\s*(if|elif|for)\s+([^%]*)$/),E=w.match(/\{\{\s*([^}]*)$/);if(h||E){let e="";h?e=h[2].trim():E&&(e=E[1].trim());const{keys:_,lastPartLength:L}=ri(T,e);return{suggestions:_.map(V=>({label:V,kind:N.languages.CompletionItemKind.Variable,insertText:V,range:{startLineNumber:S.lineNumber,endLineNumber:S.lineNumber,startColumn:S.column-L,endColumn:S.column}}))}}const f=w.match(/\{%\s*([^%]*)$/);if(f){const e=f[1].trim();return{suggestions:Xt(["if","elif","else","endif","for","endfor"],e).map((L,U)=>({label:L,kind:N.languages.CompletionItemKind.Keyword,insertText:L,sortText:String(U).padStart(2,"0"),range:{startLineNumber:S.lineNumber,endLineNumber:S.lineNumber,startColumn:S.column-e.length,endColumn:S.column}}))}}return{suggestions:[]}}})}function ri(N,T){let l=N,S=[],w=0;if(T==="")S=Object.keys(N??{}),w=0;else if(T.includes(".")){const h=T.split("."),E=h.pop()||"";w=E.length;for(const f of h)if(l&&typeof l=="object"&&f in l)l=l[f];else{l=null;break}l&&typeof l=="object"&&(S=Xt(Object.keys(l),E))}else w=T.length,S=Xt(Object.keys(N??{}),T);return{keys:S,lastPartLength:w}}function Xt(N,T){return T?N.map((l,S)=>({value:l,index:S,match:ii(l,T)})).filter(l=>l.match!==null).sort((l,S)=>l.match.kindRank!==S.match.kindRank?l.match.kindRank-S.match.kindRank:l.match.span!==S.match.span?l.match.span-S.match.span:l.match.gapCount!==S.match.gapCount?l.match.gapCount-S.match.gapCount:l.match.start!==S.match.start?l.match.start-S.match.start:l.index-S.index).map(l=>l.value):N}function ii(N,T){const l=N.toLowerCase(),S=T.toLowerCase();if(!S)return null;if(l.startsWith(S))return{kindRank:0,start:0,span:S.length,gapCount:0};const w=l.indexOf(S);if(w!==-1)return{kindRank:li(N,w,S.length),start:w,span:S.length,gapCount:0};const h=oi(l,S);return h?{kindRank:4,start:h.start,span:h.span,gapCount:h.gapCount}:null}function oi(N,T){if(!N||!T)return null;let l=null,S=0;for(;S<N.length;){let w=S,h=0;for(;w<N.length&&h<T.length;)N[w]===T[h]&&(h+=1),w+=1;if(h!==T.length)break;const E=new Array(T.length);let f=w-1;for(let L=T.length-1;L>=0;L--){for(;f>=0&&N[f]!==T[L];)f-=1;if(f<0)return l;E[L]=f,f-=1}let e=0;for(let L=1;L<E.length;L++)e+=E[L]-E[L-1]-1;const _={start:E[0],span:E[E.length-1]-E[0]+1,gapCount:e};(!l||_.span<l.span||_.span===l.span&&_.gapCount<l.gapCount||_.span===l.span&&_.gapCount===l.gapCount&&_.start<l.start)&&(l=_),S=E[0]+1}return l}function ai(N,T){return T<=0?!0:/[\s._-]/.test(N[T-1]??"")}function si(N,T){return T>=N.length?!0:/[\s._-]/.test(N[T]??"")}function li(N,T,l){const S=ai(N,T),w=si(N,T+l);return S&&w?1:S?2:3}const ci=/^(#{1,6})\s/,ui=/^\s*\{%\s*(if|elif|elseif|else|endif|for|endfor)\b/,fi={provideFoldingRanges(N){return hi(N)}},pi={provideFoldingRanges(N){return di(N)}};function hi(N){const T=[],l=N.getLineCount(),S=[];for(let w=1;w<=l;w++){const h=ci.exec(N.getLineContent(w));h&&S.push({line:w,level:h[1].length})}for(let w=0;w<S.length;w++){const{line:h,level:E}=S[w];let f=l;for(let e=w+1;e<S.length;e++)if(S[e].level<=E){f=S[e].line-1;break}f=Hn(N,h,f),f>h&&T.push({start:h,end:f})}return T}function di(N){const T=[],l=[],S=N.getLineCount();for(let w=1;w<=S;w++){const h=ui.exec(N.getLineContent(w));if(!h)continue;const E=h[1];if(E==="if"){l.push({kind:"if",branchStarts:[w],startLine:w});continue}if(E==="for"){l.push({kind:"for",branchStarts:[w],startLine:w});continue}if(E==="elif"||E==="elseif"||E==="else"){const f=vi(l,"if");if(!f)continue;Nt(T,N,f.branchStarts.at(-1)??f.startLine,w-1),f.branchStarts.push(w);continue}if(E==="endif"){const f=Tn(l,"if");if(!f)continue;Nt(T,N,f.branchStarts.at(-1)??f.startLine,w-1);continue}if(E==="endfor"){const f=Tn(l,"for");if(!f)continue;Nt(T,N,f.startLine,w-1)}}for(const w of l){const h=w.kind==="if"?w.branchStarts.at(-1)??w.startLine:w.startLine;Nt(T,N,h,S)}return T}function vi(N,T){for(let l=N.length-1;l>=0;l--)if(N[l].kind===T)return N[l];return null}function Tn(N,T){for(let l=N.length-1;l>=0;l--)if(N[l].kind===T)return N.splice(l,1)[0];return null}function Nt(N,T,l,S){const w=Hn(T,l,S);w>l&&N.push({start:l,end:w})}function Hn(N,T,l){let S=l;for(;S>T&&N.getLineContent(S).trim()==="";)S-=1;return S}const mi=/\{%[-\s]*(if|elif|elseif|else|endif|for|endfor)\b/,gi={provideDocumentHighlights(N,T){const l=_i(N),S=T.lineNumber,w=T.column;for(const h of l)for(const E of h)if(E.line===S&&w>=E.startColumn&&w<=E.endColumn)return h.map(f=>({range:{startLineNumber:f.line,startColumn:f.startColumn,endLineNumber:f.line,endColumn:f.endColumn},kind:1}));return[]}};function yi(N,T){const l=N.getLineContent(T),S=mi.exec(l);if(!S)return null;const w=S[1],h=S.index+S[0].length-w.length;return{line:T,startColumn:h+1,endColumn:h+w.length+1,keyword:w}}function _i(N){const T=[],l=N.getLineCount(),S=[];for(let w=1;w<=l;w++){const h=yi(N,w);if(!h)continue;const E=h.keyword;if(E==="if"){S.push({kind:"if",tags:[h]});continue}if(E==="for"){S.push({kind:"for",tags:[h]});continue}if(E==="elif"||E==="elseif"||E==="else"){const f=xi(S,"if");f&&f.tags.push(h);continue}if(E==="endif"){const f=An(S,"if");f&&(f.tags.push(h),T.push(f.tags));continue}if(E==="endfor"){const f=An(S,"for");f&&(f.tags.push(h),T.push(f.tags))}}return T}function xi(N,T){for(let l=N.length-1;l>=0;l--)if(N[l].kind===T)return N[l];return null}function An(N,T){for(let l=N.length-1;l>=0;l--)if(N[l].kind===T)return N.splice(l,1)[0];return null}var qn={exports:{}};/*! Browser bundle of nunjucks 3.2.4 */(function(N,T){(function(S,w){N.exports=w()})(typeof self<"u"?self:zr,function(){return function(l){var S={};function w(h){if(S[h])return S[h].exports;var E=S[h]={i:h,l:!1,exports:{}};return l[h].call(E.exports,E,E.exports,w),E.l=!0,E.exports}return w.m=l,w.c=S,w.d=function(h,E,f){w.o(h,E)||Object.defineProperty(h,E,{configurable:!1,enumerable:!0,get:f})},w.n=function(h){var E=h&&h.__esModule?function(){return h.default}:function(){return h};return w.d(E,"a",E),E},w.o=function(h,E){return Object.prototype.hasOwnProperty.call(h,E)},w.p="",w(w.s=11)}([function(l,_,w){var h=Array.prototype,E=Object.prototype,f={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},e=/[&"'<>\\]/g,_=l.exports={};function L(x,R){return E.hasOwnProperty.call(x,R)}_.hasOwnProp=L;function U(x){return f[x]}function V(x,R,M){if(M.Update||(M=new _.TemplateError(M)),M.Update(x),!R){var C=M;M=new Error(C.message),M.name=C.name}return M}_._prettifyError=V;function $(x,R,M){var C,z;x instanceof Error&&(z=x,x=z.name+": "+z.message),Object.setPrototypeOf?(C=new Error(x),Object.setPrototypeOf(C,$.prototype)):(C=this,Object.defineProperty(C,"message",{enumerable:!1,writable:!0,value:x})),Object.defineProperty(C,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(C,this.constructor);var Z;if(z){var ee=Object.getOwnPropertyDescriptor(z,"stack");Z=ee&&(ee.get||function(){return ee.value}),Z||(Z=function(){return z.stack})}else{var ge=new Error(x).stack;Z=function(){return ge}}return Object.defineProperty(C,"stack",{get:function(){return Z.call(C)}}),Object.defineProperty(C,"cause",{value:z}),C.lineno=R,C.colno=M,C.firstUpdate=!0,C.Update=function(oe){var le="("+(oe||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?le+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(le+=" [Line "+this.lineno+"]")),le+=`
|
|
3
|
+
`,this.firstUpdate&&(le+=" "),this.message=le+(this.message||""),this.firstUpdate=!1,this},C}Object.setPrototypeOf?Object.setPrototypeOf($.prototype,Error.prototype):$.prototype=Object.create(Error.prototype,{constructor:{value:$}}),_.TemplateError=$;function O(x){return x.replace(e,U)}_.escape=O;function F(x){return E.toString.call(x)==="[object Function]"}_.isFunction=F;function t(x){return E.toString.call(x)==="[object Array]"}_.isArray=t;function r(x){return E.toString.call(x)==="[object String]"}_.isString=r;function i(x){return E.toString.call(x)==="[object Object]"}_.isObject=i;function y(x){return x?typeof x=="string"?x.split("."):[x]:[]}function c(x){var R=y(x);return function(C){for(var z=C,Z=0;Z<R.length;Z++){var ee=R[Z];if(L(z,ee))z=z[ee];else return}return z}}_.getAttrGetter=c;function m(x,R,M){for(var C={},z=F(R)?R:c(R),Z=0;Z<x.length;Z++){var ee=x[Z],ge=z(ee,Z);if(ge===void 0&&M===!0)throw new TypeError('groupby: attribute "'+R+'" resolved to undefined');(C[ge]||(C[ge]=[])).push(ee)}return C}_.groupBy=m;function n(x){return Array.prototype.slice.call(x)}_.toArray=n;function a(x){var R=[];if(!x)return R;for(var M=x.length,C=n(arguments).slice(1),z=-1;++z<M;)A(C,x[z])===-1&&R.push(x[z]);return R}_.without=a;function u(x,R){for(var M="",C=0;C<R;C++)M+=x;return M}_.repeat=u;function o(x,R,M){if(x!=null){if(h.forEach&&x.forEach===h.forEach)x.forEach(R,M);else if(x.length===+x.length)for(var C=0,z=x.length;C<z;C++)R.call(M,x[C],C,x)}}_.each=o;function s(x,R){var M=[];if(x==null)return M;if(h.map&&x.map===h.map)return x.map(R);for(var C=0;C<x.length;C++)M[M.length]=R(x[C],C);return x.length===+x.length&&(M.length=x.length),M}_.map=s;function g(x,R,M){var C=-1;function z(){C++,C<x.length?R(x[C],C,z,M):M()}z()}_.asyncIter=g;function d(x,R,M){var C=B(x||{}),z=C.length,Z=-1;function ee(){Z++;var ge=C[Z];Z<z?R(ge,x[ge],Z,z,ee):M()}ee()}_.asyncFor=d;function A(x,R,M){return Array.prototype.indexOf.call(x||[],R,M)}_.indexOf=A;function B(x){var R=[];for(var M in x)L(x,M)&&R.push(M);return R}_.keys=B;function I(x){return B(x).map(function(R){return[R,x[R]]})}_._entries=I;function K(x){return B(x).map(function(R){return x[R]})}_._values=K;function W(x,R){return x=x||{},B(R).forEach(function(M){x[M]=R[M]}),x}_._assign=_.extend=W;function b(x,R){if(t(R)||r(R))return R.indexOf(x)!==-1;if(i(R))return x in R;throw new Error('Cannot use "in" operator to search for "'+x+'" in unexpected types.')}_.inOperator=b},function(l,S,w){function h(r,i){for(var y=0;y<i.length;y++){var c=i[y];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(r,f(c.key),c)}}function E(r,i,y){return i&&h(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function f(r){var i=e(r,"string");return typeof i=="symbol"?i:String(i)}function e(r,i){if(typeof r!="object"||r===null)return r;var y=r[Symbol.toPrimitive];if(y!==void 0){var c=y.call(r,i);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function _(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,L(r,i)}function L(r,i){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,m){return c.__proto__=m,c},L(r,i)}var U=w(16),V=w(0);function $(r,i){return typeof r!="function"||typeof i!="function"?i:function(){var c=this.parent;this.parent=r;var m=i.apply(this,arguments);return this.parent=c,m}}function O(r,i,y){y=y||{},V.keys(y).forEach(function(m){y[m]=$(r.prototype[m],y[m])});var c=function(m){_(n,m);function n(){return m.apply(this,arguments)||this}return E(n,[{key:"typename",get:function(){return i}}]),n}(r);return V._assign(c.prototype,y),c}var F=function(){function r(){this.init.apply(this,arguments)}var i=r.prototype;return i.init=function(){},r.extend=function(c,m){return typeof c=="object"&&(m=c,c="anonymous"),O(this,c,m)},E(r,[{key:"typename",get:function(){return this.constructor.name}}]),r}(),t=function(r){_(i,r);function i(){var c,m;return m=r.call(this)||this,(c=m).init.apply(c,arguments),m}var y=i.prototype;return y.init=function(){},i.extend=function(m,n){return typeof m=="object"&&(n=m,m="anonymous"),O(this,m,n)},E(i,[{key:"typename",get:function(){return this.constructor.name}}]),i}(U);l.exports={Obj:F,EmitterObj:t}},function(l,S,w){var h=w(0),E=Array.from,f=typeof Symbol=="function"&&Symbol.iterator&&typeof E=="function",e=function(){function s(d,A){this.variables=Object.create(null),this.parent=d,this.topLevel=!1,this.isolateWrites=A}var g=s.prototype;return g.set=function(A,B,I){var K=A.split("."),W=this.variables,b=this;if(I&&(b=this.resolve(K[0],!0))){b.set(A,B);return}for(var x=0;x<K.length-1;x++){var R=K[x];W[R]||(W[R]={}),W=W[R]}W[K[K.length-1]]=B},g.get=function(A){var B=this.variables[A];return B!==void 0?B:null},g.lookup=function(A){var B=this.parent,I=this.variables[A];return I!==void 0?I:B&&B.lookup(A)},g.resolve=function(A,B){var I=B&&this.isolateWrites?void 0:this.parent,K=this.variables[A];return K!==void 0?this:I&&I.resolve(A)},g.push=function(A){return new s(this,A)},g.pop=function(){return this.parent},s}();function _(s,g,d){return function(){for(var B=arguments.length,I=new Array(B),K=0;K<B;K++)I[K]=arguments[K];var W=$(I),b,x=V(I);if(W>s.length)b=I.slice(0,s.length),I.slice(b.length,W).forEach(function(C,z){z<g.length&&(x[g[z]]=C)}),b.push(x);else if(W<s.length){b=I.slice(0,W);for(var R=W;R<s.length;R++){var M=s[R];b.push(x[M]),delete x[M]}b.push(x)}else b=I;return d.apply(this,b)}}function L(s){return s.__keywords=!0,s}function U(s){return s&&Object.prototype.hasOwnProperty.call(s,"__keywords")}function V(s){var g=s.length;if(g){var d=s[g-1];if(U(d))return d}return{}}function $(s){var g=s.length;if(g===0)return 0;var d=s[g-1];return U(d)?g-1:g}function O(s){if(typeof s!="string")return s;this.val=s,this.length=s.length}O.prototype=Object.create(String.prototype,{length:{writable:!0,configurable:!0,value:0}}),O.prototype.valueOf=function(){return this.val},O.prototype.toString=function(){return this.val};function F(s,g){return s instanceof O?new O(g):g.toString()}function t(s){var g=typeof s;return g==="string"?new O(s):g!=="function"?s:function(A){var B=s.apply(this,arguments);return typeof B=="string"?new O(B):B}}function r(s,g){return s=s??"",g&&!(s instanceof O)&&(s=h.escape(s.toString())),s}function i(s,g,d){if(s==null)throw new h.TemplateError("attempted to output null or undefined value",g+1,d+1);return s}function y(s,g){if(s!=null)return typeof s[g]=="function"?function(){for(var d=arguments.length,A=new Array(d),B=0;B<d;B++)A[B]=arguments[B];return s[g].apply(s,A)}:s[g]}function c(s,g,d,A){if(s){if(typeof s!="function")throw new Error("Unable to call `"+g+"`, which is not a function")}else throw new Error("Unable to call `"+g+"`, which is undefined or falsey");return s.apply(d,A)}function m(s,g,d){var A=g.lookup(d);return A!==void 0?A:s.lookup(d)}function n(s,g,d){return s.lineno?s:new h.TemplateError(s,g,d)}function a(s,g,d,A){if(h.isArray(s)){var B=s.length;h.asyncIter(s,function(K,W,b){switch(g){case 1:d(K,W,B,b);break;case 2:d(K[0],K[1],W,B,b);break;case 3:d(K[0],K[1],K[2],W,B,b);break;default:K.push(W,B,b),d.apply(this,K)}},A)}else h.asyncFor(s,function(K,W,b,x,R){d(K,W,b,x,R)},A)}function u(s,g,d,A){var B=0,I,K;function W(z,Z){B++,K[z]=Z,B===I&&A(null,K.join(""))}if(h.isArray(s))if(I=s.length,K=new Array(I),I===0)A(null,"");else for(var b=0;b<s.length;b++){var x=s[b];switch(g){case 1:d(x,b,I,W);break;case 2:d(x[0],x[1],b,I,W);break;case 3:d(x[0],x[1],x[2],b,I,W);break;default:x.push(b,I,W),d.apply(this,x)}}else{var R=h.keys(s||{});if(I=R.length,K=new Array(I),I===0)A(null,"");else for(var M=0;M<R.length;M++){var C=R[M];d(C,s[C],M,I,W)}}}function o(s){return typeof s!="object"||s===null||h.isArray(s)?s:f&&Symbol.iterator in s?E(s):s}l.exports={Frame:e,makeMacro:_,makeKeywordArgs:L,numArgs:$,suppressValue:r,ensureDefined:i,memberLookup:y,contextOrFrameLookup:m,callWrap:c,handleError:n,isArray:h.isArray,keys:h.keys,SafeString:O,copySafeness:F,markSafe:t,asyncEach:a,asyncAll:u,inOperator:h.inOperator,fromIterator:o}},function(l,S,w){function h(ce,ue){for(var Se=0;Se<ue.length;Se++){var we=ue[Se];we.enumerable=we.enumerable||!1,we.configurable=!0,"value"in we&&(we.writable=!0),Object.defineProperty(ce,f(we.key),we)}}function E(ce,ue,Se){return ue&&h(ce.prototype,ue),Object.defineProperty(ce,"prototype",{writable:!1}),ce}function f(ce){var ue=e(ce,"string");return typeof ue=="symbol"?ue:String(ue)}function e(ce,ue){if(typeof ce!="object"||ce===null)return ce;var Se=ce[Symbol.toPrimitive];if(Se!==void 0){var we=Se.call(ce,ue);if(typeof we!="object")return we;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ce)}function _(ce,ue){ce.prototype=Object.create(ue.prototype),ce.prototype.constructor=ce,L(ce,ue)}function L(ce,ue){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(we,Oe){return we.__proto__=Oe,we},L(ce,ue)}var U=w(1),V=U.Obj;function $(ce,ue,Se){ce instanceof ue&&Se.push(ce),ce instanceof O&&ce.findAll(ue,Se)}var O=function(ce){_(ue,ce);function ue(){return ce.apply(this,arguments)||this}var Se=ue.prototype;return Se.init=function(Oe,Be){for(var We=arguments,at=this,tt=arguments.length,At=new Array(tt>2?tt-2:0),lt=2;lt<tt;lt++)At[lt-2]=arguments[lt];this.lineno=Oe,this.colno=Be,this.fields.forEach(function(Bt,ht){var kt=We[ht+2];kt===void 0&&(kt=null),at[Bt]=kt})},Se.findAll=function(Oe,Be){var We=this;return Be=Be||[],this instanceof t?this.children.forEach(function(at){return $(at,Oe,Be)}):this.fields.forEach(function(at){return $(We[at],Oe,Be)}),Be},Se.iterFields=function(Oe){var Be=this;this.fields.forEach(function(We){Oe(Be[We],We)})},ue}(V),F=function(ce){_(ue,ce);function ue(){return ce.apply(this,arguments)||this}return E(ue,[{key:"typename",get:function(){return"Value"}},{key:"fields",get:function(){return["value"]}}]),ue}(O),t=function(ce){_(ue,ce);function ue(){return ce.apply(this,arguments)||this}var Se=ue.prototype;return Se.init=function(Oe,Be,We){ce.prototype.init.call(this,Oe,Be,We||[])},Se.addChild=function(Oe){this.children.push(Oe)},E(ue,[{key:"typename",get:function(){return"NodeList"}},{key:"fields",get:function(){return["children"]}}]),ue}(O),r=t.extend("Root"),i=F.extend("Literal"),y=F.extend("Symbol"),c=t.extend("Group"),m=t.extend("Array"),n=O.extend("Pair",{fields:["key","value"]}),a=t.extend("Dict"),u=O.extend("LookupVal",{fields:["target","val"]}),o=O.extend("If",{fields:["cond","body","else_"]}),s=o.extend("IfAsync"),g=O.extend("InlineIf",{fields:["cond","body","else_"]}),d=O.extend("For",{fields:["arr","name","body","else_"]}),A=d.extend("AsyncEach"),B=d.extend("AsyncAll"),I=O.extend("Macro",{fields:["name","args","body"]}),K=I.extend("Caller"),W=O.extend("Import",{fields:["template","target","withContext"]}),b=function(ce){_(ue,ce);function ue(){return ce.apply(this,arguments)||this}var Se=ue.prototype;return Se.init=function(Oe,Be,We,at,tt){ce.prototype.init.call(this,Oe,Be,We,at||new t,tt)},E(ue,[{key:"typename",get:function(){return"FromImport"}},{key:"fields",get:function(){return["template","names","withContext"]}}]),ue}(O),x=O.extend("FunCall",{fields:["name","args"]}),R=x.extend("Filter"),M=R.extend("FilterAsync",{fields:["name","args","symbol"]}),C=a.extend("KeywordArgs"),z=O.extend("Block",{fields:["name","body"]}),Z=O.extend("Super",{fields:["blockName","symbol"]}),ee=O.extend("TemplateRef",{fields:["template"]}),ge=ee.extend("Extends"),Ee=O.extend("Include",{fields:["template","ignoreMissing"]}),oe=O.extend("Set",{fields:["targets","value"]}),le=O.extend("Switch",{fields:["expr","cases","default"]}),q=O.extend("Case",{fields:["cond","body"]}),Q=t.extend("Output"),X=O.extend("Capture",{fields:["body"]}),ve=i.extend("TemplateData"),Le=O.extend("UnaryOp",{fields:["target"]}),ke=O.extend("BinOp",{fields:["left","right"]}),Fe=ke.extend("In"),k=ke.extend("Is"),D=ke.extend("Or"),te=ke.extend("And"),G=Le.extend("Not"),he=ke.extend("Add"),de=ke.extend("Concat"),Ae=ke.extend("Sub"),ye=ke.extend("Mul"),Pe=ke.extend("Div"),Xe=ke.extend("FloorDiv"),et=ke.extend("Mod"),Ge=ke.extend("Pow"),Tt=Le.extend("Neg"),xt=Le.extend("Pos"),ut=O.extend("Compare",{fields:["expr","ops"]}),dt=O.extend("CompareOperand",{fields:["expr","type"]}),it=O.extend("CallExtension",{init:function(ue,Se,we,Oe){this.parent(),this.extName=ue.__name||ue,this.prop=Se,this.args=we||new t,this.contentArgs=Oe||[],this.autoescape=ue.autoescape},fields:["extName","prop","args","contentArgs"]}),ft=it.extend("CallExtensionAsync");function ot(ce,ue,Se){var we=ce.split(`
|
|
4
|
+
`);we.forEach(function(Oe,Be){Oe&&(Se&&Be>0||!Se)&&process.stdout.write(" ".repeat(ue));var We=Be===we.length-1?"":`
|
|
5
|
+
`;process.stdout.write(""+Oe+We)})}function pt(ce,ue){if(ue=ue||0,ot(ce.typename+": ",ue),ce instanceof t)ot(`
|
|
6
|
+
`),ce.children.forEach(function(Oe){pt(Oe,ue+2)});else if(ce instanceof it)ot(ce.extName+"."+ce.prop+`
|
|
7
|
+
`),ce.args&&pt(ce.args,ue+2),ce.contentArgs&&ce.contentArgs.forEach(function(Oe){pt(Oe,ue+2)});else{var Se=[],we=null;ce.iterFields(function(Oe,Be){Oe instanceof O?Se.push([Be,Oe]):(we=we||{},we[Be]=Oe)}),we?ot(JSON.stringify(we,null,2)+`
|
|
8
|
+
`,null,!0):ot(`
|
|
9
|
+
`),Se.forEach(function(Oe){var Be=Oe[0],We=Oe[1];ot("["+Be+"] =>",ue+2),pt(We,ue+4)})}}l.exports={Node:O,Root:r,NodeList:t,Value:F,Literal:i,Symbol:y,Group:c,Array:m,Pair:n,Dict:a,Output:Q,Capture:X,TemplateData:ve,If:o,IfAsync:s,InlineIf:g,For:d,AsyncEach:A,AsyncAll:B,Macro:I,Caller:K,Import:W,FromImport:b,FunCall:x,Filter:R,FilterAsync:M,KeywordArgs:C,Block:z,Super:Z,Extends:ge,Include:Ee,Set:oe,Switch:le,Case:q,LookupVal:u,BinOp:ke,In:Fe,Is:k,Or:D,And:te,Not:G,Add:he,Concat:de,Sub:Ae,Mul:ye,Div:Pe,FloorDiv:Xe,Mod:et,Pow:Ge,Neg:Tt,Pos:xt,Compare:ut,CompareOperand:dt,CallExtension:it,CallExtensionAsync:ft,printNodes:pt}},function(l,S){},function(l,S,w){function h(i,y){i.prototype=Object.create(y.prototype),i.prototype.constructor=i,E(i,y)}function E(i,y){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,n){return m.__proto__=n,m},E(i,y)}var f=w(8),e=w(17),_=w(3),L=w(0),U=L.TemplateError,V=w(2),$=V.Frame,O=w(1),F=O.Obj,t={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},r=function(i){h(y,i);function y(){return i.apply(this,arguments)||this}var c=y.prototype;return c.init=function(n,a){this.templateName=n,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=a},c.fail=function(n,a,u){throw a!==void 0&&(a+=1),u!==void 0&&(u+=1),new U(n,a,u)},c._pushBuffer=function(){var n=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=n,this._emit("var "+this.buffer+' = "";'),n},c._popBuffer=function(){this.buffer=this.bufferStack.pop()},c._emit=function(n){this.codebuf.push(n)},c._emitLine=function(n){this._emit(n+`
|
|
10
|
+
`)},c._emitLines=function(){for(var n=this,a=arguments.length,u=new Array(a),o=0;o<a;o++)u[o]=arguments[o];u.forEach(function(s){return n._emitLine(s)})},c._emitFuncBegin=function(n,a){this.buffer="output",this._scopeClosers="",this._emitLine("function "+a+"(env, context, frame, runtime, cb) {"),this._emitLine("var lineno = "+n.lineno+";"),this._emitLine("var colno = "+n.colno+";"),this._emitLine("var "+this.buffer+' = "";'),this._emitLine("try {")},c._emitFuncEnd=function(n){n||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(n){var a=this._scopeClosers;this._scopeClosers="",n.call(this),this._closeScopeLevels(),this._scopeClosers=a},c._makeCallback=function(n){var a=this._tmpid();return"function("+a+(n?","+n:"")+`) {
|
|
11
|
+
if(`+a+") { cb("+a+"); 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(n,a){var u=this;n.children.forEach(function(o){u.compile(o,a)})},c._compileAggregate=function(n,a,u,o){var s=this;u&&this._emit(u),n.children.forEach(function(g,d){d>0&&s._emit(","),s.compile(g,a)}),o&&this._emit(o)},c._compileExpression=function(n,a){this.assertType(n,_.Literal,_.Symbol,_.Group,_.Array,_.Dict,_.FunCall,_.Caller,_.Filter,_.LookupVal,_.Compare,_.InlineIf,_.In,_.Is,_.And,_.Or,_.Not,_.Add,_.Concat,_.Sub,_.Mul,_.Div,_.FloorDiv,_.Mod,_.Pow,_.Neg,_.Pos,_.Compare,_.NodeList),this.compile(n,a)},c.assertType=function(n){for(var a=arguments.length,u=new Array(a>1?a-1:0),o=1;o<a;o++)u[o-1]=arguments[o];u.some(function(s){return n instanceof s})||this.fail("assertType: invalid type: "+n.typename,n.lineno,n.colno)},c.compileCallExtension=function(n,a,u){var o=this,s=n.args,g=n.contentArgs,d=typeof n.autoescape=="boolean"?n.autoescape:!0;if(u||this._emit(this.buffer+" += runtime.suppressValue("),this._emit('env.getExtension("'+n.extName+'")["'+n.prop+'"]('),this._emit("context"),(s||g)&&this._emit(","),s&&(s instanceof _.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),s.children.forEach(function(B,I){o._compileExpression(B,a),(I!==s.children.length-1||g.length)&&o._emit(",")})),g.length&&g.forEach(function(B,I){if(I>0&&o._emit(","),B){o._emitLine("function(cb) {"),o._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var K=o._pushBuffer();o._withScopedSyntax(function(){o.compile(B,a),o._emitLine("cb(null, "+K+");")}),o._popBuffer(),o._emitLine("return "+K+";"),o._emitLine("}")}else o._emit("null")}),u){var A=this._tmpid();this._emitLine(", "+this._makeCallback(A)),this._emitLine(this.buffer+" += runtime.suppressValue("+A+", "+d+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+d+` && env.opts.autoescape);
|
|
12
|
+
`)},c.compileCallExtensionAsync=function(n,a){this.compileCallExtension(n,a,!0)},c.compileNodeList=function(n,a){this._compileChildren(n,a)},c.compileLiteral=function(n){if(typeof n.value=="string"){var a=n.value.replace(/\\/g,"\\\\");a=a.replace(/"/g,'\\"'),a=a.replace(/\n/g,"\\n"),a=a.replace(/\r/g,"\\r"),a=a.replace(/\t/g,"\\t"),a=a.replace(/\u2028/g,"\\u2028"),this._emit('"'+a+'"')}else n.value===null?this._emit("null"):this._emit(n.value.toString())},c.compileSymbol=function(n,a){var u=n.value,o=a.lookup(u);o?this._emit(o):this._emit('runtime.contextOrFrameLookup(context, frame, "'+u+'")')},c.compileGroup=function(n,a){this._compileAggregate(n,a,"(",")")},c.compileArray=function(n,a){this._compileAggregate(n,a,"[","]")},c.compileDict=function(n,a){this._compileAggregate(n,a,"{","}")},c.compilePair=function(n,a){var u=n.key,o=n.value;u instanceof _.Symbol?u=new _.Literal(u.lineno,u.colno,u.value):u instanceof _.Literal&&typeof u.value=="string"||this.fail("compilePair: Dict keys must be strings or names",u.lineno,u.colno),this.compile(u,a),this._emit(": "),this._compileExpression(o,a)},c.compileInlineIf=function(n,a){this._emit("("),this.compile(n.cond,a),this._emit("?"),this.compile(n.body,a),this._emit(":"),n.else_!==null?this.compile(n.else_,a):this._emit('""'),this._emit(")")},c.compileIn=function(n,a){this._emit("runtime.inOperator("),this.compile(n.left,a),this._emit(","),this.compile(n.right,a),this._emit(")")},c.compileIs=function(n,a){var u=n.right.name?n.right.name.value:n.right.value;this._emit('env.getTest("'+u+'").call(context, '),this.compile(n.left,a),n.right.args&&(this._emit(","),this.compile(n.right.args,a)),this._emit(") === true")},c._binOpEmitter=function(n,a,u){this.compile(n.left,a),this._emit(u),this.compile(n.right,a)},c.compileOr=function(n,a){return this._binOpEmitter(n,a," || ")},c.compileAnd=function(n,a){return this._binOpEmitter(n,a," && ")},c.compileAdd=function(n,a){return this._binOpEmitter(n,a," + ")},c.compileConcat=function(n,a){return this._binOpEmitter(n,a,' + "" + ')},c.compileSub=function(n,a){return this._binOpEmitter(n,a," - ")},c.compileMul=function(n,a){return this._binOpEmitter(n,a," * ")},c.compileDiv=function(n,a){return this._binOpEmitter(n,a," / ")},c.compileMod=function(n,a){return this._binOpEmitter(n,a," % ")},c.compileNot=function(n,a){this._emit("!"),this.compile(n.target,a)},c.compileFloorDiv=function(n,a){this._emit("Math.floor("),this.compile(n.left,a),this._emit(" / "),this.compile(n.right,a),this._emit(")")},c.compilePow=function(n,a){this._emit("Math.pow("),this.compile(n.left,a),this._emit(", "),this.compile(n.right,a),this._emit(")")},c.compileNeg=function(n,a){this._emit("-"),this.compile(n.target,a)},c.compilePos=function(n,a){this._emit("+"),this.compile(n.target,a)},c.compileCompare=function(n,a){var u=this;this.compile(n.expr,a),n.ops.forEach(function(o){u._emit(" "+t[o.type]+" "),u.compile(o.expr,a)})},c.compileLookupVal=function(n,a){this._emit("runtime.memberLookup(("),this._compileExpression(n.target,a),this._emit("),"),this._compileExpression(n.val,a),this._emit(")")},c._getNodeName=function(n){switch(n.typename){case"Symbol":return n.value;case"FunCall":return"the return value of ("+this._getNodeName(n.name)+")";case"LookupVal":return this._getNodeName(n.target)+'["'+this._getNodeName(n.val)+'"]';case"Literal":return n.value.toString();default:return"--expression--"}},c.compileFunCall=function(n,a){this._emit("(lineno = "+n.lineno+", colno = "+n.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(n.name,a),this._emit(', "'+this._getNodeName(n.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(n.args,a,"[","])"),this._emit(")")},c.compileFilter=function(n,a){var u=n.name;this.assertType(u,_.Symbol),this._emit('env.getFilter("'+u.value+'").call(context, '),this._compileAggregate(n.args,a),this._emit(")")},c.compileFilterAsync=function(n,a){var u=n.name,o=n.symbol.value;this.assertType(u,_.Symbol),a.set(o,o),this._emit('env.getFilter("'+u.value+'").call(context, '),this._compileAggregate(n.args,a),this._emitLine(", "+this._makeCallback(o)),this._addScopeLevel()},c.compileKeywordArgs=function(n,a){this._emit("runtime.makeKeywordArgs("),this.compileDict(n,a),this._emit(")")},c.compileSet=function(n,a){var u=this,o=[];n.targets.forEach(function(s){var g=s.value,d=a.lookup(g);d==null&&(d=u._tmpid(),u._emitLine("var "+d+";")),o.push(d)}),n.value?(this._emit(o.join(" = ")+" = "),this._compileExpression(n.value,a),this._emitLine(";")):(this._emit(o.join(" = ")+" = "),this.compile(n.body,a),this._emitLine(";")),n.targets.forEach(function(s,g){var d=o[g],A=s.value;u._emitLine('frame.set("'+A+'", '+d+", true);"),u._emitLine("if(frame.topLevel) {"),u._emitLine('context.setVariable("'+A+'", '+d+");"),u._emitLine("}"),A.charAt(0)!=="_"&&(u._emitLine("if(frame.topLevel) {"),u._emitLine('context.addExport("'+A+'", '+d+");"),u._emitLine("}"))})},c.compileSwitch=function(n,a){var u=this;this._emit("switch ("),this.compile(n.expr,a),this._emit(") {"),n.cases.forEach(function(o,s){u._emit("case "),u.compile(o.cond,a),u._emit(": "),u.compile(o.body,a),o.body.children.length&&u._emitLine("break;")}),n.default&&(this._emit("default:"),this.compile(n.default,a)),this._emit("}")},c.compileIf=function(n,a,u){var o=this;this._emit("if("),this._compileExpression(n.cond,a),this._emitLine(") {"),this._withScopedSyntax(function(){o.compile(n.body,a),u&&o._emit("cb()")}),n.else_?(this._emitLine(`}
|
|
13
|
+
else {`),this._withScopedSyntax(function(){o.compile(n.else_,a),u&&o._emit("cb()")})):u&&(this._emitLine(`}
|
|
14
|
+
else {`),this._emit("cb()")),this._emitLine("}")},c.compileIfAsync=function(n,a){this._emit("(function(cb) {"),this.compileIf(n,a,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},c._emitLoopBindings=function(n,a,u,o){var s=this,g=[{name:"index",val:u+" + 1"},{name:"index0",val:u},{name:"revindex",val:o+" - "+u},{name:"revindex0",val:o+" - "+u+" - 1"},{name:"first",val:u+" === 0"},{name:"last",val:u+" === "+o+" - 1"},{name:"length",val:o}];g.forEach(function(d){s._emitLine('frame.set("loop.'+d.name+'", '+d.val+");")})},c.compileFor=function(n,a){var u=this,o=this._tmpid(),s=this._tmpid(),g=this._tmpid();if(a=a.push(),this._emitLine("frame = frame.push();"),this._emit("var "+g+" = "),this._compileExpression(n.arr,a),this._emitLine(";"),this._emit("if("+g+") {"),this._emitLine(g+" = runtime.fromIterator("+g+");"),n.name instanceof _.Array){this._emitLine("var "+o+";"),this._emitLine("if(runtime.isArray("+g+")) {"),this._emitLine("var "+s+" = "+g+".length;"),this._emitLine("for("+o+"=0; "+o+" < "+g+".length; "+o+"++) {"),n.name.children.forEach(function(b,x){var R=u._tmpid();u._emitLine("var "+R+" = "+g+"["+o+"]["+x+"];"),u._emitLine('frame.set("'+b+'", '+g+"["+o+"]["+x+"]);"),a.set(n.name.children[x].value,R)}),this._emitLoopBindings(n,g,o,s),this._withScopedSyntax(function(){u.compile(n.body,a)}),this._emitLine("}"),this._emitLine("} else {");var d=n.name.children,A=d[0],B=d[1],I=this._tmpid(),K=this._tmpid();a.set(A.value,I),a.set(B.value,K),this._emitLine(o+" = -1;"),this._emitLine("var "+s+" = runtime.keys("+g+").length;"),this._emitLine("for(var "+I+" in "+g+") {"),this._emitLine(o+"++;"),this._emitLine("var "+K+" = "+g+"["+I+"];"),this._emitLine('frame.set("'+A.value+'", '+I+");"),this._emitLine('frame.set("'+B.value+'", '+K+");"),this._emitLoopBindings(n,g,o,s),this._withScopedSyntax(function(){u.compile(n.body,a)}),this._emitLine("}"),this._emitLine("}")}else{var W=this._tmpid();a.set(n.name.value,W),this._emitLine("var "+s+" = "+g+".length;"),this._emitLine("for(var "+o+"=0; "+o+" < "+g+".length; "+o+"++) {"),this._emitLine("var "+W+" = "+g+"["+o+"];"),this._emitLine('frame.set("'+n.name.value+'", '+W+");"),this._emitLoopBindings(n,g,o,s),this._withScopedSyntax(function(){u.compile(n.body,a)}),this._emitLine("}")}this._emitLine("}"),n.else_&&(this._emitLine("if (!"+s+") {"),this.compile(n.else_,a),this._emitLine("}")),this._emitLine("frame = frame.pop();")},c._compileAsyncLoop=function(n,a,u){var o=this,s=this._tmpid(),g=this._tmpid(),d=this._tmpid(),A=u?"asyncAll":"asyncEach";if(a=a.push(),this._emitLine("frame = frame.push();"),this._emit("var "+d+" = runtime.fromIterator("),this._compileExpression(n.arr,a),this._emitLine(");"),n.name instanceof _.Array){var B=n.name.children.length;this._emit("runtime."+A+"("+d+", "+B+", function("),n.name.children.forEach(function(W){o._emit(W.value+",")}),this._emit(s+","+g+",next) {"),n.name.children.forEach(function(W){var b=W.value;a.set(b,b),o._emitLine('frame.set("'+b+'", '+b+");")})}else{var I=n.name.value;this._emitLine("runtime."+A+"("+d+", 1, function("+I+", "+s+", "+g+",next) {"),this._emitLine('frame.set("'+I+'", '+I+");"),a.set(I,I)}this._emitLoopBindings(n,d,s,g),this._withScopedSyntax(function(){var W;u&&(W=o._pushBuffer()),o.compile(n.body,a),o._emitLine("next("+s+(W?","+W:"")+");"),u&&o._popBuffer()});var K=this._tmpid();this._emitLine("}, "+this._makeCallback(K)),this._addScopeLevel(),u&&this._emitLine(this.buffer+" += "+K+";"),n.else_&&(this._emitLine("if (!"+d+".length) {"),this.compile(n.else_,a),this._emitLine("}")),this._emitLine("frame = frame.pop();")},c.compileAsyncEach=function(n,a){this._compileAsyncLoop(n,a)},c.compileAsyncAll=function(n,a){this._compileAsyncLoop(n,a,!0)},c._compileMacro=function(n,a){var u=this,o=[],s=null,g="macro_"+this._tmpid(),d=a!==void 0;n.args.children.forEach(function(b,x){x===n.args.children.length-1&&b instanceof _.Dict?s=b:(u.assertType(b,_.Symbol),o.push(b))});var A=[].concat(o.map(function(b){return"l_"+b.value}),["kwargs"]),B=o.map(function(b){return'"'+b.value+'"'}),I=(s&&s.children||[]).map(function(b){return'"'+b.key.value+'"'}),K;d?K=a.push(!0):K=new $,this._emitLines("var "+g+" = runtime.makeMacro(","["+B.join(", ")+"], ","["+I.join(", ")+"], ","function ("+A.join(", ")+") {","var callerFrame = frame;","frame = "+(d?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),o.forEach(function(b){u._emitLine('frame.set("'+b.value+'", l_'+b.value+");"),K.set(b.value,"l_"+b.value)}),s&&s.children.forEach(function(b){var x=b.key.value;u._emit('frame.set("'+x+'", '),u._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+x+'")'),u._emit(' ? kwargs["'+x+'"] : '),u._compileExpression(b.value,K),u._emit(");")});var W=this._pushBuffer();return this._withScopedSyntax(function(){u.compile(n.body,K)}),this._emitLine("frame = "+(d?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+W+");"),this._emitLine("});"),this._popBuffer(),g},c.compileMacro=function(n,a){var u=this._compileMacro(n),o=n.name.value;a.set(o,u),a.parent?this._emitLine('frame.set("'+o+'", '+u+");"):(n.name.value.charAt(0)!=="_"&&this._emitLine('context.addExport("'+o+'");'),this._emitLine('context.setVariable("'+o+'", '+u+");"))},c.compileCaller=function(n,a){this._emit("(function (){");var u=this._compileMacro(n,a);this._emit("return "+u+";})()")},c._compileGetTemplate=function(n,a,u,o){var s=this._tmpid(),g=this._templateName(),d=this._makeCallback(s),A=u?"true":"false",B=o?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(n.template,a),this._emitLine(", "+A+", "+g+", "+B+", "+d),s},c.compileImport=function(n,a){var u=n.target.value,o=this._compileGetTemplate(n,a,!1,!1);this._addScopeLevel(),this._emitLine(o+".getExported("+(n.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(o)),this._addScopeLevel(),a.set(u,o),a.parent?this._emitLine('frame.set("'+u+'", '+o+");"):this._emitLine('context.setVariable("'+u+'", '+o+");")},c.compileFromImport=function(n,a){var u=this,o=this._compileGetTemplate(n,a,!1,!1);this._addScopeLevel(),this._emitLine(o+".getExported("+(n.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(o)),this._addScopeLevel(),n.names.children.forEach(function(s){var g,d,A=u._tmpid();s instanceof _.Pair?(g=s.key.value,d=s.value.value):(g=s.value,d=g),u._emitLine("if(Object.prototype.hasOwnProperty.call("+o+', "'+g+'")) {'),u._emitLine("var "+A+" = "+o+"."+g+";"),u._emitLine("} else {"),u._emitLine(`cb(new Error("cannot import '`+g+`'")); return;`),u._emitLine("}"),a.set(d,A),a.parent?u._emitLine('frame.set("'+d+'", '+A+");"):u._emitLine('context.setVariable("'+d+'", '+A+");")})},c.compileBlock=function(n){var a=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+n.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(a)),this._emitLine(this.buffer+" += "+a+";"),this._addScopeLevel()},c.compileSuper=function(n,a){var u=n.blockName.value,o=n.symbol.value,s=this._makeCallback(o);this._emitLine('context.getSuper(env, "'+u+'", b_'+u+", frame, runtime, "+s),this._emitLine(o+" = runtime.markSafe("+o+");"),this._addScopeLevel(),a.set(o,o)},c.compileExtends=function(n,a){var u=this._tmpid(),o=this._compileGetTemplate(n,a,!0,!1);this._emitLine("parentTemplate = "+o),this._emitLine("for(var "+u+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+u+", parentTemplate.blocks["+u+"]);"),this._emitLine("}"),this._addScopeLevel()},c.compileInclude=function(n,a){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var u=this._compileGetTemplate(n,a,!1,n.ignoreMissing);this._emitLine("callback(null,"+u+");});"),this._emitLine("});");var o=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(o)),this._emitLine("callback(null,"+o+");});"),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(n,a){this.compileLiteral(n,a)},c.compileCapture=function(n,a){var u=this,o=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax(function(){u.compile(n.body,a)}),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=o},c.compileOutput=function(n,a){var u=this,o=n.children;o.forEach(function(s){s instanceof _.TemplateData?s.value&&(u._emit(u.buffer+" += "),u.compileLiteral(s,a),u._emitLine(";")):(u._emit(u.buffer+" += runtime.suppressValue("),u.throwOnUndefined&&u._emit("runtime.ensureDefined("),u.compile(s,a),u.throwOnUndefined&&u._emit(","+n.lineno+","+n.colno+")"),u._emit(`, env.opts.autoescape);
|
|
15
|
+
`))})},c.compileRoot=function(n,a){var u=this;a&&this.fail("compileRoot: root node can't have frame"),a=new $,this._emitFuncBegin(n,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(n,a),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 o=[],s=n.findAll(_.Block);s.forEach(function(g,d){var A=g.name.value;if(o.indexOf(A)!==-1)throw new Error('Block "'+A+'" defined more than once.');o.push(A),u._emitFuncBegin(g,"b_"+A);var B=new $;u._emitLine("var frame = frame.push(true);"),u.compile(g.body,B),u._emitFuncEnd()}),this._emitLine("return {"),s.forEach(function(g,d){var A="b_"+g.name.value;u._emitLine(A+": "+A+",")}),this._emitLine(`root: root
|
|
16
|
+
};`)},c.compile=function(n,a){var u=this["compile"+n.typename];u?u.call(this,n,a):this.fail("compile: Cannot compile node: "+n.typename,n.lineno,n.colno)},c.getCode=function(){return this.codebuf.join("")},y}(F);l.exports={compile:function(y,c,m,n,a){a===void 0&&(a={});var u=new r(n,a.throwOnUndefined),o=(m||[]).map(function(g){return g.preprocess}).filter(function(g){return!!g}),s=o.reduce(function(g,d){return d(g)},y);return u.compile(e.transform(f.parse(s,m,a),c,n)),u.getCode()},Compiler:r}},function(l,S,w){function h(L,U){L.prototype=Object.create(U.prototype),L.prototype.constructor=L,E(L,U)}function E(L,U){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function($,O){return $.__proto__=O,$},E(L,U)}var f=w(4),e=w(1),_=e.EmitterObj;l.exports=function(L){h(U,L);function U(){return L.apply(this,arguments)||this}var V=U.prototype;return V.resolve=function(O,F){return f.resolve(f.dirname(O),F)},V.isRelative=function(O){return O.indexOf("./")===0||O.indexOf("../")===0},U}(_)},function(l,S,w){function h(B,I){B.prototype=Object.create(I.prototype),B.prototype.constructor=B,E(B,I)}function E(B,I){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(W,b){return W.__proto__=b,W},E(B,I)}var f=w(12),e=w(15),_=w(0),L=w(5),U=w(18),V=w(10),$=V.FileSystemLoader,O=V.WebLoader,F=V.PrecompiledLoader,t=w(20),r=w(21),i=w(1),y=i.Obj,c=i.EmitterObj,m=w(2),n=m.handleError,a=m.Frame,u=w(22);function o(B,I,K){f(function(){B(I,K)})}var s={type:"code",obj:{root:function(I,K,W,b,x){try{x(null,"")}catch(R){x(n(R,null,null))}}}},g=function(B){h(I,B);function I(){return B.apply(this,arguments)||this}var K=I.prototype;return K.init=function(b,x){var R=this;x=this.opts=x||{},this.opts.dev=!!x.dev,this.opts.autoescape=x.autoescape!=null?x.autoescape:!0,this.opts.throwOnUndefined=!!x.throwOnUndefined,this.opts.trimBlocks=!!x.trimBlocks,this.opts.lstripBlocks=!!x.lstripBlocks,this.loaders=[],b?this.loaders=_.isArray(b)?b:[b]:$?this.loaders=[new $("views")]:O&&(this.loaders=[new O("/views")]),typeof window<"u"&&window.nunjucksPrecompiled&&this.loaders.unshift(new F(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=r(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],_._entries(U).forEach(function(M){var C=M[0],z=M[1];return R.addFilter(C,z)}),_._entries(t).forEach(function(M){var C=M[0],z=M[1];return R.addTest(C,z)})},K._initLoaders=function(){var b=this;this.loaders.forEach(function(x){x.cache={},typeof x.on=="function"&&(x.on("update",function(R,M){x.cache[R]=null,b.emit("update",R,M,x)}),x.on("load",function(R,M){b.emit("load",R,M,x)}))})},K.invalidateCache=function(){this.loaders.forEach(function(b){b.cache={}})},K.addExtension=function(b,x){return x.__name=b,this.extensions[b]=x,this.extensionsList.push(x),this},K.removeExtension=function(b){var x=this.getExtension(b);x&&(this.extensionsList=_.without(this.extensionsList,x),delete this.extensions[b])},K.getExtension=function(b){return this.extensions[b]},K.hasExtension=function(b){return!!this.extensions[b]},K.addGlobal=function(b,x){return this.globals[b]=x,this},K.getGlobal=function(b){if(typeof this.globals[b]>"u")throw new Error("global not found: "+b);return this.globals[b]},K.addFilter=function(b,x,R){var M=x;return R&&this.asyncFilters.push(b),this.filters[b]=M,this},K.getFilter=function(b){if(!this.filters[b])throw new Error("filter not found: "+b);return this.filters[b]},K.addTest=function(b,x){return this.tests[b]=x,this},K.getTest=function(b){if(!this.tests[b])throw new Error("test not found: "+b);return this.tests[b]},K.resolveTemplate=function(b,x,R){var M=b.isRelative&&x?b.isRelative(R):!1;return M&&b.resolve?b.resolve(x,R):R},K.getTemplate=function(b,x,R,M,C){var z=this,Z=this,ee=null;if(b&&b.raw&&(b=b.raw),_.isFunction(R)&&(C=R,R=null,x=x||!1),_.isFunction(x)&&(C=x,x=!1),b instanceof A)ee=b;else{if(typeof b!="string")throw new Error("template names must be a string: "+b);for(var ge=0;ge<this.loaders.length;ge++){var Ee=this.loaders[ge];if(ee=Ee.cache[this.resolveTemplate(Ee,R,b)],ee)break}}if(ee)if(x&&ee.compile(),C){C(null,ee);return}else return ee;var oe,le=function(Q,X){if(!X&&!Q&&!M&&(Q=new Error("template not found: "+b)),Q)if(C){C(Q);return}else throw Q;var ve;X?(ve=new A(X.src,z,X.path,x),X.noCache||(X.loader.cache[b]=ve)):ve=new A(s,z,"",x),C?C(null,ve):oe=ve};return _.asyncIter(this.loaders,function(q,Q,X,ve){function Le(ke,Fe){ke?ve(ke):Fe?(Fe.loader=q,ve(null,Fe)):X()}b=Z.resolveTemplate(q,R,b),q.async?q.getSource(b,Le):Le(null,q.getSource(b))},le),oe},K.express=function(b){return u(this,b)},K.render=function(b,x,R){_.isFunction(x)&&(R=x,x=null);var M=null;return this.getTemplate(b,function(C,z){if(C&&R)o(R,C);else{if(C)throw C;M=z.render(x,R)}}),M},K.renderString=function(b,x,R,M){_.isFunction(R)&&(M=R,R={}),R=R||{};var C=new A(b,this,R.path);return C.render(x,M)},K.waterfall=function(b,x,R){return e(b,x,R)},I}(c),d=function(B){h(I,B);function I(){return B.apply(this,arguments)||this}var K=I.prototype;return K.init=function(b,x,R){var M=this;this.env=R||new g,this.ctx=_.extend({},b),this.blocks={},this.exported=[],_.keys(x).forEach(function(C){M.addBlock(C,x[C])})},K.lookup=function(b){return b in this.env.globals&&!(b in this.ctx)?this.env.globals[b]:this.ctx[b]},K.setVariable=function(b,x){this.ctx[b]=x},K.getVariables=function(){return this.ctx},K.addBlock=function(b,x){return this.blocks[b]=this.blocks[b]||[],this.blocks[b].push(x),this},K.getBlock=function(b){if(!this.blocks[b])throw new Error('unknown block "'+b+'"');return this.blocks[b][0]},K.getSuper=function(b,x,R,M,C,z){var Z=_.indexOf(this.blocks[x]||[],R),ee=this.blocks[x][Z+1],ge=this;if(Z===-1||!ee)throw new Error('no super block available for "'+x+'"');ee(b,ge,M,C,z)},K.addExport=function(b){this.exported.push(b)},K.getExported=function(){var b=this,x={};return this.exported.forEach(function(R){x[R]=b.ctx[R]}),x},I}(y),A=function(B){h(I,B);function I(){return B.apply(this,arguments)||this}var K=I.prototype;return K.init=function(b,x,R,M){if(this.env=x||new g,_.isObject(b))switch(b.type){case"code":this.tmplProps=b.obj;break;case"string":this.tmplStr=b.obj;break;default:throw new Error("Unexpected template object type "+b.type+"; expected 'code', or 'string'")}else if(_.isString(b))this.tmplStr=b;else throw new Error("src must be a string or an object describing the source");if(this.path=R,M)try{this._compile()}catch(C){throw _._prettifyError(this.path,this.env.opts.dev,C)}else this.compiled=!1},K.render=function(b,x,R){var M=this;typeof b=="function"?(R=b,b={}):typeof x=="function"&&(R=x,x=null);var C=!x;try{this.compile()}catch(oe){var z=_._prettifyError(this.path,this.env.opts.dev,oe);if(R)return o(R,z);throw z}var Z=new d(b||{},this.blocks,this.env),ee=x?x.push(!0):new a;ee.topLevel=!0;var ge=null,Ee=!1;return this.rootRenderFunc(this.env,Z,ee,m,function(oe,le){if(!(Ee&&R&&typeof le<"u"))if(oe&&(oe=_._prettifyError(M.path,M.env.opts.dev,oe),Ee=!0),R)C?o(R,oe,le):R(oe,le);else{if(oe)throw oe;ge=le}}),ge},K.getExported=function(b,x,R){typeof b=="function"&&(R=b,b={}),typeof x=="function"&&(R=x,x=null);try{this.compile()}catch(z){if(R)return R(z);throw z}var M=x?x.push():new a;M.topLevel=!0;var C=new d(b||{},this.blocks,this.env);this.rootRenderFunc(this.env,C,M,m,function(z){z?R(z,null):R(null,C.getExported())})},K.compile=function(){this.compiled||this._compile()},K._compile=function(){var b;if(this.tmplProps)b=this.tmplProps;else{var x=L.compile(this.tmplStr,this.env.asyncFilters,this.env.extensionsList,this.path,this.env.opts),R=new Function(x);b=R()}this.blocks=this._getBlocks(b),this.rootRenderFunc=b.root,this.compiled=!0},K._getBlocks=function(b){var x={};return _.keys(b).forEach(function(R){R.slice(0,2)==="b_"&&(x[R.slice(2)]=b[R])}),x},I}(y);l.exports={Environment:g,Template:A}},function(l,S,w){function h(V,$){V.prototype=Object.create($.prototype),V.prototype.constructor=V,E(V,$)}function E(V,$){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(F,t){return F.__proto__=t,F},E(V,$)}var f=w(9),e=w(3),_=w(1).Obj,L=w(0),U=function(V){h($,V);function $(){return V.apply(this,arguments)||this}var O=$.prototype;return O.init=function(t){this.tokens=t,this.peeked=null,this.breakOnBlocks=null,this.dropLeadingWhitespace=!1,this.extensions=[]},O.nextToken=function(t){var r;if(this.peeked)if(!t&&this.peeked.type===f.TOKEN_WHITESPACE)this.peeked=null;else return r=this.peeked,this.peeked=null,r;if(r=this.tokens.nextToken(),!t)for(;r&&r.type===f.TOKEN_WHITESPACE;)r=this.tokens.nextToken();return r},O.peekToken=function(){return this.peeked=this.peeked||this.nextToken(),this.peeked},O.pushToken=function(t){if(this.peeked)throw new Error("pushToken: can only push one token on between reads");this.peeked=t},O.error=function(t,r,i){if(r===void 0||i===void 0){var y=this.peekToken()||{};r=y.lineno,i=y.colno}return r!==void 0&&(r+=1),i!==void 0&&(i+=1),new L.TemplateError(t,r,i)},O.fail=function(t,r,i){throw this.error(t,r,i)},O.skip=function(t){var r=this.nextToken();return!r||r.type!==t?(this.pushToken(r),!1):!0},O.expect=function(t){var r=this.nextToken();return r.type!==t&&this.fail("expected "+t+", got "+r.type,r.lineno,r.colno),r},O.skipValue=function(t,r){var i=this.nextToken();return!i||i.type!==t||i.value!==r?(this.pushToken(i),!1):!0},O.skipSymbol=function(t){return this.skipValue(f.TOKEN_SYMBOL,t)},O.advanceAfterBlockEnd=function(t){var r;return t||(r=this.peekToken(),r||this.fail("unexpected end of file"),r.type!==f.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),t=this.nextToken().value),r=this.nextToken(),r&&r.type===f.TOKEN_BLOCK_END?r.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0):this.fail("expected block end in "+t+" statement"),r},O.advanceAfterVariableEnd=function(){var t=this.nextToken();t&&t.type===f.TOKEN_VARIABLE_END?this.dropLeadingWhitespace=t.value.charAt(t.value.length-this.tokens.tags.VARIABLE_END.length-1)==="-":(this.pushToken(t),this.fail("expected variable end"))},O.parseFor=function(){var t=this.peekToken(),r,i;this.skipSymbol("for")?(r=new e.For(t.lineno,t.colno),i="endfor"):this.skipSymbol("asyncEach")?(r=new e.AsyncEach(t.lineno,t.colno),i="endeach"):this.skipSymbol("asyncAll")?(r=new e.AsyncAll(t.lineno,t.colno),i="endall"):this.fail("parseFor: expected for{Async}",t.lineno,t.colno),r.name=this.parsePrimary(),r.name instanceof e.Symbol||this.fail("parseFor: variable name expected for loop");var y=this.peekToken().type;if(y===f.TOKEN_COMMA){var c=r.name;for(r.name=new e.Array(c.lineno,c.colno),r.name.addChild(c);this.skip(f.TOKEN_COMMA);){var m=this.parsePrimary();r.name.addChild(m)}}return this.skipSymbol("in")||this.fail('parseFor: expected "in" keyword for loop',t.lineno,t.colno),r.arr=this.parseExpression(),this.advanceAfterBlockEnd(t.value),r.body=this.parseUntilBlocks(i,"else"),this.skipSymbol("else")&&(this.advanceAfterBlockEnd("else"),r.else_=this.parseUntilBlocks(i)),this.advanceAfterBlockEnd(),r},O.parseMacro=function(){var t=this.peekToken();this.skipSymbol("macro")||this.fail("expected macro");var r=this.parsePrimary(!0),i=this.parseSignature(),y=new e.Macro(t.lineno,t.colno,r,i);return this.advanceAfterBlockEnd(t.value),y.body=this.parseUntilBlocks("endmacro"),this.advanceAfterBlockEnd(),y},O.parseCall=function(){var t=this.peekToken();this.skipSymbol("call")||this.fail("expected call");var r=this.parseSignature(!0)||new e.NodeList,i=this.parsePrimary();this.advanceAfterBlockEnd(t.value);var y=this.parseUntilBlocks("endcall");this.advanceAfterBlockEnd();var c=new e.Symbol(t.lineno,t.colno,"caller"),m=new e.Caller(t.lineno,t.colno,c,r,y),n=i.args.children;n[n.length-1]instanceof e.KeywordArgs||n.push(new e.KeywordArgs);var a=n[n.length-1];return a.addChild(new e.Pair(t.lineno,t.colno,c,m)),new e.Output(t.lineno,t.colno,[i])},O.parseWithContext=function(){var t=this.peekToken(),r=null;return this.skipSymbol("with")?r=!0:this.skipSymbol("without")&&(r=!1),r!==null&&(this.skipSymbol("context")||this.fail("parseFrom: expected context after with/without",t.lineno,t.colno)),r},O.parseImport=function(){var t=this.peekToken();this.skipSymbol("import")||this.fail("parseImport: expected import",t.lineno,t.colno);var r=this.parseExpression();this.skipSymbol("as")||this.fail('parseImport: expected "as" keyword',t.lineno,t.colno);var i=this.parseExpression(),y=this.parseWithContext(),c=new e.Import(t.lineno,t.colno,r,i,y);return this.advanceAfterBlockEnd(t.value),c},O.parseFrom=function(){var t=this.peekToken();this.skipSymbol("from")||this.fail("parseFrom: expected from");var r=this.parseExpression();this.skipSymbol("import")||this.fail("parseFrom: expected import",t.lineno,t.colno);for(var i=new e.NodeList,y;;){var c=this.peekToken();if(c.type===f.TOKEN_BLOCK_END){i.children.length||this.fail("parseFrom: Expected at least one import name",t.lineno,t.colno),c.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0),this.nextToken();break}i.children.length>0&&!this.skip(f.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var m=this.parsePrimary();if(m.value.charAt(0)==="_"&&this.fail("parseFrom: names starting with an underscore cannot be imported",m.lineno,m.colno),this.skipSymbol("as")){var n=this.parsePrimary();i.addChild(new e.Pair(m.lineno,m.colno,m,n))}else i.addChild(m);y=this.parseWithContext()}return new e.FromImport(t.lineno,t.colno,r,i,y)},O.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var r=new e.Block(t.lineno,t.colno);r.name=this.parsePrimary(),r.name instanceof e.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),r.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(r.name.value);var i=this.peekToken();return i||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(i.value),r},O.parseExtends=function(){var t="extends",r=this.peekToken();this.skipSymbol(t)||this.fail("parseTemplateRef: expected "+t);var i=new e.Extends(r.lineno,r.colno);return i.template=this.parseExpression(),this.advanceAfterBlockEnd(r.value),i},O.parseInclude=function(){var t="include",r=this.peekToken();this.skipSymbol(t)||this.fail("parseInclude: expected "+t);var i=new e.Include(r.lineno,r.colno);return i.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(i.ignoreMissing=!0),this.advanceAfterBlockEnd(r.value),i},O.parseIf=function(){var t=this.peekToken(),r;this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?r=new e.If(t.lineno,t.colno):this.skipSymbol("ifAsync")?r=new e.IfAsync(t.lineno,t.colno):this.fail("parseIf: expected if, elif, or elseif",t.lineno,t.colno),r.cond=this.parseExpression(),this.advanceAfterBlockEnd(t.value),r.body=this.parseUntilBlocks("elif","elseif","else","endif");var i=this.peekToken();switch(i&&i.value){case"elseif":case"elif":r.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),r.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":r.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return r},O.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var r=new e.Set(t.lineno,t.colno,[]),i;(i=this.parsePrimary())&&(r.targets.push(i),!!this.skip(f.TOKEN_COMMA)););return this.skipValue(f.TOKEN_OPERATOR,"=")?(r.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(f.TOKEN_BLOCK_END)?(r.body=new e.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),r.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),r},O.parseSwitch=function(){var t="switch",r="endswitch",i="case",y="default",c=this.peekToken();!this.skipSymbol(t)&&!this.skipSymbol(i)&&!this.skipSymbol(y)&&this.fail('parseSwitch: expected "switch," "case" or "default"',c.lineno,c.colno);var m=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(i,y,r);var n=this.peekToken(),a=[],u;do{this.skipSymbol(i);var o=this.parseExpression();this.advanceAfterBlockEnd(t);var s=this.parseUntilBlocks(i,y,r);a.push(new e.Case(n.line,n.col,o,s)),n=this.peekToken()}while(n&&n.value===i);switch(n.value){case y:this.advanceAfterBlockEnd(),u=this.parseUntilBlocks(r),this.advanceAfterBlockEnd();break;case r:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new e.Switch(c.lineno,c.colno,m,a,u)},O.parseStatement=function(){var t=this.peekToken(),r;if(t.type!==f.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&L.indexOf(this.breakOnBlocks,t.value)!==-1)return null;switch(t.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 i=0;i<this.extensions.length;i++){var y=this.extensions[i];if(L.indexOf(y.tags||[],t.value)!==-1)return y.parse(this,e,f)}this.fail("unknown block tag: "+t.value,t.lineno,t.colno)}return r},O.parseRaw=function(t){t=t||"raw";for(var r="end"+t,i=new RegExp("([\\s\\S]*?){%\\s*("+t+"|"+r+")\\s*(?=%})%}"),y=1,c="",m=null,n=this.advanceAfterBlockEnd();(m=this.tokens._extractRegex(i))&&y>0;){var a=m[0],u=m[1],o=m[2];o===t?y+=1:o===r&&(y-=1),y===0?(c+=u,this.tokens.backN(a.length-u.length)):c+=a}return new e.Output(n.lineno,n.colno,[new e.TemplateData(n.lineno,n.colno,c)])},O.parsePostfix=function(t){for(var r,i=this.peekToken();i;){if(i.type===f.TOKEN_LEFT_PAREN)t=new e.FunCall(i.lineno,i.colno,t,this.parseSignature());else if(i.type===f.TOKEN_LEFT_BRACKET)r=this.parseAggregate(),r.children.length>1&&this.fail("invalid index"),t=new e.LookupVal(i.lineno,i.colno,t,r.children[0]);else if(i.type===f.TOKEN_OPERATOR&&i.value==="."){this.nextToken();var y=this.nextToken();y.type!==f.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+y.value,y.lineno,y.colno),r=new e.Literal(y.lineno,y.colno,y.value),t=new e.LookupVal(i.lineno,i.colno,t,r)}else break;i=this.peekToken()}return t},O.parseExpression=function(){var t=this.parseInlineIf();return t},O.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var r=this.parseOr(),i=t;t=new e.InlineIf(t.lineno,t.colno),t.body=i,t.cond=r,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},O.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var r=this.parseAnd();t=new e.Or(t.lineno,t.colno,t,r)}return t},O.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var r=this.parseNot();t=new e.And(t.lineno,t.colno,t,r)}return t},O.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new e.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},O.parseIn=function(){for(var t=this.parseIs();;){var r=this.nextToken();if(!r)break;var i=r.type===f.TOKEN_SYMBOL&&r.value==="not";if(i||this.pushToken(r),this.skipSymbol("in")){var y=this.parseIs();t=new e.In(t.lineno,t.colno,t,y),i&&(t=new e.Not(t.lineno,t.colno,t))}else{i&&this.pushToken(r);break}}return t},O.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var r=this.skipSymbol("not"),i=this.parseCompare();t=new e.Is(t.lineno,t.colno,t,i),r&&(t=new e.Not(t.lineno,t.colno,t))}return t},O.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],r=this.parseConcat(),i=[];;){var y=this.nextToken();if(y)if(t.indexOf(y.value)!==-1)i.push(new e.CompareOperand(y.lineno,y.colno,this.parseConcat(),y.value));else{this.pushToken(y);break}else break}return i.length?new e.Compare(i[0].lineno,i[0].colno,r,i):r},O.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(f.TOKEN_TILDE,"~");){var r=this.parseAdd();t=new e.Concat(t.lineno,t.colno,t,r)}return t},O.parseAdd=function(){for(var t=this.parseSub();this.skipValue(f.TOKEN_OPERATOR,"+");){var r=this.parseSub();t=new e.Add(t.lineno,t.colno,t,r)}return t},O.parseSub=function(){for(var t=this.parseMul();this.skipValue(f.TOKEN_OPERATOR,"-");){var r=this.parseMul();t=new e.Sub(t.lineno,t.colno,t,r)}return t},O.parseMul=function(){for(var t=this.parseDiv();this.skipValue(f.TOKEN_OPERATOR,"*");){var r=this.parseDiv();t=new e.Mul(t.lineno,t.colno,t,r)}return t},O.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(f.TOKEN_OPERATOR,"/");){var r=this.parseFloorDiv();t=new e.Div(t.lineno,t.colno,t,r)}return t},O.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(f.TOKEN_OPERATOR,"//");){var r=this.parseMod();t=new e.FloorDiv(t.lineno,t.colno,t,r)}return t},O.parseMod=function(){for(var t=this.parsePow();this.skipValue(f.TOKEN_OPERATOR,"%");){var r=this.parsePow();t=new e.Mod(t.lineno,t.colno,t,r)}return t},O.parsePow=function(){for(var t=this.parseUnary();this.skipValue(f.TOKEN_OPERATOR,"**");){var r=this.parseUnary();t=new e.Pow(t.lineno,t.colno,t,r)}return t},O.parseUnary=function(t){var r=this.peekToken(),i;return this.skipValue(f.TOKEN_OPERATOR,"-")?i=new e.Neg(r.lineno,r.colno,this.parseUnary(!0)):this.skipValue(f.TOKEN_OPERATOR,"+")?i=new e.Pos(r.lineno,r.colno,this.parseUnary(!0)):i=this.parsePrimary(),t||(i=this.parseFilter(i)),i},O.parsePrimary=function(t){var r=this.nextToken(),i,y=null;if(r?r.type===f.TOKEN_STRING?i=r.value:r.type===f.TOKEN_INT?i=parseInt(r.value,10):r.type===f.TOKEN_FLOAT?i=parseFloat(r.value):r.type===f.TOKEN_BOOLEAN?r.value==="true"?i=!0:r.value==="false"?i=!1:this.fail("invalid boolean: "+r.value,r.lineno,r.colno):r.type===f.TOKEN_NONE?i=null:r.type===f.TOKEN_REGEX&&(i=new RegExp(r.value.body,r.value.flags)):this.fail("expected expression, got end of file"),i!==void 0?y=new e.Literal(r.lineno,r.colno,i):r.type===f.TOKEN_SYMBOL?y=new e.Symbol(r.lineno,r.colno,r.value):(this.pushToken(r),y=this.parseAggregate()),t||(y=this.parsePostfix(y)),y)return y;throw this.error("unexpected token: "+r.value,r.lineno,r.colno)},O.parseFilterName=function(){for(var t=this.expect(f.TOKEN_SYMBOL),r=t.value;this.skipValue(f.TOKEN_OPERATOR,".");)r+="."+this.expect(f.TOKEN_SYMBOL).value;return new e.Symbol(t.lineno,t.colno,r)},O.parseFilterArgs=function(t){if(this.peekToken().type===f.TOKEN_LEFT_PAREN){var r=this.parsePostfix(t);return r.args.children}return[]},O.parseFilter=function(t){for(;this.skip(f.TOKEN_PIPE);){var r=this.parseFilterName();t=new e.Filter(r.lineno,r.colno,r,new e.NodeList(r.lineno,r.colno,[t].concat(this.parseFilterArgs(t))))}return t},O.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var r=this.parseFilterName(),i=this.parseFilterArgs(r);this.advanceAfterBlockEnd(t.value);var y=new e.Capture(r.lineno,r.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var c=new e.Filter(r.lineno,r.colno,r,new e.NodeList(r.lineno,r.colno,[y].concat(i)));return new e.Output(r.lineno,r.colno,[c])},O.parseAggregate=function(){var t=this.nextToken(),r;switch(t.type){case f.TOKEN_LEFT_PAREN:r=new e.Group(t.lineno,t.colno);break;case f.TOKEN_LEFT_BRACKET:r=new e.Array(t.lineno,t.colno);break;case f.TOKEN_LEFT_CURLY:r=new e.Dict(t.lineno,t.colno);break;default:return null}for(;;){var i=this.peekToken().type;if(i===f.TOKEN_RIGHT_PAREN||i===f.TOKEN_RIGHT_BRACKET||i===f.TOKEN_RIGHT_CURLY){this.nextToken();break}if(r.children.length>0&&(this.skip(f.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",t.lineno,t.colno)),r instanceof e.Dict){var y=this.parsePrimary();this.skip(f.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",t.lineno,t.colno);var c=this.parseExpression();r.addChild(new e.Pair(y.lineno,y.colno,y,c))}else{var m=this.parseExpression();r.addChild(m)}}return r},O.parseSignature=function(t,r){var i=this.peekToken();if(!r&&i.type!==f.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",i.lineno,i.colno)}i.type===f.TOKEN_LEFT_PAREN&&(i=this.nextToken());for(var y=new e.NodeList(i.lineno,i.colno),c=new e.KeywordArgs(i.lineno,i.colno),m=!1;;){if(i=this.peekToken(),!r&&i.type===f.TOKEN_RIGHT_PAREN){this.nextToken();break}else if(r&&i.type===f.TOKEN_BLOCK_END)break;if(m&&!this.skip(f.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",i.lineno,i.colno);else{var n=this.parseExpression();this.skipValue(f.TOKEN_OPERATOR,"=")?c.addChild(new e.Pair(n.lineno,n.colno,n,this.parseExpression())):y.addChild(n)}m=!0}return c.children.length&&y.addChild(c),y},O.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,r=arguments.length,i=new Array(r),y=0;y<r;y++)i[y]=arguments[y];this.breakOnBlocks=i;var c=this.parse();return this.breakOnBlocks=t,c},O.parseNodes=function(){for(var t,r=[];t=this.nextToken();)if(t.type===f.TOKEN_DATA){var i=t.value,y=this.peekToken(),c=y&&y.value;this.dropLeadingWhitespace&&(i=i.replace(/^\s*/,""),this.dropLeadingWhitespace=!1),y&&(y.type===f.TOKEN_BLOCK_START&&c.charAt(c.length-1)==="-"||y.type===f.TOKEN_VARIABLE_START&&c.charAt(this.tokens.tags.VARIABLE_START.length)==="-"||y.type===f.TOKEN_COMMENT&&c.charAt(this.tokens.tags.COMMENT_START.length)==="-")&&(i=i.replace(/\s*$/,"")),r.push(new e.Output(t.lineno,t.colno,[new e.TemplateData(t.lineno,t.colno,i)]))}else if(t.type===f.TOKEN_BLOCK_START){this.dropLeadingWhitespace=!1;var m=this.parseStatement();if(!m)break;r.push(m)}else if(t.type===f.TOKEN_VARIABLE_START){var n=this.parseExpression();this.dropLeadingWhitespace=!1,this.advanceAfterVariableEnd(),r.push(new e.Output(t.lineno,t.colno,[n]))}else t.type===f.TOKEN_COMMENT?this.dropLeadingWhitespace=t.value.charAt(t.value.length-this.tokens.tags.COMMENT_END.length-1)==="-":this.fail("Unexpected token at top-level: "+t.type,t.lineno,t.colno);return r},O.parse=function(){return new e.NodeList(0,0,this.parseNodes())},O.parseAsRoot=function(){return new e.Root(0,0,this.parseNodes())},$}(_);l.exports={parse:function($,O,F){var t=new U(f.lex($,F));return O!==void 0&&(t.extensions=O),t.parseAsRoot()},Parser:U}},function(l,S,w){var h=w(0),E=`
|
|
17
|
+
\r `,f="()[]{}%*-+~/#,:|.<>=!",e="0123456789",_="{%",L="%}",U="{{",V="}}",$="{#",O="#}",F="string",t="whitespace",r="data",i="block-start",y="block-end",c="variable-start",m="variable-end",n="comment",a="left-paren",u="right-paren",o="left-bracket",s="right-bracket",g="left-curly",d="right-curly",A="operator",B="comma",I="colon",K="tilde",W="pipe",b="int",x="float",R="boolean",M="none",C="symbol",z="special",Z="regex";function ee(Ee,oe,le,q){return{type:Ee,value:oe,lineno:le,colno:q}}var ge=function(){function Ee(le,q){this.str=le,this.index=0,this.len=le.length,this.lineno=0,this.colno=0,this.in_code=!1,q=q||{};var Q=q.tags||{};this.tags={BLOCK_START:Q.blockStart||_,BLOCK_END:Q.blockEnd||L,VARIABLE_START:Q.variableStart||U,VARIABLE_END:Q.variableEnd||V,COMMENT_START:Q.commentStart||$,COMMENT_END:Q.commentEnd||O},this.trimBlocks=!!q.trimBlocks,this.lstripBlocks=!!q.lstripBlocks}var oe=Ee.prototype;return oe.nextToken=function(){var q=this.lineno,Q=this.colno,X;if(this.in_code){var ve=this.current();if(this.isFinished())return null;if(ve==='"'||ve==="'")return ee(F,this._parseString(ve),q,Q);if(X=this._extract(E))return ee(t,X,q,Q);if((X=this._extractString(this.tags.BLOCK_END))||(X=this._extractString("-"+this.tags.BLOCK_END)))return this.in_code=!1,this.trimBlocks&&(ve=this.current(),ve===`
|
|
18
|
+
`?this.forward():ve==="\r"&&(this.forward(),ve=this.current(),ve===`
|
|
19
|
+
`?this.forward():this.back())),ee(y,X,q,Q);if((X=this._extractString(this.tags.VARIABLE_END))||(X=this._extractString("-"+this.tags.VARIABLE_END)))return this.in_code=!1,ee(m,X,q,Q);if(ve==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var Le="";!this.isFinished();)if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}else Le+=this.current(),this.forward();for(var ke=["g","i","m","y"],Fe="";!this.isFinished();){var k=ke.indexOf(this.current())!==-1;if(k)Fe+=this.current(),this.forward();else break}return ee(Z,{body:Le,flags:Fe},q,Q)}else if(f.indexOf(ve)!==-1){this.forward();var D=["==","===","!=","!==","<=",">=","//","**"],te=ve+this.current(),G;switch(h.indexOf(D,te)!==-1&&(this.forward(),ve=te,h.indexOf(D,te+this.current())!==-1&&(ve=te+this.current(),this.forward())),ve){case"(":G=a;break;case")":G=u;break;case"[":G=o;break;case"]":G=s;break;case"{":G=g;break;case"}":G=d;break;case",":G=B;break;case":":G=I;break;case"~":G=K;break;case"|":G=W;break;default:G=A}return ee(G,ve,q,Q)}else if(X=this._extractUntil(E+f),X.match(/^[-+]?[0-9]+$/))if(this.current()==="."){this.forward();var he=this._extract(e);return ee(x,X+"."+he,q,Q)}else return ee(b,X,q,Q);else{if(X.match(/^(true|false)$/))return ee(R,X,q,Q);if(X==="none")return ee(M,X,q,Q);if(X==="null")return ee(M,X,q,Q);if(X)return ee(C,X,q,Q);throw new Error("Unexpected value while parsing: "+X)}}else{var de=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((X=this._extractString(this.tags.BLOCK_START+"-"))||(X=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,ee(i,X,q,Q);if((X=this._extractString(this.tags.VARIABLE_START+"-"))||(X=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,ee(c,X,q,Q);X="";var Ae,ye=!1;for(this._matches(this.tags.COMMENT_START)&&(ye=!0,X=this._extractString(this.tags.COMMENT_START));(Ae=this._extractUntil(de))!==null;)if(X+=Ae,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!ye){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=X.length){var Pe=X.slice(-this.colno);if(/^\s+$/.test(Pe)&&(X=X.slice(0,-this.colno),!X.length))return this.nextToken()}break}else if(this._matches(this.tags.COMMENT_END)){if(!ye)throw new Error("unexpected end of comment");X+=this._extractString(this.tags.COMMENT_END);break}else X+=this.current(),this.forward();if(Ae===null&&ye)throw new Error("expected end of comment, got end of file");return ee(ye?n:r,X,q,Q)}},oe._parseString=function(q){this.forward();for(var Q="";!this.isFinished()&&this.current()!==q;){var X=this.current();if(X==="\\"){switch(this.forward(),this.current()){case"n":Q+=`
|
|
20
|
+
`;break;case"t":Q+=" ";break;case"r":Q+="\r";break;default:Q+=this.current()}this.forward()}else Q+=X,this.forward()}return this.forward(),Q},oe._matches=function(q){if(this.index+q.length>this.len)return null;var Q=this.str.slice(this.index,this.index+q.length);return Q===q},oe._extractString=function(q){return this._matches(q)?(this.forwardN(q.length),q):null},oe._extractUntil=function(q){return this._extractMatching(!0,q||"")},oe._extract=function(q){return this._extractMatching(!1,q)},oe._extractMatching=function(q,Q){if(this.isFinished())return null;var X=Q.indexOf(this.current());if(q&&X===-1||!q&&X!==-1){var ve=this.current();this.forward();for(var Le=Q.indexOf(this.current());(q&&Le===-1||!q&&Le!==-1)&&!this.isFinished();)ve+=this.current(),this.forward(),Le=Q.indexOf(this.current());return ve}return""},oe._extractRegex=function(q){var Q=this.currentStr().match(q);return Q?(this.forwardN(Q[0].length),Q):null},oe.isFinished=function(){return this.index>=this.len},oe.forwardN=function(q){for(var Q=0;Q<q;Q++)this.forward()},oe.forward=function(){this.index++,this.previous()===`
|
|
21
|
+
`?(this.lineno++,this.colno=0):this.colno++},oe.backN=function(q){for(var Q=0;Q<q;Q++)this.back()},oe.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--},oe.current=function(){return this.isFinished()?"":this.str.charAt(this.index)},oe.currentStr=function(){return this.isFinished()?"":this.str.substr(this.index)},oe.previous=function(){return this.str.charAt(this.index-1)},Ee}();l.exports={lex:function(oe,le){return new ge(oe,le)},TOKEN_STRING:F,TOKEN_WHITESPACE:t,TOKEN_DATA:r,TOKEN_BLOCK_START:i,TOKEN_BLOCK_END:y,TOKEN_VARIABLE_START:c,TOKEN_VARIABLE_END:m,TOKEN_COMMENT:n,TOKEN_LEFT_PAREN:a,TOKEN_RIGHT_PAREN:u,TOKEN_LEFT_BRACKET:o,TOKEN_RIGHT_BRACKET:s,TOKEN_LEFT_CURLY:g,TOKEN_RIGHT_CURLY:d,TOKEN_OPERATOR:A,TOKEN_COMMA:B,TOKEN_COLON:I,TOKEN_TILDE:K,TOKEN_PIPE:W,TOKEN_INT:b,TOKEN_FLOAT:x,TOKEN_BOOLEAN:R,TOKEN_NONE:M,TOKEN_SYMBOL:C,TOKEN_SPECIAL:z,TOKEN_REGEX:Z}},function(l,S,w){function h(U,V){U.prototype=Object.create(V.prototype),U.prototype.constructor=U,E(U,V)}function E(U,V){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,F){return O.__proto__=F,O},E(U,V)}var f=w(6),e=w(19),_=e.PrecompiledLoader,L=function(U){h(V,U);function V(O,F){var t;return t=U.call(this)||this,t.baseURL=O||".",F=F||{},t.useCache=!!F.useCache,t.async=!!F.async,t}var $=V.prototype;return $.resolve=function(F,t){throw new Error("relative templates not support in the browser yet")},$.getSource=function(F,t){var r=this,i=this.useCache,y;return this.fetch(this.baseURL+"/"+F,function(c,m){if(c)if(t)t(c.content);else if(c.status===404)y=null;else throw c.content;else y={src:m,path:F,noCache:!i},r.emit("load",F,y),t&&t(null,y)}),y},$.fetch=function(F,t){if(typeof window>"u")throw new Error("WebLoader can only by used in a browser");var r=new XMLHttpRequest,i=!0;r.onreadystatechange=function(){r.readyState===4&&i&&(i=!1,r.status===0||r.status===200?t(null,r.responseText):t({status:r.status,content:r.responseText}))},F+=(F.indexOf("?")===-1?"?":"&")+"s="+new Date().getTime(),r.open("GET",F,this.async),r.send()},V}(f);l.exports={WebLoader:L,PrecompiledLoader:_}},function(l,S,w){var h=w(0),E=w(7),f=E.Environment,e=E.Template,_=w(6),L=w(10),U=w(23),V=w(5),$=w(8),O=w(9),F=w(2),t=w(3),r=w(25),i;function y(c,m){m=m||{},h.isObject(c)&&(m=c,c=null);var n;return L.FileSystemLoader?n=new L.FileSystemLoader(c,{watch:m.watch,noCache:m.noCache}):L.WebLoader&&(n=new L.WebLoader(c,{useCache:m.web&&m.web.useCache,async:m.web&&m.web.async})),i=new f(n,m),m&&m.express&&i.express(m.express),i}l.exports={Environment:f,Template:e,Loader:_,FileSystemLoader:L.FileSystemLoader,NodeResolveLoader:L.NodeResolveLoader,PrecompiledLoader:L.PrecompiledLoader,WebLoader:L.WebLoader,compiler:V,parser:$,lexer:O,runtime:F,lib:h,nodes:t,installJinjaCompat:r,configure:y,reset:function(){i=void 0},compile:function(m,n,a,u){return i||y(),new e(m,n,a,u)},render:function(m,n,a){return i||y(),i.render(m,n,a)},renderString:function(m,n,a){return i||y(),i.renderString(m,n,a)},precompile:U?U.precompile:void 0,precompileString:U?U.precompileString:void 0}},function(l,S,w){var h=w(13),E=[],f=[],e=h.makeRequestCallFromTimer(_);function _(){if(f.length)throw f.shift()}l.exports=L;function L(V){var $;E.length?$=E.pop():$=new U,$.task=V,h($)}function U(){this.task=null}U.prototype.call=function(){try{this.task.call()}catch(V){L.onerror?L.onerror(V):(f.push(V),e())}finally{this.task=null,E[E.length]=this}}},function(l,S,w){(function(h){l.exports=E;function E(t){f.length||e(),f[f.length]=t}var f=[],e,_=0,L=1024;function U(){for(;_<f.length;){var t=_;if(_=_+1,f[t].call(),_>L){for(var r=0,i=f.length-_;r<i;r++)f[r]=f[r+_];f.length-=_,_=0}}f.length=0,_=0}var V=typeof h<"u"?h:self,$=V.MutationObserver||V.WebKitMutationObserver;typeof $=="function"?e=O(U):e=F(U),E.requestFlush=e;function O(t){var r=1,i=new $(t),y=document.createTextNode("");return i.observe(y,{characterData:!0}),function(){r=-r,y.data=r}}function F(t){return function(){var i=setTimeout(c,0),y=setInterval(c,50);function c(){clearTimeout(i),clearInterval(y),t()}}}E.makeRequestCallFromTimer=F}).call(S,w(14))},function(l,S){var w;w=function(){return this}();try{w=w||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(w=window)}l.exports=w},function(l,S,w){var h,E;(function(f){var e=function(){var $=Array.prototype.slice.call(arguments);typeof $[0]=="function"&&$[0].apply(null,$.splice(1))},_=function($){typeof setImmediate=="function"?setImmediate($):typeof process<"u"&&process.nextTick?process.nextTick($):setTimeout($,0)},L=function($){var O=function(F){var t=function(){return $.length&&$[F].apply(null,arguments),t.next()};return t.next=function(){return F<$.length-1?O(F+1):null},t};return O(0)},U=Array.isArray||function($){return Object.prototype.toString.call($)==="[object Array]"},V=function($,O,F){var t=F?_:e;if(O=O||function(){},!U($)){var r=new Error("First argument to waterfall must be an array of functions");return O(r)}if(!$.length)return O();var i=function(y){return function(c){if(c)O.apply(null,arguments),O=function(){};else{var m=Array.prototype.slice.call(arguments,1),n=y.next();n?m.push(i(n)):m.push(O),t(function(){y.apply(null,m)})}}};i(L($))()};h=[],E=(function(){return V}).apply(S,h),E!==void 0&&(l.exports=E)})()},function(l,S,w){var h=typeof Reflect=="object"?Reflect:null,E=h&&typeof h.apply=="function"?h.apply:function(s,g,d){return Function.prototype.apply.call(s,g,d)},f;h&&typeof h.ownKeys=="function"?f=h.ownKeys:Object.getOwnPropertySymbols?f=function(s){return Object.getOwnPropertyNames(s).concat(Object.getOwnPropertySymbols(s))}:f=function(s){return Object.getOwnPropertyNames(s)};function e(o){console&&console.warn&&console.warn(o)}var _=Number.isNaN||function(s){return s!==s};function L(){L.init.call(this)}l.exports=L,l.exports.once=n,L.EventEmitter=L,L.prototype._events=void 0,L.prototype._eventsCount=0,L.prototype._maxListeners=void 0;var U=10;function V(o){if(typeof o!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof o)}Object.defineProperty(L,"defaultMaxListeners",{enumerable:!0,get:function(){return U},set:function(o){if(typeof o!="number"||o<0||_(o))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+o+".");U=o}}),L.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},L.prototype.setMaxListeners=function(s){if(typeof s!="number"||s<0||_(s))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+s+".");return this._maxListeners=s,this};function $(o){return o._maxListeners===void 0?L.defaultMaxListeners:o._maxListeners}L.prototype.getMaxListeners=function(){return $(this)},L.prototype.emit=function(s){for(var g=[],d=1;d<arguments.length;d++)g.push(arguments[d]);var A=s==="error",B=this._events;if(B!==void 0)A=A&&B.error===void 0;else if(!A)return!1;if(A){var I;if(g.length>0&&(I=g[0]),I instanceof Error)throw I;var K=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw K.context=I,K}var W=B[s];if(W===void 0)return!1;if(typeof W=="function")E(W,this,g);else for(var b=W.length,x=y(W,b),d=0;d<b;++d)E(x[d],this,g);return!0};function O(o,s,g,d){var A,B,I;if(V(g),B=o._events,B===void 0?(B=o._events=Object.create(null),o._eventsCount=0):(B.newListener!==void 0&&(o.emit("newListener",s,g.listener?g.listener:g),B=o._events),I=B[s]),I===void 0)I=B[s]=g,++o._eventsCount;else if(typeof I=="function"?I=B[s]=d?[g,I]:[I,g]:d?I.unshift(g):I.push(g),A=$(o),A>0&&I.length>A&&!I.warned){I.warned=!0;var K=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(s)+" listeners added. Use emitter.setMaxListeners() to increase limit");K.name="MaxListenersExceededWarning",K.emitter=o,K.type=s,K.count=I.length,e(K)}return o}L.prototype.addListener=function(s,g){return O(this,s,g,!1)},L.prototype.on=L.prototype.addListener,L.prototype.prependListener=function(s,g){return O(this,s,g,!0)};function F(){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 t(o,s,g){var d={fired:!1,wrapFn:void 0,target:o,type:s,listener:g},A=F.bind(d);return A.listener=g,d.wrapFn=A,A}L.prototype.once=function(s,g){return V(g),this.on(s,t(this,s,g)),this},L.prototype.prependOnceListener=function(s,g){return V(g),this.prependListener(s,t(this,s,g)),this},L.prototype.removeListener=function(s,g){var d,A,B,I,K;if(V(g),A=this._events,A===void 0)return this;if(d=A[s],d===void 0)return this;if(d===g||d.listener===g)--this._eventsCount===0?this._events=Object.create(null):(delete A[s],A.removeListener&&this.emit("removeListener",s,d.listener||g));else if(typeof d!="function"){for(B=-1,I=d.length-1;I>=0;I--)if(d[I]===g||d[I].listener===g){K=d[I].listener,B=I;break}if(B<0)return this;B===0?d.shift():c(d,B),d.length===1&&(A[s]=d[0]),A.removeListener!==void 0&&this.emit("removeListener",s,K||g)}return this},L.prototype.off=L.prototype.removeListener,L.prototype.removeAllListeners=function(s){var g,d,A;if(d=this._events,d===void 0)return this;if(d.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):d[s]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete d[s]),this;if(arguments.length===0){var B=Object.keys(d),I;for(A=0;A<B.length;++A)I=B[A],I!=="removeListener"&&this.removeAllListeners(I);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(g=d[s],typeof g=="function")this.removeListener(s,g);else if(g!==void 0)for(A=g.length-1;A>=0;A--)this.removeListener(s,g[A]);return this};function r(o,s,g){var d=o._events;if(d===void 0)return[];var A=d[s];return A===void 0?[]:typeof A=="function"?g?[A.listener||A]:[A]:g?m(A):y(A,A.length)}L.prototype.listeners=function(s){return r(this,s,!0)},L.prototype.rawListeners=function(s){return r(this,s,!1)},L.listenerCount=function(o,s){return typeof o.listenerCount=="function"?o.listenerCount(s):i.call(o,s)},L.prototype.listenerCount=i;function i(o){var s=this._events;if(s!==void 0){var g=s[o];if(typeof g=="function")return 1;if(g!==void 0)return g.length}return 0}L.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]};function y(o,s){for(var g=new Array(s),d=0;d<s;++d)g[d]=o[d];return g}function c(o,s){for(;s+1<o.length;s++)o[s]=o[s+1];o.pop()}function m(o){for(var s=new Array(o.length),g=0;g<s.length;++g)s[g]=o[g].listener||o[g];return s}function n(o,s){return new Promise(function(g,d){function A(I){o.removeListener(s,B),d(I)}function B(){typeof o.removeListener=="function"&&o.removeListener("error",A),g([].slice.call(arguments))}u(o,s,B,{once:!0}),s!=="error"&&a(o,A,{once:!0})})}function a(o,s,g){typeof o.on=="function"&&u(o,"error",s,g)}function u(o,s,g,d){if(typeof o.on=="function")d.once?o.once(s,g):o.on(s,g);else if(typeof o.addEventListener=="function")o.addEventListener(s,function A(B){d.once&&o.removeEventListener(s,A),g(B)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof o)}},function(l,S,w){var h=w(3),E=w(0),f=0;function e(){return"hole_"+f++}function _(i,y){for(var c=null,m=0;m<i.length;m++){var n=y(i[m]);n!==i[m]&&(c||(c=i.slice()),c[m]=n)}return c||i}function L(i,y,c){if(!(i instanceof h.Node))return i;if(!c){var m=y(i);if(m&&m!==i)return m}if(i instanceof h.NodeList){var n=_(i.children,function(g){return L(g,y,c)});n!==i.children&&(i=new h[i.typename](i.lineno,i.colno,n))}else if(i instanceof h.CallExtension){var a=L(i.args,y,c),u=_(i.contentArgs,function(g){return L(g,y,c)});(a!==i.args||u!==i.contentArgs)&&(i=new h[i.typename](i.extName,i.prop,a,u))}else{var o=i.fields.map(function(g){return i[g]}),s=_(o,function(g){return L(g,y,c)});s!==o&&(i=new h[i.typename](i.lineno,i.colno),s.forEach(function(g,d){i[i.fields[d]]=g}))}return c&&y(i)||i}function U(i,y){return L(i,y,!0)}function V(i,y,c){var m=[],n=U(c?i[c]:i,function(a){var u;return a instanceof h.Block?a:((a instanceof h.Filter&&E.indexOf(y,a.name.value)!==-1||a instanceof h.CallExtensionAsync)&&(u=new h.Symbol(a.lineno,a.colno,e()),m.push(new h.FilterAsync(a.lineno,a.colno,a.name,a.args,u))),u)});return c?i[c]=n:i=n,m.length?(m.push(i),new h.NodeList(i.lineno,i.colno,m)):i}function $(i,y){return U(i,function(c){return c instanceof h.Output?V(c,y):c instanceof h.Set?V(c,y,"value"):c instanceof h.For?V(c,y,"arr"):c instanceof h.If?V(c,y,"cond"):c instanceof h.CallExtension?V(c,y,"args"):void 0})}function O(i){return L(i,function(y){if(y instanceof h.Block){var c=!1,m=e();y.body=L(y.body,function(n){if(n instanceof h.FunCall&&n.name.value==="super")return c=!0,new h.Symbol(n.lineno,n.colno,m)}),c&&y.body.children.unshift(new h.Super(0,0,y.name,new h.Symbol(0,0,m)))}})}function F(i){return U(i,function(y){if(!(!(y instanceof h.If)&&!(y instanceof h.For))){var c=!1;if(L(y,function(m){if(m instanceof h.FilterAsync||m instanceof h.IfAsync||m instanceof h.AsyncEach||m instanceof h.AsyncAll||m instanceof h.CallExtensionAsync)return c=!0,m}),c){if(y instanceof h.If)return new h.IfAsync(y.lineno,y.colno,y.cond,y.body,y.else_);if(y instanceof h.For&&!(y instanceof h.AsyncAll))return new h.AsyncEach(y.lineno,y.colno,y.arr,y.name,y.body,y.else_)}}})}function t(i,y){return F(O($(i,y)))}function r(i,y){return t(i,y||[])}l.exports={transform:r}},function(l,f,w){var h=w(0),E=w(2),f=l.exports={};function e(k,D){return k==null||k===!1?D:k}f.abs=Math.abs;function _(k){return k!==k}function L(k,D,te){var G,he=[],de=[];for(G=0;G<k.length;G++)G%D===0&&de.length&&(he.push(de),de=[]),de.push(k[G]);if(de.length){if(te)for(G=de.length;G<D;G++)de.push(te);he.push(de)}return he}f.batch=L;function U(k){k=e(k,"");var D=k.toLowerCase();return E.copySafeness(k,D.charAt(0).toUpperCase()+D.slice(1))}f.capitalize=U;function V(k,D){if(k=e(k,""),D=D||80,k.length>=D)return k;var te=D-k.length,G=h.repeat(" ",te/2-te%2),he=h.repeat(" ",te/2);return E.copySafeness(k,G+k+he)}f.center=V;function $(k,D,te){return te?k||D:k!==void 0?k:D}f.default=$;function O(k,D,te){if(!h.isObject(k))throw new h.TemplateError("dictsort filter: val must be an object");var G=[];for(var he in k)G.push([he,k[he]]);var de;if(te===void 0||te==="key")de=0;else if(te==="value")de=1;else throw new h.TemplateError("dictsort filter: You can only sort by either key or value");return G.sort(function(Ae,ye){var Pe=Ae[de],Xe=ye[de];return D||(h.isString(Pe)&&(Pe=Pe.toUpperCase()),h.isString(Xe)&&(Xe=Xe.toUpperCase())),Pe>Xe?1:Pe===Xe?0:-1}),G}f.dictsort=O;function F(k,D){return JSON.stringify(k,null,D)}f.dump=F;function t(k){return k instanceof E.SafeString?k:(k=k??"",E.markSafe(h.escape(k.toString())))}f.escape=t;function r(k){return k instanceof E.SafeString?k:(k=k??"",E.markSafe(k.toString()))}f.safe=r;function i(k){return k[0]}f.first=i;function y(k){return k=k??"",E.markSafe(h.escape(k.toString()))}f.forceescape=y;function c(k,D){return h.groupBy(k,D,this.env.opts.throwOnUndefined)}f.groupby=c;function m(k,D,te){if(k=e(k,""),k==="")return"";D=D||4;var G=k.split(`
|
|
24
|
+
`),he=h.repeat(" ",D),de=G.map(function(Ae,ye){return ye===0&&!te?Ae:""+he+Ae}).join(`
|
|
25
|
+
`);return E.copySafeness(k,de)}f.indent=m;function n(k,D,te){return D=D||"",te&&(k=h.map(k,function(G){return G[te]})),k.join(D)}f.join=n;function a(k){return k[k.length-1]}f.last=a;function u(k){var D=e(k,"");return D!==void 0?typeof Map=="function"&&D instanceof Map||typeof Set=="function"&&D instanceof Set?D.size:h.isObject(D)&&!(D instanceof E.SafeString)?h.keys(D).length:D.length:0}f.length=u;function o(k){if(h.isString(k))return k.split("");if(h.isObject(k))return h._entries(k||{}).map(function(D){var te=D[0],G=D[1];return{key:te,value:G}});if(h.isArray(k))return k;throw new h.TemplateError("list filter: type not iterable")}f.list=o;function s(k){return k=e(k,""),k.toLowerCase()}f.lower=s;function g(k){return k==null?"":E.copySafeness(k,k.replace(/\r\n|\n/g,`<br />
|
|
26
|
+
`))}f.nl2br=g;function d(k){return k[Math.floor(Math.random()*k.length)]}f.random=d;function A(k){function D(te,G,he){G===void 0&&(G="truthy");var de=this,Ae=de.env.getTest(G);return h.toArray(te).filter(function(Pe){return Ae.call(de,Pe,he)===k})}return D}f.reject=A(!1);function B(k,D){return k.filter(function(te){return!te[D]})}f.rejectattr=B,f.select=A(!0);function I(k,D){return k.filter(function(te){return!!te[D]})}f.selectattr=I;function K(k,D,te,G){var he=k;if(D instanceof RegExp)return k.replace(D,te);typeof G>"u"&&(G=-1);var de="";if(typeof D=="number")D=""+D;else if(typeof D!="string")return k;if(typeof k=="number"&&(k=""+k),typeof k!="string"&&!(k instanceof E.SafeString))return k;if(D==="")return de=te+k.split("").join(te)+te,E.copySafeness(k,de);var Ae=k.indexOf(D);if(G===0||Ae===-1)return k;for(var ye=0,Pe=0;Ae>-1&&(G===-1||Pe<G);)de+=k.substring(ye,Ae)+te,ye=Ae+D.length,Pe++,Ae=k.indexOf(D,ye);return ye<k.length&&(de+=k.substring(ye)),E.copySafeness(he,de)}f.replace=K;function W(k){var D;return h.isString(k)?D=o(k):D=h.map(k,function(te){return te}),D.reverse(),h.isString(k)?E.copySafeness(k,D.join("")):D}f.reverse=W;function b(k,D,te){D=D||0;var G=Math.pow(10,D),he;return te==="ceil"?he=Math.ceil:te==="floor"?he=Math.floor:he=Math.round,he(k*G)/G}f.round=b;function x(k,D,te){for(var G=Math.floor(k.length/D),he=k.length%D,de=[],Ae=0,ye=0;ye<D;ye++){var Pe=Ae+ye*G;ye<he&&Ae++;var Xe=Ae+(ye+1)*G,et=k.slice(Pe,Xe);te&&ye>=he&&et.push(te),de.push(et)}return de}f.slice=x;function R(k,D,te){return te===void 0&&(te=0),D&&(k=h.map(k,function(G){return G[D]})),te+k.reduce(function(G,he){return G+he},0)}f.sum=R,f.sort=E.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(D,te,G,he){var de=this,Ae=h.map(D,function(Pe){return Pe}),ye=h.getAttrGetter(he);return Ae.sort(function(Pe,Xe){var et=he?ye(Pe):Pe,Ge=he?ye(Xe):Xe;if(de.env.opts.throwOnUndefined&&he&&(et===void 0||Ge===void 0))throw new TypeError('sort: attribute "'+he+'" resolved to undefined');return!G&&h.isString(et)&&h.isString(Ge)&&(et=et.toLowerCase(),Ge=Ge.toLowerCase()),et<Ge?te?1:-1:et>Ge?te?-1:1:0}),Ae});function M(k){return E.copySafeness(k,k)}f.string=M;function C(k,D){k=e(k,"");var te=/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,G=Z(k.replace(te,"")),he="";return D?he=G.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,`
|
|
27
|
+
`).replace(/\n\n\n+/g,`
|
|
28
|
+
|
|
29
|
+
`):he=G.replace(/\s+/gi," "),E.copySafeness(k,he)}f.striptags=C;function z(k){k=e(k,"");var D=k.split(" ").map(function(te){return U(te)});return E.copySafeness(k,D.join(" "))}f.title=z;function Z(k){return E.copySafeness(k,k.replace(/^\s*|\s*$/g,""))}f.trim=Z;function ee(k,D,te,G){var he=k;if(k=e(k,""),D=D||255,k.length<=D)return k;if(te)k=k.substring(0,D);else{var de=k.lastIndexOf(" ",D);de===-1&&(de=D),k=k.substring(0,de)}return k+=G??"...",E.copySafeness(he,k)}f.truncate=ee;function ge(k){return k=e(k,""),k.toUpperCase()}f.upper=ge;function Ee(k){var D=encodeURIComponent;if(h.isString(k))return D(k);var te=h.isArray(k)?k:h._entries(k);return te.map(function(G){var he=G[0],de=G[1];return D(he)+"="+D(de)}).join("&")}f.urlencode=Ee;var oe=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,le=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,q=/^https?:\/\/.*$/,Q=/^www\./,X=/\.(?:org|net|com)(?:\:|\/|$)/;function ve(k,D,te){_(D)&&(D=1/0);var G=te===!0?' rel="nofollow"':"",he=k.split(/(\s+)/).filter(function(de){return de&&de.length}).map(function(de){var Ae=de.match(oe),ye=Ae?Ae[1]:de,Pe=ye.substr(0,D);return q.test(ye)?'<a href="'+ye+'"'+G+">"+Pe+"</a>":Q.test(ye)?'<a href="http://'+ye+'"'+G+">"+Pe+"</a>":le.test(ye)?'<a href="mailto:'+ye+'">'+ye+"</a>":X.test(ye)?'<a href="http://'+ye+'"'+G+">"+Pe+"</a>":de});return he.join("")}f.urlize=ve;function Le(k){k=e(k,"");var D=k?k.match(/\w+/g):null;return D?D.length:null}f.wordcount=Le;function ke(k,D){var te=parseFloat(k);return _(te)?D:te}f.float=ke;var Fe=E.makeMacro(["value","default","base"],[],function(D,te,G){G===void 0&&(G=10);var he=parseInt(D,G);return _(he)?te:he});f.int=Fe,f.d=f.default,f.e=f.escape},function(l,S,w){function h(_,L){_.prototype=Object.create(L.prototype),_.prototype.constructor=_,E(_,L)}function E(_,L){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(V,$){return V.__proto__=$,V},E(_,L)}var f=w(6),e=function(_){h(L,_);function L(V){var $;return $=_.call(this)||this,$.precompiled=V||{},$}var U=L.prototype;return U.getSource=function($){return this.precompiled[$]?{src:{type:"code",obj:this.precompiled[$]},path:$}:null},L}(f);l.exports={PrecompiledLoader:e}},function(l,S,w){var h=w(2).SafeString;function E(d){return typeof d=="function"}S.callable=E;function f(d){return d!==void 0}S.defined=f;function e(d,A){return d%A===0}S.divisibleby=e;function _(d){return d instanceof h}S.escaped=_;function L(d,A){return d===A}S.equalto=L,S.eq=S.equalto,S.sameas=S.equalto;function U(d){return d%2===0}S.even=U;function V(d){return!d}S.falsy=V;function $(d,A){return d>=A}S.ge=$;function O(d,A){return d>A}S.greaterthan=O,S.gt=S.greaterthan;function F(d,A){return d<=A}S.le=F;function t(d,A){return d<A}S.lessthan=t,S.lt=S.lessthan;function r(d){return d.toLowerCase()===d}S.lower=r;function i(d,A){return d!==A}S.ne=i;function y(d){return d===null}S.null=y;function c(d){return typeof d=="number"}S.number=c;function m(d){return d%2===1}S.odd=m;function n(d){return typeof d=="string"}S.string=n;function a(d){return!!d}S.truthy=a;function u(d){return d===void 0}S.undefined=u;function o(d){return d.toUpperCase()===d}S.upper=o;function s(d){return typeof Symbol<"u"?!!d[Symbol.iterator]:Array.isArray(d)||typeof d=="string"}S.iterable=s;function g(d){var A=d!=null&&typeof d=="object"&&!Array.isArray(d);return Set?A&&!(d instanceof Set):A}S.mapping=g},function(l,S,w){function h(e){var _=-1;return{current:null,reset:function(){_=-1,this.current=null},next:function(){return _++,_>=e.length&&(_=0),this.current=e[_],this.current}}}function E(e){e=e||",";var _=!0;return function(){var L=_?"":e;return _=!1,L}}function f(){return{range:function(_,L,U){typeof L>"u"?(L=_,_=0,U=1):U||(U=1);var V=[];if(U>0)for(var $=_;$<L;$+=U)V.push($);else for(var O=_;O>L;O+=U)V.push(O);return V},cycler:function(){return h(Array.prototype.slice.call(arguments))},joiner:function(_){return E(_)}}}l.exports=f},function(l,S,w){var h=w(4);l.exports=function(f,e){function _(L,U){if(this.name=L,this.path=L,this.defaultEngine=U.defaultEngine,this.ext=h.extname(L),!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 _.prototype.render=function(U,V){f.render(this.name,U,V)},e.set("view",_),e.set("nunjucksEnv",f),f}},function(l,S,w){var h=w(4),E=w(4),f=w(0),e=f._prettifyError,_=w(5),L=w(7),U=L.Environment,V=w(24);function $(r,i){return Array.isArray(i)?i.some(function(y){return r.match(y)}):!1}function O(r,i){i=i||{},i.isString=!0;var y=i.env||new U([]),c=i.wrapper||V;if(!i.name)throw new Error('the "name" option is required when compiling a string');return c([t(r,i.name,y)],i)}function F(r,i){i=i||{};var y=i.env||new U([]),c=i.wrapper||V;if(i.isString)return O(r,i);var m=h.existsSync(r)&&h.statSync(r),n=[],a=[];function u(g){h.readdirSync(g).forEach(function(d){var A=E.join(g,d),B=A.substr(E.join(r,"/").length),I=h.statSync(A);I&&I.isDirectory()?(B+="/",$(B,i.exclude)||u(A)):$(B,i.include)&&a.push(A)})}if(m.isFile())n.push(t(h.readFileSync(r,"utf-8"),i.name||r,y));else if(m.isDirectory()){u(r);for(var o=0;o<a.length;o++){var s=a[o].replace(E.join(r,"/"),"");try{n.push(t(h.readFileSync(a[o],"utf-8"),s,y))}catch(g){if(i.force)console.error(g);else throw g}}}return c(n,i)}function t(r,i,y){y=y||new U([]);var c=y.asyncFilters,m=y.extensionsList,n;i=i.replace(/\\/g,"/");try{n=_.compile(r,c,m,i,y.opts)}catch(a){throw e(i,!1,a)}return{name:i,template:n}}l.exports={precompile:F,precompileString:O}},function(l,S,w){function h(E,f){var e="";f=f||{};for(var _=0;_<E.length;_++){var L=JSON.stringify(E[_].name),U=E[_].template;e+="(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["+L+`] = (function() {
|
|
30
|
+
`+U+`
|
|
31
|
+
})();
|
|
32
|
+
`,f.asFunction&&(e+="return function(ctx, cb) { return nunjucks.render("+L+`, ctx, cb); }
|
|
33
|
+
`),e+=`})();
|
|
34
|
+
`}return e}l.exports=h},function(l,S,w){function h(){var E=this.runtime,f=this.lib,e=this.compiler.Compiler,_=this.parser.Parser,L=this.nodes,U=this.lexer,V=E.contextOrFrameLookup,$=E.memberLookup,O,F;e&&(O=e.prototype.assertType),_&&(F=_.prototype.parseAggregate);function t(){E.contextOrFrameLookup=V,E.memberLookup=$,e&&(e.prototype.assertType=O),_&&(_.prototype.parseAggregate=F)}E.contextOrFrameLookup=function(u,o,s){var g=V.apply(this,arguments);if(g!==void 0)return g;switch(s){case"True":return!0;case"False":return!1;case"None":return null;default:return}};function r(a){return{index:a.index,lineno:a.lineno,colno:a.colno}}if(L&&e&&_){var i=L.Node.extend("Slice",{fields:["start","stop","step"],init:function(u,o,s,g,d){s=s||new L.Literal(u,o,null),g=g||new L.Literal(u,o,null),d=d||new L.Literal(u,o,1),this.parent(u,o,s,g,d)}});e.prototype.assertType=function(u){u instanceof i||O.apply(this,arguments)},e.prototype.compileSlice=function(u,o){this._emit("("),this._compileExpression(u.start,o),this._emit("),("),this._compileExpression(u.stop,o),this._emit("),("),this._compileExpression(u.step,o),this._emit(")")},_.prototype.parseAggregate=function(){var u=this,o=r(this.tokens);o.colno--,o.index--;try{return F.apply(this)}catch(W){var s=r(this.tokens),g=function(){return f._assign(u.tokens,s),W};f._assign(this.tokens,o),this.peeked=!1;var d=this.peekToken();if(d.type!==U.TOKEN_LEFT_BRACKET)throw g();this.nextToken();for(var A=new i(d.lineno,d.colno),B=!1,I=0;I<=A.fields.length&&!this.skip(U.TOKEN_RIGHT_BRACKET);I++){if(I===A.fields.length)if(B)this.fail("parseSlice: too many slice components",d.lineno,d.colno);else break;if(this.skip(U.TOKEN_COLON))B=!0;else{var K=A.fields[I];A[K]=this.parseExpression(),B=this.skip(U.TOKEN_COLON)||B}}if(!B)throw g();return new L.Array(d.lineno,d.colno,[A])}}}function y(a,u,o,s){a=a||[],u===null&&(u=s<0?a.length-1:0),o===null?o=s<0?-1:a.length:o<0&&(o+=a.length),u<0&&(u+=a.length);for(var g=[],d=u;!(d<0||d>a.length||s>0&&d>=o||s<0&&d<=o);d+=s)g.push(E.memberLookup(a,d));return g}function c(a,u){return Object.prototype.hasOwnProperty.call(a,u)}var m={pop:function(u){if(u===void 0)return this.pop();if(u>=this.length||u<0)throw new Error("KeyError");return this.splice(u,1)},append:function(u){return this.push(u)},remove:function(u){for(var o=0;o<this.length;o++)if(this[o]===u)return this.splice(o,1);throw new Error("ValueError")},count:function(u){for(var o=0,s=0;s<this.length;s++)this[s]===u&&o++;return o},index:function(u){var o;if((o=this.indexOf(u))===-1)throw new Error("ValueError");return o},find:function(u){return this.indexOf(u)},insert:function(u,o){return this.splice(u,0,o)}},n={items:function(){return f._entries(this)},values:function(){return f._values(this)},keys:function(){return f.keys(this)},get:function(u,o){var s=this[u];return s===void 0&&(s=o),s},has_key:function(u){return c(this,u)},pop:function(u,o){var s=this[u];if(s===void 0&&o!==void 0)s=o;else{if(s===void 0)throw new Error("KeyError");delete this[u]}return s},popitem:function(){var u=f.keys(this);if(!u.length)throw new Error("KeyError");var o=u[0],s=this[o];return delete this[o],[o,s]},setdefault:function(u,o){return o===void 0&&(o=null),u in this||(this[u]=o),this[u]},update:function(u){return f._assign(this,u),null}};return n.iteritems=n.items,n.itervalues=n.values,n.iterkeys=n.keys,E.memberLookup=function(u,o,s){return arguments.length===4?y.apply(this,arguments):(u=u||{},f.isArray(u)&&c(m,o)?m[o].bind(u):f.isObject(u)&&c(n,o)?n[o].bind(u):$.apply(this,arguments))},t}l.exports=h}])})})(qn);var wi=qn.exports;const Mt=Gr(wi);var bi=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>'),Ei=me('<div class="flex justify-end"><!></div>'),ki=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 Cn(N,T){bt(T,!0);let l=Re(null),S,w=ct(T,"readOnly",3,!1),h=ct(T,"readOnlyMessage",3,""),E=ct(T,"bottomPadding",3,0),f=ct(T,"showPreviewToggle",3,!0),e=ct(T,"preview",3,null),_=!1,L=null,U=null,V=!1,$=null,O=[],F=null,t=null,r=0,i=null;const y=24;let c=Re(!1);const m=_e(()=>e()!==null?e():v(c)),n=_e(()=>`editorState/prompt/${T.agentId}/${T.stepName}`),a=_e(()=>`editorState/prompt/${T.agentId}/${T.stepName}/preview`),u=_e(()=>v(m)?v(a):v(n));function o(M,C){const z=M.getLayoutInfo(),Z=Number((z==null?void 0:z.contentWidth)??0);if(!Number.isFinite(Z)||Z<=0)return 80;const ee=M.getOption(C.editor.EditorOption.fontInfo),ge=Number(ee==null?void 0:ee.typicalHalfwidthCharacterWidth)||Number(ee==null?void 0:ee.typicalFullwidthCharacterWidth)||7;if(!Number.isFinite(ge)||ge<=0)return 80;const Ee=Math.floor((Z-y)/ge);return Math.max(20,Ee)}function s(){!v(l)||!U||t==null&&(t=requestAnimationFrame(()=>{if(t=null,!v(l)||!U)return;const M=o(v(l),U);M!==r&&(r=M,v(l).updateOptions({wordWrap:"bounded",wordWrapColumn:M}))}))}function g(){Qt(v(u),v(l))}function d(M,C){const z=Kr(C);if(!z)return;const Z=M.getContribution("editor.contrib.folding");if(Z!=null&&Z.getFoldingModel)Z.getFoldingModel().then(()=>{try{M.restoreViewState(z)}catch{}});else try{M.restoreViewState(z)}catch{}}function A(){i!=null&&clearTimeout(i),i=setTimeout(()=>{i=null,g()},180)}en(()=>{if(!S)return;Un();let M=!1;return Vn(()=>import("../chunks/DLQqXQ6R.js").then(C=>C.e),__vite__mapDeps([0,1,2]),import.meta.url).then(C=>{if(M)return;U=C,Wn(C),O.push(C.languages.registerFoldingRangeProvider("markdown",fi)),O.push(C.languages.registerFoldingRangeProvider("markdown",pi)),O.push(C.languages.registerDocumentHighlightProvider("markdown",gi)),re(l,C.editor.create(S,{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},selectionHighlight:!1,unicodeHighlight:{ambiguousCharacters:!1,nonBasicASCII:!1,invisibleCharacters:!1,includeStrings:!1,includeComments:!1},autoClosingQuotes:"never",padding:{top:32,bottom:E()},readOnly:w(),readOnlyMessage:h()?{value:h()}:void 0}),!0),$=v(l).getModel(),s(),O.push(v(l).onDidLayoutChange(()=>s())),O.push(v(l).onDidChangeModelDecorations(()=>A())),O.push(v(l).onDidScrollChange(()=>A())),O.push(v(l).onDidChangeCursorPosition(()=>A())),O.push(v(l).onDidBlurEditorText(()=>g())),rt.agents.context.query({agentId:T.agentId}).then(Z=>{M||(F==null||F.dispose(),F=ni(C,Z),O.push(F))}),L=Vr(C,v(l));const z=T.initialPrompt??"";if(_=!0,v(l).setValue(z),_=!1,requestAnimationFrame(()=>{L==null||L.update(),v(l)&&d(v(l),v(u))}),O.push(v(l).onDidChangeModelContent(()=>{if(v(l)&&(L==null||L.update(),!_)){A();try{const Z=v(l).getValue();T.onPromptChanged(Z)}catch(Z){console.error("Error updating prompt",Z)}}})),V=!0,T.onEditorReady)try{T.onEditorReady(v(l),C)}catch(Z){console.error("PromptEditor onEditorReady error",Z)}}).catch(C=>{console.error("Error initializing Monaco editor:",C)}),()=>{M=!0,t!=null&&cancelAnimationFrame(t),t=null,i!=null&&clearTimeout(i),i=null,g(),F=null;for(const z of O)try{z.dispose()}catch{}O=[],L==null||L.dispose(),L=null;const C=$;if($=null,v(l)){try{v(l).setModel(null)}catch{}v(l).dispose(),re(l,null)}try{C==null||C.dispose()}catch{}}}),Je(()=>{!v(l)||!V||v(l).updateOptions({readOnly:w(),readOnlyMessage:h()?{value:h()}:void 0,padding:{top:32,bottom:E()}})}),Je(()=>{const M=T.initialPrompt??"";if(!(!v(l)||!V||v(m)&&!w())&&v(l).getValue()!==M){_=!0;try{v(l).setValue(M),L==null||L.update()}finally{_=!1}}});function B(M,C){return Mt.configure({autoescape:!1,trimBlocks:!0,lstripBlocks:!0}),Mt.renderString(M,C||{})}let I="",K=0;function W(M){var C;if(e()!==null){(C=T.onPreviewChange)==null||C.call(T,M);return}re(c,M,!0)}function b(){if(K+=1,!!v(l)){Qt(v(a),v(l)),_=!0;try{I&&(v(l).setValue(I),I=""),v(l).updateOptions({readOnly:w()})}finally{_=!1}d(v(l),v(n))}}async function x(){if(!v(l)||w())return;Qt(v(n),v(l)),I=v(l).getValue();const M=K+=1;let C=null;try{C=await rt.agents.context.query({agentId:T.agentId})}catch(Z){console.error("Failed to load agent context for preview:",Z),C=null}if(M!==K||!v(l)||!v(m))return;const z=B(I,C||{});_=!0;try{v(l).setValue(z),v(l).updateOptions({readOnly:!0})}finally{_=!1}d(v(l),v(a))}let R=Re(!1);Je(()=>{if(!v(l)||!V)return;const M=!!v(m)&&!w();M!==v(R)&&(re(R,M,!0),M?x():b())}),Lt(N,{get class(){return`relative overflow-hidden ${T.class??""}`},children:(M,C)=>{var z=ki(),Z=ie(z),ee=ie(Z);tn(ee,q=>S=q,()=>S);var ge=pe(ee,2);{var Ee=q=>{var Q=bi(),X=ie(Q);jn(X),De(2),ne(Q),Ke(()=>Tr(X,v(m))),Ft("change",X,ve=>W(ve.currentTarget.checked)),J(q,Q)};Me(ge,q=>{f()&&!w()&&q(Ee)})}ne(Z);var oe=pe(Z,2);{var le=q=>{var Q=Ei(),X=ie(Q);Ye(X,{variant:"secondary",get onclick(){return T.onSchemaClick},class:"absolute bottom-2 right-6 !font-medium",children:(ve,Le)=>{De();var ke=$e("Schema");J(ve,ke)},$$slots:{default:!0}}),ne(Q),J(q,Q)};Me(oe,q=>{T.showSchemaButton&&T.onSchemaClick&&q(le)})}ne(z),J(M,z)}}),Et()}Zt(["change"]);var Si=me("<!> <!>",1),Oi=me('<div class="flex h-full items-center justify-center text-sm text-rc-gray-300">Loading</div>'),Pn=me('<pre class="whitespace-pre-wrap font-mono text-xs text-rc-gray-200"> </pre>'),Li=me('<div class="flex h-full flex-col gap-3"><div class="text-sm text-red-400"> </div></div>'),Ti=me('<div class="text-red-400">Error</div>'),Ai=me('<div class="rounded-md border border-rc-gray-700 bg-rc-gray-900/40 px-3 py-2"><div class="flex items-center justify-between text-xs text-rc-gray-400"><div> </div> <!></div> <div class="whitespace-pre-wrap break-words text-sm text-rc-gray-100"> </div></div>'),Ci=me('<div class="mb-4"><div class="mb-2 text-xs font-semibold text-rc-gray-400">Why this response</div> <div class="flex flex-col gap-2"></div></div>'),Pi=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>'),Ni=me('<div class="flex flex-col gap-2"></div>'),Ri=me('<div class="text-sm text-rc-gray-300">No quotes returned.</div>'),Ii=me('<div class="mb-3 text-sm font-semibold text-rc-gray-100"> </div> <!> <!>',1),Fi=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>'),Mi=me('<div class="mt-3 flex flex-col gap-2"></div>'),Bi=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>'),Ki=me('<div class="flex flex-col gap-3"></div>'),Di=me('<div class="text-sm text-rc-gray-300">No issues found.</div>'),ji=me('<div class="mb-3 text-sm font-semibold text-rc-gray-100"> </div> <!>',1),$i=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 Vi(N,T){bt(T,!0);const{state:l,actions:S}=$n();let w=Re("results"),h=Re(null);Je(()=>{var L;const _=((L=l.edit.popover)==null?void 0:L.requestId)??null;_!==v(h)&&(re(h,_,!0),re(w,"results"))});var E=Rt(),f=Ue(E);{var e=_=>{const L=_e(()=>l.edit.popover);var U=$i(),V=Ue(U),$=ie(V);Jt($,{get value(){return v(w)},ariaLabel:"Popover tabs",onChange:({value:y})=>re(w,y,!0),children:(y,c)=>{var m=Si(),n=Ue(m);yt(n,{value:"results",children:(u,o)=>{De();var s=$e("Results");J(u,s)},$$slots:{default:!0}});var a=pe(n,2);yt(a,{value:"raw",children:(u,o)=>{De();var s=$e("Raw");J(u,s)},$$slots:{default:!0}}),J(y,m)},$$slots:{default:!0}}),ne(V);var O=pe(V,2),F=ie(O);{var t=y=>{var c=Oi();J(y,c)},r=y=>{var c=Rt(),m=Ue(c);{var n=u=>{const o=_e(()=>{var d;return typeof((d=v(L).data)==null?void 0:d.raw)=="string"?v(L).data.raw:v(L).error});var s=Pn(),g=ie(s,!0);ne(s),Ke(()=>Ie(g,v(o)||"—")),J(u,s)},a=u=>{var o=Li(),s=ie(o),g=ie(s,!0);ne(s),ne(o),Ke(()=>Ie(g,v(L).error)),J(u,o)};Me(m,u=>{v(w)==="raw"?u(n):u(a,-1)})}J(y,c)},i=y=>{const c=_e(()=>v(L).data);var m=Rt(),n=Ue(m);{var a=s=>{var g=Pn(),d=ie(g,!0);ne(g),Ke(()=>{var A;return Ie(d,typeof((A=v(c))==null?void 0:A.raw)=="string"?v(c).raw:"—")}),J(s,g)},u=s=>{const g=_e(()=>{var C;return typeof((C=v(c))==null?void 0:C.parallelCalls)=="number"&&Number.isFinite(v(c).parallelCalls)?v(c).parallelCalls:10});var d=Ii(),A=Ue(d),B=ie(A,!0);ne(A);var I=pe(A,2);{var K=C=>{var z=Ci(),Z=pe(ie(z),2);_t(Z,23,()=>v(c).rationales,(ee,ge)=>ee.attempt??ge,(ee,ge,Ee)=>{var oe=Ai(),le=ie(oe),q=ie(le),Q=ie(q);ne(q);var X=pe(q,2);{var ve=Fe=>{var k=Ti();J(Fe,k)};Me(X,Fe=>{v(ge).status==="error"&&Fe(ve)})}ne(le);var Le=pe(le,2),ke=ie(Le,!0);ne(Le),ne(oe),Ke(()=>{Ie(Q,`Analysis ${v(ge).attempt??v(Ee)+1??""}`),Ie(ke,v(ge).text)}),J(ee,oe)}),ne(Z),ne(z),J(C,z)},W=_e(()=>{var C;return Array.isArray((C=v(c))==null?void 0:C.rationales)&&v(c).rationales.length>0});Me(I,C=>{v(W)&&C(K)})}var b=pe(I,2);{var x=C=>{var z=Ni();_t(z,23,()=>v(c).quotes,Z=>Z.quote,(Z,ee,ge)=>{var Ee=Pi(),oe=ie(Ee),le=ie(oe),q=ie(le);ne(le);var Q=pe(le,2),X=ie(Q);ne(Q),ne(oe);var ve=pe(oe,2),Le=ie(ve,!0);ne(ve),ne(Ee),Ke(()=>{Ie(q,`Quote ${v(ge)+1}`),Ie(X,`x${v(ee).count??""}/${v(g)??""}`),Ie(Le,v(ee).quote)}),Ft("click",Ee,()=>S.focusQuote(v(ee).quote)),J(Z,Ee)}),ne(z),J(C,z)},R=_e(()=>{var C;return Array.isArray((C=v(c))==null?void 0:C.quotes)&&v(c).quotes.length>0}),M=C=>{var z=Ri();J(C,z)};Me(b,C=>{v(R)?C(x):C(M,-1)})}Ke(()=>{var C;return Ie(B,((C=v(c))==null?void 0:C.title)??"Analysis")}),J(s,d)},o=s=>{var g=ji(),d=Ue(g),A=ie(d,!0);ne(d);var B=pe(d,2);{var I=b=>{var x=Ki();_t(x,21,()=>v(c).issues,It,(R,M,C)=>{var z=Bi(),Z=ie(z),ee=ie(Z);ee.textContent=`Issue ${C+1}`;var ge=pe(ee,2),Ee=ie(ge,!0);ne(ge),ne(Z);var oe=pe(Z,2),le=ie(oe,!0);ne(oe);var q=pe(oe,2);{var Q=X=>{var ve=Mi();_t(ve,20,()=>v(M).contradictingQuotes,Le=>Le,(Le,ke)=>{var Fe=Fi(),k=ie(Fe),D=ie(k,!0);ne(k),ne(Fe),Ke(()=>Ie(D,ke)),Ft("click",Fe,()=>S.focusQuote(ke)),J(Le,Fe)}),ne(ve),J(X,ve)};Me(q,X=>{v(M).contradictingQuotes&&v(M).contradictingQuotes.length>0&&X(Q)})}ne(z),Ke(()=>{Ie(Ee,v(M).type),Ie(le,v(M).reason)}),J(R,z)}),ne(x),J(b,x)},K=_e(()=>{var b;return Array.isArray((b=v(c))==null?void 0:b.issues)&&v(c).issues.length>0}),W=b=>{var x=Di();J(b,x)};Me(B,b=>{v(K)?b(I):b(W,-1)})}Ke(()=>{var b;return Ie(A,((b=v(c))==null?void 0:b.title)??"Prompt issues")}),J(s,g)};Me(n,s=>{v(w)==="raw"?s(a):v(L).kind==="analyze"?s(u,1):s(o,-1)})}J(y,m)};Me(F,y=>{v(L).status==="loading"?y(t):v(L).status==="error"?y(r,1):y(i,-1)})}ne(O),J(_,U)};Me(f,_=>{l.edit.popover&&_(e)})}J(N,E),Et()}Zt(["click"]);var Ui=me('<div class="min-h-0 flex-1 overflow-hidden p-3"><!></div>');function Wi(N,T){bt(T,!1);const l=$n(),S=wr(l.state),w=l.actions;function h(e){br(S,v(S).context=e),w.sendAppEvent({type:"context-updated",context:e})}Hr();var E=Ui(),f=ie(E);{let e=Er(()=>{var _;return`editorState/context/${v(S).agentId}/${((_=v(S).currentStep)==null?void 0:_.name)??"main"}`});Dr(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 v(S).context},onContextChanged:h,get editorStateKey(){return v(e)},suppressErrors:!0})}ne(E),J(N,E),Et()}function Hi(N){try{return decodeURIComponent(N)}catch{return N}}function zn(N){var h;const l=(((h=String(N||"").split("?")[0])==null?void 0:h.split("#")[0])??"").split("/").filter(Boolean);if(l[0]!=="edit")return{agentId:null,tab:null};if(l.length===1)return{agentId:null,tab:null};const S=Hi(l[1]??""),w=l[2]??null;return w?w==="roleplay"?{agentId:S,tab:"roleplay"}:w==="tests"?{agentId:S,tab:"tests"}:w==="configure"?{agentId:S,tab:"configure"}:{agentId:S,tab:null}:{agentId:S,tab:"roleplay"}}function qi(N){return{tab:zn(N.pathname).tab??"roleplay",popover:null,highlights:null,requestSeq:0}}function zi(N,T){const S=zn(T.pathname).tab??"roleplay";return{...N,tab:S,popover:null,highlights:null}}function Gi(N,T){const l=N.requestSeq+1;return{...N,requestSeq:l,popover:{kind:T.kind,status:"loading",requestId:l},highlights:null}}function Qi(N,T){return!N.popover||N.popover.requestId!==T.requestId?N:{...N,popover:{...N.popover,status:"ready",data:T.data,error:void 0}}}function Yi(N,T){return!N.popover||N.popover.requestId!==T.requestId?N:{...N,popover:{...N.popover,status:"error",error:String(T.error||"Unknown error"),data:T.data}}}function Ji(N){return{...N,popover:null,highlights:null}}function Xi(N,T){return{...N,highlights:{quotes:T??[],focusQuote:null,focusNonce:0}}}function Zi(N,T){const l=String(T||"");if(!l)return N;const S=N.highlights??{quotes:[],focusQuote:null,focusNonce:0};return{...N,highlights:{...S,focusQuote:l,focusNonce:(S.focusNonce??0)+1}}}function eo(N,T){const l=String(N??""),S=to(T),w=In(l);for(const h of S){const E=Nn(l,h);if(E.length>0)return E;const f=Rn(l,h);if(f.length>0)return f;const e=In(h);if(w!==l||e!==h){const _=Nn(w,e);if(_.length>0)return _;const L=Rn(w,e);if(L.length>0)return L}}return[]}function Nn(N,T){const l=String(T??"");if(!l)return[];const S=[];let w=0;for(;w<=N.length-l.length;){const h=N.indexOf(l,w);if(h===-1)break;S.push({start:h,end:h+l.length}),w=h+1}return S}function Rn(N,T){const l=String(T??"");if(!l.trim())return[];const S=no(l).replace(/\s+/g,"\\s+");let w;try{w=new RegExp(`(?=(${S}))`,"gu")}catch{return[]}const h=[];let E;for(;(E=w.exec(N))!==null;){const f=E.index,e=E[1]??"",_=f+e.length;_>f&&h.push({start:f,end:_}),w.lastIndex===f&&(w.lastIndex+=1)}return h}function to(N){const T=String(N??""),l=T.trim(),S=new Set;for(const E of[T,l])E&&S.add(E);const w=l.replace(/^[-*•]\s+/,"");w&&w!==l&&S.add(w);const h=l.replace(/^(?:\(?\d+\)?[.)]|[a-zA-Z][.)])\s+/,"");return h&&h!==l&&S.add(h),[...S].filter(E=>E.trim().length>0)}function In(N){return String(N??"").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 no(N){return N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fn(N,T){const l=N.createDecorationsCollection(),S=N.createDecorationsCollection();let w=null,h=new Map,E=new Map,f=0;function e(){h=new Map,E=new Map,f=0}function _(t,r,i){return Number.isNaN(t)?r:Math.max(r,Math.min(i,t))}function L(t){const r=_(t,1,10);return`rgba(220, 38, 38, ${_(.22+r*.06,.28,.82)})`}function U(t,r){const i=String(t??"");if(!i)return[];const y=h.get(i);if(y)return y;const c=eo(r,i);return h.set(i,c),c}function V(t){const r=N.getModel();if(!r)return;const i=r.getValue()??"",y=[],c=[...t||[]].sort((m,n)=>(m.count||0)-(n.count||0));for(const m of c){const n=String(m.quote||"");if(!n)continue;const a=_(Number(m.count||0),1,10),u=L(a),o=U(n,i);for(const s of o){const g=r.getPositionAt(s.start),d=r.getPositionAt(s.end);y.push({range:new T.Range(g.lineNumber,g.column,d.lineNumber,d.column),options:{inlineClassName:`analysis-quote analysis-quote-l${a}`,overviewRuler:{color:u,position:T.editor.OverviewRulerLane.Center}}})}}l.set(y)}function $(t){const r=N.getModel();if(!r)return;const i=r.getValue()??"",y=U(t,i);if(y.length===0)return;const m=((E.get(t)??-1)+1)%y.length;E.set(t,m);const n=y[m],a=r.getPositionAt(n.start),u=r.getPositionAt(n.end),o=new T.Range(a.lineNumber,a.column,u.lineNumber,u.column);S.set([{range:o,options:{inlineClassName:"analysis-quote-focus"}}]),N.setSelection(o),N.revealRangeInCenter(o,T.editor.ScrollType.Smooth),N.focus()}function O(t){if(w=t,!w){l.clear(),S.clear(),e();return}V(w.quotes||[]),w.focusQuote&&w.focusNonce!==f?(f=w.focusNonce,$(w.focusQuote)):w.focusQuote||S.clear()}const F=N.onDidChangeModelContent(()=>{w&&(h=new Map,S.clear(),V(w.quotes||[]))});return{setHighlights:O,dispose:()=>{try{F.dispose(),l.clear(),S.clear()}finally{w=null,e()}}}}var Mn=me("<!> <!>",1),Bn=me('<span class="truncate"> </span> <!>',1),ro=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="Variant"></div>'),io=me('<span class="text-sm text-rc-gray-300">Variant</span> <div><!> <!></div>',1),oo=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>'),ao=me('<span class="text-sm text-rc-gray-300">Region</span> <div><!> <!></div>',1),so=me('<div class="p-2 text-rc-gray-400">Connecting…</div>'),lo=me('<div class="p-2 text-rc-gray-400">No steps</div>'),co=me('<button><span class="block truncate"> </span></button>'),uo=me('<div class="rc-scroll min-h-0 flex-1 overflow-auto p-2"><!></div>'),fo=me('<span class="max-w-64 text-sm text-red-300"> </span>'),po=me('<div class="absolute inset-0 z-10 min-w-0"><!> <div class="absolute bottom-2 left-3 z-20 flex items-center gap-2"><!> <!> <!></div> <!></div>'),ho=me('<div class="relative h-full min-w-0"><!> <!></div>'),Kn=me("<!> <!> <!>",1),vo=me('<div class="border-b border-rc-gray-700 p-2"><!></div> <div class="min-h-0 flex-1"><!></div> <!> <!>',1),mo=me('<div class="text-sm text-red-300"> </div>'),go=me('<div class="flex flex-col gap-2"><label for="ai-edit-request" class="font-semibold text-rc-gray-100">What do you want to change?</label> <!> <!></div>'),yo=me('<div class="min-w-0 truncate whitespace-nowrap text-base text-rc-gray-300"> </div>'),_o=me('<p class="text-rc-gray-200">Try changing your request and suggest edits again.</p>'),xo=me('<span class="text-rc-red-500 mr-auto text-sm"> </span>'),wo=me('<span class="mr-auto text-sm text-rc-gray-300"> </span>'),bo=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 ea(N,T){bt(T,!0);const{onError:l}=Wr();let S=Re(wn([]));const w=p=>{try{return p?decodeURIComponent(p):""}catch{return p||""}},h=p=>encodeURIComponent(p);function E(p){return w(p).trim().replace(/^\/+|\/+$/g,"")}const f=_e(()=>E(T.params.agent)),e=wn({agentId:E(T.params.agent),region:null,availableRegions:[],defaultRegion:null,variant:null,experimentVariants:[],experimentHasDefault:!1,agentType:void 0,wsLoaded:!1,chatReady:!1,steps:[],currentStep:null,promptDrafts:{},promptEdits:{},context:null,promptContext:null,agentStates:[],currentState:null,contextPopoverOpen:!1,edit:qi({pathname:Qe.url.pathname})});let _=null,L=null,U=null,V;const $="region-dropdown";let O=Re(!1),F=Re(null);const t="variant-dropdown";let r=Re(!1),i=Re(null);const y=_e(()=>[...e.experimentHasDefault?[null]:[],...e.experimentVariants]);Je(()=>{const p=e.availableRegions,P=e.region;(!p.length||!P||!p.includes(P))&&re(O,!1)});function c(p,P){if(typeof window>"u")return;const j=new URL(window.location.href);P===null?j.searchParams.delete(p):j.searchParams.set(p,P),jr(j.toString(),{})}function m(p){gt.sendMessage({channel:"app-events",event:p})}function n(p){p!=null&&p.name&&e.promptDrafts[p.name]===void 0&&(e.promptDrafts[p.name]=p.prompt??"")}const a=_e(()=>{var p;return((p=e.currentStep)==null?void 0:p.name)??null}),u=(p,P,j)=>`${p}\0${j??""}\0${P}`,o=_e(()=>{const p=v(a);return p?e.promptEdits[u(e.agentId,p,e.variant)]??null:null}),s=_e(()=>{const p=v(a);if(!p)return"";const P=e.promptDrafts[p];return typeof P=="string"?P:""}),g=_e(()=>{var p;return((p=v(o))==null?void 0:p.suggestedPrompt)??v(s)});function d(p=e.agentId){const P={},j=p===e.agentId?e.variant:null;for(const H of Object.values(e.promptEdits))H.agentId===p&&(H.variantId??null)===j&&(P[H.step]=H.suggestedPrompt);return P}function A(){e.wsLoaded&&m({type:"prompt-overrides-updated",prompts:d()})}function B(p,P){if(!P)return null;const j=p===e.agentId?e.variant:null;return e.promptEdits[u(p,P,j)]??null}let I=null,K=null,W=Promise.resolve();const b=800;function x(){I&&(clearTimeout(I),I=null)}async function R(p,P,j,H){try{await rt.agents.savePrompt.mutate({agentId:p,step:P,prompt:j,variant:H})}catch(ae){console.error("Failed to save prompt",ae);const Y=e.promptDrafts[P];throw e.agentId===p&&e.variant===H&&Y===j&&(K={stepName:P,prompt:j,variant:H}),ae}}function M(p,P,j,H){const ae=W.catch(()=>{}).then(()=>R(p,P,j,H));return W=ae.catch(()=>{}),ae}async function C(){if(!K)return;const p=e.agentId.trim();if(!p)return;const{stepName:P,prompt:j,variant:H}=K;x(),K=null,await M(p,P,j,H)}function z(p,P){K={stepName:p,prompt:P,variant:e.variant},x(),I=setTimeout(()=>{I=null,C()},b)}Je(()=>{e.wsLoaded&&C()});async function Z(p){try{const P=await rt.regionConfig.meta.query({agent:p});if(!P){e.availableRegions=[],e.defaultRegion=null,e.region=null,c("region",null),ee(void 0);return}if(ee(P.experiment),e.availableRegions=P.availableRegions,e.defaultRegion=P.defaultRegion??null,!Array.isArray(P.availableRegions)||P.availableRegions.length===0){e.region=null,c("region",null);return}const j=(Qe.url.searchParams.get("region")||"").trim()||null,H=j&&P.availableRegions.includes(j)&&j||P.defaultRegion&&P.availableRegions.includes(P.defaultRegion)&&P.defaultRegion||P.availableRegions[0]||null;e.region=H,c("region",H)}catch(P){console.error("Failed to load region config meta",P),e.availableRegions=[],e.defaultRegion=null,e.region=null,c("region",null),ee(void 0)}}function ee(p){e.experimentVariants=p?Object.keys(p.variants):[],e.experimentHasDefault=!!(p!=null&&p.default);const P=(Qe.url.searchParams.get("variant")||"").trim()||null,j=P&&e.experimentVariants.includes(P)?P:e.experimentHasDefault?null:e.experimentVariants[0]??null;e.variant=j,c("variant",j)}Je(()=>{const p=v(f);p&&p!==U&&(U=p,Z(p))});function ge(p){var j;C(),ht();const P=e.steps.find(H=>H.name===p)||null;e.currentStep=P,P?(n(P),c("step",P.name),m({type:"step-selected",step:P.name}),c("promptEdit",((j=B(e.agentId,P.name))==null?void 0:j.id)??null)):c("step",null)}function Ee(p){const P=v(a);P&&(e.promptDrafts[P]=p,z(P,p))}let oe=Re(!1),le=Re(""),q=Re(!1),Q=Re(null);function X(p){return(p||"").replace(/[*_`]/g,"").replace(/(^|\s)#{1,6}\s+/g," ").replace(/\s+/g," ").trim()||"Thinking..."}const ve=_e(()=>{var p;return X((p=v(Q))==null?void 0:p.summary)});let Le=Re(null),ke=Re(null),Fe=Re(!1),k=Re(!1),D=0,te=!1;const G=new Set;Je(()=>{const p=v(oe);te&&!p&&v(q)&&(D+=1,re(q,!1)),te=p});function he(p=""){!e.currentStep||v(o)||(re(le,p,!0),re(Le,null),re(k,!1),re(oe,!0))}function de(){D+=1,re(q,!1),re(oe,!1),re(k,!1)}async function Ae(p,P){for(;P===D&&v(q);){try{const j=await rt.agents.promptEditProgress.query({id:p});if(P!==D||!v(q))return;j&&re(Q,{phase:j.phase,activity:j.activity,summary:j.summary},!0)}catch(j){P===D&&console.warn("Failed to read prompt edit progress",j)}await new Promise(j=>setTimeout(j,400))}}async function ye(){const p=v(le).trim(),P=v(a),j=e.agentId.trim();if(!p||!P||!j||v(q))return;const H=++D,ae=crypto.randomUUID();re(q,!0),re(Q,null),re(Le,null),Ae(ae,H);try{await C();const Y=await rt.agents.suggestPromptEdit.mutate({agentId:j,step:P,variant:e.variant,request:p,progressId:ae});if(H!==D)return;if(Y.status==="unchanged"){re(k,!0);return}const fe=Y.proposal;e.promptEdits[u(fe.agentId,fe.step,fe.variantId)]=fe,c("promptEdit",fe.id),re(oe,!1),re(vt,!1),A()}catch(Y){if(H!==D)return;console.error("Failed to suggest prompt edits",Y),re(Le,Y instanceof Error?Y.message:"Failed to suggest edits",!0)}finally{H===D&&(re(q,!1),re(Q,null))}}function Pe(p){for(const[P,j]of Object.entries(e.promptEdits))j.id===p&&delete e.promptEdits[P];Qe.url.searchParams.get("promptEdit")===p&&c("promptEdit",null)}function Xe(){const p=v(o);!p||v(Fe)||(tt(),re(ke,null),Pe(p.id),A(),rt.agents.rejectPromptEdit.mutate({id:p.id}).catch(P=>{console.error("Failed to release rejected prompt edit",P)}))}async function et(){var Y;const p=v(o);if(!p||v(Fe))return;const P=Ct??Kt,j=(P==null?void 0:P.saveViewState())??null,H=((Y=P==null?void 0:P.getVisibleRanges()[0])==null?void 0:Y.startLineNumber)??null,ae=H&&P?P.getTopForLineNumber(H)-P.getScrollTop():0;tt(),re(Fe,!0),re(ke,null);try{const fe=await rt.agents.acceptPromptEdit.mutate({id:p.id});if(e.promptDrafts[p.step]=fe.prompt,e.steps=e.steps.map(se=>se.name===p.step?{...se,prompt:fe.prompt}:se),e.currentStep=e.steps.find(se=>se.name===v(a))??e.currentStep,await bn(),Pe(p.id),A(),await bn(),j&&St){const se=St;requestAnimationFrame(()=>{if(St===se)try{se.restoreViewState(j),H&&se.setScrollTop(se.getTopForLineNumber(H)-ae)}catch(xe){console.warn("Failed to preserve accepted prompt scroll position",xe)}})}}catch(fe){console.error("Failed to accept prompt edit",fe),re(ke,fe instanceof Error?fe.message:"Failed to save prompt",!0)}finally{re(Fe,!1)}}Je(()=>{const p=(Qe.url.searchParams.get("promptEdit")||"").trim();!p||G.has(p)||(G.add(p),rt.agents.promptEditProposal.query({id:p}).then(P=>{!P||P.agentId!==e.agentId||(e.promptEdits[u(P.agentId,P.step,P.variantId)]=P,A())}).catch(P=>console.error("Failed to restore prompt edit",P)))});const Ge=_e(()=>{var p;return((p=e.currentStep)==null?void 0:p.schema)??null}),Tt=_e(()=>!!v(Ge)&&v(Ge).trim().length>0);let xt=Re(!1),ut=Re(""),dt=Re(!1),it=Re(null),ft=Re(null);const ot=_e(()=>v(ut)!==(v(Ge)??""));function pt(){v(Ge)&&(re(ut,v(Ge),!0),re(it,null),re(ft,null),re(xt,!0))}function ce(p){re(ut,p,!0),re(it,null),re(ft,null)}async function ue(){var j;const p=(j=e.currentStep)==null?void 0:j.name,P=e.agentId.trim();if(!(!p||!P||!v(ot)||v(dt))){re(dt,!0),re(it,null),re(ft,null);try{await C();const H=await rt.agents.saveSchema.mutate({agentId:P,step:p,variant:e.variant,schema:v(ut)});e.steps=e.steps.map(ae=>ae.name===p?{...ae,schema:v(ut)}:ae),e.currentStep=e.steps.find(ae=>ae.name===p)??e.currentStep,re(ft,H.restartScheduled?"Saved. Reloading the project…":"Saved. Restart Bosun to use this schema in tests.",!0),H.restartScheduled&&setTimeout(()=>window.location.reload(),1200)}catch(H){console.error("Failed to save schema",H),re(it,H instanceof Error?H.message:"Failed to save schema",!0)}finally{re(dt,!1)}}}function Se({value:p}){if(p===e.edit.tab)return;C(),ht();const P=Qe.url.searchParams.get("step"),j=Qe.url.searchParams.get("region"),H=Qe.url.searchParams.get("variant"),ae=`/edit/${h(e.agentId)}/${p}`,Y=new URLSearchParams;P&&Y.set("step",P),j&&Y.set("region",j),H&&Y.set("variant",H),v(o)&&Y.set("promptEdit",v(o).id);const fe=Y.size?`${ae}?${Y.toString()}`:ae;Ot(fe)}const we=_e(()=>{const p=Qe.url.pathname.split("/")[1];return p==="traces"?"view":p});function Oe({value:p}){if(p!==v(we)){if(C(),ht(),p==="edit")return Ot("/edit");if(p==="view"){const P=new URLSearchParams({agent:e.agentId});return e.region&&P.set("region",e.region),e.variant&&P.set("variant",e.variant),Ot(`/view?${P.toString()}`)}Ot("/"+p)}}function Be(p){var P;return e.contextPopoverOpen=!1,e.edit=Gi(e.edit,{kind:p}),((P=e.edit.popover)==null?void 0:P.requestId)??0}function We(p,P){e.edit=Qi(e.edit,{requestId:p,data:P})}function at(p,P,j){e.edit=Yi(e.edit,{requestId:p,error:P,data:j})}function tt(){e.edit=Ji(e.edit)}function At(){tt(),e.contextPopoverOpen=!0}function lt(){e.contextPopoverOpen=!1}function Bt(){e.contextPopoverOpen?lt():At()}function ht(){tt(),lt()}function kt(p){return p==="analyze"?"Analyze":"Find issues"}function nn(p){e.edit=Xi(e.edit,p)}function Gn(p){e.edit=Zi(e.edit,p)}let nt=null,qe=null,St=null,Ct=null,Kt=null,vt=Re(!1),rn=null;function on(p){try{return Mt.configure({autoescape:!1,trimBlocks:!0,lstripBlocks:!0}),Mt.renderString(p,e.promptContext??e.context??{})}catch(P){return console.error("Failed to render prompt preview",P),p}}const Qn=_e(()=>{const p=v(o);return p?v(vt)?on(p.originalPrompt):p.originalPrompt:""}),Yn=_e(()=>{const p=v(o);return p?v(vt)?on(p.suggestedPrompt):p.suggestedPrompt:""});Je(()=>{var P;const p=((P=e.currentStep)==null?void 0:P.name)??null;p!==rn&&(rn=p,re(vt,!1))});function Jn(p,P){St=p,nt==null||nt.dispose(),nt=Fn(p,P),nt.setHighlights(e.edit.highlights)}function Xn(p,P){Ct=p,qe==null||qe.dispose(),qe=Fn(p,P),qe.setHighlights(e.edit.highlights)}Je(()=>{const p=e.edit.highlights;!!v(o)&&!!e.edit.popover?qe==null||qe.setHighlights(p):nt==null||nt.setHighlights(p)}),Je(()=>{v(o)&&e.edit.popover||(qe==null||qe.dispose(),qe=null,Ct=null)});let an=Re("");Je(()=>{const p=Qe.url.toString();p!==v(an)&&(re(an,p,!0),e.edit=zi(e.edit,{pathname:Qe.url.pathname}),e.contextPopoverOpen=!1)});function Zn(p,P,j){return Math.max(P,Math.min(j,p))}function er(p){const P=new Map;for(const j of p||[])for(const H of j.contradictingQuotes||[]){const ae=String(H||"").trim();ae&&P.set(ae,(P.get(ae)||0)+1)}return[...P.entries()].map(([j,H])=>({quote:j,count:Zn(H,1,10)})).sort((j,H)=>H.count-j.count||j.quote.localeCompare(H.quote))}let Pt=Re(!1);async function tr(){var P;if(v(Pt)||!e.currentStep)return;re(Pt,!0);const p=Be("findIssues");try{const j=await rt.tests.findPromptIssues.mutate({agent:e.agentId,step:e.currentStep.name,prompt:v(g)}),H=er(j.issues||[]);if(((P=e.edit.popover)==null?void 0:P.requestId)!==p)return;nn(H);let ae=null;try{ae=JSON.stringify(j.raw,null,2)}catch{ae=null}We(p,{title:`Prompt issues — ${e.currentStep.name}`,issues:j.issues,raw:ae})}catch(j){console.error(j);const H=typeof(j==null?void 0:j.message)=="string"?j.message:(()=>{try{return JSON.stringify(j)}catch{return String(j)}})();at(p,H||"Failed to find issues in this prompt",{title:`Prompt issues failed — ${e.currentStep.name}`,raw:H})}finally{re(Pt,!1)}}function nr(p){C(),ht();const P=Qe.url.searchParams.get("step"),j=Qe.url.searchParams.get("region"),H=Qe.url.searchParams.get("variant"),ae=`/edit/${h(p)}/${e.edit.tab}`,Y=new URLSearchParams;P&&Y.set("step",P),j&&Y.set("region",j),H&&Y.set("variant",H);const fe=B(p,P);fe&&Y.set("promptEdit",fe.id);const se=Y.size?`${ae}?${Y.toString()}`:ae;Ot(se)}function rr(p){!p||p===e.region||(C(),e.region=p,c("region",p))}function ir(p){p!==e.variant&&(C(),e.variant=p,c("variant",p))}Rr({state:e,actions:{openPopover:Be,setPopoverReady:We,setPopoverError:at,closePopover:tt,setHighlightQuotes:nn,focusQuote:Gn,openContextPopover:At,closeContextPopover:lt,toggleContextPopover:Bt,openAiEdit:p=>he(p),sendAppEvent:m,sendChatMessage:p=>{if(!e.wsLoaded||!e.chatReady){console.warn("[roleplay] Ignoring chat message while websocket session is reconnecting");return}A(),gt.sendMessage({channel:"chat",message:p})},flushPromptSave:C,getPromptOverrides:()=>d(),getActivePromptEditId:()=>{var p;return((p=v(o))==null?void 0:p.id)??null},selectState:p=>{C(),ht(),V=p,e.currentState=p,En(),Ln(),m({type:"select-agent",agent:e.agentId,state:p,region:e.region,variant:e.variant,promptOverrides:d()})},hangup(){m({type:"hangup",agentId:e.agentId,region:e.region,variant:e.variant})}}}),en(async()=>{try{re(S,await rt.agents.catalog.query(),!0)}catch(p){console.error("Failed to load agents",p)}gt.onClose(()=>{e.wsLoaded=!1,e.chatReady=!1,e.context=null,e.promptContext=null,e.agentStates=[],e.currentState=null,e.contextPopoverOpen=!1,_=null}),gt.onError(p=>l(p)),gt.onMessage(p=>{if(p.channel==="app-events"){if(p.event.type==="agents-loaded"){e.wsLoaded=!0;return}if(p.event.type==="context-updated"){e.context=p.event.context,p.event.promptContext&&(e.promptContext=p.event.promptContext);return}if(p.event.type==="update-states"){const P=e.agentStates.length;e.agentStates=p.event.states;const j=e.agentStates.length>0?e.agentStates[e.agentStates.length-1].id:null;V!==void 0?e.currentState=V:(e.currentState===null&&P===0&&j||e.agentStates.length>P)&&(e.currentState=j),V=void 0;return}if(p.event.type==="agent-selected"){e.steps=p.event.agent.steps,e.agentType=p.event.agent.type;const P={};for(const fe of e.steps){const se=e.promptDrafts[fe.name];P[fe.name]=typeof se=="string"?se:fe.prompt??""}e.promptDrafts=P;const j=(Qe.url.searchParams.get("step")||"").trim()||null,H=j?e.steps.find(fe=>fe.name===j)??null:null,ae=e.steps.find(fe=>fe.name.toLowerCase()==="main")??e.steps.find(fe=>$r(fe.name))??e.steps[0]??null,Y=H??ae;e.currentStep=Y,Y?(n(Y),Y.name!==j&&c("step",Y.name),m({type:"step-selected",step:Y.name}),C()):c("step",null);return}return}if(p.channel==="log"){qr(p.message);return}if(p.channel==="step-trace"){Ir(p.trace);return}if(p.channel==="api-call-trace"){Fr(p.trace);return}if(p.channel==="conversational-trace"){Mr(p.trace);return}if(p.channel==="error"){l(p.message);return}}),gt.init(),e.wsLoaded=gt.isReady()}),Dn(()=>{C(),x(),nt==null||nt.dispose(),nt=null,St=null,qe==null||qe.dispose(),qe=null,Ct=null,Kt=null}),Je(()=>{const p=v(f);if(p!==e.agentId&&(C(),K=null,x(),e.chatReady=!1,e.promptDrafts={},e.steps=[],e.currentStep=null),e.agentId=p,!e.wsLoaded){e.chatReady=!1;return}if(!e.agentId){e.chatReady=!1;return}if(e.availableRegions.length>0&&!e.region){e.chatReady=!1;return}const P=`${e.agentId}::${e.region??""}::${e.variant??""}`;_!==P&&(_=P,e.variant!==L&&(C(),e.promptDrafts={},L=e.variant),En(),Ln(),ht(),e.currentState=null,e.agentStates=[],e.context=null,e.promptContext=null,C(),V=void 0,e.chatReady=!1,m({type:"select-agent",agent:e.agentId,region:e.region,variant:e.variant,promptOverrides:d()}),e.chatReady=!0)});var sn=bo(),Dt=Ue(sn),ln=ie(Dt);Ur(ln,{className:"flex-none",get agents(){return v(S)},get currentAgent(){return e.agentId},onAgentClick:nr});var cn=pe(ln,2),jt=ie(cn),$t=pe(ie(jt),2),or=ie($t);Jt(or,{get value(){return v(we)},ariaLabel:"Top tabs",onChange:Oe,children:(p,P)=>{var j=Mn(),H=Ue(j);yt(H,{value:"edit",children:(Y,fe)=>{De();var se=$e("Edit");J(Y,se)},$$slots:{default:!0}});var ae=pe(H,2);yt(ae,{value:"view",children:(Y,fe)=>{De();var se=$e("View");J(Y,se)},$$slots:{default:!0}}),J(p,j)},$$slots:{default:!0}}),ne($t);var un=pe($t,2),fn=ie(un);{var ar=p=>{var P=io(),j=pe(Ue(P),2),H=ie(j);Ye(H,{variant:"secondary",size:"small",get"aria-expanded"(){return v(r)},"aria-haspopup":"listbox","aria-controls":t,onclick:Y=>{Y.stopPropagation(),re(r,!v(r))},class:"flex w-40 items-center justify-between gap-1 !px-3 !py-1",get el(){return v(i)},set el(Y){re(i,Y,!0)},children:(Y,fe)=>{var se=Bn(),xe=Ue(se),Ce=ie(xe,!0);ne(xe);var Te=pe(xe,2);{let be=_e(()=>"size-5 text-rc-gray-400 transition-transform duration-200 "+(v(r)?"rotate-180":""));Sn(Te,{name:"chevron-down",get class(){return v(be)}})}Ke(()=>Ie(Ce,e.variant??"default")),J(Y,se)},$$slots:{default:!0}});var ae=pe(H,2);kn(ae,{id:t,get open(){return v(r)},onClose:()=>re(r,!1),get anchorEl(){return v(i)},placement:"bottom-end",offset:[0,1],children:fe=>{var se=ro();_t(se,21,()=>v(y),It,(xe,Ce)=>{{let Te=_e(()=>v(Ce)===e.variant),be=_e(()=>`w-full rounded-none py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400 ${v(Ce)===e.variant?"bg-rc-gray-800 text-rc-gray-100":"text-rc-gray-200"}`);Ye(xe,{variant:"ghost",size:"small",role:"option",get"aria-selected"(){return v(Te)},onclick:Ne=>{Ne.stopPropagation(),re(r,!1),ir(v(Ce))},get class(){return v(be)},children:(Ne,ze)=>{De();var Ze=$e();Ke(()=>Ie(Ze,v(Ce)??"default")),J(Ne,Ze)},$$slots:{default:!0}})}}),ne(se),J(fe,se)},$$slots:{default:!0}}),ne(j),J(p,P)};Me(fn,p=>{e.experimentVariants.length>0&&p(ar)})}var sr=pe(fn,2);{var lr=p=>{var P=ao(),j=pe(Ue(P),2),H=ie(j);Ye(H,{variant:"secondary",size:"small",get"aria-expanded"(){return v(O)},"aria-haspopup":"listbox","aria-controls":$,onclick:Y=>{Y.stopPropagation(),re(O,!v(O))},class:"flex w-32 items-center justify-between gap-1 !px-3 !py-1",get el(){return v(F)},set el(Y){re(F,Y,!0)},children:(Y,fe)=>{var se=Bn(),xe=Ue(se),Ce=ie(xe,!0);ne(xe);var Te=pe(xe,2);{let be=_e(()=>"size-5 text-rc-gray-400 transition-transform duration-200 "+(v(O)?"rotate-180":""));Sn(Te,{name:"chevron-down",get class(){return v(be)}})}Ke(()=>Ie(Ce,e.region)),J(Y,se)},$$slots:{default:!0}});var ae=pe(H,2);kn(ae,{id:$,get open(){return v(O)},onClose:()=>re(O,!1),get anchorEl(){return v(F)},placement:"bottom-end",offset:[0,1],children:fe=>{var se=oo();_t(se,21,()=>e.availableRegions,It,(xe,Ce)=>{{let Te=_e(()=>v(Ce)===e.region),be=_e(()=>`w-full rounded-none py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400 ${v(Ce)===e.region?"bg-rc-gray-800 text-rc-gray-100":"text-rc-gray-200"}`);Ye(xe,{variant:"ghost",size:"small",role:"option",get"aria-selected"(){return v(Te)},onclick:Ne=>{Ne.stopPropagation(),re(O,!1),rr(v(Ce))},get class(){return v(be)},children:(Ne,ze)=>{De();var Ze=$e();Ke(()=>Ie(Ze,v(Ce))),J(Ne,Ze)},$$slots:{default:!0}})}}),ne(se),J(fe,se)},$$slots:{default:!0}}),ne(j),J(p,P)};Me(sr,p=>{e.availableRegions.length>0&&e.region&&p(lr)})}ne(un),ne(jt);var pn=pe(jt,2),hn=ie(pn),dn=ie(hn);Lt(dn,{class:"flex h-full min-w-0 flex-col !rounded-none p-0",children:(p,P)=>{var j=uo(),H=ie(j);{var ae=se=>{var xe=so();J(se,xe)},Y=se=>{var xe=lo();J(se,xe)},fe=se=>{var xe=Rt(),Ce=Ue(xe);_t(Ce,17,()=>e.steps,It,(Te,be)=>{var Ne=co(),ze=ie(Ne),Ze=ie(ze,!0);ne(ze),ne(Ne),Ke(()=>{var mt;Cr(Ne,1,`my-1 w-full rounded-lg px-3 py-2 text-left text-rc-gray-200 hover:bg-rc-gray-700 ${v(be).name===((mt=e.currentStep)==null?void 0:mt.name)?"bg-rc-gray-600":"bg-transparent"}`),Ie(Ze,v(be).name)}),Ft("click",Ne,()=>ge(v(be).name)),J(Te,Ne)}),J(se,xe)};Me(H,se=>{e.wsLoaded?e.steps.length===0?se(Y,1):se(fe,-1):se(ae)})}ne(j),J(p,j)}});var Vt=pe(dn,2),Ut=ie(Vt),Wt=ie(Ut),vn=ie(Wt),cr=ie(vn,!0);ne(vn),ne(Wt);var mn=pe(Wt,2),Ht=ie(mn),qt=ie(Ht);jn(qt),De(2),ne(Ht);var gn=pe(Ht,2);{let p=_e(()=>!e.currentStep||v(Pt));Ye(gn,{variant:"secondary",get disabled(){return v(p)},onclick:tr,children:(P,j)=>{De();var H=$e("Find issues");J(P,H)},$$slots:{default:!0}})}var ur=pe(gn,2);{let p=_e(()=>!e.currentStep||!!v(o)||v(q));Ye(ur,{variant:"secondary",get disabled(){return v(p)},onclick:()=>he(),children:(P,j)=>{De();var H=$e("Edit with AI");J(P,H)},$$slots:{default:!0}})}ne(mn),ne(Ut);var yn=pe(Ut,2),fr=ie(yn);{var pr=p=>{var P=ho(),j=ie(P);kr(j,()=>e.currentStep.name,Y=>{{let fe=_e(()=>v(Tt)&&!v(o)),se=_e(()=>!!v(o)),xe=_e(()=>v(o)?"Accept or reject the AI suggestion before editing.":""),Ce=_e(()=>v(o)?!1:v(vt));Cn(Y,{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 initialPrompt(){return v(s)},get agentId(){return e.agentId},get stepName(){return e.currentStep.name},onPromptChanged:Ee,get showSchemaButton(){return v(fe)},onSchemaClick:pt,get readOnly(){return v(se)},get readOnlyMessage(){return v(xe)},showPreviewToggle:!1,get preview(){return v(Ce)},onEditorReady:Jn})}});var H=pe(j,2);{var ae=Y=>{var fe=po(),se=ie(fe);{var xe=Ve=>{Cn(Ve,{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 initialPrompt(){return v(o).suggestedPrompt},get agentId(){return e.agentId},get stepName(){return e.currentStep.name},onPromptChanged:()=>{},showSchemaButton:!1,readOnly:!0,readOnlyMessage:"Accept or reject the AI suggestion before editing.",bottomPadding:56,showPreviewToggle:!1,onEditorReady:Xn})},Ce=Ve=>{Sr(Ve,{class:"h-full min-w-0 !rounded-none",get original(){return v(Qn)},get modified(){return v(Yn)},inline:!0,bottomPadding:56,readOnlyMessage:"Accept or reject the AI suggestion before editing.",onModifiedEditorReady:He=>Kt=He})};Me(se,Ve=>{e.edit.popover?Ve(xe):Ve(Ce,-1)})}var Te=pe(se,2),be=ie(Te);Ye(be,{variant:"secondary",get disabled(){return v(Fe)},onclick:Xe,children:(Ve,He)=>{De();var st=$e("✕ Reject");J(Ve,st)},$$slots:{default:!0}});var Ne=pe(be,2);Ye(Ne,{get disabled(){return v(Fe)},onclick:et,children:(Ve,He)=>{De();var st=$e("✓ Accept");J(Ve,st)},$$slots:{default:!0}});var ze=pe(Ne,2);{var Ze=Ve=>{var He=fo(),st=ie(He,!0);ne(He),Ke(()=>Ie(st,v(ke))),J(Ve,He)};Me(ze,Ve=>{v(ke)&&Ve(Ze)})}ne(Te);var mt=pe(Te,2);{var zt=Ve=>{Ye(Ve,{variant:"secondary",onclick:pt,class:"absolute bottom-2 right-6 z-20 !font-medium",children:(He,st)=>{De();var wt=$e("Schema");J(He,wt)},$$slots:{default:!0}})};Me(mt,Ve=>{v(Tt)&&Ve(zt)})}ne(fe),J(Y,fe)};Me(H,Y=>{v(o)&&Y(ae)})}ne(P),J(p,P)},hr=p=>{Lt(p,{class:"flex h-full min-w-0 items-center justify-center !rounded-none p-4 text-sm text-rc-gray-400",children:(P,j)=>{De();var H=$e("Select a step to edit its prompt");J(P,H)}})};Me(fr,p=>{e.currentStep?p(pr):p(hr,-1)})}ne(yn),ne(Vt);var dr=pe(Vt,2);Lt(dr,{class:"relative flex h-full min-w-0 flex-col overflow-hidden !rounded-none p-0",children:(p,P)=>{var j=vo(),H=Ue(j),ae=ie(H);Jt(ae,{get value(){return e.edit.tab},ariaLabel:"Mode tabs",onChange:Se,children:(be,Ne)=>{var ze=Kn(),Ze=Ue(ze);yt(Ze,{value:"roleplay",children:(He,st)=>{De();var wt=$e("Roleplay");J(He,wt)},$$slots:{default:!0}});var mt=pe(Ze,2);yt(mt,{value:"tests",children:(He,st)=>{De();var wt=$e("Tests");J(He,wt)},$$slots:{default:!0}});var zt=pe(mt,2);{var Ve=He=>{yt(He,{value:"configure",children:(st,wt)=>{De();var gr=$e("Configure");J(st,gr)},$$slots:{default:!0}})};Me(zt,He=>{e.defaultRegion!==null&&He(Ve)})}J(be,ze)},$$slots:{default:!0}}),ne(H);var Y=pe(H,2),fe=ie(Y);Or(fe,()=>T.children),ne(Y);var se=pe(Y,2);{var xe=be=>{{const Ne=Ze=>{Vi(Ze,{})};let ze=_e(()=>kt(e.edit.popover.kind));On(be,{get title(){return v(ze)},onClose:tt,children:Ne})}};Me(se,be=>{e.edit.popover&&be(xe)})}var Ce=pe(se,2);{var Te=be=>{On(be,{title:"Edit context",onClose:lt,children:ze=>{Wi(ze,{})}})};Me(Ce,be=>{e.contextPopoverOpen&&be(Te)})}J(p,j)}}),ne(hn),ne(pn),ne(cn),ne(Dt);var _n=pe(Dt,2);Gt(_n,{title:"Edit with AI",class:"!max-w-xl",get underlayOpen(){return v(q)},get open(){return v(oe)},set open(H){re(oe,H,!0)},children:H=>{var ae=go(),Y=pe(ie(ae),2);Jr(Y,{id:"ai-edit-request",rows:6,get disabled(){return v(q)},placeholder:"I want the agent to ask the user's name during the greeting",class:"rc-scroll disabled:cursor-wait disabled:opacity-70",get value(){return v(le)},set value(xe){re(le,xe,!0)}});var fe=pe(Y,2);{var se=xe=>{var Ce=mo(),Te=ie(Ce,!0);ne(Ce),Ke(()=>Ie(Te,v(Le))),J(xe,Ce)};Me(fe,xe=>{v(Le)&&xe(se)})}ne(ae),J(H,ae)},footer:H=>{var ae=Mn(),Y=Ue(ae);Ye(Y,{variant:"outlined",size:"small",onclick:de,children:(se,xe)=>{De();var Ce=$e("Cancel");J(se,Ce)},$$slots:{default:!0}});var fe=pe(Y,2);{let se=_e(()=>!v(le).trim()||v(q));Ye(fe,{size:"small",get disabled(){return v(se)},onclick:ye,children:(xe,Ce)=>{De();var Te=$e();Ke(()=>Ie(Te,v(q)?"Suggesting edits…":"Suggest edits")),J(xe,Te)},$$slots:{default:!0}})}J(H,ae)},underlay:H=>{var ae=yo(),Y=ie(ae,!0);ne(ae),Ke(()=>{Ar(ae,"title",v(ve)),Ie(Y,v(ve))}),J(H,ae)},$$slots:{default:!0,footer:!0,underlay:!0}});var xn=pe(_n,2);Gt(xn,{title:"No changes were suggested",class:"!z-[60] !max-w-md",overlayClass:"!z-[60]",get open(){return v(k)},set open(j){re(k,j,!0)},children:j=>{var H=_o();J(j,H)},footer:j=>{Ye(j,{size:"small",onclick:()=>re(k,!1),children:(H,ae)=>{De();var Y=$e("Close");J(H,Y)},$$slots:{default:!0}})},$$slots:{default:!0,footer:!0}});var vr=pe(xn,2);{var mr=p=>{Gt(p,{title:"Schema",class:"!w-[80vw] !max-w-5xl",get open(){return v(xt)},set open(H){re(xt,H,!0)},children:H=>{ti(H,{class:"h-[70vh] min-w-0",get schema(){return v(ut)},onChange:ce})},footer:H=>{var ae=Kn(),Y=Ue(ae);{var fe=Te=>{var be=xo(),Ne=ie(be,!0);ne(be),Ke(()=>Ie(Ne,v(it))),J(Te,be)},se=Te=>{var be=wo(),Ne=ie(be,!0);ne(be),Ke(()=>Ie(Ne,v(ft))),J(Te,be)};Me(Y,Te=>{v(it)?Te(fe):v(ft)&&Te(se,1)})}var xe=pe(Y,2);Ye(xe,{variant:"outlined",size:"small",onclick:()=>re(xt,!1),children:(Te,be)=>{De();var Ne=$e();Ke(()=>Ie(Ne,v(ot)?"Cancel":"Close")),J(Te,Ne)},$$slots:{default:!0}});var Ce=pe(xe,2);{let Te=_e(()=>!v(ot)||v(dt));Ye(Ce,{size:"small",get disabled(){return v(Te)},onclick:ue,children:(be,Ne)=>{De();var ze=$e();Ke(()=>Ie(ze,v(dt)?"Saving…":"Save")),J(be,ze)},$$slots:{default:!0}})}J(H,ae)},$$slots:{default:!0,footer:!0}})};Me(vr,p=>{v(Ge)&&p(mr)})}Ke(()=>{var p;Ie(cr,((p=e.currentStep)==null?void 0:p.name)??"Prompt"),qt.disabled=!e.currentStep||!!v(o)&&!!e.edit.popover}),Nr(qt,()=>v(vt),p=>re(vt,p)),J(N,sn),Et()}Zt(["click"]);export{ea as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as Jt,b as U,a as v,t as D,f as h,c as Kt}from"../chunks/CCYriF4C.js";import{o as Xt}from"../chunks/DnMQeiTY.js";import{p as Yt,w as u,x as X,d as et,t as S,j as t,a as Zt,e as ea,f as Y,s as l,c as i,y as o,n as k,$ as ta,o as V,r as n}from"../chunks/CR-uVjxM.js";import{s as m}from"../chunks/B0nqNj93.js";import{i as j}from"../chunks/BQIf5msi.js";import{e as $e,i as Ie}from"../chunks/DuQdgMax.js";import{s as aa}from"../chunks/9mOMnnWN.js";import{h as ra}from"../chunks/DjujL8K1.js";import{b as tt,c as at,i as sa,d as oa}from"../chunks/AmpxVxY6.js";import{s as na}from"../chunks/C9yBjdYI.js";import{p as ia}from"../chunks/BcbX6huO.js";import{g as y}from"../chunks/CQvDMTjY.js";import{p as g}from"../chunks/DK7_9Rr4.js";import{B as Z}from"../chunks/BqH4VDQz.js";import{I as la}from"../chunks/B1MxGo6p.js";import{I as ca}from"../chunks/dL_jwANm.js";import{m as da}from"../chunks/ddC1NP9R.js";import{p as rt,T as va,g as ua}from"../chunks/B-5g3xS8.js";import{T as pa,a as st}from"../chunks/D9YsE4-8.js";import{A as fa}from"../chunks/CVZT6n14.js";import{g as ga}from"../chunks/Dba0_Upf.js";import{t as ot}from"../chunks/CWPN78Jk.js";var ma=h("<!> <!>",1),Se=h("<option> </option>"),_a=h('<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>'),ha=h('<div class="flex items-center gap-2"><div class="text-rc-gray-200">Variant:</div> <select class="select svelte-1uk1thp" aria-label="Variant"><option>All</option><!></select></div>'),xa=h('<p class="py-8 text-center text-rc-gray-200">Loading...</p>'),ya=h('<p class="py-8 text-center text-rc-gray-300">No conversations found</p>'),ba=h('<span class="text-rc-gray-200">, Agent Id:</span> <span class="text-rc-green-200"> </span>',1),wa=h('<span class="text-rc-gray-200">, Variant:</span> <span class="text-rc-green-200"> </span>',1),$a=h('<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>'),Ia=h('<ul class="space-y-2"></ul>'),Sa=h('<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(nt,ee){Yt(ee,!0);const q=new va(fetch);let Ce=u(X([])),b=u(void 0),x=u(null);const p=k(()=>(g.url.searchParams.get("agent")??"").trim()),te=k(()=>(g.url.searchParams.get("region")??"").trim()),w=k(()=>(g.url.searchParams.get("variant")??"").trim());let M=u(X([])),R=u(""),ae=u(20),G=u("20"),Q=u(!0),$=u(X([])),P=u(null),W=u(!1),re=u(null),Ae=u(0),C=u(X([])),z=u(""),H=u(!1),se=u(null),ke=u(!1),oe=u(null),Pe=ia(ee,"useMock",3,!1);const{onError:Te}=ga();function it(e){return new Date(e).toLocaleString()}function lt(e){const a=Math.floor(e/60),r=e%60;return`${a}:${String(r).padStart(2,"0")}`}function Le(e=t(p),a=e===t(p)?t(te):"",r=e===t(p)?t(w):""){const s=new URLSearchParams;e&&s.set("agent",e),e&&a&&s.set("region",a),e&&r&&s.set("variant",r);const c=s.toString();return c?`?${c}`:""}function B(e=t(p)){return`${t(ie)}/conversations${Le(e)}`}const ct=k(()=>g.url.pathname.split("/").at(-1)==="latency"?"latency":"traces");function dt(e,a=t(ct),r=t(p)){return`${t(ie)}/conversations/${encodeURIComponent(e)}/${a}${Le(r)}`}async function vt(e,a=t(ae),r,s,c){return Pe()?da.fetchConversations(a,e,r??void 0):q.getConversations({phoneNumber:e,agentId:s,variantId:c,limit:Number(a),lastConversationId:r??void 0})}async function O(){o($,[],!0),o(P,null),await ne()}async function ut(){o(H,!0),o(se,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(),r=Array.isArray(a)?a:[];if(o(C,r.filter(d=>d&&typeof d.id=="string"&&typeof d.label=="string"),!0),!t(C).length)throw new Error("No sources returned");const s=ua(),c=s&&t(C).some(d=>d.id===s)?s:t(C)[0].id;o(z,c,!0),rt(c),q.setSourceId(c)}catch(e){console.error("Failed to load Telescope sources:",e),o(se,(e==null?void 0:e.message)??"Failed to load Telescope sources",!0),o(C,[],!0),o(z,""),q.setSourceId(void 0)}finally{o(H,!1)}}async function pt(e){const a=e.target.value;o(z,a,!0),rt(a),q.setSourceId(a),o(x,null),await y(B()),await O()}async function ft(){try{o(Ce,await ot.agents.catalog.query(),!0)}catch(e){const a=e instanceof Error?e.message:e?String(e):"Unknown error";console.error("Failed to load agents:",e),Te(`Failed to load agents: ${a}`)}}async function ne(){o(W,!0),o(re,null);try{const e=await vt(t(R)||void 0,t(ae),t(P)??void 0,t(p)||void 0,t(w)||void 0);let a=Array.isArray(e.items)?e.items.slice():[];a=a.filter(r=>!!(r!=null&&r.phoneNumber)),o(b,{limit:e.limit,items:a,lastConversationId:e.lastConversationId},!0),o(Ae,a.length,!0),o(P,e.lastConversationId??null,!0),o(W,!1)}catch(e){o(W,!1),o(re,e.message||"Unknown error",!0),Te(`Error loading conversations: ${t(re)}`),console.error("Load page error:",e)}}async function gt(){var e;(e=t(b))!=null&&e.lastConversationId&&(t($).push(t(b).lastConversationId),o(P,t(b).lastConversationId,!0),await ne())}async function mt(){t($).length&&(t($).pop(),o(P,t($).length?t($)[t($).length-1]:null,!0),await ne())}function _t(){var e;o(Q,!t(Q)),(e=t(b))!=null&&e.items&&t(b).items.sort((a,r)=>t(Q)?r.createdAt-a.createdAt:a.createdAt-r.createdAt)}async function ht(e,a){var s;if(a==null||a.stopPropagation(),g.params.conversationId&&g.params.conversationId===e.conversationId||!g.params.conversationId&&((s=t(x))==null?void 0:s.conversationId)===e.conversationId){o(x,null),await y(B());return}o(x,e,!0),await y(dt(e.conversationId))}function xt(e){const a=e.target.value;o(G,a,!0),o(ae,parseInt(t(G),10)||20,!0)}async function Ee(){await O()}async function yt(e){e==null||e.preventDefault(),e==null||e.stopPropagation(),o(R,""),o($,[],!0),o(P,null),await O()}const Fe=k(()=>{const e=g.url.pathname.split("/")[1];return e==="traces"?"view":e}),ie=k(()=>g.url.pathname.startsWith("/view")?"/view":"/traces");function bt({value:e}){if(e!==t(Fe)){if(e==="edit"){if(!t(p))return y("/edit");const a=new URLSearchParams;t(te)&&a.set("region",t(te)),t(w)&&a.set("variant",t(w));const r=a.toString();return y(`/edit/${encodeURIComponent(t(p))}/roleplay${r?`?${r}`:""}`)}if(e==="view")return y(B());y("/"+e)}}async function wt(e,a){a==null||a.stopPropagation(),e!==t(p)&&(o(x,null),await y(B(e)))}async function $t(e){e==null||e.stopPropagation(),t(p)&&(o(x,null),await y(B("")))}et(()=>{const e=`${t(p)}::${t(w)}`;t(ke)&&e!==t(oe)&&(o(oe,e),o(x,null),O())}),et(()=>{It(t(p))});async function It(e){var a;if(!e){o(M,[],!0);return}try{const r=await ot.regionConfig.meta.query({agent:e});o(M,Object.keys(((a=r==null?void 0:r.experiment)==null?void 0:a.variants)??{}),!0)}catch(r){console.error("Failed to load the experiment of the agent",r),o(M,[],!0)}}async function St(e){const a=e.target.value,r=new URLSearchParams(g.url.searchParams);a?r.set("variant",a):r.delete("variant"),o(x,null);const s=r.toString();await y(`${t(ie)}/conversations${s?`?${s}`:""}`)}Xt(()=>{(async()=>(await Promise.all([ft(),ut()]),await O(),o(oe,`${t(p)}::${t(w)}`),o(ke,!0)))()});var le=Sa();ra("1uk1thp",e=>{ea(()=>{ta.title="Bosun: Telescope"})});var Ne=i(le);fa(Ne,{get agents(){return t(Ce)},get currentAgent(){return t(p)},onAgentClick:wt,showAllAgentsOption:!0,onAllAgentsClick:$t,className:"flex-none"});var Ue=l(Ne,2),ce=i(Ue),de=i(ce),Ct=i(de);pa(Ct,{get value(){return t(Fe)},ariaLabel:"Top tabs",onChange:bt,children:(e,a)=>{var r=ma(),s=Y(r);st(s,{value:"edit",children:(d,I)=>{V();var f=D("Edit");v(d,f)},$$slots:{default:!0}});var c=l(s,2);st(c,{value:"view",children:(d,I)=>{V();var f=D("View");v(d,f)},$$slots:{default:!0}}),v(e,r)},$$slots:{default:!0}}),n(de);var De=l(de,2),ve=i(De),Ve=i(ve),je=i(Ve),T=i(je),At=i(T);{var kt=e=>{var a=Kt(),r=Y(a);$e(r,17,()=>t(C),Ie,(s,c)=>{var d=Se(),I=i(d,!0);n(d);var f={};S(()=>{m(I,t(c).label),f!==(f=t(c).id)&&(d.value=(d.__value=t(c).id)??"")}),v(s,d)}),v(e,a)},Pt=e=>{var a=Se(),r=i(a,!0);n(a),a.value=a.__value="",S(()=>m(r,t(H)?"Loading…":"No sources")),v(e,a)};j(At,e=>{t(C).length?e(kt):e(Pt,-1)})}n(T);var ue=l(T,2),Me=i(ue);ca(Me,{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(),Ee())},get value(){return t(R)},set value(e){o(R,e,!0)}});var Tt=l(Me);{var Lt=e=>{var a=_a(),r=i(a);la(r,{name:"close",width:18,height:18}),n(a),U("click",a,yt),v(e,a)};j(Tt,e=>{t(R)&&e(Lt)})}n(ue);var Et=l(ue,2);Z(Et,{onclick:Ee,children:(e,a)=>{V();var r=D("Search");v(e,r)},$$slots:{default:!0}}),n(je),n(Ve),n(ve);var Re=l(ve,2);{var Ft=e=>{var a=ha(),r=l(i(a),2),s=i(r);s.value=s.__value="";var c=l(s);$e(c,17,()=>t(M),Ie,(I,f)=>{var L=Se(),K=i(L,!0);n(L);var F={};S(()=>{m(K,t(f)),F!==(F=t(f))&&(L.value=(L.__value=t(f))??"")}),v(I,L)}),n(r);var d;sa(r),n(a),S(()=>{d!==(d=t(w))&&(r.value=(r.__value=t(w))??"",oa(r,t(w)))}),U("change",r,St),v(e,a)};j(Re,e=>{t(p)&&t(M).length>0&&e(Ft)})}var pe=l(Re,2),Nt=l(i(pe),2);Z(Nt,{onclick:_t,children:(e,a)=>{V();var r=D();S(()=>m(r,t(Q)?"Newest first":"Oldest first")),v(e,r)},$$slots:{default:!0}}),n(pe);var fe=l(pe,2),J=l(i(fe),2),ge=i(J);ge.value=ge.__value="5";var me=l(ge);me.value=me.__value="10";var _e=l(me);_e.value=_e.__value="20";var ze=l(_e);ze.value=ze.__value="50",n(J),n(fe);var he=l(fe,2),Be=i(he),Oe=i(Be);{let e=k(()=>t($).length===0&&!t(P));Z(Oe,{onclick:mt,get disabled(){return t(e)},children:(a,r)=>{V();var s=D("Prev");v(a,s)},$$slots:{default:!0}})}var qe=l(Oe,2);{let e=k(()=>{var a;return!((a=t(b))!=null&&a.items.length)});Z(qe,{onclick:gt,get disabled(){return t(e)},children:(a,r)=>{V();var s=D("Next");v(a,s)},$$slots:{default:!0}})}var Ge=l(qe,2),Ut=i(Ge);n(Ge),n(Be),n(he);var Qe=l(he,2),We=l(i(Qe),2),Dt=i(We,!0);n(We),n(Qe),n(De),n(ce);var He=l(ce,2),xe=i(He),Je=l(i(xe),2),Vt=i(Je);{var jt=e=>{var a=xa();v(e,a)},Mt=e=>{var a=ya();v(e,a)},Rt=e=>{var a=Ia();$e(a,21,()=>t(b).items,Ie,(r,s)=>{var c=$a(),d=i(c),I=i(d),f=i(I),L=i(f,!0);n(f);var K=l(f,2),F=i(K),Bt=i(F,!0);n(F);var Ke=l(F,2),Ot=i(Ke,!0);n(Ke),n(K),n(I);var Xe=l(I,2),be=i(Xe),we=l(i(be),2),qt=i(we,!0);n(we);var Ye=l(we,2);{var Gt=_=>{var E=ba(),A=l(Y(E),2),N=i(A,!0);n(A),S(()=>m(N,t(s).agentId)),v(_,E)};j(Ye,_=>{!t(p)&&t(s).agentId&&_(Gt)})}var Qt=l(Ye,2);{var Wt=_=>{var E=wa(),A=l(Y(E),2),N=i(A,!0);n(A),S(()=>m(N,t(s).variantId)),v(_,E)};j(Qt,_=>{t(s).variantId&&_(Wt)})}n(be);var Ze=l(be,2),Ht=i(Ze);n(Ze),n(Xe),n(d),n(c),S((_,E)=>{var A,N;na(c,1,`cursor-pointer rounded-lg p-3 transition-colors ${(g.params.conversationId?t(s).conversationId===g.params.conversationId:t(s).conversationId===((A=t(x))==null?void 0:A.conversationId))?"bg-rc-gray-600":"bg-rc-gray-700 hover:bg-rc-gray-650"}`,"svelte-1uk1thp"),at(c,"aria-selected",g.params.conversationId?t(s).conversationId===g.params.conversationId:t(s).conversationId===((N=t(x))==null?void 0:N.conversationId)),m(L,_),m(Bt,t(s).medium),m(Ot,t(s).phoneNumber),m(qt,t(s).conversationId),m(Ht,`Duration: ${E??""}`)},[()=>it(t(s).createdAt),()=>lt(t(s).duration??0)]),U("click",c,_=>ht(t(s),_)),v(r,c)}),n(a),v(e,a)};j(Vt,e=>{var a,r;t(W)?e(jt):(r=(a=t(b))==null?void 0:a.items)!=null&&r.length?e(Rt,-1):e(Mt,1)})}n(Je),n(xe);var ye=l(xe,2),zt=i(ye);aa(zt,()=>ee.children),n(ye),n(He),n(Ue),n(le),S(()=>{T.disabled=t(H)||!t(C).length,at(T,"title",t(se)??"Telescope source"),m(Ut,`Items: ${t(Ae)??""}`),m(Dt,Pe()?"Mock (local)":"Live")}),U("change",T,pt),tt(T,()=>t(z),e=>o(z,e)),U("change",J,xt),tt(J,()=>t(G),e=>o(G,e)),U("click",ye,e=>e.stopPropagation()),v(nt,le),Zt()}Jt(["change","click"]);export{Ha as component};
|
package/build/bosun-app/frontend/client/_app/immutable/nodes/{4.BzhaMuo5.js → 4.DKTRRObl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as L,b as U,a as t,t as h,f as x}from"../chunks/CCYriF4C.js";import{p as j,a as B,f as M,j as l,s as g,n as $,c,o as b,r as d}from"../chunks/CR-uVjxM.js";import{s as R}from"../chunks/9mOMnnWN.js";import{g as W}from"../chunks/
|
|
1
|
+
import{d as L,b as U,a as t,t as h,f as x}from"../chunks/CCYriF4C.js";import{p as j,a as B,f as M,j as l,s as g,n as $,c,o as b,r as d}from"../chunks/CR-uVjxM.js";import{s as R}from"../chunks/9mOMnnWN.js";import{g as W}from"../chunks/CQvDMTjY.js";import{p as o}from"../chunks/DK7_9Rr4.js";import{T as q,a as _}from"../chunks/D9YsE4-8.js";import{p as z}from"../chunks/BJ9KKLWf.js";var A=x("<!> <!>",1),D=x('<div class="flex h-full min-h-0 flex-col bg-rc-gray-980"><div class="flex-none border-b border-rc-gray-300/40 px-4 pt-3"><!></div> <div class="min-h-0 flex-1"><!></div></div>');function O(y,v){j(v,!0),z();const p=$(()=>o.url.pathname.split("/").at(-1)==="latency"?"latency":"traces"),w=$(()=>o.url.pathname.startsWith("/view")?"/view":"/traces");function T(a){const m=o.params.conversationId??"",r=o.url.search;return`${l(w)}/conversations/${encodeURIComponent(m)}/${a}${r}`}function C({value:a}){a!=="traces"&&a!=="latency"||a!==l(p)&&W(T(a))}var e=D(),s=c(e),P=c(s);q(P,{get value(){return l(p)},ariaLabel:"View conversation tabs",onChange:C,children:(a,m)=>{var r=A(),u=M(r);_(u,{value:"traces",children:(n,k)=>{b();var i=h("Traces");t(n,i)},$$slots:{default:!0}});var I=g(u,2);_(I,{value:"latency",children:(n,k)=>{b();var i=h("Latency");t(n,i)},$$slots:{default:!0}}),t(a,r)},$$slots:{default:!0}}),d(s);var f=g(s,2),V=c(f);R(V,()=>v.children),d(f),d(e),U("click",e,a=>a.stopPropagation()),t(y,e),B()}L(["click"]);export{O as component};
|
package/build/bosun-app/frontend/client/_app/immutable/nodes/{5.BG8ylHWg.js → 5.D9SClLPX.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as x,b,a as m,f}from"../chunks/CCYriF4C.js";import{o as y}from"../chunks/DnMQeiTY.js";import{p as A,d as w,a as _,s as h,c as n,r as o,t as C,j as r,w as N,x as F,e as S,y as j,$ as q}from"../chunks/CR-uVjxM.js";import{h as H}from"../chunks/DjujL8K1.js";import{e as M,c as O,A as P}from"../chunks/
|
|
1
|
+
import{d as x,b,a as m,f}from"../chunks/CCYriF4C.js";import{o as y}from"../chunks/DnMQeiTY.js";import{p as A,d as w,a as _,s as h,c as n,r as o,t as C,j as r,w as N,x as F,e as S,y as j,$ as q}from"../chunks/CR-uVjxM.js";import{h as H}from"../chunks/DjujL8K1.js";import{e as M,c as O,A as P}from"../chunks/CVZT6n14.js";import{s as R}from"../chunks/B0nqNj93.js";import{e as z}from"../chunks/DuQdgMax.js";import{s as B,c as D}from"../chunks/AmpxVxY6.js";import{s as E}from"../chunks/C9yBjdYI.js";import{g as G}from"../chunks/Dba0_Upf.js";import{t as I}from"../chunks/CWPN78Jk.js";var J=f('<button><span class="agent-name svelte-16acuk9"> </span></button>'),K=f('<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 L(d,s){A(s,!0),w(()=>{M(s.agents.map(a=>a.id))});var l=K(),i=n(l),c=n(i);z(c,17,()=>s.agents,a=>a.id,(a,e)=>{var t=J();let v;var p=n(t),k=n(p,!0);o(p),o(t),C(u=>{v=E(t,1,"agent-card svelte-16acuk9",null,v,{active:r(e).id===s.currentAgent}),B(t,`--agent-color: ${u??""}`),D(t,"aria-label",`Open ${r(e).displayName}`),R(k,r(e).displayName)},[()=>O(r(e).id)]),b("click",t,u=>s.onAgentClick(r(e).id,u)),m(a,t)});var g=h(c,2);o(i),o(l),b("click",g,function(...a){var e;(e=s.onNewAgent)==null||e.apply(this,a)}),m(d,l),_()}x(["click"]);var Q=f('<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 se(d,s){A(s,!0);const{onAgentSelect:l}=G();let i=N(F([]));y(async()=>{j(i,await I.agents.catalog.query(),!0)});var c=Q();H("1uha8ag",v=>{S(()=>{q.title="Recombine Agents Hub"})});var g=n(c);P(g,{className:"flex-none border-r-thin border-r-rc-gray-600",get agents(){return r(i)},currentAgent:"",get onAgentClick(){return l},initiallyCollapsed:!1,hoverCollapse:!1});var a=h(g,2),e=n(a),t=n(e);L(t,{get agents(){return r(i)},currentAgent:"",get onAgentClick(){return l}}),o(e),o(a),o(c),m(d,c),_()}export{se as component};
|
package/build/bosun-app/frontend/client/_app/immutable/nodes/{6.DkDEANSN.js → 6.DdAs7BvU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,t as b,f as C}from"../chunks/CCYriF4C.js";import{o as L}from"../chunks/DnMQeiTY.js";import{p as M,w as _,x as N,d as U,a as V,e as z,j as t,f as D,s as y,c as i,n as G,y as w,$ as H,o as l,r as f}from"../chunks/CR-uVjxM.js";import{h as I}from"../chunks/DjujL8K1.js";import{g as c}from"../chunks/
|
|
1
|
+
import{a as r,t as b,f as C}from"../chunks/CCYriF4C.js";import{o as L}from"../chunks/DnMQeiTY.js";import{p as M,w as _,x as N,d as U,a as V,e as z,j as t,f as D,s as y,c as i,n as G,y as w,$ as H,o as l,r as f}from"../chunks/CR-uVjxM.js";import{h as I}from"../chunks/DjujL8K1.js";import{g as c}from"../chunks/CQvDMTjY.js";import{g as J}from"../chunks/Dba0_Upf.js";import{t as K}from"../chunks/CWPN78Jk.js";import{A as O}from"../chunks/CVZT6n14.js";import{T as Q,a as A}from"../chunks/D9YsE4-8.js";import{p as T}from"../chunks/DK7_9Rr4.js";var R=C("<!> <!>",1),W=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 ie(S,E){M(E,!0);const{onAgentSelect:d,onError:j}=J();let a=_(N([])),p=_(!1);const g=G(()=>T.url.pathname.split("/")[1]);function k({value:e}){if(e!==t(g)){if(e==="edit")return c("/edit");if(e==="view")return c("/view");c("/"+e)}}function P(e){d(e)}U(()=>{t(p)||T.url.pathname==="/edit"&&t(a).length&&(w(p,!0),d(t(a)[0].id))}),L(async()=>{try{w(a,await K.agents.catalog.query(),!0)}catch(e){const h=e instanceof Error?e.message:e?String(e):"Unknown error";console.error("Failed to load agents:",e),j(`Failed to load agents: ${h}`)}});var s=W();I("17v3h6h",e=>{z(()=>{H.title="Bosun: Edit"})});var m=i(s);O(m,{className:"flex-none",get agents(){return t(a)},currentAgent:"",onAgentClick:P});var u=y(m,2),v=i(u),F=i(v);Q(F,{get value(){return t(g)},ariaLabel:"Top tabs",onChange:k,children:(e,h)=>{var x=R(),$=D(x);A($,{value:"edit",children:(n,B)=>{l();var o=b("Edit");r(n,o)},$$slots:{default:!0}});var q=y($,2);A(q,{value:"view",children:(n,B)=>{l();var o=b("View");r(n,o)},$$slots:{default:!0}}),r(e,x)},$$slots:{default:!0}}),f(v),l(2),f(u),f(s),r(S,s),V()}export{ie as component};
|
package/build/bosun-app/frontend/client/_app/immutable/nodes/{8.3fEbISY6.js → 8.DNEyJy0a.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
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 re}from"../chunks/C1FmrZbK.js";import{a as c,f as d}from"../chunks/CCYriF4C.js";import{o as oe,a as ie}from"../chunks/DnMQeiTY.js";import{p as se,d as le,a as ne,y as a,j as e,f as T,s as E,c as m,r as p,t as O,w as u}from"../chunks/CR-uVjxM.js";import{s as V}from"../chunks/B0nqNj93.js";import{i as S}from"../chunks/BQIf5msi.js";import{b as ce}from"../chunks/ClLUwVGq.js";import{g as ue,P as ve}from"../chunks/CHCMKZAC.js";import{e as de,a as fe}from"../chunks/BU7aeYn4.js";import{t as J}from"../chunks/
|
|
2
|
+
import{_ as re}from"../chunks/C1FmrZbK.js";import{a as c,f as d}from"../chunks/CCYriF4C.js";import{o as oe,a as ie}from"../chunks/DnMQeiTY.js";import{p as se,d as le,a as ne,y as a,j as e,f as T,s as E,c as m,r as p,t as O,w as u}from"../chunks/CR-uVjxM.js";import{s as V}from"../chunks/B0nqNj93.js";import{i as S}from"../chunks/BQIf5msi.js";import{b as ce}from"../chunks/ClLUwVGq.js";import{g as ue,P as ve}from"../chunks/CHCMKZAC.js";import{e as de,a as fe}from"../chunks/BU7aeYn4.js";import{t as J}from"../chunks/CWPN78Jk.js";var me=d("<span>Saving…</span>"),pe=d("<span>Saved</span>"),ge=d('<div class="text-rc-gray-400">Loading…</div>'),_e=d('<div class="text-rc-red-500"> </div>'),L=d('<div class="text-rc-red-500 mb-2 text-xs"> </div>'),he=d('<!> <!> <div class="min-h-0 flex-1"></div>',1),ye=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 Be(W,z){se(z,!0);const{actions:F}=ue();let o=u(null),k,P=null,w=[],D=null,j=!1,g=u(""),A=u(""),B=u(!0),_=u(null),h=u(null),y=u(!1),f=u(null),x=null;const R=800;function M(){x&&(clearTimeout(x),x=null)}function q(t){M(),x=setTimeout(()=>{Q(t)},R)}async function Q(t){if(!e(y)&&t!==e(A)){try{JSON.parse(t)}catch{return}a(y,!0),a(f,null);try{await J.regionConfig.save.mutate({text:t}),a(A,t,!0),F.sendAppEvent({type:"reload-project"})}catch(l){console.error(l),a(f,"Failed to save region config")}finally{a(y,!1)}}}oe(async()=>{try{de();const t=await re(()=>import("../chunks/DLQqXQ6R.js").then(n=>n.e),__vite__mapDeps([0,1,2]),import.meta.url);if(j)return;D=t,fe(t),a(B,!0),a(_,null);const l=await J.regionConfig.get.query();if(j)return;a(g,l,!0),a(A,l,!0),a(o,t.editor.create(k,{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),P=e(o).getModel(),w.push(e(o).onDidChangeModelContent(()=>{if(!e(o))return;const n=e(o).getValue();a(g,n,!0),a(f,null);try{JSON.parse(n),a(h,null),q(n)}catch{M(),a(h,"Invalid JSON")}}))}catch(t){console.error(t),a(_,"Failed to load region config")}finally{a(B,!1)}}),ie(()=>{j=!0,M();for(const l of w)try{l.dispose()}catch{}w=[];const t=P;P=null;try{if(e(o)){try{e(o).setModel(null)}catch{}e(o).dispose()}}finally{a(o,null)}try{t==null||t.dispose()}catch{}D=null}),le(()=>{e(o)&&e(g)!==e(o).getValue()&&e(o).setValue(e(g))}),ve(W,{class:"flex h-full min-h-0 flex-col !rounded-none p-2",children:(t,l)=>{var n=ye(),b=T(n),H=E(m(b),2),U=m(H);{var G=r=>{var i=me();c(r,i)},K=r=>{var i=pe();c(r,i)};S(U,r=>{e(y)?r(G):r(K,-1)})}p(H),p(b);var X=E(b,2);{var Y=r=>{var i=ge();c(r,i)},Z=r=>{var i=_e(),C=m(i,!0);p(i),O(()=>V(C,e(_))),c(r,i)},$=r=>{var i=he(),C=T(i);{var ee=s=>{var v=L(),N=m(v,!0);p(v),O(()=>V(N,e(h))),c(s,v)};S(C,s=>{e(h)&&s(ee)})}var I=E(C,2);{var te=s=>{var v=L(),N=m(v,!0);p(v),O(()=>V(N,e(f))),c(s,v)};S(I,s=>{e(f)&&s(te)})}var ae=E(I,2);ce(ae,s=>k=s,()=>k),c(r,i)};S(X,r=>{e(B)?r(Y):e(_)?r(Z,1):r($,-1)})}c(t,n)}}),ne()}export{Be as component};
|