@kern0x1b/penstock-cli 26.10.0 → 26.10.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 +1647 -0
- package/dist/grammars/tree-sitter-c-sharp.wasm +0 -0
- package/dist/grammars/tree-sitter-go.wasm +0 -0
- package/dist/grammars/tree-sitter-groovy.wasm +0 -0
- package/dist/grammars/tree-sitter-java.wasm +0 -0
- package/dist/grammars/tree-sitter-javascript.wasm +0 -0
- package/dist/grammars/tree-sitter-kotlin.wasm +0 -0
- package/dist/grammars/tree-sitter-python.wasm +0 -0
- package/dist/grammars/tree-sitter-scala.wasm +0 -0
- package/dist/grammars/tree-sitter-typescript.wasm +0 -0
- package/dist/grammars/web-tree-sitter.wasm +0 -0
- package/dist/penstock.js +1077 -419
- package/dist/syntax-worker.js +5 -0
- package/dist/web/assets/AgentSettings-Iy9ZaTGR.js +1 -0
- package/dist/web/assets/AgentsDialog-Dt09_TEw.js +1 -0
- package/dist/web/assets/BpmnCanvas-CCRBnGIV.js +1905 -0
- package/dist/web/assets/BpmnDocument-D2lXXcnN.js +24 -0
- package/dist/web/assets/ConflictDialog-CaBNoJST.js +1 -0
- package/dist/web/assets/DiffDocument-BjLzoDLL.js +1 -0
- package/dist/web/assets/DmnDocument-BSGTyR3r.js +41 -0
- package/dist/web/assets/DmnDocument-DdjhA8he.css +1 -0
- package/dist/web/assets/FormDocument-BdCKvI-7.js +32 -0
- package/dist/web/assets/FormDocument-URLcKn84.css +1 -0
- package/dist/web/assets/FormStepView-BEDXMPef.js +1 -0
- package/dist/web/assets/GraphAwareLayoutService-CZCVRb9X.js +21 -0
- package/dist/web/assets/NewFileDialog-D9nTKDOT.js +34 -0
- package/dist/web/assets/QuickOpen-D3AkwBdF.js +1 -0
- package/dist/web/assets/ScriptPane-4TG-1RyI.js +2 -0
- package/dist/web/assets/ScriptRunDialog-C2n9cLcf.js +1 -0
- package/dist/web/assets/SettingsDialog-BUft2ulJ.js +1 -0
- package/dist/web/assets/ShortcutsDialog-Naoea994.js +1 -0
- package/dist/web/assets/SourceDocument-PMA1dm6T.js +1 -0
- package/dist/web/assets/TextDocument-D4fl42FV.js +1 -0
- package/dist/web/assets/UnreadableFileLayer-DuWtY1bx.js +1 -0
- package/dist/web/assets/UploadDialog-CEnwtJ3T.js +1 -0
- package/dist/web/assets/Viewer-CZiVl0t6.js +4 -0
- package/dist/web/assets/apply-DwO6xN9h.js +1 -0
- package/dist/web/assets/array-move-Bc4mVEdq.js +1 -0
- package/dist/web/assets/bpmn-0HrGCizt.svg +228 -0
- package/dist/web/assets/bpmn-Cyvp-fAH.eot +0 -0
- package/dist/web/assets/bpmnTheme-iB2hl29R.js +1687 -0
- package/dist/web/assets/bridgeInstance-CJkr34d9.js +600 -0
- package/dist/web/assets/clike-DaHM3zHz.js +1 -0
- package/dist/web/assets/colors-dark-C7vOziWz.css +1 -0
- package/dist/web/assets/colors-dracula-CXhMcc1Z.css +1 -0
- package/dist/web/assets/colors-light-CyT40N4M.css +1 -0
- package/dist/web/assets/commands-BMjdyegc.js +1 -0
- package/dist/web/assets/de-BDwOyJ4E.js +1 -0
- package/dist/web/assets/dialog-wo7dFa5A.js +1 -0
- package/dist/web/assets/diff-BmEImmS0.js +1 -0
- package/dist/web/assets/dist--PmHUHDp.js +1 -0
- package/dist/web/assets/dist-B163CX7G.js +57 -0
- package/dist/web/assets/dist-BBuLDp9u.js +2 -0
- package/dist/web/assets/dist-B_V0lTcO.js +1 -0
- package/dist/web/assets/dist-BaEGn3tp.js +6 -0
- package/dist/web/assets/dist-BqwyxNP3.js +1 -0
- package/dist/web/assets/dist-CAxViutc.js +5 -0
- package/dist/web/assets/dist-CBRIhX1e.js +1 -0
- package/dist/web/assets/dist-CHluRwHI.js +2 -0
- package/dist/web/assets/dist-COW2iVt-.js +1 -0
- package/dist/web/assets/dist-CRJyslwo.js +1 -0
- package/dist/web/assets/dist-CnDXCEJ_.js +23 -0
- package/dist/web/assets/dist-CsBP6QjA.js +13 -0
- package/dist/web/assets/dist-CxyFqsL2.js +6 -0
- package/dist/web/assets/dist-D6gjpLLN.js +1 -0
- package/dist/web/assets/dist-DUkRqvKl.js +1 -0
- package/dist/web/assets/dist-DgvQWhKm.js +6 -0
- package/dist/web/assets/dist-DvFyMwGd.js +1 -0
- package/dist/web/assets/dist-Gx7P7Pk_.js +1 -0
- package/dist/web/assets/dist-Km3QNqlU.js +2 -0
- package/dist/web/assets/dist-TNwbKIWT.js +1 -0
- package/dist/web/assets/dist-sl8LIbwu.js +1 -0
- package/dist/web/assets/dmn-2EwrEScy.eot +0 -0
- package/dist/web/assets/dmn-eH1_eUsy.svg +90 -0
- package/dist/web/assets/dockLayout-CxOMo-Nl.js +1 -0
- package/dist/web/assets/documentBridge-uW6vNrY3.js +240 -0
- package/dist/web/assets/documents-BwU2MdUd.js +1 -0
- package/dist/web/assets/duplicate-rWDlHiZr.js +342 -0
- package/dist/web/assets/ed25519-DTYhEcYX.js +1 -0
- package/dist/web/assets/engine-BPUfS3r2.js +1 -0
- package/dist/web/assets/engines-C3gTrVWJ.js +5 -0
- package/dist/web/assets/es-B4wrlqk9.js +1 -0
- package/dist/web/assets/files-Chpd_QD0.js +1 -0
- package/dist/web/assets/formChecks-DXIRZuhX.js +1 -0
- package/dist/web/assets/fr-BqtYruiB.js +1 -0
- package/dist/web/assets/frontend-By89859W.js +1 -0
- package/dist/web/assets/go-C1TRUqzB.js +1 -0
- package/dist/web/assets/groovy-DASguM_i.js +1 -0
- package/dist/web/assets/html2canvas-BNKOpkjM.js +5 -0
- package/dist/web/assets/httpHost-_QDw41Ka.js +1 -0
- package/dist/web/assets/index.es-CVOua_f9.js +4 -0
- package/dist/web/assets/index.es-DHW5-gbr.js +78 -0
- package/dist/web/assets/index.esm-CTLpq4ik.js +3 -0
- package/dist/web/assets/intelligence-BnJILPl7.js +3 -0
- package/dist/web/assets/ja-B6eG6Wld.js +1 -0
- package/dist/web/assets/jspdf.es.min-Yw43YJzU.js +79 -0
- package/dist/web/assets/ko-Le3hTKqP.js +1 -0
- package/dist/web/assets/lib-D6xZQFAF.js +1 -0
- package/dist/web/assets/libavoid-BRQRZjmQ.wasm +0 -0
- package/dist/web/assets/libavoid.wasm +0 -0
- package/dist/web/assets/platform-PXoldsjF.js +2 -0
- package/dist/web/assets/preferences-C7SSy7Wf.js +1 -0
- package/dist/web/assets/preload-helper-VRuDKI9K.js +1 -0
- package/dist/web/assets/properties-C3HzGRE2.js +1 -0
- package/dist/web/assets/pt-BR-aDlgSu84.js +1 -0
- package/dist/web/assets/purify.es-DBLk-NVl.js +3 -0
- package/dist/web/assets/python-CvnBFxgv.js +1 -0
- package/dist/web/assets/resource/ArchitectsDaughter-OFL.txt +93 -0
- package/dist/web/assets/resource/ArchitectsDaughter-Regular.ttf +0 -0
- package/dist/web/assets/resource/JetBrainsMono-Italic.woff2 +0 -0
- package/dist/web/assets/resource/JetBrainsMono-Medium.woff2 +0 -0
- package/dist/web/assets/resource/JetBrainsMono-OFL.txt +52 -0
- package/dist/web/assets/resource/JetBrainsMono-Regular.woff2 +0 -0
- package/dist/web/assets/resource/JetBrainsMono-SemiBold.woff2 +0 -0
- package/dist/web/assets/rolldown-runtime-B8BYMn-z.js +1 -0
- package/dist/web/assets/ru-DJl9EFpu.js +1 -0
- package/dist/web/assets/run-Dd_PjDF8.js +1 -0
- package/dist/web/assets/samples-DfOV2cQu.js +1 -0
- package/dist/web/assets/shortcut-DONH578b.js +1 -0
- package/dist/web/assets/source-frame-q4WXS_Md.js +2 -0
- package/dist/web/assets/stackblur-es-Djj-lnDR.js +2 -0
- package/dist/web/assets/syntax-DBcQvmbn.js +6 -0
- package/dist/web/assets/testCaseRuns-6x2pl8U_.js +1 -0
- package/dist/web/assets/translator-CTBxdhz9.js +1 -0
- package/dist/web/assets/typing-CXvbBSPr.js +1 -0
- package/dist/web/assets/ui-B2q39Bca.js +1 -0
- package/dist/web/assets/useTrace-BbcYW5PF.js +1 -0
- package/dist/web/assets/vendor-NJP34MHU.js +1 -0
- package/dist/web/assets/web-BTVzb1W6.css +1 -0
- package/dist/web/assets/web-D7xTiPek.js +148 -0
- package/dist/web/assets/zh-CaEk-YOk.js +1 -0
- package/dist/web/icon.svg +9 -0
- package/dist/web/index.html +64 -0
- package/dist/web/manifest.webmanifest +14 -0
- package/package.json +13 -8
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{c as e,o as t,r as n}from"./vendor-NJP34MHU.js";import{i as r}from"./translator-CTBxdhz9.js";import{an as i,cn as a,dn as o,ln as s,on as c,sn as l,un as u}from"./bridgeInstance-CJkr34d9.js";import{o as d}from"./engine-BPUfS3r2.js";import{f,l as p,o as m,p as h,u as g}from"./ui-B2q39Bca.js";import{d as _,l as v}from"./files-Chpd_QD0.js";var y=[`bpmn`,`dmn`,`form`],b={bpmn:`.bpmn`,dmn:`.dmn`,form:`.form`};function familyOf(e){let t=d(e);return t===`camunda-7`||t===`operaton`||t===`cib-seven`?t:`camunda-8`}function identifier(e,t){let n=e.replace(/\.[^.]+$/,``).replace(/[^A-Za-z0-9_.-]+/g,`_`).replace(/^[^A-Za-z_]+/,``);return n?`${t}_${n}`:`${t}_1`}function escapeXml(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function emptyProcess(e,t){let n=s(e),r=identifier(t,`Process`);return`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<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" ${n.namespaces} xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" modeler:executionPlatform="${n.name}" modeler:executionPlatformVersion="${n.version}">
|
|
3
|
+
<bpmn:process id="${r}" name="${escapeXml(t.replace(/\.[^.]+$/,``))}" isExecutable="true"${i(e).process}>
|
|
4
|
+
<bpmn:startEvent id="StartEvent_1" />
|
|
5
|
+
</bpmn:process>
|
|
6
|
+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
|
7
|
+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${r}">
|
|
8
|
+
<bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
|
|
9
|
+
<dc:Bounds x="182" y="102" width="36" height="36" />
|
|
10
|
+
</bpmndi:BPMNShape>
|
|
11
|
+
</bpmndi:BPMNPlane>
|
|
12
|
+
</bpmndi:BPMNDiagram>
|
|
13
|
+
</bpmn:definitions>
|
|
14
|
+
`}function emptyDecision(e,t){let n=s(e),r=identifier(t,`Decision`),i=escapeXml(t.replace(/\.[^.]+$/,``)),a=o(e);return`<?xml version="1.0" encoding="UTF-8"?>
|
|
15
|
+
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"${a.namespace} xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1" name="${i}" namespace="${l(e)}" modeler:executionPlatform="${n.name}" modeler:executionPlatformVersion="${n.version}">
|
|
16
|
+
<decision id="${r}" name="${i}"${a.attribute}>
|
|
17
|
+
<decisionTable id="DecisionTable_1">
|
|
18
|
+
<input id="Input_1">
|
|
19
|
+
<inputExpression id="InputExpression_1" typeRef="string">
|
|
20
|
+
<text></text>
|
|
21
|
+
</inputExpression>
|
|
22
|
+
</input>
|
|
23
|
+
<output id="Output_1" typeRef="string" />
|
|
24
|
+
</decisionTable>
|
|
25
|
+
</decision>
|
|
26
|
+
<dmndi:DMNDI>
|
|
27
|
+
<dmndi:DMNDiagram id="DMNDiagram_1">
|
|
28
|
+
<dmndi:DMNShape id="DMNShape_1" dmnElementRef="${r}">
|
|
29
|
+
<dc:Bounds height="80" width="180" x="160" y="100" />
|
|
30
|
+
</dmndi:DMNShape>
|
|
31
|
+
</dmndi:DMNDiagram>
|
|
32
|
+
</dmndi:DMNDI>
|
|
33
|
+
</definitions>
|
|
34
|
+
`}function emptyForm(e,t){let n=s(e);return`${JSON.stringify({components:[],type:`default`,id:identifier(t,`Form`),executionPlatform:n.name,executionPlatformVersion:n.version,schemaVersion:18},null,2)}\n`}function newFileContent(e,t,n,r){let i=familyOf(n);return t===`example`?e===`bpmn`?u(i):e===`dmn`?c(i):a(i):e===`bpmn`?emptyProcess(i,r):e===`dmn`?emptyDecision(i,r):emptyForm(i,r)}function relativeOf(e){let t=e.name.trim(),n=b[e.kind],r=t.toLowerCase().endsWith(n)?t:`${t}${n}`,i=v(e.folder.trim()).replace(/^\/+|\/+$/g,``);return i?`${i}/${r}`:r}function problemWith(e,t){let n=e.name.trim();if(n===``)return`name-empty`;if(/[\\/\0:*?"<>|]/.test(n)||n===`.`||n===`..`)return`name-characters`;let r=e.folder.trim();if(r!==``&&_(r)===null)return`folder-outside`;let i=relativeOf(e);return t.some(e=>e.rel.toLowerCase()===i.toLowerCase())?`exists`:null}function defaultFolder(e,t){let n=new Map;for(let r of t){if(r.kind!==e)continue;let t=r.rel.lastIndexOf(`/`),i=t<0?``:r.rel.slice(0,t);n.set(i,(n.get(i)??0)+1)}let r=``,i=0;for(let[e,t]of n)t>i&&(r=e,i=t);return r}function describe(e){switch(e){case`name-empty`:return r(`app.web.newFile.nameEmpty`);case`name-characters`:return r(`app.web.newFile.nameCharacters`);case`folder-outside`:return r(`app.web.newFile.folderOutside`);default:return r(`app.web.newFile.exists`)}}function NewFileDialog({files:i,engine:a,initialKind:o=`bpmn`,initialFolder:s,onCreate:c,onClose:l}){let[u,d]=e(o),[_,v]=e(`empty`),[x,S]=e(``),[C,w]=e(()=>s??defaultFolder(o,i)),[T,E]=e(s!==void 0),[D,O]=e(!1),[k,A]=e(null),j=m(),M={kind:u,content:_,name:x,folder:C},N=t(()=>problemWith(M,i),[u,x,C,i]),P=N===`name-empty`||N===`name-characters`||N===`exists`?N:null,F=N===`folder-outside`?N:null,pickKind=e=>{d(e),T||w(defaultFolder(e,i))},create=async()=>{if(j.submit(),N)requestAnimationFrame(()=>document.querySelector(`.ui-dialog [aria-invalid="true"]`)?.focus());else{O(!0),A(null);try{await c(relativeOf(M),newFileContent(u,_,a,x.trim())),l()}catch(e){A(r(`app.web.newFile.failed`,{reason:e instanceof Error?e.message:String(e)})),O(!1)}}};return n(f,{title:r(`app.web.newFile.title`),size:`medium`,onClose:l,onSubmit:()=>void create(),footer:n(h,{actions:[{id:`cancel`,label:r(`app.common.cancel`),role:`cancel`,onClick:l,disabled:D},{id:`create`,label:r(`app.web.newFile.create`),role:`primary`,onClick:()=>void create(),busy:D}]}),children:[n(p,{label:r(`app.web.newFile.type`),children:e=>n(`select`,{...e,value:u,onChange:e=>pickKind(e.target.value),children:y.map(e=>n(`option`,{value:e,children:r(`app.web.newFile.kind.${e}`)},e))})}),n(p,{label:r(`app.web.newFile.content`),children:e=>n(`select`,{...e,value:_,onChange:e=>v(e.target.value),children:[n(`option`,{value:`empty`,children:r(`app.web.newFile.empty`)}),n(`option`,{value:`example`,children:r(`app.web.newFile.example`)})]})}),n(p,{label:r(`app.web.newFile.name`),hint:r(`app.web.newFile.nameHint`,{extension:b[u]}),error:j.errorOf(`name`,P&&describe(P)),children:e=>n(`input`,{...e,value:x,spellcheck:!1,autocomplete:`off`,onInput:e=>S(e.target.value),onBlur:()=>j.touch(`name`)})}),n(p,{label:r(`app.web.newFile.folder`),optional:!0,hint:r(`app.web.newFile.folderHint`),error:j.errorOf(`folder`,F&&describe(F)),children:e=>n(`input`,{...e,value:C,spellcheck:!1,autocomplete:`off`,onInput:e=>{E(!0),w(e.target.value)},onBlur:()=>j.touch(`folder`)})}),k&&n(g,{children:k})]})}export{NewFileDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{c as e,h as t,i as n,o as r,r as i,s as a,u as o}from"./vendor-NJP34MHU.js";import{i as s}from"./translator-CTBxdhz9.js";import{G as c,K as l,f as u}from"./web-D7xTiPek.js";var d=-.005,f=-.005,p=-.01,m=1,h=2,g=512;function bonusAt(e,t){if(t===0)return .8;let n=e[t-1];if(n===`/`)return .9;if(n===`-`||n===`_`||n===` `)return .8;if(n===`.`)return .6;let r=e[t];return n>=`a`&&n<=`z`&&r>=`A`&&r<=`Z`?.7:0}function subsequence(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r+=1)t[r]===e[n]&&(n+=1);return n===e.length}function fuzzy(e,t){let n=e.toLowerCase(),r=n.length;if(r===0)return{score:0,positions:[]};let i=t.length>g?t.slice(t.length-g):t,a=i.toLowerCase(),o=a.length;if(r>o||!subsequence(n,a))return null;let s=new Float64Array(o);for(let e=0;e<o;e+=1)s[e]=bonusAt(i,e);let c=[],l=[];for(let e=0;e<r;e+=1){let t=new Float64Array(o).fill(-1/0),i=new Float64Array(o).fill(-1/0),u=-1/0,h=e===r-1?f:p;for(let r=0;r<o;r+=1){if(n[e]===a[r]){let n=-1/0;e===0?n=r*d+s[r]:r>0&&(n=Math.max(l[e-1][r-1]+s[r],c[e-1][r-1]+m)),t[r]=n,u=Math.max(n,u+h)}else u+=h;i[r]=u}c.push(t),l.push(i)}let u=Array(r).fill(0),h=!1;for(let e=r-1,t=o-1;e>=0;--e)for(;t>=0;--t)if(c[e][t]!==-1/0&&(h||c[e][t]===l[e][t])){h=e>0&&t>0&&l[e][t]===c[e-1][t-1]+m,u[e]=t,--t;break}let _=t.length-i.length;return{score:l[r-1][o-1],positions:u.map(e=>e+_)}}function rankFiles(e,t,n=[]){let r=t.trim().split(/\s+/).filter(Boolean),i=new Map(n.map((e,t)=>[e,n.length-t]));if(r.length===0){let t=e.filter(e=>i.has(e.rel)).sort((e,t)=>(i.get(t.rel)??0)-(i.get(e.rel)??0)),n=e.filter(e=>!i.has(e.rel)).sort((e,t)=>e.rel.localeCompare(t.rel,void 0,{numeric:!0,sensitivity:`base`}));return[...t,...n].map(e=>({file:e,score:0,positions:[]}))}let a=[];for(let t of e){let e=0,n=[],o=t.rel.length-t.name.length,s=!0;for(let i of r){let r=fuzzy(i,t.rel);if(!r){s=!1;break}e+=r.score+(r.positions.every(e=>e>=o)?h:0),n.push(...r.positions)}s&&a.push({file:t,score:e+(i.get(t.rel)??0)*.001,positions:[...new Set(n)].sort((e,t)=>e-t)})}return a.sort((e,t)=>t.score-e.score||e.file.rel.length-t.file.rel.length||e.file.rel.localeCompare(t.file.rel))}function rangesOf(e,t,n){let r=[];for(let i of e){if(i<t||i>=n)continue;let e=i-t,a=r[r.length-1];a&&a[1]===e?a[1]=e+1:r.push([e,e+1])}return r}function useModal(e,t){a(()=>{let n=e.current;if(!n)return;let r=t??(document.activeElement instanceof HTMLElement?document.activeElement:null),i=[],a=n,o=0;for(;a&&a.parentElement&&o<50;){o+=1;let e=a.parentElement;for(let t of Array.from(e.children))t===a||t.hasAttribute(`inert`)||(t.setAttribute(`inert`,``),i.push(t));a=e}return()=>{i.forEach(e=>e.removeAttribute(`inert`));let e=document.activeElement,t=e!==null&&n.contains(e),a=e===null||e===document.body||!document.contains(e);if((t||a)&&r?.isConnected)try{r.focus()}catch{}}},[])}var _=6,v=336,y=`web-quick-list`;function rowsFor(e,t,n,r,i){if(e.startsWith(`>`)){let t=e.slice(1).trim();return i.map(e=>({command:e,found:t===``?{score:0,positions:[]}:fuzzy(t,e.title)})).filter(e=>e.found!==null).sort((e,t)=>t.found.score-e.found.score).map(e=>({type:`command`,id:`c:${e.command.id}`,command:e.command,positions:e.found.positions}))}let a=rankFiles(t,e,n),o=[],c=new Set(n),l=null;for(let t of a){if(e.trim()===``){let e=c.has(t.file.rel)?`recent`:`files`;e!==l&&(l=e,(e===`recent`||a.some(e=>c.has(e.file.rel)))&&o.push({type:`heading`,id:`h:${e}`,text:s(e===`recent`?`app.web.quick.recent`:`app.web.quick.files`)}))}o.push({type:`file`,id:`p:${t.file.path}`,file:t.file,positions:t.positions,open:r.has(t.file.path)})}return o}function windowOf(e,t,n){return{start:Math.max(0,Math.floor(e/28)-_),end:Math.min(n,Math.ceil((e+t)/28)+_)}}function Marked({text:e,ranges:n}){if(n.length===0)return i(t,{children:e});let r=[],a=0;return n.forEach(([n,o])=>{n>a&&r.push(i(t,{children:e.slice(a,n)})),r.push(i(`span`,{class:`palette__match`,children:e.slice(n,o)})),a=o}),a<e.length&&r.push(i(t,{children:e.slice(a)})),i(t,{children:r})}function selectable(e){return!!e&&e.type!==`heading`}function stepIndex(e,t,n){let r=t;for(let i=0;i<e.length;i+=1){if(r+=n,r<0||r>=e.length)return t;if(selectable(e[r]))return r}return t}function QuickOpen({files:t,recent:d,open:f,commands:p,initial:m=``,side:h=!1,onPick:g,onRun:_,onClose:b}){let[x,S]=e(m),[C,w]=e(0),[T,E]=e(0),[D,O]=e(v),k=n(null),A=n(null),j=n(null);useModal(k);let M=r(()=>rowsFor(x,t,d,f,p),[x,t,d,f,p]),N=x.startsWith(`>`);o(()=>{let e=M.findIndex(selectable);w(e<0?0:e),E(0),A.current&&(A.current.scrollTop=0)},[x,M.length]),a(()=>{let e=A.current;if(!e)return;let measure=()=>O(e.clientHeight||v);if(measure(),typeof ResizeObserver>`u`)return;let t=new ResizeObserver(measure);return t.observe(e),()=>t.disconnect()},[]),o(()=>{j.current?.focus(),j.current?.setSelectionRange(m.length,m.length)},[]);let reveal=e=>{let t=A.current;if(!t)return;let n=e*28,r=t.clientHeight||v;n<t.scrollTop?t.scrollTop=n:n+28>t.scrollTop+r&&(t.scrollTop=n+28-r),E(t.scrollTop)},go=e=>{w(e),reveal(e)},choose=(e,t)=>{e&&(e.type===`file`?g(e.file,t||h):e.type===`command`&&_(e.command))},P=Math.max(1,Math.floor((A.current?.clientHeight||v)/28)-1),keys=e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),b();else if(e.key===`ArrowDown`)e.preventDefault(),go(stepIndex(M,C,1));else if(e.key===`ArrowUp`)e.preventDefault(),go(stepIndex(M,C,-1));else if(e.key===`PageDown`||e.key===`PageUp`){e.preventDefault();let t=C;for(let n=0;n<P;n+=1)t=stepIndex(M,t,e.key===`PageDown`?1:-1);go(t)}else if(e.key===`Home`&&e.ctrlKey)e.preventDefault(),go(Math.max(0,M.findIndex(selectable)));else if(e.key===`End`&&e.ctrlKey){e.preventDefault();for(let e=M.length-1;e>=0;--e)if(selectable(M[e])){go(e);break}}else e.key===`Enter`?(e.preventDefault(),choose(M[C],e.ctrlKey||e.metaKey)):e.key===`Tab`&&e.preventDefault()},{start:F,end:I}=windowOf(T,D,M.length),L=M[C],R=r(()=>{let e=0;return M.map(t=>selectable(t)?e+=1:e)},[M]),z=R.length>0?R[R.length-1]:0,position=e=>R[e]??0;return i(`div`,{ref:k,class:`palette-overlay web-quick`,onMouseDown:e=>{e.target===e.currentTarget&&b()},children:i(`div`,{class:`palette`,role:`dialog`,"aria-modal":`true`,"aria-label":s(N?`app.web.quick.commandsLabel`:`app.web.quick.label`),children:[i(`input`,{ref:j,class:`palette__field`,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":y,"aria-autocomplete":`list`,"aria-activedescendant":L&&selectable(L)?`web-quick-${C}`:void 0,"aria-describedby":`web-quick-hint`,placeholder:s(h?`app.web.quick.sidePlaceholder`:`app.web.quick.placeholder`),spellcheck:!1,autoComplete:`off`,value:x,onInput:e=>S(e.currentTarget.value),onKeyDown:keys}),i(`span`,{id:`web-quick-hint`,class:`palette__hint`,children:s(`app.web.quick.hint`)}),i(`ul`,{ref:A,id:y,class:`palette__list web-quick__list`,role:`listbox`,"aria-label":s(N?`app.web.quick.commandsLabel`:`app.web.quick.results`),onScroll:e=>E(e.currentTarget.scrollTop),children:[i(`li`,{role:`presentation`,class:`web-quick__canvas`,style:{height:`${M.length*28}px`},children:M.slice(F,I).map((e,t)=>{let n=F+t,r={top:`${n*28}px`};if(e.type===`heading`)return i(`div`,{class:`palette__heading web-quick__heading`,role:`presentation`,style:r,children:e.text},e.id);let a=n===C;if(e.type===`command`)return i(`div`,{id:`web-quick-${n}`,role:`option`,"aria-selected":a,"aria-setsize":z,"aria-posinset":position(n),class:`palette__row web-quick__row${a?` is-active`:``}`,style:r,onMouseMove:()=>!a&&w(n),onClick:()=>choose(e,!1),children:[i(`span`,{class:`palette__title`,children:i(Marked,{text:e.command.title,ranges:rangesOf(e.positions,0,e.command.title.length)})}),e.command.keys&&i(`span`,{class:`palette__shortcut`,children:e.command.keys})]},e.id);let o=e.file.rel.length-e.file.name.length,d=e.file.rel.slice(0,Math.max(0,o-1));return i(`div`,{id:`web-quick-${n}`,role:`option`,"aria-selected":a,"aria-setsize":z,"aria-posinset":position(n),"aria-label":e.open?s(`app.web.quick.openFile`,{path:e.file.rel}):e.file.rel,title:e.file.rel,class:`palette__row web-quick__row${a?` is-active`:``}`,style:r,onMouseMove:()=>!a&&w(n),onClick:()=>choose(e,!1),children:[i(`span`,{class:`palette__icon web-quick__icon`,children:i(c,{name:l(u(e.file.kind))})}),i(`span`,{class:`palette__title`,children:i(Marked,{text:e.file.name,ranges:rangesOf(e.positions,o,e.file.rel.length)})}),d&&i(`span`,{class:`palette__section web-quick__folder`,children:i(Marked,{text:d,ranges:rangesOf(e.positions,0,d.length)})}),e.open&&i(`span`,{class:`palette__shortcut`,children:s(`app.web.quick.opened`)})]},e.id)})}),M.length===0&&i(`li`,{class:`palette__empty`,role:`presentation`,children:N?s(`app.web.quick.noCommands`):t.length===0?s(`app.web.quick.noFiles`):s(`app.web.quick.noMatch`,{query:x.trim()})})]})]})})}export{QuickOpen};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./run-Dd_PjDF8.js","./rolldown-runtime-B8BYMn-z.js","./translator-CTBxdhz9.js","./preload-helper-VRuDKI9K.js","./samples-DfOV2cQu.js","./engines-C3gTrVWJ.js","./dist-CxyFqsL2.js","./dist-CRJyslwo.js","./dist-CHluRwHI.js","./dist-TNwbKIWT.js","./syntax-DBcQvmbn.js","./dist-CAxViutc.js","./dist-CsBP6QjA.js","./dist-DvFyMwGd.js","./ScriptRunDialog-C2n9cLcf.js","./vendor-NJP34MHU.js","./ui-B2q39Bca.js","./bridgeInstance-CJkr34d9.js","./dist-DgvQWhKm.js","./engine-BPUfS3r2.js","./dist-BqwyxNP3.js","./dialog-wo7dFa5A.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{c as e,i as t,r as n,u as r}from"./vendor-NJP34MHU.js";import{i}from"./translator-CTBxdhz9.js";import{t as a}from"./preload-helper-VRuDKI9K.js";import{t as o}from"./bridgeInstance-CJkr34d9.js";import"./platform-PXoldsjF.js";import{a as s}from"./httpHost-_QDw41Ka.js";import{$ as c,I as l,J as u,Q as d,T as f,Tt as p,Y as m,Z as h,ht as g,l as _,lt as v,pt as y}from"./dist-CsBP6QjA.js";import{a as b,i as x,r as S}from"./dist-DvFyMwGd.js";import{r as C}from"./dist-DUkRqvKl.js";import{n as w}from"./dist-Km3QNqlU.js";import{d as T,q as E}from"./web-D7xTiPek.js";import{n as D,t as O}from"./syntax-DBcQvmbn.js";import{n as k,r as A,t as j}from"./source-frame-q4WXS_Md.js";var M={DOUBLE_EQUALS:`app.feel.problem.doubleEquals`,SPACED_NAME:`app.feel.problem.spacedName`,UNCLOSED_BRACKET:`app.feel.problem.unclosedBracket`,MISSING_ELSE:`app.feel.problem.missingElse`,ENDS_TOO_EARLY:`app.feel.problem.endsTooEarly`,UNEXPECTED_TOKEN:`app.feel.problem.unexpectedToken`,UNTERMINATED_STRING:`app.feel.problem.unterminatedString`,NOT_FEEL:`app.feel.problem.notFeel`};function feelProblemText(e){return i(M[e])}var N=[{name:`number`,parameters:[`from`,`grouping separator`,`decimal separator`]},{name:`string`,parameters:[`from`]},{name:`date`,parameters:[`year`,`month`,`day`,`from`]},{name:`date and time`,parameters:[`date`,`time`,`from`]},{name:`time`,parameters:[`hour`,`minute`,`second`,`offset`,`from`]},{name:`duration`,parameters:[`from`]},{name:`years and months duration`,parameters:[`from`,`to`]},{name:`now`,parameters:[]},{name:`today`,parameters:[]},{name:`not`,parameters:[`negand`]},{name:`substring`,parameters:[`string`,`start position`,`length`]},{name:`string length`,parameters:[`string`]},{name:`upper case`,parameters:[`string`]},{name:`lower case`,parameters:[`string`]},{name:`substring before`,parameters:[`string`,`match`]},{name:`substring after`,parameters:[`string`,`match`]},{name:`replace`,parameters:[`input`,`pattern`,`replacement`,`flags`]},{name:`contains`,parameters:[`string`,`match`]},{name:`matches`,parameters:[`input`,`pattern`,`flags`]},{name:`starts with`,parameters:[`string`,`match`]},{name:`ends with`,parameters:[`string`,`match`]},{name:`split`,parameters:[`string`,`delimiter`]},{name:`string join`,parameters:[`list`,`delimiter`]},{name:`list contains`,parameters:[`list`,`element`]},{name:`list replace`,parameters:[`list`,`position`,`newItem`,`match`]},{name:`count`,parameters:[`list`]},{name:`sublist`,parameters:[`list`,`start`,`length`]},{name:`append`,parameters:[`list`,`...item`]},{name:`concatenate`,parameters:[`...list`]},{name:`insert before`,parameters:[`list`,`position`,`newItem`]},{name:`remove`,parameters:[`list`,`position`]},{name:`reverse`,parameters:[`list`]},{name:`index of`,parameters:[`list`,`match`]},{name:`distinct values`,parameters:[`list`]},{name:`flatten`,parameters:[`list`]},{name:`decimal`,parameters:[`n`,`scale`]},{name:`floor`,parameters:[`n`,`scale`]},{name:`ceiling`,parameters:[`n`,`scale`]},{name:`abs`,parameters:[`n`]},{name:`round up`,parameters:[`n`,`scale`]},{name:`round down`,parameters:[`n`,`scale`]},{name:`round half up`,parameters:[`n`,`scale`]},{name:`round half down`,parameters:[`n`,`scale`]},{name:`modulo`,parameters:[`dividend`,`divisor`]},{name:`sqrt`,parameters:[`number`]},{name:`log`,parameters:[`number`]},{name:`exp`,parameters:[`number`]},{name:`odd`,parameters:[`number`]},{name:`even`,parameters:[`number`]},{name:`is`,parameters:[`value1`,`value2`]},{name:`before`,parameters:[`a`,`b`]},{name:`after`,parameters:[`a`,`b`]},{name:`meets`,parameters:[`range1`,`range2`]},{name:`met by`,parameters:[`range1`,`range2`]},{name:`overlaps`,parameters:[`range1`,`range2`]},{name:`includes`,parameters:[`range`,`value`]},{name:`day of year`,parameters:[`date`]},{name:`day of week`,parameters:[`date`]},{name:`month of year`,parameters:[`date`]},{name:`week of year`,parameters:[`date`]},{name:`sort`,parameters:[`list`,`precedes`]},{name:`get value`,parameters:[`m`,`key`]},{name:`get entries`,parameters:[`m`]},{name:`context put`,parameters:[`context`,`keys`,`value`,`key`]}],P=[`execution`,`task`],F={getVariable:`read`,getVariableTyped:`read`,hasVariable:`test`,setVariable:`write`,removeVariable:`remove`},I=RegExp(`\\b(?:${P.join(`|`)})\\s*\\.\\s*(${Object.keys(F).join(`|`)})\\s*\\(\\s*(["'])([^"'\\\\\\r\\n]+)\\2`,`g`),L=RegExp(`\\b(?:${P.join(`|`)})\\s*\\.\\s*(?:${Object.keys(F).join(`|`)})\\s*\\(\\s*(["'])[^"'\\\\\\r\\n]*$`);function isInsideVariableName(e){return L.test(e)}function scriptVariableReferences(e){return[...e.matchAll(I)].flatMap(e=>{let t=e[1],n=e[2],r=e[3],i=t===void 0?void 0:F[t];if(t===void 0||n===void 0||r===void 0||i===void 0)return[];let a=e.index+e[0].length-n.length;return[{name:r,start:a-r.length,end:a,access:i,method:t}]})}function feelNameAt(e,t){let n=D(e),r=n.findIndex(e=>e.start<=t&&t<e.end),i=n[r];if(!(!i||i.kind!==`name`&&i.kind!==`backtick_name`)&&n[r+1]?.kind!==`open_parenthesis`)return{name:i.kind===`backtick_name`?i.text.slice(1,-1):i.text,start:i.start,end:i.end}}function variableNamed(e,t){return e.find(e=>e.name===t)}function referenceAt(e,t){return scriptVariableReferences(e).find(e=>e.start<=t&&t<=e.end)}function variableAt(e,t,n,r){let i=e===`feel`?feelNameAt(t,n):referenceAt(t,n),a=i===void 0?void 0:variableNamed(r,i.name);return a&&i?{variable:a,start:i.start,end:i.end}:void 0}function placesOf(e){return e.writers.map(e=>e.label).join(`, `)}function setByText(e){return e.writers.length>0?i(`app.script.writers.set`,{places:placesOf(e)}):i(`app.script.writers.none`)}function variableCompletions(e){return e.map(e=>({name:e.name,detail:e.type??i(`app.script.completion.variable`),documentation:setByText(e)}))}function builtinCompletions(){return N.map(e=>({name:e.name,signature:`${e.name}(${e.parameters.join(`, `)})`}))}function completionsFor(e,t,n){if(e!==`feel`&&!isInsideVariableName(t))return[];let r=variableCompletions(n).map(e=>({name:e.name,kind:`variable`,detail:e.detail,documentation:e.documentation}));if(e!==`feel`)return r;let a=builtinCompletions().map(e=>({name:e.name,kind:`builtin`,detail:e.signature,documentation:i(`app.script.completion.builtin`)}));return[...r,...a]}function variableHover(e){return{name:e.name,typeLine:e.type?i(`app.script.typeLabel`,{type:e.type}):null,setBy:setByText(e)}}function contextSummary(e){if(e.length!==0)return i(`app.script.context.summary`,{names:e.map(e=>e.name).join(`, `)})}function feelDiagnostics(e){let t=O(e);if(!t)return[];let n={start:t.start,end:t.end,message:feelProblemText(t.problem)};return t.replacement!==void 0&&(n.replacement=t.replacement),[n]}async function engineFor(e,t){if(t===void 0)return{note:i(`app.feel.run.noEngine`)};let{connectedFeelTarget:n}=await a(async()=>{let{connectedFeelTarget:e}=await import(`./run-Dd_PjDF8.js`);return{connectedFeelTarget:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),r=await e.getDeployTargets(t),o=n(r.targets,r.active);if(o===void 0)return{note:i(`app.feel.run.noEngine`)};let s=o.profile??null;return{link:{kind:`CAMUNDA_8`,ask:n=>e.askEngine(s,n,t)}}}async function runFeelScript(e,t,n,r){let i=await a(()=>import(`./run-Dd_PjDF8.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),o=i.resolveSampleInputs(r);if(o.status===`failed`)return{status:`inputs`,message:o.message};try{let r=await engineFor(e,t);return{status:`report`,report:await i.runEvaluation(n,o.variables,r.link,r.link===void 0?r.note:void 0)}}catch(e){return{status:`report`,report:i.failureReport(await s(e))}}}var R=v.define(),z=/[\p{L}\p{N}_]*/u,B=/^[\p{L}\p{N}_]*$/u,V=g.transactionExtender.of(e=>e.annotation(R)?{annotations:p.addToHistory.of(!1)}:null);function scriptTabLanguageOf(e){return e===`feel`||e===`groovy`||e===`javascript`?e:null}async function scriptLanguageExtension(e){return e===`feel`?(await a(async()=>{let{feel:e}=await import(`./dist-CAxViutc.js`).then(e=>e.t);return{feel:e}},__vite__mapDeps([11,1,7,8,9,12,13]),import.meta.url)).feel():A(e)}function scriptBasics(){return[w,c(),m(),u(),_(),f(),x(),d.of(b)]}async function feelWords(e){let{keywordCompletions:t,snippets:n}=await a(async()=>{let{keywordCompletions:e,snippets:t}=await import(`./dist-CAxViutc.js`).then(e=>e.t);return{keywordCompletions:e,snippets:t}},__vite__mapDeps([11,1,7,8,9,12,13]),import.meta.url);return[...(await Promise.all(t.map(t=>t(e)))).flatMap(e=>e?.options??[]),...n]}function completionSource(e,t,n){return async r=>{let i=r.matchBefore(z);if(!i||i.from===i.to&&!r.explicit)return null;let a=r.state.doc.lineAt(r.pos),o=completionsFor(n,a.text.slice(0,r.pos-a.from),e.contextOf(t)).map(e=>({label:e.name,type:e.kind===`builtin`?`function`:`variable`,detail:e.detail,info:e.documentation})),s=n===`feel`?[...o,...await feelWords(r)]:o;return s.length>0?{from:i.from,options:s,validFor:B}:null}}function hoverElement(e){let t=document.createElement(`div`);t.className=`web-script__hover`;let n=document.createElement(`strong`);if(n.textContent=e.name,t.append(n),e.typeLine!==null){let n=document.createElement(`div`);n.textContent=e.typeLine,t.append(n)}let r=document.createElement(`div`);return r.textContent=e.setBy,t.append(r),t}function hoverFor(e,t,n){return h((r,i)=>{let a=variableAt(n,r.state.doc.toString(),i,e.contextOf(t));if(!a)return null;let o=variableHover(a.variable);return{pos:a.start,end:a.end,above:!0,create:()=>({dom:hoverElement(o)})}})}var H=C(e=>feelDiagnostics(e.state.doc.toString()).map(e=>({from:e.start,to:e.end,severity:`error`,message:e.message})));function scriptEditing(e,t,n){let r=S({override:[completionSource(e,t,n)]}),i=hoverFor(e,t,n);return n===`feel`?[r,i,V,H]:[r,i,V]}var U={feel:`FEEL`,groovy:`Groovy`,javascript:`JavaScript`};function ScriptResult({report:e}){return n(`div`,{class:e.failed?`web-script__result is-error`:`web-script__result`,role:e.failed?`alert`:`status`,children:e.lines.map((e,t)=>n(`p`,{class:`type-body`,children:e},t))})}function ScriptPane({hub:s,tab:c,shown:u,focused:d}){let f=t(null),p=t(null),m=t(Symbol(`script-tab`)),h=scriptTabLanguageOf(c.language),_=s.contextOf(c.id),v=contextSummary(_),[b,x]=e(!1),[S,C]=e(null),[w,D]=e(null),[O,A]=e({}),[M,N]=e(null),P=h===`feel`;r(()=>{let e=f.current;if(!e)return;let t=!0,n=new y,r=h?scriptEditing(s,c.id,h):[],i=new l({parent:e,state:g.create({doc:c.text,extensions:[scriptBasics(),j,k,n.of(r),l.updateListener.of(e=>{e.docChanged&&!e.transactions.some(e=>e.annotation(R))&&(s.changed(c.id,e.state.doc.toString()),C(null))})]})});return p.current=i,h&&scriptLanguageExtension(h).then(e=>{t&&i.dispatch({effects:n.reconfigure([e,...r])})}),()=>{t=!1,i.destroy(),p.current=null}},[c.id]),r(()=>{let e=p.current;e&&e.state.doc.toString()!==c.text&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:c.text},annotations:R.of(!0)})},[c.revision]),r(()=>{if(u&&d)return E(m.current,()=>({undo:()=>s.history(c.id,`undo`),redo:()=>s.history(c.id,`redo`)}))},[u,d,c.id]),r(()=>{if(!S?.mark)return;let{start:e,end:t}=S.mark;p.current?.dispatch({selection:{anchor:e,head:t},effects:l.scrollIntoView(e,{y:`center`})})},[S]);let openRun=()=>{let e=p.current;P&&e&&(D({expression:e.state.doc.toString()}),a(()=>import(`./ScriptRunDialog-C2n9cLcf.js`).then(e=>N(()=>e.ScriptRunDialog)),__vite__mapDeps([14,1,15,2,3,4,5,6,7,8,9,10,16,17,18,19,20,21]),import.meta.url))},runFeel=async(e,t)=>{let n=await runFeelScript(o(),s.diagramOf(c.id),e,t);return n.status===`inputs`?n.message:(A(t),C(n.report),D(null),null)};return n(`div`,{id:T(`web-pane`,c.id),class:`web-pane web-script`,role:`tabpanel`,"aria-labelledby":T(`web-tab`,c.id),"data-active":u?`true`:`false`,"data-focused":d?`true`:`false`,"aria-hidden":!u||void 0,children:[c.conflict!==null&&n(`div`,{class:`web-pane__banner is-warning`,role:`alert`,children:[n(`span`,{class:`web-pane__banner-text type-body`,children:i(`app.script.conflict.message`,{name:c.title})}),n(`button`,{type:`button`,class:`ui-button type-button`,onClick:()=>s.resolve(c.id,`tab`),children:i(`app.script.conflict.keepTab`)}),n(`button`,{type:`button`,class:`ui-button type-button`,onClick:()=>s.resolve(c.id,`diagram`),children:i(`app.script.conflict.useDiagram`)})]}),n(`div`,{class:`web-script__bar`,children:[n(`span`,{class:`web-script__language type-help`,children:h?U[h]:c.language}),v&&n(`span`,{class:`web-script__context type-help`,children:v}),_.length>0&&n(`button`,{type:`button`,class:`ui-button type-button`,"aria-expanded":b,onClick:()=>x(e=>!e),children:i(`app.script.context.showAll`)}),n(`button`,{type:`button`,class:`ui-button type-button`,disabled:!P,onClick:openRun,children:i(`app.script.run.button`)})]}),!P&&n(`p`,{class:`web-script__note type-help`,role:`status`,children:i(`app.script.run.unavailable`)}),b&&n(`ul`,{class:`web-script__variables`,children:_.map(e=>n(`li`,{class:`web-script__variable`,children:[n(`span`,{class:`type-body`,children:e.name}),e.type&&n(`span`,{class:`type-help`,children:e.type}),n(`span`,{class:`type-help`,children:variableHover(e).setBy})]},e.name))}),n(`div`,{class:`web-script__editor`,ref:f,"aria-label":c.title}),S&&n(ScriptResult,{report:S}),w&&M&&n(M,{expression:w.expression,variables:_,remembered:O,onRun:e=>runFeel(w.expression,e),onClose:()=>D(null)})]})}export{ScriptPane,feelProblemText as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{c as e,r as t}from"./vendor-NJP34MHU.js";import{i as n}from"./translator-CTBxdhz9.js";import{t as r}from"./samples-DfOV2cQu.js";import{f as i,l as a,p as o,u as s}from"./ui-B2q39Bca.js";var c={mode:`json`,text:``},l=3;function ScriptRunDialog({expression:u,variables:d,remembered:f,onRun:p,onClose:m}){let h=r(u),[g,_]=e(()=>Object.fromEntries(h.map(e=>[e,f[e]??c]))),[v,y]=e(null),[b,x]=e(!1),change=(e,t)=>{_(n=>({...n,[e]:{...n[e]??c,...t}}))},run=async()=>{x(!0);let e=await p(g);e!==null&&(y(e),x(!1))},typeOf=e=>d.find(t=>t.name===e)?.type??void 0;return t(i,{title:n(`app.script.run.title`),size:h.length>l?`medium`:`small`,onClose:m,onSubmit:run,footer:t(o,{actions:[{id:`cancel`,label:n(`app.common.cancel`),role:`cancel`,onClick:m,disabled:b},{id:`run`,label:n(`app.script.run.button`),role:`primary`,onClick:run,busy:b}]}),children:[t(`p`,{class:`type-help`,children:n(`app.script.run.help`)}),h.map(e=>t(a,{label:e,hint:typeOf(e),children:r=>t(`div`,{class:`web-script__sample`,children:[t(`input`,{...r,value:g[e]?.text??``,disabled:b,spellcheck:!1,autocomplete:`off`,onInput:t=>change(e,{text:t.target.value})}),t(`select`,{"aria-label":n(`app.script.run.kindLabel`),value:g[e]?.mode??c.mode,disabled:b,onChange:t=>change(e,{mode:t.target.value}),children:[t(`option`,{value:`json`,children:n(`app.script.run.kind.json`)}),t(`option`,{value:`expression`,children:n(`app.script.run.kind.expression`)})]})]})},e)),v&&t(s,{children:v})]})}export{ScriptRunDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{c as e,r as t}from"./vendor-NJP34MHU.js";import{i as n}from"./translator-CTBxdhz9.js";import{f as r,l as i,p as a}from"./ui-B2q39Bca.js";import{et as o}from"./web-D7xTiPek.js";function parseSeconds(e){if(!/^\d{1,4}$/.test(e.trim()))return null;let t=Number(e);return t>=1&&t<=600?t:null}function SettingsDialog({theme:s,autosave:c,onAgents:l,onTheme:u,onAutosave:d,suggestNextBlock:f,onSuggestNextBlock:p,suggestions:m,onSuggestions:h,onClose:g}){let[_,v]=e(s),[y,b]=e(c!==null),[x,S]=e(String(c??5)),[C,w]=e(f),[T,E]=e(m),D=parseSeconds(x)!==null,pickTheme=e=>{v(e),u(e)},toggleSuggest=e=>{w(e),p(e)},toggleNames=e=>{E(e),h(e)},toggle=e=>{b(e),d(e?parseSeconds(x)??5:null)},change=e=>{S(e);let t=parseSeconds(e);y&&t!==null&&d(t)};return t(r,{title:n(`app.web.settings.title`),size:`medium`,onClose:g,onSubmit:()=>D&&g(),footer:t(a,{actions:[{id:`done`,label:n(`app.common.done`),role:`primary`,onClick:g,disabled:!D}]}),children:t(`div`,{class:`web-settings`,children:[t(`section`,{class:`web-settings__group`,"aria-labelledby":`web-settings-theme`,children:[t(`h3`,{id:`web-settings-theme`,class:`web-settings__heading type-section-heading`,children:n(`app.web.settings.appearance`)}),t(`div`,{role:`radiogroup`,"aria-labelledby":`web-settings-theme`,class:`web-settings__choices`,children:o.map(e=>t(`label`,{class:`web-settings__choice type-body`,children:[t(`input`,{type:`radio`,name:`web-theme`,value:e,checked:_===e,onChange:()=>pickTheme(e)}),t(`span`,{children:n(e===`ide`?`app.web.settings.themeSystem`:`app.themeChoice.${e}`)})]},e))})]}),t(`section`,{class:`web-settings__group`,"aria-labelledby":`web-settings-editor`,children:[t(`h3`,{id:`web-settings-editor`,class:`web-settings__heading type-section-heading`,children:n(`app.web.settings.editor`)}),t(`label`,{class:`web-settings__choice type-body`,children:[t(`input`,{type:`checkbox`,checked:C,onChange:e=>toggleSuggest(e.currentTarget.checked)}),t(`span`,{children:n(`app.web.settings.suggestNextBlock`)})]}),t(`p`,{class:`web-settings__help type-help`,children:n(`app.web.settings.suggestNextBlockHelp`)}),t(`label`,{class:`web-settings__choice type-body`,children:[t(`input`,{type:`checkbox`,checked:T,onChange:e=>toggleNames(e.currentTarget.checked)}),t(`span`,{children:n(`app.web.settings.suggestions`)})]}),t(`p`,{class:`web-settings__help type-help`,children:n(`app.web.settings.suggestionsHelp`)})]}),t(`section`,{class:`web-settings__group`,"aria-labelledby":`web-settings-save`,children:[t(`h3`,{id:`web-settings-save`,class:`web-settings__heading type-section-heading`,children:n(`app.web.settings.saving`)}),t(`label`,{class:`web-settings__choice type-body`,children:[t(`input`,{type:`checkbox`,checked:y,onChange:e=>toggle(e.currentTarget.checked)}),t(`span`,{children:n(`app.web.settings.autosave`)})]}),t(i,{label:n(`app.web.settings.autosaveDelay`),hint:n(`app.web.settings.autosaveHelp`),error:D?void 0:n(`app.web.settings.autosaveRange`,{min:1,max:600}),children:e=>t(`input`,{...e,class:`${e.class} type-input web-settings__number`,type:`text`,inputMode:`numeric`,value:x,disabled:!y,onInput:e=>change(e.currentTarget.value)})})]}),t(`section`,{class:`web-settings__group`,"aria-labelledby":`web-settings-agents`,children:[t(`h3`,{id:`web-settings-agents`,class:`web-settings__heading type-section-heading`,children:n(`app.web.settings.agents`)}),t(`p`,{class:`web-settings__help type-help`,children:n(`app.web.settings.agentsHelp`)}),t(`button`,{type:`button`,class:`ui-button type-button web-settings__manage`,onClick:l,children:n(`app.web.settings.agentsManage`)})]})]})})}export{SettingsDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{r as e}from"./vendor-NJP34MHU.js";import{i as t}from"./translator-CTBxdhz9.js";import{o as n}from"./AgentSettings-Iy9ZaTGR.js";import{f as r,p as i}from"./ui-B2q39Bca.js";import{t as a}from"./commands-BMjdyegc.js";import"./web-D7xTiPek.js";function shortcutRows(){return[{group:t(`app.web.shortcuts.group.files`),rows:[{command:`quickOpen`,label:t(`app.web.command.quickOpen`)},{command:`actions`,label:t(`app.web.command.actions`)},{command:`newFile`,label:t(`app.web.command.newFile`)},{command:`save`,label:t(`app.web.command.save`)},{command:`saveAll`,label:t(`app.web.command.saveAll`)}]},{group:t(`app.web.shortcuts.group.tabs`),rows:[{command:`closeTab`,label:t(`app.web.command.closeTab`)},{command:`nextTab`,label:t(`app.web.command.nextTab`)},{command:`previousTab`,label:t(`app.web.command.previousTab`)},{command:`tab1`,label:t(`app.web.command.jumpToTab`)},{command:`splitView`,label:t(`app.web.command.splitView`)}]},{group:t(`app.web.shortcuts.group.window`),rows:[{command:`toggleSidebar`,label:t(`app.web.command.toggleSidebar`)},...n()?[{command:`askAgent`,label:t(`app.web.command.askAgent`)}]:[],{command:`shortcuts`,label:t(`app.web.command.shortcuts`)}]}]}function ShortcutsDialog({mac:n,onClose:o}){return e(r,{title:t(`app.web.shortcuts.title`),size:`medium`,onClose:o,onSubmit:o,footer:e(i,{help:t(`app.web.shortcuts.editorHint`),actions:[{id:`close`,label:t(`app.common.close`),role:`primary`,onClick:o}]}),children:e(`div`,{class:`web-shortcuts`,children:shortcutRows().map(t=>e(`section`,{class:`web-shortcuts__group`,"aria-label":t.group,children:[e(`h3`,{class:`web-shortcuts__heading type-section-heading`,children:t.group}),e(`dl`,{class:`web-shortcuts__list`,children:t.rows.map(t=>e(`div`,{class:`web-shortcuts__row`,children:[e(`dt`,{class:`type-body`,children:t.label}),e(`dd`,{class:`web-shortcuts__keys`,children:t.command===`tab1`?e(`kbd`,{class:`web-shortcuts__key type-help`,children:n?`⌘1…9`:`Ctrl+1…9`}):a(t.command,n).map(t=>e(`kbd`,{class:`web-shortcuts__key type-help`,children:t},t))})]},t.command))})]},t.group))})})}export{ShortcutsDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{c as e,i as t,r as n,u as r}from"./vendor-NJP34MHU.js";import{i}from"./translator-CTBxdhz9.js";import{r as a}from"./files-Chpd_QD0.js";import{I as o,ht as s,pt as c}from"./dist-CsBP6QjA.js";import{t as l}from"./dist-Km3QNqlU.js";import{$ as u,Q as d}from"./web-D7xTiPek.js";import{i as f,n as p,r as m,t as h}from"./source-frame-q4WXS_Md.js";import{t as g}from"./intelligence-BnJILPl7.js";var _=2e6;function shown(e){return e.length>_?{text:e.slice(0,_),cut:!0}:{text:e,cut:!1}}function SourceDocument({handle:_}){let v=t(null),y=t(null),[b,x]=e(shown(_.initialText).cut),[S,C]=e(null),w=a(_.path),T=f(w),goTo=e=>{let t=y.current;if(!t||e===null)return;let n=t.state.doc.lines,r=t.state.doc.line(Math.max(1,Math.min(e,n)));t.dispatch({selection:{anchor:r.from},effects:o.scrollIntoView(r.from,{y:`center`})})};return r(()=>{let e=v.current;if(!e)return;let t=!0;C(null);let n=new c,r=new c,i=new o({parent:e,state:s.create({doc:shown(_.initialText).text,extensions:[l,h,p,s.readOnly.of(!0),n.of([]),r.of([])]})});y.current=i,m(T).then(e=>{t&&i.dispatch({effects:n.reconfigure(e)})}),g(i,r,_,T,{noServer:e=>t&&C(e)},()=>t),requestAnimationFrame(()=>t&&goTo(d(_.path)));let a=u(_.path,goTo),f=_.onReload(e=>{let t=shown(e);x(t.cut),i.dispatch({changes:{from:0,to:i.state.doc.length,insert:t.text}})});return()=>{t=!1,a(),f(),i.destroy(),y.current=null}},[_,T]),n(`div`,{class:`web-source`,children:[n(`div`,{class:`web-source__bar`,children:[n(`span`,{class:`web-source__path type-help`,title:w,children:w}),n(`span`,{class:`web-source__tag type-help`,children:i(`app.webHost.source.readOnly`)})]}),S&&n(`p`,{class:`web-source__hint type-help`,role:`status`,children:i(`app.web.code.noServer`,{server:S})}),b&&n(`p`,{class:`web-source__note type-help`,role:`status`,children:i(`app.webHost.source.truncated`)}),n(`div`,{class:`web-source__editor`,ref:v,"aria-label":i(`app.webHost.source.label`,{name:_.name})})]})}export{SourceDocument};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{c as e,i as t,r as n,u as r}from"./vendor-NJP34MHU.js";import{i}from"./translator-CTBxdhz9.js";import{r as a}from"./files-Chpd_QD0.js";import{I as o,ht as s,lt as c,pt as l}from"./dist-CsBP6QjA.js";import{t as u}from"./dist-Km3QNqlU.js";import{i as d,n as f,r as p,t as m}from"./source-frame-q4WXS_Md.js";import{t as h}from"./intelligence-BnJILPl7.js";var g=c.define();function TextDocument({handle:c}){let _=t(null),[v,y]=e(null),b=a(c.path),x=d(b);return r(()=>{let e=_.current;if(!e)return;let t=!0;y(null);let n=new l,r=new l,i=new o({parent:e,state:s.create({doc:c.initialText,extensions:[u,m,f,n.of([]),r.of([]),o.updateListener.of(e=>{e.docChanged&&!e.transactions.some(e=>e.annotation(g))&&c.edit(e.state.doc.toString())})]})});p(x).then(e=>{t&&i.dispatch({effects:n.reconfigure(e)})}),h(i,r,c,x,{noServer:e=>t&&y(e)},()=>t);let a=c.onReload(e=>{i.state.doc.toString()!==e&&i.dispatch({changes:{from:0,to:i.state.doc.length,insert:e},annotations:g.of(!0)})});return()=>{t=!1,a(),i.destroy()}},[c,x]),n(`div`,{class:`web-source`,children:[n(`div`,{class:`web-source__bar`,children:n(`span`,{class:`web-source__path type-help`,title:b,children:b})}),v&&n(`p`,{class:`web-source__hint type-help`,role:`status`,children:i(`app.web.code.noServer`,{server:v})}),n(`div`,{class:`web-source__editor`,ref:_,"aria-label":i(`app.web.text.label`,{name:c.name})})]})}export{TextDocument};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{r as e}from"./vendor-NJP34MHU.js";import{i as t}from"./translator-CTBxdhz9.js";import{Rn as n,t as r}from"./bridgeInstance-CJkr34d9.js";import{r as i}from"./platform-PXoldsjF.js";import{a}from"./documentBridge-uW6vNrY3.js";import{s as o}from"./ui-B2q39Bca.js";function ResourceProblemsTab({findings:n,waiting:r,clean:i,onRecheck:a,onPick:s}){let c=n?.length??0;return e(`div`,{class:`problems`,children:[e(`header`,{class:`problems__bar`,children:[e(`span`,{class:`problems__count`,children:n?t(`app.problems.tally`,{count:c}):``}),e(`button`,{type:`button`,class:`ui-button`,onClick:a,title:t(`app.common.checkAgain`),children:t(`app.common.recheck`)})]}),n===null&&e(o,{title:r,hint:t(`app.editorShell.useCheckInTheToolbar`),guide:`problems`}),n!==null&&c===0&&e(o,{title:t(`app.diagramCheck.noProblemsFound`),hint:i,guide:`problems`}),n!==null&&c>0&&e(`ul`,{class:`diagram-check__list`,children:n.map((t,n)=>e(`li`,{children:e(`button`,{type:`button`,class:`diagram-check__row`,onClick:()=>s(n),children:[e(`span`,{class:`diagram-check__row-title`,children:t.title}),e(`span`,{class:`diagram-check__row-where diagram-check__row-where--wrap`,children:t.detail})]})},n))})]})}function historyState(e){return{undo:!!e?.canUndo?.(),redo:!!e?.canRedo?.()}}function UnreadableFileLayer({message:o,kind:s,client:c,onReload:l}){if(o===null)return null;let openText=()=>{let e=r().getBpmnFilePath();e&&r().openAsText(e).catch(e=>console.error(`Failed to open as text:`,e))},reload=async()=>{let e=r().getBpmnFilePath();if(e)try{let t=await c.file.readFile(e);t&&l(t)}catch(e){console.error(`Failed to read the file again:`,e),i.error(t(`app.canvas.unableToReadTheFile`))}};return e(a,{problem:n(Error(o)),kind:s,onOpenText:openText,onReload:()=>void reload()})}export{historyState as n,ResourceProblemsTab as r,UnreadableFileLayer as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{c as e,h as t,r as n}from"./vendor-NJP34MHU.js";import{i as r}from"./translator-CTBxdhz9.js";import{f as i,l as a,o,p as s,u as c}from"./ui-B2q39Bca.js";import{d as l}from"./files-Chpd_QD0.js";import{m as u,p as d,r as f}from"./web-D7xTiPek.js";function uploadProblem(e,t,n){let i=t.trim();if(i!==``&&l(i)===null)return{folder:r(`app.web.newFile.folderOutside`)};let a=i===``?``:`${l(i)}/`,o=new Set(n.map(e=>e.rel.toLowerCase())),s=new Set;for(let t=0;t<e.length;t+=1){let n=e[t].name.trim(),i=u(n);if(i)return{index:t,text:i};if(!f(n))return{index:t,text:r(`app.web.upload.extension`)};let c=`${a}${n}`.toLowerCase();if(o.has(c)||s.has(c))return{index:t,text:r(`app.web.newFile.exists`)};s.add(c)}return null}function UploadDialog({files:u,existing:f,folders:p,onUpload:m,onClose:h}){let[g,_]=e(()=>u.map(e=>({file:e,name:e.name}))),[v,y]=e(``),[b,x]=e(!1),[S,C]=e(null),w=o(),T=uploadProblem(g,v,f),upload=async()=>{if(w.submit(),T)requestAnimationFrame(()=>document.querySelector(`.ui-dialog [aria-invalid="true"]`)?.focus());else{x(!0),C(null);try{let e=v.trim()===``?``:`${l(v.trim())}/`;await m(await Promise.all(g.map(async t=>({rel:`${e}${t.name.trim()}`,content:await t.file.text()})))),h()}catch(e){C(d(e)),x(!1)}}},nameError=e=>T&&`index`in T&&T.index===e?w.errorOf(`name${e}`,T.text):null,E=T&&`folder`in T?w.errorOf(`folder`,T.folder):null;return n(i,{title:r(`app.web.upload.title`),size:`medium`,onClose:h,onSubmit:()=>void upload(),footer:n(s,{actions:[{id:`cancel`,label:r(`app.common.cancel`),role:`cancel`,onClick:h,disabled:b},{id:`upload`,label:g.length===1?r(`app.web.upload.addOne`):r(`app.web.upload.addMany`,{count:g.length}),role:`primary`,onClick:()=>void upload(),busy:b}]}),children:[n(`p`,{class:`web-dialog-text type-body`,children:r(`app.web.upload.text`)}),n(a,{label:r(`app.web.newFile.folder`),optional:!0,hint:r(`app.web.newFile.folderHint`),error:E,children:e=>n(t,{children:[n(`input`,{...e,value:v,list:`web-upload-folders`,spellcheck:!1,autocomplete:`off`,onInput:e=>y(e.target.value),onBlur:()=>w.touch(`folder`)}),n(`datalist`,{id:`web-upload-folders`,children:p.slice(0,500).map(e=>n(`option`,{value:e},e))})]})}),g.map((e,t)=>n(a,{label:g.length===1?r(`app.web.newFile.name`):r(`app.web.upload.fileN`,{number:t+1}),error:nameError(t),children:r=>n(`input`,{...r,value:e.name,spellcheck:!1,autocomplete:`off`,onInput:e=>{let n=e.target.value;_(e=>e.map((e,r)=>r===t?{...e,name:n}:e))},onBlur:()=>w.touch(`name${t}`)})},t)),S&&n(c,{children:S})]})}export{UploadDialog};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{i as t,r as n}from"./rolldown-runtime-B8BYMn-z.js";import{D as r,M as i,N as a,S as o,T as s,_ as c,a as l,b as u,f as d,g as f,h as p,k as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,w,x as T,y as E}from"./dist-CRJyslwo.js";import{t as D}from"./dist-DgvQWhKm.js";import{t as ee}from"./dist-BqwyxNP3.js";import{t as te}from"./dist--PmHUHDp.js";function e(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}h();var O={legend:[1,`<fieldset>`,`</fieldset>`],tr:[2,`<table><tbody>`,`</tbody></table>`],col:[2,`<table><tbody></tbody><colgroup>`,`</colgroup></table>`],_default:[0,``,``]};O.td=O.th=[3,`<table><tbody><tr>`,`</tr></tbody></table>`],O.option=O.optgroup=[1,`<select multiple="multiple">`,`</select>`],O.thead=O.tbody=O.colgroup=O.caption=O.tfoot=[1,`<table>`,`</table>`],O.polyline=O.ellipse=O.polygon=O.circle=O.text=O.line=O.path=O.rect=O.g=[1,`<svg xmlns="http://www.w3.org/2000/svg" version="1.1">`,`</svg>`];function domify(t,n=globalThis.document){if(typeof t!=`string`)throw TypeError(`String expected`);let r=/^<!--(.*?)-->$/s.exec(t);if(r)return n.createComment(r[1]);let i=/<([\w:]+)/.exec(t)?.[1];if(!i)return n.createTextNode(t);if(t=t.trim(),i===`body`){let r=n.createElement(`html`);r.innerHTML=t;let{lastChild:i}=r;return i.remove(),i}let[a,o,s]=Object.hasOwn(O,i)?O[i]:O._default,c=n.createElement(`div`);for(c.innerHTML=o+t+s;a--;)c=c.lastChild;if(c.firstChild===c.lastChild){let{firstChild:t}=c;return t.remove(),t}let l=n.createDocumentFragment();return l.append(...c.childNodes),l}function _mergeNamespaces(t,n){return n.forEach(function(n){n&&typeof n!=`string`&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in t)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(t)}function assign(t,...n){let r=t.style;return S(n,function(t){t&&S(t,function(t,n){r[n]=t})}),t}function attr$1(t,n,r){return arguments.length==2?t.getAttribute(n):r===null?t.removeAttribute(n):(t.setAttribute(n,r),t)}t(attr$1,`attr`);var ne=Object.prototype.toString;function classes$1(t){return new ClassList$1(t)}t(classes$1,`classes`);function ClassList$1(t){if(!t||!t.nodeType)throw Error(`A DOM element reference is required`);this.el=t,this.list=t.classList}t(ClassList$1,`ClassList`),ClassList$1.prototype.add=function(t){return this.list.add(t),this},ClassList$1.prototype.remove=function(t){return ne.call(t)==`[object RegExp]`?this.removeMatching(t):(this.list.remove(t),this)},ClassList$1.prototype.removeMatching=function(t){let n=this.array();for(let r=0;r<n.length;r++)t.test(n[r])&&this.remove(n[r]);return this},ClassList$1.prototype.toggle=function(t,n){return(n===void 0||n!==this.list.toggle(t,n))&&this.list.toggle(t),this},ClassList$1.prototype.array=function(){return Array.from(this.list)},ClassList$1.prototype.has=ClassList$1.prototype.contains=function(t){return this.list.contains(t)};function clear$1(t){for(var n;n=t.firstChild;)t.removeChild(n);return t}t(clear$1,`clear`);function closest(t,n,r){var i=r?t:t.parentNode;return i&&typeof i.closest==`function`&&i.closest(n)||null}function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,`default`)?t.default:t}var k={},A;function requireComponentEvent(){if(A)return k;A=1;var t,n,r;function detect(){t=window.addEventListener?`addEventListener`:`attachEvent`,n=window.removeEventListener?`removeEventListener`:`detachEvent`,r=t===`addEventListener`?``:`on`}return k.bind=function(n,i,a,o){return t||detect(),n[t](r+i,a,o||!1),a},k.unbind=function(t,i,a,o){return n||detect(),t[n](r+i,a,o||!1),a},k}var re=requireComponentEvent(),j=_mergeNamespaces({__proto__:null,default:getDefaultExportFromCjs(re)},[re]),M=[`focus`,`blur`];function bind(t,n,r,i,a){return M.indexOf(r)!==-1&&(a=!0),j.bind(t,r,function(r){r.delegateTarget=closest(r.target||r.srcElement,n,!0),r.delegateTarget&&i.call(t,r)},a)}function unbind(t,n,r,i){return M.indexOf(n)!==-1&&(i=!0),j.unbind(t,n,r,i)}var N={bind,unbind};function matches(t,n){return t&&typeof t.matches==`function`&&t.matches(n)||!1}function query(t,n){return n||=document,n.querySelector(t)}function all(t,n){return n||=document,n.querySelectorAll(t)}function remove$2(t){t.parentNode&&t.parentNode.removeChild(t)}t(remove$2,`remove`);function ensureImported(t,n){if(t.ownerDocument!==n.ownerDocument)try{return n.ownerDocument.importNode(t,!0)}catch{}return t}function appendTo(t,n){return n.appendChild(ensureImported(t,n))}function append(t,n){return appendTo(n,t),t}var P=2,F={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":P,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":P,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function getAttribute(t,n){return F[n]?t.style[n]:t.getAttributeNS(null,n)}function setAttribute(t,n,r){var i=n.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase(),a=F[i];a?(a===P&&typeof r==`number`&&(r=String(r)+`px`),t.style[i]=r):t.setAttributeNS(null,n,r)}function setAttributes(t,n){for(var r=Object.keys(n),i=0,a;a=r[i];i++)setAttribute(t,a,n[a])}function attr(t,n,r){if(typeof n==`string`){if(r!==void 0)setAttribute(t,n,r);else return getAttribute(t,n)}else setAttributes(t,n);return t}var ie=Object.prototype.toString;function classes(t){return new ClassList(t)}function ClassList(t){if(!t||!t.nodeType)throw Error(`A DOM element reference is required`);this.el=t,this.list=t.classList}ClassList.prototype.add=function(t){return this.list.add(t),this},ClassList.prototype.remove=function(t){return ie.call(t)==`[object RegExp]`?this.removeMatching(t):(this.list.remove(t),this)},ClassList.prototype.removeMatching=function(t){let n=this.array();for(let r=0;r<n.length;r++)t.test(n[r])&&this.remove(n[r]);return this},ClassList.prototype.toggle=function(t,n){return(n===void 0||n!==this.list.toggle(t,n))&&this.list.toggle(t),this},ClassList.prototype.array=function(){return Array.from(this.list)},ClassList.prototype.has=ClassList.prototype.contains=function(t){return this.list.contains(t)};function clear(t){for(var n;n=t.firstChild;)t.removeChild(n);return t}function clone(t){return t.cloneNode(!0)}var I={svg:`http://www.w3.org/2000/svg`},L=`<svg xmlns="`+I.svg+`"`;function parse(t){var n=!1;t.substring(0,4)===`<svg`?t.indexOf(I.svg)===-1&&(t=L+t.substring(4)):(t=L+`>`+t+`</svg>`,n=!0);var r=parseDocument(t);if(!n)return r;for(var i=document.createDocumentFragment(),a=r.firstChild;a.firstChild;)i.appendChild(a.firstChild);return i}function parseDocument(t){var n=new DOMParser;return n.async=!1,n.parseFromString(t,`text/xml`)}function create$1(t,n){var r;return t=t.trim(),t.charAt(0)===`<`?(r=parse(t).firstChild,r=document.importNode(r,!0)):r=document.createElementNS(I.svg,t),n&&attr(r,n),r}t(create$1,`create`);var R=null;function getNode(){return R===null&&(R=create$1(`svg`)),R}function extend$1(t,n){var r,i,a=Object.keys(n);for(r=0;i=a[r];r++)t[i]=n[i];return t}t(extend$1,`extend`);function createMatrix(t,n,r,i,a,o){var s=getNode().createSVGMatrix();switch(arguments.length){case 0:return s;case 1:return extend$1(s,t);case 6:return extend$1(s,{a:t,b:n,c:r,d:i,e:a,f:o})}}function createTransform(t){return t?getNode().createSVGTransformFromMatrix(t):getNode().createSVGTransform()}var ae=/([&<>]{1})/g,oe=/([&<>\n\r"]{1})/g,se={"&":`&`,"<":`<`,">":`>`,'"':`'`};function escape(t,n){function replaceFn(t,n){return se[n]||n}return t.replace(n,replaceFn)}function serialize(t,n){var r,i,a,o,s;switch(t.nodeType){case 3:n.push(escape(t.textContent,ae));break;case 1:if(n.push(`<`,t.tagName),t.hasAttributes())for(a=t.attributes,r=0,i=a.length;r<i;++r)o=a.item(r),n.push(` `,o.name,`="`,escape(o.value,oe),`"`);if(t.hasChildNodes()){for(n.push(`>`),s=t.childNodes,r=0,i=s.length;r<i;++r)serialize(s.item(r),n);n.push(`</`,t.tagName,`>`)}else n.push(`/>`);break;case 8:n.push(`<!--`,escape(t.nodeValue,ae),`-->`);break;case 4:n.push(`<![CDATA[`,t.nodeValue,`]]>`);break;default:throw Error(`unable to handle node `+t.nodeType)}return n}function set(t,n){var r=parse(n);if(clear(t),n){isFragment(r)||(r=r.documentElement);for(var i=slice$1(r.childNodes),a=0;a<i.length;a++)appendTo(i[a],t)}}function get(t){for(var n=t.firstChild,r=[];n;)serialize(n,r),n=n.nextSibling;return r.join(``)}function isFragment(t){return t.nodeName===`#document-fragment`}function innerSVG(t,n){if(n!==void 0){try{set(t,n)}catch(t){throw Error(`error parsing SVG: `+t.message)}return t}return get(t)}function slice$1(t){return Array.prototype.slice.call(t)}t(slice$1,`slice`);function remove$1(t){var n=t.parentNode;return n&&n.removeChild(t),t}t(remove$1,`remove`);function wrapMatrix(t,n){return n instanceof SVGMatrix?t.createSVGTransformFromMatrix(n):n}function setTransforms(t,n){var r,i;for(t.clear(),r=0;i=n[r];r++)t.appendItem(wrapMatrix(t,i))}function transform$1(t,n){var r=t.transform.baseVal;return n&&(Array.isArray(n)||(n=[n]),setTransforms(r,n)),r.consolidate()}t(transform$1,`transform`);var ce=1e3;function BaseRenderer(t,n){var r=this;n||=ce,t.on([`render.shape`,`render.connection`],n,function(t,n){var i=t.type,a=n.element,o=n.gfx,s=n.attrs;if(r.canRender(a))return i===`render.shape`?r.drawShape(o,a,s):r.drawConnection(o,a,s)}),t.on([`render.getShapePath`,`render.getConnectionPath`],n,function(t,n){if(r.canRender(n))return t.type===`render.getShapePath`?r.getShapePath(n):r.getConnectionPath(n)})}BaseRenderer.prototype.canRender=function(t){},BaseRenderer.prototype.drawShape=function(t,n){},BaseRenderer.prototype.drawConnection=function(t,n){},BaseRenderer.prototype.getShapePath=function(t){},BaseRenderer.prototype.getConnectionPath=function(t){},h();function componentsToPath(t){return t.flat().join(`,`).replace(/,?([A-Za-z]),?/g,`$1`)}function move(t){return[`M`,t.x,t.y]}function lineTo(t){return[`L`,t.x,t.y]}function curveTo(t,n,r){return[`C`,t.x,t.y,n.x,n.y,r.x,r.y]}function drawPath(t,n){let r=t.length,i=[move(t[0])];for(let a=1;a<r;a++){let r=t[a-1],o=t[a],s=t[a+1];if(!s||!n){i.push(lineTo(o));continue}let c=Math.min(n,vectorLength(o.x-r.x,o.y-r.y),vectorLength(s.x-o.x,s.y-o.y));if(!c){i.push(lineTo(o));continue}let l=getPointAtLength(o,r,c),u=getPointAtLength(o,r,c*.5),d=getPointAtLength(o,s,c),f=getPointAtLength(o,s,c*.5);i.push(lineTo(l)),i.push(curveTo(u,f,d))}return i}function getPointAtLength(t,n,r){let i=n.x-t.x,a=n.y-t.y,o=r/vectorLength(i,a);return{x:t.x+i*o,y:t.y+a*o}}function vectorLength(t,n){return Math.sqrt(t**2+n**2)}function createLine(t,n,r){E(n)&&(r=n,n=null),n||={};let i=create$1(`path`,n);return E(r)&&(i.dataset.cornerRadius=String(r)),updateLine(i,t)}function updateLine(t,n){return attr(t,{d:componentsToPath(drawPath(n,parseInt(t.dataset.cornerRadius,10)||0))}),t}h();function getParents(t){var n=new Set(t);return _(t,function(t){for(var r=t.parent;r;){if(n.has(r))return!1;r=r.parent}return!0})}function eachElement(t,n,r){r||=0,p(t)||(t=[t]),S(t,function(t,i){var a=n(t,i,r);p(a)&&a.length&&eachElement(a,n,r+1)})}function selfAndChildren(t,n,r){var i=new Set,a=new Set;return eachElement(t,function(t,n,o){i.add(t);var s=t.children;if((r===-1||o<r)&&s&&!a.has(s))return a.add(s),s}),Array.from(i)}function selfAndAllChildren(t,n){return selfAndChildren(t,!0,-1)}function getClosure(t,n,r){o(n)&&(n=!0),u(n)&&(r=n,n=!0),r||={};var i=copyObject(r.allShapes),a=copyObject(r.allConnections),s=copyObject(r.enclosedElements),c=copyObject(r.enclosedConnections),l=copyObject(r.topLevel,n&&d(t,function(t){return t.id}));function handleConnection(t){l[t.source.id]&&l[t.target.id]&&(l[t.id]=[t]),i[t.source.id]&&i[t.target.id]&&(c[t.id]=s[t.id]=t),a[t.id]=t}function handleElement(t){if(s[t.id]=t,t.waypoints)c[t.id]=a[t.id]=t;else return i[t.id]=t,S(t.incoming,handleConnection),S(t.outgoing,handleConnection),t.children}return eachElement(t,handleElement),{allShapes:i,allConnections:a,topLevel:l,enclosedConnections:c,enclosedElements:s}}function getBBox(t,n){n=!!n,p(t)||(t=[t]);var r,i,a,o;return S(t,function(t){var s=t;t.waypoints&&!n&&(s=getBBox(t.waypoints,!0));var c=s.x,l=s.y,u=s.height||0,d=s.width||0;(c<r||r===void 0)&&(r=c),(l<i||i===void 0)&&(i=l),(c+d>a||a===void 0)&&(a=c+d),(l+u>o||o===void 0)&&(o=l+u)}),{x:r,y:i,height:o-i,width:a-r}}function getEnclosedElements(t,n){var r={};return S(t,function(t){var i=t;i.waypoints&&(i=getBBox(i)),!E(n.y)&&i.x>n.x&&(r[t.id]=t),!E(n.x)&&i.y>n.y&&(r[t.id]=t),i.x>n.x&&i.y>n.y&&(E(n.width)&&E(n.height)&&i.width+i.x<n.width+n.x&&i.height+i.y<n.height+n.y?r[t.id]=t:E(n.width)&&E(n.height)||(r[t.id]=t))}),r}function getType(t){return`waypoints`in t?`connection`:`x`in t?`shape`:`root`}function isFrameElement$1(t){return!!(t&&t.isFrame)}t(isFrameElement$1,`isFrameElement`);function copyObject(t,n){return x({},t||{},n||{})}h();var le=1;function DefaultRenderer(t,n){BaseRenderer.call(this,t,le),this.CONNECTION_STYLE=n.style([`no-fill`],{strokeWidth:5,stroke:`fuchsia`}),this.SHAPE_STYLE=n.style({fill:`white`,stroke:`fuchsia`,strokeWidth:2}),this.FRAME_STYLE=n.style([`no-fill`],{stroke:`fuchsia`,strokeDasharray:4,strokeWidth:2})}e(DefaultRenderer,BaseRenderer),DefaultRenderer.prototype.canRender=function(){return!0},DefaultRenderer.prototype.drawShape=function drawShape(t,n,r){var i=create$1(`rect`);return attr(i,{x:0,y:0,width:n.width||0,height:n.height||0}),isFrameElement$1(n)?attr(i,x({},this.FRAME_STYLE,r||{})):attr(i,x({},this.SHAPE_STYLE,r||{})),append(t,i),i},DefaultRenderer.prototype.drawConnection=function drawConnection(t,n,r){var i=createLine(n.waypoints,x({},this.CONNECTION_STYLE,r||{}));return append(t,i),i},DefaultRenderer.prototype.getShapePath=function getShapePath(t){var n=t.x,r=t.y,i=t.width,a=t.height;return componentsToPath([[`M`,n,r],[`l`,i,0],[`l`,0,a],[`l`,-i,0],[`z`]])},DefaultRenderer.prototype.getConnectionPath=function getConnectionPath(t){var n=t.waypoints,r,i,a=[];for(r=0;i=n[r];r++)i=i.original||i,a.push([r===0?`M`:`L`,i.x,i.y]);return componentsToPath(a)},DefaultRenderer.$inject=[`eventBus`,`styles`],h();function Styles(){var t={"no-fill":{fill:`none`},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:`none`}},n=this;this.cls=function(t,n,r){var i=this.style(n,r);return x(i,{class:t})},this.style=function(n,r){!p(n)&&!r&&(r=n,n=[]);var i=m(n,function(n,r){return x(n,t[r]||{})},{});return r?x(i,r):i},this.computeStyle=function(t,r,i){return p(r)||(i=r,r=[]),n.style(r||[],x({},i,t||{}))}}var ue={__init__:[`defaultRenderer`],defaultRenderer:[`type`,DefaultRenderer],styles:[`type`,Styles]};function remove(t,n){if(!t||!n)return-1;var r=t.indexOf(n);return r!==-1&&t.splice(r,1),r}function add(t,n,r){if(t&&n){typeof r!=`number`&&(r=-1);var i=t.indexOf(n);if(i!==-1){if(i===r)return;if(r!==-1)t.splice(i,1);else return}r===-1?t.push(n):t.splice(r,0,n)}}function indexOf(t,n){return!t||!n?-1:t.indexOf(n)}h();function pointDistance(t,n){return!t||!n?-1:Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2)}function pointsOnLine(t,n,r,i){if(i===void 0&&(i=5),!t||!n||!r)return!1;var a=(n.x-t.x)*(r.y-t.y)-(n.y-t.y)*(r.x-t.x),o=pointDistance(t,n);return Math.abs(a/o)<=i}var de=2;function pointsAligned(t,n){var r=Array.from(arguments).flat();for(let[t,n]of Object.entries({x:`v`,y:`h`}))if(pointsAlignedOnAxis(t,r))return n;return!1}function pointsAlignedOnAxis(t,n){let r=n[0];return l(n,function(n){return Math.abs(r[t]-n[t])<=de})}function pointInRect(t,n,r){return r||=0,t.x>n.x-r&&t.y>n.y-r&&t.x<n.x+n.width+r&&t.y<n.y+n.height+r}function getMidPoint(t,n){return{x:Math.round(t.x+(n.x-t.x)/2),y:Math.round(t.y+(n.y-t.y)/2)}}var fe=/,?([a-z]),?/gi,pe=parseFloat,z=Math,B=z.PI,V=z.min,H=z.max,me=z.pow,U=z.abs,he=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,ge=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,W=`-?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][-+]?\\d+)?`,G=`[\\s]*,?[\\s]*`,_e=RegExp(`(?=(`+W+`))\\1`+G+`(?=(`+W+`))\\2`+G+`(?=(`+W+`))\\3`+G+`([01])`+G+`([01])`+G+`(?=(`+W+`))\\6`+G+`(?=(`+W+`))\\7`+G,`g`),ve=Array.isArray||function(t){return t instanceof Array};function parsePathString(t){if(!t)return null;var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=[];return String(t).replace(he,function(t,i,a){var o=[],s=i.toLowerCase();for(a.replace(s==`a`?_e:ge,function(){for(var t=1;t<arguments.length-2;t++)arguments[t]&&o.push(+arguments[t])}),s==`m`&&o.length>2&&(r.push([i,...o.splice(0,2)]),s=`l`,i=i==`m`?`l`:`L`);o.length>=n[s]&&(r.push([i,...o.splice(0,n[s])]),n[s]););}),r.toString=pathToString,r}function isPathAbsolute(t){for(var n=0,r=t.length;n<r;n++){var i=t[n][0];if(typeof i==`string`&&i!==i.toUpperCase())return!1}return!0}function isPathCurve(t){for(var n=0,r=t.length;n<r;n++){var i=t[n][0];if(i!==`M`&&i!==`C`)return!1}return!0}function rectBBox(t,n,r,i){return arguments.length===1&&(n=t.y,r=t.width,i=t.height,t=t.x),{x:t,y:n,width:r,height:i,x2:t+r,y2:n+i}}function pathToString(){return this.join(`,`).replace(fe,`$1`)}function pathClone(t){for(var n=Array(t.length),r=0,i=t.length;r<i;r++)for(var a=t[r],o=n[r]=Array(a.length),s=0,c=a.length;s<c;s++)o[s]=a[s];return n.toString=pathToString,n}function findDotsAtSegment(t,n,r,i,a,o,s,c,l){var u=1-l,d=me(u,3),f=me(u,2),p=l*l*l,m=d*t+f*3*l*r+u*3*l*l*a+p*s,h=d*n+f*3*l*i+u*3*l*l*o+p*c;return{x:fixError(m),y:fixError(h)}}function bezierBBox(t){var n=curveBBox(...t);return rectBBox(n.x0,n.y0,n.x1-n.x0,n.y1-n.y0)}function isPointInsideBBox$1(t,n,r){return n>=t.x&&n<=t.x+t.width&&r>=t.y&&r<=t.y+t.height}t(isPointInsideBBox$1,`isPointInsideBBox`);function isBBoxIntersect(t,n){return isPointInsideBBox$1(n,t.x,t.y)||isPointInsideBBox$1(n,t.x2,t.y)||isPointInsideBBox$1(n,t.x,t.y2)||isPointInsideBBox$1(n,t.x2,t.y2)||isPointInsideBBox$1(t,n.x,n.y)||isPointInsideBBox$1(t,n.x2,n.y)||isPointInsideBBox$1(t,n.x,n.y2)||isPointInsideBBox$1(t,n.x2,n.y2)||(t.x<n.x2&&t.x>n.x||n.x<t.x2&&n.x>t.x)&&(t.y<n.y2&&t.y>n.y||n.y<t.y2&&n.y>t.y)}function base3(t,n,r,i,a){return t*(t*(-3*n+9*r-9*i+3*a)+6*n-12*r+6*i)-3*n+3*r}function bezlen(t,n,r,i,a,o,s,c,l){l??=1,l=l>1?1:l<0?0:l;for(var u=l/2,d=12,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],m=0,h=0;h<d;h++){var g=u*f[h]+u,_=base3(g,t,r,a,s),v=base3(g,n,i,o,c),y=_*_+v*v;m+=p[h]*z.sqrt(y)}return u*m}function intersectLines(t,n,r,i,a,o,s,c){if(!(H(t,r)<V(a,s)||V(t,r)>H(a,s)||H(n,i)<V(o,c)||V(n,i)>H(o,c))){var l=(t*i-n*r)*(a-s)-(t-r)*(a*c-o*s),u=(t*i-n*r)*(o-c)-(n-i)*(a*c-o*s),d=(t-r)*(o-c)-(n-i)*(a-s);if(d){var f=fixError(l/d),p=fixError(u/d),m=+f.toFixed(2),h=+p.toFixed(2);if(!(m<+V(t,r).toFixed(2)||m>+H(t,r).toFixed(2)||m<+V(a,s).toFixed(2)||m>+H(a,s).toFixed(2)||h<+V(n,i).toFixed(2)||h>+H(n,i).toFixed(2)||h<+V(o,c).toFixed(2)||h>+H(o,c).toFixed(2)))return{x:f,y:p}}}}function fixError(t){return Math.round(t*1e11)/1e11}function findBezierIntersections(t,n,r,i,a){if(i||=bezierBBox(t),a||=bezierBBox(n),!isBBoxIntersect(i,a))return r?0:[];for(var o=bezlen(...t),s=bezlen(...n),c=isLine(t)?1:~~(o/5)||1,l=isLine(n)?1:~~(s/5)||1,u=Array(c+1),d=Array(l+1),f={},p=r?0:[],m=0,h;m<c+1;m++){var g=m/c,_=findDotsAtSegment(...t,g);u[m]={x:_.x,y:_.y,t:g}}for(m=0;m<l+1;m++)g=m/l,_=findDotsAtSegment(...n,g),d[m]={x:_.x,y:_.y,t:g};for(m=0;m<c;m++)for(h=0;h<l;h++){var v=u[m],y=u[m+1],b=d[h],x=d[h+1],S=U(y.x-v.x)<.01?`y`:`x`,C=U(x.x-b.x)<.01?`y`:`x`,w=intersectLines(v.x,v.y,y.x,y.y,b.x,b.y,x.x,x.y),T;if(w){if(T=w.x.toFixed(9)+`#`+w.y.toFixed(9),f[T])continue;f[T]=!0;var E=v.t+U((w[S]-v[S])/(y[S]-v[S]))*(y.t-v.t),D=b.t+U((w[C]-b[C])/(x[C]-b[C]))*(x.t-b.t);E>=0&&E<=1&&D>=0&&D<=1&&(r?p++:p.push({x:w.x,y:w.y,t1:E,t2:D}))}}return p}function findPathIntersections(t,n,r){for(var i=pathToSegments(pathToCurve(t)),a=pathToSegments(pathToCurve(n)),o=r?0:[],s=0,c=i.length;s<c;s++)for(var l=i[s],u=0,d=a.length;u<d;u++){var f=a[u];if(isBBoxIntersect(l.bbox,f.bbox)){var p=findBezierIntersections(l.bez,f.bez,r,l.bbox,f.bbox);if(r)o+=p;else for(var m=0,h=p.length;m<h;m++)p[m].segment1=l.segment,p[m].segment2=f.segment,p[m].bez1=l.bez,p[m].bez2=f.bez,o.push(p[m])}}return o}function pathToSegments(t){for(var n=[],r=0,i=0,a=0,o=0,s=0,c=t.length;s<c;s++){var l=t[s],u;l[0]==`M`?(r=a=l[1],i=o=l[2]):(l[0]==`C`?(u=[r,i,l[1],l[2],l[3],l[4],l[5],l[6]],r=l[5],i=l[6]):(u=[r,i,r,i,a,o,a,o],r=a,i=o),n.push({bez:u,bbox:bezierBBox(u),segment:s}))}return n}function isPathComponents(t){return ve(t)&&ve(t[0])}function pathToAbsolute(t){if(isPathAbsolute(t))return t;var n=Array(t.length),r=0,i=0,a=0,o=0,s=0,c;t[0][0]==`M`&&(r=+t[0][1],i=+t[0][2],a=r,o=i,s++,n[0]=[`M`,r,i]);for(var l,u,d=s,f=t.length;d<f;d++){if(u=t[d],c=u[0],n[d]=l=Array(u.length),c!=c.toUpperCase())switch(l[0]=c.toUpperCase(),l[0]){case`A`:l[1]=u[1],l[2]=u[2],l[3]=u[3],l[4]=u[4],l[5]=u[5],l[6]=+u[6]+r,l[7]=+u[7]+i;break;case`V`:l[1]=+u[1]+i;break;case`H`:l[1]=+u[1]+r;break;case`M`:a=+u[1]+r,o=+u[2]+i;default:for(var p=1,m=u.length;p<m;p++)l[p]=+u[p]+(p%2?r:i)}else for(var h=0,g=u.length;h<g;h++)l[h]=u[h];switch(c=c.toUpperCase(),l[0]){case`Z`:r=+a,i=+o;break;case`H`:r=l[1];break;case`V`:i=l[1];break;case`M`:a=l[l.length-2],o=l[l.length-1];default:r=l[l.length-2],i=l[l.length-1]}}return n.toString=pathToString,n}function isLine(t){return t[0]===t[2]&&t[1]===t[3]&&t[4]===t[6]&&t[5]===t[7]}function lineToCurve(t,n,r,i){return[t,n,r,i,r,i]}function qubicToCurve(t,n,r,i,a,o){var s=1/3,c=2/3;return[s*t+c*r,s*n+c*i,s*a+c*r,s*o+c*i,a,o]}function arcToCurve(t,n,r,i,a,o,s,c,l,u){var d=B*120/180,f=B/180*(+a||0),p=[],m,h=z.cos(f),g=z.sin(f),rotate=function(t,n){return{x:t*h-n*g,y:t*g+n*h}};if(u)T=u[0],E=u[1],C=u[2],w=u[3];else{m=rotate(t,-n),t=m.x,n=-m.y,m=rotate(c,-l),c=m.x,l=-m.y;var _=(t-c)/2,v=(n-l)/2,y=_*_/(r*r)+v*v/(i*i);y>1&&(y=z.sqrt(y),r=y*r,i=y*i);var b=r*r,x=i*i,S=(o==s?-1:1)*z.sqrt(U((b*x-b*v*v-x*_*_)/(b*v*v+x*_*_))),C=S*r*v/i+(t+c)/2,w=S*-i*_/r+(n+l)/2,T=z.asin(((n-w)/i).toFixed(9)),E=z.asin(((l-w)/i).toFixed(9));T=t<C?B-T:T,E=c<C?B-E:E,T<0&&(T=B*2+T),E<0&&(E=B*2+E),s&&T>E&&(T-=B*2),!s&&E>T&&(E-=B*2)}var D=E-T;if(U(D)>d){var ee=E,te=c,O=l;E=T+d*(s&&E>T?1:-1),c=C+r*z.cos(E),l=w+i*z.sin(E),p=arcToCurve(c,l,r,i,a,0,s,te,O,[E,ee,C,w])}D=E-T;var ne=z.cos(T),k=z.sin(T),A=z.cos(E),re=z.sin(E),j=z.tan(D/4),M=4/3*r*j,N=4/3*i*j,P=[t,n],F=[t+M*k,n-N*ne],ie=[c+M*re,l-N*A],I=[c,l];if(F[0]=2*P[0]-F[0],F[1]=2*P[1]-F[1],u)return[F,ie,I].concat(p);p=[F,ie,I].concat(p).join().split(`,`);for(var L=[],R=0,ae=p.length;R<ae;R++)L[R]=R%2?rotate(p[R-1],p[R]).y:rotate(p[R],p[R+1]).x;return L}function curveBBox(t,n,r,i,a,o,s,c){for(var l=[],u=[[],[]],d,f,p,m,h,g,_,v,y=0;y<2;++y)if(y==0?(f=6*t-12*r+6*a,d=-3*t+9*r-9*a+3*s,p=3*r-3*t):(f=6*n-12*i+6*o,d=-3*n+9*i-9*o+3*c,p=3*i-3*n),U(d)<1e-12){if(U(f)<1e-12)continue;m=-p/f,0<m&&m<1&&l.push(m)}else _=f*f-4*p*d,v=z.sqrt(_),!(_<0)&&(h=(-f+v)/(2*d),0<h&&h<1&&l.push(h),g=(-f-v)/(2*d),0<g&&g<1&&l.push(g));for(var b=l.length,x=b,S;b--;)m=l[b],S=1-m,u[0][b]=S*S*S*t+3*S*S*m*r+3*S*m*m*a+m*m*m*s,u[1][b]=S*S*S*n+3*S*S*m*i+3*S*m*m*o+m*m*m*c;return u[0][x]=t,u[1][x]=n,u[0][x+1]=s,u[1][x+1]=c,u[0].length=u[1].length=x+2,{x0:V(...u[0]),y0:V(...u[1]),x1:H(...u[0]),y1:H(...u[1])}}function pathToCurve(t){if(isPathComponents(t)||(t=parsePathString(t)),isPathCurve(t))return t;for(var n=pathClone(pathToAbsolute(t)),r={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},processPath=function(t,n,r){var i,a;if(!t)return[`C`,n.x,n.y,n.x,n.y,n.x,n.y];switch(!(t[0]in{T:1,Q:1})&&(n.qx=n.qy=null),t[0]){case`M`:n.X=t[1],n.Y=t[2];break;case`A`:t=[`C`,...arcToCurve(n.x,n.y,...t.slice(1))];break;case`S`:r==`C`||r==`S`?(i=n.x*2-n.bx,a=n.y*2-n.by):(i=n.x,a=n.y),t=[`C`,i,a,...t.slice(1)];break;case`T`:r==`Q`||r==`T`?(n.qx=n.x*2-n.qx,n.qy=n.y*2-n.qy):(n.qx=n.x,n.qy=n.y),t=[`C`,...qubicToCurve(n.x,n.y,n.qx,n.qy,t[1],t[2])];break;case`Q`:n.qx=t[1],n.qy=t[2],t=[`C`,...qubicToCurve(n.x,n.y,t[1],t[2],t[3],t[4])];break;case`L`:t=[`C`,...lineToCurve(n.x,n.y,t[1],t[2])];break;case`H`:t=[`C`,...lineToCurve(n.x,n.y,t[1],n.y)];break;case`V`:t=[`C`,...lineToCurve(n.x,n.y,n.x,t[1])];break;case`Z`:t=[`C`,...lineToCurve(n.x,n.y,n.X,n.Y)]}return t},fixArc=function(t,r){if(t[r].length>7){t[r].shift();for(var a=t[r];a.length;)i[r]=`A`,t.splice(r++,0,[`C`,...a.splice(0,6)]);t.splice(r,1),c=n.length}},i=[],a=``,o=``,s=0,c=n.length;s<c;s++){n[s]&&(a=n[s][0]),a!=`C`&&(i[s]=a,s&&(o=i[s-1])),n[s]=processPath(n[s],r,o),i[s]!=`A`&&a==`C`&&(i[s]=`C`),fixArc(n,s);var l=n[s],u=l.length;r.x=l[u-2],r.y=l[u-1],r.bx=pe(l[u-4])||r.x,r.by=pe(l[u-3])||r.y}return n}h();function isConnection(t){return u(t)&&v(t,`waypoints`)}function isLabel(t){return u(t)&&v(t,`labelTarget`)}function isRoot(t){return u(t)&&C(t.parent)}h();function roundBounds(t){return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function roundPoint(t){return{x:Math.round(t.x),y:Math.round(t.y)}}function asTRBL(t){return{top:t.y,right:t.x+(t.width||0),bottom:t.y+(t.height||0),left:t.x}}function asBounds(t){return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}function getBoundsMid(t){return roundPoint({x:t.x+(t.width||0)/2,y:t.y+(t.height||0)/2})}function getConnectionMid(t){for(var n=t.waypoints,r=n.reduce(function(t,r,i){var a=n[i-1];if(a){var o=t[t.length-1],s=o&&o.endLength||0,c=distance(a,r);t.push({start:a,end:r,startLength:s,endLength:s+c,length:c})}return t},[]),i=r.reduce(function(t,n){return t+n.length},0)/2,a=0,o=r[a];o.endLength<i;)o=r[++a];var s=(i-o.startLength)/o.length;return{x:o.start.x+(o.end.x-o.start.x)*s,y:o.start.y+(o.end.y-o.start.y)*s}}function getMid(t){return isConnection(t)?getConnectionMid(t):getBoundsMid(t)}function getOrientation(t,n,r){r||=0,u(r)||(r={x:r,y:r});var i=asTRBL(t),a=asTRBL(n),o=i.bottom+r.y<=a.top,s=i.left-r.x>=a.right,c=i.top-r.y>=a.bottom,l=i.right+r.x<=a.left,d=o?`top`:c?`bottom`:null,f=l?`left`:s?`right`:null;return f&&d?d+`-`+f:f||d||`intersect`}function getElementLineIntersection(t,n,r){var i=getIntersections(t,n);return i.length===1||i.length===2&&pointDistance(i[0],i[1])<1?roundPoint(i[0]):i.length>1?(i=a(i,function(t){var n=Math.floor(t.t2*100)||1;return n=100-n,n=(n<10?`0`:``)+n,t.segment2+`#`+n}),roundPoint(i[r?0:i.length-1])):null}function getIntersections(t,n){return findPathIntersections(t,n)}function filterRedundantWaypoints(t){t=t.slice();for(var n=0,r,i,a;t[n];)r=t[n],i=t[n-1],a=t[n+1],pointDistance(r,a)===0||pointsOnLine(i,a,r)?t.splice(n,1):n++;return t}function distance(t,n){return Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2)}h();function round(t,n){return Math.round(t*n)/n}function ensurePx(t){return E(t)?t+`px`:t}function findRoot(t){for(;t.parent;)t=t.parent;return t}function createContainer(t){t=x({},{width:`100%`,height:`100%`},t);let n=t.container||document.body,r=document.createElement(`div`);return r.setAttribute(`class`,`djs-container djs-parent bio-theme-parent`),assign(r,{position:`relative`,overflow:`hidden`,width:ensurePx(t.width),height:ensurePx(t.height)}),n.appendChild(r),r}function createGroup(t,n,r){let i=create$1(`g`);classes(i).add(n);let a=r===void 0?t.childNodes.length-1:r;return t.insertBefore(i,t.childNodes[a]||null),i}var ye=`base`,be=0,xe=1,Se={shape:[`x`,`y`,`width`,`height`],connection:[`waypoints`]};function Canvas(t,n,r,i){this._eventBus=n,this._elementRegistry=i,this._graphicsFactory=r,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(t||{})}Canvas.$inject=[`config.canvas`,`eventBus`,`graphicsFactory`,`elementRegistry`],Canvas.prototype._init=function(t){let n=this._eventBus,r=this._container=createContainer(t),i=this._svg=create$1(`svg`);attr(i,{width:`100%`,height:`100%`}),attr$1(i,`tabindex`,0),t.autoFocus&&n.on(`element.hover`,()=>{this.restoreFocus()}),n.on(`element.mousedown`,500,t=>{this.focus()}),i.addEventListener(`focusin`,()=>{this._setFocused(!0)}),i.addEventListener(`focusout`,()=>{this._setFocused(!1)}),i.addEventListener(`mouseover`,()=>{this._eventBus.fire(`canvas.mouseover`)}),i.addEventListener(`mouseout`,()=>{this._eventBus.fire(`canvas.mouseout`)}),append(r,i);let a=this._viewport=createGroup(i,`viewport`);t.deferUpdate&&(this._viewboxChanged=y(this._viewboxChanged,300)),this._restoreFocus=y(this._restoreFocus,0),n.on(`diagram.init`,()=>{n.fire(`canvas.init`,{svg:i,viewport:a})}),n.on([`shape.added`,`connection.added`,`shape.removed`,`connection.removed`,`elements.changed`,`root.set`],()=>{delete this._cachedViewbox}),n.on(`diagram.destroy`,500,this._destroy,this),n.on(`diagram.clear`,500,this._clear,this)},Canvas.prototype._destroy=function(){this._restoreFocus.cancel(),this._eventBus.fire(`canvas.destroy`,{svg:this._svg,viewport:this._viewport});let t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},Canvas.prototype._setFocused=function(t){t!=this._focused&&(this._focused=t,this._eventBus.fire(`canvas.focus.changed`,{focused:t}))},Canvas.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{let n=getType(t);n===`root`?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},Canvas.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},Canvas.prototype.restoreFocus=function(){this._restoreFocus()},Canvas.prototype._restoreFocus=function(){document.activeElement===document.body&&this.focus()},Canvas.prototype.isFocused=function(){return this._focused},Canvas.prototype.getDefaultLayer=function(){return this.getLayer(ye,be)},Canvas.prototype.getLayer=function(t,n){if(!t)throw Error(`must specify a name`);let r=this._layers[t];if(r||=this._layers[t]=this._createLayer(t,n),n!==void 0&&r.index!==n)throw Error(`layer <`+t+`> already created at index <`+n+`>`);return r.group},Canvas.prototype._getChildIndex=function(t){return m(this._layers,function(n,r){return r.visible&&t>=r.index&&n++,n},0)},Canvas.prototype._createLayer=function(t,n){n===void 0&&(n=xe);let r=this._getChildIndex(n);return{group:createGroup(this._viewport,`layer-`+t,r),index:n,visible:!0}},Canvas.prototype.showLayer=function(t){if(!t)throw Error(`must specify a name`);let n=this._layers[t];if(!n)throw Error(`layer <`+t+`> does not exist`);let r=this._viewport,i=n.group,a=n.index;if(n.visible)return i;let o=this._getChildIndex(a);return r.insertBefore(i,r.childNodes[o]||null),n.visible=!0,i},Canvas.prototype.hideLayer=function(t){if(!t)throw Error(`must specify a name`);let n=this._layers[t];if(!n)throw Error(`layer <`+t+`> does not exist`);let r=n.group;return n.visible&&=(remove$1(r),!1),r},Canvas.prototype._removeLayer=function(t){let n=this._layers[t];n&&(delete this._layers[t],remove$1(n.group))},Canvas.prototype.getActiveLayer=function(){let t=this._findPlaneForRoot(this.getRootElement());return t?t.layer:null},Canvas.prototype.findRoot=function(t){let n=this._resolveElements(t),r;for(let t of n){let n=this._findPlaneForRoot(findRoot(t));if(!n||r&&n.rootElement!==r)return;r=n.rootElement}return r},Canvas.prototype.getRootElements=function(){return this._planes.map(function(t){return t.rootElement})},Canvas.prototype._findPlaneForRoot=function(t){return b(this._planes,function(n){return n.rootElement===t})},Canvas.prototype._resolveElement=function(t){return typeof t==`string`?this._elementRegistry.get(t):t},Canvas.prototype._resolveElements=function(t){return p(t)||(t=[t]),t.map(t=>this._resolveElement(t)).filter(Boolean)},Canvas.prototype.getContainer=function(){return this._container},Canvas.prototype._updateMarker=function(t,n,r){let i;t=this._resolveElement(t),t.markers=t.markers||new Set,i=this._elementRegistry._elements[t.id],i&&(S([i.gfx,i.secondaryGfx],function(i){i&&(r?(t.markers.add(n),classes(i).add(n)):(t.markers.delete(n),classes(i).remove(n)))}),this._eventBus.fire(`element.marker.update`,{element:t,gfx:i.gfx,marker:n,add:!!r}))},Canvas.prototype.addMarker=function(t,n){this._updateMarker(t,n,!0)},Canvas.prototype.removeMarker=function(t,n){this._updateMarker(t,n,!1)},Canvas.prototype.hasMarker=function(t,n){return t=this._resolveElement(t),t.markers?t.markers.has(n):!1},Canvas.prototype.toggleMarker=function(t,n){this.hasMarker(t,n)?this.removeMarker(t,n):this.addMarker(t,n)},Canvas.prototype.getRootElement=function(){let t=this._rootElement;return t||this._planes.length?t:this.setRootElement(this.addRootElement(null))},Canvas.prototype.addRootElement=function(t){let n=this._rootsIdx++;t||={id:`__implicitroot_`+n,children:[],isImplicit:!0};let r=t.layer=`root-`+n;this._ensureValid(`root`,t);let i=this.getLayer(r,be);return this.hideLayer(r),this._addRoot(t,i),this._planes.push({rootElement:t,layer:i}),t},Canvas.prototype.removeRootElement=function(t){if(t=this._resolveElement(t),this._findPlaneForRoot(t))return this._removeRoot(t),this._removeLayer(t.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==t}),this._rootElement===t&&(this._rootElement=null),t},Canvas.prototype.setRootElement=function(t){if(t===this._rootElement)return t;let n;if(!t)throw Error(`rootElement required`);return n=this._findPlaneForRoot(t),n||(t=this.addRootElement(t)),this._setRoot(t),t},Canvas.prototype._removeRoot=function(t){let n=this._elementRegistry,r=this._eventBus;r.fire(`root.remove`,{element:t}),r.fire(`root.removed`,{element:t}),n.remove(t)},Canvas.prototype._addRoot=function(t,n){let r=this._elementRegistry,i=this._eventBus;i.fire(`root.add`,{element:t}),r.add(t,n),i.fire(`root.added`,{element:t,gfx:n})},Canvas.prototype._setRoot=function(t,n){let r=this._rootElement;r&&(this._elementRegistry.updateGraphics(r,null,!0),this.hideLayer(r.layer)),t&&(n||=this._findPlaneForRoot(t).layer,this._elementRegistry.updateGraphics(t,this._svg,!0),this.showLayer(t.layer)),this._rootElement=t,this._eventBus.fire(`root.set`,{element:t})},Canvas.prototype._ensureValid=function(t,n){if(!n.id)throw Error(`element must have an id`);if(this._elementRegistry.get(n.id))throw Error(`element <`+n.id+`> already exists`);let r=Se[t];if(!l(r,function(t){return n[t]!==void 0}))throw Error(`must supply { `+r.join(`, `)+` } with `+t)},Canvas.prototype._setParent=function(t,n,r){add(n.children,t,r),t.parent=n},Canvas.prototype._addElement=function(t,n,r,i){r||=this.getRootElement();let a=this._eventBus,o=this._graphicsFactory;this._ensureValid(t,n),a.fire(t+`.add`,{element:n,parent:r}),this._setParent(n,r,i);let s=o.create(t,n,i);return this._elementRegistry.add(n,s),o.update(t,n,s),a.fire(t+`.added`,{element:n,gfx:s}),n},Canvas.prototype.addShape=function(t,n,r){return this._addElement(`shape`,t,n,r)},Canvas.prototype.addConnection=function(t,n,r){return this._addElement(`connection`,t,n,r)},Canvas.prototype._removeElement=function(t,n){let r=this._elementRegistry,i=this._graphicsFactory,a=this._eventBus;if(t=r.get(t.id||t),t)return a.fire(n+`.remove`,{element:t}),i.remove(t),remove(t.parent&&t.parent.children,t),t.parent=null,a.fire(n+`.removed`,{element:t}),r.remove(t),t},Canvas.prototype.removeShape=function(t){return this._removeElement(t,`shape`)},Canvas.prototype.removeConnection=function(t){return this._removeElement(t,`connection`)},Canvas.prototype.getGraphics=function(t,n){return this._elementRegistry.getGraphics(t,n)},Canvas.prototype._changeViewbox=function(t){this._eventBus.fire(`canvas.viewbox.changing`),t.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Canvas.prototype._viewboxChanged=function(){this._eventBus.fire(`canvas.viewbox.changed`,{viewbox:this.viewbox()})},Canvas.prototype.viewbox=function(t){if(t===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);let n=this._viewport,r=this.getSize(),i,a,o,s,c,l,u;if(t)this._changeViewbox(function(){c=Math.min(r.width/t.width,r.height/t.height);let i=this._svg.createSVGMatrix().scale(c).translate(-t.x,-t.y);transform$1(n,i)});else return o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},s=transform$1(n),a=s?s.matrix:createMatrix(),c=round(a.a,1e3),l=round(-a.e||0,1e3),u=round(-a.f||0,1e3),t=this._cachedViewbox={x:l?l/c:0,y:u?u/c:0,width:r.width/c,height:r.height/c,scale:c,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:r},t;return t},Canvas.prototype.scroll=function(t){let n=this._viewport,r=n.getCTM();return t&&this._changeViewbox(function(){t=x({dx:0,dy:0},t||{}),r=this._svg.createSVGMatrix().translate(t.dx,t.dy).multiply(r),setCTM(n,r)}),{x:r.e,y:r.f}},Canvas.prototype.scrollToElement=function(t,n){let r=100,i=this._resolveElements(t);if(!i.length)return;let a=this.findRoot(i);if(!a)return;a!==this.getRootElement()&&this.setRootElement(a);let o=i.filter(t=>t!=a);if(!o.length)return;n||={},typeof n==`number`&&(r=n),n={top:n.top||r,right:n.right||r,bottom:n.bottom||r,left:n.left||r};let s=getBBox(o),c=asTRBL(s),l=this.viewbox(),u=this.zoom(),d,f;l.y+=n.top/u,l.x+=n.left/u,l.width-=(n.right+n.left)/u,l.height-=(n.bottom+n.top)/u;let p=asTRBL(l);if(!(s.width<l.width&&s.height<l.height))d=s.x-l.x,f=s.y-l.y;else{let t=Math.max(0,c.right-p.right),n=Math.min(0,c.left-p.left),r=Math.max(0,c.bottom-p.bottom),i=Math.min(0,c.top-p.top);d=t||n,f=r||i}this.scroll({dx:-d*u,dy:-f*u})},Canvas.prototype.zoom=function(t,n){if(!t)return this.viewbox(t).scale;if(t===`fit-viewport`)return this._fitViewport(n);let r,i;return this._changeViewbox(function(){typeof n!=`object`&&(r=this.viewbox().outer,n={x:r.width/2,y:r.height/2}),i=this._setZoom(t,n)}),round(i.a,1e3)};function setCTM(t,n){let r=`matrix(`+n.a+`,`+n.b+`,`+n.c+`,`+n.d+`,`+n.e+`,`+n.f+`)`;t.setAttribute(`transform`,r)}Canvas.prototype._fitViewport=function(t){let n=this.viewbox(),r=n.outer,i=n.inner,a,o;return i.x>=0&&i.y>=0&&i.x+i.width<=r.width&&i.y+i.height<=r.height&&!t?o={x:0,y:0,width:Math.max(i.width+i.x,r.width),height:Math.max(i.height+i.y,r.height)}:(a=Math.min(1,r.width/i.width,r.height/i.height),o={x:i.x+(t?i.width/2-r.width/a/2:0),y:i.y+(t?i.height/2-r.height/a/2:0),width:r.width/a,height:r.height/a}),this.viewbox(o),this.viewbox(!1).scale},Canvas.prototype._setZoom=function(t,n){let r=this._svg,i=this._viewport,a=r.createSVGMatrix(),o=r.createSVGPoint(),s,c,l,u,d;l=i.getCTM();let f=l.a;return n?(s=x(o,n),c=s.matrixTransform(l.inverse()),u=a.translate(c.x,c.y).scale(1/f*t).translate(-c.x,-c.y),d=l.multiply(u)):d=a.scale(t),setCTM(this._viewport,d),d},Canvas.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Canvas.prototype.getAbsoluteBBox=function(t){let n=this.viewbox(),r;return r=t.waypoints?this.getGraphics(t).getBBox():t,{x:r.x*n.scale-n.x*n.scale,y:r.y*n.scale-n.y*n.scale,width:r.width*n.scale,height:r.height*n.scale}},Canvas.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire(`canvas.resized`)};var K=`data-element-id`;function ElementRegistry(t){this._elements={},this._eventBus=t}ElementRegistry.$inject=[`eventBus`],ElementRegistry.prototype.add=function(t,n,r){var i=t.id;this._validateId(i),attr(n,K,i),r&&attr(r,K,i),this._elements[i]={element:t,gfx:n,secondaryGfx:r}},ElementRegistry.prototype.remove=function(t){var n=this._elements,r=t.id||t,i=r&&n[r];i&&(attr(i.gfx,K,``),i.secondaryGfx&&attr(i.secondaryGfx,K,``),delete n[r])},ElementRegistry.prototype.updateId=function(t,n){this._validateId(n),typeof t==`string`&&(t=this.get(t)),this._eventBus.fire(`element.updateId`,{element:t,newId:n});var r=this.getGraphics(t),i=this.getGraphics(t,!0);this.remove(t),t.id=n,this.add(t,r,i)},ElementRegistry.prototype.updateGraphics=function(t,n,r){var i=t.id||t,a=this._elements[i];return r?a.secondaryGfx=n:a.gfx=n,n&&attr(n,K,i),n},ElementRegistry.prototype.get=function(t){var n=typeof t==`string`?t:t&&attr(t,K),r=this._elements[n];return r&&r.element},ElementRegistry.prototype.filter=function(t){var n=[];return this.forEach(function(r,i){t(r,i)&&n.push(r)}),n},ElementRegistry.prototype.find=function(t){for(var n=this._elements,r=Object.keys(n),i=0;i<r.length;i++){var a=n[r[i]],o=a.element,s=a.gfx;if(t(o,s))return o}},ElementRegistry.prototype.getAll=function(){return this.filter(function(t){return t})},ElementRegistry.prototype.forEach=function(t){var n=this._elements;Object.keys(n).forEach(function(r){var i=n[r],a=i.element,o=i.gfx;return t(a,o)})},ElementRegistry.prototype.getGraphics=function(t,n){var r=t.id||t,i=this._elements[r];return i&&(n?i.secondaryGfx:i.gfx)},ElementRegistry.prototype._validateId=function(t){if(!t)throw Error(`element must have an id`);if(this._elements[t])throw Error(`element with id `+t+` already added`)};function extend(t,n,r,i){var a=r.inverse;return Object.defineProperty(t,"remove",{value:function(t){var r=this.indexOf(t);return r!==-1&&(this.splice(r,1),n.unset(t,a,i)),t}}),Object.defineProperty(t,"contains",{value:function(t){return this.indexOf(t)!==-1}}),Object.defineProperty(t,"add",{value:function(t,r){var o=this.indexOf(t);if(r===void 0){if(o!==-1)return;r=this.length}o!==-1&&this.splice(o,1),this.splice(r,0,t),o===-1&&n.set(t,a,i)}}),Object.defineProperty(t,"__refs_collection",{value:!0}),t}function isExtended(t){return t.__refs_collection===!0}function hasOwnProperty(t,n){return Object.prototype.hasOwnProperty.call(t,n.name||n)}function defineCollectionProperty(t,n,r){var i=extend(r[n.name]||[],t,n,r);Object.defineProperty(r,n.name,{enumerable:n.enumerable,value:i}),i.length&&i.forEach(function(i){t.set(i,n.inverse,r)})}function defineProperty(t,n,r){var i=n.inverse,a=r[n.name];Object.defineProperty(r,n.name,{configurable:n.configurable,enumerable:n.enumerable,get:function(){return a},set:function(n){if(n!==a){var o=a;a=null,o&&t.unset(o,i,r),a=n,t.set(a,i,r)}}})}function Refs(t,n){if(!(this instanceof Refs))return new Refs(t,n);t.inverse=n,n.inverse=t,this.props={},this.props[t.name]=t,this.props[n.name]=n}Refs.prototype.bind=function(t,n){if(typeof n==`string`){if(!this.props[n])throw Error(`no property <`+n+`> in ref`);n=this.props[n]}n.collection?defineCollectionProperty(this,n,t):defineProperty(this,n,t)},Refs.prototype.ensureRefsCollection=function(t,n){var r=t[n.name];return isExtended(r)||defineCollectionProperty(this,n,t),r},Refs.prototype.ensureBound=function(t,n){hasOwnProperty(t,n)||this.bind(t,n)},Refs.prototype.unset=function(t,n,r){t&&(this.ensureBound(t,n),n.collection?this.ensureRefsCollection(t,n).remove(r):t[n.name]=void 0)},Refs.prototype.set=function(t,n,r){t&&(this.ensureBound(t,n),n.collection?this.ensureRefsCollection(t,n).add(r):t[n.name]=r)},h();var Ce=new Refs({name:`children`,enumerable:!0,collection:!0},{name:`parent`}),we=new Refs({name:`labels`,enumerable:!0,collection:!0},{name:`labelTarget`}),Te=new Refs({name:`attachers`,collection:!0},{name:`host`}),Ee=new Refs({name:`outgoing`,collection:!0},{name:`source`}),De=new Refs({name:`incoming`,collection:!0},{name:`target`});function ElementImpl(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(t){var n=this.label,r=this.labels;!t&&n?r.remove(n):r.add(t,0)}}),Ce.bind(this,`parent`),we.bind(this,`labels`),Ee.bind(this,`outgoing`),De.bind(this,`incoming`)}function ShapeImpl(){ElementImpl.call(this),Ce.bind(this,`children`),Te.bind(this,`host`),Te.bind(this,`attachers`)}e(ShapeImpl,ElementImpl);function RootImpl(){ElementImpl.call(this),Ce.bind(this,`children`)}e(RootImpl,ShapeImpl);function LabelImpl(){ShapeImpl.call(this),we.bind(this,`labelTarget`)}e(LabelImpl,ShapeImpl);function ConnectionImpl(){ElementImpl.call(this),Ee.bind(this,`source`),De.bind(this,`target`)}e(ConnectionImpl,ElementImpl);var Oe={connection:ConnectionImpl,shape:ShapeImpl,label:LabelImpl,root:RootImpl};function create(t,n){var r=Oe[t];if(!r)throw Error(`unknown type: <`+t+`>`);return x(new r,n)}function isModelElement(t){return t instanceof ElementImpl}h();function ElementFactory(){this._uid=12}ElementFactory.prototype.createRoot=function(t){return this.create(`root`,t)},ElementFactory.prototype.createLabel=function(t){return this.create(`label`,t)},ElementFactory.prototype.createShape=function(t){return this.create(`shape`,t)},ElementFactory.prototype.createConnection=function(t){return this.create(`connection`,t)},ElementFactory.prototype.create=function(t,n){return n=x({},n||{}),n.id||(n.id=t+`_`+this._uid++),create(t,n)},h();var q=`__fn`,ke=1e3,Ae=Array.prototype.slice;function EventBus(){this._listeners={},this.on(`diagram.destroy`,1,this._destroy,this)}EventBus.prototype.on=function(t,n,r,i){if(t=p(t)?t:[t],c(n)&&(i=r,r=n,n=ke),!E(n))throw Error(`priority must be a number`);var a=r;i&&(a=g(r,i),a[q]=r[q]||r);var o=this;t.forEach(function(t){o._addListener(t,{priority:n,callback:a,next:null})})},EventBus.prototype.once=function(t,n,r,i){var a=this;if(c(n)&&(i=r,r=n,n=ke),!E(n))throw Error(`priority must be a number`);function wrappedCallback(){wrappedCallback.__isTomb=!0;var n=r.apply(i,arguments);return a.off(t,wrappedCallback),n}wrappedCallback[q]=r,this.on(t,n,wrappedCallback)},EventBus.prototype.off=function(t,n){t=p(t)?t:[t];var r=this;t.forEach(function(t){r._removeListener(t,n)})},EventBus.prototype.createEvent=function(t){var n=new InternalEvent;return n.init(t),n},EventBus.prototype.fire=function(t,n){var r,i,a,o=Ae.call(arguments);if(typeof t==`object`&&(n=t,t=n.type),!t)throw Error(`no event type specified`);if(i=this._listeners[t],i){r=n instanceof InternalEvent?n:this.createEvent(n),o[0]=r;var s=r.type;t!==s&&(r.type=t);try{a=this._invokeListeners(r,o,i)}finally{t!==s&&(r.type=s)}return a===void 0&&r.defaultPrevented&&(a=!1),a}},EventBus.prototype.handleError=function(t){return this.fire(`error`,{error:t})===!1},EventBus.prototype._destroy=function(){this._listeners={}},EventBus.prototype._invokeListeners=function(t,n,r){for(var i;r&&!t.cancelBubble;)i=this._invokeListener(t,n,r),r=r.next;return i},EventBus.prototype._invokeListener=function(t,n,r){var i;if(r.callback.__isTomb)return i;try{i=invokeFunction(r.callback,n),i!==void 0&&(t.returnValue=i,t.stopPropagation()),i===!1&&t.preventDefault()}catch(t){if(!this.handleError(t))throw console.error(`unhandled error in event listener`,t),t}return i},EventBus.prototype._addListener=function(t,n){var r=this._getListeners(t),i;if(!r)this._setListeners(t,n);else{for(;r;){if(r.priority<n.priority){n.next=r,i?i.next=n:this._setListeners(t,n);return}i=r,r=r.next}i.next=n}},EventBus.prototype._getListeners=function(t){return this._listeners[t]},EventBus.prototype._setListeners=function(t,n){this._listeners[t]=n},EventBus.prototype._removeListener=function(t,n){var r=this._getListeners(t),i,a,o;if(!n)this._setListeners(t,null);else for(;r;)i=r.next,o=r.callback,(o===n||o[q]===n)&&(a?a.next=i:this._setListeners(t,i)),a=r,r=i};function InternalEvent(){}InternalEvent.prototype.stopPropagation=function(){this.cancelBubble=!0},InternalEvent.prototype.preventDefault=function(){this.defaultPrevented=!0},InternalEvent.prototype.init=function(t){x(this,t||{})};function invokeFunction(t,n){return t.apply(null,n)}function getVisual(t){return t.childNodes[0]}function getChildren(t){return t.parentNode.childNodes[1]}function transform(t,n,r,i,a){var o=createTransform();o.setTranslate(n,r);var s=createTransform();s.setRotate(i||0,0,0);var c=createTransform();c.setScale(a||1,a||1),transform$1(t,[o,s,c])}function translate$1(t,n,r){var i=createTransform();i.setTranslate(n,r),transform$1(t,i)}t(translate$1,`translate`);function rotate(t,n){var r=createTransform();r.setRotate(n,0,0),transform$1(t,r)}h();function GraphicsFactory(t,n){this._eventBus=t,this._elementRegistry=n}GraphicsFactory.$inject=[`eventBus`,`elementRegistry`],GraphicsFactory.prototype._getChildrenContainer=function(t){var n=this._elementRegistry.getGraphics(t),r;return t.parent?(r=getChildren(n),r||(r=create$1(`g`),classes(r).add(`djs-children`),append(n.parentNode,r))):r=n,r},GraphicsFactory.prototype._clear=function(t){var n=getVisual(t);return clear$1(n),n},GraphicsFactory.prototype._createContainer=function(t,n,r,i){var a=create$1(`g`);classes(a).add(`djs-group`),r===void 0?append(n,a):prependTo(a,n,n.childNodes[r]);var o=create$1(`g`);classes(o).add(`djs-element`),classes(o).add(`djs-`+t),i&&classes(o).add(`djs-frame`),append(a,o);var s=create$1(`g`);return classes(s).add(`djs-visual`),append(o,s),o},GraphicsFactory.prototype.create=function(t,n,r){var i=this._getChildrenContainer(n.parent);return this._createContainer(t,i,r,isFrameElement$1(n))},GraphicsFactory.prototype.updateContainments=function(t){var n=this,r=this._elementRegistry,i=m(t,function(t,n){return n.parent&&(t[n.parent.id]=n.parent),t},{});S(i,function(t){var i=t.children;if(i){var a=n._getChildrenContainer(t),o=a.firstChild;S(i,function(t){var n=r.getGraphics(t).parentNode;n===o?o=o.nextSibling:a.insertBefore(n,o)})}})},GraphicsFactory.prototype.drawShape=function(t,n,r={}){return this._eventBus.fire(`render.shape`,{gfx:t,element:n,attrs:r})},GraphicsFactory.prototype.getShapePath=function(t){return this._eventBus.fire(`render.getShapePath`,t)},GraphicsFactory.prototype.drawConnection=function(t,n,r={}){return this._eventBus.fire(`render.connection`,{gfx:t,element:n,attrs:r})},GraphicsFactory.prototype.getConnectionPath=function(t){return this._eventBus.fire(`render.getConnectionPath`,t)},GraphicsFactory.prototype.update=function(t,n,r){if(n.parent){var i=this._clear(r);if(t===`shape`)this.drawShape(i,n),translate$1(r,n.x,n.y);else if(t===`connection`)this.drawConnection(i,n);else throw Error(`unknown type: `+t);n.hidden?attr(r,`display`,`none`):attr(r,`display`,`block`)}},GraphicsFactory.prototype.remove=function(t){remove$1(this._elementRegistry.getGraphics(t).parentNode)};function prependTo(t,n,r){var i=r||n.firstChild;t!==i&&n.insertBefore(t,i)}var je={__depends__:[ue],__init__:[`canvas`],canvas:[`type`,Canvas],elementRegistry:[`type`,ElementRegistry],elementFactory:[`type`,ElementFactory],eventBus:[`type`,EventBus],graphicsFactory:[`type`,GraphicsFactory]};function bootstrap(t){var n=new te(t);return n.init(),n}function createInjector(t){return t||={},bootstrap([{config:[`value`,t]},je].concat(t.modules||[]))}function Diagram(t,n){this._injector=n||createInjector(t),this.get(`eventBus`).fire(`diagram.init`)}Diagram.prototype.get=function(t,n){return this._injector.get(t,n)},Diagram.prototype.invoke=function(t,n,r){return this._injector.invoke(t,n,r)},Diagram.prototype.destroy=function(){this.get(`eventBus`).fire(`diagram.destroy`)},Diagram.prototype.clear=function(){this.get(`eventBus`).fire(`diagram.clear`)};function elementToString(t){return t?`<`+t.$type+(t.id?` id="`+t.id:``)+`" />`:`<null>`}h();function is$1(t,n){return t.$instanceOf(n)}t(is$1,`is`);function findDisplayCandidate(t){return b(t.rootElements,function(t){return is$1(t,`bpmn:Process`)||is$1(t,`bpmn:Collaboration`)})}function BpmnTreeWalker(t){var n={},r=[],i={};function contextual(t,n){return function(r){t(r,n)}}function handled(t){n[t.id]=t}function isHandled(t){return n[t.id]}function visit(n,r){if(n.gfx)throw Error(`already rendered ${elementToString(n)}`);return t.element(n,i[n.id],r)}function visitRoot(n,r){return t.root(n,i[n.id],r)}function visitIfDi(t,n){try{var r=i[t.id]&&visit(t,n);return handled(t),r}catch(n){logError(n.message,{element:t,error:n}),console.error(`failed to import ${elementToString(t)}`,n)}}function logError(n,r){t.error(n,r)}var a=this.registerDi=function registerDi(t){var n=t.bpmnElement;n?i[n.id]?logError(`multiple DI elements defined for ${elementToString(n)}`,{element:n}):i[n.id]=t:logError(`no bpmnElement referenced in ${elementToString(t)}`,{element:t})};function handleDiagram(t){handlePlane(t.plane)}function handlePlane(t){a(t),S(t.planeElement,handlePlaneElement)}function handlePlaneElement(t){a(t)}this.handleDefinitions=function handleDefinitions(t,n){var s=t.diagrams;if(n&&s.indexOf(n)===-1)throw Error(`diagram not part of <bpmn:Definitions />`);if(!n&&s&&s.length&&(n=s[0]),!n)throw Error(`no diagram to display`);i={},handleDiagram(n);var c=n.plane;if(!c)throw Error(`no plane for ${elementToString(n)}`);var l=c.bpmnElement;if(!l){if(l=findDisplayCandidate(t),l)logError(`correcting missing bpmnElement on ${elementToString(c)} to ${elementToString(l)}`),c.bpmnElement=l,a(c);else throw Error(`no process or collaboration to display`)}var u=visitRoot(l,c);if(is$1(l,`bpmn:Process`)||is$1(l,`bpmn:SubProcess`))handleProcess(l,u);else if(is$1(l,`bpmn:Collaboration`))handleCollaboration(l,u),handleUnhandledProcesses(t.rootElements,u);else throw Error(`unsupported bpmnElement for ${elementToString(c)}: ${elementToString(l)}`);o(r)};var o=this.handleDeferred=function handleDeferred(){for(var t;r.length;)t=r.shift(),t()};function handleProcess(t,n){handleFlowElementsContainer(t,n),handleIoSpecification(t.ioSpecification,n),handleArtifacts(t.artifacts,n),handled(t)}function handleUnhandledProcesses(t,n){_(t,function(t){return!isHandled(t)&&is$1(t,`bpmn:Process`)&&t.laneSets}).forEach(contextual(handleProcess,n))}function handleMessageFlow(t,n){visitIfDi(t,n)}function handleMessageFlows(t,n){S(t,contextual(handleMessageFlow,n))}function handleDataAssociation(t,n){visitIfDi(t,n)}function handleDataInput(t,n){visitIfDi(t,n)}function handleDataOutput(t,n){visitIfDi(t,n)}function handleArtifact(t,n){visitIfDi(t,n)}function handleArtifacts(t,n){S(t,function(t){is$1(t,`bpmn:Association`)?r.push(function(){handleArtifact(t,n)}):handleArtifact(t,n)})}function handleIoSpecification(t,n){t&&(S(t.dataInputs,contextual(handleDataInput,n)),S(t.dataOutputs,contextual(handleDataOutput,n)))}var s=this.handleSubProcess=function handleSubProcess(t,n){handleFlowElementsContainer(t,n),handleArtifacts(t.artifacts,n)};function handleFlowNode(t,n){var i=visitIfDi(t,n);is$1(t,`bpmn:SubProcess`)&&s(t,i||n),is$1(t,`bpmn:Activity`)&&handleIoSpecification(t.ioSpecification,n),r.push(function(){S(t.dataInputAssociations,contextual(handleDataAssociation,n)),S(t.dataOutputAssociations,contextual(handleDataAssociation,n))})}function handleSequenceFlow(t,n){visitIfDi(t,n)}function handleDataElement(t,n){visitIfDi(t,n)}function handleLane(t,n){r.push(function(){var r=visitIfDi(t,n);t.childLaneSet&&handleLaneSet(t.childLaneSet,r||n),wireFlowNodeRefs(t)})}function handleLaneSet(t,n){S(t.lanes,contextual(handleLane,n))}function handleLaneSets(t,n){S(t,contextual(handleLaneSet,n))}function handleFlowElementsContainer(t,n){handleFlowElements(t.flowElements,n),t.laneSets&&handleLaneSets(t.laneSets,n)}function handleFlowElements(t,n){S(t,function(t){is$1(t,`bpmn:SequenceFlow`)?r.push(function(){handleSequenceFlow(t,n)}):is$1(t,`bpmn:BoundaryEvent`)?r.unshift(function(){handleFlowNode(t,n)}):is$1(t,`bpmn:FlowNode`)?handleFlowNode(t,n):is$1(t,`bpmn:DataObject`)||(is$1(t,`bpmn:DataStoreReference`)||is$1(t,`bpmn:DataObjectReference`)?handleDataElement(t,n):logError(`unrecognized flowElement ${elementToString(t)} in context ${elementToString(n&&n.businessObject)}`,{element:t,context:n}))})}function handleParticipant(t,n){var r=visitIfDi(t,n),i=t.processRef;i&&handleProcess(i,r||n)}function handleCollaboration(t,n){S(t.participants,contextual(handleParticipant,n)),r.push(function(){handleMessageFlows(t.messageFlows,n)}),handleArtifacts(t.artifacts,n)}function wireFlowNodeRefs(t){S(t.flowNodeRef,function(n){var r=n.get(`lanes`);r&&r.push(t)})}}h();function is(t,n){var r=getBusinessObject(t);return r&&typeof r.$instanceOf==`function`&&r.$instanceOf(n)}function isAny(t,n){return i(n,function(n){return is(t,n)})}function getBusinessObject(t){return t&&t.businessObject||t}function getDi(t){return t&&t.di}h();function importBpmnDiagram(t,n,r){var i,a,o,s,c=[];function render(t,n){var r=new BpmnTreeWalker({root:function(t,n){return i.add(t,n)},element:function(t,n,r){return i.add(t,n,r)},error:function(t,n){c.push({message:t,context:n})}});n||=t.diagrams&&t.diagrams[0];var a=getDiagramsToImport(t,n);if(!a)throw Error(`no diagram to display`);S(a,function(n){r.handleDefinitions(t,n)});var s=n.plane.bpmnElement.id;o.setRootElement(o.findRoot(s+`_plane`)||o.findRoot(s))}return new Promise(function(l,u){try{return i=t.get(`bpmnImporter`),a=t.get(`eventBus`),o=t.get(`canvas`),a.fire(`import.render.start`,{definitions:n}),render(n,r),a.fire(`import.render.complete`,{error:s,warnings:c}),l({warnings:c})}catch(t){return t.warnings=c,u(t)}})}function getDiagramsToImport(t,n){if(n&&n.plane){var r=n.plane.bpmnElement,i=r;!is(r,`bpmn:Process`)&&!is(r,`bpmn:Collaboration`)&&(i=findRootProcess(r));var a=is(i,`bpmn:Collaboration`)?i:b(t.rootElements,function(t){if(is(t,`bpmn:Collaboration`))return b(t.participants,function(t){return t.processRef===i})}),o=[i];a&&(o=w(a.participants,function(t){return t.processRef}),o.push(a));var s=selfAndAllFlowElements(o),c=[n],l=[r];return S(t.diagrams,function(t){if(t.plane){var n=t.plane.bpmnElement;s.indexOf(n)!==-1&&l.indexOf(n)===-1&&(c.push(t),l.push(n))}}),c}}function selfAndAllFlowElements(t){var n=[];return S(t,function(t){t&&(n.push(t),n=n.concat(selfAndAllFlowElements(t.flowElements)))}),n}function findRootProcess(t){for(var n=t;n;){if(is(n,`bpmn:Process`))return n;n=n.$parent}}var Me=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>`,Ne={verticalAlign:`middle`},Pe={color:`#404040`},Fe={zIndex:`1001`,position:`fixed`,top:`0`,left:`0`,right:`0`,bottom:`0`},Ie={width:`100%`,height:`100%`,background:`rgba(40,40,40,0.2)`},Le={position:`absolute`,left:`50%`,top:`40%`,transform:`translate(-50%)`,width:`260px`,padding:`10px`,background:`white`,boxShadow:`0 1px 4px rgba(0,0,0,0.3)`,fontFamily:`Helvetica, Arial, sans-serif`,fontSize:`14px`,display:`flex`,lineHeight:`1.3`},Re=`<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">`+Me+`</a><span>Web-based tooling for BPMN, DMN and forms powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>`,J;function createLightbox(){J=domify(Re),assign(J,Fe),assign(query(`svg`,J),Ne),assign(query(`.backdrop`,J),Ie),assign(query(`.notice`,J),Le),assign(query(`.link`,J),Pe,{margin:`15px 20px 15px 10px`,alignSelf:`center`})}function open(){J||(createLightbox(),N.bind(J,`.backdrop`,`click`,function(t){document.body.removeChild(J)})),document.body.appendChild(J)}h();var ze=5,Be=`djs-outline-hidden`;function BaseViewer(t){t=x({},Ve,t),this._moddle=this._createModdle(t),this._container=this._createContainer(t),this._init(this._container,this._moddle,t),addProjectLogo(this._container)}e(BaseViewer,Diagram),BaseViewer.prototype.importXML=async function importXML(t,n){let r=this;function ParseCompleteEvent(t){return r.get(`eventBus`).createEvent(t)}let i=[];try{t=this._emit(`import.parse.start`,{xml:t})||t;let r;try{r=await this._moddle.fromXML(t,`bpmn:Definitions`)}catch(t){throw this._emit(`import.parse.complete`,{error:t}),t}let a=r.rootElement,o=r.references,s=r.warnings,c=r.elementsById;i=i.concat(s),a=this._emit(`import.parse.complete`,ParseCompleteEvent({error:null,definitions:a,elementsById:c,references:o,warnings:i}))||a;let l=await this.importDefinitions(a,n);return i=i.concat(l.warnings),this._emit(`import.done`,{error:null,warnings:i}),{warnings:i}}catch(t){let n=t;throw i=i.concat(n.warnings||[]),addWarningsToError(n,i),n=checkValidationError(n),this._emit(`import.done`,{error:n,warnings:n.warnings}),n}},BaseViewer.prototype.importDefinitions=async function importDefinitions(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}},BaseViewer.prototype.open=async function open(t){let n=this._definitions,r=t;if(!n){let t=Error(`no XML imported`);throw addWarningsToError(t,[]),t}if(typeof t==`string`&&(r=findBPMNDiagram(n,t),!r)){let n=Error(`BPMNDiagram <`+t+`> not found`);throw addWarningsToError(n,[]),n}try{this.clear()}catch(t){throw addWarningsToError(t,[]),t}let{warnings:i}=await importBpmnDiagram(this,n,r);return{warnings:i}},BaseViewer.prototype.saveXML=async function saveXML(t){t||={};let n=this._definitions,r,i;try{if(!n)throw Error(`no definitions loaded`);n=this._emit(`saveXML.start`,{definitions:n})||n,i=(await this._moddle.toXML(n,t)).xml,i=this._emit(`saveXML.serialized`,{xml:i})||i}catch(t){r=t}let a=r?{error:r}:{xml:i};if(this._emit(`saveXML.done`,a),r)throw r;return a},BaseViewer.prototype.saveSVG=async function saveSVG(){this._emit(`saveSVG.start`);let t,n;try{let n=this.get(`canvas`),r=n.getActiveLayer(),i=query(`:scope > defs`,n._svg),a=innerSVG(r),o=i?`<defs>`+innerSVG(i)+`</defs>`:``,s=n.getContainer();classes$1(s).add(Be);let c;try{c=r.getBBox()}finally{classes$1(s).remove(Be)}let l=c.x-ze,u=c.y-ze,d=c.width+10,f=c.height+10;t=`<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- created with bpmn-js / http://bpmn.io -->
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+d+`" height="`+f+`" viewBox="`+l+` `+u+` `+d+` `+f+`" version="1.1">`+o+a+`</svg>`}catch(t){n=t}if(this._emit(`saveSVG.done`,{error:n,svg:t}),n)throw n;return{svg:t}},BaseViewer.prototype._setDefinitions=function(t){this._definitions=t},BaseViewer.prototype.getModules=function(){return this._modules},BaseViewer.prototype.clear=function(){this.getDefinitions()&&Diagram.prototype.clear.call(this)},BaseViewer.prototype.destroy=function(){Diagram.prototype.destroy.call(this),remove$2(this._container)},BaseViewer.prototype.on=function(t,n,r,i){return this.get(`eventBus`).on(t,n,r,i)},BaseViewer.prototype.off=function(t,n){this.get(`eventBus`).off(t,n)},BaseViewer.prototype.attachTo=function(t){if(!t)throw Error(`parentNode required`);this.detach(),t.get&&t.constructor.prototype.jquery&&(t=t.get(0)),typeof t==`string`&&(t=query(t)),t.appendChild(this._container),this._emit(`attach`,{}),this.get(`canvas`).resized()},BaseViewer.prototype.getDefinitions=function(){return this._definitions},BaseViewer.prototype.detach=function(){let t=this._container,n=t.parentNode;n&&(this._emit(`detach`,{}),n.removeChild(t))},BaseViewer.prototype._init=function(t,n,i){let a=i.modules||this.getModules(i),o=i.additionalModules||[],s=[{bpmnjs:[`value`,this],moddle:[`value`,n]}],c=[].concat(s,a,o),l=x(r(i,[`additionalModules`]),{canvas:x({},i.canvas,{container:t}),modules:c});Diagram.call(this,l),i&&i.container&&this.attachTo(i.container)},BaseViewer.prototype._emit=function(t,n){return this.get(`eventBus`).fire(t,n)},BaseViewer.prototype._createContainer=function(t){let n=domify(`<div class="bjs-container bio-theme-parent"></div>`);return assign(n,{width:ensureUnit(t.width),height:ensureUnit(t.height),position:t.position}),n},BaseViewer.prototype._createModdle=function(t){let n=x({},this._moddleExtensions,t.moddleExtensions);return new D(n)},BaseViewer.prototype._modules=[];function addWarningsToError(t,n){return t.warnings=n,t}function checkValidationError(t){let n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(t.message);return n&&(t.message=`unparsable content <`+n[1]+`> detected; this may indicate an invalid BPMN 2.0 diagram file`+n[2]),t}var Ve={width:`100%`,height:`100%`,position:`relative`};function ensureUnit(t){return t+(E(t)?`px`:``)}function findBPMNDiagram(t,n){return n&&b(t.diagrams,function(t){return t.id===n})||null}function addProjectLogo(t){let n=domify(`<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >`+Me+`</a>`);assign(query(`svg`,n),Ne),assign(n,Pe,{position:`absolute`,bottom:`15px`,right:`15px`,zIndex:`100`}),t.appendChild(n),j.bind(n,`click`,function(t){open(),t.preventDefault()})}h();function isExpanded(t,n){return is(t,`bpmn:CallActivity`)?!1:is(t,`bpmn:SubProcess`)?(n||=getDi(t),n&&is(n,`bpmndi:BPMNPlane`)?!0:n&&!!n.isExpanded):!is(t,`bpmn:Participant`)||!!getBusinessObject(t).processRef}function isHorizontal(t){if(is(t,`bpmn:Participant`)||is(t,`bpmn:Lane`)){var n=getDi(t).isHorizontal;return n===void 0||n}}function isInterrupting(t){return t&&getBusinessObject(t).isInterrupting!==!1}function isEventSubProcess(t){return t&&!!getBusinessObject(t).triggeredByEvent}function hasEventDefinition(t,n){var r=getBusinessObject(t).eventDefinitions;return i(r,function(t){return is(t,n)})}function hasErrorEventDefinition(t){return hasEventDefinition(t,`bpmn:ErrorEventDefinition`)}function hasEscalationEventDefinition(t){return hasEventDefinition(t,`bpmn:EscalationEventDefinition`)}function hasCompensateEventDefinition(t){return hasEventDefinition(t,`bpmn:CompensateEventDefinition`)}h();var Y={width:90,height:20};function isLabelExternal(t){return is(t,`bpmn:Event`)||is(t,`bpmn:Gateway`)||is(t,`bpmn:DataStoreReference`)||is(t,`bpmn:DataObjectReference`)||is(t,`bpmn:DataInput`)||is(t,`bpmn:DataOutput`)||is(t,`bpmn:SequenceFlow`)||is(t,`bpmn:MessageFlow`)||is(t,`bpmn:Group`)}function hasExternalLabel(t){return isLabel(t.label)}function getFlowLabelPosition(t){var n=t.length/2-1,r=t[Math.floor(n)],i=t[Math.ceil(n+.01)],a=getWaypointsMid(t),o=Math.atan((i.y-r.y)/(i.x-r.x)),s=a.x,c=a.y;return Math.abs(o)<Math.PI/2?c-=15:s+=15,{x:s,y:c}}function getWaypointsMid(t){var n=t.length/2-1,r=t[Math.floor(n)],i=t[Math.ceil(n+.01)];return{x:r.x+(i.x-r.x)/2,y:r.y+(i.y-r.y)/2}}function getExternalLabelMid(t){return t.waypoints?getFlowLabelPosition(t.waypoints):is(t,`bpmn:Group`)?{x:t.x+t.width/2,y:t.y+Y.height/2}:{x:t.x+t.width/2,y:t.y+t.height+Y.height/2}}function getExternalLabelBounds(t,n){var r,i,a,o=t.label;return o&&o.bounds?(a=o.bounds,i={width:a.width,height:a.height},r={x:a.x+a.width/2,y:a.y+a.height/2}):(r=getExternalLabelMid(n),i=Y),x({x:r.x-i.width/2,y:r.y-i.height/2},i)}function getLabelAttr(t){if(is(t,`bpmn:FlowElement`)||is(t,`bpmn:Participant`)||is(t,`bpmn:Lane`)||is(t,`bpmn:SequenceFlow`)||is(t,`bpmn:MessageFlow`)||is(t,`bpmn:DataInput`)||is(t,`bpmn:DataOutput`))return`name`;if(is(t,`bpmn:TextAnnotation`))return`text`;if(is(t,`bpmn:Group`))return`categoryValueRef`}function getCategoryValue(t){var n=t.categoryValueRef;return n&&n.value||``}function getLabel(t){var n=t.businessObject,r=getLabelAttr(n);if(r)return r===`categoryValueRef`?getCategoryValue(n):n[r]||``}function setLabel(t,n){var r=t.businessObject,i=getLabelAttr(r);if(i){if(i===`categoryValueRef`){if(!r[i])return t;r[i].value=n}else r[i]=n}return t}function isExternalLabel(t){return isLabel(t)&&isLabelExternal(t.labelTarget)}h();function getElementAnnotations(t){let n=[];return S(t.incoming,t=>{is(t,`bpmn:Association`)&&is(t.source,`bpmn:TextAnnotation`)&&n.push({annotation:t.source,association:t})}),S(t.outgoing,t=>{is(t,`bpmn:Association`)&&is(t.target,`bpmn:TextAnnotation`)&&n.push({annotation:t.target,association:t})}),n}function collectElementsAnnotations(t){let n=new Map;return S(selfAndChildren(t,!0,-1),t=>{S(getElementAnnotations(t),t=>{n.has(t.annotation)||n.set(t.annotation,{annotation:t.annotation,associations:[]}),n.get(t.annotation).associations.push(t.association)})}),[...n.values()]}h();var He=`hsl(225, 10%, 15%)`;function isTypedEvent(t,n){return i(t.eventDefinitions,function(t){return t.$type===n})}function isThrowEvent(t){return t.$type===`bpmn:IntermediateThrowEvent`||t.$type===`bpmn:EndEvent`}function isCollection(t){var n=t.dataObjectRef;return t.isCollection||n&&n.isCollection}function getFillColor(t,n,r){var i=getDi(t);return r||i.get(`color:background-color`)||i.get(`bioc:fill`)||n||`white`}function getStrokeColor(t,n,r){var i=getDi(t);return r||i.get(`color:border-color`)||i.get(`bioc:stroke`)||n||`hsl(225, 10%, 15%)`}function getLabelColor(t,n,r,i){var a=getDi(t).get(`label`);return i||a&&a.get(`color:color`)||n||getStrokeColor(t,r)}function getCirclePath(t){var n=t.x+t.width/2,r=t.y+t.height/2,i=t.width/2;return componentsToPath([[`M`,n,r],[`m`,0,-i],[`a`,i,i,0,1,1,0,2*i],[`a`,i,i,0,1,1,0,-2*i],[`z`]])}function getRoundRectPath(t,n){var r=t.x,i=t.y,a=t.width,o=t.height;return componentsToPath([[`M`,r+n,i],[`l`,a-n*2,0],[`a`,n,n,0,0,1,n,n],[`l`,0,o-n*2],[`a`,n,n,0,0,1,-n,n],[`l`,n*2-a,0],[`a`,n,n,0,0,1,-n,-n],[`l`,0,n*2-o],[`a`,n,n,0,0,1,n,-n],[`z`]])}function getDiamondPath(t){var n=t.width,r=t.height,i=t.x,a=t.y,o=n/2,s=r/2;return componentsToPath([[`M`,i+o,a],[`l`,o,s],[`l`,-o,s],[`l`,-o,-s],[`z`]])}function getRectPath(t){var n=t.x,r=t.y,i=t.width,a=t.height;return componentsToPath([[`M`,n,r],[`l`,i,0],[`l`,0,a],[`l`,-i,0],[`z`]])}function getBounds(t,n={}){return{width:getWidth(t,n),height:getHeight(t,n)}}function getWidth(t,n={}){return v(n,`width`)?n.width:t.width}function getHeight(t,n={}){return v(n,`height`)?n.height:t.height}h();var Ue=new ee,We=10,X=3,Ge=1.5,Z=10,Ke=4,Q=.95,qe=1,Je=.25;function BpmnRenderer(t,n,r,i,a,o,s){BaseRenderer.call(this,n,s);var c=t&&t.defaultFillColor,l=t&&t.defaultStrokeColor,d=t&&t.defaultLabelColor;function shapeStyle(t){return r.computeStyle(t,{strokeLinecap:`round`,strokeLinejoin:`round`,stroke:He,strokeWidth:2,fill:`white`})}function lineStyle(t){return r.computeStyle(t,[`no-fill`],{strokeLinecap:`round`,strokeLinejoin:`round`,stroke:He,strokeWidth:2})}function addMarker(t,n){var{ref:r={x:0,y:0},scale:i=1,element:o,parentGfx:s=a._svg}=n,c=create$1(`marker`,{id:t,viewBox:`0 0 20 20`,refX:r.x,refY:r.y,markerWidth:20*i,markerHeight:20*i,orient:`auto`});append(c,o);var l=query(`:scope > defs`,s);l||(l=create$1(`defs`),append(s,l)),append(l,c)}function marker(t,n,r,i){var a=Ue.nextPrefixed(`marker-`);return createMarker(t,a,n,r,i),`url(#`+a+`)`}function createMarker(t,n,r,i,a){r===`sequenceflow-end`&&addMarker(n,{element:create$1(`path`,{d:`M 1 5 L 11 10 L 1 15 Z`,...shapeStyle({fill:a,stroke:a,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:t}),r===`messageflow-start`&&addMarker(n,{element:create$1(`circle`,{cx:6,cy:6,r:3.5,...shapeStyle({fill:i,stroke:a,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:t}),r===`messageflow-end`&&addMarker(n,{element:create$1(`path`,{d:`m 1 5 l 0 -3 l 7 3 l -7 3 z`,...shapeStyle({fill:i,stroke:a,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:t}),r===`association-start`&&addMarker(n,{element:create$1(`path`,{d:`M 11 5 L 1 10 L 11 15`,...lineStyle({fill:`none`,stroke:a,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:t}),r===`association-end`&&addMarker(n,{element:create$1(`path`,{d:`M 1 5 L 11 10 L 1 15`,...lineStyle({fill:`none`,stroke:a,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:t}),r===`conditional-flow-marker`&&addMarker(n,{element:create$1(`path`,{d:`M 0 10 L 8 6 L 16 10 L 8 14 Z`,...shapeStyle({fill:i,stroke:a})}),ref:{x:-1,y:10},scale:.5,parentGfx:t}),r===`conditional-default-flow-marker`&&addMarker(n,{element:create$1(`path`,{d:`M 6 4 L 10 16`,...shapeStyle({stroke:a,fill:`none`})}),ref:{x:0,y:10},scale:.5,parentGfx:t})}function drawCircle(t,n,r,i,a={}){u(i)&&(a=i,i=0),i||=0,a=shapeStyle(a);var o=create$1(`circle`,{cx:n/2,cy:r/2,r:Math.round((n+r)/4-i),...a});return append(t,o),o}function drawRect(t,n,r,i,a,o){u(a)&&(o=a,a=0),a||=0,o=shapeStyle(o);var s=create$1(`rect`,{x:a,y:a,width:n-a*2,height:r-a*2,rx:i,ry:i,...o});return append(t,s),s}function drawDiamond(t,n,r,i){var a=n/2,o=r/2,s=[{x:a,y:0},{x:n,y:o},{x:a,y:r},{x:0,y:o}].map(function(t){return t.x+`,`+t.y}).join(` `);i=shapeStyle(i);var c=create$1(`polygon`,{...i,points:s});return append(t,c),c}function drawLine(t,n,r,i){r=lineStyle(r);var a=createLine(n,r,i);return append(t,a),a}function drawConnectionSegments(t,n,r){return drawLine(t,n,r,5)}function drawPath(t,n,r){r=lineStyle(r);var i=create$1(`path`,{...r,d:n});return append(t,i),i}function drawMarker(t,n,r,i){return drawPath(n,r,x({"data-marker":t},i))}function renderer(t){return m[t]}function as(t){return function(n,r,i){return renderer(t)(n,r,i)}}var f={"bpmn:MessageEventDefinition":function(t,n,r={},a){return drawPath(t,i.getScaledPath(`EVENT_MESSAGE`,{xScaleFactor:.9,yScaleFactor:.9,containerWidth:r.width||n.width,containerHeight:r.height||n.height,position:{mx:.235,my:.315}}),{fill:a?getStrokeColor(n,l,r.stroke):getFillColor(n,c,r.fill),stroke:a?getFillColor(n,c,r.fill):getStrokeColor(n,l,r.stroke),strokeWidth:1})},"bpmn:TimerEventDefinition":function(t,n,r={}){var a=r.width||n.width,o=r.height||n.height,s=r.width?1:2,u=drawCircle(t,a,o,.2*o,{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:s});drawPath(t,i.getScaledPath(`EVENT_TIMER_WH`,{xScaleFactor:.75,yScaleFactor:.75,containerWidth:a,containerHeight:o,position:{mx:.5,my:.5}}),{stroke:getStrokeColor(n,l,r.stroke),strokeWidth:s});for(var d=0;d<12;d++){var f=i.getScaledPath(`EVENT_TIMER_LINE`,{xScaleFactor:.75,yScaleFactor:.75,containerWidth:a,containerHeight:o,position:{mx:.5,my:.5}}),p=a/2,m=o/2;drawPath(t,f,{strokeWidth:1,stroke:getStrokeColor(n,l,r.stroke),transform:`rotate(`+d*30+`,`+m+`,`+p+`)`})}return u},"bpmn:EscalationEventDefinition":function(t,n,r={},a){return drawPath(t,i.getScaledPath(`EVENT_ESCALATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width||n.width,containerHeight:r.height||n.height,position:{mx:.5,my:.2}}),{fill:a?getStrokeColor(n,l,r.stroke):getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(t,n,r={}){return drawPath(t,i.getScaledPath(`EVENT_CONDITIONAL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width||n.width,containerHeight:r.height||n.height,position:{mx:.5,my:.222}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(t,n,r={},a){return drawPath(t,i.getScaledPath(`EVENT_LINK`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width,containerHeight:n.height,position:{mx:.57,my:.263}}),{fill:a?getStrokeColor(n,l,r.stroke):getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(t,n,r={},a){return drawPath(t,i.getScaledPath(`EVENT_ERROR`,{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:r.width||n.width,containerHeight:r.height||n.height,position:{mx:.2,my:.722}}),{fill:a?getStrokeColor(n,l,r.stroke):getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(t,n,r={},a){var o=drawPath(t,i.getScaledPath(`EVENT_CANCEL_45`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width,containerHeight:n.height,position:{mx:.638,my:-.055}}),{fill:a?getStrokeColor(n,l,r.stroke):`none`,stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1});return rotate(o,45),o},"bpmn:CompensateEventDefinition":function(t,n,r={},a){return drawPath(t,i.getScaledPath(`EVENT_COMPENSATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width||n.width,containerHeight:r.height||n.height,position:{mx:.22,my:.5}}),{fill:a?getStrokeColor(n,l,r.stroke):getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(t,n,r={},a){return drawPath(t,i.getScaledPath(`EVENT_SIGNAL`,{xScaleFactor:.9,yScaleFactor:.9,containerWidth:r.width||n.width,containerHeight:r.height||n.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:a?getStrokeColor(n,l,r.stroke):getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke)})},"bpmn:MultipleEventDefinition":function(t,n,r={},a){return drawPath(t,i.getScaledPath(`EVENT_MULTIPLE`,{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:r.width||n.width,containerHeight:r.height||n.height,position:{mx:.211,my:.36}}),{fill:a?getStrokeColor(n,l,r.stroke):getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(t,n,r={}){return drawPath(t,i.getScaledPath(`EVENT_PARALLEL_MULTIPLE`,{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:r.width||n.width,containerHeight:r.height||n.height,position:{mx:.458,my:.194}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(t,n,r={}){return drawCircle(t,n.width,n.height,8,{fill:getStrokeColor(n,l,r.stroke),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:4})}};function renderEventIcon(t,n,r={},i){var a=getBusinessObject(t),o=isThrowEvent(a),s=i||t;return a.get(`eventDefinitions`)&&a.get(`eventDefinitions`).length>1?a.get(`parallelMultiple`)?f[`bpmn:ParallelMultipleEventDefinition`](n,s,r,o):f[`bpmn:MultipleEventDefinition`](n,s,r,o):isTypedEvent(a,`bpmn:MessageEventDefinition`)?f[`bpmn:MessageEventDefinition`](n,s,r,o):isTypedEvent(a,`bpmn:TimerEventDefinition`)?f[`bpmn:TimerEventDefinition`](n,s,r,o):isTypedEvent(a,`bpmn:ConditionalEventDefinition`)?f[`bpmn:ConditionalEventDefinition`](n,s,r,o):isTypedEvent(a,`bpmn:SignalEventDefinition`)?f[`bpmn:SignalEventDefinition`](n,s,r,o):isTypedEvent(a,`bpmn:EscalationEventDefinition`)?f[`bpmn:EscalationEventDefinition`](n,s,r,o):isTypedEvent(a,`bpmn:LinkEventDefinition`)?f[`bpmn:LinkEventDefinition`](n,s,r,o):isTypedEvent(a,`bpmn:ErrorEventDefinition`)?f[`bpmn:ErrorEventDefinition`](n,s,r,o):isTypedEvent(a,`bpmn:CancelEventDefinition`)?f[`bpmn:CancelEventDefinition`](n,s,r,o):isTypedEvent(a,`bpmn:CompensateEventDefinition`)?f[`bpmn:CompensateEventDefinition`](n,s,r,o):isTypedEvent(a,`bpmn:TerminateEventDefinition`)?f[`bpmn:TerminateEventDefinition`](n,s,r,o):null}var p={ParticipantMultiplicityMarker:function(t,n,r={}){var a=getWidth(n,r),o=getHeight(n,r);drawMarker(`participant-multiplicity`,t,i.getScaledPath(`MARKER_PARALLEL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:a,containerHeight:o,position:{mx:(a/2-6)/a,my:(o-15)/o}}),{strokeWidth:2,fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke)})},SubProcessMarker:function(t,n,r={}){translate$1(drawRect(t,14,14,0,{strokeWidth:1,fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke)}),n.width/2-7.5,n.height-20),drawMarker(`sub-process`,t,i.getScaledPath(`MARKER_SUB_PROCESS`,{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:n.width,containerHeight:n.height,position:{mx:(n.width/2-7.5)/n.width,my:(n.height-20)/n.height}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke)})},ParallelMarker:function(t,n,r){var a=getWidth(n,r),o=getHeight(n,r);drawMarker(`parallel`,t,i.getScaledPath(`MARKER_PARALLEL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:a,containerHeight:o,position:{mx:(a/2+r.parallel)/a,my:(o-20)/o}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke)})},SequentialMarker:function(t,n,r){drawMarker(`sequential`,t,i.getScaledPath(`MARKER_SEQUENTIAL`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width,containerHeight:n.height,position:{mx:(n.width/2+r.seq)/n.width,my:(n.height-19)/n.height}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke)})},CompensationMarker:function(t,n,r){drawMarker(`compensation`,t,i.getScaledPath(`MARKER_COMPENSATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width,containerHeight:n.height,position:{mx:(n.width/2+r.compensation)/n.width,my:(n.height-13)/n.height}}),{strokeWidth:1,fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke)})},LoopMarker:function(t,n,r){var a=getWidth(n,r),o=getHeight(n,r);drawMarker(`loop`,t,i.getScaledPath(`MARKER_LOOP`,{xScaleFactor:1,yScaleFactor:1,containerWidth:a,containerHeight:o,position:{mx:(a/2+r.loop)/a,my:(o-7)/o}}),{strokeWidth:1.5,fill:`none`,stroke:getStrokeColor(n,l,r.stroke),strokeMiterlimit:.5})},AdhocMarker:function(t,n,r){var a=getWidth(n,r),o=getHeight(n,r);drawMarker(`adhoc`,t,i.getScaledPath(`MARKER_ADHOC`,{xScaleFactor:1,yScaleFactor:1,containerWidth:a,containerHeight:o,position:{mx:(a/2+r.adhoc)/a,my:(o-15)/o}}),{strokeWidth:1,fill:getStrokeColor(n,l,r.stroke),stroke:getStrokeColor(n,l,r.stroke)})}};function renderTaskMarker(t,n,r,i){p[t](n,r,i)}function renderTaskMarkers(t,n,r=[],i={}){i={fill:i.fill,stroke:i.stroke,width:getWidth(n,i),height:getHeight(n,i)};var a=getBusinessObject(n),o=r.includes(`SubProcessMarker`);i=o?{...i,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},a.get(`isForCompensation`)&&r.push(`CompensationMarker`),is(a,`bpmn:AdHocSubProcess`)&&(r.push(`AdhocMarker`),o||x(i,{compensation:i.compensation-18}));var s=a.get(`loopCharacteristics`),c=s&&s.get(`isSequential`);s&&(x(i,{compensation:i.compensation-18}),r.includes(`AdhocMarker`)&&x(i,{seq:-23,loop:-18,parallel:-24}),c===void 0&&r.push(`LoopMarker`),c===!1&&r.push(`ParallelMarker`),c===!0&&r.push(`SequentialMarker`)),r.includes(`CompensationMarker`)&&r.length===1&&x(i,{compensation:-8}),S(r,function(r){renderTaskMarker(r,t,n,i)})}function renderLabel(t,n,r={}){r=x({size:{width:100}},r);var i=o.createText(n||``,r);return classes(i).add(`djs-label`),append(t,i),i}function renderEmbeddedLabel(t,n,r,i={}){var a=getBusinessObject(n),o=getBounds({x:n.x,y:n.y,width:n.width,height:n.height},i);return renderLabel(t,a.name,{align:r,box:o,padding:7,style:{fill:getLabelColor(n,d,l,i.stroke)}})}function renderExternalLabel(t,n,r={}){var i={width:n.width,height:n.height,x:n.width/2+n.x,y:n.height/2+n.y};return renderLabel(t,getLabel(n),{box:i,style:x({},o.getExternalStyle(),{fill:getLabelColor(n,d,l,r.stroke)})})}function renderLaneLabel(t,n,r,i={}){var a=isHorizontal(r),o=renderLabel(t,n,{box:{height:30,width:a?getHeight(r,i):getWidth(r,i)},align:`center-middle`,style:{fill:getLabelColor(r,d,l,i.stroke)}});a&&transform(o,0,-(-1*getHeight(r,i)),270)}function renderActivity(t,n,r={}){var{width:i,height:a}=getBounds(n,r);return drawRect(t,i,a,Z,{...r,fill:getFillColor(n,c,r.fill),fillOpacity:Q,stroke:getStrokeColor(n,l,r.stroke)})}function renderAssociation(t,n,r={}){var i=getBusinessObject(n),a=getFillColor(n,c,r.fill),o=getStrokeColor(n,l,r.stroke);return(i.get(`associationDirection`)===`One`||i.get(`associationDirection`)===`Both`)&&(r.markerEnd=marker(t,`association-end`,a,o)),i.get(`associationDirection`)===`Both`&&(r.markerStart=marker(t,`association-start`,a,o)),r=pickAttrs(r,[`markerStart`,`markerEnd`]),drawConnectionSegments(t,n.waypoints,{...r,stroke:o,strokeDasharray:`0, 5`})}function renderDataObject(t,n,r={}){var a=getFillColor(n,c,r.fill),o=getStrokeColor(n,l,r.stroke),s=drawPath(t,i.getScaledPath(`DATA_OBJECT_PATH`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width,containerHeight:n.height,position:{mx:.474,my:.296}}),{fill:a,fillOpacity:Q,stroke:o});return isCollection(getBusinessObject(n))&&drawPath(t,i.getScaledPath(`DATA_OBJECT_COLLECTION_PATH`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width,containerHeight:n.height,position:{mx:.33,my:(n.height-18)/n.height}}),{strokeWidth:2,fill:a,stroke:o}),s}function renderEvent(t,n,r={}){return drawCircle(t,n.width,n.height,{fillOpacity:Q,...r,fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke)})}function renderGateway(t,n,r={}){return drawDiamond(t,n.width,n.height,{fill:getFillColor(n,c,r.fill),fillOpacity:Q,stroke:getStrokeColor(n,l,r.stroke)})}function renderLane(t,n,r={}){var i=drawRect(t,getWidth(n,r),getHeight(n,r),0,{fill:getFillColor(n,c,r.fill),fillOpacity:r.fillOpacity||Q,stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1.5}),a=getBusinessObject(n);return is(a,`bpmn:Lane`)&&renderLaneLabel(t,a.get(`name`),n,r),i}function renderSubProcess(t,n,r={}){var i=renderActivity(t,n,r),a=isExpanded(n);if(isEventSubProcess(n)&&(attr(i,{strokeDasharray:`0, 5.5`,strokeWidth:2.5}),!a)){var o=(getBusinessObject(n).flowElements||[]).filter(t=>is(t,`bpmn:StartEvent`));o.length===1&&renderEventSubProcessIcon(o[0],t,r,n)}return renderEmbeddedLabel(t,n,a?`center-top`:`center-middle`,r),a?renderTaskMarkers(t,n,void 0,r):renderTaskMarkers(t,n,[`SubProcessMarker`],r),i}function renderEventSubProcessIcon(t,n,r,i){var a=22,o={fill:getFillColor(i,c,r.fill),stroke:getStrokeColor(i,l,r.stroke),width:a,height:a},s=getBusinessObject(t).isInterrupting,u=s?0:3,d=s?1:1.2,f=20,p=(a-f)/2,m=`translate(`+p+`,`+p+`)`;drawCircle(n,f,f,{fill:o.fill,stroke:o.stroke,strokeWidth:d,strokeDasharray:u,transform:m}),renderEventIcon(t,n,o,i)}function renderTask(t,n,r={}){var i=renderActivity(t,n,r);return renderEmbeddedLabel(t,n,`center-middle`,r),renderTaskMarkers(t,n,void 0,r),i}var m=this.handlers={"bpmn:AdHocSubProcess":function(t,n,r={}){return r=isExpanded(n)?pickAttrs(r,[`fill`,`stroke`,`width`,`height`]):pickAttrs(r,[`fill`,`stroke`]),renderSubProcess(t,n,r)},"bpmn:Association":function(t,n,r={}){return r=pickAttrs(r,[`fill`,`stroke`]),renderAssociation(t,n,r)},"bpmn:BoundaryEvent":function(t,n,r={}){var{renderIcon:i=!0}=r;r=pickAttrs(r,[`fill`,`stroke`]);var a=getBusinessObject(n).get(`cancelActivity`);r={strokeWidth:1.5,fill:getFillColor(n,c,r.fill),fillOpacity:qe,stroke:getStrokeColor(n,l,r.stroke)},a||(r.strokeDasharray=`6`);var o=renderEvent(t,n,r);return drawCircle(t,n.width,n.height,X,{...r,fill:`none`}),i&&renderEventIcon(n,t,r),o},"bpmn:BusinessRuleTask":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=renderTask(t,n,r);return attr(drawPath(t,i.getScaledPath(`TASK_TYPE_BUSINESS_RULE_MAIN`,{abspos:{x:8,y:8}})),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),attr(drawPath(t,i.getScaledPath(`TASK_TYPE_BUSINESS_RULE_HEADER`,{abspos:{x:8,y:8}})),{fill:getStrokeColor(n,l,r.stroke),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),a},"bpmn:CallActivity":function(t,n,r={}){return r=pickAttrs(r,[`fill`,`stroke`]),renderSubProcess(t,n,{strokeWidth:5,...r})},"bpmn:ComplexGateway":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=renderGateway(t,n,r);return drawPath(t,i.getScaledPath(`GATEWAY_COMPLEX`,{xScaleFactor:.5,yScaleFactor:.5,containerWidth:n.width,containerHeight:n.height,position:{mx:.46,my:.26}}),{fill:getStrokeColor(n,l,r.stroke),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),a},"bpmn:DataInput":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=i.getRawPath(`DATA_ARROW`),o=renderDataObject(t,n,r);return drawPath(t,a,{fill:`none`,stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(t,n,r={}){return r=pickAttrs(r,[`fill`,`stroke`]),renderAssociation(t,n,{...r,markerEnd:marker(t,`association-end`,getFillColor(n,c,r.fill),getStrokeColor(n,l,r.stroke))})},"bpmn:DataObject":function(t,n,r={}){return r=pickAttrs(r,[`fill`,`stroke`]),renderDataObject(t,n,r)},"bpmn:DataObjectReference":as(`bpmn:DataObject`),"bpmn:DataOutput":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=i.getRawPath(`DATA_ARROW`),o=renderDataObject(t,n,r);return drawPath(t,a,{strokeWidth:1,fill:getStrokeColor(n,l,r.stroke),stroke:getStrokeColor(n,l,r.stroke)}),o},"bpmn:DataOutputAssociation":function(t,n,r={}){return r=pickAttrs(r,[`fill`,`stroke`]),renderAssociation(t,n,{...r,markerEnd:marker(t,`association-end`,getFillColor(n,c,r.fill),getStrokeColor(n,l,r.stroke))})},"bpmn:DataStoreReference":function(t,n,r={}){return r=pickAttrs(r,[`fill`,`stroke`]),drawPath(t,i.getScaledPath(`DATA_STORE`,{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width,containerHeight:n.height,position:{mx:0,my:.133}}),{fill:getFillColor(n,c,r.fill),fillOpacity:Q,stroke:getStrokeColor(n,l,r.stroke),strokeWidth:2})},"bpmn:EndEvent":function(t,n,r={}){var{renderIcon:i=!0}=r;r=pickAttrs(r,[`fill`,`stroke`]);var a=renderEvent(t,n,{...r,strokeWidth:4});return i&&renderEventIcon(n,t,r),a},"bpmn:EventBasedGateway":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=getBusinessObject(n),o=renderGateway(t,n,r);drawCircle(t,n.width,n.height,n.height*.2,{fill:getFillColor(n,`none`,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1});var s=a.get(`eventGatewayType`),c=!!a.get(`instantiate`);function drawEvent(){drawPath(t,i.getScaledPath(`GATEWAY_EVENT_BASED`,{xScaleFactor:.18,yScaleFactor:.18,containerWidth:n.width,containerHeight:n.height,position:{mx:.36,my:.44}}),{fill:`none`,stroke:getStrokeColor(n,l,r.stroke),strokeWidth:2})}return s===`Parallel`?drawPath(t,i.getScaledPath(`GATEWAY_PARALLEL`,{xScaleFactor:.4,yScaleFactor:.4,containerWidth:n.width,containerHeight:n.height,position:{mx:.474,my:.296}}),{fill:`none`,stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}):s===`Exclusive`&&(c||drawCircle(t,n.width,n.height,n.height*.26,{fill:`none`,stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),drawEvent()),o},"bpmn:ExclusiveGateway":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=renderGateway(t,n,r),o=i.getScaledPath(`GATEWAY_EXCLUSIVE`,{xScaleFactor:.4,yScaleFactor:.4,containerWidth:n.width,containerHeight:n.height,position:{mx:.32,my:.3}});return getDi(n).get(`isMarkerVisible`)&&drawPath(t,o,{fill:getStrokeColor(n,l,r.stroke),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),a},"bpmn:Gateway":function(t,n,r={}){return r=pickAttrs(r,[`fill`,`stroke`]),renderGateway(t,n,r)},"bpmn:Group":function(t,n,r={}){return r=pickAttrs(r,[`fill`,`stroke`,`width`,`height`]),drawRect(t,n.width,n.height,Z,{stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1.5,strokeDasharray:`10, 6, 0, 6`,fill:`none`,pointerEvents:`none`,width:getWidth(n,r),height:getHeight(n,r)})},"bpmn:InclusiveGateway":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var i=renderGateway(t,n,r);return drawCircle(t,n.width,n.height,n.height*.24,{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(t,n,r={}){var{renderIcon:i=!0}=r;r=pickAttrs(r,[`fill`,`stroke`]);var a=renderEvent(t,n,{...r,strokeWidth:1.5});return drawCircle(t,n.width,n.height,X,{fill:`none`,stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1.5}),i&&renderEventIcon(n,t,r),a},"bpmn:IntermediateCatchEvent":as(`bpmn:IntermediateEvent`),"bpmn:IntermediateThrowEvent":as(`bpmn:IntermediateEvent`),"bpmn:Lane":function(t,n,r={}){return r=pickAttrs(r,[`fill`,`stroke`,`width`,`height`]),renderLane(t,n,{...r,fillOpacity:Je})},"bpmn:ManualTask":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=renderTask(t,n,r);return drawPath(t,i.getScaledPath(`TASK_TYPE_MANUAL`,{abspos:{x:17,y:15}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:.5}),a},"bpmn:MessageFlow":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=getBusinessObject(n),o=getDi(n),s=getFillColor(n,c,r.fill),u=getStrokeColor(n,l,r.stroke),d=drawConnectionSegments(t,n.waypoints,{markerEnd:marker(t,`messageflow-end`,s,u),markerStart:marker(t,`messageflow-start`,s,u),stroke:u,strokeDasharray:`10, 11`,strokeWidth:1.5});if(a.get(`messageRef`)){var f=d.getPointAtLength(d.getTotalLength()/2),p=i.getScaledPath(`MESSAGE_FLOW_MARKER`,{abspos:{x:f.x,y:f.y}}),m={strokeWidth:1};o.get(`messageVisibleKind`)===`initiating`?(m.fill=s,m.stroke=u):(m.fill=u,m.stroke=s);var h=drawPath(t,p,m),g=renderLabel(t,a.get(`messageRef`).get(`name`),{align:`center-top`,fitBox:!0,style:{fill:u}}),_=h.getBBox(),v=g.getBBox();transform(g,f.x-v.width/2,f.y+_.height/2+We,0)}return d},"bpmn:ParallelGateway":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=renderGateway(t,n,r);return drawPath(t,i.getScaledPath(`GATEWAY_PARALLEL`,{xScaleFactor:.6,yScaleFactor:.6,containerWidth:n.width,containerHeight:n.height,position:{mx:.46,my:.2}}),{fill:getStrokeColor(n,l,r.stroke),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),a},"bpmn:Participant":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`,`width`,`height`]);var i=renderLane(t,n,r),a=isExpanded(n),o=isHorizontal(n),s=getBusinessObject(n),c=s.get(`name`);if(a)drawLine(t,o?[{x:30,y:0},{x:30,y:getHeight(n,r)}]:[{x:0,y:30},{x:getWidth(n,r),y:30}],{stroke:getStrokeColor(n,l,r.stroke),strokeWidth:Ge}),renderLaneLabel(t,c,n,r);else{var u=getBounds(n,r);o||(u.height=getWidth(n,r),u.width=getHeight(n,r));var f=renderLabel(t,c,{box:u,align:`center-middle`,style:{fill:getLabelColor(n,d,l,r.stroke)}});o||transform(f,0,-(-1*getHeight(n,r)),270)}return s.get(`participantMultiplicity`)&&renderTaskMarker(`ParticipantMultiplicityMarker`,t,n,r),i},"bpmn:ReceiveTask":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=getBusinessObject(n),o=renderTask(t,n,r),s;return a.get(`instantiate`)?(drawCircle(t,28,28,4.4,{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),s=i.getScaledPath(`TASK_TYPE_INSTANTIATING_SEND`,{abspos:{x:7.77,y:9.52}})):s=i.getScaledPath(`TASK_TYPE_SEND`,{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),drawPath(t,s,{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),o},"bpmn:ScriptTask":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=renderTask(t,n,r);return drawPath(t,i.getScaledPath(`TASK_TYPE_SCRIPT`,{abspos:{x:15,y:20}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),a},"bpmn:SendTask":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=renderTask(t,n,r);return drawPath(t,i.getScaledPath(`TASK_TYPE_SEND`,{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:getStrokeColor(n,l,r.stroke),stroke:getFillColor(n,c,r.fill),strokeWidth:1}),a},"bpmn:SequenceFlow":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var i=getFillColor(n,c,r.fill),a=getStrokeColor(n,l,r.stroke),o=drawConnectionSegments(t,n.waypoints,{markerEnd:marker(t,`sequenceflow-end`,i,a),stroke:a}),s=getBusinessObject(n),{source:u}=n;if(u){var d=getBusinessObject(u);s.get(`conditionExpression`)&&is(d,`bpmn:Activity`)&&attr(o,{markerStart:marker(t,`conditional-flow-marker`,i,a)}),d.get(`default`)&&(is(d,`bpmn:Gateway`)||is(d,`bpmn:Activity`))&&d.get(`default`)===s&&attr(o,{markerStart:marker(t,`conditional-default-flow-marker`,i,a)})}return o},"bpmn:ServiceTask":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=renderTask(t,n,r);return drawCircle(t,10,10,{fill:getFillColor(n,c,r.fill),stroke:`none`,transform:`translate(6, 6)`}),drawPath(t,i.getScaledPath(`TASK_TYPE_SERVICE`,{abspos:{x:12,y:18}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),drawCircle(t,10,10,{fill:getFillColor(n,c,r.fill),stroke:`none`,transform:`translate(11, 10)`}),drawPath(t,i.getScaledPath(`TASK_TYPE_SERVICE`,{abspos:{x:17,y:22}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:1}),a},"bpmn:StartEvent":function(t,n,r={}){var{renderIcon:i=!0}=r;r=pickAttrs(r,[`fill`,`stroke`]),getBusinessObject(n).get(`isInterrupting`)||(r={...r,strokeDasharray:`6`});var a=renderEvent(t,n,r);return i&&renderEventIcon(n,t,r),a},"bpmn:SubProcess":function(t,n,r={}){return r=isExpanded(n)?pickAttrs(r,[`fill`,`stroke`,`width`,`height`]):pickAttrs(r,[`fill`,`stroke`]),renderSubProcess(t,n,r)},"bpmn:Task":function(t,n,r={}){return r=pickAttrs(r,[`fill`,`stroke`]),renderTask(t,n,r)},"bpmn:TextAnnotation":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var{width:a,height:o}=getBounds(n,r),s=drawRect(t,a,o,0,0,{fill:`none`,stroke:`none`});return drawPath(t,i.getScaledPath(`TEXT_ANNOTATION`,{xScaleFactor:1,yScaleFactor:1,containerWidth:a,containerHeight:o,position:{mx:0,my:0}}),{stroke:getStrokeColor(n,l,r.stroke)}),renderLabel(t,getBusinessObject(n).get(`text`)||``,{align:`left-top`,box:getBounds(n,r),padding:7,style:{fill:getLabelColor(n,d,l,r.stroke)}}),s},"bpmn:Transaction":function(t,n,i={}){i=isExpanded(n)?pickAttrs(i,[`fill`,`stroke`,`width`,`height`]):pickAttrs(i,[`fill`,`stroke`]);var a=renderSubProcess(t,n,{strokeWidth:1.5,...i}),o=r.style([`no-fill`,`no-events`],{stroke:getStrokeColor(n,l,i.stroke),strokeWidth:1.5});return isExpanded(n)||(i={}),drawRect(t,getWidth(n,i),getHeight(n,i),Z-X,X,o),a},"bpmn:UserTask":function(t,n,r={}){r=pickAttrs(r,[`fill`,`stroke`]);var a=renderTask(t,n,r),o=15,s=12;return drawPath(t,i.getScaledPath(`TASK_TYPE_USER_1`,{abspos:{x:o,y:s}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:.5}),drawPath(t,i.getScaledPath(`TASK_TYPE_USER_2`,{abspos:{x:o,y:s}}),{fill:getFillColor(n,c,r.fill),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:.5}),drawPath(t,i.getScaledPath(`TASK_TYPE_USER_3`,{abspos:{x:o,y:s}}),{fill:getStrokeColor(n,l,r.stroke),stroke:getStrokeColor(n,l,r.stroke),strokeWidth:.5}),a},label:function(t,n,r={}){return renderExternalLabel(t,n,r)}};this._drawPath=drawPath,this._renderer=renderer}e(BpmnRenderer,BaseRenderer),BpmnRenderer.$inject=[`config.bpmnRenderer`,`eventBus`,`styles`,`pathMap`,`canvas`,`textRenderer`],BpmnRenderer.prototype.canRender=function(t){return is(t,`bpmn:BaseElement`)},BpmnRenderer.prototype.drawShape=function(t,n,r={}){var{type:i}=n;return this._renderer(i)(t,n,r)},BpmnRenderer.prototype.drawConnection=function(t,n,r={}){var{type:i}=n;return this._renderer(i)(t,n,r)},BpmnRenderer.prototype.getShapePath=function(t){return isLabel(t)?getRoundRectPath(t,Ke):is(t,`bpmn:Event`)?getCirclePath(t):is(t,`bpmn:Activity`)?getRoundRectPath(t,Z):is(t,`bpmn:Gateway`)?getDiamondPath(t):getRectPath(t)};function pickAttrs(t,n=[]){return n.reduce((n,r)=>(t[r]&&(n[r]=t[r]),n),{})}h();var Ye=0,Xe={width:150,height:50};function parseAlign(t){var n=t.split(`-`);return{horizontal:n[0]||`center`,vertical:n[1]||`top`}}function parsePadding(t){return u(t)?x({top:0,left:0,right:0,bottom:0},t):{top:t,left:t,right:t,bottom:t}}var Ze=null;function getCanvasContext(){return Ze||=document.createElement(`canvas`).getContext(`2d`),Ze}function buildFont(t){var n=[];return t.fontStyle&&n.push(t.fontStyle),t.fontVariant&&n.push(t.fontVariant),t.fontWeight&&n.push(t.fontWeight),t.fontStretch&&n.push(t.fontStretch),n.push(buildLength(t.fontSize)||`12px`),n.push(t.fontFamily||`sans-serif`),n.join(` `)}function buildLength(t){if(t!=null)return typeof t==`number`||/^-?\d+(\.\d+)?$/.test(t)?t+`px`:t}function getTextBBox(t,n){var r=getCanvasContext();if(!r)return{width:0,height:0};r.font=buildFont(n),`letterSpacing`in r&&(r.letterSpacing=buildLength(n.letterSpacing)||`0px`);var i=t===``,a=i?`dummy`:t.replace(/\s+$/,``),o=r.measureText(a);return{width:i?0:o.width,height:`fontBoundingBoxAscent`in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function layoutNext(t,n,r){for(var i=t.shift(),a=i,o;;){if(o=getTextBBox(a,r),o.width=a?o.width:0,a===` `||a===``||o.width<=n||a.length<2)return fit(t,a,i,o);a=shortenLine(a,o.width,n)}}function fit(t,n,r,i){if(n.length<r.length){var a=r.slice(n.length).trim();t.unshift(a)}return{width:i.width,height:i.height,text:n}}var Qe=``;function semanticShorten(t,n){var r=t.split(/(\s|-|\u00AD)/g),i,a=[],o=0;if(r.length>1)for(;i=r.shift();)if(i.length+o<n)a.push(i),o+=i.length;else{(i===`-`||i===Qe)&&a.pop();break}var s=a[a.length-1];return s&&s===Qe&&(a[a.length-1]=`-`),a.join(``)}function shortenLine(t,n,r){var i=Math.max(t.length*(r/n),1),a=semanticShorten(t,i);return a||=t.slice(0,Math.max(Math.round(i-1),1)),a}function Text(t){this._config=x({},{size:Xe,padding:Ye,style:{},align:`center-top`},t||{})}Text.prototype.createText=function(t,n){return this.layoutText(t,n).element},Text.prototype.getDimensions=function(t,n){return this.layoutText(t,n).dimensions},Text.prototype.layoutText=function(t,n){for(var r=x({},this._config.size,n.box),i=x({},this._config.style,n.style),a=parseAlign(n.align||this._config.align),o=parsePadding(n.padding===void 0?this._config.padding:n.padding),s=n.fitBox||!1,c=getLineHeight(i),l=t.split(/\u00AD?\r?\n/),u=[],d=r.width-o.left-o.right;l.length;)u.push(layoutNext(l,d,i));a.vertical===`middle`&&(o.top=o.bottom=0);var f=m(u,function(t,n,r){return t+(c||n.height)},0)+o.top+o.bottom,p=m(u,function(t,n,r){return n.width>t?n.width:t},0),h=o.top;a.vertical===`middle`&&(h+=(r.height-f)/2),h-=(c||u[0].height)/4;var g=create$1(`text`);return attr(g,i),S(u,function(t){var n;switch(h+=c||t.height,a.horizontal){case`left`:n=o.left;break;case`right`:n=(s?p:d)-o.right-t.width;break;default:n=Math.max(((s?p:d)-t.width)/2+o.left,0)}var r=create$1(`tspan`);attr(r,{x:n,y:h}),r.textContent=t.text,append(g,r)}),{dimensions:{width:p,height:f},element:g}};function getLineHeight(t){if(`fontSize`in t&&`lineHeight`in t)return t.lineHeight*parseInt(t.fontSize,10)}h();var $e=12,et=1.2,tt=40;function TextRenderer(t){var n=x({fontFamily:`Arial, sans-serif`,fontSize:$e,fontWeight:`normal`,lineHeight:et},t&&t.defaultStyle||{}),r=parseInt(n.fontSize,10)-1,i=x({},n,{fontSize:r},t&&t.externalStyle||{}),a=new Text({style:n});this.getExternalLabelBounds=function(t,n){var r=getTextboxDimensions(n,{width:Math.max(t.width,Y.width),height:30},{style:i});return{x:Math.round(t.x+t.width/2-r.width/2),y:t.y,width:Math.ceil(r.width),height:Math.ceil(r.height)}},this.getTextAnnotationBounds=function(t,r){var i=getTextboxDimensions(r,t,{style:n,align:`left-top`,padding:7});return{x:t.x,y:t.y,width:t.width,height:Math.max(tt,Math.round(i.height))}},this.getDimensions=function(t,n){return a.getDimensions(t,n||{})};function getTextboxDimensions(t,n,r){return a.getDimensions(t,x({box:n},r))}this.createText=function(t,n){return a.createText(t,n||{})},this.getDefaultStyle=function(){return n},this.getExternalStyle=function(){return i}}TextRenderer.$inject=[`config.textRenderer`];function PathMap(){this.pathMap={EVENT_MESSAGE:{d:`m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}`,height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:`M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z`,height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:`M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z`,height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:`M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 `,height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:`m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z`,height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:`m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z`,height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:`m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z`,height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:`m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z`,height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:`M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} `,height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:`M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} `,height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:`m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z`,height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:`m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z`,height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:`m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z`,height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:`m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z`,height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:`m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z`,height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:`m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z`,height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:`m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0`,height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:`m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10`,height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:`m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z`,height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:`m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0`,height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:`m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0`,height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:`m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0`,height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:`m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10`,height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:`m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0`,height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:`m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z`,height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:`m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902`,height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:`m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z`,height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:`m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}`,height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:`m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0`,height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:`m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5`},TASK_TYPE_USER_2:{d:`m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 `},TASK_TYPE_USER_3:{d:`m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z`},TASK_TYPE_MANUAL:{d:`m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z`},TASK_TYPE_INSTANTIATING_SEND:{d:`m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6`},TASK_TYPE_SERVICE:{d:`m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z`},TASK_TYPE_SERVICE_FILL:{d:`m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z`},TASK_TYPE_BUSINESS_RULE_HEADER:{d:`m {mx},{my} 0,4 20,0 0,-4 z`},TASK_TYPE_BUSINESS_RULE_MAIN:{d:`m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8`},MESSAGE_FLOW_MARKER:{d:`m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6`}},this.getRawPath=function getRawPath(t){return this.pathMap[t].d},this.getScaledPath=function getScaledPath(t,n){var r=this.pathMap[t],i,a;n.abspos?(i=n.abspos.x,a=n.abspos.y):(i=n.containerWidth*n.position.mx,a=n.containerHeight*n.position.my);var o={};if(n.position){for(var s=n.containerHeight/r.height*n.yScaleFactor,c=n.containerWidth/r.width*n.xScaleFactor,l=0;l<r.heightElements.length;l++)o[`y`+l]=r.heightElements[l]*s;for(var u=0;u<r.widthElements.length;u++)o[`x`+u]=r.widthElements[u]*c}return format(r.d,{mx:i,my:a,e:o})}}var nt=/\{([^{}]+)\}/g,rt=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function replacer(t,n,r){var i=r;return n.replace(rt,function(t,n,r,a,o){n||=a,i&&(n in i&&(i=i[n]),typeof i==`function`&&o&&(i=i()))}),i=(i==null||i==r?t:i)+``,i}function format(t,n){return String(t).replace(nt,function(t,r){return replacer(t,r,n)})}var it={__init__:[`bpmnRenderer`],bpmnRenderer:[`type`,BpmnRenderer],textRenderer:[`type`,TextRenderer],pathMap:[`type`,PathMap]};function translate(t,n){return n||={},t.replace(/{([^}]+)}/g,function(t,r){return n[r]||`{`+r+`}`})}var at={translate:[`value`,translate]};h();function elementData(t,n,r){return x({id:t.id,type:t.$type,businessObject:t,di:n},r)}function getWaypoints(t,n,r){var i=t.waypoint;return!i||i.length<2?[getMid(n),getMid(r)]:i.map(function(t){return{x:t.x,y:t.y}})}function notYetDrawn(t,n,r){return Error(`element ${elementToString(n)} referenced by ${elementToString(t)}#${r} not yet drawn`)}function BpmnImporter(t,n,r,i,a){this._eventBus=t,this._canvas=n,this._elementFactory=r,this._elementRegistry=i,this._textRenderer=a}BpmnImporter.$inject=[`eventBus`,`canvas`,`elementFactory`,`elementRegistry`,`textRenderer`],BpmnImporter.prototype.add=function(t,n,r){var i,a,o;if(is(n,`bpmndi:BPMNPlane`)){var s=is(t,`bpmn:SubProcess`)?{id:t.id+`_plane`}:{};i=this._elementFactory.createRoot(elementData(t,n,s)),this._canvas.addRootElement(i)}else if(is(n,`bpmndi:BPMNShape`)){var c=!isExpanded(t,n),l=isFrameElement(t);a=r&&(r.hidden||r.collapsed);var u=n.bounds;i=this._elementFactory.createShape(elementData(t,n,{collapsed:c,hidden:a,x:Math.round(u.x),y:Math.round(u.y),width:Math.round(u.width),height:Math.round(u.height),isFrame:l})),is(t,`bpmn:BoundaryEvent`)&&this._attachBoundary(t,i),is(t,`bpmn:Lane`)&&(o=0),is(t,`bpmn:DataStoreReference`)&&(isPointInsideBBox(r,getMid(u))||(r=this._canvas.findRoot(r))),this._canvas.addShape(i,r,o)}else if(is(n,`bpmndi:BPMNEdge`)){var d=this._getSource(t),f=this._getTarget(t);a=r&&(r.hidden||r.collapsed),i=this._elementFactory.createConnection(elementData(t,n,{hidden:a,source:d,target:f,waypoints:getWaypoints(n,d,f)})),is(t,`bpmn:DataAssociation`)&&(r=this._canvas.findRoot(r)),this._canvas.addConnection(i,r,o)}else throw Error(`unknown di ${elementToString(n)} for element ${elementToString(t)}`);return isLabelExternal(t)&&getLabel(i)&&this.addLabel(t,n,i),this._eventBus.fire(`bpmnElement.added`,{element:i}),i},BpmnImporter.prototype._attachBoundary=function(t,n){var r=t.attachedToRef;if(!r)throw Error(`missing ${elementToString(t)}#attachedToRef`);var i=this._elementRegistry.get(r.id),a=i&&i.attachers;if(!i)throw notYetDrawn(t,r,`attachedToRef`);n.host=i,a||(i.attachers=a=[]),a.indexOf(n)===-1&&a.push(n)},BpmnImporter.prototype.addLabel=function(t,n,r){var i=getExternalLabelBounds(n,r),a=getLabel(r),o;if(a&&n.label&&n.label.bounds&&i.width>0){var s=this._textRenderer.getDimensions(a,{box:i,style:this._textRenderer.getExternalStyle()});i=x({},i,{height:Math.ceil(s.height)})}else a&&(i=this._textRenderer.getExternalLabelBounds(i,a));return o=this._elementFactory.createLabel(elementData(t,n,{id:t.id+`_label`,labelTarget:r,type:`label`,hidden:r.hidden||!getLabel(r),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,r.parent)},BpmnImporter.prototype._getConnectedElement=function(t,n){var r,i,a=t.$type;if(i=t[n+`Ref`],n===`source`&&a===`bpmn:DataInputAssociation`&&(i&&=i[0]),(n===`source`&&a===`bpmn:DataOutputAssociation`||n===`target`&&a===`bpmn:DataInputAssociation`)&&(i=t.$parent),r=i&&this._getElement(i),r)return r;throw i?notYetDrawn(t,i,n+`Ref`):Error(`${elementToString(t)}#${n} Ref not specified`)},BpmnImporter.prototype._getSource=function(t){return this._getConnectedElement(t,`source`)},BpmnImporter.prototype._getTarget=function(t){return this._getConnectedElement(t,`target`)},BpmnImporter.prototype._getElement=function(t){return this._elementRegistry.get(t.id)};function isPointInsideBBox(t,n){var r=n.x,i=n.y;return r>=t.x&&r<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function isFrameElement(t){return is(t,`bpmn:Group`)}var ot={__depends__:[it,{__depends__:[at],bpmnImporter:[`type`,BpmnImporter]}]};function IdGenerator(t){this._counter=0,this._prefix=(t?t+`-`:``)+Math.floor(Math.random()*1e9)+`-`}IdGenerator.prototype.next=function(){return this._prefix+ ++this._counter},h();var st=new IdGenerator(`ov`),ct=500;function Overlays(t,n,r,i){this._eventBus=n,this._canvas=r,this._elementRegistry=i,this._ids=st,this._overlayDefaults=x({show:null,scale:!0},t&&t.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=createRoot(r.getContainer()),this._init()}Overlays.$inject=[`config.overlays`,`eventBus`,`canvas`,`elementRegistry`],Overlays.prototype.get=function(t){if(T(t)&&(t={id:t}),T(t.element)&&(t.element=this._elementRegistry.get(t.element)),t.element){var n=this._getOverlayContainer(t.element,!0);return n?t.type?_(n.overlays,s({type:t.type})):n.overlays.slice():[]}return t.type?_(this._overlays,s({type:t.type})):t.id?this._overlays[t.id]:null},Overlays.prototype.add=function(t,n,r){if(u(n)&&(r=n,n=null),t.id||(t=this._elementRegistry.get(t)),!r.position)throw Error(`must specifiy overlay position`);if(!r.html)throw Error(`must specifiy overlay html`);if(!t)throw Error(`invalid element specified`);var i=this._ids.next();return r=x({},this._overlayDefaults,r,{id:i,type:n,element:t,html:r.html}),this._addOverlay(r),i},Overlays.prototype.remove=function(t){var n=this.get(t)||[];p(n)||(n=[n]);var r=this;S(n,function(t){var n=r._getOverlayContainer(t.element,!0);if(t&&(remove$2(t.html),remove$2(t.htmlContainer),delete t.htmlContainer,delete t.element,delete r._overlays[t.id]),n){var i=n.overlays.indexOf(t);i!==-1&&n.overlays.splice(i,1)}})},Overlays.prototype.isShown=function(){return this._overlayRoot.style.display!==`none`},Overlays.prototype.show=function(){setVisible(this._overlayRoot)},Overlays.prototype.hide=function(){setVisible(this._overlayRoot,!1)},Overlays.prototype.clear=function(){this._overlays={},this._overlayContainers=[],clear$1(this._overlayRoot)},Overlays.prototype._updateOverlayContainer=function(t){var n=t.element,r=t.html,i=n.x,a=n.y;if(n.waypoints){var o=getBBox(n);i=o.x,a=o.y}setPosition(r,i,a),attr$1(t.html,`data-container-id`,n.id)},Overlays.prototype._updateOverlay=function(t){var n=t.position,r=t.htmlContainer,i=t.element,a=n.left,o=n.top;if(n.right!==void 0){var s=i.waypoints?getBBox(i).width:i.width;a=n.right*-1+s}if(n.bottom!==void 0){var c=i.waypoints?getBBox(i).height:i.height;o=n.bottom*-1+c}setPosition(r,a||0,o||0),this._updateOverlayVisibilty(t,this._canvas.viewbox())},Overlays.prototype._createOverlayContainer=function(t){var n=domify(`<div class="djs-overlays" />`);assign(n,{position:`absolute`}),this._overlayRoot.appendChild(n);var r={html:n,element:t,overlays:[]};return this._updateOverlayContainer(r),this._overlayContainers.push(r),r},Overlays.prototype._updateRoot=function(t){var n=t.scale||1,r=`matrix(`+[n,0,0,n,-1*t.x*n,-1*t.y*n].join(`,`)+`)`;setTransform(this._overlayRoot,r)},Overlays.prototype._getOverlayContainer=function(t,n){var r=b(this._overlayContainers,function(n){return n.element===t});return!r&&!n?this._createOverlayContainer(t):r},Overlays.prototype._addOverlay=function(t){var n=t.id,r=t.element,i=t.html,a,o;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),T(i)&&(i=domify(i)),o=this._getOverlayContainer(r),a=domify(`<div class="djs-overlay" data-overlay-id="`+n+`">`),assign(a,{position:`absolute`}),a.appendChild(i),t.type&&classes$1(a).add(`djs-overlay-`+t.type);var s=this._canvas.findRoot(r),c=this._canvas.getRootElement();setVisible(a,s===c),t.htmlContainer=a,o.overlays.push(t),o.html.appendChild(a),this._overlays[n]=t,this._updateOverlay(t),this._updateOverlayVisibilty(t,this._canvas.viewbox())},Overlays.prototype._updateOverlayVisibilty=function(t,n){var r=t.show,i=this._canvas.findRoot(t.element),a=r&&r.minZoom,o=r&&r.maxZoom,s=t.htmlContainer,c=this._canvas.getRootElement(),l=!0;i===c?r&&(f(a)&&a>n.scale||f(o)&&o<n.scale)&&(l=!1):l=!1,setVisible(s,l),this._updateOverlayScale(t,n)},Overlays.prototype._updateOverlayScale=function(t,n){var r=t.scale,i,a,o=t.htmlContainer,s,c=``;r!==!0&&(r===!1?(i=1,a=1):(i=r.min,a=r.max),f(i)&&n.scale<i&&(s=(1/n.scale||1)*i),f(a)&&n.scale>a&&(s=(1/n.scale||1)*a)),f(s)&&(c=`scale(`+s+`,`+s+`)`),setTransform(o,c)},Overlays.prototype._updateOverlaysVisibilty=function(t){var n=this;S(this._overlays,function(r){n._updateOverlayVisibilty(r,t)})},Overlays.prototype._init=function(){var t=this._eventBus,n=this;function updateViewbox(t){n._updateRoot(t),n._updateOverlaysVisibilty(t),n.show()}t.on(`canvas.viewbox.changing`,function(t){n.hide()}),t.on(`canvas.viewbox.changed`,function(t){updateViewbox(t.viewbox)}),t.on([`shape.remove`,`connection.remove`],function(t){var r=t.element,i=n.get({element:r});S(i,function(t){n.remove(t.id)});var a=n._getOverlayContainer(r);if(a){remove$2(a.html);var o=n._overlayContainers.indexOf(a);o!==-1&&n._overlayContainers.splice(o,1)}}),t.on(`element.changed`,ct,function(t){var r=t.element,i=n._getOverlayContainer(r,!0);i&&(S(i.overlays,function(t){n._updateOverlay(t)}),n._updateOverlayContainer(i))}),t.on(`element.marker.update`,function(t){var r=n._getOverlayContainer(t.element,!0);r&&classes$1(r.html)[t.add?`add`:`remove`](t.marker)}),t.on(`root.set`,function(){n._updateOverlaysVisibilty(n._canvas.viewbox())}),t.on(`diagram.clear`,this.clear,this)};function createRoot(t){var n=domify(`<div class="djs-overlay-container" />`);return assign(n,{position:`absolute`,width:0,height:0}),t.insertBefore(n,t.firstChild),n}function setPosition(t,n,r){assign(t,{left:n+`px`,top:r+`px`})}function setVisible(t,n){t.style.display=n===!1?`none`:``}function setTransform(t,n){t.style[`transform-origin`]=`top left`,[``,`-ms-`,`-webkit-`].forEach(function(r){t.style[r+`transform`]=n})}var lt={__init__:[`overlays`],overlays:[`type`,Overlays]};function ChangeSupport(t,n,r,i){t.on(`element.changed`,function(i){var a=i.element;(a.parent||a===n.getRootElement())&&(i.gfx=r.getGraphics(a)),i.gfx&&t.fire(getType(a)+`.changed`,i)}),t.on(`elements.changed`,function(n){var r=n.elements;r.forEach(function(n){t.fire(`element.changed`,{element:n})}),i.updateContainments(r)}),t.on(`shape.changed`,function(t){i.update(`shape`,t.element,t.gfx)}),t.on(`connection.changed`,function(t){i.update(`connection`,t.element,t.gfx)})}ChangeSupport.$inject=[`eventBus`,`canvas`,`elementRegistry`,`graphicsFactory`];var ut={__init__:[`changeSupport`],changeSupport:[`type`,ChangeSupport]};h();var dt=1e3;function CommandInterceptor(t){this._eventBus=t}CommandInterceptor.$inject=[`eventBus`];function unwrapEvent(t,n){return function(r){return t.call(n||null,r.context,r.command,r)}}CommandInterceptor.prototype.on=function(t,n,r,i,a,o){if((c(n)||E(n))&&(o=a,a=i,i=r,r=n,n=null),c(r)&&(o=a,a=i,i=r,r=dt),u(a)&&(o=a,a=!1),!c(i))throw Error(`handlerFn must be a function`);p(t)||(t=[t]);var s=this._eventBus;S(t,function(t){var c=[`commandStack`,t,n].filter(function(t){return t}).join(`.`);s.on(c,r,a?unwrapEvent(i,o):i,o)})},CommandInterceptor.prototype.canExecute=createHook(`canExecute`),CommandInterceptor.prototype.preExecute=createHook(`preExecute`),CommandInterceptor.prototype.preExecuted=createHook(`preExecuted`),CommandInterceptor.prototype.execute=createHook(`execute`),CommandInterceptor.prototype.executed=createHook(`executed`),CommandInterceptor.prototype.postExecute=createHook(`postExecute`),CommandInterceptor.prototype.postExecuted=createHook(`postExecuted`),CommandInterceptor.prototype.revert=createHook(`revert`),CommandInterceptor.prototype.reverted=createHook(`reverted`);function createHook(t){let hookFn=function(n,r,i,a,o){(c(n)||E(n))&&(o=a,a=i,i=r,r=n,n=null),this.on(n,t,r,i,a,o)};return hookFn}function RootElementsBehavior(t,n){n.invoke(CommandInterceptor,this),this.executed(function(n){var r=n.context;r.rootElement?t.setRootElement(r.rootElement):r.rootElement=t.getRootElement()}),this.revert(function(n){var r=n.context;r.rootElement&&t.setRootElement(r.rootElement)})}e(RootElementsBehavior,CommandInterceptor),RootElementsBehavior.$inject=[`canvas`,`injector`];var ft={__init__:[`rootElementsBehavior`],rootElementsBehavior:[`type`,RootElementsBehavior]};function escapeCSS(t){return CSS.escape(t)}var pt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function escapeHTML(t){return t=``+t,t&&t.replace(/[&<>"']/g,function(t){return pt[t]})}var mt=`_plane`;function getShapeIdFromPlane(t){var n=t.id;return removePlaneSuffix(n)}function getPlaneIdFromShape(t){var n=t.id;return is(t,`bpmn:SubProcess`)?addPlaneSuffix(n):n}function toPlaneId(t){return addPlaneSuffix(t)}function isPlane(t){return is(getDi(t),`bpmndi:BPMNPlane`)}function addPlaneSuffix(t){return t+mt}function removePlaneSuffix(t){return t.replace(RegExp(mt+`$`),``)}h();var ht=`bjs-breadcrumbs-shown`;function DrilldownBreadcrumbs(t,n,r){var i=domify(`<ul class="bjs-breadcrumbs"></ul>`),a=r.getContainer(),o=classes$1(a);a.appendChild(i);var s=[];t.on(`element.changed`,function(t){var n=t.element,r=getBusinessObject(n);b(s,function(t){return t===r})&&updateBreadcrumbs()});function updateBreadcrumbs(t){t&&(s=getBusinessObjectParentChain(t));var a=s.flatMap(function(t){var i=r.findRoot(getPlaneIdFromShape(t))||r.findRoot(t.id);if(!i&&is(t,`bpmn:Process`)){var a=n.find(function(n){var r=getBusinessObject(n);return r&&r.get(`processRef`)===t});i=a&&r.findRoot(a.id)}return i?[{parent:t,parentPlane:i}]:[]});i.innerHTML=``;var c=a.length>1;o.toggle(ht,c),a.forEach(function(t,n){var o=t.parent,s=t.parentPlane,c=escapeHTML(o.name||o.id),l=n===a.length-1,u;l?u=domify(`<li><span class="bjs-crumb" title="`+c+`">`+c+`</span></li>`):(u=domify(`<li><a class="bjs-crumb" href="`+(`#`+escapeHTML(o.id))+`" title="`+c+`">`+c+`</a></li>`),u.addEventListener(`click`,function(t){t.preventDefault(),r.setRootElement(s)})),i.appendChild(u)})}t.on(`root.set`,function(t){updateBreadcrumbs(t.element)})}DrilldownBreadcrumbs.$inject=[`eventBus`,`elementRegistry`,`canvas`];function getBusinessObjectParentChain(t){for(var n=getBusinessObject(t),r=[],i=n;i;i=i.$parent)(is(i,`bpmn:SubProcess`)||is(i,`bpmn:Process`))&&r.push(i);return r.reverse()}function DrilldownCentering(t,n){var r=null,i=new Map$1;t.on(`root.set`,function(t){var a=t.element,o=n.viewbox(),s=i.get(a);if(i.set(r,{x:o.x,y:o.y,zoom:o.scale}),r=a,is(a,`bpmn:SubProcess`)||s){s||={x:0,y:0,zoom:1};var c=(o.x-s.x)*o.scale,l=(o.y-s.y)*o.scale;(c!==0||l!==0)&&n.scroll({dx:c,dy:l}),s.zoom!==o.scale&&n.zoom(s.zoom,{x:0,y:0})}}),t.on(`diagram.clear`,function(){i.clear(),r=null})}DrilldownCentering.$inject=[`eventBus`,`canvas`];function Map$1(){this._entries=[],this.set=function(t,n){var r=!1;for(var i in this._entries)if(this._entries[i][0]===t){this._entries[i][1]=n,r=!0;break}r||this._entries.push([t,n])},this.get=function(t){for(var n in this._entries)if(this._entries[n][0]===t)return this._entries[n][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(t){var n=-1;for(var r in this._entries)if(this._entries[r][0]===t){n=r;break}n!==-1&&this._entries.splice(n,1)}}t(Map$1,`Map`);var gt={x:180,y:160};function SubprocessCompatibility(t,n){this._eventBus=t,this._moddle=n;var r=this;t.on(`import.render.start`,1500,function(t,n){r._handleImport(n.definitions)})}SubprocessCompatibility.prototype._handleImport=function(t){if(t.diagrams){var n=this;this._definitions=t,this._processToDiagramMap={},t.diagrams.forEach(function(t){t.plane&&t.plane.bpmnElement&&(n._processToDiagramMap[t.plane.bpmnElement.id]=t)}),t.diagrams.filter(t=>t.plane).flatMap(t=>n._createNewDiagrams(t.plane)).forEach(function(t){n._movePlaneElementsToOrigin(t.plane)})}},SubprocessCompatibility.prototype._createNewDiagrams=function(t){var n=this,r=[],i=[];t.get(`planeElement`).forEach(function(n){var a=n.bpmnElement;if(a){var o=a.$parent;is(a,`bpmn:SubProcess`)&&!n.isExpanded&&r.push(a),shouldMoveToPlane(a,t)&&i.push({diElement:n,parent:o})}});var a=[];return r.forEach(function(t){if(!n._processToDiagramMap[t.id]){var r=n._createDiagram(t);n._processToDiagramMap[t.id]=r,a.push(r)}}),i.forEach(function(t){for(var i=t.diElement,a=t.parent;a&&r.indexOf(a)===-1;)a=a.$parent;if(a){var o=n._processToDiagramMap[a.id];n._moveToDiPlane(i,o.plane)}}),a},SubprocessCompatibility.prototype._movePlaneElementsToOrigin=function(t){var n=t.get(`planeElement`),r=getPlaneBounds(t),i={x:r.x-gt.x,y:r.y-gt.y};n.forEach(function(t){t.waypoint?t.waypoint.forEach(function(t){t.x-=i.x,t.y-=i.y}):t.bounds&&(t.bounds.x=t.bounds.x-i.x,t.bounds.y=t.bounds.y-i.y)})},SubprocessCompatibility.prototype._moveToDiPlane=function(t,n){var r=findRootDiagram(t).plane.get(`planeElement`);r.splice(r.indexOf(t),1),n.get(`planeElement`).push(t)},SubprocessCompatibility.prototype._createDiagram=function(t){var n=this._moddle.create(`bpmndi:BPMNPlane`,{bpmnElement:t}),r=this._moddle.create(`bpmndi:BPMNDiagram`,{plane:n});return n.$parent=r,n.bpmnElement=t,r.$parent=this._definitions,this._definitions.diagrams.push(r),r},SubprocessCompatibility.$inject=[`eventBus`,`moddle`];function findRootDiagram(t){return is(t,`bpmndi:BPMNDiagram`)?t:findRootDiagram(t.$parent)}function getPlaneBounds(t){var n={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return t.planeElement.forEach(function(t){if(t.bounds){var r=asTRBL(t.bounds);n.top=Math.min(r.top,n.top),n.left=Math.min(r.left,n.left)}}),asBounds(n)}function shouldMoveToPlane(t,n){var r=t.$parent;return!(!is(r,`bpmn:SubProcess`)||r===n.bpmnElement||isAny(t,[`bpmn:DataInputAssociation`,`bpmn:DataOutputAssociation`]))}var $=250,_t=`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg>`,vt=`bjs-drilldown-empty`;function DrilldownOverlayBehavior(t,n,r,i,a){CommandInterceptor.call(this,n),this._canvas=t,this._eventBus=n,this._elementRegistry=r,this._overlays=i,this._translate=a;var o=this;this.executed(`shape.toggleCollapse`,$,function(t){var n=t.shape;o._canDrillDown(n)?o._addOverlay(n):o._removeOverlay(n)},!0),this.reverted(`shape.toggleCollapse`,$,function(t){var n=t.shape;o._canDrillDown(n)?o._addOverlay(n):o._removeOverlay(n)},!0),this.executed([`shape.create`,`shape.move`,`shape.delete`],$,function(t){var n=t.oldParent,r=t.newParent||t.parent,i=t.shape;o._canDrillDown(i)&&o._addOverlay(i),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(r),o._updateDrilldownOverlay(i)},!0),this.reverted([`shape.create`,`shape.move`,`shape.delete`],$,function(t){var n=t.oldParent,r=t.newParent||t.parent,i=t.shape;o._canDrillDown(i)&&o._addOverlay(i),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(r),o._updateDrilldownOverlay(i)},!0),n.on(`import.render.complete`,function(){r.filter(function(t){return o._canDrillDown(t)}).map(function(t){o._addOverlay(t)})})}e(DrilldownOverlayBehavior,CommandInterceptor),DrilldownOverlayBehavior.prototype._updateDrilldownOverlay=function(t){var n=this._canvas;if(t){var r=n.findRoot(t);r&&this._updateOverlayVisibility(r)}},DrilldownOverlayBehavior.prototype._canDrillDown=function(t){var n=this._canvas;return is(t,`bpmn:SubProcess`)&&n.findRoot(getPlaneIdFromShape(t))},DrilldownOverlayBehavior.prototype._updateOverlayVisibility=function(t){var n=this._overlays,r=getBusinessObject(t),i=n.get({element:r.id,type:`drilldown`})[0];if(i){var a=r&&r.get(`flowElements`)&&r.get(`flowElements`).length;classes$1(i.html).toggle(vt,!a)}},DrilldownOverlayBehavior.prototype._addOverlay=function(t){var n=this._canvas,r=this._overlays,i=getBusinessObject(t);r.get({element:t,type:`drilldown`}).length&&this._removeOverlay(t);var a=domify(`<button type="button" class="bjs-drilldown">`+_t+`</button>`),o=i.get(`name`)||i.get(`id`),s=this._translate(`Open {element}`,{element:o});a.setAttribute(`title`,s),a.addEventListener(`click`,function(){n.setRootElement(n.findRoot(getPlaneIdFromShape(t)))}),r.add(t,`drilldown`,{position:{bottom:-7,right:-8},html:a}),this._updateOverlayVisibility(t)},DrilldownOverlayBehavior.prototype._removeOverlay=function(t){this._overlays.remove({element:t,type:`drilldown`})},DrilldownOverlayBehavior.$inject=[`canvas`,`eventBus`,`elementRegistry`,`overlays`,`translate`];var yt={__depends__:[lt,ut,ft],__init__:[`drilldownBreadcrumbs`,`drilldownOverlayBehavior`,`drilldownCentering`,`subprocessCompatibility`],drilldownBreadcrumbs:[`type`,DrilldownBreadcrumbs],drilldownCentering:[`type`,DrilldownCentering],drilldownOverlayBehavior:[`type`,DrilldownOverlayBehavior],subprocessCompatibility:[`type`,SubprocessCompatibility]};function __stopPropagation(t){t&&typeof t.stopPropagation==`function`&&t.stopPropagation()}function getOriginal(t){return t.originalEvent||t.srcEvent}function stopPropagation(t){__stopPropagation(t),__stopPropagation(getOriginal(t))}function toPoint(t){return t.pointers&&t.pointers.length&&(t=t.pointers[0]),t.touches&&t.touches.length&&(t=t.touches[0]),t?{x:t.clientX,y:t.clientY}:null}function isMac(){return/mac/i.test(navigator.platform)}function isButton(t,n){return(getOriginal(t)||t).button===n}function isPrimaryButton(t){return isButton(t,0)}function isAuxiliaryButton(t){return isButton(t,1)}function hasPrimaryModifier(t){var n=getOriginal(t)||t;return isPrimaryButton(t)?isMac()?n.metaKey:n.ctrlKey:!1}function hasSecondaryModifier(t){var n=getOriginal(t)||t;return isPrimaryButton(t)&&n.shiftKey}h();function allowAll(t){return!0}function allowPrimaryAndAuxiliary(t){return isPrimaryButton(t)||isAuxiliaryButton(t)}var bt=500;function InteractionEvents(t,n,r){var i=this;function fire(r,i,a){if(!isIgnored(r,i)){var o,s,c;a?s=n.getGraphics(a):(o=i.delegateTarget||i.target,o&&(s=o,a=n.get(s))),s&&a&&(c=t.fire(r,{element:a,gfx:s,originalEvent:i}),c===!1&&(i.stopPropagation(),i.preventDefault()))}}var a={};function mouseHandler(t){return a[t]}function isIgnored(t,n){return!(s[t]||isPrimaryButton)(n)}var o={click:`element.click`,contextmenu:`element.contextmenu`,dblclick:`element.dblclick`,mousedown:`element.mousedown`,mousemove:`element.mousemove`,mouseover:`element.hover`,mouseout:`element.out`,mouseup:`element.mouseup`},s={"element.contextmenu":allowAll,"element.mousedown":allowPrimaryAndAuxiliary,"element.mouseup":allowPrimaryAndAuxiliary,"element.click":allowPrimaryAndAuxiliary,"element.dblclick":allowPrimaryAndAuxiliary};function triggerMouseEvent(t,n,r){var i=o[t];if(!i)throw Error(`unmapped DOM event name <`+t+`>`);return fire(i,n,r)}var c=`svg, .djs-element`;function registerEvent(t,n,r,i){var o=a[r]=function(t){fire(r,t)};i&&(s[r]=i),o.$delegate=N.bind(t,c,n,o)}function unregisterEvent(t,n,r){var i=mouseHandler(r);i&&N.unbind(t,n,i.$delegate)}function registerEvents(t){S(o,function(n,r){registerEvent(t,r,n)})}function unregisterEvents(t){S(o,function(n,r){unregisterEvent(t,r,n)})}t.on(`canvas.destroy`,function(t){unregisterEvents(t.svg)}),t.on(`canvas.init`,function(t){registerEvents(t.svg)}),t.on([`shape.added`,`connection.added`],function(n){var r=n.element,i=n.gfx;t.fire(`interactionEvents.createHit`,{element:r,gfx:i})}),t.on([`shape.changed`,`connection.changed`],bt,function(n){var r=n.element,i=n.gfx;t.fire(`interactionEvents.updateHit`,{element:r,gfx:i})}),t.on(`interactionEvents.createHit`,bt,function(t){var n=t.element,r=t.gfx;i.createDefaultHit(n,r)}),t.on(`interactionEvents.updateHit`,function(t){var n=t.element,r=t.gfx;i.updateDefaultHit(n,r)});var l=createHitStyle(`djs-hit djs-hit-stroke`),u=createHitStyle(`djs-hit djs-hit-click-stroke`),d={all:createHitStyle(`djs-hit djs-hit-all`),"click-stroke":u,stroke:l,"no-move":createHitStyle(`djs-hit djs-hit-no-move`)};function createHitStyle(t,n){return n=x({stroke:`white`,strokeWidth:15},n||{}),r.cls(t,[`no-fill`,`no-border`],n)}function applyStyle(t,n){var r=d[n];if(!r)throw Error(`invalid hit type <`+n+`>`);return attr(t,r),t}function appendHit(t,n){append(t,n)}this.removeHits=function(t){var n=all(`.djs-hit`,t);S(n,remove$1)},this.createDefaultHit=function(t,n){var r=t.waypoints,i=t.isFrame,a;return r?this.createWaypointsHit(n,r):(a=i?`stroke`:`all`,this.createBoxHit(n,a,{width:t.width,height:t.height}))},this.createWaypointsHit=function(t,n){var r=createLine(n);return applyStyle(r,`stroke`),appendHit(t,r),r},this.createBoxHit=function(t,n,r){r=x({x:0,y:0},r);var i=create$1(`rect`);return applyStyle(i,n),attr(i,r),appendHit(t,i),i},this.updateDefaultHit=function(t,n){var r=query(`.djs-hit`,n);if(r)return t.waypoints?updateLine(r,t.waypoints):attr(r,{width:t.width,height:t.height}),r},this.fire=fire,this.triggerMouseEvent=triggerMouseEvent,this.mouseHandler=mouseHandler,this.registerEvent=registerEvent,this.unregisterEvent=unregisterEvent}InteractionEvents.$inject=[`eventBus`,`elementRegistry`,`styles`];var xt={__init__:[`interactionEvents`],interactionEvents:[`type`,InteractionEvents]};h();function Selection(t,n){this._eventBus=t,this._canvas=n,this._selectedElements=new Set;var r=this;t.on([`shape.remove`,`connection.remove`],function(t){var n=t.element;r.deselect(n)}),t.on([`diagram.clear`,`root.set`],function(t){r.select(null)})}Selection.$inject=[`eventBus`,`canvas`],Selection.prototype.deselect=function(t){if(this._selectedElements.has(t)){var n=this.get();this._selectedElements.delete(t),this._eventBus.fire(`selection.changed`,{oldSelection:n,newSelection:this.get()})}},Selection.prototype.get=function(){return Array.from(this._selectedElements)},Selection.prototype.isSelected=function(t){return this._selectedElements.has(t)},Selection.prototype.select=function(t,n){var r=this.get();p(t)||(t=t?[t]:[]);var i=this._canvas,a=i.getRootElement();t=t.filter(function(t){return a===i.findRoot(t)}),n?S(t,t=>{this._selectedElements.add(t)}):this._selectedElements=new Set(t),this._eventBus.fire(`selection.changed`,{oldSelection:r,newSelection:this.get()})};var St=`hover`,Ct=`selected`;function SelectionVisuals(t,n){this._canvas=t;function addMarker(n,r){t.addMarker(n,r)}function removeMarker(n,r){t.removeMarker(n,r)}n.on(`element.hover`,function(t){addMarker(t.element,St)}),n.on(`element.out`,function(t){removeMarker(t.element,St)}),n.on(`selection.changed`,function(t){function deselect(t){removeMarker(t,Ct)}function select(t){addMarker(t,Ct)}var n=new Set(t.oldSelection),r=new Set(t.newSelection);for(let t of n)r.has(t)||deselect(t);for(let t of r)n.has(t)||select(t)})}SelectionVisuals.$inject=[`canvas`,`eventBus`],h();function SelectionBehavior(t,n,r,i){t.on(`create.end`,500,function(t){var r=t.context,i=r.canExecute,a=r.elements,o=(r.hints||{}).autoSelect;if(i){if(o===!1)return;p(o)?n.select(o):n.select(a.filter(isShown))}}),t.on(`connect.end`,500,function(t){var r=t.context.connection;r&&n.select(r)}),t.on(`shape.move.end`,500,function(t){var r=t.previousSelection||[],a=i.get(t.context.shape.id);b(r,function(t){return a.id===t.id})||n.select(a)}),t.on(`element.click`,function(t){if(isPrimaryButton(t)){var i=t.element;i===r.getRootElement()&&(i=null);var a=n.isSelected(i),o=n.get().length>1,s=hasSecondaryModifier(t);if(a&&o)return s?n.deselect(i):n.select(i);a?n.deselect(i):n.select(i,s)}})}SelectionBehavior.$inject=[`eventBus`,`selection`,`canvas`,`elementRegistry`];function isShown(t){return!t.hidden}var wt={__init__:[`selectionVisuals`,`selectionBehavior`],__depends__:[xt],selection:[`type`,Selection],selectionVisuals:[`type`,SelectionVisuals],selectionBehavior:[`type`,SelectionBehavior]},Tt=n({default:()=>Viewer});function Viewer(t){BaseViewer.call(this,t)}e(Viewer,BaseViewer),Viewer.prototype._modules=[ot,yt,lt,wt,at],Viewer.prototype._moddleExtensions={};export{translate$1 as $,j as $t,getExternalLabelMid as A,selfAndAllChildren as At,isEventSubProcess as B,clone as Bt,Text as C,indexOf as Ct,collectElementsAnnotations as D,getClosure as Dt,getRoundRectPath as E,getBBox as Et,setLabel as F,append as Ft,Me as G,transform$1 as Gt,isHorizontal as H,createTransform as Ht,hasCompensateEventDefinition as I,appendTo as It,is as J,attr$1 as Jt,getBusinessObject as K,all as Kt,hasErrorEventDefinition as L,attr as Lt,hasExternalLabel as M,createLine as Mt,isExternalLabel as N,updateLine as Nt,getElementAnnotations as O,getEnclosedElements as Ot,isLabelExternal as P,BaseRenderer as Pt,transform as Q,N as Qt,hasEscalationEventDefinition as R,classes as Rt,at as S,add as St,getCirclePath as T,eachElement as Tt,isInterrupting as U,innerSVG as Ut,isExpanded as V,create$1 as Vt,BaseViewer as W,remove$1 as Wt,Diagram as X,clear$1 as Xt,isAny as Y,classes$1 as Yt,rotate as Z,closest as Zt,escapeHTML as _,getMidPoint as _t,hasPrimaryModifier as a,asBounds as at,lt as b,pointsAligned as bt,isMac as c,getElementLineIntersection as ct,toPoint as d,roundBounds as dt,matches as en,getVisual as et,getPlaneIdFromShape as f,roundPoint as ft,escapeCSS as g,findPathIntersections as gt,toPlaneId as h,isRoot as ht,xt as i,e as in,Refs as it,getLabel as j,selfAndChildren as jt,Y as k,getParents as kt,getOriginal as l,getMid as lt,isPlane as m,isLabel as mt,Tt as n,remove$2 as nn,ElementFactory as nt,hasSecondaryModifier as o,asTRBL as ot,getShapeIdFromPlane as p,isConnection as pt,getDi as q,assign as qt,wt as r,domify as rn,isModelElement as rt,isPrimaryButton as s,filterRedundantWaypoints as st,Viewer as t,query as tn,EventBus as tt,stopPropagation as u,getOrientation as ut,CommandInterceptor as v,pointDistance as vt,BpmnRenderer as w,remove as wt,IdGenerator as x,pointsOnLine as xt,ut as y,pointInRect as yt,hasEventDefinition as z,clear as zt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-B8BYMn-z.js";import{i as t}from"./translator-CTBxdhz9.js";import{b as n,d as r,h as i,l as a,v as o,y as s}from"./engine-BPUfS3r2.js";var c=`{Type}_{Name}`;function pascal(e){return typeof e==`string`?e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e[0].toUpperCase()+e.slice(1)).join(``):``}function typeOf(e){return(e.$type??e.type??``).replace(/^[a-z0-9]+:/i,``)}function validId(e){let t=e.replace(/[^A-Za-z0-9_.-]/g,`_`);return/^[A-Za-z_]/.test(t)?t:`_${t}`}function idFor(e,t,n){if(!n.fromName)return null;let r=pascal(t);return r?validId((typeof n.pattern==`string`&&n.pattern?n.pattern:c).replace(`{Type}`,()=>typeOf(e)).replace(`{Name}`,()=>r)):null}var l=1e6;function uniqueId(e,t){if(!t(e))return e;for(let n=2;n<l;n+=1){let r=`${e}_${n}`;if(!t(r))return r}return`${e}_${l}`}function defaultsFor(e,t){let n=e?.defaults;if(typeof n!=`object`||!n||!Object.hasOwn(n,t))return{};let r=n[t];return typeof r==`object`&&r?r:{}}var u={task:{type:`bpmn:Task`},"user-task":{type:`bpmn:UserTask`},"service-task":{type:`bpmn:ServiceTask`},"script-task":{type:`bpmn:ScriptTask`},"send-task":{type:`bpmn:SendTask`},"receive-task":{type:`bpmn:ReceiveTask`},"business-rule-task":{type:`bpmn:BusinessRuleTask`},"manual-task":{type:`bpmn:ManualTask`},"call-activity":{type:`bpmn:CallActivity`},"sub-process":{type:`bpmn:SubProcess`},"end-event":{type:`bpmn:EndEvent`},"intermediate-catch-event":{type:`bpmn:IntermediateCatchEvent`},"intermediate-throw-event":{type:`bpmn:IntermediateThrowEvent`},"exclusive-gateway":{type:`bpmn:ExclusiveGateway`},"parallel-gateway":{type:`bpmn:ParallelGateway`},"inclusive-gateway":{type:`bpmn:InclusiveGateway`},"event-based-gateway":{type:`bpmn:EventBasedGateway`}},d={message:`bpmn:MessageEventDefinition`,timer:`bpmn:TimerEventDefinition`,signal:`bpmn:SignalEventDefinition`,error:`bpmn:ErrorEventDefinition`,escalation:`bpmn:EscalationEventDefinition`,conditional:`bpmn:ConditionalEventDefinition`,terminate:`bpmn:TerminateEventDefinition`},described=(e,t,n)=>({kind:t,description:`app.cli.edit.property.${e}`,on:n}),f=[`bpmn:Task`,`bpmn:UserTask`,`bpmn:ServiceTask`,`bpmn:ScriptTask`,`bpmn:SendTask`,`bpmn:ReceiveTask`,`bpmn:BusinessRuleTask`,`bpmn:ManualTask`,`bpmn:CallActivity`,`bpmn:SubProcess`],p=[`bpmn:ServiceTask`,`bpmn:SendTask`,`bpmn:BusinessRuleTask`,`bpmn:ScriptTask`],m={name:described(`name`,`string`),documentation:described(`documentation`,`string`)},h={...m,condition:described(`condition`,`string`,[`bpmn:SequenceFlow`]),class:described(`class`,`string`,p),delegateExpression:described(`delegateExpression`,`string`,p),expression:described(`expression`,`string`,p),resultVariable:described(`resultVariable`,`string`,p),topic:described(`topic`,`string`,p),asyncBefore:described(`asyncBefore`,`boolean`),asyncAfter:described(`asyncAfter`,`boolean`),assignee:described(`assignee`,`string`,[`bpmn:UserTask`]),candidateUsers:described(`candidateUsers`,`string`,[`bpmn:UserTask`]),candidateGroups:described(`candidateGroups`,`string`,[`bpmn:UserTask`]),formKey:described(`formKey`,`string`,[`bpmn:UserTask`,`bpmn:StartEvent`]),calledElement:described(`calledElement`,`string`,[`bpmn:CallActivity`]),decisionRef:described(`decisionRef`,`string`,[`bpmn:BusinessRuleTask`]),inputs:described(`inputs`,`mapping`,f),outputs:described(`outputs`,`mapping`,f)},g={classic:{...m,condition:described(`conditionSimple`,`string`,[`bpmn:SequenceFlow`])},"camunda-7":h,operaton:h,"cib-seven":h,"camunda-8":{...m,condition:described(`feelCondition`,`string`,[`bpmn:SequenceFlow`]),jobType:described(`jobType`,`string`,p),retries:described(`retries`,`integer`,p),assignee:described(`assignee`,`string`,[`bpmn:UserTask`]),candidateUsers:described(`candidateUsers`,`string`,[`bpmn:UserTask`]),candidateGroups:described(`candidateGroups`,`string`,[`bpmn:UserTask`]),formId:described(`formId`,`string`,[`bpmn:UserTask`]),processId:described(`processId`,`string`,[`bpmn:CallActivity`]),decisionId:described(`decisionId`,`string`,[`bpmn:BusinessRuleTask`]),inputs:described(`inputMappings`,`mapping`,f),outputs:described(`outputMappings`,`mapping`,f)}},ContractError=class extends Error{};function propertyAllowedOn(e,t,n){let r=Object.hasOwn(g[e],t)?g[e][t]:void 0;return!!r&&(!r.on||r.on.includes(n))}var _={"bpmn:EndEvent":[`message`,`signal`,`error`,`escalation`,`terminate`],"bpmn:IntermediateThrowEvent":[`message`,`signal`,`escalation`],"bpmn:IntermediateCatchEvent":[`message`,`timer`,`signal`,`conditional`]},v=[`bpmn:ReceiveTask`,`bpmn:IntermediateCatchEvent`];function checkEventDefinition(e,n){if(n&&(!(_[e]??[]).includes(n)||!Object.hasOwn(d,n)))throw new ContractError(t(`app.patch.eventNotAllowed`,{type:typeOf({type:e}),event:n}))}function checkSequenceFlow(e,n,r){if(e.id===n.id)throw new ContractError(t(`app.patch.sameElement`,{id:e.id}));if(e.type===`bpmn:EndEvent`)throw new ContractError(t(`app.cli.edit.afterEndEvent`,{id:e.id}));if(n.type===`bpmn:StartEvent`)throw new ContractError(t(`app.patch.startEventTarget`,{id:n.id}));if(n.type===`bpmn:BoundaryEvent`)throw new ContractError(t(`app.patch.boundaryTarget`,{id:n.id}));if(e.scope!==n.scope)throw new ContractError(t(`app.patch.differentScopes`,{from:e.id,to:n.id}));if(e.type===`bpmn:EventBasedGateway`&&!v.includes(n.type))throw new ContractError(t(`app.patch.eventBasedTarget`,{to:n.id}));if(r(e.id,n.id))throw new ContractError(t(`app.patch.duplicateFlow`,{from:e.id,to:n.id}))}var y=12,b=6,x=[0,1,-1,2,-2,3,-3,4,-4];function sizeOf(e){return e.endsWith(`Event`)?{width:36,height:36}:e.endsWith(`Gateway`)?{width:50,height:50}:e===`bpmn:SubProcess`?{width:350,height:200}:{width:100,height:80}}function overlaps(e,t,n=0){return e.x<t.x+t.width+n&&e.x+e.width+n>t.x&&e.y<t.y+t.height+n&&e.y+e.height+n>t.y}function labelBoxOf(e,t,n){if(!t||!/(Event|Gateway)$/.test(e))return;let r=Math.max(n.width,Math.min(t.length*7,120));return{x:Math.round(n.x+n.width/2-r/2),y:n.y+n.height+4,width:r,height:28}}function contains(e,t){return t.x>=e.x&&t.y>=e.y&&t.x+t.width<=e.x+e.width&&t.y+t.height<=e.y+e.height}function centreOf(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function placeAfter(e,t,n,r,i=50,a){let{width:o,height:s}=sizeOf(t),c=e.y+e.height/2,l=[];for(let t=0;t<b;t+=1)for(let n of x)l.push({x:Math.round(e.x+e.width+i+t*(o+i)),y:Math.round(c-s/2+n*(s+i*.6)),width:o,height:s});let clear=e=>!n.some(t=>overlaps(e,t,y)),free=e=>{let n=labelBoxOf(t,a,e);return clear(e)&&(!n||clear(n))},inside=e=>!r||contains(r,e);return l.find(e=>inside(e)&&free(e))??l.find(free)??l[0]}function routeBetween(e,t){let n=centreOf(e),r=centreOf(t);if(t.x>=e.x+e.width){let i={x:e.x+e.width,y:n.y},a={x:t.x,y:r.y};if(i.y===a.y)return[i,a];let o=Math.round((i.x+a.x)/2);return[i,{x:o,y:i.y},{x:o,y:a.y},a]}let i=Math.max(e.y+e.height,t.y+t.height)+25;return[{x:n.x,y:e.y+e.height},{x:n.x,y:i},{x:r.x,y:i},{x:r.x,y:t.y+t.height}]}var S=[`class`,`delegateExpression`,`expression`,`topic`];function setProperties(e,n,r,i){for(let e of Object.keys(i))if(!propertyAllowedOn(n,e,r.type))throw new ContractError(t(`app.cli.edit.doesNotApply`,{key:e,type:typeOf(r),id:r.id}));for(let[t,a]of Object.entries(i))setProperty(e,n,r,t,a)}function setProperty(e,t,n,i,a){let{modeling:o,moddle:s}=e;if(i===`name`)return o.updateProperties(n,{name:a});if(i===`documentation`)return o.updateProperties(n,{documentation:[s.create(`bpmn:Documentation`,{text:a})]});if(i===`condition`)return o.updateProperties(n,{conditionExpression:s.create(`bpmn:FormalExpression`,{body:a})});if(r(t))return setCamunda7(e,t,n,i,a);if(t===`camunda-8`)return setCamunda8(e,n,i,a)}function setCamunda7(e,t,n,r,i){let{modeling:o,moddle:s}=e,c=a(t);if(S.includes(r)){let e=Object.fromEntries([`class`,`delegateExpression`,`expression`,`topic`,`type`].map(e=>[`${c}:${e}`,void 0])),t=r===`topic`?{[`${c}:type`]:`external`,[`${c}:topic`]:i}:{[`${c}:${r}`]:i};return o.updateProperties(n,{...e,...t})}if(r===`inputs`||r===`outputs`){let t=extension(e,n,`${c}:InputOutput`),a=Object.entries(i).map(([e,t])=>s.create(r===`inputs`?`${c}:InputParameter`:`${c}:OutputParameter`,{name:e,value:t}));return o.updateModdleProperties(n,t,{[r===`inputs`?`inputParameters`:`outputParameters`]:a})}return o.updateProperties(n,{[`${c}:${r}`]:i})}function setCamunda8(e,t,n,r){let{modeling:i,moddle:a}=e,update=(n,r)=>{i.updateModdleProperties(t,extension(e,t,n),r)};switch(n){case`jobType`:return update(`zeebe:TaskDefinition`,{type:r});case`retries`:return update(`zeebe:TaskDefinition`,{retries:String(r)});case`assignee`:case`candidateUsers`:case`candidateGroups`:return update(`zeebe:AssignmentDefinition`,{[n]:r});case`formId`:return update(`zeebe:FormDefinition`,{formId:r});case`processId`:return update(`zeebe:CalledElement`,{processId:r});case`decisionId`:return update(`zeebe:CalledDecision`,{decisionId:r});case`inputs`:case`outputs`:{let e=Object.entries(r).map(([e,t])=>a.create(n===`inputs`?`zeebe:Input`:`zeebe:Output`,{target:e,source:t}));return update(`zeebe:IoMapping`,{[n===`inputs`?`inputParameters`:`outputParameters`]:e})}}}function extension(e,t,n){let{modeling:r,moddle:i}=e,a=t.businessObject.extensionElements;a||(a=i.create(`bpmn:ExtensionElements`,{values:[]}),r.updateProperties(t,{extensionElements:a}));let o=(a.values??[]).find(e=>e.$type===n);if(o)return o;let s=i.create(n);return s.$parent=a,r.updateModdleProperties(t,a,{values:[...a.values??[],s]}),s}function readProperties(e,t){let n={},i=e.extensionElements?.values??[],find=e=>i.find(t=>t.$type===e),put=(e,t)=>{t!=null&&t!==``&&(n[e]=t)};put(`documentation`,e.documentation?.[0]?.text),put(`condition`,e.conditionExpression?.body);let o=e.eventDefinitions?.[0]?.$type;if(o&&put(`event`,Object.entries(d).find(([,e])=>e===o)?.[0]),r(t)){let n=a(t);for(let t of Object.keys(g[`camunda-7`])){if([`inputs`,`outputs`,`name`,`documentation`,`condition`].includes(t))continue;let r=e.get(`${n}:${t}`);(typeof r!=`boolean`||Object.prototype.hasOwnProperty.call(e,t))&&put(t,r)}let r=find(`${n}:InputOutput`),map=e=>e?.length?Object.fromEntries(e.map(e=>[e.name,String(e.value??``)])):void 0;put(`inputs`,map(r?.inputParameters)),put(`outputs`,map(r?.outputParameters))}if(t===`camunda-8`){let e=find(`zeebe:TaskDefinition`);put(`jobType`,e?.type),put(`retries`,e?.retries===void 0?void 0:Number(e.retries));let t=find(`zeebe:AssignmentDefinition`);put(`assignee`,t?.assignee),put(`candidateUsers`,t?.candidateUsers),put(`candidateGroups`,t?.candidateGroups),put(`formId`,find(`zeebe:FormDefinition`)?.formId),put(`processId`,find(`zeebe:CalledElement`)?.processId),put(`decisionId`,find(`zeebe:CalledDecision`)?.decisionId);let n=find(`zeebe:IoMapping`),map=e=>e?.length?Object.fromEntries(e.map(e=>[e.target,String(e.source??``)])):void 0;put(`inputs`,map(n?.inputParameters)),put(`outputs`,map(n?.outputParameters))}return n}var C=e({applyPatch:()=>applyPatch,closureOf:()=>closureOf,dependenciesOf:()=>dependenciesOf,dependentsOf:()=>dependentsOf,inspectModel:()=>inspectModel}),w=`bpmn:SequenceFlow`;function hash(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(36).padStart(7,`0`).slice(-7)}function prefixOf(e){return e.endsWith(`Gateway`)?`Gateway`:e.endsWith(`Event`)?`Event`:`Activity`}function referencesOf(e){switch(e.op){case`add`:return[e.after];case`connect`:return[e.from,e.to];default:return[e.id]}}function dependenciesOf(e){let t=new Map;return e.map((e,n)=>{let r=new Set;for(let n of referencesOf(e)){let e=t.get(n);e!==void 0&&r.add(e)}return e.op===`add`&&e.id&&!t.has(e.id)&&t.set(e.id,n),[...r].sort((e,t)=>e-t)})}function closureOf(e,t){let n=dependenciesOf(e),r=new Set,visit=e=>{r.has(e)||(r.add(e),n[e].forEach(visit))};for(let e of t)visit(e);return[...r].sort((e,t)=>e-t)}function dependentsOf(e,t){let n=dependenciesOf(e),r=new Set(t);for(let t=0;t<e.length;t+=1)n[t].some(e=>r.has(e))&&r.add(t);return[...r].sort((e,t)=>e-t)}var Diagram=class{nodes=new Map;flows=new Map;shapes=new Map;edges=new Map;pairs=new Set;taken=new Set;plane;moddle;properties;definitions;engine;conventions;gap;constructor(e,t,n,r=50){this.definitions=e,this.engine=t,this.conventions=n,this.gap=r,this.moddle=o(e),this.plane=e.diagrams?.[0]?.plane,this.properties={moddle:this.moddle,modeling:{updateProperties:(e,t)=>{for(let[n,r]of Object.entries(t))e.businessObject.set(n,r)},updateModdleProperties:(e,t,n)=>{for(let[e,r]of Object.entries(n))t.set(e,r)}}},this.index()}index(){let claim=e=>{typeof e==`string`&&this.taken.add(e)},e=new Set,t=[this.definitions];for(;t.length>0;){let n=t.pop();if(n&&typeof n==`object`&&!e.has(n)){if(e.add(n),Array.isArray(n))t.push(...n);else{claim(n.id);for(let[e,r]of Object.entries(n))!e.startsWith(`$`)&&r&&typeof r==`object`&&t.push(r)}}}for(let e of this.definitions.rootElements??[])if(e.$type===`bpmn:Process`&&this.walk(e),e.$type===`bpmn:Collaboration`){this.nodes.set(e.id,{bo:e,kind:`root`});for(let t of e.participants??[])this.nodes.set(t.id,{bo:t,kind:`container`}),t.processRef&&this.walk(t.processRef)}for(let e of this.plane?.planeElement??[]){let t=e.bpmnElement?.id;t&&(e.$type===`bpmndi:BPMNShape`&&this.shapes.set(t,e),e.$type===`bpmndi:BPMNEdge`&&this.edges.set(t,e))}}walk(e){this.nodes.has(e.id)||this.nodes.set(e.id,{bo:e,kind:`root`});for(let t of e.laneSets?.flatMap(e=>this.lanesOf(e))??[])this.nodes.set(t.id,{bo:t,kind:`container`});for(let t of e.flowElements??[])t.$type===w?(this.flows.set(t.id,t),this.pairs.add(`${t.sourceRef?.id}>${t.targetRef?.id}`)):t.$instanceOf(`bpmn:FlowNode`)&&(this.nodes.set(t.id,{bo:t,kind:`node`}),t.$instanceOf(`bpmn:SubProcess`)&&this.walk(t))}lanesOf(e){return(e.lanes??[]).flatMap(e=>[e,...e.childLaneSet?this.lanesOf(e.childLaneSet):[]])}has(e){return this.nodes.has(e)||this.flows.has(e)}node(e){let n=this.nodes.get(e);if(!n)throw new ContractError(t(`app.cli.edit.noSuchElement`,{id:e}));return n}freshId(e,t){let n=e===w?`Flow`:prefixOf(e);for(let e=0;;e+=1){let r=`${n}_${hash(e===0?t:`${t}#${e}`)}`;if(!this.taken.has(r))return r}}boundsOf(e){let t=this.shapes.get(e)?.bounds;return t?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0}pointsOf(e){let t=this.edges.get(e)?.waypoint;return t?t.map(e=>({x:e.x,y:e.y})):void 0}snapshot(e){let t=this.flows.get(e),n=t??this.nodes.get(e)?.bo,r=n?.$parent;return{id:e,type:n?.$type??``,...n?.name?{name:n.name}:{},...this.boundsOf(e)?{bounds:this.boundsOf(e)}:{},...t?{waypoints:this.pointsOf(e),source:t.sourceRef?.id,target:t.targetRef?.id}:{},...r?.id&&r.$type!==`bpmn:Definitions`?{parent:r.id}:{},...n?.attachedToRef?.id?{attachedTo:n.attachedToRef.id}:{}}}scopeOf(e){return e.attachedToRef?e.attachedToRef.$parent:e.$parent}shape(e,t){let n=this.moddle.create(`dc:Bounds`,t),r={id:this.uniqueDi(e.id),bpmnElement:e,bounds:n};e.$type===`bpmn:ExclusiveGateway`&&(r.isMarkerVisible=!0),e.$type===`bpmn:SubProcess`&&(r.isExpanded=!0);let i=this.moddle.create(`bpmndi:BPMNShape`,r);this.plane.get(`planeElement`).push(i),i.$parent=this.plane,this.shapes.set(e.id,i)}uniqueDi(e){let t=uniqueId(`${e}_di`,e=>this.taken.has(e));return this.taken.add(t),t}edge(e,t){let n=this.moddle.create(`bpmndi:BPMNEdge`,{id:this.uniqueDi(e.id),bpmnElement:e,waypoint:t.map(e=>this.moddle.create(`dc:Point`,e))});this.plane.get(`planeElement`).push(n),n.$parent=this.plane,this.edges.set(e.id,n)}reroute(e){let t=this.flows.get(e),n=this.edges.get(e),r=this.boundsOf(t?.sourceRef?.id),i=this.boundsOf(t?.targetRef?.id);n&&r&&i&&n.set(`waypoint`,routeBetween(r,i).map(e=>this.moddle.create(`dc:Point`,e)))}unplane(e){for(let t of[this.shapes,this.edges]){let n=t.get(e);if(!n)continue;let r=this.plane.get(`planeElement`),i=r.indexOf(n);i>=0&&r.splice(i,1),t.delete(e)}}occupiedAround(e,t){let n=[];for(let[r,i]of this.nodes){if(i.kind!==`node`||t.has(r))continue;let a=this.boundsOf(r);if(!a||i.bo.$instanceOf(`bpmn:SubProcess`)&&contains(a,e))continue;n.push(a);let o=this.labelOf(r,a,i.bo);o&&n.push(o)}return n}labelOf(e,t,n){let r=this.shapes.get(e)?.label?.bounds;return r?{x:r.x,y:r.y,width:r.width,height:r.height}:labelBoxOf(n.$type,n.name,t)}withinOf(e){if(e.$instanceOf(`bpmn:SubProcess`))return this.boundsOf(e.id);for(let t of this.definitions.rootElements??[]){if(t.$type!==`bpmn:Collaboration`)continue;let n=(t.participants??[]).find(t=>t.processRef===e);if(n)return this.boundsOf(n.id)}}describe(){let e=[];for(let[t,n]of this.nodes){if(n.kind===`root`)continue;let r=this.scopeOf(n.bo)?.id;e.push({id:t,type:typeOf(n.bo),...n.bo.name?{name:n.bo.name}:{},...r?{parent:r}:{},properties:readProperties(n.bo,this.engine)})}for(let[t,n]of this.flows)e.push({id:t,type:typeOf(n),...n.name?{name:n.name}:{},source:n.sourceRef?.id,target:n.targetRef?.id,properties:readProperties(n,this.engine)});return e.sort((e,t)=>e.id<t.id?-1:+(e.id>t.id))}snapshotAll(){return{nodes:[...this.nodes].filter(([,e])=>e.kind===`node`).map(([e])=>this.snapshot(e)),flows:[...this.flows.keys()].map(e=>this.snapshot(e))}}flowTouching(e){return[...this.flows.values()].filter(t=>t.sourceRef?.id===e||t.targetRef?.id===e).map(e=>e.id)}create(e,n,r){if(this.flows.has(e.after))throw new ContractError(t(`app.cli.edit.isAConnection`,{id:e.after}));let i=this.node(e.after);if(i.kind!==`node`)throw new ContractError(t(`app.cli.edit.addAfterAnElementInside`,{id:e.after,type:typeOf(i.bo)}));if(!this.plane)throw new ContractError(t(`app.patch.noDrawing`));let a=u[e.element].type,o=this.scopeOf(i.bo);if(checkEventDefinition(a,e.event),e.id&&this.taken.has(e.id))throw new ContractError(t(`app.cli.edit.idTaken`,{id:e.id}));checkSequenceFlow({id:i.bo.id,type:i.bo.$type,scope:o},{id:e.id??``,type:a,scope:o},(e,t)=>this.pairs.has(`${e}>${t}`));let s=e.id;if(!s){let t=e.name&&this.conventions.ids?idFor({$type:a},e.name,this.conventions.ids):null;s=t?uniqueId(t,e=>this.taken.has(e)):this.freshId(a,`${n}:${a}:${e.name??``}:${e.after}`)}this.taken.add(s);let c=this.moddle.create(a,{id:s});if(c.$parent=o,e.event){let t=this.moddle.create(d[e.event]);t.$parent=c,c.get(`eventDefinitions`).push(t)}o.get(`flowElements`).push(c),this.nodes.set(s,{bo:c,kind:`node`});for(let e of[...this.nodes.values()].filter(e=>e.kind===`container`&&e.bo.$type===`bpmn:Lane`))(e.bo.flowNodeRef??[]).includes(i.bo)&&e.bo.get(`flowNodeRef`).push(c);let l=this.boundsOf(i.bo.id);if(!l)throw new ContractError(t(`app.patch.noDrawing`));let f=placeAfter(l,a,this.occupiedAround(l,new Set([s])),this.withinOf(o),this.gap,e.name);this.shape(c,f);let p=defaultsFor(this.conventions,a);Object.keys(p).length>0&&this.properties.modeling.updateProperties({businessObject:c},p),e.name&&c.set(`name`,e.name),e.properties&&setProperties(this.properties,this.engine,{id:s,type:a,businessObject:c},e.properties);let m=this.link(i.bo,c,`${n}:flow:${i.bo.id}>${s}`);r.added.push(this.snapshot(s)),r.addedFlows.push(this.snapshot(m.id)),r.touched.push(s,m.id),r.summary=t(`app.cli.edit.added`,{type:typeOf(c),id:s,after:i.bo.id})}link(e,t,n){let r=this.freshId(w,n);this.taken.add(r);let i=this.moddle.create(w,{id:r,sourceRef:e,targetRef:t}),a=this.scopeOf(e);i.$parent=a,a.get(`flowElements`).push(i),e.get(`outgoing`).push(i),t.get(`incoming`).push(i),this.flows.set(r,i),this.pairs.add(`${e.id}>${t.id}`);let o=this.boundsOf(e.id),s=this.boundsOf(t.id);return o&&s&&this.plane&&this.edge(i,routeBetween(o,s)),i}connect(e,n,r){let i=this.node(e.from),a=this.node(e.to);if(i.kind!==`node`)throw new ContractError(t(`app.patch.notAFlowNode`,{id:e.from,type:typeOf(i.bo)}));if(a.kind!==`node`)throw new ContractError(t(`app.patch.notAFlowNode`,{id:e.to,type:typeOf(a.bo)}));checkSequenceFlow({id:i.bo.id,type:i.bo.$type,scope:this.scopeOf(i.bo)},{id:a.bo.id,type:a.bo.$type,scope:this.scopeOf(a.bo)},(e,t)=>this.pairs.has(`${e}>${t}`));let o=this.link(i.bo,a.bo,`${n}:flow:${e.from}>${e.to}`);e.name&&o.set(`name`,e.name),e.condition&&setProperties(this.properties,this.engine,{id:o.id,type:w,businessObject:o},{condition:e.condition}),r.addedFlows.push(this.snapshot(o.id)),r.touched.push(o.id),r.summary=t(`app.cli.edit.connect`,{from:e.from,to:e.to,id:o.id})}set(e,n){let r=this.flows.get(e.id)??this.node(e.id).bo;setProperties(this.properties,this.engine,{id:r.id,type:r.$type,businessObject:r},e.properties),n.changed.push({id:r.id,keys:Object.keys(e.properties),bounds:this.boundsOf(r.id)}),n.touched.push(r.id),n.summary=t(`app.cli.edit.set`,{keys:Object.keys(e.properties).join(`, `),id:r.id})}remove(e,n){let r=this.flows.get(e.id);if(r){this.snapshotAndDrop([r.id],n),n.summary=t(`app.cli.edit.removed`,{id:e.id});return}let i=this.node(e.id);if(i.kind===`root`)throw new ContractError(t(`app.cli.edit.isTheRoot`,{id:e.id}));if(i.kind===`container`)throw new ContractError(t(`app.patch.cannotRemoveContainer`,{id:e.id,type:typeOf(i.bo)}));let a=new Set([e.id]),o=[i.bo];for(;o.length>0;){let e=o.pop();for(let t of this.nodes.values())t.bo.attachedToRef===e&&!a.has(t.bo.id)&&(a.add(t.bo.id),o.push(t.bo));if(e.$instanceOf(`bpmn:SubProcess`))for(let t of e.flowElements??[])t.$type!==w&&this.nodes.has(t.id)&&!a.has(t.id)&&(a.add(t.id),o.push(t))}let s=new Set;for(let e of a)for(let t of this.flowTouching(e))s.add(t);this.snapshotAndDrop([...s,...a],n),n.summary=t(`app.cli.edit.removed`,{id:e.id})}snapshotAndDrop(e,t){let n=[...new Set(e)];for(let e of n)t.removed.push(this.snapshot(e));for(let e of n){let t=this.flows.get(e);if(t){let dropFrom=(e,t)=>{let n=e?.indexOf(t)??-1;n>=0&&e.splice(n,1)};dropFrom(t.sourceRef?.outgoing,t),dropFrom(t.targetRef?.incoming,t),dropFrom(t.$parent?.flowElements,t),t.sourceRef?.default===t&&t.sourceRef.set(`default`,void 0),this.flows.delete(e),this.pairs.delete(`${t.sourceRef?.id}>${t.targetRef?.id}`),this.unplane(e);continue}let n=this.nodes.get(e);if(!n)continue;let r=n.bo.$parent?.flowElements,i=r?.indexOf(n.bo)??-1;i>=0&&r.splice(i,1);for(let e of this.nodes.values()){let t=e.bo.flowNodeRef,r=t?.indexOf(n.bo)??-1;r>=0&&t.splice(r,1)}this.nodes.delete(e),this.unplane(e)}t.touched.push(...n)}move(e,n){if(this.flows.has(e.id))throw new ContractError(t(`app.patch.isAFlow`,{id:e.id}));let r=this.node(e.id);if(r.kind!==`node`)throw new ContractError(t(`app.patch.notAFlowNode`,{id:e.id,type:typeOf(r.bo)}));if(!this.shapes.has(e.id))throw new ContractError(t(`app.patch.noDrawing`));let i=new Set([e.id]);for(let e of this.nodes.values())e.bo.attachedToRef===r.bo&&i.add(e.bo.id);if(r.bo.$instanceOf(`bpmn:SubProcess`)){let visit=e=>{for(let t of e.flowElements??[])t.$type!==w&&(i.add(t.id),t.$instanceOf(`bpmn:SubProcess`)&&visit(t))};visit(r.bo)}for(let t of i){let r=this.shapes.get(t)?.bounds;if(!r)continue;let i=this.boundsOf(t);r.set(`x`,i.x+e.dx),r.set(`y`,i.y+e.dy),n.moved.push({id:t,from:i,to:this.boundsOf(t)}),n.touched.push(t)}for(let t of this.flows.values()){let n=i.has(t.sourceRef?.id),r=i.has(t.targetRef?.id);if(n||r){if(n&&r){let n=this.edges.get(t.id);for(let t of n?.waypoint??[])t.set(`x`,t.x+e.dx),t.set(`y`,t.y+e.dy)}else this.reroute(t.id)}}n.summary=t(`app.cli.edit.moved`,{id:e.id,dx:e.dx,dy:e.dy})}};function emptyEffect(e,t){return{index:e,operation:t,summary:``,added:[],addedFlows:[],removed:[],changed:[],moved:[],touched:[]}}function run(e,n){let r=dependenciesOf(n),i=[];return n.forEach((n,a)=>{let o=emptyEffect(a,n);i.push(o);let s=r[a].find(e=>i[e].error);if(s!==void 0)o.skipped=!0,o.error=t(`app.patch.dependsOnFailed`,{number:s+1});else try{switch(n.op){case`add`:e.create(n,a,o);break;case`connect`:e.connect(n,a,o);break;case`set`:e.set(n,o);break;case`remove`:e.remove(n,o);break;case`move`:e.move(n,o)}}catch(e){if(!(e instanceof ContractError))throw e;o.error=e.message}}),i}async function applyPatch(e,t,r){if(t.operations.length===0)return{ok:!0,xml:e,steps:[]};let a=await s(e,i(r.engine));if(!a)return{ok:!1,steps:[],failedAt:-1};let o=run(new Diagram(a,r.engine,r.conventions??{},r.gap),t.operations),c=o.find(e=>e.error);return c?{ok:!1,steps:o,failedAt:c.index}:{ok:!0,xml:await n(a),steps:o}}async function inspectModel(e,t){let n=await s(e,i(t));if(!n)return null;let r=new Diagram(n,t,{});return{elements:r.describe(),...r.snapshotAll()}}export{dependentsOf as a,ContractError as c,propertyAllowedOn as d,defaultsFor as f,dependenciesOf as i,u as l,uniqueId as m,C as n,inspectModel as o,idFor as p,closureOf as r,setProperties as s,applyPatch as t,d as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";function arrayMoveMutable(e,t,n){let r=t<0?e.length+t:t;if(r>=0&&r<e.length){let r=n<0?e.length+n:n,[i]=e.splice(t,1);e.splice(r,0,i)}}export{arrayMoveMutable as t};
|