@leadal/flowstream-ui-plus 0.0.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,17 @@
1
+ (function(he,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],l):(he=typeof globalThis<"u"?globalThis:he||self,l(he.FlowstreamUIPlus={},he.Vue,he.ElementPlus))})(this,(function(he,l,ht){"use strict";/*! Element Plus Icons Vue v2.3.2 */var Rs=l.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}}),Ts=Rs,Ps=l.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),Ns=Ps,Os=l.defineComponent({name:"Back",__name:"back",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64"}),l.createElementVNode("path",{fill:"currentColor",d:"m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312z"})]))}}),Oi=Os,Ds=l.defineComponent({name:"Check",__name:"check",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}}),Ms=Ds,Bs=l.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),l.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Is=Bs,Ls=l.defineComponent({name:"Delete",__name:"delete",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),Fs=Ls,Vs=l.defineComponent({name:"Document",__name:"document",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),$s=Vs,js=l.defineComponent({name:"Promotion",__name:"promotion",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"m64 448 832-320-128 704-446.08-243.328L832 192 242.816 545.472zm256 512V657.024L512 768z"})]))}}),Us=js,zs=l.defineComponent({name:"RefreshLeft",__name:"refresh-left",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"})]))}}),Di=zs,Hs=l.defineComponent({name:"RefreshRight",__name:"refresh-right",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88"})]))}}),Mi=Hs,Ws=l.defineComponent({name:"Switch",__name:"switch",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M118.656 438.656a32 32 0 0 1 0-45.248L416 96l4.48-3.776A32 32 0 0 1 461.248 96l3.712 4.48a32.064 32.064 0 0 1-3.712 40.832L218.56 384H928a32 32 0 1 1 0 64H141.248a32 32 0 0 1-22.592-9.344M64 608a32 32 0 0 1 32-32h786.752a32 32 0 0 1 22.656 54.592L608 928l-4.48 3.776a32.064 32.064 0 0 1-40.832-49.024L805.632 640H96a32 32 0 0 1-32-32"})]))}}),Bi=Ws,qs=l.defineComponent({name:"VideoPause",__name:"video-pause",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-96-544q32 0 32 32v256q0 32-32 32t-32-32V384q0-32 32-32m192 0q32 0 32 32v256q0 32-32 32t-32-32V384q0-32 32-32"})]))}}),Ys=qs,Ks=l.defineComponent({name:"VideoPlay",__name:"video-play",setup(e){return(t,n)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-48-247.616L668.608 512 464 375.616zm10.624-342.656 249.472 166.336a48 48 0 0 1 0 79.872L474.624 718.272A48 48 0 0 1 400 678.336V345.6a48 48 0 0 1 74.624-39.936z"})]))}}),Ii=Ks;const Gs={key:1,"aria-hidden":"true"},Xs=["href"],Js=l.defineComponent({name:"SvgIcon",inheritAttrs:!1,__name:"SvgIcon",props:{iconClass:{},className:{}},setup(e){const t=e,n={back:Oi,delete:Fs,save:$s,enable:Ii,start:Ii,hang:Ys,restore:Mi,revocation:Di,taskWithdraw:Di,taskRecyle:Mi,terminate:Is,jump:Bi,taskJump:Bi,taskComplete:Ms,taskSend:Us,taskRollback:Oi},r=l.computed(()=>n[t.iconClass]);return(i,o)=>(l.openBlock(),l.createElementBlock("span",l.mergeProps({class:"workflow-svg-icon"},i.$attrs),[r.value?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.value),{key:0})):(l.openBlock(),l.createElementBlock("svg",Gs,[l.createElementVNode("use",{href:`#icon-${e.iconClass}`},null,8,Xs)]))],16))}}),_t=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Zs=_t(Js,[["__scopeId","data-v-366205a3"]]),Qs={class:"ui-flow-btn"},Li=_t(l.defineComponent({name:"UiFlowButton",__name:"FlowButton",props:{type:{},label:{}},emits:["click"],setup(e,{emit:t}){const n=e,r=t,i=[{label:"保存",value:"save",icon:"save"},{label:"启动",value:"start",icon:"enable"},{label:"撤回",value:"revocation",icon:"taskWithdraw"},{label:"撤回",value:"taskWithdraw",icon:"taskWithdraw"},{label:"收回",value:"taskRecyle",icon:"taskRecyle"},{label:"挂起",value:"hang",icon:"hang"},{label:"恢复",value:"restore",icon:"restore"},{label:"终止",value:"terminate",icon:"terminate"},{label:"跳转",value:"jump",icon:"jump"},{label:"跳转",value:"taskJump",icon:"jump"},{label:"办毕",value:"taskComplete",icon:"taskComplete"},{label:"发送",value:"taskSend",icon:"taskSend"},{label:"退回",value:"taskRollback",icon:"taskRollback"}],o=l.computed(()=>i.find(s=>s.value===n.type));function a(){var s;r("click",(s=o.value)==null?void 0:s.value)}return(s,f)=>{const p=l.resolveComponent("el-button");return l.openBlock(),l.createElementBlock("span",Qs,[o.value?(l.openBlock(),l.createBlock(p,{key:0,link:"",type:"primary",onClick:a},{default:l.withCtx(()=>[l.createVNode(Zs,{"icon-class":o.value.icon},null,8,["icon-class"]),l.createTextVNode(" "+l.toDisplayString(e.label||o.value.label),1)]),_:1})):(l.openBlock(),l.createBlock(p,{key:1,link:"",type:"primary",onClick:a},{default:l.withCtx(()=>[l.renderSlot(s.$slots,"default",{},void 0,!0)]),_:3}))])}}}),[["__scopeId","data-v-2f3f771c"]]);function Fi(e,t){return function(){return e.apply(t,arguments)}}const{toString:el}=Object.prototype,{getPrototypeOf:Xt}=Object,{iterator:pn,toStringTag:Vi}=Symbol,Nn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),dn=(e,t)=>{let n=e;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),Nn(n,t))return!0;n=Xt(n)}return!1},tl=(e,t)=>e!=null&&dn(e,t)?e[t]:void 0,yr=(e=>t=>{const n=el.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),et=e=>(e=e.toLowerCase(),t=>yr(t)===e),On=e=>t=>typeof t===e,{isArray:Bt}=Array,It=On("undefined");function Jt(e){return e!==null&&!It(e)&&e.constructor!==null&&!It(e.constructor)&&Ye(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $i=et("ArrayBuffer");function nl(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$i(e.buffer),t}const rl=On("string"),Ye=On("function"),ji=On("number"),Zt=e=>e!==null&&typeof e=="object",il=e=>e===!0||e===!1,Dn=e=>{if(!Zt(e))return!1;const t=Xt(e);return(t===null||t===Object.prototype||Xt(t)===null)&&!dn(e,Vi)&&!dn(e,pn)},ol=e=>{if(!Zt(e)||Jt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},al=et("Date"),sl=et("File"),ll=e=>!!(e&&typeof e.uri<"u"),cl=e=>e&&typeof e.getParts<"u",ul=et("Blob"),fl=et("FileList"),pl=et("Set"),dl=e=>Zt(e)&&Ye(e.pipe);function hl(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Ui=hl(),zi=typeof Ui.FormData<"u"?Ui.FormData:void 0,ml=e=>{if(!e)return!1;if(zi&&e instanceof zi)return!0;const t=Xt(e);if(!t||t===Object.prototype||!Ye(e.append))return!1;const n=yr(e);return n==="formdata"||n==="object"&&Ye(e.toString)&&e.toString()==="[object FormData]"},yl=et("URLSearchParams"),[gl,vl,wl,bl]=["ReadableStream","Request","Response","Headers"].map(et),El=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function hn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Bt(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Jt(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let s;for(r=0;r<a;r++)s=o[r],t.call(null,e[s],s,e)}}function Hi(e,t){if(Jt(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Lt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wi=e=>!It(e)&&e!==Lt;function gr(...e){const{caseless:t,skipUndefined:n}=Wi(this)&&this||{},r={},i=(o,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const s=t&&typeof a=="string"&&Hi(r,a)||a,f=Nn(r,s)?r[s]:void 0;Dn(f)&&Dn(o)?r[s]=gr(f,o):Dn(o)?r[s]=gr({},o):Bt(o)?r[s]=o.slice():(!n||!It(o))&&(r[s]=o)};for(let o=0,a=e.length;o<a;o++){const s=e[o];if(!s||Jt(s)||(hn(s,i),typeof s!="object"||Bt(s)))continue;const f=Object.getOwnPropertySymbols(s);for(let p=0;p<f.length;p++){const h=f[p];Dl.call(s,h)&&i(s[h],h)}}return r}const _l=(e,t,n,{allOwnKeys:r}={})=>(hn(t,(i,o)=>{n&&Ye(i)?Object.defineProperty(e,o,{__proto__:null,value:Fi(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),xl=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Sl=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Al=(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=n!==!1&&Xt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Cl=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},kl=e=>{if(!e)return null;if(Bt(e))return e;let t=e.length;if(!ji(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Rl=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Xt(Uint8Array)),Tl=(e,t)=>{const r=(e&&e[pn]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Pl=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Nl=et("HTMLFormElement"),Ol=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),{propertyIsEnumerable:Dl}=Object.prototype,Ml=et("RegExp"),qi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};hn(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},Bl=e=>{qi(e,(t,n)=>{if(Ye(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(Ye(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Il=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Bt(e)?r(e):r(String(e).split(t)),n},Ll=()=>{},Fl=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Vl(e){return!!(e&&Ye(e.append)&&e[Vi]==="FormData"&&e[pn])}const $l=e=>{const t=new WeakSet,n=r=>{if(Zt(r)){if(t.has(r))return;if(Jt(r))return r;if(!("toJSON"in r)){t.add(r);let i;if(pl(r)){i=[];for(const o of r){const a=n(o);!It(a)&&i.push(a)}}else i=Bt(r)?[]:{},hn(r,(o,a)=>{const s=n(o);!It(s)&&(i[a]=s)});return t.delete(r),i}}return r};return n(e)},jl=et("AsyncFunction"),Ul=e=>e&&(Zt(e)||Ye(e))&&Ye(e.then)&&Ye(e.catch),Yi=((e,t)=>e?setImmediate:t?((n,r)=>(Lt.addEventListener("message",({source:i,data:o})=>{i===Lt&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Lt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ye(Lt.postMessage)),zl=typeof queueMicrotask<"u"?queueMicrotask.bind(Lt):typeof process<"u"&&process.nextTick||Yi,Ki=e=>e!=null&&Ye(e[pn]),g={isArray:Bt,isArrayBuffer:$i,isBuffer:Jt,isFormData:ml,isArrayBufferView:nl,isString:rl,isNumber:ji,isBoolean:il,isObject:Zt,isPlainObject:Dn,isEmptyObject:ol,isReadableStream:gl,isRequest:vl,isResponse:wl,isHeaders:bl,isUndefined:It,isDate:al,isFile:sl,isReactNativeBlob:ll,isReactNative:cl,isBlob:ul,isRegExp:Ml,isFunction:Ye,isStream:dl,isURLSearchParams:yl,isTypedArray:Rl,isFileList:fl,forEach:hn,merge:gr,extend:_l,trim:El,stripBOM:xl,inherits:Sl,toFlatObject:Al,kindOf:yr,kindOfTest:et,endsWith:Cl,toArray:kl,forEachEntry:Tl,matchAll:Pl,isHTMLForm:Nl,hasOwnProperty:Nn,hasOwnProp:Nn,hasOwnInPrototypeChain:dn,getSafeProp:tl,reduceDescriptors:qi,freezeMethods:Bl,toObjectSet:Il,toCamelCase:Ol,noop:Ll,toFiniteNumber:Fl,findKey:Hi,global:Lt,isContextDefined:Wi,isSpecCompliantForm:Vl,toJSONObject:$l,isAsyncFn:jl,isThenable:Ul,setImmediate:Yi,asap:zl,isIterable:Ki,isSafeIterable:e=>e!=null&&dn(e,pn)&&Ki(e)},Hl=g.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Wl=e=>{const t={};let n,r,i;return e&&e.split(`
2
+ `).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim();const s=g.hasOwnProp(t,n);!n||s&&g.hasOwnProp(Hl,n)||(n==="set-cookie"?s?t[n].push(r):t[n]=[r]:t[n]=s?t[n]+", "+r:r)}),t};function ql(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const Yl=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Kl=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function vr(e,t){return g.isArray(e)?e.map(n=>vr(n,t)):ql(String(e).replace(t,""))}const Gl=e=>vr(e,Yl),Xl=e=>vr(e,Kl);function Gi(e){const t=Object.create(null);return g.forEach(e.toJSON(),(n,r)=>{t[r]=Xl(n)}),t}const Xi=Symbol("internals");function mn(e){return e&&String(e).trim().toLowerCase()}function Mn(e){return e===!1||e==null?e:g.isArray(e)?e.map(Mn):Gl(String(e))}function Jl(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Zl=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function wr(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function Ql(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n="";for(let r=1;r<t;r++){const i=e.charCodeAt(r);if(i===34||i===92&&(r+=1,r>=t))return e;n+=e[r]}return n}function ec(e){const t=Object.create(null),n=String(e);let r=0,i=!1,o=!1;function a(s){const f=wr(n.slice(r,s)),p=f.indexOf("=");if(p<1)return;const h=wr(f.slice(0,p));if(!Zl.test(h))return;const m=h.toLowerCase();if(m==="__proto__"||m==="constructor"||m==="prototype")return;const _=wr(f.slice(p+1));t[m]=Ql(_)}for(let s=0;s<n.length;s++){const f=n.charCodeAt(s);i?o?o=!1:f===92?o=!0:f===34&&(i=!1):f===34?i=!0:(f===44||f===59)&&(a(s),r=s+1)}return a(n.length),t}const tc=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function br(e,t,n,r,i){if(g.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!g.isString(t)){if(g.isString(r))return t.indexOf(r)!==-1;if(g.isRegExp(r))return r.test(t)}}function nc(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function rc(e,t){const n=g.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(i,o,a){return this[r].call(this,t,i,o,a)},configurable:!0})})}let $e=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(s,f,p){const h=mn(f);if(!h)return;const m=g.findKey(i,h);(!m||i[m]===void 0||p===!0||p===void 0&&i[m]!==!1)&&(i[m||f]=Mn(s))}const a=(s,f)=>g.forEach(s,(p,h)=>o(p,h,f));if(g.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(g.isString(t)&&(t=t.trim())&&!tc(t))a(Wl(t),n);else if(g.isObject(t)&&g.isSafeIterable(t)){let s=Object.create(null),f,p;for(const h of t){if(!g.isArray(h))throw new TypeError("Object iterator must return a key-value pair");p=h[0],g.hasOwnProp(s,p)?(f=s[p],s[p]=g.isArray(f)?[...f,h[1]]:[f,h[1]]):s[p]=h[1]}a(s,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=mn(t),t){const r=g.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return Jl(i);if(g.isFunction(n))return n.call(this,i,r);if(g.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=mn(t),t){const r=g.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||br(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=mn(a),a){const s=g.findKey(r,a);s&&(!n||br(r,r[s],s,n))&&(delete r[s],i=!0)}}return g.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||br(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return g.forEach(this,(i,o)=>{const a=g.findKey(r,o);if(a){n[a]=Mn(i),delete n[o];return}const s=t?nc(o):String(o).trim();s!==o&&delete n[o],n[s]=Mn(i),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return g.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&g.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
+ `)}getSetCookie(){const t=this.get("set-cookie");return g.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return ec(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Xi]=this[Xi]={accessors:{}}).accessors,i=this.prototype;function o(a){const s=mn(a);r[s]||(rc(i,a),r[s]=!0)}return g.isArray(t)?t.forEach(o):o(t),this}};$e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),g.reduceDescriptors($e.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),g.freezeMethods($e);const Bn="[REDACTED ****]";function ic(e){if(g.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(g.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function oc(e,t){const n=new Set(t.map(o=>String(o).toLowerCase())),r=[],i=o=>{if(o===null||typeof o!="object"||g.isBuffer(o))return o;if(r.indexOf(o)!==-1)return;o instanceof $e&&(o=o.toJSON()),r.push(o);let a;if(g.isArray(o))a=[],o.forEach((s,f)=>{const p=i(s);g.isUndefined(p)||(a[f]=p)});else{if(!g.isPlainObject(o)&&ic(o))return r.pop(),o;a=Object.create(null);for(const[s,f]of Object.entries(o)){const p=n.has(s.toLowerCase())?Bn:i(f);g.isUndefined(p)||(a[s]=p)}}return r.pop(),a};return i(e)}function Ji(e){try{return String(e)}catch{return""}}function ac(e){return e.errors.map(n=>{try{return n&&n.message?Ji(n.message):Ji(n)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}let Z=class Cs extends Error{static from(t,n,r,i,o,a){let s=t.message;!s&&g.isArray(t.errors)&&t.errors.length&&(s=ac(t));const f=new Cs(s,n||t.code,r,i,o);return Object.defineProperty(f,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),f.name=t.name,t.status!=null&&f.status==null&&(f.status=t.status),a&&Object.assign(f,a),f}constructor(t,n,r,i,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),i&&(this.request=i),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,n=t&&g.hasOwnProp(t,"redact")?t.redact:void 0,r=g.isArray(n)&&n.length>0?oc(t,n):g.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};Z.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Z.ERR_BAD_OPTION="ERR_BAD_OPTION",Z.ECONNABORTED="ECONNABORTED",Z.ETIMEDOUT="ETIMEDOUT",Z.ECONNREFUSED="ECONNREFUSED",Z.ERR_NETWORK="ERR_NETWORK",Z.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Z.ERR_DEPRECATED="ERR_DEPRECATED",Z.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Z.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Z.ERR_CANCELED="ERR_CANCELED",Z.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Z.ERR_INVALID_URL="ERR_INVALID_URL",Z.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const sc=null,Zi=100;function Er(e){return g.isPlainObject(e)||g.isArray(e)}function Qi(e){return g.endsWith(e,"[]")?e.slice(0,-2):e}function _r(e,t,n){return e?e.concat(t).map(function(i,o){return i=Qi(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function lc(e){return g.isArray(e)&&!e.some(Er)}const cc=g.toFlatObject(g,{},null,function(t){return/^is[A-Z]/.test(t)});function In(e,t,n){if(!g.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=g.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(M,w){return!g.isUndefined(w[M])});const r=n.metaTokens,i=n.visitor||H,o=n.dots,a=n.indexes,s=n.Blob||typeof Blob<"u"&&Blob,f=n.maxDepth===void 0?Zi:n.maxDepth,p=s&&g.isSpecCompliantForm(t),h=[];if(!g.isFunction(i))throw new TypeError("visitor must be a function");function m(S){if(S===null)return"";if(g.isDate(S))return S.toISOString();if(g.isBoolean(S))return S.toString();if(!p&&g.isBlob(S))throw new Z("Blob is not supported. Use a Buffer instead.");if(g.isArrayBuffer(S)||g.isTypedArray(S)){if(p&&typeof s=="function")return new s([S]);throw new Z("Blob is not supported. Use a Buffer instead.",Z.ERR_NOT_SUPPORT)}return S}function _(S){if(S>f)throw new Z("Object is too deeply nested ("+S+" levels). Max depth: "+f,Z.ERR_FORM_DATA_DEPTH_EXCEEDED)}function B(S,M){if(f===1/0)return JSON.stringify(S);const w=[];return JSON.stringify(S,function(D,L){if(!g.isObject(L))return L;for(;w.length&&w[w.length-1]!==this;)w.pop();return w.push(L),_(M+w.length-1),L})}function H(S,M,w){let E=S;if(g.isReactNative(t)&&g.isReactNativeBlob(S))return t.append(_r(w,M,o),m(S)),!1;if(S&&!w&&typeof S=="object"){if(g.endsWith(M,"{}"))M=r?M:M.slice(0,-2),S=B(S,1);else if(g.isArray(S)&&lc(S)||(g.isFileList(S)||g.endsWith(M,"[]"))&&(E=g.toArray(S)))return M=Qi(M),E.forEach(function(L,N){!(g.isUndefined(L)||L===null)&&t.append(a===!0?_r([M],N,o):a===null?M:M+"[]",m(L))}),!1}return Er(S)?!0:(t.append(_r(w,M,o),m(S)),!1)}const F=Object.assign(cc,{defaultVisitor:H,convertValue:m,isVisitable:Er});function R(S,M,w=0){if(!g.isUndefined(S)){if(_(w),h.indexOf(S)!==-1)throw new Error("Circular reference detected in "+M.join("."));h.push(S),g.forEach(S,function(D,L){(!(g.isUndefined(D)||D===null)&&i.call(t,D,g.isString(L)?L.trim():L,M,F))===!0&&R(D,M?M.concat(L):[L],w+1)}),h.pop()}}if(!g.isObject(e))throw new TypeError("data must be an object");return R(e),t}function eo(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function xr(e,t){this._pairs=[],e&&In(e,this,t)}const to=xr.prototype;to.append=function(t,n){this._pairs.push([t,n])},to.toString=function(t){const n=t?r=>t.call(this,r,eo):eo;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function uc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function no(e,t,n){if(!t)return e;e=e||"";const r=g.isFunction(n)?{serialize:n}:n,i=g.getSafeProp(r,"encode")||uc,o=g.getSafeProp(r,"serialize");let a;if(o?a=o(t,r):a=g.isURLSearchParams(t)?t.toString():new xr(t,r).toString(i),a){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class ro{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){g.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Sr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},fc={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:xr,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ar=typeof window<"u"&&typeof document<"u",Cr=typeof navigator=="object"&&navigator||void 0,pc=Ar&&(!Cr||["ReactNative","NativeScript","NS"].indexOf(Cr.product)<0),dc=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hc=Ar&&window.location.href||"http://localhost",Le={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ar,hasStandardBrowserEnv:pc,hasStandardBrowserWebWorkerEnv:dc,navigator:Cr,origin:hc},Symbol.toStringTag,{value:"Module"})),...fc};function mc(e,t){return In(e,new Le.classes.URLSearchParams,{visitor:function(n,r,i,o){return Le.isNode&&g.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const io=Zi;function oo(e){if(e>io)throw new Z("FormData field is too deeply nested ("+e+" levels). Max depth: "+io,Z.ERR_FORM_DATA_DEPTH_EXCEEDED)}function yc(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;(r=n.exec(e))!==null;)oo(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function gc(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function ao(e){function t(n,r,i,o){oo(o);let a=n[o++];if(a==="__proto__")return!0;const s=Number.isFinite(+a),f=o>=n.length;return a=!a&&g.isArray(i)?i.length:a,f?(g.hasOwnProp(i,a)?i[a]=g.isArray(i[a])?i[a].concat(r):[i[a],r]:i[a]=r,!s):((!g.hasOwnProp(i,a)||!g.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&g.isArray(i[a])&&(i[a]=gc(i[a])),!s)}if(g.isFormData(e)&&g.isFunction(e.entries)){const n={};return g.forEachEntry(e,(r,i)=>{t(yc(r),i,n,0)}),n}return null}const Qt=(e,t)=>e!=null&&g.hasOwnProp(e,t)?e[t]:void 0;function vc(e,t,n){if(g.isString(e))try{return(t||JSON.parse)(e),g.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const yn={transitional:Sr,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=g.isObject(t);if(o&&g.isHTMLForm(t)&&(t=new FormData(t)),g.isFormData(t))return i?JSON.stringify(ao(t)):t;if(g.isArrayBuffer(t)||g.isBuffer(t)||g.isStream(t)||g.isFile(t)||g.isBlob(t)||g.isReadableStream(t))return t;if(g.isArrayBufferView(t))return t.buffer;if(g.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){const f=Qt(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return mc(t,f).toString();if((s=g.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=Qt(this,"env"),h=p&&p.FormData;return In(s?{"files[]":t}:t,h&&new h,f)}}return o||i?(n.setContentType("application/json",!1),vc(t)):t}],transformResponse:[function(t){const n=Qt(this,"transitional")||yn.transitional,r=n&&n.forcedJSONParsing,i=Qt(this,"responseType"),o=i==="json";if(g.isResponse(t)||g.isReadableStream(t))return t;if(t&&g.isString(t)&&(r&&!i||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,Qt(this,"parseReviver"))}catch(f){if(s)throw f.name==="SyntaxError"?Z.from(f,Z.ERR_BAD_RESPONSE,this,null,Qt(this,"response")):f}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Le.classes.FormData,Blob:Le.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};g.forEach(["delete","get","head","post","put","patch","query"],e=>{yn.headers[e]={}});function kr(e,t){const n=this||yn,r=t||n,i=$e.from(r.headers);let o=r.data;return g.forEach(e,function(s){o=s.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function so(e){return!!(e&&e.__CANCEL__)}let gn=class extends Z{constructor(t,n,r){super(t??"canceled",Z.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function lo(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Z("Request failed with status code "+n.status,n.status>=400&&n.status<500?Z.ERR_BAD_REQUEST:Z.ERR_BAD_RESPONSE,n.config,n.request,n))}function wc(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function bc(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(f){const p=Date.now(),h=r[o];a||(a=p),n[i]=f,r[i]=p;let m=o,_=0;for(;m!==i;)_+=n[m++],m=m%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),p-a<t)return;const B=h&&p-h;return B?Math.round(_*1e3/B):void 0}}function Ec(e,t){let n=0,r=1e3/t,i,o;const a=(p,h=Date.now())=>{n=h,i=null,o&&(clearTimeout(o),o=null),e(...p)};return[(...p)=>{const h=Date.now(),m=h-n;m>=r?a(p,h):(i=p,o||(o=setTimeout(()=>{o=null,a(i)},r-m)))},()=>i&&a(i)]}const Ln=(e,t,n=3)=>{let r=0;const i=bc(50,250);return Ec(o=>{if(!o||typeof o.loaded!="number")return;const a=o.loaded,s=o.lengthComputable?o.total:void 0,f=Math.max(0,s!=null?Math.min(a,s):a),p=Math.max(0,f-r),h=i(p);r=Math.max(r,f);const m={loaded:f,total:s,progress:s?f/s:void 0,bytes:p,rate:h||void 0,estimated:h&&s?(s-f)/h:void 0,event:o,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(m)},n)},co=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},uo=(e,t=g.asap)=>(...n)=>t(()=>e(...n)),_c=Le.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Le.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Le.origin),Le.navigator&&/(msie|trident)/i.test(Le.navigator.userAgent)):()=>!0,xc=Le.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];g.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),g.isString(r)&&s.push(`path=${r}`),g.isString(i)&&s.push(`domain=${i}`),o===!0&&s.push("secure"),g.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),i=r.indexOf("=");if(i!==-1&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch{return r.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Sc(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ac(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}const Cc=/^https?:(?!\/\/)/i,kc=/[\t\n\r]/g;function Rc(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Tc(e){return Rc(e).replace(kc,"")}function Pc(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,n,r="")=>`${n}${r}${Bn}`)}function Nc(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Bn}@`),n=t.indexOf("#"),i=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Bn}`);return n===-1?i:`${i}#${Pc(t.slice(n+1))}`}function fo(e,t){if(typeof e=="string"){const n=Tc(e);if(Cc.test(n))throw new Z(`Invalid URL ${JSON.stringify(Nc(n))}: missing "//" after protocol`,Z.ERR_INVALID_URL,t)}}function po(e,t,n,r){fo(t,r);let i=!Sc(t);return e&&(i||n===!1)?(fo(e,r),Ac(e,t)):t}const ho=e=>e instanceof $e?{...e}:e,Oc=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function Ft(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(h,m,_,B){return g.isPlainObject(h)&&g.isPlainObject(m)?g.merge.call({caseless:B},h,m):g.isPlainObject(m)?g.merge({},m):g.isArray(m)?m.slice():m}function i(h,m,_,B){if(g.isUndefined(m)){if(!g.isUndefined(h))return r(void 0,h,_,B)}else return r(h,m,_,B)}function o(h,m){if(!g.isUndefined(m))return r(void 0,m)}function a(h,m){if(g.isUndefined(m)){if(!g.isUndefined(h))return r(void 0,h)}else return r(void 0,m)}function s(h){const m=g.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!g.isUndefined(m))if(g.isPlainObject(m)){if(g.hasOwnProp(m,h))return m[h]}else return;const _=g.hasOwnProp(e,"transitional")?e.transitional:void 0;if(g.isPlainObject(_)&&g.hasOwnProp(_,h))return _[h]}function f(h,m,_){if(g.hasOwnProp(t,_))return r(h,m);if(g.hasOwnProp(e,_))return r(void 0,h)}const p={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:f,headers:(h,m,_)=>i(ho(h),ho(m),_,!0)};return g.forEach(Oc({...e,...t}),function(m){if(m==="__proto__"||m==="constructor"||m==="prototype")return;const _=g.hasOwnProp(p,m)?p[m]:i,B=g.hasOwnProp(e,m)?e[m]:void 0,H=g.hasOwnProp(t,m)?t[m]:void 0,F=_(B,H,m);g.isUndefined(F)&&_!==f||(n[m]=F)}),g.hasOwnProp(t,"validateStatus")&&g.isUndefined(t.validateStatus)&&s("validateStatusUndefinedResolves")===!1&&(g.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const Dc=["content-type","content-length"];function Mc(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([r,i])=>{Dc.includes(r.toLowerCase())&&e.set(r,i)})}const Bc=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function mo(e){const t=Ft({},e),n=_=>g.hasOwnProp(t,_)?t[_]:void 0,r=n("data");let i=n("withXSRFToken");const o=n("xsrfHeaderName"),a=n("xsrfCookieName");let s=n("headers");const f=n("auth"),p=n("baseURL"),h=n("allowAbsoluteUrls"),m=n("url");if(t.headers=s=$e.from(s),t.url=no(po(p,m,h,t),n("params"),n("paramsSerializer")),f){const _=g.getSafeProp(f,"username")||"",B=g.getSafeProp(f,"password")||"";try{s.set("Authorization","Basic "+btoa(_+":"+(B?Bc(B):"")))}catch(H){throw Z.from(H,Z.ERR_BAD_OPTION_VALUE,e)}}if(g.isFormData(r)&&(Le.hasStandardBrowserEnv||Le.hasStandardBrowserWebWorkerEnv||g.isReactNative(r)?s.setContentType(void 0):g.isFunction(r.getHeaders)&&Mc(s,r.getHeaders(),n("formDataHeaderPolicy"))),Le.hasStandardBrowserEnv&&(g.isFunction(i)&&(i=i(t)),i===!0||i==null&&_c(t.url))){const B=o&&a&&xc.read(a);B&&s.set(o,B)}return t}const Ic=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=mo(e);let o=i.data;const a=$e.from(i.headers).normalize();let{responseType:s,onUploadProgress:f,onDownloadProgress:p}=i,h,m,_,B,H;function F(){B&&B(),H&&H(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let R=new XMLHttpRequest;R.open(i.method.toUpperCase(),i.url,!0),R.timeout=i.timeout;function S(){if(!R)return;const w=$e.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),D={data:!s||s==="text"||s==="json"?R.responseText:R.response,status:R.status,statusText:R.statusText,headers:w,config:e,request:R};lo(function(N){n(N),F()},function(N){r(N),F()},D),R=null}"onloadend"in R?R.onloadend=S:R.onreadystatechange=function(){!R||R.readyState!==4||R.status===0&&!(R.responseURL&&R.responseURL.startsWith("file:"))||setTimeout(S)},R.onabort=function(){R&&(r(new Z("Request aborted",Z.ECONNABORTED,e,R)),F(),R=null)},R.onerror=function(E){const D=E&&E.message?E.message:"Network Error",L=new Z(D,Z.ERR_NETWORK,e,R);L.event=E||null,r(L),F(),R=null},R.ontimeout=function(){let E=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const D=i.transitional||Sr;i.timeoutErrorMessage&&(E=i.timeoutErrorMessage),r(new Z(E,D.clarifyTimeoutError?Z.ETIMEDOUT:Z.ECONNABORTED,e,R)),F(),R=null},o===void 0&&a.setContentType(null),"setRequestHeader"in R&&g.forEach(Gi(a),function(E,D){R.setRequestHeader(D,E)}),g.isUndefined(i.withCredentials)||(R.withCredentials=!!i.withCredentials),s&&s!=="json"&&(R.responseType=i.responseType),p&&([_,H]=Ln(p,!0),R.addEventListener("progress",_)),f&&R.upload&&([m,B]=Ln(f),R.upload.addEventListener("progress",m),R.upload.addEventListener("loadend",B)),(i.cancelToken||i.signal)&&(h=w=>{R&&(r(!w||w.type?new gn(null,e,R):w),R.abort(),F(),R=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const M=wc(i.url);if(M&&!Le.protocols.includes(M)){r(new Z("Unsupported protocol "+M+":",Z.ERR_BAD_REQUEST,e)),F();return}R.send(o||null)})},Lc=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const i=function(f){if(!r){r=!0,a();const p=f instanceof Error?f:this.reason;n.abort(p instanceof Z?p:new gn(p instanceof Error?p.message:p))}};let o=t&&setTimeout(()=>{o=null,i(new Z(`timeout of ${t}ms exceeded`,Z.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>{if(!r){if(f.aborted){i.call(f);return}f.addEventListener("abort",i,{once:!0})}});const{signal:s}=n;return s.unsubscribe=()=>g.asap(a),s},Fc=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},Vc=async function*(e,t){for await(const n of $c(e))yield*Fc(n,t)},$c=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},yo=(e,t,n,r)=>{const i=Vc(e,t);let o=0,a,s=f=>{a||(a=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:p,value:h}=await i.next();if(p){s(),f.close();return}let m=h.byteLength;if(n){let _=o+=m;n(_)}f.enqueue(new Uint8Array(h))}catch(p){throw s(p),p}},cancel(f){return s(f),i.return()}},{highWaterMark:2})},go=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,vo=(e,t,n)=>t+2<n&&go(e.charCodeAt(t+1))&&go(e.charCodeAt(t+2)),wo=e=>e<=57?e-48:(e&223)-55,jc=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,Uc=e=>e===9||e===10||e===12||e===13||e===32,zc=e=>{const t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},Hc=e=>{const t=e.length;let n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},Wc=e=>{const t=e.length;let n=0,r=0,i=!1;for(let o=0;o<t;o++){let a=e.charCodeAt(o);if(a===37&&vo(e,o,t)&&(a=wo(e.charCodeAt(o+1))*16+wo(e.charCodeAt(o+2)),o+=2),!Uc(a)){if(a===61){r++;continue}if(!jc(a)||r>0){i=!0;continue}n++}}return i||r>2||r>0&&(n+r)%4!==0||n%4===1?Hc(e):zc(n)},qc=(e,t)=>{if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const r=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(r))return t(i);let a=0;for(let s=0,f=i.length;s<f;s++){const p=i.charCodeAt(s);if(p===37&&vo(i,s,f))a+=1,s+=2;else if(p<128)a+=1;else if(p<2048)a+=2;else if(p>=55296&&p<=56319&&s+1<f){const h=i.charCodeAt(s+1);h>=56320&&h<=57343?(a+=4,s++):a+=3}else a+=3}return a};function Yc(e){const t=typeof e=="string"?e.indexOf("#"):-1;return qc(t===-1?e:e.slice(0,t),Wc)}const Rr="1.19.0",bo=64*1024,{isFunction:Fn}=g,Kc=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),Eo=e=>{if(!g.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},_o=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Gc=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},Xc=e=>{const t=g.global!==void 0&&g.global!==null?g.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=g.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:o,Response:a}=e,s=i?Fn(i):typeof fetch=="function",f=Fn(o),p=Fn(a);if(!s)return!1;const h=s&&Fn(n),m=s&&(typeof r=="function"?(S=>M=>S.encode(M))(new r):async S=>new Uint8Array(await new o(S).arrayBuffer())),_=f&&h&&_o(()=>{let S=!1;const M=new o(Le.origin,{body:new n,method:"POST",get duplex(){return S=!0,"half"}}),w=M.headers.has("Content-Type");return M.body!=null&&M.body.cancel(),S&&!w}),B=p&&h&&_o(()=>g.isReadableStream(new a("").body)),H={stream:B&&(S=>S.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!H[S]&&(H[S]=(M,w)=>{let E=M&&M[S];if(E)return E.call(M);throw new Z(`Response type '${S}' is not supported`,Z.ERR_NOT_SUPPORT,w)})});const F=async S=>{if(S==null)return 0;if(g.isBlob(S))return S.size;if(g.isSpecCompliantForm(S))return(await new o(Le.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(g.isArrayBufferView(S)||g.isArrayBuffer(S))return S.byteLength;if(g.isURLSearchParams(S)&&(S=S+""),g.isString(S))return(await m(S)).byteLength},R=async(S,M)=>{const w=g.toFiniteNumber(S.getContentLength());return w??F(M)};return async S=>{let{url:M,method:w,data:E,signal:D,cancelToken:L,timeout:N,onDownloadProgress:x,onUploadProgress:$,responseType:P,headers:b,withCredentials:W="same-origin",fetchOptions:ue,maxContentLength:G,maxBodyLength:Y}=mo(S);const T=g.isNumber(G)&&G>-1,j=g.isNumber(Y)&&Y>-1,O=ae=>g.hasOwnProp(S,ae)?S[ae]:void 0;let q=i||fetch;P=P?(P+"").toLowerCase():"text";let U=Lc([D,L&&L.toAbortSignal()],N),K=null;const k=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let A,I=null;const ie=()=>new Z("Request body larger than maxBodyLength limit",Z.ERR_BAD_REQUEST,S,K);try{let ae;const d=O("auth");if(d){const Q=g.getSafeProp(d,"username")||"",pe=g.getSafeProp(d,"password")||"";ae={username:Q,password:pe}}if(Gc(M)){const Q=new URL(M,Le.origin);if(!ae&&(Q.username||Q.password)){const pe=Eo(Q.username),be=Eo(Q.password);ae={username:pe,password:be}}(Q.username||Q.password)&&(Q.username="",Q.password="",M=Q.href)}if(ae&&(b.delete("authorization"),b.set("Authorization","Basic "+btoa(Kc((ae.username||"")+":"+(ae.password||""))))),T&&typeof M=="string"&&M.startsWith("data:")&&Yc(M)>G)throw new Z("maxContentLength size of "+G+" exceeded",Z.ERR_BAD_RESPONSE,S,K);if(j&&w!=="get"&&w!=="head"){const Q=await F(E);if(typeof Q=="number"&&isFinite(Q)&&(A=Q,Q>Y))throw ie()}const u=j&&(g.isReadableStream(E)||g.isStream(E)),c=(Q,pe,be)=>yo(Q,bo,Ce=>{if(j&&Ce>Y)throw I=ie();pe&&pe(Ce)},be);if(_&&w!=="get"&&w!=="head"&&($||u)){if(A=A??await R(b,E),A!==0||u){let Q=new o(M,{method:"POST",body:E,duplex:"half"}),pe;if(g.isFormData(E)&&(pe=Q.headers.get("content-type"))&&b.setContentType(pe),Q.body){const[be,Ce]=$&&co(A,Ln(uo($)))||[];E=c(Q.body,be,Ce)}}}else if(u&&!f&&h&&w!=="get"&&w!=="head")E=c(E);else if(u&&f&&!_&&w!=="get"&&w!=="head")throw new Z("Stream request bodies are not supported by the current fetch implementation",Z.ERR_NOT_SUPPORT,S,K);g.isString(W)||(W=W?"include":"omit");const y=f&&"credentials"in o.prototype;if(g.isFormData(E)){const Q=b.getContentType();Q&&/^multipart\/form-data/i.test(Q)&&!/boundary=/i.test(Q)&&b.delete("content-type")}b.set("User-Agent","axios/"+Rr,!1);const v={...ue,signal:U,method:w.toUpperCase(),headers:Gi(b.normalize()),body:E,duplex:"half",credentials:y?W:void 0};K=f&&new o(M,v);let C=await(f?q(K,ue):q(M,v));const X=$e.from(C.headers);if(T){const Q=g.toFiniteNumber(X.getContentLength());if(Q!=null&&Q>G)throw new Z("maxContentLength size of "+G+" exceeded",Z.ERR_BAD_RESPONSE,S,K)}const se=B&&(P==="stream"||P==="response");if(B&&C.body&&(x||T||se&&k)){const Q={};["status","statusText","headers"].forEach(Ee=>{Q[Ee]=C[Ee]});const pe=g.toFiniteNumber(X.getContentLength()),[be,Ce]=x&&co(pe,Ln(uo(x),!0))||[];let Pe=0;const we=Ee=>{if(T&&(Pe=Ee,Pe>G))throw new Z("maxContentLength size of "+G+" exceeded",Z.ERR_BAD_RESPONSE,S,K);be&&be(Ee)};C=new a(yo(C.body,bo,we,()=>{Ce&&Ce(),k&&k()}),Q)}P=P||"text";let fe=await H[g.findKey(H,P)||"text"](C,S);if(T&&!B&&!se){let Q;if(fe!=null&&(typeof fe.byteLength=="number"?Q=fe.byteLength:typeof fe.size=="number"?Q=fe.size:typeof fe=="string"&&(Q=typeof r=="function"?new r().encode(fe).byteLength:fe.length)),typeof Q=="number"&&Q>G)throw new Z("maxContentLength size of "+G+" exceeded",Z.ERR_BAD_RESPONSE,S,K)}return!se&&k&&k(),await new Promise((Q,pe)=>{lo(Q,pe,{data:fe,headers:$e.from(C.headers),status:C.status,statusText:C.statusText,config:S,request:K})})}catch(ae){if(k&&k(),U&&U.aborted&&U.reason instanceof Z){const d=U.reason;throw d.config=S,K&&(d.request=K),ae!==d&&Object.defineProperty(d,"cause",{__proto__:null,value:ae,writable:!0,enumerable:!1,configurable:!0}),d}if(I)throw K&&!I.request&&(I.request=K),I;if(ae instanceof Z)throw K&&!ae.request&&(ae.request=K),ae;if(ae&&ae.name==="TypeError"&&/Load failed|fetch/i.test(ae.message)){const d=new Z("Network Error",Z.ERR_NETWORK,S,K,ae&&ae.response);throw Object.defineProperty(d,"cause",{__proto__:null,value:ae.cause||ae,writable:!0,enumerable:!1,configurable:!0}),d}throw Z.from(ae,ae&&ae.code,S,K,ae&&ae.response)}}},Jc=new Map,xo=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a=o.length,s=a,f,p,h=Jc;for(;s--;)f=o[s],p=h.get(f),p===void 0&&h.set(f,p=s?new Map:Xc(t)),h=p;return p};xo();const Tr={http:sc,xhr:Ic,fetch:{get:xo}};g.forEach(Tr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const So=e=>`- ${e}`,Zc=e=>g.isFunction(e)||e===null||e===!1;function Qc(e,t){e=g.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){r=e[a];let s;if(i=r,!Zc(r)&&(i=Tr[(s=String(r)).toLowerCase()],i===void 0))throw new Z(`Unknown adapter '${s}'`);if(i&&(g.isFunction(i)||(i=i.get(t))))break;o[s||"#"+a]=i}if(!i){const a=Object.entries(o).map(([f,p])=>`adapter ${f} `+(p===!1?"is not supported by the environment":"is not available in the build"));let s=n?a.length>1?`since :
4
+ `+a.map(So).join(`
5
+ `):" "+So(a[0]):"as no adapter specified";throw new Z("There is no suitable adapter to dispatch the request "+s,Z.ERR_NOT_SUPPORT)}return i}const Ao={getAdapter:Qc,adapters:Tr};function Pr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gn(null,e)}function Nr(e){return Pr(e),e.headers=$e.from(e.headers),e.data=kr.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ao.getAdapter(e.adapter||yn.adapter,e)(e).then(function(r){Pr(e),e.response=r;try{r.data=kr.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=$e.from(r.headers),r},function(r){if(!so(r)&&(Pr(e),r&&r.response)){e.response=r.response;try{r.response.data=kr.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=$e.from(r.response.headers)}return Promise.reject(r)})}const Vn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Co={};Vn.transitional=function(t,n,r){function i(o,a){return"[Axios v"+Rr+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,s)=>{if(t===!1)throw new Z(i(a," has been removed"+(n?" in "+n:"")),Z.ERR_DEPRECATED);return n&&!Co[a]&&(Co[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,s):!0}},Vn.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function eu(e,t,n){if(typeof e!="object"||e===null)throw new Z("options must be an object",Z.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){const s=e[o],f=s===void 0||a(s,o,e);if(f!==!0)throw new Z("option "+o+" must be "+f,Z.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Z("Unknown option "+o,Z.ERR_BAD_OPTION)}}const $n={assertOptions:eu,validators:Vn},je=$n.validators;let Vt=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ro,response:new ro}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=(()=>{if(!i.stack)return"";const a=i.stack.indexOf(`
6
+ `);return a===-1?"":i.stack.slice(a+1)})();try{if(!r.stack)r.stack=o;else if(o){const a=o.indexOf(`
7
+ `),s=a===-1?-1:o.indexOf(`
8
+ `,a+1),f=s===-1?"":o.slice(s+1);String(r.stack).endsWith(f)||(r.stack+=`
9
+ `+o)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ft(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&$n.assertOptions(r,{silentJSONParsing:je.transitional(je.boolean),forcedJSONParsing:je.transitional(je.boolean),clarifyTimeoutError:je.transitional(je.boolean),legacyInterceptorReqResOrdering:je.transitional(je.boolean),advertiseZstdAcceptEncoding:je.transitional(je.boolean),validateStatusUndefinedResolves:je.transitional(je.boolean)},!1),i!=null&&(g.isFunction(i)?n.paramsSerializer={serialize:i}:$n.assertOptions(i,{encode:je.function,serialize:je.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),$n.assertOptions(n,{baseUrl:je.spelling("baseURL"),withXsrfToken:je.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&g.merge(o.common,o[n.method]);o&&g.forEach(["delete","get","head","post","put","patch","query","common"],H=>{delete o[H]}),n.headers=$e.concat(a,o);const s=[];let f=!0;this.interceptors.request.forEach(function(F){if(typeof F.runWhen=="function"&&F.runWhen(n)===!1)return;f=f&&F.synchronous;const R=n.transitional||Sr;R&&R.legacyInterceptorReqResOrdering?s.unshift(F.fulfilled,F.rejected):s.push(F.fulfilled,F.rejected)});const p=[];this.interceptors.response.forEach(function(F){p.push(F.fulfilled,F.rejected)});let h,m=0,_;if(!f){const H=[Nr.bind(this),void 0];for(H.unshift(...s),H.push(...p),_=H.length,h=Promise.resolve(n);m<_;)h=h.then(H[m++],H[m++]);return h}_=s.length;let B=n;for(;m<_;){const H=s[m++],F=s[m++];try{B=H?H(B):B}catch(R){if(!F){h=Promise.reject(R);break}try{const S=F.call(this,R);g.isThenable(S)&&(h=Promise.resolve(S).then(()=>Nr.call(this,B)))}catch(S){h=Promise.reject(S)}break}}if(!h)try{h=Nr.call(this,B)}catch(H){h=Promise.reject(H)}for(m=0,_=p.length;m<_;)h=h.then(p[m++],p[m++]);return h}getUri(t){t=Ft(this.defaults,t);const n=po(t.baseURL,t.url,t.allowAbsoluteUrls,t);return no(n,t.params,t.paramsSerializer)}};g.forEach(["delete","get","head","options"],function(t){Vt.prototype[t]=function(n,r){return this.request(Ft(r||{},{method:t,url:n,data:r&&g.hasOwnProp(r,"data")?r.data:void 0}))}}),g.forEach(["post","put","patch","query"],function(t){function n(r){return function(o,a,s){return this.request(Ft(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}Vt.prototype[t]=n(),t!=="query"&&(Vt.prototype[t+"Form"]=n(!0))});let tu=class ks{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,s){r.reason||(r.reason=new gn(o,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ks(function(i){t=i}),cancel:t}}};function nu(e){return function(n){return e.apply(null,n)}}function ru(e){return g.isObject(e)&&e.isAxiosError===!0}const Or={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Or).forEach(([e,t])=>{Or[t]=e});function ko(e){const t=new Vt(e),n=Fi(Vt.prototype.request,t);return g.extend(n,Vt.prototype,t,{allOwnKeys:!0}),g.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return ko(Ft(e,i))},n}const Ne=ko(yn);Ne.Axios=Vt,Ne.CanceledError=gn,Ne.CancelToken=tu,Ne.isCancel=so,Ne.VERSION=Rr,Ne.toFormData=In,Ne.AxiosError=Z,Ne.Cancel=Ne.CanceledError,Ne.all=function(t){return Promise.all(t)},Ne.spread=nu,Ne.isAxiosError=ru,Ne.mergeConfig=Ft,Ne.AxiosHeaders=$e,Ne.formToJSON=e=>ao(g.isHTMLForm(e)?new FormData(e):e),Ne.getAdapter=Ao.getAdapter,Ne.HttpStatusCode=Or,Ne.default=Ne;const{Axios:Zm,AxiosError:Qm,CanceledError:ey,isCancel:ty,CancelToken:ny,VERSION:ry,all:iy,Cancel:oy,isAxiosError:ay,spread:sy,toFormData:ly,AxiosHeaders:cy,HttpStatusCode:uy,formToJSON:fy,getAdapter:py,mergeConfig:dy,create:hy}=Ne,mt={baseURL:"",timeout:6e4,getToken:void 0};function Ro(e={}){e.baseURL!==void 0&&(mt.baseURL=e.baseURL),e.timeout!==void 0&&(mt.timeout=e.timeout),e.getToken!==void 0&&(mt.getToken=e.getToken)}const iu="";function ou(e){return(e||"").replace(/\/$/,"")||iu}const jn=Ne.create({timeout:mt.timeout});jn.interceptors.request.use(e=>{var n;e.baseURL=ou(mt.baseURL||e.baseURL),e.timeout=mt.timeout;const t=(n=mt.getToken)==null?void 0:n.call(mt);return t&&(e.headers.Authorization=t),e}),jn.interceptors.response.use(e=>{const t=e.config,n=e.data;return t.responseType==="blob"?e:t.noCode?n:n&&![0,200].includes(n.code)?Promise.reject(new Error(n.msg||n.message||"服务错误")):n},e=>Promise.reject(e));function _e(e){return jn.request(e)}const To=e=>_e({url:"/flowstream/server/repository/flowdef/event/latest",method:"post",data:e}),Dr=(e,t)=>_e({url:`/flowstream/console/plugin/simulate/event/page/draft/${e.currentPage}/${e.pageSize}`,method:"post",data:t}),Po=e=>_e({url:"/flowstream/console/plugin/simulate",method:"post",data:e}),No=e=>_e({url:"/flowstream/server/runtime/event/start",method:"post",data:e}),Mr=e=>_e({url:"/flowstream/server/work/event/query",method:"post",data:e}),Br=e=>_e({url:"/flowstream/server/history/workinst/event/query",method:"post",data:e}),Ir=e=>_e({url:"/flowstream/server/operate/def/event/get",method:"post",data:e}),Lr=e=>_e({url:"/flowstream/server/task/event/withdraw",method:"post",data:e}),Fr=e=>_e({url:"/flowstream/server/task/event/rollback",method:"post",data:e}),Vr=e=>_e({url:"/flowstream/server/task/event/recyle",method:"post",data:e}),$r=e=>_e({url:"/flowstream/server/task/event/complete",method:"post",data:e}),jr=e=>_e({url:"/flowstream/server/runtime/event/suspend",method:"post",data:e}),Ur=e=>_e({url:"/flowstream/server/runtime/event/activate",method:"post",data:e}),zr=e=>_e({url:"/flowstream/server/runtime/event/terminate",method:"post",data:e}),Hr=e=>_e({url:`/flowstream/server/repository/flowdef/res/event/download/procdefId/${e.procdefId}/extname/bpmn`,method:"get",noCode:!0}),Wr=e=>_e({url:"/flowstream/server/task/event/send",method:"post",data:e}),Oo=e=>_e({url:"/flowstream/server/model/event/get/usertasks",method:"post",data:e}),Un=e=>_e({url:"/flowstream/server/repository/userassign/event/query",method:"post",data:e}),qr=e=>_e({url:"/flowstream/server/model/event/get/succeding",method:"post",data:e}),Yr=e=>_e({url:"/flowstream/server/task/event/jump",method:"post",data:e}),Kr=e=>_e({url:"/flowstream/server/model/event/get/usertasks",method:"post",data:e}),au=Object.freeze(Object.defineProperty({__proto__:null,activateFlow:Ur,completeTask:$r,doneTaskList:Br,downloadBpmn:Hr,draftFlowList:To,draftTaskList:Dr,flowStartNodeList:Oo,getOptList:Ir,jumpTask:Yr,nextSendNode:qr,nodeAssistant:Un,recycleTask:Vr,revocationTask:Lr,rollbackTask:Fr,saveDraft:Po,sendTask:Wr,startDraft:No,startNodes:Kr,suspendFlow:jr,terminateFlow:zr,todoTaskList:Mr},Symbol.toStringTag,{value:"Module"})),su={class:"button-group-wrapper"},lu={key:0,class:"line"},cu=_t(l.defineComponent({name:"UiFlowButtons",__name:"FlowButtons",props:{processInstanceId:{},workId:{},beforeAction:{type:Function},afterAction:{type:Function}},emits:["executeAction","afterAction","error"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=l.ref([]);async function a(){const p=await Ir({workId:r.workId});return o.value=p.data||[],o.value}async function s(p,h){var B;await ht.ElMessageBox.confirm(`是否${h}此任务?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});const m={workId:r.workId};let _;switch(p){case"revocation":case"taskWithdraw":_=await Lr(m);break;case"taskRecyle":_=await Vr(m);break;case"hang":_=await jr({processInstanceIds:[r.processInstanceId||""]});break;case"restore":_=await Ur(m);break;case"terminate":_=await zr(m);break;case"taskComplete":_=await $r({...m,variables:{}});break;case"taskRollback":_=await Fr(m);break;default:i("executeAction",p);return}(B=r.afterAction)==null||B.call(r,p,_),i("afterAction",p,_)}async function f(p){var _;const h=p.name,m={action:h,workId:r.workId,processInstanceIds:r.processInstanceId?[r.processInstanceId]:[]};if(((_=r.beforeAction)==null?void 0:_.call(r,h,m))!==!1){if(["save","start","taskSend","jump","taskJump"].includes(h)){i("executeAction",h);return}try{await s(h,p.label)}catch(B){B!=="cancel"&&B!=="close"&&i("error",B)}}}return l.watch(()=>r.workId,a),l.onMounted(a),t({getAvailableActions:a,executeAction:f}),(p,h)=>(l.openBlock(),l.createElementBlock("div",su,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(m,_)=>(l.openBlock(),l.createElementBlock("div",{key:m.name||_,class:"flex-start-r"},[l.renderSlot(p.$slots,"prefix",{action:m},void 0,!0),l.renderSlot(p.$slots,"default",{action:m},void 0,!0),l.createVNode(Li,{type:m.name,label:m.label,onClick:B=>f(m)},null,8,["type","label","onClick"]),_!==o.value.length-1?(l.openBlock(),l.createElementBlock("div",lu)):l.createCommentVNode("",!0),l.renderSlot(p.$slots,"suffix",{action:m},void 0,!0)]))),128))]))}}),[["__scopeId","data-v-d2f30b35"]]);function uu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},fu=zn.exports,Do;function pu(){return Do||(Do=1,(function(e,t){(function(n,r){e.exports=r()})(fu,(function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",f="hour",p="day",h="week",m="month",_="quarter",B="year",H="date",F="Invalid Date",R=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(G){var Y=["th","st","nd","rd"],T=G%100;return"["+G+(Y[(T-20)%10]||Y[T]||Y[0])+"]"}},w=function(G,Y,T){var j=String(G);return!j||j.length>=Y?G:""+Array(Y+1-j.length).join(T)+G},E={s:w,z:function(G){var Y=-G.utcOffset(),T=Math.abs(Y),j=Math.floor(T/60),O=T%60;return(Y<=0?"+":"-")+w(j,2,"0")+":"+w(O,2,"0")},m:function G(Y,T){if(Y.date()<T.date())return-G(T,Y);var j=12*(T.year()-Y.year())+(T.month()-Y.month()),O=Y.clone().add(j,m),q=T-O<0,U=Y.clone().add(j+(q?-1:1),m);return+(-(j+(T-O)/(q?O-U:U-O))||0)},a:function(G){return G<0?Math.ceil(G)||0:Math.floor(G)},p:function(G){return{M:m,y:B,w:h,d:p,D:H,h:f,m:s,s:a,ms:o,Q:_}[G]||String(G||"").toLowerCase().replace(/s$/,"")},u:function(G){return G===void 0}},D="en",L={};L[D]=M;var N="$isDayjsObject",x=function(G){return G instanceof W||!(!G||!G[N])},$=function G(Y,T,j){var O;if(!Y)return D;if(typeof Y=="string"){var q=Y.toLowerCase();L[q]&&(O=q),T&&(L[q]=T,O=q);var U=Y.split("-");if(!O&&U.length>1)return G(U[0])}else{var K=Y.name;L[K]=Y,O=K}return!j&&O&&(D=O),O||!j&&D},P=function(G,Y){if(x(G))return G.clone();var T=typeof Y=="object"?Y:{};return T.date=G,T.args=arguments,new W(T)},b=E;b.l=$,b.i=x,b.w=function(G,Y){return P(G,{locale:Y.$L,utc:Y.$u,x:Y.$x,$offset:Y.$offset})};var W=(function(){function G(T){this.$L=$(T.locale,null,!0),this.parse(T),this.$x=this.$x||T.x||{},this[N]=!0}var Y=G.prototype;return Y.parse=function(T){this.$d=(function(j){var O=j.date,q=j.utc;if(O===null)return new Date(NaN);if(b.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var U=O.match(R);if(U){var K=U[2]-1||0,k=(U[7]||"0").substring(0,3);return q?new Date(Date.UTC(U[1],K,U[3]||1,U[4]||0,U[5]||0,U[6]||0,k)):new Date(U[1],K,U[3]||1,U[4]||0,U[5]||0,U[6]||0,k)}}return new Date(O)})(T),this.init()},Y.init=function(){var T=this.$d;this.$y=T.getFullYear(),this.$M=T.getMonth(),this.$D=T.getDate(),this.$W=T.getDay(),this.$H=T.getHours(),this.$m=T.getMinutes(),this.$s=T.getSeconds(),this.$ms=T.getMilliseconds()},Y.$utils=function(){return b},Y.isValid=function(){return this.$d.toString()!==F},Y.isSame=function(T,j){var O=P(T);return this.startOf(j)<=O&&O<=this.endOf(j)},Y.isAfter=function(T,j){return P(T)<this.startOf(j)},Y.isBefore=function(T,j){return this.endOf(j)<P(T)},Y.$g=function(T,j,O){return b.u(T)?this[j]:this.set(O,T)},Y.unix=function(){return Math.floor(this.valueOf()/1e3)},Y.valueOf=function(){return this.$d.getTime()},Y.startOf=function(T,j){var O=this,q=!!b.u(j)||j,U=b.p(T),K=function(c,y){var v=b.w(O.$u?Date.UTC(O.$y,y,c):new Date(O.$y,y,c),O);return q?v:v.endOf(p)},k=function(c,y){return b.w(O.toDate()[c].apply(O.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(y)),O)},A=this.$W,I=this.$M,ie=this.$D,ae="set"+(this.$u?"UTC":"");switch(U){case B:return q?K(1,0):K(31,11);case m:return q?K(1,I):K(0,I+1);case h:var d=this.$locale().weekStart||0,u=(A<d?A+7:A)-d;return K(q?ie-u:ie+(6-u),I);case p:case H:return k(ae+"Hours",0);case f:return k(ae+"Minutes",1);case s:return k(ae+"Seconds",2);case a:return k(ae+"Milliseconds",3);default:return this.clone()}},Y.endOf=function(T){return this.startOf(T,!1)},Y.$set=function(T,j){var O,q=b.p(T),U="set"+(this.$u?"UTC":""),K=(O={},O[p]=U+"Date",O[H]=U+"Date",O[m]=U+"Month",O[B]=U+"FullYear",O[f]=U+"Hours",O[s]=U+"Minutes",O[a]=U+"Seconds",O[o]=U+"Milliseconds",O)[q],k=q===p?this.$D+(j-this.$W):j;if(q===m||q===B){var A=this.clone().set(H,1);A.$d[K](k),A.init(),this.$d=A.set(H,Math.min(this.$D,A.daysInMonth())).$d}else K&&this.$d[K](k);return this.init(),this},Y.set=function(T,j){return this.clone().$set(T,j)},Y.get=function(T){return this[b.p(T)]()},Y.add=function(T,j){var O,q=this;T=Number(T);var U=b.p(j),K=function(I){var ie=P(q);return b.w(ie.date(ie.date()+Math.round(I*T)),q)};if(U===m)return this.set(m,this.$M+T);if(U===B)return this.set(B,this.$y+T);if(U===p)return K(1);if(U===h)return K(7);var k=(O={},O[s]=r,O[f]=i,O[a]=n,O)[U]||1,A=this.$d.getTime()+T*k;return b.w(A,this)},Y.subtract=function(T,j){return this.add(-1*T,j)},Y.format=function(T){var j=this,O=this.$locale();if(!this.isValid())return O.invalidDate||F;var q=T||"YYYY-MM-DDTHH:mm:ssZ",U=b.z(this),K=this.$H,k=this.$m,A=this.$M,I=O.weekdays,ie=O.months,ae=O.meridiem,d=function(y,v,C,X){return y&&(y[v]||y(j,q))||C[v].slice(0,X)},u=function(y){return b.s(K%12||12,y,"0")},c=ae||function(y,v,C){var X=y<12?"AM":"PM";return C?X.toLowerCase():X};return q.replace(S,(function(y,v){return v||(function(C){switch(C){case"YY":return String(j.$y).slice(-2);case"YYYY":return b.s(j.$y,4,"0");case"M":return A+1;case"MM":return b.s(A+1,2,"0");case"MMM":return d(O.monthsShort,A,ie,3);case"MMMM":return d(ie,A);case"D":return j.$D;case"DD":return b.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return d(O.weekdaysMin,j.$W,I,2);case"ddd":return d(O.weekdaysShort,j.$W,I,3);case"dddd":return I[j.$W];case"H":return String(K);case"HH":return b.s(K,2,"0");case"h":return u(1);case"hh":return u(2);case"a":return c(K,k,!0);case"A":return c(K,k,!1);case"m":return String(k);case"mm":return b.s(k,2,"0");case"s":return String(j.$s);case"ss":return b.s(j.$s,2,"0");case"SSS":return b.s(j.$ms,3,"0");case"Z":return U}return null})(y)||U.replace(":","")}))},Y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Y.diff=function(T,j,O){var q,U=this,K=b.p(j),k=P(T),A=(k.utcOffset()-this.utcOffset())*r,I=this-k,ie=function(){return b.m(U,k)};switch(K){case B:q=ie()/12;break;case m:q=ie();break;case _:q=ie()/3;break;case h:q=(I-A)/6048e5;break;case p:q=(I-A)/864e5;break;case f:q=I/i;break;case s:q=I/r;break;case a:q=I/n;break;default:q=I}return O?q:b.a(q)},Y.daysInMonth=function(){return this.endOf(m).$D},Y.$locale=function(){return L[this.$L]},Y.locale=function(T,j){if(!T)return this.$L;var O=this.clone(),q=$(T,j,!0);return q&&(O.$L=q),O},Y.clone=function(){return b.w(this.$d,this)},Y.toDate=function(){return new Date(this.valueOf())},Y.toJSON=function(){return this.isValid()?this.toISOString():null},Y.toISOString=function(){return this.$d.toISOString()},Y.toString=function(){return this.$d.toUTCString()},G})(),ue=W.prototype;return P.prototype=ue,[["$ms",o],["$s",a],["$m",s],["$H",f],["$W",p],["$M",m],["$y",B],["$D",H]].forEach((function(G){ue[G[1]]=function(Y){return this.$g(Y,G[0],G[1])}})),P.extend=function(G,Y){return G.$i||(G(Y,W,P),G.$i=!0),P},P.locale=$,P.isDayjs=x,P.unix=function(G){return P(1e3*G)},P.en=L[D],P.Ls=L,P.p={},P}))})(zn)),zn.exports}var du=pu();const Hn=uu(du),hu={class:"colBtns"},mu={key:0,class:"table-pagination"},yu={class:"left-pagination"},gu={class:"right-pagination"},Mo=_t(l.defineComponent({name:"UiFlowBaseGrid",inheritAttrs:!1,__name:"FlowGrid",props:{data:{default:()=>[]},tableLabel:{default:()=>[]},pageConfig:{default:()=>({currentPage:1,total:0,pageSize:20})},hidePage:{type:Boolean,default:!1},hideSelection:{type:Boolean,default:!1},hideNumber:{type:Boolean,default:!0},operation:{type:Boolean,default:!1},tableHeight:{default:"calc(100% - 45px)"},isFixed:{type:Boolean,default:!1},btnWidth:{default:0},size:{default:"default"}},emits:["page-change","size-change","row-click","row-dblclick"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=l.useSlots(),a=l.ref(),s=l.ref(),f=l.ref("100%"),p=l.ref(0),h=l.computed(()=>r.tableLabel.filter(N=>{var x;return!((x=N.hiddenCondition)!=null&&x.call(N,N))})),m=l.computed(()=>r.size==="medium"?"default":r.size);function _(N){return N<9?`0${N+1}`:N+1}function B(){var N;(N=s.value)==null||N.clearSelection()}function H(N,x){var $;($=s.value)==null||$.toggleRowSelection(N,x)}function F(){var N;(N=s.value)==null||N.toggleAllSelection()}function R(N){var x;(x=s.value)==null||x.setCurrentRow(N)}function S(N){i("page-change",N)}function M(N){i("size-change",N)}function w(){f.value=r.hidePage?"100%":"calc(100% - 45px)"}async function E(){var $;if(!r.operation||r.btnWidth)return;await l.nextTick();const N=(($=a.value)==null?void 0:$.querySelectorAll(".colBtns"))||[];let x=o.operation?120:0;N.forEach(P=>{x=Math.max(x,P.scrollWidth+40)}),p.value=x}function D(N,x,$){var P;r.hideSelection||(P=s.value)==null||P.toggleRowSelection(N),i("row-click",N,x,$)}function L(N,x,$){i("row-dblclick",N,x,$)}return l.watch(()=>[r.hidePage,r.data.length],()=>{w(),E()}),l.onMounted(()=>{window.addEventListener("resize",w),w(),E()}),l.onBeforeUnmount(()=>window.removeEventListener("resize",w)),t({tableRef:s,clearSelection:B,toggleRowSelection:H,toggleAllSelection:F,setCurrentRow:R,computeHeight:w}),(N,x)=>{const $=l.resolveComponent("el-table-column"),P=l.resolveComponent("el-table"),b=l.resolveComponent("el-pagination");return l.openBlock(),l.createElementBlock("div",{ref_key:"rootRef",ref:a,class:l.normalizeClass({"no-fixed":!e.isFixed}),style:l.normalizeStyle({height:e.tableHeight||"100%"})},[l.createVNode(P,l.mergeProps({ref_key:"tableRef",ref:s},N.$attrs,{"cell-style":{height:"50px"},data:e.data,"header-cell-style":{background:"#fafafa",color:"#45484B",height:"50px"},height:f.value,size:m.value,border:"","cell-class-name":"c-table-cell","current-row-key":"id","header-row-class-name":"c-table-header",onRowClick:D,onRowDblclick:L}),{default:l.withCtx(()=>[e.hideSelection?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock($,{key:0,align:"center",type:"selection",width:"40"})),e.hideNumber?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock($,{key:1,index:_,align:"center",label:"序号",type:"index",width:"55"})),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,W=>(l.openBlock(),l.createBlock($,{key:W.prop,formatter:W.formatter,label:W.label,"min-width":W.minWidth,prop:W.prop,"show-overflow-tooltip":W.showTooltip,sortable:W.sortable,width:W.width,align:"center"},null,8,["formatter","label","min-width","prop","show-overflow-tooltip","sortable","width"]))),128)),l.renderSlot(N.$slots,"default",{},void 0,!0),e.operation?(l.openBlock(),l.createBlock($,{key:2,fixed:e.isFixed?"right":!1,width:e.btnWidth||p.value||void 0,align:"center",label:"操作"},{default:l.withCtx(W=>[l.createElementVNode("div",hu,[l.renderSlot(N.$slots,"operation",{row:W.row},void 0,!0)])]),_:3},8,["fixed","width"])):l.createCommentVNode("",!0)]),_:3},16,["data","height","size"]),e.hidePage?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",mu,[l.createElementVNode("div",yu,[l.renderSlot(N.$slots,"pagination-left",{},void 0,!0)]),l.createElementVNode("div",gu,[l.createVNode(b,{"current-page":e.pageConfig.currentPage,"page-size":e.pageConfig.pageSize,"page-sizes":[10,20,30,40],total:e.pageConfig.total,background:"",layout:"total, sizes, prev, pager, next, jumper",onCurrentChange:S,onSizeChange:M},null,8,["current-page","page-size","total"])])]))],6)}}}),[["__scopeId","data-v-bf6383fa"]]),vu={executing:"审批中",completed:"已完成",deleted:"已删除",canceled:"已取消",withdrawed:"已撤回",recyled:"已回收",rollbacked:"已退回",jumped:"已跳转"},wu=[{label:"业务标题",prop:"businessName",minWidth:"180px"},{label:"当前环节",prop:"activityName",minWidth:"180px"},{label:"发送人",prop:"assigneesNames",minWidth:"150px"},{label:"发送时间",prop:"startTime",width:"180px",formatter:e=>e.startTime?Hn(e.startTime).format("YYYY-MM-DD HH:mm:ss"):""}],bu=[{label:"业务标题",prop:"title",minWidth:"180px"},{label:"当前环节",prop:"currentActivity",minWidth:"180px",formatter:e=>e.currentActivity||"无"},{label:"创建人",prop:"createUserName",minWidth:"150px"},{label:"创建时间",prop:"createdTime",width:"180px"}];function Eu(e){return{...e,workId:e.workId||e.id,processDefinitionId:e.processDefinitionId,processInstanceId:e.processInstanceId,activityId:e.activityId,activityName:e.activityName}}const _u=l.defineComponent({name:"UiFlowGrid",__name:"FlowList",props:{type:{},dealUserId:{default:""},appId:{default:""},appModuleId:{default:""}},emits:["onHandle","error"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=l.ref(),a=l.ref([]),s=l.ref(!1),f=l.reactive({currentPage:1,pageSize:20,total:0}),p=l.computed(()=>r.type==="draft"?bu:wu);function h(w){return vu[w]||w||""}function m(w,E){i("onHandle",{action:w,workData:Eu(E)})}function _(w){i("onHandle",{action:"view",workData:{...w,processDefinitionId:w.processDefinitionId,workId:w.id,workName:w.title}})}function B(w){return`${w}_${Hn().format("YYYYMMDDHHmmss")}`}function H(w){const E=B(w.name);i("onHandle",{action:"create",workData:{processDefinitionId:w.processDefinitionId,flowName:w.name,title:E,workName:E}})}function F(w){r.type==="todo"&&m("view",w),r.type==="done"&&m("handle",w)}function R(w){f.currentPage=w,M()}function S(w){f.pageSize=w,f.currentPage=1,M()}async function M(){s.value=!0;try{if(r.type==="todo"||r.type==="done"){const E=await(r.type==="todo"?Mr:Br)({currentPage:f.currentPage,pageSize:f.pageSize,assignee:r.dealUserId});a.value=E.data||[],f.total=Number(E.count||0)}else{const E=(await Dr(f,{appId:r.appId,appModuleId:r.appModuleId,createUserId:r.dealUserId})).data||{};a.value=E.records||[],f.total=Number(E.total||0)}}catch(w){throw i("error",w),w}finally{s.value=!1}}return l.watch(()=>[r.type,r.dealUserId,r.appId,r.appModuleId],()=>{f.currentPage=1,M()}),l.onMounted(M),t({data:a,loading:s,pageConfig:f,gridRef:o,loadTableData:M,onRowDblclick:F,create:H,buildDefaultBusinessTitle:B}),(w,E)=>{const D=l.resolveComponent("el-table-column"),L=l.resolveComponent("el-button");return l.openBlock(),l.createBlock(Mo,{ref_key:"gridRef",ref:o,data:a.value,"hide-number":!1,"hide-selection":!0,"is-fixed":!0,"page-config":f,"table-label":p.value,operation:"","table-height":"100%",onPageChange:R,onRowDblclick:F,onSizeChange:S},{operation:l.withCtx(({row:N})=>[e.type==="todo"?(l.openBlock(),l.createBlock(L,{key:0,link:"",type:"primary",onClick:l.withModifiers(x=>m("view",N),["stop"])},{default:l.withCtx(()=>[...E[0]||(E[0]=[l.createTextVNode(" 办理 ",-1)])]),_:1},8,["onClick"])):e.type==="done"?(l.openBlock(),l.createBlock(L,{key:1,link:"",type:"primary",onClick:l.withModifiers(x=>m("handle",N),["stop"])},{default:l.withCtx(()=>[...E[1]||(E[1]=[l.createTextVNode(" 查看 ",-1)])]),_:1},8,["onClick"])):e.type==="draft"&&N.state==="audit"?(l.openBlock(),l.createBlock(L,{key:2,link:"",type:"primary",onClick:l.withModifiers(x=>_(N),["stop"])},{default:l.withCtx(()=>[...E[2]||(E[2]=[l.createTextVNode(" 查看 ",-1)])]),_:1},8,["onClick"])):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[e.type==="done"||e.type==="draft"?(l.openBlock(),l.createBlock(D,{key:0,align:"center",label:"状态",width:"120"},{default:l.withCtx(({row:N})=>[l.createTextVNode(l.toDisplayString(e.type==="done"?h(N.stateName):N.stateLabel),1)]),_:1})):l.createCommentVNode("",!0)]),_:1},8,["data","page-config","table-label"])}}}),xu={class:"ui-flow-jump"},Su={class:"dialog-footer"},Au=_t(l.defineComponent({name:"UiFlowJump",__name:"FlowJump",props:{processDefinitionId:{},workId:{default:""},processInstanceId:{default:""},dealUser:{default:()=>({})},modelValue:{type:Boolean,default:!1},showTrigger:{type:Boolean,default:!0},dialogTitle:{default:"跳转"},dialogWidth:{default:"960px"}},emits:["update:modelValue","click","open","close","beforeJump","afterJump","error"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=l.ref(!1),a=l.ref(!1),s=l.ref(!1),f=l.ref(!1),p=l.ref([]),h=l.ref([]),m=l.ref(""),_=l.ref(""),B=l.computed(()=>String(r.dealUser.userId||r.dealUser.id||"")),H=l.computed(()=>String(r.dealUser.name||B.value)),F={children:"children",label:"label",value:"value",disabled:"disabled",isLeaf:T=>T.hasChild===!1};function R(T){return T?String(T.id||T.activityId||""):""}function S(T){return T?String(T.activityName||T.name||T.id||T.activityId||""):""}function M(T){return T.map(j=>{const O=j||{},q=String(O.id||O.userId||""),U=String(O.ntype||"user"),K=Array.isArray(O.childs)?O.childs:Array.isArray(O.children)?O.children:void 0;return{...O,id:q,value:q,label:String(O.caption||O.name||O.id||O.userId||""),caption:String(O.caption||O.name||O.id||O.userId||""),ntype:U,hasChild:!!(O.hasChild||K!=null&&K.length),disabled:U!=="user",children:K?M(K):void 0}}).filter(j=>j.id)}function w(){return B.value?[{id:B.value,value:B.value,label:H.value,caption:H.value,name:H.value,ntype:"user",hasChild:!1,disabled:!1}]:[]}async function E(){s.value=!0;try{const T=await Kr({processDefinitionId:r.processDefinitionId});return p.value=Array.isArray(T.data)?T.data:[],p.value}catch(T){throw p.value=[],i("error",T),T}finally{s.value=!1}}async function D(T="",j){const O=await Un({processDefinitionId:r.processDefinitionId,activityId:m.value,ntype:j,parentId:T});return M(Array.isArray(O.data)?O.data:[])}async function L(){if(h.value=[],_.value="",!m.value)return[];f.value=!0;try{const T=await D();h.value=T.length?T:w()}catch{h.value=w()}finally{f.value=!1}return h.value.length===1&&h.value[0].ntype==="user"&&(_.value=h.value[0].id),h.value}async function N(T,j){if(T.level===0){j(h.value);return}if(T.data.hasChild===!1||T.data.ntype==="user"){j([]);return}if(Array.isArray(T.data.children)&&T.data.children.length){j(T.data.children);return}try{const O=await D(String(T.data.id),String(T.data.ntype||""));j(O)}catch(O){i("error",O),j([])}}async function x(){await L()}function $(T,j){const O=T?R(T):m.value,q=String(j||_.value||B.value);return{workId:r.workId,flowNodeAssignee:{activityId:O,assignees:[{name:q,userId:q}]},variables:{}}}async function P(T){const j=T||$();i("beforeJump",j),a.value=!0;try{const O=await Yr(j);return i("afterJump",O),O}catch(O){throw i("error",O),O}finally{a.value=!1}}async function b(){if(!r.workId){ht.ElMessage.warning("当前任务缺少 workId,无法执行跳转");return}if(!m.value){ht.ElMessage.warning("请选择开始节点");return}if(!_.value){ht.ElMessage.warning("请选择办理人");return}try{await P(),o.value=!1,ht.ElMessage.success("跳转任务成功")}catch{}}async function W(){o.value=!0,m.value="",_.value="",h.value=[],i("open");try{await E()}catch{}}function ue(){o.value=!1}function G(){i("close")}function Y(){i("click"),W()}return l.watch(()=>r.modelValue,T=>{T&&!o.value&&W(),!T&&o.value&&(o.value=!1)}),l.watch(o,T=>i("update:modelValue",T)),l.watch(()=>r.processDefinitionId,()=>{m.value="",_.value="",h.value=[],E().catch(()=>{})}),l.watch(B,()=>{o.value&&m.value&&L()}),l.onMounted(()=>{r.modelValue?W():E().catch(()=>{})}),t({visible:o,loading:a,nodeLoading:s,assigneeLoading:f,startNodeList:p,selectedActivityId:m,selectedAssigneeId:_,open:W,close:ue,getStartNodes:E,assembleData:$,jump:P}),(T,j)=>{const O=l.resolveComponent("el-button"),q=l.resolveComponent("el-option"),U=l.resolveComponent("el-select"),K=l.resolveComponent("el-form-item"),k=l.resolveComponent("el-tree-select"),A=l.resolveComponent("el-form"),I=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",xu,[e.showTrigger?(l.openBlock(),l.createBlock(O,{key:0,type:"primary",loading:a.value,onClick:Y},{default:l.withCtx(()=>[l.renderSlot(T.$slots,"default",{},()=>[j[3]||(j[3]=l.createTextVNode("跳转",-1))],!0)]),_:3},8,["loading"])):l.createCommentVNode("",!0),l.createVNode(I,{modelValue:o.value,"onUpdate:modelValue":j[2]||(j[2]=ie=>o.value=ie),"append-to-body":"",class:"ui-flow-jump-dialog","close-on-click-modal":!1,title:e.dialogTitle,width:e.dialogWidth,onClosed:G},{footer:l.withCtx(()=>[l.createElementVNode("div",Su,[l.createVNode(O,{type:"primary",loading:a.value,onClick:b},{default:l.withCtx(()=>[...j[4]||(j[4]=[l.createTextVNode("确认",-1)])]),_:1},8,["loading"]),l.createVNode(O,{disabled:a.value,onClick:ue},{default:l.withCtx(()=>[...j[5]||(j[5]=[l.createTextVNode("取消",-1)])]),_:1},8,["disabled"])])]),default:l.withCtx(()=>[l.createVNode(A,{class:"jump-form","label-width":"108px"},{default:l.withCtx(()=>[l.createVNode(K,{label:"开始节点",required:""},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:m.value,"onUpdate:modelValue":j[0]||(j[0]=ie=>m.value=ie),clearable:"",filterable:"",loading:s.value,placeholder:"请选择",style:{width:"100%"},onChange:x},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p.value,ie=>(l.openBlock(),l.createBlock(q,{key:R(ie),label:S(ie),value:R(ie)},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1}),l.createVNode(K,{label:"办理人",required:""},{default:l.withCtx(()=>[l.createVNode(k,{modelValue:_.value,"onUpdate:modelValue":j[1]||(j[1]=ie=>_.value=ie),"check-strictly":"",clearable:"",data:h.value,disabled:!m.value,load:N,loading:f.value,props:F,lazy:"","node-key":"id",placeholder:"请选择","render-after-expand":!1,style:{width:"100%"}},null,8,["modelValue","data","disabled","loading"])]),_:1})]),_:1})]),_:1},8,["modelValue","title","width"])])}}}),[["__scopeId","data-v-93e9b256"]]),Cu={class:"ui-flow-send"},ku={class:"send-panel"},Ru={class:"current-activity"},Tu={class:"node-groups"},Pu=["onClick"],Nu={class:"send-center"},Ou={class:"assignee-transfer"},Du={class:"assignee-box"},Mu={class:"tree-node"},Bu={key:1,class:"candidate-list"},Iu={class:"assignee-box selected-list"},Lu={key:0,class:"node-state"},Fu={class:"variable-toolbar"},Vu={class:"opinion-panel"},$u={class:"dialog-footer"},ju=_t(l.defineComponent({name:"UiFlowSend",__name:"FlowSend",props:{processDefinitionId:{},activity:{},workId:{},processInstanceId:{default:""},variables:{default:()=>({})},dealUser:{default:()=>({})},bpmnXml:{default:""},showTrigger:{type:Boolean,default:!0},dialogTitle:{default:"发送"},dialogWidth:{default:"1200px"},defaultOpinion:{default:""},modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","click","open","close","nextNodesResolved","beforeSend","afterSend","error"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=l.ref(!1),a=l.ref(!1),s=l.ref(!1),f=l.ref(!1),p=l.ref(!1),h=l.ref([]),m=l.ref([]),_=l.ref([]),B=l.ref([]),H=l.ref([]),F=l.ref(!1),R=l.ref(""),S=l.ref("nextNode"),M=l.ref(""),w=l.ref([]),E=l.ref(!1),D=l.ref(0),L=l.ref(),N=[{label:"Boolean",value:"boolean"},{label:"Short",value:"short"},{label:"Integer",value:"integer"},{label:"Long",value:"long"},{label:"Double",value:"double"},{label:"String",value:"string"},{label:"Date",value:"date"}],x={children:"childs",label:"caption",isLeaf:z=>z.hasChild===!1},$=l.computed(()=>String(r.dealUser.userId||r.dealUser.id||"")),P=l.computed(()=>m.value.find(z=>b(z)===R.value));function b(z){return z?String(z.id||z.activityId||""):""}function W(z){return`${z.activity}:${z.id}`}function ue(z){return typeof z=="boolean"?"boolean":typeof z=="number"?Number.isInteger(z)?"integer":"double":z instanceof Date?"date":"string"}function G(){w.value=Object.entries(r.variables).map(([z,V])=>({variableName:z,variableType:ue(V),variableValue:V})),E.value=!1}function Y(){return w.value.reduce((z,V)=>(V.variableName&&(z[V.variableName]=V.variableValue),z),{})}function T(){R.value="",h.value=[],m.value=[],_.value=[],B.value=[],H.value=[],F.value=!1}function j(z){if(!r.bpmnXml||!z||typeof DOMParser>"u")return;const V=new DOMParser().parseFromString(r.bpmnXml,"text/xml");return Array.from(V.getElementsByTagName("*")).find(te=>te.getAttribute("id")===z)}function O(z){const V=j(z);if(!V)return!0;if(Array.from(V.children||[]).some(ke=>ke.localName==="multiInstanceLoopCharacteristics"))return!1;const ce=["assigneUser","candidateUser"],ge=Array.from(V.getElementsByTagName("*")).filter(ke=>ke.localName==="properties"&&ce.includes(ke.getAttribute("type")||"")).flatMap(ke=>Array.from(ke.getElementsByTagName("*")).filter(me=>me.localName==="property"));if(ge.some(ke=>{const me=ke.getAttribute("assignType");return!!(me&&me!=="user")}))return!1;const De=ge.map(ke=>ke.getAttribute("value")).filter(Boolean),qe=V.getAttribute("camunda:assignee")||"";return qe&&!qe.includes("${")&&De.push(...qe.split(",").filter(Boolean)),new Set(De).size<=1}function q(z){var V;return((V=m.value.find(te=>b(te)===z))==null?void 0:V.isSingleAssignee)!==!1}function U(z,V){const te=b(V),ce=String(V.activityName||V.name||te);return z.map(ge=>{const De=ge||{};return{...De,id:String(De.id||""),caption:String(De.caption||De.name||De.id||""),ntype:String(De.ntype||"user"),hasChild:De.hasChild,activity:te,activityName:ce,disabled:De.ntype!=="user",childs:Array.isArray(De.childs)?U(De.childs,V):void 0}})}async function K(z,V){p.value=!0;try{const te=await Un({processDefinitionId:r.processDefinitionId,activityId:b(z),userId:$.value,...V?{parentId:V}:{}}),ce=U(Array.isArray(te.data)?te.data:[],z);return V?ce:R.value!==b(z)?[]:(F.value=ce.some(ge=>["router","organ"].includes(ge.ntype||"")),F.value?(B.value=ce,_.value=[],await l.nextTick(),u(ce)):(B.value=[],_.value=ce),ce)}catch(te){throw i("error",te),te}finally{p.value=!1}}async function k(z,V){if(z.level===0){V(B.value);return}if(z.data.hasChild===!1||!P.value){V([]);return}if(Array.isArray(z.data.childs)&&z.data.childs.length){V(z.data.childs),await l.nextTick(),u(z.data.childs);return}try{const te=await K(P.value,String(z.data.id));V(te),await l.nextTick(),u(te)}catch{V([])}}async function A(z=Y()){const V=++D.value;s.value=!0,f.value=!1,T();try{const te=await qr({processDefinitionId:r.processDefinitionId,activityId:r.activity.activityId,processInstanceId:r.processInstanceId,workId:r.workId,variables:z});if(V!==D.value)return[];h.value=te.data||[],m.value=h.value.filter(ge=>ge.flowElementType==="USER_TASK").map(ge=>({...ge,isSingleAssignee:O(b(ge))})),f.value=!0,E.value=!1,i("nextNodesResolved",h.value);const ce=m.value[0];if(ce){R.value=b(ce);try{await K(ce)}catch{}}return h.value}catch(te){throw V===D.value&&(f.value=!1),i("error",te),te}finally{V===D.value&&(s.value=!1)}}async function I(z){R.value=b(z),_.value=[],B.value=[],F.value=!1;try{await K(z)}catch{}}function ie(z){return H.value.some(V=>W(V)===W(z))}function ae(z,V){const te=W(z);V?(q(z.activity)&&(H.value=H.value.filter(ce=>ce.activity!==z.activity)),H.value.some(ce=>W(ce)===te)||H.value.push({...z})):H.value=H.value.filter(ce=>W(ce)!==te)}function d(z,V){z.ntype==="user"&&(V&&q(z.activity)&&H.value.filter(ce=>ce.activity===z.activity).forEach(ce=>{var ge;return(ge=L.value)==null?void 0:ge.setChecked(ce.id,!1,!1)}),ae(z,V))}function u(z){z.forEach(V=>{var te,ce;V.ntype==="user"&&ie(V)&&((te=L.value)==null||te.setChecked(V.id,!0,!1)),(ce=V.childs)!=null&&ce.length&&u(V.childs)})}function c(z){var V;H.value=H.value.filter(te=>W(te)!==W(z)),F.value&&((V=L.value)==null||V.setChecked(z.id,!1,!1))}function y(){E.value=!0}function v(){w.value.push({variableName:"",variableType:"string",variableValue:""}),y()}function C(z){w.value.splice(z,1),y()}function X(z){z.variableValue="",y()}function se(z,V){return z===""||z===null||z===void 0?null:V==="boolean"?String(z).toLowerCase()==="true":["short","integer","long"].includes(V)?Number.parseInt(String(z),10):V==="double"?Number.parseFloat(String(z)):z}function fe(z){z.variableValue=se(z.variableValue,z.variableType),y()}async function Q(){S.value="nextNode";try{await A(Y())}catch{}}function pe(){const z=H.value.reduce((V,te)=>{let ce=V.get(te.activity);return ce||(ce={activityId:te.activity,assignees:[]},V.set(te.activity,ce)),ce.assignees.some(ge=>ge.userId===te.id)||ce.assignees.push({name:te.id,userId:te.id}),V},new Map);return{workId:r.workId,flowNodeAssignees:Array.from(z.values()),variables:Y(),opinion:M.value}}async function be(z){const V=z||pe();i("beforeSend",V),a.value=!0;try{const te=await Wr(V);return i("afterSend",te),te}catch(te){throw i("error",te),te}finally{a.value=!1}}async function Ce(){if(s.value){ht.ElMessage.warning("正在计算下一环节,请稍后再发送");return}if(E.value||!f.value){S.value="variables",ht.ElMessage.warning("流程变量已变化,请重新计算下一环节");return}const z=m.value.find(V=>!H.value.some(te=>te.activity===b(V)));if(z){R.value=b(z),S.value="nextNode",ht.ElMessage.warning(`请选择“${z.activityName||z.name||b(z)}”的办理人`),await I(z);return}try{await be(),o.value=!1,ht.ElMessage.success("发送成功")}catch{}}async function Pe(){o.value=!0,M.value=r.defaultOpinion,S.value="nextNode",G(),i("open");try{await A(Y())}catch{}}function we(){o.value=!1}function Ee(){i("close")}function ze(){i("click"),Pe()}return l.watch(()=>r.modelValue,z=>{z&&!o.value&&Pe(),!z&&o.value&&(o.value=!1)}),l.watch(o,z=>i("update:modelValue",z)),l.onMounted(()=>{r.modelValue&&Pe()}),t({visible:o,loading:a,nodeLoading:s,nodeResolved:f,nextNodes:h,open:Pe,close:we,getNextNode:A,assembleData:pe,send:be}),(z,V)=>{const te=l.resolveComponent("el-button"),ce=l.resolveComponent("el-empty"),ge=l.resolveComponent("el-tree"),De=l.resolveComponent("el-checkbox"),qe=l.resolveComponent("el-table-column"),ke=l.resolveComponent("el-table"),me=l.resolveComponent("el-tab-pane"),ve=l.resolveComponent("el-input"),Vm=l.resolveComponent("el-option"),$m=l.resolveComponent("el-select"),jm=l.resolveComponent("el-date-picker"),Um=l.resolveComponent("el-tabs"),zm=l.resolveComponent("el-dialog"),Hm=l.resolveDirective("loading");return l.openBlock(),l.createElementBlock("div",Cu,[e.showTrigger?(l.openBlock(),l.createBlock(te,{key:0,type:"primary",loading:a.value,onClick:ze},{default:l.withCtx(()=>[l.renderSlot(z.$slots,"default",{},()=>[V[3]||(V[3]=l.createTextVNode("发送",-1))],!0)]),_:3},8,["loading"])):l.createCommentVNode("",!0),l.createVNode(zm,{modelValue:o.value,"onUpdate:modelValue":V[2]||(V[2]=le=>o.value=le),"append-to-body":"",class:"ui-flow-send-dialog","close-on-click-modal":!1,title:e.dialogTitle,width:e.dialogWidth,onClosed:Ee},{footer:l.withCtx(()=>[l.createElementVNode("div",$u,[l.createVNode(te,{type:"primary",loading:a.value,onClick:Ce},{default:l.withCtx(()=>[...V[13]||(V[13]=[l.createTextVNode("确认",-1)])]),_:1},8,["loading"]),l.createVNode(te,{disabled:a.value,onClick:we},{default:l.withCtx(()=>[...V[14]||(V[14]=[l.createTextVNode("取消",-1)])]),_:1},8,["disabled"])])]),default:l.withCtx(()=>[l.createElementVNode("div",ku,[l.createElementVNode("div",Ru,[V[4]||(V[4]=l.createTextVNode(" 当前环节:",-1)),l.createElementVNode("strong",null,l.toDisplayString(e.activity.activityName||e.activity.activityId),1)]),l.createElementVNode("aside",Tu,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m.value,le=>(l.openBlock(),l.createElementBlock("button",{key:b(le),class:l.normalizeClass(["node-group",{active:R.value===b(le)}]),type:"button",onClick:Be=>I(le)},[V[5]||(V[5]=l.createElementVNode("span",{class:"group-avatar"},"♟",-1)),l.createElementVNode("span",null,l.toDisplayString(le.activityName||le.name||b(le)),1)],10,Pu))),128)),f.value&&!m.value.length?(l.openBlock(),l.createBlock(ce,{key:0,description:"没有下一用户任务","image-size":44})):l.createCommentVNode("",!0)]),l.createElementVNode("section",Nu,[l.createElementVNode("div",Ou,[l.withDirectives((l.openBlock(),l.createElementBlock("div",Du,[F.value?(l.openBlock(),l.createBlock(ge,{key:0,ref_key:"assigneeTreeRef",ref:L,class:"assignee-tree",data:B.value,load:k,props:x,"check-on-click-node":"","check-strictly":"",lazy:"","node-key":"id","show-checkbox":"",onCheckChange:d},{default:l.withCtx(({data:le})=>[l.createElementVNode("span",Mu,[l.createElementVNode("span",null,l.toDisplayString(le.ntype==="user"?"●":"▣"),1),l.createElementVNode("span",null,l.toDisplayString(le.caption||le.id),1)])]),_:1},8,["data"])):(l.openBlock(),l.createElementBlock("div",Bu,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,le=>(l.openBlock(),l.createBlock(De,{key:W(le),"model-value":ie(le),class:"candidate-item",onChange:Be=>ae(le,!!Be)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(le.caption||le.name||le.id),1)]),_:2},1032,["model-value","onChange"]))),128)),!p.value&&!_.value.length?(l.openBlock(),l.createBlock(ce,{key:0,description:"暂无可选办理人","image-size":44})):l.createCommentVNode("",!0)]))])),[[Hm,p.value]]),V[7]||(V[7]=l.createElementVNode("div",{class:"transfer-arrows","aria-hidden":"true"},[l.createElementVNode("span",null,"→"),l.createElementVNode("span",null,"←")],-1)),l.createElementVNode("div",Iu,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(H.value,le=>(l.openBlock(),l.createElementBlock("div",{key:W(le),class:"selected-user"},[l.createElementVNode("span",null,l.toDisplayString(le.caption||le.name||le.id),1),l.createVNode(te,{link:"",type:"danger",onClick:Be=>c(le)},{default:l.withCtx(()=>[...V[6]||(V[6]=[l.createTextVNode("移除",-1)])]),_:1},8,["onClick"])]))),128)),H.value.length?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(ce,{key:0,description:"暂未选择办理人","image-size":44}))])]),l.createVNode(Um,{modelValue:S.value,"onUpdate:modelValue":V[0]||(V[0]=le=>S.value=le),type:"card",class:"send-tabs"},{default:l.withCtx(()=>[l.createVNode(me,{label:"下一环节",name:"nextNode"},{default:l.withCtx(()=>[s.value?(l.openBlock(),l.createElementBlock("div",Lu,"正在根据流程变量计算下一环节...")):(l.openBlock(),l.createBlock(ke,{key:1,data:H.value,border:"",height:"190"},{empty:l.withCtx(()=>[l.createElementVNode("span",null,l.toDisplayString(m.value.length?"请选择办理人":"暂无数据"),1)]),default:l.withCtx(()=>[l.createVNode(qe,{prop:"activityName",label:"办理环节","min-width":"150"}),l.createVNode(qe,{prop:"caption",label:"办理人","min-width":"130"},{default:l.withCtx(({row:le})=>[l.createTextVNode(l.toDisplayString(le.caption||le.name||le.id),1)]),_:1}),l.createVNode(qe,{label:"办理方式",width:"120"},{default:l.withCtx(({row:le})=>[l.createTextVNode(l.toDisplayString(q(le.activity)?"单人单办":"多人办理"),1)]),_:1}),l.createVNode(qe,{label:"操作",width:"90",align:"center"},{default:l.withCtx(({row:le})=>[l.createVNode(te,{link:"",type:"danger",onClick:Be=>c(le)},{default:l.withCtx(()=>[...V[8]||(V[8]=[l.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"]))]),_:1}),l.createVNode(me,{label:"输入变量",name:"variables"},{default:l.withCtx(()=>[l.createElementVNode("div",Fu,[l.createVNode(te,{type:"primary",plain:"",onClick:v},{default:l.withCtx(()=>[...V[9]||(V[9]=[l.createTextVNode("新增变量",-1)])]),_:1}),l.createVNode(te,{loading:s.value,onClick:Q},{default:l.withCtx(()=>[...V[10]||(V[10]=[l.createTextVNode(" 重新计算下一环节 ",-1)])]),_:1},8,["loading"])]),l.createVNode(ke,{data:w.value,border:"",height:"190"},{default:l.withCtx(()=>[l.createVNode(qe,{label:"变量名称","min-width":"150"},{default:l.withCtx(({row:le})=>[l.createVNode(ve,{modelValue:le.variableName,"onUpdate:modelValue":Be=>le.variableName=Be,onInput:y},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(qe,{label:"变量类型",width:"140"},{default:l.withCtx(({row:le})=>[l.createVNode($m,{modelValue:le.variableType,"onUpdate:modelValue":Be=>le.variableType=Be,onChange:Be=>X(le)},{default:l.withCtx(()=>[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(N,Be=>l.createVNode(Vm,{key:Be.value,label:Be.label,value:Be.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),l.createVNode(qe,{label:"变量值","min-width":"180"},{default:l.withCtx(({row:le})=>[le.variableType==="date"?(l.openBlock(),l.createBlock(jm,{key:0,modelValue:le.variableValue,"onUpdate:modelValue":Be=>le.variableValue=Be,style:{width:"100%"},type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss",onChange:y},null,8,["modelValue","onUpdate:modelValue"])):(l.openBlock(),l.createBlock(ve,{key:1,modelValue:le.variableValue,"onUpdate:modelValue":Be=>le.variableValue=Be,onBlur:Be=>fe(le),onInput:y},null,8,["modelValue","onUpdate:modelValue","onBlur"]))]),_:1}),l.createVNode(qe,{label:"操作",width:"90",align:"center"},{default:l.withCtx(({$index:le})=>[l.createVNode(te,{link:"",type:"danger",onClick:Be=>C(le)},{default:l.withCtx(()=>[...V[11]||(V[11]=[l.createTextVNode("删除",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])]),l.createElementVNode("aside",Vu,[V[12]||(V[12]=l.createElementVNode("label",null,"填写意见:",-1)),l.createVNode(ve,{modelValue:M.value,"onUpdate:modelValue":V[1]||(V[1]=le=>M.value=le),maxlength:"500",placeholder:"请输入意见",resize:"none","show-word-limit":"",type:"textarea"},null,8,["modelValue"])])])]),_:1},8,["modelValue","title","width"])])}}}),[["__scopeId","data-v-0300169e"]]);function at(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}const vn=Object.prototype.toString,Uu=Object.prototype.hasOwnProperty;function Gr(e){return e===void 0}function en(e){return e!==void 0}function Bo(e){return e==null}function tt(e){return vn.call(e)==="[object Array]"}function xt(e){return vn.call(e)==="[object Object]"}function St(e){return vn.call(e)==="[object Number]"}function $t(e){const t=vn.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function st(e){return vn.call(e)==="[object String]"}function tn(e,t){return!Bo(e)&&Uu.call(e,t)}function ot(e,t){const n=Xr(t);let r;return ee(e,function(i,o){if(n(i,o))return r=i,!1}),r}function zu(e,t){const n=Xr(t);let r=tt(e)?-1:void 0;return ee(e,function(i,o){if(n(i,o))return r=o,!1}),r}function nn(e,t){const n=Xr(t);let r=[];return ee(e,function(i,o){n(i,o)&&r.push(i)}),r}function ee(e,t){let n,r;if(Gr(e))return;const i=tt(e)?qu:Wu;for(let o in e)if(tn(e,o)&&(n=e[o],r=t(n,i(o)),r===!1))return n}function rn(e,t,n){return ee(e,function(r,i){n=t(n,r,i)}),n}function Io(e,t){return!!rn(e,function(n,r,i){return n&&t(r,i)},!0)}function Lo(e,t){return!!ot(e,t)}function Hu(e,t){let n=[];return ee(e,function(r,i){n.push(t(r,i))}),n}function Fo(e){return function(t){return Io(e,function(n,r){return t[r]===n})}}function Xr(e){return $t(e)?e:t=>t===e}function Wu(e){return e}function qu(e){return Number(e)}function Vo(e,t){let n,r,i,o;function a(m){let _=Date.now(),B=m?0:o+t-_;if(B>0)return s(B);e.apply(i,r),f()}function s(m){n=setTimeout(a,m)}function f(){n&&clearTimeout(n),n=o=r=i=void 0}function p(){n&&a(!0),f()}function h(...m){o=Date.now(),r=m,i=this,n||s(t)}return h.flush=p,h.cancel=f,h}function At(e,t){return e.bind(t)}function ne(e,...t){return Object.assign(e,...t)}function Yu(e,t,n){let r=e;return ee(t,function(i,o){if(typeof i!="number"&&typeof i!="string")throw new Error("illegal key type: "+typeof i+". Key should be of type number or string.");if(i==="constructor")throw new Error("illegal key: constructor");if(i==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=r[i];en(a)&&Bo(s)&&(s=r[i]=isNaN(+a)?{}:[]),Gr(a)?Gr(n)?delete r[i]:r[i]=n:r=s}),e}function Ku(e,t){let n={},r=Object(e);return ee(t,function(i){i in r&&(n[i]=e[i])}),n}function Gu(e,t){let n={},r=Object(e);return ee(r,function(i,o){t.indexOf(o)===-1&&(n[o]=i)}),n}var Xu=1e3;function yt(e,t){var n=this;t=t||Xu,e.on(["render.shape","render.connection"],t,function(r,i){var o=r.type,a=i.element,s=i.gfx,f=i.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,f):n.drawConnection(s,a,f)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,i){if(n.canRender(i))return r.type==="render.getShapePath"?n.getShapePath(i):n.getConnectionPath(i)})}yt.prototype.canRender=function(e){},yt.prototype.drawShape=function(e,t){},yt.prototype.drawConnection=function(e,t){},yt.prototype.getShapePath=function(e){},yt.prototype.getConnectionPath=function(e){};function re(e,t){var n=Se(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function Ju(e,t){return Lo(t,function(n){return re(e,n)})}function Se(e){return e&&e.businessObject||e}function jt(e){return e&&e.di}function Ut(e,t){return re(e,"bpmn:CallActivity")?!1:re(e,"bpmn:SubProcess")?(t=t||jt(e),t&&re(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):re(e,"bpmn:Participant")?!!Se(e).processRef:!0}function $o(e){if(!(!re(e,"bpmn:Participant")&&!re(e,"bpmn:Lane"))){var t=jt(e).isHorizontal;return t===void 0?!0:t}}function Zu(e){return e&&!!Se(e).triggeredByEvent}function Qu(e){return xt(e)&&tn(e,"waypoints")}function ef(e){return xt(e)&&tn(e,"labelTarget")}var wn={width:90,height:20},jo=15;function tf(e){return re(e,"bpmn:Event")||re(e,"bpmn:Gateway")||re(e,"bpmn:DataStoreReference")||re(e,"bpmn:DataObjectReference")||re(e,"bpmn:DataInput")||re(e,"bpmn:DataOutput")||re(e,"bpmn:SequenceFlow")||re(e,"bpmn:MessageFlow")||re(e,"bpmn:Group")}function nf(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],i=rf(e),o=Math.atan((r.y-n.y)/(r.x-n.x)),a=i.x,s=i.y;return Math.abs(o)<Math.PI/2?s-=jo:a+=jo,{x:a,y:s}}function rf(e){var t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)];return{x:n.x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2}}function of(e){return e.waypoints?nf(e.waypoints):re(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+wn.height/2}:{x:e.x+e.width/2,y:e.y+e.height+wn.height/2}}function af(e,t){var n,r,i,o=e.label;return o&&o.bounds?(i=o.bounds,r={width:Math.max(wn.width,i.width),height:i.height},n={x:i.x+i.width/2,y:i.y+i.height/2}):(n=of(t),r=wn),ne({x:n.x-r.width/2,y:n.y-r.height/2},r)}function sf(e){if(re(e,"bpmn:FlowElement")||re(e,"bpmn:Participant")||re(e,"bpmn:Lane")||re(e,"bpmn:SequenceFlow")||re(e,"bpmn:MessageFlow")||re(e,"bpmn:DataInput")||re(e,"bpmn:DataOutput"))return"name";if(re(e,"bpmn:TextAnnotation"))return"text";if(re(e,"bpmn:Group"))return"categoryValueRef"}function lf(e){var t=e.categoryValueRef;return t&&t.value||""}function Wn(e){var t=e.businessObject,n=sf(t);if(n)return n==="categoryValueRef"?lf(t):t[n]||""}function bn(e,t){t=!!t,tt(e)||(e=[e]);var n,r,i,o;return ee(e,function(a){var s=a;a.waypoints&&!t&&(s=bn(a.waypoints,!0));var f=s.x,p=s.y,h=s.height||0,m=s.width||0;(f<n||n===void 0)&&(n=f),(p<r||r===void 0)&&(r=p),(f+m>i||i===void 0)&&(i=f+m),(p+h>o||o===void 0)&&(o=p+h)}),{x:n,y:r,height:o-r,width:i-n}}function Uo(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function zo(e){return!!(e&&e.isFrame)}var Ho=7;function cf(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function uf(e,t){return t.appendChild(cf(e,t))}function Ie(e,t){return uf(t,e),e}var Jr=2,Wo={"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":Jr,"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":Jr,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function ff(e,t){return Wo[t]?e.style[t]:e.getAttributeNS(null,t)}function qo(e,t,n){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=Wo[r];i?(i===Jr&&typeof n=="number"&&(n=String(n)+"px"),e.style[r]=n):e.setAttributeNS(null,t,n)}function pf(e,t){var n=Object.keys(t),r,i;for(r=0,i;i=n[r];r++)qo(e,i,t[i])}function Re(e,t,n){if(typeof t=="string")if(n!==void 0)qo(e,t,n);else return ff(e,t);else pf(e,t);return e}const df=Object.prototype.toString;function lt(e){return new Ct(e)}function Ct(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Ct.prototype.add=function(e){return this.list.add(e),this},Ct.prototype.remove=function(e){return df.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Ct.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Ct.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Ct.prototype.array=function(){return Array.from(this.list)},Ct.prototype.has=Ct.prototype.contains=function(e){return this.list.contains(e)};var Zr={svg:"http://www.w3.org/2000/svg"},Yo='<svg xmlns="'+Zr.svg+'"';function hf(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Zr.svg)===-1&&(e=Yo+e.substring(4)):(e=Yo+">"+e+"</svg>",t=!0);var n=mf(e);if(!t)return n;for(var r=document.createDocumentFragment(),i=n.firstChild;i.firstChild;)r.appendChild(i.firstChild);return r}function mf(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function Ae(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=hf(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Zr.svg,e),t&&Re(n,t),n}var Qr=null;function Ko(){return Qr===null&&(Qr=Ae("svg")),Qr}function Go(e,t){var n,r,i=Object.keys(t);for(n=0;r=i[n];n++)e[r]=t[r];return e}function yf(e,t,n,r,i,o){var a=Ko().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return Go(a,e);case 6:return Go(a,{a:e,b:t,c:n,d:r,e:i,f:o})}}function En(e){return Ko().createSVGTransform()}var Xo=/([&<>]{1})/g,gf=/([&<>\n\r"]{1})/g,vf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function ei(e,t){function n(r,i){return vf[i]||i}return e.replace(t,n)}function Jo(e,t){var n,r,i,o,a;switch(e.nodeType){case 3:t.push(ei(e.textContent,Xo));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(i=e.attributes,n=0,r=i.length;n<r;++n)o=i.item(n),t.push(" ",o.name,'="',ei(o.value,gf),'"');if(e.hasChildNodes()){for(t.push(">"),a=e.childNodes,n=0,r=a.length;n<r;++n)Jo(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",ei(e.nodeValue,Xo),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function wf(e){for(var t=e.firstChild,n=[];t;)Jo(t,n),t=t.nextSibling;return n.join("")}function Zo(e,t){return wf(e)}function qn(e){var t=e.parentNode;return t&&t.removeChild(e),e}function bf(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Ef(e,t){var n,r;for(e.clear(),n=0;r=t[n];n++)e.appendItem(bf(e,r))}function _n(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),Ef(n,t)),n.consolidate()}function zt(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function _f(e){return["M",e.x,e.y]}function ti(e){return["L",e.x,e.y]}function xf(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function Sf(e,t){const n=e.length,r=[_f(e[0])];for(let i=1;i<n;i++){const o=e[i-1],a=e[i],s=e[i+1];if(!s||!t){r.push(ti(a));continue}const f=Math.min(t,ni(a.x-o.x,a.y-o.y),ni(s.x-a.x,s.y-a.y));if(!f){r.push(ti(a));continue}const p=Yn(a,o,f),h=Yn(a,o,f*.5),m=Yn(a,s,f),_=Yn(a,s,f*.5);r.push(ti(p)),r.push(xf(h,_,m))}return r}function Yn(e,t,n){const r=t.x-e.x,i=t.y-e.y,o=ni(r,i),a=n/o;return{x:e.x+r*a,y:e.y+i*a}}function ni(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ri(e,t,n){St(t)&&(n=t,t=null),t||(t={});const r=Ae("path",t);return St(n)&&(r.dataset.cornerRadius=String(n)),Qo(r,e)}function Qo(e,t){const n=parseInt(e.dataset.cornerRadius,10)||0;return Re(e,{d:zt(Sf(t,n))}),e}var ii="hsl(225, 10%, 15%)",Af="white";function ct(e,t){return Lo(e.eventDefinitions,function(n){return n.$type===t})}function Cf(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function kf(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function de(e,t,n){var r=jt(e);return n||r.get("color:background-color")||r.get("bioc:fill")||t||Af}function J(e,t,n){var r=jt(e);return n||r.get("color:border-color")||r.get("bioc:stroke")||t||ii}function xn(e,t,n,r){var i=jt(e),o=i.get("label");return r||o&&o.get("color:color")||t||J(e,n)}function Rf(e){var t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2,i=[["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]];return zt(i)}function ea(e,t){var n=e.x,r=e.y,i=e.width,o=e.height,a=[["M",n+t,r],["l",i-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-i,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-o],["a",t,t,0,0,1,t,-t],["z"]];return zt(a)}function Tf(e){var t=e.width,n=e.height,r=e.x,i=e.y,o=t/2,a=n/2,s=[["M",r+o,i],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return zt(s)}function Pf(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=[["M",t,n],["l",r,0],["l",0,i],["l",-r,0],["z"]];return zt(o)}function Sn(e,t={}){return{width:nt(e,t),height:Ke(e,t)}}function nt(e,t={}){return tn(t,"width")?t.width:e.width}function Ke(e,t={}){return tn(t,"height")?t.height:e.height}const Oe={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};Oe.td=Oe.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Oe.option=Oe.optgroup=[1,'<select multiple="multiple">',"</select>"],Oe.thead=Oe.tbody=Oe.colgroup=Oe.caption=Oe.tfoot=[1,"<table>","</table>"],Oe.polyline=Oe.ellipse=Oe.polygon=Oe.circle=Oe.text=Oe.line=Oe.path=Oe.rect=Oe.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function ut(e,t=globalThis.document){var p;if(typeof e!="string")throw new TypeError("String expected");const n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);const r=(p=/<([\w:]+)/.exec(e))==null?void 0:p[1];if(!r)return t.createTextNode(e);if(e=e.trim(),r==="body"){const h=t.createElement("html");h.innerHTML=e;const{lastChild:m}=h;return m.remove(),m}let[i,o,a]=Object.hasOwn(Oe,r)?Oe[r]:Oe._default,s=t.createElement("div");for(s.innerHTML=o+e+a;i--;)s=s.lastChild;if(s.firstChild===s.lastChild){const{firstChild:h}=s;return h.remove(),h}const f=t.createDocumentFragment();return f.append(...s.childNodes),f}function Nf(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function Xe(e,...t){const n=e.style;return ee(t,function(r){r&&ee(r,function(i,o){n[o]=i})}),e}function ta(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}const Of=Object.prototype.toString;function Ht(e){return new kt(e)}function kt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}kt.prototype.add=function(e){return this.list.add(e),this},kt.prototype.remove=function(e){return Of.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},kt.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},kt.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},kt.prototype.array=function(){return Array.from(this.list)},kt.prototype.has=kt.prototype.contains=function(e){return this.list.contains(e)};function na(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function ra(e,t,n){var r=n?e:e.parentNode;return r&&typeof r.closest=="function"&&r.closest(t)||null}function Df(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kn={},ia;function Mf(){if(ia)return Kn;ia=1;var e,t,n;function r(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n=e!=="addEventListener"?"on":""}return Kn.bind=function(i,o,a,s){return e||r(),i[e](n+o,a,s||!1),a},Kn.unbind=function(i,o,a,s){return t||r(),i[t](n+o,a,s||!1),a},Kn}var oa=Mf(),Bf=Df(oa),Rt=Nf({__proto__:null,default:Bf},[oa]),aa=["focus","blur"];function If(e,t,n,r,i){return aa.indexOf(n)!==-1&&(i=!0),Rt.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=ra(a,t,!0),o.delegateTarget&&r.call(e,o)},i)}function Lf(e,t,n,r){return aa.indexOf(t)!==-1&&(r=!0),Rt.unbind(e,t,n,r)}var oi={bind:If,unbind:Lf};function gt(e,t){return t=t||document,t.querySelector(e)}function Ff(e,t){return t=t||document,t.querySelectorAll(e)}function Gn(e){e.parentNode&&e.parentNode.removeChild(e)}function ai(e,t,n,r,i){var o=En();o.setTranslate(t,n);var a=En();a.setRotate(r||0,0,0);var s=En();s.setScale(1,1),_n(e,[o,a,s])}function sa(e,t,n){var r=En();r.setTranslate(t,n),_n(e,r)}function Vf(e,t){var n=En();n.setRotate(t,0,0),_n(e,n)}function $f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var si={exports:{}},la;function jf(){if(la)return si.exports;la=1;var e=si.exports=function(t,n){if(n||(n=16),t===void 0&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(n),i=2;r===1/0;i*=2)r=Math.log(Math.pow(2,t/i))/Math.log(n)*i;for(var o=r-Math.floor(r),a="",i=0;i<Math.floor(r);i++){var s=Math.floor(Math.random()*n).toString(n);a=s+a}if(o){var f=Math.pow(n,o),s=Math.floor(Math.random()*f).toString(n);a=s+a}var p=parseInt(a,n);return p!==1/0&&p>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,r){var i=function(a){var s=0;do{if(s++>10)if(r)t+=r;else throw new Error("too many ID collisions, use more bits");var f=e(t,n)}while(Object.hasOwnProperty.call(o,f));return o[f]=a,f},o=i.hats={};return i.get=function(a){return i.hats[a]},i.set=function(a,s){return i.hats[a]=s,i},i.bits=t||128,i.base=n||16,i},si.exports}var Uf=jf(),zf=$f(Uf);function vt(e){if(!(this instanceof vt))return new vt(e);e=e||[128,36,1],this._seed=e.length?zf.rack(e[0],e[1],e[2]):e}vt.prototype.next=function(e){return this._seed(e||!0)},vt.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},vt.prototype.claim=function(e,t){this._seed.set(e,t||!0)},vt.prototype.assigned=function(e){return this._seed.get(e)||!1},vt.prototype.unclaim=function(e){delete this._seed.hats[e]},vt.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};var Hf=new vt,Wf=10,Xn=3,qf=1.5,Jn=10,Yf=4,on=.95,Kf=1,Gf=.25;function Wt(e,t,n,r,i,o,a){yt.call(this,t,a);var s=e&&e.defaultFillColor,f=e&&e.defaultStrokeColor,p=e&&e.defaultLabelColor;function h(d){return n.computeStyle(d,{strokeLinecap:"round",strokeLinejoin:"round",stroke:ii,strokeWidth:2,fill:"white"})}function m(d){return n.computeStyle(d,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:ii,strokeWidth:2})}function _(d,u){var{ref:c={x:0,y:0},scale:y=1,element:v,parentGfx:C=i._svg}=u,X=Ae("marker",{id:d,viewBox:"0 0 20 20",refX:c.x,refY:c.y,markerWidth:20*y,markerHeight:20*y,orient:"auto"});Ie(X,v);var se=gt(":scope > defs",C);se||(se=Ae("defs"),Ie(C,se)),Ie(se,X)}function B(d,u,c,y){var v=Hf.nextPrefixed("marker-");return H(d,v,u,c,y),"url(#"+v+")"}function H(d,u,c,y,v){if(c==="sequenceflow-end"){var C=Ae("path",{d:"M 1 5 L 11 10 L 1 15 Z",...h({fill:v,stroke:v,strokeWidth:1})});_(u,{element:C,ref:{x:11,y:10},scale:.5,parentGfx:d})}if(c==="messageflow-start"){var X=Ae("circle",{cx:6,cy:6,r:3.5,...h({fill:y,stroke:v,strokeWidth:1,strokeDasharray:[1e4,1]})});_(u,{element:X,ref:{x:6,y:6},parentGfx:d})}if(c==="messageflow-end"){var se=Ae("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...h({fill:y,stroke:v,strokeWidth:1,strokeDasharray:[1e4,1]})});_(u,{element:se,ref:{x:8.5,y:5},parentGfx:d})}if(c==="association-start"){var fe=Ae("path",{d:"M 11 5 L 1 10 L 11 15",...m({fill:"none",stroke:v,strokeWidth:1.5,strokeDasharray:[1e4,1]})});_(u,{element:fe,ref:{x:1,y:10},scale:.5,parentGfx:d})}if(c==="association-end"){var Q=Ae("path",{d:"M 1 5 L 11 10 L 1 15",...m({fill:"none",stroke:v,strokeWidth:1.5,strokeDasharray:[1e4,1]})});_(u,{element:Q,ref:{x:11,y:10},scale:.5,parentGfx:d})}if(c==="conditional-flow-marker"){var pe=Ae("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...h({fill:y,stroke:v})});_(u,{element:pe,ref:{x:-1,y:10},scale:.5,parentGfx:d})}if(c==="conditional-default-flow-marker"){var be=Ae("path",{d:"M 6 4 L 10 16",...h({stroke:v,fill:"none"})});_(u,{element:be,ref:{x:0,y:10},scale:.5,parentGfx:d})}}function F(d,u,c,y,v={}){xt(y)&&(v=y,y=0),y=y||0,v=h(v);var C=u/2,X=c/2,se=Ae("circle",{cx:C,cy:X,r:Math.round((u+c)/4-y),...v});return Ie(d,se),se}function R(d,u,c,y,v,C){xt(v)&&(C=v,v=0),v=v||0,C=h(C);var X=Ae("rect",{x:v,y:v,width:u-v*2,height:c-v*2,rx:y,ry:y,...C});return Ie(d,X),X}function S(d,u,c,y){var v=u/2,C=c/2,X=[{x:v,y:0},{x:u,y:C},{x:v,y:c},{x:0,y:C}],se=X.map(function(Q){return Q.x+","+Q.y}).join(" ");y=h(y);var fe=Ae("polygon",{...y,points:se});return Ie(d,fe),fe}function M(d,u,c,y){c=m(c);var v=ri(u,c,y);return Ie(d,v),v}function w(d,u,c){return M(d,u,c,5)}function E(d,u,c){c=m(c);var y=Ae("path",{...c,d:u});return Ie(d,y),y}function D(d,u,c,y){return E(u,c,ne({"data-marker":d},y))}function L(d){return ae[d]}function N(d){return function(u,c,y){return L(d)(u,c,y)}}var x={"bpmn:MessageEventDefinition":function(d,u,c={},y){var v=r.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:c.width||u.width,containerHeight:c.height||u.height,position:{mx:.235,my:.315}}),C=y?J(u,f,c.stroke):de(u,s,c.fill),X=y?de(u,s,c.fill):J(u,f,c.stroke),se=E(d,v,{fill:C,stroke:X,strokeWidth:1});return se},"bpmn:TimerEventDefinition":function(d,u,c={}){var y=c.width||u.width,v=c.height||u.height,C=c.width?1:2,X=F(d,y,v,.2*v,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:C}),se=r.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:y,containerHeight:v,position:{mx:.5,my:.5}});E(d,se,{stroke:J(u,f,c.stroke),strokeWidth:C});for(var fe=0;fe<12;fe++){var Q=r.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:y,containerHeight:v,position:{mx:.5,my:.5}}),pe=y/2,be=v/2;E(d,Q,{strokeWidth:1,stroke:J(u,f,c.stroke),transform:"rotate("+fe*30+","+be+","+pe+")"})}return X},"bpmn:EscalationEventDefinition":function(d,u,c={},y){var v=r.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:c.width||u.width,containerHeight:c.height||u.height,position:{mx:.5,my:.2}}),C=y?J(u,f,c.stroke):de(u,s,c.fill);return E(d,v,{fill:C,stroke:J(u,f,c.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(d,u,c={}){var y=r.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:c.width||u.width,containerHeight:c.height||u.height,position:{mx:.5,my:.222}});return E(d,y,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(d,u,c={},y){var v=r.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width,containerHeight:u.height,position:{mx:.57,my:.263}}),C=y?J(u,f,c.stroke):de(u,s,c.fill);return E(d,v,{fill:C,stroke:J(u,f,c.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(d,u,c={},y){var v=r.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:c.width||u.width,containerHeight:c.height||u.height,position:{mx:.2,my:.722}}),C=y?J(u,f,c.stroke):de(u,s,c.fill);return E(d,v,{fill:C,stroke:J(u,f,c.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(d,u,c={},y){var v=r.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width,containerHeight:u.height,position:{mx:.638,my:-.055}}),C=y?J(u,f,c.stroke):"none",X=E(d,v,{fill:C,stroke:J(u,f,c.stroke),strokeWidth:1});return Vf(X,45),X},"bpmn:CompensateEventDefinition":function(d,u,c={},y){var v=r.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:c.width||u.width,containerHeight:c.height||u.height,position:{mx:.22,my:.5}}),C=y?J(u,f,c.stroke):de(u,s,c.fill);return E(d,v,{fill:C,stroke:J(u,f,c.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(d,u,c={},y){var v=r.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:c.width||u.width,containerHeight:c.height||u.height,position:{mx:.5,my:.2}}),C=y?J(u,f,c.stroke):de(u,s,c.fill);return E(d,v,{strokeWidth:1,fill:C,stroke:J(u,f,c.stroke)})},"bpmn:MultipleEventDefinition":function(d,u,c={},y){var v=r.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:c.width||u.width,containerHeight:c.height||u.height,position:{mx:.211,my:.36}}),C=y?J(u,f,c.stroke):de(u,s,c.fill);return E(d,v,{fill:C,stroke:J(u,f,c.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(d,u,c={}){var y=r.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:c.width||u.width,containerHeight:c.height||u.height,position:{mx:.458,my:.194}});return E(d,y,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(d,u,c={}){var y=F(d,u.width,u.height,8,{fill:J(u,f,c.stroke),stroke:J(u,f,c.stroke),strokeWidth:4});return y}};function $(d,u,c={},y){var v=Se(d),C=Cf(v),X=y||d;return v.get("eventDefinitions")&&v.get("eventDefinitions").length>1?v.get("parallelMultiple")?x["bpmn:ParallelMultipleEventDefinition"](u,X,c,C):x["bpmn:MultipleEventDefinition"](u,X,c,C):ct(v,"bpmn:MessageEventDefinition")?x["bpmn:MessageEventDefinition"](u,X,c,C):ct(v,"bpmn:TimerEventDefinition")?x["bpmn:TimerEventDefinition"](u,X,c,C):ct(v,"bpmn:ConditionalEventDefinition")?x["bpmn:ConditionalEventDefinition"](u,X,c,C):ct(v,"bpmn:SignalEventDefinition")?x["bpmn:SignalEventDefinition"](u,X,c,C):ct(v,"bpmn:EscalationEventDefinition")?x["bpmn:EscalationEventDefinition"](u,X,c,C):ct(v,"bpmn:LinkEventDefinition")?x["bpmn:LinkEventDefinition"](u,X,c,C):ct(v,"bpmn:ErrorEventDefinition")?x["bpmn:ErrorEventDefinition"](u,X,c,C):ct(v,"bpmn:CancelEventDefinition")?x["bpmn:CancelEventDefinition"](u,X,c,C):ct(v,"bpmn:CompensateEventDefinition")?x["bpmn:CompensateEventDefinition"](u,X,c,C):ct(v,"bpmn:TerminateEventDefinition")?x["bpmn:TerminateEventDefinition"](u,X,c,C):null}var P={ParticipantMultiplicityMarker:function(d,u,c={}){var y=nt(u,c),v=Ke(u,c),C=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:y,containerHeight:v,position:{mx:(y/2-6)/y,my:(v-15)/v}});D("participant-multiplicity",d,C,{strokeWidth:2,fill:de(u,s,c.fill),stroke:J(u,f,c.stroke)})},SubProcessMarker:function(d,u,c={}){var y=R(d,14,14,0,{strokeWidth:1,fill:de(u,s,c.fill),stroke:J(u,f,c.stroke)});sa(y,u.width/2-7.5,u.height-20);var v=r.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:u.width,containerHeight:u.height,position:{mx:(u.width/2-7.5)/u.width,my:(u.height-20)/u.height}});D("sub-process",d,v,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke)})},ParallelMarker:function(d,u,c){var y=nt(u,c),v=Ke(u,c),C=r.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:y,containerHeight:v,position:{mx:(y/2+c.parallel)/y,my:(v-20)/v}});D("parallel",d,C,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke)})},SequentialMarker:function(d,u,c){var y=r.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width,containerHeight:u.height,position:{mx:(u.width/2+c.seq)/u.width,my:(u.height-19)/u.height}});D("sequential",d,y,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke)})},CompensationMarker:function(d,u,c){var y=r.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width,containerHeight:u.height,position:{mx:(u.width/2+c.compensation)/u.width,my:(u.height-13)/u.height}});D("compensation",d,y,{strokeWidth:1,fill:de(u,s,c.fill),stroke:J(u,f,c.stroke)})},LoopMarker:function(d,u,c){var y=nt(u,c),v=Ke(u,c),C=r.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:y,containerHeight:v,position:{mx:(y/2+c.loop)/y,my:(v-7)/v}});D("loop",d,C,{strokeWidth:1.5,fill:"none",stroke:J(u,f,c.stroke),strokeMiterlimit:.5})},AdhocMarker:function(d,u,c){var y=nt(u,c),v=Ke(u,c),C=r.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:y,containerHeight:v,position:{mx:(y/2+c.adhoc)/y,my:(v-15)/v}});D("adhoc",d,C,{strokeWidth:1,fill:J(u,f,c.stroke),stroke:J(u,f,c.stroke)})}};function b(d,u,c,y){P[d](u,c,y)}function W(d,u,c=[],y={}){y={fill:y.fill,stroke:y.stroke,width:nt(u,y),height:Ke(u,y)};var v=Se(u),C=c.includes("SubProcessMarker");C?y={...y,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:y={...y,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},v.get("isForCompensation")&&c.push("CompensationMarker"),re(v,"bpmn:AdHocSubProcess")&&(c.push("AdhocMarker"),C||ne(y,{compensation:y.compensation-18}));var X=v.get("loopCharacteristics"),se=X&&X.get("isSequential");X&&(ne(y,{compensation:y.compensation-18}),c.includes("AdhocMarker")&&ne(y,{seq:-23,loop:-18,parallel:-24}),se===void 0&&c.push("LoopMarker"),se===!1&&c.push("ParallelMarker"),se===!0&&c.push("SequentialMarker")),c.includes("CompensationMarker")&&c.length===1&&ne(y,{compensation:-8}),ee(c,function(fe){b(fe,d,u,y)})}function ue(d,u,c={}){c=ne({size:{width:100}},c);var y=o.createText(u||"",c);return lt(y).add("djs-label"),Ie(d,y),y}function G(d,u,c,y={}){var v=Se(u),C=Sn({x:u.x,y:u.y,width:u.width,height:u.height},y);return ue(d,v.name,{align:c,box:C,padding:7,style:{fill:xn(u,p,f,y.stroke)}})}function Y(d,u,c={}){var y={width:u.width,height:u.height,x:u.width/2+u.x,y:u.height/2+u.y};return ue(d,Wn(u),{box:y,style:ne({},o.getExternalStyle(),{fill:xn(u,p,f,c.stroke)})})}function T(d,u,c,y={}){var v=$o(c),C=ue(d,u,{box:{height:30,width:v?Ke(c,y):nt(c,y)},align:"center-middle",style:{fill:xn(c,p,f,y.stroke)}});if(v){var X=-1*Ke(c,y);ai(C,0,-X,270)}}function j(d,u,c={}){var{width:y,height:v}=Sn(u,c);return R(d,y,v,Jn,{...c,fill:de(u,s,c.fill),fillOpacity:on,stroke:J(u,f,c.stroke)})}function O(d,u,c={}){var y=Se(u),v=de(u,s,c.fill),C=J(u,f,c.stroke);return(y.get("associationDirection")==="One"||y.get("associationDirection")==="Both")&&(c.markerEnd=B(d,"association-end",v,C)),y.get("associationDirection")==="Both"&&(c.markerStart=B(d,"association-start",v,C)),c=ye(c,["markerStart","markerEnd"]),w(d,u.waypoints,{...c,stroke:C,strokeDasharray:"0, 5"})}function q(d,u,c={}){var y=de(u,s,c.fill),v=J(u,f,c.stroke),C=r.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width,containerHeight:u.height,position:{mx:.474,my:.296}}),X=E(d,C,{fill:y,fillOpacity:on,stroke:v}),se=Se(u);if(kf(se)){var fe=r.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width,containerHeight:u.height,position:{mx:.33,my:(u.height-18)/u.height}});E(d,fe,{strokeWidth:2,fill:y,stroke:v})}return X}function U(d,u,c={}){return F(d,u.width,u.height,{fillOpacity:on,...c,fill:de(u,s,c.fill),stroke:J(u,f,c.stroke)})}function K(d,u,c={}){return S(d,u.width,u.height,{fill:de(u,s,c.fill),fillOpacity:on,stroke:J(u,f,c.stroke)})}function k(d,u,c={}){var y=R(d,nt(u,c),Ke(u,c),0,{fill:de(u,s,c.fill),fillOpacity:c.fillOpacity||on,stroke:J(u,f,c.stroke),strokeWidth:1.5}),v=Se(u);if(re(v,"bpmn:Lane")){var C=v.get("name");T(d,C,u,c)}return y}function A(d,u,c={}){var y=j(d,u,c),v=Ut(u);if(Zu(u)&&(Re(y,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!v)){var C=Se(u).flowElements||[],X=C.filter(se=>re(se,"bpmn:StartEvent"));X.length===1&&I(X[0],d,c,u)}return G(d,u,v?"center-top":"center-middle",c),v?W(d,u,void 0,c):W(d,u,["SubProcessMarker"],c),y}function I(d,u,c,y){var v=22,C={fill:de(y,s,c.fill),stroke:J(y,f,c.stroke),width:v,height:v},X=Se(d).isInterrupting,se=X?0:3,fe=X?1:1.2,Q=20,pe=(v-Q)/2,be="translate("+pe+","+pe+")";F(u,Q,Q,{fill:C.fill,stroke:C.stroke,strokeWidth:fe,strokeDasharray:se,transform:be}),$(d,u,C,y)}function ie(d,u,c={}){var y=j(d,u,c);return G(d,u,"center-middle",c),W(d,u,void 0,c),y}var ae=this.handlers={"bpmn:AdHocSubProcess":function(d,u,c={}){return Ut(u)?c=ye(c,["fill","stroke","width","height"]):c=ye(c,["fill","stroke"]),A(d,u,c)},"bpmn:Association":function(d,u,c={}){return c=ye(c,["fill","stroke"]),O(d,u,c)},"bpmn:BoundaryEvent":function(d,u,c={}){var{renderIcon:y=!0}=c;c=ye(c,["fill","stroke"]);var v=Se(u),C=v.get("cancelActivity");c={strokeWidth:1.5,fill:de(u,s,c.fill),fillOpacity:Kf,stroke:J(u,f,c.stroke)},C||(c.strokeDasharray="6");var X=U(d,u,c);return F(d,u.width,u.height,Xn,{...c,fill:"none"}),y&&$(u,d,c),X},"bpmn:BusinessRuleTask":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=ie(d,u,c),v=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),C=E(d,v);Re(C,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:1});var X=r.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),se=E(d,X);return Re(se,{fill:J(u,f,c.stroke),stroke:J(u,f,c.stroke),strokeWidth:1}),y},"bpmn:CallActivity":function(d,u,c={}){return c=ye(c,["fill","stroke"]),A(d,u,{strokeWidth:5,...c})},"bpmn:ComplexGateway":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=K(d,u,c),v=r.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:u.width,containerHeight:u.height,position:{mx:.46,my:.26}});return E(d,v,{fill:J(u,f,c.stroke),stroke:J(u,f,c.stroke),strokeWidth:1}),y},"bpmn:DataInput":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=r.getRawPath("DATA_ARROW"),v=q(d,u,c);return E(d,y,{fill:"none",stroke:J(u,f,c.stroke),strokeWidth:1}),v},"bpmn:DataInputAssociation":function(d,u,c={}){return c=ye(c,["fill","stroke"]),O(d,u,{...c,markerEnd:B(d,"association-end",de(u,s,c.fill),J(u,f,c.stroke))})},"bpmn:DataObject":function(d,u,c={}){return c=ye(c,["fill","stroke"]),q(d,u,c)},"bpmn:DataObjectReference":N("bpmn:DataObject"),"bpmn:DataOutput":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=r.getRawPath("DATA_ARROW"),v=q(d,u,c);return E(d,y,{strokeWidth:1,fill:J(u,f,c.stroke),stroke:J(u,f,c.stroke)}),v},"bpmn:DataOutputAssociation":function(d,u,c={}){return c=ye(c,["fill","stroke"]),O(d,u,{...c,markerEnd:B(d,"association-end",de(u,s,c.fill),J(u,f,c.stroke))})},"bpmn:DataStoreReference":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=r.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:u.width,containerHeight:u.height,position:{mx:0,my:.133}});return E(d,y,{fill:de(u,s,c.fill),fillOpacity:on,stroke:J(u,f,c.stroke),strokeWidth:2})},"bpmn:EndEvent":function(d,u,c={}){var{renderIcon:y=!0}=c;c=ye(c,["fill","stroke"]);var v=U(d,u,{...c,strokeWidth:4});return y&&$(u,d,c),v},"bpmn:EventBasedGateway":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=Se(u),v=K(d,u,c);F(d,u.width,u.height,u.height*.2,{fill:de(u,"none",c.fill),stroke:J(u,f,c.stroke),strokeWidth:1});var C=y.get("eventGatewayType"),X=!!y.get("instantiate");function se(){var Q=r.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:u.width,containerHeight:u.height,position:{mx:.36,my:.44}});E(d,Q,{fill:"none",stroke:J(u,f,c.stroke),strokeWidth:2})}if(C==="Parallel"){var fe=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:u.width,containerHeight:u.height,position:{mx:.474,my:.296}});E(d,fe,{fill:"none",stroke:J(u,f,c.stroke),strokeWidth:1})}else C==="Exclusive"&&(X||F(d,u.width,u.height,u.height*.26,{fill:"none",stroke:J(u,f,c.stroke),strokeWidth:1}),se());return v},"bpmn:ExclusiveGateway":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=K(d,u,c),v=r.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:u.width,containerHeight:u.height,position:{mx:.32,my:.3}}),C=jt(u);return C.get("isMarkerVisible")&&E(d,v,{fill:J(u,f,c.stroke),stroke:J(u,f,c.stroke),strokeWidth:1}),y},"bpmn:Gateway":function(d,u,c={}){return c=ye(c,["fill","stroke"]),K(d,u,c)},"bpmn:Group":function(d,u,c={}){return c=ye(c,["fill","stroke","width","height"]),R(d,u.width,u.height,Jn,{stroke:J(u,f,c.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:nt(u,c),height:Ke(u,c)})},"bpmn:InclusiveGateway":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=K(d,u,c);return F(d,u.width,u.height,u.height*.24,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:2.5}),y},"bpmn:IntermediateEvent":function(d,u,c={}){var{renderIcon:y=!0}=c;c=ye(c,["fill","stroke"]);var v=U(d,u,{...c,strokeWidth:1.5});return F(d,u.width,u.height,Xn,{fill:"none",stroke:J(u,f,c.stroke),strokeWidth:1.5}),y&&$(u,d,c),v},"bpmn:IntermediateCatchEvent":N("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":N("bpmn:IntermediateEvent"),"bpmn:Lane":function(d,u,c={}){return c=ye(c,["fill","stroke","width","height"]),k(d,u,{...c,fillOpacity:Gf})},"bpmn:ManualTask":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=ie(d,u,c),v=r.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return E(d,v,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:.5}),y},"bpmn:MessageFlow":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=Se(u),v=jt(u),C=de(u,s,c.fill),X=J(u,f,c.stroke),se=w(d,u.waypoints,{markerEnd:B(d,"messageflow-end",C,X),markerStart:B(d,"messageflow-start",C,X),stroke:X,strokeDasharray:"10, 11",strokeWidth:1.5});if(y.get("messageRef")){var fe=se.getPointAtLength(se.getTotalLength()/2),Q=r.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:fe.x,y:fe.y}}),pe={strokeWidth:1};v.get("messageVisibleKind")==="initiating"?(pe.fill=C,pe.stroke=X):(pe.fill=X,pe.stroke=C);var be=E(d,Q,pe),Ce=y.get("messageRef"),Pe=Ce.get("name"),we=ue(d,Pe,{align:"center-top",fitBox:!0,style:{fill:X}}),Ee=be.getBBox(),ze=we.getBBox(),z=fe.x-ze.width/2,V=fe.y+Ee.height/2+Wf;ai(we,z,V,0)}return se},"bpmn:ParallelGateway":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=K(d,u,c),v=r.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:u.width,containerHeight:u.height,position:{mx:.46,my:.2}});return E(d,v,{fill:J(u,f,c.stroke),stroke:J(u,f,c.stroke),strokeWidth:1}),y},"bpmn:Participant":function(d,u,c={}){c=ye(c,["fill","stroke","width","height"]);var y=k(d,u,c),v=Ut(u),C=$o(u),X=Se(u),se=X.get("name");if(v){var fe=C?[{x:30,y:0},{x:30,y:Ke(u,c)}]:[{x:0,y:30},{x:nt(u,c),y:30}];M(d,fe,{stroke:J(u,f,c.stroke),strokeWidth:qf}),T(d,se,u,c)}else{var Q=Sn(u,c);C||(Q.height=nt(u,c),Q.width=Ke(u,c));var pe=ue(d,se,{box:Q,align:"center-middle",style:{fill:xn(u,p,f,c.stroke)}});if(!C){var be=-1*Ke(u,c);ai(pe,0,-be,270)}}return X.get("participantMultiplicity")&&b("ParticipantMultiplicityMarker",d,u,c),y},"bpmn:ReceiveTask":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=Se(u),v=ie(d,u,c),C;return y.get("instantiate")?(F(d,28,28,20*.22,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:1}),C=r.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):C=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),E(d,C,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:1}),v},"bpmn:ScriptTask":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=ie(d,u,c),v=r.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return E(d,v,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:1}),y},"bpmn:SendTask":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=ie(d,u,c),v=r.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return E(d,v,{fill:J(u,f,c.stroke),stroke:de(u,s,c.fill),strokeWidth:1}),y},"bpmn:SequenceFlow":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=de(u,s,c.fill),v=J(u,f,c.stroke),C=w(d,u.waypoints,{markerEnd:B(d,"sequenceflow-end",y,v),stroke:v}),X=Se(u),{source:se}=u;if(se){var fe=Se(se);X.get("conditionExpression")&&re(fe,"bpmn:Activity")&&Re(C,{markerStart:B(d,"conditional-flow-marker",y,v)}),fe.get("default")&&(re(fe,"bpmn:Gateway")||re(fe,"bpmn:Activity"))&&fe.get("default")===X&&Re(C,{markerStart:B(d,"conditional-default-flow-marker",y,v)})}return C},"bpmn:ServiceTask":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=ie(d,u,c);F(d,10,10,{fill:de(u,s,c.fill),stroke:"none",transform:"translate(6, 6)"});var v=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});E(d,v,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:1}),F(d,10,10,{fill:de(u,s,c.fill),stroke:"none",transform:"translate(11, 10)"});var C=r.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return E(d,C,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:1}),y},"bpmn:StartEvent":function(d,u,c={}){var{renderIcon:y=!0}=c;c=ye(c,["fill","stroke"]);var v=Se(u);v.get("isInterrupting")||(c={...c,strokeDasharray:"6"});var C=U(d,u,c);return y&&$(u,d,c),C},"bpmn:SubProcess":function(d,u,c={}){return Ut(u)?c=ye(c,["fill","stroke","width","height"]):c=ye(c,["fill","stroke"]),A(d,u,c)},"bpmn:Task":function(d,u,c={}){return c=ye(c,["fill","stroke"]),ie(d,u,c)},"bpmn:TextAnnotation":function(d,u,c={}){c=ye(c,["fill","stroke"]);var{width:y,height:v}=Sn(u,c),C=R(d,y,v,0,0,{fill:"none",stroke:"none"}),X=r.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:y,containerHeight:v,position:{mx:0,my:0}});E(d,X,{stroke:J(u,f,c.stroke)});var se=Se(u),fe=se.get("text")||"";return ue(d,fe,{align:"left-top",box:Sn(u,c),padding:Ho,style:{fill:xn(u,p,f,c.stroke)}}),C},"bpmn:Transaction":function(d,u,c={}){Ut(u)?c=ye(c,["fill","stroke","width","height"]):c=ye(c,["fill","stroke"]);var y=A(d,u,{strokeWidth:1.5,...c}),v=n.style(["no-fill","no-events"],{stroke:J(u,f,c.stroke),strokeWidth:1.5}),C=Ut(u);return C||(c={}),R(d,nt(u,c),Ke(u,c),Jn-Xn,Xn,v),y},"bpmn:UserTask":function(d,u,c={}){c=ye(c,["fill","stroke"]);var y=ie(d,u,c),v=15,C=12,X=r.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:v,y:C}});E(d,X,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:.5});var se=r.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:v,y:C}});E(d,se,{fill:de(u,s,c.fill),stroke:J(u,f,c.stroke),strokeWidth:.5});var fe=r.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:v,y:C}});return E(d,fe,{fill:J(u,f,c.stroke),stroke:J(u,f,c.stroke),strokeWidth:.5}),y},label:function(d,u,c={}){return Y(d,u,c)}};this._drawPath=E,this._renderer=L}at(Wt,yt),Wt.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Wt.prototype.canRender=function(e){return re(e,"bpmn:BaseElement")},Wt.prototype.drawShape=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)},Wt.prototype.drawConnection=function(e,t,n={}){var{type:r}=t,i=this._renderer(r);return i(e,t,n)},Wt.prototype.getShapePath=function(e){return ef(e)?ea(e,Yf):re(e,"bpmn:Event")?Rf(e):re(e,"bpmn:Activity")?ea(e,Jn):re(e,"bpmn:Gateway")?Tf(e):Pf(e)};function ye(e,t=[]){return t.reduce((n,r)=>(e[r]&&(n[r]=e[r]),n),{})}var Xf=0,Jf={width:150,height:50};function Zf(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function Qf(e){return xt(e)?ne({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var li=null;function ep(){return li||(li=document.createElement("canvas").getContext("2d")),li}function tp(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(ca(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function ca(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function np(e,t){var n=ep();if(!n)return{width:0,height:0};n.font=tp(t),"letterSpacing"in n&&(n.letterSpacing=ca(t.letterSpacing)||"0px");var r=e==="",i=r?"dummy":e.replace(/\s+$/,""),o=n.measureText(i);return{width:r?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function rp(e,t,n){for(var r=e.shift(),i=r,o;;){if(o=np(i,n),o.width=i?o.width:0,i===" "||i===""||o.width<Math.round(t)||i.length<2)return ip(e,i,r,o);i=ap(i,o.width,t)}}function ip(e,t,n,r){if(t.length<n.length){var i=n.slice(t.length).trim();e.unshift(i)}return{width:r.width,height:r.height,text:t}}var ua="­";function op(e,t){var n=e.split(/(\s|-|\u00AD)/g),r,i=[],o=0;if(n.length>1)for(;r=n.shift();)if(r.length+o<t)i.push(r),o+=r.length;else{(r==="-"||r===ua)&&i.pop();break}var a=i[i.length-1];return a&&a===ua&&(i[i.length-1]="-"),i.join("")}function ap(e,t,n){var r=Math.max(e.length*(n/t),1),i=op(e,r);return i||(i=e.slice(0,Math.max(Math.round(r-1),1))),i}function Zn(e){this._config=ne({},{size:Jf,padding:Xf,style:{},align:"center-top"},e||{})}Zn.prototype.createText=function(e,t){return this.layoutText(e,t).element},Zn.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Zn.prototype.layoutText=function(e,t){for(var n=ne({},this._config.size,t.box),r=ne({},this._config.style,t.style),i=Zf(t.align||this._config.align),o=Qf(t.padding!==void 0?t.padding:this._config.padding),a=t.fitBox||!1,s=sp(r),f=e.split(/\u00AD?\r?\n/),p=[],h=n.width-o.left-o.right;f.length;)p.push(rp(f,h,r));i.vertical==="middle"&&(o.top=o.bottom=0);var m=rn(p,function(R,S,M){return R+(s||S.height)},0)+o.top+o.bottom,_=rn(p,function(R,S,M){return S.width>R?S.width:R},0),B=o.top;i.vertical==="middle"&&(B+=(n.height-m)/2),B-=(s||p[0].height)/4;var H=Ae("text");Re(H,r),ee(p,function(R){var S;switch(B+=s||R.height,i.horizontal){case"left":S=o.left;break;case"right":S=(a?_:h)-o.right-R.width;break;default:S=Math.max(((a?_:h)-R.width)/2+o.left,0)}var M=Ae("tspan");Re(M,{x:S,y:B}),M.textContent=R.text,Ie(H,M)});var F={width:_,height:m};return{dimensions:F,element:H}};function sp(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var lp=12,cp=1.2,up=40;function fa(e){var t=ne({fontFamily:"Arial, sans-serif",fontSize:lp,fontWeight:"normal",lineHeight:cp},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,r=ne({},t,{fontSize:n},e&&e.externalStyle||{}),i=new Zn({style:t});this.getExternalLabelBounds=function(a,s){var f={width:Math.max(a.width,wn.width),height:30},p=o(s,f,{style:r});return{x:Math.round(a.x+a.width/2-p.width/2),y:a.y,width:Math.ceil(p.width),height:Math.ceil(p.height)}},this.getTextAnnotationBounds=function(a,s){var f=o(s,a,{style:t,align:"left-top",padding:Ho});return{x:a.x,y:a.y,width:a.width,height:Math.max(up,Math.round(f.height))}},this.getDimensions=function(a,s){return i.getDimensions(a,s||{})};function o(a,s,f){return i.getDimensions(a,ne({box:s},f))}this.createText=function(a,s){return i.createText(a,s||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return r}}fa.$inject=["config.textRenderer"];function fp(){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(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){var r=this.pathMap[t],i,o;n.abspos?(i=n.abspos.x,o=n.abspos.y):(i=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var a={};if(n.position){for(var s=n.containerHeight/r.height*n.yScaleFactor,f=n.containerWidth/r.width*n.xScaleFactor,p=0;p<r.heightElements.length;p++)a["y"+p]=r.heightElements[p]*s;for(var h=0;h<r.widthElements.length;h++)a["x"+h]=r.widthElements[h]*f}var m=mp(r.d,{mx:i,my:o,e:a});return m}}var pp=/\{([^{}]+)\}/g,dp=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function hp(e,t,n){var r=n;return t.replace(dp,function(i,o,a,s,f){o=o||s,r&&(o in r&&(r=r[o]),typeof r=="function"&&f&&(r=r()))}),r=(r==null||r==n?e:r)+"",r}function mp(e,t){return String(e).replace(pp,function(n,r){return hp(n,r,t)})}const yp={__init__:["bpmnRenderer"],bpmnRenderer:["type",Wt],textRenderer:["type",fa],pathMap:["type",fp]};function gp(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,r){return t[r]||"{"+r+"}"})}const pa={translate:["value",gp]};function vp(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function ci(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function wp(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function bp(e){return vp({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function Ep(e){for(var t=e.waypoints,n=t.reduce(function(p,h,m){var _=t[m-1];if(_){var B=p[p.length-1],H=B&&B.endLength||0,F=_p(_,h);p.push({start:_,end:h,startLength:H,endLength:H+F,length:F})}return p},[]),r=n.reduce(function(p,h){return p+h.length},0),i=r/2,o=0,a=n[o];a.endLength<i;)a=n[++o];var s=(i-a.startLength)/a.length,f={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return f}function ui(e){return Qu(e)?Ep(e):bp(e)}function _p(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Fe(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function Qn(e,t,n){return ne({id:e.id,type:e.$type,businessObject:e,di:t},n)}function xp(e,t,n){var r=e.waypoint;return!r||r.length<2?[ui(t),ui(n)]:r.map(function(i){return{x:i.x,y:i.y}})}function da(e,t,n){return new Error(`element ${Fe(t)} referenced by ${Fe(e)}#${n} not yet drawn`)}function wt(e,t,n,r,i){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=r,this._textRenderer=i}wt.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],wt.prototype.add=function(e,t,n){var r,i,o;if(re(t,"bpmndi:BPMNPlane")){var a=re(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};r=this._elementFactory.createRoot(Qn(e,t,a)),this._canvas.addRootElement(r)}else if(re(t,"bpmndi:BPMNShape")){var s=!Ut(e,t),f=Ap(e);i=n&&(n.hidden||n.collapsed);var p=t.bounds;r=this._elementFactory.createShape(Qn(e,t,{collapsed:s,hidden:i,x:Math.round(p.x),y:Math.round(p.y),width:Math.round(p.width),height:Math.round(p.height),isFrame:f})),re(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,r),re(e,"bpmn:Lane")&&(o=0),re(e,"bpmn:DataStoreReference")&&(Sp(n,ui(p))||(n=this._canvas.findRoot(n))),this._canvas.addShape(r,n,o)}else if(re(t,"bpmndi:BPMNEdge")){var h=this._getSource(e),m=this._getTarget(e);i=n&&(n.hidden||n.collapsed),r=this._elementFactory.createConnection(Qn(e,t,{hidden:i,source:h,target:m,waypoints:xp(t,h,m)})),re(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(r,n,o)}else throw new Error(`unknown di ${Fe(t)} for element ${Fe(e)}`);return tf(e)&&Wn(r)&&this.addLabel(e,t,r),this._eventBus.fire("bpmnElement.added",{element:r}),r},wt.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${Fe(e)}#attachedToRef`);var r=this._elementRegistry.get(n.id),i=r&&r.attachers;if(!r)throw da(e,n,"attachedToRef");t.host=r,i||(r.attachers=i=[]),i.indexOf(t)===-1&&i.push(t)},wt.prototype.addLabel=function(e,t,n){var r,i,o;return r=af(t,n),i=Wn(n),i&&(r=this._textRenderer.getExternalLabelBounds(r,i)),o=this._elementFactory.createLabel(Qn(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!Wn(n),x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)})),this._canvas.addShape(o,n.parent)},wt.prototype._getConnectedElement=function(e,t){var n,r,i=e.$type;if(r=e[t+"Ref"],t==="source"&&i==="bpmn:DataInputAssociation"&&(r=r&&r[0]),(t==="source"&&i==="bpmn:DataOutputAssociation"||t==="target"&&i==="bpmn:DataInputAssociation")&&(r=e.$parent),n=r&&this._getElement(r),n)return n;throw r?da(e,r,t+"Ref"):new Error(`${Fe(e)}#${t} Ref not specified`)},wt.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},wt.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},wt.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function Sp(e,t){var n=t.x,r=t.y;return n>=e.x&&n<=e.x+e.width&&r>=e.y&&r<=e.y+e.height}function Ap(e){return re(e,"bpmn:Group")}const Cp={__depends__:[yp,{__depends__:[pa],bpmnImporter:["type",wt]}]};function ha(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}ha.prototype.next=function(){return this._prefix+ ++this._counter};var kp=new ha("ov"),Rp=500;function Me(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=kp,this._overlayDefaults=ne({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=Tp(n.getContainer()),this._init()}Me.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Me.prototype.get=function(e){if(st(e)&&(e={id:e}),st(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?nn(t.overlays,Fo({type:e.type})):t.overlays.slice():[]}else return e.type?nn(this._overlays,Fo({type:e.type})):e.id?this._overlays[e.id]:null},Me.prototype.add=function(e,t,n){if(xt(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=ne({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},Me.prototype.remove=function(e){var t=this.get(e)||[];tt(t)||(t=[t]);var n=this;ee(t,function(r){var i=n._getOverlayContainer(r.element,!0);if(r&&(Gn(r.html),Gn(r.htmlContainer),delete r.htmlContainer,delete r.element,delete n._overlays[r.id]),i){var o=i.overlays.indexOf(r);o!==-1&&i.overlays.splice(o,1)}})},Me.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},Me.prototype.show=function(){er(this._overlayRoot)},Me.prototype.hide=function(){er(this._overlayRoot,!1)},Me.prototype.clear=function(){this._overlays={},this._overlayContainers=[],na(this._overlayRoot)},Me.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,i=t.y;if(t.waypoints){var o=bn(t);r=o.x,i=o.y}ma(n,r,i),ta(e.html,"data-container-id",t.id)},Me.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,i=t.left,o=t.top;if(t.right!==void 0){var a;r.waypoints?a=bn(r).width:a=r.width,i=t.right*-1+a}if(t.bottom!==void 0){var s;r.waypoints?s=bn(r).height:s=r.height,o=t.bottom*-1+s}ma(n,i||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Me.prototype._createOverlayContainer=function(e){var t=ut('<div class="djs-overlays" />');Xe(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Me.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";ya(this._overlayRoot,n)},Me.prototype._getOverlayContainer=function(e,t){var n=ot(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n},Me.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,i,o;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),st(r)&&(r=ut(r)),o=this._getOverlayContainer(n),i=ut('<div class="djs-overlay" data-overlay-id="'+t+'">'),Xe(i,{position:"absolute"}),i.appendChild(r),e.type&&Ht(i).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();er(i,a===s),e.htmlContainer=i,o.overlays.push(e),o.html.appendChild(i),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Me.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),i=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),f=!0;(r!==s||n&&(en(i)&&i>t.scale||en(o)&&o<t.scale))&&(f=!1),er(a,f),this._updateOverlayScale(e,t)},Me.prototype._updateOverlayScale=function(e,t){var n=e.scale,r,i,o=e.htmlContainer,a,s="";n!==!0&&(n===!1?(r=1,i=1):(r=n.min,i=n.max),en(r)&&t.scale<r&&(a=(1/t.scale||1)*r),en(i)&&t.scale>i&&(a=(1/t.scale||1)*i)),en(a)&&(s="scale("+a+","+a+")"),ya(o,s)},Me.prototype._updateOverlaysVisibilty=function(e){var t=this;ee(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},Me.prototype._init=function(){var e=this._eventBus,t=this;function n(r){t._updateRoot(r),t._updateOverlaysVisibilty(r),t.show()}e.on("canvas.viewbox.changing",function(r){t.hide()}),e.on("canvas.viewbox.changed",function(r){n(r.viewbox)}),e.on(["shape.remove","connection.remove"],function(r){var i=r.element,o=t.get({element:i});ee(o,function(f){t.remove(f.id)});var a=t._getOverlayContainer(i);if(a){Gn(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",Rp,function(r){var i=r.element,o=t._getOverlayContainer(i,!0);o&&(ee(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(r){var i=t._getOverlayContainer(r.element,!0);i&&Ht(i.html)[r.add?"add":"remove"](r.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function Tp(e){var t=ut('<div class="djs-overlay-container" />');return Xe(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function ma(e,t,n){Xe(e,{left:t+"px",top:n+"px"})}function er(e,t){e.style.display=t===!1?"none":""}function ya(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}const ga={__init__:["overlays"],overlays:["type",Me]};function va(e,t,n,r){e.on("element.changed",function(i){var o=i.element;(o.parent||o===t.getRootElement())&&(i.gfx=n.getGraphics(o)),i.gfx&&e.fire(Uo(o)+".changed",i)}),e.on("elements.changed",function(i){var o=i.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),r.updateContainments(o)}),e.on("shape.changed",function(i){r.update("shape",i.element,i.gfx)}),e.on("connection.changed",function(i){r.update("connection",i.element,i.gfx)})}va.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const Pp={__init__:["changeSupport"],changeSupport:["type",va]};var Np=1e3;function He(e){this._eventBus=e}He.$inject=["eventBus"];function Op(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}He.prototype.on=function(e,t,n,r,i,o){if(($t(t)||St(t))&&(o=i,i=r,r=n,n=t,t=null),$t(n)&&(o=i,i=r,r=n,n=Np),xt(i)&&(o=i,i=!1),!$t(r))throw new Error("handlerFn must be a function");tt(e)||(e=[e]);var a=this._eventBus;ee(e,function(s){var f=["commandStack",s,t].filter(function(p){return p}).join(".");a.on(f,n,i?Op(r,o):r,o)})},He.prototype.canExecute=bt("canExecute"),He.prototype.preExecute=bt("preExecute"),He.prototype.preExecuted=bt("preExecuted"),He.prototype.execute=bt("execute"),He.prototype.executed=bt("executed"),He.prototype.postExecute=bt("postExecute"),He.prototype.postExecuted=bt("postExecuted"),He.prototype.revert=bt("revert"),He.prototype.reverted=bt("reverted");function bt(e){return function(n,r,i,o,a){($t(n)||St(n))&&(a=o,o=i,i=r,r=n,n=null),this.on(n,e,r,i,o,a)}}function fi(e,t){t.invoke(He,this),this.executed(function(n){var r=n.context;r.rootElement?e.setRootElement(r.rootElement):r.rootElement=e.getRootElement()}),this.revert(function(n){var r=n.context;r.rootElement&&e.setRootElement(r.rootElement)})}at(fi,He),fi.$inject=["canvas","injector"];const Dp={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",fi]};var Mp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Bp(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return Mp[t]})}var Ip="_plane";function pi(e){var t=e.id;return re(e,"bpmn:SubProcess")?Lp(t):t}function Lp(e){return e+Ip}var Fp="bjs-breadcrumbs-shown";function wa(e,t,n){var r=ut('<ul class="bjs-breadcrumbs"></ul>'),i=n.getContainer(),o=Ht(i);i.appendChild(r);var a=[];e.on("element.changed",function(f){var p=f.element,h=Se(p),m=ot(a,function(_){return _===h});m&&s()});function s(f){f&&(a=Vp(f));var p=a.flatMap(function(m){var _=n.findRoot(pi(m))||n.findRoot(m.id);if(!_&&re(m,"bpmn:Process")){var B=t.find(function(R){var S=Se(R);return S&&S.get("processRef")===m});_=B&&n.findRoot(B.id)}if(!_)return[];var H=Bp(m.name||m.id),F=ut('<li><span class="bjs-crumb"><a title="'+H+'">'+H+"</a></span></li>");return F.addEventListener("click",function(){n.setRootElement(_)}),F});r.innerHTML="";var h=p.length>1;o.toggle(Fp,h),p.forEach(function(m){r.appendChild(m)})}e.on("root.set",function(f){s(f.element)})}wa.$inject=["eventBus","elementRegistry","canvas"];function Vp(e){for(var t=Se(e),n=[],r=t;r;r=r.$parent)(re(r,"bpmn:SubProcess")||re(r,"bpmn:Process"))&&n.push(r);return n.reverse()}function ba(e,t){var n=null,r=new $p;e.on("root.set",function(i){var o=i.element,a=t.viewbox(),s=r.get(o);if(r.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(!re(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var f=(a.x-s.x)*a.scale,p=(a.y-s.y)*a.scale;(f!==0||p!==0)&&t.scroll({dx:f,dy:p}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){r.clear(),n=null})}ba.$inject=["eventBus","canvas"];function $p(){this._entries=[],this.set=function(e,t){var n=!1;for(var r in this._entries)if(this._entries[r][0]===e){this._entries[r][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}t!==-1&&this._entries.splice(t,1)}}var Ea={x:180,y:160};function qt(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(r,i){n._handleImport(i.definitions)})}qt.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(r){!r.plane||!r.plane.bpmnElement||(t._processToDiagramMap[r.plane.bpmnElement.id]=r)});var n=e.diagrams.filter(r=>r.plane).flatMap(r=>t._createNewDiagrams(r.plane));n.forEach(function(r){t._movePlaneElementsToOrigin(r.plane)})}},qt.prototype._createNewDiagrams=function(e){var t=this,n=[],r=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;re(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),Up(a,e)&&r.push({diElement:o,parent:s})}});var i=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,i.push(a)}}),r.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var f=t._processToDiagramMap[s.id];t._moveToDiPlane(a,f.plane)}}),i},qt.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=jp(e),r={x:n.x-Ea.x,y:n.y-Ea.y};t.forEach(function(i){i.waypoint?i.waypoint.forEach(function(o){o.x=o.x-r.x,o.y=o.y-r.y}):i.bounds&&(i.bounds.x=i.bounds.x-r.x,i.bounds.y=i.bounds.y-r.y)})},qt.prototype._moveToDiPlane=function(e,t){var n=_a(e),r=n.plane.get("planeElement");r.splice(r.indexOf(e),1),t.get("planeElement").push(e)},qt.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},qt.$inject=["eventBus","moddle"];function _a(e){return re(e,"bpmndi:BPMNDiagram")?e:_a(e.$parent)}function jp(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(n){if(n.bounds){var r=ci(n.bounds);t.top=Math.min(r.top,t.top),t.left=Math.min(r.left,t.left)}}),wp(t)}function Up(e,t){var n=e.$parent;return!(!re(n,"bpmn:SubProcess")||n===t.bpmnElement||Ju(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var tr=250,zp='<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>',Hp="bjs-drilldown-empty";function Tt(e,t,n,r,i){He.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=r,this._translate=i;var o=this;this.executed("shape.toggleCollapse",tr,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",tr,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],tr,function(a){var s=a.oldParent,f=a.newParent||a.parent,p=a.shape;o._canDrillDown(p)&&o._addOverlay(p),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(f),o._updateDrilldownOverlay(p)},!0),this.reverted(["shape.create","shape.move","shape.delete"],tr,function(a){var s=a.oldParent,f=a.newParent||a.parent,p=a.shape;o._canDrillDown(p)&&o._addOverlay(p),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(f),o._updateDrilldownOverlay(p)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}at(Tt,He),Tt.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Tt.prototype._canDrillDown=function(e){var t=this._canvas;return re(e,"bpmn:SubProcess")&&t.findRoot(pi(e))},Tt.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=Se(e),r=t.get({element:n.id,type:"drilldown"})[0];if(r){var i=n&&n.get("flowElements")&&n.get("flowElements").length;Ht(r.html).toggle(Hp,!i)}},Tt.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,r=Se(e),i=n.get({element:e,type:"drilldown"});i.length&&this._removeOverlay(e);var o=ut('<button type="button" class="bjs-drilldown">'+zp+"</button>"),a=r.get("name")||r.get("id"),s=this._translate("Open {element}",{element:a});o.setAttribute("title",s),o.addEventListener("click",function(){t.setRootElement(t.findRoot(pi(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)},Tt.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})},Tt.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];const Wp={__depends__:[ga,Pp,Dp],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",wa],drilldownCentering:["type",ba],drilldownOverlayBehavior:["type",Tt],subprocessCompatibility:["type",qt]};function xa(e){return e.originalEvent||e.srcEvent}function Sa(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function qp(){return/mac/i.test(navigator.platform)}function Aa(e,t){return(xa(e)||e).button===t}function nr(e){return Aa(e,0)}function Yp(e){return Aa(e,1)}function Kp(e){var t=xa(e)||e;return nr(e)&&t.shiftKey}function Gp(e){return!0}function rr(e){return nr(e)||Yp(e)}var Ca=500;function ka(e,t,n){var r=this;function i(x,$,P){if(!s(x,$)){var b,W,ue;P?W=t.getGraphics(P):(b=$.delegateTarget||$.target,b&&(W=b,P=t.get(W))),!(!W||!P)&&(ue=e.fire(x,{element:P,gfx:W,originalEvent:$}),ue===!1&&($.stopPropagation(),$.preventDefault()))}}var o={};function a(x){return o[x]}function s(x,$){var P=p[x]||nr;return!P($)}var f={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},p={"element.contextmenu":Gp,"element.mousedown":rr,"element.mouseup":rr,"element.click":rr,"element.dblclick":rr};function h(x,$,P){var b=f[x];if(!b)throw new Error("unmapped DOM event name <"+x+">");return i(b,$,P)}var m="svg, .djs-element";function _(x,$,P,b){var W=o[P]=function(ue){i(P,ue)};b&&(p[P]=b),W.$delegate=oi.bind(x,m,$,W)}function B(x,$,P){var b=a(P);b&&oi.unbind(x,$,b.$delegate)}function H(x){ee(f,function($,P){_(x,P,$)})}function F(x){ee(f,function($,P){B(x,P,$)})}e.on("canvas.destroy",function(x){F(x.svg)}),e.on("canvas.init",function(x){H(x.svg)}),e.on(["shape.added","connection.added"],function(x){var $=x.element,P=x.gfx;e.fire("interactionEvents.createHit",{element:$,gfx:P})}),e.on(["shape.changed","connection.changed"],Ca,function(x){var $=x.element,P=x.gfx;e.fire("interactionEvents.updateHit",{element:$,gfx:P})}),e.on("interactionEvents.createHit",Ca,function(x){var $=x.element,P=x.gfx;r.createDefaultHit($,P)}),e.on("interactionEvents.updateHit",function(x){var $=x.element,P=x.gfx;r.updateDefaultHit($,P)});var R=D("djs-hit djs-hit-stroke"),S=D("djs-hit djs-hit-click-stroke"),M=D("djs-hit djs-hit-all"),w=D("djs-hit djs-hit-no-move"),E={all:M,"click-stroke":S,stroke:R,"no-move":w};function D(x,$){return $=ne({stroke:"white",strokeWidth:15},$||{}),n.cls(x,["no-fill","no-border"],$)}function L(x,$){var P=E[$];if(!P)throw new Error("invalid hit type <"+$+">");return Re(x,P),x}function N(x,$){Ie(x,$)}this.removeHits=function(x){var $=Ff(".djs-hit",x);ee($,qn)},this.createDefaultHit=function(x,$){var P=x.waypoints,b=x.isFrame,W;return P?this.createWaypointsHit($,P):(W=b?"stroke":"all",this.createBoxHit($,W,{width:x.width,height:x.height}))},this.createWaypointsHit=function(x,$){var P=ri($);return L(P,"stroke"),N(x,P),P},this.createBoxHit=function(x,$,P){P=ne({x:0,y:0},P);var b=Ae("rect");return L(b,$),Re(b,P),N(x,b),b},this.updateDefaultHit=function(x,$){var P=gt(".djs-hit",$);if(P)return x.waypoints?Qo(P,x.waypoints):Re(P,{width:x.width,height:x.height}),P},this.fire=i,this.triggerMouseEvent=h,this.mouseHandler=a,this.registerEvent=_,this.unregisterEvent=B}ka.$inject=["eventBus","elementRegistry","styles"];const Xp={__init__:["interactionEvents"],interactionEvents:["type",ka]};function an(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=new Set;var n=this;e.on(["shape.remove","connection.remove"],function(r){var i=r.element;n.deselect(i)}),e.on(["diagram.clear","root.set"],function(r){n.select(null)})}an.$inject=["eventBus","canvas"],an.prototype.deselect=function(e){if(this._selectedElements.has(e)){var t=this.get();this._selectedElements.delete(e),this._eventBus.fire("selection.changed",{oldSelection:t,newSelection:this.get()})}},an.prototype.get=function(){return Array.from(this._selectedElements)},an.prototype.isSelected=function(e){return this._selectedElements.has(e)},an.prototype.select=function(e,t){var n=this.get();tt(e)||(e=e?[e]:[]);var r=this._canvas,i=r.getRootElement();e=e.filter(function(o){var a=r.findRoot(o);return i===a}),t?ee(e,o=>{this._selectedElements.add(o)}):this._selectedElements=new Set(e),this._eventBus.fire("selection.changed",{oldSelection:n,newSelection:this.get()})};var Ra="hover",Ta="selected";function Pa(e,t){this._canvas=e;function n(i,o){e.addMarker(i,o)}function r(i,o){e.removeMarker(i,o)}t.on("element.hover",function(i){n(i.element,Ra)}),t.on("element.out",function(i){r(i.element,Ra)}),t.on("selection.changed",function(i){function o(p){r(p,Ta)}function a(p){n(p,Ta)}var s=new Set(i.oldSelection),f=new Set(i.newSelection);for(let p of s)f.has(p)||o(p);for(let p of f)s.has(p)||a(p)})}Pa.$inject=["canvas","eventBus"];function Na(e,t,n,r){e.on("create.end",500,function(i){var o=i.context,a=o.canExecute,s=o.elements,f=o.hints||{},p=f.autoSelect;if(a){if(p===!1)return;tt(p)?t.select(p):t.select(s.filter(Jp))}}),e.on("connect.end",500,function(i){var o=i.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(i){var o=i.previousSelection||[],a=r.get(i.context.shape.id),s=ot(o,function(f){return a.id===f.id});s||t.select(a)}),e.on("element.click",function(i){if(nr(i)){var o=i.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,f=Kp(i);if(a&&s)return f?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,f)}})}Na.$inject=["eventBus","selection","canvas","elementRegistry"];function Jp(e){return!e.hidden}const Zp={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Xp],selection:["type",an],selectionVisuals:["type",Pa],selectionBehavior:["type",Na]},Qp=/^class[ {]/;function ed(e){return Qp.test(e.toString())}function di(e){return Array.isArray(e)}function hi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ir(...e){e.length===1&&di(e[0])&&(e=e[0]),e=[...e];const t=e.pop();return t.$inject=e,t}const td=/constructor\s*[^(]*\(\s*([^)]*)\)/m,nd=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,rd=/\/\*([^*]*)\*\//m;function id(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(ed(e)?td:nd);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(r=>{const i=r.match(rd);return(i&&i[1]||r).trim()})||[]}function Oa(e,t){const n=t||{get:function(w,E){if(r.push(w),E===!1)return null;throw s(`No provider for "${w}"!`)}},r=[],i=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(w){const E=r.join(" -> ");return r.length=0,new Error(E?`${w} (Resolving: ${E})`:w)};function f(w,E){if(!i[w]&&w.includes(".")){const D=w.split(".");let L=f(D.shift());for(;D.length;)L=L[D.shift()];return L}if(hi(o,w))return o[w];if(hi(i,w)){if(r.indexOf(w)!==-1)throw r.push(w),s("Cannot resolve circular dependency!");return r.push(w),o[w]=i[w][0](i[w][1]),r.pop(),o[w]}return n.get(w,E)}function p(w,E){if(typeof E>"u"&&(E={}),typeof w!="function")if(di(w))w=ir(w.slice());else throw s(`Cannot invoke "${w}". Expected a function!`);const L=(w.$inject||id(w)).map(N=>hi(E,N)?E[N]:f(N));return{fn:w,dependencies:L}}function h(w){const{fn:E,dependencies:D}=p(w),L=Function.prototype.bind.call(E,null,...D);return new L}function m(w,E,D){const{fn:L,dependencies:N}=p(w,D);return L.apply(E,N)}function _(w){return ir(E=>w.get(E))}function B(w,E){if(E&&E.length){const D=Object.create(null),L=Object.create(null),N=[],x=[],$=[];let P,b,W,ue;for(let G in i)P=i[G],E.indexOf(G)!==-1&&(P[2]==="private"?(b=N.indexOf(P[3]),b===-1?(W=P[3].createChild([],E),ue=_(W),N.push(P[3]),x.push(W),$.push(ue),D[G]=[ue,G,"private",W]):D[G]=[$[b],G,"private",x[b]]):D[G]=[P[2],P[1]],L[G]=!0),(P[2]==="factory"||P[2]==="type")&&P[1].$scope&&E.forEach(Y=>{P[1].$scope.indexOf(Y)!==-1&&(D[G]=[P[2],P[1]],L[Y]=!0)});E.forEach(G=>{if(!L[G])throw new Error('No provider for "'+G+'". Cannot use provider from the parent!')}),w.unshift(D)}return new Oa(w,a)}const H={factory:m,type:h,value:function(w){return w}};function F(w,E){const D=w.__init__||[];return function(){D.forEach(L=>{typeof L=="string"?E.get(L):E.invoke(L)})}}function R(w){const E=w.__exports__;if(E){const D=w.__modules__,L=Object.keys(w).reduce((b,W)=>(W!=="__exports__"&&W!=="__modules__"&&W!=="__init__"&&W!=="__depends__"&&(b[W]=w[W]),b),Object.create(null)),N=(D||[]).concat(L),x=B(N),$=ir(function(b){return x.get(b)});E.forEach(function(b){i[b]=[$,b,"private",x]});const P=(w.__init__||[]).slice();return P.unshift(function(){x.init()}),w=Object.assign({},w,{__init__:P}),F(w,x)}return Object.keys(w).forEach(function(D){if(D==="__init__"||D==="__depends__")return;const L=w[D];if(L[2]==="private"){i[D]=L;return}const N=L[0],x=L[1];i[D]=[H[N],od(N,x),N]}),F(w,a)}function S(w,E){return w.indexOf(E)!==-1||(w=(E.__depends__||[]).reduce(S,w),w.indexOf(E)!==-1)?w:w.concat(E)}function M(w){const E=w.reduce(S,[]).map(R);let D=!1;return function(){D||(D=!0,E.forEach(L=>L()))}}this.get=f,this.invoke=m,this.instantiate=h,this.createChild=B,this.init=M(e)}function od(e,t){return e!=="value"&&di(t)&&(t=ir(t.slice())),t}var ad=1;function Pt(e,t){yt.call(this,e,ad),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}at(Pt,yt),Pt.prototype.canRender=function(){return!0},Pt.prototype.drawShape=function(t,n,r){var i=Ae("rect");return Re(i,{x:0,y:0,width:n.width||0,height:n.height||0}),zo(n)?Re(i,ne({},this.FRAME_STYLE,r||{})):Re(i,ne({},this.SHAPE_STYLE,r||{})),Ie(t,i),i},Pt.prototype.drawConnection=function(t,n,r){var i=ri(n.waypoints,ne({},this.CONNECTION_STYLE,r||{}));return Ie(t,i),i},Pt.prototype.getShapePath=function(t){var n=t.x,r=t.y,i=t.width,o=t.height,a=[["M",n,r],["l",i,0],["l",0,o],["l",-i,0],["z"]];return zt(a)},Pt.prototype.getConnectionPath=function(t){var n=t.waypoints,r,i,o=[];for(r=0;i=n[r];r++)i=i.original||i,o.push([r===0?"M":"L",i.x,i.y]);return zt(o)},Pt.$inject=["eventBus","styles"];function sd(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,r,i){var o=this.style(r,i);return ne(o,{class:n})},this.style=function(n,r){!tt(n)&&!r&&(r=n,n=[]);var i=rn(n,function(o,a){return ne(o,e[a]||{})},{});return r?ne(i,r):i},this.computeStyle=function(n,r,i){return tt(r)||(i=r,r=[]),t.style(r||[],ne({},i,n||{}))}}const ld={__init__:["defaultRenderer"],defaultRenderer:["type",Pt],styles:["type",sd]};function cd(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function ud(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var r=e.indexOf(t);if(r!==-1){if(r===n)return;if(n!==-1)e.splice(r,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function or(e,t){return Math.round(e*t)/t}function Da(e){return St(e)?e+"px":e}function fd(e){for(;e.parent;)e=e.parent;return e}function pd(e){e=ne({},{width:"100%",height:"100%"},e);const t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),Xe(n,{position:"relative",overflow:"hidden",width:Da(e.width),height:Da(e.height)}),t.appendChild(n),n}function Ma(e,t,n){const r=Ae("g");lt(r).add(t);const i=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(r,e.childNodes[i]||null),r}const dd="base",Ba=0,hd=1,md={shape:["x","y","width","height"],connection:["waypoints"]};function oe(e,t,n,r){this._eventBus=t,this._elementRegistry=r,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}oe.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],oe.prototype._init=function(e){const t=this._eventBus,n=this._container=pd(e),r=this._svg=Ae("svg");Re(r,{width:"100%",height:"100%"}),ta(r,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),r.addEventListener("focusin",()=>{this._setFocused(!0)}),r.addEventListener("focusout",()=>{this._setFocused(!1)}),r.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),r.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),Ie(n,r);const i=this._viewport=Ma(r,"viewport");e.deferUpdate&&(this._viewboxChanged=Vo(this._viewboxChanged,300)),this._restoreFocus=Vo(this._restoreFocus,0),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:r,viewport:i})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},oe.prototype._destroy=function(){this._restoreFocus.cancel(),this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},oe.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},oe.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{const n=Uo(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},oe.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},oe.prototype.restoreFocus=function(){this._restoreFocus()},oe.prototype._restoreFocus=function(){document.activeElement===document.body&&this.focus()},oe.prototype.isFocused=function(){return this._focused},oe.prototype.getDefaultLayer=function(){return this.getLayer(dd,Ba)},oe.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),typeof t<"u"&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},oe.prototype._getChildIndex=function(e){return rn(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},oe.prototype._createLayer=function(e,t){typeof t>"u"&&(t=hd);const n=this._getChildIndex(t);return{group:Ma(this._viewport,"layer-"+e,n),index:t,visible:!0}},oe.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=this._viewport,r=t.group,i=t.index;if(t.visible)return r;const o=this._getChildIndex(i);return n.insertBefore(r,n.childNodes[o]||null),t.visible=!0,r},oe.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const n=t.group;return t.visible&&(qn(n),t.visible=!1),n},oe.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],qn(t.group))},oe.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},oe.prototype.findRoot=function(e){const t=this._resolveElements(e);let n;for(const r of t){const i=this._findPlaneForRoot(fd(r));if(!i||n&&i.rootElement!==n)return;n=i.rootElement}return n},oe.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},oe.prototype._findPlaneForRoot=function(e){return ot(this._planes,function(t){return t.rootElement===e})},oe.prototype._resolveElement=function(e){return typeof e=="string"?this._elementRegistry.get(e):e},oe.prototype._resolveElements=function(e){return tt(e)||(e=[e]),e.map(t=>this._resolveElement(t)).filter(Boolean)},oe.prototype.getContainer=function(){return this._container},oe.prototype._updateMarker=function(e,t,n){let r;e=this._resolveElement(e),e.markers=e.markers||new Set,r=this._elementRegistry._elements[e.id],r&&(ee([r.gfx,r.secondaryGfx],function(i){i&&(n?(e.markers.add(t),lt(i).add(t)):(e.markers.delete(t),lt(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:r.gfx,marker:t,add:!!n}))},oe.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},oe.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},oe.prototype.hasMarker=function(e,t){return e=this._resolveElement(e),e.markers?e.markers.has(t):!1},oe.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},oe.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},oe.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const n=e.layer="root-"+t;this._ensureValid("root",e);const r=this.getLayer(n,Ba);return this.hideLayer(n),this._addRoot(e,r),this._planes.push({rootElement:e,layer:r}),e},oe.prototype.removeRootElement=function(e){if(e=this._resolveElement(e),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(n){return n.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},oe.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},oe.prototype._removeRoot=function(e){const t=this._elementRegistry,n=this._eventBus;n.fire("root.remove",{element:e}),n.fire("root.removed",{element:e}),t.remove(e)},oe.prototype._addRoot=function(e,t){const n=this._elementRegistry,r=this._eventBus;r.fire("root.add",{element:e}),n.add(e,t),r.fire("root.added",{element:e,gfx:t})},oe.prototype._setRoot=function(e,t){const n=this._rootElement;n&&(this._elementRegistry.updateGraphics(n,null,!0),this.hideLayer(n.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},oe.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const n=md[e];if(!Io(n,function(i){return typeof t[i]<"u"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},oe.prototype._setParent=function(e,t,n){ud(t.children,e,n),e.parent=t},oe.prototype._addElement=function(e,t,n,r){n=n||this.getRootElement();const i=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),i.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,r);const a=o.create(e,t,r);return this._elementRegistry.add(t,a),o.update(e,t,a),i.fire(e+".added",{element:t,gfx:a}),t},oe.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},oe.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},oe.prototype._removeElement=function(e,t){const n=this._elementRegistry,r=this._graphicsFactory,i=this._eventBus;if(e=n.get(e.id||e),!!e)return i.fire(t+".remove",{element:e}),r.remove(e),cd(e.parent&&e.parent.children,e),e.parent=null,i.fire(t+".removed",{element:e}),n.remove(e),e},oe.prototype.removeShape=function(e){return this._removeElement(e,"shape")},oe.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},oe.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},oe.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},oe.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},oe.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let r,i,o,a,s,f,p;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);const h=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);_n(t,h)});else return o=this._rootElement?this.getActiveLayer():null,r=o&&o.getBBox()||{},a=_n(t),i=a?a.matrix:yf(),s=or(i.a,1e3),f=or(-i.e||0,1e3),p=or(-i.f||0,1e3),e=this._cachedViewbox={x:f?f/s:0,y:p?p/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:r.width||0,height:r.height||0,x:r.x||0,y:r.y||0},outer:n},e;return e},oe.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=ne({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Ia(t,n)}),{x:n.e,y:n.f}},oe.prototype.scrollToElement=function(e,t){let n=100;const r=this._resolveElements(e);if(!r.length)return;const i=this.findRoot(r);if(!i)return;i!==this.getRootElement()&&this.setRootElement(i);const o=r.filter(H=>H!=i);if(!o.length)return;t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const a=bn(o),s=ci(a),f=this.viewbox(),p=this.zoom();let h,m;f.y+=t.top/p,f.x+=t.left/p,f.width-=(t.right+t.left)/p,f.height-=(t.bottom+t.top)/p;const _=ci(f);if(!(a.width<f.width&&a.height<f.height))h=a.x-f.x,m=a.y-f.y;else{const H=Math.max(0,s.right-_.right),F=Math.min(0,s.left-_.left),R=Math.max(0,s.bottom-_.bottom),S=Math.min(0,s.top-_.top);h=H||F,m=R||S}this.scroll({dx:-h*p,dy:-m*p})},oe.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let n,r;return this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),r=this._setZoom(e,t)}),or(r.a,1e3)};function Ia(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}oe.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,r=t.inner;let i,o;return r.x>=0&&r.y>=0&&r.x+r.width<=n.width&&r.y+r.height<=n.height&&!e?o={x:0,y:0,width:Math.max(r.width+r.x,n.width),height:Math.max(r.height+r.y,n.height)}:(i=Math.min(1,n.width/r.width,n.height/r.height),o={x:r.x+(e?r.width/2-n.width/i/2:0),y:r.y+(e?r.height/2-n.height/i/2:0),width:n.width/i,height:n.height/i}),this.viewbox(o),this.viewbox(!1).scale},oe.prototype._setZoom=function(e,t){const n=this._svg,r=this._viewport,i=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,f,p,h;f=r.getCTM();const m=f.a;return t?(a=ne(o,t),s=a.matrixTransform(f.inverse()),p=i.translate(s.x,s.y).scale(1/m*e).translate(-s.x,-s.y),h=f.multiply(p)):h=i.scale(e),Ia(this._viewport,h),h},oe.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},oe.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;const r=n.x*t.scale-t.x*t.scale,i=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:r,y:i,width:o,height:a}},oe.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var sn="data-element-id";function Je(e){this._elements={},this._eventBus=e}Je.$inject=["eventBus"],Je.prototype.add=function(e,t,n){var r=e.id;this._validateId(r),Re(t,sn,r),n&&Re(n,sn,r),this._elements[r]={element:e,gfx:t,secondaryGfx:n}},Je.prototype.remove=function(e){var t=this._elements,n=e.id||e,r=n&&t[n];r&&(Re(r.gfx,sn,""),r.secondaryGfx&&Re(r.secondaryGfx,sn,""),delete t[n])},Je.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),r=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,r)},Je.prototype.updateGraphics=function(e,t,n){var r=e.id||e,i=this._elements[r];return n?i.secondaryGfx=t:i.gfx=t,t&&Re(t,sn,r),t},Je.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&Re(e,sn);var n=this._elements[t];return n&&n.element},Je.prototype.filter=function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(n)}),t},Je.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),r=0;r<n.length;r++){var i=n[r],o=t[i],a=o.element,s=o.gfx;if(e(a,s))return a}},Je.prototype.getAll=function(){return this.filter(function(e){return e})},Je.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var r=t[n],i=r.element,o=r.gfx;return e(i,o)})},Je.prototype.getGraphics=function(e,t){var n=e.id||e,r=this._elements[n];return r&&(t?r.secondaryGfx:r.gfx)},Je.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};function yd(e,t,n,r){var i=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,i,r)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var s=this.indexOf(o);if(typeof a>"u"){if(s!==-1)return;a=this.length}s!==-1&&this.splice(s,1),this.splice(a,0,o),s===-1&&t.set(o,i,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function gd(e){return e.__refs_collection===!0}function vd(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function La(e,t,n){var r=yd(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(i){e.set(i,t.inverse,n)})}function wd(e,t,n){var r=t.inverse,i=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return i},set:function(o){if(o!==i){var a=i;i=null,a&&e.unset(a,r,n),i=o,e.set(i,r,n)}}})}function rt(e,t){if(!(this instanceof rt))return new rt(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}rt.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?La(this,t,e):wd(this,t,e)},rt.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return gd(n)||La(this,t,e),n},rt.prototype.ensureBound=function(e,t){vd(e,t)||this.bind(e,t)},rt.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},rt.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var mi=new rt({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Fa=new rt({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Va=new rt({name:"attachers",collection:!0},{name:"host"}),$a=new rt({name:"outgoing",collection:!0},{name:"source"}),ja=new rt({name:"incoming",collection:!0},{name:"target"});function An(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),mi.bind(this,"parent"),Fa.bind(this,"labels"),$a.bind(this,"outgoing"),ja.bind(this,"incoming")}function Cn(){An.call(this),mi.bind(this,"children"),Va.bind(this,"host"),Va.bind(this,"attachers")}at(Cn,An);function Ua(){An.call(this),mi.bind(this,"children")}at(Ua,Cn);function za(){Cn.call(this),Fa.bind(this,"labelTarget")}at(za,Cn);function Ha(){An.call(this),$a.bind(this,"source"),ja.bind(this,"target")}at(Ha,An);var bd={connection:Ha,shape:Cn,label:za,root:Ua};function Ed(e,t){var n=bd[e];if(!n)throw new Error("unknown type: <"+e+">");return ne(new n,t)}function ln(){this._uid=12}ln.prototype.createRoot=function(e){return this.create("root",e)},ln.prototype.createLabel=function(e){return this.create("label",e)},ln.prototype.createShape=function(e){return this.create("shape",e)},ln.prototype.createConnection=function(e){return this.create("connection",e)},ln.prototype.create=function(e,t){return t=ne({},t||{}),t.id||(t.id=e+"_"+this._uid++),Ed(e,t)};var ar="__fn",Wa=1e3,_d=Array.prototype.slice;function Ge(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}Ge.prototype.on=function(e,t,n,r){if(e=tt(e)?e:[e],$t(t)&&(r=n,n=t,t=Wa),!St(t))throw new Error("priority must be a number");var i=n;r&&(i=At(n,r),i[ar]=n[ar]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:i,next:null})})},Ge.prototype.once=function(e,t,n,r){var i=this;if($t(t)&&(r=n,n=t,t=Wa),!St(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(r,arguments);return i.off(e,o),a}o[ar]=n,this.on(e,t,o)},Ge.prototype.off=function(e,t){e=tt(e)?e:[e];var n=this;e.forEach(function(r){n._removeListener(r,t)})},Ge.prototype.createEvent=function(e){var t=new kn;return t.init(e),t},Ge.prototype.fire=function(e,t){var n,r,i,o;if(o=_d.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(r=this._listeners[e],!!r){t instanceof kn?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{i=this._invokeListeners(n,o,r)}finally{e!==a&&(n.type=a)}return i===void 0&&n.defaultPrevented&&(i=!1),i}},Ge.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},Ge.prototype._destroy=function(){this._listeners={}},Ge.prototype._invokeListeners=function(e,t,n){for(var r;n&&!e.cancelBubble;)r=this._invokeListener(e,t,n),n=n.next;return r},Ge.prototype._invokeListener=function(e,t,n){var r;if(n.callback.__isTomb)return r;try{r=xd(n.callback,t),r!==void 0&&(e.returnValue=r,e.stopPropagation()),r===!1&&e.preventDefault()}catch(i){if(!this.handleError(i))throw console.error("unhandled error in event listener",i),i}return r},Ge.prototype._addListener=function(e,t){var n=this._getListeners(e),r;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,r?r.next=t:this._setListeners(e,t);return}r=n,n=n.next}r.next=t},Ge.prototype._getListeners=function(e){return this._listeners[e]},Ge.prototype._setListeners=function(e,t){this._listeners[e]=t},Ge.prototype._removeListener=function(e,t){var n=this._getListeners(e),r,i,o;if(!t){this._setListeners(e,null);return}for(;n;)r=n.next,o=n.callback,(o===t||o[ar]===t)&&(i?i.next=r:this._setListeners(e,r)),i=n,n=r};function kn(){}kn.prototype.stopPropagation=function(){this.cancelBubble=!0},kn.prototype.preventDefault=function(){this.defaultPrevented=!0},kn.prototype.init=function(e){ne(this,e||{})};function xd(e,t){return e.apply(null,t)}function Sd(e){return e.childNodes[0]}function Ad(e){return e.parentNode.childNodes[1]}function Ze(e,t){this._eventBus=e,this._elementRegistry=t}Ze.$inject=["eventBus","elementRegistry"],Ze.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=Ad(t),n||(n=Ae("g"),lt(n).add("djs-children"),Ie(t.parentNode,n))):n=t,n},Ze.prototype._clear=function(e){var t=Sd(e);return na(t),t},Ze.prototype._createContainer=function(e,t,n,r){var i=Ae("g");lt(i).add("djs-group"),typeof n<"u"?Cd(i,t,t.childNodes[n]):Ie(t,i);var o=Ae("g");lt(o).add("djs-element"),lt(o).add("djs-"+e),r&&lt(o).add("djs-frame"),Ie(i,o);var a=Ae("g");return lt(a).add("djs-visual"),Ie(o,a),o},Ze.prototype.create=function(e,t,n){var r=this._getChildrenContainer(t.parent);return this._createContainer(e,r,n,zo(t))},Ze.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,r;r=rn(e,function(i,o){return o.parent&&(i[o.parent.id]=o.parent),i},{}),ee(r,function(i){var o=i.children;if(o){var a=t._getChildrenContainer(i),s=a.firstChild;ee(o,function(f){var p=n.getGraphics(f).parentNode;p===s?s=s.nextSibling:a.insertBefore(p,s)})}})},Ze.prototype.drawShape=function(e,t,n={}){var r=this._eventBus;return r.fire("render.shape",{gfx:e,element:t,attrs:n})},Ze.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)},Ze.prototype.drawConnection=function(e,t,n={}){var r=this._eventBus;return r.fire("render.connection",{gfx:e,element:t,attrs:n})},Ze.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)},Ze.prototype.update=function(e,t,n){if(t.parent){var r=this._clear(n);if(e==="shape")this.drawShape(r,t),sa(n,t.x,t.y);else if(e==="connection")this.drawConnection(r,t);else throw new Error("unknown type: "+e);t.hidden?Re(n,"display","none"):Re(n,"display","block")}},Ze.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);qn(t.parentNode)};function Cd(e,t,n){var r=n||t.firstChild;e!==r&&t.insertBefore(e,r)}const kd={__depends__:[ld],__init__:["canvas"],canvas:["type",oe],elementRegistry:["type",Je],elementFactory:["type",ln],eventBus:["type",Ge],graphicsFactory:["type",Ze]};function Rd(e){var t=new Oa(e);return t.init(),t}function Td(e){e=e||{};var t={config:["value",e]},n=[t,kd].concat(e.modules||[]);return Rd(n)}function Nt(e,t){this._injector=t||Td(e),this.get("eventBus").fire("diagram.init")}Nt.prototype.get=function(e,t){return this._injector.get(e,t)},Nt.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Nt.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Nt.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function yi(){}yi.prototype.get=function(e){return this.$model.properties.get(this,e)},yi.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function qa(e,t){this.model=e,this.properties=t}qa.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(yi.prototype);ee(e.properties,function(a){!a.isMany&&a.default!==void 0&&(r[a.name]=a.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function o(a){n.define(this,"$type",{value:i,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),ee(a,At(function(s,f){this.set(f,s)},this))}return o.prototype=r,o.hasType=r.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var Pd=ne(Object.create(null),{String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0}),Ya=ne(Object.create(null),{String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}});function gi(e,t){var n=Ya[e];return n?n(t):t}function vi(e){return!!Pd[e]}function Ka(e){return!!Ya[e]}function Ve(e,t){var n=e.split(/:/),r,i;if(n.length===1)r=e,i=t;else if(n.length===2)r=n[1],i=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(i?i+":":"")+r,{name:e,prefix:i,localName:r}}function Qe(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName=Object.create(null),this.properties=[],this.propertiesByName=Object.create(null)}Qe.prototype.build=function(){return Ku(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Qe.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t!==void 0?r.splice(t,0,e):r.push(e)},Qe.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(s===-1)throw new Error("property <"+r.name+"> not found in property list");i.splice(s,1),this.addProperty(t,n?void 0:s,a),o[r.name]=o[r.localName]=t},Qe.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split("#"),o=Ve(i[0],r),a=Ve(i[1],o.prefix).name,s=this.propertiesByName[a];if(s)this.replaceProperty(s,e,n);else throw new Error("refined property <"+a+"> not found");delete e.redefines},Qe.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},Qe.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Qe.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Qe.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Qe.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},Qe.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw new Error("property <"+n+"> already defined; override of <"+r.definedBy.ns.name+"#"+r.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Qe.prototype.hasProperty=function(e){return this.propertiesByName[e]},Qe.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(ee(e.properties,At(function(o){o=ne({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});var a=o.replaces,s=o.redefines;a||s?this.redefineProperty(o,a||s,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),r.push(e),n[i]=e)};function Ot(e,t){this.packageMap=Object.create(null),this.typeMap=Object.create(null),this.packages=[],this.properties=t,ee(e,At(this.registerPackage,this))}Ot.prototype.getPackage=function(e){return this.packageMap[e]},Ot.prototype.getPackages=function(){return this.packages},Ot.prototype.registerPackage=function(e){e=ne({},e);var t=this.packageMap;Ga(t,e,"prefix"),Ga(t,e,"uri"),ee(e.types,At(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Ot.prototype.registerType=function(e,t){e=ne({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:ne({},e.meta||{})});var n=Ve(e.name,t.prefix),r=n.name,i=Object.create(null);ee(e.properties,At(function(o){var a=Ve(o.name,n.prefix),s=a.name;vi(o.type)||(o.type=Ve(o.type,a.prefix).name),ne(o,{ns:a,name:s}),i[s]=o},this)),ne(e,{ns:n,name:r,propertiesByName:i}),ee(e.extends,At(function(o){var a=Ve(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e},Ot.prototype.mapTypes=function(e,t,n){var r=vi(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function o(f,p){var h=Ve(f,vi(f)?"":e.prefix);i.mapTypes(h,t,p)}function a(f){return o(f,!0)}function s(f){return o(f,!1)}if(!r)throw new Error("unknown type <"+e.name+">");ee(r.superClass,n?a:s),t(r,!n),ee(r.traits,a)},Ot.prototype.getEffectiveDescriptor=function(e){var t=Ve(e),n=new Qe(t);this.mapTypes(t,function(i,o){n.addTrait(i,o)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},Ot.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function Ga(e,t,n){var r=t[n];if(r in e)throw new Error("package with "+n+" <"+r+"> already defined")}function Yt(e){this.model=e}Yt.prototype.set=function(e,t,n){if(!st(t)||!t.length)throw new TypeError("property name must be a non-empty string");var r=this.getProperty(e,t),i=r&&r.name;Nd(n)?r?delete e[i]:delete e.$attrs[wi(t)]:r?i in e?e[i]=n:Xa(e,r,n):e.$attrs[wi(t)]=n},Yt.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[wi(t)];var r=n.name;return!e[r]&&n.isMany&&Xa(e,n,[]),e[r]},Yt.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=ne({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)},Yt.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Yt.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Yt.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(":"))return null;const i=n.config.strict;if(typeof i<"u"){const o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw o;typeof console<"u"&&console.warn(o)}return null};function Nd(e){return typeof e>"u"}function Xa(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function wi(e){return e.replace(/^:/,"")}function it(e,t={}){this.properties=new Yt(this),this.factory=new qa(this,this.properties),this.registry=new Ot(e,this.properties),this.typeCache=Object.create(null),this.config=t}it.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},it.prototype.getType=function(e){var t=this.typeCache,n=st(e)?e:e.ns.name,r=t[n];return r||(e=this.registry.getEffectiveDescriptor(n),r=t[n]=this.factory.createType(e)),r},it.prototype.createAny=function(e,t,n){var r=Ve(e),i={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){Yu(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:r.prefix,localName:r.localName,uri:t}};return this.properties.defineDescriptor(i,o),this.properties.defineModel(i,this),this.properties.define(i,"get",{enumerable:!1,writable:!0}),this.properties.define(i,"set",{enumerable:!1,writable:!0}),this.properties.define(i,"$parent",{enumerable:!1,writable:!0}),this.properties.define(i,"$instanceOf",{enumerable:!1,writable:!0}),ee(n,function(a,s){xt(a)&&a.value!==void 0?i[a.name]=a.value:i[s]=a}),i},it.prototype.getPackage=function(e){return this.registry.getPackage(e)},it.prototype.getPackages=function(){return this.registry.getPackages()},it.prototype.getElementDescriptor=function(e){return e.$descriptor},it.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName},it.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},it.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Ja=String.fromCharCode,Od=Object.prototype.hasOwnProperty,Dd=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Rn={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Rn).forEach(function(e){Rn[e.toUpperCase()]=Rn[e]});function Md(e,t,n,r){return r?Od.call(Rn,r)?Rn[r]:"&"+r+";":Ja(t||parseInt(n,16))}function Kt(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(Dd,Md):e}var Za="non-whitespace outside of root node";function Dt(e){return new Error(e)}function Bd(e){return"missing namespace for prefix <"+e+">"}function sr(e){return{get:e,enumerable:!0}}function Id(e){var t=Object.create(null),n;for(n in e)t[n]=e[n];return t}var Qa=Symbol("nameCache");function bi(e){return e+"$uri"}function Ld(e){var t=Object.create(null),n,r;for(n in e)r=e[n],t[r]=r,t[bi(r)]=n;return t}function lr(){return{line:0,column:0}}function Fd(e){throw e}function es(e){if(!this)return new es(e);var t=e&&e.proxy,n,r,i,o,a=Fd,s,f,p,h,m=lr,_=!1,B=!1,H="",F=!1,R=!1,S=null,M=!1,w,E,D,L;function N(b){b instanceof Error||(b=Dt(b)),S=b,a(b,m)}function x(b){s&&(b instanceof Error||(b=Dt(b)),s(b,m))}this.on=function(b,W){if(typeof W!="function")throw Dt("required args <name, cb>");switch(b){case"openTag":r=W;break;case"text":n=W;break;case"closeTag":i=W;break;case"error":a=W;break;case"warn":s=W;break;case"cdata":o=W;break;case"attention":h=W;break;case"question":p=W;break;case"comment":f=W;break;default:throw Dt("unsupported event: "+b)}return this},this.ns=function(b){if(typeof b>"u"&&(b={}),typeof b!="object")throw Dt("required args <nsMap={}>");var W=Object.create(null),ue;for(ue in b)W[ue]=b[ue];return R=!0,L=W,this};function $(){w=R?[]:null,E=R?Ld(L):null,D=[],m=lr,M=!1,S=null,B=!1,H=""}this.parse=function(b){if(typeof b!="string")throw Dt("required args <xml=string>");if(_)throw Dt("parse during stream; call end() first");return $(),P(b),m=lr,M=!1,S},this.write=function(b){if(typeof b!="string")throw Dt("required args <xml=string>");return _||($(),_=!0),S||(H=P(H+b,!0)||""),this},this.end=function(){return _||$(),_=!1,S||P(H),H="",m=lr,M=!1,S},this.stop=function(){M=!0};function P(b,W=!1){var ue=null,G=null,Y,T=0,j=!1,O=!1,q=0,U=0,K,k,A,I,ie,ae,d,u,c,y="",v=0,C;function X(pe,be){var Ce=pe.indexOf(":");if(Ce===-1)return pe;var Pe=E[pe.substring(0,Ce)];return Pe?be===Pe?pe.substr(Ce+1):Pe+pe.substr(Ce):(x(Bd(pe.substring(0,Ce))),null)}function se(){if(C!==null)return C;var pe,be,Ce=R&&E.xmlns,Pe=R&&F?[]:null,we=v,Ee=y,ze=Ee.length,z,V,te,ce,ge,De={},qe=new Set,ke,me,ve;e:for(;we<ze;we++)if(ke=!1,me=Ee.charCodeAt(we),!(me===32||me<14&&me>8)){for((me<65||me>122||me>90&&me<97)&&me!==95&&me!==58&&(x("illegal first char attribute name"),ke=!0),ve=we+1;ve<ze;ve++)if(me=Ee.charCodeAt(ve),!(me>96&&me<123||me>64&&me<91||me>47&&me<59||me===46||me===45||me===95)){if(me===32||me<14&&me>8){x("missing attribute value"),we=ve;continue e}if(me===61)break;x("illegal attribute name char"),ke=!0}if(ge=Ee.substring(we,ve),ge==="xmlns:xmlns"&&(x("illegal declaration of xmlns"),ke=!0),me=Ee.charCodeAt(ve+1),me===34)ve=Ee.indexOf('"',we=ve+2),ve===-1&&(ve=Ee.indexOf("'",we),ve!==-1&&(x("attribute value quote missmatch"),ke=!0));else if(me===39)ve=Ee.indexOf("'",we=ve+2),ve===-1&&(ve=Ee.indexOf('"',we),ve!==-1&&(x("attribute value quote missmatch"),ke=!0));else for(x("missing attribute value quotes"),ke=!0,ve=ve+1;ve<ze&&(me=Ee.charCodeAt(ve+1),!(me===32||me<14&&me>8));ve++);for(ve===-1&&(x("missing closing quotes"),ve=ze,ke=!0),ke||(te=Ee.substring(we,ve)),we=ve;ve+1<ze&&(me=Ee.charCodeAt(ve+1),!(me===32||me<14&&me>8));ve++)we===ve&&(x("illegal character after attribute end"),ke=!0);if(we=ve+1,ke)continue e;if(qe.has(ge)){x("attribute <"+ge+"> already defined");continue}if(qe.add(ge),!R){De[ge]=te;continue}if(F){if(V=ge==="xmlns"?"xmlns":ge.charCodeAt(0)===120&&ge.substr(0,6)==="xmlns:"?ge.substr(6):null,V!==null){if(pe=Kt(te),be=bi(V),ce=L[pe],!ce){if(V==="xmlns"||be in E&&E[be]!==pe)do ce="ns"+T++;while(typeof E[ce]<"u");else ce=V;L[pe]=ce}E[V]!==ce&&(z||(E=Id(E),z=!0),E[V]=ce,V==="xmlns"&&(E[bi(ce)]=pe,Ce=ce),E[be]=pe),De[ge]=te;continue}Pe.push(ge,te);continue}ge=X(ge,Ce),ge!==null&&(De[ge]=te)}if(F)for(we=0,ze=Pe.length;we<ze;we++)ge=X(Pe[we++],Ce),te=Pe[we],ge!==null&&(De[ge]=te);return C=De}function fe(){for(var pe=/(\r\n|\r|\n)/g,be=0,Ce=0,Pe=0,we=U,Ee,ze;q>=Pe&&(Ee=pe.exec(b),!(!Ee||(we=Ee[0].length+Ee.index,we>q)));)be+=1,Pe=we;return q==-1?(Ce=we,ze=b.substring(U)):U===0?ze=b.substring(U,q):(Ce=q-Pe,ze=U==-1?b.substring(q):b.substring(q,U+1)),{data:ze,line:be,column:Ce}}for(m=fe,t&&(c=Object.create({},{name:sr(function(){return d}),originalName:sr(function(){return u}),attrs:sr(se),ns:sr(function(){return E})}));U!==-1;){if(b.charCodeAt(U)===60?q=U:q=b.indexOf("<",U),q===-1){if(W)return b.substring(U);if(D.length)return N("unexpected end of file");if(!B)return N("missing start tag");U<b.length&&b.substring(U).trim()&&x(Za);return}if(B||(B=!0),U!==q){if(D.length){if(n&&(n(b.substring(U,q),Kt,m),M))return}else if(b.substring(U,q).trim()&&(x(Za),M))return}if(I=b.charCodeAt(q+1),I===33){if(A=b.charCodeAt(q+2),A===91&&b.substr(q+3,6)==="CDATA["){if(U=b.indexOf("]]>",q),U===-1)return W?b.substring(q):N("unclosed cdata");if(o&&(o(b.substring(q+9,U),m),M))return;U+=3;continue}if(A===45&&b.charCodeAt(q+3)===45){if(U=b.indexOf("-->",q),U===-1)return W?b.substring(q):N("unclosed comment");if(f&&(f(b.substring(q+4,U),Kt,m),M))return;U+=3;continue}}if(I===63){if(U=b.indexOf("?>",q),U===-1)return W?b.substring(q):N("unclosed question");if(p&&(p(b.substring(q,U+2),m),M))return;U+=2;continue}for(K=q+1;;K++){if(ie=b.charCodeAt(K),isNaN(ie))return W?b.substring(q):(U=-1,N("unclosed tag"));if(ie===34)A=b.indexOf('"',K+1),K=A!==-1?A:K;else if(ie===39)A=b.indexOf("'",K+1),K=A!==-1?A:K;else if(ie===62){U=K;break}}if(I===33){if(h&&(h(b.substring(q,U+1),Kt,m),M))return;U+=1;continue}if(C={},I===47){if(j=!1,O=!0,!D.length)return N("missing open tag");if(K=d=D.pop(),A=q+2+K.length,b.substring(q+2,A)!==K)return N("closing tag mismatch");for(;A<U;A++)if(I=b.charCodeAt(A),!(I===32||I>8&&I<14))return N("close tag")}else{if(b.charCodeAt(U-1)===47?(K=d=b.substring(q+1,U-1),j=!0,O=!0):(K=d=b.substring(q+1,U),j=!0,O=!1),!(I>96&&I<123||I>64&&I<91||I===95||I===58))return N("illegal first char nodeName");for(A=1,k=K.length;A<k;A++)if(I=K.charCodeAt(A),!(I>96&&I<123||I>64&&I<91||I>47&&I<59||I===45||I===95||I==46)){if(I===32||I<14&&I>8){d=K.substring(0,A),C=null;break}return N("invalid nodeName")}O||D.push(d)}if(R){Y=E,j&&(O||w.push(Y),C===null&&(F=K.indexOf("xmlns",A)!==-1)&&(v=A,y=K,se(),F=!1)),u=d,G!==E&&(ue=E[Qa],ue===void 0&&(ue=E[Qa]=Object.create(null)),G=E);var Q=ue[d];if(Q!==void 0)d=Q;else{if(I=d.indexOf(":"),I!==-1){if(ae=E[d.substring(0,I)],!ae)return N("missing namespace on <"+u+">");d=d.substr(I+1)}else ae=E.xmlns;ae&&(d=ae+":"+d),ue[u]=d}}if(j&&(v=A,y=K,r&&(t?r(c,Kt,O,m):r(d,se,Kt,O,m),M)))return;if(O){if(i&&(i(t?c:d,Kt,j,m),M))return;R&&(j?E=Y:E=w.pop())}U+=1}}}function ts(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Ei={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},ns="property";function rs(e){return e.xml&&e.xml.serialize}function Vd(e){const t=rs(e);return t!==ns&&(t||null)}function $d(e){return e.charAt(0).toUpperCase()+e.slice(1)}function is(e,t){return ts(t)?e.prefix+":"+$d(e.localName):e.name}function jd(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+":"+r.slice(i.length):n}function Ud(e,t,n){const r=Ve(e,t.xmlns),i=`${t[r.prefix]||r.prefix}:${r.localName}`,o=Ve(i);var a=n.getPackage(o.prefix);return jd(o,a)}function Mt(e){return new Error(e)}function Et(e){return e.$descriptor}function zd(e){ne(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Mt("expected element");var n=this.elementsById,r=Et(t),i=r.idProperty,o;if(i&&(o=t.get(i.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw Mt("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Tn(){}Tn.prototype.handleEnd=function(){},Tn.prototype.handleText=function(){},Tn.prototype.handleNode=function(){};function _i(){}_i.prototype=Object.create(Tn.prototype),_i.prototype.handleNode=function(){return this};function cn(){}cn.prototype=Object.create(Tn.prototype),cn.prototype.handleText=function(e){this.body=(this.body||"")+e};function Pn(e,t){this.property=e,this.context=t}Pn.prototype=Object.create(cn.prototype),Pn.prototype.handleNode=function(e){if(this.element)throw Mt("expected no sub nodes");return this.element=this.createReference(e),this},Pn.prototype.handleEnd=function(){this.element.id=this.body},Pn.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function xi(e,t){this.element=t,this.propertyDesc=e}xi.prototype=Object.create(cn.prototype),xi.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=gi(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function cr(){}cr.prototype=Object.create(cn.prototype),cr.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function Ue(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}Ue.prototype=Object.create(cr.prototype),Ue.prototype.addReference=function(e){this.context.addReference(e)},Ue.prototype.handleText=function(e){var t=this.element,n=Et(t),r=n.bodyProperty;if(!r)throw Mt("unexpected body text <"+e+">");cn.prototype.handleText.call(this,e)},Ue.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Et(t),r=n.bodyProperty;r&&e!==void 0&&(e=gi(r.type,e),t.set(r.name,e))},Ue.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=Et(n),i=this.context,o=new n({}),a=this.model,s;return ee(t,function(f,p){var h=r.propertiesByName[p],m;h&&h.isReference?h.isMany?(m=f.split(" "),ee(m,function(_){i.addReference({element:o,property:h.ns.name,id:_})})):i.addReference({element:o,property:h.ns.name,id:f}):(h?f=gi(h.type,f):p==="xmlns"?p=":"+p:(s=Ve(p,r.ns.prefix),a.getPackage(s.prefix)&&i.addWarning({message:"unknown attribute <"+p+">",element:o,property:p,value:f})),o.set(p,f))}),o},Ue.prototype.getPropertyForNode=function(e){var t=e.name,n=Ve(t),r=this.type,i=this.model,o=Et(r),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){const p=Vd(s);if(p){const h=e.attributes[p];if(h){const m=Ud(h,e.ns,i),_=i.getType(m);return ne({},s,{effectiveType:Et(_).name})}}return s}var f=i.getPackage(n.prefix);if(f){const p=is(n,f),h=i.getType(p);if(s=ot(o.properties,function(m){return!m.isVirtual&&!m.isReference&&!m.isAttribute&&h.hasType(m.type)}),s)return ne({},s,{effectiveType:Et(h).name})}else if(s=ot(o.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}),s)return s;throw Mt("unrecognized element <"+n.name+">")},Ue.prototype.toString=function(){return"ElementDescriptor["+Et(this.type).name+"]"},Ue.prototype.valueHandler=function(e,t){return new xi(e,t)},Ue.prototype.referenceHandler=function(e){return new Pn(e,this.context)},Ue.prototype.handler=function(e){return e==="Element"?new un(this.model,e,this.context):new Ue(this.model,e,this.context)},Ue.prototype.handleChild=function(e){var t,n,r,i;if(t=this.getPropertyForNode(e),r=this.element,n=t.effectiveType||t.type,Ka(n))return this.valueHandler(t,r);t.isReference?i=this.referenceHandler(t).handleNode(e):i=this.handler(n).handleNode(e);var o=i.element;return o!==void 0&&(t.isMany?r.get(t.name).push(o):r.set(t.name,o),t.isReference?(ne(o,{element:r}),this.context.addReference(o)):o.$parent=r),i};function Si(e,t,n){Ue.call(this,e,t,n)}Si.prototype=Object.create(Ue.prototype),Si.prototype.createElement=function(e){var t=e.name,n=Ve(t),r=this.model,i=this.type,o=r.getPackage(n.prefix),a=o&&is(n,o)||t;if(!i.hasType(a))throw Mt("unexpected element <"+e.originalName+">");return Ue.prototype.createElement.call(this,e)};function un(e,t,n){this.model=e,this.context=n}un.prototype=Object.create(cr.prototype),un.prototype.createElement=function(e){var t=e.name,n=Ve(t),r=n.prefix,i=e.ns[r+"$uri"],o=e.attributes;return this.model.createAny(t,i,o)},un.prototype.handleChild=function(e){var t=new un(this.model,"Element",this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t},un.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Ai(e){e instanceof it&&(e={model:e}),ne(this,{lax:!1},e)}Ai.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof Ue?(r=t,t={}):typeof t=="string"?(r=this.handler(t),t={}):typeof r=="string"&&(r=this.handler(r));var i=this.model,o=this.lax,a=new zd(ne({},t,{rootHandler:r})),s=new es({proxy:!0}),f=Hd();r.context=a,f.push(r);function p(D,L,N){var x=L(),$=x.line,P=x.column,b=x.data;b.charAt(0)==="<"&&b.indexOf(" ")!==-1&&(b=b.slice(0,b.indexOf(" "))+">");var W="unparsable content "+(b?b+" ":"")+`detected
10
+ line: `+$+`
11
+ column: `+P+`
12
+ nested error: `+D.message;if(N)return a.addWarning({message:W,error:D}),!0;throw Mt(W)}function h(D,L){return p(D,L,!0)}function m(){var D=a.elementsById,L=a.references,N,x;for(N=0;x=L[N];N++){var $=x.element,P=D[x.id],b=Et($).propertiesByName[x.property];if(P||a.addWarning({message:"unresolved reference <"+x.id+">",element:x.element,property:x.property,value:x.id}),b.isMany){var W=$.get(b.name),ue=W.indexOf(x);ue===-1&&(ue=W.length),P?W[ue]=P:W.splice(ue,1)}else $.set(b.name,P)}}function _(){f.pop().handleEnd()}var B=/^<\?xml /i,H=/ encoding="([^"]+)"/i,F=/^utf-8$/i;function R(D){if(B.test(D)){var L=H.exec(D),N=L&&L[1];!N||F.test(N)||a.addWarning({message:"unsupported document encoding <"+N+">, falling back to UTF-8"})}}function S(D,L){var N=f.peek();try{f.push(N.handleNode(D))}catch(x){p(x,L,o)&&f.push(new _i)}}function M(D,L){try{f.peek().handleText(D)}catch(N){h(N,L)}}function w(D,L){D.trim()&&M(D,L)}var E=i.getPackages().reduce(function(D,L){return D[L.uri]=L.prefix,D},Object.entries(Ei).reduce(function(D,[L,N]){return D[N]=L,D},i.config&&i.config.nsMap||{}));return s.ns(E).on("openTag",function(D,L,N,x){var $=D.attrs||{},P=Object.keys($).reduce(function(W,ue){var G=L($[ue]);return W[ue]=G,W},{}),b={name:D.name,originalName:D.originalName,attributes:P,ns:D.ns};S(b,x)}).on("question",R).on("closeTag",_).on("cdata",M).on("text",function(D,L,N){w(L(D),N)}).on("error",p).on("warn",h),new Promise(function(D,L){var N;try{s.parse(e),m()}catch(W){N=W}var x=r.element;!N&&!x&&(N=Mt("failed to parse document as <"+r.type.$descriptor.name+">"));var $=a.warnings,P=a.references,b=a.elementsById;return N?(N.warnings=$,L(N)):D({rootElement:x,elementsById:b,references:P,warnings:$})})},Ai.prototype.handler=function(e){return new Si(this.model,e)};function Hd(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var Wd=`<?xml version="1.0" encoding="UTF-8"?>
13
+ `,qd=/<|>|'|"|&|\n\r|\n/g,os=/<|>|&/g;function ft(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}ft.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},ft.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},ft.prototype.byUri=function(e){return this.uriMap[e]||this.parent&&this.parent.byUri(e)},ft.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)},ft.prototype.uriByPrefix=function(e){return this.prefixMap[e||"xmlns"]||this.parent&&this.parent.uriByPrefix(e)},ft.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},ft.prototype.getNSKey=function(e){return e.prefix!==void 0?e.uri+"|"+e.prefix:e.uri},ft.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e);this.used[n]=this.byUri(t),this.parent&&this.parent.logUsed(e)},ft.prototype.getUsed=function(e){var t=[].concat(this.wellknown,this.custom);return t.filter(n=>{var r=this.getNSKey(n);return this.used[r]})};function Yd(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Kd(e,t){return ts(t)?Yd(e):e}function as(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function ss(e){return st(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function Gd(e){return e.getUsed().filter(function(t){return t.prefix!=="xml"}).map(function(t){var n="xmlns"+(t.prefix?":"+t.prefix:"");return{name:n,value:t.uri}})}function Xd(e,t){return t.isGeneric?ne({localName:t.ns.localName},e):ne({localName:Kd(t.ns.localName,t.$pkg)},e)}function Jd(e,t){return ne({localName:t.ns.localName},e)}function Zd(e){var t=e.$descriptor;return nn(t.properties,function(n){var r=n.name;if(n.isVirtual||!tn(e,r))return!1;var i=e[r];return i===n.default||i===null?!1:n.isMany?i.length:!0})}var Qd={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},eh={"<":"lt",">":"gt","&":"amp"};function ls(e,t,n){return e=st(e)?e:""+e,e.replace(t,function(r){return"&"+n[r]+";"})}function th(e){return ls(e,qd,Qd)}function nh(e){return ls(e,os,eh)}function rh(e){return nn(e,function(t){return t.isAttr})}function ih(e){return nn(e,function(t){return!t.isAttr})}function Ci(e){this.tagName=e}Ci.prototype.build=function(e){return this.element=e,this},Ci.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()};function Gt(){}Gt.prototype.serializeValue=Gt.prototype.serializeTo=function(e){e.append(this.escape?nh(this.value):this.value)},Gt.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(os)!==-1&&(this.escape=!0),this};function ki(e){this.tagName=e}as(ki,Gt),ki.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()};function xe(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}xe.prototype.build=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,r,i,o=t.isGeneric;return o?r=this.parseGenericNsAttributes(e):r=this.parseNsAttributes(e),n?this.ns=this.nsPropertyTagName(n):this.ns=this.nsTagName(t),this.tagName=this.addTagName(this.ns),o?this.parseGenericContainments(e):(i=Zd(e),this.parseAttributes(rh(i)),this.parseContainments(ih(i))),this.parseGenericAttributes(e,r),this},xe.prototype.nsTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Xd(t,e)},xe.prototype.nsPropertyTagName=function(e){var t=this.logNamespaceUsed(e.ns);return Jd(t,e)},xe.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},xe.prototype.nsAttributeName=function(e){var t;if(st(e)?t=Ve(e):t=e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:ne({localName:t.localName},n)},xe.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([t,n])=>({name:t,value:n}))},xe.prototype.parseGenericContainments=function(e){var t=e.$body;t&&this.body.push(new Gt().build({type:"String"},t));var n=e.$children;n&&ee(n,r=>{this.body.push(new xe(this).build(r))})},xe.prototype.parseNsAttribute=function(e,t,n){var r=e.$model,i=Ve(t),o;if(i.prefix==="xmlns"&&(o={prefix:i.localName,uri:n}),!i.prefix&&i.localName==="xmlns"&&(o={uri:n}),!o)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(o,!0,!0);else{var a=this.logNamespaceUsed(o,!0);this.getNamespaces().logUsed(a)}},xe.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return ee(n,function(i,o){var a=t.parseNsAttribute(e,o,i);a&&r.push(a)}),r},xe.prototype.parseGenericAttributes=function(e,t){var n=this;ee(t,function(r){try{n.addAttribute(n.nsAttributeName(r.name),r.value)}catch(i){typeof console<"u"&&console.warn(`missing namespace information for <${r.name}=${r.value}> on`,e,i)}})},xe.prototype.parseContainments=function(e){var t=this,n=this.body,r=this.element;ee(e,function(i){var o=r.get(i.name),a=i.isReference,s=i.isMany;if(s||(o=[o]),i.isBody)n.push(new Gt().build(i,o[0]));else if(Ka(i.type))ee(o,function(p){n.push(new ki(t.addTagName(t.nsPropertyTagName(i))).build(i,p))});else if(a)ee(o,function(p){n.push(new Ci(t.addTagName(t.nsPropertyTagName(i))).build(p))});else{var f=rs(i);ee(o,function(p){var h;f?f===ns?h=new xe(t,i):h=new ur(t,i,f):h=new xe(t),n.push(h.build(p))})}})},xe.prototype.getNamespaces=function(e){var t=this.namespaces,n=this.parent,r;return t||(r=n&&n.getNamespaces(),e||!r?this.namespaces=t=new ft(r):t=r),t},xe.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,o=e.prefix,a=r.byUri(i);return(!a||n)&&r.add(e,t),r.mapPrefix(o,i),e},xe.prototype.logNamespaceUsed=function(e,t){var n=this.getNamespaces(t),r=e.prefix,i=e.uri,o,a,s;if(!r&&!i)return{localName:e.localName};if(s=n.defaultUriByPrefix(r),i=i||s||n.uriByPrefix(r),!i)throw new Error("no namespace uri given for prefix <"+r+">");if(e=n.byUri(i),!e&&!r&&(e=this.logNamespace({uri:i},s===i,!0)),!e){for(o=r,a=1;n.uriByPrefix(o);)o=r+"_"+a++;e=this.logNamespace({prefix:o,uri:i},s===i)}return r&&n.mapPrefix(r,i),e},xe.prototype.parseAttributes=function(e){var t=this,n=this.element;ee(e,function(r){var i=n.get(r.name);if(r.isReference)if(!r.isMany)i=i.id;else{var o=[];ee(i,function(a){o.push(a.id)}),i=o.join(" ")}t.addAttribute(t.nsAttributeName(r),i)})},xe.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),ss(e)},xe.prototype.addAttribute=function(e,t){var n=this.attrs;st(t)&&(t=th(t));var r=zu(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),i={name:e,value:t};r!==-1?n.splice(r,1,i):n.push(i)},xe.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=Gd(n).concat(t)),ee(t,function(r){e.append(" ").append(ss(r.name)).append('="').append(r.value).append('"')})},xe.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Gt;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),ee(this.body,function(r){r.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()};function ur(e,t,n){xe.call(this,e,t),this.serialization=n}as(ur,xe),ur.prototype.parseNsAttributes=function(e){var t=xe.prototype.parseNsAttributes.call(this,e).filter(a=>a.name!==this.serialization),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),o=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(r.prefix?r.prefix+":":"")+o+n.ns.localName),t},ur.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function oh(){this.value="",this.write=function(e){this.value+=e}}function ah(e,t){var n=[""];this.append=function(r){return e.write(r),this},this.appendNewLine=function(){return t&&e.write(`
14
+ `),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function sh(e){e=ne({format:!1,preamble:!0},e||{});function t(n,r){var i=r||new oh,o=new ah(i,e.format);e.preamble&&o.append(Wd);var a=new xe,s=n.$model;if(a.getNamespaces().mapDefaultPrefixes(lh(s)),a.build(n).serializeTo(o),!r)return i.value}return{toXML:t}}function lh(e){const t=e.config&&e.config.nsMap||{},n={};for(const r in Ei)n[r]=Ei[r];for(const r in t){const i=t[r];n[i]=r}for(const r of e.getPackages())n[r.prefix]=r.uri;return n}function fr(e,t){it.call(this,e,t)}fr.prototype=Object.create(it.prototype),fr.prototype.fromXML=function(e,t,n){st(t)||(n=t,t="bpmn:Definitions");var r=new Ai(ne({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)},fr.prototype.toXML=function(e,t){var n=new sh(t);return new Promise(function(r,i){try{var o=n.toXML(e);return r({xml:o})}catch(a){return i(a)}})};var ch="BPMN20",uh="http://www.omg.org/spec/BPMN/20100524/MODEL",fh="bpmn",ph=[],dh=[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],hh=[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],mh={tagAlias:"lowerCase",typePrefix:"t"},yh={name:ch,uri:uh,prefix:fh,associations:ph,types:dh,enumerations:hh,xml:mh},gh="BPMNDI",vh="http://www.omg.org/spec/BPMN/20100524/DI",wh="bpmndi",bh=[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],Eh=[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],_h=[],xh={name:gh,uri:vh,prefix:wh,types:bh,enumerations:Eh,associations:_h},Sh="DC",Ah="http://www.omg.org/spec/DD/20100524/DC",Ch="dc",kh=[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],Rh=[],Th={name:Sh,uri:Ah,prefix:Ch,types:kh,associations:Rh},Ph="DI",Nh="http://www.omg.org/spec/DD/20100524/DI",Oh="di",Dh=[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],Mh=[],Bh={tagAlias:"lowerCase"},Ih={name:Ph,uri:Nh,prefix:Oh,types:Dh,associations:Mh,xml:Bh},Lh="bpmn.io colors for BPMN",Fh="http://bpmn.io/schema/bpmn/biocolor/1.0",Vh="bioc",$h=[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],jh=[],Uh=[],zh={name:Lh,uri:Fh,prefix:Vh,types:$h,enumerations:jh,associations:Uh},Hh="BPMN in Color",Wh="http://www.omg.org/spec/BPMN/non-normative/color/1.0",qh="color",Yh=[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],Kh=[],Gh=[],Xh={name:Hh,uri:Wh,prefix:qh,types:Yh,enumerations:Kh,associations:Gh};const Jh={bpmn:yh,bpmndi:xh,dc:Th,di:Ih,bioc:zh,color:Xh};function Zh(e,t){const n=ne({},Jh,e);return new fr(n,t)}function We(e,t){return e.$instanceOf(t)}function Qh(e){return ot(e.rootElements,function(t){return We(t,"bpmn:Process")||We(t,"bpmn:Collaboration")})}function em(e){var t={},n=[],r={};function i(k,A){return function(I){k(I,A)}}function o(k){t[k.id]=k}function a(k){return t[k.id]}function s(k,A){var I=k.gfx;if(I)throw new Error(`already rendered ${Fe(k)}`);return e.element(k,r[k.id],A)}function f(k,A){return e.root(k,r[k.id],A)}function p(k,A){try{var I=r[k.id]&&s(k,A);return o(k),I}catch(ie){h(ie.message,{element:k,error:ie}),console.error(`failed to import ${Fe(k)}`,ie)}}function h(k,A){e.error(k,A)}var m=this.registerDi=function(A){var I=A.bpmnElement;I?r[I.id]?h(`multiple DI elements defined for ${Fe(I)}`,{element:I}):r[I.id]=A:h(`no bpmnElement referenced in ${Fe(A)}`,{element:A})};function _(k){B(k.plane)}function B(k){m(k),ee(k.planeElement,H)}function H(k){m(k)}this.handleDefinitions=function(A,I){var ie=A.diagrams;if(I&&ie.indexOf(I)===-1)throw new Error("diagram not part of <bpmn:Definitions />");if(!I&&ie&&ie.length&&(I=ie[0]),!I)throw new Error("no diagram to display");r={},_(I);var ae=I.plane;if(!ae)throw new Error(`no plane for ${Fe(I)}`);var d=ae.bpmnElement;if(!d)if(d=Qh(A),d)h(`correcting missing bpmnElement on ${Fe(ae)} to ${Fe(d)}`),ae.bpmnElement=d,m(ae);else throw new Error("no process or collaboration to display");var u=f(d,ae);if(We(d,"bpmn:Process")||We(d,"bpmn:SubProcess"))R(d,u);else if(We(d,"bpmn:Collaboration"))U(d,u),S(A.rootElements,u);else throw new Error(`unsupported bpmnElement for ${Fe(ae)}: ${Fe(d)}`);F(n)};var F=this.handleDeferred=function(){for(var A;n.length;)A=n.shift(),A()};function R(k,A){j(k,A),$(k.ioSpecification,A),x(k.artifacts,A),o(k)}function S(k,A){var I=nn(k,function(ie){return!a(ie)&&We(ie,"bpmn:Process")&&ie.laneSets});I.forEach(i(R,A))}function M(k,A){p(k,A)}function w(k,A){ee(k,i(M,A))}function E(k,A){p(k,A)}function D(k,A){p(k,A)}function L(k,A){p(k,A)}function N(k,A){p(k,A)}function x(k,A){ee(k,function(I){We(I,"bpmn:Association")?n.push(function(){N(I,A)}):N(I,A)})}function $(k,A){k&&(ee(k.dataInputs,i(D,A)),ee(k.dataOutputs,i(L,A)))}var P=this.handleSubProcess=function(A,I){j(A,I),x(A.artifacts,I)};function b(k,A){var I=p(k,A);We(k,"bpmn:SubProcess")&&P(k,I||A),We(k,"bpmn:Activity")&&$(k.ioSpecification,A),n.push(function(){ee(k.dataInputAssociations,i(E,A)),ee(k.dataOutputAssociations,i(E,A))})}function W(k,A){p(k,A)}function ue(k,A){p(k,A)}function G(k,A){n.push(function(){var I=p(k,A);k.childLaneSet&&Y(k.childLaneSet,I||A),K(k)})}function Y(k,A){ee(k.lanes,i(G,A))}function T(k,A){ee(k,i(Y,A))}function j(k,A){O(k.flowElements,A),k.laneSets&&T(k.laneSets,A)}function O(k,A){ee(k,function(I){We(I,"bpmn:SequenceFlow")?n.push(function(){W(I,A)}):We(I,"bpmn:BoundaryEvent")?n.unshift(function(){b(I,A)}):We(I,"bpmn:FlowNode")?b(I,A):We(I,"bpmn:DataObject")||(We(I,"bpmn:DataStoreReference")||We(I,"bpmn:DataObjectReference")?ue(I,A):h(`unrecognized flowElement ${Fe(I)} in context ${Fe(A&&A.businessObject)}`,{element:I,context:A}))})}function q(k,A){var I=p(k,A),ie=k.processRef;ie&&R(ie,I||A)}function U(k,A){ee(k.participants,i(q,A)),n.push(function(){w(k.messageFlows,A)}),x(k.artifacts,A)}function K(k){ee(k.flowNodeRef,function(A){var I=A.get("lanes");I&&I.push(k)})}}function tm(e,t,n){var r,i,o,a,s=[];function f(p,h){var m={root:function(F,R){return r.add(F,R)},element:function(F,R,S){return r.add(F,R,S)},error:function(F,R){s.push({message:F,context:R})}},_=new em(m);h=h||p.diagrams&&p.diagrams[0];var B=nm(p,h);if(!B)throw new Error("no diagram to display");ee(B,function(F){_.handleDefinitions(p,F)});var H=h.plane.bpmnElement.id;o.setRootElement(o.findRoot(H+"_plane")||o.findRoot(H))}return new Promise(function(p,h){try{return r=e.get("bpmnImporter"),i=e.get("eventBus"),o=e.get("canvas"),i.fire("import.render.start",{definitions:t}),f(t,n),i.fire("import.render.complete",{error:a,warnings:s}),p({warnings:s})}catch(m){return m.warnings=s,h(m)}})}function nm(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,r=n;!re(n,"bpmn:Process")&&!re(n,"bpmn:Collaboration")&&(r=rm(n));var i;re(r,"bpmn:Collaboration")?i=r:i=ot(e.rootElements,function(p){if(re(p,"bpmn:Collaboration"))return ot(p.participants,function(h){return h.processRef===r})});var o=[r];i&&(o=Hu(i.participants,function(p){return p.processRef}),o.push(i));var a=cs(o),s=[t],f=[n];return ee(e.diagrams,function(p){if(p.plane){var h=p.plane.bpmnElement;a.indexOf(h)!==-1&&f.indexOf(h)===-1&&(s.push(p),f.push(h))}}),s}}function cs(e){var t=[];return ee(e,function(n){n&&(t.push(n),t=t.concat(cs(n.flowElements)))}),t}function rm(e){for(var t=e;t;){if(re(t,"bpmn:Process"))return t;t=t.$parent}}var im='<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>',us=im,fs={verticalAlign:"middle"},ps={color:"#404040"},om={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},am={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},sm={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"},lm='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+us+'</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>',pt;function cm(){pt=ut(lm),Xe(pt,om),Xe(gt("svg",pt),fs),Xe(gt(".backdrop",pt),am),Xe(gt(".notice",pt),sm),Xe(gt(".link",pt),ps,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function um(){pt||(cm(),oi.bind(pt,".backdrop","click",function(e){document.body.removeChild(pt)})),document.body.appendChild(pt)}const pr=5,ds="djs-outline-hidden";function Te(e){e=ne({},pm,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),hm(this._container)}at(Te,Nt),Te.prototype.importXML=async function(t,n){const r=this;function i(a){return r.get("eventBus").createEvent(a)}let o=[];try{t=this._emit("import.parse.start",{xml:t})||t;let a;try{a=await this._moddle.fromXML(t,"bpmn:Definitions")}catch(_){throw this._emit("import.parse.complete",{error:_}),_}let s=a.rootElement;const f=a.references,p=a.warnings,h=a.elementsById;o=o.concat(p),s=this._emit("import.parse.complete",i({error:null,definitions:s,elementsById:h,references:f,warnings:o}))||s;const m=await this.importDefinitions(s,n);return o=o.concat(m.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(a){let s=a;throw o=o.concat(s.warnings||[]),dr(s,o),s=fm(s),this._emit("import.done",{error:s,warnings:s.warnings}),s}},Te.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}},Te.prototype.open=async function(t){const n=this._definitions;let r=t;if(!n){const o=new Error("no XML imported");throw dr(o,[]),o}if(typeof t=="string"&&(r=dm(n,t),!r)){const o=new Error("BPMNDiagram <"+t+"> not found");throw dr(o,[]),o}try{this.clear()}catch(o){throw dr(o,[]),o}const{warnings:i}=await tm(this,n,r);return{warnings:i}},Te.prototype.saveXML=async function(t){t=t||{};let n=this._definitions,r,i;try{if(!n)throw new 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(a){r=a}const o=r?{error:r}:{xml:i};if(this._emit("saveXML.done",o),r)throw r;return o},Te.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{const r=this.get("canvas"),i=r.getActiveLayer(),o=gt(":scope > defs",r._svg),a=Zo(i),s=o?"<defs>"+Zo(o)+"</defs>":"",f=r.getContainer();Ht(f).add(ds);let p;try{p=i.getBBox()}finally{Ht(f).remove(ds)}const h=p.x-pr,m=p.y-pr,_=p.width+pr*2,B=p.height+pr*2;t=`<?xml version="1.0" encoding="utf-8"?>
15
+ <!-- created with bpmn-js / http://bpmn.io -->
16
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
17
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+_+'" height="'+B+'" viewBox="'+h+" "+m+" "+_+" "+B+'" version="1.1">'+s+a+"</svg>"}catch(r){n=r}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}},Te.prototype._setDefinitions=function(e){this._definitions=e},Te.prototype.getModules=function(){return this._modules},Te.prototype.clear=function(){this.getDefinitions()&&Nt.prototype.clear.call(this)},Te.prototype.destroy=function(){Nt.prototype.destroy.call(this),Gn(this._container)},Te.prototype.on=function(e,t,n,r){return this.get("eventBus").on(e,t,n,r)},Te.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Te.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=gt(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Te.prototype.getDefinitions=function(){return this._definitions},Te.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Te.prototype._init=function(e,t,n){const r=n.modules||this.getModules(n),i=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,r,i),s=ne(Gu(n,["additionalModules"]),{canvas:ne({},n.canvas,{container:e}),modules:a});Nt.call(this,s),n&&n.container&&this.attachTo(n.container)},Te.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Te.prototype._createContainer=function(e){const t=ut('<div class="bjs-container"></div>');return Xe(t,{width:hs(e.width),height:hs(e.height),position:e.position}),t},Te.prototype._createModdle=function(e){const t=ne({},this._moddleExtensions,e.moddleExtensions);return new Zh(t)},Te.prototype._modules=[];function dr(e,t){return e.warnings=t,e}function fm(e){const n=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return n&&(e.message="unparsable content <"+n[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+n[2]),e}const pm={width:"100%",height:"100%",position:"relative"};function hs(e){return e+(St(e)?"px":"")}function dm(e,t){return t&&ot(e.diagrams,function(n){return n.id===t})||null}function hm(e){const n='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+us+"</a>",r=ut(n);Xe(gt("svg",r),fs),Xe(r,ps,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(r),Rt.bind(r,"click",function(i){um(),i.preventDefault()})}function hr(e){Te.call(this,e)}at(hr,Te),hr.prototype._modules=[Cp,Wp,ga,Zp,pa],hr.prototype._moddleExtensions={};function ms(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ri(e){return Math.log(e)/Math.log(10)}function ys(e,t){var n=Ri(e.min),r=Ri(e.max),i=Math.abs(n)+Math.abs(r);return i/t}function mm(e,t){return Math.max(e.min,Math.min(e.max,t))}var ym=Math.sign||function(e){return e>=0?1:-1},Ti={min:.2,max:4},gs=10,gm=.1,vm=.75;function dt(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=At(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||vm;var r=this;t.on("canvas.mouseover",function(){r._init(e.enabled!==!1)}),t.on("canvas.mouseout",function(){r._init(!1)})}dt.$inject=["config.zoomScroll","eventBus","canvas"],dt.prototype.scroll=function(t){this._canvas.scroll(t)},dt.prototype.reset=function(){this._canvas.zoom("fit-viewport")},dt.prototype.zoom=function(t,n){var r=ys(Ti,gs*2);this._totalDelta+=t,Math.abs(this._totalDelta)>gm&&(this._zoom(t,n,r),this._totalDelta=0)},dt.prototype._handleWheel=function(t){if(this._enabled){var n=this._container;t.preventDefault();var r=t.ctrlKey||qp()&&t.metaKey,i=t.shiftKey,o=-1*this._scale,a;if(r?o*=t.deltaMode===0?.02:.32:o*=t.deltaMode===0?1:16,r){var s=n.getBoundingClientRect(),f={x:t.clientX-s.left,y:t.clientY-s.top};a=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*ym(t.deltaY)*o,this.zoom(a,f)}else i?a={dx:o*t.deltaY,dy:0}:a={dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(a)}},dt.prototype.stepZoom=function(t,n){var r=ys(Ti,gs);this._zoom(t,n,r)},dt.prototype._zoom=function(e,t,n){var r=this._canvas,i=e>0?1:-1,o=Ri(r.zoom()),a=Math.round(o/n)*n;a+=n*i;var s=Math.pow(10,a);r.zoom(mm(Ti,s),t)},dt.prototype.toggle=function(t){var n=this._container,r=this._handleWheel,i=this._enabled;return typeof t>"u"&&(t=!i),i!==t&&Rt[t?"bind":"unbind"](n,"wheel",r,!1),this._enabled=t,t},dt.prototype._init=function(e){this.toggle(e)};const wm={__init__:["zoomScroll"],zoomScroll:["type",dt]};var bm=/^djs-cursor-.*$/;function vs(e){var t=Ht(document.body);t.removeMatching(bm),e&&t.add("djs-cursor-"+e)}function Em(){vs(null)}var _m=5e3;function xm(e,t){t=t||"element.click";function n(){return!1}return e.once(t,_m,n),function(){e.off(t,n)}}var Sm=15;function ws(e,t){var n;function r(s){return a(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,r):e.off("element.mousedown",r)});function i(s){var f=n.start,p=n.button,h=Sa(s),m=ms(h,f);if(!n.dragging&&Am(m)>Sm&&(n.dragging=!0,p===0&&xm(e),vs("grab")),n.dragging){var _=n.last||n.start;m=ms(h,_),t.scroll({dx:m.x,dy:m.y}),n.last=h}s.preventDefault()}function o(s){Rt.unbind(document,"mousemove",i),Rt.unbind(document,"mouseup",o),n=null,Em()}function a(s){if(!ra(s.target,".djs-draggable")){var f=s.button;if(!(f>=2||s.ctrlKey||s.shiftKey||s.altKey))return n={button:f,start:Sa(s)},Rt.bind(document,"mousemove",i),Rt.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}ws.$inject=["eventBus","canvas"];function Am(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}const Cm={__init__:["moveCanvas"],moveCanvas:["type",ws]},km={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:JSON.parse('[{"name":"Definitions","isAbstract":true,"extends":["bpmn:Definitions"],"properties":[{"name":"diagramRelationId","isAttr":true,"type":"String"}]},{"name":"InOutBinding","superClass":["Element"],"isAbstract":true,"properties":[{"name":"source","isAttr":true,"type":"String"},{"name":"sourceExpression","isAttr":true,"type":"String"},{"name":"target","isAttr":true,"type":"String"},{"name":"businessKey","isAttr":true,"type":"String"},{"name":"local","isAttr":true,"type":"Boolean","default":false},{"name":"variables","isAttr":true,"type":"String"}]},{"name":"In","superClass":["InOutBinding"],"meta":{"allowedIn":["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{"name":"Out","superClass":["InOutBinding"],"meta":{"allowedIn":["bpmn:CallActivity"]}},{"name":"AsyncCapable","isAbstract":true,"extends":["bpmn:Activity","bpmn:Gateway","bpmn:Event"],"properties":[{"name":"async","isAttr":true,"type":"Boolean","default":false},{"name":"asyncBefore","isAttr":true,"type":"Boolean","default":false},{"name":"asyncAfter","isAttr":true,"type":"Boolean","default":false},{"name":"exclusive","isAttr":true,"type":"Boolean","default":true}]},{"name":"JobPriorized","isAbstract":true,"extends":["bpmn:Process","camunda:AsyncCapable"],"properties":[{"name":"jobPriority","isAttr":true,"type":"String"}]},{"name":"SignalEventDefinitionExtension","isAbstract":true,"extends":["bpmn:SignalEventDefinition"],"properties":[{"name":"async","isAttr":true,"type":"Boolean","default":false}]},{"name":"ErrorEventDefinitionExtension","isAbstract":true,"extends":["bpmn:ErrorEventDefinition"],"properties":[{"name":"errorCodeVariable","isAttr":true,"type":"String"},{"name":"errorMessageVariable","isAttr":true,"type":"String"}]},{"name":"ErrorEventDefinition","superClass":["bpmn:ErrorEventDefinition","Element"],"properties":[{"name":"expression","isAttr":true,"type":"String"}],"meta":{"allowedIn":["bpmn:ServiceTask"]}},{"name":"Error","isAbstract":true,"extends":["bpmn:Error"],"properties":[{"name":"camunda:errorMessage","isAttr":true,"type":"String"}]},{"name":"PotentialStarter","superClass":["Element"],"properties":[{"name":"resourceAssignmentExpression","type":"bpmn:ResourceAssignmentExpression"}]},{"name":"FormSupported","isAbstract":true,"extends":["bpmn:StartEvent","bpmn:UserTask"],"properties":[{"name":"formHandlerClass","isAttr":true,"type":"String"},{"name":"formKey","isAttr":true,"type":"String"},{"name":"formRef","isAttr":true,"type":"String"},{"name":"formRefBinding","isAttr":true,"type":"String"},{"name":"formRefVersion","isAttr":true,"type":"String"}]},{"name":"TemplateSupported","isAbstract":true,"extends":["bpmn:Collaboration","bpmn:Process","bpmn:FlowElement"],"properties":[{"name":"modelerTemplate","isAttr":true,"type":"String"},{"name":"modelerTemplateVersion","isAttr":true,"type":"Integer"}]},{"name":"Initiator","isAbstract":true,"extends":["bpmn:StartEvent"],"properties":[{"name":"initiator","isAttr":true,"type":"String"}]},{"name":"ScriptTask","isAbstract":true,"extends":["bpmn:ScriptTask"],"properties":[{"name":"resultVariable","isAttr":true,"type":"String"},{"name":"resource","isAttr":true,"type":"String"}]},{"name":"Process","isAbstract":true,"extends":["bpmn:Process"],"properties":[{"name":"candidateStarterGroups","isAttr":true,"type":"String"},{"name":"candidateStarterUsers","isAttr":true,"type":"String"},{"name":"versionTag","isAttr":true,"type":"String"},{"name":"historyTimeToLive","isAttr":true,"type":"String"},{"name":"isStartableInTasklist","isAttr":true,"type":"Boolean","default":true}]},{"name":"EscalationEventDefinitionExtension","isAbstract":true,"extends":["bpmn:EscalationEventDefinition"],"properties":[{"name":"escalationCodeVariable","isAttr":true,"type":"String"}]},{"name":"FormalExpression","isAbstract":true,"extends":["bpmn:FormalExpression"],"properties":[{"name":"resource","isAttr":true,"type":"String"}]},{"name":"Assignable","extends":["bpmn:UserTask"],"properties":[{"name":"assignee","isAttr":true,"type":"String"},{"name":"candidateUsers","isAttr":true,"type":"String"},{"name":"candidateGroups","isAttr":true,"type":"String"},{"name":"dueDate","isAttr":true,"type":"String"},{"name":"followUpDate","isAttr":true,"type":"String"},{"name":"priority","isAttr":true,"type":"String"}]},{"name":"CallActivity","extends":["bpmn:CallActivity"],"properties":[{"name":"calledElementBinding","isAttr":true,"type":"String","default":"latest"},{"name":"calledElementVersion","isAttr":true,"type":"String"},{"name":"calledElementVersionTag","isAttr":true,"type":"String"},{"name":"calledElementTenantId","isAttr":true,"type":"String"},{"name":"caseRef","isAttr":true,"type":"String"},{"name":"caseBinding","isAttr":true,"type":"String","default":"latest"},{"name":"caseVersion","isAttr":true,"type":"String"},{"name":"caseTenantId","isAttr":true,"type":"String"},{"name":"variableMappingClass","isAttr":true,"type":"String"},{"name":"variableMappingDelegateExpression","isAttr":true,"type":"String"}]},{"name":"ServiceTaskLike","extends":["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"resultVariable","isAttr":true,"type":"String"}]},{"name":"DmnCapable","extends":["bpmn:BusinessRuleTask"],"properties":[{"name":"decisionRef","isAttr":true,"type":"String"},{"name":"decisionRefBinding","isAttr":true,"type":"String","default":"latest"},{"name":"decisionRefVersion","isAttr":true,"type":"String"},{"name":"mapDecisionResult","isAttr":true,"type":"String","default":"resultList"},{"name":"decisionRefTenantId","isAttr":true,"type":"String"}]},{"name":"ExternalCapable","extends":["camunda:ServiceTaskLike"],"properties":[{"name":"type","isAttr":true,"type":"String"},{"name":"topic","isAttr":true,"type":"String"}]},{"name":"TaskPriorized","extends":["bpmn:Process","camunda:ExternalCapable"],"properties":[{"name":"taskPriority","isAttr":true,"type":"String"}]},{"name":"Properties","superClass":["Element"],"meta":{"allowedIn":["*"]},"properties":[{"name":"values","type":"Property","isMany":true}]},{"name":"Property","superClass":["Element"],"properties":[{"name":"id","type":"String","isAttr":true},{"name":"name","type":"String","isAttr":true},{"name":"value","type":"String","isAttr":true}]},{"name":"Connector","superClass":["Element"],"meta":{"allowedIn":["camunda:ServiceTaskLike"]},"properties":[{"name":"inputOutput","type":"InputOutput"},{"name":"connectorId","type":"String"}]},{"name":"InputOutput","superClass":["Element"],"meta":{"allowedIn":["bpmn:FlowNode","camunda:Connector"]},"properties":[{"name":"inputOutput","type":"InputOutput"},{"name":"connectorId","type":"String"},{"name":"inputParameters","isMany":true,"type":"InputParameter"},{"name":"outputParameters","isMany":true,"type":"OutputParameter"}]},{"name":"InputOutputParameter","properties":[{"name":"name","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"},{"name":"definition","type":"InputOutputParameterDefinition"}]},{"name":"InputOutputParameterDefinition","isAbstract":true},{"name":"List","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"items","isMany":true,"type":"InputOutputParameterDefinition"}]},{"name":"Map","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"entries","isMany":true,"type":"Entry"}]},{"name":"Entry","properties":[{"name":"key","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"},{"name":"definition","type":"InputOutputParameterDefinition"}]},{"name":"Value","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"id","isAttr":true,"type":"String"},{"name":"name","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"}]},{"name":"Script","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"scriptFormat","isAttr":true,"type":"String"},{"name":"resource","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"}]},{"name":"Field","superClass":["Element"],"meta":{"allowedIn":["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},"properties":[{"name":"name","isAttr":true,"type":"String"},{"name":"expression","type":"String"},{"name":"stringValue","isAttr":true,"type":"String"},{"name":"string","type":"String"}]},{"name":"InputParameter","superClass":["InputOutputParameter"]},{"name":"OutputParameter","superClass":["InputOutputParameter"]},{"name":"Collectable","isAbstract":true,"extends":["bpmn:MultiInstanceLoopCharacteristics"],"superClass":["camunda:AsyncCapable"],"properties":[{"name":"collection","isAttr":true,"type":"String"},{"name":"elementVariable","isAttr":true,"type":"String"}]},{"name":"FailedJobRetryTimeCycle","superClass":["Element"],"meta":{"allowedIn":["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},"properties":[{"name":"body","isBody":true,"type":"String"}]},{"name":"ExecutionListener","superClass":["Element"],"meta":{"allowedIn":["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"event","isAttr":true,"type":"String"},{"name":"script","type":"Script"},{"name":"fields","type":"Field","isMany":true}]},{"name":"TaskListener","superClass":["Element"],"meta":{"allowedIn":["bpmn:UserTask"]},"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"event","isAttr":true,"type":"String"},{"name":"script","type":"Script"},{"name":"fields","type":"Field","isMany":true},{"name":"id","type":"String","isAttr":true},{"name":"eventDefinitions","type":"bpmn:TimerEventDefinition","isMany":true}]},{"name":"FormProperty","superClass":["Element"],"meta":{"allowedIn":["bpmn:StartEvent","bpmn:UserTask"]},"properties":[{"name":"id","type":"String","isAttr":true},{"name":"name","type":"String","isAttr":true},{"name":"type","type":"String","isAttr":true},{"name":"required","type":"String","isAttr":true},{"name":"readable","type":"String","isAttr":true},{"name":"writable","type":"String","isAttr":true},{"name":"variable","type":"String","isAttr":true},{"name":"expression","type":"String","isAttr":true},{"name":"datePattern","type":"String","isAttr":true},{"name":"default","type":"String","isAttr":true},{"name":"values","type":"Value","isMany":true}]},{"name":"FormData","superClass":["Element"],"meta":{"allowedIn":["bpmn:StartEvent","bpmn:UserTask"]},"properties":[{"name":"fields","type":"FormField","isMany":true},{"name":"businessKey","type":"String","isAttr":true}]},{"name":"FormField","superClass":["Element"],"properties":[{"name":"id","type":"String","isAttr":true},{"name":"label","type":"String","isAttr":true},{"name":"type","type":"String","isAttr":true},{"name":"datePattern","type":"String","isAttr":true},{"name":"defaultValue","type":"String","isAttr":true},{"name":"properties","type":"Properties"},{"name":"validation","type":"Validation"},{"name":"values","type":"Value","isMany":true}]},{"name":"Validation","superClass":["Element"],"properties":[{"name":"constraints","type":"Constraint","isMany":true}]},{"name":"Constraint","superClass":["Element"],"properties":[{"name":"name","type":"String","isAttr":true},{"name":"config","type":"String","isAttr":true}]},{"name":"ConditionalEventDefinitionExtension","isAbstract":true,"extends":["bpmn:ConditionalEventDefinition"],"properties":[{"name":"variableName","isAttr":true,"type":"String"},{"name":"variableEvents","isAttr":true,"type":"String"}]}]'),emumerations:[]},Rm={class:"task-track"},Tm={class:"subject-container"},Pm={class:"track-table"},Nm=_t(l.defineComponent({name:"UiFlowTaskTrack",__name:"TaskTrack",props:l.mergeModels({data:{default:()=>[]}},{isHide:{type:Boolean,default:!1},isHideModifiers:{}}),emits:["update:isHide"],setup(e){const t=l.useModel(e,"isHide"),n={currentPage:1,pageSize:20,total:0},r=[{label:"办理环节",prop:"activityName",minWidth:"200px"},{label:"办理人",prop:"assigneesNames",minWidth:"200px"},{label:"办理方式",prop:"dealTypeLabel",width:"180px"},{label:"开始时间",prop:"startTime",width:"180px",formatter:i=>i.startTime?Hn(i.startTime).format("YYYY-MM-DD HH:mm:ss"):""},{label:"结束时间",prop:"endTime",width:"180px",formatter:i=>i.endTime?Hn(i.endTime).format("YYYY-MM-DD HH:mm:ss"):""},{label:"滞留时长",prop:"duration",width:"140px",formatter:i=>typeof i.duration=="string"?i.duration.split(",").join(""):i.duration||""},{label:"处理状态",prop:"stateLabel",width:"100px"}];return(i,o)=>{const a=l.resolveComponent("el-icon");return l.openBlock(),l.createElementBlock("div",Rm,[l.createElementVNode("div",Tm,[o[1]||(o[1]=l.createElementVNode("div",{class:"subject-heading"},[l.createElementVNode("div",{class:"subject-line"}),l.createElementVNode("div",{class:"subject-title"},"办理轨迹")],-1)),l.createElementVNode("button",{class:"hide-btn",type:"button",onClick:o[0]||(o[0]=s=>t.value=!t.value)},[l.createVNode(a,null,{default:l.withCtx(()=>[t.value?(l.openBlock(),l.createBlock(l.unref(Ns),{key:0})):(l.openBlock(),l.createBlock(l.unref(Ts),{key:1}))]),_:1}),l.createElementVNode("span",null,l.toDisplayString(t.value?"显示":"隐藏"),1)])]),l.withDirectives(l.createElementVNode("div",Pm,[l.createVNode(Mo,{data:e.data,"hide-number":!1,"hide-page":!0,"hide-selection":!0,"page-config":n,"table-label":r,"table-height":"100%"},null,8,["data"])],512),[[l.vShow,!t.value]])])}}}),[["__scopeId","data-v-8c8b5c11"]]),Pi=e=>_e({url:"/flowstream/server/runtime/event/get",method:"post",data:e}),Ni=e=>_e({url:"/flowstream/server/history/trackinst/event/query",method:"post",data:e}),Om=Object.freeze(Object.defineProperty({__proto__:null,activateFlow:e=>_e({url:"/flowstream/server/runtime/event/activate",method:"post",data:e}),flowMonitorLine:Pi,flowTrack:Ni,suspendFlow:e=>_e({url:"/flowstream/server/runtime/event/suspend",method:"post",data:e}),terminateFlow:e=>_e({url:"/flowstream/server/runtime/event/terminate",method:"post",data:e})},Symbol.toStringTag,{value:"Module"})),Dm={class:"flow-diagram"},Mm=_t(l.defineComponent({name:"UiFlowDiagram",__name:"FlowDiagram",props:{processDefinitionId:{},processInstanceId:{}},emits:["loaded","error"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=l.ref(),a=l.shallowRef(),s=l.ref(),f=l.ref([]),p=l.ref(!1);let h=0;function m(){var F;o.value&&((F=a.value)==null||F.destroy(),a.value=l.markRaw(new hr({container:o.value,additionalModules:[wm,Cm],moddleExtensions:{camunda:km}})))}function _(F,R,S=!1){if(!F||!a.value)return;const w=a.value.get("canvas").getGraphics(F);if(!w)return;let E=".djs-visual rect, .djs-visual path";S&&(E+=", .djs-visual circle"),w.querySelectorAll(E).forEach(D=>{D.style.fill=R,D.style.stroke="#333"}),w.querySelectorAll(".djs-visual text").forEach(D=>{D.style.fill="#333"})}function B(){var S;if(!a.value)return;const F=a.value.get("elementRegistry"),R=new Set;(((S=s.value)==null?void 0:S.flowNodeStates)||[]).forEach(M=>{R.add(M.id),_(F.get(M.id),M.state==="executing"?"#ffd37e":"#98e5b5")}),F.filter(M=>M.type==="bpmn:StartEvent").forEach(M=>{R.add(M.id),_(M,"#98e5b5",!0)}),F.filter(M=>M.type==="bpmn:EndEvent").forEach(M=>{R.add(M.id),_(M,"#f14b12",!0)}),F.forEach(M=>{var w;!R.has(M.id)&&((w=M.type)!=null&&w.includes("Task"))&&_(M,"#eee")})}async function H(){const F=++h;try{await l.nextTick(),m();const[R,S,M]=await Promise.all([Hr({procdefId:r.processDefinitionId}),Pi({processInstanceId:r.processInstanceId,fetchFlowNodeState:!0}),Ni({processInstanceId:r.processInstanceId})]);if(F!==h||!a.value)return;s.value=S.data||{},f.value=M.data||[],await a.value.importXML(R),a.value.get("canvas").zoom("fit-viewport",!0),B(),i("loaded")}catch(R){i("error",R)}}return l.watch(()=>[r.processDefinitionId,r.processInstanceId],H),l.onMounted(H),l.onBeforeUnmount(()=>{var F;h++,(F=a.value)==null||F.destroy(),a.value=void 0}),t({refresh:H,viewer:a,trackData:f,isTrackHidden:p}),(F,R)=>(l.openBlock(),l.createElementBlock("div",Dm,[l.createElementVNode("div",{ref_key:"canvasRef",ref:o,class:"canvas"},null,512),R[1]||(R[1]=l.createStaticVNode('<div class="legend" data-v-4a2ab219><div class="legend-item undo" data-v-4a2ab219><div class="legend-circle" data-v-4a2ab219></div><span data-v-4a2ab219>未办理环节</span></div><div class="legend-item doing" data-v-4a2ab219><div class="legend-circle" data-v-4a2ab219></div><span data-v-4a2ab219>当前环节</span></div><div class="legend-item done" data-v-4a2ab219><div class="legend-circle" data-v-4a2ab219></div><span data-v-4a2ab219>已办理环节</span></div></div>',1)),l.createVNode(Nm,{"is-hide":p.value,"onUpdate:isHide":R[0]||(R[0]=S=>p.value=S),class:"bottom-container",data:f.value,style:l.normalizeStyle({height:p.value?"55px":"260px"})},null,8,["is-hide","data","style"])]))}}),[["__scopeId","data-v-4a2ab219"]]);function fn(e){const t=e;return t.install=n=>{e.name&&!n.component(e.name)&&n.component(e.name,e)},t}const Bm={...Om,...au},bs=fn(Li),Es=fn(cu),_s=fn(_u),xs=fn(Au),Ss=fn(ju),As=fn(Mm),Im={FlowButton:bs,FlowButtons:Es,FlowGrid:_s,FlowJump:xs,FlowSend:Ss,FlowDiagram:As},mr={install(e,t={}){Ro(t),Object.values(Im).forEach(n=>{e.component(n.name)||e.component(n.name,n)})}},Lm=mr,Fm=mr;he.FlowButton=bs,he.FlowButtons=Es,he.FlowDiagram=As,he.FlowGrid=_s,he.FlowJump=xs,he.FlowSend=Ss,he.FlowstreamUIPlus=mr,he.LeadalFlowVue3=Lm,he.WorkflowComponentsVue3=Fm,he.activateFlow=Ur,he.completeTask=$r,he.configureWorkflow=Ro,he.default=mr,he.doneTaskList=Br,he.downloadBpmn=Hr,he.draftFlowList=To,he.draftTaskList=Dr,he.flowApi=Bm,he.flowMonitorLine=Pi,he.flowStartNodeList=Oo,he.flowTrack=Ni,he.getOptList=Ir,he.jumpTask=Yr,he.nextSendNode=qr,he.nodeAssistant=Un,he.recycleTask=Vr,he.revocationTask=Lr,he.rollbackTask=Fr,he.saveDraft=Po,he.sendTask=Wr,he.startDraft=No,he.startNodes=Kr,he.suspendFlow=jr,he.terminateFlow=zr,he.todoTaskList=Mr,he.workflowHttp=jn,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));