@kern0x1b/penstock-cli 26.11.0 → 26.11.2
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/THIRD-PARTY-NOTICES.md +16 -16
- package/dist/chunk-account-BaYNvO18.js +1 -0
- package/dist/{chunk-agentLaunch-D21uPuMr.js → chunk-agentLaunch-BnrpVME4.js} +1 -1
- package/dist/chunk-agentServe-BeOh1rjE.js +10 -0
- package/dist/chunk-agents-CZJoU2u2.js +1 -0
- package/dist/chunk-agentsMigrate-DnrqoXNz.js +2 -0
- package/dist/{chunk-analyze-BG-rlggA.js → chunk-analyze-ClE2LBCj.js} +1 -1
- package/dist/chunk-analyze-DgQqzEgb.js +1 -0
- package/dist/{chunk-analyzeFlow-2cYPgjh-.js → chunk-analyzeFlow-F2ZFmJhv.js} +1 -1
- package/dist/chunk-apiTemplates-Cl_z63FA.js +1 -0
- package/dist/{chunk-bot-DlhStBoG.js → chunk-bot-C2k8yaXA.js} +5 -5
- package/dist/chunk-cmmnFindings-DKpYqUZN.js +1 -0
- package/dist/{chunk-codeFactSet-LxSnQy8K.js → chunk-codeFactSet-DiAYqvbb.js} +1 -1
- package/dist/{chunk-codeIndex-N1gnP_sW.js → chunk-codeIndex-vStNh6Bm.js} +1 -1
- package/dist/chunk-codeLinks-BVpn4_Sr.js +1 -0
- package/dist/chunk-codeLinks-BrGduhsm.js +1 -0
- package/dist/chunk-command-8s6m3ZUw.js +5 -0
- package/dist/chunk-command-aMxPQdiV.js +1 -0
- package/dist/chunk-command-vH1_y5F0.js +1 -0
- package/dist/chunk-commands-B8YVT41b.js +5 -0
- package/dist/{chunk-commands-DcjlDt7B.js → chunk-commands-CJCSznbv.js} +1 -1
- package/dist/chunk-compose-BUJTvoFX.js +4 -0
- package/dist/chunk-connections-Drr67X9U.js +1 -0
- package/dist/chunk-connectors-DcMqy0u8.js +1 -0
- package/dist/chunk-convert-Ce1MZmsE.js +3 -0
- package/dist/chunk-convert-FkMnlxyi.js +1 -0
- package/dist/chunk-deploy-BHg8pB9x.js +1 -0
- package/dist/chunk-deploy-DZgCTgaY.js +6 -0
- package/dist/{chunk-diagrams-BukAOL0g.js → chunk-diagrams-CtGMGTa8.js} +1 -1
- package/dist/chunk-diff-9hjavV6V.js +1 -0
- package/dist/chunk-diff-Dp3fUALc.js +1 -0
- package/dist/chunk-dispatch-o-eqJb9Y.js +7 -0
- package/dist/chunk-dmnTests-BOxutoRs.js +1 -0
- package/dist/{chunk-dmnTests-ChwX1YVo.js → chunk-dmnTests-BzNA-u2k.js} +1 -1
- package/dist/{chunk-docs-D7yEDpa4.js → chunk-docs-B3C3pZpY.js} +17 -17
- package/dist/chunk-doctor-CRxbsAm7.js +1 -0
- package/dist/{chunk-editPreview-CC2vwhIW.js → chunk-editPreview-DCUnMkTU.js} +1 -1
- package/dist/chunk-evidence-ny_2ltVe.js +23 -0
- package/dist/{chunk-examples-0HkF-frb.js → chunk-examples-BG0lGXcZ.js} +9 -9
- package/dist/chunk-export-Blwjf23H.js +1 -0
- package/dist/chunk-export-kt3sBTZu.js +20 -0
- package/dist/{chunk-facts-DSVaURw5.js → chunk-facts-Dl5lLriU.js} +1 -1
- package/dist/chunk-failure-BRyRvObj.js +1 -0
- package/dist/{chunk-file-BswMa3FN.js → chunk-file-1YhfNmPn.js} +1 -1
- package/dist/chunk-import-Dh3az4BC.js +6 -0
- package/dist/chunk-importCommand-Dhikkmo0.js +1 -0
- package/dist/chunk-incident-LJe2-ohi.js +1 -0
- package/dist/chunk-init-D34Q4YA8.js +227 -0
- package/dist/chunk-lint-CnEhoYRB.js +1 -0
- package/dist/{chunk-lsp-7vA_mIt1.js → chunk-lsp-BzeJkpmf.js} +1 -1
- package/dist/chunk-main-BZF-ErAx.js +1 -0
- package/dist/chunk-mcp-B_B9bet5.js +95 -0
- package/dist/{chunk-mcpLaunch-LyfmIF_Z.js → chunk-mcpLaunch-BS709697.js} +1 -1
- package/dist/chunk-migrate-DVfXC-iJ.js +1 -0
- package/dist/chunk-migrate-DwWg0k5_.js +16 -0
- package/dist/{chunk-migrateApply-CzOkgKhB.js → chunk-migrateApply-e8O9oZXP.js} +3 -3
- package/dist/chunk-migrateVerify-oIBf-PM3.js +1 -0
- package/dist/{chunk-model-f8AzYUK7.js → chunk-model-BulEKnY1.js} +2 -2
- package/dist/{chunk-parse-B-uKGDy-.js → chunk-parse-DiOcpdOU.js} +1 -1
- package/dist/{chunk-penstockCli-CKMvaZ0O.js → chunk-penstockCli-C41P_G7i.js} +1 -1
- package/dist/chunk-policy-BVb7c7G_.js +1 -0
- package/dist/chunk-policyGate-BOgKsqLq.js +2 -0
- package/dist/chunk-pr-1jKcTNnP.js +1 -0
- package/dist/{chunk-project-DBYOlYRi.js → chunk-project-COaBZhMt.js} +1 -1
- package/dist/chunk-project-lO_6DX8G.js +1 -0
- package/dist/chunk-promotion-CTMPjXjZ.js +2 -0
- package/dist/chunk-promotion-DDLrgBqZ.js +1 -0
- package/dist/{chunk-promotion-DchO6xoC.js → chunk-promotion-NeRj4uTP.js} +1 -1
- package/dist/chunk-receipt-C4NqnSkH.js +1 -0
- package/dist/chunk-receiptDeps-B7MehyHT.js +1 -0
- package/dist/chunk-receiptGate-BZCKCMTV.js +1 -0
- package/dist/chunk-receiptGate-DRcw327y.js +1 -0
- package/dist/{chunk-receiptSnapshot-B6ruXw8z.js → chunk-receiptSnapshot-CHSk3_4N.js} +1 -1
- package/dist/{chunk-receiptStore-Cy-L0H1u.js → chunk-receiptStore-DhROtI2h.js} +1 -1
- package/dist/chunk-refactor-CO3qyIEv.js +17 -0
- package/dist/chunk-refactor-CWeCOl7w.js +1 -0
- package/dist/{chunk-render-Ci5d6mg4.js → chunk-render-DZd5hScS.js} +1 -1
- package/dist/chunk-report-w7YZwhyg.js +1 -0
- package/dist/chunk-review-DYMgFDSy.js +1 -0
- package/dist/chunk-say-CP1IyOSv.js +1 -0
- package/dist/{chunk-security-VgKwtohm.js → chunk-security-pgip-kdY.js} +2 -2
- package/dist/chunk-serve-CKt2rO05.js +10 -0
- package/dist/{chunk-share-CBV2FuKq.js → chunk-share-rsL0itIM.js} +18 -18
- package/dist/chunk-stages-B2sBBxUc.js +3 -0
- package/dist/chunk-systemError-O3vQ8hLb.js +1 -0
- package/dist/chunk-systemError-n2E6isvg.js +1 -0
- package/dist/chunk-taskTest-DWoME1mY.js +2 -0
- package/dist/chunk-taskTest-JErgWO6t.js +1 -0
- package/dist/{chunk-templateDiagnostics-BwH7RNkz.js → chunk-templateDiagnostics-6txfKwas.js} +2 -2
- package/dist/chunk-templates-Y3xfCO_3.js +1 -0
- package/dist/chunk-testCases-BwimUfDC.js +4 -0
- package/dist/chunk-testCases-DO2Rkyvd.js +1 -0
- package/dist/chunk-tests-Cy325OGw.js +1 -0
- package/dist/chunk-tests-DNkORsqB.js +23 -0
- package/dist/{chunk-trust-DXcsUJaK.js → chunk-trust-DSX-k3by.js} +1 -1
- package/dist/{chunk-trust-DubjEjlN.js → chunk-trust-Di4EYPah.js} +1 -1
- package/dist/{chunk-variableChecks-KnECGMR3.js → chunk-variableChecks-CBDpmI4d.js} +1 -1
- package/dist/{chunk-workerVariables-CajAcbwl.js → chunk-workerVariables-CNnCRijJ.js} +1 -1
- package/dist/{chunk-workerVariables-DIDoUpHF.js → chunk-workerVariables-CulLc3YH.js} +1 -1
- package/dist/chunk-wrapper-CGYED7G2.js +1 -0
- package/dist/chunk-wrapper-CK7Xtes6.js +3 -0
- package/dist/grammars/web-tree-sitter.wasm +0 -0
- package/dist/penstock.js +1 -1
- package/dist/web/assets/{AgentSettings-Cn5Vcph3.js → AgentSettings-D24jOuht.js} +1 -1
- package/dist/web/assets/{AgentsDialog-C6WqzlxZ.js → AgentsDialog-BMWv3Gyk.js} +1 -1
- package/dist/web/assets/{AgentsDialog-dpbwVSxk.js → AgentsDialog-DbY2O6O5.js} +1 -1
- package/dist/web/assets/{AgentsTab-C34OhVkw.js → AgentsTab-D6LbK6sG.js} +2 -2
- package/dist/web/assets/{BpmnCanvas-yur9daZa.js → BpmnCanvas-BcQRQ2Br.js} +27 -27
- package/dist/web/assets/BpmnDocument-Ce5F4K1e.js +27 -0
- package/dist/web/assets/CmmnDocument-C_UlPowC.js +17 -0
- package/dist/web/assets/{ConflictDialog-Bb5kduaR.js → ConflictDialog-DfFp8F7n.js} +1 -1
- package/dist/web/assets/{ConnectionsDialog-qtF7yDFw.js → ConnectionsDialog-BaYtHD5h.js} +1 -1
- package/dist/web/assets/{DiffDocument-LHOif5Ac.js → DiffDocument-BOPdBEN3.js} +1 -1
- package/dist/web/assets/{DmnDocument-0f5uS67x.css → DmnDocument-DZ9u2uk2.css} +1 -1
- package/dist/web/assets/DmnDocument-vtnARy7Q.js +41 -0
- package/dist/web/assets/{DriftDialog-Chl6BX6k.js → DriftDialog-dIbCbSK2.js} +1 -1
- package/dist/web/assets/FormDocument-B0q8DF9v.css +1 -0
- package/dist/web/assets/FormDocument-DHBUBUzO.js +32 -0
- package/dist/web/assets/FormStepView-CbHb32_8.js +1 -0
- package/dist/web/assets/{GraphAwareLayoutService-wsos3yPD.js → GraphAwareLayoutService-C5N8K9dm.js} +1 -1
- package/dist/web/assets/{MigrationDialog-CBJU7Oe3.js → MigrationDialog-DA3Vrzgw.js} +1 -1
- package/dist/web/assets/{NewFileDialog-B7075LWG.js → NewFileDialog-Dev41oA1.js} +1 -1
- package/dist/web/assets/PolicyDialog-qR19Csji.js +1 -0
- package/dist/web/assets/{QuickOpen-DJQrI7Od.js → QuickOpen-ps-rMjiS.js} +1 -1
- package/dist/web/assets/ScriptPane-BQLMNYzc.js +2 -0
- package/dist/web/assets/{ScriptRunDialog-BwE4cXnp.js → ScriptRunDialog-YivjHB6j.js} +1 -1
- package/dist/web/assets/{SettingsDialog-c307wPsg.js → SettingsDialog-DI0vZ6Ay.js} +1 -1
- package/dist/web/assets/ShortcutsDialog-DLXnv4Vm.js +1 -0
- package/dist/web/assets/SourceDocument-Cj8cGsoS.js +1 -0
- package/dist/web/assets/TemplateDocument-BRyFsofH.js +7 -0
- package/dist/web/assets/TextDocument-DB2hEuMA.js +1 -0
- package/dist/web/assets/{UnreadableFileLayer-CUP_30X8.js → UnreadableFileLayer-CRW3MM7w.js} +1 -1
- package/dist/web/assets/{UploadDialog-CaVBOxUL.js → UploadDialog-D-X6GG98.js} +1 -1
- package/dist/web/assets/Viewer-BcpDlvg_.js +4 -0
- package/dist/web/assets/apply-Nsj6ek02.js +1 -0
- package/dist/web/assets/{bpmnTheme-CZ7xp4R5.js → bpmnTheme-pKgl9Mrn.js} +2 -2
- package/dist/web/assets/{data-ZauKnQ2Z.js → data-CdiToGOq.js} +2 -2
- package/dist/web/assets/{data-Da5Nxzev.js → data-wU6sw6RY.js} +1 -1
- package/dist/web/assets/{dialog-DSLu1Bbo.js → dialog-BDJ5dDiU.js} +1 -1
- package/dist/web/assets/{diff-C4hitkRR.js → diff-BhYqTg4l.js} +1 -1
- package/dist/web/assets/dist-27z6Phtg.js +23 -0
- package/dist/web/assets/{dist-CofBTWz1.js → dist-B7TL-7R3.js} +4 -4
- package/dist/web/assets/dist-BEpeEbIu.js +1 -0
- package/dist/web/assets/{dist-CYCbBoYQ.js → dist-BTf7NfeQ.js} +1 -1
- package/dist/web/assets/{dist-CJKVV2_S.js → dist-BqGv7f4M.js} +10 -10
- package/dist/web/assets/dist-C-q1IWjr.js +6 -0
- package/dist/web/assets/{dist-Blylfrak.js → dist-CJx_2eBF.js} +2 -2
- package/dist/web/assets/dist-COUY_jv5.js +1 -0
- package/dist/web/assets/{dist-DpDu6Wz_.js → dist-CWjAtsKe.js} +1 -1
- package/dist/web/assets/{dist-gb3IfUZi.js → dist-Cv8_A_95.js} +2 -2
- package/dist/web/assets/dist-DDE6BjgI.js +5 -0
- package/dist/web/assets/{dist-7VC_hKpw.js → dist-DDNYYQtV.js} +1 -1
- package/dist/web/assets/dist-DW-S9iZN.js +1 -0
- package/dist/web/assets/dist-OnU5n5o1.js +1 -0
- package/dist/web/assets/dmn-Cgoh6wXm.js +3 -0
- package/dist/web/assets/{documentBridge-1Eg7H9yI.js → documentBridge-CHw4XsZH.js} +3 -3
- package/dist/web/assets/{documents-LG-7CTrn.js → documents-CEtohzAC.js} +1 -1
- package/dist/web/assets/duplicate-D_ic-m62.js +342 -0
- package/dist/web/assets/{engines-DhO6OW1S.js → engines-lyEvb0pH.js} +1 -1
- package/dist/web/assets/{executable-BTarDLry.js → executable--4381_Lf.js} +1 -1
- package/dist/web/assets/{file-CIeVSOHy.js → file-BbVBUuIH.js} +1 -1
- package/dist/web/assets/formChecks-CSClH9sH.js +1 -0
- package/dist/web/assets/frontend-uXAWaalt.js +1 -0
- package/dist/web/assets/{httpHost-DBSjdVth.js → httpHost-C973OTRe.js} +1 -1
- package/dist/web/assets/{index.es-pigASDxC.js → index.es-CMvq8Bhe.js} +3 -3
- package/dist/web/assets/index.es-GbdJvMnO.js +78 -0
- package/dist/web/assets/{index.esm-CTLpq4ik.js → index.esm-Ba6q0zSu.js} +1 -1
- package/dist/web/assets/{intelligence-_1C71hkQ.js → intelligence-DNqJNmdB.js} +3 -3
- package/dist/web/assets/{jspdf.es.min-PgZzOmkT.js → jspdf.es.min-C0L4zezU.js} +6 -6
- package/dist/web/assets/{kind-X3_nabTt.js → kind-DDHnk6dW.js} +1 -1
- package/dist/web/assets/{lib-BmLAen_d.js → lib-DrkEMJ65.js} +1 -1
- package/dist/web/assets/{list-DovB9lWV.js → list-TmXvCwja.js} +1 -1
- package/dist/web/assets/{migrationHost-BcguK4K5.js → migrationHost-DCWBb3L6.js} +1 -1
- package/dist/web/assets/moddle-f0Q4Guwd.js +1 -0
- package/dist/web/assets/{model--Bj28IOj.js → model-afHgSxJs.js} +1 -1
- package/dist/web/assets/{nudges-UF9_cBuO.js → nudges-DPG3WpyV.js} +1 -1
- package/dist/web/assets/{open-C9Kt9JLw.js → open-Vkx72dYx.js} +1 -1
- package/dist/web/assets/platform-G53Cenyw.js +2 -0
- package/dist/web/assets/{preload-helper-VRuDKI9K.js → preload-helper-DExCAR_V.js} +1 -1
- package/dist/web/assets/{run-BZgz1U9U.js → run-BMfRBe5O.js} +1 -1
- package/dist/web/assets/samples-BL3jA_Vd.js +1 -0
- package/dist/web/assets/{say-WvEHqIbO.js → say-BkdZMivA.js} +1 -1
- package/dist/web/assets/{say-ChFGKK2E.js → say-C7KqKcFr.js} +1 -1
- package/dist/web/assets/{sections-N6WYk7b8.js → sections-LJKSRDTS.js} +1 -1
- package/dist/web/assets/sharedReader-BsXfiBT8.js +1 -0
- package/dist/web/assets/{source-frame-DcptKpVq.js → source-frame-DC4W0A5-.js} +2 -2
- package/dist/web/assets/{syntax-DW10Wzg4.js → syntax-00Hk6Xv7.js} +4 -4
- package/dist/web/assets/{template-CMl68jPp.js → template-BQP7ZXdK.js} +1 -1
- package/dist/web/assets/testCaseRuns-liAhWMg7.js +1 -0
- package/dist/web/assets/{trace-DLziNpe2.js → trace-DXQU2N_l.js} +1 -1
- package/dist/web/assets/{translator-DLDFsUlE.js → translator-BLCeE6UY.js} +1 -1
- package/dist/web/assets/ui-BLtm3Y1J.js +1 -0
- package/dist/web/assets/{useTrace-UYBskc2k.js → useTrace-dZdQ805W.js} +1 -1
- package/dist/web/assets/web-C4k0NLZ9.js +982 -0
- package/dist/web/assets/web-CnDpD6qy.css +1 -0
- package/dist/web/assets/{workerVariables-DURgyUbG.js → workerVariables-O6VqwDzr.js} +1 -1
- package/dist/web/assets/xml-DIWt4von.js +1 -0
- package/dist/web/index.html +39 -40
- package/package.json +5 -5
- package/dist/chunk-account-CpZu-RTg.js +0 -1
- package/dist/chunk-agentServe-BYRtgGGD.js +0 -10
- package/dist/chunk-agents-B9oxdPTA.js +0 -1
- package/dist/chunk-agentsMigrate-BV8TeRXq.js +0 -2
- package/dist/chunk-analyze-pgzR-Cx-.js +0 -1
- package/dist/chunk-apiTemplates-cU7C8vap.js +0 -1
- package/dist/chunk-cmmnFindings-S2TGSnEp.js +0 -1
- package/dist/chunk-codeLinks-C8N6e8k3.js +0 -1
- package/dist/chunk-codeLinks-o0a8tBGk.js +0 -1
- package/dist/chunk-command-Bqlbgo-2.js +0 -1
- package/dist/chunk-command-DT84ioJb.js +0 -5
- package/dist/chunk-command-DrGP2kg8.js +0 -1
- package/dist/chunk-commands-B4PoZbpX.js +0 -5
- package/dist/chunk-compose-CWKKVtN5.js +0 -4
- package/dist/chunk-connections-DQpKbIGD.js +0 -1
- package/dist/chunk-connectors-PtAvE91B.js +0 -1
- package/dist/chunk-convert-CpgtOlZk.js +0 -1
- package/dist/chunk-convert-HbFpg8ab.js +0 -3
- package/dist/chunk-deploy-l4MdFfn8.js +0 -6
- package/dist/chunk-deploy-qRaaKGZb.js +0 -1
- package/dist/chunk-diff-BhTFlCE3.js +0 -1
- package/dist/chunk-diff-kBF83vzM.js +0 -1
- package/dist/chunk-dispatch-BnO-QhMh.js +0 -7
- package/dist/chunk-dmnTests-0x_yUH6S.js +0 -1
- package/dist/chunk-doctor-BuHK1dTm.js +0 -1
- package/dist/chunk-evidence-oLw_C6j8.js +0 -23
- package/dist/chunk-export-cIFHDXug.js +0 -1
- package/dist/chunk-export-jBVxtmCH.js +0 -20
- package/dist/chunk-failure-D5brrYW2.js +0 -1
- package/dist/chunk-import-BBOe-5RZ.js +0 -6
- package/dist/chunk-importCommand-DRjYoljA.js +0 -1
- package/dist/chunk-incident-BK1h37CD.js +0 -1
- package/dist/chunk-init-_OALJuKm.js +0 -227
- package/dist/chunk-lint-7KJFxyCN.js +0 -1
- package/dist/chunk-main-Cw2JXCil.js +0 -1
- package/dist/chunk-mcp-K63bhqnF.js +0 -95
- package/dist/chunk-migrate-BMwBV5sc.js +0 -16
- package/dist/chunk-migrate-CxfVmKt0.js +0 -1
- package/dist/chunk-migrateVerify-DSEXSpfR.js +0 -1
- package/dist/chunk-policy-BX0Ftdws.js +0 -1
- package/dist/chunk-policyGate-dmcufnwB.js +0 -2
- package/dist/chunk-pr-ByrGcfam.js +0 -1
- package/dist/chunk-project-DA3KnAZH.js +0 -1
- package/dist/chunk-promotion-Boedyq43.js +0 -1
- package/dist/chunk-promotion-D8Ti-vxp.js +0 -2
- package/dist/chunk-receipt-CusJaqNn.js +0 -1
- package/dist/chunk-receiptDeps-oVbX156d.js +0 -1
- package/dist/chunk-receiptGate-DrGChj7i.js +0 -1
- package/dist/chunk-receiptGate-xldHKMyJ.js +0 -1
- package/dist/chunk-refactor-B1W_MGTp.js +0 -1
- package/dist/chunk-refactor-BJXxEtVs.js +0 -17
- package/dist/chunk-report-D9pM09Nu.js +0 -1
- package/dist/chunk-review-UcqS5AAi.js +0 -1
- package/dist/chunk-say-CYb4HeJD.js +0 -1
- package/dist/chunk-serve-Dmqen1yd.js +0 -10
- package/dist/chunk-stages-BTQJrAMF.js +0 -3
- package/dist/chunk-systemError-BYrMzp2o.js +0 -1
- package/dist/chunk-systemError-CXvnhNPK.js +0 -1
- package/dist/chunk-taskTest-9gMsx0zu.js +0 -2
- package/dist/chunk-taskTest-BjXYpG5p.js +0 -1
- package/dist/chunk-templates-D3ouIwHD.js +0 -1
- package/dist/chunk-testCases-9jwT_Y7z.js +0 -4
- package/dist/chunk-testCases-BcpBPg9L.js +0 -1
- package/dist/chunk-tests-CEEXnWOp.js +0 -23
- package/dist/chunk-tests-CRVosdWp.js +0 -1
- package/dist/chunk-wrapper-B2WnOIoB.js +0 -3
- package/dist/chunk-wrapper-DiKCKZti.js +0 -1
- package/dist/web/assets/BpmnDocument-C247Rqim.js +0 -27
- package/dist/web/assets/CmmnDocument-Dj48bsUd.js +0 -17
- package/dist/web/assets/DmnDocument-Cb9Zi9fS.js +0 -41
- package/dist/web/assets/FormDocument-DoZaxWd-.js +0 -32
- package/dist/web/assets/FormDocument-URLcKn84.css +0 -1
- package/dist/web/assets/FormStepView-D8MFcpeI.js +0 -1
- package/dist/web/assets/PolicyDialog-CGdglmDn.js +0 -1
- package/dist/web/assets/ScriptPane-T6M5f6fc.js +0 -2
- package/dist/web/assets/ShortcutsDialog-BAoL9EHu.js +0 -1
- package/dist/web/assets/SourceDocument-C9KIzBA5.js +0 -1
- package/dist/web/assets/TemplateDocument-CNt2turg.js +0 -7
- package/dist/web/assets/TextDocument-CtkHoEqN.js +0 -1
- package/dist/web/assets/Viewer-DZske1C5.js +0 -4
- package/dist/web/assets/apply-nnKP9HIM.js +0 -1
- package/dist/web/assets/dist--PmHUHDp.js +0 -1
- package/dist/web/assets/dist-BoPrKCf2.js +0 -5
- package/dist/web/assets/dist-C1m02xAO.js +0 -1
- package/dist/web/assets/dist-CLqJMzT-.js +0 -1
- package/dist/web/assets/dist-D3jqq0XS.js +0 -1
- package/dist/web/assets/dist-DA-9F0U9.js +0 -1
- package/dist/web/assets/dist-DojzF5q2.js +0 -6
- package/dist/web/assets/dist-yvjzrXXf.js +0 -23
- package/dist/web/assets/dmn-DwdcYXGr.js +0 -3
- package/dist/web/assets/duplicate-D-ilQqKz.js +0 -342
- package/dist/web/assets/formChecks-CGox1z7R.js +0 -1
- package/dist/web/assets/frontend-Qq5hBH0U.js +0 -1
- package/dist/web/assets/index.es-CcNNw3VB.js +0 -78
- package/dist/web/assets/moddle-DJxj0oEU.js +0 -1
- package/dist/web/assets/platform-BLPhsye9.js +0 -2
- package/dist/web/assets/samples-oeXBsJ9Y.js +0 -1
- package/dist/web/assets/sharedReader-Bopy7Uk9.js +0 -1
- package/dist/web/assets/testCaseRuns-B_XdqGFh.js +0 -1
- package/dist/web/assets/ui-BTKMbWYG.js +0 -1
- package/dist/web/assets/web-FzNBw1kZ.css +0 -1
- package/dist/web/assets/web-jPMZVwbQ.js +0 -982
- package/dist/web/assets/xml-DTgZ-B-l.js +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{r as e}from"./chunk-translator-DNm9zRpP.js";import{a as t,i as n,o as r,r as i,s as a,t as o}from"./chunk-xml-rMelkRIV.js";import{n as s,r as c}from"./chunk-juel-CgGCf_MV.js";import{i as l,r as u,t as d}from"./chunk-catalog-CXJ23e-I.js";import{t as f}from"./chunk-own-Cn7Ki4ij.js";import{Inflate as p,strFromU8 as m,unzipSync as h}from"fflate";function g(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function _(e,t){return t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height}function v(e){return e.width*e.height}function y(e,t){let n=Math.max(e.x-t.x,0,t.x-(e.x+e.width)),r=Math.max(e.y-t.y,0,t.y-(e.y+e.height));return Math.hypot(n,r)}const b=/* @__PURE__ */ new Set([`startEvent`,`endEvent`,`intermediateCatchEvent`,`intermediateThrowEvent`,`boundaryEvent`]);function x(e){return b.has(e.kind)}function S(e){return e.kind.endsWith(`Gateway`)}function C(e,t){let n=g(e),r=t.x-n.x,i=t.y-n.y;if(r===0&&i===0)return n;let a;return a=x(e)?Math.min(e.width,e.height)/2/Math.hypot(r,i):S(e)?1/(Math.abs(r)/(e.width/2)+Math.abs(i)/(e.height/2)):Math.min(r===0?1/0:e.width/2/Math.abs(r),i===0?1/0:e.height/2/Math.abs(i)),{x:n.x+r*a,y:n.y+i*a}}function ee(e,t){let n=g(e),r=g(t),i=(e,t,n,r)=>{let i={x:e.x+e.width,y:n.y},a={x:t.x,y:r.y};if(Math.abs(n.y-r.y)<1)return[i,{x:a.x,y:i.y}];let o=(i.x+a.x)/2;return[i,{x:o,y:i.y},{x:o,y:a.y},a]},a=(e,t,n,r)=>{let i={x:n.x,y:e.y+e.height},a={x:r.x,y:t.y};if(Math.abs(n.x-r.x)<1)return[i,{x:i.x,y:a.y}];let o=(i.y+a.y)/2;return[i,{x:i.x,y:o},{x:a.x,y:o},a]};return t.x>=e.x+e.width?i(e,t,n,r):e.x>=t.x+t.width?i(t,e,r,n).reverse():t.y>=e.y+e.height?a(e,t,n,r):e.y>=t.y+t.height?a(t,e,r,n).reverse():null}function w(e){let t=e.filter(e=>e.kind===`pool`);for(let e of t)t.some(t=>t!==e&&_(t,g(e))&&v(t)>v(e))&&(e.kind=`lane`)}const te=/* @__PURE__ */ new Set([`subProcess`,`transaction`,`eventSubProcess`]),ne=/* @__PURE__ */ new Set([`task`,`callActivity`,`subProcess`,`transaction`,`eventSubProcess`]),re=/* @__PURE__ */ new Set([`pool`,`lane`,`subProcess`,`transaction`,`eventSubProcess`]),ie=/* @__PURE__ */ new Set([`dataObject`,`dataStore`]),ae=/* @__PURE__ */ new Set([`startEvent`,`endEvent`,`intermediateCatchEvent`,`intermediateThrowEvent`,`boundaryEvent`]),oe={task:`task`,user:`userTask`,service:`serviceTask`,script:`scriptTask`,send:`sendTask`,receive:`receiveTask`,manual:`manualTask`,businessRule:`businessRuleTask`},se={message:`messageEventDefinition`,timer:`timerEventDefinition`,error:`errorEventDefinition`,escalation:`escalationEventDefinition`,signal:`signalEventDefinition`,conditional:`conditionalEventDefinition`,link:`linkEventDefinition`,compensation:`compensateEventDefinition`,cancel:`cancelEventDefinition`,terminate:`terminateEventDefinition`},ce={task:`Activity`,callActivity:`Activity`,subProcess:`Activity`,transaction:`Activity`,eventSubProcess:`Activity`,startEvent:`Event`,endEvent:`Event`,intermediateCatchEvent:`Event`,intermediateThrowEvent:`Event`,boundaryEvent:`Event`,exclusiveGateway:`Gateway`,parallelGateway:`Gateway`,inclusiveGateway:`Gateway`,complexGateway:`Gateway`,eventBasedGateway:`Gateway`,dataObject:`DataObjectReference`,dataStore:`DataStoreReference`,textAnnotation:`TextAnnotation`,pool:`Participant`,lane:`Lane`};function le(e){return n(e).replace(/\r/g,``).replace(/\n/g,` `).replace(/\t/g,`	`)}function T(e,t,n=``){let r=Object.entries(t).filter(e=>e[1]!==void 0).map(([e,t])=>` ${e}="${le(t)}"`).join(``);return n?`<bpmn:${e}${r}>${n}</bpmn:${e}>`:`<bpmn:${e}${r}/>`}function ue(e){return e?.trim()?`<bpmn:documentation>${i(e.trim())}</bpmn:documentation>`:``}function E(e){return String(Math.round(e))}function de(t){let n=[...t.notes],r=(e,t)=>n.push({level:e,message:t}),a=/* @__PURE__ */ new Set,o=(e,t)=>{let n=`${e}_${t.replace(/[^A-Za-z0-9_.-]/g,`_`)||`1`}`,r=n;for(let e=2;a.has(r);e+=1)r=`${n}_${e}`;return a.add(r),r},s=e=>e.name.replace(/\s+$/g,``),c=t=>t.name.trim()?`"${t.name.replace(/\s+/g,` `).trim()}"`:e(`app.import.note.unnamed`,{kind:e(`app.import.kind.${t.kind}`)}),l=t.nodes.map(e=>({...e,bpmnId:``})),u=new Map(l.map(e=>[e.id,e]));for(let t of l)t.kind===`lane`&&!l.some(e=>e!==t&&(e.kind===`pool`||e.kind===`lane`)&&_(e,g(t))&&v(e)>v(t))&&!(t.parent&&u.get(t.parent)?.kind===`pool`)&&(t.kind=`pool`,r(`assumed`,e(`app.import.note.laneAsPool`,{node:c(t)})));let d=l.filter(e=>re.has(e.kind)),f=e=>{if(e.kind===`pool`)return;let t=e.parent?u.get(e.parent):void 0,n=t=>t===e||!re.has(t.kind)?!1:e.kind!==`lane`||t.kind===`pool`||t.kind===`lane`;if(t&&n(t)&&v(t)>v(e))return t;let r=g(e);return d.filter(t=>n(t)&&_(t,r)&&(!re.has(e.kind)||v(t)>v(e))).sort((e,t)=>v(e)-v(t))[0]};for(let e of l)e.owner=f(e);let p=l.filter(e=>ne.has(e.kind));for(let t of l){if(t.kind!==`boundaryEvent`)continue;let n=t.host?u.get(t.host):void 0,i=g(t),a=p.filter(e=>e!==t).map(e=>({candidate:e,distance:y(e,i)})).filter(e=>e.distance<=25).sort((e,t)=>e.distance-t.distance)[0],o=n&&ne.has(n.kind)?n:a?.candidate;o?(t.hostNode=o,t.owner=o.owner):(t.kind=`intermediateCatchEvent`,r(`assumed`,e(`app.import.note.boundaryEvent`,{node:c(t)})))}let m=e=>{for(let t=e;t;t=t.owner)if(t.kind===`pool`)return t},h=l.filter(e=>e.kind===`pool`);if(h.length>0){let t=[];for(let e of l){if(e.kind===`pool`||m(e))continue;let n=h.map(t=>({pool:t,distance:y(t,g(e))})).sort((e,t)=>e.distance-t.distance)[0].pool;e.owner=e.kind===`lane`?n:e.owner??n,e.kind!==`lane`&&e.owner&&e.owner!==n||t.push(e)}if(t.length>0){let n=t.slice(0,5).map(c).join(`, `);r(`assumed`,e(`app.import.note.outsidePools`,{count:t.length,names:`${n}${t.length>5?`, ...`:``}`}))}}let b=e=>{let t=e.owner;return t?.kind===`lane`?t:void 0},x=e=>{for(let t=e.owner;t;t=t.owner)if(t.kind===`pool`||te.has(t.kind))return t};for(let e of l)e.bpmnId=o(e.kind===`pool`?`Participant`:e.kind===`lane`?`Lane`:ce[e.kind]??`Element`,e.id);let S=[],w=t=>t.name.trim()?`"${t.name.replace(/\s+/g,` `).trim()}"`:e(`app.import.unnamedConnector`);for(let n of t.flows){let t=u.get(n.source),i=u.get(n.target);if(!t||!i){r(`unmapped`,e(`app.import.note.flowNotAttached`,{flow:w(n)}));continue}if(t.kind===`lane`||i.kind===`lane`){r(`unmapped`,e(`app.import.note.flowOnLane`,{flow:w(n)}));continue}let a=n.kind===`sequence`?`sequence`:n.kind===`message`?`message`:`association`,o=ie.has(t.kind),s=ie.has(i.kind);if(t.kind===`textAnnotation`||i.kind===`textAnnotation`)a=`association`;else if(o||s){let n=o?i:t,l=ae.has(n.kind),u=n.kind===`endEvent`||n.kind===`intermediateThrowEvent`,d=ne.has(n.kind)||l&&(o?u:!u);o&&s?a=`association`:d&&a!==`message`?a=o?`dataInput`:`dataOutput`:(a=`association`,r(`assumed`,e(`app.import.note.dataAssociation`,{node:c(n)})))}else if(t.kind===`pool`||i.kind===`pool`)a!==`message`&&r(`assumed`,e(`app.import.note.flowToPool`,{flow:w(n)})),a=`message`;else{let o=m(t)!==m(i);a===`sequence`&&o?(a=`message`,r(`assumed`,e(`app.import.note.flowAcrossPools`,{flow:w(n),from:c(t),to:c(i)}))):a===`message`&&!o?(a=`association`,r(`assumed`,e(`app.import.note.messageInsidePool`,{flow:w(n)}))):a===`sequence`&&x(t)!==x(i)&&(a=`association`,r(`assumed`,e(`app.import.note.flowAcrossSubProcess`,{flow:w(n)})))}S.push({flow:n,bpmnId:``,kind:a,source:t,target:i})}for(let e of S){let t={sequence:`Flow`,message:`Flow`,association:`Association`,dataInput:`DataInputAssociation`,dataOutput:`DataOutputAssociation`}[e.kind];if(e.bpmnId=o(t,e.flow.id),e.kind===`sequence`)e.container=x(e.source);else if(e.kind===`association`){let t=x(e.source);e.container=t===x(e.target)?t:void 0}}let de=/* @__PURE__ */ new Map,fe=/* @__PURE__ */ new Map;for(let e of S)e.kind===`sequence`&&e.flow.isDefault&&fe.set(e.source,e);let pe=e=>l.filter(t=>x(t)===e&&t.kind!==`pool`&&t.kind!==`lane`),D=t=>{if(!t.definition)return``;let n=se[t.definition];return n?t.definition===`conditional`?`<bpmn:conditionalEventDefinition><bpmn:condition xsi:type="bpmn:tFormalExpression"/></bpmn:conditionalEventDefinition>`:t.definition===`link`?T(n,{name:t.name.trim()||`link`}):T(n,{}):(r(`lost`,e(`app.import.note.multipleEvent`,{node:c(t),kind:t.definition===`multiple`?`multiple`:e(`app.import.parallelMultiple`)})),``)},O=e=>e.loop===`standard`?`<bpmn:standardLoopCharacteristics/>`:e.loop===`parallel`?`<bpmn:multiInstanceLoopCharacteristics/>`:e.loop===`sequential`?`<bpmn:multiInstanceLoopCharacteristics isSequential="true"/>`:``,k=e=>{let t=S.filter(t=>t.kind===`dataInput`&&t.target===e||t.kind===`dataOutput`&&t.source===e),n=S.filter(t=>t.kind===`dataInput`&&t.target===e),r=S.filter(t=>t.kind===`dataOutput`&&t.source===e);if(t.length===0)return``;let i=n.length>0?o(`Property`,e.id):``;return i&&de.set(e.id,i),(i?`<bpmn:property id="${i}" name="__targetRef_placeholder"/>`:``)+n.map(e=>`<bpmn:dataInputAssociation id="${e.bpmnId}"><bpmn:sourceRef>${e.source.bpmnId}</bpmn:sourceRef><bpmn:targetRef>${i}</bpmn:targetRef></bpmn:dataInputAssociation>`).join(``)+r.map(e=>`<bpmn:dataOutputAssociation id="${e.bpmnId}"><bpmn:targetRef>${e.target.bpmnId}</bpmn:targetRef></bpmn:dataOutputAssociation>`).join(``)},me=e=>{let t={id:e.bpmnId,name:s(e)||void 0},n=fe.get(e),r=n?{...t,default:n.bpmnId}:t,i=ue(e.documentation);switch(e.kind){case`task`:return T(oe[e.taskType??`task`],r,i+k(e)+O(e));case`callActivity`:return T(`callActivity`,r,i+k(e)+O(e));case`subProcess`:case`transaction`:case`eventSubProcess`:return T(e.kind===`transaction`?`transaction`:`subProcess`,{...r,triggeredByEvent:e.kind===`eventSubProcess`?`true`:void 0},i+k(e)+O(e)+A(e));case`startEvent`:return T(`startEvent`,{...t,isInterrupting:e.interrupting===!1?`false`:void 0},i+k(e)+D(e));case`endEvent`:return T(`endEvent`,t,i+k(e)+D(e));case`intermediateCatchEvent`:return T(`intermediateCatchEvent`,t,i+k(e)+D(e));case`intermediateThrowEvent`:return T(`intermediateThrowEvent`,t,i+k(e)+D(e));case`boundaryEvent`:return T(`boundaryEvent`,{...t,cancelActivity:e.interrupting===!1?`false`:void 0,attachedToRef:e.hostNode?.bpmnId},i+k(e)+D(e));case`exclusiveGateway`:case`parallelGateway`:case`inclusiveGateway`:case`complexGateway`:case`eventBasedGateway`:return T(e.kind,r,i);case`dataObject`:return`${T(`dataObject`,{id:`${e.bpmnId}_object`})}${T(`dataObjectReference`,{...t,dataObjectRef:`${e.bpmnId}_object`},``)}`;case`dataStore`:return T(`dataStoreReference`,t,i);default:return``}},he=e=>{let t=pe(e).filter(e=>e.kind===`textAnnotation`),n=S.filter(t=>t.kind===`association`&&t.container===e);return t.map(e=>T(`textAnnotation`,{id:e.bpmnId},`<bpmn:text>${i(e.name.trim())}</bpmn:text>`)).join(``)+n.map(e=>T(`association`,{id:e.bpmnId,sourceRef:e.source.bpmnId,targetRef:e.target.bpmnId})).join(``)},ge=e=>{let t=pe(e).filter(e=>e.kind!==`textAnnotation`),n=S.filter(t=>t.kind===`sequence`&&t.container===e);return t.map(me).join(``)+n.map(e=>T(`sequenceFlow`,{id:e.bpmnId,name:e.flow.name.trim()||void 0,sourceRef:e.source.bpmnId,targetRef:e.target.bpmnId})).join(``)};function A(e){return ge(e)+he(e)}let j=e=>{let t=e=>l.filter(t=>t.kind===`lane`&&t.owner===e).map(e=>{let n=l.filter(t=>b(t)===e&&t.kind!==`textAnnotation`&&t.kind!==`pool`&&t.kind!==`lane`&&!ie.has(t.kind)).map(e=>`<bpmn:flowNodeRef>${e.bpmnId}</bpmn:flowNodeRef>`).join(``),r=t(e);return T(`lane`,{id:e.bpmnId,name:s(e)||void 0},n+(r?`<bpmn:childLaneSet id="${e.bpmnId}_children">${r}</bpmn:childLaneSet>`:``))}).join(``),n=t(e);return n?`<bpmn:laneSet id="${e.bpmnId}_lanes">${n}</bpmn:laneSet>`:``},_e=h.length>0,ve=/* @__PURE__ */ new Map,M=``,N=``;if(_e){N=o(`Collaboration`,`1`);let e=[];for(let t of h)if(l.some(e=>e!==t&&m(e)===t&&e.kind!==`lane`)||l.some(e=>e.kind===`lane`&&m(e)===t)){let n=o(`Process`,t.id);ve.set(t,n),e.push(T(`participant`,{id:t.bpmnId,name:s(t)||void 0,processRef:n})),M+=T(`process`,{id:n,isExecutable:`false`},ue(t.documentation)+j(t)+A(t))}else e.push(T(`participant`,{id:t.bpmnId,name:s(t)||void 0}));let t=S.filter(e=>e.kind===`message`).map(e=>T(`messageFlow`,{id:e.bpmnId,name:e.flow.name.trim()||void 0,sourceRef:e.source.bpmnId,targetRef:e.target.bpmnId})).join(``),n=S.filter(e=>e.kind===`association`&&!e.container).map(e=>T(`association`,{id:e.bpmnId,sourceRef:e.source.bpmnId,targetRef:e.target.bpmnId})).join(``);M=T(`collaboration`,{id:N},e.join(``)+t+n)+M}else{let e=o(`Process`,`1`);ve.set(void 0,e),N=e,M=T(`process`,{id:e,isExecutable:`false`},A(void 0))}let ye=e=>e.kind===`pool`?0:e.kind===`lane`?1:te.has(e.kind)?2:3,be=e=>l.some(t=>t.owner===e),xe=[...l].sort((e,t)=>ye(e)-ye(t)).map(e=>{let t={id:`${e.bpmnId}_di`,bpmnElement:e.bpmnId};(e.kind===`pool`||e.kind===`lane`)&&(t.isHorizontal=e.horizontal===!1?`false`:`true`),te.has(e.kind)&&(t.isExpanded=be(e)?`true`:`false`),e.kind===`exclusiveGateway`&&(t.isMarkerVisible=`true`);let n=`<dc:Bounds x="${E(e.x)}" y="${E(e.y)}" width="${E(e.width)}" height="${E(e.height)}"/>`;return`<bpmndi:BPMNShape${Object.entries(t).filter(e=>e[1]!==void 0).map(([e,t])=>` ${e}="${le(t)}"`).join(``)}>${n}</bpmndi:BPMNShape>`}).join(``),P=e=>{let{source:t,target:n,flow:r}=e,i=r.points??[];if(i.length===0&&r.orthogonal){let e=ee(t,n);if(e)return e}let a=C(t,i[0]??g(n)),o=C(n,i[i.length-1]??g(t));return[a,...i,o]},F=S.map(e=>{let t=P(e).map(e=>`<di:waypoint x="${E(e.x)}" y="${E(e.y)}"/>`).join(``);return`<bpmndi:BPMNEdge id="${e.bpmnId}_di" bpmnElement="${e.bpmnId}">${t}</bpmndi:BPMNEdge>`}).join(``),I=N;return{xml:`<?xml version="1.0" encoding="UTF-8"?>\n<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="${o(`Definitions`,`1`)}" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Penstock">\n${M}\n<bpmndi:BPMNDiagram id="${o(`BPMNDiagram`,`1`)}"><bpmndi:BPMNPlane id="${o(`BPMNPlane`,`1`)}" bpmnElement="${I}">${xe}${F}</bpmndi:BPMNPlane></bpmndi:BPMNDiagram>\n</bpmn:definitions>\n`,notes:n,summary:{elements:l.filter(e=>e.kind!==`pool`&&e.kind!==`lane`).length,flows:S.length,pools:h.length,lanes:l.filter(e=>e.kind===`lane`).length}}}const fe=[{shortcut:`Mod+Z`,action:`undo`,vscode:!1},{shortcut:`Mod+Y`,action:`redo`,vscode:!1},{shortcut:`Mod+Shift+Z`,action:`redo`,vscode:!1},{shortcut:`Mod+C`,action:`copy`,vscode:!1},{shortcut:`Mod+V`,action:`paste`,vscode:!1},{shortcut:`Mod+=`,action:`zoom-in`,vscode:!0},{shortcut:`Mod+-`,action:`zoom-out`,vscode:!0},{shortcut:`Mod+0`,action:`fit-diagram`,vscode:!0},{shortcut:`Mod+S`,action:null,vscode:!1},{shortcut:`Mod+A`,action:null,vscode:!1},{shortcut:`Mod+F`,action:null,vscode:!1}],pe={"=":`equal`,"-":`minus`};function D(e,t){let n=e.split(`+`),r=n.pop()??``,i=n.map(e=>e===`Mod`?t?`cmd`:`ctrl`:e.toLowerCase());return i.push(pe[r]??r.toLowerCase()),i.join(`+`)}function O(){return fe.filter(e=>e.vscode&&e.action!==null).map(e=>({command:`penstock.action.${e.action}`,key:D(e.shortcut,!1),mac:D(e.shortcut,!0),when:`penstockEditorFocused`}))}const k={off:`off`,warn:`warning`,warning:`warning`,error:`error`,info:`warning`},me=[`off`,`warning`,`error`],he=/* @__PURE__ */ new Set([`bpmnlint:recommended`,`bpmnlint:all`,`bpmnlint:correctness`]);function ge(e){return e<32||e>=127&&e<=159||e===1564||e===6158||e>=8203&&e<=8207||e>=8232&&e<=8238||e>=8288&&e<=8303||e===65279||e>=65529&&e<=65531}function A(e,t=80){let n=``;for(let r of e.slice(0,t))n+=ge(r.codePointAt(0)??0)?`?`:r;return n}function j(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _e(e){let t=Array.isArray(e)?e[0]:e;return typeof t==`string`?Object.hasOwn(k,t)?k[t]:null:typeof t==`number`?me[t]??null:null}function ve(e){if(e.startsWith(`camunda-compat/`))return Object.hasOwn(u,e.slice(15))?`compat/${e.slice(15)}`:null;if(e.startsWith(`compat/`))return Object.hasOwn(u,e.slice(7))?e:null;if(e.startsWith(`penstock-engine/`))return Object.hasOwn(l,e.slice(16))?`engine/${e.slice(16)}`:null;let t=e.startsWith(`bpmnlint/`)?e.slice(9):e;return Object.hasOwn(d,t)?`bpmnlint/${t}`:null}function M(e){return he.has(e)||e.startsWith(`plugin:camunda-compat/`)}function N(e,t){let n;try{n=JSON.parse(e)}catch{return null}if(!j(n))return null;let r=n.extends,i=(Array.isArray(r)?r:r===void 0?[]:[r]).filter(e=>typeof e==`string`),a=j(n.rules)?n.rules:{},o=Object.keys(a).slice(0,2e3).map(e=>{let t=_e(a[e]);return{rule:A(e),level:t??`invalid`,penstock:t===null?null:ve(e)}});return{file:t,extends:i.slice(0,50).map(e=>({name:A(e),known:M(e)})),rules:o}}function ye(e,t){let n;try{n=JSON.parse(e)}catch{return null}return j(n)?{file:t,keys:Object.keys(n).slice(0,50).map(e=>A(e))}:null}function be(e){if(!j(e))return!1;let t=e.properties;return typeof e.name==`string`&&typeof e.id==`string`&&Array.isArray(e.appliesTo)&&(t===void 0||Array.isArray(t))}function xe(e){let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:[t],r=n.filter(be).length;return{templates:r,invalid:n.length-r}}const P=`http://www.omg.org/spec/BPMN/20100524/MODEL`,F=`http://camunda.org/schema/1.0/bpmn`,I=`http://camunda.org/schema/zeebe/1.0`,Se=/^[$#]\{\s*([A-Za-z_]\w*)\s*\}$/,Ce=[`camunda7`,`camunda8`],we={camunda7:`Camunda 7`,camunda8:`Camunda 8`},Te=/* @__PURE__ */ new Set([`assignee`,`candidateUsers`,`candidateGroups`,`dueDate`,`priority`,`formKey`,`class`,`delegateExpression`,`expression`,`resultVariable`,`exclusive`,`collection`,`elementVariable`,`initiator`,`candidateStarterUsers`,`candidateStarterGroups`]),Ee=/* @__PURE__ */ new Set([`executionListener`,`taskListener`,`in`,`out`,`failedJobRetryTimeCycle`]),De=/* @__PURE__ */ new Set([`userTask`,`serviceTask`,`sendTask`,`businessRuleTask`]);function Oe(e){for(let t of e.scope.values())if(t===`http://flowable.org/bpmn`)return!0;return!1}function ke(e){return Ce.includes(e)}var L=class{counts=/* @__PURE__ */ new Map;add(e){let t=A(e);this.counts.set(t,(this.counts.get(t)??0)+1)}get total(){let e=0;for(let t of this.counts.values())e+=t;return e}list(){let e=[...this.counts.keys()].sort(),t=e.slice(0,20).map(e=>(this.counts.get(e)??0)>1?`${e} (${this.counts.get(e)})`:e);return e.length>20?`${t.join(`, `)}, …`:t.join(`, `)}};function Ae(e){let t=[],n=[{node:e,parent:null}];for(let e=n.pop();e;e=n.pop()){t.push(e);for(let t=e.node.children.length-1;t>=0;--t)n.push({node:e.node.children[t],parent:e.node})}return t}function je(e){let t=/* @__PURE__ */ new Set;for(let{node:n}of e){t.add(n.prefix);for(let e of Object.keys(n.attrs))e.startsWith(`xmlns:`)&&t.add(e.slice(6))}return t}function R(e,t,n){for(let[n,r]of Object.entries(e.root.attrs))if(n.startsWith(`xmlns:`)&&r===t)return n.slice(6);for(let[n,r]of e.added)if(r===t)return n;let r=n;for(let t=1;e.taken.has(r);t+=1)r=`${n}${t}`;return e.taken.add(r),e.added.set(r,t),e.root.attrs[`xmlns:${r}`]=t,r}function z(e,t,n,r,i){return{name:t?`${t}:${n}`:n,local:n,prefix:t,ns:r,attrs:i,children:[],text:``,scope:e.scope}}function B(e){let t=[];for(let n of Object.keys(e.attrs)){let r=n.indexOf(`:`);r<0||n.startsWith(`xmlns`)||e.scope.get(n.slice(0,r))===`http://flowable.org/bpmn`&&t.push({key:n,local:n.slice(r+1)})}return t}function Me(e,t){let n=t.children.find(e=>e.local===`extensionElements`&&e.ns===P);if(n)return n;let r=0;for(;r<t.children.length&&t.children[r].local===`documentation`&&t.children[r].ns===P;)r+=1;let i=z(t,t.prefix,`extensionElements`,P,{});return t.children.splice(r,0,i),i}function V(e,t,n,r){let i=Me(e,t);return!i.children.some(e=>e.ns===I&&e.local===n)&&(i.children.push(z(i,R(e,I,`zeebe`),n,I,r)),!0)}function Ne(e,t){e.children.splice(e.children.indexOf(t),1)}function Pe(e,t){let n=R(e,F,`camunda`);t.prefix=n,t.name=`${n}:${t.local}`,t.ns=F}function Fe(e,t){let n=t.trim();if(n===``||n.length>512)return null;if(!n.includes("${")&&!n.includes(`#{`))return n.startsWith(`=`)?null:n;let r=s(n);return r.ok?(e.expressions.add(n),r.feel):null}function Ie(e,t){let n=t.trim();if(n===``||n.length>512)return null;if(e===`class`)return n.includes("${")||n.includes(`#{`)?null:c(`class`,n);let r=Se.exec(n)?.[1];return r?c(`bean`,r):null}function Le(e,t){for(let{key:n,local:r}of B(t)){let i=r===`async`?`asyncBefore`:Te.has(r)?r:null;if(!i)continue;let a=t.attrs[n];delete t.attrs[n],t.attrs[`${R(e,F,`camunda`)}:${i}`]=a,e.converted+=1}}function Re(e,t,n){let r=t.attrs.id;if(!r)return!1;let i=R(e,F,`camunda`),a=n.children.find(e=>e.ns===F&&e.local===`formData`);a||(a=z(n,i,`formData`,F,{}),n.children.push(a));let o={id:r};t.attrs.name&&(o.label=t.attrs.name),t.attrs.type&&(o.type=t.attrs.type),t.attrs.default&&(o.defaultValue=t.attrs.default);let s=z(a,i,`formField`,F,o);for(let[n,r]of Object.entries(t.attrs))[`id`,`name`,`type`,`default`,`required`].includes(n)||(s.attrs[`${t.prefix}:${n}`]=r,e.kept.add(`flowable:formProperty.${n}`));if(t.attrs.required===`true`){let e=z(s,i,`validation`,F,{});e.children.push(z(e,i,`constraint`,F,{name:`required`,config:`true`})),s.children.push(e)}for(let n of t.children)n.ns===`http://flowable.org/bpmn`&&n.local===`value`?s.children.push(z(s,i,`value`,F,{...n.attrs})):e.kept.add(`flowable:${n.local}`);return a.children.push(s),Ne(n,t),e.converted+=1,!0}function ze(e,t,n,r){let i=n.local===`extensionElements`&&n.ns===P;if(t.local===`formProperty`)return i&&Re(e,t,n);let a=r.has(n)&&(n.local===`executionListener`||n.local===`taskListener`);return(Ee.has(t.local)?i:t.local===`field`?i||a:(t.local===`string`||t.local===`expression`)&&r.has(n)&&n.local===`field`)?(Pe(e,t),r.add(t),e.converted+=1,!0):!1}function Be(e,t){if(!De.has(t.local)||t.ns!==P)return;let n=new Map(B(t).map(({key:e,local:t})=>[t,e])),r=e=>{let r=n.get(e);return r===void 0?void 0:t.attrs[r]},i=r=>{let i=n.get(r);i!==void 0&&delete t.attrs[i],n.delete(r),e.converted+=1};if(t.local===`userTask`){let n={},a=[];for(let t of[`assignee`,`candidateUsers`,`candidateGroups`]){let i=r(t),o=i===void 0?null:Fe(e,i);o!==null&&(n[t]=o,a.push(t))}a.length>0&&V(e,t,`assignmentDefinition`,n)&&a.forEach(i);let o=r(`dueDate`),s=o===void 0?null:Fe(e,o);s!==null&&V(e,t,`taskSchedule`,{dueDate:s})&&i(`dueDate`);let c=r(`formKey`),l=c===void 0?null:Fe(e,c);l!==null&&V(e,t,`formDefinition`,{formKey:l})&&i(`formKey`);return}let a=r(`class`)===void 0?`delegateExpression`:`class`,o=r(a),s=o===void 0?null:Ie(a,o);s!==null&&V(e,t,`taskDefinition`,{type:s})&&(i(a),e.jobTypes.add(s))}function Ve(e,t,n){if(t.local!==`executionListener`||n.local!==`extensionElements`||n.ns!==P)return!1;let r=t.attrs.event,i=t.attrs.class===void 0?t.attrs.delegateExpression===void 0?null:Ie(`delegateExpression`,t.attrs.delegateExpression):Ie(`class`,t.attrs.class),a=Object.keys(t.attrs).some(e=>![`event`,`class`,`delegateExpression`].includes(e));if(r!==`start`&&r!==`end`||i===null||a||t.children.length>0)return!1;let o=n.children.find(e=>e.ns===I&&e.local===`executionListeners`);return o||(o=z(n,R(e,I,`zeebe`),`executionListeners`,I,{}),n.children.push(o)),o.children.push(z(o,o.prefix,`executionListener`,I,{eventType:r,type:i})),Ne(n,t),e.listeners.add(i),e.converted+=1,!0}function He(e){if(!e.some(({node:e})=>e.ns===`http://flowable.org/bpmn`||B(e).length>0))for(let{node:t}of e)for(let e of Object.keys(t.attrs))e.startsWith(`xmlns:`)&&t.attrs[e]===`http://flowable.org/bpmn`&&(delete t.attrs[e],t.scope.delete(e.slice(6)))}function Ue(t,n){let r=Ae(t),i={root:t,target:n,taken:je(r),added:/* @__PURE__ */ new Map,converted:0,kept:new L,jobTypes:new L,listeners:new L,expressions:new L},a=/* @__PURE__ */ new Set,o=/* @__PURE__ */ new Set,s=/* @__PURE__ */ new Set;for(let{node:e,parent:t}of r)if(s.has(e)||t&&(o.has(t)||s.has(t)))t&&o.has(t)&&o.add(e),t&&s.has(t)&&s.add(e);else if(e.ns===`http://flowable.org/bpmn`&&t){let r=n===`camunda7`?ze(i,e,t,a):Ve(i,e,t);r&&!t.children.includes(e)&&s.add(e),r||(i.kept.add(`flowable:${e.local}`),o.add(e))}else{n===`camunda7`?Le(i,e):Be(i,e);for(let{local:t}of B(e))i.kept.add(`flowable:${t}`)}if(i.added.size>0)for(let{node:e}of Ae(t))for(let[t,n]of i.added)e.scope.set(t,n);He(Ae(t));let c=we[n],l=[];return i.jobTypes.total>0&&l.push({level:`assumed`,message:e(`app.import.flowable.jobTypes`,{count:i.jobTypes.total,list:i.jobTypes.list()})}),i.listeners.total>0&&l.push({level:`assumed`,message:e(`app.import.flowable.listeners`,{count:i.listeners.total,list:i.listeners.list()})}),i.expressions.total>0&&l.push({level:`assumed`,message:e(`app.import.flowable.expressions`,{count:i.expressions.total,list:i.expressions.list()})}),i.kept.total>0&&l.push({level:`unmapped`,message:e(`app.import.flowable.kept`,{count:i.kept.total,target:c,list:i.kept.list()})}),{notes:l,converted:i.converted}}function We(e){return we[e]}const Ge=67108864;function Ke(t,n){return n>67108864?e(`app.import.failure.entryTooLarge`,{name:t}):null}function qe(t){return t.includes(`<!ENTITY`)?e(`app.import.failure.entities`):null}function Je(t){return t.length>16777216?e(`app.import.failure.tooComplex`):qe(t)}function Ye(t){let n=0,r=[{node:t,depth:1}];for(let t=r.pop();t;t=r.pop()){if(n+=1,n>1e6||t.depth>256)return e(`app.import.failure.tooComplex`);for(let e of t.node.children)r.push({node:e,depth:t.depth+1})}return null}var H=class extends Error{};const Xe=`http://www.omg.org/spec/BPMN/20100524/MODEL`,Ze=/* @__PURE__ */ new Set([Xe,`http://www.omg.org/spec/BPMN/20100524/DI`,`http://www.omg.org/spec/DD/20100524/DC`,`http://www.omg.org/spec/DD/20100524/DI`,`http://www.w3.org/2001/XMLSchema-instance`,`http://www.w3.org/XML/1998/namespace`,`http://camunda.org/schema/1.0/bpmn`,`http://camunda.org/schema/zeebe/1.0`,`http://camunda.org/schema/modeler/1.0`,`http://bpmn.io/schema/bpmn/biocolor/1.0`,`http://www.omg.org/spec/BPMN/non-normative/color/1.0`]);function Qe(e,t){let n=0,r=[e];for(let e=r.pop();e;e=r.pop()){e.ns===t&&(n+=1);for(let r of Object.keys(e.attrs)){let i=r.indexOf(`:`);i>0&&!r.startsWith(`xmlns`)&&e.scope.get(r.slice(0,i))===t&&(n+=1)}r.push(...e.children)}return n}function $e(e,t){if(Oe(e))return`Flowable`;let n=`${t.slice(0,4e3)} ${e.attrs.exporter??``}`.toLowerCase();return n.includes(`signavio`)?`Signavio`:n.includes(`bizagi`)?`Bizagi`:`BPMN 2.0`}function et(e){let t=e.toLowerCase();return t.includes(`signavio`)?`Signavio`:t.includes(`bizagi`)?`Bizagi`:e}function U(e){let t=et(e);return t===`Signavio`||t===`Bizagi`}function tt(e,t){let n=t.indexOf(`:`);return n<0||t.startsWith(`xmlns`)?null:e.scope.get(t.slice(0,n))??``}function nt(e){return e.text.trim()!==``||e.children.length>0||Object.entries(e.attrs).some(([e,t])=>!e.startsWith(`xmlns`)&&t.trim()!==``)}function rt(t,n={}){let i=Je(t);if(i)throw new H(i);let o=r(t),s=Ye(o);if(s)throw new H(s);if(o.local!==`definitions`||o.ns!==Xe)throw new H(e(`app.import.failure.notBpmnXml`));let c=$e(o,t),l=new Set(Ze),u=Qe(o,`http://camunda.org/schema/1.0/bpmn`),d=Qe(o,`http://camunda.org/schema/zeebe/1.0`),f=c===`Flowable`?Ue(o,n.target??`camunda7`):null;f&&l.add(`http://flowable.org/bpmn`);let p=/* @__PURE__ */ new Map,m=/* @__PURE__ */ new Map,h=(e,t)=>{let n=A(et(e)),r=U(e)?m:p,i=r.get(n)??/* @__PURE__ */ new Map,a=A(t);i.set(a,(i.get(a)??0)+1),r.set(n,i)},g=e=>{for(let t of Object.keys(e.attrs)){let n=tt(e,t);n===null||l.has(n)||(e.attrs[t].trim()!==``&&h(n,t),U(n)||delete e.attrs[t])}e.children=e.children.filter(e=>{if(l.has(e.ns))return!0;if(e.local===`signavioMetaData`||e.local===`signavioDiagramMetaData`)(e.attrs.metaValue??``).trim()!==``&&h(e.ns,e.attrs.metaKey??e.local);else if(nt(e)){let t=e.children.filter(e=>nt(e)),n=Object.entries(e.attrs).filter(([e,t])=>!e.startsWith(`xmlns`)&&t.trim()!==``).map(([e])=>e);if(n.length>0)for(let t of n)h(e.ns,t.includes(`:`)?t.slice(t.indexOf(`:`)+1):t);else if(t.length>0)for(let n of t)h(e.ns,n.local);else h(e.ns,e.local)}return U(e.ns)});for(let t of e.children)U(t.ns)||g(t);e.children=e.children.filter(e=>e.local!==`extensionElements`||e.ns!==Xe||e.children.length!==0||e.text.trim()!==``)};g(o);let _=/* @__PURE__ */ new Set,v=e=>{_.add(e.prefix);for(let t of Object.keys(e.attrs))t.includes(`:`)&&!t.startsWith(`xmlns`)&&_.add(t.slice(0,t.indexOf(`:`)));e.children.forEach(v)};v(o);let y=e=>{for(let t of Object.keys(e.attrs))t.startsWith(`xmlns:`)&&(l.has(e.attrs[t])||U(e.attrs[t])||_.has(t.slice(6))||delete e.attrs[t]);e.children.forEach(y)};y(o);let b=f?[...f.notes]:[],x=new Set(W(o,`BPMNShape`).map(e=>e.attrs.bpmnElement));if(x.size===0||W(o,`BPMNPlane`).length===0)throw new H(e(`app.import.failure.noPositions`));let S=W(o,`dataObject`).filter(e=>x.has(e.attrs.id));if(S.length>0){for(let e of S){let t={id:`${e.attrs.id}_reference`,dataObjectRef:e.attrs.id};e.attrs.name&&(t.name=e.attrs.name);let n={...e,name:it(e,`dataObjectReference`),local:`dataObjectReference`,attrs:t,children:[]};delete e.attrs.name;let r=at(o,e);r?.children.splice(r.children.indexOf(e)+1,0,n);for(let t of W(o,`BPMNShape`))t.attrs.bpmnElement===e.attrs.id&&(t.attrs.bpmnElement=n.attrs.id);for(let t of[...W(o,`association`),...W(o,`sourceRef`),...W(o,`targetRef`)])t.attrs.sourceRef===e.attrs.id&&(t.attrs.sourceRef=n.attrs.id),t.attrs.targetRef===e.attrs.id&&(t.attrs.targetRef=n.attrs.id),t.text.trim()===e.attrs.id&&(t.text=n.attrs.id)}b.push({level:`assumed`,message:e(`app.import.note.dataObjects`,{count:S.length})})}for(let[t,n]of p){let r=[...n.values()].reduce((e,t)=>e+t,0),i=[...n.entries()].map(([e,t])=>t>1?`${e} (${t})`:e).join(`, `);b.push({level:`lost`,message:e(`app.import.note.vendorData`,{vendor:t,total:r,list:i})})}for(let[t,n]of m){let r=[...n.values()].reduce((e,t)=>e+t,0),i=[...n.entries()].map(([e,t])=>t>1?`${e} (${t})`:e).join(`, `);b.push({level:`unmapped`,message:e(`app.import.note.vendorKept`,{vendor:t,total:r,list:i})})}o.attrs.id||(o.attrs.id=`Definitions_1`);let C=[];return f&&f.converted>0&&C.push({kind:`converted`,count:f.converted,target:We(n.target??`camunda7`)}),u>0&&C.push({kind:`camunda`,count:u}),d>0&&C.push({kind:`zeebe`,count:d}),{xml:`<?xml version="1.0" encoding="UTF-8"?>\n${a(o)}\n`,format:c,notes:b,details:C}}function it(e,t){return e.prefix?`${e.prefix}:${t}`:t}function W(e,t){let n=[],r=e=>{e.local===t&&n.push(e),e.children.forEach(r)};return r(e),n}function at(e,t){if(e.children.includes(t))return e;for(let n of e.children){let e=at(n,t);if(e)return e}}const ot={nbsp:` `,lt:`<`,gt:`>`,quot:`"`,apos:`'`,amp:`&`};function st(e){return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,t)=>t.startsWith(`#x`)||t.startsWith(`#X`)?String.fromCodePoint(parseInt(t.slice(2),16)):t.startsWith(`#`)?String.fromCodePoint(parseInt(t.slice(1),10)):ot[t.toLowerCase()]??e)}function ct(e){return st(e.replace(/<br\s*\/?>/gi,`
|
|
2
|
+
`).replace(/<\/(div|p|li|h[1-6]|tr)>/gi,`
|
|
3
|
+
`).replace(/<[^>]*>/g,``)).replace(/ /g,` `).replace(/[ \t]+\n/g,`
|
|
4
|
+
`).replace(/\n{3,}/g,`
|
|
5
|
+
|
|
6
|
+
`).trim()}function G(e,t){return t?ct(e):e.trim()}var K=class extends Error{};function lt(t){let n=[],r=0;new p(t=>{if(r+=t.length,r>33554432)throw new K(e(`app.import.failure.pageTooLarge`));n.push(t)}).push(t,!0);let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;return i}function ut(e){let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Set;for(let r of e.split(`;`)){if(!r.trim())continue;let e=r.indexOf(`=`);e<0?n.add(r.trim().toLowerCase()):t.set(r.slice(0,e).trim(),r.slice(e+1).trim())}return{map:t,tokens:n}}function dt(e){let t=atob(e.replace(/\s+/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return n}function ft(t){let n=t.children.find(e=>e.local===`mxGraphModel`);if(n)return n;let i=t.text.trim();if(!i)throw new K(e(`app.import.failure.pageEmpty`));try{return i.startsWith(`<`)?r(i):i.startsWith(`%3C`)?r(decodeURIComponent(i)):r(decodeURIComponent(m(lt(dt(i)))))}catch(t){throw t instanceof K?t:new K(e(`app.import.failure.compressedPage`))}}const q=(e,t=0)=>{let n=Number(e);return e!==void 0&&e!==``&&Number.isFinite(n)?n:t};function pt(t){let n=t.children.find(e=>e.local===`root`);if(!n)throw new K(e(`app.import.failure.pageNoCells`));let r=[];for(let e of n.children){let t=e.local===`object`||e.local===`UserObject`,n=t?e.children.find(e=>e.local===`mxCell`):e.local===`mxCell`?e:void 0;if(!n)continue;let i=n.children.find(e=>e.local===`mxGeometry`),a=(i?.children.find(e=>e.local===`Array`&&e.attrs.as===`points`)?.children??[]).filter(e=>e.local===`mxPoint`).map(e=>({x:q(e.attrs.x),y:q(e.attrs.y)})),o={};if(t)for(let[t,n]of Object.entries(e.attrs))[`id`,`label`].includes(t)||(o[t]=n);r.push({id:(t?e.attrs.id:n.attrs.id)??``,value:t?e.attrs.label??n.attrs.value??``:n.attrs.value??``,style:n.attrs.style??``,vertex:n.attrs.vertex===`1`,edge:n.attrs.edge===`1`,parent:n.attrs.parent??``,source:n.attrs.source??``,target:n.attrs.target??``,geometry:{x:q(i?.attrs.x),y:q(i?.attrs.y),width:q(i?.attrs.width),height:q(i?.attrs.height),points:a},properties:o,hidden:n.attrs.visible===`0`})}return r}const mt={service:`service`,user:`user`,script:`script`,send:`send`,receive:`receive`,manual:`manual`,businessrule:`businessRule`},ht={general:void 0,none:void 0,message:`message`,timer:`timer`,escalation:`escalation`,conditional:`conditional`,link:`link`,error:`error`,cancel:`cancel`,compensation:`compensation`,signal:`signal`,multiple:`multiple`,parallelmultiple:`parallelMultiple`,terminate:`terminate`},gt=/* @__PURE__ */ new Set([``,`rect`,`rectangle`,`ellipse`,`rhombus`,`text`,`note`,`swimlane`,`partialrectangle`,`table`,`tablerow`]);function _t(e){let t=(e.map.get(`symbol`)??``).toLowerCase(),n=(e.map.get(`outline`)??``).toLowerCase();return t.includes(`parallelmultiple`)||t.includes(`event`)||t.includes(`multiple`)&&n!==`none`?`eventBasedGateway`:t.includes(`exclusive`)?`exclusiveGateway`:t.includes(`parallel`)?`parallelGateway`:t.includes(`complex`)?`complexGateway`:t.includes(`inclusive`)||n===`end`?`inclusiveGateway`:n===`catching`?`eventBasedGateway`:`exclusiveGateway`}function vt(e){let t=(e.map.get(`outline`)??`standard`).toLowerCase(),n=(e.map.get(`symbol`)??`general`).toLowerCase(),r=n in ht,i=r?ht[n]:void 0,a={standard:[`startEvent`],eventint:[`startEvent`],eventnonint:[`startEvent`,!1],end:[`endEvent`],throwing:[`intermediateThrowEvent`],catching:[`intermediateCatchEvent`],boundint:[`boundaryEvent`],boundnonint:[`boundaryEvent`,!1]},[o,s]=a[t]??a.standard;return{kind:o,fields:{definition:i,interrupting:s},unknownSymbol:r?void 0:n}}function yt(e){if(e.map.get(`isLoopMultiInstance`)===`1`)return e.map.get(`isSequential`)===`1`?`sequential`:`parallel`;if(e.map.get(`isLoopStandard`)===`1`)return`standard`}function bt(t,n){let r=(n.map.get(`shape`)??``).toLowerCase(),{tokens:i}=n,a=r.startsWith(`mxgraph.bpmn.`);if(i.has(`swimlane`)||r===`swimlane`||r===`table`)return{kind:`pool`,fields:{horizontal:n.map.get(`horizontal`)===`0`||r===`table`}};if(r===`tablerow`)return{kind:`lane`,fields:{horizontal:!0}};if(r.startsWith(`mxgraph.bpmn.shape`)||r.startsWith(`mxgraph.bpmn.event`)){let t=vt(n);return{kind:t.kind,fields:t.fields,note:t.unknownSymbol?{level:`lost`,message:e(`app.import.note.unknownEvent`,{symbol:t.unknownSymbol})}:void 0}}return r.startsWith(`mxgraph.bpmn.gateway`)?{kind:_t(n)}:r===`datastore`||a&&/store/.test(r)?{kind:`dataStore`}:a&&r.startsWith(`mxgraph.bpmn.data`)?{kind:`dataObject`,fields:{collection:n.map.get(`isCollection`)===`1`}}:a&&r.startsWith(`mxgraph.bpmn.annotation`)||r===`partialrectangle`?{kind:`textAnnotation`}:a&&r.startsWith(`mxgraph.bpmn.task`)?xt(n):r===`ext`?n.map.get(`double`)===`1`?{kind:`transaction`}:q(n.map.get(`strokeWidth`))>=3?{kind:`callActivity`}:n.map.get(`dashed`)===`1`?{kind:`eventSubProcess`}:xt(n):gt.has(r)?i.has(`rhombus`)||r===`rhombus`?{kind:`exclusiveGateway`,note:{level:`assumed`,message:e(`app.import.note.diamond`,{shape:St(t)})}}:i.has(`ellipse`)||r===`ellipse`?{pending:`event`}:i.has(`text`)||r===`text`?{kind:`textAnnotation`,note:{level:`assumed`,message:e(`app.import.note.freeText`,{shape:St(t)})}}:r===`note`?{kind:`textAnnotation`,note:{level:`assumed`,message:e(`app.import.note.noteShape`,{shape:St(t)})}}:n.map.get(`rounded`)===`1`?xt(n):{kind:`task`,note:{level:`assumed`,message:e(`app.import.note.rectangle`,{shape:St(t)})}}:{}}function xt(e){let t=(e.map.get(`bpmnShapeType`)??``).toLowerCase();if(t===`call`)return{kind:`callActivity`,fields:{loop:yt(e)}};if(t===`transaction`)return{kind:`transaction`};if(t===`subprocess`)return{kind:`subProcess`};if(t===`event`)return{kind:`eventSubProcess`};let n=(e.map.get(`taskMarker`)??``).toLowerCase();return{kind:`task`,fields:{taskType:f(mt,n)??`task`,loop:yt(e)}}}function St(t){let n=G(t.value,!0).replace(/\s+/g,` `);return n?`"${n}"`:e(`app.import.note.anUnlabelledShape`)}function Ct(t,n){let r=n.map.get(`shape`)??[...n.tokens][0]??`rectangle`,i=G(t.value,!0).replace(/\s+/g,` `);return i?e(`app.import.note.unmappedLabelled`,{label:i,shape:r}):e(`app.import.note.unlabelledShape`,{shape:r,count:1})}function wt(e){let t=e.map.get(`dashed`)===`1`,n=e.map.get(`startArrow`)??``,r=e.map.get(`endArrow`)??`classic`;return t&&(n===`oval`||e.map.get(`endFill`)===`0`&&r!==`none`)?`message`:t?`association`:`sequence`}function Tt(t){let n=r(t),i=[],a;if(n.local===`mxGraphModel`)a=n;else{let t=n.children.filter(e=>e.local===`diagram`);if(t.length===0)throw new K(e(`app.import.failure.noPages`));let r=t.map(e=>({page:e,model:ft(e)})),o=r.find(e=>pt(e.model).some(e=>e.vertex))??r[0];a=o.model;for(let t of r){if(t===o)continue;let n=pt(t.model).filter(e=>e.vertex).length;i.push({level:`unmapped`,message:e(`app.import.note.otherPage`,{page:t.page.attrs.name??e(`app.import.note.untitled`),shapes:n,count:n})})}}let o=pt(a).filter(e=>e.id!==``&&!e.hidden),s=new Map(o.map(e=>[e.id,e])),c=new Map(o.map(e=>[e.id,ut(e.style)])),l=/* @__PURE__ */ new Map,u=(e,t=0)=>{let n=l.get(e.id);if(n)return n;let r=s.get(e.parent),i=r&&r.vertex&&t<50?u(r,t+1):{x:0,y:0},a={x:i.x+e.geometry.x,y:i.y+e.geometry.y};return l.set(e.id,a),a},d=e=>{let t=s.get(e.parent);return t&&t.vertex?u(t):{x:0,y:0}},f=/* @__PURE__ */ new Map,p=/* @__PURE__ */ new Set;for(let e of o){let t=c.get(e.id);e.vertex&&t.tokens.has(`edgelabel`)&&s.get(e.parent)?.edge&&f.set(e.parent,G(e.value,t.map.get(`html`)===`1`));let n=s.get(e.parent);e.vertex&&n&&(c.get(n.id)?.map.get(`shape`)??``).toLowerCase()===`tablerow`&&p.add(e.id)}let m=[],h=[],g=[],_=/* @__PURE__ */ new Map,v=0;for(let e of o){if(!e.vertex)continue;let t=c.get(e.id);if(t.tokens.has(`edgelabel`)&&s.get(e.parent)?.edge)continue;let n=s.get(e.parent);if(p.has(e.id)&&(c.get(e.id)?.map.get(`shape`)??``).toLowerCase()===`partialrectangle`){let r=m.find(e=>e.id===n?.id);r&&!r.name&&e.value&&(r.name=G(e.value,t.map.get(`html`)===`1`));continue}let r=bt(e,t);if(!r.kind&&!r.pending){let n=t.map.get(`shape`)??[...t.tokens][0]??`rectangle`;g.push({text:Ct(e,t),shape:n,labelled:G(e.value,!0)!==``});continue}r.note&&i.push(r.note);let a=u(e),o=t.map.get(`html`)===`1`,l=e.properties.documentation??e.properties.tooltip,d={id:e.id,kind:r.kind??`startEvent`,name:G(e.value,o),x:a.x,y:a.y,width:e.geometry.width||100,height:e.geometry.height||80,parent:n&&n.vertex?n.id:void 0,documentation:l?G(l,!1):void 0,...r.fields};m.push(d),r.pending&&h.push(d);let f=Object.keys(e.properties).filter(e=>![`documentation`,`tooltip`,`placeholders`,`link`].includes(e));if(f.length>0){v+=1;for(let e of f)_.set(e,(_.get(e)??0)+1)}}w(m);let y=[];for(let e of o){if(!e.edge)continue;let t=c.get(e.id),n=G(e.value,t.map.get(`html`)===`1`)||f.get(e.id)||``,r=d(e),i=(t.map.get(`edgeStyle`)??``).toLowerCase(),a=t.map.get(`startArrow`)??``;y.push({id:e.id,kind:wt(t),source:e.source,target:e.target,name:n,points:e.geometry.points.map(e=>({x:e.x+r.x,y:e.y+r.y})),orthogonal:i.includes(`orthogonal`)||i.includes(`elbow`),isDefault:a===`dash`||a===`dashThin`,documentation:e.properties.documentation})}for(let t of h){let n=y.filter(e=>e.target===t.id&&e.kind===`sequence`).length,r=y.filter(e=>e.source===t.id&&e.kind===`sequence`).length;t.kind=n===0&&r>0?`startEvent`:r===0&&n>0?`endEvent`:`intermediateThrowEvent`,(t.width>80||t.height>80)&&(t.width=t.height=36);let a=t.kind===`startEvent`?e(`app.import.note.aStartEvent`):t.kind===`endEvent`?e(`app.import.note.anEndEvent`):e(`app.import.note.anIntermediateEvent`);i.push({level:`assumed`,message:e(`app.import.note.circle`,{shape:t.name?`"${t.name.replace(/\s+/g,` `)}"`:e(`app.import.note.anUnlabelledCircle`),kind:a})})}let b=g.filter(e=>e.labelled);for(let e of b)i.push({level:`unmapped`,message:e.text});let x=g.filter(e=>!e.labelled),S=/* @__PURE__ */ new Map;for(let e of x)S.set(e.shape,(S.get(e.shape)??0)+1);for(let[t,n]of S)i.push({level:`unmapped`,message:e(`app.import.note.unlabelledShape`,{count:n,shape:t})});return _.size>0&&i.push({level:`lost`,message:e(`app.import.note.customData`,{count:v,keys:[..._.keys()].join(`, `)})}),{nodes:m,flows:y,notes:i}}var J=class extends Error{};function Et(e){return e.length>4&&e[0]===80&&e[1]===75&&(e[2]===3||e[2]===5)&&(e[3]===4||e[3]===6)}function Dt(e){return e.length>8&&[208,207,17,224,161,177,26,225].every((t,n)=>e[n]===t)}function Ot(t,n){let r=0;try{let i=h(t,{filter(t){if(!n(t.name))return!1;if(t.originalSize>67108864)throw new J(e(`app.import.failure.entryTooLarge`,{name:t.name}));if(r+=t.originalSize,r>268435456)throw new J(e(`app.import.failure.archiveTooLarge`));return!0}});return new Map(Object.entries(i))}catch(t){throw t instanceof J?t:new J(e(`app.import.failure.notZip`))}}function Y(e,t){let n=e.get(t);return n?m(n).replace(/^/,``):void 0}var kt=class extends Error{};const X=e=>e.toLowerCase().replace(/[^a-z0-9]/g,``);function At(e){let t=/* @__PURE__ */ new Map;for(let n of e.children){if(n.local!==`Cell`||!n.attrs.N)continue;let e=Number(n.attrs.V);n.attrs.V!==void 0&&n.attrs.V!==``&&Number.isFinite(e)&&t.set(n.attrs.N,e)}return t}function jt(e){let t=/* @__PURE__ */ new Map;for(let n of e.children.filter(e=>e.local===`Section`&&e.attrs.N===`Property`))for(let e of n.children.filter(e=>e.local===`Row`)){let n=e.children.find(e=>e.local===`Cell`&&e.attrs.N===`Value`);e.attrs.N&&n?.attrs.V!==void 0&&t.set(X(e.attrs.N),n.attrs.V)}return t}function Mt(e){let t=e.children.find(e=>e.local===`Section`&&e.attrs.N===`Geometry`);if(!t)return[];let n=[];for(let e of t.children.filter(e=>e.local===`Row`)){let t=e.attrs.T??``;if(!e.attrs.T&&e.attrs.N)continue;if(t!==`MoveTo`&&t!==`LineTo`)return null;let r=At(e);n.push({type:t,x:r.get(`X`)??0,y:r.get(`Y`)??0})}return n}function Nt(e,t){let n=/* @__PURE__ */ new Map,i=Y(e,t);if(!i)return n;for(let e of r(i).children.filter(e=>e.local===`Relationship`))e.attrs.Id&&e.attrs.Target&&n.set(e.attrs.Id,e.attrs.Target);return n}function Pt(e,t,n,r){if(e)for(let i of e.children.filter(e=>e.local===`Shape`)){let e=At(i),a={x:(e.get(`PinX`)??0)-(e.get(`LocPinX`)??0),y:(e.get(`PinY`)??0)-(e.get(`LocPinY`)??0)},o=i.attrs.Master??i.attrs.MasterShape,s=i.children.find(e=>e.local===`Shapes`);r.push({id:i.attrs.ID,master:(o?t.get(o):void 0)??(i.attrs.NameU??i.attrs.Name??``).replace(/\.\d+$/,``),text:(i.children.find(e=>e.local===`Text`)?.text??``).replace(/\s+$/g,``).replace(/^\s+/,``),cells:e,props:jt(i),rows:Mt(i)??[],node:i,origin:n,group:i.attrs.Type===`Group`}),s&&Pt(s,t,{x:n.x+a.x,y:n.y+a.y},r)}}const Ft=[[`parallelmultiple`,`parallelMultiple`],[`multiple`,`multiple`],[`message`,`message`],[`timer`,`timer`],[`error`,`error`],[`escalation`,`escalation`],[`cancel`,`cancel`],[`compensation`,`compensation`],[`conditional`,`conditional`],[`rule`,`conditional`],[`link`,`link`],[`signal`,`signal`],[`terminate`,`terminate`]],It=[[`service`,`service`],[`send`,`send`],[`receive`,`receive`],[`user`,`user`],[`manual`,`manual`],[`businessrule`,`businessRule`],[`script`,`script`]];function Z(e,t){for(let n of t){let t=e.get(n);if(t!==void 0)return X(t)}return``}function Lt(e){let t=Z(e,[`looptype`,`loop`,`loopcharacteristics`]);if(t.includes(`multi`)||t.includes(`parallel`))return`parallel`;if(t.includes(`sequential`))return`sequential`;if(t.includes(`standard`)||t===`loop`)return`standard`}function Rt(e,t){let n=Z(e,[`gatewaytype`,`type`])||X(t);return n.includes(`event`)?`eventBasedGateway`:n.includes(`parallel`)?`parallelGateway`:n.includes(`inclusive`)?`inclusiveGateway`:n.includes(`complex`)?`complexGateway`:`exclusiveGateway`}function zt(e){let t=X(e.master);if(e.cells.has(`BeginX`)&&e.cells.has(`EndX`))return t.includes(`message`)?{flow:`message`}:t.includes(`association`)?{flow:`association`}:t.includes(`default`)?{flow:`sequence`,isDefault:!0}:t.includes(`sequence`)||t.includes(`conditional`)?{flow:`sequence`}:{flow:`sequence`,generic:!0};if(t.includes(`pool`)||t.includes(`swimlane`))return{kind:`pool`,fields:{horizontal:(e.cells.get(`Width`)??0)>=(e.cells.get(`Height`)??0)}};if(t===`lane`||t.startsWith(`lane`))return{kind:`lane`,fields:{horizontal:!0}};if(t.includes(`startevent`)||t.includes(`intermediateevent`)||t.includes(`endevent`)||t===`event`){let n=Z(e.props,[`eventtype`,`type`]),r=t.includes(`start`)||n===`start`?`start`:t.includes(`end`)||n===`end`?`end`:`intermediate`,i=Z(e.props,[`triggerorresult`,`trigger`,`result`,`eventtrigger`,`eventdefinition`]),a=Ft.find(([e])=>i.includes(e))?.[1],o=[...e.props.entries()].some(([e,t])=>(e.includes(`throw`)||X(t).includes(`throw`))&&X(t)!==`false`&&X(t)!==`no`),s=r===`start`?`startEvent`:r===`end`?`endEvent`:o?`intermediateThrowEvent`:`intermediateCatchEvent`,c=Z(e.props,[`interrupting`,`iscancelactivity`]);return{kind:s,fields:{definition:a,interrupting:c===`false`||c===`no`?!1:void 0}}}if(t.includes(`gateway`))return{kind:Rt(e.props,e.master)};if(t.includes(`callactivity`))return{kind:`callActivity`,fields:{loop:Lt(e.props)}};if(t.includes(`subprocess`)){let t=Z(e.props,[`subprocesstype`,`type`]);return{kind:t.includes(`transaction`)?`transaction`:t.includes(`event`)?`eventSubProcess`:`subProcess`,fields:{loop:Lt(e.props)}}}if(t===`task`||t.startsWith(`task`)){let t=Z(e.props,[`tasktype`,`type`]);return{kind:`task`,fields:{taskType:It.find(([e])=>t.includes(e))?.[1]??`task`,loop:Lt(e.props)}}}return t.includes(`datastore`)?{kind:`dataStore`}:t.includes(`dataobject`)||t.includes(`datainput`)||t.includes(`dataoutput`)?{kind:`dataObject`,fields:{collection:Z(e.props,[`iscollection`,`collection`])===`true`}}:t.includes(`annotation`)?{kind:`textAnnotation`}:null}function Q(e){return e*96}function Bt(t){let n=Ot(t,e=>/^visio\/.*\.(xml|rels)$/i.test(e));if(!n.has(`visio/document.xml`))throw new kt(e(`app.import.failure.notVisio`));let i=Y(n,`visio/pages/pages.xml`);if(!i)throw new kt(e(`app.import.failure.noVisioPages`));let a=/* @__PURE__ */ new Map,o=Y(n,`visio/masters/masters.xml`);if(o)for(let e of r(o).children.filter(e=>e.local===`Master`))a.set(e.attrs.ID,e.attrs.NameU??e.attrs.Name??``);let s=Nt(n,`visio/pages/_rels/pages.xml.rels`),c=r(i).children.filter(e=>e.local===`Page`).map(e=>{let t=e.children.find(e=>e.local===`PageSheet`),n=e.children.find(e=>e.local===`Rel`),r=n?s.get(n.attrs[`r:id`]??n.attrs.id??``):void 0,i=r?`visio/pages/${r.replace(/^\.?\//,``)}`:``;return{name:e.attrs.NameU??e.attrs.Name??`untitled`,height:(t?At(t).get(`PageHeight`):void 0)??8.5,file:i}}).map(e=>({page:e,text:Y(n,e.file)})).filter(e=>e.text!==void 0).map(e=>({...e,root:r(e.text)})).map(e=>({...e,shapes:[]}));for(let e of c)Pt(e.root.children.find(e=>e.local===`Shapes`),a,{x:0,y:0},e.shapes);let l=c.find(e=>e.shapes.length>0);if(!l)throw new kt(e(`app.import.failure.noShapes`));let u=[];for(let t of c)t!==l&&t.shapes.length!==0&&u.push({level:`unmapped`,message:e(`app.import.note.otherVisioPage`,{page:t.page.name,shapes:t.shapes.length,count:t.shapes.length})});let d=l.page.height,f=[],p=[],m=/* @__PURE__ */ new Map,h=l.root.children.find(e=>e.local===`Connects`);for(let e of h?.children.filter(e=>e.local===`Connect`)??[]){let t=e.attrs.FromSheet,n=m.get(t)??{};(e.attrs.FromCell??``).startsWith(`Begin`)&&(n.source=e.attrs.ToSheet),(e.attrs.FromCell??``).startsWith(`End`)&&(n.target=e.attrs.ToSheet),m.set(t,n)}let _=0,v=0,b=[],x=e=>e.text.replace(/\s+/g,` `);for(let t of l.shapes){(t.cells.get(`Angle`)??0)!==0&&(v+=1);let n=zt(t);if(n&&`flow`in n){let e={x:Q(t.cells.get(`BeginX`)??0),y:Q(d-(t.cells.get(`BeginY`)??0))},r={x:Q(t.cells.get(`EndX`)??0),y:Q(d-(t.cells.get(`EndY`)??0))},i=t.origin.x+(t.cells.get(`PinX`)??0)-(t.cells.get(`LocPinX`)??0),a=t.origin.y+(t.cells.get(`PinY`)??0)-(t.cells.get(`LocPinY`)??0),o=t.rows.slice(1,-1).map(e=>({x:Q(i+e.x),y:Q(d-(a+e.y))})).filter(t=>!(Math.abs(t.x-e.x)<.5&&Math.abs(t.y-e.y)<.5)&&!(Math.abs(t.x-r.x)<.5&&Math.abs(t.y-r.y)<.5));n.generic&&(_+=1);let s=m.get(t.id)??{};p.push({id:t.id,kind:n.flow,source:s.source??``,target:s.target??``,name:x(t),points:o,isDefault:n.isDefault})}else if(n&&`kind`in n){let e=t.cells.get(`Width`)??1,r=t.cells.get(`Height`)??1,i=t.origin.x+(t.cells.get(`PinX`)??0)-(t.cells.get(`LocPinX`)??e/2),a=t.origin.y+(t.cells.get(`PinY`)??0)-(t.cells.get(`LocPinY`)??r/2);f.push({id:t.id,kind:n.kind,name:x(t),x:Q(i),y:Q(d-a-r),width:Q(e),height:Q(r),...n.fields})}else(!t.group||n)&&b.push(x(t)?e(`app.import.note.unmappedLabelled`,{label:x(t),shape:t.master||e(`app.import.note.aShape`)}):e(`app.import.note.unlabelledMaster`,{shape:t.master||e(`app.import.note.shape`)}))}u.push(...b.map(e=>({level:`unmapped`,message:e}))),_>0&&u.push({level:`assumed`,message:e(`app.import.note.genericConnectors`,{count:_})}),v>0&&u.push({level:`lost`,message:e(`app.import.note.rotated`,{count:v})}),w(f);let S=f.filter(e=>[`task`,`callActivity`,`subProcess`,`transaction`,`eventSubProcess`].includes(e.kind));for(let e of f){if(e.kind!==`intermediateCatchEvent`||p.some(t=>t.kind===`sequence`&&t.target===e.id))continue;let t=g(e),n=S.map(e=>({candidate:e,distance:y(e,t)})).filter(e=>e.distance<=25).sort((e,t)=>e.distance-t.distance)[0];n&&(e.kind=`boundaryEvent`,e.host=n.candidate.id)}return{nodes:f,flows:p,notes:u}}const Vt=[`modeler`,`signavio`,`bizagi`,`flowable`];function Ht(e){return Vt.includes(e)}const Ut={modeler:`BPMN 2.0`,signavio:`Signavio`,bizagi:`Bizagi`,flowable:`Flowable`};function Wt(e){return(typeof e==`string`?e:new TextDecoder(`utf-8`).decode(e)).replace(/^/,``)}function $(e,t=[]){return{ok:!1,message:e,notes:t}}function Gt(t,n){if(n.nodes.length===0)return $(e(`app.import.failure.nothingToImport`,{format:t}),n.notes);let r=de(n);return{ok:!0,bpmn:r.xml,report:{format:t,summary:r.summary,notes:r.notes,needsLayout:!1}}}function Kt(){return e(`app.import.failure.bizagiPackage`)}const qt=/\.(bpmn|bpmn20\.xml)$/i;function Jt(e,t,n=[]){let r=rt(e,{target:t.target}),i=[...n,...r.notes],a={format:r.format,summary:Xt(r.xml),notes:i,needsLayout:!1,...r.details.length>0?{details:r.details}:{}};return{ok:!0,bpmn:r.xml,report:a}}function Yt(t,n,r){return!t.ok||!r.from||t.report.format===Ut[r.from]?t:$(e(`app.import.failure.notFrom`,{name:A(n),format:t.report.format,from:r.from}))}function Xt(e){let n=r(e),i=e=>t(n,e).length;return{elements:[`task`,`userTask`,`serviceTask`,`scriptTask`,`sendTask`,`receiveTask`,`manualTask`,`businessRuleTask`,`callActivity`,`subProcess`,`transaction`,`startEvent`,`endEvent`,`intermediateCatchEvent`,`intermediateThrowEvent`,`boundaryEvent`,`exclusiveGateway`,`parallelGateway`,`inclusiveGateway`,`complexGateway`,`eventBasedGateway`].reduce((e,t)=>e+i(t),0),flows:i(`sequenceFlow`)+i(`messageFlow`),pools:i(`participant`),lanes:i(`lane`)}}function Zt(e,t={}){let n=Ke(e.name,e.data.length);return n?$(n):Yt(Qt(e,t),e.name,t)}function Qt(t,n){try{if(typeof t.data!=`string`){if(Dt(t.data))return $(e(`app.import.failure.visioBinary`,{name:t.name}));if(Et(t.data)){if(/\.bpm$/i.test(t.name)){let r=Ot(t.data,e=>qt.test(e)),i=[...r.keys()].sort()[0],a=i?Y(r,i):void 0;return a?Jt(a,n,[{level:`assumed`,message:e(`app.import.note.packageImported`,{name:A(i??``)})}]):$(Kt())}return Gt(`Visio`,Bt(t.data))}}let i=Wt(t.data),a=qe(i);if(a)return $(a);if(/\.bpm$/i.test(t.name)&&!/^\s*</.test(i))return $(Kt());let o=r(i);return o.local===`mxfile`||o.local===`mxGraphModel`?Gt(`draw.io`,Tt(i)):o.local===`definitions`?Jt(i,n):o.local===`Package`&&o.ns.toLowerCase().includes(`xpdl`)?$(e(`app.import.failure.xpdl`)):$(e(`app.import.failure.unknownFormat`,{name:t.name}))}catch(e){if(e instanceof K||e instanceof kt||e instanceof H||e instanceof J||e instanceof o)return $(e.message);throw e}}export{Ce as a,N as c,O as d,A as f,Ge as i,ye as l,Zt as n,ke as o,Ht as r,fe as s,Vt as t,xe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./chunk-atomicWrite-C6J1gDtO.js";import{c as t,d as n,f as r,l as i,n as a,o,r as s,s as c,u as l}from"./chunk-import-Dh3az4BC.js";import{r as u}from"./chunk-translator-DNm9zRpP.js";import{_ as d}from"./chunk-load-rfn3E0t5.js";import{r as f,t as p}from"./chunk-context-rCJvBM9p.js";import{t as m}from"./chunk-paths-DIxn78bW.js";import{s as h}from"./chunk-failure-BRyRvObj.js";import g from"node:path";import _ from"node:os";import{closeSync as v,constants as y,existsSync as b,fstatSync as ee,lstatSync as x,mkdirSync as S,openSync as te,readFileSync as C,readSync as w,readdirSync as T,realpathSync as E,statSync as ne}from"node:fs";function D(e){let t=t=>e.notes.filter(e=>e.level===t).map(e=>e.message);return{unmapped:t(`unmapped`),assumed:t(`assumed`),lost:t(`lost`)}}const O={elements:`element`,flows:`flow`,pools:`pool`,lanes:`lane`};function k(e){return u(`app.import.noteTitle.${e}`)}function A(e,t){return u(`app.import.count.${O[t]}`,{count:e})}function j(e){let{elements:t,flows:n,pools:r,lanes:i}=e.summary,a=[A(t,`elements`),A(n,`flows`)];return r>0&&a.push(A(r,`pools`)),i>0&&a.push(A(i,`lanes`)),u(`app.import.summary`,{format:e.format,counts:a.join(`, `)})}function M(e){let t=D(e),n=[j(e)];for(let t of e.details??[])n.push(u(`app.import.detail.${t.kind}`,{count:t.count,target:t.target??``}));for(let e of[`unmapped`,`assumed`,`lost`])t[e].length!==0&&n.push(``,u(`app.import.noteSection`,{title:k(e),count:t[e].length}),...t[e].map(e=>` - ${e}`));return n}function N(e){let t=e.split(/[\\/]/).pop()??``;return/\.bpmn$/i.test(t)?`${t.replace(/\.bpmn$/i,``)}.penstock.bpmn`:`${t.replace(/\.(drawio|dio|vsdx|bpmn20\.xml|bpm|xml|xpdl)$/i,``)||u(`app.import.importedName`)}.bpmn`}function P(e){return e.length>20?`${e.slice(0,20).join(`, `)}, …`:e.join(`, `)}function F(e){let t=[u(e.found?`app.import.modeler.title`:`app.import.modeler.nothing`,{root:e.root})];for(let n of e.templates)t.push(u(n.picked?`app.import.modeler.templatesPicked`:`app.import.modeler.templatesListed`,{folder:n.folder,templates:n.templates,files:n.files,invalid:n.invalid}));if(e.lint){let n=e.lint.rules.filter(e=>e.penstock!==null).length,r=[...e.lint.extends.filter(e=>!e.known).map(e=>`extends ${e.name}`),...e.lint.rules.filter(e=>e.penstock===null).map(e=>e.rule)];t.push(u(`app.import.modeler.lint`,{file:e.lint.file,known:n,unknown:r.length})),r.length>0&&t.push(u(`app.import.modeler.lintUnknown`,{list:P(r)}))}for(let n of e.settings)t.push(u(`app.import.modeler.settings`,{file:n.file,keys:P(n.keys)||`-`}));e.plugins.length>0&&t.push(u(`app.import.modeler.plugins`,{list:P(e.plugins)})),e.diagrams.files>0&&t.push(u(`app.import.modeler.diagrams`,{files:e.diagrams.files,camunda:e.diagrams.camunda,zeebe:e.diagrams.zeebe})),e.diagrams.capped&&t.push(u(`app.import.modeler.capped`));let n=e.keymap.filter(e=>e.action!==null);t.push(u(`app.import.modeler.keymap`,{mapped:n.length,total:e.keymap.length}));for(let e of n)t.push(` ${e.shortcut} ${e.action}`);for(let n of e.issues)t.push(u(`app.import.modeler.skipped.${n.reason}`,{path:n.path}));return t}const I=2097152,L=5e4,re=/* @__PURE__ */ new Set([`node_modules`,`.git`]);var R=class extends Error{reason;constructor(e){super(e),this.reason=e}};function z(e){return e.startsWith(`\\\\`)||e.startsWith(`//`)}function B(e={}){if(e.userData!==void 0)return e.userData;let t=e.platform??process.platform,n=e.env??process.env,r=e.home??_.homedir();if(z(r))return null;let i;return i=t===`darwin`?g.join(r,`Library`,`Application Support`,`camunda-modeler`):t===`win32`?n.APPDATA?g.join(n.APPDATA,`camunda-modeler`):null:g.join(n.XDG_CONFIG_HOME&&g.isAbsolute(n.XDG_CONFIG_HOME)?n.XDG_CONFIG_HOME:g.join(r,`.config`),`camunda-modeler`),i!==null&&g.isAbsolute(i)&&!z(i)?i:null}function V(e,t,n,i){e.issues.length>=100||e.issues.push({path:r(g.relative(t,n)||g.basename(n)),reason:i})}function H(e,t,n=!1){let r;try{r=te(e,y.O_RDONLY|(y.O_NOFOLLOW??0))}catch(e){return{reason:e.code===`ELOOP`?`symlink`:`unreadable`}}try{let e=ee(r);if(!e.isFile())return{reason:`unreadable`};if(!n&&e.size>t)return{reason:`tooLarge`};let i=Buffer.alloc(Math.min(e.size,t)),a=0;for(;a<i.length;){let e=w(r,i,a,i.length-a,a);if(e===0)break;a+=e}return{text:i.subarray(0,a).toString(`utf8`)}}catch{return{reason:`unreadable`}}finally{v(r)}}function U(e,t){try{return m(E(e),t)}catch{return!1}}function W(e){try{let t=x(e);return t.isSymbolicLink()?`symlink`:t.isDirectory()?`folder`:t.isFile()?`file`:`other`}catch{return null}}function G(e){try{return T(e,{withFileTypes:!0}).sort((e,t)=>e.name<t.name?-1:+(e.name>t.name))}catch{return[]}}function K(e,t,n){let r=[],i=!1,a=0,o=[{folder:n,depth:1}];for(let n=o.pop();n;n=o.pop())for(let s of G(n.folder)){if(a+=1,a>L)return{files:r.sort(),capped:!0};let c=g.join(n.folder,s.name);s.isSymbolicLink()?V(e,t,c,`symlink`):s.isFile()&&s.name.endsWith(`.json`)?r.length>=500?i=!0:r.push(c):s.isDirectory()&&n.depth<4&&o.push({folder:c,depth:n.depth+1})}return{files:r.sort(),capped:i}}function q(e){try{let t=p(e).values.elementTemplates;return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`).map(t=>g.resolve(e,t))):/* @__PURE__ */ new Set}catch{return/* @__PURE__ */ new Set}}function J(e,t,n,i,a,o){if(W(i)===null)return null;if(W(i)!==`folder`)return V(e,t,i,W(i)===`symlink`?`symlink`:`unreadable`),null;if(!U(i,t))return V(e,t,i,`outside`),null;let{files:s,capped:c}=K(e,t,i);c&&V(e,t,i,`tooMany`);let u=0,d=0,f=0,p=0;for(let n of s){let r=H(n,I);if(`reason`in r){V(e,t,n,r.reason),f+=1;continue}if(d+=r.text.length,d>33554432){V(e,t,n,`tooMany`);break}p+=1;let i=l(r.text);i?(u+=i.templates,f+=i.invalid):(V(e,t,n,`notJson`),f+=1)}let m=a===`project`&&g.resolve(i)===g.resolve(n,`.camunda`,`element-templates`);return{folder:r(a===`project`?g.relative(n,i):i),origin:a,files:p,templates:u,invalid:f,picked:m||o.has(g.resolve(i))}}function Y(e,t,n){return W(n)!==`folder`||!U(n,t)?[]:G(n).filter(e=>e.isDirectory()&&!e.isSymbolicLink()).slice(0,50).map(e=>r(e.name))}function X(e,t,n,a){let o=W(n);if(o===null||o===`folder`)return null;if(o!==`file`||!U(n,t))return V(e,t,n,o===`symlink`?`symlink`:o===`file`?`outside`:`unreadable`),null;let s=H(n,I);if(`reason`in s)return V(e,t,n,s.reason),null;let c=i(s.text,r(a));return c||V(e,t,n,`notJson`),c}function ie(e,n,r){let i=W(r);if(i===null)return null;if(i!==`file`||!U(r,n))return V(e,n,r,i===`symlink`?`symlink`:i===`file`?`outside`:`unreadable`),null;let a=H(r,I);if(`reason`in a)return V(e,n,r,a.reason),null;let o=t(a.text,`.bpmnlintrc`);return o||V(e,n,r,`notJson`),o}function ae(e,t){let n={files:0,camunda:0,zeebe:0,capped:!1},r=0,i=[{folder:t,depth:1}];for(let a=i.pop();a;a=i.pop())for(let o of G(a.folder)){if(r+=1,r>L||n.files>=500)return n.capped=!0,n;let s=g.join(a.folder,o.name);if(!o.isSymbolicLink()){if(o.isDirectory())!re.has(o.name)&&a.depth<6&&i.push({folder:s,depth:a.depth+1});else if(o.isFile()&&o.name.toLowerCase().endsWith(`.bpmn`)){let r=H(s,65536,!0);if(`reason`in r){V(e,t,s,r.reason);continue}n.files+=1,r.text.includes(`http://camunda.org/schema/1.0/bpmn`)&&(n.camunda+=1),r.text.includes(`http://camunda.org/schema/zeebe/1.0`)&&(n.zeebe+=1)}}}return n}function oe(e){try{return Z(e)}catch{return null}}function Z(e){if(z(e))throw new R(`unc`);try{let t=E(g.resolve(e));if(z(t)||x(t).isDirectory()===!1)throw new R(`notFolder`);return t}catch(e){throw e instanceof R?e:new R(`notFolder`)}}function se(e,t={}){let n=Z(e),i={issues:[]},a=q(n),o=[],s=[],l=[];for(let e of[[`.camunda`,`element-templates`],[`resources`,`element-templates`]]){let t=J(i,n,n,g.join(n,...e),`project`,a);t&&o.push(t)}for(let[e,t]of[[`.camunda`,[`flags.json`,`settings.json`]],[`resources`,[`flags.json`]]])for(let r of t){let t=X(i,n,g.join(n,e,r),`${e}/${r}`);t&&s.push(t)}let u=X(i,n,g.join(n,`.camunda`),`.camunda`);u&&s.push(u),l.push(...Y(i,n,g.join(n,`resources`,`plugins`)));let d=B(t),f=d!==null&&W(d)===`folder`?oe(d):null;if(f!==null){let e=J(i,f,n,g.join(f,`resources`,`element-templates`),`user`,a);e&&o.push(e);for(let[e,t]of[[``,[`flags.json`,`settings.json`,`config.json`]],[`resources`,[`flags.json`]]])for(let n of t){let t=`~/${g.posix.join(`camunda-modeler`,e,n)}`,r=X(i,f,g.join(f,e,n),t);r&&s.push(r)}l.push(...Y(i,f,g.join(f,`resources`,`plugins`)))}let p=ie(i,n,g.join(n,`.bpmnlintrc`)),m=ae(i,n),h=o.length>0||p!==null||s.length>0||l.length>0;return{root:r(g.basename(n)),found:h,templates:o,lint:p,settings:s,plugins:l,diagrams:m,keymap:c.map(e=>({...e})),issues:i.issues}}const Q=4096;function ce(e,t){return t?g.resolve(t):g.join(g.dirname(e),N(g.basename(e)))}function le(e,t){return b(t)?E(e)===E(t):!1}function $(t,i,a,o){let s;try{s=se(t,{userData:a.modelerData})}catch(e){if(e instanceof R)return o([u(e.reason===`unc`?`app.cli.import.uncFolder`:`app.cli.import.notFolder`,{file:r(t,Q)})]);throw e}let c=a.json?[JSON.stringify({ok:!0,...s},null,2)]:F(s);if(!i)return{ok:!0,lines:c};let l=g.resolve(i);return a.confinedTo!==void 0&&!d(l,[a.confinedTo])?o([u(`app.cli.import.outsideProject`,{file:r(l,Q)})]):b(l)&&!a.force?o([u(`app.cli.import.exists`,{file:r(f(l),Q)})]):(S(g.dirname(l),{recursive:!0}),e(l,`${JSON.stringify(n(),null,2)}\n`),{ok:!0,lines:a.json?c:[...c,``,u(`app.cli.import.keymapWritten`,{file:r(f(l),Q)})]})}async function ue(t,n,i){let c=e=>({ok:!1,refused:!i.json,lines:i.json?[JSON.stringify({ok:!1,message:e[0]})]:e});if(i.from!==void 0&&!s(i.from))return c([u(`app.cli.import.badFrom`,{from:r(i.from,Q)})]);if(i.to!==void 0&&!o(i.to))return c([u(`app.cli.import.badTo`,{to:r(i.to,Q)})]);if(!t)return c([u(`app.cli.import.needsFile`)]);if(!b(t))return c([u(`app.cli.import.missing`,{file:r(t,Q)})]);let l=ne(t);if(l.isDirectory())return i.from===`modeler`?$(t,n,i,c):c([u(`app.cli.import.folderNeedsModeler`,{file:r(f(t),Q)})]);if(!l.isFile()||l.size>67108864)return c([u(`app.import.failure.entryTooLarge`,{name:r(g.basename(t),Q)}),u(`app.cli.nothingWritten`)]);let p;try{p=new Uint8Array(C(t))}catch(e){return c([h(r(f(t),Q),e),u(`app.cli.nothingWritten`)])}let m=a({name:g.basename(t),data:p},{from:i.from&&s(i.from)?i.from:void 0,target:i.to&&o(i.to)?i.to:void 0});if(!m.ok)return c([m.message,...m.notes.map(e=>` - ${e.message}`),u(`app.cli.nothingWritten`)]);if(i.report){let e=D(m.report);return i.json?{ok:!0,lines:[JSON.stringify({ok:!0,written:!1,format:m.report.format,summary:m.report.summary,notes:m.report.notes,groups:e,details:m.report.details??[]},null,2)]}:{ok:!0,lines:[...M(m.report),``,u(`app.cli.import.reportOnly`)]}}let _=ce(t,n);if(i.confinedTo!==void 0&&!d(_,[i.confinedTo]))return c([u(`app.cli.import.outsideProject`,{file:r(_,Q)}),u(`app.cli.nothingWritten`)]);if(le(t,_)||b(_)&&!i.force)return c([u(`app.cli.import.exists`,{file:r(f(_),Q)})]);if(S(g.dirname(_),{recursive:!0}),e(_,m.bpmn),i.json){let e=D(m.report);return{ok:!0,lines:[JSON.stringify({ok:!0,file:_,format:m.report.format,summary:m.report.summary,notes:m.report.notes,groups:e,details:m.report.details??[]},null,2)]}}let v=[`draw.io`,`Visio`].includes(m.report.format)?[``,u(`app.cli.import.routes`,{file:r(f(_),Q)})]:[];return{ok:!0,lines:[u(`app.cli.wrote`,{file:r(f(_),Q)}),``,...M(m.report),...v]}}export{ue as importCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e,t}from"./chunk-features-C6o8of19.js";import{u as n}from"./chunk-license-BG88gpDZ.js";import{t as r}from"./chunk-context-rCJvBM9p.js";import{f as i,l as a,r as o}from"./chunk-deploy-DZgCTgaY.js";import{t as s}from"./chunk-diagrams-CtGMGTa8.js";import{a as c,t as l}from"./chunk-safeWrite-RgLbdyzl.js";import{_ as u,a as d,g as f,m as p,n as m,o as h,p as g,s as _}from"./chunk-testCases-BwimUfDC.js";import{b as v}from"./chunk-engine-CxgdJ2wO.js";import{s as y}from"./chunk-variables-CXAMjZIR.js";import{i as b,r as x}from"./chunk-redact-Bz1nB1gq.js";import{r as S}from"./chunk-translator-DNm9zRpP.js";import{a as C,l as w,u as T}from"./chunk-file-1YhfNmPn.js";import{a as E}from"./chunk-moddle-D3Ym38EZ.js";import{l as D}from"./chunk-model-BulEKnY1.js";import{t as O}from"./chunk-list-XuNpvC6j.js";import k from"node:path";import{existsSync as A,mkdirSync as j,readFileSync as M}from"node:fs";function N(e){return e.length<=2e3?e:`${e.slice(0,800)}\n...\n${e.slice(-1200)}`}function P(e){if(e.status<200||e.status>=300)throw new f(S(`app.incident.read.answered`,{status:e.status}),e.status);try{return JSON.parse(e.body)}catch{throw new f(S(`app.incident.read.notJson`),e.status)}}function F(e,t,n){let r=e===`CAMUNDA_8`,i={processId:n,elementId:String((r?t?.elementId:t?.activityId)??``),type:String((r?t?.errorType:t?.incidentType)??``),message:String((r?t?.errorMessage:t?.incidentMessage)??``),instance:String((r?t?.processInstanceKey:t?.processInstanceId)??``)},a=r?t?.incidentKey??t?.key:t?.id;return a!=null&&(i.id=String(a)),i}function I(e,t){return{method:`GET`,path:e===`CAMUNDA_8`?`/incidents/${encodeURIComponent(t)}`:`/incident/${encodeURIComponent(t)}`}}function L(e,t){return{method:`GET`,path:e===`CAMUNDA_8`?`/process-instances/${encodeURIComponent(t)}`:`/history/process-instance/${encodeURIComponent(t)}`}}function R(e,t){if(e===`CAMUNDA_8`)return null;let n=typeof t?.configuration==`string`?t.configuration:``;return n?t.incidentType===`failedJob`?{method:`GET`,path:`/job/${encodeURIComponent(n)}/stacktrace`}:t.incidentType===`failedExternalTask`?{method:`GET`,path:`/external-task/${encodeURIComponent(n)}/errorDetails`}:null:null}async function z(e,t){let n=await e(t);return n.status===404?null:P(n)}async function B(e,t,n){try{let r=u(e,n),i=null;try{i=await z(n,I(e,t))}catch(e){if(!(e instanceof f)||e.status<400||e.status>=500)throw e}let a=i?String((e===`CAMUNDA_8`?i.processInstanceKey:i.processInstanceId)??``):t;if(!a)return{ok:!1,reason:S(`app.incident.read.noInstance`,{key:t})};let o=await z(n,L(e,a));if(!o)return{ok:!1,reason:S(`app.incident.read.noSuchInstance`,{key:t})};let s=String((e===`CAMUNDA_8`?o.processDefinitionId:o.processDefinitionKey)??``),c=await r.snapshot(a),l=e===`CAMUNDA_8`?[]:P(await n({method:`GET`,path:`/incident?processInstanceId=${encodeURIComponent(a)}`})),d=c.incidents.map(e=>({processId:s,elementId:e.elementId,type:e.type??``,message:e.message,instance:a,...e.id===void 0?{}:{id:e.id}})),p=i?F(e,i,s):d[0];if(!p)return{ok:!1,reason:S(`app.incident.read.noIncident`,{key:t})};let m=d.filter(e=>e.elementId!==p.elementId||e.message!==p.message||e.type!==p.type),h=i??l.find(e=>String(e?.activityId)===p.elementId)??null,g=h?R(e,h):null,_=null;if(g){let e=await n(g);e.status>=200&&e.status<300&&e.body.trim()&&(_=N(b(e.body).trim()))}return{ok:!0,evidence:{engine:e,incident:p,others:m,variables:c.variables,path:c.elements,detail:_,variablesAreCurrent:!0}}}catch(e){return{ok:!1,reason:e instanceof Error?e.message:String(e)}}}const V=/(?:[A-Za-z0-9_.-]+:\d+:)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,H=`[A-Za-z0-9_.:-]+`;function U(e){return y(e).replace(/\d{5,}/g,`\\d+`).replace(/ /g,`\\s+`)}const W=/[A-Za-z0-9_.:-]/;function G(e,t){let n=t?e.length:0;for(;t?n>0&&W.test(e[n-1]):n<e.length&&W.test(e[n]);)n+=t?-1:1;return t?e.slice(0,n):e.slice(n)}function K(e){let t=[...e.matchAll(V)];if(t.length===0)return U(e);let n=[],r=0;for(let[i,a]of t.entries()){let t=e.slice(r,a.index);i>0&&(t=G(t,!1)),t=G(t,!0),t&&n.push(U(t)),(n.length===0||n[n.length-1]!==H)&&n.push(H),r=a.index+a[0].length}let i=G(e.slice(r),!1);return i&&n.push(U(i)),n.join(``)}function q(e){let t=b(e).replace(/\s+/g,` `).trim().slice(0,200).split(`***`);return t.map((e,n)=>{let r=n===0?e:e.trimStart();return n===t.length-1?r:r.trimEnd()}).filter(e=>e.length>0).map(K).join(`.*`)}function J(e,t){let n=e.correlationKey?.trim();if(!n)return;if(!n.startsWith(`=`))return n;let r=/^=\s*([A-Za-z_]\w*)\s*$/.exec(n)?.[1],i=r?t[r]:void 0;return i==null||typeof i==`object`?void 0:String(i)}const Y=/* @__PURE__ */ new Set([`bpmn:IntermediateCatchEvent`,`bpmn:ReceiveTask`,`bpmn:BoundaryEvent`]);function X(e,t){let{incident:n}=e,r=[],i=x(e.variables),a=e=>t.get(e)?.name??e,o=[{type:`CREATE_PROCESS_INSTANCE`,processDefinitionSelector:{processDefinitionId:n.processId},variables:i.values}],s={},c=/* @__PURE__ */ new Set,l=/* @__PURE__ */ new Set,u=[],d=!1,f=!1;for(let r of e.path){if(r.state!==`COMPLETED`||r.elementId===n.elementId)continue;let e=t.get(r.elementId);if(!e){u.includes(r.elementId)||u.push(r.elementId);continue}let a=e.job??e.external;if(a&&e.type!==`bpmn:UserTask`)c.has(a)||(c.add(a),o.push({type:`MOCK_JOB_WORKER_COMPLETE_JOB`,jobType:a}));else if(e.type===`bpmn:UserTask`)o.push({type:`COMPLETE_USER_TASK`,userTaskSelector:{elementId:e.id},variables:{}}),d=!0;else if(e.type!==`bpmn:StartEvent`&&Y.has(e.type)){if(e.event===`message`&&e.message){if(l.has(`m:${e.id}`))continue;l.add(`m:${e.id}`);let t=J(e,i.values);e.correlationKey&&t===void 0&&(f=!0),o.push({type:`CORRELATE_MESSAGE`,name:e.message,...t===void 0?{}:{correlationKey:t}})}else e.event===`signal`&&e.signal?o.push({type:`BROADCAST_SIGNAL`,signalName:e.signal}):e.event===`timer`&&(s[e.id]={then:`fire`})}}let p=t.get(n.elementId),m=!!p&&!!(p.job??p.external)&&p.type!==`bpmn:UserTask`;m&&(s[n.elementId]={then:`incident`,errorMessage:b(n.message).slice(0,1e3)}),p||r.push(S(`app.incident.note.elementGone`,{element:n.elementId})),u.length&&r.push(S(`app.incident.note.pathElementsGone`,{elements:u.join(`, `)})),i.names.length&&r.push(S(`app.incident.note.redacted`,{names:i.names.join(`, `)})),e.variablesAreCurrent&&r.push(S(`app.incident.note.currentVariables`)),d&&r.push(S(`app.incident.note.taskVariables`)),f&&r.push(S(`app.incident.note.correlationKey`)),t.get(n.elementId)?.calledProcess&&r.push(S(`app.incident.note.calledProcess`,{element:a(n.elementId)})),e.others.length&&r.push(S(`app.incident.note.otherIncidents`,{count:e.others.length})),m||r.push(S(`app.incident.note.mustHappenByItself`,{element:a(n.elementId)})),o.push({type:`ASSERT_PROCESS_INSTANCE`,processInstanceSelector:{processDefinitionId:n.processId},state:`IS_ACTIVE`,hasActiveIncidents:!0});let h={elementId:n.elementId,...n.type?{type:n.type}:{},message:q(n.message)};n.id&&(h.incident=n.id);let g=v(e.engine)?.key;return{testCase:{name:S(`app.incident.scenarioName`,{element:a(n.elementId),type:n.type||S(`app.incident.noType`)}),description:S(`app.incident.scenarioDescription`,{instance:n.instance}),instructions:o,"x-penstock":{...g?{engines:[g]}:{},...Object.keys(s).length?{behaviours:s}:{},reproduces:h}},notes:r,redacted:i.names,processId:n.processId}}async function Z(e,t){let n=await g(e,t);return{verdict:n.outcome===`passed`?`reproduced`:n.outcome===`failed`?`notReproduced`:`skipped`,message:n.message??null,result:n}}function Q(e){let t=[],n=e[`x-penstock`];for(let n of e.instructions)switch(n.type){case`CREATE_PROCESS_INSTANCE`:{let e=Object.keys(n.variables??{});t.push(e.length?S(`app.incident.step.start`,{process:n.processDefinitionSelector.processDefinitionId,names:O(e)}):S(`app.incident.step.startEmpty`,{process:n.processDefinitionSelector.processDefinitionId}));break}case`MOCK_JOB_WORKER_COMPLETE_JOB`:t.push(S(`app.incident.step.mock`,{type:n.jobType}));break;case`COMPLETE_USER_TASK`:t.push(S(`app.incident.step.task`,{element:n.userTaskSelector.elementId??n.userTaskSelector.taskName??``}));break;case`CORRELATE_MESSAGE`:t.push(S(`app.incident.step.message`,{name:n.name}));break;case`BROADCAST_SIGNAL`:t.push(S(`app.incident.step.signal`,{name:n.signalName}))}for(let[e,r]of Object.entries(n?.behaviours??{}))r.then===`fire`&&t.push(S(`app.incident.step.timer`,{element:e})),r.then===`incident`&&t.push(S(`app.incident.step.fail`,{element:e}));let r=n?.reproduces;return r&&t.push(r.type?S(`app.incident.step.expect`,{element:r.elementId,type:r.type}):S(`app.incident.step.expectAny`,{element:r.elementId})),t}const $=/<(?:[\w-]+:)?process\b[^>]*\bid="([^"]+)"/g;function ee(e,t){let n;try{n=M(e,`utf8`)}catch{return!1}for(let e of n.matchAll($))if(e[1]===t)return!0;return!1}async function te(e){let t=i(e.root);if(!t&&!e.ask)return{ok:!1,reason:S(`app.incident.node.noEngine`)};let n=e.ask??o(t),u=await B(t?a(t):`CAMUNDA_8`,e.key,n);if(!u.ok)return{ok:!1,reason:u.reason};let{evidence:f}=u,g=r(e.root).root,v=s(g).sort().find(e=>ee(e,f.incident.processId));if(!v)return{ok:!1,reason:S(`app.incident.node.noDiagram`,{process:f.incident.processId})};try{e.confine?.(v),e.confine?.(k.resolve(T(k.resolve(v))))}catch(e){return{ok:!1,reason:e instanceof Error?e.message:String(e)}}let y=X(f,D(await E(M(v,`utf8`)))),b=k.resolve(T(k.resolve(v))),x=A(b)?M(b,`utf8`):null,O=C(x,[y.testCase]);if(`problem`in O)return{ok:!1,reason:O.problem};let N=O.added.length>0?`create`:`exists`,P=!1;if(e.write&&N===`create`)try{j(k.dirname(b),{recursive:!0}),c([{path:b,content:w(O.file)}],g,{replace:!0}),P=!0}catch(e){if(e instanceof l)return{ok:!1,reason:e.message};throw e}let F=null,I=null;if(e.run){let t=(e.engineFor??m)(v);if(!t)I=S(`app.incident.node.noRunEngine`);else{let n=await h({ci:e.ci??!!process.env.CI,confirm:e.confirm})(t);if(n)I=n;else{let n=d(t.url??`default`);F=await Z(y.testCase,{engine:t.engine,resources:await _(v),runId:p(/* @__PURE__ */ new Date),builds:n,...e.stepTimeoutMs===void 0?{}:{stepTimeoutMs:e.stepTimeoutMs},...e.pollMs===void 0?{}:{pollMs:e.pollMs},...e.sleep?{sleep:e.sleep}:{},...e.now?{now:e.now}:{}})}}}return{ok:!0,evidence:f,diagram:v,casesFile:b,draft:y,action:N,written:P,reproduction:F,notRun:I}}const ne=[`scenario`];async function re(r,i,a){let[o,s,c]=r;if(o===void 0||!ne.includes(o))return{ok:!1,lines:[S(`app.cli.incident.unknownAction`,{action:o??``})]};if(!s)return{ok:!1,lines:[S(`app.cli.incident.needsKey`)]};let l=a??await n();if((i.write||i.run)&&!t(l))return{ok:!1,lines:e(l,`incident-scenario`)};let u=await te({key:s,root:k.resolve(c??i.folder??process.cwd()),write:i.write,run:i.run,...i.inject});if(!u.ok)return{ok:!1,lines:[u.reason]};let{evidence:d,draft:f,reproduction:p}=u,m=k.relative(process.cwd(),u.casesFile),h=m===``||m.startsWith(`..`)?u.casesFile:m,g=p===null||p.verdict===`reproduced`;if(i.format===`json`){let e={incident:{...d.incident,others:d.others.length},diagram:u.diagram,file:u.casesFile,write:i.write,action:u.action,written:u.written,scenario:f.testCase,notes:f.notes,redacted:f.redacted,reproduction:p?{verdict:p.verdict,message:p.message}:null,notRun:u.notRun};return{ok:g,refused:!1,lines:[JSON.stringify(e,null,2)]}}let _=[S(`app.cli.incident.found`,{type:d.incident.type||S(`app.incident.noType`),element:d.incident.elementId,process:d.incident.processId,instance:d.incident.instance}),S(`app.cli.incident.message`,{message:d.incident.message}),``,S(`app.cli.incident.scenario`,{name:f.testCase.name}),...Q(f.testCase).map(e=>` - ${e}`)];return f.notes.length>0&&_.push(``,S(`app.cli.incident.notes`),...f.notes.map(e=>` - ${e}`)),_.push(``),u.action===`exists`?_.push(S(`app.cli.incident.exists`,{file:h})):u.written?_.push(S(`app.cli.incident.written`,{file:h})):_.push(S(`app.cli.incident.dryRun`,{file:h})),u.notRun&&_.push(S(`app.cli.incident.notRun`,{reason:u.notRun})),p&&_.push(p.verdict===`reproduced`?S(`app.cli.incident.reproduced`):p.verdict===`skipped`?S(`app.cli.incident.notRun`,{reason:p.message??``}):S(`app.cli.incident.notReproduced`,{reason:p.message??``})),{ok:g&&p?.verdict!==`skipped`,lines:_}}export{re as incidentCommand};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import{o as e,r as t,t as n}from"./chunk-load-rfn3E0t5.js";import{r}from"./chunk-context-rCJvBM9p.js";import{o as i}from"./chunk-git-57LoLvY3.js";import{n as a}from"./chunk-systemError-n2E6isvg.js";import{r as o}from"./chunk-translator-DNm9zRpP.js";import{n as s}from"./chunk-status-CmYxwOCn.js";import{n as c,t as l}from"./chunk-version-CdS8_QQd.js";import{o as u,r as d}from"./chunk-penstockCli-C41P_G7i.js";import{d as f}from"./chunk-wrapper-CK7Xtes6.js";import{c as p,p as m,s as h,u as g}from"./chunk-engine-CxgdJ2wO.js";import{n as _,r as v,t as y}from"./chunk-examples-BG0lGXcZ.js";import{t as b}from"./chunk-table-BOiaGWwY.js";import{n as x}from"./chunk-list-XuNpvC6j.js";import{r as S}from"./chunk-project-lO_6DX8G.js";import{t as C}from"./chunk-own-CX-3lIbf.js";import w from"node:path";import{chmodSync as T,existsSync as E,mkdirSync as D,readFileSync as O,readdirSync as k,writeFileSync as A}from"node:fs";function ee(e=c()){let t=d(e);return`#!/bin/sh
|
|
2
|
+
# Installed by penstock init --hooks. Delete this file to stop it.
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
diagrams() {
|
|
6
|
+
git diff --cached -z --name-only --diff-filter=ACM -- '*.bpmn' '*.bpmn20.xml'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
any() {
|
|
10
|
+
[ -n "$(diagrams | tr -d '\\0')" ]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
any || exit 0
|
|
14
|
+
|
|
15
|
+
runner=""
|
|
16
|
+
if [ -x "./penstockw" ]; then
|
|
17
|
+
runner="./penstockw"
|
|
18
|
+
elif command -v penstock >/dev/null 2>&1; then
|
|
19
|
+
runner="penstock"
|
|
20
|
+
elif [ -x "./node_modules/.bin/penstock" ]; then
|
|
21
|
+
runner="./node_modules/.bin/penstock"
|
|
22
|
+
${t===null?``:`elif command -v npx >/dev/null 2>&1; then
|
|
23
|
+
runner="npx --yes ${t}"
|
|
24
|
+
`}fi
|
|
25
|
+
|
|
26
|
+
if [ -z "$runner" ]; then
|
|
27
|
+
echo "penstock: the Penstock command line was not found, so the staged diagrams were not checked. Install it with: npm install -g ${l}" >&2
|
|
28
|
+
exit 0
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
diagrams | xargs -0 $runner fmt --write
|
|
32
|
+
diagrams | xargs -0 git add
|
|
33
|
+
diagrams | xargs -0 $runner check --baseline
|
|
34
|
+
`}function j(e,t){if(!E(w.join(e,`.git`)))return t.push(`skipped ${o(`app.cli.hooks.skipped`)}`),!1;let n=i(e,`hooks`)??w.join(e,`.git`,`hooks`),c=w.join(n,`pre-commit`);try{if(D(n,{recursive:!0}),E(c)&&!O(c,`utf8`).includes(`penstock`))return t.push(`${s(`kept`).padEnd(8)} ${r(c)} - ${o(`app.cli.hooks.keptOther`)}`),!1;A(c,ee()),T(c,493)}catch(e){return t.push(`skipped ${a(e,n)}`),!1}return t.push(`${s(`wrote`).padEnd(8)} ${r(c)} - ${o(`app.cli.hooks.wrote`)}`),!0}const M=`5049c2fce613420ff27d7d9df6f0291fb5d1a667 # 2026-08-31`;if(!/^[0-9a-f]{40}$/.test(`5049c2fce613420ff27d7d9df6f0291fb5d1a667`))throw Error(`the Penstock action is pinned to a commit, not to a branch or a tag`);function N(e,t){return` ${o(`app.cli.init.${e}`,t)}`}function P(e){return`name: Diagrams
|
|
35
|
+
|
|
36
|
+
on: [push, pull_request]
|
|
37
|
+
|
|
38
|
+
jobs:
|
|
39
|
+
penstock:
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
permissions:
|
|
42
|
+
contents: read${e?`
|
|
43
|
+
security-events: write`:``}
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
- uses: actions/setup-node@v4
|
|
47
|
+
with:
|
|
48
|
+
node-version: 22
|
|
49
|
+
|
|
50
|
+
- uses: kern0x1b/penstock-release@${M}
|
|
51
|
+
${e?` env:
|
|
52
|
+
PENSTOCK_LICENSE: \${{ secrets.PENSTOCK_LICENSE }}
|
|
53
|
+
with:
|
|
54
|
+
command: check
|
|
55
|
+
sarif: penstock.sarif
|
|
56
|
+
baseline: 'true'
|
|
57
|
+
|
|
58
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
59
|
+
if: always()
|
|
60
|
+
with:
|
|
61
|
+
sarif_file: penstock.sarif
|
|
62
|
+
`:` with:
|
|
63
|
+
command: check
|
|
64
|
+
`}`}const F=`name: Penstock bot
|
|
65
|
+
|
|
66
|
+
on:
|
|
67
|
+
pull_request:
|
|
68
|
+
paths: ['**.bpmn', '**.bpmn20.xml', '**.bpmn.xml', '**.dmn', '**.form']
|
|
69
|
+
issue_comment:
|
|
70
|
+
types: [created]
|
|
71
|
+
|
|
72
|
+
permissions:
|
|
73
|
+
contents: read
|
|
74
|
+
pull-requests: write
|
|
75
|
+
issues: write
|
|
76
|
+
|
|
77
|
+
jobs:
|
|
78
|
+
answer:
|
|
79
|
+
if: >-
|
|
80
|
+
(github.event_name == 'pull_request' ||
|
|
81
|
+
(github.event.issue.pull_request && contains(github.event.comment.body, '/penstock'))) &&
|
|
82
|
+
(github.event_name != 'issue_comment' ||
|
|
83
|
+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) &&
|
|
84
|
+
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
|
|
85
|
+
runs-on: ubuntu-latest
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/checkout@v4
|
|
88
|
+
with:
|
|
89
|
+
fetch-depth: 0
|
|
90
|
+
- uses: actions/setup-node@v4
|
|
91
|
+
with:
|
|
92
|
+
node-version: 22
|
|
93
|
+
- uses: kern0x1b/penstock-release/bot@${M}
|
|
94
|
+
env:
|
|
95
|
+
PENSTOCK_LICENSE: \${{ secrets.PENSTOCK_LICENSE }}
|
|
96
|
+
`,I=`name: Penstock bot
|
|
97
|
+
|
|
98
|
+
on:
|
|
99
|
+
pull_request:
|
|
100
|
+
issue_comment:
|
|
101
|
+
types: [created]
|
|
102
|
+
|
|
103
|
+
jobs:
|
|
104
|
+
answer:
|
|
105
|
+
if: github.event_name == 'pull_request' || contains(github.event.comment.body, '/penstock')
|
|
106
|
+
runs-on: ubuntu-latest
|
|
107
|
+
steps:
|
|
108
|
+
- uses: actions/checkout@v4
|
|
109
|
+
with:
|
|
110
|
+
fetch-depth: 0
|
|
111
|
+
- uses: actions/setup-node@v4
|
|
112
|
+
with:
|
|
113
|
+
node-version: 22
|
|
114
|
+
- env:
|
|
115
|
+
GITHUB_TOKEN: \${{ secrets.PENSTOCK_TOKEN || github.token }}
|
|
116
|
+
PENSTOCK_LICENSE: \${{ secrets.PENSTOCK_LICENSE }}
|
|
117
|
+
run: ./penstockw bot .
|
|
118
|
+
`,L=`name: Diagrams
|
|
119
|
+
|
|
120
|
+
on: [push, pull_request]
|
|
121
|
+
|
|
122
|
+
jobs:
|
|
123
|
+
penstock:
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
steps:
|
|
126
|
+
- uses: actions/checkout@v4
|
|
127
|
+
- uses: actions/setup-node@v4
|
|
128
|
+
with:
|
|
129
|
+
node-version: 22
|
|
130
|
+
- run: ./penstockw check .
|
|
131
|
+
`;function R(e){return`diagrams:
|
|
132
|
+
image: node:22
|
|
133
|
+
rules:
|
|
134
|
+
- if: $CI_PIPELINE_SOURCE != "trigger"
|
|
135
|
+
script:
|
|
136
|
+
- ./penstockw check .${e?` --baseline`:``}
|
|
137
|
+
${e?`
|
|
138
|
+
penstock-bot:
|
|
139
|
+
image: node:22
|
|
140
|
+
variables:
|
|
141
|
+
GIT_DEPTH: 0
|
|
142
|
+
rules:
|
|
143
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
144
|
+
- if: $CI_PIPELINE_SOURCE == "trigger" && $TRIGGER_PAYLOAD
|
|
145
|
+
script:
|
|
146
|
+
- ./penstockw bot .
|
|
147
|
+
`:``}
|
|
148
|
+
deploy-diagrams:
|
|
149
|
+
image: node:22
|
|
150
|
+
when: manual
|
|
151
|
+
rules:
|
|
152
|
+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
153
|
+
variables:
|
|
154
|
+
PENSTOCK_PROFILE: prod
|
|
155
|
+
script:
|
|
156
|
+
- ./penstockw deploy . --wait
|
|
157
|
+
`}function z(e){return`pipelines:
|
|
158
|
+
pull-requests:
|
|
159
|
+
'**':
|
|
160
|
+
- step:
|
|
161
|
+
name: ${e?`Penstock bot`:`Diagrams`}
|
|
162
|
+
image: node:22
|
|
163
|
+
${e?` clone:
|
|
164
|
+
depth: full
|
|
165
|
+
script:
|
|
166
|
+
- export PENSTOCK_BOT_DIR=$BITBUCKET_CLONE_DIR/.penstock
|
|
167
|
+
- ./penstockw check . --baseline
|
|
168
|
+
- ./penstockw bot .
|
|
169
|
+
artifacts:
|
|
170
|
+
- .penstock/penstock-bot/*.svg
|
|
171
|
+
`:` script:
|
|
172
|
+
- ./penstockw check .
|
|
173
|
+
`}`}function B(e){return`trigger: none
|
|
174
|
+
|
|
175
|
+
pr:
|
|
176
|
+
paths:
|
|
177
|
+
include: ['*.bpmn', '**/*.bpmn', '**/*.bpmn20.xml', '**/*.bpmn.xml', '*.dmn', '**/*.dmn', '*.form', '**/*.form']
|
|
178
|
+
|
|
179
|
+
pool:
|
|
180
|
+
vmImage: ubuntu-latest
|
|
181
|
+
|
|
182
|
+
steps:
|
|
183
|
+
${e?` - checkout: self
|
|
184
|
+
fetchDepth: 0
|
|
185
|
+
- task: NodeTool@0
|
|
186
|
+
inputs:
|
|
187
|
+
versionSpec: '22.x'
|
|
188
|
+
- script: |
|
|
189
|
+
export PENSTOCK_BOT_DIR=$(Build.ArtifactStagingDirectory)
|
|
190
|
+
./penstockw bot .
|
|
191
|
+
env:
|
|
192
|
+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
|
193
|
+
PENSTOCK_LICENSE: $(PENSTOCK_LICENSE)
|
|
194
|
+
- publish: $(Build.ArtifactStagingDirectory)/penstock-bot
|
|
195
|
+
artifact: penstock-diagrams
|
|
196
|
+
condition: always()
|
|
197
|
+
`:` - checkout: self
|
|
198
|
+
- task: NodeTool@0
|
|
199
|
+
inputs:
|
|
200
|
+
versionSpec: '22.x'
|
|
201
|
+
- script: |
|
|
202
|
+
./penstockw check .
|
|
203
|
+
`}`}function V(e){return N(`licenceHint`,{where:o(`app.cli.init.${e}`)})}function H(){return N(`teamHint`)}function U(e){let t={github:[N(`githubWorkflowToken`),N(`githubForks`),N(`updateHint`),N(`updateHow`),V(`secretLicence`)],gitea:[N(`giteaWorkflowToken`),V(`secretLicence`)],gitlab:[N(`gitlabToken`),N(`gitlabWebhook`),` <gitlab>/api/v4/projects/<id>/ref/<default branch>/trigger/pipeline?token=<pipeline trigger token>`,N(`gitlabTriggerIsSecret`),N(`gitlabKeepUrl`),V(`maskedLicence`)],bitbucket:[N(`bitbucketToken`),N(`bitbucketTokenHow`),V(`securedLicence`)],azure:[N(`azureContribute`),N(`azureToken`),N(`azurePolicy`),V(`pipelineLicence`)]};return C(t,e)??[]}const W=[{engine:`camunda-8`,key:`camunda8`},{engine:`camunda-7`,key:`camunda7`},{engine:`operaton`,key:`operaton`},{engine:`cib-seven`,key:`cibSeven`},{engine:`flowable`,key:`flowable`},{engine:`activiti`,key:`activiti`},{engine:`classic`,key:`classic`}];function G(){return W.map(e=>({engine:e.engine,label:o(`app.cli.init.engine.${e.key}`)}))}const K=/\.(bpmn|bpmn20\.xml|dmn|form)$/i,q=/^(pom\.xml|build\.gradle(\.kts)?)$/,J=e=>K.test(e),Y=e=>q.test(e);function X(e){return S(e,J).length>0}async function Z(e,t){if(n.some(t=>E(w.join(e,t)))||X(e))return null;let r=G(),i=`${o(`app.cli.init.engineQuestion`)}\n${r.map((e,t)=>` ${t+1} ${e.label}`).join(`
|
|
204
|
+
`)}\n${o(`app.cli.init.numberQuestion`)}`;for(;;){let e=(await t(i)).trim();if(e===``)return r[0].engine;let n=/^\d+$/.test(e)?r[Number(e)-1]:void 0;if(n)return n.engine}}function Q(e){let t=/* @__PURE__ */ new Set;for(let n of S(e,J)){let e=h(O(n,`utf8`));e&&t.add(e)}for(let n of S(e,Y)){let e=m(O(n,`utf8`));e&&t.add(e)}return[`camunda-8`,`flowable`,`activiti`,`operaton`,`cib-seven`,`camunda-7`,`classic`].find(e=>t.has(e))??`classic`}function $(e,n){let r=w.join(e,`.gitignore`),i=t[0],a=E(r)?O(r,`utf8`):``;a.split(`
|
|
205
|
+
`).some(e=>e.trim()===i)||(A(r,`${a.trimEnd()}\n\n# ${o(`app.config.local.gitignore`)}\n${i}\n`.trimStart()),n.push(`${s(`updated`)} ${o(`app.cli.init.gitignore`,{entry:i})}`))}function te(e,t,n){if(!v(t)){let e=[...y];return{ok:!1,lines:[o(`app.cli.init.unknownExample`,{example:t,names:e.slice(0,-1).join(`, `),last:e[e.length-1]})]}}if((E(e)?k(e).filter(e=>e!==`.git`):[]).length>0)return{ok:!1,lines:[o(`app.cli.init.folderNotEmpty`,{folder:r(e)})]};for(let[i,a]of Object.entries(_(t))){let t=w.join(e,i);D(w.dirname(t),{recursive:!0}),A(t,a),n.push(`${s(`wrote`).padEnd(8)} ${r(t)}`)}return n.push(N(`exampleReadme`)),null}function ne(t,i,a,c,l,d){let m=l?w.resolve(t):e(t),h=[],_=d===void 0?null:p(d);if(d!==void 0&&!_){let e=W.map(e=>e.engine);return{ok:!1,lines:[o(`app.cli.init.unknownEngine`,{engine:d,names:e.slice(0,-1).join(`, `),last:e[e.length-1]})]}}if(l&&_&&_!==l)return{ok:!1,lines:[o(`app.cli.init.engineDoesNotFit`,{example:l,label:g(l),engine:d})]};if(l){let e=te(m,l,h);if(e)return e}let v=n.map(e=>w.join(m,e)).find(E);if(l)h.push(`${s(`kept`).padEnd(8)} ${r(v??w.join(m,n[0]))} ${o(`app.cli.init.asTheExampleWroteIt`)}`);else if(v)h.push(`${s(`kept`).padEnd(8)} ${r(v)} - ${o(`app.cli.init.alreadyAnswers`)}`),_&&h.push(` ${o(`app.cli.init.engineNotUsed`,{engine:_,file:w.basename(v),says:/^engine:\s*(\S+)/m.exec(O(v,`utf8`))?.[1]??o(`app.cli.init.whatItRunsOn`)})}`);else{let e=_??Q(m),t=w.join(m,n[0]);A(t,`# yaml-language-server: $schema=${u}\n# ${o(`app.cli.init.configWhatItIs`)}\n# ${o(`app.config.file.overrides`)}\n\nengine: ${e}\n\n# deployment:\n# url: http://localhost:8080/engine-rest\n# name: ${w.basename(m)}\n#\n# profiles:\n# prod:\n# deployment:\n# url: https://bpm.example.com/engine-rest\n`),h.push(`${s(`wrote`).padEnd(8)} ${r(t)} (engine: ${e})`)}$(m,h),f(m,h),a&&j(m,h);let y={github:[[w.join(`.github`,`workflows`,`penstock.yml`),P(c)],...c?[[w.join(`.github`,`workflows`,`penstock-bot.yml`),F]]:[],[w.join(`.github`,`workflows`,`penstock-publish.yml`),`name: Publish diagrams
|
|
206
|
+
|
|
207
|
+
on:
|
|
208
|
+
push:
|
|
209
|
+
branches: [main]
|
|
210
|
+
paths: ['**.bpmn', '**.bpmn20.xml', '**.bpmn.xml', '**.dmn', '**.form']
|
|
211
|
+
workflow_dispatch:
|
|
212
|
+
|
|
213
|
+
jobs:
|
|
214
|
+
deploy:
|
|
215
|
+
runs-on: ubuntu-latest
|
|
216
|
+
environment: production
|
|
217
|
+
steps:
|
|
218
|
+
- uses: actions/checkout@v4
|
|
219
|
+
- uses: actions/setup-node@v4
|
|
220
|
+
with:
|
|
221
|
+
node-version: 22
|
|
222
|
+
- env:
|
|
223
|
+
PENSTOCK_PROFILE: prod
|
|
224
|
+
PENSTOCK_PASSWORD: \${{ secrets.PENSTOCK_PASSWORD }}
|
|
225
|
+
PENSTOCK_TOKEN: \${{ secrets.PENSTOCK_TOKEN }}
|
|
226
|
+
run: ./penstockw deploy . --wait
|
|
227
|
+
`]],gitea:[[w.join(`.gitea`,`workflows`,c?`penstock-bot.yml`:`penstock.yml`),c?I:L]],forgejo:[[w.join(`.forgejo`,`workflows`,c?`penstock-bot.yml`:`penstock.yml`),c?I:L]],gitlab:[[`penstock.gitlab-ci.yml`,R(c)]],bitbucket:[[`bitbucket-pipelines.penstock.yml`,z(c)]],azure:[[`azure-pipelines.penstock.yml`,B(c)]]},b=C(y,i);if(i&&b){for(let[e,t]of b){let n=w.join(m,e);D(w.dirname(n),{recursive:!0}),A(n,t),h.push(`${s(`wrote`).padEnd(8)} ${r(n)}`)}i===`gitlab`&&h.push(N(`includeFrom`)),i===`bitbucket`&&h.push(N(`mergeInto`)),c?h.push(...U(i===`forgejo`?`gitea`:i)):h.push(H())}else if(i)return{ok:!1,lines:[o(`app.cli.init.unknownCi`,{ci:i})]};return{ok:!0,lines:ie(h)}}const re=[`wrote`,`kept`,`updated`,`skip`];function ie(e){let t=re.map(e=>s(e).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)),n=RegExp(`^(${t.join(`|`)})\\s+(.*)$`),r=e=>{let t=e.indexOf(` - `);if(t>=0)return{target:e.slice(0,t),details:e.slice(t+3)};let n=x()?e.indexOf(` `):-1;return n<0?{target:e,details:``}:{target:e.slice(0,n),details:e.slice(n+1)}},i=[],a=[],c=()=>{a.length!==0&&(i.push(...b(a,{columns:[{name:`action`,header:o(`app.cli.header.action`),minWidth:8},{name:`target`,header:o(`app.cli.header.target`)},{name:`details`,header:o(`app.cli.header.details`)}],headers:!1})),a.length=0)};for(let t of e){let e=n.exec(t);e?a.push({action:e[1],...r(e[2].trim())}):(c(),i.push(t))}return c(),i}export{Z as chooseEngine,ne as initCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-context-rCJvBM9p.js";import{t as r}from"./chunk-report-w7YZwhyg.js";import{a as i,b as a,c as o,s,t as c}from"./chunk-engine-CxgdJ2wO.js";import{d as l,n as u,u as d}from"./chunk-moddle-D3Ym38EZ.js";import{a as f,r as p,t as m}from"./chunk-translator-DNm9zRpP.js";import{n as h,r as g,t as _}from"./chunk-kind-FnMP6Ybq.js";import{i as ee,n as v,r as y}from"./chunk-rules-Tds3uL4b.js";import{r as te,t as ne}from"./chunk-unreadableDiagram-CcrctihL.js";import{D as re,T as b}from"./chunk-load-rfn3E0t5.js";import{t as ie}from"./chunk-buffers-B8jONhEB.js";import{createRequire as x}from"node:module";import S from"node:path";import{existsSync as ae,readFileSync as oe}from"node:fs";function C(e){let[t,n]=f(m()).quotes;return t?`${t}${e}${n}`:e}function w(e){let t=`app.rules.compat.word.${se(e)}`,n=p(t);return n===t?g(e,!0):n}function se(e){let t=e.includes(`:`)?e.slice(e.indexOf(`:`)+1):e;return t&&t[0].toLowerCase()+t.slice(1)}function T(e){return e&&e[0].toUpperCase()+e.slice(1)}const E=/^[aeiou]/,ce=/^(user|uni|use|eu)/;function D(e){return E.test(e)&&!ce.test(e)?`an`:`a`}function O(e){return typeof e==`string`?e:e?.$type??``}function k(e){return(Array.isArray(e)?e:e===void 0?[]:[e]).map(O).filter(Boolean)}function le(e){let t=e.map(C);return t.length>1?p(`app.rules.compat.joinOr`,{list:t.slice(0,-1).join(`, `),last:t[t.length-1]}):t[0]??``}function A(e){return e.version?p(`app.rules.compat.targets`,{version:e.version}):``}function j(e){return p(`app.rules.compat.needs`,{allowed:e.allowed,targets:A(e)})}function ue(e){let t=k(e.data.requiredExtensionElement).map(e=>e.slice(e.indexOf(`:`)+1));return t.length===0?null:t.includes(`CalledDecision`)?p(`app.rules.compat.callsNoDecision`,{subject:e.subject}):t.includes(`Script`)?p(`app.rules.compat.hasNoScript`,{subject:e.subject}):t.includes(`TaskDefinition`)?p(`app.rules.compat.hasNoJobType`,{subject:e.subject}):null}function de(e,t){let{subject:n,data:r}=t,i=r.type,a=k(r.requiredProperty);switch(e){case`implementation`:return i===`camunda.propertyRequired`&&a.includes(`type`)?p(`app.rules.compat.hasNoJobType`,{subject:n}):i===`camunda.extensionElementRequired`?ue(t):null;case`called-element`:return i===`camunda.extensionElementRequired`||a.includes(`processId`)?p(`app.rules.compat.callsNoProcess`,{subject:n}):null;case`user-task-definition`:return i===`camunda.extensionElementRequired`?p(`app.rules.compat.hasNoForm`,{subject:n}):null;case`zeebe-user-task`:return i===`camunda.extensionElementRequired`?p(`app.rules.compat.isJobWorkerUserTask`,{subject:n}):null;case`user-task-form`:case`start-event-form`:return i===`camunda.propertyRequired`?p(`app.rules.compat.formWithNoId`,{subject:n}):null;case`message-reference`:case`error-reference`:case`signal-reference`:case`escalation-reference`:{let t=e.slice(0,e.indexOf(`-`));return i!==`camunda.propertyRequired`||!a.includes(`${t}Ref`)?null:p(e===`message-reference`?`app.rules.compat.refersToNoMessage`:e===`error-reference`?`app.rules.compat.refersToNoError`:e===`signal-reference`?`app.rules.compat.refersToNoSignal`:`app.rules.compat.refersToNoEscalation`,{subject:n})}case`subscription`:return i===`camunda.propertyRequired`&&a.includes(`correlationKey`)?p(`app.rules.compat.messageWithoutCorrelationKey`,{subject:n}):null;case`sequence-flow-condition`:return p(i===`camunda.propertyRequired`?`app.rules.compat.needsConditionOrDefault`:`app.rules.compat.conditionNotAllowedHere`,{subject:n});case`variable-name`:return p(`app.rules.compat.unreadableVariableName`,{subject:n});case`loop-characteristics`:return i===`camunda.extensionElementRequired`?p(`app.rules.compat.missingInputCollection`,{subject:n}):null;case`history-time-to-live`:return p(`app.rules.compat.historyTimeToLiveMissing`);case`element-type`:return i===`camunda.elementTypeNotAllowed`?p(`app.rules.compat.elementNeedsVersion`,{elements:T(h(t.kind||O(r.node),`other`)),allowed:t.allowed,targets:A(t)}):null;case`executable-process`:return p(`app.rules.compat.notExecutable`,{subject:n});case`no-multiple-none-start-events`:return p(`app.rules.compat.moreThanOneBlankStart`);case`link-event`:return p(`app.rules.compat.duplicateLinkName`);case`ad-hoc-sub-process`:return i===`camunda.childElementOfTypeRequired`?p(`app.rules.compat.noActivityInside`,{subject:n}):null;case`collapsed-subprocess`:return p(`app.rules.compat.isCollapsed`,{subject:n});case`event-based-gateway-target`:return p(`app.rules.compat.receiveTaskAfterGateway`);default:return null}}function fe(e){let{subject:t,data:n,allowed:r}=e,i=typeof n.property==`string`?C(w(n.property)):``,a=C(w(O(n.extensionElement)));switch(n.type){case`camunda.propertyRequired`:{let i=le(k(n.requiredProperty).map(e=>w(e)));return r?p(`app.rules.compat.needsPropertyBefore`,{subject:t,list:i,allowed:r,targets:A(e)}):p(`app.rules.compat.missingProperty`,{subject:t,list:i})}case`camunda.extensionElementRequired`:{let e=k(n.requiredExtensionElement)[0];return e?p(`app.rules.compat.missingExtension`,{subject:t,required:C(w(e))}):null}case`camunda.propertyNotAllowed`:return r?D(i)===`an`?p(`app.rules.compat.usesProperty.an`,{subject:t,property:i,needs:j(e)}):p(`app.rules.compat.usesProperty.a`,{subject:t,property:i,needs:j(e)}):D(i)===`an`?p(`app.rules.compat.cannotHaveProperty.an`,{subject:t,property:i}):p(`app.rules.compat.cannotHaveProperty.a`,{subject:t,property:i});case`camunda.extensionElementNotAllowed`:return r?D(a)===`an`?p(`app.rules.compat.usesExtension.an`,{subject:t,extension:a,needs:j(e)}):p(`app.rules.compat.usesExtension.a`,{subject:t,extension:a,needs:j(e)}):D(a)===`an`?p(`app.rules.compat.cannotHaveExtension.an`,{subject:t,extension:a}):p(`app.rules.compat.cannotHaveExtension.a`,{subject:t,extension:a});case`camunda.propertyValueNotAllowed`:case`camunda.propertyTypeNotAllowed`:return r?D(i)===`an`?p(`app.rules.compat.propertyValueNeeds.an`,{subject:t,property:i,needs:j(e)}):p(`app.rules.compat.propertyValueNeeds.a`,{subject:t,property:i,needs:j(e)}):D(i)===`an`?p(`app.rules.compat.propertyValueNotAllowed.an`,{subject:t,property:i}):p(`app.rules.compat.propertyValueNotAllowed.a`,{subject:t,property:i});case`camunda.expressionNotAllowed`:case`camunda.expressionValueNotAllowed`:return r?p(`app.rules.compat.expressionNeeds`,{subject:t,property:i,needs:j(e)}):p(`app.rules.compat.cannotUseExpression`,{subject:t,property:i});case`camunda.feelExpressionInvalid`:return p(`app.rules.compat.invalidFeelExpression`,{subject:t});case`camunda.feelExpressionUnsupportedFunction`:return p(`app.rules.compat.unsupportedFeelFunction`,{subject:t,version:e.version||p(`app.rules.compat.here`)});case`camunda.loopNotAllowed`:return p(`app.rules.compat.loopThatNeverWaits`,{subject:t});case`camunda.elementCollapsedNotAllowed`:return p(`app.rules.compat.isCollapsed`,{subject:t});case`camunda.elementMultipleNotAllowed`:return p(`app.rules.compat.moreThanOneElement`,{kind:_(e.kind||p(`app.rules.compat.element`))});case`camunda.attachedToRefElementTypeNotAllowed`:return p(`app.rules.compat.badBoundaryHost`,{subject:t});case`camunda.propertyDeprecated`:return D(i)===`an`?p(`app.rules.compat.deprecatedProperty.an`,{subject:t,property:i}):p(`app.rules.compat.deprecatedProperty.a`,{subject:t,property:i});case`camunda.secretExpressionFormatDeprecated`:case`camunda.secretExpressionFormatLegacy`:return p(`app.rules.compat.deprecatedSecret`,{subject:t})}let o=typeof n.type==`string`?n.type:``;return o.startsWith(`camunda.secretReference`)?p(`app.rules.compat.unresolvableSecret`,{subject:t}):o.startsWith(`camunda.agent`)?p(`app.rules.compat.invalidAgentSetting`,{subject:t}):null}function pe(e){let t=e.replace(/<([^<>]*)>/g,(e,t)=>/^[a-z]+:/i.test(t)&&/^(bpmn|bpmndi|zeebe|camunda|operaton|modeler):/i.test(t)?C(w(t)):t).replace(/\s+/g,` `).trim().replace(/[.]+$/,``);return t&&t[0].toLowerCase()+t.slice(1)}function me(e){try{let t=e.kind??``,n=(e.name?.trim()??``)||(t?p(`app.rules.compat.theKind`,{kind:_(t)}):p(`app.rules.compat.thisElement`)),r=e.data??{},i=typeof r.allowedVersion==`string`?r.allowedVersion:null,a={subject:n,kind:t,version:e.version??``,data:r,allowed:i};return de(e.rule,a)??fe(a)??p(`app.rules.compat.fallback`,{subject:n,message:pe(e.message)})}catch{return e.message}}const M=`penstock-engine`,he={"http://camunda.org/schema/1.0/bpmn":`Camunda 7`,"http://camunda.org/schema/zeebe/1.0":`Camunda 8`,"http://operaton.org/schema/1.0/bpmn":`Operaton`,[i]:`Flowable`,[c]:`Activiti`},N={flowable:i,activiti:c},P={flowable:`Flowable`,activiti:`Activiti`},F={camunda:`http://camunda.org/schema/1.0/bpmn`,zeebe:`http://camunda.org/schema/zeebe/1.0`,operaton:`http://operaton.org/schema/1.0/bpmn`,flowable:i,activiti:c},I=[`assignee`,`candidateUsers`,`candidateGroups`,`dueDate`,`skipExpression`,`expression`,`delegateExpression`];function L(e){let t=e;for(;t.$parent;)t=t.$parent;let n={};for(let[e,r]of Object.entries(t.$attrs??{}))e.startsWith(`xmlns:`)&&typeof r==`string`&&(n[e.slice(6)]=r);return n}function R(e,t){return t[e]??F[e]}function z(e){let t=e;for(;t&&!t.id;)t=t.$parent;return t?.id??``}function B(e){return(typeof e.name==`string`?e.name.trim():``)||p(`app.rules.lint.theElement`,{type:_(String(e.$type??``))})}function V(e){return Object.keys(e.$attrs??{}).filter(e=>e.includes(`:`)&&!e.startsWith(`xmlns:`))}function H(e,t){return typeof e.$instanceOf==`function`?e.$instanceOf(t):e.$type===t}function U(e,t,n){return(typeof e.get==`function`?e.get(`${t}:${n}`):void 0)??e.$attrs?.[`${t}:${n}`]}function ge(e){let t=e.flavour??`flowable`;return{check(e,n){let r=L(e),i=/* @__PURE__ */ new Map,a=(e,n)=>{let a=R(n,r),o=a?he[a]:void 0;o&&a!==N[t]&&i.set(o,[...i.get(o)??[],e])};for(let t of V(e))a(t,t.slice(0,t.indexOf(`:`)));for(let t of e.extensionElements?.values??[]){let e=String(t.$type??``);e.includes(`:`)&&a(e,e.slice(0,e.indexOf(`:`)))}for(let[r,a]of i)n.report(z(e),p(`app.rules.engineCheck.foreignExtension`,{subject:B(e),names:[...new Set(a)].join(`, `),owner:r,engine:P[t]}))}}}function W(e,t){let n=L(e);return V(e).filter(e=>{let r=e.slice(0,e.indexOf(`:`));return r===t||R(r,n)===N[t]})}function _e(e){let t=e.flavour??`flowable`;return{check(e,n){for(let r of W(e,t)){let i=r.slice(r.indexOf(`:`)+1);d.some(e=>e.name===i&&e.flavours.includes(t))||n.report(z(e),p(`app.rules.engineCheck.unknownAttribute`,{subject:B(e),name:r,engine:P[t]}))}}}}function ve(e){let t=e.flavour??`flowable`;return{check(e,n){for(let r of W(e,t)){let i=r.slice(r.indexOf(`:`)+1),a=l(t,i);a.length===0||a.some(t=>t.owners.some(t=>H(e,t)))||n.report(z(e),p(`app.rules.engineCheck.attributeNotAllowed`,{subject:B(e),name:r}))}}}}function ye(e){let t=e.flavour??`flowable`;return{check(e,n){(H(e,`bpmn:ComplexGateway`)||t===`activiti`&&H(e,`bpmn:ConditionalEventDefinition`))&&n.report(z(e),p(`app.rules.engineCheck.unsupportedElement`,{subject:B(e),engine:P[t]}))}}}function be(e){let t=e.flavour??`flowable`;return{check(e,n){if(!H(e,`bpmn:ServiceTask`)||H(e,`bpmn:SendTask`))return;let r=[`class`,`expression`,`delegateExpression`,`type`].some(n=>{let r=U(e,t,n);return typeof r==`string`&&r.trim()!==``}),i=typeof e.implementation==`string`&&e.implementation.trim()!==``;r||i||n.report(z(e),p(`app.rules.engineCheck.noImplementation`,{subject:B(e),engine:P[t]}))}}}function xe(){return{check(e,t){H(e,`bpmn:ScriptTask`)&&(typeof e.scriptFormat==`string`&&e.scriptFormat.trim()||t.report(z(e),p(`app.rules.engineCheck.noScriptFormat`,{subject:B(e)})))}}}function Se(e){let t=e.flavour??`flowable`;return{check(e,n){let r=e.conditionExpression,i=typeof r?.body==`string`?r.body.trim():``,a=typeof r?.language==`string`?r.language.toLowerCase():``,o=H(e,`bpmn:SequenceFlow`)&&r!==void 0&&(a.includes(`feel`)||i.startsWith(`=`)&&!i.includes("${")),s=I.find(n=>{let r=U(e,t,n);return typeof r==`string`&&r.trim().startsWith(`=`)});(o||s)&&n.report(z(e),p(`app.rules.engineCheck.feelExpression`,{subject:B(e),engine:P[t]}))}}}const G={"foreign-extension":ge,"unknown-attribute":_e,"attribute-not-allowed":ve,"unsupported-element":ye,"service-task-implementation":be,"script-format":xe,"feel-expression":Se},Ce=Object.keys(G),we={"foreign-extension":`error`,"unknown-attribute":`warn`,"attribute-not-allowed":`warn`,"unsupported-element":`error`,"service-task-implementation":`error`,"script-format":`error`,"feel-expression":`error`};function Te(e){return{rules:Object.fromEntries(Ce.map(t=>[`${M}/${t}`,[we[t],{flavour:e}]]))}}const K={resolveRule:e=>G[e],resolveConfig:e=>e===`flowable`||e===`activiti`?Te(e):void 0},q=`camunda-compat`,Ee=[`camunda-cloud-1-0`,`camunda-cloud-1-1`,`camunda-cloud-1-2`,`camunda-cloud-1-3`,`camunda-cloud-8-0`,`camunda-cloud-8-1`,`camunda-cloud-8-2`,`camunda-cloud-8-3`,`camunda-cloud-8-4`,`camunda-cloud-8-5`,`camunda-cloud-8-6`,`camunda-cloud-8-7`,`camunda-cloud-8-8`,`camunda-cloud-8-9`,`camunda-cloud-8-10`,`camunda-cloud-8-11`,`camunda-platform-7-19`,`camunda-platform-7-20`,`camunda-platform-7-21`,`camunda-platform-7-22`,`camunda-platform-7-23`,`camunda-platform-7-24`],J={"camunda-cloud":[],"camunda-platform":[]};for(let e of Ee){let[,t,n,r]=/^(camunda-(?:cloud|platform))-(\d+)-(\d+)$/.exec(e)??[];J[t].push({config:e,major:Number(n),minor:Number(r)})}function Y(e,t){return{platform:e,version:`${t.major}.${t.minor}`,config:t.config}}function De(e,t){let n=a(e)?.family;if(n===`flowable`||n===`activiti`)return{platform:n,version:``,config:n};if(n!==`camunda-8`&&n!==`camunda-7`)return null;let r=n===`camunda-8`?`camunda-cloud`:`camunda-platform`,i=J[r],o=i[i.length-1],s=/^\s*(\d+)\.(\d+)/.exec(t??``);if(!s)return Y(r,o);let c=Number(s[1])*1e3+Number(s[2]),l=i.filter(e=>e.major*1e3+e.minor<=c);return Y(r,l.length>0?l[l.length-1]:i[0])}function Oe(e){let t=e?.$attrs;if(!t)return null;let n=Object.keys(t).find(e=>e.endsWith(`:executionPlatformVersion`)),r=n?t[n]:null;return typeof r==`string`&&r.trim()?r.trim():null}const ke=`plugin:${q}/`;function Ae(e){let t=e.rules;if(typeof t!=`object`||!t)return e;let n=Object.fromEntries(Object.entries(t).map(([e,t])=>[e.startsWith(`compat/`)?`${q}/${e.slice(7)}`:e,t]));return{...e,rules:n}}function X(e){return e.platform===`flowable`||e.platform===`activiti`}function je(e,t){if(!t||typeof e!=`object`||!e)return e;let n=Ae(e),r=n.extends,i=Array.isArray(r)?r:r?[r]:[],a=X(t)?`plugin:${M}/`:ke;return i.some(e=>typeof e==`string`&&e.startsWith(a))?n:{...n,extends:[...i,`${a}${t.config}`]}}const Me=/* @__PURE__ */ new Set([`no-multiple-none-start-events`]);function Ne(e,t){return(n={})=>{let r=t(n);return{...r,check(t,i){let a=Object.create(i);return a.report=(r,a,o)=>{let s=o&&!Array.isArray(o)&&typeof o==`object`?o:void 0,c=t.id===r,l=me({rule:e,message:a,name:s?.name??(c?t.name:void 0),kind:c?t.$type:void 0,version:n.version,data:s?.data}),u=Me.has(e)&&s?{...s,data:{...s.data,scope:c?t.$parent?.id:t.id}}:o;i.report(r,l,u)},r.check(t,a)}}}}function Pe(e,t){let n=e,r=t;return{resolveRule:(e,t)=>e===`bpmnlint-plugin-penstock-engine`?K.resolveRule(t):e===`bpmnlint-plugin-camunda-compat`?Ne(t,r.resolveRule(e,t)):n.resolveRule(e,t),resolveConfig:(e,t)=>e===`bpmnlint-plugin-penstock-engine`?K.resolveConfig(t):(e===`bpmnlint-plugin-camunda-compat`?r:n).resolveConfig(e,t)}}function Fe(e,t,n){return t?{config:je(e.config,t),resolver:Pe(e.resolver,n)}:e}function Ie(e){let t=ne(e instanceof Error?e:Error(String(e)));return te(t)}const Z=x(import.meta.url),Q=Z("bpmnlint/lib/resolver/node-resolver"),$=new Q({require:Z});function Le(e){let t=n(e).policy;return t&&t.manifest&&t.refused.length===0?t.manifest.rules:{}}function Re(r,i=!1){let a=Le(r);if(i)return{config:b(v(null),a),resolver:$};let{root:o,values:s}=n(r),c=e(t(s.lint).configPath),l=c?S.resolve(o,c):S.join(o,`.bpmnlintrc`),u=ae(l);return{config:b(v(u?oe(l,`utf8`):null),a),resolver:new Q({require:x(S.join(o,`penstock-rules.js`))})}}async function ze(t,i={}){let c=Re(t,i.builtInOnly===!0);try{let i=ie(t),l=o(e(n(t).values.engine))??s(i),{rootElement:d,warnings:f=[]}=await u(a(l)?.moddle??`plain`).fromXML(i),m=f.filter(e=>/^unresolved reference/.test(String(e.message))&&e.element?.id);if(m.length>0)return m.map(e=>({file:t,rule:`bpmnlint`,message:p(`app.output.unresolvedReference`,{id:e.element.id,property:String(e.property).replace(/^.*:/,``),value:String(e.value)}),severity:`error`,elements:[e.element.id]}));let h=Fe(c,De(l,Oe(d)),$),g=n(t).policy,_=g&&g.manifest&&g.refused.length===0?g:null;return(await ee(d,h)).map(e=>r(y(e.rule),{file:t,..._&&re(e.rule,_.manifest?.rules)?{policy:_.name??void 0}:{},rule:y(e.rule)===`bpmnlint`?`bpmnlint/${e.rule}`:e.rule,message:e.elements.length>0?`${e.message} (${e.elements.join(`, `)})`:e.message,severity:e.severity,elements:e.elements}))}catch(e){return[{file:t,rule:`bpmnlint`,message:p(`app.output.rulesCouldNotRun`,{reason:Ie(e)}),severity:`error`}]}}export{ze as ruleFindings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r as e}from"./chunk-translator-DNm9zRpP.js";import{n as t}from"./chunk-version-CdS8_QQd.js";const n=/* @__PURE__ */ new Set([`--stdio`,`--lang`,`--profile`,`--clientProcessId`]),r=/* @__PURE__ */ new Set([`--lang`,`--profile`,`--clientProcessId`]);function i(e){let t=e.indexOf(`lsp`)+1;for(let i=t;i<e.length;i+=1){let t=e[i];if(!t.startsWith(`-`))continue;let a=t.split(`=`)[0];if(!n.has(a))return a.slice(0,40);r.has(a)&&!t.includes(`=`)&&(i+=1)}return null}async function a(n,r){let a=i(n);if(a!==null)return process.stderr.write(`${e(`app.lsp.stdioOnly`,{option:a})}\n`),1;if(!r&&process.stdin.isTTY)return process.stderr.write(`${e(`app.lsp.terminalHint`)}\n`),1;let o=(...e)=>{process.stderr.write(`${e.map(String).join(` `).slice(0,500)}\n`)};console.log=o,console.info=o,console.debug=o,process.on(`uncaughtException`,e=>o(e.message.slice(0,200))),process.on(`unhandledRejection`,e=>o(String(e instanceof Error?e.message:e).slice(0,200)));let{serveStdio:s}=await import(`./chunk-serve-CKt2rO05.js`);return s({input:process.stdin,output:process.stdout,error:process.stderr},t()??`development`)}export{a as lspCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-translator-DNm9zRpP.js";import{t}from"./chunk-own-CX-3lIbf.js";import{f as n}from"./chunk-git-57LoLvY3.js";import{i as r,n as i,r as a,t as o}from"./chunk-help-CxU1lT1Y.js";import{n as s}from"./chunk-version-CdS8_QQd.js";import{parseArgs as c}from"node:util";const l=/* @__PURE__ */ `--profile.--lang.--format.--ci.--out.--base.--images-dir.--image-base.--images-link.--stage.--distribution.--ops.--ops-file.--after.--name.--id.--event.--set.--input.--output.--condition.--package.--only.--junit-xml.--timeout.--example.--engine.--target.--fail-on.--port.--host.--project.--element.--variables.--variables-file.--complete.--error.--workers.--env.--against.--secret-prefix.--agent.--min-rule-coverage.--exclude.--scenarios.--original-profile.--converted-profile.--severity.--source.--from.--to.--confirm.--approve-file.--since.--modeler-data`.split(`.`),u={lint:{to:[`check`,`--only`,`rules`],name:`penstock check --only rules`},analyze:{to:[`check`,`--only`,`flow`],name:`penstock check --only flow`},against:{to:[`diff`],name:`penstock diff <ref>`},config:{to:[`doctor`],name:`penstock doctor`},profiles:{to:[`doctor`],name:`penstock doctor`},upgrade:{to:[`license`,`buy`],name:`penstock license buy`},login:{to:[`license`,`login`],name:`penstock license login`},logout:{to:[`license`,`logout`],name:`penstock license logout`},wrapper:{to:[`update`],name:`penstock update`}},d={"--json":[`--format`,`json`],"--image":[`--images`]},f={list:[`paths`],run:[`test-cases`],generate:[`test-cases`,`--generate`]},p=Object.fromEntries(l.map(e=>[e.slice(2),{type:`string`,multiple:!0}]));p.out={type:`string`,multiple:!0,short:`o`};function m(e){let t=c({args:e,allowPositionals:!0,strict:!1,options:p,tokens:!0});return{values:t.values,positionals:[...t.positionals],tokens:[...t.tokens]}}function h(e){let t=m(e).tokens.find(e=>e.kind===`positional`);return!t||t.index===void 0?{at:-1,name:``,after:void 0}:{at:t.index,name:String(t.value),after:e[t.index+1]}}function g(n){let{at:r,name:i}=h(n),a=t(u,i);a&&process.stderr.write(`${e(`app.cli.renamed`,{old:i,now:a.name})}\n`);let o=r<0?n:n.slice(0,r),s=a?a.to:r<0?[]:[i],c=r<0?[]:n.slice(r+1);return[...o,...s,...c].flatMap(n=>{let r=t(d,n);return r?(process.stderr.write(`${e(`app.cli.flagRenamed`,{old:n,now:r.join(` `)})}\n`),r):[n]})}function _(e){let n=g(e),r=h(n),i=r.name===`scenarios`?t(f,r.after):void 0,a=i===void 0?r.name===`junit`?[...n.slice(0,r.at),`tests`,...n.slice(r.at+1)]:n:[...n.slice(0,r.at),...i,...n.slice(r.at+2)],o=m(a),s=e=>(o.values[e]??[]).filter(e=>typeof e==`string`),c=h(n);return{tokens:a,asksHelp:n.slice(0,n.includes(`--`)?n.indexOf(`--`):n.length).includes(`--help`),helpNames:c.at<0?[]:n.slice(c.at).filter(e=>e!==`--help`),command:o.positionals[0]??``,words:o.positionals.slice(1),flags:new Set(Object.keys(o.values).map(e=>`--${e}`)),unknownScenario:r.name===`scenarios`&&i===void 0,option:e=>s(e)[0],options:s}}async function v(t){r(t);let n=_(t);if(n.command===`version`||t[0]===`--version`)return process.stdout.write(`${s()??`development`}\n`),0;if(n.command===``||n.command===`help`)return process.stdout.write(a()),0;if(n.asksHelp){let e=o(n.helpNames);return process.stdout.write(e?i(e):a()),0}if(n.unknownScenario)return process.stderr.write(`${e(`app.cli.scenariosUsage`)}\n`),1;let{dispatch:c}=await import(`./chunk-dispatch-o-eqJb9Y.js`);return c(n,t)}function y(e){return e.destroyed?Promise.resolve():new Promise(t=>e.write(``,()=>t()))}async function b(e){n(),await y(process.stdout),await y(process.stderr),process.exit(e)}for(let e of[process.stdout,process.stderr])e.on(`error`,e=>{throw(e.code===`EPIPE`||e.code===`ERR_STREAM_DESTROYED`)&&process.exit(141),e});v(process.argv.slice(2)).then(b).catch(async e=>{let{FolderTooLarge:t}=await import(`./chunk-folders-DX1N6vTK.js`);if(e instanceof t){process.stderr.write(`${e.message}\n`),await b(1);return}let{systemFailure:n}=await import(`./chunk-systemError-O3vQ8hLb.js`),r=n(e);r===null?(process.stderr.write(`${e instanceof Error?e.message:String(e)}\n`),await b(2)):(process.stderr.write(`${r}\n`),await b(1))});export{};
|