femo-plugin 1.0.2 → 1.0.4
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/README.md +632 -635
- package/docs/ActiveRoadmaps/ARCHITECTURE.md +466 -0
- package/docs/ActiveRoadmaps/compiler/345/244/232job/345/220/214/350/267/221/346/224/271/351/200/240-/346/226/275/345/267/245/346/270/205/345/215/225.md +164 -0
- package/docs/ActiveRoadmaps/dshAdapter-/351/207/215/346/236/204/346/226/275/345/267/245/346/270/205/345/215/225.md +154 -0
- package/docs/ActiveRoadmaps/hub/345/224/257/344/270/200/345/214/226/350/256/276/350/256/241.md +107 -0
- package/docs/ActiveRoadmaps/webAdapter-/351/235/231/351/273/230/351/230/266/346/242/257/346/226/275/345/267/245/344/272/244/346/216/245.md +158 -0
- package/docs/ActiveRoadmaps/zcode-/346/227/240/345/255/220/344/273/243/347/220/206/345/214/226/346/226/275/345/267/245/346/270/205/345/215/225.md +166 -0
- package/docs/ActiveRoadmaps//345/274/225/346/223/216/345/270/270/351/251/273/345/214/226/347/254/2542/346/255/245/344/272/244/346/216/245.md +108 -0
- package/docs/ActiveRoadmaps//345/274/225/346/223/216/345/270/270/351/251/273/350/277/233/347/250/213/346/226/275/345/267/245/346/270/205/345/215/225.md +178 -0
- package/docs/ActiveRoadmaps//346/212/225/345/275/261/345/256/277/344/270/273/346/240/207/346/263/250/344/277/256/346/255/243/350/256/276/350/256/241.md +61 -0
- package/docs/ActiveRoadmaps//346/212/225/345/275/261/351/241/265/346/213/206/345/210/206/346/226/275/345/267/245/346/270/205/345/215/225.md +116 -0
- package/docs/ActiveRoadmaps//347/224/273/345/270/203/347/233/264/350/277/236/345/274/225/346/223/216/346/226/275/345/267/245/346/270/205/345/215/225.md +259 -0
- package/docs/README.md +38 -0
- package/docs/Specs//345/205/254/345/205/261/345/261/202/350/256/276/350/256/241/347/272/246/346/235/237.md +63 -0
- package/docs/Specs//345/256/277/344/270/273/346/216/245/345/205/245/346/270/205/345/215/225.md +137 -0
- package/docs/Specs//346/212/225/345/275/261/344/270/255/345/277/203/350/241/214/345/215/217/350/256/256.md +569 -0
- package/docs/Specs//350/267/250/345/256/277/344/270/273/345/257/271/350/257/235/346/223/215/344/275/234/346/214/207/345/215/227.md +124 -0
- package/femo2host/AGENTS.md +165 -0
- package/femo2host/femoGenConnector/SKILL.common.md +232 -0
- package/femo2host/femoGenConnector/engine-client.mjs +255 -0
- package/femo2host/femoGenConnector/femogen-canvas-state.mjs +56 -0
- package/femo2host/femoGenConnector/femogen-files.d.mts +22 -0
- package/femo2host/femoGenConnector/femogen-files.mjs +208 -0
- package/femo2host/femoGenConnector/file-dialogs.d.mts +15 -0
- package/femo2host/femoGenConnector/file-dialogs.mjs +131 -0
- package/femo2host/femoGenConnector/sse-core.d.mts +40 -0
- package/femo2host/femoGenConnector/sse-core.mjs +95 -0
- package/femo2host/femoRoot.d.mts +7 -0
- package/femo2host/femoRoot.mjs +44 -0
- package/femo2host/femoToolcall/chronica.py +159 -156
- package/femo2host/femoToolcall/femo_debugger.py +1518 -1515
- package/femo2host/femo_api.py +472 -437
- package/femo2host/femo_gen_api.jsx +90 -77
- package/femo2host/host/api-retry.d.mts +44 -0
- package/femo2host/host/api-retry.mjs +155 -0
- package/femo2host/host/cast-core.d.mts +20 -0
- package/femo2host/host/cast-core.mjs +113 -0
- package/femo2host/host/daemon-client.d.mts +63 -0
- package/femo2host/host/daemon-client.mjs +606 -0
- package/femo2host/host/debug-run-core.d.mts +121 -0
- package/femo2host/host/debug-run-core.mjs +531 -0
- package/femo2host/host/delivery-queue.d.mts +18 -0
- package/femo2host/host/delivery-queue.mjs +101 -0
- package/femo2host/host/event-core.d.mts +84 -0
- package/femo2host/host/event-core.mjs +356 -0
- package/femo2host/host/femo-relation.d.mts +22 -0
- package/femo2host/host/femo-relation.mjs +39 -0
- package/femo2host/host/hub-client.d.mts +11 -0
- package/femo2host/host/hub-client.mjs +74 -0
- package/femo2host/host/hub-feed-core.d.mts +68 -0
- package/femo2host/host/hub-feed-core.mjs +274 -0
- package/femo2host/host/hub-render-core.d.mts +43 -0
- package/femo2host/host/hub-render-core.mjs +140 -0
- package/femo2host/host/mailbox-push-core.d.mts +40 -0
- package/femo2host/host/mailbox-push-core.mjs +113 -0
- package/femo2host/host/mount-registry.mjs +110 -0
- package/femo2host/host/node-retry.d.mts +37 -0
- package/femo2host/host/node-retry.mjs +200 -0
- package/femo2host/host/notice-core.d.mts +33 -0
- package/femo2host/host/notice-core.mjs +83 -0
- package/femo2host/host/projection-core.d.mts +78 -0
- package/femo2host/host/projection-core.mjs +279 -0
- package/femo2host/host/run-control-core.d.mts +23 -0
- package/femo2host/host/run-control-core.mjs +72 -0
- package/femo2host/host/run-state-core.d.mts +59 -0
- package/femo2host/host/run-state-core.mjs +173 -0
- package/femo2host/host/session-registry.mjs +56 -0
- package/femo2host/host/skill-expand.d.mts +11 -0
- package/femo2host/host/skill-expand.mjs +51 -0
- package/femo2host/host/speech-core.d.mts +43 -0
- package/femo2host/host/speech-core.mjs +75 -0
- package/femo2host/host/state-files.d.mts +35 -0
- package/femo2host/host/state-files.mjs +267 -0
- package/femo2host/host/subagent-core.d.mts +81 -0
- package/femo2host/host/subagent-core.mjs +303 -0
- package/femo2host/host/tools-core.d.mts +72 -0
- package/femo2host/host/tools-core.mjs +684 -0
- package/femo2host/host/variable-api.d.mts +23 -0
- package/femo2host/host/variable-api.mjs +90 -0
- package/femo2host/mail_courier.py +104 -0
- package/femo2host/mailbox.py +545 -0
- package/femo2host/projectionCenter/app.css +848 -0
- package/femo2host/projectionCenter/composer.mjs +272 -0
- package/femo2host/projectionCenter/debug-panel.mjs +131 -0
- package/femo2host/projectionCenter/index.html +96 -0
- package/femo2host/projectionCenter/main.mjs +479 -0
- package/femo2host/projectionCenter/panels.mjs +280 -0
- package/femo2host/projectionCenter/render.mjs +695 -0
- package/femo2host/projectionCenter/sessions.mjs +138 -0
- package/femo2host/projectionCenter/state.mjs +105 -0
- package/femo2host/projectionCenter/theme.css +250 -0
- package/femo2host/projectionCenter/util.mjs +96 -0
- package/femo2host/projection_hub.py +8422 -0
- package/femo2host/python/femo_bridge.py +2131 -0
- package/femo2host/python/femo_daemon.py +1209 -0
- package/femo2host/python/setting.py +153 -0
- package/femoBridges/ContextExample.py +167 -42
- package/femoBridges/MemoryExample.py +33 -30
- package/femoBridges/getDir/get_dir.py +32 -18
- package/femoBridges/getDir//344/275/240/345/217/257/344/273/245/350/256/276/345/256/232/344/273/273/346/204/217/346/226/207/344/273/266/345/244/271/344/270/272/347/224/250/346/210/267/346/225/260/346/215/256/346/226/207/344/273/266/345/244/271.txt +1 -1
- package/femoBridges/llmBridge.py +1 -1
- package/femoBridges/llmProviders.py +39 -35
- package/femoCompiler/AGENTS.md +185 -0
- package/femoCompiler/FEMO_CLIrenderer.py +50 -30
- package/femoCompiler/FEMO_config.py +2 -1
- package/femoCompiler/FEMO_errors.py +286 -278
- package/femoCompiler/FEMO_normalizer.py +12 -7
- package/femoCompiler/FEMO_parser.py +217 -118
- package/femoCompiler/FEMO_runtime.py +491 -251
- package/femoCompiler/FEMO_scope_resolver.py +6 -3
- package/femoCompiler/actor_resolver.py +3 -3
- package/femoCompiler/block_collector.py +31 -28
- package/femoCompiler/db_utils.py +18 -0
- package/femoCompiler/femoAsync.py +436 -401
- package/femoCompiler/host_manifest.py +22 -2
- package/femoCompiler/job_manager.py +203 -61
- package/femoCompiler/protocol.py +13 -12
- package/femoCompiler/save_dialog.py +103 -59
- package/femoCompiler/task_world.py +579 -544
- package/femoCompiler/vars/checkpoint.py +3 -3
- package/femoCompiler/vars/env.py +77 -12
- package/femoCompiler/vars/evaluator.py +11 -6
- package/femoCompiler/vars/join.py +1 -1
- package/femoCompiler/vars/model.py +7 -7
- package/femoExamples/AI/345/211/252/350/247/206/351/242/221/AI/345/211/252/350/247/206/351/242/221.femo +5 -5
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/AI/350/201/212/345/244/251/345/256/244-/345/270/246agent/347/211/210.femo +142 -0
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/AI/350/201/212/345/244/251/345/256/244.femo +111 -0
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/random_wait_time.py +80 -10
- package/{hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/LuxFiat/luxfiat.femo → femoExamples/LuxFiat/luxfiat-loop.femo} +67 -38
- package/femoExamples/LuxFiat/{luxfiat.femo → luxfiat-simple.femo} +1 -15
- package/femoExamples/LuxFiat/wait.py +2 -2
- package/femoExamples/_join_wiring_tlib.py +28 -0
- package/femoExamples/discussion.femo +7 -5
- package/femoExamples/mt_test/file_a.py +5 -0
- package/femoExamples/plan-mode.femo +55 -0
- package/femoExamples//345/237/272/347/241/200/350/277/236/351/200/232/346/265/213/350/257/225.femo +38 -0
- package/femoExamples//347/213/274/344/272/272/346/235/200/werewolf_utils2.py +248 -20
- package/femoExamples//347/213/274/344/272/272/346/235/200/werewolf_utils9.py +609 -0
- package/{hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200-/350/255/246/351/225/277/347/211/210.femo → femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200-/350/255/246/351/225/277/347/211/210-9/344/272/272/351/242/204/345/245/263/347/214/216.femo} +308 -53
- package/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200-/350/255/246/351/225/277/347/211/210.femo +222 -47
- package/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200.femo +4 -4
- package/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225/undercover_utils.py +286 -2
- package/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225//350/260/201/346/230/257/345/215/247/345/272/225-/350/217/234/345/270/202/345/234/272/345/261/200.femo +95 -3
- package/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225//350/260/201/346/230/257/345/215/247/345/272/225.femo +126 -42
- package/femoGen/AGENTS.md +145 -0
- package/femoGen/document_ch.html +20 -13
- package/femoGen/document_en.html +9 -2
- package/femoGen/index.html +4 -2
- package/femoGen/intro_ch.html +28 -26
- package/femoGen/intro_en.html +9 -2
- package/femoGen/src/FemoWorAuto.jsx +1215 -257
- package/femoGen/src/actionModal.jsx +2 -2
- package/femoGen/src/bubbleOverlay.jsx +7 -5
- package/femoGen/src/canvasNodes.jsx +261 -61
- package/femoGen/src/common.jsx +94 -20
- package/femoGen/src/debugPanel.jsx +170 -43
- package/femoGen/src/engineWatch.jsx +323 -0
- package/femoGen/src/faIcons.jsx +11 -4
- package/femoGen/src/femoDiagnostics.js +1 -1
- package/femoGen/src/femoDirBrowse.jsx +430 -0
- package/femoGen/src/femoFileList.jsx +36 -6
- package/femoGen/src/femoGenerator.jsx +9 -9
- package/femoGen/src/femoParser.jsx +2276 -2255
- package/femoGen/src/femoPreview.jsx +30 -0
- package/femoGen/src/femoSaveReminder.jsx +75 -0
- package/femoGen/src/graphBuilder.jsx +2 -2
- package/femoGen/src/indentEdit.js +81 -0
- package/femoGen/src/libPanel.jsx +1 -1
- package/femoGen/src/mobileView.jsx +2871 -2796
- package/femoGen/src/projectPanel.jsx +2 -2
- package/femoGen/src/snap.js +101 -0
- package/femoGen/src/soulModal.jsx +4 -2
- package/femoGen/src/styles/font.css +13 -10
- package/femoGen/src/themes.js +297 -12
- package/femoGen/src/watchMirror.js +170 -0
- package/femoGen/vite.config.js +33 -28
- package/hostAdapter/dshAdapter/README.md +112 -68
- package/hostAdapter/dshAdapter/build.mjs +49 -6
- package/hostAdapter/dshAdapter/check-imports.mjs +85 -0
- package/hostAdapter/dshAdapter/client/client-ui/cast-button.tsx +232 -0
- package/hostAdapter/dshAdapter/client/{lineage-fork-native.jsx → client-ui/catalog-dropdown.jsx} +689 -624
- package/hostAdapter/dshAdapter/client/client-ui/chat-node.tsx +12 -9
- package/hostAdapter/dshAdapter/client/client-ui/composer-common.tsx +74 -0
- package/hostAdapter/dshAdapter/client/client-ui/composer-permission.tsx +183 -0
- package/hostAdapter/dshAdapter/client/client-ui/composer-ring.tsx +196 -0
- package/hostAdapter/dshAdapter/client/client-ui/composer-run-state.tsx +134 -0
- package/hostAdapter/dshAdapter/client/client-ui/composer-stats.tsx +163 -0
- package/hostAdapter/dshAdapter/client/client-ui/composer.tsx +417 -1100
- package/hostAdapter/dshAdapter/client/client-ui/editor-page.tsx +747 -726
- package/hostAdapter/dshAdapter/client/client-ui/editor-view.tsx +89 -88
- package/hostAdapter/dshAdapter/client/client-ui/hub-constants.ts +10 -0
- package/hostAdapter/dshAdapter/client/client-ui/hub-window.tsx +545 -0
- package/hostAdapter/dshAdapter/client/client-ui/primitives-compat.ts +39 -0
- package/hostAdapter/dshAdapter/client/client-ui/proj2/frame-router.ts +17 -52
- package/hostAdapter/dshAdapter/client/client-ui/proj2/index.ts +1 -1
- package/hostAdapter/dshAdapter/client/client-ui/proj2/ledger.ts +12 -12
- package/hostAdapter/dshAdapter/client/client-ui/proj2/turn-view.tsx +8 -16
- package/hostAdapter/dshAdapter/client/client-ui/proj2/window-id.ts +8 -9
- package/hostAdapter/dshAdapter/client/client-ui/stream-store.ts +187 -550
- package/hostAdapter/dshAdapter/client/client-ui/styles.ts +4 -10
- package/hostAdapter/dshAdapter/client/client-ui/view-button.tsx +550 -572
- package/hostAdapter/dshAdapter/client/client-ui/view-state.ts +1 -1
- package/hostAdapter/dshAdapter/client/client.tsx +611 -518
- package/hostAdapter/dshAdapter/client/femo-reasoning-row.tsx +104 -103
- package/hostAdapter/dshAdapter/client/femo-tool-row.tsx +264 -0
- package/hostAdapter/dshAdapter/client/lineage-fork.jsx +55 -570
- package/hostAdapter/dshAdapter/dshPatch/DSH-0.1.2-fork/344/277/256/346/224/271/351/234/200/346/261/202.md +4 -4
- package/hostAdapter/dshAdapter/dshPatch/patch-dsh-0.1.2-alpha.1.py +1 -1
- package/{femo2host/femoToolcall → hostAdapter/dshAdapter}/femo-chat.mjs +4 -2
- package/hostAdapter/dshAdapter/host/actor-name.ts +30 -0
- package/hostAdapter/dshAdapter/host/actor-usage.ts +54 -0
- package/hostAdapter/dshAdapter/host/actors/dispatch.ts +152 -0
- package/hostAdapter/dshAdapter/host/actors/main/capture.ts +219 -0
- package/hostAdapter/dshAdapter/host/actors/main/delivery.ts +233 -0
- package/hostAdapter/dshAdapter/host/actors/main/index.ts +420 -0
- package/hostAdapter/dshAdapter/host/actors/main/notice.ts +180 -0
- package/hostAdapter/dshAdapter/host/actors/native/child-setup.ts +103 -0
- package/hostAdapter/dshAdapter/host/actors/native/index.ts +672 -0
- package/hostAdapter/dshAdapter/host/actors/native/registry.ts +55 -0
- package/hostAdapter/dshAdapter/host/actors/native/turn-watch.ts +159 -0
- package/hostAdapter/dshAdapter/host/api-retry.ts +30 -123
- package/hostAdapter/dshAdapter/host/bridge-supervisor.ts +96 -0
- package/hostAdapter/dshAdapter/host/bridge.ts +147 -224
- package/hostAdapter/dshAdapter/host/compat/dsh-session-host.ts +46 -0
- package/hostAdapter/dshAdapter/host/{list-cache.ts → compat/list-cache.ts} +1 -1
- package/hostAdapter/dshAdapter/host/compat/plugin-source.ts +41 -0
- package/hostAdapter/dshAdapter/host/config.ts +149 -124
- package/hostAdapter/dshAdapter/host/debug-run.ts +274 -793
- package/hostAdapter/dshAdapter/host/diag/debug-log.ts +44 -0
- package/hostAdapter/dshAdapter/host/{diag-feed.ts → diag/diag-feed.ts} +11 -18
- package/hostAdapter/dshAdapter/host/{host-log.ts → diag/host-log.ts} +1 -1
- package/hostAdapter/dshAdapter/host/engine-transcript.ts +2 -2
- package/hostAdapter/dshAdapter/host/events/engine-events.ts +747 -0
- package/hostAdapter/dshAdapter/host/events/mailbox-push.ts +332 -0
- package/hostAdapter/dshAdapter/host/{pre-step-gate.ts → events/pre-step-gate.ts} +26 -32
- package/hostAdapter/dshAdapter/host/femo-files.ts +6 -207
- package/hostAdapter/dshAdapter/host/femo-skill.ts +153 -0
- package/hostAdapter/dshAdapter/host/femoIdentity.ts +101 -0
- package/hostAdapter/dshAdapter/host/http.ts +10 -12
- package/hostAdapter/dshAdapter/host/hub/god-mirror.ts +307 -0
- package/hostAdapter/dshAdapter/host/hub/hub-feed.ts +129 -0
- package/hostAdapter/dshAdapter/host/hub/hub-proxy.ts +203 -0
- package/hostAdapter/dshAdapter/host/{stream-frames.ts → hub/stream-frames.ts} +36 -77
- package/hostAdapter/dshAdapter/host/index.ts +354 -638
- package/hostAdapter/dshAdapter/host/job-index.ts +36 -0
- package/hostAdapter/dshAdapter/host/main-actor.ts +24 -853
- package/hostAdapter/dshAdapter/host/main-delivery-queue.ts +5 -112
- package/hostAdapter/dshAdapter/host/node-retry.ts +22 -246
- package/hostAdapter/dshAdapter/host/persona.ts +50 -96
- package/hostAdapter/dshAdapter/host/projection/hub-anchor.ts +21 -0
- package/hostAdapter/dshAdapter/host/{projection.ts → projection/projection.ts} +112 -188
- package/hostAdapter/dshAdapter/host/{windowing-native.ts → projection/windowing-native.ts} +35 -37
- package/hostAdapter/dshAdapter/host/routes/dialogs.ts +63 -0
- package/hostAdapter/dshAdapter/host/routes/engine-gateway.ts +128 -0
- package/hostAdapter/dshAdapter/host/routes/index.ts +603 -0
- package/hostAdapter/dshAdapter/host/{projection-input.ts → routes/projection-input.ts} +255 -246
- package/hostAdapter/dshAdapter/host/routes/projection.ts +174 -0
- package/hostAdapter/dshAdapter/host/routes/run.ts +127 -0
- package/hostAdapter/dshAdapter/host/routes/script-files.ts +68 -0
- package/hostAdapter/dshAdapter/host/routes/state.ts +273 -0
- package/hostAdapter/dshAdapter/host/run-control.ts +687 -641
- package/hostAdapter/dshAdapter/host/session-roster.ts +407 -0
- package/hostAdapter/dshAdapter/host/sse.ts +27 -0
- package/hostAdapter/dshAdapter/host/state-files.ts +13 -301
- package/hostAdapter/dshAdapter/host/tool-deps.ts +299 -0
- package/hostAdapter/dshAdapter/host/tools.ts +395 -486
- package/hostAdapter/dshAdapter/host/verbs.ts +81 -0
- package/hostAdapter/dshAdapter/host.manifest.json +2 -1
- package/hostAdapter/dshAdapter/lib/client.js +9209 -6558
- package/hostAdapter/dshAdapter/lib/client.js.map +4 -4
- package/hostAdapter/dshAdapter/lib/index.js +13 -8213
- package/hostAdapter/dshAdapter/lib/index.js.map +4 -4
- package/hostAdapter/dshAdapter/lib/main.js +10154 -0
- package/hostAdapter/dshAdapter/lib/main.js.map +7 -0
- package/hostAdapter/dshAdapter/package.json +5 -4
- package/hostAdapter/dshAdapter/pnpm-lock.yaml +606 -596
- package/hostAdapter/dshAdapter/shared/window-id.d.mts +5 -0
- package/hostAdapter/dshAdapter/shared/window-id.mjs +22 -0
- package/hostAdapter/dshAdapter/tsconfig.host-verify.json +6 -0
- package/hostAdapter/dshAdapter/tsconfig.json +1 -3
- package/hostAdapter/webAdapter/AGENTS.md +203 -0
- package/hostAdapter/webAdapter/console/index.html +760 -0
- package/hostAdapter/webAdapter/extension/background.js +738 -0
- package/hostAdapter/webAdapter/extension/bubble.js +201 -0
- package/hostAdapter/webAdapter/extension/icons/icon128.png +0 -0
- package/hostAdapter/webAdapter/extension/icons/icon16.png +0 -0
- package/hostAdapter/webAdapter/extension/icons/icon32.png +0 -0
- package/hostAdapter/webAdapter/extension/icons/icon48.png +0 -0
- package/hostAdapter/webAdapter/extension/seat-agent-core.js +791 -0
- package/hostAdapter/webAdapter/extension/sidepanel/conn.mjs +25 -0
- package/hostAdapter/webAdapter/extension/sidepanel/feeds.mjs +57 -0
- package/hostAdapter/webAdapter/extension/sidepanel/human-seat.mjs +111 -0
- package/hostAdapter/webAdapter/extension/sidepanel/main.mjs +186 -0
- package/hostAdapter/webAdapter/extension/sidepanel/run-control.mjs +183 -0
- package/hostAdapter/webAdapter/extension/sidepanel/seats.mjs +172 -0
- package/hostAdapter/webAdapter/extension/sidepanel/svclog.mjs +78 -0
- package/hostAdapter/webAdapter/extension/sidepanel.html +600 -0
- package/hostAdapter/webAdapter/manifest.json +158 -0
- package/hostAdapter/webAdapter/native/install-native-host.cmd +8 -0
- package/hostAdapter/webAdapter/native/install-native-host.mjs +27 -0
- package/hostAdapter/webAdapter/native/register-core.mjs +101 -0
- package/hostAdapter/webAdapter/native/web-launcher.cs +141 -0
- package/hostAdapter/webAdapter/native/web-launcher.mjs +160 -0
- package/hostAdapter/webAdapter/package.json +13 -0
- package/hostAdapter/webAdapter/readme.md +365 -0
- package/hostAdapter/webAdapter/server/board.mjs +42 -0
- package/hostAdapter/webAdapter/server/bridge.mjs +68 -0
- package/hostAdapter/webAdapter/server/canvas.mjs +520 -0
- package/hostAdapter/webAdapter/server/http-io.mjs +20 -0
- package/hostAdapter/webAdapter/server/keeper.mjs +114 -0
- package/hostAdapter/webAdapter/server/mailbox-push.mjs +184 -0
- package/hostAdapter/webAdapter/server/runtime.mjs +1025 -0
- package/hostAdapter/webAdapter/server/seats.mjs +239 -0
- package/hostAdapter/webAdapter/server/service.mjs +1051 -0
- package/hostAdapter/webAdapter/shared/dom.mjs +33 -0
- package/hostAdapter/webAdapter/shared/femo-logo.mjs +36 -0
- package/hostAdapter/webAdapter/shared/guard.mjs +28 -0
- package/hostAdapter/webAdapter/shared/human-seat-core.mjs +56 -0
- package/hostAdapter/webAdapter/shared/run-core.mjs +20 -0
- package/hostAdapter/webAdapter/shared/seats-core.mjs +73 -0
- package/hostAdapter/webAdapter/sites/aistudio.google.com/SITE.md +66 -0
- package/hostAdapter/webAdapter/sites/aistudio.google.com/content.js +144 -0
- package/hostAdapter/webAdapter/sites/aistudio.google.com/inject.js +240 -0
- package/hostAdapter/webAdapter/sites/aistudio.google.com/site.mjs +70 -0
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/SITE.md +77 -0
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/content.js +103 -0
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/inject.js +181 -0
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/site.mjs +73 -0
- package/hostAdapter/webAdapter/sites/chatglm.cn/SITE.md +63 -0
- package/hostAdapter/webAdapter/sites/chatglm.cn/content.js +121 -0
- package/hostAdapter/webAdapter/sites/chatglm.cn/inject.js +190 -0
- package/hostAdapter/webAdapter/sites/chatglm.cn/site.mjs +63 -0
- package/hostAdapter/webAdapter/sites/chatgpt.com/SITE.md +58 -0
- package/hostAdapter/webAdapter/sites/chatgpt.com/content.js +124 -0
- package/hostAdapter/webAdapter/sites/chatgpt.com/inject.js +404 -0
- package/hostAdapter/webAdapter/sites/chatgpt.com/site.mjs +68 -0
- package/hostAdapter/webAdapter/sites/grok.com/SITE.md +42 -0
- package/hostAdapter/webAdapter/sites/grok.com/content.js +120 -0
- package/hostAdapter/webAdapter/sites/grok.com/inject.js +259 -0
- package/hostAdapter/webAdapter/sites/grok.com/site.mjs +73 -0
- package/hostAdapter/webAdapter/sites/www.doubao.com/SITE.md +62 -0
- package/hostAdapter/webAdapter/sites/www.doubao.com/content.js +115 -0
- package/hostAdapter/webAdapter/sites/www.doubao.com/inject.js +232 -0
- package/hostAdapter/webAdapter/sites/www.doubao.com/site.mjs +62 -0
- package/hostAdapter/webAdapter/sites/www.kimi.com/SITE.md +57 -0
- package/hostAdapter/webAdapter/sites/www.kimi.com/content.js +117 -0
- package/hostAdapter/webAdapter/sites/www.kimi.com/inject.js +194 -0
- package/hostAdapter/webAdapter/sites/www.kimi.com/site.mjs +61 -0
- package/hostAdapter/webAdapter/sites/www.qianwen.com/SITE.md +43 -0
- package/hostAdapter/webAdapter/sites/www.qianwen.com/content.js +123 -0
- package/hostAdapter/webAdapter/sites/www.qianwen.com/inject.js +273 -0
- package/hostAdapter/webAdapter/sites/www.qianwen.com/site.mjs +72 -0
- package/hostAdapter/webAdapter/sites.mjs +67 -0
- package/hostAdapter/webAdapter/start-service.cmd +13 -0
- package/hostAdapter/webAdapter/tests/canvas-files.test.mjs +134 -0
- package/hostAdapter/webAdapter/tests/chatgpt-parser.test.mjs +161 -0
- package/hostAdapter/webAdapter/tests/doubao-parser.test.mjs +151 -0
- package/hostAdapter/webAdapter/tests/keeper.test.mjs +108 -0
- package/hostAdapter/webAdapter/tests/runtime.test.mjs +962 -0
- package/hostAdapter/webAdapter/tests/seats-core.test.mjs +134 -0
- package/hostAdapter/webAdapter/tests/site-boundary.test.mjs +161 -0
- package/hostAdapter/webAdapter/tests/smoke-bridge.mjs +65 -0
- package/hostAdapter/webAdapter/tests/smoke-service.mjs +232 -0
- package/hostAdapter/webAdapter/web.host.manifest.json +6 -0
- package/hostAdapter/zcodeAdapter/.zcode-plugin/plugin.json +23 -23
- package/hostAdapter/zcodeAdapter/README.md +73 -61
- package/hostAdapter/zcodeAdapter/commands/femo.md +8 -9
- package/hostAdapter/zcodeAdapter/hooks/hooks.json +13 -16
- package/hostAdapter/zcodeAdapter/hooks/lib.mjs +318 -59
- package/hostAdapter/zcodeAdapter/hooks/mail-context.mjs +4 -0
- package/hostAdapter/zcodeAdapter/hooks/stop-intent.mjs +4 -3
- package/hostAdapter/zcodeAdapter/hooks/turn-collect.mjs +3 -0
- package/hostAdapter/zcodeAdapter/icon.png +0 -0
- package/hostAdapter/zcodeAdapter/mcp/engine-bind.mjs +56 -0
- package/hostAdapter/zcodeAdapter/mcp/event-router.mjs +42 -258
- package/hostAdapter/zcodeAdapter/mcp/femo-server.mjs +198 -320
- package/hostAdapter/zcodeAdapter/paths.mjs +78 -0
- package/hostAdapter/zcodeAdapter/runtime/femo-possess.mjs +356 -0
- package/hostAdapter/zcodeAdapter/runtime/femo-stream-watcher.mjs +214 -0
- package/hostAdapter/zcodeAdapter/runtime/mailbox-cli.mjs +33 -0
- package/hostAdapter/zcodeAdapter/runtime/pulled-letter.mjs +36 -0
- package/hostAdapter/zcodeAdapter/runtime/speech-collect.mjs +547 -0
- package/hostAdapter/zcodeAdapter/skills/femo/SKILL.md +52 -89
- package/hostAdapter/zcodeAdapter/tests/bridge-smoke.mjs +16 -6
- package/hostAdapter/zcodeAdapter/tests/event-router.test.mjs +160 -157
- package/hostAdapter/zcodeAdapter/tests/harness.mjs +91 -0
- package/hostAdapter/zcodeAdapter/tests/hooks-smoke.mjs +205 -0
- package/hostAdapter/zcodeAdapter/tests/integration-human.mjs +34 -17
- package/hostAdapter/zcodeAdapter/tests/main-actor.mjs +203 -107
- package/hostAdapter/zcodeAdapter/tests/mcp-smoke.mjs +100 -130
- package/hostAdapter/zcodeAdapter/tests/memory-store.mjs +72 -0
- package/hostAdapter/zcodeAdapter/tests/modelio-weave.test.mjs +82 -0
- package/hostAdapter/zcodeAdapter/tests/mount-state.test.mjs +150 -0
- package/hostAdapter/zcodeAdapter/tests/pulled-letter.test.mjs +77 -0
- package/hostAdapter/zcodeAdapter/tests/run-state-core.test.mjs +95 -0
- package/hostAdapter/zcodeAdapter/tests/speech-draft.mjs +163 -0
- package/hostAdapter/zcodeAdapter/tests/stream-watcher.test.mjs +154 -0
- package/hostAdapter/zcodeAdapter/tests/turn-marker.test.mjs +110 -0
- package/hostAdapter/zcodeAdapter/tests/unbound-actors.test.mjs +48 -0
- package/hostAdapter/zcodeAdapter/tests/variable-api.test.mjs +79 -0
- package/hostAdapter/zcodeAdapter/zcode.host.manifest.json +2 -1
- package/package.json +2 -2
- package//350/257/255/346/263/225/346/226/207/346/241/243.md +1202 -1136
- package/FEMO_logo.svg +0 -55
- package/FEMO_logo_slogan.svg +0 -29
- package/_tmp/fallback/driver2.py +0 -176
- package/_tmp/fallback/events.jsonl +0 -108
- package/_tmp/fallback/gateway_ui.py +0 -325
- package/_tmp/fallback/outbox/j1553_human_[/347/234/213/347/211/214]_1.done +0 -1
- package/_tmp/fallback/outbox/r1.done +0 -1
- package/_tmp/fallback/outbox/r2.done +0 -1
- package/_tmp/fallback/outbox/r3.done +0 -1
- package/_tmp/fallback/outbox/r4.done +0 -1
- package/_tmp/fallback/outbox/r5.done +0 -1
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/group-chat.femo +0 -42
- package/femoGen/src/useCanvasInteraction.jsx +0 -319
- package/hostAdapter/dshAdapter/client/client-ui/femo-stream-live.tsx +0 -264
- package/hostAdapter/dshAdapter/dshPatch/MEOW_MODIFICATIONS.md +0 -3105
- package/hostAdapter/dshAdapter/host/debug-log.ts +0 -29
- package/hostAdapter/dshAdapter/host/engine-events.ts +0 -894
- package/hostAdapter/dshAdapter/host/god-mirror.ts +0 -234
- package/hostAdapter/dshAdapter/host/preset-install.ts +0 -59
- package/hostAdapter/dshAdapter/host/proj-trace.ts +0 -49
- package/hostAdapter/dshAdapter/host/routes.ts +0 -1196
- package/hostAdapter/dshAdapter/host/section-gate.ts +0 -108
- package/hostAdapter/dshAdapter/host/subagent-native.ts +0 -997
- package/hostAdapter/dshAdapter/host/subagent.ts +0 -1205
- package/hostAdapter/dshAdapter/package-lock.json +0 -500
- package/hostAdapter/dshAdapter/preset/agent.cordis.yml +0 -220
- package/hostAdapter/dshAdapter/preset/preset.yml +0 -3
- package/hostAdapter/dshAdapter/python/dev-bridge-test.py +0 -43
- package/hostAdapter/dshAdapter/python/femo_bridge.py +0 -533
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/gateway.port +0 -1
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-a-_40_52a9_624b.jsonl +0 -3
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-a-_40_6211.jsonl +0 -10
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-god.jsonl +0 -11
- package/hostAdapter/zcodeAdapter/.tmp/femo/host-history/proj-mirror/femo-main-stage.jsonl +0 -11
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/.zcode-plugin/plugin.json +0 -23
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/LICENSE +0 -201
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/README.md +0 -635
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/commands/femo.md +0 -9
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/__init__.py +0 -4
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femoToolcall/chronica.py +0 -156
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femoToolcall/femo-chat.mjs +0 -69
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femoToolcall/femo_debugger.py +0 -1515
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femo_api.py +0 -437
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femo2host/femo_gen_api.jsx +0 -77
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/ContextExample.py +0 -555
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/MemoryExample.py +0 -163
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/__init__.py +0 -1
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/getDir/get_dir.py +0 -56
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/getDir//344/275/240/345/217/257/344/273/245/350/256/276/345/256/232/344/273/273/346/204/217/346/226/207/344/273/266/345/244/271/344/270/272/347/224/250/346/210/267/346/225/260/346/215/256/346/226/207/344/273/266/345/244/271.txt +0 -10
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/llmBridge.py +0 -247
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoBridges/llmProviders.py +0 -308
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_CLIrenderer.py +0 -198
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_config.py +0 -35
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_errors.py +0 -278
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_interpreter.py +0 -163
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_normalizer.py +0 -396
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_parser.py +0 -2468
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_runtime.py +0 -3630
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/FEMO_scope_resolver.py +0 -209
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/__init__.py +0 -1
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/actor_resolver.py +0 -86
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/block_collector.py +0 -441
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/db_utils.py +0 -485
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/femoAsync.py +0 -401
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/host_manifest.py +0 -68
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/job_manager.py +0 -767
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/protocol.py +0 -126
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/save_dialog.py +0 -402
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/task_world.py +0 -544
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/__init__.py +0 -19
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/checkpoint.py +0 -113
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/env.py +0 -686
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/evaluator.py +0 -567
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/join.py +0 -303
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/merge.py +0 -157
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoCompiler/vars/model.py +0 -245
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/AI/345/211/252/350/247/206/351/242/221/AI/345/211/252/350/247/206/351/242/221.femo +0 -192
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/AI/350/201/212/345/244/251/345/256/244/group-chat.femo +0 -42
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/AI/350/201/212/345/244/251/345/256/244/random_wait_time.py +0 -10
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/LuxFiat/wait.py +0 -29
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/debug/347/245/236/345/231/250/debug/347/245/236/345/231/250.femo +0 -222
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/discussion.femo +0 -70
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples/goal-mode.femo +0 -23
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//345/270/270/347/224/250/345/267/245/345/205/267python/wait.py +0 -29
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//347/213/274/344/272/272/346/235/200/werewolf_utils.py +0 -205
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//347/213/274/344/272/272/346/235/200/werewolf_utils2.py +0 -324
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200.femo +0 -331
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225/undercover_utils.py +0 -683
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225//350/260/201/346/230/257/345/215/247/345/272/225-/350/217/234/345/270/202/345/234/272/345/261/200.femo +0 -348
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225//350/260/201/346/230/257/345/215/247/345/272/225.femo +0 -393
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/after-tool.mjs +0 -3
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/hooks.json +0 -16
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/lib.mjs +0 -59
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/prompt-state.mjs +0 -3
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/session-start.mjs +0 -3
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hooks/stop-intent.mjs +0 -3
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hostAdapter/dshAdapter/python/dev-bridge-test.py +0 -43
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/hostAdapter/dshAdapter/python/femo_bridge.py +0 -533
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/bridge-manager.mjs +0 -192
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/event-router.mjs +0 -258
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/femo-server.mjs +0 -429
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/gateway.mjs +0 -163
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/mcp/projection-writer.mjs +0 -294
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/skills/femo/SKILL.md +0 -93
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/bridge-smoke.mjs +0 -26
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/event-router.test.mjs +0 -157
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/gateway-smoke.mjs +0 -107
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/integration-human.mjs +0 -111
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/main-actor.mjs +0 -107
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/mcp-smoke.mjs +0 -130
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/tests/projection-writer.test.mjs +0 -144
- package/hostAdapter/zcodeAdapter/femo-zcode-dist/zcode.host.manifest.json +0 -5
- package/hostAdapter/zcodeAdapter/femo-zcode-dist//346/212/225/345/275/261/347/252/227/351/207/215/350/256/276/350/256/241-/350/256/250/350/256/272/347/250/277.md +0 -113
- package/hostAdapter/zcodeAdapter/femo-zcode-dist//350/257/255/346/263/225/346/226/207/346/241/243.md +0 -1136
- package/hostAdapter/zcodeAdapter/hooks/after-tool.mjs +0 -3
- package/hostAdapter/zcodeAdapter/hooks/prompt-state.mjs +0 -3
- package/hostAdapter/zcodeAdapter/hooks/session-start.mjs +0 -3
- package/hostAdapter/zcodeAdapter/mcp/bridge-manager.mjs +0 -192
- package/hostAdapter/zcodeAdapter/mcp/gateway.mjs +0 -163
- package/hostAdapter/zcodeAdapter/mcp/projection-writer.mjs +0 -294
- package/hostAdapter/zcodeAdapter/tests/gateway-smoke.mjs +0 -107
- package/hostAdapter/zcodeAdapter/tests/projection-writer.test.mjs +0 -144
- package/hostAdapter/zcodeAdapter//346/212/225/345/275/261/347/252/227/351/207/215/350/256/276/350/256/241-/350/256/250/350/256/272/347/250/277.md +0 -113
- package/scripts/diag-find-redblue.mjs +0 -38
- package/scripts/diag-god-log.mjs +0 -31
- package/scripts/diag-god-log2.mjs +0 -39
- package/scripts/diag-god-log3.mjs +0 -35
- package/scripts/diag-god-log4.mjs +0 -59
- package/scripts/diag-god-log4b.mjs +0 -39
- package/scripts/diag-redblue-god.mjs +0 -39
- package/scripts/diag-redblue-log.mjs +0 -37
- package/scripts/diag-redblue-span.mjs +0 -41
- package/scripts/diag-stage-1017.mjs +0 -63
- package/scripts/dump_session.py +0 -36
- package/scripts/link-workspace.ps1 +0 -51
- package/scripts/list_souls.py +0 -18
- package/scripts/probe-composer-refresh.mjs +0 -197
- package/scripts/seed_story_souls.py +0 -86
- package/scripts/sync-zcode-dist.ps1 +0 -55
- package/scripts/theme-tokenize/color-extract.txt +0 -288
- package/scripts/theme-tokenize/round1-quoted.ps1 +0 -149
- package/scripts/theme-tokenize/round2-bare.ps1 +0 -138
- package/scripts/theme-tokenize/round3-shape.ps1 +0 -110
- package/tests/_diag_r4_join.femo +0 -32
- package/tests/conftest.py +0 -95
- package/tests/diag-subagent-dir-3081.mjs +0 -101
- package/tests/femoGenerator.test.mjs +0 -3909
- package/tests/femoParser.test.mjs +0 -4813
- package/tests/femogen_notice.test.mjs +0 -109
- package/tests/femoparser_validation.test.mjs +0 -84
- package/tests/main-delivery-queue.test.mjs +0 -329
- package/tests/pre-step-gate.test.mjs +0 -282
- package/tests/read-subagent-model.mjs +0 -24
- package/tests/run-script-tests.py +0 -97
- package/tests/safe-steer.test.mjs +0 -59
- package/tests/strip_comments.test.mjs +0 -164
- package/tests/test_actor_failed.py +0 -92
- package/tests/test_compile_warnings.py +0 -99
- package/tests/test_debug_log_bus.py +0 -108
- package/tests/test_debugger_module_mode.py +0 -141
- package/tests/test_error_buckets.py +0 -117
- package/tests/test_error_dispatcher.py +0 -261
- package/tests/test_exec_ai_retry.py +0 -155
- package/tests/test_exec_human_retry.py +0 -159
- package/tests/test_file_resolve.py +0 -104
- package/tests/test_flow_events.py +0 -311
- package/tests/test_flow_ref_validation.py +0 -92
- package/tests/test_func_dict_fallback.py +0 -39
- package/tests/test_job_lifecycle.py +0 -236
- package/tests/test_job_manager.py +0 -424
- package/tests/test_mind.py +0 -99
- package/tests/test_module_call_args.py +0 -258
- package/tests/test_module_visibility.py +0 -238
- package/tests/test_notice.py +0 -143
- package/tests/test_out_whitelist.py +0 -83
- package/tests/test_par_if_dispatch.py +0 -64
- package/tests/test_par_nested_for.py +0 -78
- package/tests/test_parser.py +0 -494
- package/tests/test_pause.py +0 -102
- package/tests/test_pause_contract.py +0 -135
- package/tests/test_protocol_transcript.py +0 -158
- package/tests/test_scope_self.py +0 -202
- package/tests/test_source_validate.py +0 -113
- package/tests/test_task_world.py +0 -447
- package/tests/test_town_structure.py +0 -70
- package/tests/test_v2_checkpoint.py +0 -115
- package/tests/test_v2_env.py +0 -383
- package/tests/test_v2_evaluator.py +0 -227
- package/tests/test_v2_join.py +0 -315
- package/tests/test_v2_join_wiring.py +0 -429
- package/tests/test_v2_merge.py +0 -167
- package/tests/test_v2_model.py +0 -143
- package/tests/test_v2_resume_e2e.py +0 -472
- package/tests/test_var_decls.py +0 -271
- package/tests/verify-model-functions.mjs +0 -90
- package/tests/verify-subagent-model-3081.mjs +0 -153
- package//346/226/275/345/267/245/346/270/205/345/215/225/node-notice-/346/226/275/345/267/245/346/270/205/345/215/225.md +0 -395
- package//346/226/275/345/267/245/346/270/205/345/215/225//344/270/244/344/270/252/345/276/205/350/247/243/345/206/263/347/232/204/351/227/256/351/242/230.MD +0 -66
- package//346/226/275/345/267/245/346/270/205/345/215/225//345/201/234/346/255/242/351/223/276/344/277/256/345/244/215-/346/226/275/345/267/245/346/270/205/345/215/225.md +0 -475
- package//346/226/275/345/267/245/346/270/205/345/215/225//345/217/230/351/207/217/344/270/216task/347/263/273/347/273/237/351/207/215/346/236/204-/346/226/275/345/267/245/346/270/205/345/215/225-v2.md +0 -847
- package//346/226/275/345/267/245/346/270/205/345/215/225//350/277/220/350/241/214/347/212/266/346/200/201/351/223/276/350/267/257/351/207/215/346/236/204-/346/226/275/345/267/245/346/270/205/345/215/225v4.md +0 -654
- package//346/226/275/345/267/245/346/270/205/345/215/225//351/224/231/350/257/257/346/263/250/345/205/245/347/273/255/350/201/212-/346/226/275/345/267/245/346/270/205/345/215/225.md +0 -471
- /package/hostAdapter/dshAdapter/host/{native-state.ts → compat/native-state.ts} +0 -0
- /package/hostAdapter/dshAdapter/host/{session-events.ts → compat/session-events.ts} +0 -0
|
@@ -1,4813 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
// femoGen/node_modules/react/cjs/react.development.js
|
|
28
|
-
var require_react_development = __commonJS({
|
|
29
|
-
"femoGen/node_modules/react/cjs/react.development.js"(exports, module) {
|
|
30
|
-
"use strict";
|
|
31
|
-
if (true) {
|
|
32
|
-
(function() {
|
|
33
|
-
"use strict";
|
|
34
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
35
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
36
|
-
}
|
|
37
|
-
var ReactVersion = "18.3.1";
|
|
38
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
39
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
40
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
41
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
42
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
43
|
-
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
44
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
45
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
46
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
47
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
48
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
49
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
50
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
51
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
52
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
53
|
-
function getIteratorFn(maybeIterable) {
|
|
54
|
-
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
58
|
-
if (typeof maybeIterator === "function") {
|
|
59
|
-
return maybeIterator;
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
var ReactCurrentDispatcher = {
|
|
64
|
-
/**
|
|
65
|
-
* @internal
|
|
66
|
-
* @type {ReactComponent}
|
|
67
|
-
*/
|
|
68
|
-
current: null
|
|
69
|
-
};
|
|
70
|
-
var ReactCurrentBatchConfig = {
|
|
71
|
-
transition: null
|
|
72
|
-
};
|
|
73
|
-
var ReactCurrentActQueue = {
|
|
74
|
-
current: null,
|
|
75
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
|
|
76
|
-
isBatchingLegacy: false,
|
|
77
|
-
didScheduleLegacyUpdate: false
|
|
78
|
-
};
|
|
79
|
-
var ReactCurrentOwner = {
|
|
80
|
-
/**
|
|
81
|
-
* @internal
|
|
82
|
-
* @type {ReactComponent}
|
|
83
|
-
*/
|
|
84
|
-
current: null
|
|
85
|
-
};
|
|
86
|
-
var ReactDebugCurrentFrame = {};
|
|
87
|
-
var currentExtraStackFrame = null;
|
|
88
|
-
function setExtraStackFrame(stack) {
|
|
89
|
-
{
|
|
90
|
-
currentExtraStackFrame = stack;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
{
|
|
94
|
-
ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
|
|
95
|
-
{
|
|
96
|
-
currentExtraStackFrame = stack;
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
100
|
-
ReactDebugCurrentFrame.getStackAddendum = function() {
|
|
101
|
-
var stack = "";
|
|
102
|
-
if (currentExtraStackFrame) {
|
|
103
|
-
stack += currentExtraStackFrame;
|
|
104
|
-
}
|
|
105
|
-
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
106
|
-
if (impl) {
|
|
107
|
-
stack += impl() || "";
|
|
108
|
-
}
|
|
109
|
-
return stack;
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
var enableScopeAPI = false;
|
|
113
|
-
var enableCacheElement = false;
|
|
114
|
-
var enableTransitionTracing = false;
|
|
115
|
-
var enableLegacyHidden = false;
|
|
116
|
-
var enableDebugTracing = false;
|
|
117
|
-
var ReactSharedInternals = {
|
|
118
|
-
ReactCurrentDispatcher,
|
|
119
|
-
ReactCurrentBatchConfig,
|
|
120
|
-
ReactCurrentOwner
|
|
121
|
-
};
|
|
122
|
-
{
|
|
123
|
-
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
124
|
-
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
|
125
|
-
}
|
|
126
|
-
function warn(format) {
|
|
127
|
-
{
|
|
128
|
-
{
|
|
129
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
130
|
-
args[_key - 1] = arguments[_key];
|
|
131
|
-
}
|
|
132
|
-
printWarning("warn", format, args);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function error(format) {
|
|
137
|
-
{
|
|
138
|
-
{
|
|
139
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
140
|
-
args[_key2 - 1] = arguments[_key2];
|
|
141
|
-
}
|
|
142
|
-
printWarning("error", format, args);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function printWarning(level, format, args) {
|
|
147
|
-
{
|
|
148
|
-
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
149
|
-
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
150
|
-
if (stack !== "") {
|
|
151
|
-
format += "%s";
|
|
152
|
-
args = args.concat([stack]);
|
|
153
|
-
}
|
|
154
|
-
var argsWithFormat = args.map(function(item) {
|
|
155
|
-
return String(item);
|
|
156
|
-
});
|
|
157
|
-
argsWithFormat.unshift("Warning: " + format);
|
|
158
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
var didWarnStateUpdateForUnmountedComponent = {};
|
|
162
|
-
function warnNoop(publicInstance, callerName) {
|
|
163
|
-
{
|
|
164
|
-
var _constructor = publicInstance.constructor;
|
|
165
|
-
var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
|
|
166
|
-
var warningKey = componentName + "." + callerName;
|
|
167
|
-
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
|
|
171
|
-
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
var ReactNoopUpdateQueue = {
|
|
175
|
-
/**
|
|
176
|
-
* Checks whether or not this composite component is mounted.
|
|
177
|
-
* @param {ReactClass} publicInstance The instance we want to test.
|
|
178
|
-
* @return {boolean} True if mounted, false otherwise.
|
|
179
|
-
* @protected
|
|
180
|
-
* @final
|
|
181
|
-
*/
|
|
182
|
-
isMounted: function(publicInstance) {
|
|
183
|
-
return false;
|
|
184
|
-
},
|
|
185
|
-
/**
|
|
186
|
-
* Forces an update. This should only be invoked when it is known with
|
|
187
|
-
* certainty that we are **not** in a DOM transaction.
|
|
188
|
-
*
|
|
189
|
-
* You may want to call this when you know that some deeper aspect of the
|
|
190
|
-
* component's state has changed but `setState` was not called.
|
|
191
|
-
*
|
|
192
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
193
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
|
194
|
-
*
|
|
195
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
196
|
-
* @param {?function} callback Called after component is updated.
|
|
197
|
-
* @param {?string} callerName name of the calling function in the public API.
|
|
198
|
-
* @internal
|
|
199
|
-
*/
|
|
200
|
-
enqueueForceUpdate: function(publicInstance, callback, callerName) {
|
|
201
|
-
warnNoop(publicInstance, "forceUpdate");
|
|
202
|
-
},
|
|
203
|
-
/**
|
|
204
|
-
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
205
|
-
* You should treat `this.state` as immutable.
|
|
206
|
-
*
|
|
207
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
|
208
|
-
* accessing `this.state` after calling this method may return the old value.
|
|
209
|
-
*
|
|
210
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
211
|
-
* @param {object} completeState Next state.
|
|
212
|
-
* @param {?function} callback Called after component is updated.
|
|
213
|
-
* @param {?string} callerName name of the calling function in the public API.
|
|
214
|
-
* @internal
|
|
215
|
-
*/
|
|
216
|
-
enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
|
|
217
|
-
warnNoop(publicInstance, "replaceState");
|
|
218
|
-
},
|
|
219
|
-
/**
|
|
220
|
-
* Sets a subset of the state. This only exists because _pendingState is
|
|
221
|
-
* internal. This provides a merging strategy that is not available to deep
|
|
222
|
-
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
223
|
-
* during the merge.
|
|
224
|
-
*
|
|
225
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
226
|
-
* @param {object} partialState Next partial state to be merged with state.
|
|
227
|
-
* @param {?function} callback Called after component is updated.
|
|
228
|
-
* @param {?string} Name of the calling function in the public API.
|
|
229
|
-
* @internal
|
|
230
|
-
*/
|
|
231
|
-
enqueueSetState: function(publicInstance, partialState, callback, callerName) {
|
|
232
|
-
warnNoop(publicInstance, "setState");
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
var assign = Object.assign;
|
|
236
|
-
var emptyObject = {};
|
|
237
|
-
{
|
|
238
|
-
Object.freeze(emptyObject);
|
|
239
|
-
}
|
|
240
|
-
function Component(props, context, updater) {
|
|
241
|
-
this.props = props;
|
|
242
|
-
this.context = context;
|
|
243
|
-
this.refs = emptyObject;
|
|
244
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
245
|
-
}
|
|
246
|
-
Component.prototype.isReactComponent = {};
|
|
247
|
-
Component.prototype.setState = function(partialState, callback) {
|
|
248
|
-
if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) {
|
|
249
|
-
throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
250
|
-
}
|
|
251
|
-
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
252
|
-
};
|
|
253
|
-
Component.prototype.forceUpdate = function(callback) {
|
|
254
|
-
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
255
|
-
};
|
|
256
|
-
{
|
|
257
|
-
var deprecatedAPIs = {
|
|
258
|
-
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
|
|
259
|
-
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
|
|
260
|
-
};
|
|
261
|
-
var defineDeprecationWarning = function(methodName, info) {
|
|
262
|
-
Object.defineProperty(Component.prototype, methodName, {
|
|
263
|
-
get: function() {
|
|
264
|
-
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
|
265
|
-
return void 0;
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
};
|
|
269
|
-
for (var fnName in deprecatedAPIs) {
|
|
270
|
-
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
271
|
-
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
function ComponentDummy() {
|
|
276
|
-
}
|
|
277
|
-
ComponentDummy.prototype = Component.prototype;
|
|
278
|
-
function PureComponent(props, context, updater) {
|
|
279
|
-
this.props = props;
|
|
280
|
-
this.context = context;
|
|
281
|
-
this.refs = emptyObject;
|
|
282
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
283
|
-
}
|
|
284
|
-
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
285
|
-
pureComponentPrototype.constructor = PureComponent;
|
|
286
|
-
assign(pureComponentPrototype, Component.prototype);
|
|
287
|
-
pureComponentPrototype.isPureReactComponent = true;
|
|
288
|
-
function createRef() {
|
|
289
|
-
var refObject = {
|
|
290
|
-
current: null
|
|
291
|
-
};
|
|
292
|
-
{
|
|
293
|
-
Object.seal(refObject);
|
|
294
|
-
}
|
|
295
|
-
return refObject;
|
|
296
|
-
}
|
|
297
|
-
var isArrayImpl = Array.isArray;
|
|
298
|
-
function isArray(a) {
|
|
299
|
-
return isArrayImpl(a);
|
|
300
|
-
}
|
|
301
|
-
function typeName(value) {
|
|
302
|
-
{
|
|
303
|
-
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
304
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
305
|
-
return type;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
function willCoercionThrow(value) {
|
|
309
|
-
{
|
|
310
|
-
try {
|
|
311
|
-
testStringCoercion(value);
|
|
312
|
-
return false;
|
|
313
|
-
} catch (e) {
|
|
314
|
-
return true;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
function testStringCoercion(value) {
|
|
319
|
-
return "" + value;
|
|
320
|
-
}
|
|
321
|
-
function checkKeyStringCoercion(value) {
|
|
322
|
-
{
|
|
323
|
-
if (willCoercionThrow(value)) {
|
|
324
|
-
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
325
|
-
return testStringCoercion(value);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
330
|
-
var displayName = outerType.displayName;
|
|
331
|
-
if (displayName) {
|
|
332
|
-
return displayName;
|
|
333
|
-
}
|
|
334
|
-
var functionName = innerType.displayName || innerType.name || "";
|
|
335
|
-
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
336
|
-
}
|
|
337
|
-
function getContextName(type) {
|
|
338
|
-
return type.displayName || "Context";
|
|
339
|
-
}
|
|
340
|
-
function getComponentNameFromType(type) {
|
|
341
|
-
if (type == null) {
|
|
342
|
-
return null;
|
|
343
|
-
}
|
|
344
|
-
{
|
|
345
|
-
if (typeof type.tag === "number") {
|
|
346
|
-
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
if (typeof type === "function") {
|
|
350
|
-
return type.displayName || type.name || null;
|
|
351
|
-
}
|
|
352
|
-
if (typeof type === "string") {
|
|
353
|
-
return type;
|
|
354
|
-
}
|
|
355
|
-
switch (type) {
|
|
356
|
-
case REACT_FRAGMENT_TYPE:
|
|
357
|
-
return "Fragment";
|
|
358
|
-
case REACT_PORTAL_TYPE:
|
|
359
|
-
return "Portal";
|
|
360
|
-
case REACT_PROFILER_TYPE:
|
|
361
|
-
return "Profiler";
|
|
362
|
-
case REACT_STRICT_MODE_TYPE:
|
|
363
|
-
return "StrictMode";
|
|
364
|
-
case REACT_SUSPENSE_TYPE:
|
|
365
|
-
return "Suspense";
|
|
366
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
367
|
-
return "SuspenseList";
|
|
368
|
-
}
|
|
369
|
-
if (typeof type === "object") {
|
|
370
|
-
switch (type.$$typeof) {
|
|
371
|
-
case REACT_CONTEXT_TYPE:
|
|
372
|
-
var context = type;
|
|
373
|
-
return getContextName(context) + ".Consumer";
|
|
374
|
-
case REACT_PROVIDER_TYPE:
|
|
375
|
-
var provider = type;
|
|
376
|
-
return getContextName(provider._context) + ".Provider";
|
|
377
|
-
case REACT_FORWARD_REF_TYPE:
|
|
378
|
-
return getWrappedName(type, type.render, "ForwardRef");
|
|
379
|
-
case REACT_MEMO_TYPE:
|
|
380
|
-
var outerName = type.displayName || null;
|
|
381
|
-
if (outerName !== null) {
|
|
382
|
-
return outerName;
|
|
383
|
-
}
|
|
384
|
-
return getComponentNameFromType(type.type) || "Memo";
|
|
385
|
-
case REACT_LAZY_TYPE: {
|
|
386
|
-
var lazyComponent = type;
|
|
387
|
-
var payload = lazyComponent._payload;
|
|
388
|
-
var init = lazyComponent._init;
|
|
389
|
-
try {
|
|
390
|
-
return getComponentNameFromType(init(payload));
|
|
391
|
-
} catch (x) {
|
|
392
|
-
return null;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
return null;
|
|
398
|
-
}
|
|
399
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
400
|
-
var RESERVED_PROPS = {
|
|
401
|
-
key: true,
|
|
402
|
-
ref: true,
|
|
403
|
-
__self: true,
|
|
404
|
-
__source: true
|
|
405
|
-
};
|
|
406
|
-
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
407
|
-
{
|
|
408
|
-
didWarnAboutStringRefs = {};
|
|
409
|
-
}
|
|
410
|
-
function hasValidRef(config) {
|
|
411
|
-
{
|
|
412
|
-
if (hasOwnProperty.call(config, "ref")) {
|
|
413
|
-
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
414
|
-
if (getter && getter.isReactWarning) {
|
|
415
|
-
return false;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
return config.ref !== void 0;
|
|
420
|
-
}
|
|
421
|
-
function hasValidKey(config) {
|
|
422
|
-
{
|
|
423
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
424
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
425
|
-
if (getter && getter.isReactWarning) {
|
|
426
|
-
return false;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
return config.key !== void 0;
|
|
431
|
-
}
|
|
432
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
433
|
-
var warnAboutAccessingKey = function() {
|
|
434
|
-
{
|
|
435
|
-
if (!specialPropKeyWarningShown) {
|
|
436
|
-
specialPropKeyWarningShown = true;
|
|
437
|
-
error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
};
|
|
441
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
442
|
-
Object.defineProperty(props, "key", {
|
|
443
|
-
get: warnAboutAccessingKey,
|
|
444
|
-
configurable: true
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
448
|
-
var warnAboutAccessingRef = function() {
|
|
449
|
-
{
|
|
450
|
-
if (!specialPropRefWarningShown) {
|
|
451
|
-
specialPropRefWarningShown = true;
|
|
452
|
-
error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
};
|
|
456
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
457
|
-
Object.defineProperty(props, "ref", {
|
|
458
|
-
get: warnAboutAccessingRef,
|
|
459
|
-
configurable: true
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
function warnIfStringRefCannotBeAutoConverted(config) {
|
|
463
|
-
{
|
|
464
|
-
if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
|
465
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
466
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
467
|
-
error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
|
|
468
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
|
474
|
-
var element = {
|
|
475
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
476
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
477
|
-
// Built-in properties that belong on the element
|
|
478
|
-
type,
|
|
479
|
-
key,
|
|
480
|
-
ref,
|
|
481
|
-
props,
|
|
482
|
-
// Record the component responsible for creating this element.
|
|
483
|
-
_owner: owner
|
|
484
|
-
};
|
|
485
|
-
{
|
|
486
|
-
element._store = {};
|
|
487
|
-
Object.defineProperty(element._store, "validated", {
|
|
488
|
-
configurable: false,
|
|
489
|
-
enumerable: false,
|
|
490
|
-
writable: true,
|
|
491
|
-
value: false
|
|
492
|
-
});
|
|
493
|
-
Object.defineProperty(element, "_self", {
|
|
494
|
-
configurable: false,
|
|
495
|
-
enumerable: false,
|
|
496
|
-
writable: false,
|
|
497
|
-
value: self
|
|
498
|
-
});
|
|
499
|
-
Object.defineProperty(element, "_source", {
|
|
500
|
-
configurable: false,
|
|
501
|
-
enumerable: false,
|
|
502
|
-
writable: false,
|
|
503
|
-
value: source
|
|
504
|
-
});
|
|
505
|
-
if (Object.freeze) {
|
|
506
|
-
Object.freeze(element.props);
|
|
507
|
-
Object.freeze(element);
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
return element;
|
|
511
|
-
};
|
|
512
|
-
function createElement(type, config, children) {
|
|
513
|
-
var propName;
|
|
514
|
-
var props = {};
|
|
515
|
-
var key = null;
|
|
516
|
-
var ref = null;
|
|
517
|
-
var self = null;
|
|
518
|
-
var source = null;
|
|
519
|
-
if (config != null) {
|
|
520
|
-
if (hasValidRef(config)) {
|
|
521
|
-
ref = config.ref;
|
|
522
|
-
{
|
|
523
|
-
warnIfStringRefCannotBeAutoConverted(config);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
if (hasValidKey(config)) {
|
|
527
|
-
{
|
|
528
|
-
checkKeyStringCoercion(config.key);
|
|
529
|
-
}
|
|
530
|
-
key = "" + config.key;
|
|
531
|
-
}
|
|
532
|
-
self = config.__self === void 0 ? null : config.__self;
|
|
533
|
-
source = config.__source === void 0 ? null : config.__source;
|
|
534
|
-
for (propName in config) {
|
|
535
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
536
|
-
props[propName] = config[propName];
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
var childrenLength = arguments.length - 2;
|
|
541
|
-
if (childrenLength === 1) {
|
|
542
|
-
props.children = children;
|
|
543
|
-
} else if (childrenLength > 1) {
|
|
544
|
-
var childArray = Array(childrenLength);
|
|
545
|
-
for (var i = 0; i < childrenLength; i++) {
|
|
546
|
-
childArray[i] = arguments[i + 2];
|
|
547
|
-
}
|
|
548
|
-
{
|
|
549
|
-
if (Object.freeze) {
|
|
550
|
-
Object.freeze(childArray);
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
props.children = childArray;
|
|
554
|
-
}
|
|
555
|
-
if (type && type.defaultProps) {
|
|
556
|
-
var defaultProps = type.defaultProps;
|
|
557
|
-
for (propName in defaultProps) {
|
|
558
|
-
if (props[propName] === void 0) {
|
|
559
|
-
props[propName] = defaultProps[propName];
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
{
|
|
564
|
-
if (key || ref) {
|
|
565
|
-
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
566
|
-
if (key) {
|
|
567
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
568
|
-
}
|
|
569
|
-
if (ref) {
|
|
570
|
-
defineRefPropWarningGetter(props, displayName);
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
575
|
-
}
|
|
576
|
-
function cloneAndReplaceKey(oldElement, newKey) {
|
|
577
|
-
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
578
|
-
return newElement;
|
|
579
|
-
}
|
|
580
|
-
function cloneElement(element, config, children) {
|
|
581
|
-
if (element === null || element === void 0) {
|
|
582
|
-
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
583
|
-
}
|
|
584
|
-
var propName;
|
|
585
|
-
var props = assign({}, element.props);
|
|
586
|
-
var key = element.key;
|
|
587
|
-
var ref = element.ref;
|
|
588
|
-
var self = element._self;
|
|
589
|
-
var source = element._source;
|
|
590
|
-
var owner = element._owner;
|
|
591
|
-
if (config != null) {
|
|
592
|
-
if (hasValidRef(config)) {
|
|
593
|
-
ref = config.ref;
|
|
594
|
-
owner = ReactCurrentOwner.current;
|
|
595
|
-
}
|
|
596
|
-
if (hasValidKey(config)) {
|
|
597
|
-
{
|
|
598
|
-
checkKeyStringCoercion(config.key);
|
|
599
|
-
}
|
|
600
|
-
key = "" + config.key;
|
|
601
|
-
}
|
|
602
|
-
var defaultProps;
|
|
603
|
-
if (element.type && element.type.defaultProps) {
|
|
604
|
-
defaultProps = element.type.defaultProps;
|
|
605
|
-
}
|
|
606
|
-
for (propName in config) {
|
|
607
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
608
|
-
if (config[propName] === void 0 && defaultProps !== void 0) {
|
|
609
|
-
props[propName] = defaultProps[propName];
|
|
610
|
-
} else {
|
|
611
|
-
props[propName] = config[propName];
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
var childrenLength = arguments.length - 2;
|
|
617
|
-
if (childrenLength === 1) {
|
|
618
|
-
props.children = children;
|
|
619
|
-
} else if (childrenLength > 1) {
|
|
620
|
-
var childArray = Array(childrenLength);
|
|
621
|
-
for (var i = 0; i < childrenLength; i++) {
|
|
622
|
-
childArray[i] = arguments[i + 2];
|
|
623
|
-
}
|
|
624
|
-
props.children = childArray;
|
|
625
|
-
}
|
|
626
|
-
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
627
|
-
}
|
|
628
|
-
function isValidElement(object) {
|
|
629
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
630
|
-
}
|
|
631
|
-
var SEPARATOR = ".";
|
|
632
|
-
var SUBSEPARATOR = ":";
|
|
633
|
-
function escape(key) {
|
|
634
|
-
var escapeRegex = /[=:]/g;
|
|
635
|
-
var escaperLookup = {
|
|
636
|
-
"=": "=0",
|
|
637
|
-
":": "=2"
|
|
638
|
-
};
|
|
639
|
-
var escapedString = key.replace(escapeRegex, function(match) {
|
|
640
|
-
return escaperLookup[match];
|
|
641
|
-
});
|
|
642
|
-
return "$" + escapedString;
|
|
643
|
-
}
|
|
644
|
-
var didWarnAboutMaps = false;
|
|
645
|
-
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
646
|
-
function escapeUserProvidedKey(text) {
|
|
647
|
-
return text.replace(userProvidedKeyEscapeRegex, "$&/");
|
|
648
|
-
}
|
|
649
|
-
function getElementKey(element, index) {
|
|
650
|
-
if (typeof element === "object" && element !== null && element.key != null) {
|
|
651
|
-
{
|
|
652
|
-
checkKeyStringCoercion(element.key);
|
|
653
|
-
}
|
|
654
|
-
return escape("" + element.key);
|
|
655
|
-
}
|
|
656
|
-
return index.toString(36);
|
|
657
|
-
}
|
|
658
|
-
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
659
|
-
var type = typeof children;
|
|
660
|
-
if (type === "undefined" || type === "boolean") {
|
|
661
|
-
children = null;
|
|
662
|
-
}
|
|
663
|
-
var invokeCallback = false;
|
|
664
|
-
if (children === null) {
|
|
665
|
-
invokeCallback = true;
|
|
666
|
-
} else {
|
|
667
|
-
switch (type) {
|
|
668
|
-
case "string":
|
|
669
|
-
case "number":
|
|
670
|
-
invokeCallback = true;
|
|
671
|
-
break;
|
|
672
|
-
case "object":
|
|
673
|
-
switch (children.$$typeof) {
|
|
674
|
-
case REACT_ELEMENT_TYPE:
|
|
675
|
-
case REACT_PORTAL_TYPE:
|
|
676
|
-
invokeCallback = true;
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
if (invokeCallback) {
|
|
681
|
-
var _child = children;
|
|
682
|
-
var mappedChild = callback(_child);
|
|
683
|
-
var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
684
|
-
if (isArray(mappedChild)) {
|
|
685
|
-
var escapedChildKey = "";
|
|
686
|
-
if (childKey != null) {
|
|
687
|
-
escapedChildKey = escapeUserProvidedKey(childKey) + "/";
|
|
688
|
-
}
|
|
689
|
-
mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) {
|
|
690
|
-
return c;
|
|
691
|
-
});
|
|
692
|
-
} else if (mappedChild != null) {
|
|
693
|
-
if (isValidElement(mappedChild)) {
|
|
694
|
-
{
|
|
695
|
-
if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
|
696
|
-
checkKeyStringCoercion(mappedChild.key);
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
mappedChild = cloneAndReplaceKey(
|
|
700
|
-
mappedChild,
|
|
701
|
-
// Keep both the (mapped) and old keys if they differ, just as
|
|
702
|
-
// traverseAllChildren used to do for objects as children
|
|
703
|
-
escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
704
|
-
(mappedChild.key && (!_child || _child.key !== mappedChild.key) ? (
|
|
705
|
-
// $FlowFixMe Flow incorrectly thinks existing element's key can be a number
|
|
706
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
707
|
-
escapeUserProvidedKey("" + mappedChild.key) + "/"
|
|
708
|
-
) : "") + childKey
|
|
709
|
-
);
|
|
710
|
-
}
|
|
711
|
-
array.push(mappedChild);
|
|
712
|
-
}
|
|
713
|
-
return 1;
|
|
714
|
-
}
|
|
715
|
-
var child;
|
|
716
|
-
var nextName;
|
|
717
|
-
var subtreeCount = 0;
|
|
718
|
-
var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
719
|
-
if (isArray(children)) {
|
|
720
|
-
for (var i = 0; i < children.length; i++) {
|
|
721
|
-
child = children[i];
|
|
722
|
-
nextName = nextNamePrefix + getElementKey(child, i);
|
|
723
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
724
|
-
}
|
|
725
|
-
} else {
|
|
726
|
-
var iteratorFn = getIteratorFn(children);
|
|
727
|
-
if (typeof iteratorFn === "function") {
|
|
728
|
-
var iterableChildren = children;
|
|
729
|
-
{
|
|
730
|
-
if (iteratorFn === iterableChildren.entries) {
|
|
731
|
-
if (!didWarnAboutMaps) {
|
|
732
|
-
warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
|
|
733
|
-
}
|
|
734
|
-
didWarnAboutMaps = true;
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
var iterator = iteratorFn.call(iterableChildren);
|
|
738
|
-
var step;
|
|
739
|
-
var ii = 0;
|
|
740
|
-
while (!(step = iterator.next()).done) {
|
|
741
|
-
child = step.value;
|
|
742
|
-
nextName = nextNamePrefix + getElementKey(child, ii++);
|
|
743
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
744
|
-
}
|
|
745
|
-
} else if (type === "object") {
|
|
746
|
-
var childrenString = String(children);
|
|
747
|
-
throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
return subtreeCount;
|
|
751
|
-
}
|
|
752
|
-
function mapChildren(children, func, context) {
|
|
753
|
-
if (children == null) {
|
|
754
|
-
return children;
|
|
755
|
-
}
|
|
756
|
-
var result = [];
|
|
757
|
-
var count = 0;
|
|
758
|
-
mapIntoArray(children, result, "", "", function(child) {
|
|
759
|
-
return func.call(context, child, count++);
|
|
760
|
-
});
|
|
761
|
-
return result;
|
|
762
|
-
}
|
|
763
|
-
function countChildren(children) {
|
|
764
|
-
var n = 0;
|
|
765
|
-
mapChildren(children, function() {
|
|
766
|
-
n++;
|
|
767
|
-
});
|
|
768
|
-
return n;
|
|
769
|
-
}
|
|
770
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
771
|
-
mapChildren(children, function() {
|
|
772
|
-
forEachFunc.apply(this, arguments);
|
|
773
|
-
}, forEachContext);
|
|
774
|
-
}
|
|
775
|
-
function toArray(children) {
|
|
776
|
-
return mapChildren(children, function(child) {
|
|
777
|
-
return child;
|
|
778
|
-
}) || [];
|
|
779
|
-
}
|
|
780
|
-
function onlyChild(children) {
|
|
781
|
-
if (!isValidElement(children)) {
|
|
782
|
-
throw new Error("React.Children.only expected to receive a single React element child.");
|
|
783
|
-
}
|
|
784
|
-
return children;
|
|
785
|
-
}
|
|
786
|
-
function createContext(defaultValue) {
|
|
787
|
-
var context = {
|
|
788
|
-
$$typeof: REACT_CONTEXT_TYPE,
|
|
789
|
-
// As a workaround to support multiple concurrent renderers, we categorize
|
|
790
|
-
// some renderers as primary and others as secondary. We only expect
|
|
791
|
-
// there to be two concurrent renderers at most: React Native (primary) and
|
|
792
|
-
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
|
793
|
-
// Secondary renderers store their context values on separate fields.
|
|
794
|
-
_currentValue: defaultValue,
|
|
795
|
-
_currentValue2: defaultValue,
|
|
796
|
-
// Used to track how many concurrent renderers this context currently
|
|
797
|
-
// supports within in a single renderer. Such as parallel server rendering.
|
|
798
|
-
_threadCount: 0,
|
|
799
|
-
// These are circular
|
|
800
|
-
Provider: null,
|
|
801
|
-
Consumer: null,
|
|
802
|
-
// Add these to use same hidden class in VM as ServerContext
|
|
803
|
-
_defaultValue: null,
|
|
804
|
-
_globalName: null
|
|
805
|
-
};
|
|
806
|
-
context.Provider = {
|
|
807
|
-
$$typeof: REACT_PROVIDER_TYPE,
|
|
808
|
-
_context: context
|
|
809
|
-
};
|
|
810
|
-
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
811
|
-
var hasWarnedAboutUsingConsumerProvider = false;
|
|
812
|
-
var hasWarnedAboutDisplayNameOnConsumer = false;
|
|
813
|
-
{
|
|
814
|
-
var Consumer = {
|
|
815
|
-
$$typeof: REACT_CONTEXT_TYPE,
|
|
816
|
-
_context: context
|
|
817
|
-
};
|
|
818
|
-
Object.defineProperties(Consumer, {
|
|
819
|
-
Provider: {
|
|
820
|
-
get: function() {
|
|
821
|
-
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
822
|
-
hasWarnedAboutUsingConsumerProvider = true;
|
|
823
|
-
error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
|
|
824
|
-
}
|
|
825
|
-
return context.Provider;
|
|
826
|
-
},
|
|
827
|
-
set: function(_Provider) {
|
|
828
|
-
context.Provider = _Provider;
|
|
829
|
-
}
|
|
830
|
-
},
|
|
831
|
-
_currentValue: {
|
|
832
|
-
get: function() {
|
|
833
|
-
return context._currentValue;
|
|
834
|
-
},
|
|
835
|
-
set: function(_currentValue) {
|
|
836
|
-
context._currentValue = _currentValue;
|
|
837
|
-
}
|
|
838
|
-
},
|
|
839
|
-
_currentValue2: {
|
|
840
|
-
get: function() {
|
|
841
|
-
return context._currentValue2;
|
|
842
|
-
},
|
|
843
|
-
set: function(_currentValue2) {
|
|
844
|
-
context._currentValue2 = _currentValue2;
|
|
845
|
-
}
|
|
846
|
-
},
|
|
847
|
-
_threadCount: {
|
|
848
|
-
get: function() {
|
|
849
|
-
return context._threadCount;
|
|
850
|
-
},
|
|
851
|
-
set: function(_threadCount) {
|
|
852
|
-
context._threadCount = _threadCount;
|
|
853
|
-
}
|
|
854
|
-
},
|
|
855
|
-
Consumer: {
|
|
856
|
-
get: function() {
|
|
857
|
-
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
858
|
-
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
859
|
-
error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
|
|
860
|
-
}
|
|
861
|
-
return context.Consumer;
|
|
862
|
-
}
|
|
863
|
-
},
|
|
864
|
-
displayName: {
|
|
865
|
-
get: function() {
|
|
866
|
-
return context.displayName;
|
|
867
|
-
},
|
|
868
|
-
set: function(displayName) {
|
|
869
|
-
if (!hasWarnedAboutDisplayNameOnConsumer) {
|
|
870
|
-
warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
|
871
|
-
hasWarnedAboutDisplayNameOnConsumer = true;
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
});
|
|
876
|
-
context.Consumer = Consumer;
|
|
877
|
-
}
|
|
878
|
-
{
|
|
879
|
-
context._currentRenderer = null;
|
|
880
|
-
context._currentRenderer2 = null;
|
|
881
|
-
}
|
|
882
|
-
return context;
|
|
883
|
-
}
|
|
884
|
-
var Uninitialized = -1;
|
|
885
|
-
var Pending = 0;
|
|
886
|
-
var Resolved = 1;
|
|
887
|
-
var Rejected = 2;
|
|
888
|
-
function lazyInitializer(payload) {
|
|
889
|
-
if (payload._status === Uninitialized) {
|
|
890
|
-
var ctor = payload._result;
|
|
891
|
-
var thenable = ctor();
|
|
892
|
-
thenable.then(function(moduleObject2) {
|
|
893
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
894
|
-
var resolved = payload;
|
|
895
|
-
resolved._status = Resolved;
|
|
896
|
-
resolved._result = moduleObject2;
|
|
897
|
-
}
|
|
898
|
-
}, function(error2) {
|
|
899
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
900
|
-
var rejected = payload;
|
|
901
|
-
rejected._status = Rejected;
|
|
902
|
-
rejected._result = error2;
|
|
903
|
-
}
|
|
904
|
-
});
|
|
905
|
-
if (payload._status === Uninitialized) {
|
|
906
|
-
var pending = payload;
|
|
907
|
-
pending._status = Pending;
|
|
908
|
-
pending._result = thenable;
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
if (payload._status === Resolved) {
|
|
912
|
-
var moduleObject = payload._result;
|
|
913
|
-
{
|
|
914
|
-
if (moduleObject === void 0) {
|
|
915
|
-
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
{
|
|
919
|
-
if (!("default" in moduleObject)) {
|
|
920
|
-
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
return moduleObject.default;
|
|
924
|
-
} else {
|
|
925
|
-
throw payload._result;
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
function lazy(ctor) {
|
|
929
|
-
var payload = {
|
|
930
|
-
// We use these fields to store the result.
|
|
931
|
-
_status: Uninitialized,
|
|
932
|
-
_result: ctor
|
|
933
|
-
};
|
|
934
|
-
var lazyType = {
|
|
935
|
-
$$typeof: REACT_LAZY_TYPE,
|
|
936
|
-
_payload: payload,
|
|
937
|
-
_init: lazyInitializer
|
|
938
|
-
};
|
|
939
|
-
{
|
|
940
|
-
var defaultProps;
|
|
941
|
-
var propTypes;
|
|
942
|
-
Object.defineProperties(lazyType, {
|
|
943
|
-
defaultProps: {
|
|
944
|
-
configurable: true,
|
|
945
|
-
get: function() {
|
|
946
|
-
return defaultProps;
|
|
947
|
-
},
|
|
948
|
-
set: function(newDefaultProps) {
|
|
949
|
-
error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
|
950
|
-
defaultProps = newDefaultProps;
|
|
951
|
-
Object.defineProperty(lazyType, "defaultProps", {
|
|
952
|
-
enumerable: true
|
|
953
|
-
});
|
|
954
|
-
}
|
|
955
|
-
},
|
|
956
|
-
propTypes: {
|
|
957
|
-
configurable: true,
|
|
958
|
-
get: function() {
|
|
959
|
-
return propTypes;
|
|
960
|
-
},
|
|
961
|
-
set: function(newPropTypes) {
|
|
962
|
-
error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
|
963
|
-
propTypes = newPropTypes;
|
|
964
|
-
Object.defineProperty(lazyType, "propTypes", {
|
|
965
|
-
enumerable: true
|
|
966
|
-
});
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
});
|
|
970
|
-
}
|
|
971
|
-
return lazyType;
|
|
972
|
-
}
|
|
973
|
-
function forwardRef(render) {
|
|
974
|
-
{
|
|
975
|
-
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
976
|
-
error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
|
|
977
|
-
} else if (typeof render !== "function") {
|
|
978
|
-
error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
|
|
979
|
-
} else {
|
|
980
|
-
if (render.length !== 0 && render.length !== 2) {
|
|
981
|
-
error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
if (render != null) {
|
|
985
|
-
if (render.defaultProps != null || render.propTypes != null) {
|
|
986
|
-
error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
var elementType = {
|
|
991
|
-
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
992
|
-
render
|
|
993
|
-
};
|
|
994
|
-
{
|
|
995
|
-
var ownName;
|
|
996
|
-
Object.defineProperty(elementType, "displayName", {
|
|
997
|
-
enumerable: false,
|
|
998
|
-
configurable: true,
|
|
999
|
-
get: function() {
|
|
1000
|
-
return ownName;
|
|
1001
|
-
},
|
|
1002
|
-
set: function(name) {
|
|
1003
|
-
ownName = name;
|
|
1004
|
-
if (!render.name && !render.displayName) {
|
|
1005
|
-
render.displayName = name;
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
});
|
|
1009
|
-
}
|
|
1010
|
-
return elementType;
|
|
1011
|
-
}
|
|
1012
|
-
var REACT_MODULE_REFERENCE;
|
|
1013
|
-
{
|
|
1014
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
1015
|
-
}
|
|
1016
|
-
function isValidElementType(type) {
|
|
1017
|
-
if (typeof type === "string" || typeof type === "function") {
|
|
1018
|
-
return true;
|
|
1019
|
-
}
|
|
1020
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
1021
|
-
return true;
|
|
1022
|
-
}
|
|
1023
|
-
if (typeof type === "object" && type !== null) {
|
|
1024
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
1025
|
-
// types supported by any Flight configuration anywhere since
|
|
1026
|
-
// we don't know which Flight build this will end up being used
|
|
1027
|
-
// with.
|
|
1028
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
1029
|
-
return true;
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
return false;
|
|
1033
|
-
}
|
|
1034
|
-
function memo(type, compare) {
|
|
1035
|
-
{
|
|
1036
|
-
if (!isValidElementType(type)) {
|
|
1037
|
-
error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
var elementType = {
|
|
1041
|
-
$$typeof: REACT_MEMO_TYPE,
|
|
1042
|
-
type,
|
|
1043
|
-
compare: compare === void 0 ? null : compare
|
|
1044
|
-
};
|
|
1045
|
-
{
|
|
1046
|
-
var ownName;
|
|
1047
|
-
Object.defineProperty(elementType, "displayName", {
|
|
1048
|
-
enumerable: false,
|
|
1049
|
-
configurable: true,
|
|
1050
|
-
get: function() {
|
|
1051
|
-
return ownName;
|
|
1052
|
-
},
|
|
1053
|
-
set: function(name) {
|
|
1054
|
-
ownName = name;
|
|
1055
|
-
if (!type.name && !type.displayName) {
|
|
1056
|
-
type.displayName = name;
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
});
|
|
1060
|
-
}
|
|
1061
|
-
return elementType;
|
|
1062
|
-
}
|
|
1063
|
-
function resolveDispatcher() {
|
|
1064
|
-
var dispatcher = ReactCurrentDispatcher.current;
|
|
1065
|
-
{
|
|
1066
|
-
if (dispatcher === null) {
|
|
1067
|
-
error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
return dispatcher;
|
|
1071
|
-
}
|
|
1072
|
-
function useContext(Context) {
|
|
1073
|
-
var dispatcher = resolveDispatcher();
|
|
1074
|
-
{
|
|
1075
|
-
if (Context._context !== void 0) {
|
|
1076
|
-
var realContext = Context._context;
|
|
1077
|
-
if (realContext.Consumer === Context) {
|
|
1078
|
-
error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
|
|
1079
|
-
} else if (realContext.Provider === Context) {
|
|
1080
|
-
error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
return dispatcher.useContext(Context);
|
|
1085
|
-
}
|
|
1086
|
-
function useState(initialState) {
|
|
1087
|
-
var dispatcher = resolveDispatcher();
|
|
1088
|
-
return dispatcher.useState(initialState);
|
|
1089
|
-
}
|
|
1090
|
-
function useReducer(reducer, initialArg, init) {
|
|
1091
|
-
var dispatcher = resolveDispatcher();
|
|
1092
|
-
return dispatcher.useReducer(reducer, initialArg, init);
|
|
1093
|
-
}
|
|
1094
|
-
function useRef(initialValue) {
|
|
1095
|
-
var dispatcher = resolveDispatcher();
|
|
1096
|
-
return dispatcher.useRef(initialValue);
|
|
1097
|
-
}
|
|
1098
|
-
function useEffect(create, deps) {
|
|
1099
|
-
var dispatcher = resolveDispatcher();
|
|
1100
|
-
return dispatcher.useEffect(create, deps);
|
|
1101
|
-
}
|
|
1102
|
-
function useInsertionEffect(create, deps) {
|
|
1103
|
-
var dispatcher = resolveDispatcher();
|
|
1104
|
-
return dispatcher.useInsertionEffect(create, deps);
|
|
1105
|
-
}
|
|
1106
|
-
function useLayoutEffect(create, deps) {
|
|
1107
|
-
var dispatcher = resolveDispatcher();
|
|
1108
|
-
return dispatcher.useLayoutEffect(create, deps);
|
|
1109
|
-
}
|
|
1110
|
-
function useCallback(callback, deps) {
|
|
1111
|
-
var dispatcher = resolveDispatcher();
|
|
1112
|
-
return dispatcher.useCallback(callback, deps);
|
|
1113
|
-
}
|
|
1114
|
-
function useMemo(create, deps) {
|
|
1115
|
-
var dispatcher = resolveDispatcher();
|
|
1116
|
-
return dispatcher.useMemo(create, deps);
|
|
1117
|
-
}
|
|
1118
|
-
function useImperativeHandle(ref, create, deps) {
|
|
1119
|
-
var dispatcher = resolveDispatcher();
|
|
1120
|
-
return dispatcher.useImperativeHandle(ref, create, deps);
|
|
1121
|
-
}
|
|
1122
|
-
function useDebugValue(value, formatterFn) {
|
|
1123
|
-
{
|
|
1124
|
-
var dispatcher = resolveDispatcher();
|
|
1125
|
-
return dispatcher.useDebugValue(value, formatterFn);
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
function useTransition() {
|
|
1129
|
-
var dispatcher = resolveDispatcher();
|
|
1130
|
-
return dispatcher.useTransition();
|
|
1131
|
-
}
|
|
1132
|
-
function useDeferredValue(value) {
|
|
1133
|
-
var dispatcher = resolveDispatcher();
|
|
1134
|
-
return dispatcher.useDeferredValue(value);
|
|
1135
|
-
}
|
|
1136
|
-
function useId() {
|
|
1137
|
-
var dispatcher = resolveDispatcher();
|
|
1138
|
-
return dispatcher.useId();
|
|
1139
|
-
}
|
|
1140
|
-
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
1141
|
-
var dispatcher = resolveDispatcher();
|
|
1142
|
-
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
1143
|
-
}
|
|
1144
|
-
var disabledDepth = 0;
|
|
1145
|
-
var prevLog;
|
|
1146
|
-
var prevInfo;
|
|
1147
|
-
var prevWarn;
|
|
1148
|
-
var prevError;
|
|
1149
|
-
var prevGroup;
|
|
1150
|
-
var prevGroupCollapsed;
|
|
1151
|
-
var prevGroupEnd;
|
|
1152
|
-
function disabledLog() {
|
|
1153
|
-
}
|
|
1154
|
-
disabledLog.__reactDisabledLog = true;
|
|
1155
|
-
function disableLogs() {
|
|
1156
|
-
{
|
|
1157
|
-
if (disabledDepth === 0) {
|
|
1158
|
-
prevLog = console.log;
|
|
1159
|
-
prevInfo = console.info;
|
|
1160
|
-
prevWarn = console.warn;
|
|
1161
|
-
prevError = console.error;
|
|
1162
|
-
prevGroup = console.group;
|
|
1163
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
1164
|
-
prevGroupEnd = console.groupEnd;
|
|
1165
|
-
var props = {
|
|
1166
|
-
configurable: true,
|
|
1167
|
-
enumerable: true,
|
|
1168
|
-
value: disabledLog,
|
|
1169
|
-
writable: true
|
|
1170
|
-
};
|
|
1171
|
-
Object.defineProperties(console, {
|
|
1172
|
-
info: props,
|
|
1173
|
-
log: props,
|
|
1174
|
-
warn: props,
|
|
1175
|
-
error: props,
|
|
1176
|
-
group: props,
|
|
1177
|
-
groupCollapsed: props,
|
|
1178
|
-
groupEnd: props
|
|
1179
|
-
});
|
|
1180
|
-
}
|
|
1181
|
-
disabledDepth++;
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
function reenableLogs() {
|
|
1185
|
-
{
|
|
1186
|
-
disabledDepth--;
|
|
1187
|
-
if (disabledDepth === 0) {
|
|
1188
|
-
var props = {
|
|
1189
|
-
configurable: true,
|
|
1190
|
-
enumerable: true,
|
|
1191
|
-
writable: true
|
|
1192
|
-
};
|
|
1193
|
-
Object.defineProperties(console, {
|
|
1194
|
-
log: assign({}, props, {
|
|
1195
|
-
value: prevLog
|
|
1196
|
-
}),
|
|
1197
|
-
info: assign({}, props, {
|
|
1198
|
-
value: prevInfo
|
|
1199
|
-
}),
|
|
1200
|
-
warn: assign({}, props, {
|
|
1201
|
-
value: prevWarn
|
|
1202
|
-
}),
|
|
1203
|
-
error: assign({}, props, {
|
|
1204
|
-
value: prevError
|
|
1205
|
-
}),
|
|
1206
|
-
group: assign({}, props, {
|
|
1207
|
-
value: prevGroup
|
|
1208
|
-
}),
|
|
1209
|
-
groupCollapsed: assign({}, props, {
|
|
1210
|
-
value: prevGroupCollapsed
|
|
1211
|
-
}),
|
|
1212
|
-
groupEnd: assign({}, props, {
|
|
1213
|
-
value: prevGroupEnd
|
|
1214
|
-
})
|
|
1215
|
-
});
|
|
1216
|
-
}
|
|
1217
|
-
if (disabledDepth < 0) {
|
|
1218
|
-
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
1223
|
-
var prefix;
|
|
1224
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1225
|
-
{
|
|
1226
|
-
if (prefix === void 0) {
|
|
1227
|
-
try {
|
|
1228
|
-
throw Error();
|
|
1229
|
-
} catch (x) {
|
|
1230
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1231
|
-
prefix = match && match[1] || "";
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
return "\n" + prefix + name;
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
var reentry = false;
|
|
1238
|
-
var componentFrameCache;
|
|
1239
|
-
{
|
|
1240
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
1241
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
1242
|
-
}
|
|
1243
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
1244
|
-
if (!fn || reentry) {
|
|
1245
|
-
return "";
|
|
1246
|
-
}
|
|
1247
|
-
{
|
|
1248
|
-
var frame = componentFrameCache.get(fn);
|
|
1249
|
-
if (frame !== void 0) {
|
|
1250
|
-
return frame;
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
var control;
|
|
1254
|
-
reentry = true;
|
|
1255
|
-
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
1256
|
-
Error.prepareStackTrace = void 0;
|
|
1257
|
-
var previousDispatcher;
|
|
1258
|
-
{
|
|
1259
|
-
previousDispatcher = ReactCurrentDispatcher$1.current;
|
|
1260
|
-
ReactCurrentDispatcher$1.current = null;
|
|
1261
|
-
disableLogs();
|
|
1262
|
-
}
|
|
1263
|
-
try {
|
|
1264
|
-
if (construct) {
|
|
1265
|
-
var Fake = function() {
|
|
1266
|
-
throw Error();
|
|
1267
|
-
};
|
|
1268
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
1269
|
-
set: function() {
|
|
1270
|
-
throw Error();
|
|
1271
|
-
}
|
|
1272
|
-
});
|
|
1273
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
|
1274
|
-
try {
|
|
1275
|
-
Reflect.construct(Fake, []);
|
|
1276
|
-
} catch (x) {
|
|
1277
|
-
control = x;
|
|
1278
|
-
}
|
|
1279
|
-
Reflect.construct(fn, [], Fake);
|
|
1280
|
-
} else {
|
|
1281
|
-
try {
|
|
1282
|
-
Fake.call();
|
|
1283
|
-
} catch (x) {
|
|
1284
|
-
control = x;
|
|
1285
|
-
}
|
|
1286
|
-
fn.call(Fake.prototype);
|
|
1287
|
-
}
|
|
1288
|
-
} else {
|
|
1289
|
-
try {
|
|
1290
|
-
throw Error();
|
|
1291
|
-
} catch (x) {
|
|
1292
|
-
control = x;
|
|
1293
|
-
}
|
|
1294
|
-
fn();
|
|
1295
|
-
}
|
|
1296
|
-
} catch (sample) {
|
|
1297
|
-
if (sample && control && typeof sample.stack === "string") {
|
|
1298
|
-
var sampleLines = sample.stack.split("\n");
|
|
1299
|
-
var controlLines = control.stack.split("\n");
|
|
1300
|
-
var s = sampleLines.length - 1;
|
|
1301
|
-
var c = controlLines.length - 1;
|
|
1302
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
1303
|
-
c--;
|
|
1304
|
-
}
|
|
1305
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
1306
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
1307
|
-
if (s !== 1 || c !== 1) {
|
|
1308
|
-
do {
|
|
1309
|
-
s--;
|
|
1310
|
-
c--;
|
|
1311
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1312
|
-
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
1313
|
-
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
1314
|
-
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
1315
|
-
}
|
|
1316
|
-
{
|
|
1317
|
-
if (typeof fn === "function") {
|
|
1318
|
-
componentFrameCache.set(fn, _frame);
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
return _frame;
|
|
1322
|
-
}
|
|
1323
|
-
} while (s >= 1 && c >= 0);
|
|
1324
|
-
}
|
|
1325
|
-
break;
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
} finally {
|
|
1330
|
-
reentry = false;
|
|
1331
|
-
{
|
|
1332
|
-
ReactCurrentDispatcher$1.current = previousDispatcher;
|
|
1333
|
-
reenableLogs();
|
|
1334
|
-
}
|
|
1335
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
1336
|
-
}
|
|
1337
|
-
var name = fn ? fn.displayName || fn.name : "";
|
|
1338
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
1339
|
-
{
|
|
1340
|
-
if (typeof fn === "function") {
|
|
1341
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
return syntheticFrame;
|
|
1345
|
-
}
|
|
1346
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
1347
|
-
{
|
|
1348
|
-
return describeNativeComponentFrame(fn, false);
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
function shouldConstruct(Component2) {
|
|
1352
|
-
var prototype = Component2.prototype;
|
|
1353
|
-
return !!(prototype && prototype.isReactComponent);
|
|
1354
|
-
}
|
|
1355
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
1356
|
-
if (type == null) {
|
|
1357
|
-
return "";
|
|
1358
|
-
}
|
|
1359
|
-
if (typeof type === "function") {
|
|
1360
|
-
{
|
|
1361
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
if (typeof type === "string") {
|
|
1365
|
-
return describeBuiltInComponentFrame(type);
|
|
1366
|
-
}
|
|
1367
|
-
switch (type) {
|
|
1368
|
-
case REACT_SUSPENSE_TYPE:
|
|
1369
|
-
return describeBuiltInComponentFrame("Suspense");
|
|
1370
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
1371
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
|
1372
|
-
}
|
|
1373
|
-
if (typeof type === "object") {
|
|
1374
|
-
switch (type.$$typeof) {
|
|
1375
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1376
|
-
return describeFunctionComponentFrame(type.render);
|
|
1377
|
-
case REACT_MEMO_TYPE:
|
|
1378
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
1379
|
-
case REACT_LAZY_TYPE: {
|
|
1380
|
-
var lazyComponent = type;
|
|
1381
|
-
var payload = lazyComponent._payload;
|
|
1382
|
-
var init = lazyComponent._init;
|
|
1383
|
-
try {
|
|
1384
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
1385
|
-
} catch (x) {
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
return "";
|
|
1391
|
-
}
|
|
1392
|
-
var loggedTypeFailures = {};
|
|
1393
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1394
|
-
function setCurrentlyValidatingElement(element) {
|
|
1395
|
-
{
|
|
1396
|
-
if (element) {
|
|
1397
|
-
var owner = element._owner;
|
|
1398
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1399
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1400
|
-
} else {
|
|
1401
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1406
|
-
{
|
|
1407
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
1408
|
-
for (var typeSpecName in typeSpecs) {
|
|
1409
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
1410
|
-
var error$1 = void 0;
|
|
1411
|
-
try {
|
|
1412
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
1413
|
-
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1414
|
-
err.name = "Invariant Violation";
|
|
1415
|
-
throw err;
|
|
1416
|
-
}
|
|
1417
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1418
|
-
} catch (ex) {
|
|
1419
|
-
error$1 = ex;
|
|
1420
|
-
}
|
|
1421
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
1422
|
-
setCurrentlyValidatingElement(element);
|
|
1423
|
-
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
1424
|
-
setCurrentlyValidatingElement(null);
|
|
1425
|
-
}
|
|
1426
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
1427
|
-
loggedTypeFailures[error$1.message] = true;
|
|
1428
|
-
setCurrentlyValidatingElement(element);
|
|
1429
|
-
error("Failed %s type: %s", location, error$1.message);
|
|
1430
|
-
setCurrentlyValidatingElement(null);
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
1437
|
-
{
|
|
1438
|
-
if (element) {
|
|
1439
|
-
var owner = element._owner;
|
|
1440
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1441
|
-
setExtraStackFrame(stack);
|
|
1442
|
-
} else {
|
|
1443
|
-
setExtraStackFrame(null);
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
|
-
var propTypesMisspellWarningShown;
|
|
1448
|
-
{
|
|
1449
|
-
propTypesMisspellWarningShown = false;
|
|
1450
|
-
}
|
|
1451
|
-
function getDeclarationErrorAddendum() {
|
|
1452
|
-
if (ReactCurrentOwner.current) {
|
|
1453
|
-
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
1454
|
-
if (name) {
|
|
1455
|
-
return "\n\nCheck the render method of `" + name + "`.";
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
return "";
|
|
1459
|
-
}
|
|
1460
|
-
function getSourceInfoErrorAddendum(source) {
|
|
1461
|
-
if (source !== void 0) {
|
|
1462
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
1463
|
-
var lineNumber = source.lineNumber;
|
|
1464
|
-
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
1465
|
-
}
|
|
1466
|
-
return "";
|
|
1467
|
-
}
|
|
1468
|
-
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
1469
|
-
if (elementProps !== null && elementProps !== void 0) {
|
|
1470
|
-
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
1471
|
-
}
|
|
1472
|
-
return "";
|
|
1473
|
-
}
|
|
1474
|
-
var ownerHasKeyUseWarning = {};
|
|
1475
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1476
|
-
var info = getDeclarationErrorAddendum();
|
|
1477
|
-
if (!info) {
|
|
1478
|
-
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
1479
|
-
if (parentName) {
|
|
1480
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1481
|
-
}
|
|
1482
|
-
}
|
|
1483
|
-
return info;
|
|
1484
|
-
}
|
|
1485
|
-
function validateExplicitKey(element, parentType) {
|
|
1486
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1487
|
-
return;
|
|
1488
|
-
}
|
|
1489
|
-
element._store.validated = true;
|
|
1490
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1491
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1492
|
-
return;
|
|
1493
|
-
}
|
|
1494
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
1495
|
-
var childOwner = "";
|
|
1496
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
1497
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1498
|
-
}
|
|
1499
|
-
{
|
|
1500
|
-
setCurrentlyValidatingElement$1(element);
|
|
1501
|
-
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1502
|
-
setCurrentlyValidatingElement$1(null);
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
function validateChildKeys(node, parentType) {
|
|
1506
|
-
if (typeof node !== "object") {
|
|
1507
|
-
return;
|
|
1508
|
-
}
|
|
1509
|
-
if (isArray(node)) {
|
|
1510
|
-
for (var i = 0; i < node.length; i++) {
|
|
1511
|
-
var child = node[i];
|
|
1512
|
-
if (isValidElement(child)) {
|
|
1513
|
-
validateExplicitKey(child, parentType);
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1516
|
-
} else if (isValidElement(node)) {
|
|
1517
|
-
if (node._store) {
|
|
1518
|
-
node._store.validated = true;
|
|
1519
|
-
}
|
|
1520
|
-
} else if (node) {
|
|
1521
|
-
var iteratorFn = getIteratorFn(node);
|
|
1522
|
-
if (typeof iteratorFn === "function") {
|
|
1523
|
-
if (iteratorFn !== node.entries) {
|
|
1524
|
-
var iterator = iteratorFn.call(node);
|
|
1525
|
-
var step;
|
|
1526
|
-
while (!(step = iterator.next()).done) {
|
|
1527
|
-
if (isValidElement(step.value)) {
|
|
1528
|
-
validateExplicitKey(step.value, parentType);
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
1534
|
-
}
|
|
1535
|
-
function validatePropTypes(element) {
|
|
1536
|
-
{
|
|
1537
|
-
var type = element.type;
|
|
1538
|
-
if (type === null || type === void 0 || typeof type === "string") {
|
|
1539
|
-
return;
|
|
1540
|
-
}
|
|
1541
|
-
var propTypes;
|
|
1542
|
-
if (typeof type === "function") {
|
|
1543
|
-
propTypes = type.propTypes;
|
|
1544
|
-
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1545
|
-
// Inner props are checked in the reconciler.
|
|
1546
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1547
|
-
propTypes = type.propTypes;
|
|
1548
|
-
} else {
|
|
1549
|
-
return;
|
|
1550
|
-
}
|
|
1551
|
-
if (propTypes) {
|
|
1552
|
-
var name = getComponentNameFromType(type);
|
|
1553
|
-
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
1554
|
-
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
1555
|
-
propTypesMisspellWarningShown = true;
|
|
1556
|
-
var _name = getComponentNameFromType(type);
|
|
1557
|
-
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
1558
|
-
}
|
|
1559
|
-
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
1560
|
-
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1561
|
-
}
|
|
1562
|
-
}
|
|
1563
|
-
}
|
|
1564
|
-
function validateFragmentProps(fragment) {
|
|
1565
|
-
{
|
|
1566
|
-
var keys = Object.keys(fragment.props);
|
|
1567
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1568
|
-
var key = keys[i];
|
|
1569
|
-
if (key !== "children" && key !== "key") {
|
|
1570
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1571
|
-
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
1572
|
-
setCurrentlyValidatingElement$1(null);
|
|
1573
|
-
break;
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
if (fragment.ref !== null) {
|
|
1577
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1578
|
-
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
1579
|
-
setCurrentlyValidatingElement$1(null);
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
function createElementWithValidation(type, props, children) {
|
|
1584
|
-
var validType = isValidElementType(type);
|
|
1585
|
-
if (!validType) {
|
|
1586
|
-
var info = "";
|
|
1587
|
-
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
1588
|
-
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
1589
|
-
}
|
|
1590
|
-
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
1591
|
-
if (sourceInfo) {
|
|
1592
|
-
info += sourceInfo;
|
|
1593
|
-
} else {
|
|
1594
|
-
info += getDeclarationErrorAddendum();
|
|
1595
|
-
}
|
|
1596
|
-
var typeString;
|
|
1597
|
-
if (type === null) {
|
|
1598
|
-
typeString = "null";
|
|
1599
|
-
} else if (isArray(type)) {
|
|
1600
|
-
typeString = "array";
|
|
1601
|
-
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1602
|
-
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
1603
|
-
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
1604
|
-
} else {
|
|
1605
|
-
typeString = typeof type;
|
|
1606
|
-
}
|
|
1607
|
-
{
|
|
1608
|
-
error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
1609
|
-
}
|
|
1610
|
-
}
|
|
1611
|
-
var element = createElement.apply(this, arguments);
|
|
1612
|
-
if (element == null) {
|
|
1613
|
-
return element;
|
|
1614
|
-
}
|
|
1615
|
-
if (validType) {
|
|
1616
|
-
for (var i = 2; i < arguments.length; i++) {
|
|
1617
|
-
validateChildKeys(arguments[i], type);
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
1621
|
-
validateFragmentProps(element);
|
|
1622
|
-
} else {
|
|
1623
|
-
validatePropTypes(element);
|
|
1624
|
-
}
|
|
1625
|
-
return element;
|
|
1626
|
-
}
|
|
1627
|
-
var didWarnAboutDeprecatedCreateFactory = false;
|
|
1628
|
-
function createFactoryWithValidation(type) {
|
|
1629
|
-
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
1630
|
-
validatedFactory.type = type;
|
|
1631
|
-
{
|
|
1632
|
-
if (!didWarnAboutDeprecatedCreateFactory) {
|
|
1633
|
-
didWarnAboutDeprecatedCreateFactory = true;
|
|
1634
|
-
warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
|
|
1635
|
-
}
|
|
1636
|
-
Object.defineProperty(validatedFactory, "type", {
|
|
1637
|
-
enumerable: false,
|
|
1638
|
-
get: function() {
|
|
1639
|
-
warn("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
|
|
1640
|
-
Object.defineProperty(this, "type", {
|
|
1641
|
-
value: type
|
|
1642
|
-
});
|
|
1643
|
-
return type;
|
|
1644
|
-
}
|
|
1645
|
-
});
|
|
1646
|
-
}
|
|
1647
|
-
return validatedFactory;
|
|
1648
|
-
}
|
|
1649
|
-
function cloneElementWithValidation(element, props, children) {
|
|
1650
|
-
var newElement = cloneElement.apply(this, arguments);
|
|
1651
|
-
for (var i = 2; i < arguments.length; i++) {
|
|
1652
|
-
validateChildKeys(arguments[i], newElement.type);
|
|
1653
|
-
}
|
|
1654
|
-
validatePropTypes(newElement);
|
|
1655
|
-
return newElement;
|
|
1656
|
-
}
|
|
1657
|
-
function startTransition(scope, options) {
|
|
1658
|
-
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
1659
|
-
ReactCurrentBatchConfig.transition = {};
|
|
1660
|
-
var currentTransition = ReactCurrentBatchConfig.transition;
|
|
1661
|
-
{
|
|
1662
|
-
ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set();
|
|
1663
|
-
}
|
|
1664
|
-
try {
|
|
1665
|
-
scope();
|
|
1666
|
-
} finally {
|
|
1667
|
-
ReactCurrentBatchConfig.transition = prevTransition;
|
|
1668
|
-
{
|
|
1669
|
-
if (prevTransition === null && currentTransition._updatedFibers) {
|
|
1670
|
-
var updatedFibersCount = currentTransition._updatedFibers.size;
|
|
1671
|
-
if (updatedFibersCount > 10) {
|
|
1672
|
-
warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
|
|
1673
|
-
}
|
|
1674
|
-
currentTransition._updatedFibers.clear();
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
var didWarnAboutMessageChannel = false;
|
|
1680
|
-
var enqueueTaskImpl = null;
|
|
1681
|
-
function enqueueTask(task) {
|
|
1682
|
-
if (enqueueTaskImpl === null) {
|
|
1683
|
-
try {
|
|
1684
|
-
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
1685
|
-
var nodeRequire = module && module[requireString];
|
|
1686
|
-
enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate;
|
|
1687
|
-
} catch (_err) {
|
|
1688
|
-
enqueueTaskImpl = function(callback) {
|
|
1689
|
-
{
|
|
1690
|
-
if (didWarnAboutMessageChannel === false) {
|
|
1691
|
-
didWarnAboutMessageChannel = true;
|
|
1692
|
-
if (typeof MessageChannel === "undefined") {
|
|
1693
|
-
error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.");
|
|
1694
|
-
}
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
var channel = new MessageChannel();
|
|
1698
|
-
channel.port1.onmessage = callback;
|
|
1699
|
-
channel.port2.postMessage(void 0);
|
|
1700
|
-
};
|
|
1701
|
-
}
|
|
1702
|
-
}
|
|
1703
|
-
return enqueueTaskImpl(task);
|
|
1704
|
-
}
|
|
1705
|
-
var actScopeDepth = 0;
|
|
1706
|
-
var didWarnNoAwaitAct = false;
|
|
1707
|
-
function act(callback) {
|
|
1708
|
-
{
|
|
1709
|
-
var prevActScopeDepth = actScopeDepth;
|
|
1710
|
-
actScopeDepth++;
|
|
1711
|
-
if (ReactCurrentActQueue.current === null) {
|
|
1712
|
-
ReactCurrentActQueue.current = [];
|
|
1713
|
-
}
|
|
1714
|
-
var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
|
1715
|
-
var result;
|
|
1716
|
-
try {
|
|
1717
|
-
ReactCurrentActQueue.isBatchingLegacy = true;
|
|
1718
|
-
result = callback();
|
|
1719
|
-
if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
|
1720
|
-
var queue = ReactCurrentActQueue.current;
|
|
1721
|
-
if (queue !== null) {
|
|
1722
|
-
ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
|
1723
|
-
flushActQueue(queue);
|
|
1724
|
-
}
|
|
1725
|
-
}
|
|
1726
|
-
} catch (error2) {
|
|
1727
|
-
popActScope(prevActScopeDepth);
|
|
1728
|
-
throw error2;
|
|
1729
|
-
} finally {
|
|
1730
|
-
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
|
1731
|
-
}
|
|
1732
|
-
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
1733
|
-
var thenableResult = result;
|
|
1734
|
-
var wasAwaited = false;
|
|
1735
|
-
var thenable = {
|
|
1736
|
-
then: function(resolve, reject) {
|
|
1737
|
-
wasAwaited = true;
|
|
1738
|
-
thenableResult.then(function(returnValue2) {
|
|
1739
|
-
popActScope(prevActScopeDepth);
|
|
1740
|
-
if (actScopeDepth === 0) {
|
|
1741
|
-
recursivelyFlushAsyncActWork(returnValue2, resolve, reject);
|
|
1742
|
-
} else {
|
|
1743
|
-
resolve(returnValue2);
|
|
1744
|
-
}
|
|
1745
|
-
}, function(error2) {
|
|
1746
|
-
popActScope(prevActScopeDepth);
|
|
1747
|
-
reject(error2);
|
|
1748
|
-
});
|
|
1749
|
-
}
|
|
1750
|
-
};
|
|
1751
|
-
{
|
|
1752
|
-
if (!didWarnNoAwaitAct && typeof Promise !== "undefined") {
|
|
1753
|
-
Promise.resolve().then(function() {
|
|
1754
|
-
}).then(function() {
|
|
1755
|
-
if (!wasAwaited) {
|
|
1756
|
-
didWarnNoAwaitAct = true;
|
|
1757
|
-
error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);");
|
|
1758
|
-
}
|
|
1759
|
-
});
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
return thenable;
|
|
1763
|
-
} else {
|
|
1764
|
-
var returnValue = result;
|
|
1765
|
-
popActScope(prevActScopeDepth);
|
|
1766
|
-
if (actScopeDepth === 0) {
|
|
1767
|
-
var _queue = ReactCurrentActQueue.current;
|
|
1768
|
-
if (_queue !== null) {
|
|
1769
|
-
flushActQueue(_queue);
|
|
1770
|
-
ReactCurrentActQueue.current = null;
|
|
1771
|
-
}
|
|
1772
|
-
var _thenable = {
|
|
1773
|
-
then: function(resolve, reject) {
|
|
1774
|
-
if (ReactCurrentActQueue.current === null) {
|
|
1775
|
-
ReactCurrentActQueue.current = [];
|
|
1776
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
1777
|
-
} else {
|
|
1778
|
-
resolve(returnValue);
|
|
1779
|
-
}
|
|
1780
|
-
}
|
|
1781
|
-
};
|
|
1782
|
-
return _thenable;
|
|
1783
|
-
} else {
|
|
1784
|
-
var _thenable2 = {
|
|
1785
|
-
then: function(resolve, reject) {
|
|
1786
|
-
resolve(returnValue);
|
|
1787
|
-
}
|
|
1788
|
-
};
|
|
1789
|
-
return _thenable2;
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
function popActScope(prevActScopeDepth) {
|
|
1795
|
-
{
|
|
1796
|
-
if (prevActScopeDepth !== actScopeDepth - 1) {
|
|
1797
|
-
error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
|
|
1798
|
-
}
|
|
1799
|
-
actScopeDepth = prevActScopeDepth;
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1802
|
-
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
1803
|
-
{
|
|
1804
|
-
var queue = ReactCurrentActQueue.current;
|
|
1805
|
-
if (queue !== null) {
|
|
1806
|
-
try {
|
|
1807
|
-
flushActQueue(queue);
|
|
1808
|
-
enqueueTask(function() {
|
|
1809
|
-
if (queue.length === 0) {
|
|
1810
|
-
ReactCurrentActQueue.current = null;
|
|
1811
|
-
resolve(returnValue);
|
|
1812
|
-
} else {
|
|
1813
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
1814
|
-
}
|
|
1815
|
-
});
|
|
1816
|
-
} catch (error2) {
|
|
1817
|
-
reject(error2);
|
|
1818
|
-
}
|
|
1819
|
-
} else {
|
|
1820
|
-
resolve(returnValue);
|
|
1821
|
-
}
|
|
1822
|
-
}
|
|
1823
|
-
}
|
|
1824
|
-
var isFlushing = false;
|
|
1825
|
-
function flushActQueue(queue) {
|
|
1826
|
-
{
|
|
1827
|
-
if (!isFlushing) {
|
|
1828
|
-
isFlushing = true;
|
|
1829
|
-
var i = 0;
|
|
1830
|
-
try {
|
|
1831
|
-
for (; i < queue.length; i++) {
|
|
1832
|
-
var callback = queue[i];
|
|
1833
|
-
do {
|
|
1834
|
-
callback = callback(true);
|
|
1835
|
-
} while (callback !== null);
|
|
1836
|
-
}
|
|
1837
|
-
queue.length = 0;
|
|
1838
|
-
} catch (error2) {
|
|
1839
|
-
queue = queue.slice(i + 1);
|
|
1840
|
-
throw error2;
|
|
1841
|
-
} finally {
|
|
1842
|
-
isFlushing = false;
|
|
1843
|
-
}
|
|
1844
|
-
}
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
|
-
var createElement$1 = createElementWithValidation;
|
|
1848
|
-
var cloneElement$1 = cloneElementWithValidation;
|
|
1849
|
-
var createFactory = createFactoryWithValidation;
|
|
1850
|
-
var Children = {
|
|
1851
|
-
map: mapChildren,
|
|
1852
|
-
forEach: forEachChildren,
|
|
1853
|
-
count: countChildren,
|
|
1854
|
-
toArray,
|
|
1855
|
-
only: onlyChild
|
|
1856
|
-
};
|
|
1857
|
-
exports.Children = Children;
|
|
1858
|
-
exports.Component = Component;
|
|
1859
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1860
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
|
1861
|
-
exports.PureComponent = PureComponent;
|
|
1862
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1863
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
1864
|
-
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
1865
|
-
exports.act = act;
|
|
1866
|
-
exports.cloneElement = cloneElement$1;
|
|
1867
|
-
exports.createContext = createContext;
|
|
1868
|
-
exports.createElement = createElement$1;
|
|
1869
|
-
exports.createFactory = createFactory;
|
|
1870
|
-
exports.createRef = createRef;
|
|
1871
|
-
exports.forwardRef = forwardRef;
|
|
1872
|
-
exports.isValidElement = isValidElement;
|
|
1873
|
-
exports.lazy = lazy;
|
|
1874
|
-
exports.memo = memo;
|
|
1875
|
-
exports.startTransition = startTransition;
|
|
1876
|
-
exports.unstable_act = act;
|
|
1877
|
-
exports.useCallback = useCallback;
|
|
1878
|
-
exports.useContext = useContext;
|
|
1879
|
-
exports.useDebugValue = useDebugValue;
|
|
1880
|
-
exports.useDeferredValue = useDeferredValue;
|
|
1881
|
-
exports.useEffect = useEffect;
|
|
1882
|
-
exports.useId = useId;
|
|
1883
|
-
exports.useImperativeHandle = useImperativeHandle;
|
|
1884
|
-
exports.useInsertionEffect = useInsertionEffect;
|
|
1885
|
-
exports.useLayoutEffect = useLayoutEffect;
|
|
1886
|
-
exports.useMemo = useMemo;
|
|
1887
|
-
exports.useReducer = useReducer;
|
|
1888
|
-
exports.useRef = useRef;
|
|
1889
|
-
exports.useState = useState;
|
|
1890
|
-
exports.useSyncExternalStore = useSyncExternalStore;
|
|
1891
|
-
exports.useTransition = useTransition;
|
|
1892
|
-
exports.version = ReactVersion;
|
|
1893
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
1894
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
1895
|
-
}
|
|
1896
|
-
})();
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1899
|
-
});
|
|
1900
|
-
|
|
1901
|
-
// femoGen/node_modules/react/index.js
|
|
1902
|
-
var require_react = __commonJS({
|
|
1903
|
-
"femoGen/node_modules/react/index.js"(exports, module) {
|
|
1904
|
-
"use strict";
|
|
1905
|
-
if (false) {
|
|
1906
|
-
module.exports = null;
|
|
1907
|
-
} else {
|
|
1908
|
-
module.exports = require_react_development();
|
|
1909
|
-
}
|
|
1910
|
-
}
|
|
1911
|
-
});
|
|
1912
|
-
|
|
1913
|
-
// femoGen/node_modules/react/cjs/react-jsx-runtime.development.js
|
|
1914
|
-
var require_react_jsx_runtime_development = __commonJS({
|
|
1915
|
-
"femoGen/node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
1916
|
-
"use strict";
|
|
1917
|
-
if (true) {
|
|
1918
|
-
(function() {
|
|
1919
|
-
"use strict";
|
|
1920
|
-
var React2 = require_react();
|
|
1921
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
1922
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
1923
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
1924
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
1925
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
1926
|
-
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
1927
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
1928
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
1929
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
1930
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
1931
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
1932
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
1933
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
1934
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
1935
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
1936
|
-
function getIteratorFn(maybeIterable) {
|
|
1937
|
-
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
1938
|
-
return null;
|
|
1939
|
-
}
|
|
1940
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
1941
|
-
if (typeof maybeIterator === "function") {
|
|
1942
|
-
return maybeIterator;
|
|
1943
|
-
}
|
|
1944
|
-
return null;
|
|
1945
|
-
}
|
|
1946
|
-
var ReactSharedInternals = React2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1947
|
-
function error(format) {
|
|
1948
|
-
{
|
|
1949
|
-
{
|
|
1950
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
1951
|
-
args[_key2 - 1] = arguments[_key2];
|
|
1952
|
-
}
|
|
1953
|
-
printWarning("error", format, args);
|
|
1954
|
-
}
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
function printWarning(level, format, args) {
|
|
1958
|
-
{
|
|
1959
|
-
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1960
|
-
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
1961
|
-
if (stack !== "") {
|
|
1962
|
-
format += "%s";
|
|
1963
|
-
args = args.concat([stack]);
|
|
1964
|
-
}
|
|
1965
|
-
var argsWithFormat = args.map(function(item) {
|
|
1966
|
-
return String(item);
|
|
1967
|
-
});
|
|
1968
|
-
argsWithFormat.unshift("Warning: " + format);
|
|
1969
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
var enableScopeAPI = false;
|
|
1973
|
-
var enableCacheElement = false;
|
|
1974
|
-
var enableTransitionTracing = false;
|
|
1975
|
-
var enableLegacyHidden = false;
|
|
1976
|
-
var enableDebugTracing = false;
|
|
1977
|
-
var REACT_MODULE_REFERENCE;
|
|
1978
|
-
{
|
|
1979
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
1980
|
-
}
|
|
1981
|
-
function isValidElementType(type) {
|
|
1982
|
-
if (typeof type === "string" || typeof type === "function") {
|
|
1983
|
-
return true;
|
|
1984
|
-
}
|
|
1985
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
1986
|
-
return true;
|
|
1987
|
-
}
|
|
1988
|
-
if (typeof type === "object" && type !== null) {
|
|
1989
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
1990
|
-
// types supported by any Flight configuration anywhere since
|
|
1991
|
-
// we don't know which Flight build this will end up being used
|
|
1992
|
-
// with.
|
|
1993
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
1994
|
-
return true;
|
|
1995
|
-
}
|
|
1996
|
-
}
|
|
1997
|
-
return false;
|
|
1998
|
-
}
|
|
1999
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
2000
|
-
var displayName = outerType.displayName;
|
|
2001
|
-
if (displayName) {
|
|
2002
|
-
return displayName;
|
|
2003
|
-
}
|
|
2004
|
-
var functionName = innerType.displayName || innerType.name || "";
|
|
2005
|
-
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
2006
|
-
}
|
|
2007
|
-
function getContextName(type) {
|
|
2008
|
-
return type.displayName || "Context";
|
|
2009
|
-
}
|
|
2010
|
-
function getComponentNameFromType(type) {
|
|
2011
|
-
if (type == null) {
|
|
2012
|
-
return null;
|
|
2013
|
-
}
|
|
2014
|
-
{
|
|
2015
|
-
if (typeof type.tag === "number") {
|
|
2016
|
-
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
if (typeof type === "function") {
|
|
2020
|
-
return type.displayName || type.name || null;
|
|
2021
|
-
}
|
|
2022
|
-
if (typeof type === "string") {
|
|
2023
|
-
return type;
|
|
2024
|
-
}
|
|
2025
|
-
switch (type) {
|
|
2026
|
-
case REACT_FRAGMENT_TYPE:
|
|
2027
|
-
return "Fragment";
|
|
2028
|
-
case REACT_PORTAL_TYPE:
|
|
2029
|
-
return "Portal";
|
|
2030
|
-
case REACT_PROFILER_TYPE:
|
|
2031
|
-
return "Profiler";
|
|
2032
|
-
case REACT_STRICT_MODE_TYPE:
|
|
2033
|
-
return "StrictMode";
|
|
2034
|
-
case REACT_SUSPENSE_TYPE:
|
|
2035
|
-
return "Suspense";
|
|
2036
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
2037
|
-
return "SuspenseList";
|
|
2038
|
-
}
|
|
2039
|
-
if (typeof type === "object") {
|
|
2040
|
-
switch (type.$$typeof) {
|
|
2041
|
-
case REACT_CONTEXT_TYPE:
|
|
2042
|
-
var context = type;
|
|
2043
|
-
return getContextName(context) + ".Consumer";
|
|
2044
|
-
case REACT_PROVIDER_TYPE:
|
|
2045
|
-
var provider = type;
|
|
2046
|
-
return getContextName(provider._context) + ".Provider";
|
|
2047
|
-
case REACT_FORWARD_REF_TYPE:
|
|
2048
|
-
return getWrappedName(type, type.render, "ForwardRef");
|
|
2049
|
-
case REACT_MEMO_TYPE:
|
|
2050
|
-
var outerName = type.displayName || null;
|
|
2051
|
-
if (outerName !== null) {
|
|
2052
|
-
return outerName;
|
|
2053
|
-
}
|
|
2054
|
-
return getComponentNameFromType(type.type) || "Memo";
|
|
2055
|
-
case REACT_LAZY_TYPE: {
|
|
2056
|
-
var lazyComponent = type;
|
|
2057
|
-
var payload = lazyComponent._payload;
|
|
2058
|
-
var init = lazyComponent._init;
|
|
2059
|
-
try {
|
|
2060
|
-
return getComponentNameFromType(init(payload));
|
|
2061
|
-
} catch (x) {
|
|
2062
|
-
return null;
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
return null;
|
|
2068
|
-
}
|
|
2069
|
-
var assign = Object.assign;
|
|
2070
|
-
var disabledDepth = 0;
|
|
2071
|
-
var prevLog;
|
|
2072
|
-
var prevInfo;
|
|
2073
|
-
var prevWarn;
|
|
2074
|
-
var prevError;
|
|
2075
|
-
var prevGroup;
|
|
2076
|
-
var prevGroupCollapsed;
|
|
2077
|
-
var prevGroupEnd;
|
|
2078
|
-
function disabledLog() {
|
|
2079
|
-
}
|
|
2080
|
-
disabledLog.__reactDisabledLog = true;
|
|
2081
|
-
function disableLogs() {
|
|
2082
|
-
{
|
|
2083
|
-
if (disabledDepth === 0) {
|
|
2084
|
-
prevLog = console.log;
|
|
2085
|
-
prevInfo = console.info;
|
|
2086
|
-
prevWarn = console.warn;
|
|
2087
|
-
prevError = console.error;
|
|
2088
|
-
prevGroup = console.group;
|
|
2089
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
2090
|
-
prevGroupEnd = console.groupEnd;
|
|
2091
|
-
var props = {
|
|
2092
|
-
configurable: true,
|
|
2093
|
-
enumerable: true,
|
|
2094
|
-
value: disabledLog,
|
|
2095
|
-
writable: true
|
|
2096
|
-
};
|
|
2097
|
-
Object.defineProperties(console, {
|
|
2098
|
-
info: props,
|
|
2099
|
-
log: props,
|
|
2100
|
-
warn: props,
|
|
2101
|
-
error: props,
|
|
2102
|
-
group: props,
|
|
2103
|
-
groupCollapsed: props,
|
|
2104
|
-
groupEnd: props
|
|
2105
|
-
});
|
|
2106
|
-
}
|
|
2107
|
-
disabledDepth++;
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
function reenableLogs() {
|
|
2111
|
-
{
|
|
2112
|
-
disabledDepth--;
|
|
2113
|
-
if (disabledDepth === 0) {
|
|
2114
|
-
var props = {
|
|
2115
|
-
configurable: true,
|
|
2116
|
-
enumerable: true,
|
|
2117
|
-
writable: true
|
|
2118
|
-
};
|
|
2119
|
-
Object.defineProperties(console, {
|
|
2120
|
-
log: assign({}, props, {
|
|
2121
|
-
value: prevLog
|
|
2122
|
-
}),
|
|
2123
|
-
info: assign({}, props, {
|
|
2124
|
-
value: prevInfo
|
|
2125
|
-
}),
|
|
2126
|
-
warn: assign({}, props, {
|
|
2127
|
-
value: prevWarn
|
|
2128
|
-
}),
|
|
2129
|
-
error: assign({}, props, {
|
|
2130
|
-
value: prevError
|
|
2131
|
-
}),
|
|
2132
|
-
group: assign({}, props, {
|
|
2133
|
-
value: prevGroup
|
|
2134
|
-
}),
|
|
2135
|
-
groupCollapsed: assign({}, props, {
|
|
2136
|
-
value: prevGroupCollapsed
|
|
2137
|
-
}),
|
|
2138
|
-
groupEnd: assign({}, props, {
|
|
2139
|
-
value: prevGroupEnd
|
|
2140
|
-
})
|
|
2141
|
-
});
|
|
2142
|
-
}
|
|
2143
|
-
if (disabledDepth < 0) {
|
|
2144
|
-
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
2147
|
-
}
|
|
2148
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
2149
|
-
var prefix;
|
|
2150
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
2151
|
-
{
|
|
2152
|
-
if (prefix === void 0) {
|
|
2153
|
-
try {
|
|
2154
|
-
throw Error();
|
|
2155
|
-
} catch (x) {
|
|
2156
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
2157
|
-
prefix = match && match[1] || "";
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2160
|
-
return "\n" + prefix + name;
|
|
2161
|
-
}
|
|
2162
|
-
}
|
|
2163
|
-
var reentry = false;
|
|
2164
|
-
var componentFrameCache;
|
|
2165
|
-
{
|
|
2166
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
2167
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
2168
|
-
}
|
|
2169
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
2170
|
-
if (!fn || reentry) {
|
|
2171
|
-
return "";
|
|
2172
|
-
}
|
|
2173
|
-
{
|
|
2174
|
-
var frame = componentFrameCache.get(fn);
|
|
2175
|
-
if (frame !== void 0) {
|
|
2176
|
-
return frame;
|
|
2177
|
-
}
|
|
2178
|
-
}
|
|
2179
|
-
var control;
|
|
2180
|
-
reentry = true;
|
|
2181
|
-
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
2182
|
-
Error.prepareStackTrace = void 0;
|
|
2183
|
-
var previousDispatcher;
|
|
2184
|
-
{
|
|
2185
|
-
previousDispatcher = ReactCurrentDispatcher.current;
|
|
2186
|
-
ReactCurrentDispatcher.current = null;
|
|
2187
|
-
disableLogs();
|
|
2188
|
-
}
|
|
2189
|
-
try {
|
|
2190
|
-
if (construct) {
|
|
2191
|
-
var Fake = function() {
|
|
2192
|
-
throw Error();
|
|
2193
|
-
};
|
|
2194
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
2195
|
-
set: function() {
|
|
2196
|
-
throw Error();
|
|
2197
|
-
}
|
|
2198
|
-
});
|
|
2199
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
|
2200
|
-
try {
|
|
2201
|
-
Reflect.construct(Fake, []);
|
|
2202
|
-
} catch (x) {
|
|
2203
|
-
control = x;
|
|
2204
|
-
}
|
|
2205
|
-
Reflect.construct(fn, [], Fake);
|
|
2206
|
-
} else {
|
|
2207
|
-
try {
|
|
2208
|
-
Fake.call();
|
|
2209
|
-
} catch (x) {
|
|
2210
|
-
control = x;
|
|
2211
|
-
}
|
|
2212
|
-
fn.call(Fake.prototype);
|
|
2213
|
-
}
|
|
2214
|
-
} else {
|
|
2215
|
-
try {
|
|
2216
|
-
throw Error();
|
|
2217
|
-
} catch (x) {
|
|
2218
|
-
control = x;
|
|
2219
|
-
}
|
|
2220
|
-
fn();
|
|
2221
|
-
}
|
|
2222
|
-
} catch (sample) {
|
|
2223
|
-
if (sample && control && typeof sample.stack === "string") {
|
|
2224
|
-
var sampleLines = sample.stack.split("\n");
|
|
2225
|
-
var controlLines = control.stack.split("\n");
|
|
2226
|
-
var s = sampleLines.length - 1;
|
|
2227
|
-
var c = controlLines.length - 1;
|
|
2228
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
2229
|
-
c--;
|
|
2230
|
-
}
|
|
2231
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
2232
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
2233
|
-
if (s !== 1 || c !== 1) {
|
|
2234
|
-
do {
|
|
2235
|
-
s--;
|
|
2236
|
-
c--;
|
|
2237
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
2238
|
-
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
2239
|
-
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
2240
|
-
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
2241
|
-
}
|
|
2242
|
-
{
|
|
2243
|
-
if (typeof fn === "function") {
|
|
2244
|
-
componentFrameCache.set(fn, _frame);
|
|
2245
|
-
}
|
|
2246
|
-
}
|
|
2247
|
-
return _frame;
|
|
2248
|
-
}
|
|
2249
|
-
} while (s >= 1 && c >= 0);
|
|
2250
|
-
}
|
|
2251
|
-
break;
|
|
2252
|
-
}
|
|
2253
|
-
}
|
|
2254
|
-
}
|
|
2255
|
-
} finally {
|
|
2256
|
-
reentry = false;
|
|
2257
|
-
{
|
|
2258
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
2259
|
-
reenableLogs();
|
|
2260
|
-
}
|
|
2261
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
2262
|
-
}
|
|
2263
|
-
var name = fn ? fn.displayName || fn.name : "";
|
|
2264
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
2265
|
-
{
|
|
2266
|
-
if (typeof fn === "function") {
|
|
2267
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
2268
|
-
}
|
|
2269
|
-
}
|
|
2270
|
-
return syntheticFrame;
|
|
2271
|
-
}
|
|
2272
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
2273
|
-
{
|
|
2274
|
-
return describeNativeComponentFrame(fn, false);
|
|
2275
|
-
}
|
|
2276
|
-
}
|
|
2277
|
-
function shouldConstruct(Component) {
|
|
2278
|
-
var prototype = Component.prototype;
|
|
2279
|
-
return !!(prototype && prototype.isReactComponent);
|
|
2280
|
-
}
|
|
2281
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
2282
|
-
if (type == null) {
|
|
2283
|
-
return "";
|
|
2284
|
-
}
|
|
2285
|
-
if (typeof type === "function") {
|
|
2286
|
-
{
|
|
2287
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
if (typeof type === "string") {
|
|
2291
|
-
return describeBuiltInComponentFrame(type);
|
|
2292
|
-
}
|
|
2293
|
-
switch (type) {
|
|
2294
|
-
case REACT_SUSPENSE_TYPE:
|
|
2295
|
-
return describeBuiltInComponentFrame("Suspense");
|
|
2296
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
2297
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
|
2298
|
-
}
|
|
2299
|
-
if (typeof type === "object") {
|
|
2300
|
-
switch (type.$$typeof) {
|
|
2301
|
-
case REACT_FORWARD_REF_TYPE:
|
|
2302
|
-
return describeFunctionComponentFrame(type.render);
|
|
2303
|
-
case REACT_MEMO_TYPE:
|
|
2304
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
2305
|
-
case REACT_LAZY_TYPE: {
|
|
2306
|
-
var lazyComponent = type;
|
|
2307
|
-
var payload = lazyComponent._payload;
|
|
2308
|
-
var init = lazyComponent._init;
|
|
2309
|
-
try {
|
|
2310
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
2311
|
-
} catch (x) {
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
}
|
|
2316
|
-
return "";
|
|
2317
|
-
}
|
|
2318
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2319
|
-
var loggedTypeFailures = {};
|
|
2320
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2321
|
-
function setCurrentlyValidatingElement(element) {
|
|
2322
|
-
{
|
|
2323
|
-
if (element) {
|
|
2324
|
-
var owner = element._owner;
|
|
2325
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2326
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
2327
|
-
} else {
|
|
2328
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
|
-
}
|
|
2332
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
2333
|
-
{
|
|
2334
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
2335
|
-
for (var typeSpecName in typeSpecs) {
|
|
2336
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
2337
|
-
var error$1 = void 0;
|
|
2338
|
-
try {
|
|
2339
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
2340
|
-
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
2341
|
-
err.name = "Invariant Violation";
|
|
2342
|
-
throw err;
|
|
2343
|
-
}
|
|
2344
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
2345
|
-
} catch (ex) {
|
|
2346
|
-
error$1 = ex;
|
|
2347
|
-
}
|
|
2348
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
2349
|
-
setCurrentlyValidatingElement(element);
|
|
2350
|
-
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
2351
|
-
setCurrentlyValidatingElement(null);
|
|
2352
|
-
}
|
|
2353
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
2354
|
-
loggedTypeFailures[error$1.message] = true;
|
|
2355
|
-
setCurrentlyValidatingElement(element);
|
|
2356
|
-
error("Failed %s type: %s", location, error$1.message);
|
|
2357
|
-
setCurrentlyValidatingElement(null);
|
|
2358
|
-
}
|
|
2359
|
-
}
|
|
2360
|
-
}
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
var isArrayImpl = Array.isArray;
|
|
2364
|
-
function isArray(a) {
|
|
2365
|
-
return isArrayImpl(a);
|
|
2366
|
-
}
|
|
2367
|
-
function typeName(value) {
|
|
2368
|
-
{
|
|
2369
|
-
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
2370
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
2371
|
-
return type;
|
|
2372
|
-
}
|
|
2373
|
-
}
|
|
2374
|
-
function willCoercionThrow(value) {
|
|
2375
|
-
{
|
|
2376
|
-
try {
|
|
2377
|
-
testStringCoercion(value);
|
|
2378
|
-
return false;
|
|
2379
|
-
} catch (e) {
|
|
2380
|
-
return true;
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
}
|
|
2384
|
-
function testStringCoercion(value) {
|
|
2385
|
-
return "" + value;
|
|
2386
|
-
}
|
|
2387
|
-
function checkKeyStringCoercion(value) {
|
|
2388
|
-
{
|
|
2389
|
-
if (willCoercionThrow(value)) {
|
|
2390
|
-
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
2391
|
-
return testStringCoercion(value);
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
|
-
}
|
|
2395
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
2396
|
-
var RESERVED_PROPS = {
|
|
2397
|
-
key: true,
|
|
2398
|
-
ref: true,
|
|
2399
|
-
__self: true,
|
|
2400
|
-
__source: true
|
|
2401
|
-
};
|
|
2402
|
-
var specialPropKeyWarningShown;
|
|
2403
|
-
var specialPropRefWarningShown;
|
|
2404
|
-
var didWarnAboutStringRefs;
|
|
2405
|
-
{
|
|
2406
|
-
didWarnAboutStringRefs = {};
|
|
2407
|
-
}
|
|
2408
|
-
function hasValidRef(config) {
|
|
2409
|
-
{
|
|
2410
|
-
if (hasOwnProperty.call(config, "ref")) {
|
|
2411
|
-
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
2412
|
-
if (getter && getter.isReactWarning) {
|
|
2413
|
-
return false;
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
}
|
|
2417
|
-
return config.ref !== void 0;
|
|
2418
|
-
}
|
|
2419
|
-
function hasValidKey(config) {
|
|
2420
|
-
{
|
|
2421
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
2422
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
2423
|
-
if (getter && getter.isReactWarning) {
|
|
2424
|
-
return false;
|
|
2425
|
-
}
|
|
2426
|
-
}
|
|
2427
|
-
}
|
|
2428
|
-
return config.key !== void 0;
|
|
2429
|
-
}
|
|
2430
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
2431
|
-
{
|
|
2432
|
-
if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
2433
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
2434
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
2435
|
-
error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
2436
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
2437
|
-
}
|
|
2438
|
-
}
|
|
2439
|
-
}
|
|
2440
|
-
}
|
|
2441
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
2442
|
-
{
|
|
2443
|
-
var warnAboutAccessingKey = function() {
|
|
2444
|
-
if (!specialPropKeyWarningShown) {
|
|
2445
|
-
specialPropKeyWarningShown = true;
|
|
2446
|
-
error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
2447
|
-
}
|
|
2448
|
-
};
|
|
2449
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
2450
|
-
Object.defineProperty(props, "key", {
|
|
2451
|
-
get: warnAboutAccessingKey,
|
|
2452
|
-
configurable: true
|
|
2453
|
-
});
|
|
2454
|
-
}
|
|
2455
|
-
}
|
|
2456
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
2457
|
-
{
|
|
2458
|
-
var warnAboutAccessingRef = function() {
|
|
2459
|
-
if (!specialPropRefWarningShown) {
|
|
2460
|
-
specialPropRefWarningShown = true;
|
|
2461
|
-
error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
2462
|
-
}
|
|
2463
|
-
};
|
|
2464
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
2465
|
-
Object.defineProperty(props, "ref", {
|
|
2466
|
-
get: warnAboutAccessingRef,
|
|
2467
|
-
configurable: true
|
|
2468
|
-
});
|
|
2469
|
-
}
|
|
2470
|
-
}
|
|
2471
|
-
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
|
2472
|
-
var element = {
|
|
2473
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
2474
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
2475
|
-
// Built-in properties that belong on the element
|
|
2476
|
-
type,
|
|
2477
|
-
key,
|
|
2478
|
-
ref,
|
|
2479
|
-
props,
|
|
2480
|
-
// Record the component responsible for creating this element.
|
|
2481
|
-
_owner: owner
|
|
2482
|
-
};
|
|
2483
|
-
{
|
|
2484
|
-
element._store = {};
|
|
2485
|
-
Object.defineProperty(element._store, "validated", {
|
|
2486
|
-
configurable: false,
|
|
2487
|
-
enumerable: false,
|
|
2488
|
-
writable: true,
|
|
2489
|
-
value: false
|
|
2490
|
-
});
|
|
2491
|
-
Object.defineProperty(element, "_self", {
|
|
2492
|
-
configurable: false,
|
|
2493
|
-
enumerable: false,
|
|
2494
|
-
writable: false,
|
|
2495
|
-
value: self
|
|
2496
|
-
});
|
|
2497
|
-
Object.defineProperty(element, "_source", {
|
|
2498
|
-
configurable: false,
|
|
2499
|
-
enumerable: false,
|
|
2500
|
-
writable: false,
|
|
2501
|
-
value: source
|
|
2502
|
-
});
|
|
2503
|
-
if (Object.freeze) {
|
|
2504
|
-
Object.freeze(element.props);
|
|
2505
|
-
Object.freeze(element);
|
|
2506
|
-
}
|
|
2507
|
-
}
|
|
2508
|
-
return element;
|
|
2509
|
-
};
|
|
2510
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
2511
|
-
{
|
|
2512
|
-
var propName;
|
|
2513
|
-
var props = {};
|
|
2514
|
-
var key = null;
|
|
2515
|
-
var ref = null;
|
|
2516
|
-
if (maybeKey !== void 0) {
|
|
2517
|
-
{
|
|
2518
|
-
checkKeyStringCoercion(maybeKey);
|
|
2519
|
-
}
|
|
2520
|
-
key = "" + maybeKey;
|
|
2521
|
-
}
|
|
2522
|
-
if (hasValidKey(config)) {
|
|
2523
|
-
{
|
|
2524
|
-
checkKeyStringCoercion(config.key);
|
|
2525
|
-
}
|
|
2526
|
-
key = "" + config.key;
|
|
2527
|
-
}
|
|
2528
|
-
if (hasValidRef(config)) {
|
|
2529
|
-
ref = config.ref;
|
|
2530
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
2531
|
-
}
|
|
2532
|
-
for (propName in config) {
|
|
2533
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
2534
|
-
props[propName] = config[propName];
|
|
2535
|
-
}
|
|
2536
|
-
}
|
|
2537
|
-
if (type && type.defaultProps) {
|
|
2538
|
-
var defaultProps = type.defaultProps;
|
|
2539
|
-
for (propName in defaultProps) {
|
|
2540
|
-
if (props[propName] === void 0) {
|
|
2541
|
-
props[propName] = defaultProps[propName];
|
|
2542
|
-
}
|
|
2543
|
-
}
|
|
2544
|
-
}
|
|
2545
|
-
if (key || ref) {
|
|
2546
|
-
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
2547
|
-
if (key) {
|
|
2548
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
2549
|
-
}
|
|
2550
|
-
if (ref) {
|
|
2551
|
-
defineRefPropWarningGetter(props, displayName);
|
|
2552
|
-
}
|
|
2553
|
-
}
|
|
2554
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
2555
|
-
}
|
|
2556
|
-
}
|
|
2557
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
2558
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2559
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
2560
|
-
{
|
|
2561
|
-
if (element) {
|
|
2562
|
-
var owner = element._owner;
|
|
2563
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2564
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
2565
|
-
} else {
|
|
2566
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
2567
|
-
}
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
var propTypesMisspellWarningShown;
|
|
2571
|
-
{
|
|
2572
|
-
propTypesMisspellWarningShown = false;
|
|
2573
|
-
}
|
|
2574
|
-
function isValidElement(object) {
|
|
2575
|
-
{
|
|
2576
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
2577
|
-
}
|
|
2578
|
-
}
|
|
2579
|
-
function getDeclarationErrorAddendum() {
|
|
2580
|
-
{
|
|
2581
|
-
if (ReactCurrentOwner$1.current) {
|
|
2582
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
2583
|
-
if (name) {
|
|
2584
|
-
return "\n\nCheck the render method of `" + name + "`.";
|
|
2585
|
-
}
|
|
2586
|
-
}
|
|
2587
|
-
return "";
|
|
2588
|
-
}
|
|
2589
|
-
}
|
|
2590
|
-
function getSourceInfoErrorAddendum(source) {
|
|
2591
|
-
{
|
|
2592
|
-
if (source !== void 0) {
|
|
2593
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
|
2594
|
-
var lineNumber = source.lineNumber;
|
|
2595
|
-
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
|
2596
|
-
}
|
|
2597
|
-
return "";
|
|
2598
|
-
}
|
|
2599
|
-
}
|
|
2600
|
-
var ownerHasKeyUseWarning = {};
|
|
2601
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
2602
|
-
{
|
|
2603
|
-
var info = getDeclarationErrorAddendum();
|
|
2604
|
-
if (!info) {
|
|
2605
|
-
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
2606
|
-
if (parentName) {
|
|
2607
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
2608
|
-
}
|
|
2609
|
-
}
|
|
2610
|
-
return info;
|
|
2611
|
-
}
|
|
2612
|
-
}
|
|
2613
|
-
function validateExplicitKey(element, parentType) {
|
|
2614
|
-
{
|
|
2615
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
2616
|
-
return;
|
|
2617
|
-
}
|
|
2618
|
-
element._store.validated = true;
|
|
2619
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
2620
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
2621
|
-
return;
|
|
2622
|
-
}
|
|
2623
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
2624
|
-
var childOwner = "";
|
|
2625
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
2626
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
2627
|
-
}
|
|
2628
|
-
setCurrentlyValidatingElement$1(element);
|
|
2629
|
-
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
2630
|
-
setCurrentlyValidatingElement$1(null);
|
|
2631
|
-
}
|
|
2632
|
-
}
|
|
2633
|
-
function validateChildKeys(node, parentType) {
|
|
2634
|
-
{
|
|
2635
|
-
if (typeof node !== "object") {
|
|
2636
|
-
return;
|
|
2637
|
-
}
|
|
2638
|
-
if (isArray(node)) {
|
|
2639
|
-
for (var i = 0; i < node.length; i++) {
|
|
2640
|
-
var child = node[i];
|
|
2641
|
-
if (isValidElement(child)) {
|
|
2642
|
-
validateExplicitKey(child, parentType);
|
|
2643
|
-
}
|
|
2644
|
-
}
|
|
2645
|
-
} else if (isValidElement(node)) {
|
|
2646
|
-
if (node._store) {
|
|
2647
|
-
node._store.validated = true;
|
|
2648
|
-
}
|
|
2649
|
-
} else if (node) {
|
|
2650
|
-
var iteratorFn = getIteratorFn(node);
|
|
2651
|
-
if (typeof iteratorFn === "function") {
|
|
2652
|
-
if (iteratorFn !== node.entries) {
|
|
2653
|
-
var iterator = iteratorFn.call(node);
|
|
2654
|
-
var step;
|
|
2655
|
-
while (!(step = iterator.next()).done) {
|
|
2656
|
-
if (isValidElement(step.value)) {
|
|
2657
|
-
validateExplicitKey(step.value, parentType);
|
|
2658
|
-
}
|
|
2659
|
-
}
|
|
2660
|
-
}
|
|
2661
|
-
}
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
|
-
}
|
|
2665
|
-
function validatePropTypes(element) {
|
|
2666
|
-
{
|
|
2667
|
-
var type = element.type;
|
|
2668
|
-
if (type === null || type === void 0 || typeof type === "string") {
|
|
2669
|
-
return;
|
|
2670
|
-
}
|
|
2671
|
-
var propTypes;
|
|
2672
|
-
if (typeof type === "function") {
|
|
2673
|
-
propTypes = type.propTypes;
|
|
2674
|
-
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
2675
|
-
// Inner props are checked in the reconciler.
|
|
2676
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
2677
|
-
propTypes = type.propTypes;
|
|
2678
|
-
} else {
|
|
2679
|
-
return;
|
|
2680
|
-
}
|
|
2681
|
-
if (propTypes) {
|
|
2682
|
-
var name = getComponentNameFromType(type);
|
|
2683
|
-
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
2684
|
-
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
2685
|
-
propTypesMisspellWarningShown = true;
|
|
2686
|
-
var _name = getComponentNameFromType(type);
|
|
2687
|
-
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
2688
|
-
}
|
|
2689
|
-
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
2690
|
-
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
2691
|
-
}
|
|
2692
|
-
}
|
|
2693
|
-
}
|
|
2694
|
-
function validateFragmentProps(fragment) {
|
|
2695
|
-
{
|
|
2696
|
-
var keys = Object.keys(fragment.props);
|
|
2697
|
-
for (var i = 0; i < keys.length; i++) {
|
|
2698
|
-
var key = keys[i];
|
|
2699
|
-
if (key !== "children" && key !== "key") {
|
|
2700
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
2701
|
-
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
2702
|
-
setCurrentlyValidatingElement$1(null);
|
|
2703
|
-
break;
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
if (fragment.ref !== null) {
|
|
2707
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
2708
|
-
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
2709
|
-
setCurrentlyValidatingElement$1(null);
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2712
|
-
}
|
|
2713
|
-
var didWarnAboutKeySpread = {};
|
|
2714
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
2715
|
-
{
|
|
2716
|
-
var validType = isValidElementType(type);
|
|
2717
|
-
if (!validType) {
|
|
2718
|
-
var info = "";
|
|
2719
|
-
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
2720
|
-
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
2721
|
-
}
|
|
2722
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
2723
|
-
if (sourceInfo) {
|
|
2724
|
-
info += sourceInfo;
|
|
2725
|
-
} else {
|
|
2726
|
-
info += getDeclarationErrorAddendum();
|
|
2727
|
-
}
|
|
2728
|
-
var typeString;
|
|
2729
|
-
if (type === null) {
|
|
2730
|
-
typeString = "null";
|
|
2731
|
-
} else if (isArray(type)) {
|
|
2732
|
-
typeString = "array";
|
|
2733
|
-
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2734
|
-
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
2735
|
-
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
2736
|
-
} else {
|
|
2737
|
-
typeString = typeof type;
|
|
2738
|
-
}
|
|
2739
|
-
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
2740
|
-
}
|
|
2741
|
-
var element = jsxDEV(type, props, key, source, self);
|
|
2742
|
-
if (element == null) {
|
|
2743
|
-
return element;
|
|
2744
|
-
}
|
|
2745
|
-
if (validType) {
|
|
2746
|
-
var children = props.children;
|
|
2747
|
-
if (children !== void 0) {
|
|
2748
|
-
if (isStaticChildren) {
|
|
2749
|
-
if (isArray(children)) {
|
|
2750
|
-
for (var i = 0; i < children.length; i++) {
|
|
2751
|
-
validateChildKeys(children[i], type);
|
|
2752
|
-
}
|
|
2753
|
-
if (Object.freeze) {
|
|
2754
|
-
Object.freeze(children);
|
|
2755
|
-
}
|
|
2756
|
-
} else {
|
|
2757
|
-
error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2758
|
-
}
|
|
2759
|
-
} else {
|
|
2760
|
-
validateChildKeys(children, type);
|
|
2761
|
-
}
|
|
2762
|
-
}
|
|
2763
|
-
}
|
|
2764
|
-
{
|
|
2765
|
-
if (hasOwnProperty.call(props, "key")) {
|
|
2766
|
-
var componentName = getComponentNameFromType(type);
|
|
2767
|
-
var keys = Object.keys(props).filter(function(k) {
|
|
2768
|
-
return k !== "key";
|
|
2769
|
-
});
|
|
2770
|
-
var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
2771
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
2772
|
-
var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
|
|
2773
|
-
error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
2774
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
2775
|
-
}
|
|
2776
|
-
}
|
|
2777
|
-
}
|
|
2778
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
2779
|
-
validateFragmentProps(element);
|
|
2780
|
-
} else {
|
|
2781
|
-
validatePropTypes(element);
|
|
2782
|
-
}
|
|
2783
|
-
return element;
|
|
2784
|
-
}
|
|
2785
|
-
}
|
|
2786
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
2787
|
-
{
|
|
2788
|
-
return jsxWithValidation(type, props, key, true);
|
|
2789
|
-
}
|
|
2790
|
-
}
|
|
2791
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
2792
|
-
{
|
|
2793
|
-
return jsxWithValidation(type, props, key, false);
|
|
2794
|
-
}
|
|
2795
|
-
}
|
|
2796
|
-
var jsx2 = jsxWithValidationDynamic;
|
|
2797
|
-
var jsxs2 = jsxWithValidationStatic;
|
|
2798
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2799
|
-
exports.jsx = jsx2;
|
|
2800
|
-
exports.jsxs = jsxs2;
|
|
2801
|
-
})();
|
|
2802
|
-
}
|
|
2803
|
-
}
|
|
2804
|
-
});
|
|
2805
|
-
|
|
2806
|
-
// femoGen/node_modules/react/jsx-runtime.js
|
|
2807
|
-
var require_jsx_runtime = __commonJS({
|
|
2808
|
-
"femoGen/node_modules/react/jsx-runtime.js"(exports, module) {
|
|
2809
|
-
"use strict";
|
|
2810
|
-
if (false) {
|
|
2811
|
-
module.exports = null;
|
|
2812
|
-
} else {
|
|
2813
|
-
module.exports = require_react_jsx_runtime_development();
|
|
2814
|
-
}
|
|
2815
|
-
}
|
|
2816
|
-
});
|
|
2817
|
-
|
|
2818
|
-
// femoGen/src/common.jsx
|
|
2819
|
-
var import_react = __toESM(require_react(), 1);
|
|
2820
|
-
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
2821
|
-
var ErrorBoundary = class extends import_react.default.Component {
|
|
2822
|
-
constructor(props) {
|
|
2823
|
-
super(props);
|
|
2824
|
-
this.state = { error: null, errorInfo: null };
|
|
2825
|
-
}
|
|
2826
|
-
static getDerivedStateFromError(error) {
|
|
2827
|
-
return { error };
|
|
2828
|
-
}
|
|
2829
|
-
componentDidCatch(error, errorInfo) {
|
|
2830
|
-
this.setState({ error, errorInfo });
|
|
2831
|
-
console.error("ErrorBoundary caught:", error, errorInfo);
|
|
2832
|
-
}
|
|
2833
|
-
render() {
|
|
2834
|
-
if (this.state.error) {
|
|
2835
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
2836
|
-
"div",
|
|
2837
|
-
{
|
|
2838
|
-
style: {
|
|
2839
|
-
padding: 30,
|
|
2840
|
-
fontFamily: "var(--femo-font-sans)",
|
|
2841
|
-
color: "var(--femo-danger)",
|
|
2842
|
-
background: "var(--femo-danger-soft)",
|
|
2843
|
-
minHeight: "100vh"
|
|
2844
|
-
},
|
|
2845
|
-
children: [
|
|
2846
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "\u53D1\u751F\u9519\u8BEF" }),
|
|
2847
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { style: { whiteSpace: "pre-wrap", fontSize: 13 }, children: this.state.error?.toString() }),
|
|
2848
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", { style: { marginTop: 16 }, children: [
|
|
2849
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", { children: "\u7EC4\u4EF6\u5806\u6808" }),
|
|
2850
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { style: { fontSize: 11 }, children: this.state.errorInfo?.componentStack })
|
|
2851
|
-
] }),
|
|
2852
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2853
|
-
"button",
|
|
2854
|
-
{
|
|
2855
|
-
onClick: () => this.setState({ error: null, errorInfo: null }),
|
|
2856
|
-
style: { marginTop: 16, padding: "8px 16px" },
|
|
2857
|
-
children: "\u91CD\u8BD5"
|
|
2858
|
-
}
|
|
2859
|
-
)
|
|
2860
|
-
]
|
|
2861
|
-
}
|
|
2862
|
-
);
|
|
2863
|
-
}
|
|
2864
|
-
return this.props.children;
|
|
2865
|
-
}
|
|
2866
|
-
};
|
|
2867
|
-
|
|
2868
|
-
// femoGen/src/femoDiagnostics.js
|
|
2869
|
-
var SEVERITY_ERROR = "error";
|
|
2870
|
-
var SEVERITY_WARNING = "warning";
|
|
2871
|
-
var LINE_TEXT_MAX = 120;
|
|
2872
|
-
function clipLineText(text) {
|
|
2873
|
-
const s = String(text ?? "").replace(/\t/g, " ").trim();
|
|
2874
|
-
if (s.length <= LINE_TEXT_MAX) return s;
|
|
2875
|
-
return s.slice(0, LINE_TEXT_MAX) + "\u2026";
|
|
2876
|
-
}
|
|
2877
|
-
function makeDiagnostic(severity, { line = null, lineText = "", message, where = "" } = {}) {
|
|
2878
|
-
return {
|
|
2879
|
-
severity,
|
|
2880
|
-
line: Number.isFinite(line) ? line : null,
|
|
2881
|
-
lineText: clipLineText(lineText),
|
|
2882
|
-
message: String(message || ""),
|
|
2883
|
-
where: String(where || "")
|
|
2884
|
-
};
|
|
2885
|
-
}
|
|
2886
|
-
function formatDiagnostic(d) {
|
|
2887
|
-
const where = d.where ? `${d.where} \u2192 ` : "";
|
|
2888
|
-
if (d.line != null) {
|
|
2889
|
-
const lineText = d.lineText ? ` "${d.lineText}"` : "";
|
|
2890
|
-
return `\u7B2C ${d.line} \u884C:${lineText} ${where}${d.message}`;
|
|
2891
|
-
}
|
|
2892
|
-
return `${where}${d.message}`;
|
|
2893
|
-
}
|
|
2894
|
-
var FEMOSyntaxError = class extends Error {
|
|
2895
|
-
constructor(diagnostics, header = "") {
|
|
2896
|
-
const body = diagnostics.map(
|
|
2897
|
-
(d, i) => diagnostics.length > 1 ? ` ${i + 1}. ${formatDiagnostic(d)}` : formatDiagnostic(d)
|
|
2898
|
-
).join("\n");
|
|
2899
|
-
super(header ? `${header}
|
|
2900
|
-
${body}` : body);
|
|
2901
|
-
this.name = "FEMOSyntaxError";
|
|
2902
|
-
this.diagnostics = diagnostics;
|
|
2903
|
-
}
|
|
2904
|
-
};
|
|
2905
|
-
function createReporter() {
|
|
2906
|
-
const items = [];
|
|
2907
|
-
const push = (severity, message, opts) => {
|
|
2908
|
-
const d = makeDiagnostic(severity, { ...opts || {}, message });
|
|
2909
|
-
items.push(d);
|
|
2910
|
-
return d;
|
|
2911
|
-
};
|
|
2912
|
-
return {
|
|
2913
|
-
items,
|
|
2914
|
-
get warnings() {
|
|
2915
|
-
return items.filter((d) => d.severity === SEVERITY_WARNING);
|
|
2916
|
-
},
|
|
2917
|
-
get errors() {
|
|
2918
|
-
return items.filter((d) => d.severity === SEVERITY_ERROR);
|
|
2919
|
-
},
|
|
2920
|
-
hasErrors() {
|
|
2921
|
-
return items.some((d) => d.severity === SEVERITY_ERROR);
|
|
2922
|
-
},
|
|
2923
|
-
warning(message, opts) {
|
|
2924
|
-
return push(SEVERITY_WARNING, message, opts);
|
|
2925
|
-
},
|
|
2926
|
-
// 记录 error 但不抛(配合 throwIfErrors 做聚合计数报错)
|
|
2927
|
-
error(message, opts) {
|
|
2928
|
-
return push(SEVERITY_ERROR, message, opts);
|
|
2929
|
-
},
|
|
2930
|
-
// 记录 error 并立即中断解析(替代原 throw new Error)
|
|
2931
|
-
fail(message, opts) {
|
|
2932
|
-
push(SEVERITY_ERROR, message, opts);
|
|
2933
|
-
throw new FEMOSyntaxError([items[items.length - 1]]);
|
|
2934
|
-
},
|
|
2935
|
-
// 有 error 则聚合抛出(多条时 header 带计数;header 缺省给通用文案)
|
|
2936
|
-
throwIfErrors(header = "") {
|
|
2937
|
-
const errs = items.filter((d) => d.severity === SEVERITY_ERROR);
|
|
2938
|
-
if (errs.length === 0) return;
|
|
2939
|
-
const head = header ? errs.length > 1 ? `${header}\uFF08\u5171 ${errs.length} \u5904\uFF09\uFF1A` : `${header}\uFF1A` : errs.length > 1 ? `\u5267\u672C\u8BED\u6CD5\u68C0\u67E5\u672A\u901A\u8FC7\uFF08\u5171 ${errs.length} \u5904\uFF09\uFF1A` : "";
|
|
2940
|
-
throw new FEMOSyntaxError(errs, head);
|
|
2941
|
-
}
|
|
2942
|
-
};
|
|
2943
|
-
}
|
|
2944
|
-
|
|
2945
|
-
// femoGen/src/femoParser.jsx
|
|
2946
|
-
var THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
2947
|
-
function normalizeSymbols(str, context = "global") {
|
|
2948
|
-
let s = str;
|
|
2949
|
-
if (context !== "prompt") {
|
|
2950
|
-
s = s.replace(/:/g, ":").replace(/,/g, ",").replace(/“/g, '"').replace(/”/g, '"').replace(/(/g, "(").replace(/)/g, ")").replace(/【/g, "[").replace(/】/g, "]").replace(/|/g, "|");
|
|
2951
|
-
}
|
|
2952
|
-
if (context === "flow") {
|
|
2953
|
-
s = s.replace(/--/g, "->");
|
|
2954
|
-
}
|
|
2955
|
-
return s;
|
|
2956
|
-
}
|
|
2957
|
-
function stripLineComments(line) {
|
|
2958
|
-
let out = "";
|
|
2959
|
-
let quote = null;
|
|
2960
|
-
for (let i = 0; i < line.length; i++) {
|
|
2961
|
-
const c = line[i];
|
|
2962
|
-
if (quote) {
|
|
2963
|
-
out += c;
|
|
2964
|
-
if (c === "\\" && i + 1 < line.length) {
|
|
2965
|
-
out += line[i + 1];
|
|
2966
|
-
i++;
|
|
2967
|
-
continue;
|
|
2968
|
-
}
|
|
2969
|
-
if (c === quote) quote = null;
|
|
2970
|
-
continue;
|
|
2971
|
-
}
|
|
2972
|
-
if (c === '"' || c === "'") {
|
|
2973
|
-
quote = c;
|
|
2974
|
-
out += c;
|
|
2975
|
-
continue;
|
|
2976
|
-
}
|
|
2977
|
-
if (c === "#") {
|
|
2978
|
-
break;
|
|
2979
|
-
}
|
|
2980
|
-
if (c === "/" && line[i + 1] === "/") break;
|
|
2981
|
-
out += c;
|
|
2982
|
-
}
|
|
2983
|
-
return out;
|
|
2984
|
-
}
|
|
2985
|
-
function findPromptRanges(lines) {
|
|
2986
|
-
const ranges = [];
|
|
2987
|
-
let i = 0;
|
|
2988
|
-
while (i < lines.length) {
|
|
2989
|
-
const trimmed = lines[i].trim();
|
|
2990
|
-
const isMultiStart = /^(?:prompt|showprompt):\s*[||]\s*(?:#.*)?$/.test(trimmed) || /^(?:@|\$@|\$)?[\w\u4e00-\u9fff]+\s*=\s*[||]\s*(?:#.*)?$/.test(trimmed);
|
|
2991
|
-
if (isMultiStart) {
|
|
2992
|
-
const fieldIndent = lines[i].length - lines[i].trimStart().length;
|
|
2993
|
-
let j = i + 1;
|
|
2994
|
-
while (j < lines.length) {
|
|
2995
|
-
const t2 = lines[j].trim();
|
|
2996
|
-
if (!t2) {
|
|
2997
|
-
j++;
|
|
2998
|
-
continue;
|
|
2999
|
-
}
|
|
3000
|
-
const ind2 = lines[j].length - lines[j].trimStart().length;
|
|
3001
|
-
if (ind2 <= fieldIndent) break;
|
|
3002
|
-
j++;
|
|
3003
|
-
}
|
|
3004
|
-
ranges.push([i + 1, j]);
|
|
3005
|
-
i = j;
|
|
3006
|
-
continue;
|
|
3007
|
-
}
|
|
3008
|
-
i++;
|
|
3009
|
-
}
|
|
3010
|
-
return ranges;
|
|
3011
|
-
}
|
|
3012
|
-
function extractHashSketch(lines) {
|
|
3013
|
-
const out = [];
|
|
3014
|
-
let i = 0;
|
|
3015
|
-
while (i < lines.length) {
|
|
3016
|
-
const raw = lines[i];
|
|
3017
|
-
if (/^#\s*sketch\s*:/.test(raw)) {
|
|
3018
|
-
out.push(raw.replace(/^#/, ""));
|
|
3019
|
-
i++;
|
|
3020
|
-
while (i < lines.length && /^#/.test(lines[i])) {
|
|
3021
|
-
out.push(lines[i].replace(/^#/, ""));
|
|
3022
|
-
i++;
|
|
3023
|
-
}
|
|
3024
|
-
} else {
|
|
3025
|
-
out.push(raw);
|
|
3026
|
-
i++;
|
|
3027
|
-
}
|
|
3028
|
-
}
|
|
3029
|
-
return out;
|
|
3030
|
-
}
|
|
3031
|
-
function stripComments(lines) {
|
|
3032
|
-
const ranges = findPromptRanges(lines);
|
|
3033
|
-
return lines.map((raw, i) => {
|
|
3034
|
-
for (const [s, e] of ranges) {
|
|
3035
|
-
if (i >= s && i < e) return raw;
|
|
3036
|
-
}
|
|
3037
|
-
return stripLineComments(raw);
|
|
3038
|
-
});
|
|
3039
|
-
}
|
|
3040
|
-
function parseFEMO(text, rep = null) {
|
|
3041
|
-
rep = rep || createReporter();
|
|
3042
|
-
const rawLines = text.split("\n");
|
|
3043
|
-
const metaLineIdx = rawLines.findIndex((l) => /^meta:\s*$/.test(l));
|
|
3044
|
-
const preamble = metaLineIdx > 0 ? rawLines.slice(0, metaLineIdx).join("\n").replace(/\s+$/, "") : "";
|
|
3045
|
-
const lines = stripComments(extractHashSketch(rawLines));
|
|
3046
|
-
const blocks = splitTopBlocks(lines);
|
|
3047
|
-
const result = {
|
|
3048
|
-
meta: {
|
|
3049
|
-
name: "",
|
|
3050
|
-
version: "1.0",
|
|
3051
|
-
owner: "",
|
|
3052
|
-
database: "",
|
|
3053
|
-
session: "",
|
|
3054
|
-
system_safety: "",
|
|
3055
|
-
output_style: ""
|
|
3056
|
-
},
|
|
3057
|
-
code: [],
|
|
3058
|
-
context: [],
|
|
3059
|
-
memory: [],
|
|
3060
|
-
preamble,
|
|
3061
|
-
// meta: 之前的文件头原文(注释等),buildFEMO 原样回写
|
|
3062
|
-
vars: [],
|
|
3063
|
-
actors: [],
|
|
3064
|
-
warnings: [],
|
|
3065
|
-
// 非阻断提示(rep.warnings 诊断:行号/出错行/信息/区域)——与引擎 script.warnings 对齐
|
|
3066
|
-
actions: [],
|
|
3067
|
-
modules: [],
|
|
3068
|
-
mainflow: { nodeDecls: [], edges: [] }
|
|
3069
|
-
};
|
|
3070
|
-
let mainflowSketch = null;
|
|
3071
|
-
for (const block of blocks) {
|
|
3072
|
-
const h = block.header;
|
|
3073
|
-
if (h === "meta:") {
|
|
3074
|
-
result.meta = parseMetaBlock(block.contentLines, rep);
|
|
3075
|
-
} else if (h === "code:") {
|
|
3076
|
-
result.code = parseCodeBlock(block.contentLines, rep);
|
|
3077
|
-
} else if (h === "vars:") {
|
|
3078
|
-
result.vars = parseVarsBlock(block.contentLines, rep);
|
|
3079
|
-
} else if (h === "actors:") {
|
|
3080
|
-
result.actors = parseActorsBlock(block.contentLines, rep);
|
|
3081
|
-
} else if (h.startsWith("memory ")) {
|
|
3082
|
-
result.memory.push(
|
|
3083
|
-
parseMemoryOrContextBlock(h, block.contentLines, "memory", rep, block.headerLineNum)
|
|
3084
|
-
);
|
|
3085
|
-
} else if (h.startsWith("context ")) {
|
|
3086
|
-
result.context.push(
|
|
3087
|
-
parseMemoryOrContextBlock(h, block.contentLines, "context", rep, block.headerLineNum)
|
|
3088
|
-
);
|
|
3089
|
-
} else if (h.startsWith("action ")) {
|
|
3090
|
-
result.actions.push(parseActionBlock(h, block.contentLines, rep, block.headerLineNum));
|
|
3091
|
-
} else if (h.startsWith("module ")) {
|
|
3092
|
-
result.modules.push(parseModuleBlock(h, block.contentLines, rep, block.headerLineNum));
|
|
3093
|
-
} else if (h === "sketch:") {
|
|
3094
|
-
mainflowSketch = parseLayoutBlock(block.contentLines);
|
|
3095
|
-
} else if (h === "mainflow:" || h === "flow:") {
|
|
3096
|
-
result.mainflow = parseMainflowBlock(block.contentLines, rep);
|
|
3097
|
-
if (mainflowSketch) {
|
|
3098
|
-
result.mainflow.layout = { ...result.mainflow.layout, ...mainflowSketch };
|
|
3099
|
-
mainflowSketch = null;
|
|
3100
|
-
}
|
|
3101
|
-
} else {
|
|
3102
|
-
rep.fail(
|
|
3103
|
-
`\u672A\u8BC6\u522B\u7684\u9876\u5C42\u5757: "${h}"\u3002\u671F\u671B: meta:, code:, vars:, actors:, context:, memory:, action ..., module ..., mainflow:`,
|
|
3104
|
-
{ line: (block.headerLineNum ?? -1) + 1, lineText: h, where: "\u9876\u5C42" }
|
|
3105
|
-
);
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3108
|
-
if (mainflowSketch && result.mainflow) {
|
|
3109
|
-
result.mainflow.layout = { ...result.mainflow.layout, ...mainflowSketch };
|
|
3110
|
-
}
|
|
3111
|
-
const topModules = result.modules;
|
|
3112
|
-
result.modules = [];
|
|
3113
|
-
function flattenModules(mods, parentPath) {
|
|
3114
|
-
for (const m of mods) {
|
|
3115
|
-
const path = [...parentPath, m.name];
|
|
3116
|
-
m.path = path;
|
|
3117
|
-
result.modules.push(m);
|
|
3118
|
-
if (m.subModules) {
|
|
3119
|
-
flattenModules(m.subModules, path);
|
|
3120
|
-
delete m.subModules;
|
|
3121
|
-
}
|
|
3122
|
-
}
|
|
3123
|
-
}
|
|
3124
|
-
flattenModules(topModules, ["mainflow"]);
|
|
3125
|
-
validateDeclarations(result, rep);
|
|
3126
|
-
validateActionSyntax(result, rep);
|
|
3127
|
-
validateJoinOnCycle(result, text, rep);
|
|
3128
|
-
result.warnings = rep.warnings;
|
|
3129
|
-
rep.throwIfErrors();
|
|
3130
|
-
return result;
|
|
3131
|
-
}
|
|
3132
|
-
function validateJoinOnCycle(result, text, rep = null) {
|
|
3133
|
-
rep = rep || createReporter();
|
|
3134
|
-
const flows = [];
|
|
3135
|
-
if (result.mainflow) flows.push({ edges: result.mainflow.edges, where: "mainflow" });
|
|
3136
|
-
for (const m2 of result.modules || []) {
|
|
3137
|
-
flows.push({ edges: m2.edges, where: `module ${m2.name}` });
|
|
3138
|
-
}
|
|
3139
|
-
function onCycle(targetLabel, edges) {
|
|
3140
|
-
const frontier = (edges || []).filter((e) => e.srcLabel === targetLabel).map((e) => e.tgtLabel);
|
|
3141
|
-
const visited = new Set(frontier);
|
|
3142
|
-
while (frontier.length) {
|
|
3143
|
-
const nid = frontier.pop();
|
|
3144
|
-
if (nid === targetLabel) return true;
|
|
3145
|
-
for (const e of edges || []) {
|
|
3146
|
-
if (e.srcLabel === nid && !visited.has(e.tgtLabel)) {
|
|
3147
|
-
visited.add(e.tgtLabel);
|
|
3148
|
-
frontier.push(e.tgtLabel);
|
|
3149
|
-
}
|
|
3150
|
-
}
|
|
3151
|
-
}
|
|
3152
|
-
return false;
|
|
3153
|
-
}
|
|
3154
|
-
const joinBlock = /join\s*\(([^)]*)\)\s*:\s*([\s\S]*?)to\s*\[([^\]]+)\]/g;
|
|
3155
|
-
let m;
|
|
3156
|
-
while ((m = joinBlock.exec(String(text || ""))) !== null) {
|
|
3157
|
-
const target = m[3].trim();
|
|
3158
|
-
for (const f of flows) {
|
|
3159
|
-
const known = new Set((f.edges || []).flatMap((e) => [e.srcLabel, e.tgtLabel]));
|
|
3160
|
-
if (known.has(target) && onCycle(target, f.edges)) {
|
|
3161
|
-
const before = String(text || "").slice(0, m.index);
|
|
3162
|
-
const line = before.split("\n").length;
|
|
3163
|
-
const lineText = (text.slice(m.index).split("\n")[0] || "").trim();
|
|
3164
|
-
rep.warning(
|
|
3165
|
-
`join(...) \u7684\u76EE\u6807 [${target}] \u4F4D\u4E8E\u6D41\u7A0B\u73AF\u8DEF\u4E0A\uFF08\u4ECE\u5B83\u51FA\u53D1\u80FD\u7ED5\u56DE\u5B83\u81EA\u5DF1\uFF09\u3002\u5F53\u524D\u5F15\u64CE\u7684 join \u4F1A\u7B49\u5F85\u4E0A\u6E38\u5230\u9F50\uFF0C\u800C\u73AF\u8DEF\u91CC\u7684\u4E00\u90E8\u5206\u4E0A\u6E38\u53EA\u6709 join \u653E\u884C\u4E4B\u540E\u624D\u4F1A\u53D1\u751F\uFF0C\u8FD9\u4F1A\u8BA9\u5267\u672C\u6C38\u8FDC\u7B49\u5F85\u4E0B\u53BB\u3002\u8BF7\u628A\u5FAA\u73AF\u91CC\u7684\u5408\u6D41\u6539\u6210\u666E\u901A\u591A\u7EBF\u6C47\u5165\uFF08\u9010\u6761 [A] -> [next]\uFF0C\u5230\u5373\u8D70\uFF09\uFF0C\u4E0D\u8981\u7528 join(...):\u3002`,
|
|
3166
|
-
{ line, lineText, where: f.where }
|
|
3167
|
-
);
|
|
3168
|
-
break;
|
|
3169
|
-
}
|
|
3170
|
-
}
|
|
3171
|
-
}
|
|
3172
|
-
}
|
|
3173
|
-
var _RESERVED_WORDS = /* @__PURE__ */ new Set([
|
|
3174
|
-
"and",
|
|
3175
|
-
"or",
|
|
3176
|
-
"not",
|
|
3177
|
-
"in",
|
|
3178
|
-
"is",
|
|
3179
|
-
"True",
|
|
3180
|
-
"False",
|
|
3181
|
-
"None",
|
|
3182
|
-
"true",
|
|
3183
|
-
"false",
|
|
3184
|
-
"TRUE",
|
|
3185
|
-
"FALSE"
|
|
3186
|
-
]);
|
|
3187
|
-
function _extractCondIdentifiers(cond) {
|
|
3188
|
-
const noStr = cond.replace(/"[^"]*"|'[^']*'/g, '""');
|
|
3189
|
-
return noStr.match(/@?[\w\u4e00-\u9fff]+(?:\.[\w\u4e00-\u9fff]+)*/g) || [];
|
|
3190
|
-
}
|
|
3191
|
-
function _mainIdent(ident) {
|
|
3192
|
-
const dot = ident.indexOf(".");
|
|
3193
|
-
return dot >= 0 ? ident.slice(0, dot) : ident;
|
|
3194
|
-
}
|
|
3195
|
-
function _declName(raw) {
|
|
3196
|
-
return raw.startsWith("$") ? raw.slice(1) : raw;
|
|
3197
|
-
}
|
|
3198
|
-
function validateDeclarations(result, rep = null) {
|
|
3199
|
-
rep = rep || createReporter();
|
|
3200
|
-
const topVars = new Set((result.vars || []).map((v) => _declName(v.name)));
|
|
3201
|
-
const actors = new Set((result.actors || []).map((a) => a.name));
|
|
3202
|
-
const moduleVars = /* @__PURE__ */ new Map();
|
|
3203
|
-
for (const m of result.modules || []) {
|
|
3204
|
-
moduleVars.set(m.name, new Set((m.vars || []).map((v) => _declName(v.name))));
|
|
3205
|
-
}
|
|
3206
|
-
function validateFlow(nodeDecls, edges, ctxName, moduleName) {
|
|
3207
|
-
const scopeVars = new Set(topVars);
|
|
3208
|
-
if (moduleName && moduleVars.has(moduleName)) {
|
|
3209
|
-
for (const n of moduleVars.get(moduleName)) scopeVars.add(n);
|
|
3210
|
-
}
|
|
3211
|
-
const loopVars = /* @__PURE__ */ new Set();
|
|
3212
|
-
for (const d of nodeDecls || []) {
|
|
3213
|
-
if (d.specialType === "FOR" && d.forCondition) {
|
|
3214
|
-
const m = d.forCondition.match(/^(@?[\w\u4e00-\u9fff]+)\s+in\s+(.+)$/);
|
|
3215
|
-
if (!m) {
|
|
3216
|
-
rep.fail(
|
|
3217
|
-
`for \u6761\u4EF6\u683C\u5F0F\u9519\u8BEF: "${d.forCondition}"\u3002\u671F\u671B: for @var in list`,
|
|
3218
|
-
{ where: ctxName }
|
|
3219
|
-
);
|
|
3220
|
-
}
|
|
3221
|
-
const loopVar = m[1];
|
|
3222
|
-
if (!scopeVars.has(loopVar)) {
|
|
3223
|
-
rep.fail(
|
|
3224
|
-
`for \u5FAA\u73AF\u53D8\u91CF "${loopVar}" \u672A\u5728 vars: \u4E2D\u58F0\u660E\uFF08for \u6761\u4EF6: "${d.forCondition}"\uFF09\u3002\u6240\u6709\u5FAA\u73AF\u53D8\u91CF\u5FC5\u987B\u5728 vars: \u4E2D\u9884\u5148\u58F0\u660E\uFF0C\u4F8B\u5982: ${loopVar} = ""`,
|
|
3225
|
-
{ where: ctxName }
|
|
3226
|
-
);
|
|
3227
|
-
}
|
|
3228
|
-
loopVars.add(loopVar);
|
|
3229
|
-
const iterable = m[2].trim();
|
|
3230
|
-
if (/^@?[\w\u4e00-\u9fff]+$/.test(iterable) && !scopeVars.has(iterable)) {
|
|
3231
|
-
rep.fail(
|
|
3232
|
-
`for \u8FED\u4EE3\u5668 "${iterable}" \u672A\u5728 vars: \u4E2D\u58F0\u660E\uFF08for \u6761\u4EF6: "${d.forCondition}"\uFF09`,
|
|
3233
|
-
{ where: ctxName }
|
|
3234
|
-
);
|
|
3235
|
-
}
|
|
3236
|
-
}
|
|
3237
|
-
}
|
|
3238
|
-
const known = /* @__PURE__ */ new Set([...scopeVars, ...actors, ...loopVars]);
|
|
3239
|
-
for (const e of edges || []) {
|
|
3240
|
-
if (!e.cond) continue;
|
|
3241
|
-
for (const ident of _extractCondIdentifiers(e.cond)) {
|
|
3242
|
-
if (_RESERVED_WORDS.has(ident)) continue;
|
|
3243
|
-
const main = _mainIdent(ident);
|
|
3244
|
-
if (/^\d+(\.\d+)?$/.test(main)) continue;
|
|
3245
|
-
if (main.startsWith("@")) {
|
|
3246
|
-
if (!actors.has(main) && !scopeVars.has(main) && !loopVars.has(main)) {
|
|
3247
|
-
rep.fail(
|
|
3248
|
-
`\u6761\u4EF6 "${e.cond}" \u5F15\u7528\u4E86\u672A\u58F0\u660E\u7684 actor/\u53D8\u91CF "${main}"\uFF08\u8FB9 ${e.srcLabel} -> ${e.tgtLabel}\uFF09`,
|
|
3249
|
-
{ where: ctxName }
|
|
3250
|
-
);
|
|
3251
|
-
}
|
|
3252
|
-
} else if (!known.has(main)) {
|
|
3253
|
-
rep.fail(
|
|
3254
|
-
`\u6761\u4EF6 "${e.cond}" \u5F15\u7528\u4E86\u672A\u58F0\u660E\u7684\u53D8\u91CF "${main}"\uFF08\u8FB9 ${e.srcLabel} -> ${e.tgtLabel}\uFF09\u3002\u5B57\u7B26\u4E32\u5B57\u9762\u91CF\u8BF7\u52A0\u5F15\u53F7\uFF0C\u5982 == "ai"\uFF1B\u6240\u6709\u53D8\u91CF\u987B\u5728 vars: \u4E2D\u58F0\u660E`,
|
|
3255
|
-
{ where: ctxName }
|
|
3256
|
-
);
|
|
3257
|
-
}
|
|
3258
|
-
}
|
|
3259
|
-
}
|
|
3260
|
-
const seenEdges = /* @__PURE__ */ new Set();
|
|
3261
|
-
const uniqEdges = (edges || []).filter((e) => {
|
|
3262
|
-
const key = `${e.srcLabel}\0${e.tgtLabel}\0${e.cond || ""}`;
|
|
3263
|
-
if (seenEdges.has(key)) return false;
|
|
3264
|
-
seenEdges.add(key);
|
|
3265
|
-
return true;
|
|
3266
|
-
});
|
|
3267
|
-
const entrySrc = (s) => String(s ?? "").replace(/^\[|\]$/g, "");
|
|
3268
|
-
const hasIn = new Set(
|
|
3269
|
-
uniqEdges.filter((e) => entrySrc(e.srcLabel) !== "START" && entrySrc(e.srcLabel) !== "IN").map((e) => e.tgtLabel)
|
|
3270
|
-
);
|
|
3271
|
-
const gatewayNames = new Set(
|
|
3272
|
-
(nodeDecls || []).filter((d) => d.specialType === "FOR" || d.specialType === "PAR" || d.specialType === "FORK" || d.specialType === "JOIN").map((d) => d.label)
|
|
3273
|
-
);
|
|
3274
|
-
const unconditionalOuts = /* @__PURE__ */ new Map();
|
|
3275
|
-
for (const e of uniqEdges) {
|
|
3276
|
-
if (!e.cond) {
|
|
3277
|
-
const list = unconditionalOuts.get(e.srcLabel) || [];
|
|
3278
|
-
list.push(e.tgtLabel);
|
|
3279
|
-
unconditionalOuts.set(e.srcLabel, list);
|
|
3280
|
-
}
|
|
3281
|
-
}
|
|
3282
|
-
for (const [src, tgts] of unconditionalOuts) {
|
|
3283
|
-
if (gatewayNames.has(src)) continue;
|
|
3284
|
-
if (tgts.length >= 2 && hasIn.has(src)) {
|
|
3285
|
-
}
|
|
3286
|
-
}
|
|
3287
|
-
}
|
|
3288
|
-
validateFlow(result.mainflow.nodeDecls, result.mainflow.edges, "mainflow", null);
|
|
3289
|
-
for (const m of result.modules || []) {
|
|
3290
|
-
validateFlow(m.nodeDecls, m.edges, `module ${m.name}`, m.name);
|
|
3291
|
-
}
|
|
3292
|
-
}
|
|
3293
|
-
var _PY_KEYWORDS = /* @__PURE__ */ new Set([
|
|
3294
|
-
"False",
|
|
3295
|
-
"None",
|
|
3296
|
-
"True",
|
|
3297
|
-
"and",
|
|
3298
|
-
"as",
|
|
3299
|
-
"assert",
|
|
3300
|
-
"async",
|
|
3301
|
-
"await",
|
|
3302
|
-
"break",
|
|
3303
|
-
"class",
|
|
3304
|
-
"continue",
|
|
3305
|
-
"def",
|
|
3306
|
-
"del",
|
|
3307
|
-
"elif",
|
|
3308
|
-
"else",
|
|
3309
|
-
"except",
|
|
3310
|
-
"finally",
|
|
3311
|
-
"for",
|
|
3312
|
-
"from",
|
|
3313
|
-
"global",
|
|
3314
|
-
"if",
|
|
3315
|
-
"import",
|
|
3316
|
-
"in",
|
|
3317
|
-
"is",
|
|
3318
|
-
"lambda",
|
|
3319
|
-
"nonlocal",
|
|
3320
|
-
"not",
|
|
3321
|
-
"or",
|
|
3322
|
-
"pass",
|
|
3323
|
-
"raise",
|
|
3324
|
-
"return",
|
|
3325
|
-
"try",
|
|
3326
|
-
"while",
|
|
3327
|
-
"with",
|
|
3328
|
-
"yield"
|
|
3329
|
-
]);
|
|
3330
|
-
function _stripSpecName(name) {
|
|
3331
|
-
return String(name || "").replace(/^[$@]+/, "").trim();
|
|
3332
|
-
}
|
|
3333
|
-
function _outTargetRoot(raw) {
|
|
3334
|
-
let t = String(raw || "").trim().replace(/,+$/, "").trim();
|
|
3335
|
-
t = t.replace(/\([^)]*\)\s*$/, "").trim();
|
|
3336
|
-
t = t.split(/\+=|-=|=(?!=)/)[0].trim();
|
|
3337
|
-
return _stripSpecName(t);
|
|
3338
|
-
}
|
|
3339
|
-
function _splitInItems(inMappings) {
|
|
3340
|
-
const items = [];
|
|
3341
|
-
for (const line of String(inMappings || "").split("\n")) {
|
|
3342
|
-
for (const piece of line.split(",")) {
|
|
3343
|
-
const t = piece.trim().replace(/,+$/, "").trim();
|
|
3344
|
-
if (t) items.push(t);
|
|
3345
|
-
}
|
|
3346
|
-
}
|
|
3347
|
-
return items;
|
|
3348
|
-
}
|
|
3349
|
-
function validateActionSyntax(result, rep = null) {
|
|
3350
|
-
rep = rep || createReporter();
|
|
3351
|
-
const actors = new Set((result.actors || []).map((a) => a.name));
|
|
3352
|
-
const topScopeVars = new Set((result.vars || []).map((v) => _stripSpecName(v.name)));
|
|
3353
|
-
function checkScope(rawScope, scopeVars, ctx) {
|
|
3354
|
-
const s = String(rawScope || "").trim();
|
|
3355
|
-
if (!s || s.toLowerCase() === "all" || s.toLowerCase() === "self") return;
|
|
3356
|
-
if (/\bself\b/i.test(s)) {
|
|
3357
|
-
rep.error(
|
|
3358
|
-
`${ctx}: scope: ${s} \u2192 "self" \u53EA\u80FD\u5355\u72EC\u4F7F\u7528\uFF08scope: self = \u4EC5\u53D1\u8A00\u8005\u53EF\u89C1\uFF09\uFF1B\u591A\u76EE\u6807\u8BF7\u5199\u6210\u65B9\u62EC\u53F7\u5217\u8868\uFF0C\u5982 scope: [@\u4E0A\u5E1D, @player]`,
|
|
3359
|
-
{ where: "action \u6821\u9A8C" }
|
|
3360
|
-
);
|
|
3361
|
-
return;
|
|
3362
|
-
}
|
|
3363
|
-
for (const part of s.split("+")) {
|
|
3364
|
-
const p = part.trim();
|
|
3365
|
-
if (!p) continue;
|
|
3366
|
-
if (p.startsWith("[")) {
|
|
3367
|
-
if (!p.endsWith("]")) {
|
|
3368
|
-
rep.error(`${ctx}: scope: ${s} \u2192 \u65B9\u62EC\u53F7\u4E0D\u95ED\u5408\uFF0C\u8BF7\u68C0\u67E5\u5217\u8868\u683C\u5F0F`, { where: "action \u6821\u9A8C" });
|
|
3369
|
-
continue;
|
|
3370
|
-
}
|
|
3371
|
-
for (const item of p.slice(1, -1).split(/[,,]/)) {
|
|
3372
|
-
const it = item.trim();
|
|
3373
|
-
if (!it) continue;
|
|
3374
|
-
if (it.startsWith("{") && it.endsWith("}")) continue;
|
|
3375
|
-
if (it.startsWith("@")) {
|
|
3376
|
-
if (!actors.has(it) && !scopeVars.has(_stripSpecName(it))) {
|
|
3377
|
-
rep.error(
|
|
3378
|
-
`${ctx}: scope: ${s} \u2192 "${it}" \u4E0D\u662F\u5DF2\u58F0\u660E\u7684\u89D2\u8272\uFF0C\u4E5F\u4E0D\u662F\u5DF2\u58F0\u660E\u7684\u53D8\u91CF\u3002\u53EF\u7528\u89D2\u8272\uFF1A${[...actors].sort().join(" / ") || "(\u65E0)"}`,
|
|
3379
|
-
{ where: "action \u6821\u9A8C" }
|
|
3380
|
-
);
|
|
3381
|
-
}
|
|
3382
|
-
} else if (!scopeVars.has(it)) {
|
|
3383
|
-
rep.error(
|
|
3384
|
-
`${ctx}: scope: ${s} \u2192 "${it}" \u672A\u5728 vars: \u4E2D\u58F0\u660E\uFF08scope \u5217\u8868\u91CC\u7684\u540D\u5B57\u5FC5\u987B\u662F\u89D2\u8272 @\u540D \u6216\u5DF2\u58F0\u660E\u53D8\u91CF\uFF09`,
|
|
3385
|
-
{ where: "action \u6821\u9A8C" }
|
|
3386
|
-
);
|
|
3387
|
-
}
|
|
3388
|
-
}
|
|
3389
|
-
} else if (/[,,]/.test(p)) {
|
|
3390
|
-
const suggestion = "[" + p.split(/[,,]/).map((x) => x.trim()).join(", ") + "]";
|
|
3391
|
-
rep.error(
|
|
3392
|
-
`${ctx}: scope: ${s} \u2192 \u591A\u4E2A\u76EE\u6807\u5FC5\u987B\u7528\u65B9\u62EC\u53F7\u5217\u8868\u5305\u88F9\uFF0C\u8BF7\u5199\u6210 scope: ${suggestion}`,
|
|
3393
|
-
{ where: "action \u6821\u9A8C" }
|
|
3394
|
-
);
|
|
3395
|
-
} else if (!scopeVars.has(p) && !scopeVars.has(_stripSpecName(p))) {
|
|
3396
|
-
rep.error(
|
|
3397
|
-
`${ctx}: scope: ${s} \u2192 "${p}" \u672A\u5728 vars: \u4E2D\u58F0\u660E\uFF08\u88F8\u540D\u6309\u53D8\u91CF\u89E3\u6790\uFF0C\u5FC5\u987B\u5148\u5728 vars: \u58F0\u660E\uFF1B\u89D2\u8272\u8BF7\u5E26 @\uFF09`,
|
|
3398
|
-
{ where: "action \u6821\u9A8C" }
|
|
3399
|
-
);
|
|
3400
|
-
}
|
|
3401
|
-
}
|
|
3402
|
-
}
|
|
3403
|
-
function checkAction(action, scopeVars, ctx) {
|
|
3404
|
-
if (action.executorType === "func") {
|
|
3405
|
-
const param = String(action.executorActor || "").trim();
|
|
3406
|
-
if (!/^[\w\u4e00-\u9fff]+\.[\w\u4e00-\u9fff]+$/.test(param)) {
|
|
3407
|
-
rep.error(
|
|
3408
|
-
`action "${action.name}"\uFF08${ctx}\uFF09\u2192 @func \u7F3A\u5C11"\u6A21\u5757\u522B\u540D.\u51FD\u6570\u540D"\u3002\u5FC5\u987B\u5199\u6210 @func(\u6A21\u5757\u522B\u540D.\u51FD\u6570\u540D)\uFF0C\u522B\u540D\u5728 code: \u533A\u58F0\u660E\u3002\u793A\u4F8B\uFF1A@func(werewolf_utils.get_order)`,
|
|
3409
|
-
{ where: "action \u6821\u9A8C" }
|
|
3410
|
-
);
|
|
3411
|
-
}
|
|
3412
|
-
}
|
|
3413
|
-
if (action.executorType === "notice") {
|
|
3414
|
-
if (!String(action.prompt || "").trim()) {
|
|
3415
|
-
rep.error(
|
|
3416
|
-
`action "${action.name}"\uFF08${ctx}\uFF09\u2192 @notice \u7684 prompt \u4E3A\u7A7A\u3002\u516C\u544A\u8282\u70B9\u5FC5\u987B\u8981\u6709 prompt\uFF08\u5B83\u5C31\u662F\u6CE8\u5165\u4E0A\u4E0B\u6587\u7684\u516C\u544A\u672C\u4F53\uFF09`,
|
|
3417
|
-
{ where: "action \u6821\u9A8C" }
|
|
3418
|
-
);
|
|
3419
|
-
}
|
|
3420
|
-
if (String(action.outVars || "").trim()) {
|
|
3421
|
-
rep.error(
|
|
3422
|
-
`action "${action.name}"\uFF08${ctx}\uFF09\u2192 @notice \u4E0D\u652F\u6301 out:\u3002\u516C\u544A\u8282\u70B9\u6CA1\u6709\u56DE\u7B54\u8005\uFF0Cout \u58F0\u660E\u7684\u53D8\u91CF\u6C38\u8FDC\u4E0D\u4F1A\u88AB\u8D4B\u503C\uFF0C\u8D4B\u503C\u8BF7\u7528 @assign \u6216\u8BA9 AI/human \u8F93\u51FA`,
|
|
3423
|
-
{ where: "action \u6821\u9A8C" }
|
|
3424
|
-
);
|
|
3425
|
-
}
|
|
3426
|
-
if (String(action.resolve || "").trim()) {
|
|
3427
|
-
rep.error(
|
|
3428
|
-
`action "${action.name}"\uFF08${ctx}\uFF09\u2192 @notice \u4E0D\u652F\u6301 resolve:\u3002\u516C\u544A\u8282\u70B9\u6CA1\u6709\u56DE\u7B54\u8005\uFF0C\u6821\u9A8C\u51FD\u6570\u6C38\u8FDC\u4E0D\u4F1A\u88AB\u8C03\u7528`,
|
|
3429
|
-
{ where: "action \u6821\u9A8C" }
|
|
3430
|
-
);
|
|
3431
|
-
}
|
|
3432
|
-
const inert = [];
|
|
3433
|
-
if (String(action.memory || "").trim()) inert.push("memory:");
|
|
3434
|
-
if (String(action.context || "").trim()) inert.push("context:");
|
|
3435
|
-
if (String(action.showprompt || "").trim()) inert.push("showprompt:");
|
|
3436
|
-
if (action.max_retries) inert.push("max_retries:");
|
|
3437
|
-
if (String(action.fallback || "").trim()) inert.push("fallback:");
|
|
3438
|
-
if (inert.length) {
|
|
3439
|
-
rep.warning(
|
|
3440
|
-
`action "${action.name}"\uFF08${ctx}\uFF09\u2192 @notice \u7684 ${inert.join(" / ")} \u4E0D\u751F\u6548\uFF1A\u516C\u544A\u8282\u70B9\u65E0\u56DE\u7B54\u8005\uFF08\u60F0\u6027\u6B7B\u914D\u7F6E\uFF0C\u77E5\u60C5\u5373\u53EF\uFF09`,
|
|
3441
|
-
{ where: "action \u6821\u9A8C" }
|
|
3442
|
-
);
|
|
3443
|
-
}
|
|
3444
|
-
if (String(action.scope || "").trim().toLowerCase() === "self") {
|
|
3445
|
-
rep.warning(
|
|
3446
|
-
`action "${action.name}"\uFF08${ctx}\uFF09\u2192 @notice \u7684 scope: self = \u4EC5 meta.owner \u53EF\u89C1\uFF08\u516C\u544A\u65E0\u53D1\u8A00\u8005\uFF09`,
|
|
3447
|
-
{ where: "action \u6821\u9A8C" }
|
|
3448
|
-
);
|
|
3449
|
-
}
|
|
3450
|
-
if (String(action.executorActor || "").trim()) {
|
|
3451
|
-
rep.warning(
|
|
3452
|
-
`action "${action.name}"\uFF08${ctx}\uFF09\u2192 @notice \u7684\u6267\u884C\u8005\u53C2\u6570\u88AB\u6574\u4F53\u5FFD\u7565\uFF08\u516C\u544A\u6CA1\u6709\u53D1\u8A00\u8005\uFF09\uFF0C\u5BFC\u51FA\u65F6\u4F1A\u5265\u6389`,
|
|
3453
|
-
{ where: "action \u6821\u9A8C" }
|
|
3454
|
-
);
|
|
3455
|
-
}
|
|
3456
|
-
}
|
|
3457
|
-
const items = _splitInItems(action.inMappings);
|
|
3458
|
-
const bare = items.filter((it) => !it.includes("="));
|
|
3459
|
-
if (bare.length > 0) {
|
|
3460
|
-
rep.error(
|
|
3461
|
-
`action "${action.name}"\uFF08${ctx}\uFF09\u2192 in: \u9879\u7F3A\u5C11 "= \u53D8\u91CF\u8868\u8FBE\u5F0F" \u6620\u5C04\uFF1A${bare.join(", ")}\u3002in: \u7684\u6BCF\u4E00\u9879\u5FC5\u987B\u662F "\u53C2\u6570\u540D = \u53D8\u91CF\u8868\u8FBE\u5F0F"\uFF0C\u4F8B\u5982 in: from_ = speak_from`,
|
|
3462
|
-
{ where: "action \u6821\u9A8C" }
|
|
3463
|
-
);
|
|
3464
|
-
}
|
|
3465
|
-
for (const it of items) {
|
|
3466
|
-
const left = it.split("=")[0].trim();
|
|
3467
|
-
if (_PY_KEYWORDS.has(_stripSpecName(left))) {
|
|
3468
|
-
rep.error(
|
|
3469
|
-
`action "${action.name}"\uFF08${ctx}\uFF09\u2192 in: \u53C2\u6570\u540D "${_stripSpecName(left)}" \u662F Python \u4FDD\u7559\u5B57\uFF0C\u4E0D\u80FD\u7528\u4F5C\u53C2\u6570\u540D\uFF0C\u8BF7\u6539\u540D`,
|
|
3470
|
-
{ where: "action \u6821\u9A8C" }
|
|
3471
|
-
);
|
|
3472
|
-
}
|
|
3473
|
-
}
|
|
3474
|
-
for (const line of String(action.outVars || "").split("\n")) {
|
|
3475
|
-
for (const item of line.split(",")) {
|
|
3476
|
-
const target = _outTargetRoot(item);
|
|
3477
|
-
if (_PY_KEYWORDS.has(target)) {
|
|
3478
|
-
rep.error(
|
|
3479
|
-
`action "${action.name}"\uFF08${ctx}\uFF09\u2192 out: \u76EE\u6807 "${target}" \u662F Python \u4FDD\u7559\u5B57\uFF0C\u4E0D\u80FD\u7528\u4F5C\u53D8\u91CF\u540D\uFF0C\u8BF7\u6539\u540D`,
|
|
3480
|
-
{ where: "action \u6821\u9A8C" }
|
|
3481
|
-
);
|
|
3482
|
-
}
|
|
3483
|
-
}
|
|
3484
|
-
}
|
|
3485
|
-
checkScope(action.scope, scopeVars, `action "${action.name}"\uFF08${ctx}\uFF09`);
|
|
3486
|
-
}
|
|
3487
|
-
for (const action of result.actions || []) {
|
|
3488
|
-
checkAction(action, topScopeVars, "\u9876\u5C42");
|
|
3489
|
-
}
|
|
3490
|
-
for (const m of result.modules || []) {
|
|
3491
|
-
const scopeVars = /* @__PURE__ */ new Set([...topScopeVars, ...(m.vars || []).map((v) => _stripSpecName(v.name))]);
|
|
3492
|
-
const ctx = `module ${m.name}`;
|
|
3493
|
-
for (const action of m.actions || []) {
|
|
3494
|
-
checkAction(action, scopeVars, ctx);
|
|
3495
|
-
}
|
|
3496
|
-
for (const d of m.nodeDecls || []) {
|
|
3497
|
-
if ((d.specialType === "FOR" || d.specialType === "PAR") && d.forCondition) {
|
|
3498
|
-
const match = d.forCondition.match(/^(@?[\w\u4e00-\u9fff]+)\s+in\s+/);
|
|
3499
|
-
if (match && _PY_KEYWORDS.has(_stripSpecName(match[1]))) {
|
|
3500
|
-
rep.error(
|
|
3501
|
-
`${ctx} \u5FAA\u73AF\u53D8\u91CF "${_stripSpecName(match[1])}" \u662F Python \u4FDD\u7559\u5B57\uFF0C\u4E0D\u80FD\u7528\u4F5C\u5FAA\u73AF\u53D8\u91CF\u540D\uFF0C\u8BF7\u6539\u540D`,
|
|
3502
|
-
{ where: "action \u6821\u9A8C" }
|
|
3503
|
-
);
|
|
3504
|
-
}
|
|
3505
|
-
}
|
|
3506
|
-
}
|
|
3507
|
-
}
|
|
3508
|
-
for (const d of result.mainflow && result.mainflow.nodeDecls || []) {
|
|
3509
|
-
if ((d.specialType === "FOR" || d.specialType === "PAR") && d.forCondition) {
|
|
3510
|
-
const match = d.forCondition.match(/^(@?[\w\u4e00-\u9fff]+)\s+in\s+/);
|
|
3511
|
-
if (match && _PY_KEYWORDS.has(_stripSpecName(match[1]))) {
|
|
3512
|
-
rep.error(
|
|
3513
|
-
`mainflow \u5FAA\u73AF\u53D8\u91CF "${_stripSpecName(match[1])}" \u662F Python \u4FDD\u7559\u5B57\uFF0C\u4E0D\u80FD\u7528\u4F5C\u5FAA\u73AF\u53D8\u91CF\u540D\uFF0C\u8BF7\u6539\u540D`,
|
|
3514
|
-
{ where: "action \u6821\u9A8C" }
|
|
3515
|
-
);
|
|
3516
|
-
}
|
|
3517
|
-
}
|
|
3518
|
-
}
|
|
3519
|
-
const varDecls = [...result.vars || []];
|
|
3520
|
-
for (const m of result.modules || []) {
|
|
3521
|
-
for (const v of m.vars || []) varDecls.push(v);
|
|
3522
|
-
}
|
|
3523
|
-
for (const v of varDecls) {
|
|
3524
|
-
if (_PY_KEYWORDS.has(_stripSpecName(v.name))) {
|
|
3525
|
-
rep.error(
|
|
3526
|
-
`vars: \u53D8\u91CF\u540D "${_stripSpecName(v.name)}" \u662F Python \u4FDD\u7559\u5B57\uFF0C\u4E0D\u80FD\u7528\u4F5C\u53D8\u91CF\u540D\uFF0C\u8BF7\u6362\u4E00\u4E2A\u4E0D\u51B2\u7A81\u7684\u540D\u5B57`,
|
|
3527
|
-
{ where: "action \u6821\u9A8C" }
|
|
3528
|
-
);
|
|
3529
|
-
}
|
|
3530
|
-
}
|
|
3531
|
-
rep.throwIfErrors("\u7F16\u8BD1\u9519\u8BEF\uFF1A\u5267\u672C\u8BED\u6CD5\u68C0\u67E5\u672A\u901A\u8FC7");
|
|
3532
|
-
}
|
|
3533
|
-
function splitTopBlocks(lines) {
|
|
3534
|
-
const blocks = [];
|
|
3535
|
-
let current = null;
|
|
3536
|
-
for (let i = 0; i < lines.length; i++) {
|
|
3537
|
-
const line = lines[i];
|
|
3538
|
-
const trimmed = line.trim();
|
|
3539
|
-
const indent = line.length - line.trimStart().length;
|
|
3540
|
-
if (!trimmed) {
|
|
3541
|
-
if (current) {
|
|
3542
|
-
current.contentLines.push({
|
|
3543
|
-
indent,
|
|
3544
|
-
text: "",
|
|
3545
|
-
lineNum: i,
|
|
3546
|
-
raw: line
|
|
3547
|
-
});
|
|
3548
|
-
}
|
|
3549
|
-
continue;
|
|
3550
|
-
}
|
|
3551
|
-
if (indent === 0) {
|
|
3552
|
-
if (trimmed.startsWith("#") || trimmed.startsWith("//")) {
|
|
3553
|
-
continue;
|
|
3554
|
-
}
|
|
3555
|
-
if (current) blocks.push(current);
|
|
3556
|
-
current = {
|
|
3557
|
-
header: normalizeSymbols(trimmed),
|
|
3558
|
-
headerLineNum: i,
|
|
3559
|
-
contentLines: []
|
|
3560
|
-
};
|
|
3561
|
-
} else if (current) {
|
|
3562
|
-
current.contentLines.push({
|
|
3563
|
-
indent,
|
|
3564
|
-
text: trimmed,
|
|
3565
|
-
lineNum: i,
|
|
3566
|
-
raw: line
|
|
3567
|
-
});
|
|
3568
|
-
}
|
|
3569
|
-
}
|
|
3570
|
-
if (current) blocks.push(current);
|
|
3571
|
-
return blocks;
|
|
3572
|
-
}
|
|
3573
|
-
function parseMetaBlock(cls, rep = null) {
|
|
3574
|
-
rep = rep || createReporter();
|
|
3575
|
-
const meta = {};
|
|
3576
|
-
let i = 0;
|
|
3577
|
-
while (i < cls.length) {
|
|
3578
|
-
const cl = cls[i];
|
|
3579
|
-
const _t = cl.text.trim();
|
|
3580
|
-
if (!_t || _t.startsWith("#")) {
|
|
3581
|
-
i++;
|
|
3582
|
-
continue;
|
|
3583
|
-
}
|
|
3584
|
-
const line = normalizeSymbols(cl.text);
|
|
3585
|
-
const multiMatch = line.match(/^([\w\u4e00-\u9fff]+)\s*=\s*\|$/);
|
|
3586
|
-
if (multiMatch) {
|
|
3587
|
-
const key2 = multiMatch[1];
|
|
3588
|
-
i++;
|
|
3589
|
-
const valueLines = [];
|
|
3590
|
-
while (i < cls.length && cls[i].indent > cl.indent) {
|
|
3591
|
-
valueLines.push(cls[i].text);
|
|
3592
|
-
i++;
|
|
3593
|
-
}
|
|
3594
|
-
const value = valueLines.join("\n");
|
|
3595
|
-
meta[key2] = value;
|
|
3596
|
-
continue;
|
|
3597
|
-
}
|
|
3598
|
-
const m = line.match(/^([\w\u4e00-\u9fff]+)\s*=\s*(.+)$/);
|
|
3599
|
-
if (!m)
|
|
3600
|
-
rep.fail(
|
|
3601
|
-
`meta \u5B57\u6BB5\u683C\u5F0F\u9519\u8BEF: "${cl.text}"\u3002\u671F\u671B: key = value \u6216 key = |`,
|
|
3602
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "meta:" }
|
|
3603
|
-
);
|
|
3604
|
-
const [, key, val] = m;
|
|
3605
|
-
let v = val.trim();
|
|
3606
|
-
if (v.startsWith('"') && v.endsWith('"') || v.startsWith("'") && v.endsWith("'")) {
|
|
3607
|
-
v = v.slice(1, -1);
|
|
3608
|
-
}
|
|
3609
|
-
switch (key) {
|
|
3610
|
-
case "id":
|
|
3611
|
-
meta.id = v;
|
|
3612
|
-
break;
|
|
3613
|
-
case "name":
|
|
3614
|
-
meta.name = v;
|
|
3615
|
-
break;
|
|
3616
|
-
case "version":
|
|
3617
|
-
meta.version = v;
|
|
3618
|
-
break;
|
|
3619
|
-
case "owner":
|
|
3620
|
-
meta.owner = String(v).replace(/^\[|\]$/g, "");
|
|
3621
|
-
break;
|
|
3622
|
-
case "database":
|
|
3623
|
-
meta.database = v;
|
|
3624
|
-
break;
|
|
3625
|
-
case "session":
|
|
3626
|
-
meta.session = v;
|
|
3627
|
-
break;
|
|
3628
|
-
case "system_safety":
|
|
3629
|
-
meta.system_safety = typeof v === "string" ? v.replace(/^"|"$/g, "") : v;
|
|
3630
|
-
break;
|
|
3631
|
-
case "output_style":
|
|
3632
|
-
meta.output_style = typeof v === "string" ? v.replace(/^"|"$/g, "") : v;
|
|
3633
|
-
break;
|
|
3634
|
-
case "max_steps":
|
|
3635
|
-
meta.max_steps = Number(v);
|
|
3636
|
-
break;
|
|
3637
|
-
case "delay":
|
|
3638
|
-
meta.delay = Number(v);
|
|
3639
|
-
break;
|
|
3640
|
-
default:
|
|
3641
|
-
meta[key] = v;
|
|
3642
|
-
break;
|
|
3643
|
-
}
|
|
3644
|
-
i++;
|
|
3645
|
-
}
|
|
3646
|
-
return meta;
|
|
3647
|
-
}
|
|
3648
|
-
function parseLayoutBlock(cls) {
|
|
3649
|
-
const layout = {};
|
|
3650
|
-
for (const cl of cls) {
|
|
3651
|
-
const line = normalizeSymbols(cl.text);
|
|
3652
|
-
const m = line.match(/^(\[.+?\])\s*=\s*(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)$/);
|
|
3653
|
-
if (m) {
|
|
3654
|
-
layout[m[1]] = { dx: Math.round(parseFloat(m[2])), dy: Math.round(parseFloat(m[3])) };
|
|
3655
|
-
}
|
|
3656
|
-
}
|
|
3657
|
-
return layout;
|
|
3658
|
-
}
|
|
3659
|
-
function parseVarsBlock(cls, rep = null) {
|
|
3660
|
-
rep = rep || createReporter();
|
|
3661
|
-
const vars = [];
|
|
3662
|
-
let i = 0;
|
|
3663
|
-
while (i < cls.length) {
|
|
3664
|
-
const cl = cls[i];
|
|
3665
|
-
const _t = cl.text.trim();
|
|
3666
|
-
if (!_t || _t.startsWith("#")) {
|
|
3667
|
-
i++;
|
|
3668
|
-
continue;
|
|
3669
|
-
}
|
|
3670
|
-
const line = normalizeSymbols(cl.text);
|
|
3671
|
-
const multiMatch = line.match(/^((?:@|\$@|\$)?[\w\u4e00-\u9fff]+)\s*=\s*\|$/);
|
|
3672
|
-
if (multiMatch) {
|
|
3673
|
-
const key = multiMatch[1];
|
|
3674
|
-
i++;
|
|
3675
|
-
const valueLines = [];
|
|
3676
|
-
while (i < cls.length && cls[i].indent > cl.indent) {
|
|
3677
|
-
valueLines.push(cls[i].text);
|
|
3678
|
-
i++;
|
|
3679
|
-
}
|
|
3680
|
-
vars.push({ name: key, defaultValue: valueLines.join("\n") });
|
|
3681
|
-
continue;
|
|
3682
|
-
}
|
|
3683
|
-
const m = line.match(/^((?:@|\$@|\$)?[\w\u4e00-\u9fff]+)\s*=\s*(.*)$/);
|
|
3684
|
-
if (!m)
|
|
3685
|
-
rep.fail(
|
|
3686
|
-
`vars \u5B57\u6BB5\u683C\u5F0F\u9519\u8BEF: "${cl.text}"\u3002\u671F\u671B: varname = "value"`,
|
|
3687
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "vars:" }
|
|
3688
|
-
);
|
|
3689
|
-
vars.push({ name: m[1], defaultValue: m[2].trim() });
|
|
3690
|
-
i++;
|
|
3691
|
-
}
|
|
3692
|
-
return vars;
|
|
3693
|
-
}
|
|
3694
|
-
function parseCodeBlock(cls, rep = null) {
|
|
3695
|
-
rep = rep || createReporter();
|
|
3696
|
-
const code = [];
|
|
3697
|
-
for (const cl of cls) {
|
|
3698
|
-
const _t = cl.text.trim();
|
|
3699
|
-
if (!_t || _t.startsWith("#")) continue;
|
|
3700
|
-
const line = normalizeSymbols(cl.text);
|
|
3701
|
-
const m = line.match(/^(@?[\w\u4e00-\u9fff]+)\s*=\s*(.*)$/);
|
|
3702
|
-
if (!m)
|
|
3703
|
-
rep.fail(
|
|
3704
|
-
`code \u5B57\u6BB5\u683C\u5F0F\u9519\u8BEF: "${cl.text}"\u3002\u671F\u671B: name = value`,
|
|
3705
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "code:" }
|
|
3706
|
-
);
|
|
3707
|
-
let val = m[2].trim();
|
|
3708
|
-
const fm = val.match(/^file:"(.*)"$/);
|
|
3709
|
-
if (fm) val = fm[1];
|
|
3710
|
-
code.push({ name: m[1], value: val });
|
|
3711
|
-
}
|
|
3712
|
-
return code;
|
|
3713
|
-
}
|
|
3714
|
-
function parseActorsBlock(cls, rep = null) {
|
|
3715
|
-
rep = rep || createReporter();
|
|
3716
|
-
const actors = [];
|
|
3717
|
-
let i = 0;
|
|
3718
|
-
while (i < cls.length) {
|
|
3719
|
-
const cl = cls[i];
|
|
3720
|
-
const _t = cl.text.trim();
|
|
3721
|
-
if (!_t || _t.startsWith("#")) {
|
|
3722
|
-
i++;
|
|
3723
|
-
continue;
|
|
3724
|
-
}
|
|
3725
|
-
const line = normalizeSymbols(cl.text);
|
|
3726
|
-
const bpMatch = line.match(/^blueprint\s+(@?[\w\u4e00-\u9fff]+)\s*:\s*$/);
|
|
3727
|
-
if (bpMatch) {
|
|
3728
|
-
const bpName = bpMatch[1];
|
|
3729
|
-
let source2 = null;
|
|
3730
|
-
let tools2 = null;
|
|
3731
|
-
let thinking2 = null;
|
|
3732
|
-
i++;
|
|
3733
|
-
while (i < cls.length && cls[i].indent > cl.indent) {
|
|
3734
|
-
const al = normalizeSymbols(cls[i].text).trim();
|
|
3735
|
-
if (al.startsWith("source:")) {
|
|
3736
|
-
source2 = al.slice(7).trim();
|
|
3737
|
-
} else if (al.startsWith("thinking")) {
|
|
3738
|
-
const thStr = al.replace(/^thinking\s*[:=]\s*/, "").trim().toLowerCase();
|
|
3739
|
-
if (thStr !== "default" && !THINKING_LEVELS.includes(thStr)) {
|
|
3740
|
-
rep.fail(
|
|
3741
|
-
`thinking \u6863\u4F4D\u4E0D\u5408\u6CD5: "${thStr}"\uFF08\u5141\u8BB8: default/${THINKING_LEVELS.join("/")}\uFF09`,
|
|
3742
|
-
{ line: cls[i].lineNum + 1, lineText: cls[i].raw || cls[i].text, where: `blueprint ${bpName}` }
|
|
3743
|
-
);
|
|
3744
|
-
}
|
|
3745
|
-
thinking2 = thStr === "default" ? "" : thStr;
|
|
3746
|
-
} else if (al.startsWith("tools")) {
|
|
3747
|
-
const toolsStr = al.replace(/^tools\s*[:=]\s*/, "").trim();
|
|
3748
|
-
if (toolsStr.startsWith("[") && toolsStr.endsWith("]")) {
|
|
3749
|
-
tools2 = toolsStr.slice(1, -1).split(",").map((s) => s.trim()).filter(Boolean);
|
|
3750
|
-
if (!tools2.length) tools2 = false;
|
|
3751
|
-
} else if (toolsStr === "true" || toolsStr === "false") {
|
|
3752
|
-
tools2 = toolsStr === "true";
|
|
3753
|
-
} else {
|
|
3754
|
-
rep.fail(
|
|
3755
|
-
`tools \u683C\u5F0F\u9519\u8BEF\uFF0C\u5E94\u4E3A tools = [tool1, tool2] \u6216 tools: true/false`,
|
|
3756
|
-
{ line: cls[i].lineNum + 1, lineText: cls[i].raw || cls[i].text, where: `blueprint ${bpName}` }
|
|
3757
|
-
);
|
|
3758
|
-
}
|
|
3759
|
-
}
|
|
3760
|
-
i++;
|
|
3761
|
-
}
|
|
3762
|
-
actors.push({ type: "blueprint", name: bpName, soul: "", source: source2 ?? "", tools: tools2, thinking: thinking2 ?? "" });
|
|
3763
|
-
continue;
|
|
3764
|
-
}
|
|
3765
|
-
const prefixMatch = line.match(
|
|
3766
|
-
/^(ai|human)\s+(@?[\w\u4e00-\u9fff]+)\s*=\s*(.*)$/
|
|
3767
|
-
);
|
|
3768
|
-
const bareMatch = !prefixMatch ? line.match(/^(ai|human)\s+(@?[\w\u4e00-\u9fff]+)\s*$/) : null;
|
|
3769
|
-
if (bareMatch) {
|
|
3770
|
-
actors.push({ type: bareMatch[1], name: bareMatch[2], soul: "", source: "", tools: [] });
|
|
3771
|
-
i++;
|
|
3772
|
-
continue;
|
|
3773
|
-
}
|
|
3774
|
-
if (!prefixMatch)
|
|
3775
|
-
rep.fail(
|
|
3776
|
-
`actors \u683C\u5F0F\u9519\u8BEF: "${cl.text}"\u3002\u671F\u671B: ai|human @name = soul:X, source:Y, tools:[...]\uFF0C\u6216\u88F8\u5199\u6CD5 ai|human @name`,
|
|
3777
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "actors:" }
|
|
3778
|
-
);
|
|
3779
|
-
const type = prefixMatch[1];
|
|
3780
|
-
const name = prefixMatch[2];
|
|
3781
|
-
const rest = prefixMatch[3];
|
|
3782
|
-
let soul = null;
|
|
3783
|
-
let source = null;
|
|
3784
|
-
let tools = null;
|
|
3785
|
-
let thinking = null;
|
|
3786
|
-
const parts = rest.split(",").map((p) => p.trim()).filter(Boolean);
|
|
3787
|
-
for (let pi = 0; pi < parts.length; pi++) {
|
|
3788
|
-
const part = parts[pi];
|
|
3789
|
-
if (part.startsWith("soul:")) {
|
|
3790
|
-
const val = part.slice(5).trim();
|
|
3791
|
-
if (!val) rep.fail(`soul \u5B57\u6BB5\u7F3A\u5C11\u503C\uFF0C\u4F8B\u5982 soul:1`, { line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "actors:" });
|
|
3792
|
-
soul = val;
|
|
3793
|
-
} else if (part.startsWith("source:")) {
|
|
3794
|
-
const val = part.slice(7).trim();
|
|
3795
|
-
if (!val) rep.fail(`source \u5B57\u6BB5\u7F3A\u5C11\u503C\uFF0C\u4F8B\u5982 source:01A`, { line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "actors:" });
|
|
3796
|
-
source = val;
|
|
3797
|
-
} else if (part.startsWith("thinking")) {
|
|
3798
|
-
const thStr = part.replace(/^thinking\s*[:=]\s*/, "").trim().toLowerCase();
|
|
3799
|
-
if (thStr !== "default" && !THINKING_LEVELS.includes(thStr)) {
|
|
3800
|
-
rep.fail(
|
|
3801
|
-
`thinking \u6863\u4F4D\u4E0D\u5408\u6CD5: "${thStr}"\uFF08\u5141\u8BB8: default/${THINKING_LEVELS.join("/")}\uFF09`,
|
|
3802
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: `actor ${name}` }
|
|
3803
|
-
);
|
|
3804
|
-
}
|
|
3805
|
-
thinking = thStr === "default" ? "" : thStr;
|
|
3806
|
-
} else if (part.startsWith("tools")) {
|
|
3807
|
-
let toolsStr = part.replace(/^tools\s*[:=]\s*/, "").trim();
|
|
3808
|
-
if (toolsStr.startsWith("[")) {
|
|
3809
|
-
while (!toolsStr.endsWith("]") && pi + 1 < parts.length) {
|
|
3810
|
-
pi += 1;
|
|
3811
|
-
toolsStr += "," + parts[pi];
|
|
3812
|
-
}
|
|
3813
|
-
}
|
|
3814
|
-
if (toolsStr.startsWith("[") && toolsStr.endsWith("]")) {
|
|
3815
|
-
toolsStr = toolsStr.slice(1, -1);
|
|
3816
|
-
tools = toolsStr.split(",").map((s) => s.trim()).filter(Boolean);
|
|
3817
|
-
if (!tools.length) tools = false;
|
|
3818
|
-
} else if (toolsStr === "true" || toolsStr === "false") {
|
|
3819
|
-
tools = toolsStr === "true";
|
|
3820
|
-
} else {
|
|
3821
|
-
rep.fail(
|
|
3822
|
-
`tools \u683C\u5F0F\u9519\u8BEF\uFF0C\u5E94\u4E3A tools = [tool1, tool2] \u6216 tools: true/false`,
|
|
3823
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: `actor ${name}` }
|
|
3824
|
-
);
|
|
3825
|
-
}
|
|
3826
|
-
} else {
|
|
3827
|
-
rep.fail(
|
|
3828
|
-
`\u4E0D\u652F\u6301\u7684\u5B57\u6BB5 "${part}"\u3002\u5408\u6CD5\u5B57\u6BB5: soul, source, thinking, tools`,
|
|
3829
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "actors:" }
|
|
3830
|
-
);
|
|
3831
|
-
}
|
|
3832
|
-
}
|
|
3833
|
-
if (soul === null) soul = "";
|
|
3834
|
-
if (source === null) source = "";
|
|
3835
|
-
if (thinking === null) thinking = "";
|
|
3836
|
-
actors.push({ type, name, soul, source, tools, thinking });
|
|
3837
|
-
i++;
|
|
3838
|
-
}
|
|
3839
|
-
return actors;
|
|
3840
|
-
}
|
|
3841
|
-
function parseMemoryOrContextBlock(header, cls, blockType, rep = null, headerLineNum = null) {
|
|
3842
|
-
rep = rep || createReporter();
|
|
3843
|
-
const hm = header.match(
|
|
3844
|
-
new RegExp(`^${blockType}\\s+([\\w\\u4e00-\\u9fff]+)\\((.+?)\\):$`)
|
|
3845
|
-
);
|
|
3846
|
-
if (!hm)
|
|
3847
|
-
rep.fail(
|
|
3848
|
-
`${blockType} \u58F0\u660E\u683C\u5F0F\u9519\u8BEF: "${header}"\u3002\u671F\u671B: ${blockType} name(fileRef):`,
|
|
3849
|
-
{ line: (headerLineNum ?? -1) + 1, lineText: header, where: `${blockType} \u533A` }
|
|
3850
|
-
);
|
|
3851
|
-
const block = {
|
|
3852
|
-
name: hm[1],
|
|
3853
|
-
fileRef: hm[2],
|
|
3854
|
-
in: "",
|
|
3855
|
-
out: ""
|
|
3856
|
-
};
|
|
3857
|
-
for (const cl of cls) {
|
|
3858
|
-
const _t = cl.text.trim();
|
|
3859
|
-
if (!_t || _t.startsWith("#")) continue;
|
|
3860
|
-
const line = normalizeSymbols(cl.text);
|
|
3861
|
-
if (line.startsWith("in:")) {
|
|
3862
|
-
const after = line.slice(3).trim();
|
|
3863
|
-
block.in = after || cls.filter((l) => l.indent > cl.indent).map((l) => normalizeSymbols(l.text)).join("\n");
|
|
3864
|
-
} else if (line.startsWith("out:")) {
|
|
3865
|
-
const after = line.slice(4).trim();
|
|
3866
|
-
block.out = after || cls.filter((l) => l.indent > cl.indent).map((l) => normalizeSymbols(l.text)).join(", ");
|
|
3867
|
-
}
|
|
3868
|
-
}
|
|
3869
|
-
return block;
|
|
3870
|
-
}
|
|
3871
|
-
function parseActionBlock(header, cls, rep = null, headerLineNum = null) {
|
|
3872
|
-
rep = rep || createReporter();
|
|
3873
|
-
const normalizedHeader = normalizeSymbols(header);
|
|
3874
|
-
const hm = normalizedHeader.match(
|
|
3875
|
-
/^action\s+([\w\u4e00-\u9fff]+)\s+(@[\w\u4e00-\u9fff]+)(?:\((@?[\w\u4e00-\u9fff.]+)\))?(?:\s+as\s*\((@?[\w\u4e00-\u9fff.]+)\))?\s*:\s*$/
|
|
3876
|
-
);
|
|
3877
|
-
if (!hm)
|
|
3878
|
-
rep.fail(
|
|
3879
|
-
`Action \u58F0\u660E\u683C\u5F0F\u9519\u8BEF: "${header}"\u3002\u671F\u671B: action name @type(@actor):`,
|
|
3880
|
-
{ line: (headerLineNum ?? -1) + 1, lineText: header, where: "action \u533A" }
|
|
3881
|
-
);
|
|
3882
|
-
const action = {
|
|
3883
|
-
name: hm[1],
|
|
3884
|
-
executorType: hm[2].replace("@", ""),
|
|
3885
|
-
executorActor: hm[3] || "",
|
|
3886
|
-
asActor: hm[4] || "",
|
|
3887
|
-
prompt: "",
|
|
3888
|
-
resolve: "",
|
|
3889
|
-
scope: "",
|
|
3890
|
-
outVars: "",
|
|
3891
|
-
inMappings: "",
|
|
3892
|
-
memory: "",
|
|
3893
|
-
context: "",
|
|
3894
|
-
max_retries: 0,
|
|
3895
|
-
fallback: "",
|
|
3896
|
-
interrupt: ""
|
|
3897
|
-
};
|
|
3898
|
-
let i = 0;
|
|
3899
|
-
while (i < cls.length) {
|
|
3900
|
-
const cl = cls[i];
|
|
3901
|
-
const isPromptContext = cl.text.startsWith("prompt:") || cl.text.startsWith("showprompt:") || i > 0 && (cls[i - 1].text === "prompt: |" || cls[i - 1].text === "showprompt: |") && cl.indent > cls[i - 1].indent;
|
|
3902
|
-
if (!isPromptContext && (!cl.text.trim() || cl.text.trim().startsWith("#"))) {
|
|
3903
|
-
i++;
|
|
3904
|
-
continue;
|
|
3905
|
-
}
|
|
3906
|
-
const line = isPromptContext ? cl.text : normalizeSymbols(cl.text);
|
|
3907
|
-
if (line === "prompt: |") {
|
|
3908
|
-
i++;
|
|
3909
|
-
const pl = [];
|
|
3910
|
-
while (i < cls.length && cls[i].indent > cl.indent) {
|
|
3911
|
-
pl.push(cls[i].text);
|
|
3912
|
-
i++;
|
|
3913
|
-
}
|
|
3914
|
-
action.prompt = pl.join("\n");
|
|
3915
|
-
continue;
|
|
3916
|
-
}
|
|
3917
|
-
if (line.startsWith("prompt:") && !line.endsWith("|")) {
|
|
3918
|
-
const after = line.slice(7).trim();
|
|
3919
|
-
action.prompt = after;
|
|
3920
|
-
i++;
|
|
3921
|
-
continue;
|
|
3922
|
-
}
|
|
3923
|
-
if (line === "showprompt: |") {
|
|
3924
|
-
i++;
|
|
3925
|
-
const spl = [];
|
|
3926
|
-
while (i < cls.length && cls[i].indent > cl.indent) {
|
|
3927
|
-
spl.push(cls[i].text);
|
|
3928
|
-
i++;
|
|
3929
|
-
}
|
|
3930
|
-
action.showprompt = spl.join("\n");
|
|
3931
|
-
continue;
|
|
3932
|
-
}
|
|
3933
|
-
if (line.startsWith("showprompt:")) {
|
|
3934
|
-
const after = line.slice(11).trim();
|
|
3935
|
-
action.showprompt = after;
|
|
3936
|
-
i++;
|
|
3937
|
-
continue;
|
|
3938
|
-
}
|
|
3939
|
-
if (line.startsWith("in:")) {
|
|
3940
|
-
const after = line.slice(3).trim();
|
|
3941
|
-
if (after) {
|
|
3942
|
-
action.inMappings = after;
|
|
3943
|
-
i++;
|
|
3944
|
-
} else {
|
|
3945
|
-
i++;
|
|
3946
|
-
const il = [];
|
|
3947
|
-
let guard = 0;
|
|
3948
|
-
while (i < cls.length && cls[i].indent > cl.indent) {
|
|
3949
|
-
if (++guard > 500)
|
|
3950
|
-
rep.fail(`in \u5B57\u6BB5\u89E3\u6790\u9677\u5165\u6B7B\u5FAA\u73AF`, { line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: `action ${action.name}` });
|
|
3951
|
-
il.push(normalizeSymbols(cls[i].text));
|
|
3952
|
-
i++;
|
|
3953
|
-
}
|
|
3954
|
-
action.inMappings = il.join("\n");
|
|
3955
|
-
}
|
|
3956
|
-
continue;
|
|
3957
|
-
}
|
|
3958
|
-
if (line.startsWith("out:")) {
|
|
3959
|
-
const after = line.slice(4).trim();
|
|
3960
|
-
if (after) {
|
|
3961
|
-
action.outVars = after;
|
|
3962
|
-
i++;
|
|
3963
|
-
const ol = [];
|
|
3964
|
-
while (i < cls.length && cls[i].indent > cl.indent) {
|
|
3965
|
-
const t2 = normalizeSymbols(cls[i].text).trim();
|
|
3966
|
-
if (t2 && !t2.startsWith("#")) ol.push(t2);
|
|
3967
|
-
i++;
|
|
3968
|
-
}
|
|
3969
|
-
if (ol.length > 0) action.outVars = after + "\n" + ol.join("\n");
|
|
3970
|
-
} else {
|
|
3971
|
-
i++;
|
|
3972
|
-
const ol = [];
|
|
3973
|
-
while (i < cls.length && cls[i].indent > cl.indent) {
|
|
3974
|
-
ol.push(normalizeSymbols(cls[i].text));
|
|
3975
|
-
i++;
|
|
3976
|
-
}
|
|
3977
|
-
action.outVars = ol.join("\n");
|
|
3978
|
-
}
|
|
3979
|
-
continue;
|
|
3980
|
-
}
|
|
3981
|
-
if (line.startsWith("scope:")) {
|
|
3982
|
-
action.scope = line.slice(6).trim();
|
|
3983
|
-
i++;
|
|
3984
|
-
continue;
|
|
3985
|
-
}
|
|
3986
|
-
if (line.startsWith("memory:")) {
|
|
3987
|
-
action.memory = line.slice(7).trim();
|
|
3988
|
-
i++;
|
|
3989
|
-
continue;
|
|
3990
|
-
}
|
|
3991
|
-
if (line.startsWith("context:")) {
|
|
3992
|
-
action.context = line.slice(8).trim();
|
|
3993
|
-
i++;
|
|
3994
|
-
continue;
|
|
3995
|
-
}
|
|
3996
|
-
if (line.startsWith("resolve:")) {
|
|
3997
|
-
action.resolve = line.slice(8).trim();
|
|
3998
|
-
i++;
|
|
3999
|
-
continue;
|
|
4000
|
-
}
|
|
4001
|
-
if (line.startsWith("max_retries:")) {
|
|
4002
|
-
action.max_retries = Number(line.slice(12).trim());
|
|
4003
|
-
i++;
|
|
4004
|
-
continue;
|
|
4005
|
-
}
|
|
4006
|
-
if (line.startsWith("fallback:")) {
|
|
4007
|
-
action.fallback = line.slice(9).trim();
|
|
4008
|
-
i++;
|
|
4009
|
-
continue;
|
|
4010
|
-
}
|
|
4011
|
-
if (line.startsWith("interrupt:")) {
|
|
4012
|
-
action.interrupt = line.slice(10).trim();
|
|
4013
|
-
i++;
|
|
4014
|
-
continue;
|
|
4015
|
-
}
|
|
4016
|
-
rep.fail(
|
|
4017
|
-
`\u672A\u8BC6\u522B\u7684 action \u5B50\u5B57\u6BB5: "${cl.text}"\u3002\u5408\u6CD5: prompt:, in:, out:, scope:, memory:, context:, resolve:, max_retries:, fallback:, interrupt:`,
|
|
4018
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: `action ${action.name}` }
|
|
4019
|
-
);
|
|
4020
|
-
}
|
|
4021
|
-
return action;
|
|
4022
|
-
}
|
|
4023
|
-
function parseModuleBlock(header, cls, rep = null, headerLineNum = null) {
|
|
4024
|
-
rep = rep || createReporter();
|
|
4025
|
-
const hm = header.match(/^module\s+([\w\u4e00-\u9fff]+)(?:\s*\(([^)]*)\))?\s*:?\s*$/);
|
|
4026
|
-
if (!hm)
|
|
4027
|
-
rep.fail(
|
|
4028
|
-
`Module \u58F0\u660E\u683C\u5F0F\u9519\u8BEF: "${header}"\u3002\u671F\u671B: module Name:`,
|
|
4029
|
-
{ line: (headerLineNum ?? -1) + 1, lineText: header, where: "module \u533A" }
|
|
4030
|
-
);
|
|
4031
|
-
const mod = {
|
|
4032
|
-
name: hm[1],
|
|
4033
|
-
params: hm[2] ? hm[2].split(",").map((s) => s.trim()).filter(Boolean) : [],
|
|
4034
|
-
meta: {},
|
|
4035
|
-
code: [],
|
|
4036
|
-
vars: [],
|
|
4037
|
-
actions: [],
|
|
4038
|
-
nodeDecls: [],
|
|
4039
|
-
edges: []
|
|
4040
|
-
};
|
|
4041
|
-
const subBlocks = [];
|
|
4042
|
-
let cur = null;
|
|
4043
|
-
const nonEmpty = cls.filter((cl) => cl.text.trim());
|
|
4044
|
-
const baseIndent = nonEmpty.length > 0 ? Math.min(...nonEmpty.map((cl) => cl.indent)) : 0;
|
|
4045
|
-
for (const cl of cls) {
|
|
4046
|
-
if (!cl.text.trim()) continue;
|
|
4047
|
-
if (cl.indent === baseIndent) {
|
|
4048
|
-
if (cur) subBlocks.push(cur);
|
|
4049
|
-
const headerText = cl.text.trim();
|
|
4050
|
-
if (headerText.startsWith("//") || headerText.startsWith("#")) {
|
|
4051
|
-
cur = null;
|
|
4052
|
-
} else {
|
|
4053
|
-
cur = { header: cl.text, headerLineNum: cl.lineNum, contentLines: [] };
|
|
4054
|
-
}
|
|
4055
|
-
} else if (cur && cl.indent > baseIndent) {
|
|
4056
|
-
cur.contentLines.push({ ...cl, indent: cl.indent - baseIndent });
|
|
4057
|
-
}
|
|
4058
|
-
}
|
|
4059
|
-
if (cur) subBlocks.push(cur);
|
|
4060
|
-
for (const sb of subBlocks) {
|
|
4061
|
-
const hdr = normalizeSymbols(sb.header);
|
|
4062
|
-
if (hdr === "vars:") {
|
|
4063
|
-
mod.vars = parseVarsBlock(sb.contentLines, rep);
|
|
4064
|
-
} else if (hdr === "meta:") {
|
|
4065
|
-
mod.meta = parseMetaBlock(sb.contentLines, rep);
|
|
4066
|
-
} else if (hdr === "code:") {
|
|
4067
|
-
mod.code = parseCodeBlock(sb.contentLines, rep);
|
|
4068
|
-
} else if (hdr.startsWith("action ")) {
|
|
4069
|
-
mod.actions.push(
|
|
4070
|
-
parseActionBlock(normalizeSymbols(sb.header), sb.contentLines, rep, sb.headerLineNum)
|
|
4071
|
-
);
|
|
4072
|
-
} else if (hdr === "flow:") {
|
|
4073
|
-
const { nodeDecls, edges } = parseFlowSection(sb.contentLines, [], rep);
|
|
4074
|
-
mod.nodeDecls = nodeDecls;
|
|
4075
|
-
mod.edges = edges;
|
|
4076
|
-
} else if (hdr === "sketch:") {
|
|
4077
|
-
mod.layout = parseLayoutBlock(sb.contentLines);
|
|
4078
|
-
} else if (hdr.startsWith("module ")) {
|
|
4079
|
-
const subMod = parseModuleBlock(hdr, sb.contentLines, rep, sb.headerLineNum);
|
|
4080
|
-
if (!mod.subModules) mod.subModules = [];
|
|
4081
|
-
mod.subModules.push(subMod);
|
|
4082
|
-
} else {
|
|
4083
|
-
rep.fail(
|
|
4084
|
-
`Module \u5185\u672A\u8BC6\u522B\u7684\u5B50\u5757: "${sb.header}"\u3002\u5408\u6CD5: vars:, meta:, code:, action ..., module ..., flow:`,
|
|
4085
|
-
{ line: (sb.headerLineNum ?? -1) + 1, lineText: sb.header, where: `module ${mod.name}` }
|
|
4086
|
-
);
|
|
4087
|
-
}
|
|
4088
|
-
}
|
|
4089
|
-
return mod;
|
|
4090
|
-
}
|
|
4091
|
-
function parseMainflowBlock(cls, rep = null) {
|
|
4092
|
-
rep = rep || createReporter();
|
|
4093
|
-
const nonCommentLines = cls.filter((l) => {
|
|
4094
|
-
const t = normalizeSymbols(l.text).trim();
|
|
4095
|
-
return t && !t.startsWith("//") && !t.startsWith("#");
|
|
4096
|
-
});
|
|
4097
|
-
if (nonCommentLines.length === 0) {
|
|
4098
|
-
return { nodeDecls: [], edges: [], layout: {} };
|
|
4099
|
-
}
|
|
4100
|
-
const baseIndent = Math.min(...nonCommentLines.map((l) => l.indent));
|
|
4101
|
-
const groups = [];
|
|
4102
|
-
let currentGroup = null;
|
|
4103
|
-
for (const cl of cls) {
|
|
4104
|
-
if (cl.indent === baseIndent) {
|
|
4105
|
-
if (currentGroup) groups.push(currentGroup);
|
|
4106
|
-
currentGroup = { header: cl, lines: [] };
|
|
4107
|
-
} else if (currentGroup && cl.indent > baseIndent) {
|
|
4108
|
-
currentGroup.lines.push(cl);
|
|
4109
|
-
}
|
|
4110
|
-
}
|
|
4111
|
-
if (currentGroup) groups.push(currentGroup);
|
|
4112
|
-
let flowLines = [];
|
|
4113
|
-
let layout = {};
|
|
4114
|
-
for (const group of groups) {
|
|
4115
|
-
const headerText = normalizeSymbols(group.header.text);
|
|
4116
|
-
if (headerText === "sketch:") {
|
|
4117
|
-
layout = parseLayoutBlock(group.lines);
|
|
4118
|
-
} else {
|
|
4119
|
-
flowLines.push(group.header);
|
|
4120
|
-
flowLines.push(...group.lines);
|
|
4121
|
-
}
|
|
4122
|
-
}
|
|
4123
|
-
if (groups.length === 0) {
|
|
4124
|
-
flowLines = cls;
|
|
4125
|
-
}
|
|
4126
|
-
const result = parseFlowSection(flowLines, [], rep);
|
|
4127
|
-
result.layout = layout;
|
|
4128
|
-
return result;
|
|
4129
|
-
}
|
|
4130
|
-
function parseFlowSection(flowLines, existingLabels, rep = null) {
|
|
4131
|
-
rep = rep || createReporter();
|
|
4132
|
-
console.log("parseFlowSection \u88AB\u8C03\u7528\uFF0CflowLines:");
|
|
4133
|
-
const nodeDecls = [];
|
|
4134
|
-
const edges = [];
|
|
4135
|
-
let currentNode = null;
|
|
4136
|
-
const usedLabels = new Set(existingLabels || []);
|
|
4137
|
-
const addEdge = (edge) => {
|
|
4138
|
-
const newCond = (edge.cond || "").trim();
|
|
4139
|
-
console.log(`[DEBUG] addEdge: src="${edge.srcLabel}" -> tgt="${edge.tgtLabel}", cond="${newCond}", isBack=${edge.isBack}`);
|
|
4140
|
-
const existing = edges.filter(
|
|
4141
|
-
(e) => e.srcLabel === edge.srcLabel && e.tgtLabel === edge.tgtLabel
|
|
4142
|
-
);
|
|
4143
|
-
console.log(`[DEBUG] \u5DF2\u6709\u540Csrc\u2192tgt\u8FB9\u6570: ${existing.length}, \u73B0\u6709cond\u5217\u8868: [${existing.map((e) => JSON.stringify((e.cond || "").trim())).join(", ")}]`);
|
|
4144
|
-
if (existing.length === 0) {
|
|
4145
|
-
console.log(`[addEdge] \u65E0\u51B2\u7A81, \u76F4\u63A5\u52A0\u5165`);
|
|
4146
|
-
edges.push(edge);
|
|
4147
|
-
return;
|
|
4148
|
-
}
|
|
4149
|
-
const exactMatch = existing.find((e) => (e.cond || "").trim() === newCond);
|
|
4150
|
-
if (exactMatch) {
|
|
4151
|
-
console.log(`[addEdge] \u5B8C\u5168\u76F8\u540C cond "${newCond}" \u5DF2\u5B58\u5728, \u8DF3\u8FC7\u65B0\u8FB9`);
|
|
4152
|
-
return;
|
|
4153
|
-
}
|
|
4154
|
-
const newIsConditional = newCond !== "";
|
|
4155
|
-
const hasAnyConditional = existing.some((e) => (e.cond || "").trim() !== "");
|
|
4156
|
-
const allUnconditional = existing.every((e) => (e.cond || "").trim() === "");
|
|
4157
|
-
console.log(`[DEBUG] newIsConditional=${newIsConditional}, hasAnyConditional=${hasAnyConditional}, allUnconditional=${allUnconditional}`);
|
|
4158
|
-
if (!newIsConditional && hasAnyConditional) {
|
|
4159
|
-
const keptCond = existing.find((e) => (e.cond || "").trim() !== "").cond;
|
|
4160
|
-
console.log(`[addEdge] \u89C4\u52192: \u65B0\u8FB9\u65E0\u6761\u4EF6\uFF0C\u5DF2\u6709\u6761\u4EF6\u8FB9 "${(keptCond || "").trim()}" \u2192 \u4E22\u5F03\u65B0\u8FB9`);
|
|
4161
|
-
return;
|
|
4162
|
-
}
|
|
4163
|
-
if (newIsConditional && allUnconditional) {
|
|
4164
|
-
console.log(`[addEdge] \u89C4\u52192: \u65B0\u8FB9\u6709\u6761\u4EF6 "${newCond}"\uFF0C\u5DF2\u6709\u5168\u65E0\u6761\u4EF6 \u2192 \u5220\u9664\u5DF2\u6709\u65E0\u6761\u4EF6\u8FB9\uFF0C\u52A0\u5165\u65B0\u6761\u4EF6\u8FB9`);
|
|
4165
|
-
const indicesToRemove = existing.map((e) => edges.indexOf(e)).filter((i2) => i2 !== -1).sort((a, b) => b - a);
|
|
4166
|
-
for (const idx of indicesToRemove) {
|
|
4167
|
-
edges.splice(idx, 1);
|
|
4168
|
-
}
|
|
4169
|
-
edges.push(edge);
|
|
4170
|
-
return;
|
|
4171
|
-
}
|
|
4172
|
-
if (newIsConditional && hasAnyConditional) {
|
|
4173
|
-
const existingConds = existing.map((e) => (e.cond || "").trim());
|
|
4174
|
-
rep.fail(
|
|
4175
|
-
`\u8FB9\u51B2\u7A81: "${edge.srcLabel}" \u2192 "${edge.tgtLabel}" \u5DF2\u5B58\u5728\u6761\u4EF6\u8FB9 (\u6761\u4EF6: "${existingConds.join('", "')}"), \u65B0\u8FB9\u6761\u4EF6\u4E3A "${newCond}"\u3002\u540C\u4E00 src\u2192tgt \u4E0D\u5141\u8BB8\u540C\u65F6\u5B58\u5728\u4E24\u6761\u4E0D\u540C\u6761\u4EF6\u7684\u8FB9\uFF0C\u8BF7\u68C0\u67E5\u6D41\u7A0B\u7ED3\u6784`,
|
|
4176
|
-
{ where: "flow" }
|
|
4177
|
-
);
|
|
4178
|
-
}
|
|
4179
|
-
console.log(`[addEdge] \u515C\u5E95: \u90FD\u65E0\u6761\u4EF6 (${existing.length}\u6761\u5DF2\u6709), \u52A0\u5165`);
|
|
4180
|
-
edges.push(edge);
|
|
4181
|
-
};
|
|
4182
|
-
function ensureNodeForRef(ref) {
|
|
4183
|
-
console.log("ensureNodeForRef \u88AB\u8C03\u7528:", ref);
|
|
4184
|
-
if (ref.includes("->")) {
|
|
4185
|
-
console.trace("\u5F02\u5E38\u8282\u70B9\u5F15\u7528\uFF08\u542B ->\uFF09:", ref);
|
|
4186
|
-
rep.fail(`ensureNodeForRef \u6536\u5230\u975E\u6CD5\u5F15\u7528: "${ref}"`, { where: "flow" });
|
|
4187
|
-
}
|
|
4188
|
-
const trimmed = ref.trim();
|
|
4189
|
-
const bracketMatch = trimmed.match(/^\[(.+)\]$/);
|
|
4190
|
-
if (bracketMatch) {
|
|
4191
|
-
const label2 = bracketMatch[1];
|
|
4192
|
-
if (!usedLabels.has(label2) && !nodeDecls.some((d) => d.label === label2)) {
|
|
4193
|
-
nodeDecls.push({ label: label2, ref: "" });
|
|
4194
|
-
usedLabels.add(label2);
|
|
4195
|
-
}
|
|
4196
|
-
return label2;
|
|
4197
|
-
}
|
|
4198
|
-
const inlineMatch = trimmed.match(/^\[(.+?)\]:\s*(.*)$/);
|
|
4199
|
-
if (inlineMatch) {
|
|
4200
|
-
const label2 = inlineMatch[1];
|
|
4201
|
-
const refVal = inlineMatch[2].trim();
|
|
4202
|
-
if (!usedLabels.has(label2) && !nodeDecls.some((d) => d.label === label2)) {
|
|
4203
|
-
nodeDecls.push({ label: label2, ref: refVal });
|
|
4204
|
-
usedLabels.add(label2);
|
|
4205
|
-
}
|
|
4206
|
-
return label2;
|
|
4207
|
-
}
|
|
4208
|
-
let baseName = trimmed.startsWith("&") ? trimmed.substring(1) : trimmed;
|
|
4209
|
-
baseName = baseName.replace(/\(.*$/, "").trim();
|
|
4210
|
-
let label = baseName;
|
|
4211
|
-
let counter = 2;
|
|
4212
|
-
while (usedLabels.has(label) || nodeDecls.some((d) => d.label === label)) {
|
|
4213
|
-
label = `${baseName}_${counter}`;
|
|
4214
|
-
counter++;
|
|
4215
|
-
}
|
|
4216
|
-
nodeDecls.push({ label, ref: trimmed });
|
|
4217
|
-
usedLabels.add(label);
|
|
4218
|
-
return label;
|
|
4219
|
-
}
|
|
4220
|
-
function resolveTarget(srcLabel, targetRaw, cond) {
|
|
4221
|
-
console.log("resolveTarget:", srcLabel, "->", targetRaw, "cond:", cond);
|
|
4222
|
-
console.log(`[DEBUG] resolveTarget: src="${srcLabel}", target="${targetRaw}", cond="${cond}"`);
|
|
4223
|
-
if (targetRaw == null) {
|
|
4224
|
-
console.trace("resolveTarget \u6536\u5230\u7A7A targetRaw\uFF0CsrcLabel:", srcLabel);
|
|
4225
|
-
rep.fail(`resolveTarget \u6536\u5230\u7A7A targetRaw\uFF0CsrcLabel: ${srcLabel}`, { where: "flow" });
|
|
4226
|
-
}
|
|
4227
|
-
const trimmed = targetRaw.trim().replace(/:/g, ":");
|
|
4228
|
-
const inlineMatch = trimmed.match(/^\[(.+?)\]:\s*(.*)$/);
|
|
4229
|
-
if (inlineMatch) {
|
|
4230
|
-
const label2 = inlineMatch[1];
|
|
4231
|
-
const ref = inlineMatch[2].trim();
|
|
4232
|
-
if (!usedLabels.has(label2) && !nodeDecls.some((d) => d.label === label2)) {
|
|
4233
|
-
nodeDecls.push({ label: label2, ref });
|
|
4234
|
-
usedLabels.add(label2);
|
|
4235
|
-
}
|
|
4236
|
-
addEdge({ srcLabel, tgtLabel: label2, cond, isBack: false });
|
|
4237
|
-
return label2;
|
|
4238
|
-
}
|
|
4239
|
-
const bracketMatch = trimmed.match(/^\[(.+)\]$/);
|
|
4240
|
-
if (bracketMatch) {
|
|
4241
|
-
const label2 = bracketMatch[1];
|
|
4242
|
-
if (!usedLabels.has(label2) && !nodeDecls.some((d) => d.label === label2)) {
|
|
4243
|
-
nodeDecls.push({ label: label2, ref: "" });
|
|
4244
|
-
usedLabels.add(label2);
|
|
4245
|
-
}
|
|
4246
|
-
addEdge({ srcLabel, tgtLabel: label2, cond, isBack: false });
|
|
4247
|
-
return label2;
|
|
4248
|
-
}
|
|
4249
|
-
let nodeLabel = trimmed.startsWith("&") ? trimmed.substring(1) : trimmed;
|
|
4250
|
-
const baseName = nodeLabel.replace(/\(.*$/, "").trim();
|
|
4251
|
-
let label = baseName;
|
|
4252
|
-
let counter = 2;
|
|
4253
|
-
while (usedLabels.has(label) || nodeDecls.some((d) => d.label === label)) {
|
|
4254
|
-
label = `${baseName}_${counter}`;
|
|
4255
|
-
counter++;
|
|
4256
|
-
}
|
|
4257
|
-
nodeDecls.push({ label, ref: trimmed.trim() });
|
|
4258
|
-
usedLabels.add(label);
|
|
4259
|
-
addEdge({ srcLabel, tgtLabel: label, cond, isBack: false });
|
|
4260
|
-
return label;
|
|
4261
|
-
}
|
|
4262
|
-
function resolveChainEntry(raw) {
|
|
4263
|
-
const parts = raw.split("->").map((p) => p.trim()).filter(Boolean);
|
|
4264
|
-
if (parts.length <= 1) return ensureNodeForRef(parts[0] || raw.trim());
|
|
4265
|
-
let prev = ensureNodeForRef(parts[0]);
|
|
4266
|
-
for (let k = 1; k < parts.length; k++) {
|
|
4267
|
-
prev = resolveTarget(prev, parts[k], "");
|
|
4268
|
-
}
|
|
4269
|
-
return prev;
|
|
4270
|
-
}
|
|
4271
|
-
function resolveExitChain(raw, srcLabel) {
|
|
4272
|
-
const parts = raw.split("->").map((p) => p.trim()).filter(Boolean);
|
|
4273
|
-
if (parts.length === 0) return srcLabel;
|
|
4274
|
-
let cur = srcLabel;
|
|
4275
|
-
for (const part of parts) {
|
|
4276
|
-
const ifMatch = part.match(/^if\s*\((.+)\)$/);
|
|
4277
|
-
if (ifMatch) {
|
|
4278
|
-
const rest = part.slice(part.indexOf(")") + 1).trim();
|
|
4279
|
-
cur = resolveTarget(cur, rest, ifMatch[1].trim());
|
|
4280
|
-
} else {
|
|
4281
|
-
cur = resolveTarget(cur, part, "");
|
|
4282
|
-
}
|
|
4283
|
-
}
|
|
4284
|
-
return cur;
|
|
4285
|
-
}
|
|
4286
|
-
for (const line of flowLines) {
|
|
4287
|
-
let t = normalizeSymbols(line.text, "flow");
|
|
4288
|
-
console.log("\u89C4\u8303\u5316\u524D:", line.text);
|
|
4289
|
-
const parts = t.split("->").map((p) => {
|
|
4290
|
-
let s = p.trim();
|
|
4291
|
-
if (!s) return "";
|
|
4292
|
-
if (s.startsWith("[")) return s;
|
|
4293
|
-
if (/^[^:]+\s*:\s*.+/.test(s)) return s;
|
|
4294
|
-
if (/\b(if|for|while|fork|par|join|in|to|all)\b/.test(s) || /[()]/.test(s)) {
|
|
4295
|
-
return s;
|
|
4296
|
-
}
|
|
4297
|
-
if (s.startsWith("&")) {
|
|
4298
|
-
const label = ensureNodeForRef(s);
|
|
4299
|
-
return `[${label}]`;
|
|
4300
|
-
}
|
|
4301
|
-
if (/^[\p{L}_][\p{L}\p{N}_]*$/u.test(s)) {
|
|
4302
|
-
const label = ensureNodeForRef(s);
|
|
4303
|
-
return `[${label}]`;
|
|
4304
|
-
}
|
|
4305
|
-
return s;
|
|
4306
|
-
});
|
|
4307
|
-
line.text = parts.join(" -> ");
|
|
4308
|
-
console.log("\u89C4\u8303\u5316\u540E:", line.text);
|
|
4309
|
-
}
|
|
4310
|
-
let i = 0;
|
|
4311
|
-
let loopGuard = 0;
|
|
4312
|
-
while (i < flowLines.length) {
|
|
4313
|
-
if (++loopGuard > flowLines.length * 20) {
|
|
4314
|
-
rep.fail(`\u6D41\u7A0B\u89E3\u6790\u9677\u5165\u6B7B\u5FAA\u73AF`, { line: (flowLines[i]?.lineNum ?? i) + 1, lineText: flowLines[i]?.raw || "", where: "flow" });
|
|
4315
|
-
}
|
|
4316
|
-
const cl = flowLines[i];
|
|
4317
|
-
if (!cl) break;
|
|
4318
|
-
let text = normalizeSymbols(cl.text, "flow").trim();
|
|
4319
|
-
console.log(">>> LINE", cl.lineNum + 1, JSON.stringify(text));
|
|
4320
|
-
if (!text || text.startsWith("//")) {
|
|
4321
|
-
i++;
|
|
4322
|
-
continue;
|
|
4323
|
-
}
|
|
4324
|
-
if (text.startsWith("//")) {
|
|
4325
|
-
i++;
|
|
4326
|
-
continue;
|
|
4327
|
-
}
|
|
4328
|
-
if (text.startsWith("#")) {
|
|
4329
|
-
i++;
|
|
4330
|
-
continue;
|
|
4331
|
-
}
|
|
4332
|
-
const forkMatch = text.match(/^(.+)\s*->\s*fork:$/);
|
|
4333
|
-
if (forkMatch) {
|
|
4334
|
-
const srcLabel = resolveChainEntry(forkMatch[1].trim());
|
|
4335
|
-
i++;
|
|
4336
|
-
let forkGuard = 0;
|
|
4337
|
-
while (i < flowLines.length && flowLines[i].indent > cl.indent) {
|
|
4338
|
-
if (++forkGuard > 500) rep.fail(`fork \u5206\u652F\u89E3\u6790\u6B7B\u5FAA\u73AF`, { line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "flow" });
|
|
4339
|
-
const rawLine = flowLines[i].text;
|
|
4340
|
-
const bl = normalizeSymbols(rawLine, "flow").trim();
|
|
4341
|
-
const bm = bl.match(/^->\s*(?:if\s*\((.+?)\)\s*->\s*)?(.+)$/);
|
|
4342
|
-
if (bm) {
|
|
4343
|
-
const cond = bm[1] || "";
|
|
4344
|
-
const rest = bm[2].trim();
|
|
4345
|
-
const parts = rest.split("->").map((p) => p.trim()).filter((p) => p !== "");
|
|
4346
|
-
if (parts.length === 0) rep.fail(`fork \u5206\u652F\u7F3A\u5C11\u76EE\u6807`, { line: flowLines[i].lineNum + 1, lineText: flowLines[i].raw || rawLine, where: "flow" });
|
|
4347
|
-
let curSrc = srcLabel;
|
|
4348
|
-
let first = true;
|
|
4349
|
-
for (const part of parts) {
|
|
4350
|
-
curSrc = resolveTarget(curSrc, part, first ? cond : "");
|
|
4351
|
-
first = false;
|
|
4352
|
-
}
|
|
4353
|
-
} else {
|
|
4354
|
-
rep.fail(`fork \u5206\u652F\u683C\u5F0F\u9519\u8BEF: "${rawLine}"`, { line: flowLines[i].lineNum + 1, lineText: flowLines[i].raw || rawLine, where: "flow" });
|
|
4355
|
-
}
|
|
4356
|
-
i++;
|
|
4357
|
-
}
|
|
4358
|
-
continue;
|
|
4359
|
-
}
|
|
4360
|
-
const parMatch = text.match(/^(.+)\s*->\s*par\s+(.+):$/);
|
|
4361
|
-
if (parMatch) {
|
|
4362
|
-
const entryRaw = parMatch[1].trim();
|
|
4363
|
-
const condition = parMatch[2].trim();
|
|
4364
|
-
const entryLabel = resolveChainEntry(entryRaw);
|
|
4365
|
-
let parLabel = "PAR";
|
|
4366
|
-
let counter = 2;
|
|
4367
|
-
while (nodeDecls.some((d) => d.label === parLabel)) {
|
|
4368
|
-
parLabel = `PAR_${counter}`;
|
|
4369
|
-
counter++;
|
|
4370
|
-
}
|
|
4371
|
-
const parNodeLabel = parLabel;
|
|
4372
|
-
const parOutLabel = parLabel + "_out";
|
|
4373
|
-
nodeDecls.push({
|
|
4374
|
-
label: parNodeLabel,
|
|
4375
|
-
ref: "",
|
|
4376
|
-
specialType: "PAR",
|
|
4377
|
-
forCondition: condition
|
|
4378
|
-
});
|
|
4379
|
-
if (!nodeDecls.some((d) => d.label === parOutLabel)) {
|
|
4380
|
-
nodeDecls.push({
|
|
4381
|
-
label: parOutLabel,
|
|
4382
|
-
ref: "",
|
|
4383
|
-
specialType: "PAR_OUT",
|
|
4384
|
-
forNodeId: parNodeLabel
|
|
4385
|
-
});
|
|
4386
|
-
}
|
|
4387
|
-
addEdge({ srcLabel: entryLabel, tgtLabel: parNodeLabel, cond: "", isBack: false });
|
|
4388
|
-
i++;
|
|
4389
|
-
const rawBodyLines = [];
|
|
4390
|
-
while (i < flowLines.length && flowLines[i].indent > cl.indent) {
|
|
4391
|
-
rawBodyLines.push(flowLines[i]);
|
|
4392
|
-
i++;
|
|
4393
|
-
}
|
|
4394
|
-
if (rawBodyLines.length === 0) {
|
|
4395
|
-
rep.fail(`par \u5757\u4E0D\u80FD\u4E3A\u7A7A`, { line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "flow" });
|
|
4396
|
-
}
|
|
4397
|
-
const pendingBackNodes = [];
|
|
4398
|
-
const cleanBodyLines = [];
|
|
4399
|
-
for (const bl of rawBodyLines) {
|
|
4400
|
-
let textBody = normalizeSymbols(bl.text, "flow").trim();
|
|
4401
|
-
let lastNodeInLine = null;
|
|
4402
|
-
if (textBody.startsWith("->")) {
|
|
4403
|
-
const restAfterStart = textBody.substring(2).trim();
|
|
4404
|
-
const ifMatch = restAfterStart.match(/^if\s*\((.+?)\)\s*->\s*(.*)$/);
|
|
4405
|
-
let startCond = "";
|
|
4406
|
-
if (ifMatch) {
|
|
4407
|
-
startCond = ifMatch[1].trim();
|
|
4408
|
-
textBody = ifMatch[2].trim();
|
|
4409
|
-
} else {
|
|
4410
|
-
textBody = restAfterStart;
|
|
4411
|
-
}
|
|
4412
|
-
const parts = textBody.split("->").map((x) => x.trim()).filter(Boolean);
|
|
4413
|
-
if (!parts.length) {
|
|
4414
|
-
rep.fail(`par \u5185\u90E8\u884C\u9996 -> \u540E\u9762\u7F3A\u5C11\u76EE\u6807`, { line: bl.lineNum + 1, lineText: bl.raw || bl.text, where: "flow" });
|
|
4415
|
-
}
|
|
4416
|
-
const firstPart = parts[0];
|
|
4417
|
-
const tgtLabel = resolveTarget(parNodeLabel, firstPart, startCond);
|
|
4418
|
-
lastNodeInLine = tgtLabel;
|
|
4419
|
-
}
|
|
4420
|
-
let endsWithArrow = false;
|
|
4421
|
-
if (textBody.endsWith("->")) {
|
|
4422
|
-
textBody = textBody.slice(0, -2).trim();
|
|
4423
|
-
endsWithArrow = true;
|
|
4424
|
-
}
|
|
4425
|
-
if (textBody) {
|
|
4426
|
-
const parts = textBody.split("->").map((p) => p.trim()).filter((p) => p !== "");
|
|
4427
|
-
if (parts.length > 0) {
|
|
4428
|
-
const lastPart = parts[parts.length - 1];
|
|
4429
|
-
const labelMatch = lastPart.match(/^\[(.+?)\]/);
|
|
4430
|
-
if (labelMatch) {
|
|
4431
|
-
lastNodeInLine = labelMatch[1];
|
|
4432
|
-
} else {
|
|
4433
|
-
lastNodeInLine = ensureNodeForRef(lastPart);
|
|
4434
|
-
}
|
|
4435
|
-
}
|
|
4436
|
-
} else if (!lastNodeInLine) {
|
|
4437
|
-
rep.fail(`par \u5185\u90E8\u884C\u7F3A\u5C11\u8282\u70B9`, { line: bl.lineNum + 1, lineText: bl.raw || bl.text, where: "flow" });
|
|
4438
|
-
}
|
|
4439
|
-
if (endsWithArrow && lastNodeInLine) {
|
|
4440
|
-
pendingBackNodes.push(lastNodeInLine);
|
|
4441
|
-
}
|
|
4442
|
-
if (textBody) {
|
|
4443
|
-
cleanBodyLines.push({
|
|
4444
|
-
...bl,
|
|
4445
|
-
text: textBody
|
|
4446
|
-
});
|
|
4447
|
-
}
|
|
4448
|
-
}
|
|
4449
|
-
if (cleanBodyLines.length > 0) {
|
|
4450
|
-
const minIndent = Math.min(...cleanBodyLines.map((l) => l.indent));
|
|
4451
|
-
const normalizedLines = cleanBodyLines.map((l) => ({
|
|
4452
|
-
...l,
|
|
4453
|
-
indent: l.indent - minIndent + 2
|
|
4454
|
-
}));
|
|
4455
|
-
const { nodeDecls: bodyDecls, edges: bodyEdges } = parseFlowSection(
|
|
4456
|
-
normalizedLines,
|
|
4457
|
-
[...usedLabels],
|
|
4458
|
-
rep
|
|
4459
|
-
);
|
|
4460
|
-
bodyDecls.forEach((d) => {
|
|
4461
|
-
if (!nodeDecls.some((existing) => existing.label === d.label)) {
|
|
4462
|
-
nodeDecls.push(d);
|
|
4463
|
-
}
|
|
4464
|
-
});
|
|
4465
|
-
bodyEdges.forEach((be) => addEdge(be));
|
|
4466
|
-
}
|
|
4467
|
-
pendingBackNodes.forEach((pbLabel) => {
|
|
4468
|
-
addEdge({ srcLabel: pbLabel, tgtLabel: parOutLabel, cond: "", isBack: false });
|
|
4469
|
-
});
|
|
4470
|
-
if (i < flowLines.length && flowLines[i].indent === cl.indent) {
|
|
4471
|
-
const afterLine = normalizeSymbols(flowLines[i].text, "flow").trim();
|
|
4472
|
-
const am = afterLine.match(/^->\s*(.+)$/);
|
|
4473
|
-
if (am) {
|
|
4474
|
-
const exitTargetRaw = am[1].trim();
|
|
4475
|
-
const ctrlMatch = exitTargetRaw.match(/\s*->\s*(for|par|fork|join)\b/);
|
|
4476
|
-
if (ctrlMatch) {
|
|
4477
|
-
const chainPart = exitTargetRaw.slice(0, ctrlMatch.index).trim();
|
|
4478
|
-
if (chainPart) {
|
|
4479
|
-
resolveExitChain(chainPart, parOutLabel);
|
|
4480
|
-
}
|
|
4481
|
-
} else {
|
|
4482
|
-
resolveExitChain(exitTargetRaw, parOutLabel);
|
|
4483
|
-
i++;
|
|
4484
|
-
}
|
|
4485
|
-
}
|
|
4486
|
-
}
|
|
4487
|
-
currentNode = parOutLabel;
|
|
4488
|
-
continue;
|
|
4489
|
-
}
|
|
4490
|
-
const jm = text.match(/^join\((\w+)\):$/);
|
|
4491
|
-
if (jm) {
|
|
4492
|
-
const joinParam = jm[1];
|
|
4493
|
-
i++;
|
|
4494
|
-
const sources = [];
|
|
4495
|
-
while (i < flowLines.length && !flowLines[i].text.trim().startsWith("to ")) {
|
|
4496
|
-
const rawLine = flowLines[i].text;
|
|
4497
|
-
const srcLine = rawLine.trim();
|
|
4498
|
-
if (!srcLine.endsWith("->")) {
|
|
4499
|
-
rep.fail(`join \u5185\u90E8\u6BCF\u884C\u5FC5\u987B\u4EE5 -> \u7ED3\u5C3E\u3002\u5F53\u524D\u884C: "${rawLine}"`, { line: flowLines[i].lineNum + 1, lineText: flowLines[i].raw || rawLine, where: "flow" });
|
|
4500
|
-
}
|
|
4501
|
-
const sm = srcLine.match(/^\[([^\[\]]+?)\]\s*->$/);
|
|
4502
|
-
if (sm) {
|
|
4503
|
-
sources.push(sm[1]);
|
|
4504
|
-
} else {
|
|
4505
|
-
rep.fail(`join \u6E90\u8282\u70B9\u683C\u5F0F\u9519\u8BEF\uFF0C\u671F\u671B [\u8282\u70B9\u540D] ->\uFF0C\u5B9E\u9645: "${rawLine}"`, { line: flowLines[i].lineNum + 1, lineText: flowLines[i].raw || rawLine, where: "flow" });
|
|
4506
|
-
}
|
|
4507
|
-
i++;
|
|
4508
|
-
}
|
|
4509
|
-
if (i < flowLines.length && flowLines[i].text.trim().startsWith("to ")) {
|
|
4510
|
-
let targetRaw = flowLines[i].text.trim().slice(3).trim();
|
|
4511
|
-
if (!targetRaw) rep.fail(`join \u76EE\u6807\u4E3A\u7A7A`, { line: flowLines[i].lineNum + 1, lineText: flowLines[i].raw || "", where: "flow" });
|
|
4512
|
-
if (targetRaw.endsWith("->")) {
|
|
4513
|
-
targetRaw = targetRaw.slice(0, -2).trim();
|
|
4514
|
-
}
|
|
4515
|
-
const parts = targetRaw.split("->").map((p) => p.trim()).filter(Boolean);
|
|
4516
|
-
if (parts.length === 0) rep.fail(`join \u76EE\u6807\u4E3A\u7A7A`, { line: flowLines[i].lineNum + 1, lineText: flowLines[i].raw || "", where: "flow" });
|
|
4517
|
-
const tgtLabel = ensureNodeForRef(parts[0]);
|
|
4518
|
-
let tail = tgtLabel;
|
|
4519
|
-
for (let k = 1; k < parts.length; k++) {
|
|
4520
|
-
tail = resolveTarget(tail, parts[k], "");
|
|
4521
|
-
}
|
|
4522
|
-
sources.forEach((s) => addEdge({ srcLabel: s, tgtLabel, cond: "", isBack: false }));
|
|
4523
|
-
const tgtDecl = nodeDecls.find((d) => d.label === tgtLabel);
|
|
4524
|
-
if (tgtDecl) {
|
|
4525
|
-
if (!tgtDecl.joinEntries) tgtDecl.joinEntries = [];
|
|
4526
|
-
tgtDecl.joinEntries.push({ sources: sources.slice(), param: joinParam });
|
|
4527
|
-
} else {
|
|
4528
|
-
const newDecl = { label: tgtLabel, ref: "", joinEntries: [{ sources: sources.slice(), param: joinParam }] };
|
|
4529
|
-
nodeDecls.push(newDecl);
|
|
4530
|
-
usedLabels.add(tgtLabel);
|
|
4531
|
-
}
|
|
4532
|
-
currentNode = tail;
|
|
4533
|
-
i++;
|
|
4534
|
-
} else {
|
|
4535
|
-
rep.fail(`join \u7F3A\u5C11 to \u76EE\u6807`, { line: (flowLines[i]?.lineNum ?? flowLines.length) + 1, lineText: flowLines[i]?.raw || "", where: "flow" });
|
|
4536
|
-
}
|
|
4537
|
-
continue;
|
|
4538
|
-
}
|
|
4539
|
-
const forEntryMatch = text.match(/^(.+)\s*->\s*for\s+(.+):$/);
|
|
4540
|
-
if (forEntryMatch) {
|
|
4541
|
-
const entryRaw = forEntryMatch[1].trim();
|
|
4542
|
-
const condition = forEntryMatch[2].trim();
|
|
4543
|
-
const entryLabel = resolveChainEntry(entryRaw);
|
|
4544
|
-
let forLabel = "FOR";
|
|
4545
|
-
let counter = 2;
|
|
4546
|
-
while (nodeDecls.some((d) => d.label === forLabel)) {
|
|
4547
|
-
forLabel = `FOR_${counter}`;
|
|
4548
|
-
counter++;
|
|
4549
|
-
}
|
|
4550
|
-
const forNodeLabel = forLabel;
|
|
4551
|
-
const forOutLabel = forLabel + "_out";
|
|
4552
|
-
nodeDecls.push({
|
|
4553
|
-
label: forNodeLabel,
|
|
4554
|
-
ref: "",
|
|
4555
|
-
specialType: "FOR",
|
|
4556
|
-
forCondition: condition
|
|
4557
|
-
});
|
|
4558
|
-
addEdge({ srcLabel: entryLabel, tgtLabel: forNodeLabel, cond: "", isBack: false });
|
|
4559
|
-
i++;
|
|
4560
|
-
const rawBodyLines = [];
|
|
4561
|
-
while (i < flowLines.length && flowLines[i].indent > cl.indent) {
|
|
4562
|
-
rawBodyLines.push(flowLines[i]);
|
|
4563
|
-
i++;
|
|
4564
|
-
}
|
|
4565
|
-
if (rawBodyLines.length === 0) {
|
|
4566
|
-
rep.fail(`for \u5757\u4E0D\u80FD\u4E3A\u7A7A`, { line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "flow" });
|
|
4567
|
-
}
|
|
4568
|
-
const pendingBackNodes = [];
|
|
4569
|
-
const cleanBodyLines = [];
|
|
4570
|
-
for (const bl of rawBodyLines) {
|
|
4571
|
-
let textBody = normalizeSymbols(bl.text, "flow").trim();
|
|
4572
|
-
let lastNodeInLine = null;
|
|
4573
|
-
if (textBody.startsWith("->")) {
|
|
4574
|
-
const restAfterStart = textBody.substring(2).trim();
|
|
4575
|
-
const ifMatch = restAfterStart.match(/^if\s*\((.+?)\)\s*->\s*(.*)$/);
|
|
4576
|
-
let startCond = "";
|
|
4577
|
-
if (ifMatch) {
|
|
4578
|
-
startCond = ifMatch[1].trim();
|
|
4579
|
-
textBody = ifMatch[2].trim();
|
|
4580
|
-
} else {
|
|
4581
|
-
textBody = restAfterStart;
|
|
4582
|
-
}
|
|
4583
|
-
const parts = textBody.split("->").map((x) => x.trim()).filter(Boolean);
|
|
4584
|
-
if (!parts.length) {
|
|
4585
|
-
rep.fail(`for \u5185\u90E8\u884C\u9996 -> \u540E\u9762\u7F3A\u5C11\u76EE\u6807`, { line: bl.lineNum + 1, lineText: bl.raw || bl.text, where: "flow" });
|
|
4586
|
-
}
|
|
4587
|
-
const firstPart = parts[0];
|
|
4588
|
-
const tgtLabel = resolveTarget(
|
|
4589
|
-
forNodeLabel,
|
|
4590
|
-
firstPart,
|
|
4591
|
-
startCond
|
|
4592
|
-
);
|
|
4593
|
-
lastNodeInLine = tgtLabel;
|
|
4594
|
-
}
|
|
4595
|
-
let endsWithArrow = false;
|
|
4596
|
-
if (textBody.endsWith("->")) {
|
|
4597
|
-
textBody = textBody.slice(0, -2).trim();
|
|
4598
|
-
endsWithArrow = true;
|
|
4599
|
-
}
|
|
4600
|
-
if (textBody) {
|
|
4601
|
-
const parts = textBody.split("->").map((p) => p.trim()).filter((p) => p !== "");
|
|
4602
|
-
if (parts.length > 0) {
|
|
4603
|
-
const lastPart = parts[parts.length - 1];
|
|
4604
|
-
const labelMatch = lastPart.match(/^\[(.+?)\]/);
|
|
4605
|
-
if (labelMatch) {
|
|
4606
|
-
lastNodeInLine = labelMatch[1];
|
|
4607
|
-
} else {
|
|
4608
|
-
const lbl = ensureNodeForRef(lastPart);
|
|
4609
|
-
lastNodeInLine = lbl;
|
|
4610
|
-
}
|
|
4611
|
-
}
|
|
4612
|
-
} else if (!lastNodeInLine) {
|
|
4613
|
-
rep.fail(`for \u5185\u90E8\u884C\u7F3A\u5C11\u8282\u70B9`, { line: bl.lineNum + 1, lineText: bl.raw || bl.text, where: "flow" });
|
|
4614
|
-
}
|
|
4615
|
-
if (endsWithArrow && lastNodeInLine) {
|
|
4616
|
-
pendingBackNodes.push(lastNodeInLine);
|
|
4617
|
-
}
|
|
4618
|
-
if (textBody) {
|
|
4619
|
-
cleanBodyLines.push({
|
|
4620
|
-
...bl,
|
|
4621
|
-
text: textBody
|
|
4622
|
-
});
|
|
4623
|
-
}
|
|
4624
|
-
}
|
|
4625
|
-
if (cleanBodyLines.length > 0) {
|
|
4626
|
-
const minIndent = Math.min(...cleanBodyLines.map((l) => l.indent));
|
|
4627
|
-
const normalizedLines = cleanBodyLines.map((l) => ({
|
|
4628
|
-
...l,
|
|
4629
|
-
indent: l.indent - minIndent + 2
|
|
4630
|
-
}));
|
|
4631
|
-
const { nodeDecls: bodyDecls, edges: bodyEdges } = parseFlowSection(
|
|
4632
|
-
normalizedLines,
|
|
4633
|
-
[...usedLabels],
|
|
4634
|
-
rep
|
|
4635
|
-
);
|
|
4636
|
-
bodyDecls.forEach((d) => {
|
|
4637
|
-
if (!nodeDecls.some((existing) => existing.label === d.label)) {
|
|
4638
|
-
nodeDecls.push(d);
|
|
4639
|
-
}
|
|
4640
|
-
});
|
|
4641
|
-
bodyEdges.forEach((be) => addEdge(be));
|
|
4642
|
-
}
|
|
4643
|
-
pendingBackNodes.forEach((pbLabel) => {
|
|
4644
|
-
addEdge({ srcLabel: pbLabel, tgtLabel: forNodeLabel, cond: "", isBack: true });
|
|
4645
|
-
});
|
|
4646
|
-
console.log("FOR\u51FA\u53E3\u8BCA\u65AD:", {
|
|
4647
|
-
i,
|
|
4648
|
-
lineText: flowLines[i]?.text,
|
|
4649
|
-
lineIndent: flowLines[i]?.indent,
|
|
4650
|
-
forIndent: cl.indent,
|
|
4651
|
-
isMatch: flowLines[i]?.indent === cl.indent
|
|
4652
|
-
});
|
|
4653
|
-
if (i < flowLines.length && flowLines[i].indent === cl.indent) {
|
|
4654
|
-
const afterLine = normalizeSymbols(flowLines[i].text, "flow").trim();
|
|
4655
|
-
const am = afterLine.match(/^->\s*(.+)$/);
|
|
4656
|
-
if (am) {
|
|
4657
|
-
if (!nodeDecls.some((d) => d.label === forOutLabel)) {
|
|
4658
|
-
nodeDecls.push({
|
|
4659
|
-
label: forOutLabel,
|
|
4660
|
-
ref: "",
|
|
4661
|
-
specialType: "FOR_OUT",
|
|
4662
|
-
forNodeId: forNodeLabel
|
|
4663
|
-
});
|
|
4664
|
-
}
|
|
4665
|
-
const exitTargetRaw = am[1].trim();
|
|
4666
|
-
const ctrlMatch = exitTargetRaw.match(/\s*->\s*(for|par|fork|join)\b/);
|
|
4667
|
-
if (ctrlMatch) {
|
|
4668
|
-
const chainPart = exitTargetRaw.slice(0, ctrlMatch.index).trim();
|
|
4669
|
-
if (chainPart) {
|
|
4670
|
-
resolveExitChain(chainPart, forOutLabel);
|
|
4671
|
-
}
|
|
4672
|
-
} else {
|
|
4673
|
-
resolveExitChain(exitTargetRaw, forOutLabel);
|
|
4674
|
-
i++;
|
|
4675
|
-
}
|
|
4676
|
-
}
|
|
4677
|
-
}
|
|
4678
|
-
currentNode = forOutLabel;
|
|
4679
|
-
continue;
|
|
4680
|
-
}
|
|
4681
|
-
const dmChain = text.match(/^\[([^\[\]]+?)\]:\s*(\S+)\s*->\s*(.+)$/);
|
|
4682
|
-
if (dmChain) {
|
|
4683
|
-
const label = dmChain[1];
|
|
4684
|
-
const ref = dmChain[2].trim();
|
|
4685
|
-
const existing = nodeDecls.find((d) => d.label === label);
|
|
4686
|
-
if (existing) existing.ref = ref || existing.ref;
|
|
4687
|
-
else nodeDecls.push({ label, ref });
|
|
4688
|
-
i++;
|
|
4689
|
-
const rest = dmChain[3].trim();
|
|
4690
|
-
const rawParts = rest.split("->").map((p) => p.trim()).filter((p) => p !== "");
|
|
4691
|
-
const parts = [];
|
|
4692
|
-
let pendingCond = null;
|
|
4693
|
-
for (const part of rawParts) {
|
|
4694
|
-
const ifMatch = part.match(/^if\s*\((.+)\)$/);
|
|
4695
|
-
if (ifMatch) {
|
|
4696
|
-
pendingCond = ifMatch[1].trim();
|
|
4697
|
-
} else {
|
|
4698
|
-
parts.push({ target: part, cond: pendingCond || "" });
|
|
4699
|
-
pendingCond = null;
|
|
4700
|
-
}
|
|
4701
|
-
}
|
|
4702
|
-
if (pendingCond) {
|
|
4703
|
-
rep.fail(
|
|
4704
|
-
`\u6761\u4EF6 "if (${pendingCond})" \u540E\u9762\u7F3A\u5C11\u76EE\u6807\u8282\u70B9`,
|
|
4705
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "flow" }
|
|
4706
|
-
);
|
|
4707
|
-
}
|
|
4708
|
-
let currentSrc = label;
|
|
4709
|
-
for (const { target, cond } of parts) {
|
|
4710
|
-
currentSrc = resolveTarget(currentSrc, target, cond);
|
|
4711
|
-
}
|
|
4712
|
-
currentNode = currentSrc;
|
|
4713
|
-
continue;
|
|
4714
|
-
}
|
|
4715
|
-
const chainMatch = text.match(/^\[(.+?)\]\s*->\s*(.*)$/);
|
|
4716
|
-
if (chainMatch) {
|
|
4717
|
-
const srcLabel = chainMatch[1];
|
|
4718
|
-
let rest = chainMatch[2];
|
|
4719
|
-
i++;
|
|
4720
|
-
if (!nodeDecls.some((d) => d.label === srcLabel)) {
|
|
4721
|
-
nodeDecls.push({ label: srcLabel, ref: "" });
|
|
4722
|
-
}
|
|
4723
|
-
const rawParts = rest.split("->").map((p) => p.trim()).filter((p) => p !== "");
|
|
4724
|
-
const parts = [];
|
|
4725
|
-
let pendingCond = null;
|
|
4726
|
-
for (const part of rawParts) {
|
|
4727
|
-
const ifMatch = part.match(/^if\s*\((.+)\)$/);
|
|
4728
|
-
if (ifMatch) {
|
|
4729
|
-
pendingCond = ifMatch[1].trim();
|
|
4730
|
-
} else {
|
|
4731
|
-
parts.push({ target: part, cond: pendingCond || "" });
|
|
4732
|
-
pendingCond = null;
|
|
4733
|
-
}
|
|
4734
|
-
}
|
|
4735
|
-
if (pendingCond) {
|
|
4736
|
-
rep.fail(
|
|
4737
|
-
`\u6761\u4EF6 "if (${pendingCond})" \u540E\u9762\u7F3A\u5C11\u76EE\u6807\u8282\u70B9`,
|
|
4738
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "flow" }
|
|
4739
|
-
);
|
|
4740
|
-
}
|
|
4741
|
-
let currentSrc = srcLabel;
|
|
4742
|
-
for (const { target, cond } of parts) {
|
|
4743
|
-
currentSrc = resolveTarget(currentSrc, target, cond);
|
|
4744
|
-
}
|
|
4745
|
-
currentNode = currentSrc;
|
|
4746
|
-
continue;
|
|
4747
|
-
}
|
|
4748
|
-
const soloNodeMatch = text.match(/^\[(.+?)\]\s*$/);
|
|
4749
|
-
if (soloNodeMatch && !text.includes("->") && !text.includes(":")) {
|
|
4750
|
-
ensureNodeForRef(`[${soloNodeMatch[1]}]`);
|
|
4751
|
-
i++;
|
|
4752
|
-
continue;
|
|
4753
|
-
}
|
|
4754
|
-
const dm = text.match(/^\[(.+?)\]:\s*(.*)$/);
|
|
4755
|
-
if (dm) {
|
|
4756
|
-
const label = dm[1];
|
|
4757
|
-
const ref = dm[2].trim();
|
|
4758
|
-
const existing = nodeDecls.find((d) => d.label === label);
|
|
4759
|
-
if (existing) existing.ref = ref || existing.ref;
|
|
4760
|
-
else nodeDecls.push({ label, ref });
|
|
4761
|
-
currentNode = label;
|
|
4762
|
-
i++;
|
|
4763
|
-
continue;
|
|
4764
|
-
}
|
|
4765
|
-
rep.fail(
|
|
4766
|
-
`\u672A\u8BC6\u522B\u7684\u6D41\u7A0B\u8BED\u6CD5: "${text}"`,
|
|
4767
|
-
{ line: cl.lineNum + 1, lineText: cl.raw || cl.text, where: "flow" }
|
|
4768
|
-
);
|
|
4769
|
-
}
|
|
4770
|
-
return { nodeDecls, edges };
|
|
4771
|
-
}
|
|
4772
|
-
export {
|
|
4773
|
-
THINKING_LEVELS,
|
|
4774
|
-
extractHashSketch,
|
|
4775
|
-
normalizeSymbols,
|
|
4776
|
-
parseActionBlock,
|
|
4777
|
-
parseActorsBlock,
|
|
4778
|
-
parseCodeBlock,
|
|
4779
|
-
parseFEMO,
|
|
4780
|
-
parseFlowSection,
|
|
4781
|
-
parseMainflowBlock,
|
|
4782
|
-
parseMemoryOrContextBlock,
|
|
4783
|
-
parseMetaBlock,
|
|
4784
|
-
parseModuleBlock,
|
|
4785
|
-
parseVarsBlock,
|
|
4786
|
-
splitTopBlocks,
|
|
4787
|
-
stripComments,
|
|
4788
|
-
stripLineComments
|
|
4789
|
-
};
|
|
4790
|
-
/*! Bundled license information:
|
|
4791
|
-
|
|
4792
|
-
react/cjs/react.development.js:
|
|
4793
|
-
(**
|
|
4794
|
-
* @license React
|
|
4795
|
-
* react.development.js
|
|
4796
|
-
*
|
|
4797
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4798
|
-
*
|
|
4799
|
-
* This source code is licensed under the MIT license found in the
|
|
4800
|
-
* LICENSE file in the root directory of this source tree.
|
|
4801
|
-
*)
|
|
4802
|
-
|
|
4803
|
-
react/cjs/react-jsx-runtime.development.js:
|
|
4804
|
-
(**
|
|
4805
|
-
* @license React
|
|
4806
|
-
* react-jsx-runtime.development.js
|
|
4807
|
-
*
|
|
4808
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4809
|
-
*
|
|
4810
|
-
* This source code is licensed under the MIT license found in the
|
|
4811
|
-
* LICENSE file in the root directory of this source tree.
|
|
4812
|
-
*)
|
|
4813
|
-
*/
|