@g1cloud/bpmn-modeler-next 5.0.0-alpha.1

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.
@@ -0,0 +1 @@
1
+ (function(f,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("bpmn-moddle"),require("bpmn-i18n-moddle/resources/bpmn-i18n.json"),require("vue"),require("bpmn-js/lib/BaseModeler"),require("bpmn-js/lib/core"),require("bpmn-js/lib/features/modeling"),require("bpmn-js/lib/features/auto-place"),require("diagram-js/lib/i18n/translate"),require("bpmn-js/lib/Modeler")):typeof define=="function"&&define.amd?define(["exports","bpmn-moddle","bpmn-i18n-moddle/resources/bpmn-i18n.json","vue","bpmn-js/lib/BaseModeler","bpmn-js/lib/core","bpmn-js/lib/features/modeling","bpmn-js/lib/features/auto-place","diagram-js/lib/i18n/translate","bpmn-js/lib/Modeler"],C):(f=typeof globalThis<"u"?globalThis:f||self,C(f.BpmnModeler={},f.bpmnModdle,f.bpmnI18nSchema,f.Vue,f.BaseModeler,f.CoreModule,f.ModelingModule,f.AutoPlaceModule,f.TranslateModule,f.Modeler))})(this,(function(f,C,te,Y,Ke,ze,Qe,Ze,Je,et){"use strict";var Rt=Object.defineProperty;var Ct=(f,C,te)=>C in f?Rt(f,C,{enumerable:!0,configurable:!0,writable:!0,value:te}):f[C]=te;var ee=(f,C,te)=>Ct(f,typeof C!="symbol"?C+"":C,te);const pe=["startEvent","endEvent","userTask","serviceTask","task","sendTask","receiveTask","exclusiveGateway","parallelGateway"];function Oe(t){return pe.includes(t)}const ve="http://g1project.net/spec/bpmn/bwl/1.0",he="bwl",be=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],Me={name:"bwl-hints",uri:ve,prefix:he,xml:{tagAlias:"lowerCase"},types:[{name:"Placement",superClass:["Element"],properties:[{name:"anchor",isAttr:!0,type:"String"},{name:"side",isAttr:!0,type:"String"},{name:"offset",isAttr:!0,type:"Real"}]},{name:"Members",superClass:["Element"],properties:[{name:"refs",isAttr:!0,type:"String"}]},{name:"BandHint",extends:["bpmn:FlowNode"],properties:[{name:"band",isAttr:!0,type:"Integer"}]},{name:"PoolOrderHint",extends:["bpmn:Participant"],properties:[{name:"poolOrder",isAttr:!0,type:"Integer"}]}]},ye="bwl.undoEpisode",Pe=new WeakSet;function tt(t){Pe.has(t)||(t.register(ye,{preExecute(i){try{i.run()}catch(n){i.error=n}}}),Pe.add(t))}function Ae(t,i){tt(t);const n={run:i};if(t.execute(ye,n),n.error!==void 0)throw t.canUndo()&&t.undo(),n.error}const xe=["participant.add","participant.update","node.add","node.update","sequenceFlow.add","sequenceFlow.update","messageFlow.add","messageFlow.update","dataStore.add","dataStore.update","dataAssociation.add","association.add","annotation.add","annotation.update","group.add","group.update","element.remove"],nt={description:"생략 = 보존, null = 제거.",anyOf:[{type:"string"},{type:"null"}]},ot={type:"object",description:"레인. 배열 선언 순서 = 풀 내 상→하 순서.",properties:{id:{type:"string"},name:{type:"string"}},required:["id"],additionalProperties:!1},at={type:"object",description:"풀(participant). 레인은 여기 선언하고 노드가 lane 인자로 배정된다 — 별도 레인 op 없음.",properties:{id:{type:"string",description:"문서 내 유일, XML NCName(공백 없이 문자/밑줄로 시작)."},name:{type:"string"},blackBox:{type:"boolean",description:"true = 내부 프로세스 없는 블랙박스 풀."},lanes:{type:"array",items:{$ref:"#/$defs/irLane"}}},required:["id"],additionalProperties:!1},it={type:"object",description:"플로우 노드. 좌표는 지정하지 않는다 — 배치는 resolver 가 결정한다.",properties:{id:{type:"string"},type:{type:"string",enum:[...pe]},name:{type:"string"},participant:{type:"string",description:"소속 풀 id(협업 문서)."},lane:{type:"string",description:"소속 레인 id(풀 정의에 선언된 것)."}},required:["id","type"],additionalProperties:!1},st={type:"object",description:"분기 조건 — 게이트웨이가 아닌 플로우에 붙인다. MVP 는 label 만.",properties:{label:{type:"string"}},required:["label"],additionalProperties:!1},rt={type:"object",description:"시퀀스 플로우(같은 풀 안 노드 간).",properties:{id:{type:"string"},source:{type:"string"},target:{type:"string"},name:{type:"string"},condition:{$ref:"#/$defs/irFlowCondition"}},required:["id","source","target"],additionalProperties:!1},dt={type:"object",description:"메시지 플로우(풀 경계를 넘는 연결 — 노드 또는 블랙박스 풀 자체가 끝점).",properties:{id:{type:"string"},source:{type:"string"},target:{type:"string"},name:{type:"string"}},required:["id","source","target"],additionalProperties:!1},ct={type:"object",properties:{id:{type:"string"},name:{type:"string"}},required:["id"],additionalProperties:!1},pt={type:"object",description:"데이터 입출력 연관. 방향 = source→target(태스크→스토어 = 쓰기, 스토어→태스크 = 읽기).",properties:{id:{type:"string"},source:{type:"string"},target:{type:"string"}},required:["source","target"],additionalProperties:!1},lt={type:"object",properties:{id:{type:"string"},text:{type:"string"}},required:["id","text"],additionalProperties:!1},ft={type:"object",description:"연관선(주석 ↔ 요소).",properties:{id:{type:"string"},source:{type:"string"},target:{type:"string"}},required:["source","target"],additionalProperties:!1},ut={type:"object",description:"그룹 — members(요소 id 목록)가 bwl:members 힌트로 기록되고 바운즈는 멤버 bbox 로 산출된다.",properties:{id:{type:"string"},name:{type:"string"},members:{type:"array",items:{type:"string"}}},required:["id"],additionalProperties:!1},mt={type:"object",description:"주석 방위 힌트 — 앵커 요소 기준 상대 배치. 있으면 결정적 배치, 없으면 휴리스틱.",properties:{anchor:{type:"string",description:"기준 요소 id."},side:{type:"string",enum:[...be]},offset:{type:"number"}},required:["anchor","side"],additionalProperties:!1};function $(t,i){return{type:"object",description:i.description,properties:{kind:{const:t},...i.properties},required:["kind",...i.required??[]],additionalProperties:!1}}const gt={"participant.add":$("participant.add",{description:"풀 추가. order = 풀 세로 순서 힌트(생략 시 op 순서가 곧 배치 순서).",properties:{participant:{$ref:"#/$defs/irParticipant"},order:{type:"integer"}},required:["participant"]}),"participant.update":$("participant.update",{description:"풀 이름/레인 갱신. lanes 는 전체 재선언(생략 = 보존) — 기존 레인을 유지하려면 함께 다시 나열한다.",properties:{id:{type:"string"},name:{$ref:"#/$defs/nullableString"},lanes:{type:"array",items:{$ref:"#/$defs/irLane"}}},required:["id"]}),"node.add":$("node.add",{description:"플로우 노드 추가. band = 프로세스 내부 가로 밴드 순번 힌트(주 흐름 0, 보조 스트랜드 1…).",properties:{node:{$ref:"#/$defs/irNode"},band:{type:"integer"}},required:["node"]}),"node.update":$("node.update",{description:"노드 이름/레인/타입 갱신. lane = 레인 재배정(이동), type = 태스크·이벤트 타입 전환.",properties:{id:{type:"string"},name:{$ref:"#/$defs/nullableString"},lane:{type:"string"},type:{type:"string",enum:[...pe]}},required:["id"]}),"sequenceFlow.add":$("sequenceFlow.add",{description:"시퀀스 플로우 추가. 분기 조건은 게이트웨이가 아닌 플로우의 condition 에 싣는다.",properties:{flow:{$ref:"#/$defs/irSequenceFlow"}},required:["flow"]}),"sequenceFlow.update":$("sequenceFlow.update",{description:"시퀀스 플로우 이름/조건 갱신. condition: null = 조건 제거.",properties:{id:{type:"string"},name:{$ref:"#/$defs/nullableString"},condition:{description:"생략 = 보존, null = 제거.",anyOf:[{$ref:"#/$defs/irFlowCondition"},{type:"null"}]}},required:["id"]}),"messageFlow.add":$("messageFlow.add",{description:"메시지 플로우 추가(풀 경계를 넘는 연결).",properties:{flow:{$ref:"#/$defs/irMessageFlow"}},required:["flow"]}),"messageFlow.update":$("messageFlow.update",{description:"메시지 플로우 이름 갱신.",properties:{id:{type:"string"},name:{$ref:"#/$defs/nullableString"}},required:["id"]}),"dataStore.add":$("dataStore.add",{description:"데이터 스토어 추가(+ 입출력 연관 동반 가능).",properties:{dataStore:{$ref:"#/$defs/irDataStore"},associations:{type:"array",items:{$ref:"#/$defs/irDataAssociation"}}},required:["dataStore"]}),"dataStore.update":$("dataStore.update",{description:"데이터 스토어 이름 갱신.",properties:{id:{type:"string"},name:{$ref:"#/$defs/nullableString"}},required:["id"]}),"dataAssociation.add":$("dataAssociation.add",{description:"기존 노드 ↔ 기존 데이터 스토어의 입출력 연관 추가.",properties:{association:{$ref:"#/$defs/irDataAssociation"}},required:["association"]}),"association.add":$("association.add",{description:"주석 ↔ 요소 연관 추가(한쪽 끝은 주석). 주석 신설과 함께면 annotation.add 의 association 을 쓰고, 이 op 는 추가 연관(한 주석에 여러 연관)용.",properties:{association:{$ref:"#/$defs/irAssociation"}},required:["association"]}),"annotation.add":$("annotation.add",{description:"텍스트 주석 추가. association 으로 대상 요소와 연결하고, placement 로 방위를 지정하면 결정적 배치된다.",properties:{annotation:{$ref:"#/$defs/irTextAnnotation"},association:{$ref:"#/$defs/irAssociation"},placement:{$ref:"#/$defs/bwlPlacement"}},required:["annotation"]}),"annotation.update":$("annotation.update",{description:"주석 본문/방위 힌트 갱신. placement: null = 힌트 제거(휴리스틱 복귀). 주석 삭제는 element.remove.",properties:{id:{type:"string"},text:{type:"string"},placement:{description:"생략 = 보존, null = 힌트 제거.",anyOf:[{$ref:"#/$defs/bwlPlacement"},{type:"null"}]}},required:["id"]}),"group.add":$("group.add",{description:"그룹 추가 — 바운즈는 members 의 bbox 로 산출되므로 좌표를 지정하지 않는다.",properties:{group:{$ref:"#/$defs/irGroup"}},required:["group"]}),"group.update":$("group.update",{description:"그룹 이름/멤버 갱신. members 는 전체 재선언(생략 = 보존).",properties:{id:{type:"string"},name:{$ref:"#/$defs/nullableString"},members:{type:"array",items:{type:"string"}}},required:["id"]}),"element.remove":$("element.remove",{description:"요소 제거(카테고리 무관). 부착된 연결선은 함께 제거된다.",properties:{id:{type:"string"}},required:["id"]})},ke={anyOf:xe.map(t=>gt[t])},ht={type:"object",description:"BPMN 문서에 요소를 추가·수정·삭제할 때 호출한다. 기존 요소는 describeProcess 가 노출하는 id 로 지정하고, 신규 요소 id 는 문서 내 유일한 XML NCName(공백 없이 문자/밑줄 시작)으로 짓는다. 좌표는 지정하지 않는다 — 배치는 서버가 결정하며, 필요하면 힌트(placement/band/order)로 의도만 전달하라.",properties:{ops:{type:"array",items:{$ref:"#/$defs/symbolicOp"}}},required:["ops"],additionalProperties:!1,$defs:{irLane:ot,irParticipant:at,irNode:it,irFlowCondition:st,irSequenceFlow:rt,irMessageFlow:dt,irDataStore:ct,irDataAssociation:pt,irTextAnnotation:lt,irAssociation:ft,irGroup:ut,bwlPlacement:mt,nullableString:nt,symbolicOp:ke}},bt={"bpmn:Participant":"participant","bpmn:Lane":"lane","bpmn:SequenceFlow":"sequenceFlow","bpmn:MessageFlow":"messageFlow","bpmn:DataStoreReference":"dataStore","bpmn:DataInputAssociation":"dataAssociation","bpmn:DataOutputAssociation":"dataAssociation","bpmn:TextAnnotation":"annotation","bpmn:Association":"association","bpmn:Group":"group"};function yt(t,i){const n=bt[t];return n||(t==="label"||t.startsWith("bpmndi:")?"other":t.startsWith("bpmn:")&&!("waypoints"in i&&i.waypoints)?"flowNode":"other")}function _e(t){let i=t.parent;for(;i;){if(i.type==="bpmn:Participant")return i.id;i=i.parent}}function Ie(t){const i=()=>t.getAll().filter(n=>n.type!=="label"&&!("labelTarget"in n&&n.labelTarget));return{isCollaboration:()=>i().some(n=>n.type==="bpmn:Participant"),categoryOf:n=>{const s=t.get(n);if(!(!s||s.type==="label"))return yt(s.type,s)},lanesOf:n=>i().filter(s=>s.type==="bpmn:Lane"&&_e(s)===n).sort((s,g)=>s.y-g.y).map(s=>s.id),participantOf:n=>{const s=t.get(n);return s?_e(s):void 0}}}const wt=/^[\p{L}_][\p{L}\p{N}_.\-]*$/u,Be=new Set(["sequenceFlow","messageFlow","dataAssociation","association"]);function Fe(t,i){const n=[],s=new Map,g=new Map;function S(o,r,L){if(!wt.test(r)){n.push({kind:"id-invalid",opIndex:o,id:r});return}if(i.categoryOf(r)!==void 0||s.has(r)){n.push({kind:"id-duplicate",opIndex:o,id:r});return}s.set(r,{...L,opIndex:o})}t.forEach((o,r)=>{var L;switch(o.kind){case"participant.add":S(r,o.participant.id,{category:"participant",lanes:(o.participant.lanes??[]).map(c=>c.id)});for(const c of o.participant.lanes??[])S(r,c.id,{category:"lane"});break;case"node.add":S(r,o.node.id,{category:"flowNode",participant:o.node.participant});break;case"sequenceFlow.add":S(r,o.flow.id,{category:"sequenceFlow"});break;case"messageFlow.add":S(r,o.flow.id,{category:"messageFlow"});break;case"dataStore.add":S(r,o.dataStore.id,{category:"dataStore"});for(const c of o.associations??[])c.id&&S(r,c.id,{category:"dataAssociation"});break;case"dataAssociation.add":o.association.id&&S(r,o.association.id,{category:"dataAssociation"});break;case"association.add":o.association.id&&S(r,o.association.id,{category:"association"});break;case"annotation.add":S(r,o.annotation.id,{category:"annotation"}),(L=o.association)!=null&&L.id&&S(r,o.association.id,{category:"association"});break;case"group.add":S(r,o.group.id,{category:"group"});break;case"participant.update":if(o.lanes){g.set(o.id,o.lanes.map(c=>c.id));for(const c of o.lanes)i.categoryOf(c.id)===void 0&&S(r,c.id,{category:"lane"})}break}});const u=o=>{var r;return((r=s.get(o))==null?void 0:r.category)??i.categoryOf(o)},P=o=>{const r=s.get(o);return r?r.category==="participant"?o:r.participant:i.categoryOf(o)==="participant"?o:i.participantOf(o)};function v(o,r,L,c){const y=u(r);if(y===void 0){n.push({kind:"ref-missing",opIndex:o,ref:r,role:L});return}if(c&&!c.includes(y)){n.push({kind:"ref-category",opIndex:o,ref:r,role:L,expected:c.join("|"),actual:y});return}return y}const l=i.isCollaboration()||t.some(o=>o.kind==="participant.add");return t.forEach((o,r)=>{var L;switch(o.kind){case"participant.add":break;case"node.add":{const{participant:c,lane:y}=o.node;if(c===void 0){(l||y!==void 0)&&n.push({kind:"participant-required",opIndex:r,id:o.node.id});break}if(v(r,c,"participant",["participant"])===void 0)break;y!==void 0&&((((L=s.get(c))==null?void 0:L.lanes)??g.get(c)??i.lanesOf(c)).includes(y)||n.push({kind:"lane-unknown",opIndex:r,lane:y,participant:c}));break}case"sequenceFlow.add":{const{id:c,source:y,target:I,name:A,condition:F}=o.flow,j=v(r,y,"source",["flowNode"]),X=v(r,I,"target",["flowNode"]);j&&X&&P(y)!==P(I)&&n.push({kind:"flow-cross-pool",opIndex:r,id:c}),A!==void 0&&F!==void 0&&n.push({kind:"condition-name-conflict",opIndex:r,id:c});break}case"messageFlow.add":{const{id:c,source:y,target:I}=o.flow,A=v(r,y,"source",["flowNode","participant"]),F=v(r,I,"target",["flowNode","participant"]);if(A&&F){const j=P(y),X=P(I);j!==void 0&&j===X&&n.push({kind:"message-flow-same-pool",opIndex:r,id:c})}break}case"dataStore.add":{for(const c of o.associations??[]){if([c.source,c.target].filter(A=>A===o.dataStore.id).length!==1){n.push({kind:"data-association-ends",opIndex:r,source:c.source,target:c.target});continue}const I=c.source===o.dataStore.id?c.target:c.source;v(r,I,"dataAssociation",["flowNode"])}break}case"dataAssociation.add":{const{source:c,target:y}=o.association,I=v(r,c,"source"),A=v(r,y,"target");if(I&&A){const F=new Set([I,A]);F.has("dataStore")&&F.has("flowNode")||n.push({kind:"data-association-ends",opIndex:r,source:c,target:y})}break}case"association.add":{const{id:c,source:y,target:I}=o.association,A=v(r,y,"source"),F=v(r,I,"target");A&&F&&A!=="annotation"&&F!=="annotation"&&n.push({kind:"association-detached",opIndex:r,annotation:c??`${y}->${I}`});break}case"annotation.add":{if(o.association){const{source:c,target:y}=o.association;if(c!==o.annotation.id&&y!==o.annotation.id)n.push({kind:"association-detached",opIndex:r,annotation:o.annotation.id});else{const I=c===o.annotation.id?y:c;v(r,I,"association")}}o.placement&&v(r,o.placement.anchor,"anchor");break}case"group.add":{for(const c of o.group.members??[]){const y=v(r,c,"member");y&&Be.has(y)&&n.push({kind:"ref-category",opIndex:r,ref:c,role:"member",expected:"shape",actual:y})}break}case"participant.update":{if(E(r,o.id,"participant")===void 0)break;if(o.lanes){const c=i.lanesOf(o.id),y=o.lanes.map(A=>A.id);for(const A of c)y.includes(A)||n.push({kind:"lane-shrink-unsupported",opIndex:r,participant:o.id,lane:A});for(const A of y)i.categoryOf(A)!==void 0&&!c.includes(A)&&n.push({kind:"id-duplicate",opIndex:r,id:A});const I=y.filter(A=>c.includes(A));I.length===c.length&&I.some((A,F)=>A!==c[F])&&n.push({kind:"lane-reorder-unsupported",opIndex:r,participant:o.id})}break}case"node.update":{if(E(r,o.id,"flowNode")===void 0)break;if(o.lane!==void 0){const c=i.participantOf(o.id);(c?g.get(c)??i.lanesOf(c):[]).includes(o.lane)||n.push({kind:"lane-unknown",opIndex:r,lane:o.lane,participant:c??""})}break}case"sequenceFlow.update":{if(E(r,o.id,"sequenceFlow")===void 0)break;o.name!==void 0&&o.condition!==void 0&&n.push({kind:"condition-name-conflict",opIndex:r,id:o.id});break}case"messageFlow.update":E(r,o.id,"messageFlow");break;case"dataStore.update":E(r,o.id,"dataStore");break;case"annotation.update":{if(E(r,o.id,"annotation")===void 0)break;o.placement&&v(r,o.placement.anchor,"anchor");break}case"group.update":{if(E(r,o.id,"group")===void 0)break;for(const c of o.members??[]){const y=v(r,c,"member");y&&Be.has(y)&&n.push({kind:"ref-category",opIndex:r,ref:c,role:"member",expected:"shape",actual:y})}break}case"element.remove":{E(r,o.id)==="lane"&&n.push({kind:"ref-category",opIndex:r,ref:o.id,role:"target",expected:"removable",actual:"lane"});break}}}),n;function E(o,r,L){if(s.has(r)){n.push({kind:"target-added-in-batch",opIndex:o,id:r});return}const c=i.categoryOf(r);if(c===void 0){n.push({kind:"ref-missing",opIndex:o,ref:r,role:"target"});return}if(L&&c!==L){n.push({kind:"ref-category",opIndex:o,ref:r,role:"target",expected:L,actual:c});return}return c}}function Ne(t){return{modeling:t.get("modeling"),bpmnFactory:t.get("bpmnFactory"),elementFactory:t.get("elementFactory"),elementRegistry:t.get("elementRegistry"),canvas:t.get("canvas"),autoPlace:t.get("autoPlace"),bpmnReplace:t.get("bpmnReplace")}}function le(t){return`bpmn:${t[0].toUpperCase()}${t.slice(1)}`}const Te={"top-left":[-1,-1],top:[0,-1],"top-right":[1,-1],right:[1,0],"bottom-right":[1,1],bottom:[0,1],"bottom-left":[-1,1],left:[-1,0]};function D(t,i){return t.filter(n=>n.kind===i)}function qe(t,i){var w,K,G,N;const{modeling:n,bpmnFactory:s,elementFactory:g,elementRegistry:S,canvas:u,autoPlace:P,bpmnReplace:v}=i,l=()=>u.getRootElement(),E=e=>S.get(e),o=e=>{const a=E(e);if(!a)throw new Error(`하강 참조 해소 실패: ${e}`);return a},r=e=>{let a=e.parent;for(;a;){if(a.type==="bpmn:Participant")return a;a=a.parent}},L=D(t,"participant.add"),c=D(t,"node.add"),y=D(t,"sequenceFlow.add"),I=D(t,"messageFlow.add"),A=D(t,"dataStore.add"),F=D(t,"dataAssociation.add"),j=D(t,"annotation.add"),X=D(t,"group.add"),ue=new Map(c.map(e=>[e.node.id,e])),Q=(e,a,p)=>{var T;const h=e.businessObject,b=(((T=h.extensionElements)==null?void 0:T.values)??[]).filter(k=>k.$type!==a),O=p?[...b,s.create(a,p)]:b;if(!O.length){h.extensionElements&&n.updateProperties(e,{extensionElements:void 0});return}const B=s.create("bpmn:ExtensionElements",{values:O});O.forEach(k=>{k.$parent=B}),n.updateProperties(e,{extensionElements:B})},se=e=>({anchor:e.anchor,side:e.side,...e.offset!==void 0?{offset:e.offset}:{}});for(const e of D(t,"element.remove")){const a=E(e.id);a&&n.removeElements([a])}const oe=e=>S.filter(a=>{var p;return a.type==="bpmn:Lane"&&((p=r(a))==null?void 0:p.id)===e}).sort((a,p)=>a.y-p.y);for(const e of D(t,"participant.update")){const a=o(e.id);if(e.name!==void 0&&n.updateProperties(a,{name:e.name??void 0}),!e.lanes)continue;const p=oe(e.id);if(!p.length){e.lanes.length>=2?n.splitLane(a,e.lanes.length):n.addLane(a,"bottom"),oe(e.id).forEach((b,O)=>{const B=e.lanes[O];B&&n.updateProperties(b,{id:B.id,name:B.name})});continue}const h=new Set(p.map(b=>b.id));e.lanes.forEach((b,O)=>{if(h.has(b.id)){n.updateProperties(o(b.id),{name:b.name});return}const B=O===0?n.addLane(oe(e.id)[0],"top"):n.addLane(o(e.lanes[O-1].id),"bottom");n.updateProperties(B,{id:b.id,name:b.name})})}const re=L.map((e,a)=>({op:e,declared:a}));re.sort((e,a)=>{const p=e.op.order??Number.POSITIVE_INFINITY,h=a.op.order??Number.POSITIVE_INFINITY;return p!==h?p-h:e.declared-a.declared});let U=80;for(const e of S.getAll())e.parent===l()&&"height"in e&&typeof e.y=="number"&&(U=Math.max(U,e.y+e.height+60));for(const{op:e}of re){const a=e.participant,p=c.filter(q=>q.node.participant===a.id).length,h=((w=a.lanes)==null?void 0:w.length)??0,b=Math.max(1200,p*160+300),O=a.blackBox||p+h===0?120:Math.max(300,h*180),B=g.createShape({type:"bpmn:Participant",businessObject:s.create("bpmn:Participant",{id:a.id,name:a.name,...e.order!==void 0?{"bwl:poolOrder":e.order}:{},...a.blackBox?{}:{processRef:s.create("bpmn:Process")}}),width:b,height:O,isExpanded:!0}),T=n.createShape(B,{x:100+b/2,y:U+O/2},l()),k=a.lanes??[];k.length>=2?n.splitLane(T,k.length):k.length===1&&n.addLane(T,"bottom"),k.length&&S.filter(W=>{var x;return W.type==="bpmn:Lane"&&((x=r(W))==null?void 0:x.id)===a.id}).sort((W,x)=>W.y-x.y).forEach((W,x)=>{const R=k[x];R&&n.updateProperties(W,{id:R.id,name:R.name})}),U=T.y+T.height+60}const de=e=>{var h;const a=ue.get(e);if(a)return a.node.participant??"";const p=E(e);return p?p.type==="bpmn:Participant"?p.id:((h=r(p))==null?void 0:h.id)??"":""},Z=new Map,J=e=>{let a=Z.get(e);return a||Z.set(e,a={nodes:[],flows:[]}),a};for(const e of c)J(e.node.participant??"").nodes.push(e);for(const e of y)J(de(e.flow.source)).flows.push(e);const ce=e=>{var a;return s.create("bpmn:SequenceFlow",{id:e.id,name:e.name??((a=e.condition)==null?void 0:a.label)})},me=(e,a)=>g.createShape({type:le(e.type),businessObject:s.create(le(e.type),{id:e.id,name:e.name,...a!==void 0?{"bwl:band":a}:{}})});for(const[e,a]of Z){const p=e?o(e):void 0,h=p?p.x+150:250;let b=p?p.y+80:120;const O=x=>{const R=o(x);return R.y+R.height/2},B=(x,R)=>x.node.lane?O(x.node.lane):x.band!==void 0&&p?p.y+80+x.band*150:R,T=x=>x.participant?o(x.participant):l(),k=new Set(a.flows.map(x=>x.flow.target));for(const x of a.nodes)k.has(x.node.id)||(n.createShape(me(x.node,x.band),{x:h,y:B(x,b)},T(x.node)),!x.node.lane&&x.band===void 0&&(b+=160));const q=new Set;let W=0;for(;W++<a.nodes.length+2;){for(let ge=0;ge<a.nodes.length+a.flows.length+2;ge++){let He=!1;for(const $t of a.flows){const z=$t.flow;if(q.has(z.id))continue;const ae=E(z.source);if(!ae)continue;const Ee=E(z.target),ie=ue.get(z.target);if(!Ee&&ie){const Ue=me(ie.node,ie.band);if(ie.node.lane){const Dt=n.createShape(Ue,{x:ae.x+ae.width+130,y:O(ie.node.lane)},T(ie.node));n.connect(ae,Dt,{type:"bpmn:SequenceFlow",businessObject:ce(z)})}else P.append(ae,Ue,{connection:{type:"bpmn:SequenceFlow",businessObject:ce(z)}})}else if(Ee)n.connect(ae,Ee,{type:"bpmn:SequenceFlow",businessObject:ce(z)});else continue;q.add(z.id),He=!0}if(!He)break}const x=a.nodes.filter(ge=>!E(ge.node.id));if(!x.length)break;const R=x[0];n.createShape(me(R.node,R.band),{x:h,y:B(R,b)},T(R.node)),!R.node.lane&&R.band===void 0&&(b+=160)}}const d=(e,a)=>{const p=a.target===e,h=o(a.source),b=o(a.target),O=p?"bpmn:DataOutputAssociation":"bpmn:DataInputAssociation";n.connect(h,b,a.id?{type:O,businessObject:s.create(O,{id:a.id})}:{type:O})};for(const e of A){const a=e.associations??[],p=a.map(O=>O.source===e.dataStore.id?O.target:O.source).map(E).find(Boolean),h=p?r(p)??l():l(),b=p?{x:p.x+p.width/2,y:p.y+p.height+110}:{x:200,y:U+60};n.createShape({type:"bpmn:DataStoreReference",businessObject:s.create("bpmn:DataStoreReference",{id:e.dataStore.id,name:e.dataStore.name})},b,h);for(const O of a)d(e.dataStore.id,O)}for(const e of F){const p=o(e.association.target).type==="bpmn:DataStoreReference"?e.association.target:e.association.source;d(p,e.association)}for(const e of I){const a=e.flow;n.connect(o(a.source),o(a.target),{type:"bpmn:MessageFlow",businessObject:s.create("bpmn:MessageFlow",{id:a.id,name:a.name})})}let m=0;for(const e of X){const a=(e.group.members??[]).map(E).filter(O=>!!O),p=40;let h;if(a.length){const O=Math.min(...a.map(q=>q.x))-p,B=Math.min(...a.map(q=>q.y))-p,T=Math.max(...a.map(q=>q.x+q.width))+p,k=Math.max(...a.map(q=>q.y+q.height))+p;h={x:O,y:B,width:T-O,height:k-B}}else h={x:300+m*350,y:40,width:300,height:200},m++;const b=n.createShape({type:"bpmn:Group",businessObject:s.create("bpmn:Group",{id:e.group.id}),width:h.width,height:h.height},{x:h.x+h.width/2,y:h.y+h.height/2},l());e.group.name&&n.updateLabel(b,e.group.name),(K=e.group.members)!=null&&K.length&&Q(b,"bwl:Members",{refs:e.group.members.join(" ")})}const M=e=>{const a=e.waypoints;if(a!=null&&a.length){const h=a[Math.floor((a.length-1)/2)];return{x:h.x,y:h.y,width:0,height:0}}const p=e;return{x:p.x,y:p.y,width:p.width,height:p.height}};let _=0;const V={width:100,height:30};for(const e of j){const a=e.association,p=((G=e.placement)==null?void 0:G.anchor)??(a?a.source===e.annotation.id?a.target:a.source:void 0),h=p?E(p):void 0,b=h?M(h):void 0;let O;if(b&&e.placement){const[k,q]=Te[e.placement.side],W=e.placement.offset??50;O={x:b.x+b.width/2+k*(b.width/2+V.width/2+W),y:b.y+b.height/2+q*(b.height/2+V.height/2+W)}}else b?(O={x:b.x+b.width/2+180+_%3*260,y:b.y-110-_%2*95},_++):(O={x:300+_*260,y:60},_++);const B=h?r(h)??l():l(),T=n.createShape({type:"bpmn:TextAnnotation",businessObject:s.create("bpmn:TextAnnotation",{id:e.annotation.id,text:e.annotation.text})},O,B);if(a){const k=q=>q===e.annotation.id?T:o(q);n.connect(k(a.source),k(a.target),a.id?{type:"bpmn:Association",businessObject:s.create("bpmn:Association",{id:a.id})}:{type:"bpmn:Association"})}e.placement&&Q(T,"bwl:Placement",se(e.placement))}for(const e of D(t,"association.add")){const a=e.association;n.connect(o(a.source),o(a.target),a.id?{type:"bpmn:Association",businessObject:s.create("bpmn:Association",{id:a.id})}:{type:"bpmn:Association"})}for(const e of D(t,"node.update")){let a=o(e.id);if(e.type&&le(e.type)!==a.type&&(a=v.replaceElement(a,{type:le(e.type)})),e.name!==void 0&&n.updateProperties(a,{name:e.name??void 0}),e.lane){const p=o(e.lane),h=p.y+p.height/2-(a.y+a.height/2);h!==0&&n.moveElements([a],{x:0,y:h})}}for(const e of D(t,"sequenceFlow.update")){const a=o(e.id);e.name!==void 0&&n.updateProperties(a,{name:e.name??void 0}),e.condition!==void 0&&n.updateProperties(a,{name:((N=e.condition)==null?void 0:N.label)??void 0})}for(const e of D(t,"messageFlow.update"))e.name!==void 0&&n.updateProperties(o(e.id),{name:e.name??void 0});for(const e of D(t,"dataStore.update"))e.name!==void 0&&n.updateProperties(o(e.id),{name:e.name??void 0});for(const e of D(t,"annotation.update")){const a=o(e.id);if(e.text!==void 0&&n.updateProperties(a,{text:e.text}),e.placement===null)Q(a,"bwl:Placement",null);else if(e.placement){const p=M(o(e.placement.anchor)),[h,b]=Te[e.placement.side],O=e.placement.offset??50,B=p.x+p.width/2+h*(p.width/2+a.width/2+O),T=p.y+p.height/2+b*(p.height/2+a.height/2+O);n.moveElements([a],{x:B-(a.x+a.width/2),y:T-(a.y+a.height/2)}),Q(a,"bwl:Placement",se(e.placement))}}for(const e of D(t,"group.update")){const a=o(e.id);if(e.name!==void 0&&n.updateLabel(a,e.name??""),e.members){const p=e.members.map(E).filter(h=>!!h);if(p.length){const b=Math.min(...p.map(k=>k.x))-40,O=Math.min(...p.map(k=>k.y))-40,B=Math.max(...p.map(k=>k.x+k.width))+40,T=Math.max(...p.map(k=>k.y+k.height))+40;n.resizeShape(a,{x:b,y:O,width:B-b,height:T-O})}Q(a,"bwl:Members",{refs:e.members.join(" ")})}}}function Le(t,i,n=qe){const s=Ne(t),g=Fe(i,Ie(s.elementRegistry));if(g.length)return{ok:!1,issues:g};const S=t.get("commandStack");try{return Ae(S,()=>n(i,s)),{ok:!0,issues:[]}}catch(u){return{ok:!1,issues:[{kind:"lower-failed",message:u instanceof Error?u.message:String(u)}]}}}const St="http://www.omg.org/spec/BPMN/non-normative/extensions/i18n/1.0",$e="i18n",fe={[$e]:te,[he]:Me};function De(){return C.BpmnModdle(fe)}const Re=De();async function Ce(t){const{rootElement:i,warnings:n}=await Re.fromXML(t,"bpmn:Definitions");return{definitions:i,warnings:n}}async function Et(t){const{xml:i}=await Re.toXML(t,{format:!0});return i}function we(t){return t.map(i=>typeof i=="string"?i:i.message??String(i))}function Ot(t){const i=t.slice(t.indexOf(":")+1);return i.charAt(0).toLowerCase()+i.slice(1)}function vt(t,i){return typeof t.get=="function"?t.get(i):t[i]}function je(t,i){const n=vt(t,i);return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Xe(t,i){var s;return(((s=t.extensionElements)==null?void 0:s.values)??[]).find(g=>(g==null?void 0:g.$type)===i)}function Mt(t){return typeof t=="string"&&be.includes(t)}function H(t){if(typeof t=="string")return t;const i=t==null?void 0:t.id;return typeof i=="string"?i:void 0}function Ve(t){const i=t.rootElements??[],n=i.find(d=>d.$type==="bpmn:Collaboration"),s=new Map(i.filter(d=>d.$type==="bpmn:Process").map(d=>[d.id,d])),g=[],S=[],u=[],P=[],v=[],l=[],E={poolOrders:{},bands:{},placements:{}},o=[],r=[],L=[],c=[],y=[],I=[],A=new Set,F=new Set,j=d=>{d&&A.add(d)},X=d=>{A.add(d),F.add(d)},ue=d=>{const m=Xe(d,"bwl:Placement");if(!m)return;const M=typeof m.anchor=="string"?m.anchor:void 0;if(!M||!Mt(m.side))return;const _=typeof m.offset=="number"?m.offset:void 0;y.push({owner:d.id,anchor:M,side:m.side,..._!==void 0?{offset:_}:{}})},Q=d=>{const m=Xe(d,"bwl:Members"),M=typeof(m==null?void 0:m.refs)=="string"?m.refs.split(/\s+/).filter(Boolean):[];M.length&&I.push({owner:d.id,refs:M})},se=d=>{var m;for(const M of d)switch(j(M.id),M.$type){case"bpmn:TextAnnotation":X(M.id),P.push({id:M.id,text:typeof M.text=="string"?M.text:""}),ue(M);break;case"bpmn:Association":L.push({id:M.id,type:M.$type,source:H(M.sourceRef),target:H(M.targetRef)});break;case"bpmn:Group":{X(M.id);const _=(m=M.categoryValueRef)==null?void 0:m.value;v.push({id:M.id,...typeof _=="string"&&_?{name:_}:{}}),Q(M);break}default:l.push({id:M.id,type:M.$type,reason:"type-outside-mvp"})}},oe=(d,m)=>{const M=d.flowElements??[],_=(d.laneSets??[]).flatMap(w=>w.lanes??[]),V=new Map;for(const w of _){j(w.id);for(const K of w.flowNodeRef??[]){const G=H(K);G&&V.set(G,w.id)}}for(const w of M){if(j(w.id),w.$type==="bpmn:SequenceFlow"){o.push({id:w.id,source:H(w.sourceRef),target:H(w.targetRef),...typeof w.name=="string"&&w.name?{name:w.name}:{}});continue}if(w.$type==="bpmn:DataStoreReference"){X(w.id),u.push({id:w.id,...w.name?{name:w.name}:{}});continue}const K=Ot(w.$type);if(!Oe(K)){l.push({id:w.id,type:w.$type,reason:"type-outside-mvp"});continue}X(w.id),S.push({id:w.id,type:K,...w.name?{name:w.name}:{},...m?{participant:m}:{},...V.has(w.id)?{lane:V.get(w.id)}:{}});const G=je(w,"bwl:band");G!==void 0&&(E.bands[w.id]=G);for(const N of w.dataOutputAssociations??[])j(N.id),c.push({id:N.id,type:N.$type,source:w.id,target:H(N.targetRef)});for(const N of w.dataInputAssociations??[])j(N.id),c.push({id:N.id,type:N.$type,source:H((N.sourceRef??[])[0]),target:w.id})}se(d.artifacts??[])};if(n){const d=new Set;for(const m of n.participants??[]){X(m.id);const M=H(m.processRef);M&&d.add(M);const _=M?s.get(M):void 0,V=((_==null?void 0:_.laneSets)??[]).flatMap(N=>N.lanes??[]),w=V.map(N=>({id:N.id,...N.name?{name:N.name}:{}}));for(const N of w)X(N.id);const K=!_||(_.flowElements??[]).length===0&&V.length===0&&(_.artifacts??[]).length===0;g.push({id:m.id,...m.name?{name:m.name}:{},...K?{blackBox:!0}:{},...w.length?{lanes:w}:{}});const G=je(m,"bwl:poolOrder");G!==void 0&&(E.poolOrders[m.id]=G),_&&oe(_,m.id)}for(const m of n.messageFlows??[])j(m.id),r.push({id:m.id,source:H(m.sourceRef),target:H(m.targetRef),...typeof m.name=="string"&&m.name?{name:m.name}:{}});se(n.artifacts??[]);for(const[m,M]of s)!d.has(m)&&(M.flowElements??[]).length>0&&l.push({id:m,type:M.$type,reason:"unreachable-process"})}else for(const d of s.values())oe(d);const re=[],U=[],de=[],Z=[],J=(d,m)=>!!d&&!!m&&F.has(d)&&F.has(m);for(const d of o){if(!J(d.source,d.target)){l.push({id:d.id,type:"bpmn:SequenceFlow",reason:"endpoint-outside-mvp"});continue}re.push({id:d.id,source:d.source,target:d.target,...d.name?{name:d.name}:{}}),F.add(d.id)}for(const d of r){if(!J(d.source,d.target)){l.push({id:d.id,type:"bpmn:MessageFlow",reason:"endpoint-outside-mvp"});continue}U.push({id:d.id,source:d.source,target:d.target,...d.name?{name:d.name}:{}}),F.add(d.id)}for(const d of c){if(!J(d.source,d.target)){l.push({id:d.id??"",type:d.type,reason:"endpoint-outside-mvp"});continue}Z.push({...d.id?{id:d.id}:{},source:d.source,target:d.target}),d.id&&F.add(d.id)}for(const d of L){if(!J(d.source,d.target)){l.push({id:d.id??"",type:d.type,reason:"endpoint-outside-mvp"});continue}de.push({...d.id?{id:d.id}:{},source:d.source,target:d.target})}const ce=new Map(v.map(d=>[d.id,d]));for(const{owner:d,refs:m}of I){const M=m.filter(V=>A.has(V)),_=ce.get(d);_&&M.length&&(_.members=M)}for(const d of y)A.has(d.anchor)&&(E.placements[d.owner]={anchor:d.anchor,side:d.side,...d.offset!==void 0?{offset:d.offset}:{}});return{definition:{...g.length?{participants:g}:{},nodes:S,sequenceFlows:re,...U.length?{messageFlows:U}:{},...u.length?{dataStores:u}:{},...Z.length?{dataAssociations:Z}:{},...P.length?{annotations:P}:{},...de.length?{associations:de}:{},...v.length?{groups:v}:{}},hints:E,omitted:l}}async function Pt(t){const{definitions:i,warnings:n}=await Ce(t);return{...Ve(i),warnings:n}}function At(t,i,n,s={}){return{documentId:t,baseVersion:i,ops:[...n],origin:s.origin??"agent",clientOpId:(s.mkClientOpId??(()=>crypto.randomUUID()))()}}async function Ge(t,i,{currentVersion:n}){if(i.baseVersion!==n)return{status:"conflict",baseVersion:i.baseVersion,currentVersion:n};const s=Le(t,i.ops);if(!s.ok)return{status:"rejected",issues:s.issues};const{xml:g}=await t.saveXML({format:!0});return{status:"applied",version:n+1,xml:g??""}}const xt=Symbol("bpmn-editor");function kt(){const t=Y.ref(!1),i=Y.ref(!0),n=Y.ref(!1);let s,g;const S=()=>{t.value=!0};function u(l,E){l.get("canvas").getContainer().style.pointerEvents=E?"":"none";const o=l.get("keyboard");E?(g&&o.bind(g),g=void 0):g||(g=o.getBinding(),o.unbind())}function P(){if(!s)throw new Error("modeler not attached — 뷰 @ready 후 attach() 필요");return s}function v(){return s==null?void 0:s.get("commandStack")}return{dirty:t,editable:i,agentBusy:n,attach(l){s&&this.detach(),s=l,s.get("eventBus").on("commandStack.changed",S),i.value||u(s,!1)},detach(){s==null||s.get("eventBus").off("commandStack.changed",S),s&&!i.value&&u(s,!0),g=void 0,s=void 0},setEditable(l){i.value=l,s&&u(s,l)},async applyAgentBatch(l,E){const o=P();n.value=!0;try{const r=await Ge(o,l,{currentVersion:E});return r.status==="applied"&&(t.value=!1),r}finally{n.value=!1}},async importXml(l){const{warnings:E}=await P().importXML(l);return t.value=!1,{warnings:we(E)}},async saveXml(){const{xml:l}=await P().saveXML({format:!0});return t.value=!1,l??""},undo:()=>{var l;return(l=v())==null?void 0:l.undo()},redo:()=>{var l;return(l=v())==null?void 0:l.redo()},canUndo:()=>{var l;return((l=v())==null?void 0:l.canUndo())??!1},canRedo:()=>{var l;return((l=v())==null?void 0:l.canRedo())??!1}}}const ne={cjkEm:.865,upperEm:.68,lowerEm:.5,digitEm:.556,spaceEm:.278,otherEm:.35,ascentEm:.9,descentEm:.25},_t=/[ᄀ-ᇿ -〿぀-ヿ㐀-鿿가-힯＀-⦆]/;function It(t){const i=ne;return _t.test(t)?i.cjkEm:t===" "?i.spaceEm:t>="0"&&t<="9"?i.digitEm:t>="A"&&t<="Z"?i.upperEm:t>="a"&&t<="z"?i.lowerEm:i.otherEm}function Se(t,i){let n=0;for(const s of t)n+=i*It(s);return n}function We(t=globalThis,{textMeasurement:i="approximate"}={}){if(!(t!=null&&t.SVGElement))throw new Error("installHeadlessBpmnDom: DOM 전역이 없다 — jsdom window 를 전역에 올린 뒤 호출할 것");i==="approximate"&&Bt(t),Ft(t),Nt(t),Tt(t)}function Bt(t){var s;const i=(s=t.HTMLCanvasElement)==null?void 0:s.prototype;if(!i||i.__headlessTextMeasurement)return;i.__headlessTextMeasurement=!0;const n={font:"12px sans-serif",letterSpacing:"0px",measureText(g){var u;const S=Number.parseFloat(((u=String(n.font).match(/(\d+(?:\.\d+)?)px/))==null?void 0:u[1])??"12");return{width:Se(g,S),fontBoundingBoxAscent:S*ne.ascentEm,fontBoundingBoxDescent:S*ne.descentEm,actualBoundingBoxAscent:S*ne.ascentEm,actualBoundingBoxDescent:S*ne.descentEm}}};i.getContext=()=>n}function Ft(t){if(t.SVGMatrix)return;class i{constructor(){ee(this,"a",1);ee(this,"b",0);ee(this,"c",0);ee(this,"d",1);ee(this,"e",0);ee(this,"f",0)}static of(s,g,S,u,P,v){return Object.assign(new i,{a:s,b:g,c:S,d:u,e:P,f:v})}multiply(s){return i.of(this.a*s.a+this.c*s.b,this.b*s.a+this.d*s.b,this.a*s.c+this.c*s.d,this.b*s.c+this.d*s.d,this.a*s.e+this.c*s.f+this.e,this.b*s.e+this.d*s.f+this.f)}translate(s,g){return this.multiply(i.of(1,0,0,1,s,g))}scale(s,g=s){return this.multiply(i.of(s,0,0,g,0,0))}inverse(){const s=this.a*this.d-this.b*this.c;return i.of(this.d/s,-this.b/s,-this.c/s,this.a/s,(this.c*this.f-this.d*this.e)/s,(this.b*this.e-this.a*this.f)/s)}}t.SVGMatrix=i}function Nt(t){var S;const i=()=>{const u=new t.SVGMatrix;return{type:0,matrix:u,setTranslate(P,v){u.e=P,u.f=v},setScale(P,v){u.a=P,u.d=v},setRotate(P,v=0,l=0){const E=P*Math.PI/180,o=Math.cos(E),r=Math.sin(E);u.a=o,u.b=r,u.c=-r,u.d=o,u.e=v-o*v+r*l,u.f=l-r*v-o*l},setMatrix(P){Object.assign(u,P)}}},n=u=>{const P=i();return Object.assign(P.matrix,u),P},s=(S=t.SVGSVGElement)==null?void 0:S.prototype;s&&!s.createSVGTransform&&(s.createSVGTransform=i,s.createSVGTransformFromMatrix=n,s.createSVGMatrix=()=>new t.SVGMatrix,s.createSVGPoint=()=>({x:0,y:0,matrixTransform:()=>({x:0,y:0})}));const g=t.SVGElement.prototype;Object.getOwnPropertyDescriptor(g,"transform")||Object.defineProperty(g,"transform",{configurable:!0,get(){if(!this.__headlessTransformList){const u=[];this.__headlessTransformList={baseVal:{get numberOfItems(){return u.length},clear:()=>{u.length=0},appendItem:P=>(u.push(P),P),getItem:P=>u[P],createSVGTransformFromMatrix:n,consolidate:()=>u[u.length-1]??null}}}return this.__headlessTransformList}})}function Tt(t){const i=t.SVGElement.prototype;if(!i.getCTM){const n=()=>new t.SVGMatrix;i.getCTM=n,i.getScreenCTM=n}i.getBBox||(i.getBBox=function(){const n=String(this.textContent??"");return{x:0,y:0,width:Se(n,12),height:14}})}const Ye=[ze,Je,Qe,Ze];function qt(t={}){We(globalThis,t.dom);const i=document.createElement("div");return document.body.appendChild(i),new Ke({container:i,moddleExtensions:t.moddleExtensions??fe,additionalModules:[...Ye,...t.additionalModules??[]]})}const Lt=((t,i)=>{const n=t.__vccOpts||t;for(const[s,g]of i)n[s]=g;return n})(Y.defineComponent({__name:"BpmnModelerView",props:{xml:{}},emits:["ready","imported","import-error"],setup(t,{expose:i,emit:n}){const s=t,g=n,S=Y.ref();let u;async function P(l){if(!u)throw new Error("modeler not mounted");try{const{warnings:E}=await u.importXML(l),o=we(E);return g("imported",o),{warnings:o}}catch(E){throw g("import-error",E),E}}async function v(){if(!u)throw new Error("modeler not mounted");const{xml:l}=await u.saveXML({format:!0});return l??""}return Y.onMounted(async()=>{u=new et({container:S.value,moddleExtensions:fe}),s.xml&&await P(s.xml),g("ready")}),Y.watch(()=>s.xml,l=>{l&&u&&P(l)}),Y.onBeforeUnmount(()=>{u==null||u.destroy(),u=void 0}),i({importXml:P,saveXml:v,getModeler:()=>u}),(l,E)=>(Y.openBlock(),Y.createElementBlock("div",{ref_key:"container",ref:S,class:"bpmn-modeler-view"},null,512))}}),[["__scopeId","data-v-399ca5f0"]]);f.APPLY_BPMN_OPS_SCHEMA=ht,f.BPMN_MODDLE_EXTENSIONS=fe,f.BWL_MODDLE_SCHEMA=Me,f.BWL_NS=ve,f.BWL_PREFIX=he,f.BWL_SIDES=be,f.BpmnModelerView=Lt,f.EDITOR=xt,f.HEADLESS_BPMN_MODULES=Ye,f.HEADLESS_TEXT_METRICS=ne,f.I18N_NS=St,f.I18N_PREFIX=$e,f.MVP_FLOW_NODE_TYPES=pe,f.SYMBOLIC_OP_KINDS=xe,f.SYMBOLIC_OP_SCHEMA=ke,f.UNDO_EPISODE_COMMAND=ye,f.applyBpmnOpBatch=Ge,f.applyBpmnOps=Le,f.approximateTextWidth=Se,f.buildBpmnOpBatch=At,f.buildRegistryIndex=Ie,f.createBpmnEditorController=kt,f.createBpmnModdle=De,f.createHeadlessBpmnModeler=qt,f.describeProcess=Ve,f.describeProcessXml=Pt,f.executeAsUndoEpisode=Ae,f.installHeadlessBpmnDom=We,f.isMvpFlowNodeType=Oe,f.loadBpmnXml=Ce,f.lowerOps=qe,f.resolverServicesOf=Ne,f.saveBpmnXml=Et,f.validateOps=Fe,f.warningMessages=we,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,13 @@
1
+ /**
2
+ * bpmn-js commandStack 통합 seam.
3
+ *
4
+ * 모든 모델 변경은 bpmn-js commandStack 을 경유해야 한다 — 레거시 i18n 이
5
+ * commandStack 을 우회해 businessObject.name 을 직접 변조하다 undo 버그를 만든 것이
6
+ * 반면교사(백로그 B-4). resolver 하강도 modeling API(= commandStack 경유)만 사용한다.
7
+ */
8
+ export interface CommandSeam {
9
+ undo(): void;
10
+ redo(): void;
11
+ canUndo(): boolean;
12
+ canRedo(): boolean;
13
+ }
@@ -0,0 +1,10 @@
1
+ import { default as CommandStack } from 'diagram-js/lib/command/CommandStack';
2
+ /** 합성 커맨드 이름 — bwl 소유 네임스페이스(어휘·힌트와 같은 소유권 경계). */
3
+ export declare const UNDO_EPISODE_COMMAND = "bwl.undoEpisode";
4
+ /**
5
+ * `run` 안의 모든 모델 변경을 하나의 undo 에피소드로 실행한다.
6
+ *
7
+ * `run` 이 던지면 부분 실행분을 `undo()` 1회로 되감고 원래 예외를 다시 던진다 —
8
+ * 호출자(resolver `applyBpmnOps`)의 원자성 2차 방어가 이 경로를 쓴다.
9
+ */
10
+ export declare function executeAsUndoEpisode(commandStack: CommandStack, run: () => void): void;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * bwl 힌트 네임스페이스 (본 설계 C-1 확정, 2026-08-12).
3
+ *
4
+ * 힌트 = 선택적 장식(불변식 2) — 진실은 의미론이고 힌트는 소실 시 재생성 가능한 파생 정보.
5
+ * 없으면 휴리스틱 배치, 있으면 결정적 배치. 표준 내 extensionElements 채널로 실린다
6
+ * (4게이트 실증: spikes/bpmn-auto-layout/verify-extension.mjs).
7
+ * 어휘 진화는 additive-only(불변식 5) — URI 버전업은 호환 파괴 시에만.
8
+ */
9
+ export declare const BWL_NS = "http://g1project.net/spec/bpmn/bwl/1.0";
10
+ export declare const BWL_PREFIX = "bwl";
11
+ /** 주석 방위의 닫힌 집합 — JSON Schema enum(`agent/schema.ts`)과 단일 출처. */
12
+ export declare const BWL_SIDES: readonly ["top-left", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left"];
13
+ export type BwlSide = (typeof BWL_SIDES)[number];
14
+ /** 주석 방위 힌트 — 앵커 요소 기준 상대 배치 */
15
+ export interface BwlPlacement {
16
+ anchor: string;
17
+ side: BwlSide;
18
+ offset?: number;
19
+ }
20
+ /** 밴드 지정 힌트 — 프로세스 내부 가로 밴드(주 흐름 / 보조 스트랜드) 순번 */
21
+ export type BwlBand = number;
22
+ /** 풀 세로 순서 힌트 */
23
+ export type BwlPoolOrder = number;
24
+ /**
25
+ * bwl moddle 스키마 (세션 ②-b) — `BPMN_MODDLE_EXTENSIONS`(adapter/extensions.ts)에 등록해
26
+ * 캔버스·헤드리스 양 경로의 파싱 의미를 일치시킨다(M1-2 원칙). 어휘는 additive-only(불변식 5).
27
+ *
28
+ * 표현 형태(스파이크 verify-extension 4게이트 실증 형태 유지):
29
+ * - 구조 힌트 = extensionElements 자식: `<bwl:placement anchor=".." side=".." offset=".."/>`,
30
+ * `<bwl:members refs="Id_a Id_b"/>` (공백 구분 id 목록)
31
+ * - 스칼라 힌트 = 요소 속성(`extends` 확장): `bwl:band`(플로우 노드), `bwl:poolOrder`(참여자)
32
+ * 미등록 도구 왕복 보존은 두 형태 모두 스파이크 게이트 ①에서 실증됨.
33
+ */
34
+ export declare const BWL_MODDLE_SCHEMA: {
35
+ readonly name: "bwl-hints";
36
+ readonly uri: "http://g1project.net/spec/bpmn/bwl/1.0";
37
+ readonly prefix: "bwl";
38
+ readonly xml: {
39
+ readonly tagAlias: "lowerCase";
40
+ };
41
+ readonly types: readonly [{
42
+ readonly name: "Placement";
43
+ readonly superClass: readonly ["Element"];
44
+ readonly properties: readonly [{
45
+ readonly name: "anchor";
46
+ readonly isAttr: true;
47
+ readonly type: "String";
48
+ }, {
49
+ readonly name: "side";
50
+ readonly isAttr: true;
51
+ readonly type: "String";
52
+ }, {
53
+ readonly name: "offset";
54
+ readonly isAttr: true;
55
+ readonly type: "Real";
56
+ }];
57
+ }, {
58
+ readonly name: "Members";
59
+ readonly superClass: readonly ["Element"];
60
+ readonly properties: readonly [{
61
+ readonly name: "refs";
62
+ readonly isAttr: true;
63
+ readonly type: "String";
64
+ }];
65
+ }, {
66
+ readonly name: "BandHint";
67
+ readonly extends: readonly ["bpmn:FlowNode"];
68
+ readonly properties: readonly [{
69
+ readonly name: "band";
70
+ readonly isAttr: true;
71
+ readonly type: "Integer";
72
+ }];
73
+ }, {
74
+ readonly name: "PoolOrderHint";
75
+ readonly extends: readonly ["bpmn:Participant"];
76
+ readonly properties: readonly [{
77
+ readonly name: "poolOrder";
78
+ readonly isAttr: true;
79
+ readonly type: "Integer";
80
+ }];
81
+ }];
82
+ };
@@ -0,0 +1,98 @@
1
+ /**
2
+ * 에이전트 대면 IR 어휘 (본 설계 A-1 확정, 2026-08-12).
3
+ *
4
+ * IR은 영속되지 않는다(A-2) — read 는 describeProcess 가 XML에서 파생 생성하고,
5
+ * write 는 op 페이로드가 이 어휘를 사용한다. 진실은 항상 표준 BPMN 2.0 XML(불변식 1).
6
+ * 타입은 표준 BPMN 1:1 — AI 전용 타입 신설 금지(불변식 4).
7
+ */
8
+ /**
9
+ * MVP 플로우 노드 타입 — 실운영 문서 실측 분포 기준(CLAUDE.md §A-1).
10
+ * boundaryEvent · subProcess · intermediate 이벤트는 실파일 0건으로 후순위 강등
11
+ * (스파이크 04·05 배치 실증이 있어 수요 발생 시 저비용 승격).
12
+ */
13
+ export declare const MVP_FLOW_NODE_TYPES: readonly ["startEvent", "endEvent", "userTask", "serviceTask", "task", "sendTask", "receiveTask", "exclusiveGateway", "parallelGateway"];
14
+ export type IrFlowNodeType = (typeof MVP_FLOW_NODE_TYPES)[number];
15
+ export declare function isMvpFlowNodeType(type: string): type is IrFlowNodeType;
16
+ export interface IrLane {
17
+ id: string;
18
+ name?: string;
19
+ }
20
+ /**
21
+ * 풀(participant). 레인은 풀 정의에 선언하고 노드가 `lane` 인자로 배정된다(A-3) —
22
+ * 별도 레인 op 없음, laneSet/flowNodeRef 하강은 resolver 책임.
23
+ */
24
+ export interface IrParticipant {
25
+ id: string;
26
+ name?: string;
27
+ /** true 면 내부 프로세스 없는 블랙박스 풀 */
28
+ blackBox?: boolean;
29
+ lanes?: IrLane[];
30
+ }
31
+ export interface IrNode {
32
+ id: string;
33
+ type: IrFlowNodeType;
34
+ name?: string;
35
+ /** 소속 풀 (협업 문서) */
36
+ participant?: string;
37
+ /** 소속 레인 (A-3) */
38
+ lane?: string;
39
+ }
40
+ /**
41
+ * 조건은 게이트웨이가 아닌 플로우에 붙인다.
42
+ * MVP 는 label 만 — expression/language 는 실행 엔진 도입 시 추가 필드로 확장(A-5, 스키마 파괴 없음).
43
+ */
44
+ export interface IrFlowCondition {
45
+ label: string;
46
+ }
47
+ export interface IrSequenceFlow {
48
+ id: string;
49
+ source: string;
50
+ target: string;
51
+ name?: string;
52
+ condition?: IrFlowCondition;
53
+ }
54
+ export interface IrMessageFlow {
55
+ id: string;
56
+ source: string;
57
+ target: string;
58
+ name?: string;
59
+ }
60
+ export interface IrDataStore {
61
+ id: string;
62
+ name?: string;
63
+ }
64
+ /** 데이터 입출력 연관 (노드 ↔ 데이터 스토어, 방향 = source→target) */
65
+ export interface IrDataAssociation {
66
+ /** 실파일의 dataInput/OutputAssociation 도 id 를 가진다 — element.remove 지정·describeProcess read 대칭용 */
67
+ id?: string;
68
+ source: string;
69
+ target: string;
70
+ }
71
+ export interface IrTextAnnotation {
72
+ id: string;
73
+ text: string;
74
+ }
75
+ /** 연관선 (주석 ↔ 요소) */
76
+ export interface IrAssociation {
77
+ id?: string;
78
+ source: string;
79
+ target: string;
80
+ }
81
+ /** 그룹 — BPMN 의미론엔 멤버십이 없어 bwl:members 힌트로 보충한다(A-4) */
82
+ export interface IrGroup {
83
+ id: string;
84
+ name?: string;
85
+ members?: string[];
86
+ }
87
+ /** describeProcess 가 반환하는 문서 전체 파생 뷰의 골격 */
88
+ export interface IrDefinition {
89
+ participants?: IrParticipant[];
90
+ nodes: IrNode[];
91
+ sequenceFlows: IrSequenceFlow[];
92
+ messageFlows?: IrMessageFlow[];
93
+ dataStores?: IrDataStore[];
94
+ dataAssociations?: IrDataAssociation[];
95
+ annotations?: IrTextAnnotation[];
96
+ associations?: IrAssociation[];
97
+ groups?: IrGroup[];
98
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 하강·직렬화가 실제로 요구하는 **최소 modeler 표면** (M4 진입, B-5 판정 반영).
3
+ *
4
+ * 캔버스 경로는 `bpmn-js/lib/Modeler`, 헤드리스 경로는 `BaseModeler` + 모델링 모듈 트림 셋이라
5
+ * 두 클래스가 상속으로 만나지 않는다(후자는 전자의 상위가 아니라 형제 조립이다). 하강은 DI
6
+ * 컨테이너(`get`)와 직렬화(`saveXML`)만 쓰므로, 구조 타입으로 받아 **한 구현이 두 경로를
7
+ * 커버**한다 — 경로별 분기 구현은 의미론이 갈라질 위험이 있어 두지 않는다.
8
+ */
9
+ /** 하강이 대면하는 표면 — diagram-js DI 컨테이너 조회만. */
10
+ export interface BpmnModelerLike {
11
+ get<T>(name: string): T;
12
+ }
13
+ /** 하강 + 저장까지 대면하는 표면 — 배치 wire(`applyBpmnOpBatch`)가 요구한다. */
14
+ export interface BpmnDocumentModelerLike extends BpmnModelerLike {
15
+ saveXML(options?: {
16
+ format?: boolean;
17
+ }): Promise<{
18
+ xml?: string;
19
+ }>;
20
+ }
@@ -0,0 +1,42 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { default as Modeler } from 'bpmn-js/lib/Modeler';
3
+ import { CommandSeam } from '../command/commandSeam';
4
+ import { ApplyBatchOutcome, BpmnOpBatch } from '../agent/agentBatch';
5
+ export interface ImportXmlResult {
6
+ /** import 경고(표시용 메시지) — 수용 기준상 실운영 문서는 빈 배열이어야 한다. */
7
+ warnings: string[];
8
+ }
9
+ /**
10
+ * 에디터 컨트롤러 (M1-3, M3-2 에이전트 통합) — load/save/dirty + command seam + 배치 적용.
11
+ *
12
+ * 뷰가 bpmn-js Modeler 를 소유하고(마운트 수명), 컨트롤러는 `attach()` 로 연결받아
13
+ * 문서 수명(load/save/dirty)을 관리한다. 모든 모델 변경은 commandStack 을 경유하므로
14
+ * dirty 추적은 `commandStack.changed` 구독으로 충분하다 (`CommandSeam` 주석 참조).
15
+ *
16
+ * **M3-2 에이전트 턴 통합** — 시블링 포크 A·B 대칭:
17
+ * - 적용은 단일 undo 에피소드(`agent/agentBatch` → `command/undoEpisode`)
18
+ * - 턴 중 사용자 편집 잠금은 `setEditable(false)` — 잠금은 **사용자 입력 경로만** 막고
19
+ * 프로그램 경로(modeling API)는 막지 않는다. 그래서 잠긴 상태에서도 배치 적용이 된다
20
+ * (에이전트가 쓰는 동안 사용자를 막는 것이 목적이므로 우회 장치가 따로 필요 없다).
21
+ */
22
+ export interface BpmnEditorController extends CommandSeam {
23
+ /** 뷰 마운트 완료(@ready) 후 호출 — dirty 추적 구독의 수명 시작점. */
24
+ attach(modeler: Modeler): void;
25
+ detach(): void;
26
+ importXml(xml: string): Promise<ImportXmlResult>;
27
+ saveXml(): Promise<string>;
28
+ /** 마지막 importXml/saveXml 이후 모델 변경 여부. saveXml 은 영속 진실로 내보낸 시점이므로 리셋한다. */
29
+ readonly dirty: Readonly<Ref<boolean>>;
30
+ /**
31
+ * 에이전트 배치 적용 — 단일 undo 에피소드. `applied` 의 `xml` 이 호스트 영속 페이로드다
32
+ * (내부적으로 `saveXml()` 경로를 타므로 dirty 도 리셋된다 = "영속 진실로 내보낸 시점").
33
+ */
34
+ applyAgentBatch(batch: BpmnOpBatch, currentVersion: number): Promise<ApplyBatchOutcome>;
35
+ /** 사용자 입력 잠금 — 에이전트 턴 시작/종료에서 호출. 프로그램 경로는 영향 없음. */
36
+ setEditable(editable: boolean): void;
37
+ readonly editable: Readonly<Ref<boolean>>;
38
+ /** 배치 적용이 진행 중인 구간 — 호스트 UI 의 "AI 반영 중" 표시용. */
39
+ readonly agentBusy: Readonly<Ref<boolean>>;
40
+ }
41
+ export declare const EDITOR: InjectionKey<BpmnEditorController>;
42
+ export declare function createBpmnEditorController(): BpmnEditorController;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * ── 헤드리스 DOM 심(shim) (B-5 판정, 2026-08-15) ──
3
+ *
4
+ * 호스트 서버(Node + jsdom)에서 bpmn-js 하강을 돌리기 위한 최소 보정. jsdom 이 구현하지 않는
5
+ * 표면 중 **모델링 코어가 실제로 밟는 것만** 채운다(에디터 UI 크롬은 모듈 셋에서 빠져 있어
6
+ * 대상이 아니다 — `createHeadlessBpmnModeler` 참조).
7
+ *
8
+ * 실측으로 확인된 갭 3종:
9
+ * ① **canvas `measureText`** — 라벨 측정의 실경로다(`diagram-js/lib/util/Text.js`). jsdom 은
10
+ * canvas 미구현이라 컨텍스트가 null 이 되고, 그러면 `getTextBBox` 가 width 0 을 돌려주어
11
+ * `layoutNext` 의 줄바꿈 루프가 **끝나지 않는다**(실측: 워커 OOM). 즉 이 심은 품질 보정이
12
+ * 아니라 **성립 조건**이다.
13
+ * ② SVG transform 계열(`createSVGTransform`·`transform.baseVal`·`SVGMatrix`) — 도형 배치가 요구.
14
+ * ③ `getCTM`/`getScreenCTM`·`getBBox` — 좌표 변환 조회. 헤드리스에선 뷰포트가 없으므로 항등.
15
+ *
16
+ * ⚠ **근사의 대가는 `BPMNLabel` DI 뿐이다.** chromium 대조 실측에서 도형·풀·레인·그룹 바운즈는
17
+ * 전부 0 오차였고, 외부 라벨 바운즈만 ±2px 어긋난다(`fontMetricParity.browser.test.ts` 가 그
18
+ * 허용치를 고정한다). 계수를 낮춰 폭을 과소평가하면 줄바꿈 오판으로 라벨 높이가 배가 되므로
19
+ * (실측: 2글자 라벨이 2줄 판정) 계수 변경은 대조 테스트를 반드시 통과시켜야 한다.
20
+ */
21
+ /**
22
+ * 문자 클래스별 폭 계수(em) — chromium 12px Arial 실측 대조로 고정.
23
+ *
24
+ * 라틴을 한 계수로 뭉치면 오차가 크다(실측: 대문자만 있는 'PG' 는 30% 과소, 공백 많은 문장은
25
+ * 8% 과대). 클래스를 나누면 표본 전부 8% 안으로 들어온다 — `fontMetricParity.browser.test.ts`
26
+ * 가 그 허용치를 지킨다.
27
+ */
28
+ export declare const HEADLESS_TEXT_METRICS: {
29
+ /** 전각(한글·한자·가나). */
30
+ readonly cjkEm: 0.865;
31
+ /** 라틴 대문자 평균. */
32
+ readonly upperEm: 0.68;
33
+ /** 라틴 소문자 평균. */
34
+ readonly lowerEm: 0.5;
35
+ readonly digitEm: 0.556;
36
+ readonly spaceEm: 0.278;
37
+ /** 그 외(구두점 등). */
38
+ readonly otherEm: 0.35;
39
+ /** 행 높이 산출용 — `fontBoundingBox{Ascent,Descent}` 근사. */
40
+ readonly ascentEm: 0.9;
41
+ readonly descentEm: 0.25;
42
+ };
43
+ /** 폰트 크기(px)에서 텍스트 폭을 근사한다 — 심의 `measureText` 와 대조 테스트가 공유하는 단일 출처. */
44
+ export declare function approximateTextWidth(text: string, fontSizePx: number): number;
45
+ /**
46
+ * jsdom 전역에 헤드리스 하강용 심을 설치한다(멱등 — 재호출·이미 있는 네이티브 구현은 건드리지 않는다).
47
+ *
48
+ * 호출 시점은 **modeler 생성 전**이며, 대상 스코프는 jsdom `window` 를 전역에 올린 realm 이다
49
+ * (호스트가 `global-jsdom` 류로 준비).
50
+ *
51
+ * ⚠ **Node/jsdom 전용이다.** SVG 계열 심은 네이티브가 있으면 스스로 비켜서지만, 텍스트 측정만은
52
+ * 자동 감지를 두지 않아(아래 `HeadlessDomOptions`) 기본값이 canvas 컨텍스트를 **덮는다**. 실브라우저
53
+ * 경로(`BpmnModelerView`)는 이 함수를 호출하지 않으며, 부득이 호출한다면 `textMeasurement: 'native'`.
54
+ */
55
+ export declare function installHeadlessBpmnDom(scope?: any, { textMeasurement }?: HeadlessDomOptions): void;
56
+ export interface HeadlessDomOptions {
57
+ /**
58
+ * 텍스트 측정 소스.
59
+ * - `approximate`(기본) — 문자 클래스 계수로 근사. 네이티브 의존성 0, 라벨 DI 오차 ±2px.
60
+ * - `native` — 호스트가 `canvas` 패키지 등으로 **실제 2D 컨텍스트를 이미 제공**하는 경우.
61
+ * 심을 얹지 않아 실측 폰트 메트릭이 쓰인다(오차 0). 컨텍스트가 없는데 이걸 고르면 라벨
62
+ * 줄바꿈 루프가 끝나지 않으므로(dom.ts 헤더 ①) 반드시 실제 지원을 확인하고 쓸 것.
63
+ *
64
+ * ⚠ 자동 감지를 두지 않은 이유: jsdom 은 미지원 `getContext` 호출을 **예외가 아니라 콘솔
65
+ * 오류로** 흘리므로, 감지 프로브가 호스트 로그를 매 기동 오염시킨다. 선택을 명시로 남긴다.
66
+ */
67
+ textMeasurement?: 'approximate' | 'native';
68
+ }
@@ -0,0 +1,2 @@
1
+ export { createHeadlessBpmnModeler, HEADLESS_BPMN_MODULES, type HeadlessBpmnModelerOptions } from './modeler';
2
+ export { installHeadlessBpmnDom, approximateTextWidth, HEADLESS_TEXT_METRICS, type HeadlessDomOptions, } from './dom';
@@ -0,0 +1,25 @@
1
+ import { default as BaseModeler } from 'bpmn-js/lib/BaseModeler';
2
+ import { ModdleExtensions, ModuleDeclaration } from 'bpmn-js/lib/BaseViewer';
3
+ import { default as CoreModule } from 'bpmn-js/lib/core';
4
+ import { default as ModelingModule } from 'bpmn-js/lib/features/modeling';
5
+ import { default as AutoPlaceModule } from 'bpmn-js/lib/features/auto-place';
6
+ import { HeadlessDomOptions } from './dom';
7
+ /** 헤드리스 하강에 필요한 최소 모듈 셋 — 이 목록이 곧 "에디터 없이 성립하는 표면"의 정의다. */
8
+ export declare const HEADLESS_BPMN_MODULES: readonly [typeof CoreModule, {
9
+ translate: (string | typeof import('diagram-js/lib/i18n/translate/translate').default)[];
10
+ }, typeof ModelingModule, typeof AutoPlaceModule];
11
+ export interface HeadlessBpmnModelerOptions {
12
+ /** 추가 모듈(호스트 확장). 기본 셋을 대체하지 않고 덧붙인다. */
13
+ additionalModules?: ModuleDeclaration[];
14
+ /** moddle 확장 맵 — 기본은 캔버스 경로와 같은 `BPMN_MODDLE_EXTENSIONS`(i18n·bwl 등록 포함). */
15
+ moddleExtensions?: ModdleExtensions;
16
+ /** DOM 심 옵션 — 텍스트 측정 소스 선택(`dom.ts` 참조). */
17
+ dom?: HeadlessDomOptions;
18
+ }
19
+ /**
20
+ * 헤드리스 modeler 를 만든다. 호출 전 jsdom `window` 가 전역에 올라와 있어야 한다.
21
+ *
22
+ * 반환 인스턴스는 `applyBpmnOps`/`applyBpmnOpBatch` 가 받는 구조 타입(`BpmnDocumentModelerLike`)을
23
+ * 만족하며, `importXML`/`saveXML` 은 캔버스 경로와 동일 API 다.
24
+ */
25
+ export declare function createHeadlessBpmnModeler(options?: HeadlessBpmnModelerOptions): BaseModeler;
@@ -0,0 +1,16 @@
1
+ export * from './core/ir';
2
+ export * from './core/modelerLike';
3
+ export * from './core/hints';
4
+ export * from './command/commandSeam';
5
+ export * from './command/undoEpisode';
6
+ export * from './agent/symbolicOp';
7
+ export * from './agent/schema';
8
+ export * from './agent/resolver';
9
+ export * from './agent/describeProcess';
10
+ export * from './agent/agentBatch';
11
+ export * from './editor/controller';
12
+ export * from './adapter/i18n';
13
+ export * from './adapter/extensions';
14
+ export * from './adapter/xml';
15
+ export * from './headless';
16
+ export { default as BpmnModelerView } from './view/BpmnModelerView.vue';
@@ -0,0 +1,22 @@
1
+ import { default as Modeler } from 'bpmn-js/lib/Modeler';
2
+ type __VLS_Props = {
3
+ xml?: string;
4
+ };
5
+ declare function importXml(xml: string): Promise<{
6
+ warnings: string[];
7
+ }>;
8
+ declare function saveXml(): Promise<string>;
9
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
10
+ importXml: typeof importXml;
11
+ saveXml: typeof saveXml;
12
+ getModeler: () => Modeler<null> | undefined;
13
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
14
+ ready: () => any;
15
+ imported: (warnings: string[]) => any;
16
+ "import-error": (err: unknown) => any;
17
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ onReady?: (() => any) | undefined;
19
+ onImported?: ((warnings: string[]) => any) | undefined;
20
+ "onImport-error"?: ((err: unknown) => any) | undefined;
21
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
22
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@g1cloud/bpmn-modeler-next",
3
+ "private": false,
4
+ "version": "5.0.0-alpha.1",
5
+ "description": "Vue 3 BPMN document authoring editor (bpmn-js based) with AI agent authoring",
6
+ "type": "module",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "engines": {
11
+ "node": ">= 24.10.0"
12
+ },
13
+ "main": "./dist/bpmn-modeler.umd.cjs",
14
+ "module": "./dist/bpmn-modeler.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/bpmn-modeler.js",
20
+ "require": "./dist/bpmn-modeler.umd.cjs"
21
+ },
22
+ "./style.css": "./dist/bpmn-modeler-next.css"
23
+ },
24
+ "author": "l.kei@g1project.net",
25
+ "license": "LicenseRef-LICENSE",
26
+ "peerDependencies": {
27
+ "vue": "^3.5.0"
28
+ },
29
+ "dependencies": {
30
+ "bpmn-auto-layout": "^1.3.0",
31
+ "bpmn-i18n-moddle": "^0.2.0",
32
+ "bpmn-js": "^18.23.0",
33
+ "bpmn-moddle": "^10.1.0",
34
+ "diagram-js": "^15.23.2"
35
+ },
36
+ "devDependencies": {
37
+ "@types/node": "^25.9.2",
38
+ "@vitejs/plugin-vue": "^5.2.0",
39
+ "@vitest/browser": "4.1.10",
40
+ "@vitest/browser-playwright": "4.1.10",
41
+ "jsdom": "^25.0.0",
42
+ "playwright": "1.62.1",
43
+ "typescript": "^5.6.0",
44
+ "vite": "^6.0.0",
45
+ "vite-plugin-dts": "^5.0.3",
46
+ "vitest": "^4.1.10",
47
+ "vue": "^3.5.0",
48
+ "vue-tsc": "^2.1.0"
49
+ },
50
+ "scripts": {
51
+ "dev": "vite",
52
+ "build": "vue-tsc --noEmit && vite build",
53
+ "preview": "vite preview",
54
+ "test": "vitest run",
55
+ "test:watch": "vitest",
56
+ "typecheck": "vue-tsc --noEmit",
57
+ "check": "pnpm run test && pnpm run build"
58
+ }
59
+ }