@witlink/workflow 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.js +33117 -28272
- package/dist/index.umd.cjs +178 -233
- package/package.json +6 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,240 +1,185 @@
|
|
|
1
|
-
(function(bt,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("ant-design-vue/es"),require("vue"),require("pinia"),require("vue-i18n"),require("axios"),require("ant-design-vue"),require("@witlink/components")):typeof define=="function"&&define.amd?define(["exports","ant-design-vue/es","vue","pinia","vue-i18n","axios","ant-design-vue","@witlink/components"],U):(bt=typeof globalThis<"u"?globalThis:bt||self,U(bt["witlink-workflow"]={},bt.es,bt.Vue,bt.pinia,bt.vueI18n,bt.Axios,bt.antDesignVue,bt.components))})(this,function(bt,U,f,_p,Zt,l_,Qe,Lo){"use strict";let $o=Zt.createI18n({locale:"en_US",fallbackLocale:"en_US",legacy:!1,messages:{},silentTranslationWarn:!0});function u_(e){e&&($o=e)}function p_(e,t){const n=$o.global.t;if(n)return n(e,t)}function f_(e){return f.getCurrentScope()?(f.onScopeDispose(e),!0):!1}const d_=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const h_=Object.prototype.toString,m_=e=>h_.call(e)==="[object Object]",g_=()=>{};function y_(...e){if(e.length!==1)return f.toRef(...e);const t=e[0];return typeof t=="function"?f.readonly(f.customRef(()=>({get:t,set:g_}))):f.ref(t)}function v_(e,t){function n(...i){return new Promise((r,o)=>{Promise.resolve(e(()=>t.apply(this,i),{fn:t,thisArg:this,args:i})).then(r).catch(o)})}return n}const bp=e=>e();function __(e=bp,t={}){const{initialState:n="active"}=t,i=y_(n==="active");function r(){i.value=!1}function o(){i.value=!0}const a=(...s)=>{i.value&&e(...s)};return{isActive:f.readonly(i),pause:r,resume:o,eventFilter:a}}function ec(e){return Array.isArray(e)?e:[e]}function b_(e){return f.getCurrentInstance()}function E_(e,t,n={}){const{eventFilter:i=bp,...r}=n;return f.watch(e,v_(i,t),r)}function x_(e,t,n={}){const{eventFilter:i,initialState:r="active",...o}=n,{eventFilter:a,pause:s,resume:c,isActive:l}=__(i,{initialState:r});return{stop:E_(e,t,{...o,eventFilter:a}),pause:s,resume:c,isActive:l}}function w_(e,t=!0,n){b_()?f.onMounted(e,n):t?e():f.nextTick(e)}function S_(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const tc=d_?window:void 0;function C_(e){var t;const n=f.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function Ep(...e){const t=[],n=()=>{t.forEach(s=>s()),t.length=0},i=(s,c,l,u)=>(s.addEventListener(c,l,u),()=>s.removeEventListener(c,l,u)),r=f.computed(()=>{const s=ec(f.toValue(e[0])).filter(c=>c!=null);return s.every(c=>typeof c!="string")?s:void 0}),o=S_(()=>{var s,c;return[(c=(s=r.value)==null?void 0:s.map(l=>C_(l)))!=null?c:[tc].filter(l=>l!=null),ec(f.toValue(r.value?e[1]:e[0])),ec(f.unref(r.value?e[2]:e[1])),f.toValue(r.value?e[3]:e[2])]},([s,c,l,u])=>{if(n(),!(s!=null&&s.length)||!(c!=null&&c.length)||!(l!=null&&l.length))return;const p=m_(u)?{...u}:u;t.push(...s.flatMap(d=>c.flatMap(h=>l.map(m=>i(d,h,m,p)))))},{flush:"post"}),a=()=>{o(),n()};return f_(n),a}const jo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Fo="__vueuse_ssr_handlers__",R_=T_();function T_(){return Fo in jo||(jo[Fo]=jo[Fo]||{}),jo[Fo]}function P_(e,t){return R_[e]||t}function A_(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const k_={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},xp="vueuse-storage";function wp(e,t,n,i={}){var r;const{flush:o="pre",deep:a=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:l=!1,shallow:u,window:p=tc,eventFilter:d,onError:h=L=>{console.error(L)},initOnMounted:m}=i,y=(u?f.shallowRef:f.ref)(typeof t=="function"?t():t),g=f.computed(()=>f.toValue(e));if(!n)try{n=P_("getDefaultStorage",()=>{var L;return(L=tc)==null?void 0:L.localStorage})()}catch(L){h(L)}if(!n)return y;const w=f.toValue(t),C=A_(w),x=(r=i.serializer)!=null?r:k_[C],{pause:b,resume:S}=x_(y,()=>M(y.value),{flush:o,deep:a,eventFilter:d});f.watch(g,()=>I(),{flush:o}),p&&s&&w_(()=>{n instanceof Storage?Ep(p,"storage",I,{passive:!0}):Ep(p,xp,B),m&&I()}),m||I();function P(L,O){if(p){const F={key:g.value,oldValue:L,newValue:O,storageArea:n};p.dispatchEvent(n instanceof Storage?new StorageEvent("storage",F):new CustomEvent(xp,{detail:F}))}}function M(L){try{const O=n.getItem(g.value);if(L==null)P(O,null),n.removeItem(g.value);else{const F=x.write(L);O!==F&&(n.setItem(g.value,F),P(O,F))}}catch(O){h(O)}}function R(L){const O=L?L.newValue:n.getItem(g.value);if(O==null)return c&&w!=null&&n.setItem(g.value,x.write(w)),w;if(!L&&l){const F=x.read(O);return typeof l=="function"?l(F,w):C==="object"&&!Array.isArray(F)?{...w,...F}:F}else return typeof O!="string"?O:x.read(O)}function I(L){if(!(L&&L.storageArea!==n)){if(L&&L.key==null){y.value=w;return}if(!(L&&L.key!==g.value)){b();try{(L==null?void 0:L.newValue)!==x.write(y.value)&&(y.value=R(L))}catch(O){h(O)}finally{L?f.nextTick(S):S()}}}}function B(L){I(L.detail)}return y}const Rr=new Map;function M_(e){const t=f.getCurrentScope();function n(s){var c;const l=Rr.get(e)||new Set;l.add(s),Rr.set(e,l);const u=()=>r(s);return(c=t==null?void 0:t.cleanups)==null||c.push(u),u}function i(s){function c(...l){r(c),s(...l)}return n(c)}function r(s){const c=Rr.get(e);c&&(c.delete(s),c.size||o())}function o(){Rr.delete(e)}function a(s,c){var l;(l=Rr.get(e))==null||l.forEach(u=>u(s,c))}return{on:n,once:i,off:r,emit:a,reset:o}}const nc=l_.create({baseURL:"/cisapi",timeout:3e4});function D_(e){const n=wp("Access-Token",{}).value;let i;return typeof n=="string"?i=n:n&&(i=n.value),i&&(e.headers={...e.headers,"Access-Token":i}),e}function N_(e){const t=e.data;if(!(t instanceof Blob)&&(!t||t.code===void 0))Qe.message.error(t+"");else if(!(t instanceof Blob)&&t.code<0){let n=p_("err."+t.code);n===`err.${t.code}`&&(n=t.message?t.message:"unknow error"),Qe.message.error(n)}return e}function O_(e){if(e.response){const t=e.response.data;e.response.status===403?Qe.message.error(t.message):e.response.status===401&&Qe.message.error("Authorization verification failed")}else Qe.message.error(e+"");return Promise.reject(e)}nc.interceptors.request.use(D_,e=>Promise.reject(e)),nc.interceptors.response.use(N_,O_);function yt(e){return nc(e).then(t=>t.data)}const ct={getLangInfo:e=>yt({url:"/system/api/auth/lang-info",method:"get",params:e}),getBusTypeTree:e=>yt({url:"/workorder/api/flow/type/public-tree-root",method:"get",params:e}),getBusTypeTreeData:e=>yt({url:"/workorder/api/flow/type/public-tree-child",method:"get",params:e}),getBpmnList:e=>yt({url:"/workorder/api/flow/bpmn/search-list",method:"get",params:e}),switchBpmnStatus:e=>yt({url:"/workorder/api/flow/bpmn/switch",method:"post",params:e}),delBpmn:e=>yt({url:"/workorder/api/flow/bpmn/delete",method:"delete",params:e}),getBpmnDetail:e=>yt({url:"/workorder/api/flow/bpmn/detail-view",method:"get",params:e}),getBpmnXml:e=>yt({url:"/workorder/api/flow/bpmn/update-load",method:"get",params:e}),getLinkList:e=>yt({url:"/workorder/api/flow/link/public-search-list",method:"get",params:e}),getBranchTree:e=>yt({url:"/system/api/sys/branch/public-search-list-bpmn",method:"get",params:e}),getUserList:e=>yt({url:"/system/api/sys/user/public-search-list-bpmn",method:"get",params:e}),getRoleList:e=>yt({url:"/system/api/sys/role/public-search-list-bpmn",method:"get",params:e}),bpmnInsert:e=>yt({url:"/workorder/api/flow/bpmn/insert",method:"post",data:e}),bpmnUpdate:e=>yt({url:"/workorder/api/flow/bpmn/update",method:"post",data:e}),getTemplateList:e=>yt({url:"/workorder/api/form-template/search-page",method:"get",params:e})},ic=_p.defineStore("wfApp",{state:()=>({lang:wp("locale",""),theme:{colorPrimary:"#165dff",colorInfo:"#165dff",borderRadius:4},localeMap:{}}),actions:{getLangInfo(e){const t=this.lang;t&&($o.global.locale.value=t,this.localeMap[t]||ct.getLangInfo({isoCode:t}).then(n=>{if(n.code===0){const i=n.result.detail;this.localeMap[t]=i,$o.global.mergeLocaleMessage(t,i),e&&(this.setLang(""),setTimeout(()=>{this.setLang(t)}))}}))},setLang(e){this.lang=e},setTheme(e){e&&(this.theme=e)},setupLangWatcher(){this.getLangInfo(!0),f.watch(()=>this.lang,()=>this.getLangInfo(!0))}}}),I_=f.defineComponent({__name:"index",setup(e){const t="wf",n=ic();return(i,r)=>{const o=U.App,a=U.ConfigProvider;return f.openBlock(),f.createBlock(a,{prefixCls:f.unref(t),theme:{token:f.unref(n).theme}},{default:f.withCtx(()=>[f.createVNode(o,null,{default:f.withCtx(()=>[f.renderSlot(i.$slots,"default")]),_:3})]),_:3},8,["prefixCls","theme"])}}}),rc={};function Sp(e,t={immediate:!0}){const n=Zt.useI18n(),{t:i}=n,r=f.ref({}),o=[].concat(e);function a(){const l=o.map(u=>{const p=rc[u];if(Lo.isPromise(p))return p;if(p)return Promise.resolve([u,p]);const d=yt({method:"get",url:"/system/api/sys/dictionary/public-dict-combo-ex",params:{tableType:u}}).then(h=>(rc[u]=h,[u,h]));return rc[u]=d,d});return Promise.all(l).then(u=>{u.forEach(p=>{const[d,h]=p;h&&h.code===0&&(r.value[d]=h.result)})})}f.watchEffect(()=>{const l=r.value;Object.keys(l).forEach(p=>{const d=l[p];for(const h in d){const m=`dct.${p}${h}`,y=i(m);d[h].text=y!==m?y:d[h].text}})}),t.immediate&&a();function s(l,u){const p=r.value[l];if(p&&u){const d=p[u];return d&&d.text?d.text:"-"}return"-"}function c(l){const u=r.value[l];return u?Object.keys(u).map(d=>({label:u[d].text,value:d})):[]}return[r,{fetchDict:a,toList:c,getDictLabel:s}]}const B_=f.defineComponent({__name:"index",props:{type:{type:String,default:""},value:[Number,String],style:{type:Object,default(){return{}}},dictClass:{type:String},showTooltip:{type:Boolean,default:!1}},setup(e){const t=e,[n]=Sp(t.type,{immediate:!0}),i=f.ref();f.watchEffect(()=>{let o="-";const a=n.value[t.type];if(a&&!Lo.isNullOrUndef(t.value))if(Lo.isString(t.value))o=t.value.split(",").filter(c=>c).map(c=>{var l;return(l=a[c])==null?void 0:l.text}).join("、")||"-";else{const s=a[t.value];o=(s==null?void 0:s.text)||"-"}i.value=o});const r=f.computed(()=>{if(t.dictClass)return`${t.dictClass} status${t.value}`});return(o,a)=>{const s=U.Tooltip;return e.showTooltip?(f.openBlock(),f.createBlock(s,{key:0,placement:"topLeft",title:f.unref(i)},{default:f.withCtx(()=>[f.createElementVNode("span",{class:f.normalizeClass(f.unref(r)),style:f.normalizeStyle(e.style)},f.toDisplayString(f.unref(i)),7)]),_:1},8,["title"])):(f.openBlock(),f.createElementBlock("span",{key:1,class:f.normalizeClass(f.unref(r)),style:f.normalizeStyle(e.style)},f.toDisplayString(f.unref(i)),7))}}}),oc="el",L_="is-",hi=(e,t,n,i,r)=>{let o=`${e}-${t}`;return n&&(o+=`-${n}`),i&&(o+=`__${i}`),r&&(o+=`--${r}`),o},$_=Symbol("namespaceContextKey"),j_=e=>{const t=f.getCurrentInstance()?f.inject($_,f.ref(oc)):f.ref(oc);return f.computed(()=>f.unref(t)||oc)},Cp=(e,t)=>{const n=j_();return{namespace:n,b:(y="")=>hi(n.value,e,y,"",""),e:y=>y?hi(n.value,e,"",y,""):"",m:y=>y?hi(n.value,e,"","",y):"",be:(y,g)=>y&&g?hi(n.value,e,y,g,""):"",em:(y,g)=>y&&g?hi(n.value,e,"",y,g):"",bm:(y,g)=>y&&g?hi(n.value,e,y,"",g):"",bem:(y,g,w)=>y&&g&&w?hi(n.value,e,y,g,w):"",is:(y,...g)=>{const w=g.length>=1?g[0]:!0;return y&&w?`${L_}${y}`:""},cssVar:y=>{const g={};for(const w in y)y[w]&&(g[`--${n.value}-${w}`]=y[w]);return g},cssVarName:y=>`--${n.value}-${y}`,cssVarBlock:y=>{const g={};for(const w in y)y[w]&&(g[`--${n.value}-${e}-${w}`]=y[w]);return g},cssVarBlockName:y=>`--${n.value}-${e}-${y}`}};/**
|
|
1
|
+
(function(pt,ie){typeof exports=="object"&&typeof module<"u"?ie(exports,require("ant-design-vue/es"),require("vue"),require("pinia"),require("vue-i18n"),require("axios"),require("ant-design-vue"),require("@witlink/components")):typeof define=="function"&&define.amd?define(["exports","ant-design-vue/es","vue","pinia","vue-i18n","axios","ant-design-vue","@witlink/components"],ie):(pt=typeof globalThis<"u"?globalThis:pt||self,ie(pt["witlink-workflow"]={},pt.es,pt.Vue,pt.pinia,pt.vueI18n,pt.Axios,pt.antDesignVue,pt.components))})(this,function(pt,ie,p,Kp,Dn,Vx,Wt,bs){"use strict";var t9=Object.defineProperty;var n9=(pt,ie,p)=>ie in pt?t9(pt,ie,{enumerable:!0,configurable:!0,writable:!0,value:p}):pt[ie]=p;var Yp=(pt,ie,p)=>n9(pt,typeof ie!="symbol"?ie+"":ie,p);let xs=Dn.createI18n({locale:"en_US",fallbackLocale:"en_US",legacy:!1,messages:{},silentTranslationWarn:!0});function Xx(t){t&&(xs=t)}function Gx(t,e){const n=xs.global.t;if(n)return n(t,e)}function Yx(t){return p.getCurrentScope()?(p.onScopeDispose(t),!0):!1}const Kx=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const qx=Object.prototype.toString,Zx=t=>qx.call(t)==="[object Object]",Jx=()=>{};function Qx(...t){if(t.length!==1)return p.toRef(...t);const e=t[0];return typeof e=="function"?p.readonly(p.customRef(()=>({get:e,set:Jx}))):p.ref(e)}function eE(t,e){function n(...r){return new Promise((i,o)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(i).catch(o)})}return n}const qp=t=>t();function tE(t=qp,e={}){const{initialState:n="active"}=e,r=Qx(n==="active");function i(){r.value=!1}function o(){r.value=!0}const a=(...s)=>{r.value&&t(...s)};return{isActive:p.readonly(r),pause:i,resume:o,eventFilter:a}}function Qu(t){return Array.isArray(t)?t:[t]}function nE(t){return p.getCurrentInstance()}function rE(t,e,n={}){const{eventFilter:r=qp,...i}=n;return p.watch(t,eE(r,e),i)}function iE(t,e,n={}){const{eventFilter:r,initialState:i="active",...o}=n,{eventFilter:a,pause:s,resume:l,isActive:u}=tE(r,{initialState:i});return{stop:rE(t,e,{...o,eventFilter:a}),pause:s,resume:l,isActive:u}}function oE(t,e=!0,n){nE()?p.onMounted(t,n):e?t():p.nextTick(t)}function aE(t,e,n){return p.watch(t,e,{...n,immediate:!0})}const ec=Kx?window:void 0;function sE(t){var e;const n=p.toValue(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Zp(...t){const e=[],n=()=>{e.forEach(s=>s()),e.length=0},r=(s,l,u,c)=>(s.addEventListener(l,u,c),()=>s.removeEventListener(l,u,c)),i=p.computed(()=>{const s=Qu(p.toValue(t[0])).filter(l=>l!=null);return s.every(l=>typeof l!="string")?s:void 0}),o=aE(()=>{var s,l;return[(l=(s=i.value)==null?void 0:s.map(u=>sE(u)))!=null?l:[ec].filter(u=>u!=null),Qu(p.toValue(i.value?t[1]:t[0])),Qu(p.unref(i.value?t[2]:t[1])),p.toValue(i.value?t[3]:t[2])]},([s,l,u,c])=>{if(n(),!(s!=null&&s.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const d=Zx(c)?{...c}:c;e.push(...s.flatMap(f=>l.flatMap(h=>u.map(v=>r(f,h,v,d)))))},{flush:"post"}),a=()=>{o(),n()};return Yx(n),a}const Es=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ws="__vueuse_ssr_handlers__",lE=uE();function uE(){return ws in Es||(Es[ws]=Es[ws]||{}),Es[ws]}function cE(t,e){return lE[t]||e}function dE(t){return t==null?"any":t instanceof Set?"set":t instanceof Map?"map":t instanceof Date?"date":typeof t=="boolean"?"boolean":typeof t=="string"?"string":typeof t=="object"?"object":Number.isNaN(t)?"any":"number"}const fE={boolean:{read:t=>t==="true",write:t=>String(t)},object:{read:t=>JSON.parse(t),write:t=>JSON.stringify(t)},number:{read:t=>Number.parseFloat(t),write:t=>String(t)},any:{read:t=>t,write:t=>String(t)},string:{read:t=>t,write:t=>String(t)},map:{read:t=>new Map(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t.entries()))},set:{read:t=>new Set(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t))},date:{read:t=>new Date(t),write:t=>t.toISOString()}},Jp="vueuse-storage";function Qp(t,e,n,r={}){var i;const{flush:o="pre",deep:a=!0,listenToStorageChanges:s=!0,writeDefaults:l=!0,mergeDefaults:u=!1,shallow:c,window:d=ec,eventFilter:f,onError:h=K=>{console.error(K)},initOnMounted:v}=r,g=(c?p.shallowRef:p.ref)(typeof e=="function"?e():e),m=p.computed(()=>p.toValue(t));if(!n)try{n=cE("getDefaultStorage",()=>{var K;return(K=ec)==null?void 0:K.localStorage})()}catch(K){h(K)}if(!n)return g;const y=p.toValue(e),x=dE(y),E=(i=r.serializer)!=null?i:fE[x],{pause:b,resume:T}=iE(g,()=>S(g.value),{flush:o,deep:a,eventFilter:f});p.watch(m,()=>C(),{flush:o}),d&&s&&oE(()=>{n instanceof Storage?Zp(d,"storage",C,{passive:!0}):Zp(d,Jp,G),v&&C()}),v||C();function A(K,J){if(d){const R={key:m.value,oldValue:K,newValue:J,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",R):new CustomEvent(Jp,{detail:R}))}}function S(K){try{const J=n.getItem(m.value);if(K==null)A(J,null),n.removeItem(m.value);else{const R=E.write(K);J!==R&&(n.setItem(m.value,R),A(J,R))}}catch(J){h(J)}}function M(K){const J=K?K.newValue:n.getItem(m.value);if(J==null)return l&&y!=null&&n.setItem(m.value,E.write(y)),y;if(!K&&u){const R=E.read(J);return typeof u=="function"?u(R,y):x==="object"&&!Array.isArray(R)?{...y,...R}:R}else return typeof J!="string"?J:E.read(J)}function C(K){if(!(K&&K.storageArea!==n)){if(K&&K.key==null){g.value=y;return}if(!(K&&K.key!==m.value)){b();try{(K==null?void 0:K.newValue)!==E.write(g.value)&&(g.value=M(K))}catch(J){h(J)}finally{K?p.nextTick(T):T()}}}}function G(K){C(K.detail)}return g}const ra=new Map;function pE(t){const e=p.getCurrentScope();function n(s){var l;const u=ra.get(t)||new Set;u.add(s),ra.set(t,u);const c=()=>i(s);return(l=e==null?void 0:e.cleanups)==null||l.push(c),c}function r(s){function l(...u){i(l),s(...u)}return n(l)}function i(s){const l=ra.get(t);l&&(l.delete(s),l.size||o())}function o(){ra.delete(t)}function a(s,l){var u;(u=ra.get(t))==null||u.forEach(c=>c(s,l))}return{on:n,once:r,off:i,emit:a,reset:o}}const tc=Vx.create({baseURL:"/cisapi",timeout:3e4});function hE(t){const n=Qp("Access-Token",{}).value;let r;return typeof n=="string"?r=n:n&&(r=n.value),r&&(t.headers={...t.headers,"Access-Token":r}),t}function gE(t){const e=t.data;if(!(e instanceof Blob)&&(!e||e.code===void 0))Wt.message.error(e+"");else if(!(e instanceof Blob)&&e.code<0){let n=Gx("err."+e.code);n===`err.${e.code}`&&(n=e.message?e.message:"unknow error"),Wt.message.error(n)}return t}function vE(t){if(t.response){const e=t.response.data;t.response.status===403?Wt.message.error(e.message):t.response.status===401&&Wt.message.error("Authorization verification failed")}else Wt.message.error(t+"");return Promise.reject(t)}tc.interceptors.request.use(hE,t=>Promise.reject(t)),tc.interceptors.response.use(gE,vE);function rn(t){return tc(t).then(e=>e.data)}const Gt={getLangInfo:t=>rn({url:"/system/api/auth/lang-info",method:"get",params:t}),getBusTypeTree:t=>rn({url:"/workorder/api/flow/type/public-tree-root",method:"get",params:t}),getBusTypeTreeData:t=>rn({url:"/workorder/api/flow/type/public-tree-child",method:"get",params:t}),getBpmnList:t=>rn({url:"/workorder/api/flow/bpmn/search-list",method:"get",params:t}),switchBpmnStatus:t=>rn({url:"/workorder/api/flow/bpmn/switch",method:"post",params:t}),delBpmn:t=>rn({url:"/workorder/api/flow/bpmn/delete",method:"delete",params:t}),getBpmnDetail:t=>rn({url:"/workorder/api/flow/bpmn/detail-view",method:"get",params:t}),getBpmnXml:t=>rn({url:"/workorder/api/flow/bpmn/update-load",method:"get",params:t}),getLinkList:t=>rn({url:"/workorder/api/flow/link/public-search-list",method:"get",params:t}),getBranchTree:t=>rn({url:"/system/api/sys/branch/public-search-list-bpmn",method:"get",params:t}),getUserList:t=>rn({url:"/system/api/sys/user/public-search-list-bpmn",method:"get",params:t}),getRoleList:t=>rn({url:"/system/api/sys/role/public-search-list-bpmn",method:"get",params:t}),bpmnInsert:t=>rn({url:"/workorder/api/flow/bpmn/insert",method:"post",data:t}),bpmnUpdate:t=>rn({url:"/workorder/api/flow/bpmn/update",method:"post",data:t}),getTemplateList:t=>rn({url:"/workorder/api/form-template/search-page",method:"get",params:t})},nc=Kp.defineStore("wfApp",{state:()=>({lang:Qp("locale",""),theme:{colorPrimary:"#165dff",colorInfo:"#165dff",borderRadius:4},localeMap:{}}),actions:{getLangInfo(t){const e=this.lang;e&&(xs.global.locale.value=e,this.localeMap[e]||Gt.getLangInfo({isoCode:e}).then(n=>{if(n.code===0){const r=n.result.detail;this.localeMap[e]=r,xs.global.mergeLocaleMessage(e,r),t&&(this.setLang(""),setTimeout(()=>{this.setLang(e)}))}}))},setLang(t){this.lang=t},setTheme(t){t&&(this.theme=t)},setupLangWatcher(){this.getLangInfo(!0),p.watch(()=>this.lang,()=>this.getLangInfo(!0))}}}),mE=p.defineComponent({__name:"index",setup(t){const e="wf",n=nc();return(r,i)=>{const o=ie.App,a=ie.ConfigProvider;return p.openBlock(),p.createBlock(a,{prefixCls:p.unref(e),theme:{token:p.unref(n).theme}},{default:p.withCtx(()=>[p.createVNode(o,null,{default:p.withCtx(()=>[p.renderSlot(r.$slots,"default")]),_:3})]),_:3},8,["prefixCls","theme"])}}}),rc={};function eh(t,e={immediate:!0}){const n=Dn.useI18n(),{t:r}=n,i=p.ref({}),o=[].concat(t);function a(){const u=o.map(c=>{const d=rc[c];if(bs.isPromise(d))return d;if(d)return Promise.resolve([c,d]);const f=rn({method:"get",url:"/system/api/sys/dictionary/public-dict-combo-ex",params:{tableType:c}}).then(h=>(rc[c]=h,[c,h]));return rc[c]=f,f});return Promise.all(u).then(c=>{c.forEach(d=>{const[f,h]=d;h&&h.code===0&&(i.value[f]=h.result)})})}p.watchEffect(()=>{const u=i.value;Object.keys(u).forEach(d=>{const f=u[d];for(const h in f){const v=`dct.${d}${h}`,g=r(v);f[h].text=g!==v?g:f[h].text}})}),e.immediate&&a();function s(u,c){const d=i.value[u];if(d&&c){const f=d[c];return f&&f.text?f.text:"-"}return"-"}function l(u){const c=i.value[u];return c?Object.keys(c).map(f=>({label:c[f].text,value:f})):[]}return[i,{fetchDict:a,toList:l,getDictLabel:s}]}const yE=p.defineComponent({__name:"index",props:{type:{type:String,default:""},value:[Number,String],style:{type:Object,default(){return{}}},dictClass:{type:String},showTooltip:{type:Boolean,default:!1}},setup(t){const e=t,[n]=eh(e.type,{immediate:!0}),r=p.ref();p.watchEffect(()=>{let o="-";const a=n.value[e.type];if(a&&!bs.isNullOrUndef(e.value))if(bs.isString(e.value))o=e.value.split(",").filter(l=>l).map(l=>{var u;return(u=a[l])==null?void 0:u.text}).join("、")||"-";else{const s=a[e.value];o=(s==null?void 0:s.text)||"-"}r.value=o});const i=p.computed(()=>{if(e.dictClass)return`${e.dictClass} status${e.value}`});return(o,a)=>{const s=ie.Tooltip;return t.showTooltip?(p.openBlock(),p.createBlock(s,{key:0,placement:"topLeft",title:p.unref(r)},{default:p.withCtx(()=>[p.createElementVNode("span",{class:p.normalizeClass(p.unref(i)),style:p.normalizeStyle(t.style)},p.toDisplayString(p.unref(r)),7)]),_:1},8,["title"])):(p.openBlock(),p.createElementBlock("span",{key:1,class:p.normalizeClass(p.unref(i)),style:p.normalizeStyle(t.style)},p.toDisplayString(p.unref(r)),7))}}}),ic="el",_E="is-",Ri=(t,e,n,r,i)=>{let o=`${t}-${e}`;return n&&(o+=`-${n}`),r&&(o+=`__${r}`),i&&(o+=`--${i}`),o},bE=Symbol("namespaceContextKey"),xE=t=>{const e=p.getCurrentInstance()?p.inject(bE,p.ref(ic)):p.ref(ic);return p.computed(()=>p.unref(e)||ic)},th=(t,e)=>{const n=xE();return{namespace:n,b:(g="")=>Ri(n.value,t,g,"",""),e:g=>g?Ri(n.value,t,"",g,""):"",m:g=>g?Ri(n.value,t,"","",g):"",be:(g,m)=>g&&m?Ri(n.value,t,g,m,""):"",em:(g,m)=>g&&m?Ri(n.value,t,"",g,m):"",bm:(g,m)=>g&&m?Ri(n.value,t,g,"",m):"",bem:(g,m,y)=>g&&m&&y?Ri(n.value,t,g,m,y):"",is:(g,...m)=>{const y=m.length>=1?m[0]:!0;return g&&y?`${_E}${g}`:""},cssVar:g=>{const m={};for(const y in g)g[y]&&(m[`--${n.value}-${y}`]=g[y]);return m},cssVarName:g=>`--${n.value}-${g}`,cssVarBlock:g=>{const m={};for(const y in g)g[y]&&(m[`--${n.value}-${t}-${y}`]=g[y]);return m},cssVarBlockName:g=>`--${n.value}-${t}-${g}`}};/**
|
|
2
2
|
* @vue/shared v3.5.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
|
-
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const F_=Object.prototype.hasOwnProperty,Rp=(e,t)=>F_.call(e,t),ac=e=>typeof e=="string",sc=e=>e!==null&&typeof e=="object";var H_=typeof global=="object"&&global&&global.Object===Object&&global,V_=typeof self=="object"&&self&&self.Object===Object&&self,cc=H_||V_||Function("return this")(),$n=cc.Symbol,Tp=Object.prototype,z_=Tp.hasOwnProperty,W_=Tp.toString,Tr=$n?$n.toStringTag:void 0;function U_(e){var t=z_.call(e,Tr),n=e[Tr];try{e[Tr]=void 0;var i=!0}catch{}var r=W_.call(e);return i&&(t?e[Tr]=n:delete e[Tr]),r}var G_=Object.prototype,K_=G_.toString;function q_(e){return K_.call(e)}var Y_="[object Null]",X_="[object Undefined]",Pp=$n?$n.toStringTag:void 0;function lc(e){return e==null?e===void 0?X_:Y_:Pp&&Pp in Object(e)?U_(e):q_(e)}function uc(e){return e!=null&&typeof e=="object"}var Z_="[object Symbol]";function pc(e){return typeof e=="symbol"||uc(e)&&lc(e)==Z_}function J_(e,t){for(var n=-1,i=e==null?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}var Pr=Array.isArray,Ap=$n?$n.prototype:void 0,kp=Ap?Ap.toString:void 0;function Mp(e){if(typeof e=="string")return e;if(Pr(e))return J_(e,Mp)+"";if(pc(e))return kp?kp.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ho(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Q_(e){return e}var eb="[object AsyncFunction]",tb="[object Function]",nb="[object GeneratorFunction]",ib="[object Proxy]";function rb(e){if(!Ho(e))return!1;var t=lc(e);return t==tb||t==nb||t==eb||t==ib}var fc=cc["__core-js_shared__"],Dp=function(){var e=/[^.]+$/.exec(fc&&fc.keys&&fc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ob(e){return!!Dp&&Dp in e}var ab=Function.prototype,sb=ab.toString;function cb(e){if(e!=null){try{return sb.call(e)}catch{}try{return e+""}catch{}}return""}var lb=/[\\^$.*+?()[\]{}|]/g,ub=/^\[object .+?Constructor\]$/,pb=Function.prototype,fb=Object.prototype,db=pb.toString,hb=fb.hasOwnProperty,mb=RegExp("^"+db.call(hb).replace(lb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gb(e){if(!Ho(e)||ob(e))return!1;var t=rb(e)?mb:ub;return t.test(cb(e))}function yb(e,t){return e==null?void 0:e[t]}function dc(e,t){var n=yb(e,t);return gb(n)?n:void 0}function vb(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var _b=800,bb=16,Eb=Date.now;function xb(e){var t=0,n=0;return function(){var i=Eb(),r=bb-(i-n);if(n=i,r>0){if(++t>=_b)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function wb(e){return function(){return e}}var Vo=function(){try{var e=dc(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Sb=Vo?function(e,t){return Vo(e,"toString",{configurable:!0,enumerable:!1,value:wb(t),writable:!0})}:Q_,Cb=xb(Sb),Rb=9007199254740991,Tb=/^(?:0|[1-9]\d*)$/;function Np(e,t){var n=typeof e;return t=t??Rb,!!t&&(n=="number"||n!="symbol"&&Tb.test(e))&&e>-1&&e%1==0&&e<t}function Pb(e,t,n){t=="__proto__"&&Vo?Vo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Op(e,t){return e===t||e!==e&&t!==t}var Ab=Object.prototype,kb=Ab.hasOwnProperty;function Mb(e,t,n){var i=e[t];(!(kb.call(e,t)&&Op(i,n))||n===void 0&&!(t in e))&&Pb(e,t,n)}var Ip=Math.max;function Db(e,t,n){return t=Ip(t===void 0?e.length-1:t,0),function(){for(var i=arguments,r=-1,o=Ip(i.length-t,0),a=Array(o);++r<o;)a[r]=i[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=i[r];return s[t]=n(a),vb(e,this,s)}}var Nb=9007199254740991;function Ob(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Nb}var Ib="[object Arguments]";function Bp(e){return uc(e)&&lc(e)==Ib}var Lp=Object.prototype,Bb=Lp.hasOwnProperty,Lb=Lp.propertyIsEnumerable,$p=Bp(function(){return arguments}())?Bp:function(e){return uc(e)&&Bb.call(e,"callee")&&!Lb.call(e,"callee")},$b=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jb=/^\w*$/;function Fb(e,t){if(Pr(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||pc(e)?!0:jb.test(e)||!$b.test(e)||t!=null&&e in Object(t)}var Ar=dc(Object,"create");function Hb(){this.__data__=Ar?Ar(null):{},this.size=0}function Vb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zb="__lodash_hash_undefined__",Wb=Object.prototype,Ub=Wb.hasOwnProperty;function Gb(e){var t=this.__data__;if(Ar){var n=t[e];return n===zb?void 0:n}return Ub.call(t,e)?t[e]:void 0}var Kb=Object.prototype,qb=Kb.hasOwnProperty;function Yb(e){var t=this.__data__;return Ar?t[e]!==void 0:qb.call(t,e)}var Xb="__lodash_hash_undefined__";function Zb(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ar&&t===void 0?Xb:t,this}function mi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}mi.prototype.clear=Hb,mi.prototype.delete=Vb,mi.prototype.get=Gb,mi.prototype.has=Yb,mi.prototype.set=Zb;function Jb(){this.__data__=[],this.size=0}function zo(e,t){for(var n=e.length;n--;)if(Op(e[n][0],t))return n;return-1}var Qb=Array.prototype,e0=Qb.splice;function t0(e){var t=this.__data__,n=zo(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():e0.call(t,n,1),--this.size,!0}function n0(e){var t=this.__data__,n=zo(t,e);return n<0?void 0:t[n][1]}function i0(e){return zo(this.__data__,e)>-1}function r0(e,t){var n=this.__data__,i=zo(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function Hi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Hi.prototype.clear=Jb,Hi.prototype.delete=t0,Hi.prototype.get=n0,Hi.prototype.has=i0,Hi.prototype.set=r0;var o0=dc(cc,"Map");function a0(){this.size=0,this.__data__={hash:new mi,map:new(o0||Hi),string:new mi}}function s0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Wo(e,t){var n=e.__data__;return s0(t)?n[typeof t=="string"?"string":"hash"]:n.map}function c0(e){var t=Wo(this,e).delete(e);return this.size-=t?1:0,t}function l0(e){return Wo(this,e).get(e)}function u0(e){return Wo(this,e).has(e)}function p0(e,t){var n=Wo(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function gi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}gi.prototype.clear=a0,gi.prototype.delete=c0,gi.prototype.get=l0,gi.prototype.has=u0,gi.prototype.set=p0;var f0="Expected a function";function hc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(f0);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(hc.Cache||gi),n}hc.Cache=gi;var d0=500;function h0(e){var t=hc(e,function(i){return n.size===d0&&n.clear(),i}),n=t.cache;return t}var m0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,g0=/\\(\\)?/g,y0=h0(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(m0,function(n,i,r,o){t.push(r?o.replace(g0,"$1"):i||n)}),t});function v0(e){return e==null?"":Mp(e)}function Uo(e,t){return Pr(e)?e:Fb(e,t)?[e]:y0(v0(e))}function mc(e){if(typeof e=="string"||pc(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function _0(e,t){t=Uo(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[mc(t[n++])];return n&&n==i?e:void 0}function b0(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var jp=$n?$n.isConcatSpreadable:void 0;function E0(e){return Pr(e)||$p(e)||!!(jp&&e&&e[jp])}function x0(e,t,n,i,r){var o=-1,a=e.length;for(n||(n=E0),r||(r=[]);++o<a;){var s=e[o];n(s)?b0(r,s):r[r.length]=s}return r}function w0(e){var t=e==null?0:e.length;return t?x0(e):[]}function S0(e){return Cb(Db(e,void 0,w0),e+"")}function C0(e,t){return e!=null&&t in Object(e)}function R0(e,t,n){t=Uo(t,e);for(var i=-1,r=t.length,o=!1;++i<r;){var a=mc(t[i]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++i!=r?o:(r=e==null?0:e.length,!!r&&Ob(r)&&Np(a,r)&&(Pr(e)||$p(e)))}function T0(e,t){return e!=null&&R0(e,t,C0)}function P0(e){for(var t=-1,n=e==null?0:e.length,i={};++t<n;){var r=e[t];i[r[0]]=r[1]}return i}function A0(e,t,n,i){if(!Ho(e))return e;t=Uo(t,e);for(var r=-1,o=t.length,a=o-1,s=e;s!=null&&++r<o;){var c=mc(t[r]),l=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(r!=a){var u=s[c];l=void 0,l===void 0&&(l=Ho(u)?u:Np(t[r+1])?[]:{})}Mb(s,c,l),s=s[c]}return e}function k0(e,t,n){for(var i=-1,r=t.length,o={};++i<r;){var a=t[i],s=_0(e,a);n(s,a)&&A0(o,Uo(a,e),s)}return o}function M0(e,t){return k0(e,t,function(n,i){return T0(e,i)})}var D0=S0(function(e,t){return e==null?{}:M0(e,t)});const Vi=e=>typeof e=="number",N0=e=>ac(e)?!Number.isNaN(Number(e)):!1;var Fp;const gc=typeof window<"u",O0=e=>typeof e=="string",I0=()=>{};gc&&((Fp=window==null?void 0:window.navigator)!=null&&Fp.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Hp(e){return typeof e=="function"?e():f.unref(e)}function B0(e){return e}function Vp(e){return f.getCurrentScope()?(f.onScopeDispose(e),!0):!1}function L0(e,t=!0){f.getCurrentInstance()?f.onMounted(e):t?e():f.nextTick(e)}function zp(e){var t;const n=Hp(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Wp=gc?window:void 0;function yc(...e){let t,n,i,r;if(O0(e[0])||Array.isArray(e[0])?([n,i,r]=e,t=Wp):[t,n,i,r]=e,!t)return I0;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const o=[],a=()=>{o.forEach(u=>u()),o.length=0},s=(u,p,d,h)=>(u.addEventListener(p,d,h),()=>u.removeEventListener(p,d,h)),c=f.watch(()=>[zp(t),Hp(r)],([u,p])=>{a(),u&&o.push(...n.flatMap(d=>i.map(h=>s(u,d,h,p))))},{immediate:!0,flush:"post"}),l=()=>{c(),a()};return Vp(l),l}function $0(e,t=!1){const n=f.ref(),i=()=>n.value=!!e();return i(),L0(i,t),n}const Up=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Gp="__vueuse_ssr_handlers__";Up[Gp]=Up[Gp]||{};var Kp=Object.getOwnPropertySymbols,j0=Object.prototype.hasOwnProperty,F0=Object.prototype.propertyIsEnumerable,H0=(e,t)=>{var n={};for(var i in e)j0.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&Kp)for(var i of Kp(e))t.indexOf(i)<0&&F0.call(e,i)&&(n[i]=e[i]);return n};function V0(e,t,n={}){const i=n,{window:r=Wp}=i,o=H0(i,["window"]);let a;const s=$0(()=>r&&"ResizeObserver"in r),c=()=>{a&&(a.disconnect(),a=void 0)},l=f.watch(()=>zp(e),p=>{c(),s.value&&r&&p&&(a=new ResizeObserver(t),a.observe(p,o))},{immediate:!0,flush:"post"}),u=()=>{c(),l()};return Vp(u),{isSupported:s,stop:u}}var qp;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(qp||(qp={}));var z0=Object.defineProperty,Yp=Object.getOwnPropertySymbols,W0=Object.prototype.hasOwnProperty,U0=Object.prototype.propertyIsEnumerable,Xp=(e,t,n)=>t in e?z0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G0=(e,t)=>{for(var n in t||(t={}))W0.call(t,n)&&Xp(e,n,t[n]);if(Yp)for(var n of Yp(t))U0.call(t,n)&&Xp(e,n,t[n]);return e};G0({linear:B0},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});class Zp extends Error{constructor(t){super(t),this.name="ElementPlusError"}}function K0(e,t){throw new Zp(`[${e}] ${t}`)}function vc(e,t){if(process.env.NODE_ENV!=="production"){const n=ac(e)?new Zp(`[${e}] ${t}`):e;console.warn(n)}}const Jp="__epPropKey",q0=e=>e,Y0=e=>sc(e)&&!!e[Jp],X0=(e,t)=>{if(!sc(e)||Y0(e))return e;const{values:n,required:i,default:r,type:o,validator:a}=e,c={type:o,required:!!i,validator:n||a?l=>{let u=!1,p=[];if(n&&(p=Array.from(n),Rp(e,"default")&&p.push(r),u||(u=p.includes(l))),a&&(u||(u=a(l))),!u&&p.length>0){const d=[...new Set(p)].map(h=>JSON.stringify(h)).join(", ");f.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${d}], got value ${JSON.stringify(l)}.`)}return u}:void 0,[Jp]:!0};return Rp(e,"default")&&(c.default=r),c},Go=e=>P0(Object.entries(e).map(([t,n])=>[t,X0(n,t)]));var _c=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n};const Z0="utils/dom/style";function Qp(e,t="px"){if(!e)return"";if(Vi(e)||N0(e))return`${e}${t}`;if(ac(e))return e;vc(Z0,"binding value must be a string or number")}const J0=(e,t)=>(e.install=n=>{for(const i of[e,...Object.values({})])n.component(i.name,i)},e),Q0=Go({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),eE=e=>D0(Q0,e),zi=4,tE={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},nE=({move:e,size:t,bar:n})=>({[n.size]:t,transform:`translate${n.axis}(${e}%)`}),bc=Symbol("scrollbarContextKey"),iE=Go({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),rE="Thumb";var ef=_c(f.defineComponent({__name:"thumb",props:iE,setup(e){const t=e,n=f.inject(bc),i=Cp("scrollbar");n||K0(rE,"can not inject scrollbar context");const r=f.ref(),o=f.ref(),a=f.ref({}),s=f.ref(!1);let c=!1,l=!1,u=gc?document.onselectstart:null;const p=f.computed(()=>tE[t.vertical?"vertical":"horizontal"]),d=f.computed(()=>nE({size:t.size,move:t.move,bar:p.value})),h=f.computed(()=>r.value[p.value.offset]**2/n.wrapElement[p.value.scrollSize]/t.ratio/o.value[p.value.offset]),m=P=>{var M;if(P.stopPropagation(),P.ctrlKey||[1,2].includes(P.button))return;(M=window.getSelection())==null||M.removeAllRanges(),g(P);const R=P.currentTarget;R&&(a.value[p.value.axis]=R[p.value.offset]-(P[p.value.client]-R.getBoundingClientRect()[p.value.direction]))},y=P=>{if(!o.value||!r.value||!n.wrapElement)return;const M=Math.abs(P.target.getBoundingClientRect()[p.value.direction]-P[p.value.client]),R=o.value[p.value.offset]/2,I=(M-R)*100*h.value/r.value[p.value.offset];n.wrapElement[p.value.scroll]=I*n.wrapElement[p.value.scrollSize]/100},g=P=>{P.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",w),document.addEventListener("mouseup",C),u=document.onselectstart,document.onselectstart=()=>!1},w=P=>{if(!r.value||!o.value||c===!1)return;const M=a.value[p.value.axis];if(!M)return;const R=(r.value.getBoundingClientRect()[p.value.direction]-P[p.value.client])*-1,I=o.value[p.value.offset]-M,B=(R-I)*100*h.value/r.value[p.value.offset];n.wrapElement[p.value.scroll]=B*n.wrapElement[p.value.scrollSize]/100},C=()=>{c=!1,a.value[p.value.axis]=0,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),S(),l&&(s.value=!1)},x=()=>{l=!1,s.value=!!t.size},b=()=>{l=!0,s.value=c};f.onBeforeUnmount(()=>{S(),document.removeEventListener("mouseup",C)});const S=()=>{document.onselectstart!==u&&(document.onselectstart=u)};return yc(f.toRef(n,"scrollbarElement"),"mousemove",x),yc(f.toRef(n,"scrollbarElement"),"mouseleave",b),(P,M)=>(f.openBlock(),f.createBlock(f.Transition,{name:f.unref(i).b("fade"),persisted:""},{default:f.withCtx(()=>[f.withDirectives(f.createElementVNode("div",{ref_key:"instance",ref:r,class:f.normalizeClass([f.unref(i).e("bar"),f.unref(i).is(f.unref(p).key)]),onMousedown:y},[f.createElementVNode("div",{ref_key:"thumb",ref:o,class:f.normalizeClass(f.unref(i).e("thumb")),style:f.normalizeStyle(f.unref(d)),onMousedown:m},null,38)],34),[[f.vShow,P.always||s.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const oE=Go({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var aE=_c(f.defineComponent({__name:"bar",props:oE,setup(e,{expose:t}){const n=e,i=f.inject(bc),r=f.ref(0),o=f.ref(0),a=f.ref(""),s=f.ref(""),c=f.ref(1),l=f.ref(1);return t({handleScroll:d=>{if(d){const h=d.offsetHeight-zi,m=d.offsetWidth-zi;o.value=d.scrollTop*100/h*c.value,r.value=d.scrollLeft*100/m*l.value}},update:()=>{const d=i==null?void 0:i.wrapElement;if(!d)return;const h=d.offsetHeight-zi,m=d.offsetWidth-zi,y=h**2/d.scrollHeight,g=m**2/d.scrollWidth,w=Math.max(y,n.minSize),C=Math.max(g,n.minSize);c.value=y/(h-y)/(w/(h-w)),l.value=g/(m-g)/(C/(m-C)),s.value=w+zi<h?`${w}px`:"",a.value=C+zi<m?`${C}px`:""}}),(d,h)=>(f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createVNode(ef,{move:r.value,ratio:l.value,size:a.value,always:d.always},null,8,["move","ratio","size","always"]),f.createVNode(ef,{move:o.value,ratio:c.value,size:s.value,vertical:"",always:d.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const sE=Go({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:q0([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...eE(["ariaLabel","ariaOrientation"])}),cE={scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(Vi)},Ec="ElScrollbar",lE=f.defineComponent({name:Ec}),uE=f.defineComponent({...lE,props:sE,emits:cE,setup(e,{expose:t,emit:n}){const i=e,r=Cp("scrollbar");let o,a,s=0,c=0;const l=f.ref(),u=f.ref(),p=f.ref(),d=f.ref(),h=f.computed(()=>{const S={};return i.height&&(S.height=Qp(i.height)),i.maxHeight&&(S.maxHeight=Qp(i.maxHeight)),[i.wrapStyle,S]}),m=f.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),y=f.computed(()=>[r.e("view"),i.viewClass]),g=()=>{var S;u.value&&((S=d.value)==null||S.handleScroll(u.value),s=u.value.scrollTop,c=u.value.scrollLeft,n("scroll",{scrollTop:u.value.scrollTop,scrollLeft:u.value.scrollLeft}))};function w(S,P){sc(S)?u.value.scrollTo(S):Vi(S)&&Vi(P)&&u.value.scrollTo(S,P)}const C=S=>{if(!Vi(S)){vc(Ec,"value must be a number");return}u.value.scrollTop=S},x=S=>{if(!Vi(S)){vc(Ec,"value must be a number");return}u.value.scrollLeft=S},b=()=>{var S;(S=d.value)==null||S.update()};return f.watch(()=>i.noresize,S=>{S?(o==null||o(),a==null||a()):({stop:o}=V0(p,b),a=yc("resize",b))},{immediate:!0}),f.watch(()=>[i.maxHeight,i.height],()=>{i.native||f.nextTick(()=>{var S;b(),u.value&&((S=d.value)==null||S.handleScroll(u.value))})}),f.provide(bc,f.reactive({scrollbarElement:l,wrapElement:u})),f.onActivated(()=>{u.value&&(u.value.scrollTop=s,u.value.scrollLeft=c)}),f.onMounted(()=>{i.native||f.nextTick(()=>{b()})}),f.onUpdated(()=>b()),t({wrapRef:u,update:b,scrollTo:w,setScrollTop:C,setScrollLeft:x,handleScroll:g}),(S,P)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"scrollbarRef",ref:l,class:f.normalizeClass(f.unref(r).b())},[f.createElementVNode("div",{ref_key:"wrapRef",ref:u,class:f.normalizeClass(f.unref(m)),style:f.normalizeStyle(f.unref(h)),tabindex:S.tabindex,onScroll:g},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(S.tag),{id:S.id,ref_key:"resizeRef",ref:p,class:f.normalizeClass(f.unref(y)),style:f.normalizeStyle(S.viewStyle),role:S.role,"aria-label":S.ariaLabel,"aria-orientation":S.ariaOrientation},{default:f.withCtx(()=>[f.renderSlot(S.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),S.native?f.createCommentVNode("v-if",!0):(f.openBlock(),f.createBlock(aE,{key:0,ref_key:"barRef",ref:d,always:S.always,"min-size":S.minSize},null,8,["always","min-size"]))],2))}});var pE=_c(uE,[["__file","scrollbar.vue"]]);const tf=J0(pE),Ko=Symbol("wf-bus"),fE={class:"wrapper"},dE={class:"content"},hE=["textContent"],mE=f.defineComponent({__name:"BpmnDetail",props:{data:{type:Object,required:!0}},setup(e){const t=e,n=f.ref("1"),i=f.ref(),r=f.ref();function o(){var l;if(!((l=t.data)!=null&&l.code))return;const s=n.value,c={code:t.data.code,type:s};ct.getBpmnDetail(c).then(u=>{u.code===0&&(s==="1"?i.value="data:image/png;base64,"+u.result:r.value=u.result)})}function a(){o()}return f.onMounted(()=>{o()}),(s,c)=>{const l=U.RadioButton,u=U.RadioGroup,p=U.Image;return f.openBlock(),f.createElementBlock("div",fE,[f.createVNode(u,{value:f.unref(n),"onUpdate:value":c[0]||(c[0]=d=>f.isRef(n)?n.value=d:null),class:"flex-ec mr-sm mt-sm",onChange:a},{default:f.withCtx(()=>[f.createVNode(l,{value:"1"},{default:f.withCtx(()=>c[1]||(c[1]=[f.createTextVNode("png")])),_:1}),f.createVNode(l,{value:"0"},{default:f.withCtx(()=>c[2]||(c[2]=[f.createTextVNode("xml")])),_:1})]),_:1},8,["value"]),f.createElementVNode("div",dE,[f.unref(n)==="1"?(f.openBlock(),f.createBlock(p,{key:0,src:f.unref(i)},null,8,["src"])):(f.openBlock(),f.createElementBlock("span",{key:1,textContent:f.toDisplayString(f.unref(r))},null,8,hE))])])}}}),bn=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},gE=bn(mE,[["__scopeId","data-v-248c7b10"]]),yE={class:"panel-left"},vE={class:"title"},_E={class:"search-box"},bE={key:2,class:"btns-action"},EE=bn(f.defineComponent({__name:"BusTypeList",setup(e){const{t}=Zt.useI18n(),n=f.ref(),i=f.ref([]),r=f.ref([]),o=f.ref([]),a=f.ref(!0);function s(){var M;o.value=[],i.value=[],r.value=[],(M=h.value)==null||M.reset(),c()}function c(M){const R={sync:!0};n.value&&Object.assign(R,{description:n.value}),ct.getBusTypeTree(R).then(I=>{var B;if(I.code===0){const L=I.result||[];o.value=L,L.length&&(i.value=[L[0].key],(B=L[0].children)!=null&&B.length&&(r.value=[L[0].children[0].key],a.value=L[0].children[0].type=="1",m()))}})}const l=f.inject(Ko);function u(M,R){R.selected&&R.node.dataRef.isLeaf&&(r.value=M,a.value=R.node.dataRef.type=="1",m())}const p=f.ref([{title:t("bpmn.version"),dataIndex:"version",width:100},{title:t("bpmn.description"),dataIndex:"description",width:250},{title:t("bpmn.used"),dataIndex:"used",width:130},{title:t("bpmn.status"),dataIndex:"status",width:130},{title:t("bpmn.action"),key:"action",width:200,fixed:"right"}]);function d(M){const R={type:r.value[0]};return Object.assign(R,M),ct.getBpmnList(R)}const h=f.ref(),m=()=>{var M;(M=h.value)==null||M.refresh()},{message:y,modal:g}=Qe.App.useApp();function w(M,R){g.confirm({title:t("button._006_msg1"),content:t(R==="0"?"button._006_msg2":"button._006_msg3"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const I={code:M.code,status:R};ct.switchBpmnStatus(I).then(B=>{B.code===0&&(m(),y.success(t("common.successTip")))})}})}function C(){l.emit("changeComp",{comp:"BpmnEditPage",opType:"1",isApproval:a.value,type:r.value[0]})}function x(M){l.emit("changeComp",{comp:"BpmnEditPage",opType:"2",isApproval:a.value,code:M.code})}function b(M){l.emit("changeComp",{comp:"BpmnEditPage",opType:"3",isApproval:a.value,type:r.value[0],code:M.code})}function S(M){g.confirm({title:t("button._006_msg1"),content:t("button._004_msg2"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const R={code:M.code};ct.delBpmn(R).then(I=>{I.code===0&&(m(),y.success(t("common.successTip")))})}})}function P(M){g.info({title:t("wo_list.btn_chart"),content:f.h(gE,{data:M}),centered:!0,footer:null,icon:null,closable:!0,maskClosable:!0,width:1e3,class:"modal-comp"})}return f.onMounted(()=>{s(),f.onActivated(()=>{var M;(M=h.value)==null||M.loadData()})}),(M,R)=>{const I=U.InputSearch,B=U.Tree,L=U.Empty,O=tf,F=U.Button,G=U.Space,ke=B_,be=U.Switch,ce=f.resolveComponent("a-table-ex"),st=f.resolveComponent("wl-splitter"),We=f.resolveDirective("permission");return f.openBlock(),f.createBlock(st,{bordered:!1},{left:f.withCtx(()=>[f.createElementVNode("div",yE,[f.createElementVNode("div",vE,f.toDisplayString(M.$t("bpmn.list_title")),1),f.createElementVNode("div",_E,[f.createVNode(I,{value:f.unref(n),"onUpdate:value":R[0]||(R[0]=Ee=>f.isRef(n)?n.value=Ee:null),placeholder:M.$t("bpmn.type_placeholder"),onSearch:s},null,8,["value","placeholder"])]),f.createVNode(O,{class:"tree-wrapper"},{default:f.withCtx(()=>{var Ee;return[(Ee=f.unref(o))!=null&&Ee.length?(f.openBlock(),f.createBlock(B,{key:0,expandedKeys:f.unref(i),"onUpdate:expandedKeys":R[1]||(R[1]=Te=>f.isRef(i)?i.value=Te:null),selectedKeys:f.unref(r),"tree-data":f.unref(o),showLine:!0,onSelect:u},null,8,["expandedKeys","selectedKeys","tree-data"])):(f.openBlock(),f.createBlock(L,{key:1,imageStyle:{height:"64px"}}))]}),_:1})])]),right:f.withCtx(()=>[f.createVNode(G,{class:"ml-lg my-nm"},{default:f.withCtx(()=>[f.withDirectives((f.openBlock(),f.createBlock(F,{type:"primary",onClick:C},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(M.$t("bpmn.add_workflow")),1)]),_:1})),[[We,"002"]])]),_:1}),f.createVNode(ce,{ref_key:"tableEx",ref:h,class:"table-query bordered mx-lg",columns:f.unref(p),scroll:{x:1100},loadData:d},{bodyCell:f.withCtx(({column:Ee,record:Te,text:$})=>[Ee.dataIndex==="used"?(f.openBlock(),f.createBlock(ke,{key:0,type:"BPMN_USED",value:$},null,8,["value"])):f.createCommentVNode("",!0),Ee.dataIndex==="status"?(f.openBlock(),f.createBlock(be,{key:1,checked:$,checkedValue:"0",unCheckedValue:"1",disabled:!f.unref(Lo.hasPermission)("006"),onChange:H=>w(Te,H)},null,8,["checked","disabled","onChange"])):f.createCommentVNode("",!0),Ee.key==="action"?(f.openBlock(),f.createElementBlock("div",bE,[f.withDirectives((f.openBlock(),f.createBlock(F,{type:"link",onClick:H=>x(Te)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(M.$t("common.btn_edit")),1)]),_:2},1032,["onClick"])),[[We,"003"]]),f.withDirectives((f.openBlock(),f.createBlock(F,{type:"link",onClick:H=>S(Te)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(M.$t("common.btn_del")),1)]),_:2},1032,["onClick"])),[[We,"004"]]),f.withDirectives((f.openBlock(),f.createBlock(F,{type:"link",onClick:H=>P(Te)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(M.$t("wo_my.btn_detail")),1)]),_:2},1032,["onClick"])),[[We,"005"]]),f.withDirectives((f.openBlock(),f.createBlock(F,{type:"link",onClick:H=>b(Te)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(M.$t("bpmn.btn_clone")),1)]),_:2},1032,["onClick"])),[[We,"002"]])])):f.createCommentVNode("",!0)]),_:1},8,["columns"])]),_:1})}}}),[["__scopeId","data-v-bae8bdcf"]]);function Y(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function xE(e,t){return t={exports:{}},e(t,t.exports),t.exports}var wE=xE(function(e){var t=e.exports=function(n,i){if(i||(i=16),n===void 0&&(n=128),n<=0)return"0";for(var r=Math.log(Math.pow(2,n))/Math.log(i),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,n/o))/Math.log(i)*o;for(var a=r-Math.floor(r),s="",o=0;o<Math.floor(r);o++){var c=Math.floor(Math.random()*i).toString(i);s=c+s}if(a){var l=Math.pow(i,a),c=Math.floor(Math.random()*l).toString(i);s=c+s}var u=parseInt(s,i);return u!==1/0&&u>=Math.pow(2,n)?t(n,i):s};t.rack=function(n,i,r){var o=function(s){var c=0;do{if(c++>10)if(r)n+=r;else throw new Error("too many ID collisions, use more bits");var l=t(n,i)}while(Object.hasOwnProperty.call(a,l));return a[l]=s,l},a=o.hats={};return o.get=function(s){return o.hats[s]},o.set=function(s,c){return o.hats[s]=c,o},o.bits=n||128,o.base=i||16,o}});function sn(e){if(!(this instanceof sn))return new sn(e);e=e||[128,36,1],this._seed=e.length?wE.rack(e[0],e[1],e[2]):e}sn.prototype.next=function(e){return this._seed(e||!0)},sn.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},sn.prototype.claim=function(e,t){this._seed.set(e,t||!0)},sn.prototype.assigned=function(e){return this._seed.get(e)||!1},sn.prototype.unclaim=function(e){delete this._seed.hats[e]},sn.prototype.clear=function(){var e=this._seed.hats,t;for(t in e)this.unclaim(t)};function xc(e){return Array.prototype.concat.apply([],e)}const kr=Object.prototype.toString,SE=Object.prototype.hasOwnProperty;function yi(e){return e===void 0}function et(e){return e!==void 0}function Mr(e){return e==null}function oe(e){return kr.call(e)==="[object Array]"}function tt(e){return kr.call(e)==="[object Object]"}function ee(e){return kr.call(e)==="[object Number]"}function Ue(e){const t=kr.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Rt(e){return kr.call(e)==="[object String]"}function CE(e){if(!oe(e))throw new Error("must supply array")}function Et(e,t){return!Mr(e)&&SE.call(e,t)}function _e(e,t){const n=Xo(t);let i;return A(e,function(r,o){if(n(r,o))return i=r,!1}),i}function nf(e,t){const n=Xo(t);let i=oe(e)?-1:void 0;return A(e,function(r,o){if(n(r,o))return i=o,!1}),i}function le(e,t){const n=Xo(t);let i=[];return A(e,function(r,o){n(r,o)&&i.push(r)}),i}function A(e,t){let n,i;if(yi(e))return;const r=oe(e)?kE:AE;for(let o in e)if(Et(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n}function RE(e,t){if(yi(e))return[];CE(e);const n=Xo(t);return e.filter(function(i,r){return!n(i,r)})}function Tt(e,t,n){return A(e,function(i,r){n=t(n,i,r)}),n}function vi(e,t){return!!Tt(e,function(n,i,r){return n&&t(i,r)},!0)}function jn(e,t){return!!_e(e,t)}function lt(e,t){let n=[];return A(e,function(i,r){n.push(t(i,r))}),n}function qo(e){return e&&Object.keys(e)||[]}function TE(e){return qo(e).length}function Yo(e){return lt(e,t=>t)}function Wi(e,t,n={}){return t=wc(t),A(e,function(i){let r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function rf(e,...t){e=wc(e);let n={};return A(t,r=>Wi(r,e,n)),lt(n,function(r,o){return r[0]})}const PE=rf;function cn(e,t){t=wc(t);let n=[];return A(e,function(i,r){let o=t(i,r),a={d:o,v:i};for(var s=0;s<n.length;s++){let{d:c}=n[s];if(o<c){n.splice(s,0,a);return}}n.push(a)}),lt(n,i=>i.v)}function Jt(e){return function(t){return vi(e,function(n,i){return t[i]===n})}}function wc(e){return Ue(e)?e:t=>t[e]}function Xo(e){return Ue(e)?e:t=>t===e}function AE(e){return e}function kE(e){return Number(e)}function of(e,t){let n,i,r,o;function a(p){let d=Date.now(),h=p?0:o+t-d;if(h>0)return s(h);e.apply(r,i),c()}function s(p){n=setTimeout(a,p)}function c(){n&&clearTimeout(n),n=o=i=r=void 0}function l(){n&&a(!0),c()}function u(...p){o=Date.now(),i=p,r=this,n||s(t)}return u.flush=l,u.cancel=c,u}function xt(e,t){return e.bind(t)}function D(e,...t){return Object.assign(e,...t)}function ME(e,t,n){let i=e;return A(t,function(r,o){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+typeof r+". Key should be of type number or string.");if(r==="constructor")throw new Error("illegal key: constructor");if(r==="__proto__")throw new Error("illegal key: __proto__");let a=t[o+1],s=i[r];et(a)&&Mr(s)&&(s=i[r]=isNaN(+a)?{}:[]),yi(a)?yi(n)?delete i[r]:i[r]=n:i=s}),e}function Qt(e,t){let n={},i=Object(e);return A(t,function(r){r in i&&(n[r]=e[r])}),n}function ln(e,t){let n={},i=Object(e);return A(i,function(r,o){t.indexOf(o)===-1&&(n[o]=r)}),n}function DE(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(i){if(i!=="default"&&!(i in e)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}})}),Object.freeze(e)}const NE=Object.prototype.toString,OE=Object.prototype.hasOwnProperty;function IE(e){return e===void 0}function BE(e){return NE.call(e)==="[object Array]"}function LE(e,t){return OE.call(e,t)}function af(e,t){let n,i;if(IE(e))return;const r=BE(e)?jE:$E;for(let o in e)if(LE(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n}function $E(e){return e}function jE(e){return Number(e)}function ut(e,...t){const n=e.style;return af(t,function(i){i&&af(i,function(r,o){n[o]=r})}),e}function pt(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}const FE=Object.prototype.toString;function Ie(e){return new Fn(e)}function Fn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Fn.prototype.add=function(e){return this.list.add(e),this},Fn.prototype.remove=function(e){return FE.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Fn.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},Fn.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Fn.prototype.array=function(){return Array.from(this.list)},Fn.prototype.has=Fn.prototype.contains=function(e){return this.list.contains(e)};function Zo(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Ui(e,t,n){var i=n?e:e.parentNode;return i&&typeof i.closest=="function"&&i.closest(t)||null}var Jo={},Qo,Sc,Cc;function sf(){Qo=window.addEventListener?"addEventListener":"attachEvent",Sc=window.removeEventListener?"removeEventListener":"detachEvent",Cc=Qo!=="addEventListener"?"on":""}var HE=Jo.bind=function(e,t,n,i){return Qo||sf(),e[Qo](Cc+t,n,i||!1),n},VE=Jo.unbind=function(e,t,n,i){return Sc||sf(),e[Sc](Cc+t,n,i||!1),n},ae=DE({__proto__:null,bind:HE,unbind:VE,default:Jo},[Jo]),cf=["focus","blur"];function zE(e,t,n,i,r){return cf.indexOf(n)!==-1&&(r=!0),ae.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Ui(a,t,!0),o.delegateTarget&&i.call(e,o)},r)}function WE(e,t,n,i){return cf.indexOf(t)!==-1&&(i=!0),ae.unbind(e,t,n,i)}var Pt={bind:zE,unbind:WE},UE=GE,lf=!1,ea;typeof document<"u"&&(ea=document.createElement("div"),ea.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',lf=!ea.getElementsByTagName("link").length,ea=void 0);var Ge={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:lf?[1,"X<div>","</div>"]:[0,"",""]};Ge.td=Ge.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Ge.option=Ge.optgroup=[1,'<select multiple="multiple">',"</select>"],Ge.thead=Ge.tbody=Ge.colgroup=Ge.caption=Ge.tfoot=[1,"<table>","</table>"],Ge.polyline=Ge.ellipse=Ge.polygon=Ge.circle=Ge.text=Ge.line=Ge.path=Ge.rect=Ge.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];function GE(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body"){var c=t.createElement("html");return c.innerHTML=e,c.removeChild(c.lastChild)}var r=Object.prototype.hasOwnProperty.call(Ge,i)?Ge[i]:Ge._default,o=r[0],a=r[1],s=r[2],c=t.createElement("div");for(c.innerHTML=a+e+s;o--;)c=c.lastChild;if(c.firstChild==c.lastChild)return c.removeChild(c.firstChild);for(var l=t.createDocumentFragment();c.firstChild;)l.appendChild(c.removeChild(c.firstChild));return l}var Pe=UE;function uf(e,t){return e&&typeof e.matches=="function"&&e.matches(t)||!1}function we(e,t){return t=t||document,t.querySelector(e)}function Rc(e,t){return t=t||document,t.querySelectorAll(e)}function un(e){e.parentNode&&e.parentNode.removeChild(e)}function KE(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function qE(e,t){return t.appendChild(KE(e,t))}function ie(e,t){return qE(t,e),e}var Tc=2,pf={"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":Tc,"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":Tc,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function YE(e,t){return pf[t]?e.style[t]:e.getAttributeNS(null,t)}function ff(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=pf[i];r?(r===Tc&&typeof n=="number"&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function XE(e,t){var n=Object.keys(t),i,r;for(i=0,r;r=n[i];i++)ff(e,r,t[r])}function q(e,t,n){if(typeof t=="string")if(n!==void 0)ff(e,t,n);else return YE(e,t);else XE(e,t);return e}const ZE=Object.prototype.toString;function me(e){return new Hn(e)}function Hn(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Hn.prototype.add=function(e){return this.list.add(e),this},Hn.prototype.remove=function(e){return ZE.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},Hn.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},Hn.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Hn.prototype.array=function(){return Array.from(this.list)},Hn.prototype.has=Hn.prototype.contains=function(e){return this.list.contains(e)};function ta(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function df(e){return e.cloneNode(!0)}var Pc={svg:"http://www.w3.org/2000/svg"},hf='<svg xmlns="'+Pc.svg+'"';function JE(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Pc.svg)===-1&&(e=hf+e.substring(4)):(e=hf+">"+e+"</svg>",t=!0);var n=QE(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function QE(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function X(e,t){var n;return e=e.trim(),e.charAt(0)==="<"?(n=JE(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Pc.svg,e),t&&q(n,t),n}var Ac=null;function mf(){return Ac===null&&(Ac=X("svg")),Ac}function gf(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function ex(e,t,n,i,r,o){var a=mf().createSVGMatrix();switch(arguments.length){case 0:return a;case 1:return gf(a,e);case 6:return gf(a,{a:e,b:t,c:n,d:i,e:r,f:o})}}function Dr(e){return mf().createSVGTransform()}var yf=/([&<>]{1})/g,tx=/([&<>\n\r"]{1})/g,nx={"&":"&","<":"<",">":">",'"':"'"};function kc(e,t){function n(i,r){return nx[r]||r}return e.replace(t,n)}function vf(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(kc(e.textContent,yf));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(r=e.attributes,n=0,i=r.length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',kc(o.value,tx),'"');if(e.hasChildNodes()){for(t.push(">"),a=e.childNodes,n=0,i=a.length;n<i;++n)vf(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",kc(e.nodeValue,yf),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function ix(e){for(var t=e.firstChild,n=[];t;)vf(t,n),t=t.nextSibling;return n.join("")}function _f(e,t){return ix(e)}function Ke(e){var t=e.parentNode;return t&&t.removeChild(e),e}function rx(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function ox(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(rx(e,i))}function Nr(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),ox(n,t)),n.consolidate()}const ax=/^class[ {]/;function sx(e){return ax.test(e.toString())}function Mc(e){return Array.isArray(e)}function Dc(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function na(...e){e.length===1&&Mc(e[0])&&(e=e[0]),e=[...e];const t=e.pop();return t.$inject=e,t}const cx=/constructor\s*[^(]*\(\s*([^)]*)\)/m,lx=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,ux=/\/\*([^*]*)\*\//m;function px(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(sx(e)?cx:lx);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(i=>{const r=i.match(ux);return(r&&r[1]||i).trim()})||[]}function bf(e,t){const n=t||{get:function(x,b){if(i.push(x),b===!1)return null;throw s(`No provider for "${x}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(x){const b=i.join(" -> ");return i.length=0,new Error(b?`${x} (Resolving: ${b})`:x)};function c(x,b){if(!r[x]&&x.includes(".")){const S=x.split(".");let P=c(S.shift());for(;S.length;)P=P[S.shift()];return P}if(Dc(o,x))return o[x];if(Dc(r,x)){if(i.indexOf(x)!==-1)throw i.push(x),s("Cannot resolve circular dependency!");return i.push(x),o[x]=r[x][0](r[x][1]),i.pop(),o[x]}return n.get(x,b)}function l(x,b){if(typeof b>"u"&&(b={}),typeof x!="function")if(Mc(x))x=na(x.slice());else throw s(`Cannot invoke "${x}". Expected a function!`);const P=(x.$inject||px(x)).map(M=>Dc(b,M)?b[M]:c(M));return{fn:x,dependencies:P}}function u(x){const{fn:b,dependencies:S}=l(x),P=Function.prototype.bind.call(b,null,...S);return new P}function p(x,b,S){const{fn:P,dependencies:M}=l(x,S);return P.apply(b,M)}function d(x){return na(b=>x.get(b))}function h(x,b){if(b&&b.length){const S=Object.create(null),P=Object.create(null),M=[],R=[],I=[];let B,L,O,F;for(let G in r)B=r[G],b.indexOf(G)!==-1&&(B[2]==="private"?(L=M.indexOf(B[3]),L===-1?(O=B[3].createChild([],b),F=d(O),M.push(B[3]),R.push(O),I.push(F),S[G]=[F,G,"private",O]):S[G]=[I[L],G,"private",R[L]]):S[G]=[B[2],B[1]],P[G]=!0),(B[2]==="factory"||B[2]==="type")&&B[1].$scope&&b.forEach(ke=>{B[1].$scope.indexOf(ke)!==-1&&(S[G]=[B[2],B[1]],P[ke]=!0)});b.forEach(G=>{if(!P[G])throw new Error('No provider for "'+G+'". Cannot use provider from the parent!')}),x.unshift(S)}return new bf(x,a)}const m={factory:p,type:u,value:function(x){return x}};function y(x,b){const S=x.__init__||[];return function(){S.forEach(P=>{typeof P=="string"?b.get(P):b.invoke(P)})}}function g(x){const b=x.__exports__;if(b){const S=x.__modules__,P=Object.keys(x).reduce((L,O)=>(O!=="__exports__"&&O!=="__modules__"&&O!=="__init__"&&O!=="__depends__"&&(L[O]=x[O]),L),Object.create(null)),M=(S||[]).concat(P),R=h(M),I=na(function(L){return R.get(L)});b.forEach(function(L){r[L]=[I,L,"private",R]});const B=(x.__init__||[]).slice();return B.unshift(function(){R.init()}),x=Object.assign({},x,{__init__:B}),y(x,R)}return Object.keys(x).forEach(function(S){if(S==="__init__"||S==="__depends__")return;const P=x[S];if(P[2]==="private"){r[S]=P;return}const M=P[0],R=P[1];r[S]=[m[M],fx(M,R),M]}),y(x,a)}function w(x,b){return x.indexOf(b)!==-1||(x=(b.__depends__||[]).reduce(w,x),x.indexOf(b)!==-1)?x:x.concat(b)}function C(x){const b=x.reduce(w,[]).map(g);let S=!1;return function(){S||(S=!0,b.forEach(P=>P()))}}this.get=c,this.invoke=p,this.instantiate=u,this.createChild=h,this.init=C(e)}function fx(e,t){return e!=="value"&&Mc(t)&&(t=na(t.slice())),t}var dx=1e3;function En(e,t){var n=this;t=t||dx,e.on(["render.shape","render.connection"],t,function(i,r){var o=i.type,a=r.element,s=r.gfx,c=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(s,a,c):n.drawConnection(s,a,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}En.prototype.canRender=function(e){},En.prototype.drawShape=function(e,t){},En.prototype.drawConnection=function(e,t){},En.prototype.getShapePath=function(e){},En.prototype.getConnectionPath=function(e){};function _i(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function hx(e){return["M",e.x,e.y]}function Nc(e){return["L",e.x,e.y]}function mx(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function gx(e,t){const n=e.length,i=[hx(e[0])];for(let r=1;r<n;r++){const o=e[r-1],a=e[r],s=e[r+1];if(!s||!t){i.push(Nc(a));continue}const c=Math.min(t,Oc(a.x-o.x,a.y-o.y),Oc(s.x-a.x,s.y-a.y));if(!c){i.push(Nc(a));continue}const l=ia(a,o,c),u=ia(a,o,c*.5),p=ia(a,s,c),d=ia(a,s,c*.5);i.push(Nc(l)),i.push(mx(u,d,p))}return i}function ia(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=Oc(i,r),a=n/o;return{x:e.x+i*a,y:e.y+r*a}}function Oc(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ra(e,t,n){ee(t)&&(n=t,t=null),t||(t={});const i=X("path",t);return ee(n)&&(i.dataset.cornerRadius=String(n)),Ef(i,e)}function Ef(e,t){const n=parseInt(e.dataset.cornerRadius,10)||0;return q(e,{d:_i(gx(t,n))}),e}function oa(e){return le(e,function(t){return!_e(e,function(n){return n!==t&&xf(t,n)})})}function xf(e,t){if(t){if(e===t)return t;if(e.parent)return xf(e.parent,t)}}function wf(e,t,n){var i=!n||e.indexOf(t)===-1;return i&&e.push(t),i}function bi(e,t,n){n=n||0,oe(e)||(e=[e]),A(e,function(i,r){var o=t(i,r,n);oe(o)&&o.length&&bi(o,t,n+1)})}function yx(e,t,n){var i=[],r=[];return bi(e,function(o,a,s){wf(i,o,t);var c=o.children;if(c&&wf(r,c,t))return c}),i}function Or(e,t){return yx(e,!t)}function vx(e,t,n){yi(t)&&(t=!0),tt(t)&&(n=t,t=!0),n=n||{};var i=Ir(n.allShapes),r=Ir(n.allConnections),o=Ir(n.enclosedElements),a=Ir(n.enclosedConnections),s=Ir(n.topLevel,t&&Wi(e,function(u){return u.id}));function c(u){s[u.source.id]&&s[u.target.id]&&(s[u.id]=[u]),i[u.source.id]&&i[u.target.id]&&(a[u.id]=o[u.id]=u),r[u.id]=u}function l(u){if(o[u.id]=u,u.waypoints)a[u.id]=r[u.id]=u;else return i[u.id]=u,A(u.incoming,c),A(u.outgoing,c),u.children}return bi(e,l),{allShapes:i,allConnections:r,topLevel:s,enclosedConnections:a,enclosedElements:o}}function qe(e,t){t=!!t,oe(e)||(e=[e]);var n,i,r,o;return A(e,function(a){var s=a;a.waypoints&&!t&&(s=qe(a.waypoints,!0));var c=s.x,l=s.y,u=s.height||0,p=s.width||0;(c<n||n===void 0)&&(n=c),(l<i||i===void 0)&&(i=l),(c+p>r||r===void 0)&&(r=c+p),(l+u>o||o===void 0)&&(o=l+u)}),{x:n,y:i,height:o-i,width:r-n}}function Sf(e,t){var n={};return A(e,function(i){var r=i;r.waypoints&&(r=qe(r)),!ee(t.y)&&r.x>t.x&&(n[i.id]=i),!ee(t.x)&&r.y>t.y&&(n[i.id]=i),r.x>t.x&&r.y>t.y&&(ee(t.width)&&ee(t.height)&&r.width+r.x<t.width+t.x&&r.height+r.y<t.height+t.y||!ee(t.width)||!ee(t.height))&&(n[i.id]=i)}),n}function Cf(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Rf(e){return!!(e&&e.isFrame)}function Ir(e,t){return D({},e||{},t||{})}var _x=1;function Vn(e,t){En.call(this,e,_x),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})}Y(Vn,En),Vn.prototype.canRender=function(){return!0},Vn.prototype.drawShape=function(t,n,i){var r=X("rect");return q(r,{x:0,y:0,width:n.width||0,height:n.height||0}),Rf(n)?q(r,D({},this.FRAME_STYLE,i||{})):q(r,D({},this.SHAPE_STYLE,i||{})),ie(t,r),r},Vn.prototype.drawConnection=function(t,n,i){var r=ra(n.waypoints,D({},this.CONNECTION_STYLE,i||{}));return ie(t,r),r},Vn.prototype.getShapePath=function(t){var n=t.x,i=t.y,r=t.width,o=t.height,a=[["M",n,i],["l",r,0],["l",0,o],["l",-r,0],["z"]];return _i(a)},Vn.prototype.getConnectionPath=function(t){var n=t.waypoints,i,r,o=[];for(i=0;r=n[i];i++)r=r.original||r,o.push([i===0?"M":"L",r.x,r.y]);return _i(o)},Vn.$inject=["eventBus","styles"];function bx(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,i,r){var o=this.style(i,r);return D(o,{class:n})},this.style=function(n,i){!oe(n)&&!i&&(i=n,n=[]);var r=Tt(n,function(o,a){return D(o,e[a]||{})},{});return i?D(r,i):r},this.computeStyle=function(n,i,r){return oe(i)||(r=i,i=[]),t.style(i||[],D({},r,n||{}))}}const Ex={__init__:["defaultRenderer"],defaultRenderer:["type",Vn],styles:["type",bx]};function $e(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Ye(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var i=e.indexOf(t);if(i!==-1){if(i===n)return;if(n!==-1)e.splice(i,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function Ic(e,t){return!e||!t?-1:e.indexOf(t)}function Br(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Bc(e,t,n,i){if(typeof i>"u"&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=Br(e,t);return Math.abs(r/o)<=i}var xx=2;function xn(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[r,o]of Object.entries(i))if(wx(r,n))return o;return!1}function wx(e,t){const n=t[0];return vi(t,function(i){return Math.abs(n[e]-i[e])<=xx})}function Tf(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function Lc(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var Sx=/,?([a-z]),?/gi,Pf=parseFloat,je=Math,zn=je.PI,pn=je.min,fn=je.max,Af=je.pow,Wn=je.abs,Cx=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,Rx=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,aa=Array.isArray||function(e){return e instanceof Array};function $c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Lr(e){if(typeof e=="function"||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)$c(e,n)&&(t[n]=Lr(e[n]));return t}function Tx(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function Px(e){function t(){var n=Array.prototype.slice.call(arguments,0),i=n.join("␀"),r=t.cache=t.cache||{},o=t.count=t.count||[];return $c(r,i)?(Tx(o,i),r[i]):(o.length>=1e3&&delete r[o.shift()],o.push(i),r[i]=e(...arguments),r[i])}return t}function Ax(e){if(!e)return null;var t=Gi(e);if(t.arr)return Lr(t.arr);var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return aa(e)&&aa(e[0])&&(i=Lr(e)),i.length||String(e).replace(Cx,function(r,o,a){var s=[],c=o.toLowerCase();for(a.replace(Rx,function(l,u){u&&s.push(+u)}),c=="m"&&s.length>2&&(i.push([o,...s.splice(0,2)]),c="l",o=o=="m"?"l":"L");s.length>=n[c]&&(i.push([o,...s.splice(0,n[c])]),!!n[c]););}),i.toString=Gi.toString,t.arr=Lr(i),i}function Gi(e){var t=Gi.ps=Gi.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)$c(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function jc(e,t,n,i){return arguments.length===1&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function kf(){return this.join(",").replace(Sx,"$1")}function sa(e){var t=Lr(e);return t.toString=kf,t}function Mf(e,t,n,i,r,o,a,s,c){var l=1-c,u=Af(l,3),p=Af(l,2),d=c*c,h=d*c,m=u*e+p*3*c*n+l*3*c*c*r+h*a,y=u*t+p*3*c*i+l*3*c*c*o+h*s;return{x:ca(m),y:ca(y)}}function Df(e){var t=Ox(...e);return jc(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Un(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function kx(e,t){return e=jc(e),t=jc(t),Un(t,e.x,e.y)||Un(t,e.x2,e.y)||Un(t,e.x,e.y2)||Un(t,e.x2,e.y2)||Un(e,t.x,t.y)||Un(e,t.x2,t.y)||Un(e,t.x,t.y2)||Un(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function Nf(e,t,n,i,r){var o=-3*t+9*n-9*i+3*r,a=e*o+6*t-12*n+6*i;return e*a-3*t+3*n}function Of(e,t,n,i,r,o,a,s,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var l=c/2,u=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,m=0;m<u;m++){var y=l*p[m]+l,g=Nf(y,e,n,r,a),w=Nf(y,t,i,o,s),C=g*g+w*w;h+=d[m]*je.sqrt(C)}return l*h}function Mx(e,t,n,i,r,o,a,s){if(!(fn(e,n)<pn(r,a)||pn(e,n)>fn(r,a)||fn(t,i)<pn(o,s)||pn(t,i)>fn(o,s))){var c=(e*i-t*n)*(r-a)-(e-n)*(r*s-o*a),l=(e*i-t*n)*(o-s)-(t-i)*(r*s-o*a),u=(e-n)*(o-s)-(t-i)*(r-a);if(u){var p=ca(c/u),d=ca(l/u),h=+p.toFixed(2),m=+d.toFixed(2);if(!(h<+pn(e,n).toFixed(2)||h>+fn(e,n).toFixed(2)||h<+pn(r,a).toFixed(2)||h>+fn(r,a).toFixed(2)||m<+pn(t,i).toFixed(2)||m>+fn(t,i).toFixed(2)||m<+pn(o,s).toFixed(2)||m>+fn(o,s).toFixed(2)))return{x:p,y:d}}}}function ca(e){return Math.round(e*1e11)/1e11}function Dx(e,t,n){var i=Df(e),r=Df(t);if(!kx(i,r))return[];for(var o=Of(...e),a=Of(...t),s=Bf(e)?1:~~(o/5)||1,c=Bf(t)?1:~~(a/5)||1,l=[],u=[],p={},d=[],h=0;h<s+1;h++){var m=Mf(...e,h/s);l.push({x:m.x,y:m.y,t:h/s})}for(h=0;h<c+1;h++)m=Mf(...t,h/c),u.push({x:m.x,y:m.y,t:h/c});for(h=0;h<s;h++)for(var y=0;y<c;y++){var g=l[h],w=l[h+1],C=u[y],x=u[y+1],b=Wn(w.x-g.x)<.01?"y":"x",S=Wn(x.x-C.x)<.01?"y":"x",P=Mx(g.x,g.y,w.x,w.y,C.x,C.y,x.x,x.y),M;if(P){if(M=P.x.toFixed(9)+"#"+P.y.toFixed(9),p[M])continue;p[M]=!0;var R=g.t+Wn((P[b]-g[b])/(w[b]-g[b]))*(w.t-g.t),I=C.t+Wn((P[S]-C[S])/(x[S]-C[S]))*(x.t-C.t);R>=0&&R<=1&&I>=0&&I<=1&&d.push({x:P.x,y:P.y,t1:R,t2:I})}}return d}function If(e,t,n){e=jf(e),t=jf(t);for(var i,r,o,a,s,c,l,u,p,d,h=n?0:[],m=0,y=e.length;m<y;m++){var g=e[m];if(g[0]=="M")i=s=g[1],r=c=g[2];else{g[0]=="C"?(p=[i,r,...g.slice(1)],i=p[6],r=p[7]):(p=[i,r,i,r,s,c,s,c],i=s,r=c);for(var w=0,C=t.length;w<C;w++){var x=t[w];if(x[0]=="M")o=l=x[1],a=u=x[2];else{x[0]=="C"?(d=[o,a,...x.slice(1)],o=d[6],a=d[7]):(d=[o,a,o,a,l,u,l,u],o=l,a=u);var b=Dx(p,d);{for(var S=0,P=b.length;S<P;S++)b[S].segment1=m,b[S].segment2=w,b[S].bez1=p,b[S].bez2=d;h=h.concat(b)}}}}}return h}function Nx(e){var t=Gi(e);if(t.abs)return sa(t.abs);if((!aa(e)||!aa(e&&e[0]))&&(e=Ax(e)),!e||!e.length)return[["M",0,0]];var n=[],i=0,r=0,o=0,a=0,s=0,c;e[0][0]=="M"&&(i=+e[0][1],r=+e[0][2],o=i,a=r,s++,n[0]=["M",i,r]);for(var l,u,p=s,d=e.length;p<d;p++){if(n.push(l=[]),u=e[p],c=u[0],c!=c.toUpperCase())switch(l[0]=c.toUpperCase(),l[0]){case"A":l[1]=u[1],l[2]=u[2],l[3]=u[3],l[4]=u[4],l[5]=u[5],l[6]=+u[6]+i,l[7]=+u[7]+r;break;case"V":l[1]=+u[1]+r;break;case"H":l[1]=+u[1]+i;break;case"M":o=+u[1]+i,a=+u[2]+r;default:for(var h=1,m=u.length;h<m;h++)l[h]=+u[h]+(h%2?i:r)}else for(var y=0,g=u.length;y<g;y++)l[y]=u[y];switch(c=c.toUpperCase(),l[0]){case"Z":i=+o,r=+a;break;case"H":i=l[1];break;case"V":r=l[1];break;case"M":o=l[l.length-2],a=l[l.length-1];default:i=l[l.length-2],r=l[l.length-1]}}return n.toString=kf,t.abs=sa(n),n}function Bf(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function la(e,t,n,i){return[e,t,n,i,n,i]}function Lf(e,t,n,i,r,o){var a=.3333333333333333,s=2/3;return[a*e+s*n,a*t+s*i,a*r+s*n,a*o+s*i,r,o]}function $f(e,t,n,i,r,o,a,s,c,l){var u=zn*120/180,p=zn/180*(+r||0),d=[],h,m=Px(function(T,_,v){var k=T*je.cos(v)-_*je.sin(v),N=T*je.sin(v)+_*je.cos(v);return{x:k,y:N}});if(l)M=l[0],R=l[1],S=l[2],P=l[3];else{h=m(e,t,-p),e=h.x,t=h.y,h=m(s,c,-p),s=h.x,c=h.y;var y=(e-s)/2,g=(t-c)/2,w=y*y/(n*n)+g*g/(i*i);w>1&&(w=je.sqrt(w),n=w*n,i=w*i);var C=n*n,x=i*i,b=(o==a?-1:1)*je.sqrt(Wn((C*x-C*g*g-x*y*y)/(C*g*g+x*y*y))),S=b*n*g/i+(e+s)/2,P=b*-i*y/n+(t+c)/2,M=je.asin(((t-P)/i).toFixed(9)),R=je.asin(((c-P)/i).toFixed(9));M=e<S?zn-M:M,R=s<S?zn-R:R,M<0&&(M=zn*2+M),R<0&&(R=zn*2+R),a&&M>R&&(M=M-zn*2),!a&&R>M&&(R=R-zn*2)}var I=R-M;if(Wn(I)>u){var B=R,L=s,O=c;R=M+u*(a&&R>M?1:-1),s=S+n*je.cos(R),c=P+i*je.sin(R),d=$f(s,c,n,i,r,0,a,L,O,[R,B,S,P])}I=R-M;var F=je.cos(M),G=je.sin(M),ke=je.cos(R),be=je.sin(R),ce=je.tan(I/4),st=4/3*n*ce,We=4/3*i*ce,Ee=[e,t],Te=[e+st*G,t-We*F],$=[s+st*be,c-We*ke],H=[s,c];if(Te[0]=2*Ee[0]-Te[0],Te[1]=2*Ee[1]-Te[1],l)return[Te,$,H].concat(d);d=[Te,$,H].concat(d).join().split(",");for(var Z=[],he=0,Ct=d.length;he<Ct;he++)Z[he]=he%2?m(d[he-1],d[he],p).y:m(d[he],d[he+1],p).x;return Z}function Ox(e,t,n,i,r,o,a,s){for(var c=[],l=[[],[]],u,p,d,h,m,y,g,w,C=0;C<2;++C){if(C==0?(p=6*e-12*n+6*r,u=-3*e+9*n-9*r+3*a,d=3*n-3*e):(p=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*s,d=3*i-3*t),Wn(u)<1e-12){if(Wn(p)<1e-12)continue;h=-d/p,0<h&&h<1&&c.push(h);continue}g=p*p-4*d*u,w=je.sqrt(g),!(g<0)&&(m=(-p+w)/(2*u),0<m&&m<1&&c.push(m),y=(-p-w)/(2*u),0<y&&y<1&&c.push(y))}for(var x=c.length,b=x,S;x--;)h=c[x],S=1-h,l[0][x]=S*S*S*e+3*S*S*h*n+3*S*h*h*r+h*h*h*a,l[1][x]=S*S*S*t+3*S*S*h*i+3*S*h*h*o+h*h*h*s;return l[0][b]=e,l[1][b]=t,l[0][b+1]=a,l[1][b+1]=s,l[0].length=l[1].length=b+2,{x0:pn(...l[0]),y0:pn(...l[1]),x1:fn(...l[0]),y1:fn(...l[1])}}function jf(e){var t=Gi(e);if(t.curve)return sa(t.curve);for(var n=Nx(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(h,m,y){var g,w;if(!h)return["C",m.x,m.y,m.x,m.y,m.x,m.y];switch(!(h[0]in{T:1,Q:1})&&(m.qx=m.qy=null),h[0]){case"M":m.X=h[1],m.Y=h[2];break;case"A":h=["C",...$f(m.x,m.y,...h.slice(1))];break;case"S":y=="C"||y=="S"?(g=m.x*2-m.bx,w=m.y*2-m.by):(g=m.x,w=m.y),h=["C",g,w,...h.slice(1)];break;case"T":y=="Q"||y=="T"?(m.qx=m.x*2-m.qx,m.qy=m.y*2-m.qy):(m.qx=m.x,m.qy=m.y),h=["C",...Lf(m.x,m.y,m.qx,m.qy,h[1],h[2])];break;case"Q":m.qx=h[1],m.qy=h[2],h=["C",...Lf(m.x,m.y,h[1],h[2],h[3],h[4])];break;case"L":h=["C",...la(m.x,m.y,h[1],h[2])];break;case"H":h=["C",...la(m.x,m.y,h[1],m.y)];break;case"V":h=["C",...la(m.x,m.y,m.x,h[1])];break;case"Z":h=["C",...la(m.x,m.y,m.X,m.Y)];break}return h},o=function(h,m){if(h[m].length>7){h[m].shift();for(var y=h[m];y.length;)a[m]="A",h.splice(m++,0,["C",...y.splice(0,6)]);h.splice(m,1),u=n.length}},a=[],s="",c="",l=0,u=n.length;l<u;l++){n[l]&&(s=n[l][0]),s!="C"&&(a[l]=s,l&&(c=a[l-1])),n[l]=r(n[l],i,c),a[l]!="A"&&s=="C"&&(a[l]="C"),o(n,l);var p=n[l],d=p.length;i.x=p[d-2],i.y=p[d-1],i.bx=Pf(p[d-4])||i.x,i.by=Pf(p[d-3])||i.y}return t.curve=sa(n),n}function Se(e){return tt(e)&&Et(e,"waypoints")}function ge(e){return tt(e)&&Et(e,"labelTarget")}function Ff(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function wn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function Q(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function ua(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function Ix(e){return wn({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function Bx(e){for(var t=e.waypoints,n=t.reduce(function(l,u,p){var d=t[p-1];if(d){var h=l[l.length-1],m=h&&h.endLength||0,y=jx(d,u);l.push({start:d,end:u,startLength:m,endLength:m+y,length:y})}return l},[]),i=n.reduce(function(l,u){return l+u.length},0),r=i/2,o=0,a=n[o];a.endLength<r;)a=n[++o];var s=(r-a.startLength)/a.length,c={x:a.start.x+(a.end.x-a.start.x)*s,y:a.start.y+(a.end.y-a.start.y)*s};return c}function te(e){return Se(e)?Bx(e):Ix(e)}function ft(e,t,n){n=n||0,tt(n)||(n={x:n,y:n});var i=Q(e),r=Q(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=r.right,s=i.top-n.y>=r.bottom,c=i.right+n.x<=r.left,l=o?"top":s?"bottom":null,u=c?"left":a?"right":null;return u&&l?l+"-"+u:u||l||"intersect"}function Fc(e,t,n){var i=Lx(e,t);return i.length===1||i.length===2&&Br(i[0],i[1])<1?wn(i[0]):i.length>1?(i=cn(i,function(r){var o=Math.floor(r.t2*100)||1;return o=100-o,o=(o<10?"0":"")+o,r.segment2+"#"+o}),wn(i[n?0:i.length-1])):null}function Lx(e,t){return If(e,t)}function $x(e){e=e.slice();for(var t=0,n,i,r;e[t];)n=e[t],i=e[t-1],r=e[t+1],Br(n,r)===0||Bc(i,r,n)?e.splice(t,1):t++;return e}function jx(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pa(e,t){return Math.round(e*t)/t}function Hf(e){return ee(e)?e+"px":e}function Fx(e){for(;e.parent;)e=e.parent;return e}function Hx(e){e=D({},{width:"100%",height:"100%"},e);const t=e.container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent"),ut(n,{position:"relative",overflow:"hidden",width:Hf(e.width),height:Hf(e.height)}),t.appendChild(n),n}function Vf(e,t,n){const i=X("g");me(i).add(t);const r=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const Vx="base",zf=0,zx=1,Wx={shape:["x","y","width","height"],connection:["waypoints"]};function ne(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}ne.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ne.prototype._init=function(e){const t=this._eventBus,n=this._container=Hx(e),i=this._svg=X("svg");q(i,{width:"100%",height:"100%"}),pt(i,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,o=>{this.focus()}),i.addEventListener("focusin",()=>{this._setFocused(!0)}),i.addEventListener("focusout",()=>{this._setFocused(!1)}),ie(n,i);const r=this._viewport=Vf(i,"viewport");e.deferUpdate&&(this._viewboxChanged=of(xt(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:i,viewport:r})}),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)},ne.prototype._destroy=function(){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},ne.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},ne.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{const n=Cf(t);n==="root"?this.removeRootElement(t):this._removeElement(t,n)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},ne.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},ne.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()},ne.prototype.isFocused=function(){return this._focused},ne.prototype.getDefaultLayer=function(){return this.getLayer(Vx,zf)},ne.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},ne.prototype._getChildIndex=function(e){return Tt(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},ne.prototype._createLayer=function(e,t){typeof t>"u"&&(t=zx);const n=this._getChildIndex(t);return{group:Vf(this._viewport,"layer-"+e,n),index:t,visible:!0}},ne.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,i=t.group,r=t.index;if(t.visible)return i;const o=this._getChildIndex(r);return n.insertBefore(i,n.childNodes[o]||null),t.visible=!0,i},ne.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&&(Ke(n),t.visible=!1),n},ne.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Ke(t.group))},ne.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},ne.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(Fx(e))||{}).rootElement:void 0},ne.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},ne.prototype._findPlaneForRoot=function(e){return _e(this._planes,function(t){return t.rootElement===e})},ne.prototype.getContainer=function(){return this._container},ne.prototype._updateMarker=function(e,t,n){let i;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,i=this._elementRegistry._elements[e.id],i&&(A([i.gfx,i.secondaryGfx],function(r){r&&(n?(e.markers.add(t),me(r).add(t)):(e.markers.delete(t),me(r).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},ne.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ne.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ne.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1},ne.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ne.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},ne.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 i=this.getLayer(n,zf);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},ne.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(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},ne.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},ne.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)},ne.prototype._addRoot=function(e,t){const n=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),n.add(e,t),i.fire("root.added",{element:e,gfx:t})},ne.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})},ne.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=Wx[e];if(!vi(n,function(r){return typeof t[r]<"u"}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},ne.prototype._setParent=function(e,t,n){Ye(t.children,e,n),e.parent=t},ne.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();const r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);const a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},ne.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},ne.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},ne.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e),!!e)return r.fire(t+".remove",{element:e}),i.remove(e),$e(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},ne.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ne.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ne.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ne.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ne.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ne.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let i,r,o,a,s,c,l;if(e)this._changeViewbox(function(){s=Math.min(n.width/e.width,n.height/e.height);const u=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Nr(t,u)});else return o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},a=Nr(t),r=a?a.matrix:ex(),s=pa(r.a,1e3),c=pa(-r.e||0,1e3),l=pa(-r.f||0,1e3),e=this._cachedViewbox={x:c?c/s:0,y:l?l/s:0,width:n.width/s,height:n.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n},e;return e},ne.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=D({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Wf(t,n)}),{x:n.e,y:n.f}},ne.prototype.scrollToElement=function(e,t){let n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)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 r=qe(e),o=Q(r),a=this.viewbox(),s=this.zoom();let c,l;a.y+=t.top/s,a.x+=t.left/s,a.width-=(t.right+t.left)/s,a.height-=(t.bottom+t.top)/s;const u=Q(a);if(!(r.width<a.width&&r.height<a.height))c=r.x-a.x,l=r.y-a.y;else{const d=Math.max(0,o.right-u.right),h=Math.min(0,o.left-u.left),m=Math.max(0,o.bottom-u.bottom),y=Math.min(0,o.top-u.top);c=d||h,l=m||y}this.scroll({dx:-c*s,dy:-l*s})},ne.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let n,i;return this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),pa(i.a,1e3)};function Wf(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}ne.prototype._fitViewport=function(e){const t=this.viewbox(),n=t.outer,i=t.inner;let r,o;return i.x>=0&&i.y>=0&&i.x+i.width<=n.width&&i.y+i.height<=n.height&&!e?o={x:0,y:0,width:Math.max(i.width+i.x,n.width),height:Math.max(i.height+i.y,n.height)}:(r=Math.min(1,n.width/i.width,n.height/i.height),o={x:i.x+(e?i.width/2-n.width/r/2:0),y:i.y+(e?i.height/2-n.height/r/2:0),width:n.width/r,height:n.height/r}),this.viewbox(o),this.viewbox(!1).scale},ne.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let a,s,c,l,u;c=i.getCTM();const p=c.a;return t?(a=D(o,t),s=a.matrixTransform(c.inverse()),l=r.translate(s.x,s.y).scale(1/p*e).translate(-s.x,-s.y),u=c.multiply(l)):u=r.scale(e),Wf(this._viewport,u),u},ne.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ne.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;e.waypoints?n=this.getGraphics(e).getBBox():n=e;const i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale,o=n.width*t.scale,a=n.height*t.scale;return{x:i,y:r,width:o,height:a}},ne.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Ki="data-element-id";function Nt(e){this._elements={},this._eventBus=e}Nt.$inject=["eventBus"],Nt.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),q(t,Ki,i),n&&q(n,Ki,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Nt.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(q(i.gfx,Ki,""),i.secondaryGfx&&q(i.secondaryGfx,Ki,""),delete t[n])},Nt.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),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Nt.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&q(t,Ki,i),t},Nt.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&q(e,Ki);var n=this._elements[t];return n&&n.element},Nt.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Nt.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=n[i],o=t[r],a=o.element,s=o.gfx;if(e(a,s))return a}},Nt.prototype.getAll=function(){return this.filter(function(e){return e})},Nt.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)})},Nt.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Nt.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 Ux(e,t,n,i){var r=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,r,i)),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,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function Gx(e){return e.__refs_collection===!0}function Kx(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Uf(e,t,n){var i=Ux(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(r){e.set(r,t.inverse,n)})}function qx(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(o){if(o!==r){var a=r;r=null,a&&e.unset(a,i,n),r=o,e.set(r,i,n)}}})}function Lt(e,t){if(!(this instanceof Lt))return new Lt(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Lt.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?Uf(this,t,e):qx(this,t,e)},Lt.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Gx(n)||Uf(this,t,e),n},Lt.prototype.ensureBound=function(e,t){Kx(e,t)||this.bind(e,t)},Lt.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Lt.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Hc=new Lt({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Gf=new Lt({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Kf=new Lt({name:"attachers",collection:!0},{name:"host"}),qf=new Lt({name:"outgoing",collection:!0},{name:"source"}),Yf=new Lt({name:"incoming",collection:!0},{name:"target"});function qi(){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)}}),Hc.bind(this,"parent"),Gf.bind(this,"labels"),qf.bind(this,"outgoing"),Yf.bind(this,"incoming")}function $r(){qi.call(this),Hc.bind(this,"children"),Kf.bind(this,"host"),Kf.bind(this,"attachers")}Y($r,qi);function Xf(){qi.call(this),Hc.bind(this,"children")}Y(Xf,$r);function Zf(){$r.call(this),Gf.bind(this,"labelTarget")}Y(Zf,$r);function Jf(){qi.call(this),qf.bind(this,"source"),Yf.bind(this,"target")}Y(Jf,qi);var Yx={connection:Jf,shape:$r,label:Zf,root:Xf};function Xx(e,t){var n=Yx[e];if(!n)throw new Error("unknown type: <"+e+">");return D(new n,t)}function Zx(e){return e instanceof qi}function Sn(){this._uid=12}Sn.prototype.createRoot=function(e){return this.create("root",e)},Sn.prototype.createLabel=function(e){return this.create("label",e)},Sn.prototype.createShape=function(e){return this.create("shape",e)},Sn.prototype.createConnection=function(e){return this.create("connection",e)},Sn.prototype.create=function(e,t){return t=D({},t||{}),t.id||(t.id=e+"_"+this._uid++),Xx(e,t)};var fa="__fn",Qf=1e3,Jx=Array.prototype.slice;function At(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}At.prototype.on=function(e,t,n,i){if(e=oe(e)?e:[e],Ue(t)&&(i=n,n=t,t=Qf),!ee(t))throw new Error("priority must be a number");var r=n;i&&(r=xt(n,i),r[fa]=n[fa]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:r,next:null})})},At.prototype.once=function(e,t,n,i){var r=this;if(Ue(t)&&(i=n,n=t,t=Qf),!ee(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(e,o),a}o[fa]=n,this.on(e,t,o)},At.prototype.off=function(e,t){e=oe(e)?e:[e];var n=this;e.forEach(function(i){n._removeListener(i,t)})},At.prototype.createEvent=function(e){var t=new jr;return t.init(e),t},At.prototype.fire=function(e,t){var n,i,r,o;if(o=Jx.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(i=this._listeners[e],!!i){t instanceof jr?n=t:n=this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},At.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},At.prototype._destroy=function(){this._listeners={}},At.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},At.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=Qx(n.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i},At.prototype._addListener=function(e,t){var n=this._getListeners(e),i;if(!n){this._setListeners(e,t);return}for(;n;){if(n.priority<t.priority){t.next=n,i?i.next=t:this._setListeners(e,t);return}i=n,n=n.next}i.next=t},At.prototype._getListeners=function(e){return this._listeners[e]},At.prototype._setListeners=function(e,t){this._listeners[e]=t},At.prototype._removeListener=function(e,t){var n=this._getListeners(e),i,r,o;if(!t){this._setListeners(e,null);return}for(;n;)i=n.next,o=n.callback,(o===t||o[fa]===t)&&(r?r.next=i:this._setListeners(e,i)),r=n,n=i};function jr(){}jr.prototype.stopPropagation=function(){this.cancelBubble=!0},jr.prototype.preventDefault=function(){this.defaultPrevented=!0},jr.prototype.init=function(e){D(this,e||{})};function Qx(e,t){return e.apply(null,t)}function Ei(e){return e.childNodes[0]}function ew(e){return e.parentNode.childNodes[1]}function da(e,t,n,i,r){var o=Dr();o.setTranslate(t,n);var a=Dr();a.setRotate(i||0,0,0);var s=Dr();s.setScale(1,1),Nr(e,[o,a,s])}function ot(e,t,n){var i=Dr();i.setTranslate(t,n),Nr(e,i)}function ed(e,t){var n=Dr();n.setRotate(t,0,0),Nr(e,n)}function Ot(e,t){this._eventBus=e,this._elementRegistry=t}Ot.$inject=["eventBus","elementRegistry"],Ot.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),n;return e.parent?(n=ew(t),n||(n=X("g"),me(n).add("djs-children"),ie(t.parentNode,n))):n=t,n},Ot.prototype._clear=function(e){var t=Ei(e);return Zo(t),t},Ot.prototype._createContainer=function(e,t,n,i){var r=X("g");me(r).add("djs-group"),typeof n<"u"?td(r,t,t.childNodes[n]):ie(t,r);var o=X("g");me(o).add("djs-element"),me(o).add("djs-"+e),i&&me(o).add("djs-frame"),ie(r,o);var a=X("g");return me(a).add("djs-visual"),ie(o,a),o},Ot.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,Rf(t))},Ot.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry,i;i=Tt(e,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),A(i,function(r){var o=r.children;if(o){var a=t._getChildrenContainer(r);A(o.slice().reverse(),function(s){var c=n.getGraphics(s);td(c.parentNode,a)})}})},Ot.prototype.drawShape=function(e,t,n={}){var i=this._eventBus;return i.fire("render.shape",{gfx:e,element:t,attrs:n})},Ot.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)},Ot.prototype.drawConnection=function(e,t,n={}){var i=this._eventBus;return i.fire("render.connection",{gfx:e,element:t,attrs:n})},Ot.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)},Ot.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if(e==="shape")this.drawShape(i,t),ot(n,t.x,t.y);else if(e==="connection")this.drawConnection(i,t);else throw new Error("unknown type: "+e);t.hidden?q(n,"display","none"):q(n,"display","block")}},Ot.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Ke(t.parentNode)};function td(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}const tw={__depends__:[Ex],__init__:["canvas"],canvas:["type",ne],elementRegistry:["type",Nt],elementFactory:["type",Sn],eventBus:["type",At],graphicsFactory:["type",Ot]};function nw(e){var t=new bf(e);return t.init(),t}function iw(e){e=e||{};var t={config:["value",e]},n=[t,tw].concat(e.modules||[]);return nw(n)}function Gn(e,t){this._injector=t||iw(e),this.get("eventBus").fire("diagram.init")}Gn.prototype.get=function(e,t){return this._injector.get(e,t)},Gn.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Gn.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Gn.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function Vc(){}Vc.prototype.get=function(e){return this.$model.properties.get(this,e)},Vc.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function nd(e,t){this.model=e,this.properties=t}nd.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Vc.prototype);A(e.properties,function(a){!a.isMany&&a.default!==void 0&&(i[a.name]=a.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(a){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),A(a,xt(function(s,c){this.set(c,s)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var rw={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},id={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 zc(e,t){var n=id[e];return n?n(t):t}function Wc(e){return!!rw[e]}function rd(e){return!!id[e]}function dt(e,t){var n=e.split(/:/),i,r;if(n.length===1)i=e,r=t;else if(n.length===2)i=n[1],r=n[0];else throw new Error("expected <prefix:localName> or <localName>, got "+e);return e=(r?r+":":"")+i,{name:e,prefix:r,localName:i}}function It(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}It.prototype.build=function(){return Qt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},It.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var i=this.properties;t!==void 0?i.splice(t,0,e):i.push(e)},It.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=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=r.indexOf(e);if(s===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},It.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=dt(r[0],i),a=dt(r[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},It.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},It.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},It.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},It.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},It.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},It.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},It.prototype.hasProperty=function(e){return this.propertiesByName[e]},It.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(A(e.properties,xt(function(o){o=D({},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)),i.push(e),n[r]=e)};function Kn(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,A(e,xt(this.registerPackage,this))}Kn.prototype.getPackage=function(e){return this.packageMap[e]},Kn.prototype.getPackages=function(){return this.packages},Kn.prototype.registerPackage=function(e){e=D({},e);var t=this.packageMap;od(t,e,"prefix"),od(t,e,"uri"),A(e.types,xt(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Kn.prototype.registerType=function(e,t){e=D({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:D(e.meta||{})});var n=dt(e.name,t.prefix),i=n.name,r={};A(e.properties,xt(function(o){var a=dt(o.name,n.prefix),s=a.name;Wc(o.type)||(o.type=dt(o.type,a.prefix).name),D(o,{ns:a,name:s}),r[s]=o},this)),D(e,{ns:n,name:i,propertiesByName:r}),A(e.extends,xt(function(o){var a=dt(o,n.prefix),s=this.typeMap[a.name];s.traits=s.traits||[],s.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Kn.prototype.mapTypes=function(e,t,n){var i=Wc(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(c,l){var u=dt(c,Wc(c)?"":e.prefix);r.mapTypes(u,t,l)}function a(c){return o(c,!0)}function s(c){return o(c,!1)}if(!i)throw new Error("unknown type <"+e.name+">");A(i.superClass,n?a:s),t(i,!n),A(i.traits,a)},Kn.prototype.getEffectiveDescriptor=function(e){var t=dt(e),n=new It(t);this.mapTypes(t,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},Kn.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};function od(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function xi(e){this.model=e}xi.prototype.set=function(e,t,n){if(!Rt(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;ow(n)?i?delete e[r]:delete e.$attrs[Uc(t)]:i?r in e?e[r]=n:ad(e,i,n):e.$attrs[Uc(t)]=n},xi.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[Uc(t)];var i=n.name;return!e[i]&&n.isMany&&ad(e,n,[]),e[i]},xi.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;n=D({},n,{get:function(){return i}}),delete n.value}Object.defineProperty(e,t,n)},xi.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},xi.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},xi.prototype.getProperty=function(e,t){var n=this.model,i=n.getPropertyDescriptor(e,t);if(i)return i;if(t.includes(":"))return null;const r=n.config.strict;if(typeof r<"u"){const o=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw o;typeof console<"u"&&console.warn(o)}return null};function ow(e){return typeof e>"u"}function ad(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Uc(e){return e.replace(/^:/,"")}function $t(e,t={}){this.properties=new xi(this),this.factory=new nd(this,this.properties),this.registry=new Kn(e,this.properties),this.typeCache={},this.config=t}$t.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},$t.prototype.getType=function(e){var t=this.typeCache,n=Rt(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},$t.prototype.createAny=function(e,t,n){var i=dt(e),r={$type:e,$instanceOf:function(a){return a===this.$type},get:function(a){return this[a]},set:function(a,s){ME(this,[a],s)}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"get",{enumerable:!1,writable:!0}),this.properties.define(r,"set",{enumerable:!1,writable:!0}),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),A(n,function(a,s){tt(a)&&a.value!==void 0?r[a.name]=a.value:r[s]=a}),r},$t.prototype.getPackage=function(e){return this.registry.getPackage(e)},$t.prototype.getPackages=function(){return this.registry.getPackages()},$t.prototype.getElementDescriptor=function(e){return e.$descriptor},$t.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName},$t.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},$t.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var sd=String.fromCharCode,aw=Object.prototype.hasOwnProperty,sw=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,Fr={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Fr).forEach(function(e){Fr[e.toUpperCase()]=Fr[e]});function cw(e,t,n,i){return i?aw.call(Fr,i)?Fr[i]:"&"+i+";":sd(t||parseInt(n,16))}function wi(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(sw,cw):e}var cd="non-whitespace outside of root node";function Yi(e){return new Error(e)}function ld(e){return"missing namespace for prefix <"+e+">"}function ha(e){return{get:e,enumerable:!0}}function lw(e){var t={},n;for(n in e)t[n]=e[n];return t}function Gc(e){return e+"$uri"}function uw(e){var t={},n,i;for(n in e)i=e[n],t[i]=i,t[Gc(i)]=n;return t}function ud(){return{line:0,column:0}}function pw(e){throw e}function pd(e){if(!this)return new pd(e);var t=e&&e.proxy,n,i,r,o,a=pw,s,c,l,u,p=ud,d=!1,h=!1,m=null,y=!1,g;function w(b){b instanceof Error||(b=Yi(b)),m=b,a(b,p)}function C(b){s&&(b instanceof Error||(b=Yi(b)),s(b,p))}this.on=function(b,S){if(typeof S!="function")throw Yi("required args <name, cb>");switch(b){case"openTag":i=S;break;case"text":n=S;break;case"closeTag":r=S;break;case"error":a=S;break;case"warn":s=S;break;case"cdata":o=S;break;case"attention":u=S;break;case"question":l=S;break;case"comment":c=S;break;default:throw Yi("unsupported event: "+b)}return this},this.ns=function(b){if(typeof b>"u"&&(b={}),typeof b!="object")throw Yi("required args <nsMap={}>");var S={},P;for(P in b)S[P]=b[P];return h=!0,g=S,this},this.parse=function(b){if(typeof b!="string")throw Yi("required args <xml=string>");return m=null,x(b),p=ud,y=!1,m},this.stop=function(){y=!0};function x(b){var S=h?[]:null,P=h?uw(g):null,M,R=[],I=0,B=!1,L=!1,O=0,F=0,G,ke,be,ce,st,We,Ee,Te,$,H="",Z=0,he;function Ct(){if(he!==null)return he;var _,v,k,N=h&&P.xmlns,j=h&&d?[]:null,W=Z,J=H,de=J.length,Ze,Le,rt,Xt,Re,Ln={},Qs={},Bt,se,xe;e:for(;W<de;W++)if(Bt=!1,se=J.charCodeAt(W),!(se===32||se<14&&se>8)){for((se<65||se>122||se>90&&se<97)&&se!==95&&se!==58&&(C("illegal first char attribute name"),Bt=!0),xe=W+1;xe<de;xe++)if(se=J.charCodeAt(xe),!(se>96&&se<123||se>64&&se<91||se>47&&se<59||se===46||se===45||se===95)){if(se===32||se<14&&se>8){C("missing attribute value"),W=xe;continue e}if(se===61)break;C("illegal attribute name char"),Bt=!0}if(Re=J.substring(W,xe),Re==="xmlns:xmlns"&&(C("illegal declaration of xmlns"),Bt=!0),se=J.charCodeAt(xe+1),se===34)xe=J.indexOf('"',W=xe+2),xe===-1&&(xe=J.indexOf("'",W),xe!==-1&&(C("attribute value quote missmatch"),Bt=!0));else if(se===39)xe=J.indexOf("'",W=xe+2),xe===-1&&(xe=J.indexOf('"',W),xe!==-1&&(C("attribute value quote missmatch"),Bt=!0));else for(C("missing attribute value quotes"),Bt=!0,xe=xe+1;xe<de&&(se=J.charCodeAt(xe+1),!(se===32||se<14&&se>8));xe++);for(xe===-1&&(C("missing closing quotes"),xe=de,Bt=!0),Bt||(rt=J.substring(W,xe)),W=xe;xe+1<de&&(se=J.charCodeAt(xe+1),!(se===32||se<14&&se>8));xe++)W===xe&&(C("illegal character after attribute end"),Bt=!0);if(W=xe+1,Bt)continue e;if(Re in Qs){C("attribute <"+Re+"> already defined");continue}if(Qs[Re]=!0,!h){Ln[Re]=rt;continue}if(d){if(Le=Re==="xmlns"?"xmlns":Re.charCodeAt(0)===120&&Re.substr(0,6)==="xmlns:"?Re.substr(6):null,Le!==null){if(_=wi(rt),v=Gc(Le),Xt=g[_],!Xt){if(Le==="xmlns"||v in P&&P[v]!==_)do Xt="ns"+I++;while(typeof P[Xt]<"u");else Xt=Le;g[_]=Xt}P[Le]!==Xt&&(Ze||(P=lw(P),Ze=!0),P[Le]=Xt,Le==="xmlns"&&(P[Gc(Xt)]=_,N=Xt),P[v]=_),Ln[Re]=rt;continue}j.push(Re,rt);continue}if(se=Re.indexOf(":"),se===-1){Ln[Re]=rt;continue}if(!(k=P[Re.substring(0,se)])){C(ld(Re.substring(0,se)));continue}Re=N===k?Re.substr(se+1):k+Re.substr(se),Ln[Re]=rt}if(d)for(W=0,de=j.length;W<de;W++){if(Re=j[W++],rt=j[W],se=Re.indexOf(":"),se!==-1){if(!(k=P[Re.substring(0,se)])){C(ld(Re.substring(0,se)));continue}Re=N===k?Re.substr(se+1):k+Re.substr(se)}Ln[Re]=rt}return he=Ln}function T(){for(var _=/(\r\n|\r|\n)/g,v=0,k=0,N=0,j=F,W,J;O>=N&&(W=_.exec(b),!(!W||(j=W[0].length+W.index,j>O)));)v+=1,N=j;return O==-1?(k=j,J=b.substring(F)):F===0?J=b.substring(F,O):(k=O-N,J=F==-1?b.substring(O):b.substring(O,F+1)),{data:J,line:v,column:k}}for(p=T,t&&($=Object.create({},{name:ha(function(){return Ee}),originalName:ha(function(){return Te}),attrs:ha(Ct),ns:ha(function(){return P})}));F!==-1;){if(b.charCodeAt(F)===60?O=F:O=b.indexOf("<",F),O===-1){if(R.length)return w("unexpected end of file");if(F===0)return w("missing start tag");F<b.length&&b.substring(F).trim()&&C(cd);return}if(F!==O){if(R.length){if(n&&(n(b.substring(F,O),wi,p),y))return}else if(b.substring(F,O).trim()&&(C(cd),y))return}if(ce=b.charCodeAt(O+1),ce===33){if(be=b.charCodeAt(O+2),be===91&&b.substr(O+3,6)==="CDATA["){if(F=b.indexOf("]]>",O),F===-1)return w("unclosed cdata");if(o&&(o(b.substring(O+9,F),p),y))return;F+=3;continue}if(be===45&&b.charCodeAt(O+3)===45){if(F=b.indexOf("-->",O),F===-1)return w("unclosed comment");if(c&&(c(b.substring(O+4,F),wi,p),y))return;F+=3;continue}}if(ce===63){if(F=b.indexOf("?>",O),F===-1)return w("unclosed question");if(l&&(l(b.substring(O,F+2),p),y))return;F+=2;continue}for(G=O+1;;G++){if(st=b.charCodeAt(G),isNaN(st))return F=-1,w("unclosed tag");if(st===34)be=b.indexOf('"',G+1),G=be!==-1?be:G;else if(st===39)be=b.indexOf("'",G+1),G=be!==-1?be:G;else if(st===62){F=G;break}}if(ce===33){if(u&&(u(b.substring(O,F+1),wi,p),y))return;F+=1;continue}if(he={},ce===47){if(B=!1,L=!0,!R.length)return w("missing open tag");if(G=Ee=R.pop(),be=O+2+G.length,b.substring(O+2,be)!==G)return w("closing tag mismatch");for(;be<F;be++)if(ce=b.charCodeAt(be),!(ce===32||ce>8&&ce<14))return w("close tag")}else{if(b.charCodeAt(F-1)===47?(G=Ee=b.substring(O+1,F-1),B=!0,L=!0):(G=Ee=b.substring(O+1,F),B=!0,L=!1),!(ce>96&&ce<123||ce>64&&ce<91||ce===95||ce===58))return w("illegal first char nodeName");for(be=1,ke=G.length;be<ke;be++)if(ce=G.charCodeAt(be),!(ce>96&&ce<123||ce>64&&ce<91||ce>47&&ce<59||ce===45||ce===95||ce==46)){if(ce===32||ce<14&&ce>8){Ee=G.substring(0,be),he=null;break}return w("invalid nodeName")}L||R.push(Ee)}if(h){if(M=P,B&&(L||S.push(M),he===null&&(d=G.indexOf("xmlns",be)!==-1)&&(Z=be,H=G,Ct(),d=!1)),Te=Ee,ce=Ee.indexOf(":"),ce!==-1){if(We=P[Ee.substring(0,ce)],!We)return w("missing namespace on <"+Te+">");Ee=Ee.substr(ce+1)}else We=P.xmlns;We&&(Ee=We+":"+Ee)}if(B&&(Z=be,H=G,i&&(t?i($,wi,L,p):i(Ee,Ct,wi,L,p),y)))return;if(L){if(r&&(r(t?$:Ee,wi,B,p),y))return;h&&(B?P=M:P=S.pop())}F+=1}}}function fd(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Kc={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},dd="property";function hd(e){return e.xml&&e.xml.serialize}function fw(e){const t=hd(e);return t!==dd&&(t||null)}function dw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function md(e,t){return fd(t)?e.prefix+":"+dw(e.localName):e.name}function hw(e,t){var n=e.name,i=e.localName,r=t&&t.xml&&t.xml.typePrefix;return r&&i.indexOf(r)===0?e.prefix+":"+i.slice(r.length):n}function mw(e,t,n){const i=dt(e,t.xmlns),r=`${t[i.prefix]||i.prefix}:${i.localName}`,o=dt(r);var a=n.getPackage(o.prefix);return hw(o,a)}function qn(e){return new Error(e)}function Cn(e){return e.$descriptor}function gw(e){D(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw qn("expected element");var n=this.elementsById,i=Cn(t),r=i.idProperty,o;if(r&&(o=t.get(r.name),o)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(o))throw new Error("illegal ID <"+o+">");if(n[o])throw qn("duplicate ID <"+o+">");n[o]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Hr(){}Hr.prototype.handleEnd=function(){},Hr.prototype.handleText=function(){},Hr.prototype.handleNode=function(){};function qc(){}qc.prototype=Object.create(Hr.prototype),qc.prototype.handleNode=function(){return this};function Xi(){}Xi.prototype=Object.create(Hr.prototype),Xi.prototype.handleText=function(e){this.body=(this.body||"")+e};function Vr(e,t){this.property=e,this.context=t}Vr.prototype=Object.create(Xi.prototype),Vr.prototype.handleNode=function(e){if(this.element)throw qn("expected no sub nodes");return this.element=this.createReference(e),this},Vr.prototype.handleEnd=function(){this.element.id=this.body},Vr.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}};function Yc(e,t){this.element=t,this.propertyDesc=e}Yc.prototype=Object.create(Xi.prototype),Yc.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=zc(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function ma(){}ma.prototype=Object.create(Xi.prototype),ma.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 vt(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}vt.prototype=Object.create(ma.prototype),vt.prototype.addReference=function(e){this.context.addReference(e)},vt.prototype.handleText=function(e){var t=this.element,n=Cn(t),i=n.bodyProperty;if(!i)throw qn("unexpected body text <"+e+">");Xi.prototype.handleText.call(this,e)},vt.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Cn(t),i=n.bodyProperty;i&&e!==void 0&&(e=zc(i.type,e),t.set(i.name,e))},vt.prototype.createElement=function(e){var t=e.attributes,n=this.type,i=Cn(n),r=this.context,o=new n({}),a=this.model,s;return A(t,function(c,l){var u=i.propertiesByName[l],p;u&&u.isReference?u.isMany?(p=c.split(" "),A(p,function(d){r.addReference({element:o,property:u.ns.name,id:d})})):r.addReference({element:o,property:u.ns.name,id:c}):(u?c=zc(u.type,c):l==="xmlns"?l=":"+l:(s=dt(l,i.ns.prefix),a.getPackage(s.prefix)&&r.addWarning({message:"unknown attribute <"+l+">",element:o,property:l,value:c})),o.set(l,c))}),o},vt.prototype.getPropertyForNode=function(e){var t=e.name,n=dt(t),i=this.type,r=this.model,o=Cn(i),a=n.name,s=o.propertiesByName[a];if(s&&!s.isAttr){const l=fw(s);if(l){const u=e.attributes[l];if(u){const p=mw(u,e.ns,r),d=r.getType(p);return D({},s,{effectiveType:Cn(d).name})}}return s}var c=r.getPackage(n.prefix);if(c){const l=md(n,c),u=r.getType(l);if(s=_e(o.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&u.hasType(p.type)}),s)return D({},s,{effectiveType:Cn(u).name})}else if(s=_e(o.properties,function(l){return!l.isReference&&!l.isAttribute&&l.type==="Element"}),s)return s;throw qn("unrecognized element <"+n.name+">")},vt.prototype.toString=function(){return"ElementDescriptor["+Cn(this.type).name+"]"},vt.prototype.valueHandler=function(e,t){return new Yc(e,t)},vt.prototype.referenceHandler=function(e){return new Vr(e,this.context)},vt.prototype.handler=function(e){return e==="Element"?new Zi(this.model,e,this.context):new vt(this.model,e,this.context)},vt.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,n=t.effectiveType||t.type,rd(n))return this.valueHandler(t,i);t.isReference?r=this.referenceHandler(t).handleNode(e):r=this.handler(n).handleNode(e);var o=r.element;return o!==void 0&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(D(o,{element:i}),this.context.addReference(o)):o.$parent=i),r};function Xc(e,t,n){vt.call(this,e,t,n)}Xc.prototype=Object.create(vt.prototype),Xc.prototype.createElement=function(e){var t=e.name,n=dt(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&md(n,o)||t;if(!r.hasType(a))throw qn("unexpected element <"+e.originalName+">");return vt.prototype.createElement.call(this,e)};function Zi(e,t,n){this.model=e,this.context=n}Zi.prototype=Object.create(ma.prototype),Zi.prototype.createElement=function(e){var t=e.name,n=dt(t),i=n.prefix,r=e.ns[i+"$uri"],o=e.attributes;return this.model.createAny(t,r,o)},Zi.prototype.handleChild=function(e){var t=new Zi(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element,r;return i!==void 0&&(r=n.$children=n.$children||[],r.push(i),i.$parent=n),t},Zi.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Zc(e){e instanceof $t&&(e={model:e}),D(this,{lax:!1},e)}Zc.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof vt?(i=t,t={}):typeof t=="string"?(i=this.handler(t),t={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new gw(D({},t,{rootHandler:i})),s=new pd({proxy:!0}),c=yw();i.context=a,c.push(i);function l(S,P,M){var R=P(),I=R.line,B=R.column,L=R.data;L.charAt(0)==="<"&&L.indexOf(" ")!==-1&&(L=L.slice(0,L.indexOf(" "))+">");var O="unparsable content "+(L?L+" ":"")+`detected
|
|
6
|
-
|
|
7
|
-
column: `+B+`
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
`),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 Ow(e){e=D({format:!1,preamble:!0},e||{});function t(n,i){var r=i||new Dw,o=new Nw(r,e.format);e.preamble&&o.append(vw);var a=new Ae,s=n.$model;if(a.getNamespaces().mapDefaultPrefixes(Iw(s)),a.build(n).serializeTo(o),!i)return r.value}return{toXML:t}}function Iw(e){const t=e.config&&e.config.nsMap||{},n={};for(const i in Kc)n[i]=Kc[i];for(const i in t){const r=t[i];n[r]=i}for(const i of e.getPackages())n[i.prefix]=i.uri;return n}function ya(e,t){$t.call(this,e,t)}ya.prototype=Object.create($t.prototype),ya.prototype.fromXML=function(e,t,n){Rt(t)||(n=t,t="bpmn:Definitions");var i=new Zc(D({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},ya.prototype.toXML=function(e,t){var n=new Ow(t);return new Promise(function(i,r){try{var o=n.toXML(e);return i({xml:o})}catch(a){return r(a)}})};var Bw="BPMN20",Lw="http://www.omg.org/spec/BPMN/20100524/MODEL",$w="bpmn",jw=[],Fw=[{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",isAttr:!0,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"}]}],Hw=[{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"}]}],Vw={tagAlias:"lowerCase",typePrefix:"t"},zw={name:Bw,uri:Lw,prefix:$w,associations:jw,types:Fw,enumerations:Hw,xml:Vw},Ww="BPMNDI",Uw="http://www.omg.org/spec/BPMN/20100524/DI",Gw="bpmndi",Kw=[{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"]}],qw=[{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"}]}],Yw=[],Xw={name:Ww,uri:Uw,prefix:Gw,types:Kw,enumerations:qw,associations:Yw},Zw="DC",Jw="http://www.omg.org/spec/DD/20100524/DC",Qw="dc",e1=[{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}]}],t1=[],n1={name:Zw,uri:Jw,prefix:Qw,types:e1,associations:t1},i1="DI",r1="http://www.omg.org/spec/DD/20100524/DI",o1="di",a1=[{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"}]}],s1=[],c1={tagAlias:"lowerCase"},l1={name:i1,uri:r1,prefix:o1,types:a1,associations:s1,xml:c1},u1="bpmn.io colors for BPMN",p1="http://bpmn.io/schema/bpmn/biocolor/1.0",f1="bioc",d1=[{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"}]}],h1=[],m1=[],g1={name:u1,uri:p1,prefix:f1,types:d1,enumerations:h1,associations:m1},y1="BPMN in Color",v1="http://www.omg.org/spec/BPMN/non-normative/color/1.0",_1="color",b1=[{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"}]}],E1=[],x1=[],w1={name:y1,uri:v1,prefix:_1,types:b1,enumerations:E1,associations:x1};const S1={bpmn:zw,bpmndi:Xw,dc:n1,di:l1,bioc:g1,color:w1};function C1(e,t){const n=D({},S1,e);return new ya(n,t)}function ht(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var R1="Tried to access di from the businessObject. The di is available through the diagram element only. For more information, see https://github.com/bpmn-io/bpmn-js/issues/1472";function bd(e){Et(e,"di")||Object.defineProperty(e,"di",{enumerable:!1,get:function(){throw new Error(R1)}})}function wt(e,t){return e.$instanceOf(t)}function T1(e){return _e(e.rootElements,function(t){return wt(t,"bpmn:Process")||wt(t,"bpmn:Collaboration")})}function P1(e){var t={},n=[],i={};function r($,H){return function(Z){$(Z,H)}}function o($){t[$.id]=$}function a($){return t[$.id]}function s($,H){var Z=$.gfx;if(Z)throw new Error(`already rendered ${ht($)}`);return e.element($,i[$.id],H)}function c($,H){return e.root($,i[$.id],H)}function l($,H){try{var Z=i[$.id]&&s($,H);return o($),Z}catch(he){u(he.message,{element:$,error:he}),console.error(`failed to import ${ht($)}`,he)}}function u($,H){e.error($,H)}var p=this.registerDi=function(H){var Z=H.bpmnElement;Z?i[Z.id]?u(`multiple DI elements defined for ${ht(Z)}`,{element:Z}):(i[Z.id]=H,bd(Z)):u(`no bpmnElement referenced in ${ht(H)}`,{element:H})};function d($){h($.plane)}function h($){p($),A($.planeElement,m)}function m($){p($)}this.handleDefinitions=function(H,Z){var he=H.diagrams;if(Z&&he.indexOf(Z)===-1)throw new Error("diagram not part of <bpmn:Definitions />");if(!Z&&he&&he.length&&(Z=he[0]),!Z)throw new Error("no diagram to display");i={},d(Z);var Ct=Z.plane;if(!Ct)throw new Error(`no plane for ${ht(Z)}`);var T=Ct.bpmnElement;if(!T)if(T=T1(H),T)u(`correcting missing bpmnElement on ${ht(Ct)} to ${ht(T)}`),Ct.bpmnElement=T,p(Ct);else throw new Error("no process or collaboration to display");var _=c(T,Ct);if(wt(T,"bpmn:Process")||wt(T,"bpmn:SubProcess"))g(T,_);else if(wt(T,"bpmn:Collaboration"))Ee(T,_),w(H.rootElements,_);else throw new Error(`unsupported bpmnElement for ${ht(Ct)}: ${ht(T)}`);y(n)};var y=this.handleDeferred=function(){for(var H;n.length;)H=n.shift(),H()};function g($,H){ce($,H),I($.ioSpecification,H),R($.artifacts,H),o($)}function w($,H){var Z=le($,function(he){return!a(he)&&wt(he,"bpmn:Process")&&he.laneSets});Z.forEach(r(g,H))}function C($,H){l($,H)}function x($,H){A($,r(C,H))}function b($,H){l($,H)}function S($,H){l($,H)}function P($,H){l($,H)}function M($,H){l($,H)}function R($,H){A($,function(Z){wt(Z,"bpmn:Association")?n.push(function(){M(Z,H)}):M(Z,H)})}function I($,H){$&&(A($.dataInputs,r(S,H)),A($.dataOutputs,r(P,H)))}var B=this.handleSubProcess=function(H,Z){ce(H,Z),R(H.artifacts,Z)};function L($,H){var Z=l($,H);wt($,"bpmn:SubProcess")&&B($,Z||H),wt($,"bpmn:Activity")&&I($.ioSpecification,H),n.push(function(){A($.dataInputAssociations,r(b,H)),A($.dataOutputAssociations,r(b,H))})}function O($,H){l($,H)}function F($,H){l($,H)}function G($,H){n.push(function(){var Z=l($,H);$.childLaneSet&&ke($.childLaneSet,Z||H),Te($)})}function ke($,H){A($.lanes,r(G,H))}function be($,H){A($,r(ke,H))}function ce($,H){st($.flowElements,H),$.laneSets&&be($.laneSets,H)}function st($,H){A($,function(Z){wt(Z,"bpmn:SequenceFlow")?n.push(function(){O(Z,H)}):wt(Z,"bpmn:BoundaryEvent")?n.unshift(function(){L(Z,H)}):wt(Z,"bpmn:FlowNode")?L(Z,H):wt(Z,"bpmn:DataObject")||(wt(Z,"bpmn:DataStoreReference")||wt(Z,"bpmn:DataObjectReference")?F(Z,H):u(`unrecognized flowElement ${ht(Z)} in context ${ht(H&&H.businessObject)}`,{element:Z,context:H}))})}function We($,H){var Z=l($,H),he=$.processRef;he&&g(he,Z||H)}function Ee($,H){A($.participants,r(We,H)),R($.artifacts,H),n.push(function(){x($.messageFlows,H)})}function Te($){A($.flowNodeRef,function(H){var Z=H.get("lanes");Z&&Z.push($)})}}function E(e,t){var n=z(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function ue(e,t){return jn(t,function(n){return E(e,n)})}function z(e){return e&&e.businessObject||e}function ye(e){return e&&e.di}function A1(e,t,n){var i,r,o,a,s=[];function c(l,u){var p={root:function(y,g){return i.add(y,g)},element:function(y,g,w){return i.add(y,g,w)},error:function(y,g){s.push({message:y,context:g})}},d=new P1(p);u=u||l.diagrams&&l.diagrams[0];var h=k1(l,u);if(!h)throw new Error("no diagram to display");A(h,function(y){d.handleDefinitions(l,y)});var m=u.plane.bpmnElement.id;o.setRootElement(o.findRoot(m+"_plane")||o.findRoot(m))}return new Promise(function(l,u){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("canvas"),r.fire("import.render.start",{definitions:t}),c(t,n),r.fire("import.render.complete",{error:a,warnings:s}),l({warnings:s})}catch(p){return p.warnings=s,u(p)}})}function k1(e,t){if(!(!t||!t.plane)){var n=t.plane.bpmnElement,i=n;!E(n,"bpmn:Process")&&!E(n,"bpmn:Collaboration")&&(i=M1(n));var r;E(i,"bpmn:Collaboration")?r=i:r=_e(e.rootElements,function(l){if(E(l,"bpmn:Collaboration"))return _e(l.participants,function(u){return u.processRef===i})});var o=[i];r&&(o=lt(r.participants,function(l){return l.processRef}),o.push(r));var a=Ed(o),s=[t],c=[n];return A(e.diagrams,function(l){if(l.plane){var u=l.plane.bpmnElement;a.indexOf(u)!==-1&&c.indexOf(u)===-1&&(s.push(l),c.push(u))}}),s}}function Ed(e){var t=[];return A(e,function(n){n&&(t.push(n),t=t.concat(Ed(n.flowElements)))}),t}function M1(e){for(var t=e;t;){if(E(t,"bpmn:Process"))return t;t=t.$parent}}var D1='<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>',xd=D1,wd={verticalAlign:"middle"},Sd={color:"#404040"},N1={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},O1={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},I1={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"},B1='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+xd+'</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>',hn;function L1(){hn=Pe(B1),ut(hn,N1),ut(we("svg",hn),wd),ut(we(".backdrop",hn),O1),ut(we(".notice",hn),I1),ut(we(".link",hn),Sd,{margin:"15px 20px 15px 10px",alignSelf:"center"})}function $1(){hn||(L1(),Pt.bind(hn,".backdrop","click",function(e){document.body.removeChild(hn)})),document.body.appendChild(hn)}function Me(e){e=D({},F1,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),V1(this._container)}Y(Me,Gn),Me.prototype.importXML=async function(t,n){const i=this;function r(a){return i.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(d){throw this._emit("import.parse.complete",{error:d}),d}let s=a.rootElement;const c=a.references,l=a.warnings,u=a.elementsById;o=o.concat(l),s=this._emit("import.parse.complete",r({error:null,definitions:s,elementsById:u,references:c,warnings:o}))||s;const p=await this.importDefinitions(s,n);return o=o.concat(p.warnings),this._emit("import.done",{error:null,warnings:o}),{warnings:o}}catch(a){let s=a;throw o=o.concat(s.warnings||[]),va(s,o),s=j1(s),this._emit("import.done",{error:s,warnings:s.warnings}),s}},Me.prototype.importDefinitions=async function(t,n){return this._setDefinitions(t),{warnings:(await this.open(n)).warnings}},Me.prototype.open=async function(t){const n=this._definitions;let i=t;if(!n){const o=new Error("no XML imported");throw va(o,[]),o}if(typeof t=="string"&&(i=H1(n,t),!i)){const o=new Error("BPMNDiagram <"+t+"> not found");throw va(o,[]),o}try{this.clear()}catch(o){throw va(o,[]),o}const{warnings:r}=await A1(this,n,i);return{warnings:r}},Me.prototype.saveXML=async function(t){t=t||{};let n=this._definitions,i,r;try{if(!n)throw new Error("no definitions loaded");n=this._emit("saveXML.start",{definitions:n})||n,r=(await this._moddle.toXML(n,t)).xml,r=this._emit("saveXML.serialized",{xml:r})||r}catch(a){i=a}const o=i?{error:i}:{xml:r};if(this._emit("saveXML.done",o),i)throw i;return o},Me.prototype.saveSVG=async function(){this._emit("saveSVG.start");let t,n;try{const i=this.get("canvas"),r=i.getActiveLayer(),o=we(":scope > defs",i._svg),a=_f(r),s=o?"<defs>"+_f(o)+"</defs>":"",c=r.getBBox();t=`<?xml version="1.0" encoding="utf-8"?>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+c.width+'" height="'+c.height+'" viewBox="'+c.x+" "+c.y+" "+c.width+" "+c.height+'" version="1.1">'+s+a+"</svg>"}catch(i){n=i}if(this._emit("saveSVG.done",{error:n,svg:t}),n)throw n;return{svg:t}},Me.prototype._setDefinitions=function(e){this._definitions=e},Me.prototype.getModules=function(){return this._modules},Me.prototype.clear=function(){this.getDefinitions()&&Gn.prototype.clear.call(this)},Me.prototype.destroy=function(){Gn.prototype.destroy.call(this),un(this._container)},Me.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Me.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Me.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=we(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Me.prototype.getDefinitions=function(){return this._definitions},Me.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Me.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[{bpmnjs:["value",this],moddle:["value",t]}],a=[].concat(o,i,r),s=D(ln(n,["additionalModules"]),{canvas:D({},n.canvas,{container:e}),modules:a});Gn.call(this,s),n&&n.container&&this.attachTo(n.container)},Me.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Me.prototype._createContainer=function(e){const t=Pe('<div class="bjs-container"></div>');return ut(t,{width:Cd(e.width),height:Cd(e.height),position:e.position}),t},Me.prototype._createModdle=function(e){const t=D({},this._moddleExtensions,e.moddleExtensions);return new C1(t)},Me.prototype._modules=[];function va(e,t){return e.warnings=t,e}function j1(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 F1={width:"100%",height:"100%",position:"relative"};function Cd(e){return e+(ee(e)?"px":"")}function H1(e,t){return t&&_e(e.diagrams,function(n){return n.id===t})||null}function V1(e){const n='<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+xd+"</a>",i=Pe(n);ut(we("svg",i),wd),ut(i,Sd,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(i),ae.bind(i,"click",function(r){$1(),r.preventDefault()})}function zr(e){Me.call(this,e),this.on("import.parse.complete",function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}Y(zr,Me),zr.prototype._createModdle=function(e){var t=Me.prototype._createModdle.call(this,e);return t.ids=new sn([32,36,1]),t},zr.prototype._collectIds=function(e,t){var n=e.$model,i=n.ids,r;i.clear();for(r in t)i.claim(r,t[r])};function fe(e,t){return E(e,"bpmn:CallActivity")?!1:E(e,"bpmn:SubProcess")?(t=t||ye(e),t&&E(t,"bpmndi:BPMNPlane")?!0:t&&!!t.isExpanded):E(e,"bpmn:Participant")?!!z(e).processRef:!0}function Je(e){if(!(!E(e,"bpmn:Participant")&&!E(e,"bpmn:Lane"))){var t=ye(e).isHorizontal;return t===void 0?!0:t}}function z1(e){return e&&z(e).isInterrupting!==!1}function mt(e){return e&&!!z(e).triggeredByEvent}function Ji(e,t){var n=z(e).eventDefinitions;return jn(n,function(i){return E(i,t)})}function W1(e){return Ji(e,"bpmn:ErrorEventDefinition")}function U1(e){return Ji(e,"bpmn:EscalationEventDefinition")}function G1(e){return Ji(e,"bpmn:CompensateEventDefinition")}var Wr={width:90,height:20},Rd=15;function Ci(e){return E(e,"bpmn:Event")||E(e,"bpmn:Gateway")||E(e,"bpmn:DataStoreReference")||E(e,"bpmn:DataObjectReference")||E(e,"bpmn:DataInput")||E(e,"bpmn:DataOutput")||E(e,"bpmn:SequenceFlow")||E(e,"bpmn:MessageFlow")||E(e,"bpmn:Group")}function _a(e){return ge(e.label)}function K1(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=q1(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=Rd:a+=Rd,{x:a,y:s}}function q1(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}function el(e){return e.waypoints?K1(e.waypoints):E(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Wr.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Wr.height/2}}function Y1(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Wr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=el(t),i=Wr),D({x:n.x-i.width/2,y:n.y-i.height/2},i)}function Td(e){if(E(e,"bpmn:FlowElement")||E(e,"bpmn:Participant")||E(e,"bpmn:Lane")||E(e,"bpmn:SequenceFlow")||E(e,"bpmn:MessageFlow")||E(e,"bpmn:DataInput")||E(e,"bpmn:DataOutput"))return"name";if(E(e,"bpmn:TextAnnotation"))return"text";if(E(e,"bpmn:Group"))return"categoryValueRef"}function X1(e){var t=e.categoryValueRef;return t&&t.value||""}function en(e){var t=e.businessObject,n=Td(t);if(n)return n==="categoryValueRef"?X1(t):t[n]||""}function Z1(e,t){var n=e.businessObject,i=Td(n);if(i)if(i==="categoryValueRef"){if(!n[i])return e;n[i].value=t}else n[i]=t;return e}var tl="hsl(225, 10%, 15%)",J1="white";function mn(e,t){return jn(e.eventDefinitions,function(n){return n.$type===t})}function Q1(e){return e.$type==="bpmn:IntermediateThrowEvent"||e.$type==="bpmn:EndEvent"}function eS(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}function pe(e,t,n){var i=ye(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||J1}function K(e,t,n){var i=ye(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||tl}function Ur(e,t,n,i){var r=ye(e),o=r.get("label");return i||o&&o.get("color:color")||t||K(e,n)}function tS(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2,r=[["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]];return _i(r)}function nS(e,t){var n=e.x,i=e.y,r=e.width,o=e.height,a=[["M",n+t,i],["l",r-t*2,0],["a",t,t,0,0,1,t,t],["l",0,o-t*2],["a",t,t,0,0,1,-10,t],["l",t*2-r,0],["a",t,t,0,0,1,-10,-10],["l",0,t*2-o],["a",t,t,0,0,1,t,-10],["z"]];return _i(a)}function iS(e){var t=e.width,n=e.height,i=e.x,r=e.y,o=t/2,a=n/2,s=[["M",i+o,r],["l",o,a],["l",-o,a],["l",-o,-a],["z"]];return _i(s)}function rS(e){var t=e.x,n=e.y,i=e.width,r=e.height,o=[["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]];return _i(o)}function Gr(e,t={}){return{width:jt(e,t),height:kt(e,t)}}function jt(e,t={}){return Et(t,"width")?t.width:e.width}function kt(e,t={}){return Et(t,"height")?t.height:e.height}var oS=new sn,aS=10,ba=3,sS=1.5,Ea=10,Qi=.95,cS=1,lS=.25;function Ri(e,t,n,i,r,o,a){En.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,l=e&&e.defaultLabelColor;function u(T){return n.computeStyle(T,{strokeLinecap:"round",strokeLinejoin:"round",stroke:tl,strokeWidth:2,fill:"white"})}function p(T){return n.computeStyle(T,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:tl,strokeWidth:2})}function d(T,_){var{ref:v={x:0,y:0},scale:k=1,element:N,parentGfx:j=r._svg}=_,W=X("marker",{id:T,viewBox:"0 0 20 20",refX:v.x,refY:v.y,markerWidth:20*k,markerHeight:20*k,orient:"auto"});ie(W,N);var J=we(":scope > defs",j);J||(J=X("defs"),ie(j,J)),ie(J,W)}function h(T,_,v,k){var N=oS.nextPrefixed("marker-");return m(T,N,_,v,k),"url(#"+N+")"}function m(T,_,v,k,N){if(v==="sequenceflow-end"){var j=X("path",{d:"M 1 5 L 11 10 L 1 15 Z",...u({fill:N,stroke:N,strokeWidth:1})});d(_,{element:j,ref:{x:11,y:10},scale:.5,parentGfx:T})}if(v==="messageflow-start"){var W=X("circle",{cx:6,cy:6,r:3.5,...u({fill:k,stroke:N,strokeWidth:1,strokeDasharray:[1e4,1]})});d(_,{element:W,ref:{x:6,y:6},parentGfx:T})}if(v==="messageflow-end"){var J=X("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:k,stroke:N,strokeWidth:1,strokeDasharray:[1e4,1]})});d(_,{element:J,ref:{x:8.5,y:5},parentGfx:T})}if(v==="association-start"){var de=X("path",{d:"M 11 5 L 1 10 L 11 15",...p({fill:"none",stroke:N,strokeWidth:1.5,strokeDasharray:[1e4,1]})});d(_,{element:de,ref:{x:1,y:10},scale:.5,parentGfx:T})}if(v==="association-end"){var Ze=X("path",{d:"M 1 5 L 11 10 L 1 15",...p({fill:"none",stroke:N,strokeWidth:1.5,strokeDasharray:[1e4,1]})});d(_,{element:Ze,ref:{x:11,y:10},scale:.5,parentGfx:T})}if(v==="conditional-flow-marker"){var Le=X("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:k,stroke:N})});d(_,{element:Le,ref:{x:-1,y:10},scale:.5,parentGfx:T})}if(v==="conditional-default-flow-marker"){var rt=X("path",{d:"M 6 4 L 10 16",...u({stroke:N,fill:"none"})});d(_,{element:rt,ref:{x:0,y:10},scale:.5,parentGfx:T})}}function y(T,_,v,k,N={}){tt(k)&&(N=k,k=0),k=k||0,N=u(N);var j=_/2,W=v/2,J=X("circle",{cx:j,cy:W,r:Math.round((_+v)/4-k),...N});return ie(T,J),J}function g(T,_,v,k,N,j){tt(N)&&(j=N,N=0),N=N||0,j=u(j);var W=X("rect",{x:N,y:N,width:_-N*2,height:v-N*2,rx:k,ry:k,...j});return ie(T,W),W}function w(T,_,v,k){var N=_/2,j=v/2,W=[{x:N,y:0},{x:_,y:j},{x:N,y:v},{x:0,y:j}],J=W.map(function(Ze){return Ze.x+","+Ze.y}).join(" ");k=u(k);var de=X("polygon",{...k,points:J});return ie(T,de),de}function C(T,_,v,k){v=p(v);var N=ra(_,v,k);return ie(T,N),N}function x(T,_,v){return C(T,_,v,5)}function b(T,_,v){v=p(v);var k=X("path",{...v,d:_});return ie(T,k),k}function S(T,_,v,k){return b(_,v,D({"data-marker":T},k))}function P(T){return Ct[T]}function M(T){return function(_,v,k){return P(T)(_,v,k)}}var R={"bpmn:MessageEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.235,my:.315}}),j=k?K(_,c,v.stroke):pe(_,s,v.fill),W=k?pe(_,s,v.fill):K(_,c,v.stroke),J=b(T,N,{fill:j,stroke:W,strokeWidth:1});return J},"bpmn:TimerEventDefinition":function(T,_,v={}){var k=v.width||_.width,N=v.height||_.height,j=v.width?1:2,W=y(T,k,N,.2*N,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:j}),J=i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:k,containerHeight:N,position:{mx:.5,my:.5}});b(T,J,{stroke:K(_,c,v.stroke),strokeWidth:j});for(var de=0;de<12;de++){var Ze=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:k,containerHeight:N,position:{mx:.5,my:.5}}),Le=k/2,rt=N/2;b(T,Ze,{strokeWidth:1,stroke:K(_,c,v.stroke),transform:"rotate("+de*30+","+rt+","+Le+")"})}return W},"bpmn:EscalationEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.5,my:.2}}),j=k?K(_,c,v.stroke):pe(_,s,v.fill);return b(T,N,{fill:j,stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:ConditionalEventDefinition":function(T,_,v={}){var k=i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.5,my:.222}});return b(T,k,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:LinkEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.57,my:.263}}),j=k?K(_,c,v.stroke):pe(_,s,v.fill);return b(T,N,{fill:j,stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:ErrorEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.2,my:.722}}),j=k?K(_,c,v.stroke):pe(_,s,v.fill);return b(T,N,{fill:j,stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:CancelEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.638,my:-.055}}),j=k?K(_,c,v.stroke):"none",W=b(T,N,{fill:j,stroke:K(_,c,v.stroke),strokeWidth:1});return ed(W,45),W},"bpmn:CompensateEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.22,my:.5}}),j=k?K(_,c,v.stroke):pe(_,s,v.fill);return b(T,N,{fill:j,stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:SignalEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.5,my:.2}}),j=k?K(_,c,v.stroke):pe(_,s,v.fill);return b(T,N,{strokeWidth:1,fill:j,stroke:K(_,c,v.stroke)})},"bpmn:MultipleEventDefinition":function(T,_,v={},k){var N=i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.211,my:.36}}),j=k?K(_,c,v.stroke):pe(_,s,v.fill);return b(T,N,{fill:j,stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:ParallelMultipleEventDefinition":function(T,_,v={}){var k=i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:v.width||_.width,containerHeight:v.height||_.height,position:{mx:.458,my:.194}});return b(T,k,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1})},"bpmn:TerminateEventDefinition":function(T,_,v={}){var k=y(T,_.width,_.height,8,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:4});return k}};function I(T,_,v={},k){var N=z(T),j=Q1(N),W=k||T;return N.get("eventDefinitions")&&N.get("eventDefinitions").length>1?N.get("parallelMultiple")?R["bpmn:ParallelMultipleEventDefinition"](_,W,v,j):R["bpmn:MultipleEventDefinition"](_,W,v,j):mn(N,"bpmn:MessageEventDefinition")?R["bpmn:MessageEventDefinition"](_,W,v,j):mn(N,"bpmn:TimerEventDefinition")?R["bpmn:TimerEventDefinition"](_,W,v,j):mn(N,"bpmn:ConditionalEventDefinition")?R["bpmn:ConditionalEventDefinition"](_,W,v,j):mn(N,"bpmn:SignalEventDefinition")?R["bpmn:SignalEventDefinition"](_,W,v,j):mn(N,"bpmn:EscalationEventDefinition")?R["bpmn:EscalationEventDefinition"](_,W,v,j):mn(N,"bpmn:LinkEventDefinition")?R["bpmn:LinkEventDefinition"](_,W,v,j):mn(N,"bpmn:ErrorEventDefinition")?R["bpmn:ErrorEventDefinition"](_,W,v,j):mn(N,"bpmn:CancelEventDefinition")?R["bpmn:CancelEventDefinition"](_,W,v,j):mn(N,"bpmn:CompensateEventDefinition")?R["bpmn:CompensateEventDefinition"](_,W,v,j):mn(N,"bpmn:TerminateEventDefinition")?R["bpmn:TerminateEventDefinition"](_,W,v,j):null}var B={ParticipantMultiplicityMarker:function(T,_,v={}){var k=jt(_,v),N=kt(_,v),j=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:N,position:{mx:(k/2-6)/k,my:(N-15)/N}});S("participant-multiplicity",T,j,{strokeWidth:2,fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke)})},SubProcessMarker:function(T,_,v={}){var k=g(T,14,14,0,{strokeWidth:1,fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke)});ot(k,_.width/2-7.5,_.height-20);var N=i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2-7.5)/_.width,my:(_.height-20)/_.height}});S("sub-process",T,N,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke)})},ParallelMarker:function(T,_,v){var k=jt(_,v),N=kt(_,v),j=i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:N,position:{mx:(k/2+v.parallel)/k,my:(N-20)/N}});S("parallel",T,j,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke)})},SequentialMarker:function(T,_,v){var k=i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+v.seq)/_.width,my:(_.height-19)/_.height}});S("sequential",T,k,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke)})},CompensationMarker:function(T,_,v){var k=i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:(_.width/2+v.compensation)/_.width,my:(_.height-13)/_.height}});S("compensation",T,k,{strokeWidth:1,fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke)})},LoopMarker:function(T,_,v){var k=jt(_,v),N=kt(_,v),j=i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:N,position:{mx:(k/2+v.loop)/k,my:(N-7)/N}});S("loop",T,j,{strokeWidth:1.5,fill:"none",stroke:K(_,c,v.stroke),strokeMiterlimit:.5})},AdhocMarker:function(T,_,v){var k=jt(_,v),N=kt(_,v),j=i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:N,position:{mx:(k/2+v.adhoc)/k,my:(N-15)/N}});S("adhoc",T,j,{strokeWidth:1,fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke)})}};function L(T,_,v,k){B[T](_,v,k)}function O(T,_,v,k={}){k={fill:k.fill,stroke:k.stroke,width:jt(_,k),height:kt(_,k)};var N=z(_),j=v&&v.includes("SubProcessMarker");j?k={...k,seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:k={...k,seq:-5,parallel:-6,compensation:-27,loop:0,adhoc:10},A(v,function(de){L(de,T,_,k)}),N.get("isForCompensation")&&L("CompensationMarker",T,_,k),E(N,"bpmn:AdHocSubProcess")&&L("AdhocMarker",T,_,k);var W=N.get("loopCharacteristics"),J=W&&W.get("isSequential");W&&(J===void 0&&L("LoopMarker",T,_,k),J===!1&&L("ParallelMarker",T,_,k),J===!0&&L("SequentialMarker",T,_,k))}function F(T,_,v={}){v=D({size:{width:100}},v);var k=o.createText(_||"",v);return me(k).add("djs-label"),ie(T,k),k}function G(T,_,v,k={}){var N=z(_),j=Gr({x:_.x,y:_.y,width:_.width,height:_.height},k);return F(T,N.name,{align:v,box:j,padding:7,style:{fill:Ur(_,l,c,k.stroke)}})}function ke(T,_,v={}){var k={width:90,height:30,x:_.width/2+_.x,y:_.height/2+_.y};return F(T,en(_),{box:k,fitBox:!0,style:D({},o.getExternalStyle(),{fill:Ur(_,l,c,v.stroke)})})}function be(T,_,v,k={}){var N=Je(v),j=F(T,_,{box:{height:30,width:N?kt(v,k):jt(v,k)},align:"center-middle",style:{fill:Ur(v,l,c,k.stroke)}});if(N){var W=-1*kt(v,k);da(j,0,-W,270)}}function ce(T,_,v={}){var{width:k,height:N}=Gr(_,v);return g(T,k,N,Ea,{...v,fill:pe(_,s,v.fill),fillOpacity:Qi,stroke:K(_,c,v.stroke)})}function st(T,_,v={}){var k=z(_),N=pe(_,s,v.fill),j=K(_,c,v.stroke);return(k.get("associationDirection")==="One"||k.get("associationDirection")==="Both")&&(v.markerEnd=h(T,"association-end",N,j)),k.get("associationDirection")==="Both"&&(v.markerStart=h(T,"association-start",N,j)),v=ve(v,["markerStart","markerEnd"]),x(T,_.waypoints,{...v,stroke:j,strokeDasharray:"0, 5"})}function We(T,_,v={}){var k=pe(_,s,v.fill),N=K(_,c,v.stroke),j=i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}}),W=b(T,j,{fill:k,fillOpacity:Qi,stroke:N}),J=z(_);if(eS(J)){var de=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:.33,my:(_.height-18)/_.height}});b(T,de,{strokeWidth:2,fill:k,stroke:N})}return W}function Ee(T,_,v={}){return y(T,_.width,_.height,{fillOpacity:Qi,...v,fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke)})}function Te(T,_,v={}){return w(T,_.width,_.height,{fill:pe(_,s,v.fill),fillOpacity:Qi,stroke:K(_,c,v.stroke)})}function $(T,_,v={}){var k=g(T,jt(_,v),kt(_,v),0,{fill:pe(_,s,v.fill),fillOpacity:v.fillOpacity||Qi,stroke:K(_,c,v.stroke),strokeWidth:1.5}),N=z(_);if(E(N,"bpmn:Lane")){var j=N.get("name");be(T,j,_,v)}return k}function H(T,_,v={}){var k=ce(T,_,v),N=fe(_);if(mt(_)&&(q(k,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!N)){var j=z(_).flowElements||[],W=j.filter(J=>E(J,"bpmn:StartEvent"));W.length===1&&Z(W[0],T,v,_)}return G(T,_,N?"center-top":"center-middle",v),N?O(T,_,void 0,v):O(T,_,["SubProcessMarker"],v),k}function Z(T,_,v,k){var N=22,j={fill:pe(k,s,v.fill),stroke:K(k,c,v.stroke),width:N,height:N},W=z(T).isInterrupting,J=W?0:3,de=W?1:1.2,Ze=20,Le=(N-Ze)/2,rt="translate("+Le+","+Le+")";y(_,Ze,Ze,{fill:j.fill,stroke:j.stroke,strokeWidth:de,strokeDasharray:J,transform:rt}),I(T,_,j,k)}function he(T,_,v={}){var k=ce(T,_,v);return G(T,_,"center-middle",v),O(T,_,void 0,v),k}var Ct=this.handlers={"bpmn:AdHocSubProcess":function(T,_,v={}){return fe(_)?v=ve(v,["fill","stroke","width","height"]):v=ve(v,["fill","stroke"]),H(T,_,v)},"bpmn:Association":function(T,_,v={}){return v=ve(v,["fill","stroke"]),st(T,_,v)},"bpmn:BoundaryEvent":function(T,_,v={}){var{renderIcon:k=!0}=v;v=ve(v,["fill","stroke"]);var N=z(_),j=N.get("cancelActivity");v={strokeWidth:1.5,fill:pe(_,s,v.fill),fillOpacity:cS,stroke:K(_,c,v.stroke)},j||(v.strokeDasharray="6");var W=Ee(T,_,v);return y(T,_.width,_.height,ba,{...v,fill:"none"}),k&&I(_,T,v),W},"bpmn:BusinessRuleTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v),N=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}),j=b(T,N);q(j,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1});var W=i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}),J=b(T,W);return q(J,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:CallActivity":function(T,_,v={}){return v=ve(v,["fill","stroke"]),H(T,_,{strokeWidth:5,...v})},"bpmn:ComplexGateway":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=Te(T,_,v),N=i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.26}});return b(T,N,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:DataInput":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=i.getRawPath("DATA_ARROW"),N=We(T,_,v);return b(T,k,{fill:"none",stroke:K(_,c,v.stroke),strokeWidth:1}),N},"bpmn:DataInputAssociation":function(T,_,v={}){return v=ve(v,["fill","stroke"]),st(T,_,{...v,markerEnd:h(T,"association-end",pe(_,s,v.fill),K(_,c,v.stroke))})},"bpmn:DataObject":function(T,_,v={}){return v=ve(v,["fill","stroke"]),We(T,_,v)},"bpmn:DataObjectReference":M("bpmn:DataObject"),"bpmn:DataOutput":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=i.getRawPath("DATA_ARROW"),N=We(T,_,v);return b(T,k,{strokeWidth:1,fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke)}),N},"bpmn:DataOutputAssociation":function(T,_,v={}){return v=ve(v,["fill","stroke"]),st(T,_,{...v,markerEnd:h(T,"association-end",pe(_,s,v.fill),K(_,c,v.stroke))})},"bpmn:DataStoreReference":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:_.width,containerHeight:_.height,position:{mx:0,my:.133}});return b(T,k,{fill:pe(_,s,v.fill),fillOpacity:Qi,stroke:K(_,c,v.stroke),strokeWidth:2})},"bpmn:EndEvent":function(T,_,v={}){var{renderIcon:k=!0}=v;v=ve(v,["fill","stroke"]);var N=Ee(T,_,{...v,strokeWidth:4});return k&&I(_,T,v),N},"bpmn:EventBasedGateway":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=z(_),N=Te(T,_,v);y(T,_.width,_.height,_.height*.2,{fill:pe(_,"none",v.fill),stroke:K(_,c,v.stroke),strokeWidth:1});var j=k.get("eventGatewayType"),W=!!k.get("instantiate");function J(){var Ze=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:_.width,containerHeight:_.height,position:{mx:.36,my:.44}});b(T,Ze,{fill:"none",stroke:K(_,c,v.stroke),strokeWidth:2})}if(j==="Parallel"){var de=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.474,my:.296}});b(T,de,{fill:"none",stroke:K(_,c,v.stroke),strokeWidth:1})}else j==="Exclusive"&&(W||y(T,_.width,_.height,_.height*.26,{fill:"none",stroke:K(_,c,v.stroke),strokeWidth:1}),J());return N},"bpmn:ExclusiveGateway":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=Te(T,_,v),N=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:_.width,containerHeight:_.height,position:{mx:.32,my:.3}}),j=ye(_);return j.get("isMarkerVisible")&&b(T,N,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:Gateway":function(T,_,v={}){return v=ve(v,["fill","stroke"]),Te(T,_,v)},"bpmn:Group":function(T,_,v={}){return v=ve(v,["fill","stroke","width","height"]),g(T,_.width,_.height,Ea,{stroke:K(_,c,v.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:jt(_,v),height:kt(_,v)})},"bpmn:InclusiveGateway":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=Te(T,_,v);return y(T,_.width,_.height,_.height*.24,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:2.5}),k},"bpmn:IntermediateEvent":function(T,_,v={}){var{renderIcon:k=!0}=v;v=ve(v,["fill","stroke"]);var N=Ee(T,_,{...v,strokeWidth:1.5});return y(T,_.width,_.height,ba,{fill:"none",stroke:K(_,c,v.stroke),strokeWidth:1.5}),k&&I(_,T,v),N},"bpmn:IntermediateCatchEvent":M("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":M("bpmn:IntermediateEvent"),"bpmn:Lane":function(T,_,v={}){return v=ve(v,["fill","stroke","width","height"]),$(T,_,{...v,fillOpacity:lS})},"bpmn:ManualTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v),N=i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}});return b(T,N,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:.5}),k},"bpmn:MessageFlow":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=z(_),N=ye(_),j=pe(_,s,v.fill),W=K(_,c,v.stroke),J=x(T,_.waypoints,{markerEnd:h(T,"messageflow-end",j,W),markerStart:h(T,"messageflow-start",j,W),stroke:W,strokeDasharray:"10, 11",strokeWidth:1.5});if(k.get("messageRef")){var de=J.getPointAtLength(J.getTotalLength()/2),Ze=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:de.x,y:de.y}}),Le={strokeWidth:1};N.get("messageVisibleKind")==="initiating"?(Le.fill=j,Le.stroke=W):(Le.fill=W,Le.stroke=j);var rt=b(T,Ze,Le),Xt=k.get("messageRef"),Re=Xt.get("name"),Ln=F(T,Re,{align:"center-top",fitBox:!0,style:{fill:W}}),Qs=rt.getBBox(),Bt=Ln.getBBox(),se=de.x-Bt.width/2,xe=de.y+Qs.height/2+aS;da(Ln,se,xe,0)}return J},"bpmn:ParallelGateway":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=Te(T,_,v),N=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:_.width,containerHeight:_.height,position:{mx:.46,my:.2}});return b(T,N,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:Participant":function(T,_,v={}){v=ve(v,["fill","stroke","width","height"]);var k=$(T,_,v),N=fe(_),j=Je(_),W=z(_),J=W.get("name");if(N){var de=j?[{x:30,y:0},{x:30,y:kt(_,v)}]:[{x:0,y:30},{x:jt(_,v),y:30}];C(T,de,{stroke:K(_,c,v.stroke),strokeWidth:sS}),be(T,J,_,v)}else{var Ze=Gr(_,v);j||(Ze.height=jt(_,v),Ze.width=kt(_,v));var Le=F(T,J,{box:Ze,align:"center-middle",style:{fill:Ur(_,l,c,v.stroke)}});if(!j){var rt=-1*kt(_,v);da(Le,0,-rt,270)}}return W.get("participantMultiplicity")&&L("ParticipantMultiplicityMarker",T,_,v),k},"bpmn:ReceiveTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=z(_),N=he(T,_,v),j;return k.get("instantiate")?(y(T,28,28,20*.22,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1}),j=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):j=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),b(T,j,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1}),N},"bpmn:ScriptTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v),N=i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return b(T,N,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:SendTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v),N=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}});return b(T,N,{fill:K(_,c,v.stroke),stroke:pe(_,s,v.fill),strokeWidth:1}),k},"bpmn:SequenceFlow":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=pe(_,s,v.fill),N=K(_,c,v.stroke),j=x(T,_.waypoints,{markerEnd:h(T,"sequenceflow-end",k,N),stroke:N}),W=z(_),{source:J}=_;if(J){var de=z(J);W.get("conditionExpression")&&E(de,"bpmn:Activity")&&q(j,{markerStart:h(T,"conditional-flow-marker",k,N)}),de.get("default")&&(E(de,"bpmn:Gateway")||E(de,"bpmn:Activity"))&&de.get("default")===W&&q(j,{markerStart:h(T,"conditional-default-flow-marker",k,N)})}return j},"bpmn:ServiceTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v);y(T,10,10,{fill:pe(_,s,v.fill),stroke:"none",transform:"translate(6, 6)"});var N=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}});b(T,N,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1}),y(T,10,10,{fill:pe(_,s,v.fill),stroke:"none",transform:"translate(11, 10)"});var j=i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}});return b(T,j,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:1}),k},"bpmn:StartEvent":function(T,_,v={}){var{renderIcon:k=!0}=v;v=ve(v,["fill","stroke"]);var N=z(_);N.get("isInterrupting")||(v={...v,strokeDasharray:"6"});var j=Ee(T,_,v);return k&&I(_,T,v),j},"bpmn:SubProcess":function(T,_,v={}){return fe(_)?v=ve(v,["fill","stroke","width","height"]):v=ve(v,["fill","stroke"]),H(T,_,v)},"bpmn:Task":function(T,_,v={}){return v=ve(v,["fill","stroke"]),he(T,_,v)},"bpmn:TextAnnotation":function(T,_,v={}){v=ve(v,["fill","stroke","width","height"]);var{width:k,height:N}=Gr(_,v),j=g(T,k,N,0,0,{fill:"none",stroke:"none"}),W=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:k,containerHeight:N,position:{mx:0,my:0}});b(T,W,{stroke:K(_,c,v.stroke)});var J=z(_),de=J.get("text")||"";return F(T,de,{align:"left-top",box:Gr(_,v),padding:7,style:{fill:Ur(_,l,c,v.stroke)}}),j},"bpmn:Transaction":function(T,_,v={}){fe(_)?v=ve(v,["fill","stroke","width","height"]):v=ve(v,["fill","stroke"]);var k=H(T,_,{strokeWidth:1.5,...v}),N=n.style(["no-fill","no-events"],{stroke:K(_,c,v.stroke),strokeWidth:1.5}),j=fe(_);return j||(v={}),g(T,jt(_,v),kt(_,v),Ea-ba,ba,N),k},"bpmn:UserTask":function(T,_,v={}){v=ve(v,["fill","stroke"]);var k=he(T,_,v),N=15,j=12,W=i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:N,y:j}});b(T,W,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:.5});var J=i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:N,y:j}});b(T,J,{fill:pe(_,s,v.fill),stroke:K(_,c,v.stroke),strokeWidth:.5});var de=i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:N,y:j}});return b(T,de,{fill:K(_,c,v.stroke),stroke:K(_,c,v.stroke),strokeWidth:.5}),k},label:function(T,_,v={}){return ke(T,_,v)}};this._drawPath=b,this._renderer=P}Y(Ri,En),Ri.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Ri.prototype.canRender=function(e){return E(e,"bpmn:BaseElement")},Ri.prototype.drawShape=function(e,t,n={}){var{type:i}=t,r=this._renderer(i);return r(e,t,n)},Ri.prototype.drawConnection=function(e,t,n={}){var{type:i}=t,r=this._renderer(i);return r(e,t,n)},Ri.prototype.getShapePath=function(e){return E(e,"bpmn:Event")?tS(e):E(e,"bpmn:Activity")?nS(e,Ea):E(e,"bpmn:Gateway")?iS(e):rS(e)};function ve(e,t=[]){return t.reduce((n,i)=>(e[i]&&(n[i]=e[i]),n),{})}var uS=0,pS={width:150,height:50};function fS(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function dS(e){return tt(e)?D({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function hS(e,t){t.textContent=e;var n;try{var i,r=e==="";return t.textContent=r?"dummy":e,n=t.getBBox(),i={width:n.width+n.x*2,height:n.height},r&&(i.width=0),i}catch(o){return console.log(o),{width:0,height:0}}}function mS(e,t,n){for(var i=e.shift(),r=i,o;;){if(o=hS(r,n),o.width=r?o.width:0,r===" "||r===""||o.width<Math.round(t)||r.length<2)return gS(e,r,i,o);r=vS(r,o.width,t)}}function gS(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}var Pd="";function yS(e,t){var n=e.split(/(\s|-|\u00AD)/g),i,r=[],o=0;if(n.length>1)for(;i=n.shift();)if(i.length+o<t)r.push(i),o+=i.length;else{(i==="-"||i===Pd)&&r.pop();break}var a=r[r.length-1];return a&&a===Pd&&(r[r.length-1]="-"),r.join("")}function vS(e,t,n){var i=Math.max(e.length*(n/t),1),r=yS(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function _S(){var e=document.getElementById("helper-svg");return e||(e=X("svg"),q(e,{id:"helper-svg"}),ut(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}function xa(e){this._config=D({},{size:pS,padding:uS,style:{},align:"center-top"},e||{})}xa.prototype.createText=function(e,t){return this.layoutText(e,t).element},xa.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},xa.prototype.layoutText=function(e,t){var n=D({},this._config.size,t.box),i=D({},this._config.style,t.style),r=fS(t.align||this._config.align),o=dS(t.padding!==void 0?t.padding:this._config.padding),a=t.fitBox||!1,s=bS(i),c=e.split(/\u00AD?\r?\n/),l=[],u=n.width-o.left-o.right,p=X("text");q(p,{x:0,y:0}),q(p,i);var d=_S();for(ie(d,p);c.length;)l.push(mS(c,u,p));r.vertical==="middle"&&(o.top=o.bottom=0);var h=Tt(l,function(C,x,b){return C+(s||x.height)},0)+o.top+o.bottom,m=Tt(l,function(C,x,b){return x.width>C?x.width:C},0),y=o.top;r.vertical==="middle"&&(y+=(n.height-h)/2),y-=(s||l[0].height)/4;var g=X("text");q(g,i),A(l,function(C){var x;switch(y+=s||C.height,r.horizontal){case"left":x=o.left;break;case"right":x=(a?m:u)-o.right-C.width;break;default:x=Math.max(((a?m:u)-C.width)/2+o.left,0)}var b=X("tspan");q(b,{x,y}),b.textContent=C.text,ie(g,b)}),Ke(p);var w={width:m,height:h};return{dimensions:w,element:g}};function bS(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var ES=12,xS=1.2,wS=30;function Ad(e){var t=D({fontFamily:"Arial, sans-serif",fontSize:ES,fontWeight:"normal",lineHeight:xS},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=D({},t,{fontSize:n},e&&e.externalStyle||{}),r=new xa({style:t});this.getExternalLabelBounds=function(o,a){var s=r.getDimensions(a,{box:{width:90,height:30},style:i});return{x:Math.round(o.x+o.width/2-s.width/2),y:Math.round(o.y),width:Math.ceil(s.width),height:Math.ceil(s.height)}},this.getTextAnnotationBounds=function(o,a){var s=r.getDimensions(a,{box:o,style:t,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(wS,Math.round(s.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}Ad.$inject=["config.textRenderer"];function SS(){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 i=this.pathMap[t],r,o;n.abspos?(r=n.abspos.x,o=n.abspos.y):(r=n.containerWidth*n.position.mx,o=n.containerHeight*n.position.my);var a={};if(n.position){for(var s=n.containerHeight/i.height*n.yScaleFactor,c=n.containerWidth/i.width*n.xScaleFactor,l=0;l<i.heightElements.length;l++)a["y"+l]=i.heightElements[l]*s;for(var u=0;u<i.widthElements.length;u++)a["x"+u]=i.widthElements[u]*c}var p=PS(i.d,{mx:r,my:o,e:a});return p}}var CS=/\{([^{}]+)\}/g,RS=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function TS(e,t,n){var i=n;return t.replace(RS,function(r,o,a,s,c){o=o||s,i&&(o in i&&(i=i[o]),typeof i=="function"&&c&&(i=i()))}),i=(i==null||i==n?e:i)+"",i}function PS(e,t){return String(e).replace(CS,function(n,i){return TS(n,i,t)})}const AS={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ri],textRenderer:["type",Ad],pathMap:["type",SS]};function kS(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,i){return t[i]||"{"+i+"}"})}const wa={translate:["value",kS]};function Sa(e,t,n){return D({id:e.id,type:e.$type,businessObject:e,di:t},n)}function MS(e,t,n){var i=e.waypoint;return!i||i.length<2?[te(t),te(n)]:i.map(function(r){return{x:r.x,y:r.y}})}function kd(e,t,n){return new Error(`element ${ht(t)} referenced by ${ht(e)}#${n} not yet drawn`)}function Rn(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}Rn.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],Rn.prototype.add=function(e,t,n){var i,r,o;if(E(t,"bpmndi:BPMNPlane")){var a=E(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Sa(e,t,a)),this._canvas.addRootElement(i)}else if(E(t,"bpmndi:BPMNShape")){var s=!fe(e,t),c=NS(e);r=n&&(n.hidden||n.collapsed);var l=t.bounds;i=this._elementFactory.createShape(Sa(e,t,{collapsed:s,hidden:r,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:c})),E(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),E(e,"bpmn:Lane")&&(o=0),E(e,"bpmn:DataStoreReference")&&(DS(n,te(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else if(E(t,"bpmndi:BPMNEdge")){var u=this._getSource(e),p=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Sa(e,t,{hidden:r,source:u,target:p,waypoints:MS(t,u,p)})),E(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}else throw new Error(`unknown di ${ht(t)} for element ${ht(e)}`);return Ci(e)&&en(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},Rn.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${ht(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw kd(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),r.indexOf(t)===-1&&r.push(t)},Rn.prototype.addLabel=function(e,t,n){var i,r,o;return i=Y1(t,n),r=en(n),r&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(Sa(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!en(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},Rn.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],t==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(t==="source"&&r==="bpmn:DataOutputAssociation"||t==="target"&&r==="bpmn:DataInputAssociation")&&(i=e.$parent),n=i&&this._getElement(i),n)return n;throw i?kd(e,i,t+"Ref"):new Error(`${ht(e)}#${t} Ref not specified`)},Rn.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},Rn.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},Rn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};function DS(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function NS(e){return E(e,"bpmn:Group")}const OS={__depends__:[AS,{__depends__:[wa],bpmnImporter:["type",Rn]}]};function Kr(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}Kr.prototype.next=function(){return this._prefix+ ++this._counter};var IS=new Kr("ov"),BS=500;function nt(e,t,n,i){this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=IS,this._overlayDefaults=D({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=LS(n.getContainer()),this._init()}nt.$inject=["config.overlays","eventBus","canvas","elementRegistry"],nt.prototype.get=function(e){if(Rt(e)&&(e={id:e}),Rt(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?le(t.overlays,Jt({type:e.type})):t.overlays.slice():[]}else return e.type?le(this._overlays,Jt({type:e.type})):e.id?this._overlays[e.id]:null},nt.prototype.add=function(e,t,n){if(tt(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 i=this._ids.next();return n=D({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},nt.prototype.remove=function(e){var t=this.get(e)||[];oe(t)||(t=[t]);var n=this;A(t,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(un(i.html),un(i.htmlContainer),delete i.htmlContainer,delete i.element,delete n._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})},nt.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},nt.prototype.show=function(){Ca(this._overlayRoot)},nt.prototype.hide=function(){Ca(this._overlayRoot,!1)},nt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Zo(this._overlayRoot)},nt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=qe(t);i=o.x,r=o.y}Md(n,i,r),pt(e.html,"data-container-id",t.id)},nt.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,i=e.element,r=t.left,o=t.top;if(t.right!==void 0){var a;i.waypoints?a=qe(i).width:a=i.width,r=t.right*-1+a}if(t.bottom!==void 0){var s;i.waypoints?s=qe(i).height:s=i.height,o=t.bottom*-1+s}Md(n,r||0,o||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},nt.prototype._createOverlayContainer=function(e){var t=Pe('<div class="djs-overlays" />');ut(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},nt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Dd(this._overlayRoot,n)},nt.prototype._getOverlayContainer=function(e,t){var n=_e(this._overlayContainers,function(i){return i.element===e});return!n&&!t?this._createOverlayContainer(e):n},nt.prototype._addOverlay=function(e){var t=e.id,n=e.element,i=e.html,r,o;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Rt(i)&&(i=Pe(i)),o=this._getOverlayContainer(n),r=Pe('<div class="djs-overlay" data-overlay-id="'+t+'">'),ut(r,{position:"absolute"}),r.appendChild(i),e.type&&Ie(r).add("djs-overlay-"+e.type);var a=this._canvas.findRoot(n),s=this._canvas.getRootElement();Ca(r,a===s),e.htmlContainer=r,o.overlays.push(e),o.html.appendChild(r),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},nt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=this._canvas.getRootElement(),c=!0;(i!==s||n&&(et(r)&&r>t.scale||et(o)&&o<t.scale))&&(c=!1),Ca(a,c),this._updateOverlayScale(e,t)},nt.prototype._updateOverlayScale=function(e,t){var n=e.scale,i,r,o=e.htmlContainer,a,s="";n!==!0&&(n===!1?(i=1,r=1):(i=n.min,r=n.max),et(i)&&t.scale<i&&(a=(1/t.scale||1)*i),et(r)&&t.scale>r&&(a=(1/t.scale||1)*r)),et(a)&&(s="scale("+a+","+a+")"),Dd(o,s)},nt.prototype._updateOverlaysVisibilty=function(e){var t=this;A(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},nt.prototype._init=function(){var e=this._eventBus,t=this;function n(i){t._updateRoot(i),t._updateOverlaysVisibilty(i),t.show()}e.on("canvas.viewbox.changing",function(i){t.hide()}),e.on("canvas.viewbox.changed",function(i){n(i.viewbox)}),e.on(["shape.remove","connection.remove"],function(i){var r=i.element,o=t.get({element:r});A(o,function(c){t.remove(c.id)});var a=t._getOverlayContainer(r);if(a){un(a.html);var s=t._overlayContainers.indexOf(a);s!==-1&&t._overlayContainers.splice(s,1)}}),e.on("element.changed",BS,function(i){var r=i.element,o=t._getOverlayContainer(r,!0);o&&(A(o.overlays,function(a){t._updateOverlay(a)}),t._updateOverlayContainer(o))}),e.on("element.marker.update",function(i){var r=t._getOverlayContainer(i.element,!0);r&&Ie(r.html)[i.add?"add":"remove"](i.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function LS(e){var t=Pe('<div class="djs-overlay-container" />');return ut(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function Md(e,t,n){ut(e,{left:t+"px",top:n+"px"})}function Ca(e,t){e.style.display=t===!1?"none":""}function Dd(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}const Ra={__init__:["overlays"],overlays:["type",nt]};function Nd(e,t,n,i){e.on("element.changed",function(r){var o=r.element;(o.parent||o===t.getRootElement())&&(r.gfx=n.getGraphics(o)),r.gfx&&e.fire(Cf(o)+".changed",r)}),e.on("elements.changed",function(r){var o=r.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),i.updateContainments(o)}),e.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),e.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}Nd.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const nl={__init__:["changeSupport"],changeSupport:["type",Nd]};var $S=1e3;function V(e){this._eventBus=e}V.$inject=["eventBus"];function jS(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}V.prototype.on=function(e,t,n,i,r,o){if((Ue(t)||ee(t))&&(o=r,r=i,i=n,n=t,t=null),Ue(n)&&(o=r,r=i,i=n,n=$S),tt(r)&&(o=r,r=!1),!Ue(i))throw new Error("handlerFn must be a function");oe(e)||(e=[e]);var a=this._eventBus;A(e,function(s){var c=["commandStack",s,t].filter(function(l){return l}).join(".");a.on(c,n,r?jS(i,o):i,o)})},V.prototype.canExecute=Tn("canExecute"),V.prototype.preExecute=Tn("preExecute"),V.prototype.preExecuted=Tn("preExecuted"),V.prototype.execute=Tn("execute"),V.prototype.executed=Tn("executed"),V.prototype.postExecute=Tn("postExecute"),V.prototype.postExecuted=Tn("postExecuted"),V.prototype.revert=Tn("revert"),V.prototype.reverted=Tn("reverted");function Tn(e){return function(n,i,r,o,a){(Ue(n)||ee(n))&&(a=o,o=r,r=i,i=n,n=null),this.on(n,e,i,r,o,a)}}function il(e,t){t.invoke(V,this),this.executed(function(n){var i=n.context;i.rootElement?e.setRootElement(i.rootElement):i.rootElement=e.getRootElement()}),this.revert(function(n){var i=n.context;i.rootElement&&e.setRootElement(i.rootElement)})}Y(il,V),il.$inject=["canvas","injector"];const FS={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",il]};function qr(e){return CSS.escape(e)}var HS={"&":"&","<":"<",">":">",'"':""","'":"'"};function Od(e){return e=""+e,e&&e.replace(/[&<>"']/g,function(t){return HS[t]})}var Id="_plane";function Bd(e){var t=e.id;return VS(t)}function Pn(e){var t=e.id;return E(e,"bpmn:SubProcess")?Ld(t):t}function Ti(e){return Ld(e)}function Ta(e){var t=ye(e);return E(t,"bpmndi:BPMNPlane")}function Ld(e){return e+Id}function VS(e){return e.replace(new RegExp(Id+"$"),"")}var zS="bjs-breadcrumbs-shown";function $d(e,t,n){var i=Pe('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=Ie(r);r.appendChild(i);var a=[];e.on("element.changed",function(c){var l=c.element,u=z(l),p=_e(a,function(d){return d===u});p&&s()});function s(c){c&&(a=WS(c));var l=a.flatMap(function(p){var d=n.findRoot(Pn(p))||n.findRoot(p.id);if(!d&&E(p,"bpmn:Process")){var h=t.find(function(g){var w=z(g);return w&&w.get("processRef")===p});d=h&&n.findRoot(h.id)}if(!d)return[];var m=Od(p.name||p.id),y=Pe('<li><span class="bjs-crumb"><a title="'+m+'">'+m+"</a></span></li>");return y.addEventListener("click",function(){n.setRootElement(d)}),y});i.innerHTML="";var u=l.length>1;o.toggle(zS,u),l.forEach(function(p){i.appendChild(p)})}e.on("root.set",function(c){s(c.element)})}$d.$inject=["eventBus","elementRegistry","canvas"];function WS(e){for(var t=z(e),n=[],i=t;i;i=i.$parent)(E(i,"bpmn:SubProcess")||E(i,"bpmn:Process"))&&n.push(i);return n.reverse()}function jd(e,t){var n=null,i=new US;e.on("root.set",function(r){var o=r.element,a=t.viewbox(),s=i.get(o);if(i.set(n,{x:a.x,y:a.y,zoom:a.scale}),n=o,!(!E(o,"bpmn:SubProcess")&&!s)){s=s||{x:0,y:0,zoom:1};var c=(a.x-s.x)*a.scale,l=(a.y-s.y)*a.scale;(c!==0||l!==0)&&t.scroll({dx:c,dy:l}),s.zoom!==a.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){i.clear(),n=null})}jd.$inject=["eventBus","canvas"];function US(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][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 Fd={x:180,y:160};function Pi(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(i,r){n._handleImport(r.definitions)})}Pi.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(i){!i.plane||!i.plane.bpmnElement||(t._processToDiagramMap[i.plane.bpmnElement.id]=i)});var n=e.diagrams.filter(i=>i.plane).flatMap(i=>t._createNewDiagrams(i.plane));n.forEach(function(i){t._movePlaneElementsToOrigin(i.plane)})}},Pi.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach(function(o){var a=o.bpmnElement;if(a){var s=a.$parent;E(a,"bpmn:SubProcess")&&!o.isExpanded&&n.push(a),KS(a,e)&&i.push({diElement:o,parent:s})}});var r=[];return n.forEach(function(o){if(!t._processToDiagramMap[o.id]){var a=t._createDiagram(o);t._processToDiagramMap[o.id]=a,r.push(a)}}),i.forEach(function(o){for(var a=o.diElement,s=o.parent;s&&n.indexOf(s)===-1;)s=s.$parent;if(s){var c=t._processToDiagramMap[s.id];t._moveToDiPlane(a,c.plane)}}),r},Pi.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=GS(e),i={x:n.x-Fd.x,y:n.y-Fd.y};t.forEach(function(r){r.waypoint?r.waypoint.forEach(function(o){o.x=o.x-i.x,o.y=o.y-i.y}):r.bounds&&(r.bounds.x=r.bounds.x-i.x,r.bounds.y=r.bounds.y-i.y)})},Pi.prototype._moveToDiPlane=function(e,t){var n=Hd(e),i=n.plane.get("planeElement");i.splice(i.indexOf(e),1),t.get("planeElement").push(e)},Pi.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},Pi.$inject=["eventBus","moddle"];function Hd(e){return E(e,"bpmndi:BPMNDiagram")?e:Hd(e.$parent)}function GS(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 i=Q(n.bounds);t.top=Math.min(i.top,t.top),t.left=Math.min(i.left,t.left)}}),ua(t)}function KS(e,t){var n=e.$parent;return!(!E(n,"bpmn:SubProcess")||n===t.bpmnElement||ue(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))}var Pa=250,qS='<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>',YS="bjs-drilldown-empty";function Yn(e,t,n,i,r){V.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i,this._translate=r;var o=this;this.executed("shape.toggleCollapse",Pa,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.reverted("shape.toggleCollapse",Pa,function(a){var s=a.shape;o._canDrillDown(s)?o._addOverlay(s):o._removeOverlay(s)},!0),this.executed(["shape.create","shape.move","shape.delete"],Pa,function(a){var s=a.oldParent,c=a.newParent||a.parent,l=a.shape;o._canDrillDown(l)&&o._addOverlay(l),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(l)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Pa,function(a){var s=a.oldParent,c=a.newParent||a.parent,l=a.shape;o._canDrillDown(l)&&o._addOverlay(l),o._updateDrilldownOverlay(s),o._updateDrilldownOverlay(c),o._updateDrilldownOverlay(l)},!0),t.on("import.render.complete",function(){n.filter(function(a){return o._canDrillDown(a)}).map(function(a){o._addOverlay(a)})})}Y(Yn,V),Yn.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Yn.prototype._canDrillDown=function(e){var t=this._canvas;return E(e,"bpmn:SubProcess")&&t.findRoot(Pn(e))},Yn.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=z(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;Ie(i.html).toggle(YS,!r)}},Yn.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,i=z(e),r=n.get({element:e,type:"drilldown"});r.length&&this._removeOverlay(e);var o=Pe('<button type="button" class="bjs-drilldown">'+qS+"</button>"),a=i.get("name")||i.get("id"),s=this._translate("Open {element}",{element:a});o.setAttribute("title",s),o.addEventListener("click",function(){t.setRootElement(t.findRoot(Pn(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:o}),this._updateOverlayVisibility(e)},Yn.prototype._removeOverlay=function(e){var t=this._overlays;t.remove({element:e,type:"drilldown"})},Yn.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];const XS={__depends__:[Ra,nl,FS],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",$d],drilldownCentering:["type",jd],drilldownOverlayBehavior:["type",Yn],subprocessCompatibility:["type",Pi]};function Vd(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function er(e){return e.originalEvent||e.srcEvent}function rl(e){Vd(e),Vd(er(e))}function Ai(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 zd(){return/mac/i.test(navigator.platform)}function Wd(e,t){return(er(e)||e).button===t}function Xn(e){return Wd(e,0)}function ZS(e){return Wd(e,1)}function Yr(e){var t=er(e)||e;return Xn(e)?zd()?t.metaKey:t.ctrlKey:!1}function Aa(e){var t=er(e)||e;return Xn(e)&&t.shiftKey}function JS(e){return!0}function ka(e){return Xn(e)||ZS(e)}var Ud=500;function Gd(e,t,n){var i=this;function r(R,I,B){if(!s(R,I)){var L,O,F;B?O=t.getGraphics(B):(L=I.delegateTarget||I.target,L&&(O=L,B=t.get(O))),!(!O||!B)&&(F=e.fire(R,{element:B,gfx:O,originalEvent:I}),F===!1&&(I.stopPropagation(),I.preventDefault()))}}var o={};function a(R){return o[R]}function s(R,I){var B=l[R]||Xn;return!B(I)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":JS,"element.mousedown":ka,"element.mouseup":ka,"element.click":ka,"element.dblclick":ka};function u(R,I,B){var L=c[R];if(!L)throw new Error("unmapped DOM event name <"+R+">");return r(L,I,B)}var p="svg, .djs-element";function d(R,I,B,L){var O=o[B]=function(F){r(B,F)};L&&(l[B]=L),O.$delegate=Pt.bind(R,p,I,O)}function h(R,I,B){var L=a(B);L&&Pt.unbind(R,I,L.$delegate)}function m(R){A(c,function(I,B){d(R,B,I)})}function y(R){A(c,function(I,B){h(R,B,I)})}e.on("canvas.destroy",function(R){y(R.svg)}),e.on("canvas.init",function(R){m(R.svg)}),e.on(["shape.added","connection.added"],function(R){var I=R.element,B=R.gfx;e.fire("interactionEvents.createHit",{element:I,gfx:B})}),e.on(["shape.changed","connection.changed"],Ud,function(R){var I=R.element,B=R.gfx;e.fire("interactionEvents.updateHit",{element:I,gfx:B})}),e.on("interactionEvents.createHit",Ud,function(R){var I=R.element,B=R.gfx;i.createDefaultHit(I,B)}),e.on("interactionEvents.updateHit",function(R){var I=R.element,B=R.gfx;i.updateDefaultHit(I,B)});var g=S("djs-hit djs-hit-stroke"),w=S("djs-hit djs-hit-click-stroke"),C=S("djs-hit djs-hit-all"),x=S("djs-hit djs-hit-no-move"),b={all:C,"click-stroke":w,stroke:g,"no-move":x};function S(R,I){return I=D({stroke:"white",strokeWidth:15},I||{}),n.cls(R,["no-fill","no-border"],I)}function P(R,I){var B=b[I];if(!B)throw new Error("invalid hit type <"+I+">");return q(R,B),R}function M(R,I){ie(R,I)}this.removeHits=function(R){var I=Rc(".djs-hit",R);A(I,Ke)},this.createDefaultHit=function(R,I){var B=R.waypoints,L=R.isFrame,O;return B?this.createWaypointsHit(I,B):(O=L?"stroke":"all",this.createBoxHit(I,O,{width:R.width,height:R.height}))},this.createWaypointsHit=function(R,I){var B=ra(I);return P(B,"stroke"),M(R,B),B},this.createBoxHit=function(R,I,B){B=D({x:0,y:0},B);var L=X("rect");return P(L,I),q(L,B),M(R,L),L},this.updateDefaultHit=function(R,I){var B=we(".djs-hit",I);if(B)return R.waypoints?Ef(B,R.waypoints):q(B,{width:R.width,height:R.height}),B},this.fire=r,this.triggerMouseEvent=u,this.mouseHandler=a,this.registerEvent=d,this.unregisterEvent=h}Gd.$inject=["eventBus","elementRegistry","styles"];const Ma={__init__:["interactionEvents"],interactionEvents:["type",Gd]};function tr(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),e.on(["diagram.clear","root.set"],function(i){n.select(null)})}tr.$inject=["eventBus","canvas"],tr.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},tr.prototype.get=function(){return this._selectedElements},tr.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},tr.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();oe(e)||(e=e?[e]:[]);var r=this._canvas,o=r.getRootElement();e=e.filter(function(a){var s=r.findRoot(a);return o===s}),t?A(e,function(a){n.indexOf(a)===-1&&n.push(a)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Kd="hover",qd="selected";function Yd(e,t){this._canvas=e;function n(r,o){e.addMarker(r,o)}function i(r,o){e.removeMarker(r,o)}t.on("element.hover",function(r){n(r.element,Kd)}),t.on("element.out",function(r){i(r.element,Kd)}),t.on("selection.changed",function(r){function o(l){i(l,qd)}function a(l){n(l,qd)}var s=r.oldSelection,c=r.newSelection;A(s,function(l){c.indexOf(l)===-1&&o(l)}),A(c,function(l){s.indexOf(l)===-1&&a(l)})})}Yd.$inject=["canvas","eventBus"];function Xd(e,t,n,i){e.on("create.end",500,function(r){var o=r.context,a=o.canExecute,s=o.elements,c=o.hints||{},l=c.autoSelect;if(a){if(l===!1)return;oe(l)?t.select(l):t.select(s.filter(QS))}}),e.on("connect.end",500,function(r){var o=r.context,a=o.connection;a&&t.select(a)}),e.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id),s=_e(o,function(c){return a.id===c.id});s||t.select(a)}),e.on("element.click",function(r){if(Xn(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),s=t.get().length>1,c=Aa(r);if(a&&s)return c?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,c)}})}Xd.$inject=["eventBus","selection","canvas","elementRegistry"];function QS(e){return!e.hidden}const tn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Ma],selection:["type",tr],selectionVisuals:["type",Yd],selectionBehavior:["type",Xd]};function Zn(e){Me.call(this,e)}Y(Zn,Me),Zn.prototype._modules=[OS,XS,Ra,tn,wa],Zn.prototype._moddleExtensions={};var eC=["c","C"],tC=["v","V"],nC=["y","Y"],Zd=["z","Z"];function iC(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Ft(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function it(e,t){return e=oe(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}function ol(e){return e.shiftKey}function rC(e){return Ft(e)&&it(eC,e)}function oC(e){return Ft(e)&&it(tC,e)}function aC(e){return Ft(e)&&!ol(e)&&it(Zd,e)}function sC(e){return Ft(e)&&(it(nC,e)||it(Zd,e)&&ol(e))}var Da="keyboard.keydown",cC="keyboard.keyup",lC=1e3,Jd="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function _t(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(Jd));var i=e&&e.bind!==!1;t.on("canvas.init",function(r){n._target=r.svg,i&&n.bind(),n._fire("init")})}_t.$inject=["config.keyboard","eventBus"],_t.prototype._keydownHandler=function(e){this._keyHandler(e,Da)},_t.prototype._keyupHandler=function(e){this._keyHandler(e,cC)},_t.prototype._keyHandler=function(e,t){var n;if(!this._isEventIgnored(e)){var i={keyEvent:e};n=this._eventBus.fire(t||Da,i),n&&e.preventDefault()}},_t.prototype._isEventIgnored=function(e){return!1},_t.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(Jd)),this.unbind(),e=this._node=this._target,ae.bind(e,"keydown",this._keydownHandler),ae.bind(e,"keyup",this._keyupHandler),this._fire("bind")},_t.prototype.getBinding=function(){return this._node},_t.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ae.unbind(e,"keydown",this._keydownHandler),ae.unbind(e,"keyup",this._keyupHandler)),this._node=null},_t.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},_t.prototype.addListener=function(e,t,n){Ue(e)&&(n=t,t=e,e=lC),this._eventBus.on(n||Da,e,t)},_t.prototype.removeListener=function(e,t){this._eventBus.off(t||Da,e)},_t.prototype.hasModifier=iC,_t.prototype.isCmd=Ft,_t.prototype.isShift=ol,_t.prototype.isKey=it;var uC=500;function nr(e,t){var n=this;e.on("editorActions.init",uC,function(i){var r=i.editorActions;n.registerBindings(t,r)})}nr.$inject=["eventBus","keyboard"],nr.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("undo",function(i){var r=i.keyEvent;if(aC(r))return t.trigger("undo"),!0}),n("redo",function(i){var r=i.keyEvent;if(sC(r))return t.trigger("redo"),!0}),n("copy",function(i){var r=i.keyEvent;if(rC(r))return t.trigger("copy"),!0}),n("paste",function(i){var r=i.keyEvent;if(oC(r))return t.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(it(["+","Add","="],r)&&Ft(r))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(it(["-","Subtract"],r)&&Ft(r))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(it("0",r)&&Ft(r))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){var r=i.keyEvent;if(it(["Backspace","Delete","Del"],r))return t.trigger("removeSelection"),!0})};const al={__init__:["keyboard","keyboardBindings"],keyboard:["type",_t],keyboardBindings:["type",nr]};var pC={moveSpeed:50,moveSpeedAccelerated:200};function Qd(e,t,n){var i=this;this._config=D({},pC,e||{}),t.addListener(r);function r(o){var a=o.keyEvent,s=i._config;if(t.isCmd(a)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],a)){var c=t.isShift(a)?s.moveSpeedAccelerated:s.moveSpeed,l;switch(a.key){case"ArrowLeft":case"Left":l="left";break;case"ArrowUp":case"Up":l="up";break;case"ArrowRight":case"Right":l="right";break;case"ArrowDown":case"Down":l="down";break}return i.moveCanvas({speed:c,direction:l}),!0}}this.moveCanvas=function(o){var a=0,s=0,c=o.speed,l=c/Math.min(Math.sqrt(n.viewbox().scale),1);switch(o.direction){case"left":a=l;break;case"up":s=l;break;case"right":a=-l;break;case"down":s=-l;break}n.scroll({dx:a,dy:s})}}Qd.$inject=["config.keyboardMove","keyboard","canvas"];const eh={__depends__:[al],__init__:["keyboardMove"],keyboardMove:["type",Qd]};var fC=/^djs-cursor-.*$/;function Na(e){var t=Ie(document.body);t.removeMatching(fC),e&&t.add("djs-cursor-"+e)}function th(){Na(null)}var dC=5e3;function nh(e,t){t=t||"element.click";function n(){return!1}return e.once(t,dC,n),function(){e.off(t,n)}}function Xr(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function nn(e,t){return{x:e.x-t.x,y:e.y-t.y}}var hC=15;function ih(e,t){var n;function i(s){return a(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,i):e.off("element.mousedown",i)});function r(s){var c=n.start,l=n.button,u=Ai(s),p=nn(u,c);if(!n.dragging&&mC(p)>hC&&(n.dragging=!0,l===0&&nh(e),Na("grab")),n.dragging){var d=n.last||n.start;p=nn(u,d),t.scroll({dx:p.x,dy:p.y}),n.last=u}s.preventDefault()}function o(s){ae.unbind(document,"mousemove",r),ae.unbind(document,"mouseup",o),n=null,th()}function a(s){if(!Ui(s.target,".djs-draggable")){var c=s.button;if(!(c>=2||s.ctrlKey||s.shiftKey||s.altKey))return n={button:c,start:Ai(s)},ae.bind(document,"mousemove",r),ae.bind(document,"mouseup",o),!0}}this.isActive=function(){return!!n}}ih.$inject=["eventBus","canvas"];function mC(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}const rh={__init__:["moveCanvas"],moveCanvas:["type",ih]};function sl(e){return Math.log(e)/Math.log(10)}function oh(e,t){var n=sl(e.min),i=sl(e.max),r=Math.abs(n)+Math.abs(i);return r/t}function gC(e,t){return Math.max(e.min,Math.min(e.max,t))}var yC=Math.sign||function(e){return e>=0?1:-1},cl={min:.2,max:4},ah=10,vC=.1,_C=.75;function gn(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=xt(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||_C;var i=this;t.on("canvas.focus.changed",function(r){i._init(r.focused&&e.enabled!==!1)})}gn.$inject=["config.zoomScroll","eventBus","canvas"],gn.prototype.scroll=function(t){this._canvas.scroll(t)},gn.prototype.reset=function(){this._canvas.zoom("fit-viewport")},gn.prototype.zoom=function(t,n){var i=oh(cl,ah*2);this._totalDelta+=t,Math.abs(this._totalDelta)>vC&&(this._zoom(t,n,i),this._totalDelta=0)},gn.prototype._handleWheel=function(t){if(this._canvas.isFocused()){var n=this._container;t.preventDefault();var i=t.ctrlKey||zd()&&t.metaKey,r=t.shiftKey,o=-1*this._scale,a;if(i?o*=t.deltaMode===0?.02:.32:o*=t.deltaMode===0?1:16,i){var s=n.getBoundingClientRect(),c={x:t.clientX-s.left,y:t.clientY-s.top};a=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*yC(t.deltaY)*o,this.zoom(a,c)}else r?a={dx:o*t.deltaY,dy:0}:a={dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(a)}},gn.prototype.stepZoom=function(t,n){var i=oh(cl,ah);this._zoom(t,n,i)},gn.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=sl(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s=Math.pow(10,a);i.zoom(gC(cl,s),t)},gn.prototype.toggle=function(t){var n=this._container,i=this._handleWheel,r=this._enabled;return typeof t>"u"&&(t=!r),r!==t&&ae[t?"bind":"unbind"](n,"wheel",i,!1),this._enabled=t,t},gn.prototype._init=function(e){this.toggle(e)};const sh={__init__:["zoomScroll"],zoomScroll:["type",gn]};function Zr(e){Zn.call(this,e)}Y(Zr,Zn),Zr.prototype._navigationModules=[eh,rh,sh],Zr.prototype._modules=[].concat(Zn.prototype._modules,Zr.prototype._navigationModules);function ll(e){return e&&e[e.length-1]}function ch(e){return e.y}function lh(e){return e.x}var bC={left:lh,center:lh,right:function(e){return e.x+e.width},top:ch,middle:ch,bottom:function(e){return e.y+e.height}};function ir(e,t){this._modeling=e,this._rules=t}ir.$inject=["modeling","rules"],ir.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",i="width";return t.indexOf(e)!==-1&&(n="y",i="height"),{axis:n,dimension:i}},ir.prototype._isType=function(e,t){return t.indexOf(e)!==-1},ir.prototype._alignmentPosition=function(e,t){var n=this._getOrientationDetails(e),i=n.axis,r=n.dimension,o={},a={},s=!1,c,l,u;function p(d,h){return Math.round((d[i]+h[i]+h[r])/2)}if(this._isType(e,["left","top"]))o[e]=t[0][i];else if(this._isType(e,["right","bottom"]))u=ll(t),o[e]=u[i]+u[r];else if(this._isType(e,["center","middle"])){if(A(t,function(d){var h=d[i]+Math.round(d[r]/2);a[h]?a[h].elements.push(d):a[h]={elements:[d],center:h}}),c=cn(a,function(d){return d.elements.length>1&&(s=!0),d.elements.length}),s)return o[e]=ll(c).center,o;l=t[0],t=cn(t,function(d){return d[i]+d[r]}),u=ll(t),o[e]=p(l,u)}return o},ir.prototype.trigger=function(e,t){var n=this._modeling,i,r=le(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(i=this._rules.allowed("elements.align",{elements:r}),oe(i)&&(r=i),!(r.length<2||!i)){var o=bC[t],a=cn(r,o),s=this._alignmentPosition(t,a);n.alignElements(a,s)}};const EC={__init__:["alignElements"],alignElements:["type",ir]},xC=new Kr;function rr(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}rr.$inject=["eventBus"],rr.prototype.schedule=function(e,t=xC.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},rr.prototype._schedule=function(e,t){const n=wC();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(r){n.reject(r)}}catch(r){console.error("Scheduler#_schedule execution failed",r)}}),promise:n.promise}},rr.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},rr.prototype._cancel=function(e){clearTimeout(e.executionId)};function wC(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const SC={scheduler:["type",rr]};var CC="djs-element-hidden",Oa=".entry",RC=1e3,uh=8,TC=300;function Fe(e,t,n,i){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=i,this._current=null,this._init()}Fe.$inject=["canvas","elementRegistry","eventBus","scheduler"],Fe.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,i=n.length?n.length===1?n[0]:n:null;i?e.open(i,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,i=e._current;if(i){var r=i.target,o=oe(r)?r:[r],a=o.filter(function(c){return n.includes(c)});if(a.length){e.close();var s=o.filter(function(c){return e._elementRegistry.get(c.id)});s.length&&e._updateAndOpen(s.length>1?s:s[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,i=e._current,r=oe(i.target)?i.target:[i.target];r.includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},Fe.prototype._createContainer=function(){var e=Pe('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},Fe.prototype.registerProvider=function(e,t){t||(t=e,e=RC),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},Fe.prototype.getEntries=function(e){var t=this._getProviders(),n=oe(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return A(t,function(r){if(Ue(r[n])){var o=r[n](e);Ue(o)?i=o(i):A(o,function(a,s){i[s]=a})}}),i},Fe.prototype.trigger=function(e,t,n){var i=this,r,o,a=t.delegateTarget||t.target;if(!a)return t.preventDefault();if(r=pt(a,"data-action"),o=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){i._mouseout=i.triggerEntry(r,"hover",o,n)},TC);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(r,e,o,n)},Fe.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries,a=o[e];if(a){var s=a.action;if(this._eventBus.fire("contextPad.trigger",{entry:a,event:n})!==!1){if(Ue(s)){if(t==="click")return s(n,r,i)}else if(s[t])return s[t](n,r,i);n.preventDefault()}}}},Fe.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},Fe.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Fe.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this._createHtml(e),i;A(t,function(r,o){var a=r.group||"default",s=Pe(r.html||'<div class="entry" draggable="true"></div>'),c;pt(s,"data-action",o),c=we("[data-group="+qr(a)+"]",n),c||(c=Pe('<div class="group"></div>'),pt(c,"data-group",a),n.appendChild(c)),c.appendChild(s),r.className&&PC(s,r.className),r.title&&pt(s,"title",r.title),r.imageUrl&&(i=Pe("<img>"),pt(i,"src",r.imageUrl),i.style.width="100%",i.style.height="100%",s.appendChild(i))}),Ie(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},Fe.prototype._createHtml=function(e){var t=this,n=Pe('<div class="djs-context-pad"></div>');return Pt.bind(n,Oa,"click",function(i){t.trigger("click",i)}),Pt.bind(n,Oa,"dragstart",function(i){t.trigger("dragstart",i)}),Pt.bind(n,Oa,"mouseover",function(i){t.trigger("mouseover",i)}),Pt.bind(n,Oa,"mouseout",function(i){t.trigger("mouseout",i)}),ae.bind(n,"mousedown",function(i){i.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},Fe.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&kC(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}},Fe.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},Fe.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return oe(e)!==oe(n)?!1:oe(e)?e.length===n.length&&vi(e,function(i){return n.includes(i)}):n===e},Fe.prototype.isShown=function(){return this.isOpen()&&Ie(this._current.html).has("open")},Fe.prototype.show=function(){this.isOpen()&&(Ie(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},Fe.prototype.hide=function(){this.isOpen()&&(Ie(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},Fe.prototype._getPosition=function(e){if(!oe(e)&&Se(e)){var t=this._canvas.viewbox(),n=AC(e),i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale;return{left:i+uh*this._canvas.zoom(),top:r}}var o=this._canvas.getContainer(),a=o.getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+uh*this._canvas.zoom(),top:s.top-a.top}},Fe.prototype._updatePosition=function(){const e=()=>{if(this.isOpen()){var t=this._current.html,n=this._getPosition(this._current.target);"x"in n&&"y"in n?(t.style.left=n.x+"px",t.style.top=n.y+"px"):["top","right","bottom","left"].forEach(function(i){i in n&&(t.style[i]=n[i]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")},Fe.prototype._updateVisibility=function(){const e=()=>{if(this.isOpen()){var t=this,n=this._current.target,i=oe(n)?n:[n],r=i.some(function(o){return t._canvas.hasMarker(o,CC)});r?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")},Fe.prototype._getTargetBounds=function(e){var t=this,n=oe(e)?e:[e],i=n.map(function(r){return t._canvas.getGraphics(r)});return i.reduce(function(r,o){const a=o.getBoundingClientRect();return r.top=Math.min(r.top,a.top),r.right=Math.max(r.right,a.right),r.bottom=Math.max(r.bottom,a.bottom),r.left=Math.min(r.left,a.left),r.x=r.left,r.y=r.top,r.width=r.right-r.left,r.height=r.bottom-r.top,r},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function PC(e,t){var n=Ie(e);t=oe(t)?t:t.split(/\s+/g),t.forEach(function(i){n.add(i)})}function AC(e){return e.waypoints[e.waypoints.length-1]}function kC(e,t){return e=oe(e)?e:[e],t=oe(t)?t:[t],e.length===t.length&&vi(e,function(n){return t.includes(n)})}const ph={__depends__:[Ma,SC,Ra],contextPad:["type",Fe]};var Ia,De,fh,ki,dh,hh,mh,gh,ul,pl,fl,Jr={},yh=[],MC=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ba=Array.isArray;function An(e,t){for(var n in t)e[n]=t[n];return e}function dl(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function vh(e,t,n){var i,r,o,a={};for(o in t)o=="key"?i=t[o]:o=="ref"?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Ia.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]==null&&(a[o]=e.defaultProps[o]);return La(e,a,i,r,null)}function La(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++fh,__i:-1,__u:0};return r==null&&De.vnode!=null&&De.vnode(o),o}function $a(e){return e.children}function ja(e,t){this.props=e,this.context=t}function or(e,t){if(t==null)return e.__?or(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?or(e):null}function _h(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return _h(e)}}function bh(e){(!e.__d&&(e.__d=!0)&&ki.push(e)&&!Fa.__r++||dh!=De.debounceRendering)&&((dh=De.debounceRendering)||hh)(Fa)}function Fa(){for(var e,t,n,i,r,o,a,s=1;ki.length;)ki.length>s&&ki.sort(mh),e=ki.shift(),s=ki.length,e.__d&&(n=void 0,r=(i=(t=e).__v).__e,o=[],a=[],t.__P&&((n=An({},i)).__v=i.__v+1,De.vnode&&De.vnode(n),hl(t.__P,n,i,t.__n,t.__P.namespaceURI,32&i.__u?[r]:null,o,r??or(i),!!(32&i.__u),a),n.__v=i.__v,n.__.__k[n.__i]=n,Ch(o,n,a),n.__e!=r&&_h(n)));Fa.__r=0}function Eh(e,t,n,i,r,o,a,s,c,l,u){var p,d,h,m,y,g,w=i&&i.__k||yh,C=t.length;for(c=DC(n,t,w,c,C),p=0;p<C;p++)(h=n.__k[p])!=null&&(d=h.__i==-1?Jr:w[h.__i]||Jr,h.__i=p,g=hl(e,h,d,r,o,a,s,c,l,u),m=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&ml(d.ref,null,h),u.push(h.ref,h.__c||m,h)),y==null&&m!=null&&(y=m),4&h.__u||d.__k===h.__k?c=xh(h,c,e):typeof h.type=="function"&&g!==void 0?c=g:m&&(c=m.nextSibling),h.__u&=-7);return n.__e=y,c}function DC(e,t,n,i,r){var o,a,s,c,l,u=n.length,p=u,d=0;for(e.__k=new Array(r),o=0;o<r;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(c=o+d,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?La(null,a,null,null,null):Ba(a)?La($a,{children:a},null,null,null):a.constructor==null&&a.__b>0?La(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(l=a.__i=NC(a,n,c,p))!=-1&&(p--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(r>u?d--:r<u&&d++),typeof a.type!="function"&&(a.__u|=4)):l!=c&&(l==c-1?d--:l==c+1?d++:(l>c?d--:d++,a.__u|=4))):e.__k[o]=null;if(p)for(o=0;o<u;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==i&&(i=or(s)),Th(s,s));return i}function xh(e,t,n){var i,r;if(typeof e.type=="function"){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=xh(i[r],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=or(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function NC(e,t,n,i){var r,o,a=e.key,s=e.type,c=t[n];if(c===null&&e.key==null||c&&a==c.key&&s==c.type&&(2&c.__u)==0)return n;if(i>(c!=null&&(2&c.__u)==0?1:0))for(r=n-1,o=n+1;r>=0||o<t.length;){if(r>=0){if((c=t[r])&&(2&c.__u)==0&&a==c.key&&s==c.type)return r;r--}if(o<t.length){if((c=t[o])&&(2&c.__u)==0&&a==c.key&&s==c.type)return o;o++}}return-1}function wh(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||MC.test(t)?n:n+"px"}function Ha(e,t,n,i,r){var o;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||wh(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||wh(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(gh,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=ul,e.addEventListener(t,o?fl:pl,o)):e.removeEventListener(t,o?fl:pl,o);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Sh(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=ul++;else if(t.t<n.u)return;return n(De.event?De.event(t):t)}}}function hl(e,t,n,i,r,o,a,s,c,l){var u,p,d,h,m,y,g,w,C,x,b,S,P,M,R,I,B,L=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),o=[s=t.__e=n.__e]),(u=De.__b)&&u(t);e:if(typeof L=="function")try{if(w=t.props,C="prototype"in L&&L.prototype.render,x=(u=L.contextType)&&i[u.__c],b=u?x?x.props.value:u.__:i,n.__c?g=(p=t.__c=n.__c).__=p.__E:(C?t.__c=p=new L(w,b):(t.__c=p=new ja(w,b),p.constructor=L,p.render=IC),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=b,p.__n=i,d=p.__d=!0,p.__h=[],p._sb=[]),C&&p.__s==null&&(p.__s=p.state),C&&L.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=An({},p.__s)),An(p.__s,L.getDerivedStateFromProps(w,p.__s))),h=p.props,m=p.state,p.__v=t,d)C&&L.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),C&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(C&&L.getDerivedStateFromProps==null&&w!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(w,b),!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(w,p.__s,b)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(p.props=w,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(O){O&&(O.__=t)}),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(w,p.__s,b),C&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,m,y)})}if(p.context=b,p.props=w,p.__P=e,p.__e=!1,P=De.__r,M=0,C){for(p.state=p.__s,p.__d=!1,P&&P(t),u=p.render(p.props,p.state,p.context),R=0;R<p._sb.length;R++)p.__h.push(p._sb[R]);p._sb=[]}else do p.__d=!1,P&&P(t),u=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++M<25);p.state=p.__s,p.getChildContext!=null&&(i=An(An({},i),p.getChildContext())),C&&!d&&p.getSnapshotBeforeUpdate!=null&&(y=p.getSnapshotBeforeUpdate(h,m)),I=u,u!=null&&u.type===$a&&u.key==null&&(I=Rh(u.props.children)),s=Eh(e,Ba(I)?I:[I],t,n,i,r,o,a,s,c,l),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),g&&(p.__E=p.__=null)}catch(O){if(t.__v=null,c||o!=null)if(O.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(B=o.length;B--;)dl(o[B]);else t.__e=n.__e,t.__k=n.__k;De.__e(O,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=OC(n.__e,t,n,i,r,o,a,c,l);return(u=De.diffed)&&u(t),128&t.__u?void 0:s}function Ch(e,t,n){for(var i=0;i<n.length;i++)ml(n[i],n[++i],n[++i]);De.__c&&De.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(o){o.call(r)})}catch(o){De.__e(o,r.__v)}})}function Rh(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Ba(e)?e.map(Rh):An({},e)}function OC(e,t,n,i,r,o,a,s,c){var l,u,p,d,h,m,y,g=n.props,w=t.props,C=t.type;if(C=="svg"?r="http://www.w3.org/2000/svg":C=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(l=0;l<o.length;l++)if((h=o[l])&&"setAttribute"in h==!!C&&(C?h.localName==C:h.nodeType==3)){e=h,o[l]=null;break}}if(e==null){if(C==null)return document.createTextNode(w);e=document.createElementNS(r,C,w.is&&w),s&&(De.__m&&De.__m(t,o),s=!1),o=null}if(C==null)g===w||s&&e.data==w||(e.data=w);else{if(o=o&&Ia.call(e.childNodes),g=n.props||Jr,!s&&o!=null)for(g={},l=0;l<e.attributes.length;l++)g[(h=e.attributes[l]).name]=h.value;for(l in g)if(h=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")p=h;else if(!(l in w)){if(l=="value"&&"defaultValue"in w||l=="checked"&&"defaultChecked"in w)continue;Ha(e,l,null,h,r)}}for(l in w)h=w[l],l=="children"?d=h:l=="dangerouslySetInnerHTML"?u=h:l=="value"?m=h:l=="checked"?y=h:s&&typeof h!="function"||g[l]===h||Ha(e,l,h,g[l],r);if(u)s||p&&(u.__html==p.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(p&&(e.innerHTML=""),Eh(t.type=="template"?e.content:e,Ba(d)?d:[d],t,n,i,C=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:n.__k&&or(n,0),s,c),o!=null)for(l=o.length;l--;)dl(o[l]);s||(l="value",C=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[l]||C=="progress"&&!m||C=="option"&&m!=g[l])&&Ha(e,l,m,g[l],r),l="checked",y!=null&&y!=e[l]&&Ha(e,l,y,g[l],r))}return e}function ml(e,t,n){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(r){De.__e(r,n)}}function Th(e,t,n){var i,r;if(De.unmount&&De.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||ml(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){De.__e(o,t)}i.base=i.__P=null}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Th(i[r],t,n||typeof e.type!="function");n||dl(e.__e),e.__c=e.__=e.__e=void 0}function IC(e,t,n){return this.constructor(e,n)}function Ph(e,t,n){var i,r,o,a;t==document&&(t=document.documentElement),De.__&&De.__(e,t),r=(i=!1)?null:t.__k,o=[],a=[],hl(t,e=t.__k=vh($a,null,[e]),r||Jr,Jr,t.namespaceURI,r?null:t.firstChild?Ia.call(t.childNodes):null,o,r?r.__e:t.firstChild,i,a),Ch(o,e,a)}Ia=yh.slice,De={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(s){e=s}throw e}},fh=0,ja.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=An({},this.state),typeof e=="function"&&(e=e(An({},n),this.props)),e&&An(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),bh(this))},ja.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),bh(this))},ja.prototype.render=$a,ki=[],hh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,mh=function(e,t){return e.__v.__b-t.__v.__b},Fa.__r=0,gh=/(PointerCapture)$|Capture$/i,ul=0,pl=Sh(!1),fl=Sh(!0);var Ah=function(e,t,n,i){var r;t[0]=0;for(var o=1;o<t.length;o++){var a=t[o++],s=t[o]?(t[0]|=a?1:2,n[t[o++]]):t[++o];a===3?i[0]=s:a===4?i[1]=Object.assign(i[1]||{},s):a===5?(i[1]=i[1]||{})[t[++o]]=s:a===6?i[1][t[++o]]+=s+"":a?(r=e.apply(s,Ah(e,s,n,["",null])),i.push(r),s[0]?t[0]|=2:(t[o-2]=0,t[o]=r)):i.push(s)}return i},kh=new Map;function BC(e){var t=kh.get(this);return t||(t=new Map,kh.set(this,t)),(t=Ah(this,t.get(e)||(t.set(e,t=function(n){for(var i,r,o=1,a="",s="",c=[0],l=function(d){o===1&&(d||(a=a.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?c.push(0,d,a):o===3&&(d||a)?(c.push(3,d,a),o=2):o===2&&a==="..."&&d?c.push(4,d,0):o===2&&a&&!d?c.push(5,0,!0,a):o>=5&&((a||!d&&o===5)&&(c.push(o,0,a,r),o=6),d&&(c.push(o,d,0,r),o=6)),a=""},u=0;u<n.length;u++){u&&(o===1&&l(),l(u));for(var p=0;p<n[u].length;p++)i=n[u][p],o===1?i==="<"?(l(),c=[c],o=3):a+=i:o===4?a==="--"&&i===">"?(o=1,a=""):a=i+a[0]:s?i===s?s="":a+=i:i==='"'||i==="'"?s=i:i===">"?(l(),o=1):o&&(i==="="?(o=5,r=a,a=""):i==="/"&&(o<5||n[u][p+1]===">")?(l(),o===3&&(c=c[0]),o=c,(c=c[0]).push(2,0,o),o=0):i===" "||i===" "||i===`
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const EE=Object.prototype.hasOwnProperty,nh=(t,e)=>EE.call(t,e),oc=t=>typeof t=="string",ac=t=>t!==null&&typeof t=="object";var rh=typeof global=="object"&&global&&global.Object===Object&&global,wE=typeof self=="object"&&self&&self.Object===Object&&self,Ut=rh||wE||Function("return this")(),on=Ut.Symbol,ih=Object.prototype,SE=ih.hasOwnProperty,CE=ih.toString,ia=on?on.toStringTag:void 0;function AE(t){var e=SE.call(t,ia),n=t[ia];try{t[ia]=void 0;var r=!0}catch{}var i=CE.call(t);return r&&(e?t[ia]=n:delete t[ia]),i}var OE=Object.prototype,TE=OE.toString;function NE(t){return TE.call(t)}var ME="[object Null]",DE="[object Undefined]",oh=on?on.toStringTag:void 0;function dn(t){return t==null?t===void 0?DE:ME:oh&&oh in Object(t)?AE(t):NE(t)}function It(t){return t!=null&&typeof t=="object"}var PE="[object Symbol]";function Pn(t){return typeof t=="symbol"||It(t)&&dn(t)==PE}var RE=NaN;function ah(t){return typeof t=="number"?t:Pn(t)?RE:+t}function Pt(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var We=Array.isArray,sh=on?on.prototype:void 0,lh=sh?sh.toString:void 0;function Rn(t){if(typeof t=="string")return t;if(We(t))return Pt(t,Rn)+"";if(Pn(t))return lh?lh.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ss(t,e){return function(n,r){var i;if(n===void 0&&r===void 0)return e;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=Rn(n),r=Rn(r)):(n=ah(n),r=ah(r)),i=t(n,r)}return i}}var LE=Ss(function(t,e){return t+e},0),IE=/\s/;function uh(t){for(var e=t.length;e--&&IE.test(t.charAt(e)););return e}var kE=/^\s+/;function ch(t){return t&&t.slice(0,uh(t)+1).replace(kE,"")}function Rt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var dh=NaN,BE=/^[-+]0x[0-9a-f]+$/i,jE=/^0b[01]+$/i,FE=/^0o[0-7]+$/i,$E=parseInt;function Vn(t){if(typeof t=="number")return t;if(Pn(t))return dh;if(Rt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Rt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=ch(t);var n=jE.test(t);return n||FE.test(t)?$E(t.slice(2),n?2:8):BE.test(t)?dh:+t}var HE=1/0,zE=17976931348623157e292;function Ur(t){if(!t)return t===0?t:0;if(t=Vn(t),t===HE||t===-1/0){var e=t<0?-1:1;return e*zE}return t===t?t:0}function Ke(t){var e=Ur(t),n=e%1;return e===e?n?e-n:e:0}var WE="Expected a function";function UE(t,e){if(typeof e!="function")throw new TypeError(WE);return t=Ke(t),function(){if(--t<1)return e.apply(this,arguments)}}function wn(t){return t}var VE="[object AsyncFunction]",XE="[object Function]",GE="[object GeneratorFunction]",YE="[object Proxy]";function lr(t){if(!Rt(t))return!1;var e=dn(t);return e==XE||e==GE||e==VE||e==YE}var Cs=Ut["__core-js_shared__"],fh=function(){var t=/[^.]+$/.exec(Cs&&Cs.keys&&Cs.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function KE(t){return!!fh&&fh in t}var qE=Function.prototype,ZE=qE.toString;function Li(t){if(t!=null){try{return ZE.call(t)}catch{}try{return t+""}catch{}}return""}var JE=/[\\^$.*+?()[\]{}|]/g,QE=/^\[object .+?Constructor\]$/,ew=Function.prototype,tw=Object.prototype,nw=ew.toString,rw=tw.hasOwnProperty,iw=RegExp("^"+nw.call(rw).replace(JE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ph(t){if(!Rt(t)||KE(t))return!1;var e=lr(t)?iw:QE;return e.test(Li(t))}function ow(t,e){return t==null?void 0:t[e]}function Ii(t,e){var n=ow(t,e);return ph(n)?n:void 0}var oa=Ii(Ut,"WeakMap"),As=oa&&new oa,hh=As?function(t,e){return As.set(t,e),t}:wn,gh=Object.create,so=function(){function t(){}return function(e){if(!Rt(e))return{};if(gh)return gh(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function aa(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=so(t.prototype),r=t.apply(n,e);return Rt(r)?r:n}}var aw=1;function sw(t,e,n){var r=e&aw,i=aa(t);function o(){var a=this&&this!==Ut&&this instanceof o?i:t;return a.apply(r?n:this,arguments)}return o}function Ln(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var lw=Math.max;function vh(t,e,n,r){for(var i=-1,o=t.length,a=n.length,s=-1,l=e.length,u=lw(o-a,0),c=Array(l+u),d=!r;++s<l;)c[s]=e[s];for(;++i<a;)(d||i<o)&&(c[n[i]]=t[i]);for(;u--;)c[s++]=t[i++];return c}var uw=Math.max;function mh(t,e,n,r){for(var i=-1,o=t.length,a=-1,s=n.length,l=-1,u=e.length,c=uw(o-s,0),d=Array(c+u),f=!r;++i<c;)d[i]=t[i];for(var h=i;++l<u;)d[h+l]=e[l];for(;++a<s;)(f||i<o)&&(d[h+n[a]]=t[i++]);return d}function cw(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}function Os(){}var dw=4294967295;function ot(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=dw,this.__views__=[]}ot.prototype=so(Os.prototype),ot.prototype.constructor=ot;function lo(){}var sc=As?function(t){return As.get(t)}:lo,uo={},fw=Object.prototype,pw=fw.hasOwnProperty;function Ts(t){for(var e=t.name+"",n=uo[e],r=pw.call(uo,e)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==t)return i.name}return e}function Xn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Xn.prototype=so(Os.prototype),Xn.prototype.constructor=Xn;function Sn(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function yh(t){if(t instanceof ot)return t.clone();var e=new Xn(t.__wrapped__,t.__chain__);return e.__actions__=Sn(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var hw=Object.prototype,gw=hw.hasOwnProperty;function O(t){if(It(t)&&!We(t)&&!(t instanceof ot)){if(t instanceof Xn)return t;if(gw.call(t,"__wrapped__"))return yh(t)}return new Xn(t)}O.prototype=Os.prototype,O.prototype.constructor=O;function lc(t){var e=Ts(t),n=O[e];if(typeof n!="function"||!(e in ot.prototype))return!1;if(t===n)return!0;var r=sc(n);return!!r&&t===r[0]}var vw=800,mw=16,yw=Date.now;function _h(t){var e=0,n=0;return function(){var r=yw(),i=mw-(r-n);if(n=r,i>0){if(++e>=vw)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var bh=_h(hh),_w=/\{\n\/\* \[wrapped with (.+)\] \*/,bw=/,? & /;function xw(t){var e=t.match(_w);return e?e[1].split(bw):[]}var Ew=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function ww(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Ew,`{
|
|
6
|
+
/* [wrapped with `+e+`] */
|
|
7
|
+
`)}function uc(t){return function(){return t}}var Ns=function(){try{var t=Ii(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Sw=Ns?function(t,e){return Ns(t,"toString",{configurable:!0,enumerable:!1,value:uc(e),writable:!0})}:wn,cc=_h(Sw);function Gn(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function Ms(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function xh(t){return t!==t}function Cw(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function co(t,e,n){return e===e?Cw(t,e,n):Ms(t,xh,n)}function Ds(t,e){var n=t==null?0:t.length;return!!n&&co(t,e,0)>-1}var Aw=1,Ow=2,Tw=8,Nw=16,Mw=32,Dw=64,Pw=128,Rw=256,Lw=512,Iw=[["ary",Pw],["bind",Aw],["bindKey",Ow],["curry",Tw],["curryRight",Nw],["flip",Lw],["partial",Mw],["partialRight",Dw],["rearg",Rw]];function kw(t,e){return Gn(Iw,function(n){var r="_."+n[0];e&n[1]&&!Ds(t,r)&&t.push(r)}),t.sort()}function Eh(t,e,n){var r=e+"";return cc(t,ww(r,kw(xw(r),n)))}var Bw=4,jw=8,wh=32,Sh=64;function Ch(t,e,n,r,i,o,a,s,l,u){var c=e&jw,d=c?a:void 0,f=c?void 0:a,h=c?o:void 0,v=c?void 0:o;e|=c?wh:Sh,e&=~(c?Sh:wh),e&Bw||(e&=-4);var g=[t,e,i,h,d,v,f,s,l,u],m=n.apply(void 0,g);return lc(t)&&bh(m,g),m.placeholder=r,Eh(m,t,e)}function fo(t){var e=t;return e.placeholder}var Fw=9007199254740991,$w=/^(?:0|[1-9]\d*)$/;function Vr(t,e){var n=typeof t;return e=e??Fw,!!e&&(n=="number"||n!="symbol"&&$w.test(t))&&t>-1&&t%1==0&&t<e}var Hw=Math.min;function zw(t,e){for(var n=t.length,r=Hw(e.length,n),i=Sn(t);r--;){var o=e[r];t[r]=Vr(o,n)?i[o]:void 0}return t}var Ah="__lodash_placeholder__";function ai(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];(a===e||a===Ah)&&(t[n]=Ah,o[i++]=n)}return o}var Ww=1,Uw=2,Vw=8,Xw=16,Gw=128,Yw=512;function Ps(t,e,n,r,i,o,a,s,l,u){var c=e&Gw,d=e&Ww,f=e&Uw,h=e&(Vw|Xw),v=e&Yw,g=f?void 0:aa(t);function m(){for(var y=arguments.length,x=Array(y),E=y;E--;)x[E]=arguments[E];if(h)var b=fo(m),T=cw(x,b);if(r&&(x=vh(x,r,i,h)),o&&(x=mh(x,o,a,h)),y-=T,h&&y<u){var A=ai(x,b);return Ch(t,e,Ps,m.placeholder,n,x,A,s,l,u-y)}var S=d?n:this,M=f?S[t]:t;return y=x.length,s?x=zw(x,s):v&&y>1&&x.reverse(),c&&l<y&&(x.length=l),this&&this!==Ut&&this instanceof m&&(M=g||aa(M)),M.apply(S,x)}return m}function Kw(t,e,n){var r=aa(t);function i(){for(var o=arguments.length,a=Array(o),s=o,l=fo(i);s--;)a[s]=arguments[s];var u=o<3&&a[0]!==l&&a[o-1]!==l?[]:ai(a,l);if(o-=u.length,o<n)return Ch(t,e,Ps,i.placeholder,void 0,a,u,void 0,void 0,n-o);var c=this&&this!==Ut&&this instanceof i?r:t;return Ln(c,this,a)}return i}var qw=1;function Zw(t,e,n,r){var i=e&qw,o=aa(t);function a(){for(var s=-1,l=arguments.length,u=-1,c=r.length,d=Array(c+l),f=this&&this!==Ut&&this instanceof a?o:t;++u<c;)d[u]=r[u];for(;l--;)d[u++]=arguments[++s];return Ln(f,i?n:this,d)}return a}var Oh="__lodash_placeholder__",dc=1,Jw=2,Qw=4,Th=8,sa=128,Nh=256,eS=Math.min;function tS(t,e){var n=t[1],r=e[1],i=n|r,o=i<(dc|Jw|sa),a=r==sa&&n==Th||r==sa&&n==Nh&&t[7].length<=e[8]||r==(sa|Nh)&&e[7].length<=e[8]&&n==Th;if(!(o||a))return t;r&dc&&(t[2]=e[2],i|=n&dc?0:Qw);var s=e[3];if(s){var l=t[3];t[3]=l?vh(l,s,e[4]):s,t[4]=l?ai(t[3],Oh):e[4]}return s=e[5],s&&(l=t[5],t[5]=l?mh(l,s,e[6]):s,t[6]=l?ai(t[5],Oh):e[6]),s=e[7],s&&(t[7]=s),r&sa&&(t[8]=t[8]==null?e[8]:eS(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}var nS="Expected a function",Mh=1,rS=2,Dh=8,Ph=16,Rh=32,iS=64,Lh=Math.max;function Xr(t,e,n,r,i,o,a,s){var l=e&rS;if(!l&&typeof t!="function")throw new TypeError(nS);var u=r?r.length:0;if(u||(e&=-97,r=i=void 0),a=a===void 0?a:Lh(Ke(a),0),s=s===void 0?s:Ke(s),u-=i?i.length:0,e&iS){var c=r,d=i;r=i=void 0}var f=l?void 0:sc(t),h=[t,e,n,r,i,c,d,o,a,s];if(f&&tS(h,f),t=h[0],e=h[1],n=h[2],r=h[3],i=h[4],s=h[9]=h[9]===void 0?l?0:t.length:Lh(h[9]-u,0),!s&&e&(Dh|Ph)&&(e&=-25),!e||e==Mh)var v=sw(t,e,n);else e==Dh||e==Ph?v=Kw(t,e,s):(e==Rh||e==(Mh|Rh))&&!i.length?v=Zw(t,e,n,r):v=Ps.apply(void 0,h);var g=f?hh:bh;return Eh(g(v,h),t,e)}var oS=128;function Ih(t,e,n){return e=n?void 0:e,e=t&&e==null?t.length:e,Xr(t,oS,void 0,void 0,void 0,void 0,e)}function Gr(t,e,n){e=="__proto__"&&Ns?Ns(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ur(t,e){return t===e||t!==t&&e!==e}var aS=Object.prototype,sS=aS.hasOwnProperty;function la(t,e,n){var r=t[e];(!(sS.call(t,e)&&ur(r,n))||n===void 0&&!(e in t))&&Gr(t,e,n)}function Nr(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=r?r(n[s],t[s],s,n,t):void 0;l===void 0&&(l=t[s]),i?Gr(n,s,l):la(n,s,l)}return n}var kh=Math.max;function Bh(t,e,n){return e=kh(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=kh(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),Ln(t,this,s)}}function Je(t,e){return cc(Bh(t,e,wn),t+"")}var lS=9007199254740991;function Rs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=lS}function Cn(t){return t!=null&&Rs(t.length)&&!lr(t)}function fn(t,e,n){if(!Rt(n))return!1;var r=typeof e;return(r=="number"?Cn(n)&&Vr(e,n.length):r=="string"&&e in n)?ur(n[e],t):!1}function po(t){return Je(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&fn(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=n[r];s&&t(e,s,r,o)}return e})}var uS=Object.prototype;function ua(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||uS;return t===n}function fc(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var cS="[object Arguments]";function jh(t){return It(t)&&dn(t)==cS}var Fh=Object.prototype,dS=Fh.hasOwnProperty,fS=Fh.propertyIsEnumerable,ki=jh(function(){return arguments}())?jh:function(t){return It(t)&&dS.call(t,"callee")&&!fS.call(t,"callee")};function pc(){return!1}var $h=typeof pt=="object"&&pt&&!pt.nodeType&&pt,Hh=$h&&typeof module=="object"&&module&&!module.nodeType&&module,pS=Hh&&Hh.exports===$h,zh=pS?Ut.Buffer:void 0,hS=zh?zh.isBuffer:void 0,si=hS||pc,gS="[object Arguments]",vS="[object Array]",mS="[object Boolean]",yS="[object Date]",_S="[object Error]",bS="[object Function]",xS="[object Map]",ES="[object Number]",wS="[object Object]",SS="[object RegExp]",CS="[object Set]",AS="[object String]",OS="[object WeakMap]",TS="[object ArrayBuffer]",NS="[object DataView]",MS="[object Float32Array]",DS="[object Float64Array]",PS="[object Int8Array]",RS="[object Int16Array]",LS="[object Int32Array]",IS="[object Uint8Array]",kS="[object Uint8ClampedArray]",BS="[object Uint16Array]",jS="[object Uint32Array]",Nt={};Nt[MS]=Nt[DS]=Nt[PS]=Nt[RS]=Nt[LS]=Nt[IS]=Nt[kS]=Nt[BS]=Nt[jS]=!0,Nt[gS]=Nt[vS]=Nt[TS]=Nt[mS]=Nt[NS]=Nt[yS]=Nt[_S]=Nt[bS]=Nt[xS]=Nt[ES]=Nt[wS]=Nt[SS]=Nt[CS]=Nt[AS]=Nt[OS]=!1;function FS(t){return It(t)&&Rs(t.length)&&!!Nt[dn(t)]}function In(t){return function(e){return t(e)}}var Wh=typeof pt=="object"&&pt&&!pt.nodeType&&pt,ca=Wh&&typeof module=="object"&&module&&!module.nodeType&&module,$S=ca&&ca.exports===Wh,hc=$S&&rh.process,Yn=function(){try{var t=ca&&ca.require&&ca.require("util").types;return t||hc&&hc.binding&&hc.binding("util")}catch{}}(),Uh=Yn&&Yn.isTypedArray,ho=Uh?In(Uh):FS,HS=Object.prototype,zS=HS.hasOwnProperty;function Vh(t,e){var n=We(t),r=!n&&ki(t),i=!n&&!r&&si(t),o=!n&&!r&&!i&&ho(t),a=n||r||i||o,s=a?fc(t.length,String):[],l=s.length;for(var u in t)(e||zS.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Vr(u,l)))&&s.push(u);return s}function Xh(t,e){return function(n){return t(e(n))}}var WS=Xh(Object.keys,Object),US=Object.prototype,VS=US.hasOwnProperty;function gc(t){if(!ua(t))return WS(t);var e=[];for(var n in Object(t))VS.call(t,n)&&n!="constructor"&&e.push(n);return e}function Vt(t){return Cn(t)?Vh(t):gc(t)}var XS=Object.prototype,GS=XS.hasOwnProperty,ut=po(function(t,e){if(ua(e)||Cn(e)){Nr(e,Vt(e),t);return}for(var n in e)GS.call(e,n)&&la(t,n,e[n])});function YS(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var KS=Object.prototype,qS=KS.hasOwnProperty;function ZS(t){if(!Rt(t))return YS(t);var e=ua(t),n=[];for(var r in t)r=="constructor"&&(e||!qS.call(t,r))||n.push(r);return n}function An(t){return Cn(t)?Vh(t,!0):ZS(t)}var JS=po(function(t,e){Nr(e,An(e),t)}),vc=po(function(t,e,n,r){Nr(e,An(e),t,r)}),QS=po(function(t,e,n,r){Nr(e,Vt(e),t,r)}),eC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tC=/^\w*$/;function mc(t,e){if(We(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Pn(t)?!0:tC.test(t)||!eC.test(t)||e!=null&&t in Object(e)}var da=Ii(Object,"create");function nC(){this.__data__=da?da(null):{},this.size=0}function rC(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var iC="__lodash_hash_undefined__",oC=Object.prototype,aC=oC.hasOwnProperty;function sC(t){var e=this.__data__;if(da){var n=e[t];return n===iC?void 0:n}return aC.call(e,t)?e[t]:void 0}var lC=Object.prototype,uC=lC.hasOwnProperty;function cC(t){var e=this.__data__;return da?e[t]!==void 0:uC.call(e,t)}var dC="__lodash_hash_undefined__";function fC(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=da&&e===void 0?dC:e,this}function Bi(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Bi.prototype.clear=nC,Bi.prototype.delete=rC,Bi.prototype.get=sC,Bi.prototype.has=cC,Bi.prototype.set=fC;function pC(){this.__data__=[],this.size=0}function Ls(t,e){for(var n=t.length;n--;)if(ur(t[n][0],e))return n;return-1}var hC=Array.prototype,gC=hC.splice;function vC(t){var e=this.__data__,n=Ls(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():gC.call(e,n,1),--this.size,!0}function mC(t){var e=this.__data__,n=Ls(e,t);return n<0?void 0:e[n][1]}function yC(t){return Ls(this.__data__,t)>-1}function _C(t,e){var n=this.__data__,r=Ls(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Yr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Yr.prototype.clear=pC,Yr.prototype.delete=vC,Yr.prototype.get=mC,Yr.prototype.has=yC,Yr.prototype.set=_C;var fa=Ii(Ut,"Map");function bC(){this.size=0,this.__data__={hash:new Bi,map:new(fa||Yr),string:new Bi}}function xC(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Is(t,e){var n=t.__data__;return xC(e)?n[typeof e=="string"?"string":"hash"]:n.map}function EC(t){var e=Is(this,t).delete(t);return this.size-=e?1:0,e}function wC(t){return Is(this,t).get(t)}function SC(t){return Is(this,t).has(t)}function CC(t,e){var n=Is(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Kr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Kr.prototype.clear=bC,Kr.prototype.delete=EC,Kr.prototype.get=wC,Kr.prototype.has=SC,Kr.prototype.set=CC;var AC="Expected a function";function ks(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(AC);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ks.Cache||Kr),n}ks.Cache=Kr;var OC=500;function TC(t){var e=ks(t,function(r){return n.size===OC&&n.clear(),r}),n=e.cache;return e}var NC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,MC=/\\(\\)?/g,Gh=TC(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(NC,function(n,r,i,o){e.push(i?o.replace(MC,"$1"):r||n)}),e});function _t(t){return t==null?"":Rn(t)}function li(t,e){return We(t)?t:mc(t,e)?[t]:Gh(_t(t))}function Mr(t){if(typeof t=="string"||Pn(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ji(t,e){e=li(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Mr(e[n++])];return n&&n==r?t:void 0}function ui(t,e,n){var r=t==null?void 0:ji(t,e);return r===void 0?n:r}function yc(t,e){for(var n=-1,r=e.length,i=Array(r),o=t==null;++n<r;)i[n]=o?void 0:ui(t,e[n]);return i}function ci(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Yh=on?on.isConcatSpreadable:void 0;function DC(t){return We(t)||ki(t)||!!(Yh&&t&&t[Yh])}function Yt(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=DC),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?Yt(s,e-1,n,r,i):ci(i,s):r||(i[i.length]=s)}return i}function Kh(t){var e=t==null?0:t.length;return e?Yt(t,1):[]}function qr(t){return cc(Bh(t,void 0,Kh),t+"")}var PC=qr(yc),Bs=Xh(Object.getPrototypeOf,Object),RC="[object Object]",LC=Function.prototype,IC=Object.prototype,qh=LC.toString,kC=IC.hasOwnProperty,BC=qh.call(Object);function pa(t){if(!It(t)||dn(t)!=RC)return!1;var e=Bs(t);if(e===null)return!0;var n=kC.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&qh.call(n)==BC}var jC="[object DOMException]",FC="[object Error]";function _c(t){if(!It(t))return!1;var e=dn(t);return e==FC||e==jC||typeof t.message=="string"&&typeof t.name=="string"&&!pa(t)}var Zh=Je(function(t,e){try{return Ln(t,void 0,e)}catch(n){return _c(n)?n:new Error(n)}}),$C="Expected a function";function Jh(t,e){var n;if(typeof e!="function")throw new TypeError($C);return t=Ke(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var HC=1,zC=32,js=Je(function(t,e,n){var r=HC;if(n.length){var i=ai(n,fo(js));r|=zC}return Xr(t,r,e,n,i)});js.placeholder={};var WC=qr(function(t,e){return Gn(e,function(n){n=Mr(n),Gr(t,n,js(t[n],t))}),t}),UC=1,VC=2,XC=32,bc=Je(function(t,e,n){var r=UC|VC;if(n.length){var i=ai(n,fo(bc));r|=XC}return Xr(e,r,t,n,i)});bc.placeholder={};function Kn(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}function di(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:Kn(t,e,n)}var GC="\\ud800-\\udfff",YC="\\u0300-\\u036f",KC="\\ufe20-\\ufe2f",qC="\\u20d0-\\u20ff",ZC=YC+KC+qC,JC="\\ufe0e\\ufe0f",QC="\\u200d",eA=RegExp("["+QC+GC+ZC+JC+"]");function go(t){return eA.test(t)}function tA(t){return t.split("")}var Qh="\\ud800-\\udfff",nA="\\u0300-\\u036f",rA="\\ufe20-\\ufe2f",iA="\\u20d0-\\u20ff",oA=nA+rA+iA,aA="\\ufe0e\\ufe0f",sA="["+Qh+"]",xc="["+oA+"]",Ec="\\ud83c[\\udffb-\\udfff]",lA="(?:"+xc+"|"+Ec+")",eg="[^"+Qh+"]",tg="(?:\\ud83c[\\udde6-\\uddff]){2}",ng="[\\ud800-\\udbff][\\udc00-\\udfff]",uA="\\u200d",rg=lA+"?",ig="["+aA+"]?",cA="(?:"+uA+"(?:"+[eg,tg,ng].join("|")+")"+ig+rg+")*",dA=ig+rg+cA,fA="(?:"+[eg+xc+"?",xc,tg,ng,sA].join("|")+")",pA=RegExp(Ec+"(?="+Ec+")|"+fA+dA,"g");function hA(t){return t.match(pA)||[]}function cr(t){return go(t)?hA(t):tA(t)}function og(t){return function(e){e=_t(e);var n=go(e)?cr(e):void 0,r=n?n[0]:e.charAt(0),i=n?di(n,1).join(""):e.slice(1);return r[t]()+i}}var wc=og("toUpperCase");function ag(t){return wc(_t(t).toLowerCase())}function Sc(t,e,n,r){var i=-1,o=t==null?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Cc(t){return function(e){return t==null?void 0:t[e]}}var gA={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},vA=Cc(gA),mA=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yA="\\u0300-\\u036f",_A="\\ufe20-\\ufe2f",bA="\\u20d0-\\u20ff",xA=yA+_A+bA,EA="["+xA+"]",wA=RegExp(EA,"g");function sg(t){return t=_t(t),t&&t.replace(mA,vA).replace(wA,"")}var SA=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function CA(t){return t.match(SA)||[]}var AA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function OA(t){return AA.test(t)}var lg="\\ud800-\\udfff",TA="\\u0300-\\u036f",NA="\\ufe20-\\ufe2f",MA="\\u20d0-\\u20ff",DA=TA+NA+MA,ug="\\u2700-\\u27bf",cg="a-z\\xdf-\\xf6\\xf8-\\xff",PA="\\xac\\xb1\\xd7\\xf7",RA="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",LA="\\u2000-\\u206f",IA=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dg="A-Z\\xc0-\\xd6\\xd8-\\xde",kA="\\ufe0e\\ufe0f",fg=PA+RA+LA+IA,pg="['’]",hg="["+fg+"]",BA="["+DA+"]",gg="\\d+",jA="["+ug+"]",vg="["+cg+"]",mg="[^"+lg+fg+gg+ug+cg+dg+"]",FA="\\ud83c[\\udffb-\\udfff]",$A="(?:"+BA+"|"+FA+")",HA="[^"+lg+"]",yg="(?:\\ud83c[\\udde6-\\uddff]){2}",_g="[\\ud800-\\udbff][\\udc00-\\udfff]",vo="["+dg+"]",zA="\\u200d",bg="(?:"+vg+"|"+mg+")",WA="(?:"+vo+"|"+mg+")",xg="(?:"+pg+"(?:d|ll|m|re|s|t|ve))?",Eg="(?:"+pg+"(?:D|LL|M|RE|S|T|VE))?",wg=$A+"?",Sg="["+kA+"]?",UA="(?:"+zA+"(?:"+[HA,yg,_g].join("|")+")"+Sg+wg+")*",VA="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",XA="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",GA=Sg+wg+UA,YA="(?:"+[jA,yg,_g].join("|")+")"+GA,KA=RegExp([vo+"?"+vg+"+"+xg+"(?="+[hg,vo,"$"].join("|")+")",WA+"+"+Eg+"(?="+[hg,vo+bg,"$"].join("|")+")",vo+"?"+bg+"+"+xg,vo+"+"+Eg,XA,VA,gg,YA].join("|"),"g");function qA(t){return t.match(KA)||[]}function Cg(t,e,n){return t=_t(t),e=n?void 0:e,e===void 0?OA(t)?qA(t):CA(t):t.match(e)||[]}var ZA="['’]",JA=RegExp(ZA,"g");function mo(t){return function(e){return Sc(Cg(sg(e).replace(JA,"")),t,"")}}var QA=mo(function(t,e,n){return e=e.toLowerCase(),t+(n?ag(e):e)});function eO(){if(!arguments.length)return[];var t=arguments[0];return We(t)?t:[t]}var tO=Ut.isFinite,nO=Math.min;function Ac(t){var e=Math[t];return function(n,r){if(n=Vn(n),r=r==null?0:nO(Ke(r),292),r&&tO(n)){var i=(_t(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(_t(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var rO=Ac("ceil");function Ag(t){var e=O(t);return e.__chain__=!0,e}var iO=Math.ceil,oO=Math.max;function aO(t,e,n){(n?fn(t,e,n):e===void 0)?e=1:e=oO(Ke(e),0);var r=t==null?0:t.length;if(!r||e<1)return[];for(var i=0,o=0,a=Array(iO(r/e));i<r;)a[o++]=Kn(t,i,i+=e);return a}function Fi(t,e,n){return t===t&&(n!==void 0&&(t=t<=n?t:n),e!==void 0&&(t=t>=e?t:e)),t}function sO(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=Vn(n),n=n===n?n:0),e!==void 0&&(e=Vn(e),e=e===e?e:0),Fi(Vn(t),e,n)}function lO(){this.__data__=new Yr,this.size=0}function uO(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function cO(t){return this.__data__.get(t)}function dO(t){return this.__data__.has(t)}var fO=200;function pO(t,e){var n=this.__data__;if(n instanceof Yr){var r=n.__data__;if(!fa||r.length<fO-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Kr(r)}return n.set(t,e),this.size=n.size,this}function dr(t){var e=this.__data__=new Yr(t);this.size=e.size}dr.prototype.clear=lO,dr.prototype.delete=uO,dr.prototype.get=cO,dr.prototype.has=dO,dr.prototype.set=pO;function Og(t,e){return t&&Nr(e,Vt(e),t)}function hO(t,e){return t&&Nr(e,An(e),t)}var Tg=typeof pt=="object"&&pt&&!pt.nodeType&&pt,Ng=Tg&&typeof module=="object"&&module&&!module.nodeType&&module,gO=Ng&&Ng.exports===Tg,Mg=gO?Ut.Buffer:void 0,Dg=Mg?Mg.allocUnsafe:void 0;function Pg(t,e){if(e)return t.slice();var n=t.length,r=Dg?Dg(n):new t.constructor(n);return t.copy(r),r}function fi(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Oc(){return[]}var vO=Object.prototype,mO=vO.propertyIsEnumerable,Rg=Object.getOwnPropertySymbols,Tc=Rg?function(t){return t==null?[]:(t=Object(t),fi(Rg(t),function(e){return mO.call(t,e)}))}:Oc;function yO(t,e){return Nr(t,Tc(t),e)}var _O=Object.getOwnPropertySymbols,Lg=_O?function(t){for(var e=[];t;)ci(e,Tc(t)),t=Bs(t);return e}:Oc;function bO(t,e){return Nr(t,Lg(t),e)}function Ig(t,e,n){var r=e(t);return We(t)?r:ci(r,n(t))}function Nc(t){return Ig(t,Vt,Tc)}function Mc(t){return Ig(t,An,Lg)}var Dc=Ii(Ut,"DataView"),Pc=Ii(Ut,"Promise"),yo=Ii(Ut,"Set"),kg="[object Map]",xO="[object Object]",Bg="[object Promise]",jg="[object Set]",Fg="[object WeakMap]",$g="[object DataView]",EO=Li(Dc),wO=Li(fa),SO=Li(Pc),CO=Li(yo),AO=Li(oa),an=dn;(Dc&&an(new Dc(new ArrayBuffer(1)))!=$g||fa&&an(new fa)!=kg||Pc&&an(Pc.resolve())!=Bg||yo&&an(new yo)!=jg||oa&&an(new oa)!=Fg)&&(an=function(t){var e=dn(t),n=e==xO?t.constructor:void 0,r=n?Li(n):"";if(r)switch(r){case EO:return $g;case wO:return kg;case SO:return Bg;case CO:return jg;case AO:return Fg}return e});var OO=Object.prototype,TO=OO.hasOwnProperty;function NO(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&TO.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Fs=Ut.Uint8Array;function Rc(t){var e=new t.constructor(t.byteLength);return new Fs(e).set(new Fs(t)),e}function MO(t,e){var n=e?Rc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var DO=/\w*$/;function PO(t){var e=new t.constructor(t.source,DO.exec(t));return e.lastIndex=t.lastIndex,e}var Hg=on?on.prototype:void 0,zg=Hg?Hg.valueOf:void 0;function RO(t){return zg?Object(zg.call(t)):{}}function Wg(t,e){var n=e?Rc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var LO="[object Boolean]",IO="[object Date]",kO="[object Map]",BO="[object Number]",jO="[object RegExp]",FO="[object Set]",$O="[object String]",HO="[object Symbol]",zO="[object ArrayBuffer]",WO="[object DataView]",UO="[object Float32Array]",VO="[object Float64Array]",XO="[object Int8Array]",GO="[object Int16Array]",YO="[object Int32Array]",KO="[object Uint8Array]",qO="[object Uint8ClampedArray]",ZO="[object Uint16Array]",JO="[object Uint32Array]";function QO(t,e,n){var r=t.constructor;switch(e){case zO:return Rc(t);case LO:case IO:return new r(+t);case WO:return MO(t,n);case UO:case VO:case XO:case GO:case YO:case KO:case qO:case ZO:case JO:return Wg(t,n);case kO:return new r;case BO:case $O:return new r(t);case jO:return PO(t);case FO:return new r;case HO:return RO(t)}}function Ug(t){return typeof t.constructor=="function"&&!ua(t)?so(Bs(t)):{}}var e1="[object Map]";function t1(t){return It(t)&&an(t)==e1}var Vg=Yn&&Yn.isMap,Xg=Vg?In(Vg):t1,n1="[object Set]";function r1(t){return It(t)&&an(t)==n1}var Gg=Yn&&Yn.isSet,Yg=Gg?In(Gg):r1,i1=1,o1=2,a1=4,Kg="[object Arguments]",s1="[object Array]",l1="[object Boolean]",u1="[object Date]",c1="[object Error]",qg="[object Function]",d1="[object GeneratorFunction]",f1="[object Map]",p1="[object Number]",Zg="[object Object]",h1="[object RegExp]",g1="[object Set]",v1="[object String]",m1="[object Symbol]",y1="[object WeakMap]",_1="[object ArrayBuffer]",b1="[object DataView]",x1="[object Float32Array]",E1="[object Float64Array]",w1="[object Int8Array]",S1="[object Int16Array]",C1="[object Int32Array]",A1="[object Uint8Array]",O1="[object Uint8ClampedArray]",T1="[object Uint16Array]",N1="[object Uint32Array]",At={};At[Kg]=At[s1]=At[_1]=At[b1]=At[l1]=At[u1]=At[x1]=At[E1]=At[w1]=At[S1]=At[C1]=At[f1]=At[p1]=At[Zg]=At[h1]=At[g1]=At[v1]=At[m1]=At[A1]=At[O1]=At[T1]=At[N1]=!0,At[c1]=At[qg]=At[y1]=!1;function qn(t,e,n,r,i,o){var a,s=e&i1,l=e&o1,u=e&a1;if(n&&(a=i?n(t,r,i,o):n(t)),a!==void 0)return a;if(!Rt(t))return t;var c=We(t);if(c){if(a=NO(t),!s)return Sn(t,a)}else{var d=an(t),f=d==qg||d==d1;if(si(t))return Pg(t,s);if(d==Zg||d==Kg||f&&!i){if(a=l||f?{}:Ug(t),!s)return l?bO(t,hO(a,t)):yO(t,Og(a,t))}else{if(!At[d])return i?t:{};a=QO(t,d,s)}}o||(o=new dr);var h=o.get(t);if(h)return h;o.set(t,a),Yg(t)?t.forEach(function(m){a.add(qn(m,e,n,m,t,o))}):Xg(t)&&t.forEach(function(m,y){a.set(y,qn(m,e,n,y,t,o))});var v=u?l?Mc:Nc:l?An:Vt,g=c?void 0:v(t);return Gn(g||t,function(m,y){g&&(y=m,m=t[y]),la(a,y,qn(m,e,n,y,t,o))}),a}var M1=4;function D1(t){return qn(t,M1)}var P1=1,R1=4;function Pe(t){return qn(t,P1|R1)}var L1=1,I1=4;function k1(t,e){return e=typeof e=="function"?e:void 0,qn(t,L1|I1,e)}var B1=4;function j1(t,e){return e=typeof e=="function"?e:void 0,qn(t,B1,e)}function F1(){return new Xn(this.value(),this.__chain__)}function $1(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i}function H1(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return ci(We(n)?Sn(n):[n],Yt(e,1))}var z1="__lodash_hash_undefined__";function W1(t){return this.__data__.set(t,z1),this}function U1(t){return this.__data__.has(t)}function $i(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Kr;++e<n;)this.add(t[e])}$i.prototype.add=$i.prototype.push=W1,$i.prototype.has=U1;function Lc(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function ha(t,e){return t.has(e)}var V1=1,X1=2;function Jg(t,e,n,r,i,o){var a=n&V1,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var d=-1,f=!0,h=n&X1?new $i:void 0;for(o.set(t,e),o.set(e,t);++d<s;){var v=t[d],g=e[d];if(r)var m=a?r(g,v,d,e,t,o):r(v,g,d,t,e,o);if(m!==void 0){if(m)continue;f=!1;break}if(h){if(!Lc(e,function(y,x){if(!ha(h,x)&&(v===y||i(v,y,n,r,o)))return h.push(x)})){f=!1;break}}else if(!(v===g||i(v,g,n,r,o))){f=!1;break}}return o.delete(t),o.delete(e),f}function Ic(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function $s(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var G1=1,Y1=2,K1="[object Boolean]",q1="[object Date]",Z1="[object Error]",J1="[object Map]",Q1="[object Number]",eT="[object RegExp]",tT="[object Set]",nT="[object String]",rT="[object Symbol]",iT="[object ArrayBuffer]",oT="[object DataView]",Qg=on?on.prototype:void 0,kc=Qg?Qg.valueOf:void 0;function aT(t,e,n,r,i,o,a){switch(n){case oT:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case iT:return!(t.byteLength!=e.byteLength||!o(new Fs(t),new Fs(e)));case K1:case q1:case Q1:return ur(+t,+e);case Z1:return t.name==e.name&&t.message==e.message;case eT:case nT:return t==e+"";case J1:var s=Ic;case tT:var l=r&G1;if(s||(s=$s),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;r|=Y1,a.set(t,e);var c=Jg(s(t),s(e),r,i,o,a);return a.delete(t),c;case rT:if(kc)return kc.call(t)==kc.call(e)}return!1}var sT=1,lT=Object.prototype,uT=lT.hasOwnProperty;function cT(t,e,n,r,i,o){var a=n&sT,s=Nc(t),l=s.length,u=Nc(e),c=u.length;if(l!=c&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in e:uT.call(e,f)))return!1}var h=o.get(t),v=o.get(e);if(h&&v)return h==e&&v==t;var g=!0;o.set(t,e),o.set(e,t);for(var m=a;++d<l;){f=s[d];var y=t[f],x=e[f];if(r)var E=a?r(x,y,f,e,t,o):r(y,x,f,t,e,o);if(!(E===void 0?y===x||i(y,x,n,r,o):E)){g=!1;break}m||(m=f=="constructor")}if(g&&!m){var b=t.constructor,T=e.constructor;b!=T&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof T=="function"&&T instanceof T)&&(g=!1)}return o.delete(t),o.delete(e),g}var dT=1,ev="[object Arguments]",tv="[object Array]",Hs="[object Object]",fT=Object.prototype,nv=fT.hasOwnProperty;function pT(t,e,n,r,i,o){var a=We(t),s=We(e),l=a?tv:an(t),u=s?tv:an(e);l=l==ev?Hs:l,u=u==ev?Hs:u;var c=l==Hs,d=u==Hs,f=l==u;if(f&&si(t)){if(!si(e))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new dr),a||ho(t)?Jg(t,e,n,r,i,o):aT(t,e,l,n,r,i,o);if(!(n&dT)){var h=c&&nv.call(t,"__wrapped__"),v=d&&nv.call(e,"__wrapped__");if(h||v){var g=h?t.value():t,m=v?e.value():e;return o||(o=new dr),i(g,m,n,r,o)}}return f?(o||(o=new dr),cT(t,e,n,r,i,o)):!1}function ga(t,e,n,r,i){return t===e?!0:t==null||e==null||!It(t)&&!It(e)?t!==t&&e!==e:pT(t,e,n,r,ga,i)}var hT=1,gT=2;function Bc(t,e,n,r){var i=n.length,o=i,a=!r;if(t==null)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=n[i];var l=s[0],u=t[l],c=s[1];if(a&&s[2]){if(u===void 0&&!(l in t))return!1}else{var d=new dr;if(r)var f=r(u,c,l,t,e,d);if(!(f===void 0?ga(c,u,hT|gT,r,d):f))return!1}}return!0}function rv(t){return t===t&&!Rt(t)}function jc(t){for(var e=Vt(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,rv(i)]}return e}function iv(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function ov(t){var e=jc(t);return e.length==1&&e[0][2]?iv(e[0][0],e[0][1]):function(n){return n===t||Bc(n,t,e)}}function vT(t,e){return t!=null&&e in Object(t)}function av(t,e,n){e=li(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Mr(e[r]);if(!(o=t!=null&&n(t,a)))break;t=t[a]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&Rs(i)&&Vr(a,i)&&(We(t)||ki(t)))}function Fc(t,e){return t!=null&&av(t,e,vT)}var mT=1,yT=2;function sv(t,e){return mc(t)&&rv(e)?iv(Mr(t),e):function(n){var r=ui(n,t);return r===void 0&&r===e?Fc(n,t):ga(e,r,mT|yT)}}function $c(t){return function(e){return e==null?void 0:e[t]}}function _T(t){return function(e){return ji(e,t)}}function lv(t){return mc(t)?$c(Mr(t)):_T(t)}function Ue(t){return typeof t=="function"?t:t==null?wn:typeof t=="object"?We(t)?sv(t[0],t[1]):ov(t):lv(t)}var bT="Expected a function";function xT(t){var e=t==null?0:t.length,n=Ue;return t=e?Pt(t,function(r){if(typeof r[1]!="function")throw new TypeError(bT);return[n(r[0]),r[1]]}):[],Je(function(r){for(var i=-1;++i<e;){var o=t[i];if(Ln(o[0],this,r))return Ln(o[1],this,r)}})}function uv(t,e,n){var r=n.length;if(t==null)return!r;for(t=Object(t);r--;){var i=n[r],o=e[i],a=t[i];if(a===void 0&&!(i in t)||!o(a))return!1}return!0}function ET(t){var e=Vt(t);return function(n){return uv(n,t,e)}}var wT=1;function ST(t){return ET(qn(t,wT))}function CT(t,e){return e==null||uv(t,e,Vt(e))}function AT(t,e,n,r){for(var i=-1,o=t==null?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function cv(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var Hc=cv();function Dr(t,e){return t&&Hc(t,e,Vt)}function dv(t,e){return function(n,r){if(n==null)return n;if(!Cn(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var pi=dv(Dr);function OT(t,e,n,r){return pi(t,function(i,o,a){e(r,i,n(i),a)}),r}function zs(t,e){return function(n,r){var i=We(n)?AT:OT,o=e?e():{};return i(n,t,Ue(r),o)}}var TT=Object.prototype,NT=TT.hasOwnProperty,MT=zs(function(t,e,n){NT.call(t,n)?++t[n]:Gr(t,n,1)});function DT(t,e){var n=so(t);return e==null?n:Og(n,e)}var PT=8;function zc(t,e,n){e=n?void 0:e;var r=Xr(t,PT,void 0,void 0,void 0,void 0,void 0,e);return r.placeholder=zc.placeholder,r}zc.placeholder={};var RT=16;function Wc(t,e,n){e=n?void 0:e;var r=Xr(t,RT,void 0,void 0,void 0,void 0,void 0,e);return r.placeholder=Wc.placeholder,r}Wc.placeholder={};var Ws=function(){return Ut.Date.now()},LT="Expected a function",IT=Math.max,kT=Math.min;function Us(t,e,n){var r,i,o,a,s,l,u=0,c=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(LT);e=Vn(e)||0,Rt(n)&&(c=!!n.leading,d="maxWait"in n,o=d?IT(Vn(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f);function h(A){var S=r,M=i;return r=i=void 0,u=A,a=t.apply(M,S),a}function v(A){return u=A,s=setTimeout(y,e),c?h(A):a}function g(A){var S=A-l,M=A-u,C=e-S;return d?kT(C,o-M):C}function m(A){var S=A-l,M=A-u;return l===void 0||S>=e||S<0||d&&M>=o}function y(){var A=Ws();if(m(A))return x(A);s=setTimeout(y,g(A))}function x(A){return s=void 0,f&&r?h(A):(r=i=void 0,a)}function E(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function b(){return s===void 0?a:x(Ws())}function T(){var A=Ws(),S=m(A);if(r=arguments,i=this,l=A,S){if(s===void 0)return v(l);if(d)return clearTimeout(s),s=setTimeout(y,e),h(l)}return s===void 0&&(s=setTimeout(y,e)),a}return T.cancel=E,T.flush=b,T}function BT(t,e){return t==null||t!==t?e:t}var fv=Object.prototype,jT=fv.hasOwnProperty,FT=Je(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&fn(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],a=An(o),s=-1,l=a.length;++s<l;){var u=a[s],c=t[u];(c===void 0||ur(c,fv[u])&&!jT.call(t,u))&&(t[u]=o[u])}return t});function Uc(t,e,n){(n!==void 0&&!ur(t[e],n)||n===void 0&&!(e in t))&&Gr(t,e,n)}function Bt(t){return It(t)&&Cn(t)}function Vc(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function pv(t){return Nr(t,An(t))}function $T(t,e,n,r,i,o,a){var s=Vc(t,n),l=Vc(e,n),u=a.get(l);if(u){Uc(t,n,u);return}var c=o?o(s,l,n+"",t,e,a):void 0,d=c===void 0;if(d){var f=We(l),h=!f&&si(l),v=!f&&!h&&ho(l);c=l,f||h||v?We(s)?c=s:Bt(s)?c=Sn(s):h?(d=!1,c=Pg(l,!0)):v?(d=!1,c=Wg(l,!0)):c=[]:pa(l)||ki(l)?(c=s,ki(s)?c=pv(s):(!Rt(s)||lr(s))&&(c=Ug(l))):d=!1}d&&(a.set(l,c),i(c,l,r,o,a),a.delete(l)),Uc(t,n,c)}function Vs(t,e,n,r,i){t!==e&&Hc(e,function(o,a){if(i||(i=new dr),Rt(o))$T(t,e,a,n,Vs,r,i);else{var s=r?r(Vc(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),Uc(t,a,s)}},An)}function hv(t,e,n,r,i,o){return Rt(t)&&Rt(e)&&(o.set(e,t),Vs(t,e,void 0,hv,o),o.delete(e)),t}var gv=po(function(t,e,n,r){Vs(t,e,n,r)}),HT=Je(function(t){return t.push(void 0,hv),Ln(gv,void 0,t)}),zT="Expected a function";function vv(t,e,n){if(typeof t!="function")throw new TypeError(zT);return setTimeout(function(){t.apply(void 0,n)},e)}var WT=Je(function(t,e){return vv(t,1,e)}),UT=Je(function(t,e,n){return vv(t,Vn(e)||0,n)});function Xc(t,e,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}var VT=200;function va(t,e,n,r){var i=-1,o=Ds,a=!0,s=t.length,l=[],u=e.length;if(!s)return l;n&&(e=Pt(e,In(n))),r?(o=Xc,a=!1):e.length>=VT&&(o=ha,a=!1,e=new $i(e));e:for(;++i<s;){var c=t[i],d=n==null?c:n(c);if(c=r||c!==0?c:0,a&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;l.push(c)}else o(e,d,r)||l.push(c)}return l}var XT=Je(function(t,e){return Bt(t)?va(t,Yt(e,1,Bt,!0)):[]});function kn(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var GT=Je(function(t,e){var n=kn(e);return Bt(n)&&(n=void 0),Bt(t)?va(t,Yt(e,1,Bt,!0),Ue(n)):[]}),YT=Je(function(t,e){var n=kn(e);return Bt(n)&&(n=void 0),Bt(t)?va(t,Yt(e,1,Bt,!0),void 0,n):[]}),KT=Ss(function(t,e){return t/e},1);function qT(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ke(e),Kn(t,e<0?0:e,r)):[]}function ZT(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ke(e),e=r-e,Kn(t,0,e<0?0:e)):[]}function Xs(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?Kn(t,r?0:o,r?o+1:i):Kn(t,r?o+1:0,r?i:o)}function JT(t,e){return t&&t.length?Xs(t,Ue(e),!0,!0):[]}function QT(t,e){return t&&t.length?Xs(t,Ue(e),!0):[]}function Pr(t){return typeof t=="function"?t:wn}function gt(t,e){var n=We(t)?Gn:pi;return n(t,Pr(e))}function eN(t,e){for(var n=t==null?0:t.length;n--&&e(t[n],n,t)!==!1;);return t}var mv=cv(!0);function Gc(t,e){return t&&mv(t,e,Vt)}var yv=dv(Gc,!0);function tN(t,e){var n=We(t)?eN:yv;return n(t,Pr(e))}function nN(t,e,n){t=_t(t),e=Rn(e);var r=t.length;n=n===void 0?r:Fi(Ke(n),0,r);var i=n;return n-=e.length,n>=0&&t.slice(n,i)==e}function rN(t,e){return Pt(e,function(n){return[n,t[n]]})}function iN(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=[r,r]}),n}var oN="[object Map]",aN="[object Set]";function _v(t){return function(e){var n=an(e);return n==oN?Ic(e):n==aN?iN(e):rN(e,t(e))}}var Zr=_v(Vt),sN=_v(An),lN={"&":"&","<":"<",">":">",'"':""","'":"'"},uN=Cc(lN),bv=/[&<>"']/g,cN=RegExp(bv.source);function xv(t){return t=_t(t),t&&cN.test(t)?t.replace(bv,uN):t}var Ev=/[\\^$.*+?()[\]{}|]/g,dN=RegExp(Ev.source);function fN(t){return t=_t(t),t&&dN.test(t)?t.replace(Ev,"\\$&"):t}function wv(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function pN(t,e){var n=!0;return pi(t,function(r,i,o){return n=!!e(r,i,o),n}),n}function hN(t,e,n){var r=We(t)?wv:pN;return n&&fn(t,e,n)&&(e=void 0),r(t,Ue(e))}var gN=4294967295;function Sv(t){return t?Fi(Ke(t),0,gN):0}function vN(t,e,n,r){var i=t.length;for(n=Ke(n),n<0&&(n=-n>i?0:i+n),r=r===void 0||r>i?i:Ke(r),r<0&&(r+=i),r=n>r?0:Sv(r);n<r;)t[n++]=e;return t}function mN(t,e,n,r){var i=t==null?0:t.length;return i?(n&&typeof n!="number"&&fn(t,e,n)&&(n=0,r=i),vN(t,e,n,r)):[]}function Cv(t,e){var n=[];return pi(t,function(r,i,o){e(r,i,o)&&n.push(r)}),n}function yN(t,e){var n=We(t)?fi:Cv;return n(t,Ue(e))}function Av(t){return function(e,n,r){var i=Object(e);if(!Cn(e)){var o=Ue(n);e=Vt(e),n=function(s){return o(i[s],s,i)}}var a=t(e,n,r);return a>-1?i[o?e[a]:a]:void 0}}var _N=Math.max;function Yc(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Ke(n);return i<0&&(i=_N(r+i,0)),Ms(t,Ue(e),i)}var hi=Av(Yc);function Ov(t,e,n){var r;return n(t,function(i,o,a){if(e(i,o,a))return r=o,!1}),r}function bN(t,e){return Ov(t,Ue(e),Dr)}var xN=Math.max,EN=Math.min;function Tv(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=r-1;return n!==void 0&&(i=Ke(n),i=n<0?xN(r+i,0):EN(i,r-1)),Ms(t,Ue(e),i,!0)}var wN=Av(Tv);function SN(t,e){return Ov(t,Ue(e),Gc)}function CN(t){return t&&t.length?t[0]:void 0}function Nv(t,e){var n=-1,r=Cn(t)?Array(t.length):[];return pi(t,function(i,o,a){r[++n]=e(i,o,a)}),r}function Bn(t,e){var n=We(t)?Pt:Nv;return n(t,Ue(e))}function AN(t,e){return Yt(Bn(t,e),1)}var ON=1/0;function TN(t,e){return Yt(Bn(t,e),ON)}function NN(t,e,n){return n=n===void 0?1:Ke(n),Yt(Bn(t,e),n)}var MN=1/0;function DN(t){var e=t==null?0:t.length;return e?Yt(t,MN):[]}function PN(t,e){var n=t==null?0:t.length;return n?(e=e===void 0?1:Ke(e),Yt(t,e)):[]}var RN=512;function LN(t){return Xr(t,RN)}var IN=Ac("floor"),kN="Expected a function",BN=8,jN=32,FN=128,$N=256;function Mv(t){return qr(function(e){var n=e.length,r=n,i=Xn.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new TypeError(kN);if(i&&!a&&Ts(o)=="wrapper")var a=new Xn([],!0)}for(r=a?r:n;++r<n;){o=e[r];var s=Ts(o),l=s=="wrapper"?sc(o):void 0;l&&lc(l[0])&&l[1]==(FN|BN|jN|$N)&&!l[4].length&&l[9]==1?a=a[Ts(l[0])].apply(a,l[3]):a=o.length==1&&lc(o)?a[s]():a.thru(o)}return function(){var u=arguments,c=u[0];if(a&&u.length==1&&We(c))return a.plant(c).value();for(var d=0,f=n?e[d].apply(this,u):c;++d<n;)f=e[d].call(this,f);return f}})}var HN=Mv(),zN=Mv(!0);function WN(t,e){return t==null?t:Hc(t,Pr(e),An)}function UN(t,e){return t==null?t:mv(t,Pr(e),An)}function VN(t,e){return t&&Dr(t,Pr(e))}function XN(t,e){return t&&Gc(t,Pr(e))}function Dv(t){for(var e=-1,n=t==null?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r}function Gs(t,e){return fi(e,function(n){return lr(t[n])})}function GN(t){return t==null?[]:Gs(t,Vt(t))}function YN(t){return t==null?[]:Gs(t,An(t))}var KN=Object.prototype,qN=KN.hasOwnProperty,ZN=zs(function(t,e,n){qN.call(t,n)?t[n].push(e):Gr(t,n,[e])});function Kc(t,e){return t>e}function Ys(t){return function(e,n){return typeof e=="string"&&typeof n=="string"||(e=Vn(e),n=Vn(n)),t(e,n)}}var JN=Ys(Kc),QN=Ys(function(t,e){return t>=e}),eM=Object.prototype,tM=eM.hasOwnProperty;function nM(t,e){return t!=null&&tM.call(t,e)}function Ks(t,e){return t!=null&&av(t,e,nM)}var rM=Math.max,iM=Math.min;function oM(t,e,n){return t>=iM(e,n)&&t<rM(e,n)}function aM(t,e,n){return e=Ur(e),n===void 0?(n=e,e=0):n=Ur(n),t=Vn(t),oM(t,e,n)}var sM="[object String]";function qs(t){return typeof t=="string"||!We(t)&&It(t)&&dn(t)==sM}function qc(t,e){return Pt(e,function(n){return t[n]})}function _o(t){return t==null?[]:qc(t,Vt(t))}var lM=Math.max;function uM(t,e,n,r){t=Cn(t)?t:_o(t),n=n&&!r?Ke(n):0;var i=t.length;return n<0&&(n=lM(i+n,0)),qs(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&co(t,e,n)>-1}var cM=Math.max;function Pv(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Ke(n);return i<0&&(i=cM(r+i,0)),co(t,e,i)}function dM(t){var e=t==null?0:t.length;return e?Kn(t,0,-1):[]}var fM=Math.min;function Zc(t,e,n){for(var r=n?Xc:Ds,i=t[0].length,o=t.length,a=o,s=Array(o),l=1/0,u=[];a--;){var c=t[a];a&&e&&(c=Pt(c,In(e))),l=fM(c.length,l),s[a]=!n&&(e||i>=120&&c.length>=120)?new $i(a&&c):void 0}c=t[0];var d=-1,f=s[0];e:for(;++d<i&&u.length<l;){var h=c[d],v=e?e(h):h;if(h=n||h!==0?h:0,!(f?ha(f,v):r(u,v,n))){for(a=o;--a;){var g=s[a];if(!(g?ha(g,v):r(t[a],v,n)))continue e}f&&f.push(v),u.push(h)}}return u}function Jc(t){return Bt(t)?t:[]}var pM=Je(function(t){var e=Pt(t,Jc);return e.length&&e[0]===t[0]?Zc(e):[]}),hM=Je(function(t){var e=kn(t),n=Pt(t,Jc);return e===kn(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Zc(n,Ue(e)):[]}),gM=Je(function(t){var e=kn(t),n=Pt(t,Jc);return e=typeof e=="function"?e:void 0,e&&n.pop(),n.length&&n[0]===t[0]?Zc(n,void 0,e):[]});function vM(t,e,n,r){return Dr(t,function(i,o,a){e(r,n(i),o,a)}),r}function Rv(t,e){return function(n,r){return vM(n,t,e(r),{})}}var mM=Object.prototype,yM=mM.toString,_M=Rv(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=yM.call(e)),t[e]=n},uc(wn)),Lv=Object.prototype,bM=Lv.hasOwnProperty,xM=Lv.toString,EM=Rv(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=xM.call(e)),bM.call(t,e)?t[e].push(n):t[e]=[n]},Ue);function Iv(t,e){return e.length<2?t:ji(t,Kn(e,0,-1))}function ma(t,e,n){e=li(e,t),t=Iv(t,e);var r=t==null?t:t[Mr(kn(e))];return r==null?void 0:Ln(r,t,n)}var wM=Je(ma),SM=Je(function(t,e,n){var r=-1,i=typeof e=="function",o=Cn(t)?Array(t.length):[];return pi(t,function(a){o[++r]=i?Ln(e,a,n):ma(a,e,n)}),o}),CM="[object ArrayBuffer]";function AM(t){return It(t)&&dn(t)==CM}var kv=Yn&&Yn.isArrayBuffer,OM=kv?In(kv):AM,TM="[object Boolean]";function Zs(t){return t===!0||t===!1||It(t)&&dn(t)==TM}var NM="[object Date]";function MM(t){return It(t)&&dn(t)==NM}var Bv=Yn&&Yn.isDate,DM=Bv?In(Bv):MM;function PM(t){return It(t)&&t.nodeType===1&&!pa(t)}var RM="[object Map]",LM="[object Set]",IM=Object.prototype,kM=IM.hasOwnProperty;function Js(t){if(t==null)return!0;if(Cn(t)&&(We(t)||typeof t=="string"||typeof t.splice=="function"||si(t)||ho(t)||ki(t)))return!t.length;var e=an(t);if(e==RM||e==LM)return!t.size;if(ua(t))return!gc(t).length;for(var n in t)if(kM.call(t,n))return!1;return!0}function Qc(t,e){return ga(t,e)}function BM(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?ga(t,e,void 0,n):!!r}var jM=Ut.isFinite;function FM(t){return typeof t=="number"&&jM(t)}function jv(t){return typeof t=="number"&&t==Ke(t)}function $M(t,e){return t===e||Bc(t,e,jc(e))}function HM(t,e,n){return n=typeof n=="function"?n:void 0,Bc(t,e,jc(e),n)}var zM="[object Number]";function Fv(t){return typeof t=="number"||It(t)&&dn(t)==zM}function WM(t){return Fv(t)&&t!=+t}var UM=Cs?lr:pc,VM="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function XM(t){if(UM(t))throw new Error(VM);return ph(t)}function pn(t){return t==null}function GM(t){return t===null}var YM="[object RegExp]";function KM(t){return It(t)&&dn(t)==YM}var $v=Yn&&Yn.isRegExp,ed=$v?In($v):KM,qM=9007199254740991;function ZM(t){return jv(t)&&t>=-9007199254740991&&t<=qM}function Hi(t){return t===void 0}var JM="[object WeakMap]";function QM(t){return It(t)&&an(t)==JM}var eD="[object WeakSet]";function tD(t){return It(t)&&dn(t)==eD}var nD=1;function rD(t){return Ue(typeof t=="function"?t:qn(t,nD))}var iD=Array.prototype,oD=iD.join;function aD(t,e){return t==null?"":oD.call(t,e)}var sD=mo(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),lD=zs(function(t,e,n){Gr(t,n,e)});function uD(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}var cD=Math.max,dD=Math.min;function fD(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=r;return n!==void 0&&(i=Ke(n),i=i<0?cD(r+i,0):dD(i,r-1)),e===e?uD(t,e,i):Ms(t,xh,i,!0)}var pD=mo(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),hD=og("toLowerCase");function td(t,e){return t<e}var gD=Ys(td),vD=Ys(function(t,e){return t<=e});function Hv(t,e){var n={};return e=Ue(e),Dr(t,function(r,i,o){Gr(n,e(r,i,o),r)}),n}function mD(t,e){var n={};return e=Ue(e),Dr(t,function(r,i,o){Gr(n,i,e(r,i,o))}),n}var yD=1;function _D(t){return ov(qn(t,yD))}var bD=1;function xD(t,e){return sv(t,qn(e,bD))}function Qs(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(a!=null&&(s===void 0?a===a&&!Pn(a):n(a,s)))var s=a,l=o}return l}function ED(t){return t&&t.length?Qs(t,wn,Kc):void 0}function wD(t,e){return t&&t.length?Qs(t,Ue(e),Kc):void 0}function nd(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);o!==void 0&&(n=n===void 0?o:n+o)}return n}var SD=NaN;function zv(t,e){var n=t==null?0:t.length;return n?nd(t,e)/n:SD}function CD(t){return zv(t,wn)}function AD(t,e){return zv(t,Ue(e))}var zi=po(function(t,e,n){Vs(t,e,n)}),OD=Je(function(t,e){return function(n){return ma(n,t,e)}}),TD=Je(function(t,e){return function(n){return ma(t,n,e)}});function ND(t){return t&&t.length?Qs(t,wn,td):void 0}function MD(t,e){return t&&t.length?Qs(t,Ue(e),td):void 0}function DD(t,e,n){var r=Vt(e),i=Gs(e,r),o=!(Rt(n)&&"chain"in n)||!!n.chain,a=lr(t);return Gn(i,function(s){var l=e[s];t[s]=l,a&&(t.prototype[s]=function(){var u=this.__chain__;if(o||u){var c=t(this.__wrapped__),d=c.__actions__=Sn(this.__actions__);return d.push({func:l,args:arguments,thisArg:t}),c.__chain__=u,c}return l.apply(t,ci([this.value()],arguments))})}),t}var PD=Ss(function(t,e){return t*e},1),RD="Expected a function";function el(t){if(typeof t!="function")throw new TypeError(RD);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function LD(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}var ID="[object Map]",kD="[object Set]",rd=on?on.iterator:void 0;function Wv(t){if(!t)return[];if(Cn(t))return qs(t)?cr(t):Sn(t);if(rd&&t[rd])return LD(t[rd]());var e=an(t),n=e==ID?Ic:e==kD?$s:_o;return n(t)}function BD(){this.__values__===void 0&&(this.__values__=Wv(this.value()));var t=this.__index__>=this.__values__.length,e=t?void 0:this.__values__[this.__index__++];return{done:t,value:e}}function Uv(t,e){var n=t.length;if(n)return e+=e<0?n:0,Vr(e,n)?t[e]:void 0}function jD(t,e){return t&&t.length?Uv(t,Ke(e)):void 0}function FD(t){return t=Ke(t),Je(function(e){return Uv(e,t)})}function id(t,e){return e=li(e,t),t=Iv(t,e),t==null||delete t[Mr(kn(e))]}function $D(t){return pa(t)?void 0:t}var HD=1,zD=2,WD=4,UD=qr(function(t,e){var n={};if(t==null)return n;var r=!1;e=Pt(e,function(o){return o=li(o,t),r||(r=o.length>1),o}),Nr(t,Mc(t),n),r&&(n=qn(n,HD|zD|WD,$D));for(var i=e.length;i--;)id(n,e[i]);return n});function ya(t,e,n,r){if(!Rt(t))return t;e=li(e,t);for(var i=-1,o=e.length,a=o-1,s=t;s!=null&&++i<o;){var l=Mr(e[i]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var c=s[l];u=r?r(c,l,s):void 0,u===void 0&&(u=Rt(c)?c:Vr(e[i+1])?[]:{})}la(s,l,u),s=s[l]}return t}function Vv(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=ji(t,a);n(s,a)&&ya(o,li(a,t),s)}return o}function Xv(t,e){if(t==null)return{};var n=Pt(Mc(t),function(r){return[r]});return e=Ue(e),Vv(t,n,function(r,i){return e(r,i[0])})}function VD(t,e){return Xv(t,el(Ue(e)))}function XD(t){return Jh(2,t)}function GD(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}function Gv(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,o=Pn(t),a=e!==void 0,s=e===null,l=e===e,u=Pn(e);if(!s&&!u&&!o&&t>e||o&&a&&l&&!s&&!u||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!u&&t<e||u&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!l)return-1}return 0}function YD(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var l=Gv(i[r],o[r]);if(l){if(r>=s)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return t.index-e.index}function Yv(t,e,n){e.length?e=Pt(e,function(o){return We(o)?function(a){return ji(a,o.length===1?o[0]:o)}:o}):e=[wn];var r=-1;e=Pt(e,In(Ue));var i=Nv(t,function(o,a,s){var l=Pt(e,function(u){return u(o)});return{criteria:l,index:++r,value:o}});return GD(i,function(o,a){return YD(o,a,n)})}function KD(t,e,n,r){return t==null?[]:(We(e)||(e=e==null?[]:[e]),n=r?void 0:n,We(n)||(n=n==null?[]:[n]),Yv(t,e,n))}function od(t){return qr(function(e){return e=Pt(e,In(Ue)),Je(function(n){var r=this;return t(e,function(i){return Ln(i,r,n)})})})}var qD=od(Pt),ZD=Je,JD=Math.min,QD=ZD(function(t,e){e=e.length==1&&We(e[0])?Pt(e[0],In(Ue)):Pt(Yt(e,1),In(Ue));var n=e.length;return Je(function(r){for(var i=-1,o=JD(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Ln(t,this,r)})}),eP=od(wv),tP=od(Lc),nP=9007199254740991,rP=Math.floor;function ad(t,e){var n="";if(!t||e<1||e>nP)return n;do e%2&&(n+=t),e=rP(e/2),e&&(t+=t);while(e);return n}var iP=$c("length"),Kv="\\ud800-\\udfff",oP="\\u0300-\\u036f",aP="\\ufe20-\\ufe2f",sP="\\u20d0-\\u20ff",lP=oP+aP+sP,uP="\\ufe0e\\ufe0f",cP="["+Kv+"]",sd="["+lP+"]",ld="\\ud83c[\\udffb-\\udfff]",dP="(?:"+sd+"|"+ld+")",qv="[^"+Kv+"]",Zv="(?:\\ud83c[\\udde6-\\uddff]){2}",Jv="[\\ud800-\\udbff][\\udc00-\\udfff]",fP="\\u200d",Qv=dP+"?",em="["+uP+"]?",pP="(?:"+fP+"(?:"+[qv,Zv,Jv].join("|")+")"+em+Qv+")*",hP=em+Qv+pP,gP="(?:"+[qv+sd+"?",sd,Zv,Jv,cP].join("|")+")",tm=RegExp(ld+"(?="+ld+")|"+gP+hP,"g");function vP(t){for(var e=tm.lastIndex=0;tm.test(t);)++e;return e}function bo(t){return go(t)?vP(t):iP(t)}var mP=Math.ceil;function tl(t,e){e=e===void 0?" ":Rn(e);var n=e.length;if(n<2)return n?ad(e,t):e;var r=ad(e,mP(t/bo(e)));return go(e)?di(cr(r),0,t).join(""):r.slice(0,t)}var yP=Math.ceil,_P=Math.floor;function bP(t,e,n){t=_t(t),e=Ke(e);var r=e?bo(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return tl(_P(i),n)+t+tl(yP(i),n)}function xP(t,e,n){t=_t(t),e=Ke(e);var r=e?bo(t):0;return e&&r<e?t+tl(e-r,n):t}function EP(t,e,n){t=_t(t),e=Ke(e);var r=e?bo(t):0;return e&&r<e?tl(e-r,n)+t:t}var wP=/^\s+/,SP=Ut.parseInt;function CP(t,e,n){return n||e==null?e=0:e&&(e=+e),SP(_t(t).replace(wP,""),e||0)}var AP=32,nl=Je(function(t,e){var n=ai(e,fo(nl));return Xr(t,AP,void 0,e,n)});nl.placeholder={};var OP=64,ud=Je(function(t,e){var n=ai(e,fo(ud));return Xr(t,OP,void 0,e,n)});ud.placeholder={};var TP=zs(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});function NP(t,e){return Vv(t,e,function(n,r){return Fc(t,r)})}var gi=qr(function(t,e){return t==null?{}:NP(t,e)});function MP(t){for(var e,n=this;n instanceof Os;){var r=yh(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e}function DP(t){return function(e){return t==null?void 0:ji(t,e)}}function PP(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}var RP=Array.prototype,nm=RP.splice;function cd(t,e,n,r){var i=r?PP:co,o=-1,a=e.length,s=t;for(t===e&&(e=Sn(e)),n&&(s=Pt(t,In(n)));++o<a;)for(var l=0,u=e[o],c=n?n(u):u;(l=i(s,c,l,r))>-1;)s!==t&&nm.call(s,l,1),nm.call(t,l,1);return t}function rm(t,e){return t&&t.length&&e&&e.length?cd(t,e):t}var LP=Je(rm);function IP(t,e,n){return t&&t.length&&e&&e.length?cd(t,e,Ue(n)):t}function kP(t,e,n){return t&&t.length&&e&&e.length?cd(t,e,void 0,n):t}var BP=Array.prototype,jP=BP.splice;function im(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Vr(i)?jP.call(t,i,1):id(t,i)}}return t}var FP=qr(function(t,e){var n=t==null?0:t.length,r=yc(t,e);return im(t,Pt(e,function(i){return Vr(i,n)?+i:i}).sort(Gv)),r}),$P=Math.floor,HP=Math.random;function dd(t,e){return t+$P(HP()*(e-t+1))}var zP=parseFloat,WP=Math.min,UP=Math.random;function VP(t,e,n){if(n&&typeof n!="boolean"&&fn(t,e,n)&&(e=n=void 0),n===void 0&&(typeof e=="boolean"?(n=e,e=void 0):typeof t=="boolean"&&(n=t,t=void 0)),t===void 0&&e===void 0?(t=0,e=1):(t=Ur(t),e===void 0?(e=t,t=0):e=Ur(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=UP();return WP(t+i*(e-t+zP("1e-"+((i+"").length-1))),e)}return dd(t,e)}var XP=Math.ceil,GP=Math.max;function YP(t,e,n,r){for(var i=-1,o=GP(XP((e-t)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=t,t+=n;return a}function om(t){return function(e,n,r){return r&&typeof r!="number"&&fn(e,n,r)&&(n=r=void 0),e=Ur(e),n===void 0?(n=e,e=0):n=Ur(n),r=r===void 0?e<n?1:-1:Ur(r),YP(e,n,r,t)}}var KP=om(),qP=om(!0),ZP=256,JP=qr(function(t,e){return Xr(t,ZP,void 0,void 0,void 0,e)});function am(t,e,n,r,i){return i(t,function(o,a,s){n=r?(r=!1,o):e(n,o,a,s)}),n}function sm(t,e,n){var r=We(t)?Sc:am,i=arguments.length<3;return r(t,Ue(e),n,i,pi)}function QP(t,e,n,r){var i=t==null?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function eR(t,e,n){var r=We(t)?QP:am,i=arguments.length<3;return r(t,Ue(e),n,i,yv)}function tR(t,e){var n=We(t)?fi:Cv;return n(t,el(Ue(e)))}function nR(t,e){var n=[];if(!(t&&t.length))return n;var r=-1,i=[],o=t.length;for(e=Ue(e);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return im(t,i),n}function rR(t,e,n){return(n?fn(t,e,n):e===void 0)?e=1:e=Ke(e),ad(_t(t),e)}function iR(){var t=arguments,e=_t(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var oR="Expected a function";function aR(t,e){if(typeof t!="function")throw new TypeError(oR);return e=e===void 0?e:Ke(e),Je(t,e)}function sR(t,e,n){e=li(e,t);var r=-1,i=e.length;for(i||(i=1,t=void 0);++r<i;){var o=t==null?void 0:t[Mr(e[r])];o===void 0&&(r=i,o=n),t=lr(o)?o.call(t):o}return t}var lR=Array.prototype,uR=lR.reverse;function fd(t){return t==null?t:uR.call(t)}var cR=Ac("round");function lm(t){var e=t.length;return e?t[dd(0,e-1)]:void 0}function dR(t){return lm(_o(t))}function fR(t){var e=We(t)?lm:dR;return e(t)}function rl(t,e){var n=-1,r=t.length,i=r-1;for(e=e===void 0?r:e;++n<e;){var o=dd(n,i),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}function pR(t,e){return rl(Sn(t),Fi(e,0,t.length))}function hR(t,e){var n=_o(t);return rl(n,Fi(e,0,n.length))}function gR(t,e,n){(n?fn(t,e,n):e===void 0)?e=1:e=Ke(e);var r=We(t)?pR:hR;return r(t,e)}function um(t,e,n){return t==null?t:ya(t,e,n)}function vR(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:ya(t,e,n,r)}function mR(t){return rl(Sn(t))}function yR(t){return rl(_o(t))}function _R(t){var e=We(t)?mR:yR;return e(t)}var bR="[object Map]",xR="[object Set]";function ER(t){if(t==null)return 0;if(Cn(t))return qs(t)?bo(t):t.length;var e=an(t);return e==bR||e==xR?t.size:gc(t).length}function wR(t,e,n){var r=t==null?0:t.length;return r?(n&&typeof n!="number"&&fn(t,e,n)?(e=0,n=r):(e=e==null?0:Ke(e),n=n===void 0?r:Ke(n)),Kn(t,e,n)):[]}var SR=mo(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});function CR(t,e){var n;return pi(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}function AR(t,e,n){var r=We(t)?Lc:CR;return n&&fn(t,e,n)&&(e=void 0),r(t,Ue(e))}var OR=Je(function(t,e){if(t==null)return[];var n=e.length;return n>1&&fn(t,e[0],e[1])?e=[]:n>2&&fn(e[0],e[1],e[2])&&(e=[e[0]]),Yv(t,Yt(e,1),[])}),TR=4294967295,NR=TR-1,MR=Math.floor,DR=Math.min;function pd(t,e,n,r){var i=0,o=t==null?0:t.length;if(o===0)return 0;e=n(e);for(var a=e!==e,s=e===null,l=Pn(e),u=e===void 0;i<o;){var c=MR((i+o)/2),d=n(t[c]),f=d!==void 0,h=d===null,v=d===d,g=Pn(d);if(a)var m=r||v;else u?m=v&&(r||f):s?m=v&&f&&(r||!h):l?m=v&&f&&!h&&(r||!g):h||g?m=!1:m=r?d<=e:d<e;m?i=c+1:o=c}return DR(o,NR)}var PR=4294967295,RR=PR>>>1;function il(t,e,n){var r=0,i=t==null?r:t.length;if(typeof e=="number"&&e===e&&i<=RR){for(;r<i;){var o=r+i>>>1,a=t[o];a!==null&&!Pn(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return pd(t,e,wn,n)}function LR(t,e){return il(t,e)}function IR(t,e,n){return pd(t,e,Ue(n))}function kR(t,e){var n=t==null?0:t.length;if(n){var r=il(t,e);if(r<n&&ur(t[r],e))return r}return-1}function BR(t,e){return il(t,e,!0)}function jR(t,e,n){return pd(t,e,Ue(n),!0)}function FR(t,e){var n=t==null?0:t.length;if(n){var r=il(t,e,!0)-1;if(ur(t[r],e))return r}return-1}function cm(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!ur(s,l)){var l=s;o[i++]=a===0?0:a}}return o}function $R(t){return t&&t.length?cm(t):[]}function HR(t,e){return t&&t.length?cm(t,Ue(e)):[]}var zR=4294967295;function WR(t,e,n){return n&&typeof n!="number"&&fn(t,e,n)&&(e=n=void 0),n=n===void 0?zR:n>>>0,n?(t=_t(t),t&&(typeof e=="string"||e!=null&&!ed(e))&&(e=Rn(e),!e&&go(t))?di(cr(t),0,n):t.split(e,n)):[]}var UR="Expected a function",VR=Math.max;function XR(t,e){if(typeof t!="function")throw new TypeError(UR);return e=e==null?0:VR(Ke(e),0),Je(function(n){var r=n[e],i=di(n,0,e);return r&&ci(i,r),Ln(t,this,i)})}var GR=mo(function(t,e,n){return t+(n?" ":"")+wc(e)});function YR(t,e,n){return t=_t(t),n=n==null?0:Fi(Ke(n),0,t.length),e=Rn(e),t.slice(n,n+e.length)==e}function KR(){return{}}function qR(){return""}function ZR(){return!0}var JR=Ss(function(t,e){return t-e},0);function QR(t){return t&&t.length?nd(t,wn):0}function e2(t,e){return t&&t.length?nd(t,Ue(e)):0}function t2(t){var e=t==null?0:t.length;return e?Kn(t,1,e):[]}function n2(t,e,n){return t&&t.length?(e=n||e===void 0?1:Ke(e),Kn(t,0,e<0?0:e)):[]}function r2(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ke(e),e=r-e,Kn(t,e<0?0:e,r)):[]}function i2(t,e){return t&&t.length?Xs(t,Ue(e),!1,!0):[]}function o2(t,e){return t&&t.length?Xs(t,Ue(e)):[]}function a2(t,e){return e(t),t}var dm=Object.prototype,s2=dm.hasOwnProperty;function fm(t,e,n,r){return t===void 0||ur(t,dm[n])&&!s2.call(r,n)?e:t}var l2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function u2(t){return"\\"+l2[t]}var pm=/<%=([\s\S]+?)%>/g,c2=/<%-([\s\S]+?)%>/g,d2=/<%([\s\S]+?)%>/g,hd={escape:c2,evaluate:d2,interpolate:pm,variable:"",imports:{_:{escape:xv}}},f2="Invalid `variable` option passed into `_.template`",p2=/\b__p \+= '';/g,h2=/\b(__p \+=) '' \+/g,g2=/(__e\(.*?\)|\b__t\)) \+\n'';/g,v2=/[()=,{}\[\]\/\s]/,m2=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ol=/($^)/,y2=/['\n\r\u2028\u2029\\]/g,_2=Object.prototype,hm=_2.hasOwnProperty;function b2(t,e,n){var r=hd.imports._.templateSettings||hd;n&&fn(t,e,n)&&(e=void 0),t=_t(t),e=vc({},e,r,fm);var i=vc({},e.imports,r.imports,fm),o=Vt(i),a=qc(i,o),s,l,u=0,c=e.interpolate||ol,d="__p += '",f=RegExp((e.escape||ol).source+"|"+c.source+"|"+(c===pm?m2:ol).source+"|"+(e.evaluate||ol).source+"|$","g"),h=hm.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+`
|
|
8
|
+
`:"";t.replace(f,function(m,y,x,E,b,T){return x||(x=E),d+=t.slice(u,T).replace(y2,u2),y&&(s=!0,d+=`' +
|
|
9
|
+
__e(`+y+`) +
|
|
10
|
+
'`),b&&(l=!0,d+=`';
|
|
11
|
+
`+b+`;
|
|
12
|
+
__p += '`),x&&(d+=`' +
|
|
13
|
+
((__t = (`+x+`)) == null ? '' : __t) +
|
|
14
|
+
'`),u=T+m.length,m}),d+=`';
|
|
15
|
+
`;var v=hm.call(e,"variable")&&e.variable;if(!v)d=`with (obj) {
|
|
16
|
+
`+d+`
|
|
17
|
+
}
|
|
18
|
+
`;else if(v2.test(v))throw new Error(f2);d=(l?d.replace(p2,""):d).replace(h2,"$1").replace(g2,"$1;"),d="function("+(v||"obj")+`) {
|
|
19
|
+
`+(v?"":`obj || (obj = {});
|
|
20
|
+
`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(l?`, __j = Array.prototype.join;
|
|
21
|
+
function print() { __p += __j.call(arguments, '') }
|
|
22
|
+
`:`;
|
|
23
|
+
`)+d+`return __p
|
|
24
|
+
}`;var g=Zh(function(){return Function(o,h+"return "+d).apply(void 0,a)});if(g.source=d,_c(g))throw g;return g}var x2="Expected a function";function gm(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(x2);return Rt(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Us(t,e,{leading:r,maxWait:e,trailing:i})}function al(t,e){return e(t)}var E2=9007199254740991,gd=4294967295,w2=Math.min;function S2(t,e){if(t=Ke(t),t<1||t>E2)return[];var n=gd,r=w2(t,gd);e=Pr(e),t-=gd;for(var i=fc(r,e);++n<t;)e(n);return i}function C2(){return this}function vm(t,e){var n=t;return n instanceof ot&&(n=n.value()),Sc(e,function(r,i){return i.func.apply(i.thisArg,ci([r],i.args))},n)}function A2(){return vm(this.__wrapped__,this.__actions__)}function O2(t){return _t(t).toLowerCase()}function T2(t){return We(t)?Pt(t,Mr):Pn(t)?[t]:Sn(Gh(_t(t)))}var N2=9007199254740991;function M2(t){return t?Fi(Ke(t),-9007199254740991,N2):t===0?t:0}function D2(t){return _t(t).toUpperCase()}function P2(t,e,n){var r=We(t),i=r||si(t)||ho(t);if(e=Ue(e),n==null){var o=t&&t.constructor;i?n=r?new o:[]:Rt(t)?n=lr(o)?so(Bs(t)):{}:n={}}return(i?Gn:Dr)(t,function(a,s,l){return e(n,a,s,l)}),n}function mm(t,e){for(var n=t.length;n--&&co(e,t[n],0)>-1;);return n}function ym(t,e){for(var n=-1,r=t.length;++n<r&&co(e,t[n],0)>-1;);return n}function R2(t,e,n){if(t=_t(t),t&&(n||e===void 0))return ch(t);if(!t||!(e=Rn(e)))return t;var r=cr(t),i=cr(e),o=ym(r,i),a=mm(r,i)+1;return di(r,o,a).join("")}function L2(t,e,n){if(t=_t(t),t&&(n||e===void 0))return t.slice(0,uh(t)+1);if(!t||!(e=Rn(e)))return t;var r=cr(t),i=mm(r,cr(e))+1;return di(r,0,i).join("")}var I2=/^\s+/;function k2(t,e,n){if(t=_t(t),t&&(n||e===void 0))return t.replace(I2,"");if(!t||!(e=Rn(e)))return t;var r=cr(t),i=ym(r,cr(e));return di(r,i).join("")}var B2=30,j2="...",F2=/\w*$/;function $2(t,e){var n=B2,r=j2;if(Rt(e)){var i="separator"in e?e.separator:i;n="length"in e?Ke(e.length):n,r="omission"in e?Rn(e.omission):r}t=_t(t);var o=t.length;if(go(t)){var a=cr(t);o=a.length}if(n>=o)return t;var s=n-bo(r);if(s<1)return r;var l=a?di(a,0,s).join(""):t.slice(0,s);if(i===void 0)return l+r;if(a&&(s+=l.length-s),ed(i)){if(t.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,_t(F2.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;l=l.slice(0,d===void 0?s:d)}}else if(t.indexOf(Rn(i),s)!=s){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}function H2(t){return Ih(t,1)}var z2={"&":"&","<":"<",">":">",""":'"',"'":"'"},W2=Cc(z2),_m=/&(?:amp|lt|gt|quot|#39);/g,U2=RegExp(_m.source);function V2(t){return t=_t(t),t&&U2.test(t)?t.replace(_m,W2):t}var X2=1/0,G2=yo&&1/$s(new yo([,-0]))[1]==X2?function(t){return new yo(t)}:lo,Y2=200;function vi(t,e,n){var r=-1,i=Ds,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=Xc;else if(o>=Y2){var u=e?null:G2(t);if(u)return $s(u);a=!1,i=ha,l=new $i}else l=e?[]:s;e:for(;++r<o;){var c=t[r],d=e?e(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;e&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var K2=Je(function(t){return vi(Yt(t,1,Bt,!0))}),q2=Je(function(t){var e=kn(t);return Bt(e)&&(e=void 0),vi(Yt(t,1,Bt,!0),Ue(e))}),Z2=Je(function(t){var e=kn(t);return e=typeof e=="function"?e:void 0,vi(Yt(t,1,Bt,!0),void 0,e)});function J2(t){return t&&t.length?vi(t):[]}function Q2(t,e){return t&&t.length?vi(t,Ue(e)):[]}function eL(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?vi(t,void 0,e):[]}var tL=0;function nL(t){var e=++tL;return _t(t)+e}function rL(t,e){return t==null?!0:id(t,e)}var iL=Math.max;function vd(t){if(!(t&&t.length))return[];var e=0;return t=fi(t,function(n){if(Bt(n))return e=iL(n.length,e),!0}),fc(e,function(n){return Pt(t,$c(n))})}function bm(t,e){if(!(t&&t.length))return[];var n=vd(t);return e==null?n:Pt(n,function(r){return Ln(e,void 0,r)})}function xm(t,e,n,r){return ya(t,e,n(ji(t,e)),r)}function oL(t,e,n){return t==null?t:xm(t,e,Pr(n))}function aL(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:xm(t,e,Pr(n),r)}var sL=mo(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()});function lL(t){return t==null?[]:qc(t,An(t))}var uL=Je(function(t,e){return Bt(t)?va(t,e):[]});function cL(t,e){return nl(Pr(e),t)}var dL=qr(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(o){return yc(o,t)};return e>1||this.__actions__.length||!(r instanceof ot)||!Vr(n)?this.thru(i):(r=r.slice(n,+n+(e?1:0)),r.__actions__.push({func:al,args:[i],thisArg:void 0}),new Xn(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(void 0),o}))});function fL(){return Ag(this)}function pL(){var t=this.__wrapped__;if(t instanceof ot){var e=t;return this.__actions__.length&&(e=new ot(this)),e=e.reverse(),e.__actions__.push({func:al,args:[fd],thisArg:void 0}),new Xn(e,this.__chain__)}return this.thru(fd)}function md(t,e,n){var r=t.length;if(r<2)return r?vi(t[0]):[];for(var i=-1,o=Array(r);++i<r;)for(var a=t[i],s=-1;++s<r;)s!=i&&(o[i]=va(o[i]||a,t[s],e,n));return vi(Yt(o,1),e,n)}var hL=Je(function(t){return md(fi(t,Bt))}),gL=Je(function(t){var e=kn(t);return Bt(e)&&(e=void 0),md(fi(t,Bt),Ue(e))}),vL=Je(function(t){var e=kn(t);return e=typeof e=="function"?e:void 0,md(fi(t,Bt),void 0,e)}),mL=Je(vd);function Em(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;n(a,t[r],s)}return a}function yL(t,e){return Em(t||[],e||[],la)}function _L(t,e){return Em(t||[],e||[],ya)}var bL=Je(function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n=typeof n=="function"?(t.pop(),n):void 0,bm(t,n)});const xe={chunk:aO,compact:$1,concat:H1,difference:XT,differenceBy:GT,differenceWith:YT,drop:qT,dropRight:ZT,dropRightWhile:JT,dropWhile:QT,fill:mN,findIndex:Yc,findLastIndex:Tv,flatten:Kh,flattenDeep:DN,flattenDepth:PN,fromPairs:Dv,head:CN,indexOf:Pv,initial:dM,intersection:pM,intersectionBy:hM,intersectionWith:gM,join:aD,lastIndexOf:fD,nth:jD,pull:LP,pullAll:rm,pullAllBy:IP,pullAllWith:kP,pullAt:FP,remove:nR,reverse:fd,slice:wR,sortedIndex:LR,sortedIndexBy:IR,sortedIndexOf:kR,sortedLastIndex:BR,sortedLastIndexBy:jR,sortedLastIndexOf:FR,sortedUniq:$R,sortedUniqBy:HR,tail:t2,take:n2,takeRight:r2,takeRightWhile:i2,takeWhile:o2,union:K2,unionBy:q2,unionWith:Z2,uniq:J2,uniqBy:Q2,uniqWith:eL,unzip:vd,unzipWith:bm,without:uL,xor:hL,xorBy:gL,xorWith:vL,zip:mL,zipObject:yL,zipObjectDeep:_L,zipWith:bL},St={countBy:MT,every:hN,filter:yN,find:hi,findLast:wN,flatMap:AN,flatMapDeep:TN,flatMapDepth:NN,forEach:gt,forEachRight:tN,groupBy:ZN,includes:uM,invokeMap:SM,keyBy:lD,map:Bn,orderBy:KD,partition:TP,reduce:sm,reduceRight:eR,reject:tR,sample:fR,sampleSize:gR,shuffle:_R,size:ER,some:AR,sortBy:OR},xL={now:Ws},kt={after:UE,ary:Ih,before:Jh,bind:js,bindKey:bc,curry:zc,curryRight:Wc,debounce:Us,defer:WT,delay:UT,flip:LN,memoize:ks,once:XD,overArgs:QD,partial:nl,partialRight:ud,rearg:JP,rest:aR,spread:XR,throttle:gm,unary:H2,wrap:cL},De={castArray:eO,clone:D1,cloneDeep:Pe,cloneDeepWith:k1,cloneWith:j1,conformsTo:CT,eq:ur,gt:JN,gte:QN,isArguments:ki,isArrayBuffer:OM,isArrayLike:Cn,isArrayLikeObject:Bt,isBoolean:Zs,isBuffer:si,isDate:DM,isElement:PM,isEmpty:Js,isEqual:Qc,isEqualWith:BM,isError:_c,isFinite:FM,isFunction:lr,isInteger:jv,isLength:Rs,isMap:Xg,isMatch:$M,isMatchWith:HM,isNaN:WM,isNative:XM,isNil:pn,isNull:GM,isNumber:Fv,isObjectLike:It,isPlainObject:pa,isRegExp:ed,isSafeInteger:ZM,isSet:Yg,isString:qs,isSymbol:Pn,isTypedArray:ho,isUndefined:Hi,isWeakMap:QM,isWeakSet:tD,lt:gD,lte:vD,toArray:Wv,toFinite:Ur,toLength:Sv,toNumber:Vn,toPlainObject:pv,toSafeInteger:M2,toString:_t},hn={add:LE,ceil:rO,divide:KT,floor:IN,max:ED,maxBy:wD,mean:CD,meanBy:AD,min:ND,minBy:MD,multiply:PD,round:cR,subtract:JR,sum:QR,sumBy:e2},yd={clamp:sO,inRange:aM,random:VP},$e={assign:ut,assignIn:JS,assignInWith:vc,assignWith:QS,at:PC,create:DT,defaults:FT,defaultsDeep:HT,findKey:bN,findLastKey:SN,forIn:WN,forInRight:UN,forOwn:VN,forOwnRight:XN,functions:GN,functionsIn:YN,get:ui,has:Ks,hasIn:Fc,invert:_M,invertBy:EM,invoke:wM,keysIn:An,mapKeys:Hv,mapValues:mD,merge:zi,mergeWith:gv,omit:UD,omitBy:VD,pick:gi,pickBy:Xv,result:sR,set:um,setWith:vR,toPairs:Zr,toPairsIn:sN,transform:P2,unset:rL,update:oL,updateWith:aL,values:_o,valuesIn:lL},Rr={at:dL,chain:Ag,commit:F1,next:BD,plant:MP,reverse:pL,tap:a2,toIterator:C2,value:A2,wrapperChain:fL},mt={camelCase:QA,capitalize:ag,deburr:sg,endsWith:nN,escape:xv,escapeRegExp:fN,kebabCase:sD,lowerCase:pD,lowerFirst:hD,pad:bP,padEnd:xP,padStart:EP,parseInt:CP,repeat:rR,replace:iR,snakeCase:SR,split:WR,startCase:GR,startsWith:YR,template:b2,templateSettings:hd,toLower:O2,toUpper:D2,trim:R2,trimEnd:L2,trimStart:k2,truncate:$2,unescape:V2,upperCase:sL,upperFirst:wc,words:Cg},bt={attempt:Zh,bindAll:WC,cond:xT,conforms:ST,constant:uc,defaultTo:BT,flow:HN,flowRight:zN,iteratee:rD,matches:_D,matchesProperty:xD,method:OD,methodOf:TD,noop:lo,nthArg:FD,over:qD,overEvery:eP,overSome:tP,property:lv,propertyOf:DP,range:KP,rangeRight:qP,stubArray:Oc,stubFalse:pc,stubObject:KR,stubString:qR,stubTrue:ZR,times:S2,toPath:T2,uniqueId:nL};function EL(){var t=new ot(this.__wrapped__);return t.__actions__=Sn(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Sn(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Sn(this.__views__),t}function wL(){if(this.__filtered__){var t=new ot(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}var SL=Math.max,CL=Math.min;function AL(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=CL(e,t+a);break;case"takeRight":t=SL(t,e-a);break}}return{start:t,end:e}}var OL=1,TL=2,NL=Math.min;function ML(){var t=this.__wrapped__.value(),e=this.__dir__,n=We(t),r=e<0,i=n?t.length:0,o=AL(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=r?s:a-1,c=this.__iteratees__,d=c.length,f=0,h=NL(l,this.__takeCount__);if(!n||!r&&i==l&&h==l)return vm(t,this.__actions__);var v=[];e:for(;l--&&f<h;){u+=e;for(var g=-1,m=t[u];++g<d;){var y=c[g],x=y.iteratee,E=y.type,b=x(m);if(E==TL)m=b;else if(!b){if(E==OL)continue e;break e}}v[f++]=m}return v}/**
|
|
25
|
+
* @license
|
|
26
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
27
|
+
* Build: `lodash modularize exports="es" -o ./`
|
|
28
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
29
|
+
* Released under MIT license <https://lodash.com/license>
|
|
30
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
31
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
32
|
+
*/var DL="4.17.21",PL=2,RL=1,LL=3,wm=4294967295,IL=Array.prototype,kL=Object.prototype,Sm=kL.hasOwnProperty,Cm=on?on.iterator:void 0,BL=Math.max,Am=Math.min,_d=function(t){return function(e,n,r){if(r==null){var i=Rt(n),o=i&&Vt(n),a=o&&o.length&&Gs(n,o);(a?a.length:i)||(r=n,n=e,e=this)}return t(e,n,r)}}(DD);O.after=kt.after,O.ary=kt.ary,O.assign=$e.assign,O.assignIn=$e.assignIn,O.assignInWith=$e.assignInWith,O.assignWith=$e.assignWith,O.at=$e.at,O.before=kt.before,O.bind=kt.bind,O.bindAll=bt.bindAll,O.bindKey=kt.bindKey,O.castArray=De.castArray,O.chain=Rr.chain,O.chunk=xe.chunk,O.compact=xe.compact,O.concat=xe.concat,O.cond=bt.cond,O.conforms=bt.conforms,O.constant=bt.constant,O.countBy=St.countBy,O.create=$e.create,O.curry=kt.curry,O.curryRight=kt.curryRight,O.debounce=kt.debounce,O.defaults=$e.defaults,O.defaultsDeep=$e.defaultsDeep,O.defer=kt.defer,O.delay=kt.delay,O.difference=xe.difference,O.differenceBy=xe.differenceBy,O.differenceWith=xe.differenceWith,O.drop=xe.drop,O.dropRight=xe.dropRight,O.dropRightWhile=xe.dropRightWhile,O.dropWhile=xe.dropWhile,O.fill=xe.fill,O.filter=St.filter,O.flatMap=St.flatMap,O.flatMapDeep=St.flatMapDeep,O.flatMapDepth=St.flatMapDepth,O.flatten=xe.flatten,O.flattenDeep=xe.flattenDeep,O.flattenDepth=xe.flattenDepth,O.flip=kt.flip,O.flow=bt.flow,O.flowRight=bt.flowRight,O.fromPairs=xe.fromPairs,O.functions=$e.functions,O.functionsIn=$e.functionsIn,O.groupBy=St.groupBy,O.initial=xe.initial,O.intersection=xe.intersection,O.intersectionBy=xe.intersectionBy,O.intersectionWith=xe.intersectionWith,O.invert=$e.invert,O.invertBy=$e.invertBy,O.invokeMap=St.invokeMap,O.iteratee=bt.iteratee,O.keyBy=St.keyBy,O.keys=Vt,O.keysIn=$e.keysIn,O.map=St.map,O.mapKeys=$e.mapKeys,O.mapValues=$e.mapValues,O.matches=bt.matches,O.matchesProperty=bt.matchesProperty,O.memoize=kt.memoize,O.merge=$e.merge,O.mergeWith=$e.mergeWith,O.method=bt.method,O.methodOf=bt.methodOf,O.mixin=_d,O.negate=el,O.nthArg=bt.nthArg,O.omit=$e.omit,O.omitBy=$e.omitBy,O.once=kt.once,O.orderBy=St.orderBy,O.over=bt.over,O.overArgs=kt.overArgs,O.overEvery=bt.overEvery,O.overSome=bt.overSome,O.partial=kt.partial,O.partialRight=kt.partialRight,O.partition=St.partition,O.pick=$e.pick,O.pickBy=$e.pickBy,O.property=bt.property,O.propertyOf=bt.propertyOf,O.pull=xe.pull,O.pullAll=xe.pullAll,O.pullAllBy=xe.pullAllBy,O.pullAllWith=xe.pullAllWith,O.pullAt=xe.pullAt,O.range=bt.range,O.rangeRight=bt.rangeRight,O.rearg=kt.rearg,O.reject=St.reject,O.remove=xe.remove,O.rest=kt.rest,O.reverse=xe.reverse,O.sampleSize=St.sampleSize,O.set=$e.set,O.setWith=$e.setWith,O.shuffle=St.shuffle,O.slice=xe.slice,O.sortBy=St.sortBy,O.sortedUniq=xe.sortedUniq,O.sortedUniqBy=xe.sortedUniqBy,O.split=mt.split,O.spread=kt.spread,O.tail=xe.tail,O.take=xe.take,O.takeRight=xe.takeRight,O.takeRightWhile=xe.takeRightWhile,O.takeWhile=xe.takeWhile,O.tap=Rr.tap,O.throttle=kt.throttle,O.thru=al,O.toArray=De.toArray,O.toPairs=$e.toPairs,O.toPairsIn=$e.toPairsIn,O.toPath=bt.toPath,O.toPlainObject=De.toPlainObject,O.transform=$e.transform,O.unary=kt.unary,O.union=xe.union,O.unionBy=xe.unionBy,O.unionWith=xe.unionWith,O.uniq=xe.uniq,O.uniqBy=xe.uniqBy,O.uniqWith=xe.uniqWith,O.unset=$e.unset,O.unzip=xe.unzip,O.unzipWith=xe.unzipWith,O.update=$e.update,O.updateWith=$e.updateWith,O.values=$e.values,O.valuesIn=$e.valuesIn,O.without=xe.without,O.words=mt.words,O.wrap=kt.wrap,O.xor=xe.xor,O.xorBy=xe.xorBy,O.xorWith=xe.xorWith,O.zip=xe.zip,O.zipObject=xe.zipObject,O.zipObjectDeep=xe.zipObjectDeep,O.zipWith=xe.zipWith,O.entries=$e.toPairs,O.entriesIn=$e.toPairsIn,O.extend=$e.assignIn,O.extendWith=$e.assignInWith,_d(O,O),O.add=hn.add,O.attempt=bt.attempt,O.camelCase=mt.camelCase,O.capitalize=mt.capitalize,O.ceil=hn.ceil,O.clamp=yd.clamp,O.clone=De.clone,O.cloneDeep=De.cloneDeep,O.cloneDeepWith=De.cloneDeepWith,O.cloneWith=De.cloneWith,O.conformsTo=De.conformsTo,O.deburr=mt.deburr,O.defaultTo=bt.defaultTo,O.divide=hn.divide,O.endsWith=mt.endsWith,O.eq=De.eq,O.escape=mt.escape,O.escapeRegExp=mt.escapeRegExp,O.every=St.every,O.find=St.find,O.findIndex=xe.findIndex,O.findKey=$e.findKey,O.findLast=St.findLast,O.findLastIndex=xe.findLastIndex,O.findLastKey=$e.findLastKey,O.floor=hn.floor,O.forEach=St.forEach,O.forEachRight=St.forEachRight,O.forIn=$e.forIn,O.forInRight=$e.forInRight,O.forOwn=$e.forOwn,O.forOwnRight=$e.forOwnRight,O.get=$e.get,O.gt=De.gt,O.gte=De.gte,O.has=$e.has,O.hasIn=$e.hasIn,O.head=xe.head,O.identity=wn,O.includes=St.includes,O.indexOf=xe.indexOf,O.inRange=yd.inRange,O.invoke=$e.invoke,O.isArguments=De.isArguments,O.isArray=We,O.isArrayBuffer=De.isArrayBuffer,O.isArrayLike=De.isArrayLike,O.isArrayLikeObject=De.isArrayLikeObject,O.isBoolean=De.isBoolean,O.isBuffer=De.isBuffer,O.isDate=De.isDate,O.isElement=De.isElement,O.isEmpty=De.isEmpty,O.isEqual=De.isEqual,O.isEqualWith=De.isEqualWith,O.isError=De.isError,O.isFinite=De.isFinite,O.isFunction=De.isFunction,O.isInteger=De.isInteger,O.isLength=De.isLength,O.isMap=De.isMap,O.isMatch=De.isMatch,O.isMatchWith=De.isMatchWith,O.isNaN=De.isNaN,O.isNative=De.isNative,O.isNil=De.isNil,O.isNull=De.isNull,O.isNumber=De.isNumber,O.isObject=Rt,O.isObjectLike=De.isObjectLike,O.isPlainObject=De.isPlainObject,O.isRegExp=De.isRegExp,O.isSafeInteger=De.isSafeInteger,O.isSet=De.isSet,O.isString=De.isString,O.isSymbol=De.isSymbol,O.isTypedArray=De.isTypedArray,O.isUndefined=De.isUndefined,O.isWeakMap=De.isWeakMap,O.isWeakSet=De.isWeakSet,O.join=xe.join,O.kebabCase=mt.kebabCase,O.last=kn,O.lastIndexOf=xe.lastIndexOf,O.lowerCase=mt.lowerCase,O.lowerFirst=mt.lowerFirst,O.lt=De.lt,O.lte=De.lte,O.max=hn.max,O.maxBy=hn.maxBy,O.mean=hn.mean,O.meanBy=hn.meanBy,O.min=hn.min,O.minBy=hn.minBy,O.stubArray=bt.stubArray,O.stubFalse=bt.stubFalse,O.stubObject=bt.stubObject,O.stubString=bt.stubString,O.stubTrue=bt.stubTrue,O.multiply=hn.multiply,O.nth=xe.nth,O.noop=bt.noop,O.now=xL.now,O.pad=mt.pad,O.padEnd=mt.padEnd,O.padStart=mt.padStart,O.parseInt=mt.parseInt,O.random=yd.random,O.reduce=St.reduce,O.reduceRight=St.reduceRight,O.repeat=mt.repeat,O.replace=mt.replace,O.result=$e.result,O.round=hn.round,O.sample=St.sample,O.size=St.size,O.snakeCase=mt.snakeCase,O.some=St.some,O.sortedIndex=xe.sortedIndex,O.sortedIndexBy=xe.sortedIndexBy,O.sortedIndexOf=xe.sortedIndexOf,O.sortedLastIndex=xe.sortedLastIndex,O.sortedLastIndexBy=xe.sortedLastIndexBy,O.sortedLastIndexOf=xe.sortedLastIndexOf,O.startCase=mt.startCase,O.startsWith=mt.startsWith,O.subtract=hn.subtract,O.sum=hn.sum,O.sumBy=hn.sumBy,O.template=mt.template,O.times=bt.times,O.toFinite=De.toFinite,O.toInteger=Ke,O.toLength=De.toLength,O.toLower=mt.toLower,O.toNumber=De.toNumber,O.toSafeInteger=De.toSafeInteger,O.toString=De.toString,O.toUpper=mt.toUpper,O.trim=mt.trim,O.trimEnd=mt.trimEnd,O.trimStart=mt.trimStart,O.truncate=mt.truncate,O.unescape=mt.unescape,O.uniqueId=bt.uniqueId,O.upperCase=mt.upperCase,O.upperFirst=mt.upperFirst,O.each=St.forEach,O.eachRight=St.forEachRight,O.first=xe.head,_d(O,function(){var t={};return Dr(O,function(e,n){Sm.call(O.prototype,n)||(t[n]=e)}),t}(),{chain:!1}),O.VERSION=DL,(O.templateSettings=mt.templateSettings).imports._=O,Gn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){O[t].placeholder=O}),Gn(["drop","take"],function(t,e){ot.prototype[t]=function(n){n=n===void 0?1:BL(Ke(n),0);var r=this.__filtered__&&!e?new ot(this):this.clone();return r.__filtered__?r.__takeCount__=Am(n,r.__takeCount__):r.__views__.push({size:Am(n,wm),type:t+(r.__dir__<0?"Right":"")}),r},ot.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),Gn(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==RL||n==LL;ot.prototype[t]=function(i){var o=this.clone();return o.__iteratees__.push({iteratee:Ue(i),type:n}),o.__filtered__=o.__filtered__||r,o}}),Gn(["head","last"],function(t,e){var n="take"+(e?"Right":"");ot.prototype[t]=function(){return this[n](1).value()[0]}}),Gn(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");ot.prototype[t]=function(){return this.__filtered__?new ot(this):this[n](1)}}),ot.prototype.compact=function(){return this.filter(wn)},ot.prototype.find=function(t){return this.filter(t).head()},ot.prototype.findLast=function(t){return this.reverse().find(t)},ot.prototype.invokeMap=Je(function(t,e){return typeof t=="function"?new ot(this):this.map(function(n){return ma(n,t,e)})}),ot.prototype.reject=function(t){return this.filter(el(Ue(t)))},ot.prototype.slice=function(t,e){t=Ke(t);var n=this;return n.__filtered__&&(t>0||e<0)?new ot(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==void 0&&(e=Ke(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)},ot.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ot.prototype.toArray=function(){return this.take(wm)},Dr(ot.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=O[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(O.prototype[e]=function(){var a=this.__wrapped__,s=r?[1]:arguments,l=a instanceof ot,u=s[0],c=l||We(a),d=function(y){var x=i.apply(O,ci([y],s));return r&&f?x[0]:x};c&&n&&typeof u=="function"&&u.length!=1&&(l=c=!1);var f=this.__chain__,h=!!this.__actions__.length,v=o&&!f,g=l&&!h;if(!o&&c){a=g?a:new ot(this);var m=t.apply(a,s);return m.__actions__.push({func:al,args:[d],thisArg:void 0}),new Xn(m,f)}return v&&g?t.apply(this,s):(m=this.thru(d),v?r?m.value()[0]:m.value():m)})}),Gn(["pop","push","shift","sort","splice","unshift"],function(t){var e=IL[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);O.prototype[t]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(We(o)?o:[],i)}return this[n](function(a){return e.apply(We(a)?a:[],i)})}}),Dr(ot.prototype,function(t,e){var n=O[e];if(n){var r=n.name+"";Sm.call(uo,r)||(uo[r]=[]),uo[r].push({name:e,func:n})}}),uo[Ps(void 0,PL).name]=[{name:"wrapper",func:void 0}],ot.prototype.clone=EL,ot.prototype.reverse=wL,ot.prototype.value=ML,O.prototype.at=Rr.at,O.prototype.chain=Rr.wrapperChain,O.prototype.commit=Rr.commit,O.prototype.next=Rr.next,O.prototype.plant=Rr.plant,O.prototype.reverse=Rr.reverse,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=Rr.value,O.prototype.first=O.prototype.head,Cm&&(O.prototype[Cm]=Rr.toIterator);const xo=t=>typeof t=="number",jL=t=>oc(t)?!Number.isNaN(Number(t)):!1;var Om;const bd=typeof window<"u",FL=t=>typeof t=="string",$L=()=>{};bd&&((Om=window==null?void 0:window.navigator)!=null&&Om.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Tm(t){return typeof t=="function"?t():p.unref(t)}function HL(t){return t}function Nm(t){return p.getCurrentScope()?(p.onScopeDispose(t),!0):!1}function zL(t,e=!0){p.getCurrentInstance()?p.onMounted(t):e?t():p.nextTick(t)}function Mm(t){var e;const n=Tm(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Dm=bd?window:void 0;function xd(...t){let e,n,r,i;if(FL(t[0])||Array.isArray(t[0])?([n,r,i]=t,e=Dm):[e,n,r,i]=t,!e)return $L;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,d,f,h)=>(c.addEventListener(d,f,h),()=>c.removeEventListener(d,f,h)),l=p.watch(()=>[Mm(e),Tm(i)],([c,d])=>{a(),c&&o.push(...n.flatMap(f=>r.map(h=>s(c,f,h,d))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return Nm(u),u}function WL(t,e=!1){const n=p.ref(),r=()=>n.value=!!t();return r(),zL(r,e),n}const Pm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Rm="__vueuse_ssr_handlers__";Pm[Rm]=Pm[Rm]||{};var Lm=Object.getOwnPropertySymbols,UL=Object.prototype.hasOwnProperty,VL=Object.prototype.propertyIsEnumerable,XL=(t,e)=>{var n={};for(var r in t)UL.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Lm)for(var r of Lm(t))e.indexOf(r)<0&&VL.call(t,r)&&(n[r]=t[r]);return n};function GL(t,e,n={}){const r=n,{window:i=Dm}=r,o=XL(r,["window"]);let a;const s=WL(()=>i&&"ResizeObserver"in i),l=()=>{a&&(a.disconnect(),a=void 0)},u=p.watch(()=>Mm(t),d=>{l(),s.value&&i&&d&&(a=new ResizeObserver(e),a.observe(d,o))},{immediate:!0,flush:"post"}),c=()=>{l(),u()};return Nm(c),{isSupported:s,stop:c}}var Im;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(Im||(Im={}));var YL=Object.defineProperty,km=Object.getOwnPropertySymbols,KL=Object.prototype.hasOwnProperty,qL=Object.prototype.propertyIsEnumerable,Bm=(t,e,n)=>e in t?YL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ZL=(t,e)=>{for(var n in e||(e={}))KL.call(e,n)&&Bm(t,n,e[n]);if(km)for(var n of km(e))qL.call(e,n)&&Bm(t,n,e[n]);return t};ZL({linear:HL},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});class jm extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function JL(t,e){throw new jm(`[${t}] ${e}`)}function Ed(t,e){if(process.env.NODE_ENV!=="production"){const n=oc(t)?new jm(`[${t}] ${e}`):t;console.warn(n)}}const Fm="__epPropKey",QL=t=>t,eI=t=>ac(t)&&!!t[Fm],tI=(t,e)=>{if(!ac(t)||eI(t))return t;const{values:n,required:r,default:i,type:o,validator:a}=t,l={type:o,required:!!r,validator:n||a?u=>{let c=!1,d=[];if(n&&(d=Array.from(n),nh(t,"default")&&d.push(i),c||(c=d.includes(u))),a&&(c||(c=a(u))),!c&&d.length>0){const f=[...new Set(d)].map(h=>JSON.stringify(h)).join(", ");p.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${f}], got value ${JSON.stringify(u)}.`)}return c}:void 0,[Fm]:!0};return nh(t,"default")&&(l.default=i),l},sl=t=>Dv(Object.entries(t).map(([e,n])=>[e,tI(n,e)]));var wd=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n};const nI="utils/dom/style";function $m(t,e="px"){if(!t)return"";if(xo(t)||jL(t))return`${t}${e}`;if(oc(t))return t;Ed(nI,"binding value must be a string or number")}const rI=(t,e)=>(t.install=n=>{for(const r of[t,...Object.values({})])n.component(r.name,r)},t),iI=sl({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),oI=t=>gi(iI,t),Eo=4,aI={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},sI=({move:t,size:e,bar:n})=>({[n.size]:e,transform:`translate${n.axis}(${t}%)`}),Sd=Symbol("scrollbarContextKey"),lI=sl({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),uI="Thumb";var Hm=wd(p.defineComponent({__name:"thumb",props:lI,setup(t){const e=t,n=p.inject(Sd),r=th("scrollbar");n||JL(uI,"can not inject scrollbar context");const i=p.ref(),o=p.ref(),a=p.ref({}),s=p.ref(!1);let l=!1,u=!1,c=bd?document.onselectstart:null;const d=p.computed(()=>aI[e.vertical?"vertical":"horizontal"]),f=p.computed(()=>sI({size:e.size,move:e.move,bar:d.value})),h=p.computed(()=>i.value[d.value.offset]**2/n.wrapElement[d.value.scrollSize]/e.ratio/o.value[d.value.offset]),v=A=>{var S;if(A.stopPropagation(),A.ctrlKey||[1,2].includes(A.button))return;(S=window.getSelection())==null||S.removeAllRanges(),m(A);const M=A.currentTarget;M&&(a.value[d.value.axis]=M[d.value.offset]-(A[d.value.client]-M.getBoundingClientRect()[d.value.direction]))},g=A=>{if(!o.value||!i.value||!n.wrapElement)return;const S=Math.abs(A.target.getBoundingClientRect()[d.value.direction]-A[d.value.client]),M=o.value[d.value.offset]/2,C=(S-M)*100*h.value/i.value[d.value.offset];n.wrapElement[d.value.scroll]=C*n.wrapElement[d.value.scrollSize]/100},m=A=>{A.stopImmediatePropagation(),l=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",x),c=document.onselectstart,document.onselectstart=()=>!1},y=A=>{if(!i.value||!o.value||l===!1)return;const S=a.value[d.value.axis];if(!S)return;const M=(i.value.getBoundingClientRect()[d.value.direction]-A[d.value.client])*-1,C=o.value[d.value.offset]-S,G=(M-C)*100*h.value/i.value[d.value.offset];n.wrapElement[d.value.scroll]=G*n.wrapElement[d.value.scrollSize]/100},x=()=>{l=!1,a.value[d.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",x),T(),u&&(s.value=!1)},E=()=>{u=!1,s.value=!!e.size},b=()=>{u=!0,s.value=l};p.onBeforeUnmount(()=>{T(),document.removeEventListener("mouseup",x)});const T=()=>{document.onselectstart!==c&&(document.onselectstart=c)};return xd(p.toRef(n,"scrollbarElement"),"mousemove",E),xd(p.toRef(n,"scrollbarElement"),"mouseleave",b),(A,S)=>(p.openBlock(),p.createBlock(p.Transition,{name:p.unref(r).b("fade"),persisted:""},{default:p.withCtx(()=>[p.withDirectives(p.createElementVNode("div",{ref_key:"instance",ref:i,class:p.normalizeClass([p.unref(r).e("bar"),p.unref(r).is(p.unref(d).key)]),onMousedown:g},[p.createElementVNode("div",{ref_key:"thumb",ref:o,class:p.normalizeClass(p.unref(r).e("thumb")),style:p.normalizeStyle(p.unref(f)),onMousedown:v},null,38)],34),[[p.vShow,A.always||s.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const cI=sl({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var dI=wd(p.defineComponent({__name:"bar",props:cI,setup(t,{expose:e}){const n=t,r=p.inject(Sd),i=p.ref(0),o=p.ref(0),a=p.ref(""),s=p.ref(""),l=p.ref(1),u=p.ref(1);return e({handleScroll:f=>{if(f){const h=f.offsetHeight-Eo,v=f.offsetWidth-Eo;o.value=f.scrollTop*100/h*l.value,i.value=f.scrollLeft*100/v*u.value}},update:()=>{const f=r==null?void 0:r.wrapElement;if(!f)return;const h=f.offsetHeight-Eo,v=f.offsetWidth-Eo,g=h**2/f.scrollHeight,m=v**2/f.scrollWidth,y=Math.max(g,n.minSize),x=Math.max(m,n.minSize);l.value=g/(h-g)/(y/(h-y)),u.value=m/(v-m)/(x/(v-x)),s.value=y+Eo<h?`${y}px`:"",a.value=x+Eo<v?`${x}px`:""}}),(f,h)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(Hm,{move:i.value,ratio:u.value,size:a.value,always:f.always},null,8,["move","ratio","size","always"]),p.createVNode(Hm,{move:o.value,ratio:l.value,size:s.value,vertical:"",always:f.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const fI=sl({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:QL([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...oI(["ariaLabel","ariaOrientation"])}),pI={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(xo)},Cd="ElScrollbar",hI=p.defineComponent({name:Cd}),gI=p.defineComponent({...hI,props:fI,emits:pI,setup(t,{expose:e,emit:n}){const r=t,i=th("scrollbar");let o,a,s=0,l=0;const u=p.ref(),c=p.ref(),d=p.ref(),f=p.ref(),h=p.computed(()=>{const T={};return r.height&&(T.height=$m(r.height)),r.maxHeight&&(T.maxHeight=$m(r.maxHeight)),[r.wrapStyle,T]}),v=p.computed(()=>[r.wrapClass,i.e("wrap"),{[i.em("wrap","hidden-default")]:!r.native}]),g=p.computed(()=>[i.e("view"),r.viewClass]),m=()=>{var T;c.value&&((T=f.value)==null||T.handleScroll(c.value),s=c.value.scrollTop,l=c.value.scrollLeft,n("scroll",{scrollTop:c.value.scrollTop,scrollLeft:c.value.scrollLeft}))};function y(T,A){ac(T)?c.value.scrollTo(T):xo(T)&&xo(A)&&c.value.scrollTo(T,A)}const x=T=>{if(!xo(T)){Ed(Cd,"value must be a number");return}c.value.scrollTop=T},E=T=>{if(!xo(T)){Ed(Cd,"value must be a number");return}c.value.scrollLeft=T},b=()=>{var T;(T=f.value)==null||T.update()};return p.watch(()=>r.noresize,T=>{T?(o==null||o(),a==null||a()):({stop:o}=GL(d,b),a=xd("resize",b))},{immediate:!0}),p.watch(()=>[r.maxHeight,r.height],()=>{r.native||p.nextTick(()=>{var T;b(),c.value&&((T=f.value)==null||T.handleScroll(c.value))})}),p.provide(Sd,p.reactive({scrollbarElement:u,wrapElement:c})),p.onActivated(()=>{c.value&&(c.value.scrollTop=s,c.value.scrollLeft=l)}),p.onMounted(()=>{r.native||p.nextTick(()=>{b()})}),p.onUpdated(()=>b()),e({wrapRef:c,update:b,scrollTo:y,setScrollTop:x,setScrollLeft:E,handleScroll:m}),(T,A)=>(p.openBlock(),p.createElementBlock("div",{ref_key:"scrollbarRef",ref:u,class:p.normalizeClass(p.unref(i).b())},[p.createElementVNode("div",{ref_key:"wrapRef",ref:c,class:p.normalizeClass(p.unref(v)),style:p.normalizeStyle(p.unref(h)),tabindex:T.tabindex,onScroll:m},[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(T.tag),{id:T.id,ref_key:"resizeRef",ref:d,class:p.normalizeClass(p.unref(g)),style:p.normalizeStyle(T.viewStyle),role:T.role,"aria-label":T.ariaLabel,"aria-orientation":T.ariaOrientation},{default:p.withCtx(()=>[p.renderSlot(T.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),T.native?p.createCommentVNode("v-if",!0):(p.openBlock(),p.createBlock(dI,{key:0,ref_key:"barRef",ref:f,always:T.always,"min-size":T.minSize},null,8,["always","min-size"]))],2))}});var vI=wd(gI,[["__file","scrollbar.vue"]]);const zm=rI(vI);function Zn(t,e){mI(t)&&(t="100%");var n=yI(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function mI(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function yI(t){return typeof t=="string"&&t.indexOf("%")!==-1}function _I(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ll(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Ad(t){return t.length===1?"0"+t:String(t)}function bI(t,e,n){return{r:Zn(t,255)*255,g:Zn(e,255)*255,b:Zn(n,255)*255}}function Od(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function xI(t,e,n){var r,i,o;if(t=Zn(t,360),e=Zn(e,100),n=Zn(n,100),e===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+e):n+e-n*e,s=2*n-a;r=Od(s,a,t+1/3),i=Od(s,a,t),o=Od(s,a,t-1/3)}return{r:r*255,g:i*255,b:o*255}}function EI(t,e,n){t=Zn(t,255),e=Zn(e,255),n=Zn(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case t:o=(e-n)/s+(e<n?6:0);break;case e:o=(n-t)/s+2;break;case n:o=(t-e)/s+4;break}o/=6}return{h:o,s:l,v:a}}function wI(t,e,n){t=Zn(t,360)*6,e=Zn(e,100),n=Zn(n,100);var r=Math.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),l=r%6,u=[n,a,o,o,s,n][l],c=[s,n,n,a,o,o][l],d=[o,o,s,n,n,a][l];return{r:u*255,g:c*255,b:d*255}}function SI(t,e,n,r){var i=[Ad(Math.round(t).toString(16)),Ad(Math.round(e).toString(16)),Ad(Math.round(n).toString(16))];return i.join("")}function Wm(t){return jn(t)/255}function jn(t){return parseInt(t,16)}var Um={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function _a(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof t=="string"&&(t=OI(t)),typeof t=="object"&&(Jr(t.r)&&Jr(t.g)&&Jr(t.b)?(e=bI(t.r,t.g,t.b),a=!0,s=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Jr(t.h)&&Jr(t.s)&&Jr(t.v)?(r=ll(t.s),i=ll(t.v),e=wI(t.h,r,i),a=!0,s="hsv"):Jr(t.h)&&Jr(t.s)&&Jr(t.l)&&(r=ll(t.s),o=ll(t.l),e=xI(t.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=_I(n),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var CI="[-\\+]?\\d+%?",AI="[-\\+]?\\d*\\.\\d+%?",mi="(?:".concat(AI,")|(?:").concat(CI,")"),Td="[\\s|\\(]+(".concat(mi,")[,|\\s]+(").concat(mi,")[,|\\s]+(").concat(mi,")\\s*\\)?"),Nd="[\\s|\\(]+(".concat(mi,")[,|\\s]+(").concat(mi,")[,|\\s]+(").concat(mi,")[,|\\s]+(").concat(mi,")\\s*\\)?"),fr={CSS_UNIT:new RegExp(mi),rgb:new RegExp("rgb"+Td),rgba:new RegExp("rgba"+Nd),hsl:new RegExp("hsl"+Td),hsla:new RegExp("hsla"+Nd),hsv:new RegExp("hsv"+Td),hsva:new RegExp("hsva"+Nd),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function OI(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(Um[t])t=Um[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=fr.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=fr.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=fr.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=fr.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=fr.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=fr.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=fr.hex8.exec(t),n?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),a:Wm(n[4]),format:e?"name":"hex8"}:(n=fr.hex6.exec(t),n?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),format:e?"name":"hex"}:(n=fr.hex4.exec(t),n?{r:jn(n[1]+n[1]),g:jn(n[2]+n[2]),b:jn(n[3]+n[3]),a:Wm(n[4]+n[4]),format:e?"name":"hex8"}:(n=fr.hex3.exec(t),n?{r:jn(n[1]+n[1]),g:jn(n[2]+n[2]),b:jn(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function Jr(t){return!!fr.CSS_UNIT.exec(String(t))}function ul(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function TI(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}const cl=Symbol("wf-bus"),NI={class:"wrapper"},MI={class:"content"},DI=["textContent"],PI=p.defineComponent({__name:"BpmnDetail",props:{data:{type:Object,required:!0}},setup(t){const e=t,n=p.ref("1"),r=p.ref(),i=p.ref();function o(){var u;if(!((u=e.data)!=null&&u.code))return;const s=n.value,l={code:e.data.code,type:s};Gt.getBpmnDetail(l).then(c=>{c.code===0&&(s==="1"?r.value="data:image/png;base64,"+c.result:i.value=c.result)})}function a(){o()}return p.onMounted(()=>{o()}),(s,l)=>{const u=ie.RadioButton,c=ie.RadioGroup,d=ie.Image;return p.openBlock(),p.createElementBlock("div",NI,[p.createVNode(c,{value:p.unref(n),"onUpdate:value":l[0]||(l[0]=f=>p.isRef(n)?n.value=f:null),class:"flex-ec mr-sm mt-sm",onChange:a},{default:p.withCtx(()=>[p.createVNode(u,{value:"1"},{default:p.withCtx(()=>l[1]||(l[1]=[p.createTextVNode("png")])),_:1}),p.createVNode(u,{value:"0"},{default:p.withCtx(()=>l[2]||(l[2]=[p.createTextVNode("xml")])),_:1})]),_:1},8,["value"]),p.createElementVNode("div",MI,[p.unref(n)==="1"?(p.openBlock(),p.createBlock(d,{key:0,src:p.unref(r)},null,8,["src"])):(p.openBlock(),p.createElementBlock("span",{key:1,textContent:p.toDisplayString(p.unref(i))},null,8,DI))])])}}}),Qr=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},RI=Qr(PI,[["__scopeId","data-v-248c7b10"]]),LI={class:"panel-left"},II={class:"title"},kI={class:"search-box"},BI={key:2,class:"btns-action"},jI=Qr(p.defineComponent({__name:"BusTypeList",setup(t){const{t:e}=Dn.useI18n(),n=p.ref(),r=p.ref([]),i=p.ref([]),o=p.ref([]),a=p.ref(!0);function s(){var M;o.value=[],r.value=[],i.value=[],(M=v.value)==null||M.reset(),u()}function l(M){if(!Array.isArray(M)||M.length===0)return M||[];function C(G){if(!G||typeof G!="object")return G;const K={...G};return K.title!==void 0&&K.key!==void 0&&(K.title=e(`temp.title${K.key}`)),Array.isArray(K.children)&&K.children.length>0&&(K.children=K.children.map(C)),K}return M.map(C)}function u(M){const C={sync:!0};n.value&&Object.assign(C,{description:n.value}),Gt.getBusTypeTree(C).then(G=>{var K;if(G.code===0){const J=G.result||[];o.value=l(J),J.length&&(r.value=[J[0].key],(K=J[0].children)!=null&&K.length&&(i.value=[J[0].children[0].key],a.value=J[0].children[0].type=="1",g()))}})}const c=p.inject(cl);function d(M,C){C.selected&&C.node.dataRef.isLeaf&&(i.value=M,a.value=C.node.dataRef.type=="1",g())}const f=p.ref([{title:e("bpmn.version"),dataIndex:"version",width:100},{title:e("bpmn.description"),dataIndex:"description",width:250},{title:e("bpmn.used"),dataIndex:"used",width:130},{title:e("bpmn.status"),dataIndex:"status",width:130},{title:e("bpmn.action"),key:"action",width:200,fixed:"right"}]);function h(M){const C={type:i.value[0]};return Object.assign(C,M),Gt.getBpmnList(C)}const v=p.ref(),g=()=>{var M;(M=v.value)==null||M.refresh()},{message:m,modal:y}=Wt.App.useApp();function x(M,C){y.confirm({title:e("button._006_msg1"),content:e(C==="0"?"button._006_msg2":"button._006_msg3"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const G={code:M.code,status:C};Gt.switchBpmnStatus(G).then(K=>{K.code===0&&(g(),m.success(e("common.successTip")))})}})}function E(){c.emit("changeComp",{comp:"BpmnEditPage",opType:"1",type:i.value[0],isApproval:a.value})}function b(M){c.emit("changeComp",{comp:"BpmnEditPage",opType:"2",code:M.code,type:M.type,isApproval:a.value})}function T(M){c.emit("changeComp",{comp:"BpmnEditPage",opType:"3",type:i.value[0],code:M.code,isApproval:a.value})}function A(M){y.confirm({title:e("button._006_msg1"),content:e("button._004_msg2"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const C={code:M.code};Gt.delBpmn(C).then(G=>{G.code===0&&(g(),m.success(e("common.successTip")))})}})}function S(M){y.info({title:e("wo_list.btn_chart"),content:p.h(RI,{data:M}),centered:!0,footer:null,icon:null,closable:!0,maskClosable:!0,width:1e3,class:"modal-comp"})}return p.onMounted(()=>{s(),p.onActivated(()=>{var M;(M=v.value)==null||M.loadData()})}),(M,C)=>{const G=ie.InputSearch,K=ie.Tree,J=ie.Empty,R=zm,k=ie.Button,B=ie.Space,Z=yE,ee=ie.Switch,ce=p.resolveComponent("a-table-ex"),Be=p.resolveComponent("wl-splitter"),me=p.resolveDirective("permission");return p.openBlock(),p.createBlock(Be,{bordered:!1},{left:p.withCtx(()=>[p.createElementVNode("div",LI,[p.createElementVNode("div",II,p.toDisplayString(M.$t("bpmn.list_title")),1),p.createElementVNode("div",kI,[p.createVNode(G,{value:p.unref(n),"onUpdate:value":C[0]||(C[0]=de=>p.isRef(n)?n.value=de:null),placeholder:M.$t("bpmn.type_placeholder"),onSearch:s},null,8,["value","placeholder"])]),p.createVNode(R,{class:"tree-wrapper"},{default:p.withCtx(()=>{var de;return[(de=p.unref(o))!=null&&de.length?(p.openBlock(),p.createBlock(K,{key:0,expandedKeys:p.unref(r),"onUpdate:expandedKeys":C[1]||(C[1]=Se=>p.isRef(r)?r.value=Se:null),selectedKeys:p.unref(i),"tree-data":p.unref(o),showLine:!0,onSelect:d},null,8,["expandedKeys","selectedKeys","tree-data"])):(p.openBlock(),p.createBlock(J,{key:1,imageStyle:{height:"64px"}}))]}),_:1})])]),right:p.withCtx(()=>[p.createVNode(B,{class:"ml-lg my-nm"},{default:p.withCtx(()=>[p.withDirectives((p.openBlock(),p.createBlock(k,{type:"primary",onClick:E},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("bpmn.add_workflow")),1)]),_:1})),[[me,"002"]])]),_:1}),p.createVNode(ce,{ref_key:"tableEx",ref:v,class:"table-query bordered mx-lg",columns:p.unref(f),scroll:{x:1100},loadData:h},{bodyCell:p.withCtx(({column:de,record:Se,text:je})=>[de.dataIndex==="used"?(p.openBlock(),p.createBlock(Z,{key:0,type:"BPMN_USED",value:je},null,8,["value"])):p.createCommentVNode("",!0),de.dataIndex==="status"?(p.openBlock(),p.createBlock(ee,{key:1,checked:je,checkedValue:"0",unCheckedValue:"1",disabled:!p.unref(bs.hasPermission)("006"),onChange:he=>x(Se,he)},null,8,["checked","disabled","onChange"])):p.createCommentVNode("",!0),de.key==="action"?(p.openBlock(),p.createElementBlock("div",BI,[p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>b(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("common.btn_edit")),1)]),_:2},1032,["onClick"])),[[me,"003"]]),p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>A(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("common.btn_del")),1)]),_:2},1032,["onClick"])),[[me,"004"]]),p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>S(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("wo_my.btn_detail")),1)]),_:2},1032,["onClick"])),[[me,"005"]]),p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>T(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("bpmn.btn_clone")),1)]),_:2},1032,["onClick"])),[[me,"002"]])])):p.createCommentVNode("",!0)]),_:1},8,["columns"])]),_:1})}}}),[["__scopeId","data-v-8a3cde47"]]);var dl,qe,Vm,Wi,Xm,Gm,Ym,Km,Md,Dd,Pd,ba={},qm=[],FI=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,xa=Array.isArray;function ei(t,e){for(var n in e)t[n]=e[n];return t}function Rd(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Te(t,e,n){var r,i,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?dl.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]==null&&(a[o]=t.defaultProps[o]);return fl(t,a,r,i,null)}function fl(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Vm,__i:-1,__u:0};return i==null&&qe.vnode!=null&&qe.vnode(o),o}function pl(){return{current:null}}function wo(t){return t.children}function Qe(t,e){this.props=t,this.context=e}function So(t,e){if(e==null)return t.__?So(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?So(t):null}function Zm(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Zm(t)}}function Jm(t){(!t.__d&&(t.__d=!0)&&Wi.push(t)&&!hl.__r++||Xm!=qe.debounceRendering)&&((Xm=qe.debounceRendering)||Gm)(hl)}function hl(){for(var t,e,n,r,i,o,a,s=1;Wi.length;)Wi.length>s&&Wi.sort(Ym),t=Wi.shift(),s=Wi.length,t.__d&&(n=void 0,i=(r=(e=t).__v).__e,o=[],a=[],e.__P&&((n=ei({},r)).__v=r.__v+1,qe.vnode&&qe.vnode(n),Ld(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,o,i??So(r),!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,ry(o,n,a),n.__e!=i&&Zm(n)));hl.__r=0}function Qm(t,e,n,r,i,o,a,s,l,u,c){var d,f,h,v,g,m,y=r&&r.__k||qm,x=e.length;for(l=$I(n,e,y,l,x),d=0;d<x;d++)(h=n.__k[d])!=null&&(f=h.__i==-1?ba:y[h.__i]||ba,h.__i=d,m=Ld(t,h,f,i,o,a,s,l,u,c),v=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Id(f.ref,null,h),c.push(h.ref,h.__c||v,h)),g==null&&v!=null&&(g=v),4&h.__u||f.__k===h.__k?l=ey(h,l,t):typeof h.type=="function"&&m!==void 0?l=m:v&&(l=v.nextSibling),h.__u&=-7);return n.__e=g,l}function $I(t,e,n,r,i){var o,a,s,l,u,c=n.length,d=c,f=0;for(t.__k=new Array(i),o=0;o<i;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=o+f,(a=t.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?fl(null,a,null,null,null):xa(a)?fl(wo,{children:a},null,null,null):a.constructor==null&&a.__b>0?fl(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=t,a.__b=t.__b+1,s=null,(u=a.__i=HI(a,n,l,d))!=-1&&(d--,(s=n[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(i>c?f--:i<c&&f++),typeof a.type!="function"&&(a.__u|=4)):u!=l&&(u==l-1?f--:u==l+1?f++:(u>l?f--:f++,a.__u|=4))):t.__k[o]=null;if(d)for(o=0;o<c;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=So(s)),oy(s,s));return r}function ey(t,e,n){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=ey(r[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=So(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function gl(t,e){return e=e||[],t==null||typeof t=="boolean"||(xa(t)?t.some(function(n){gl(n,e)}):e.push(t)),e}function HI(t,e,n,r){var i,o,a=t.key,s=t.type,l=e[n];if(l===null&&t.key==null||l&&a==l.key&&s==l.type&&(2&l.__u)==0)return n;if(r>(l!=null&&(2&l.__u)==0?1:0))for(i=n-1,o=n+1;i>=0||o<e.length;){if(i>=0){if((l=e[i])&&(2&l.__u)==0&&a==l.key&&s==l.type)return i;i--}if(o<e.length){if((l=e[o])&&(2&l.__u)==0&&a==l.key&&s==l.type)return o;o++}}return-1}function ty(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||FI.test(e)?n:n+"px"}function vl(t,e,n,r,i){var o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ty(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||ty(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(Km,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=Md,t.addEventListener(e,o?Pd:Dd,o)):t.removeEventListener(e,o?Pd:Dd,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ny(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Md++;else if(e.t<n.u)return;return n(qe.event?qe.event(e):e)}}}function Ld(t,e,n,r,i,o,a,s,l,u){var c,d,f,h,v,g,m,y,x,E,b,T,A,S,M,C,G,K=e.type;if(e.constructor!=null)return null;128&n.__u&&(l=!!(32&n.__u),o=[s=e.__e=n.__e]),(c=qe.__b)&&c(e);e:if(typeof K=="function")try{if(y=e.props,x="prototype"in K&&K.prototype.render,E=(c=K.contextType)&&r[c.__c],b=c?E?E.props.value:c.__:r,n.__c?m=(d=e.__c=n.__c).__=d.__E:(x?e.__c=d=new K(y,b):(e.__c=d=new Qe(y,b),d.constructor=K,d.render=WI),E&&E.sub(d),d.props=y,d.state||(d.state={}),d.context=b,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&K.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ei({},d.__s)),ei(d.__s,K.getDerivedStateFromProps(y,d.__s))),h=d.props,v=d.state,d.__v=e,f)x&&K.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(x&&K.getDerivedStateFromProps==null&&y!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(y,b),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(y,d.__s,b)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(J){J&&(J.__=e)}),T=0;T<d._sb.length;T++)d.__h.push(d._sb[T]);d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(y,d.__s,b),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,v,g)})}if(d.context=b,d.props=y,d.__P=t,d.__e=!1,A=qe.__r,S=0,x){for(d.state=d.__s,d.__d=!1,A&&A(e),c=d.render(d.props,d.state,d.context),M=0;M<d._sb.length;M++)d.__h.push(d._sb[M]);d._sb=[]}else do d.__d=!1,A&&A(e),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=ei(ei({},r),d.getChildContext())),x&&!f&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(h,v)),C=c,c!=null&&c.type===wo&&c.key==null&&(C=iy(c.props.children)),s=Qm(t,xa(C)?C:[C],e,n,r,i,o,a,s,l,u),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(J){if(e.__v=null,l||o!=null)if(J.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,e.__e=s}else for(G=o.length;G--;)Rd(o[G]);else e.__e=n.__e,e.__k=n.__k;qe.__e(J,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=zI(n.__e,e,n,r,i,o,a,l,u);return(c=qe.diffed)&&c(e),128&e.__u?void 0:s}function ry(t,e,n){for(var r=0;r<n.length;r++)Id(n[r],n[++r],n[++r]);qe.__c&&qe.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){qe.__e(o,i.__v)}})}function iy(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:xa(t)?t.map(iy):ei({},t)}function zI(t,e,n,r,i,o,a,s,l){var u,c,d,f,h,v,g,m=n.props,y=e.props,x=e.type;if(x=="svg"?i="http://www.w3.org/2000/svg":x=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((h=o[u])&&"setAttribute"in h==!!x&&(x?h.localName==x:h.nodeType==3)){t=h,o[u]=null;break}}if(t==null){if(x==null)return document.createTextNode(y);t=document.createElementNS(i,x,y.is&&y),s&&(qe.__m&&qe.__m(e,o),s=!1),o=null}if(x==null)m===y||s&&t.data==y||(t.data=y);else{if(o=o&&dl.call(t.childNodes),m=n.props||ba,!s&&o!=null)for(m={},u=0;u<t.attributes.length;u++)m[(h=t.attributes[u]).name]=h.value;for(u in m)if(h=m[u],u!="children"){if(u=="dangerouslySetInnerHTML")d=h;else if(!(u in y)){if(u=="value"&&"defaultValue"in y||u=="checked"&&"defaultChecked"in y)continue;vl(t,u,null,h,i)}}for(u in y)h=y[u],u=="children"?f=h:u=="dangerouslySetInnerHTML"?c=h:u=="value"?v=h:u=="checked"?g=h:s&&typeof h!="function"||m[u]===h||vl(t,u,h,m[u],i);if(c)s||d&&(c.__html==d.__html||c.__html==t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),Qm(e.type=="template"?t.content:t,xa(f)?f:[f],e,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:n.__k&&So(n,0),s,l),o!=null)for(u=o.length;u--;)Rd(o[u]);s||(u="value",x=="progress"&&v==null?t.removeAttribute("value"):v!=null&&(v!==t[u]||x=="progress"&&!v||x=="option"&&v!=m[u])&&vl(t,u,v,m[u],i),u="checked",g!=null&&g!=t[u]&&vl(t,u,g,m[u],i))}return t}function Id(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){qe.__e(i,n)}}function oy(t,e,n){var r,i;if(qe.unmount&&qe.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Id(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){qe.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&oy(r[i],e,n||typeof t.type!="function");n||Rd(t.__e),t.__c=t.__=t.__e=void 0}function WI(t,e,n){return this.constructor(t,n)}function UI(t,e,n){var r,i,o,a;e==document&&(e=document.documentElement),qe.__&&qe.__(t,e),i=(r=!1)?null:e.__k,o=[],a=[],Ld(e,t=e.__k=Te(wo,null,[t]),i||ba,ba,e.namespaceURI,i?null:e.firstChild?dl.call(e.childNodes):null,o,i?i.__e:e.firstChild,r,a),ry(o,t,a)}dl=qm.slice,qe={__e:function(t,e,n,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(s){t=s}throw t}},Vm=0,Qe.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ei({},this.state),typeof t=="function"&&(t=t(ei({},n),this.props)),t&&ei(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Jm(this))},Qe.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Jm(this))},Qe.prototype.render=wo,Wi=[],Gm=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ym=function(t,e){return t.__v.__b-e.__v.__b},hl.__r=0,Km=/(PointerCapture)$|Capture$/i,Md=0,Dd=ny(!1),Pd=ny(!0);var VI="An invariant failed, however the error is obfuscated because this is a production build.",ml=[];Object.freeze(ml);var kd={};Object.freeze(kd);function On(){return++pe.mobxGuid}function He(t){throw Mt(!1,t),"X"}function Mt(t,e){if(!t)throw new Error("[mobx] "+(e||VI))}var ay=[];function XI(t,e){return process.env.NODE_ENV==="production"||ay.indexOf(t)!==-1?!1:(ay.push(t),console.error("[mobx] Deprecated: "+t),!0)}function Bd(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var yl=function(){};function GI(t){var e=[];return t.forEach(function(n){e.indexOf(n)===-1&&e.push(n)}),e}function jd(t){return t!==null&&typeof t=="object"}function Ui(t){if(t===null||typeof t!="object")return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function YI(t){if(Ao(t)||gn(t))return t;if(Array.isArray(t))return new Map(t);if(Ui(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return He("Cannot convert to map from '"+t+"'")}function Co(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function KI(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function sy(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||n.configurable!==!1&&n.writable!==!1}function qI(t,e){process.env.NODE_ENV!=="production"&&!sy(t,e)&&He("Cannot make property '"+e.toString()+"' observable, it is not configurable and writable in the target object")}function yi(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(r){return jd(r)&&r[n]===!0}}function Ao(t){return t instanceof Map}function Ea(t){return t instanceof Set}function Fd(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach(function(r){Object.getOwnPropertyDescriptor(t,r).enumerable&&e.add(r)}),Array.from(e)}function Jn(t){return t&&t.toString?t.toString():new String(t).toString()}function ly(t){return t===null?null:typeof t=="object"?""+t:t}var ZI=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,ke=Symbol("mobx administration"),Oo=function(){function t(e){e===void 0&&(e="Atom@"+On()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=vt.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.reportObserved=function(){return Ey(this)},t.prototype.reportChanged=function(){gr(),Ek(this),vr()},t.prototype.toString=function(){return this.name},t}(),$d=yi("Atom",Oo);function Hd(t,e,n){e===void 0&&(e=yl),n===void 0&&(n=yl);var r=new Oo(t);return e!==yl&&Bk(r,e),n!==yl&&My(r,n),r}function JI(t,e){return Yy(t,e)}function QI(t,e){return Object.is(t,e)}var To={structural:JI,default:QI};/*! *****************************************************************************
|
|
33
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
34
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
35
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
36
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
19
37
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
onClick=${l=>c.action&&n(l,c)}
|
|
25
|
-
title=${c.title||c.label}
|
|
26
|
-
data-id=${c.id}
|
|
27
|
-
onMouseEnter=${()=>c.action&&r(c)}
|
|
28
|
-
onMouseLeave=${()=>c.action&&r(null)}
|
|
29
|
-
onFocus=${()=>c.action&&r(c)}
|
|
30
|
-
onBlur=${()=>c.action&&r(null)}
|
|
31
|
-
>
|
|
32
|
-
${c.imageUrl&&Be`<img class="djs-popup-entry-icon" src=${c.imageUrl} alt="" />`||c.imageHtml&&Be`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:c.imageHtml}} />`}
|
|
33
|
-
${c.label?Be`
|
|
34
|
-
<span class="djs-popup-label">${c.label}</span>
|
|
35
|
-
`:null}
|
|
36
|
-
</${c.action?"button":"span"}>
|
|
37
|
-
</li>
|
|
38
|
-
`)}
|
|
39
|
-
</ul>
|
|
40
|
-
`)}
|
|
41
|
-
</div>
|
|
42
|
-
`}function HC(e){return e.reduce((t,n)=>{const i=n.group||"default",r=t.find(o=>o.id===i);return r?r.entries.push(n):t.push({id:i,entries:[n]}),t},[])}function VC(e,t){return Wa("entry",e.className,e.active?"active":"",e.disabled?"disabled":"",t?"selected":"")}function zC(e){const{entry:t,selected:n,onMouseEnter:i,onMouseLeave:r,onAction:o}=e;return Be`
|
|
43
|
-
<li
|
|
44
|
-
class=${Wa("entry",{selected:n})}
|
|
45
|
-
data-id=${t.id}
|
|
46
|
-
title=${t.title||t.label}
|
|
47
|
-
tabIndex="0"
|
|
48
|
-
onClick=${o}
|
|
49
|
-
onFocus=${i}
|
|
50
|
-
onBlur=${r}
|
|
51
|
-
onMouseEnter=${i}
|
|
52
|
-
onMouseLeave=${r}
|
|
53
|
-
onDragStart=${a=>o(a,t,"dragstart")}
|
|
54
|
-
draggable=${!0}
|
|
55
|
-
>
|
|
56
|
-
<div class="djs-popup-entry-content">
|
|
57
|
-
<span
|
|
58
|
-
class=${Wa("djs-popup-entry-name",t.className)}
|
|
59
|
-
>
|
|
60
|
-
${t.imageUrl&&Be`<img class="djs-popup-entry-icon" src=${t.imageUrl} alt="" />`||t.imageHtml&&Be`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:t.imageHtml}} />`}
|
|
38
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
39
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
40
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
41
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
61
42
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
${t.label}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</span>
|
|
68
|
-
${t.description&&Be`
|
|
69
|
-
<span
|
|
70
|
-
class="djs-popup-entry-description"
|
|
71
|
-
title=${t.description}
|
|
72
|
-
>
|
|
73
|
-
${t.description}
|
|
74
|
-
</span>
|
|
75
|
-
`}
|
|
76
|
-
</div>
|
|
77
|
-
${t.documentationRef&&Be`
|
|
78
|
-
<div class="djs-popup-entry-docs">
|
|
79
|
-
<a
|
|
80
|
-
href="${t.documentationRef}"
|
|
81
|
-
onClick=${a=>a.stopPropagation()}
|
|
82
|
-
title="Open element documentation"
|
|
83
|
-
target="_blank"
|
|
84
|
-
rel="noopener"
|
|
85
|
-
>
|
|
86
|
-
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
87
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.6368 10.6375V5.91761H11.9995V10.6382C11.9995 10.9973 11.8623 11.3141 11.5878 11.5885C11.3134 11.863 10.9966 12.0002 10.6375 12.0002H1.36266C0.982345 12.0002 0.660159 11.8681 0.396102 11.6041C0.132044 11.34 1.52588e-05 11.0178 1.52588e-05 10.6375V1.36267C1.52588e-05 0.98236 0.132044 0.660173 0.396102 0.396116C0.660159 0.132058 0.982345 2.95639e-05 1.36266 2.95639e-05H5.91624V1.36267H1.36266V10.6375H10.6368ZM12 0H7.2794L7.27873 1.36197H9.68701L3.06507 7.98391L4.01541 8.93425L10.6373 2.31231V4.72059H12V0Z" fill="#818798"/>
|
|
88
|
-
</svg>
|
|
89
|
-
</a>
|
|
90
|
-
</div>
|
|
91
|
-
`}
|
|
92
|
-
</li>
|
|
93
|
-
`}function WC(e){const{selectedEntry:t,setSelectedEntry:n,entries:i,...r}=e,o=jh(),a=sr(()=>UC(i),[i]);return _l(()=>{const s=o.current;if(!s)return;const c=s.querySelector(".selected");c&&GC(c)},[t]),Be`
|
|
94
|
-
<div class="djs-popup-results" ref=${o}>
|
|
95
|
-
${a.map(s=>Be`
|
|
96
|
-
${s.name&&Be`
|
|
97
|
-
<div key=${s.id} class="entry-header" title=${s.name}>
|
|
98
|
-
${s.name}
|
|
99
|
-
</div>
|
|
100
|
-
`}
|
|
101
|
-
<ul class="djs-popup-group" data-group=${s.id}>
|
|
102
|
-
${s.entries.map(c=>Be`
|
|
103
|
-
<${zC}
|
|
104
|
-
key=${c.id}
|
|
105
|
-
entry=${c}
|
|
106
|
-
selected=${c===t}
|
|
107
|
-
onMouseEnter=${()=>n(c)}
|
|
108
|
-
onMouseLeave=${()=>n(null)}
|
|
109
|
-
...${r}
|
|
110
|
-
/>
|
|
111
|
-
`)}
|
|
112
|
-
</ul>
|
|
113
|
-
`)}
|
|
114
|
-
</div>
|
|
115
|
-
`}function UC(e){const t=[],n=o=>t.find(a=>o.id===a.id),i=o=>!!n(o),r=o=>typeof o=="string"?{id:o}:o;return e.forEach(o=>{const a=o.group?r(o.group):{id:"default"};i(a)?n(a).entries.push(o):t.push({...a,entries:[o]})}),t}function GC(e){typeof e.scrollIntoViewIfNeeded=="function"?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest"})}function KC(e){const{onClose:t,onSelect:n,className:i,headerEntries:r,position:o,title:a,width:s,scale:c,search:l,emptyPlaceholder:u,searchFn:p,entries:d,onOpened:h,onClosed:m}=e,y=sr(()=>et(l)?d.length>5:!1,[l,d]),[g,w]=yl(""),C=eo((O,F)=>{if(!y)return O;if(!F.trim())return O.filter(({rank:ke=0})=>ke>=0);const G=O.filter(({searchable:ke})=>ke!==!1);return p(G,F,{keys:["label","description","search"]}).map(({item:ke})=>ke)},[y]),[x,b]=yl(C(d,g)),[S,P]=yl(x[0]),M=eo(O=>{(!S||!O.includes(S))&&P(O[0]),b(O)},[S,b,P]);vl(()=>{M(C(d,g))},[g,d]);const R=eo(O=>{let G=x.indexOf(S)+O;G<0&&(G=x.length-1),G>=x.length&&(G=0),P(x[G])},[x,S,P]),I=eo(O=>{if(O.key==="Enter"&&S)return n(O,S);if(O.key==="ArrowUp")return R(-1),O.preventDefault();if(O.key==="ArrowDown")return R(1),O.preventDefault()},[n,S,R]),B=eo(O=>{uf(O.target,"input")&&w(()=>O.target.value)},[w]);vl(()=>(h(),()=>{m()}),[]);const L=sr(()=>a||r.length>0,[a,r]);return Be`
|
|
116
|
-
<${zh}
|
|
117
|
-
onClose=${t}
|
|
118
|
-
onKeyup=${B}
|
|
119
|
-
onKeydown=${I}
|
|
120
|
-
className=${i}
|
|
121
|
-
position=${o}
|
|
122
|
-
width=${s}
|
|
123
|
-
scale=${c}
|
|
124
|
-
>
|
|
125
|
-
${L&&Be`
|
|
126
|
-
<${FC}
|
|
127
|
-
headerEntries=${r}
|
|
128
|
-
onSelect=${n}
|
|
129
|
-
selectedEntry=${S}
|
|
130
|
-
setSelectedEntry=${P}
|
|
131
|
-
title=${a}
|
|
132
|
-
/>
|
|
133
|
-
`}
|
|
134
|
-
${d.length>0&&Be`
|
|
135
|
-
<div class="djs-popup-body">
|
|
43
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
44
|
+
and limitations under the License.
|
|
45
|
+
***************************************************************************** */var zd=function(t,e){return zd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},zd(t,e)};function ek(t,e){zd(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Ot=function(){return Ot=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ot.apply(this,arguments)};function pr(t){var e=typeof Symbol=="function"&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function No(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Wd(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(No(arguments[e]));return t}var _l=Symbol("mobx did run lazy initializers"),wa=Symbol("mobx pending decorators"),tk={},nk={};function rk(t,e){var n=e?tk:nk;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return Vi(this),this[t]},set:function(r){Vi(this),this[t]=r}})}function Vi(t){var e,n;if(t[_l]!==!0){var r=t[wa];if(r){Co(t,_l,!0);var i=Wd(Object.getOwnPropertySymbols(r),Object.keys(r));try{for(var o=pr(i),a=o.next();!a.done;a=o.next()){var s=a.value,l=r[s];l.propertyCreator(t,l.prop,l.descriptor,l.decoratorTarget,l.decoratorArguments)}}catch(u){e={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}}}function uy(t,e){return function(){var r,i=function(a,s,l,u){if(u===!0)return e(a,s,l,a,r),null;if(process.env.NODE_ENV!=="production"&&!cy(arguments)&&He("This function is a decorator, but it wasn't invoked like a decorator"),!Object.prototype.hasOwnProperty.call(a,wa)){var c=a[wa];Co(a,wa,Ot({},c))}return a[wa][s]={prop:s,propertyCreator:e,descriptor:l,decoratorTarget:a,decoratorArguments:r},rk(s,t)};return cy(arguments)?(r=ml,i.apply(null,arguments)):(r=Array.prototype.slice.call(arguments),i)}}function cy(t){return(t.length===2||t.length===3)&&(typeof t[1]=="string"||typeof t[1]=="symbol")||t.length===4&&t[3]===!0}function Sa(t,e,n){return bi(t)?t:Array.isArray(t)?X.array(t,{name:n}):Ui(t)?X.object(t,void 0,{name:n}):Ao(t)?X.map(t,{name:n}):Ea(t)?X.set(t,{name:n}):t}function ik(t,e,n){return t==null||xr(t)||kr(t)||gn(t)||Qn(t)?t:Array.isArray(t)?X.array(t,{name:n,deep:!1}):Ui(t)?X.object(t,void 0,{name:n,deep:!1}):Ao(t)?X.map(t,{name:n,deep:!1}):Ea(t)?X.set(t,{name:n,deep:!1}):He(process.env.NODE_ENV!=="production"&&"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function bl(t){return t}function ok(t,e,n){if(process.env.NODE_ENV!=="production"&&bi(t))throw"observable.struct should not be used with observable values";return Yy(t,e)?e:t}function xl(t){Mt(t);var e=uy(!0,function(r,i,o,a,s){process.env.NODE_ENV!=="production"&&Mt(!o||!o.get,'@observable cannot be used on getter (property "'+Jn(i)+'"), use @computed instead.');var l=o?o.initializer?o.initializer.call(r):o.value:void 0;ef(r).addObservableProp(i,l,t)}),n=typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"?function(){return arguments.length<2?He("Incorrect decorator invocation. @observable decorator doesn't expect any arguments"):e.apply(null,arguments)}:e;return n.enhancer=t,n}var dy={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(dy);function ak(t){/^(deep|name|equals|defaultDecorator|proxy)$/.test(t)||He("invalid option for (extend)observable: "+t)}function Mo(t){if(t==null)return dy;if(typeof t=="string")return{name:t,deep:!0,proxy:!0};if(process.env.NODE_ENV!=="production"){if(typeof t!="object")return He("expected options object");Object.keys(t).forEach(ak)}return t}var Ud=xl(Sa),sk=xl(ik),fy=xl(bl),lk=xl(ok);function El(t){return t.defaultDecorator?t.defaultDecorator.enhancer:t.deep===!1?bl:Sa}function uk(t,e,n){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return Ud.apply(null,arguments);if(bi(t))return t;var r=Ui(t)?X.object(t,e,n):Array.isArray(t)?X.array(t,e):Ao(t)?X.map(t,e):Ea(t)?X.set(t,e):t;if(r!==t)return r;He(process.env.NODE_ENV!=="production"&&"The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)'")}var py={box:function(t,e){arguments.length>2&&Ca("box");var n=Mo(e);return new Gi(t,El(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&Ca("array");var n=Mo(e);return Zk(t,El(n),n.name)},map:function(t,e){arguments.length>2&&Ca("map");var n=Mo(e);return new Qd(t,El(n),n.name)},set:function(t,e){arguments.length>2&&Ca("set");var n=Mo(e);return new zy(t,El(n),n.name)},object:function(t,e,n){typeof arguments[1]=="string"&&Ca("object");var r=Mo(n);if(r.proxy===!1)return Zd({},t,e,r);var i=Py(r),o=Zd({},void 0,void 0,r),a=Yk(o);return Ry(a,t,e,i),a},ref:fy,shallow:sk,deep:Ud,struct:lk},X=uk;Object.keys(py).forEach(function(t){return X[t]=py[t]});function Ca(t){He("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}var wl=uy(!1,function(t,e,n,r,i){process.env.NODE_ENV!=="production"&&Mt(n&&n.get,"Trying to declare a computed value for unspecified getter '"+Jn(e)+"'");var o=n.get,a=n.set,s=i[0]||{};ef(t).addComputedProp(t,e,Ot({get:o,set:a,context:t},s))}),ck=wl({equals:To.structural}),Et=function(e,n,r){if(typeof n=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return wl.apply(null,arguments);process.env.NODE_ENV!=="production"&&(Mt(typeof e=="function","First argument to `computed` should be an expression."),Mt(arguments.length<3,"Computed takes one or two arguments if used as function"));var i=typeof n=="object"?n:{};return i.get=e,i.set=typeof n=="function"?n:i.set,i.name=i.name||e.name||"",new Ro(i)};Et.struct=ck;var vt;(function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"})(vt||(vt={}));var hr;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(hr||(hr={}));var Sl=function(){function t(e){this.cause=e}return t}();function Aa(t){return t instanceof Sl}function Vd(t){switch(t.dependenciesState){case vt.UP_TO_DATE:return!1;case vt.NOT_TRACKING:case vt.STALE:return!0;case vt.POSSIBLY_STALE:{for(var e=Gd(!0),n=Po(),r=t.observing,i=r.length,o=0;o<i;o++){var a=r[o];if(Lo(a)){if(pe.disableErrorBoundaries)a.get();else try{a.get()}catch{return _i(n),Oa(e),!0}if(t.dependenciesState===vt.STALE)return _i(n),Oa(e),!0}}return vy(t),_i(n),Oa(e),!1}}}function Do(t){var e=t.observers.size>0;pe.computationDepth>0&&e&&He(process.env.NODE_ENV!=="production"&&"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: "+t.name),!pe.allowStateChanges&&(e||pe.enforceActions==="strict")&&He(process.env.NODE_ENV!=="production"&&(pe.enforceActions?"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ")+t.name)}function dk(t){process.env.NODE_ENV!=="production"&&!pe.allowStateReads&&pe.observableRequiresReaction&&console.warn("[mobx] Observable "+t.name+" being read outside a reactive context")}function hy(t,e,n){var r=Gd(!0);vy(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++pe.runId;var i=pe.trackingDerivation;pe.trackingDerivation=t;var o;if(pe.disableErrorBoundaries===!0)o=e.call(n);else try{o=e.call(n)}catch(a){o=new Sl(a)}return pe.trackingDerivation=i,pk(t),fk(t),Oa(r),o}function fk(t){process.env.NODE_ENV!=="production"&&t.observing.length===0&&(pe.reactionRequiresObservable||t.requiresObservable)&&console.warn("[mobx] Derivation "+t.name+" is created/updated without reading any observable value")}function pk(t){for(var e=t.observing,n=t.observing=t.newObserving,r=vt.UP_TO_DATE,i=0,o=t.unboundDepsCount,a=0;a<o;a++){var s=n[a];s.diffValue===0&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>r&&(r=s.dependenciesState)}for(n.length=i,t.newObserving=null,o=e.length;o--;){var s=e[o];s.diffValue===0&&by(s,t),s.diffValue=0}for(;i--;){var s=n[i];s.diffValue===1&&(s.diffValue=0,xk(s,t))}r!==vt.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}function Xd(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)by(e[n],t);t.dependenciesState=vt.NOT_TRACKING}function gy(t){var e=Po();try{return t()}finally{_i(e)}}function Po(){var t=pe.trackingDerivation;return pe.trackingDerivation=null,t}function _i(t){pe.trackingDerivation=t}function Gd(t){var e=pe.allowStateReads;return pe.allowStateReads=t,e}function Oa(t){pe.allowStateReads=t}function vy(t){if(t.dependenciesState!==vt.UP_TO_DATE){t.dependenciesState=vt.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=vt.UP_TO_DATE}}var Cl=0,hk=1,my=Object.getOwnPropertyDescriptor(function(){},"name"),gk=my&&my.configurable;function Xi(t,e,n){process.env.NODE_ENV!=="production"&&(Mt(typeof e=="function","`action` can only be invoked on functions"),(typeof t!="string"||!t)&&He("actions should have valid names, got: '"+t+"'"));var r=function(){return yy(t,e,n||this,arguments)};return r.isMobxAction=!0,process.env.NODE_ENV!=="production"&&gk&&Object.defineProperty(r,"name",{value:t}),r}function yy(t,e,n,r){var i=vk(t,n,r);try{return e.apply(n,r)}catch(o){throw i.error=o,o}finally{mk(i)}}function vk(t,e,n){var r=Kt()&&!!t,i=0;if(r&&process.env.NODE_ENV!=="production"){i=Date.now();var o=n&&n.length||0,a=new Array(o);if(o>0)for(var s=0;s<o;s++)a[s]=n[s];Fn({type:"action",name:t,object:e,arguments:a})}var l=Po();gr();var u=Al(!0),c=Gd(!0),d={prevDerivation:l,prevAllowStateChanges:u,prevAllowStateReads:c,notifySpy:r,startTime:i,actionId:hk++,parentActionId:Cl};return Cl=d.actionId,d}function mk(t){Cl!==t.actionId&&He("invalid action stack. did you forget to finish an action?"),Cl=t.parentActionId,t.error!==void 0&&(pe.suppressReactionErrors=!0),Ol(t.prevAllowStateChanges),Oa(t.prevAllowStateReads),vr(),_i(t.prevDerivation),t.notifySpy&&process.env.NODE_ENV!=="production"&&$n({time:Date.now()-t.startTime}),pe.suppressReactionErrors=!1}function Al(t){var e=pe.allowStateChanges;return pe.allowStateChanges=t,e}function Ol(t){pe.allowStateChanges=t}var Gi=function(t){ek(e,t);function e(n,r,i,o,a){i===void 0&&(i="ObservableValue@"+On()),o===void 0&&(o=!0),a===void 0&&(a=To.default);var s=t.call(this,i)||this;return s.enhancer=r,s.name=i,s.equals=a,s.hasUnreportedChange=!1,s.value=r(n,void 0,i),o&&Kt()&&process.env.NODE_ENV!=="production"&&Yi({type:"create",name:s.name,newValue:""+s.value}),s}return e.prototype.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.prototype.set=function(n){var r=this.value;if(n=this.prepareNewValue(n),n!==pe.UNCHANGED){var i=Kt();i&&process.env.NODE_ENV!=="production"&&Fn({type:"update",name:this.name,newValue:n,oldValue:r}),this.setNewValue(n),i&&process.env.NODE_ENV!=="production"&&$n()}},e.prototype.prepareNewValue=function(n){if(Do(this),Lr(this)){var r=Ir(this,{object:this,type:"update",newValue:n});if(!r)return pe.UNCHANGED;n=r.newValue}return n=this.enhancer(n,this.value,this.name),this.equals(this.value,n)?pe.UNCHANGED:n},e.prototype.setNewValue=function(n){var r=this.value;this.value=n,this.reportChanged(),_r(this)&&br(this,{type:"update",object:this,newValue:n,oldValue:r})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(n){return Na(this,n)},e.prototype.observe=function(n,r){return r&&n({object:this,type:"update",newValue:this.value,oldValue:void 0}),Ma(this,n)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return ly(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Oo),yk=yi("ObservableValue",Gi),Ro=function(){function t(e){this.dependenciesState=vt.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=vt.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+On(),this.value=new Sl(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=hr.NONE,Mt(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+On(),e.set&&(this.setter=Xi(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?To.structural:To.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return t.prototype.onBecomeStale=function(){Sk(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.get=function(){this.isComputing&&He("Cycle detected in computation "+this.name+": "+this.derivation),pe.inBatch===0&&this.observers.size===0&&!this.keepAlive?Vd(this)&&(this.warnAboutUntrackedRead(),gr(),this.value=this.computeValue(!1),vr()):(Ey(this),Vd(this)&&this.trackAndCompute()&&wk(this));var e=this.value;if(Aa(e))throw e.cause;return e},t.prototype.peek=function(){var e=this.computeValue(!1);if(Aa(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){Mt(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else Mt(!1,process.env.NODE_ENV!=="production"&&"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},t.prototype.trackAndCompute=function(){Kt()&&process.env.NODE_ENV!=="production"&&Yi({object:this.scope,type:"compute",name:this.name});var e=this.value,n=this.dependenciesState===vt.NOT_TRACKING,r=this.computeValue(!0),i=n||Aa(e)||Aa(r)||!this.equals(e,r);return i&&(this.value=r),i},t.prototype.computeValue=function(e){this.isComputing=!0,pe.computationDepth++;var n;if(e)n=hy(this,this.derivation,this.scope);else if(pe.disableErrorBoundaries===!0)n=this.derivation.call(this.scope);else try{n=this.derivation.call(this.scope)}catch(r){n=new Sl(r)}return pe.computationDepth--,this.isComputing=!1,n},t.prototype.suspend=function(){this.keepAlive||(Xd(this),this.value=void 0)},t.prototype.observe=function(e,n){var r=this,i=!0,o=void 0;return Lk(function(){var a=r.get();if(!i||n){var s=Po();e({type:"update",object:r,newValue:a,oldValue:o}),_i(s)}i=!1,o=a})},t.prototype.warnAboutUntrackedRead=function(){process.env.NODE_ENV!=="production"&&(this.requiresReaction===!0&&He("[mobx] Computed value "+this.name+" is read outside a reactive context"),this.isTracing!==hr.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context. Doing a full recompute"),pe.computedRequiresReaction&&console.warn("[mobx] Computed value "+this.name+" is being read outside a reactive context. Doing a full recompute"))},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return ly(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Lo=yi("ComputedValue",Ro),Tl=function(){function t(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return t}(),_k={};function Nl(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:_k}var Ml=!0,_y=!1,pe=function(){var t=Nl();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(Ml=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Tl().version&&(Ml=!1),Ml?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Tl):(setTimeout(function(){_y||He("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Tl)}();function bk(){(pe.pendingReactions.length||pe.inBatch||pe.isRunningReactions)&&He("isolateGlobalState should be called before MobX is running any reactions"),_y=!0,Ml&&(--Nl().__mobxInstanceCount===0&&(Nl().__mobxGlobals=void 0),pe=new Tl)}function Yd(){return pe}function xk(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function by(t,e){t.observers.delete(e),t.observers.size===0&&xy(t)}function xy(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,pe.pendingUnobservations.push(t))}function gr(){pe.inBatch++}function vr(){if(--pe.inBatch===0){Ay();for(var t=pe.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Ro&&n.suspend())}pe.pendingUnobservations=[]}}function Ey(t){dk(t);var e=pe.trackingDerivation;return e!==null?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(t.observers.size===0&&pe.inBatch>0&&xy(t),!1)}function Ek(t){t.lowestObserverState!==vt.STALE&&(t.lowestObserverState=vt.STALE,t.observers.forEach(function(e){e.dependenciesState===vt.UP_TO_DATE&&(e.isTracing!==hr.NONE&&wy(e,t),e.onBecomeStale()),e.dependenciesState=vt.STALE}))}function wk(t){t.lowestObserverState!==vt.STALE&&(t.lowestObserverState=vt.STALE,t.observers.forEach(function(e){e.dependenciesState===vt.POSSIBLY_STALE?e.dependenciesState=vt.STALE:e.dependenciesState===vt.UP_TO_DATE&&(t.lowestObserverState=vt.UP_TO_DATE)}))}function Sk(t){t.lowestObserverState===vt.UP_TO_DATE&&(t.lowestObserverState=vt.POSSIBLY_STALE,t.observers.forEach(function(e){e.dependenciesState===vt.UP_TO_DATE&&(e.dependenciesState=vt.POSSIBLY_STALE,e.isTracing!==hr.NONE&&wy(e,t),e.onBecomeStale())}))}function wy(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===hr.BREAK){var n=[];Sy(Fk(t),n,1),new Function(`debugger;
|
|
46
|
+
/*
|
|
47
|
+
Tracing '`+t.name+`'
|
|
136
48
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.0325 8.5H9.625L13.3675 12.25L12.25 13.3675L8.5 9.625V9.0325L8.2975 8.8225C7.4425 9.5575 6.3325 10 5.125 10C2.4325 10 0.25 7.8175 0.25 5.125C0.25 2.4325 2.4325 0.25 5.125 0.25C7.8175 0.25 10 2.4325 10 5.125C10 6.3325 9.5575 7.4425 8.8225 8.2975L9.0325 8.5ZM1.75 5.125C1.75 6.9925 3.2575 8.5 5.125 8.5C6.9925 8.5 8.5 6.9925 8.5 5.125C8.5 3.2575 6.9925 1.75 5.125 1.75C3.2575 1.75 1.75 3.2575 1.75 5.125Z" fill="#22242A"/>
|
|
141
|
-
</svg>
|
|
142
|
-
<input type="text" spellcheck=${!1} aria-label="${a}" />
|
|
143
|
-
</div>
|
|
144
|
-
`}
|
|
49
|
+
You are entering this break point because derivation '`+t.name+"' is being traced and '"+e.name+`' is now forcing it to update.
|
|
50
|
+
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
|
51
|
+
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
|
145
52
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
`}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
`}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
<div
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
onKeyup=${i}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
>
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
className=${t}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
searchFn=${this._search}
|
|
182
|
-
...${{...o}}
|
|
183
|
-
/>
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
<rect x="150" y="350" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
</svg>`},oR=900;function cr(e,t,n,i){e.registerProvider(oR,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}cr.$inject=["contextPad","popupMenu","translate","canvas"],cr.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&D(t,this._getEntries(e)),t},cr.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},cr.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`<div class="entry">${Kh.align}</div>`,action:{click:function(t,n){var i=e._getMenuPosition(n);D(i,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",i)}}}}},cr.prototype._getMenuPosition=function(e){var t=5,n=this._contextPad.getPad(e).html,i=n.getBoundingClientRect(),r={x:i.left,y:i.bottom+t};return r};var aR=["left","center","right","top","middle","bottom"];function to(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}to.$inject=["popupMenu","alignElements","translate","rules"],to.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&D(t,this._getEntries(e)),t},to.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},to.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return A(aR,function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:Kh[o],action:function(){t.trigger(e,o),i.close()}}}),r};function Ht(e){V.call(this,e),this.init()}Ht.$inject=["eventBus"],Y(Ht,V),Ht.prototype.addRule=function(e,t,n){var i=this;typeof e=="string"&&(e=[e]),e.forEach(function(r){i.canExecute(r,t,function(o,a,s){return n(o)},!0)})},Ht.prototype.init=function(){};function Ua(e){Ht.call(this,e)}Ua.$inject=["eventBus"],Y(Ua,Ht),Ua.prototype.init=function(){this.addRule("elements.align",function(e){var t=e.elements,n=le(t,function(i){return!(i.waypoints||i.host||i.labelTarget)});return n=oa(n),n.length<2?!1:n})};const sR={__depends__:[EC,ph,xl],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",cr],alignElementsMenuProvider:["type",to],bpmnAlignElements:["type",Ua]};var cR=10,qh=50,lR=250;function wl(e,t,n,i){for(var r;r=uR(e,n,t);)n=i(t,n,r);return n}function Sl(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=e[o];if(a){var s=o==="x"?"width":"height",c=a.margin,l=a.minDistance;c<0?r[o]=Math.min(i[o]+c-t[s]/2,n[o]-l+c):r[o]=Math.max(i[o]+i[s]+c+t[s]/2,n[o]+l+c)}}),r}}function uR(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=fR(e);return _e(r,function(o){if(o===n)return!1;var a=ft(o,i,cR);return a==="intersect"})}function pR(e,t){t||(t={});function n(m){return m.source===e?1:-1}var i=t.defaultDistance||qh,r=t.direction||"e",o=t.filter,a=t.getWeight||n,s=t.maxDistance||lR,c=t.reference||"start";o||(o=mR);function l(m,y){return r==="n"?c==="start"?Q(m).top-Q(y).bottom:c==="center"?Q(m).top-te(y).y:Q(m).top-Q(y).top:r==="w"?c==="start"?Q(m).left-Q(y).right:c==="center"?Q(m).left-te(y).x:Q(m).left-Q(y).left:r==="s"?c==="start"?Q(y).top-Q(m).bottom:c==="center"?te(y).y-Q(m).bottom:Q(y).bottom-Q(m).bottom:c==="start"?Q(y).left-Q(m).right:c==="center"?te(y).x-Q(m).right:Q(y).right-Q(m).right}var u=e.incoming.filter(o).map(function(m){var y=a(m),g=y<0?l(m.source,e):l(e,m.source);return{id:m.source.id,distance:g,weight:y}}),p=e.outgoing.filter(o).map(function(m){var y=a(m),g=y>0?l(e,m.target):l(m.target,e);return{id:m.target.id,distance:g,weight:y}}),d=u.concat(p).reduce(function(m,y){return m[y.id+"__weight_"+y.weight]=y,m},{}),h=Tt(d,function(m,y){var g=y.distance,w=y.weight;return g<0||g>s||(m[String(g)]||(m[String(g)]=0),m[String(g)]+=1*w,(!m.distance||m[m.distance]<m[String(g)])&&(m.distance=g)),m},{});return h.distance||i}function fR(e){var t=Cl(e);return e.host&&(t=t.concat(Cl(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce(function(n,i){return n.concat(Cl(i))},[]))),t}function Cl(e){return hR(e).concat(dR(e))}function dR(e){return e.incoming.map(function(t){return t.source})}function hR(e){return e.outgoing.map(function(t){return t.target})}function mR(){return!0}var gR=100;function Yh(e,t,n){e.on("autoPlace",gR,function(i){var r=i.shape,o=i.source;return yR(o,r)}),e.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){e.fire("autoPlace.start",{source:i,shape:r});var a=e.fire("autoPlace",{source:i,shape:r}),s=t.appendShape(i,r,a,i.parent,o);return e.fire("autoPlace.end",{source:i,shape:s}),s}}Yh.$inject=["eventBus","modeling","canvas"];function yR(e,t,n){n||(n={});var i=n.defaultDistance||qh,r=te(e),o=Q(e);return{x:o.right+i+t.width/2,y:r.y}}function Xh(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}Xh.$inject=["eventBus","selection"];const vR={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Yh],autoPlaceSelectionBehavior:["type",Xh]};function lr(e,t){for(Rt(t)&&(t=[t]);e=e.parent;)if(ue(e,t))return e;return null}function Zh(e,t){var n=lr(e,"bpmn:Process");if(n)return!0;var i=["bpmn:Participant","bpmn:Lane"];if(n=lr(e,i),n)return Je(n);if(ue(e,i))return Je(e);var r;for(r=z(e);r&&!E(r,"bpmn:Process");r=r.$parent);if(!t)return!0;var o=t.find(function(a){var s=z(a);return s&&s.get("processRef")===r});return o?Je(o):!0}function Jh(e,t,n){var i=Zh(e,n);if(E(t,"bpmn:TextAnnotation"))return bR(e,t,i);if(ue(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"]))return ER(e,t,i);if(E(t,"bpmn:FlowNode"))return _R(e,t,i)}function _R(e,t,n){var i=Q(e),r=te(e),o=n?{directionHint:"e",minDistance:80,baseOrientation:"left",boundaryOrientation:"top",start:"top",end:"bottom"}:{directionHint:"s",minDistance:90,baseOrientation:"top",boundaryOrientation:"left",start:"left",end:"right"},a=pR(e,{filter:function(h){return E(h,"bpmn:SequenceFlow")},direction:o.directionHint}),s=30,c=o.minDistance,l=o.baseOrientation;E(e,"bpmn:BoundaryEvent")&&(l=ft(e,e.host,-25),l.indexOf(o.boundaryOrientation)!==-1&&(s*=-1));var u=n?{x:i.right+a+t.width/2,y:r.y+Qh(l,c,o)}:{x:r.x+Qh(l,c,o),y:i.bottom+a+t.height/2},p={margin:s,minDistance:c},d=n?{y:p}:{x:p};return wl(e,t,u,Sl(d))}function Qh(e,t,n){return e.includes(n.start)?-1*t:e.includes(n.end)?t:0}function bR(e,t,n){var i=Q(e),r=n?{x:i.right+t.width/2,y:i.top-50-t.height/2}:{x:i.right+50+t.width/2,y:i.bottom+t.height/2};Se(e)&&(r=te(e),n?(r.x+=100,r.y-=50):(r.x+=100,r.y+=50));var o={margin:n?-30:30,minDistance:20},a=n?{y:o}:{x:o};return wl(e,t,r,Sl(a))}function ER(e,t,n){var i=Q(e),r=n?{x:i.right-10+t.width/2,y:i.bottom+40+t.width/2}:{x:i.left-40-t.width/2,y:i.bottom-10+t.height/2},o={margin:30,minDistance:30},a=n?{x:o}:{y:o};return wl(e,t,r,Sl(a))}function em(e,t){e.on("autoPlace",function(n){var i=n.shape,r=n.source;return Jh(r,i,t)})}em.$inject=["eventBus","elementRegistry"];const Rl={__depends__:[vR],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",em]};function kn(e,t,n,i){V.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],function(o){var a=o.context,s=a.hints||{},c=a.shape,l=a.parent||a.newParent;s.autoResize!==!1&&r._expand([c],l)}),this.postExecuted(["elements.move"],function(o){var a=o.context,s=xc(Yo(a.closure.topLevel)),c=a.hints,l=c?c.autoResize:!0;if(l!==!1){var u=Wi(s,function(p){return p.parent.id});A(u,function(p,d){oe(l)&&(p=p.filter(function(h){return _e(l,Jt({id:h.id}))})),r._expand(p,d)})}}),this.postExecuted(["shape.toggleCollapse"],function(o){var a=o.context,s=a.hints,c=a.shape;s&&s.autoResize===!1||c.collapsed||r._expand(c.children||[],c)}),this.postExecuted(["shape.resize"],function(o){var a=o.context,s=a.hints,c=a.shape,l=c.parent;s&&s.autoResize===!1||l&&r._expand([c],l)})}kn.$inject=["eventBus","elementRegistry","modeling","rules"],Y(kn,V),kn.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=Q(qe(e)),o=Q(t),a={};return r.top-o.top<i.top&&(a.top=r.top-n.top),r.left-o.left<i.left&&(a.left=r.left-n.left),o.right-r.right<i.right&&(a.right=r.right+n.right),o.bottom-r.bottom<i.bottom&&(a.bottom=r.bottom+n.bottom),ua(D({},o,a))},kn.prototype._expand=function(e,t){typeof t=="string"&&(t=this._elementRegistry.get(t));var n=this._rules.allowed("element.autoResize",{elements:e,target:t});if(n){var i=this._getOptimalBounds(e,t);if(xR(i,t)){var r=wR(Qt(t,["x","y","width","height"]),i);this.resize(t,i,{autoResize:r});var o=t.parent;o&&this._expand([t],o)}}},kn.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},kn.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},kn.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)};function xR(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function wR(e,t){var n="";return e=Q(e),t=Q(t),e.top>t.top&&(n=n.concat("n")),e.right<t.right&&(n=n.concat("w")),e.bottom<t.bottom&&(n=n.concat("s")),e.left>t.left&&(n=n.concat("e")),n}function Ga(e){e.invoke(kn,this)}Ga.$inject=["injector"],Y(Ga,kn),Ga.prototype.resize=function(e,t,n){E(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)};function no(e){Ht.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}no.$inject=["eventBus"],Y(no,Ht),no.prototype.canResize=function(e,t){return!1};function Ka(e,t){no.call(this,e),this._modeling=t}Y(Ka,no),Ka.$inject=["eventBus","modeling"],Ka.prototype.canResize=function(e,t){if(E(t.di,"bpmndi:BPMNPlane")||!E(t,"bpmn:Participant")&&!E(t,"bpmn:Lane")&&!E(t,"bpmn:SubProcess"))return!1;var n=!0;return A(e,function(i){if(E(i,"bpmn:Lane")||ge(i)){n=!1;return}}),n};const SR={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Ga],bpmnAutoResizeProvider:["type",Ka]};var tm=1500;function nm(e,t,n){var i=this,r=n.get("dragging",!1);function o(a){if(!a.hover){var s=a.originalEvent,c=i._findTargetGfx(s),l=c&&e.get(c);c&&l&&(a.stopPropagation(),r.hover({element:l,gfx:c}),r.move(s))}}r&&t.on("drag.start",function(a){t.once("drag.move",tm,function(s){o(s)})}),function(){var a,s;t.on("element.hover",function(c){a=c.gfx,s=c.element}),t.on("element.hover",tm,function(c){s&&t.fire("element.out",{element:s,gfx:a})}),t.on("element.out",function(){a=null,s=null})}(),this._findTargetGfx=function(a){var s,c;if(a instanceof MouseEvent)return s=Ai(a),c=document.elementFromPoint(s.x,s.y),CR(c)}}nm.$inject=["elementRegistry","eventBus","injector"];function CR(e){return Ui(e,"svg, .djs-element",!0)}const RR={__init__:["hoverFix"],hoverFix:["type",nm]};var ur=Math.round,im="djs-drag-active";function Mi(e){e.preventDefault()}function TR(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function PR(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function rm(e,t,n,i){var r={threshold:5,trapClick:!0},o;function a(x){var b=t.viewbox(),S=t._container.getBoundingClientRect();return{x:b.x+(x.x-S.left)/b.scale,y:b.y+(x.y-S.top)/b.scale}}function s(x,b){b=b||o;var S=e.createEvent(D({},b.payload,b.data,{isTouch:b.isTouch}));return e.fire("drag."+x,S)===!1?!1:e.fire(b.prefix+"."+x,S)}function c(x){var b=x.filter(function(S){return i.get(S.id)});b.length&&n.select(b)}function l(x,b){var S=o.payload,P=o.displacement,M=o.globalStart,R=Ai(x),I=nn(R,M),B=o.localStart,L=a(R),O=nn(L,B);if(!o.active&&(b||PR(I)>o.threshold)){if(D(S,{x:ur(B.x+P.x),y:ur(B.y+P.y),dx:0,dy:0},{originalEvent:x}),s("start")===!1)return g();o.active=!0,o.keepSelection||(S.previousSelection=n.get(),n.select(null)),o.cursor&&Na(o.cursor),t.addMarker(t.getRootElement(),im)}rl(x),o.active&&(D(S,{x:ur(L.x+P.x),y:ur(L.y+P.y),dx:ur(O.x),dy:ur(O.y)},{originalEvent:x}),s("move"))}function u(x){var b,S=!0;o.active&&(x&&(o.payload.originalEvent=x,rl(x)),S=s("end")),S===!1&&s("rejected"),b=w(S!==!0),s("ended",b)}function p(x){it("Escape",x)&&(Mi(x),g())}function d(x){var b;o.active&&(b=nh(e),setTimeout(b,400),Mi(x)),u(x)}function h(x){l(x)}function m(x){var b=o.payload;b.hoverGfx=x.gfx,b.hover=x.element,s("hover")}function y(x){s("out");var b=o.payload;b.hoverGfx=null,b.hover=null}function g(x){var b;if(o){var S=o.active;S&&s("cancel"),b=w(x),S&&s("canceled",b)}}function w(x){var b,S;s("cleanup"),th(),o.trapClick?S=d:S=u,ae.unbind(document,"mousemove",l),ae.unbind(document,"dragstart",Mi),ae.unbind(document,"selectstart",Mi),ae.unbind(document,"mousedown",S,!0),ae.unbind(document,"mouseup",S,!0),ae.unbind(document,"keyup",p),ae.unbind(document,"touchstart",h,!0),ae.unbind(document,"touchcancel",g,!0),ae.unbind(document,"touchmove",l,!0),ae.unbind(document,"touchend",u,!0),e.off("element.hover",m),e.off("element.out",y),t.removeMarker(t.getRootElement(),im);var P=o.payload.previousSelection;return x!==!1&&P&&!n.get().length&&c(P),b=o,o=null,b}function C(x,b,S,P){o&&g(!1),typeof b=="string"&&(P=S,S=b,b=null),P=D({},r,P||{});var M=P.data||{},R,I,B,L,O;P.trapClick?L=d:L=u,x?(R=er(x)||x,I=Ai(x),rl(x),R.type==="dragstart"&&Mi(R)):(R=null,I={x:0,y:0}),B=a(I),b||(b=B),O=TR(R),o=D({prefix:S,data:M,payload:{},globalStart:I,displacement:nn(b,B),localStart:B,isTouch:O},P),P.manual||(O?(ae.bind(document,"touchstart",h,!0),ae.bind(document,"touchcancel",g,!0),ae.bind(document,"touchmove",l,!0),ae.bind(document,"touchend",u,!0)):(ae.bind(document,"mousemove",l),ae.bind(document,"dragstart",Mi),ae.bind(document,"selectstart",Mi),ae.bind(document,"mousedown",L,!0),ae.bind(document,"mouseup",L,!0)),ae.bind(document,"keyup",p),e.on("element.hover",m),e.on("element.out",y)),s("init"),P.autoActivate&&l(x,!0)}e.on("diagram.destroy",g),this.init=C,this.move=l,this.hover=m,this.out=y,this.end=u,this.cancel=g,this.context=function(){return o},this.setOptions=function(x){D(r,x)}}rm.$inject=["eventBus","canvas","selection","elementRegistry"];const Mn={__depends__:[RR,tn],dragging:["type",rm]};function pr(e,t,n){this._canvas=n,this._opts=D({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),t.on(["drag.cleanup"],function(){i.stopScroll()})}pr.$inject=["config.autoScroll","eventBus","canvas"],pr.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,i=this,r=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,r.width-e.x,r.height-e.y];this.stopScroll();for(var a=0,s=0,c=0;c<4;c++)AR(o[c],n.scrollThresholdOut[c],n.scrollThresholdIn[c])&&(c===0?a=n.scrollStep:c==1?s=n.scrollStep:c==2?a=-n.scrollStep:c==3&&(s=-n.scrollStep));(a!==0||s!==0)&&(t.scroll({dx:a,dy:s}),this._scrolling=setTimeout(function(){i.startScroll(e)},n.scrollRepeatTimeout))};function AR(e,t,n){return t<e&&e<n}pr.prototype.stopScroll=function(){clearTimeout(this._scrolling)},pr.prototype.setOptions=function(e){this._opts=D({},this._opts,e)},pr.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=Ai(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};const kR={__depends__:[Mn],__init__:["autoScroll"],autoScroll:["type",pr]};function Tl(e){this._commandStack=e.get("commandStack",!1)}Tl.$inject=["injector"],Tl.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),n===void 0?!0:n};const yn={__init__:["rules"],rules:["type",Tl]};var qa=Math.round,MR=Math.max;function DR(e,t){var n=e.x,i=e.y;return[["M",n,i],["m",0,-10],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}function NR(e){var t=[];return e.forEach(function(n,i){t.push([i===0?"M":"L",n.x,n.y])}),t}var om=10;function OR(e,t){var n,i;for(n=0;i=e[n];n++)if(Br(i,t)<=om)return{point:e[n],bendpoint:!0,index:n};return null}function IR(e,t){var n=If(DR(t,om),NR(e)),i=n[0],r=n[n.length-1],o;return i?i!==r?i.segment2!==r.segment2?(o=MR(i.segment2,r.segment2)-1,{point:e[o],bendpoint:!0,index:o}):{point:{x:qa(i.x+r.x)/2,y:qa(i.y+r.y)/2},index:i.segment2}:{point:{x:qa(i.x),y:qa(i.y)},index:i.segment2}:null}function Pl(e,t){return OR(e,t)||IR(e,t)}function am(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function sm(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function BR(e,t){return t?{x:Math.cos(t)*e.x-Math.sin(t)*e.y,y:Math.sin(t)*e.x+Math.cos(t)*e.y}:e}function LR(e,t,n){var i=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}],r=i[0].n*t[0]+i[1].n*t[1],o=i[0].lambda*t[0]+i[1].lambda*t[1];return-r/o}function Al(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=LR([n.x,n.y],[r.x,r.y],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function cm(e,t){var n=Al(e,t),i={x:n.x-e.x,y:n.y-e.y};return am(i)}function Ya(e,t){return am({x:e.x-t.x,y:e.y-t.y})}var lm="djs-bendpoint",um="djs-segment-dragger";function $R(e,t){var n=Ai(t),i=e._container.getBoundingClientRect(),r;r={x:i.left,y:i.top};var o=e.viewbox();return{x:o.x+(n.x-r.x)/o.scale,y:o.y+(n.y-r.y)/o.scale}}function kl(e,t,n){var i=$R(e,n),r=Pl(t,i);return r}function Ml(e,t){var n=X("g");me(n).add(lm),ie(e,n);var i=X("circle");q(i,{cx:0,cy:0,r:4}),me(i).add("djs-visual"),ie(n,i);var r=X("circle");return q(r,{cx:0,cy:0,r:10}),me(r).add("djs-hit"),ie(n,r),t&&me(n).add(t),n}function jR(e,t,n,i){var r=X("g");ie(e,r);var o=18,a=6,s=11,c=HR(t,n,i),l=a+s,u=X("rect");q(u,{x:-18/2,y:-6/2,width:o,height:a}),me(u).add("djs-visual"),ie(r,u);var p=X("rect");return q(p,{x:-c/2,y:-17/2,width:c,height:l}),me(p).add("djs-hit"),ie(r,p),ed(r,i==="v"?90:0),r}function pm(e,t,n){var i=X("g"),r=Lc(t,n),o=xn(t,n);return ie(e,i),jR(i,t,n,o),me(i).add(um),me(i).add(o==="h"?"horizontal":"vertical"),ot(i,r.x,r.y),i}function Dl(e){return Math.abs(Math.round(e*2/3))}function FR(e,t){var n=VR(e,t);return Al(e,n)}function HR(e,t,n){var i=t.x-e.x,r=t.y-e.y;return Dl(n==="h"?i:r)}function VR(e,t){for(var n=t.waypoints,i=1/0,r,o=0;o<n.length-1;o++){var a=n[o],s=n[o+1],c=cm(e,[a,s]);c<i&&(i=c,r=o)}return[n[r],n[r+1]]}function fm(e,t,n,i,r){function o(x,b,S){var P=x.index,M=x.point,R,I,B,L,O,F;return P<=0||x.bendpoint?!1:(R=b[P-1],I=b[P],B=Lc(R,I),L=xn(R,I),O=Math.abs(M.x-B.x),F=Math.abs(M.y-B.y),L&&O<=S&&F<=S)}function a(x,b){var S=x.waypoints,P,M,R,I;return b.index<=0||b.bendpoint||(P={start:S[b.index-1],end:S[b.index]},M=xn(P.start,P.end),!M)?null:(M==="h"?R=P.end.x-P.start.x:R=P.end.y-P.start.y,I=Dl(R)/2,I)}function s(x,b){var S=b.waypoints,P=kl(t,S,x),M;if(P)return M=a(b,P),o(P,S,M)?r.start(x,b,P.index):i.start(x,b,P.index,!P.bendpoint),!0}function c(x,b,S){ae.bind(x,b,function(P){n.triggerMouseEvent(b,P,S),P.stopPropagation()})}function l(x,b){var S=t.getLayer("overlays"),P=we('.djs-bendpoints[data-element-id="'+qr(x.id)+'"]',S);return!P&&b&&(P=X("g"),q(P,{"data-element-id":x.id}),me(P).add("djs-bendpoints"),ie(S,P),c(P,"mousedown",x),c(P,"click",x),c(P,"dblclick",x)),P}function u(x,b){return we('.djs-segment-dragger[data-segment-idx="'+x+'"]',b)}function p(x,b){b.waypoints.forEach(function(S,P){var M=Ml(x);ie(x,M),ot(M,S.x,S.y)}),Ml(x,"floating")}function d(x,b){for(var S=b.waypoints,P,M,R,I=1;I<S.length;I++)P=S[I-1],M=S[I],xn(P,M)&&(R=pm(x,P,M),q(R,{"data-segment-idx":I}),c(R,"mousemove",b))}function h(x){A(Rc("."+lm,x),function(b){Ke(b)})}function m(x){A(Rc("."+um,x),function(b){Ke(b)})}function y(x){var b=l(x);return b||(b=l(x,!0),p(b,x),d(b,x)),b}function g(x){var b=l(x);b&&(m(b),h(b),d(b,x),p(b,x))}function w(x,b){var S=we(".floating",x),P=b.point;S&&ot(S,P.x,P.y)}function C(x,b,S){var P=u(b.index,x),M=S[b.index-1],R=S[b.index],I=b.point,B=Lc(M,R),L=xn(M,R),O,F;P&&(O=zR(P),F={x:I.x-B.x,y:I.y-B.y},L==="v"&&(F={x:F.y,y:F.x}),ot(O,F.x,F.y))}e.on("connection.changed",function(x){g(x.element)}),e.on("connection.remove",function(x){var b=l(x.element);b&&Ke(b)}),e.on("element.marker.update",function(x){var b=x.element,S;b.waypoints&&(S=y(b),x.add?me(S).add(x.marker):me(S).remove(x.marker))}),e.on("element.mousemove",function(x){var b=x.element,S=b.waypoints,P,M;if(S){if(P=l(b,!0),M=kl(t,S,x.originalEvent),!M)return;w(P,M),M.bendpoint||C(P,M,S)}}),e.on("element.mousedown",function(x){if(Xn(x)){var b=x.originalEvent,S=x.element;if(S.waypoints)return s(b,S)}}),e.on("selection.changed",function(x){var b=x.newSelection,S=b[0];S&&S.waypoints&&y(S)}),e.on("element.hover",function(x){var b=x.element;b.waypoints&&(y(b),n.registerEvent(x.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(x){n.unregisterEvent(x.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(x){var b=x.element,S=x.newId;if(b.waypoints){var P=l(b);P&&q(P,{"data-element-id":S})}}),this.addHandles=y,this.updateHandles=g,this.getBendpointsContainer=l,this.getSegmentDragger=u}fm.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];function zR(e){return we(".djs-visual",e)}var dm=Math.round,Di="reconnectStart",Ni="reconnectEnd",io="updateWaypoints";function Nl(e,t,n,i,r,o){this._injector=e,this.start=function(a,s,c,l){var u=n.getGraphics(s),p=s.source,d=s.target,h=s.waypoints,m;!l&&c===0?m=Di:!l&&c===h.length-1?m=Ni:m=io;var y=m===io?"connection.updateWaypoints":"connection.reconnect",g=r.allowed(y,{connection:s,source:p,target:d});g===!1&&(g=r.allowed(y,{connection:s,source:d,target:p})),g!==!1&&i.init(a,"bendpoint.move",{data:{connection:s,connectionGfx:u,context:{allowed:g,bendpointIndex:c,connection:s,source:p,target:d,insert:l,type:m}}})},t.on("bendpoint.move.hover",function(a){var s=a.context,c=s.connection,l=c.source,u=c.target,p=a.hover,d=s.type;s.hover=p;var h;if(p){var m=d===io?"connection.updateWaypoints":"connection.reconnect";if(h=s.allowed=r.allowed(m,{connection:c,source:d===Di?p:l,target:d===Ni?p:u}),h){s.source=d===Di?p:l,s.target=d===Ni?p:u;return}h===!1&&(h=s.allowed=r.allowed(m,{connection:c,source:d===Ni?p:u,target:d===Di?p:l})),h&&(s.source=d===Ni?p:u,s.target=d===Di?p:l)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(a){var s=a.context,c=s.type;s.hover=null,s.source=null,s.target=null,c!==io&&(s.allowed=!1)}),t.on("bendpoint.move.end",function(a){var s=a.context,c=s.allowed,l=s.bendpointIndex,u=s.connection,p=s.insert,d=u.waypoints.slice(),h=s.source,m=s.target,y=s.type,g=s.hints||{},w={x:dm(a.x),y:dm(a.y)};if(!c)return!1;y===io?(p?d.splice(l,0,w):d[l]=w,g.bendpointMove={insert:p,bendpointIndex:l},d=this.cropWaypoints(u,d),o.updateWaypoints(u,$x(d),g)):(y===Di?(g.docking="source",Xa(s)&&(g.docking="target",g.newWaypoints=d.reverse())):y===Ni&&(g.docking="target",Xa(s)&&(g.docking="source",g.newWaypoints=d.reverse())),o.reconnect(u,h,m,w,g))},this)}Nl.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],Nl.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var i=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=i,t};function Xa(e){var t=e.hover,n=e.source,i=e.target,r=e.type;if(r===Di)return t&&i&&t===i&&n!==i;if(r===Ni)return t&&n&&t===n&&n!==i}var WR="reconnectStart",UR="reconnectEnd",hm="updateWaypoints",ro="connect-ok",Za="connect-not-ok",mm="connect-hover",gm="djs-updating",ym="djs-dragging",vm=1100;function _m(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var a=o.context,s=a.bendpointIndex,c=a.connection,l=a.insert,u=c.waypoints,p=u.slice();a.waypoints=u,l&&p.splice(s,0,{x:o.x,y:o.y}),c.waypoints=p;var d=a.draggerGfx=Ml(i.getLayer("overlays"));me(d).add("djs-dragging"),i.addMarker(c,ym),i.addMarker(c,gm)}),n.on("bendpoint.move.hover",function(o){var a=o.context,s=a.allowed,c=a.hover,l=a.type;if(c){if(i.addMarker(c,mm),l===hm)return;s?(i.removeMarker(c,Za),i.addMarker(c,ro)):s===!1&&(i.removeMarker(c,ro),i.addMarker(c,Za))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],vm,function(o){var a=o.context,s=a.hover,c=a.target;s&&(i.removeMarker(s,mm),i.removeMarker(s,c?ro:Za))}),n.on("bendpoint.move.move",function(o){var a=o.context,s=a.allowed,c=a.bendpointIndex,l=a.draggerGfx,u=a.hover,p=a.type,d=a.connection,h=d.source,m=d.target,y=d.waypoints.slice(),g={x:o.x,y:o.y},w=a.hints||{},C={};r&&(w.connectionStart&&(C.connectionStart=w.connectionStart),w.connectionEnd&&(C.connectionEnd=w.connectionEnd),p===WR?Xa(a)?(C.connectionEnd=C.connectionEnd||g,C.source=m,C.target=u||h,y=y.reverse()):(C.connectionStart=C.connectionStart||g,C.source=u||h,C.target=m):p===UR?Xa(a)?(C.connectionStart=C.connectionStart||g,C.source=u||m,C.target=h,y=y.reverse()):(C.connectionEnd=C.connectionEnd||g,C.source=h,C.target=u||m):(C.noCropping=!0,C.noLayout=!0,y[c]=g),p===hm&&(y=e.cropWaypoints(d,y)),C.waypoints=y,r.drawPreview(a,s,C)),ot(l,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],vm,function(o){var a=o.context,s=a.connection,c=a.draggerGfx,l=a.hover,u=a.target,p=a.waypoints;s.waypoints=p,Ke(c),i.removeMarker(s,gm),i.removeMarker(s,ym),l&&(i.removeMarker(l,ro),i.removeMarker(l,u?ro:Za)),r&&r.cleanUp(a)})}_m.$inject=["bendpointMove","injector","eventBus","canvas"];var bm="connect-hover",Em="djs-updating";function xm(e,t,n){return Ol(e,t,e[t]+n)}function Ol(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function GR(e,t,n,i){var r=Math.max(t[i],n[i]),o=Math.min(t[i],n[i]),a=20,s=Math.min(Math.max(o+a,e[i]),r-a);return Ol(t,i,s)}function wm(e){return e==="x"?"y":"x"}function Sm(e,t,n){var i,r;return e.original?e.original:(i=te(t),r=wm(n),Ol(e,r,i[r]))}function Cm(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);this.start=function(p,d,h){var m,y=n.getGraphics(d),g=h-1,w=h,C=d.waypoints,x=C[g],b=C[w],S=kl(n,C,p),P,M,R;P=xn(x,b),P&&(M=P==="v"?"x":"y",g===0&&(x=Sm(x,d.source,M)),w===C.length-1&&(b=Sm(b,d.target,M)),S?R=S.point:R={x:(x.x+b.x)/2,y:(x.y+b.y)/2},m={connection:d,segmentStartIndex:g,segmentEndIndex:w,segmentStart:x,segmentEnd:b,axis:M,dragPosition:R},i.init(p,R,"connectionSegment.move",{cursor:M==="x"?"resize-ew":"resize-ns",data:{connection:d,connectionGfx:y,context:m}}))};function s(p,d){if(!a)return d;var h=p.waypoints,m;return p.waypoints=d,m=a.getCroppedWaypoints(p),p.waypoints=h,m}function c(p){r.update("connection",p.connection,p.connectionGfx)}function l(p,d,h){var m=p.newWaypoints,y=p.segmentStartIndex+d,g=m[y],w=p.segmentEndIndex+d,C=m[w],x=wm(p.axis),b=GR(h,g,C,x);ot(p.draggerGfx,b.x,b.y)}function u(p,d){var h=0,m=p.filter(function(y,g){return Bc(p[g-1],p[g+1],y)?(h=g<=d?h-1:h,!1):!0});return{waypoints:m,segmentOffset:h}}t.on("connectionSegment.move.start",function(p){var d=p.context,h=p.connection,m=n.getLayer("overlays");d.originalWaypoints=h.waypoints.slice(),d.draggerGfx=pm(m,d.segmentStart,d.segmentEnd),me(d.draggerGfx).add("djs-dragging"),n.addMarker(h,Em)}),t.on("connectionSegment.move.move",function(p){var d=p.context,h=d.connection,m=d.segmentStartIndex,y=d.segmentEndIndex,g=d.segmentStart,w=d.segmentEnd,C=d.axis,x=d.originalWaypoints.slice(),b=xm(g,C,p["d"+C]),S=xm(w,C,p["d"+C]),P=x.length,M=0;x[m]=b,x[y]=S;var R,I;m<2&&(R=ft(h.source,b),m===1?R==="intersect"&&(x.shift(),x[0]=b,M--):R!=="intersect"&&(x.unshift(g),M++)),y>P-3&&(I=ft(h.target,S),y===P-2?I==="intersect"&&(x.pop(),x[x.length-1]=S):I!=="intersect"&&x.push(w)),d.newWaypoints=h.waypoints=s(h,x),l(d,M,p),d.newSegmentStartIndex=m+M,c(p)}),t.on("connectionSegment.move.hover",function(p){p.context.hover=p.hover,n.addMarker(p.hover,bm)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var d=p.context.hover;d&&n.removeMarker(d,bm)}),t.on("connectionSegment.move.cleanup",function(p){var d=p.context,h=d.connection;d.draggerGfx&&Ke(d.draggerGfx),n.removeMarker(h,Em)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var d=p.context,h=d.connection;h.waypoints=d.originalWaypoints,c(p)}),t.on("connectionSegment.move.end",function(p){var d=p.context,h=d.connection,m=d.newWaypoints,y=d.newSegmentStartIndex;m=m.map(function(S){return{original:S.original,x:Math.round(S.x),y:Math.round(S.y)}});var g=u(m,y),w=g.waypoints,C=s(h,w),x=g.segmentOffset,b={segmentMove:{segmentStartIndex:d.segmentStartIndex,newSegmentStartIndex:y+x}};o.updateWaypoints(h,C,b)})}Cm.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var KR=Math.abs,Rm=Math.round;function qR(e,t,n){n=n===void 0?10:n;var i,r;for(i=0;i<t.length;i++)if(r=t[i],KR(r-e)<=n)return r}function Tm(e){return{x:e.x,y:e.y}}function Pm(e){return{x:e.x+e.width,y:e.y+e.height}}function Vt(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:Rm(e.x+e.width/2),y:Rm(e.y+e.height/2)}}function fr(e,t){var n=e.snapped;return n?typeof t=="string"?n[t]:n.x&&n.y:!1}function Ve(e,t,n){if(typeof t!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return n===!1?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function Am(e){return e.children||[]}var YR=Math.abs,km=Math.round,Il=10;function Mm(e){function t(o,a){if(oe(o)){for(var s=o.length;s--;)if(YR(o[s]-a)<=Il)return o[s]}else{o=+o;var c=a%o;if(c<Il)return a-c;if(c>o-Il)return a-c+o}return a}function n(o,a){if(o.waypoints)return FR(a,o);if(o.width)return{x:km(o.width/2+o.x),y:km(o.height/2+o.y)}}function i(o){var a=o.context,s=a.snapPoints,c=a.connection,l=c.waypoints,u=a.segmentStart,p=a.segmentStartIndex,d=a.segmentEnd,h=a.segmentEndIndex,m=a.axis;if(s)return s;var y=[l[p-1],u,d,l[h+1]];return p<2&&y.unshift(n(c.source,o)),h>l.length-3&&y.unshift(n(c.target,o)),a.snapPoints=s={horizontal:[],vertical:[]},A(y,function(g){g&&(g=g.original||g,m==="y"&&s.horizontal.push(g.y),m==="x"&&s.vertical.push(g.x))}),s}e.on("connectionSegment.move.move",1500,function(o){var a=i(o),s=o.x,c=o.y,l,u;if(a){l=t(a.vertical,s),u=t(a.horizontal,c);var p=s-l,d=c-u;D(o,{dx:o.dx-p,dy:o.dy-d,x:l,y:u}),(p||a.vertical.indexOf(s)!==-1)&&Ve(o,"x",l),(d||a.horizontal.indexOf(c)!==-1)&&Ve(o,"y",u)}});function r(o){var a=o.snapPoints,s=o.connection.waypoints,c=o.bendpointIndex;if(a)return a;var l=[s[c-1],s[c+1]];return o.snapPoints=a={horizontal:[],vertical:[]},A(l,function(u){u&&(u=u.original||u,a.horizontal.push(u.y),a.vertical.push(u.x))}),a}e.on(["connect.hover","connect.move","connect.end"],1500,function(o){var a=o.context,s=a.hover,c=s&&n(s,o);!Se(s)||!c||!c.x||!c.y||(Ve(o,"x",c.x),Ve(o,"y",c.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(o){var a=o.context,s=r(a),c=a.hover,l=c&&n(c,o),u=o.x,p=o.y,d,h;if(s){d=t(l?s.vertical.concat([l.x]):s.vertical,u),h=t(l?s.horizontal.concat([l.y]):s.horizontal,p);var m=u-d,y=p-h;D(o,{dx:o.dx-m,dy:o.dy-y,x:o.x-m,y:o.y-y}),(m||s.vertical.indexOf(u)!==-1)&&Ve(o,"x",d),(y||s.horizontal.indexOf(p)!==-1)&&Ve(o,"y",h)}})}Mm.$inject=["eventBus"];const XR={__depends__:[Mn,yn],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",fm],bendpointMove:["type",Nl],bendpointMovePreview:["type",_m],connectionSegmentMove:["type",Cm],bendpointSnapping:["type",Mm]};function Dm(e,t,n,i){function r(a,s){return i.allowed("connection.create",{source:a,target:s})}function o(a,s){return r(s,a)}e.on("connect.hover",function(a){var s=a.context,c=s.start,l=a.hover,u;if(s.hover=l,u=s.canExecute=r(c,l),!Mr(u)){if(u!==!1){s.source=c,s.target=l;return}u=s.canExecute=o(c,l),!Mr(u)&&u!==!1&&(s.source=l,s.target=c)}}),e.on(["connect.out","connect.cleanup"],function(a){var s=a.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),e.on("connect.end",function(a){var s=a.context,c=s.canExecute,l=s.connectionStart,u={x:a.x,y:a.y},p=s.source,d=s.target;if(!c)return!1;var h=null,m={connectionStart:Bl(s)?u:l,connectionEnd:Bl(s)?l:u};tt(c)&&(h=c),s.connection=n.connect(p,d,h,m)}),this.start=function(a,s,c,l){tt(c)||(l=c,c=te(s)),t.init(a,"connect",{autoActivate:l,data:{shape:s,context:{start:s,connectionStart:c}}})}}Dm.$inject=["eventBus","dragging","modeling","rules"];function Bl(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}var ZR=1100,JR=900,Nm="connect-ok",Om="connect-not-ok";function Im(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(r){var o=r.context,a=o.canExecute,s=o.hover,c=o.source,l=o.start,u=o.startPosition,p=o.target,d=o.connectionStart||u,h=o.connectionEnd||{x:r.x,y:r.y},m=d,y=h;Bl(o)&&(m=h,y=d),i.drawPreview(o,a,{source:c||l,target:p||s,connectionStart:m,connectionEnd:y})}),t.on("connect.hover",JR,function(r){var o=r.context,a=r.hover,s=o.canExecute;s!==null&&n.addMarker(a,s?Nm:Om)}),t.on(["connect.out","connect.cleanup"],ZR,function(r){var o=r.hover;o&&(n.removeMarker(o,Nm),n.removeMarker(o,Om))}),i&&t.on("connect.cleanup",function(r){i.cleanUp(r.context)})}Im.$inject=["injector","eventBus","canvas"];const Ll={__depends__:[tn,yn,Mn],__init__:["connectPreview"],connect:["type",Dm],connectPreview:["type",Im]};var QR="djs-dragger";function Dn(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Dn.$inject=["injector","canvas","graphicsFactory","elementFactory"],Dn.prototype.drawPreview=function(e,t,n){n=n||{};var i=e.connectionPreviewGfx,r=e.getConnection,o=n.source,a=n.target,s=n.waypoints,c=n.connectionStart,l=n.connectionEnd,u=n.noLayout,p=n.noCropping,d=n.noNoop,h,m=this;if(i||(i=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),ta(i),r||(r=e.getConnection=eT(function(y,g,w){return m.getConnection(y,g,w)})),t&&(h=r(t,o,a)),!h){!d&&this.drawNoopPreview(i,n);return}h.waypoints=s||[],this._layouter&&!u&&(h.waypoints=this._layouter.layoutConnection(h,{source:o,target:a,connectionStart:c,connectionEnd:l,waypoints:n.waypoints||h.waypoints})),(!h.waypoints||!h.waypoints.length)&&(h.waypoints=[o?te(o):c,a?te(a):l]),this._connectionDocking&&(o||a)&&!p&&(h.waypoints=this._connectionDocking.getCroppedWaypoints(h,o,a)),this._graphicsFactory.drawConnection(i,h,{stroke:"var(--element-dragger-color)"})},Dn.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||te(n),o=t.connectionEnd||te(i),a=this.cropWaypoints(r,o,n,i),s=this.createNoopConnection(a[0],a[1]);ie(e,s)},Dn.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),s=r.getConnectionPath({waypoints:[e,t]});return e=n&&Fc(o,s,!0)||e,t=i&&Fc(a,s,!1)||t,[e,t]},Dn.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&Ke(e.connectionPreviewGfx)},Dn.prototype.getConnection=function(e){var t=tT(e);return this._elementFactory.createConnection(t)},Dn.prototype.createConnectionPreviewGfx=function(){var e=X("g");return q(e,{pointerEvents:"none"}),me(e).add(QR),ie(this._canvas.getActiveLayer(),e),e},Dn.prototype.createNoopConnection=function(e,t){return ra([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function eT(e){var t={};return function(n){var i=JSON.stringify(n),r=t[i];return r||(r=t[i]=e.apply(null,arguments)),r}}function tT(e){return tt(e)?e:{}}const nT={__init__:["connectionPreview"],connectionPreview:["type",Dn]},iT=new Kr("ps");var rT=["marker-start","marker-mid","marker-end"],oT=["circle","ellipse","line","path","polygon","polyline","path","rect"];function Jn(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i}Jn.$inject=["elementRegistry","eventBus","canvas","styles"],Jn.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")},Jn.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},Jn.prototype.addDragger=function(e,t,n,i="djs-dragger"){n=n||this.getGfx(e);var r=df(n),o=n.getBoundingClientRect();return this._cloneMarkers(Ei(r),i),q(r,this._styles.cls(i,[],{x:o.top,y:o.left})),ie(t,r),q(r,"data-preview-support-element-id",e.id),r},Jn.prototype.addFrame=function(e,t){var n=X("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return ie(t,n),q(n,"data-preview-support-element-id",e.id),n},Jn.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var i=this;e.childNodes&&e.childNodes.forEach(r=>{i._cloneMarkers(r,t,n)}),lT(e)&&rT.forEach(function(r){if(q(e,r)){var o=aT(e,r,i._canvas.getContainer());o&&i._cloneMarker(n,e,o,r,t)}})},Jn.prototype._cloneMarker=function(e,t,n,i,r="djs-dragger"){var o=[n.id,r,iT.next()].join("-"),a=we("marker#"+n.id,e);e=e||this._canvas._svg;var s=a||df(n);s.id=o,me(s).add(r);var c=we(":scope > defs",e);c||(c=X("defs"),ie(e,c)),ie(c,s);var l=cT(s.id);q(t,i,l)};function aT(e,t,n){var i=sT(q(e,t));return we("marker#"+i,n||document)}function sT(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function cT(e){return"url(#"+e+")"}function lT(e){return oT.indexOf(e.nodeName)!==-1}const dr={__init__:["previewSupport"],previewSupport:["type",Jn]},Ja="complex-preview";class Bm{constructor(t,n,i){this._canvas=t,this._graphicsFactory=n,this._previewSupport=i,this._markers=[]}create(t){this.cleanUp();const{created:n=[],moved:i=[],removed:r=[],resized:o=[]}=t,a=this._canvas.getLayer(Ja);n.filter(s=>!uT(s)).forEach(s=>{let c;Se(s)?(c=this._graphicsFactory._createContainer("connection",X("g")),this._graphicsFactory.drawConnection(Ei(c),s)):(c=this._graphicsFactory._createContainer("shape",X("g")),this._graphicsFactory.drawShape(Ei(c),s),ot(c,s.x,s.y)),this._previewSupport.addDragger(s,a,c)}),i.forEach(({element:s,delta:c})=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"]);const l=this._previewSupport.addDragger(s,a);Se(s)?ot(l,c.x,c.y):ot(l,s.x+c.x,s.y+c.y)}),r.forEach(s=>{this._previewSupport.addDragger(s,a,void 0,"djs-dragging"),this._canvas.addMarker(s,"djs-element-hidden"),this._markers.push([s,"djs-element-hidden"])}),o.forEach(({shape:s,bounds:c})=>{this._canvas.addMarker(s,"djs-hidden"),this._markers.push([s,"djs-hidden"]),this._previewSupport.addDragger(s,a,void 0,"djs-dragging");const l=this._graphicsFactory._createContainer("shape",X("g"));this._graphicsFactory.drawShape(Ei(l),s,{width:c.width,height:c.height}),ot(l,c.x,c.y),this._previewSupport.addDragger(s,a,l)})}cleanUp(){ta(this._canvas.getLayer(Ja)),this._markers.forEach(([t,n])=>this._canvas.removeMarker(t,n)),this._markers=[]}show(){this._canvas.showLayer(Ja)}hide(){this._canvas.hideLayer(Ja)}}Bm.$inject=["canvas","graphicsFactory","previewSupport"];function uT(e){return e.hidden}const pT={__depends__:[dr],__init__:["complexPreview"],complexPreview:["type",Bm]};var $l=["top","bottom","left","right"],Qa=10;function jl(e,t){V.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(r){var o=r.context,a=o.connection,s=a.source,c=a.target,l=o.hints||{};l.createElementsBehavior!==!1&&(n(s),n(c))}),this.postExecuted(["label.create"],function(r){var o=r.context,a=o.shape,s=o.hints||{};s.createElementsBehavior!==!1&&n(a.labelTarget)}),this.postExecuted(["elements.create"],function(r){var o=r.context,a=o.elements,s=o.hints||{};s.createElementsBehavior!==!1&&a.forEach(function(c){n(c)})});function n(r){if(_a(r)&&!Se(r)){var o=hT(r);o&&i(r,o)}}function i(r,o){var a=te(r),s=r.label,c=te(s);if(s.parent){var l=Q(r),u;switch(o){case"top":u={x:a.x,y:l.top-Qa-s.height/2};break;case"left":u={x:l.left-Qa-s.width/2,y:a.y};break;case"bottom":u={x:a.x,y:l.bottom+Qa+s.height/2};break;case"right":u={x:l.right+Qa+s.width/2,y:a.y};break}var p=nn(u,c);t.moveShape(s,p)}}}Y(jl,V),jl.$inject=["eventBus","modeling"];function fT(e){var t=e.host,n=te(e),i=ft(n,t),r;i.indexOf("-")>=0?r=i.split("-"):r=[i];var o=$l.filter(function(a){return r.indexOf(a)===-1});return o}function dT(e){var t=te(e),n=[].concat(e.incoming.map(function(i){return i.waypoints[i.waypoints.length-2]}),e.outgoing.map(function(i){return i.waypoints[1]})).map(function(i){return Lm(t,i)});return n}function hT(e){var t=te(e.label),n=te(e),i=Lm(n,t);if(mT(i)){var r=dT(e);if(e.host){var o=fT(e);r=r.concat(o)}var a=$l.filter(function(s){return r.indexOf(s)===-1});if(a.indexOf(i)===-1)return a[0]}}function Lm(e,t){return ft(t,e,5)}function mT(e){return $l.indexOf(e)!==-1}function Fl(e){V.call(this,e),this.preExecute("shape.append",function(t){var n=t.source,i=t.shape;t.position||(E(i,"bpmn:TextAnnotation")?t.position={x:n.x+n.width/2+75,y:n.y-50-i.height/2}:t.position={x:n.x+n.width+80+i.width/2,y:n.y+n.height/2})},!0)}Y(Fl,V),Fl.$inject=["eventBus"];function Hl(e,t){e.invoke(V,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape,o=le(r.incoming.concat(r.outgoing),function(a){return E(a,"bpmn:Association")});A(o,function(a){t.moveConnection(a,{x:0,y:0},i)})},!0)}Y(Hl,V),Hl.$inject=["injector","modeling"];var $m=500;function es(e,t){t.invoke(V,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",$m,function(i){var r=i.elements;r=r.filter(function(o){var a=o.host;return jm(o,a)}),r.length===1&&r.map(function(o){return r.indexOf(o)}).forEach(function(o){var a=r[o];i.elements[o]=n._replaceShape(r[o],a)})},!0),this.preExecute("elements.move",$m,function(i){var r=i.shapes,o=i.newHost;if(r.length===1){var a=r[0];jm(a,o)&&(i.shapes=[n._replaceShape(a,o)])}},!0)}es.$inject=["bpmnReplace","injector"],Y(es,V),es.prototype._replaceShape=function(e,t){var n=gT(e),i={type:"bpmn:BoundaryEvent",host:t};return n&&(i.eventDefinitionType=n.$type),this._bpmnReplace.replaceElement(e,i,{layoutConnection:!1})};function gT(e){var t=z(e),n=t.eventDefinitions;return n&&n[0]}function jm(e,t){return!ge(e)&&ue(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function Vl(e,t){V.call(this,e);function n(i){return le(i.attachers,function(r){return E(r,"bpmn:BoundaryEvent")})}this.postExecute("connection.create",function(i){var r=i.context.source,o=i.context.target,a=n(o);E(r,"bpmn:EventBasedGateway")&&E(o,"bpmn:ReceiveTask")&&a.length>0&&t.removeElements(a)}),this.postExecute("connection.reconnect",function(i){var r=i.context.oldSource,o=i.context.newSource;E(r,"bpmn:Gateway")&&E(o,"bpmn:EventBasedGateway")&&A(o.outgoing,function(a){var s=a.target,c=n(s);E(s,"bpmn:ReceiveTask")&&c.length>0&&t.removeElements(c)})})}Vl.$inject=["eventBus","modeling"],Y(Vl,V);function zl(e,t,n){V.call(this,e),this.preExecute("shape.replace",s,!0),this.postExecuted("shape.replace",c,!0),this.preExecute("connection.create",r,!0),this.postExecuted("connection.delete",i,!0),this.postExecuted("connection.reconnect",o,!0),this.postExecuted("element.updateProperties",a,!0);function i(g){const w=g.source,C=g.target;hr(w)&&oo(C)&&u(C)}function r(g){const w=g.connection,C=g.source,x=g.target;hr(C)&&ts(x)&&(l(x),d(C,[w]))}function o(g){const w=g.newTarget,C=g.oldSource,x=g.oldTarget;if(x!==w){const b=C;oo(x)&&u(x),hr(b)&&ts(w)&&l(w)}}function a(g){const{element:w}=g;oo(w)?(p(w),h(w)):ts(w)&&m(w)}function s(g){const{newData:w,oldShape:C}=g;if(hr(g.oldShape)&&w.eventDefinitionType!=="bpmn:CompensateEventDefinition"||w.type!=="bpmn:BoundaryEvent"){const x=C.outgoing.find(({target:b})=>oo(b));x&&x.target&&(g._connectionTarget=x.target)}else if(!hr(g.oldShape)&&w.eventDefinitionType==="bpmn:CompensateEventDefinition"&&w.type==="bpmn:BoundaryEvent"){const x=C.outgoing.find(({target:b})=>ts(b));x&&x.target&&(g._connectionTarget=x.target),y(C)}}function c(g){const{_connectionTarget:w,newShape:C}=g;w&&t.connect(C,w)}function l(g){t.updateProperties(g,{isForCompensation:!0})}function u(g){t.updateProperties(g,{isForCompensation:void 0})}function p(g){for(const w of g.incoming)n.canConnect(w.source,g)||t.removeConnection(w);for(const w of g.outgoing)n.canConnect(g,w.target)||t.removeConnection(w)}function d(g,w){g.outgoing.filter(b=>E(b,"bpmn:Association")).filter(b=>oo(b.target)&&!w.includes(b)).forEach(b=>t.removeConnection(b))}function h(g){const w=g.attachers.slice();w.length&&t.removeElements(w)}function m(g){const w=g.incoming.filter(C=>hr(C.source));t.removeElements(w)}function y(g){const w=g.outgoing.filter(C=>E(C,"bpmn:SequenceFlow"));t.removeElements(w)}}Y(zl,V),zl.$inject=["eventBus","modeling","bpmnRules"];function oo(e){const t=z(e);return t&&t.get("isForCompensation")}function hr(e){return e&&E(e,"bpmn:BoundaryEvent")&&Ji(e,"bpmn:CompensateEventDefinition")}function ts(e){return e&&E(e,"bpmn:Activity")&&!mt(e)}function Wl(e){e.invoke(V,this),this.preExecute("shape.create",1500,function(t){var n=t.context,i=n.parent,r=n.shape;E(i,"bpmn:Lane")&&!E(r,"bpmn:Lane")&&(n.parent=lr(i,"bpmn:Participant"))})}Wl.$inject=["injector"],Y(Wl,V);function Ul(e,t){V.call(this,e),this.preExecute("shape.create",function(n){var i=n.context,r=i.shape;if(E(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=t.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}Ul.$inject=["eventBus","bpmnFactory"],Y(Ul,V);var Gl=20,Kl=20,Fm=30,ns=2e3;function ql(e,t,n){V.call(this,t),t.on(["create.start","shape.move.start"],ns,function(r){var o=r.context,a=o.shape,s=e.getRootElement();if(!(!E(a,"bpmn:Participant")||!E(s,"bpmn:Process")||!s.children.length)){var c=s.children.filter(function(p){return!E(p,"bpmn:Group")&&!ge(p)&&!Se(p)});if(c.length){var l=qe(c),u=yT(a,l);D(a,u),o.createConstraints=vT(a,l)}}}),t.on("create.start",ns,function(r){var o=r.context,a=o.shape,s=e.getRootElement(),c=e.getGraphics(s);function l(u){u.element=s,u.gfx=c}E(a,"bpmn:Participant")&&E(s,"bpmn:Process")&&(t.on("element.hover",ns,l),t.once("create.cleanup",function(){t.off("element.hover",l)}))});function i(){var r=e.getRootElement();return E(r,"bpmn:Collaboration")?r:n.makeCollaboration()}this.preExecute("elements.create",ns,function(r){var o=r.elements,a=r.parent,s=_T(o),c;s&&E(a,"bpmn:Process")&&(r.parent=i(),c=r.hints=r.hints||{},c.participant=s,c.process=a,c.processRef=z(s).get("processRef"))},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;E(a,"bpmn:Participant")&&E(o,"bpmn:Process")&&(r.parent=i(),r.process=o,r.processRef=z(a).get("processRef"))},!0),this.execute("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.shape,c=o.participant;a&&(!c||s===c)&&z(s).set("processRef",z(a))},!0),this.revert("shape.create",function(r){var o=r.hints||{},a=r.process||o.process,s=r.processRef||o.processRef,c=r.shape,l=o.participant;a&&(!l||c===l)&&z(c).set("processRef",s)},!0),this.postExecute("shape.create",function(r){var o=r.hints||{},a=r.process||r.hints.process,s=r.shape,c=o.participant;if(a){var l=a.children.slice();c?s===c&&n.moveElements(l,{x:0,y:0},c):n.moveElements(l,{x:0,y:0},s)}},!0)}ql.$inject=["canvas","eventBus","modeling"],Y(ql,V);function yT(e,t){t={width:t.width+Gl*2+Fm,height:t.height+Kl*2};var n=Math.max(e.width,t.width),i=Math.max(e.height,t.height);return{x:-n/2,y:-i/2,width:n,height:i}}function vT(e,t){return t=Q(t),{bottom:t.top+e.height/2-Kl,left:t.right-e.width/2+Gl,top:t.bottom-e.height/2+Kl,right:t.left+e.width/2-Gl-Fm}}function _T(e){return _e(e,function(t){return E(t,"bpmn:Participant")})}var Hm="__targetRef_placeholder";function Yl(e,t){V.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Vm(o)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Vm(o));function n(a,s,c){var l=a.get("dataInputAssociations");return _e(l,function(u){return u!==c&&u.targetRef===s})}function i(a,s){var c=a.get("properties"),l=_e(c,function(u){return u.name===Hm});return!l&&s&&(l=t.create("bpmn:Property",{name:Hm}),Ye(c,l)),l}function r(a,s){var c=i(a);c&&(n(a,c,s)||$e(a.get("properties"),c))}function o(a){var s=a.context,c=s.connection,l=c.businessObject,u=c.target,p=u&&u.businessObject,d=s.newTarget,h=d&&d.businessObject,m=s.oldTarget||s.target,y=m&&m.businessObject,g=c.businessObject,w;y&&y!==p&&r(y,l),h&&h!==p&&r(h,l),p?(w=i(p,!0),g.targetRef=w):g.targetRef=null}}Yl.$inject=["eventBus","bpmnFactory"],Y(Yl,V);function Vm(e){return function(t){var n=t.context,i=n.connection;if(E(i,"bpmn:DataInputAssociation"))return e(t)}}function is(e){this._bpmnUpdater=e}is.$inject=["bpmnUpdater"],is.prototype.execute=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.newSemanticParent,r=e.newDiParent;return e.oldSemanticParent=t.$parent,e.oldDiParent=n.$parent,this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]},is.prototype.revert=function(e){var t=e.dataStoreBo,n=e.dataStoreDi,i=e.oldSemanticParent,r=e.oldDiParent;return this._bpmnUpdater.updateSemanticParent(t,i),this._bpmnUpdater.updateDiParent(n,r),[]};function Xl(e,t,n,i){V.call(this,i),t.registerHandler("dataStore.updateContainment",is);function r(){return n.filter(function(s){return E(s,"bpmn:Participant")&&z(s).processRef})[0]}function o(s){return s.children.filter(function(c){return E(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function a(s,c){var l=s.businessObject||s;if(c=c||r(),c){var u=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:l,dataStoreDi:ye(s),newSemanticParent:u.processRef||u,newDiParent:ye(c)})}}this.preExecute("shape.create",function(s){var c=s.context,l=c.shape;E(l,"bpmn:DataStoreReference")&&l.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(s){var c=s.context,l=c.shapes,u=l.filter(function(p){return E(p,"bpmn:DataStoreReference")});u.length&&(c.hints||(c.hints={}),c.hints.autoResize=l.filter(function(p){return!E(p,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(s){var c=s.context,l=c.shape,u=l.parent;E(l,"bpmn:DataStoreReference")&&l.type!=="label"&&E(u,"bpmn:Collaboration")&&a(l)}),this.postExecute("shape.move",function(s){var c=s.context,l=c.shape,u=c.oldParent,p=l.parent;if(!E(u,"bpmn:Collaboration")&&E(l,"bpmn:DataStoreReference")&&l.type!=="label"&&E(p,"bpmn:Collaboration")){var d=E(u,"bpmn:Participant")?u:ET(u,"bpmn:Participant");a(l,d)}}),this.postExecute("shape.delete",function(s){var c=s.context,l=c.shape,u=e.getRootElement();ue(l,["bpmn:Participant","bpmn:SubProcess"])&&E(u,"bpmn:Collaboration")&&o(u).filter(function(p){return bT(p,l)}).forEach(function(p){a(p)})}),this.postExecute("canvas.updateRoot",function(s){var c=s.context,l=c.oldRoot,u=c.newRoot,p=o(l);p.forEach(function(d){E(u,"bpmn:Process")&&a(d,u)})})}Xl.$inject=["canvas","commandStack","elementRegistry","eventBus"],Y(Xl,V);function bT(e,t){for(var n=e.businessObject||e,i=t.businessObject||t;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}function ET(e,t){for(;e.parent;){if(E(e.parent,t))return e.parent;e=e.parent}}var rs=Math.max,os=Math.min,xT=20;function zm(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function wT(e,t,n){var i=n.x,r=n.y,o={x:e.x,y:e.y,width:e.width,height:e.height};return t.indexOf("n")!==-1?(o.y=e.y+r,o.height=e.height-r):t.indexOf("s")!==-1&&(o.height=e.height+r),t.indexOf("e")!==-1?o.width=e.width+i:t.indexOf("w")!==-1&&(o.x=e.x+i,o.width=e.width-i),o}function ST(e,t){return{x:e.x+(t.left||0),y:e.y+(t.top||0),width:e.width-(t.left||0)+(t.right||0),height:e.height-(t.top||0)+(t.bottom||0)}}function as(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return ee(r)&&(i=(/top|left/.test(e)?os:rs)(i,r)),ee(o)&&(i=(/top|left/.test(e)?rs:os)(i,o)),i}function CT(e,t){if(!t)return e;var n=Q(e);return ua({top:as("top",n,t),right:as("right",n,t),bottom:as("bottom",n,t),left:as("left",n,t)})}function RT(e,t,n,i){var r=Q(t),o={top:/n/.test(e)?r.bottom-n.height:r.top,left:/w/.test(e)?r.right-n.width:r.left,bottom:/s/.test(e)?r.top+n.height:r.bottom,right:/e/.test(e)?r.left+n.width:r.right},a=i?Q(i):o,s={top:os(o.top,a.top),left:os(o.left,a.left),bottom:rs(o.bottom,a.bottom),right:rs(o.right,a.right)};return ua(s)}function ao(e,t){return typeof e<"u"?e:xT}function TT(e,t){var n,i,r,o;return typeof t=="object"?(n=ao(t.left),i=ao(t.right),r=ao(t.top),o=ao(t.bottom)):n=i=r=o=ao(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}function PT(e){return!(e.waypoints||e.type==="label")}function Wm(e,t){var n;if(e.length===void 0?n=le(e.children,PT):n=e,n.length)return TT(qe(n),t)}var Qn=Math.abs;function AT(e,t){return zm(Q(t),Q(e))}var kT=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],zt=30;function ss(e,t){return t=t||[],e.children.filter(function(n){E(n,"bpmn:Lane")&&(ss(n,t),t.push(n))}),t}function ei(e){return e.children.filter(function(t){return E(t,"bpmn:Lane")})}function Wt(e){return lr(e,kT)||e}function MT(e,t){var n=Wt(e),i=E(n,"bpmn:Process")?[]:[n],r=ss(n,i),o=Q(e),a=Q(t),s=AT(e,t),c=[],l=Je(e);return r.forEach(function(u){if(u!==e){var p=l?0:s.top,d=l?s.right:0,h=l?0:s.bottom,m=l?s.left:0,y=Q(u);s.top&&(Qn(y.bottom-o.top)<10&&(h=a.top-y.bottom),Qn(y.top-o.top)<5&&(p=a.top-y.top)),s.left&&(Qn(y.right-o.left)<10&&(d=a.left-y.right),Qn(y.left-o.left)<5&&(m=a.left-y.left)),s.bottom&&(Qn(y.top-o.bottom)<10&&(p=a.bottom-y.top),Qn(y.bottom-o.bottom)<5&&(h=a.bottom-y.bottom)),s.right&&(Qn(y.left-o.right)<10&&(m=a.right-y.left),Qn(y.right-o.right)<5&&(d=a.right-y.right)),(p||d||h||m)&&c.push({shape:u,newBounds:ST(u,{top:p,right:d,bottom:h,left:m})})}}),c}var DT=500;function Zl(e,t){V.call(this,e);function n(i,r){var o=Je(i),a=ei(r),s=[],c=[],l=[],u=[];if(bi(a,function(g){return o?g.y>i.y?c.push(g):s.push(g):g.x>i.x?u.push(g):l.push(g),g.children}),!!a.length){var p;o?c.length&&s.length?p=i.height/2:p=i.height:u.length&&l.length?p=i.width/2:p=i.width;var d,h,m,y;s.length&&(d=t.calculateAdjustments(s,"y",p,i.y-10),t.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},"s")),c.length&&(h=t.calculateAdjustments(c,"y",-p,i.y+i.height+10),t.makeSpace(h.movingShapes,h.resizingShapes,{x:0,y:-p},"n")),l.length&&(m=t.calculateAdjustments(l,"x",p,i.x-10),t.makeSpace(m.movingShapes,m.resizingShapes,{x:p,y:0},"e")),u.length&&(y=t.calculateAdjustments(u,"x",-p,i.x+i.width+10),t.makeSpace(y.movingShapes,y.resizingShapes,{x:-p,y:0},"w"))}}this.postExecuted("shape.delete",DT,function(i){var r=i.context,o=r.hints,a=r.shape,s=r.oldParent;E(a,"bpmn:Lane")&&(o&&o.nested||n(a,s))})}Zl.$inject=["eventBus","spaceTool"],Y(Zl,V);var Um=500;function cs(e,t){t.invoke(V,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",Um,function(i){var r=i.elements;r.filter(function(o){var a=o.host;return Gm(o,a)}).map(function(o){return r.indexOf(o)}).forEach(function(o){i.elements[o]=n._replaceShape(r[o])})},!0),this.preExecute("elements.move",Um,function(i){var r=i.shapes,o=i.newHost;r.forEach(function(a,s){var c=a.host;Gm(a,OT(r,c)?c:o)&&(r[s]=n._replaceShape(a))})},!0)}cs.$inject=["bpmnReplace","injector"],Y(cs,V),cs.prototype._replaceShape=function(e){var t=NT(e),n;return t?n={type:"bpmn:IntermediateCatchEvent",eventDefinitionType:t.$type}:n={type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,n,{layoutConnection:!1})};function NT(e){var t=z(e),n=t.eventDefinitions;return n&&n[0]}function Gm(e,t){return!ge(e)&&E(e,"bpmn:BoundaryEvent")&&!t}function OT(e,t){return e.indexOf(t)!==-1}function Jl(e,t,n){V.call(this,e);function i(r,o,a){var s=o.waypoints,c,l,u,p,d,h,m,y=r.outgoing.slice(),g=r.incoming.slice(),w;ee(a.width)?w=te(a):w=a;var C=Pl(s,w);if(C){if(c=s.slice(0,C.index),l=s.slice(C.index+(C.bendpoint?1:0)),!c.length||!l.length)return;u=C.bendpoint?s[C.index]:w,(c.length===1||!Km(r,c[c.length-1]))&&c.push(qm(u)),(l.length===1||!Km(r,l[0]))&&l.unshift(qm(u))}p=o.source,d=o.target,t.canConnect(p,r,o)&&(n.reconnectEnd(o,r,c||w),h=o),t.canConnect(r,d,o)&&(h?m=n.connect(r,d,{type:o.type,waypoints:l}):(n.reconnectStart(o,r,l||w),m=o));var x=[].concat(h&&le(g,function(b){return b.source===h.source})||[],m&&le(y,function(b){return b.target===m.target})||[]);x.length&&n.removeElements(x)}this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,s=r.delta,c=a[0];if(!(!c||!o)){o&&o.waypoints&&(r.newParent=o=o.parent);var l=te(c),u={x:l.x+s.x,y:l.y+s.y},p=_e(o.children,function(d){var h=t.canInsert(a,d);return h&&Pl(d.waypoints,u)});p&&(r.targetFlow=p,r.position=u)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,s=r.position;a&&i(o[0],a,s)},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;t.canInsert(a,o)&&(r.targetFlow=o,r.parent=o.parent)},!0),this.postExecuted("shape.create",function(r){var o=r.shape,a=r.targetFlow,s=r.position;a&&i(o,a,s)},!0)}Y(Jl,V),Jl.$inject=["eventBus","bpmnRules","modeling"];function Km(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function qm(e){return D({},e)}function Ql(e,t){V.call(this,e),this.preExecuted("connection.create",function(n){var i=n.context,r=i.connection,o=i.source,a=i.target,s=i.hints;if(!(s&&s.createElementsBehavior===!1)&&mr(r)){var c=[];E(o,"bpmn:EventBasedGateway")?c=a.incoming.filter(l=>l!==r&&mr(l)):c=a.incoming.filter(l=>l!==r&&mr(l)&&E(l.source,"bpmn:EventBasedGateway")),c.forEach(function(l){t.removeConnection(l)})}}),this.preExecuted("shape.replace",function(n){var i=n.context,r=i.newShape;if(E(r,"bpmn:EventBasedGateway")){var o=r.outgoing.filter(mr).reduce(function(a,s){return a.includes(s.target)?a:a.concat(s.target)},[]);o.forEach(function(a){a.incoming.filter(mr).forEach(function(s){const c=a.incoming.filter(mr).filter(function(l){return l.source===r});(s.source!==r||c.length>1)&&t.removeConnection(s)})})}})}Ql.$inject=["eventBus","modeling"],Y(Ql,V);function mr(e){return E(e,"bpmn:SequenceFlow")}var ls=1500,Ym=2e3;function Xm(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],ls,function(i){var r=i.context,o=r.shape||i.shape,a=i.hover;E(a,"bpmn:Lane")&&!ue(o,["bpmn:Lane","bpmn:Participant"])&&(i.hover=Wt(a),i.hoverGfx=e.getGraphics(i.hover));var s=n.getRootElement();a!==s&&(o.labelTarget||ue(o,["bpmn:Group","bpmn:TextAnnotation"]))&&(i.hover=s,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],ls,function(i){var r=i.hover;E(r,"bpmn:Lane")&&(i.hover=Wt(r)||r,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["bendpoint.move.hover"],ls,function(i){var r=i.context,o=i.hover,a=r.type;E(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=Wt(o)||o,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.start"],ls,function(i){var r=i.context,o=r.start;E(o,"bpmn:Lane")&&(r.start=Wt(o)||o)}),t.on("shape.move.start",Ym,function(i){var r=i.shape;E(r,"bpmn:Lane")&&(i.shape=Wt(r)||r)}),t.on("spaceTool.move",Ym,function(i){var r=i.hover;r&&E(r,"bpmn:Lane")&&(i.hover=Wt(r))})}Xm.$inject=["elementRegistry","eventBus","canvas"];function IT(e){return e.create("bpmn:Category")}function BT(e){return e.create("bpmn:CategoryValue")}function LT(e,t,n){return Ye(t.get("categoryValue"),e),e.$parent=t,Ye(n.get("rootElements"),t),t.$parent=n,e}function $T(e){var t=e.$parent;return t&&($e(t.get("categoryValue"),e),e.$parent=null),e}function jT(e){var t=e.$parent;return t&&($e(t.get("rootElements"),e),e.$parent=null),e}var Zm=770;function eu(e,t,n,i,r,o){r.invoke(V,this);function a(){return n.filter(function(m){return E(m,"bpmn:Group")})}function s(m,y){return m.some(function(g){var w=z(g),C=w.categoryValueRef&&w.categoryValueRef.$parent;return C===y})}function c(m,y){return m.some(function(g){var w=z(g);return w.categoryValueRef===y})}function l(m,y,g){var w=a().filter(function(C){return C.businessObject!==g});y&&!s(w,y)&&jT(y),m&&!c(w,m)&&$T(m)}function u(m,y){return LT(m,y,t.getDefinitions())}function p(m,y){var g=z(m),w=g.categoryValueRef;w||(w=g.categoryValueRef=y.categoryValue=y.categoryValue||BT(e));var C=w.$parent;C||(C=w.$parent=y.category=y.category||IT(e)),u(w,C,t.getDefinitions())}function d(m,y){var g=y.category,w=y.categoryValue,C=z(m);w?(C.categoryValueRef=null,l(w,g,C)):l(null,C.categoryValueRef.$parent,C)}this.execute("label.create",function(m){var y=m.context,g=y.labelTarget;E(g,"bpmn:Group")&&p(g,y)}),this.revert("label.create",function(m){var y=m.context,g=y.labelTarget;E(g,"bpmn:Group")&&d(g,y)}),this.execute("shape.delete",function(m){var y=m.context,g=y.shape,w=z(g);if(!(!E(g,"bpmn:Group")||g.labelTarget)){var C=y.categoryValue=w.categoryValueRef,x;C&&(x=y.category=C.$parent,l(C,x,w),w.categoryValueRef=null)}}),this.reverted("shape.delete",function(m){var y=m.context,g=y.shape;if(!(!E(g,"bpmn:Group")||g.labelTarget)){var w=y.category,C=y.categoryValue,x=z(g);C&&(x.categoryValueRef=C,u(C,w))}}),this.execute("shape.create",function(m){var y=m.context,g=y.shape;!E(g,"bpmn:Group")||g.labelTarget||z(g).categoryValueRef&&p(g,y)}),this.reverted("shape.create",function(m){var y=m.context,g=y.shape;!E(g,"bpmn:Group")||g.labelTarget||z(g).categoryValueRef&&d(g,y)});function h(m,y){var g=e.create(m.$type);return o.copyElement(m,g,null,y)}i.on("copyPaste.copyElement",Zm,function(m){var y=m.descriptor,g=m.element;if(!(!E(g,"bpmn:Group")||g.labelTarget)){var w=z(g);if(w.categoryValueRef){var C=w.categoryValueRef;y.categoryValue=h(C,!0),C.$parent&&(y.category=h(C.$parent,!0))}}}),i.on("copyPaste.pasteElement",Zm,function(m){var y=m.descriptor,g=y.businessObject,w=y.categoryValue,C=y.category;w&&(w=g.categoryValueRef=h(w)),C&&(w.$parent=h(C)),delete y.category,delete y.categoryValue})}eu.$inject=["bpmnFactory","bpmnjs","elementRegistry","eventBus","injector","moddleCopy"],Y(eu,V);function tu(e,t,n,i){var r,o,a,s,c;return r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y),r==0?null:(o=e.y-n.y,a=e.x-n.x,c=(i.x-n.x)*o-(i.y-n.y)*a,s=c/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})}function Jm(e){function t(i,r,o){var a={x:o.x,y:o.y-50},s={x:o.x-50,y:o.y},c=tu(i,r,o,a),l=tu(i,r,o,s),u;c&&l?Qm(c,o)>Qm(l,o)?u=l:u=c:u=c||l,i.original=u}function n(i){var r=i.waypoints;t(r[0],r[1],te(i.source)),t(r[r.length-1],r[r.length-2],te(i.target))}e.on("bpmnElement.added",function(i){var r=i.element;r.waypoints&&n(r)})}Jm.$inject=["eventBus"];function Qm(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function nu(e){V.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=n.context.shape,r=z(i),o=ye(i);if(ue(r,t)){var a=o.get("isHorizontal");a===void 0&&(a=!0),o.set("isHorizontal",a)}})}nu.$inject=["eventBus"],Y(nu,V);var eg=Math.sqrt,tg=Math.min,FT=Math.max,ng=Math.abs;function ig(e){return Math.pow(e,2)}function so(e,t){return eg(ig(e.x-t.x)+ig(e.y-t.y))}function HT(e,t){var n=0,i,r,o,a,s,c,l,u,p,d,h;for(n=0;n<t.length-1;n++){if(i=t[n],r=t[n+1],og(i,r)?l=[i]:(o=so(e,i),a=so(e,r),c=tg(o,a),l=VT(i,r,e,c)),l.length<1)throw new Error("expected between [1, 2] circle -> line intersections");l.length===1&&(u={type:"bendpoint",position:l[0],segmentIndex:n,bendpointIndex:og(i,l[0])?n:n+1}),l.length===2&&(s=WT(l[0],l[1]),u={type:"segment",position:s,segmentIndex:n,relativeLocation:so(i,s)/so(i,r)}),p=so(u.position,e),(!h||d>p)&&(h=u,d=p)}return h}function VT(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,s=n.y-e.y,c=r*r+o*o,l=r*a+o*s,u=a*a+s*s-i*i,p=l/c,d=u/c,h=p*p-d;if(h<0&&h>-1e-6&&(h=0),h<0)return[];var m=eg(h),y=-p+m,g=-p-m,w={x:e.x-r*y,y:e.y-o*y};if(h===0)return[w];var C={x:e.x-r*g,y:e.y-o*g};return[w,C].filter(function(x){return zT(x,e,t)})}function zT(e,t,n){return rg(e.x,t.x,n.x)&&rg(e.y,t.y,n.y)}function rg(e,t,n){return e>=tg(t,n)-us&&e<=FT(t,n)+us}function WT(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var us=.1;function og(e,t){return ng(e.x-t.x)<=us&&ng(e.y-t.y)<=us}function UT(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o<s?s:r+o:r}if(i.bendpointMove){var c=i.bendpointMove.insert,l=i.bendpointMove.bendpointIndex,u;if(o===0)return r;if(r>=l&&(u=c?r+1:r-1),r<l&&(u=r,c&&n.type!=="bendpoint"&&l-1===r)){var p=sg(t,l);p<n.relativeLocation&&u++}return u}return o===0?r:i.connectionStart&&r===0?0:i.connectionEnd&&r===e.length-2?t.length-2:Math.floor((t.length-2)/2)}function ag(e,t,n,i){var r=0,o=0,a={point:e,delta:{x:0,y:0}},s=HT(e,n),c=s.segmentIndex,l=UT(n,t,s,i);if(l<0||l>t.length-2||l===null)return a;var u=cg(n,c),p=cg(t,l),d=s.position,h=KT(u,d),m=GT(u,p);if(s.type==="bendpoint"){var y=t.length-n.length,g=s.bendpointIndex,w=n[g];if(t.indexOf(w)!==-1)return a;if(y===0){var C=t[g];return r=C.x-s.position.x,o=C.y-s.position.y,{delta:{x:r,y:o},point:{x:e.x+r,y:e.y+o}}}y<0&&g!==0&&g<n.length-1&&(h=sg(n,g))}var x={x:(p[1].x-p[0].x)*h+p[0].x,y:(p[1].y-p[0].y)*h+p[0].y},b=BR({x:e.x-d.x,y:e.y-d.y},m);return r=x.x+b.x-e.x,o=x.y+b.y-e.y,{point:wn(x),delta:wn({x:r,y:o})}}function sg(e,t){var n=Ya(e[t-1],e[t]),i=Ya(e[t],e[t+1]),r=n/(n+i);return r}function GT(e,t){var n=sm(e),i=sm(t);return i-n}function cg(e,t){return[e[t],e[t+1]]}function KT(e,t){var n=Ya(e[0],e[1]),i=Ya(e[0],t);return n===0?0:i/n}function qT(e,t,n,i){var r=te(e);return ag(r,t,n,i).delta}function co(e,t,n){var i=Xr(t),r=Xr(n),o=nn(e,i),a={x:o.x*(n.width/t.width),y:o.y*(n.height/t.height)};return wn({x:r.x+a.x,y:r.y+a.y})}function lg(e,t,n){var i=Xr(e),r=Xr(t),o=Xr(n),a=nn(e,i),s=nn(i,r),c=YT(i,t,n);if(c)return c;var l={x:s.x*(n.width/t.width),y:s.y*(n.height/t.height)},u={x:o.x+l.x,y:o.y+l.y};return wn({x:u.x+a.x-e.x,y:u.y+a.y-e.y})}function YT(e,t,n){var i=Q(t),r=Q(n);if(XT(i,r))return null;var o=ft(t,e),a,s,c;if(o==="top")a={x:0,y:r.bottom-i.bottom};else if(o==="bottom")a={x:0,y:r.top-i.top};else if(o==="right")a={x:r.left-i.left,y:0};else if(o==="left")a={x:r.right-i.right,y:0};else return null;return s={x:e.x+a.x,y:e.y+a.y},c=ft(n,s),c!==o?null:a}function XT(e,t){return ZT(e,t)||JT(e,t)}function ZT(e,t){return e.right!==t.right&&e.left!==t.left}function JT(e,t){return e.top!==t.top&&e.bottom!==t.bottom}var ug="name",pg="text";function iu(e,t,n,i){V.call(this,e),this.postExecute("element.updateProperties",r),this.postExecute("element.updateModdleProperties",a=>{z(a.context.element)===a.context.moddleElement&&r(a)});function r(a){var s=a.context,c=s.element,l=s.properties;if(ug in l&&t.updateLabel(c,l[ug]),pg in l&&E(c,"bpmn:TextAnnotation")){var u=i.getTextAnnotationBounds({x:c.x,y:c.y,width:c.width,height:c.height},l[pg]||"");t.updateLabel(c,l.text,u)}}this.postExecute(["shape.create","connection.create"],function(a){var s=a.context,c=s.hints||{};if(c.createElementsBehavior!==!1){var l=s.shape||s.connection;ge(l)||!Ci(l)||en(l)&&t.updateLabel(l,en(l))}}),this.postExecute("shape.delete",function(a){var s=a.context,c=s.labelTarget,l=s.hints||{};c&&l.unsetLabel!==!1&&t.updateLabel(c,null,null,{removeShape:!1})});function o(a){var s=a.context,c=s.connection,l=c.label,u=D({},s.hints),p=s.newWaypoints||c.waypoints,d=s.oldWaypoints;return typeof u.startChanged>"u"&&(u.startChanged=!!u.connectionStart),typeof u.endChanged>"u"&&(u.endChanged=!!u.connectionEnd),qT(l,p,d,u)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(a){var s=a.context,c=s.hints||{};if(c.labelBehavior!==!1){var l=s.connection,u=l.label,p;!u||!u.parent||(p=o(a),t.moveShape(u,p))}}),this.postExecute(["shape.replace"],function(a){var s=a.context,c=s.newShape,l=s.oldShape,u=z(c);u&&Ci(u)&&l.label&&c.label&&(c.label.x=l.label.x,c.label.y=l.label.y)}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,l=s.newBounds,u=s.oldBounds;if(_a(c)){var p=c.label,d=te(p),h=tP(u),m=eP(d,h),y=QT(m,u,l);t.moveShape(p,y)}})}Y(iu,V),iu.$inject=["eventBus","modeling","bpmnFactory","textRenderer"];function QT(e,t,n){var i=co(e,t,n);return wn(nn(i,e))}function eP(e,t){if(t.length){var n=nP(e,t);return Al(e,n)}}function tP(e){return[[{x:e.x,y:e.y},{x:e.x+(e.width||0),y:e.y}],[{x:e.x+(e.width||0),y:e.y},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y+(e.height||0)},{x:e.x+(e.width||0),y:e.y+(e.height||0)}],[{x:e.x,y:e.y},{x:e.x,y:e.y+(e.height||0)}]]}function nP(e,t){var n=t.map(function(r){return{line:r,distance:cm(e,r)}}),i=cn(n,"distance");return i[0].line}function iP(e,t,n,i){return ag(e,t,n,i).point}function ru(e,t){V.call(this,e);function n(i,r){var o=i.context,a=o.connection,s=D({},o.hints),c=o.newWaypoints||a.waypoints,l=o.oldWaypoints;return typeof s.startChanged>"u"&&(s.startChanged=!!s.connectionStart),typeof s.endChanged>"u"&&(s.endChanged=!!s.connectionEnd),iP(r,c,l,s)}this.postExecute(["connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming;s.forEach(function(c){var l=c.waypoints[c.waypoints.length-1],u=n(i,l),p=[].concat(c.waypoints.slice(0,-1),[u]);t.updateWaypoints(c,p)}),a.forEach(function(c){var l=c.waypoints[0],u=n(i,l),p=[].concat([u],c.waypoints.slice(1));t.updateWaypoints(c,p)})}),this.postExecute(["connection.move"],function(i){var r=i.context,o=r.connection,a=o.outgoing,s=o.incoming,c=r.delta;s.forEach(function(l){var u=l.waypoints[l.waypoints.length-1],p={x:u.x+c.x,y:u.y+c.y},d=[].concat(l.waypoints.slice(0,-1),[p]);t.updateWaypoints(l,d)}),a.forEach(function(l){var u=l.waypoints[0],p={x:u.x+c.x,y:u.y+c.y},d=[].concat([p],l.waypoints.slice(1));t.updateWaypoints(l,d)})})}Y(ru,V),ru.$inject=["eventBus","modeling"];function ps(e,t,n){var i=ds(e),r=dg(i,t),o=i[0];return r.length?r[r.length-1]:co(o.original||o,n,t)}function fs(e,t,n){var i=ds(e),r=dg(i,t),o=i[i.length-1];return r.length?r[0]:co(o.original||o,n,t)}function ou(e,t,n){var i=ds(e),r=fg(t,n),o=i[0];return co(o.original||o,r,t)}function au(e,t,n){var i=ds(e),r=fg(t,n),o=i[i.length-1];return co(o.original||o,r,t)}function fg(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function ds(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function dg(e,t){var n=lt(e,oP);return le(n,function(i){return rP(i,t)})}function rP(e,t){return ft(t,e,1)==="intersect"}function oP(e){return e.original||e}function su(e,t){V.call(this,e),this.postExecute("shape.replace",function(n){var i=n.oldShape,r=n.newShape;if(aP(i,r)){var o=sP(i);o.incoming.forEach(function(a){var s=fs(a,r,i);t.reconnectEnd(a,r,s)}),o.outgoing.forEach(function(a){var s=ps(a,r,i);t.reconnectStart(a,r,s)})}},!0)}su.$inject=["eventBus","modeling"],Y(su,V);function aP(e,t){return E(e,"bpmn:Participant")&&fe(e)&&E(t,"bpmn:Participant")&&!fe(t)}function sP(e){var t=Or([e],!1),n=[],i=[];return t.forEach(function(r){r!==e&&(r.incoming.forEach(function(o){E(o,"bpmn:MessageFlow")&&n.push(o)}),r.outgoing.forEach(function(o){E(o,"bpmn:MessageFlow")&&i.push(o)}))},[]),{incoming:n,outgoing:i}}const cP=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function hg(e){const t=z(e);if(!E(t,"bpmn:BoundaryEvent")&&!(E(t,"bpmn:StartEvent")&&mt(t.$parent)))return!1;const n=t.get("eventDefinitions");return!n||!n.length?!1:cP.some(i=>E(n[0],i))}function mg(e){return E(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function cu(e,t){e.invoke(V,this),this.postExecuted("shape.replace",function(n){const i=n.context.oldShape,r=n.context.newShape,o=n.context.hints;if(!hg(r))return;const a=mg(r);if(o.targetElement&&o.targetElement[a]!==void 0)return;const c=z(i).get(a),l=z(r).get(a);c!==l&&t.updateProperties(r,{[a]:c})})}cu.$inject=["injector","modeling"],Y(cu,V);function lu(e,t){V.call(this,e),this.preExecute("shape.resize",function(n){var i=n.shape,r=ye(i),o=r&&r.get("label"),a=o&&o.get("bounds");a&&t.updateModdleProperties(i,o,{bounds:void 0})},!0)}Y(lu,V),lu.$inject=["eventBus","modeling"];function uu(e,t,n){V.call(this,e),this.preExecute("shape.delete",function(i){var r=i.context.shape;if(!(r.incoming.length!==1||r.outgoing.length!==1)){var o=r.incoming[0],a=r.outgoing[0];if(!(!E(o,"bpmn:SequenceFlow")||!E(a,"bpmn:SequenceFlow"))&&t.canConnect(o.source,a.target,o)){var s=lP(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,s)}}})}Y(uu,V),uu.$inject=["eventBus","bpmnRules","modeling"];function gr(e){return e.original||e}function lP(e,t){var n=tu(gr(e[e.length-2]),gr(e[e.length-1]),gr(t[1]),gr(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[gr(e[0]),gr(t[t.length-1])]}function pu(e,t){V.call(this,e),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;E(i,"bpmn:Participant")&&(n.collaborationRoot=r)},!0),this.postExecute("shape.delete",function(n){var i=n.collaborationRoot;if(i&&!i.businessObject.participants.length){var r=t.makeProcess(),o=i.children.slice();t.moveElements(o,{x:0,y:0},r)}},!0)}pu.$inject=["eventBus","modeling"],Y(pu,V);function fu(e,t,n,i){V.call(this,e);var r=i.get("dragging",!1);function o(c){var l=c.source,u=c.target,p=c.parent;if(p){var d,h;E(c,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(l,u)||(h=!0),n.canConnectMessageFlow(l,u)&&(d="bpmn:MessageFlow")),E(c,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(l,u)||(h=!0),n.canConnectSequenceFlow(l,u)&&(d="bpmn:SequenceFlow")),h&&t.removeConnection(c),d&&t.connect(l,u,{type:d,waypoints:c.waypoints.slice()})}}function a(c){var l=c.context,u=l.connection,p=l.newSource||u.source,d=l.newTarget||u.target,h,m;h=n.canConnect(p,d),!(!h||h.type===u.type)&&(m=t.connect(p,d,{type:h.type,associationDirection:h.associationDirection,waypoints:u.waypoints.slice()}),u.parent&&t.removeConnection(u),l.connection=m,r&&s(u,m))}function s(c,l){var u=r.context(),p=u&&u.payload.previousSelection,d;!p||!p.length||(d=p.indexOf(c),d!==-1&&p.splice(d,1,l))}this.postExecuted("elements.move",function(c){var l=c.closure,u=l.allConnections;A(u,o)},!0),this.preExecute("connection.reconnect",a),this.postExecuted("element.updateProperties",function(c){var l=c.context,u=l.properties,p=l.element,d=p.businessObject,h;u.default&&(h=_e(p.outgoing,Jt({id:p.businessObject.default.id})),h&&t.updateProperties(h,{conditionExpression:void 0})),u.conditionExpression&&d.sourceRef.default===d&&t.updateProperties(p.source,{default:void 0})})}Y(fu,V),fu.$inject=["eventBus","modeling","bpmnRules","injector"];function hs(e,t,n,i,r,o){i.invoke(V,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var s=a.context,c=s.parent,l=s.elements,u=Tt(l,function(p,d){var h=t.canReplace([d],d.host||d.parent||c);return h?p.concat(h.replacements):p},[]);u.length&&this._replaceElements(l,u)},this),this.postExecuted(["elements.move"],500,function(a){var s=a.context,c=s.newParent,l=s.newHost,u=[];A(s.closure.topLevel,function(d){mt(d)?u=u.concat(d.children):u=u.concat(d)}),u.length===1&&l&&(c=l);var p=t.canReplace(u,c);p&&this._replaceElements(u,p.replacements,l)},this),this.postExecute(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,l=s.newShape,u=c.attachers,p;u&&u.length&&(p=t.canReplace(u,l),this._replaceElements(u,p.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var s=a.context,c=s.oldShape,l=s.newShape;r.unclaimId(c.businessObject.id,c.businessObject),r.updateProperties(l,{id:c.id})})}Y(hs,V),hs.prototype._replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;A(t,function(o){var a={type:o.newElementType},s=n.get(o.oldElementId),c=e.indexOf(s);e[c]=i.replaceElement(s,a,{select:!1})}),t&&r.select(e)},hs.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var uP=1500,pP={width:140,height:120},du={width:300,height:60},hu={width:60,height:300},ms={width:300,height:150},gs={width:150,height:300},gg={width:140,height:120},yg={width:50,height:30};function vg(e){e.on("resize.start",uP,function(t){var n=t.context,i=n.shape,r=n.direction,o=n.balanced;(E(i,"bpmn:Lane")||E(i,"bpmn:Participant"))&&(n.resizeConstraints=gP(i,r,o)),E(i,"bpmn:SubProcess")&&fe(i)&&(n.minDimensions=gg),E(i,"bpmn:TextAnnotation")&&(n.minDimensions=yg)})}vg.$inject=["eventBus"];var ti=Math.abs,fP=Math.min,dP=Math.max;function _g(e,t,n,i){var r=e[t];e[t]=r===void 0?n:i(n,r)}function yr(e,t,n){return _g(e,t,n,fP)}function vr(e,t,n){return _g(e,t,n,dP)}var hP={top:20,left:50,right:20,bottom:20},mP={top:50,left:20,right:20,bottom:20};function gP(e,t,n){var i=Wt(e),r=!0,o=!0,a=ss(i,[i]),s=Q(e),c={},l={},u=Je(e),p=u?du:hu;/n/.test(t)?l.top=s.bottom-p.height:/e/.test(t)?l.right=s.left+p.width:/s/.test(t)?l.bottom=s.top+p.height:/w/.test(t)&&(l.left=s.right-p.width),a.forEach(function(m){var y=Q(m);u?(y.top<s.top-10&&(r=!1),y.bottom>s.bottom+10&&(o=!1)):(y.left<s.left-10&&(r=!1),y.right>s.right+10&&(o=!1)),/n/.test(t)&&(n&&ti(s.top-y.bottom)<10&&vr(c,"top",y.top+p.height),ti(s.top-y.top)<5&&yr(l,"top",y.bottom-p.height)),/e/.test(t)&&(n&&ti(s.right-y.left)<10&&yr(c,"right",y.right-p.width),ti(s.right-y.right)<5&&vr(l,"right",y.left+p.width)),/s/.test(t)&&(n&&ti(s.bottom-y.top)<10&&yr(c,"bottom",y.bottom-p.height),ti(s.bottom-y.bottom)<5&&vr(l,"bottom",y.top+p.height)),/w/.test(t)&&(n&&ti(s.left-y.right)<10&&vr(c,"left",y.left+p.width),ti(s.left-y.left)<5&&yr(l,"left",y.right-p.width))});var d=i.children.filter(function(m){return!m.hidden&&!m.waypoints&&(E(m,"bpmn:FlowElement")||E(m,"bpmn:Artifact"))}),h=u?hP:mP;return d.forEach(function(m){var y=Q(m);/n/.test(t)&&(!u||r)&&yr(l,"top",y.top-h.top),/e/.test(t)&&(u||o)&&vr(l,"right",y.right+h.right),/s/.test(t)&&(!u||o)&&vr(l,"bottom",y.bottom+h.bottom),/w/.test(t)&&(u||r)&&yr(l,"left",y.left-h.left)}),{min:l,max:c}}var bg=1001;function Eg(e,t){e.on("resize.start",bg+500,function(n){var i=n.context,r=i.shape;(E(r,"bpmn:Lane")||E(r,"bpmn:Participant"))&&(i.balanced=!Yr(n))}),e.on("resize.end",bg,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(E(r,"bpmn:Lane")||E(r,"bpmn:Participant"))return o&&(a=Ff(a),t.resizeLane(r,a,i.balanced)),!1})}Eg.$inject=["eventBus","modeling"];var yP=500;function mu(e,t,n,i,r){n.invoke(V,this);function o(u){return ue(u,["bpmn:ReceiveTask","bpmn:SendTask"])||vP(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){var p=e.getDefinitions(),d=p.get("rootElements");return!!_e(d,Jt({id:u.id}))}function s(u){if(E(u,"bpmn:ErrorEventDefinition"))return"errorRef";if(E(u,"bpmn:EscalationEventDefinition"))return"escalationRef";if(E(u,"bpmn:MessageEventDefinition"))return"messageRef";if(E(u,"bpmn:SignalEventDefinition"))return"signalRef"}function c(u){if(ue(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var p=u.get("eventDefinitions"),d=p[0];return d.get(s(d))}function l(u,p){if(ue(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.set("messageRef",p);var d=u.get("eventDefinitions"),h=d[0];return h.set(s(h),p)}this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(u){var p=u.shape||u.element;if(o(p)){var d=z(p),h=c(d),m;h&&!a(h)&&(m=e.getDefinitions().get("rootElements"),Ye(m,h),u.addedRootElement=h)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(u){var p=u.addedRootElement;if(p){var d=e.getDefinitions().get("rootElements");$e(d,p)}},!0),t.on("copyPaste.copyElement",function(u){var p=u.descriptor,d=u.element;if(!(d.labelTarget||!o(d))){var h=z(d),m=c(h);m&&(p.referencedRootElement=m)}}),t.on("copyPaste.pasteElement",yP,function(u){var p=u.descriptor,d=p.businessObject,h=p.referencedRootElement;h&&(a(h)||(h=i.copyElement(h,r.create(h.$type))),l(d,h),delete p.referencedRootElement)})}mu.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],Y(mu,V);function vP(e,t){return oe(t)||(t=[t]),jn(t,function(n){return Ji(e,n)})}var xg=Math.max;function wg(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,i=t.axis,r=t.start,o={};return A(n,function(a){var s=a.id;E(a,"bpmn:Participant")&&(o[s]=bP(a,i,r)),E(a,"bpmn:Lane")&&(o[s]=Je(a)?du:hu),E(a,"bpmn:SubProcess")&&fe(a)&&(o[s]=gg),E(a,"bpmn:TextAnnotation")&&(o[s]=yg),E(a,"bpmn:Group")&&(o[s]=pP)}),o})}wg.$inject=["eventBus"];function _P(e){return e==="x"}function bP(e,t,n){var i=Je(e);if(!wP(e))return i?ms:gs;var r=_P(t),o={};return r?i?o=ms:o={width:xP(e,n,r),height:gs.height}:i?o={width:ms.width,height:EP(e,n,r)}:o=gs,o}function EP(e,t,n){var i;return i=SP(e,t,n),xg(ms.height,i)}function xP(e,t,n){var i;return i=CP(e,t,n),xg(gs.width,i)}function wP(e){return!!ei(e).length}function SP(e,t,n){var i=ei(e),r;return r=gu(i,t,n),e.height-r.height+du.height}function CP(e,t,n){var i=ei(e),r;return r=gu(i,t,n),e.width-r.width+hu.width}function gu(e,t,n){var i,r,o;for(i=0;i<e.length;i++)if(r=e[i],!n&&t>=r.y&&t<=r.y+r.height||n&&t>=r.x&&t<=r.x+r.width)return o=ei(r),o.length?gu(o,t,n):r}var Sg=400,RP=600,Cg={x:180,y:160};function ni(e,t,n,i,r,o,a){V.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=a;var s=this;function c(p){return E(p,"bpmn:SubProcess")&&!fe(p)}function l(p){var d=p.shape,h=p.newRootElement,m=z(d);h=s._addDiagram(h||m),p.newRootElement=e.addRootElement(h)}function u(p){var d=p.shape,h=z(d);s._removeDiagram(h);var m=p.newRootElement=a.get(Pn(h));e.removeRootElement(m)}this.executed("shape.create",function(p){var d=p.shape;c(d)&&l(p)},!0),this.postExecuted("shape.create",function(p){var d=p.shape,h=p.newRootElement;!h||!d.children||(s._showRecursively(d.children),s._moveChildrenToShape(d,h))},!0),this.reverted("shape.create",function(p){var d=p.shape;c(d)&&u(p)},!0),this.preExecuted("shape.delete",function(p){var d=p.shape;if(c(d)){var h=a.get(Pn(d));h&&n.removeElements(h.children.slice())}},!0),this.executed("shape.delete",function(p){var d=p.shape;c(d)&&u(p)},!0),this.reverted("shape.delete",function(p){var d=p.shape;c(d)&&l(p)},!0),this.preExecuted("shape.replace",function(p){var d=p.oldShape,h=p.newShape;!c(d)||!c(h)||(p.oldRoot=e.removeRootElement(Pn(d)))},!0),this.postExecuted("shape.replace",function(p){var d=p.newShape,h=p.oldRoot,m=e.findRoot(Pn(d));if(!(!h||!m)){var y=h.children;n.moveElements(y,{x:0,y:0},m)}},!0),this.executed("element.updateProperties",function(p){var d=p.element;if(E(d,"bpmn:SubProcess")){var h=p.properties,m=p.oldProperties,y=m.id,g=h.id;if(y!==g){if(Ta(d)){a.updateId(d,Ti(g)),a.updateId(y,g);return}var w=a.get(Ti(y));w&&a.updateId(Ti(y),Ti(g))}}},!0),this.reverted("element.updateProperties",function(p){var d=p.element;if(E(d,"bpmn:SubProcess")){var h=p.properties,m=p.oldProperties,y=m.id,g=h.id;if(y!==g){if(Ta(d)){a.updateId(d,Ti(y)),a.updateId(g,y);return}var w=a.get(Ti(g));w&&a.updateId(w,Ti(y))}}},!0),t.on("element.changed",function(p){var d=p.element;if(Ta(d)){var h=d,m=a.get(Bd(h));!m||m===h||t.fire("element.changed",{element:m})}}),this.executed("shape.toggleCollapse",Sg,function(p){var d=p.shape;E(d,"bpmn:SubProcess")&&(fe(d)?u(p):(l(p),s._showRecursively(d.children)))},!0),this.reverted("shape.toggleCollapse",Sg,function(p){var d=p.shape;E(d,"bpmn:SubProcess")&&(fe(d)?u(p):(l(p),s._showRecursively(d.children)))},!0),this.postExecuted("shape.toggleCollapse",RP,function(p){var d=p.shape;if(E(d,"bpmn:SubProcess")){var h=p.newRootElement;h&&(fe(d)?s._moveChildrenToShape(h,d):s._moveChildrenToShape(d,h))}},!0),t.on("copyPaste.createTree",function(p){var d=p.element,h=p.children;if(c(d)){var m=Pn(d),y=a.get(m);y&&h.push.apply(h,y.children)}}),t.on("copyPaste.copyElement",function(p){var d=p.descriptor,h=p.element,m=p.elements,y=h.parent,g=E(ye(y),"bpmndi:BPMNPlane");if(g){var w=Bd(y),C=_e(m,function(x){return x.id===w});C&&(d.parent=C.id)}}),t.on("copyPaste.pasteElement",function(p){var d=p.descriptor;d.parent&&(c(d.parent)||d.parent.hidden)&&(d.hidden=!0)})}Y(ni,V),ni.prototype._moveChildrenToShape=function(e,t){var n=this._modeling,i=e.children,r;if(i){i=i.concat(i.reduce(function(l,u){return u.label&&u.label.parent!==e?l.concat(u.label):l},[]));var o=i.filter(function(l){return!l.hidden});if(!o.length){n.moveElements(i,{x:0,y:0},t,{autoResize:!1});return}var a=qe(o);if(!t.x)r={x:Cg.x-a.x,y:Cg.y-a.y};else{var s=te(t),c=te(a);r={x:s.x-c.x,y:s.y-c.y}}n.moveElements(i,r,t,{autoResize:!1})}},ni.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach(function(r){r.hidden=!!t,i=i.concat(r),r.children&&(i=i.concat(n._showRecursively(r.children,r.collapsed||t)))}),i},ni.prototype._addDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),n.push(e.di.$parent),e},ni.prototype._createNewDiagram=function(e){var t=this._bpmnFactory,n=this._elementFactory,i=t.create("bpmndi:BPMNPlane",{bpmnElement:e}),r=t.create("bpmndi:BPMNDiagram",{plane:i});i.$parent=r;var o=n.createRoot({id:Pn(e),type:e.$type,di:i,businessObject:e,collapsed:!0});return o},ni.prototype._removeDiagram=function(e){var t=this._bpmnjs,n=t.getDefinitions().diagrams,i=_e(n,function(r){return r.plane.bpmnElement.id===e.id});return n.splice(n.indexOf(i),1),i},ni.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"];function yu(e,t){e.invoke(V,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(!(!E(r,"bpmn:SubProcess")||E(r,"bpmn:AdHocSubProcess")||!(E(i,"bpmn:Task")||E(i,"bpmn:CallActivity"))||!fe(r))){var o=TP(r);t.createShape({type:"bpmn:StartEvent"},o,r)}})}yu.$inject=["injector","modeling"],Y(yu,V);function TP(e){return{x:e.x+e.width/6,y:e.y+e.height/2}}function vu(e){V.call(this,e),this.preExecute("connection.create",function(t){const{target:n}=t;E(n,"bpmn:TextAnnotation")&&(t.parent=n.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(t){const n=t.shapes||[t.shape];n.length===1&&E(n[0],"bpmn:TextAnnotation")&&(t.hints=t.hints||{},t.hints.autoResize=!1)},!0)}Y(vu,V),vu.$inject=["eventBus"];function _u(e,t){V.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(n){var i=n.shape;if(fe(i))return;var r=Or(i);r.forEach(function(a){var s=a.incoming.slice(),c=a.outgoing.slice();A(s,function(l){o(l,!0)}),A(c,function(l){o(l,!1)})});function o(a,s){r.indexOf(a.source)!==-1&&r.indexOf(a.target)!==-1||(s?t.reconnectEnd(a,i,te(i)):t.reconnectStart(a,i,te(i)))}},!0)}Y(_u,V),_u.$inject=["eventBus","modeling"];var bu=500;function Eu(e,t,n){V.call(this,e);function i(a){a.length&&a.forEach(function(s){s.type==="label"&&!s.businessObject.name&&(s.hidden=!0)})}function r(a,s){var c=a.children,l=s,u,p;return u=PP(c).concat([a]),p=Wm(u),p?(l.width=Math.max(p.width,l.width),l.height=Math.max(p.height,l.height),l.x=p.x+(p.width-l.width)/2,l.y=p.y+(p.height-l.height)/2):(l.x=a.x+(a.width-l.width)/2,l.y=a.y+(a.height-l.height)/2),l}function o(a,s){return{x:a.x+(a.width-s.width)/2,y:a.y+(a.height-s.height)/2,width:s.width,height:s.height}}this.executed(["shape.toggleCollapse"],bu,function(a){var s=a.context,c=s.shape;E(c,"bpmn:SubProcess")&&(c.collapsed?ye(c).isExpanded=!1:(i(c.children),ye(c).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],bu,function(a){var s=a.context,c=s.shape;c.collapsed?ye(c).isExpanded=!1:ye(c).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],bu,function(a){var s=a.context.shape,c=t.getDefaultSize(s),l;s.collapsed?l=o(s,c):l=r(s,c),n.resizeShape(s,l,null,{autoResize:s.collapsed?!1:"nwse"})})}Y(Eu,V),Eu.$inject=["eventBus","elementFactory","modeling"];function PP(e){return e.filter(function(t){return!t.hidden})}function xu(e,t,n,i){t.invoke(V,this),this.preExecute("shape.delete",function(r){var o=r.context,a=o.shape,s=a.businessObject;ge(a)||(E(a,"bpmn:Participant")&&fe(a)&&n.ids.unclaim(s.processRef.id),i.unclaimId(s.id,s))}),this.preExecute("connection.delete",function(r){var o=r.context,a=o.connection,s=a.businessObject;i.unclaimId(s.id,s)}),this.preExecute("canvas.updateRoot",function(){var r=e.getRootElement(),o=r.businessObject;E(r,"bpmn:Collaboration")&&n.ids.unclaim(o.id)})}Y(xu,V),xu.$inject=["canvas","injector","moddle","modeling"];function wu(e,t){V.call(this,e),this.preExecute("connection.delete",function(n){var i=n.context,r=i.connection,o=r.source;AP(r,o)&&t.updateProperties(o,{default:null})})}Y(wu,V),wu.$inject=["eventBus","modeling"];function AP(e,t){if(!E(e,"bpmn:SequenceFlow"))return!1;var n=z(t),i=z(e);return n.get("default")===i}var kP=500,MP=5e3;function Su(e,t){V.call(this,e);var n;function i(){return n=n||new DP,n.enter(),n}function r(){if(!n)throw new Error("out of bounds release");return n}function o(){if(!n)throw new Error("out of bounds release");var s=n.leave();return s&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null),s}var a=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(a,MP,function(s){i()}),this.postExecuted(a,kP,function(s){o()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(s){var c=s.context,l=c.shape,u=r();l.labelTarget||(E(l,"bpmn:Lane")&&u.addLane(l),E(l,"bpmn:FlowNode")&&u.addFlowNode(l))})}Su.$inject=["eventBus","modeling"],Y(Su,V);function DP(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function Cu(e,t){V.call(this,e),this.postExecuted("elements.create",function(n){const i=n.context,r=i.elements;for(const o of r)NP(o)&&!IP(o)&&t.updateProperties(o,{isForCompensation:void 0})})}Y(Cu,V),Cu.$inject=["eventBus","modeling"];function NP(e){const t=z(e);return t&&t.isForCompensation}function OP(e){return e&&E(e,"bpmn:BoundaryEvent")&&Ji(e,"bpmn:CompensateEventDefinition")}function IP(e){return e.incoming.filter(n=>OP(n.source)).length>0}const BP={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","compensateBoundaryEventBehaviour","createBehavior","createDataObjectBehavior","createParticipantBehavior","dataInputAssociationBehavior","dataStoreBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","fixHoverBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","layoutConnectionBehavior","messageFlowBehavior","nonInterruptingBehavior","removeElementBehavior","removeEmbeddedLabelBoundsBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","rootElementReferenceBehavior","spaceToolBehavior","subProcessPlaneBehavior","subProcessStartEventBehavior","textAnnotationBehavior","toggleCollapseConnectionBehaviour","toggleElementCollapseBehaviour","unclaimIdBehavior","updateFlowNodeRefsBehavior","unsetDefaultFlowBehavior","setCompensationActivityAfterPasteBehavior"],adaptiveLabelPositioningBehavior:["type",jl],appendBehavior:["type",Fl],associationBehavior:["type",Hl],attachEventBehavior:["type",es],boundaryEventBehavior:["type",Vl],compensateBoundaryEventBehaviour:["type",zl],createBehavior:["type",Wl],createDataObjectBehavior:["type",Ul],createParticipantBehavior:["type",ql],dataInputAssociationBehavior:["type",Yl],dataStoreBehavior:["type",Xl],deleteLaneBehavior:["type",Zl],detachEventBehavior:["type",cs],dropOnFlowBehavior:["type",Jl],eventBasedGatewayBehavior:["type",Ql],fixHoverBehavior:["type",Xm],groupBehavior:["type",eu],importDockingFix:["type",Jm],isHorizontalFix:["type",nu],labelBehavior:["type",iu],layoutConnectionBehavior:["type",ru],messageFlowBehavior:["type",su],nonInterruptingBehavior:["type",cu],removeElementBehavior:["type",uu],removeEmbeddedLabelBoundsBehavior:["type",lu],removeParticipantBehavior:["type",pu],replaceConnectionBehavior:["type",fu],replaceElementBehaviour:["type",hs],resizeBehavior:["type",vg],resizeLaneBehavior:["type",Eg],rootElementReferenceBehavior:["type",mu],spaceToolBehavior:["type",wg],subProcessPlaneBehavior:["type",ni],subProcessStartEventBehavior:["type",yu],textAnnotationBehavior:["type",vu],toggleCollapseConnectionBehaviour:["type",_u],toggleElementCollapseBehaviour:["type",Eu],unclaimIdBehavior:["type",xu],unsetDefaultFlowBehavior:["type",wu],updateFlowNodeRefsBehavior:["type",Su],setCompensationActivityAfterPasteBehavior:["type",Cu]};function Rg(e,t){var n=ft(e,t,-15);return n!=="intersect"?n:null}function at(e){Ht.call(this,e)}Y(at,Ht),at.$inject=["eventBus"],at.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return LP(t)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent,o=i.targetAttach;if(o)return!1;r&&(n.parent=r);try{return vs(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,i=e.target;return vs(n,i,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){var t=e.shape,n=e.newBounds;return Lg(t,n)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return Se(i)&&!_s(t,i)?!1:vi(t,function(r){return Se(r)?vs(r.source,r.target,r):r.host?lo(r,r.host,null,n):ku(r,i,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position;return lo(n,t,null,i)||Ig(n,t,i)||Bg(n,t)||_s(n,t)}),this.addRule("shape.create",function(e){return ku(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return lo(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element,n=e.elements;return Vg(n,t)})},at.prototype.canConnectMessageFlow=Fg,at.prototype.canConnectSequenceFlow=Hg,at.prototype.canConnectDataAssociation=Mu,at.prototype.canConnectAssociation=$g,at.prototype.canConnectCompensationAssociation=jg,at.prototype.canMove=Bg,at.prototype.canAttach=lo,at.prototype.canReplace=Ig,at.prototype.canDrop=_r,at.prototype.canInsert=_s,at.prototype.canCreate=ku,at.prototype.canConnect=vs,at.prototype.canResize=Lg,at.prototype.canCopy=Vg;function LP(e){return Ru(e)?null:ue(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}function Ru(e){return!e||ge(e)}function $P(e,t){return e===t}function Tg(e){do{if(E(e,"bpmn:Process"))return z(e);if(E(e,"bpmn:Participant"))return z(e).processRef||z(e)}while(e=e.parent)}function Tu(e){return E(e,"bpmn:TextAnnotation")}function Pu(e){return E(e,"bpmn:Group")&&!e.labelTarget}function Pg(e){return E(e,"bpmn:BoundaryEvent")&&vn(e,"bpmn:CompensateEventDefinition")}function ys(e){return z(e).isForCompensation}function jP(e,t){var n=Tg(e),i=Tg(t);return n===i}function FP(e){return E(e,"bpmn:InteractionNode")&&!E(e,"bpmn:BoundaryEvent")&&(!E(e,"bpmn:Event")||E(e,"bpmn:ThrowEvent")&&Mg(e,"bpmn:MessageEventDefinition"))}function HP(e){return E(e,"bpmn:InteractionNode")&&!ys(e)&&(!E(e,"bpmn:Event")||E(e,"bpmn:CatchEvent")&&Mg(e,"bpmn:MessageEventDefinition"))&&!(E(e,"bpmn:BoundaryEvent")&&!vn(e,"bpmn:MessageEventDefinition"))}function Ag(e){for(var t=e;t=t.parent;){if(E(t,"bpmn:FlowElementsContainer"))return z(t);if(E(t,"bpmn:Participant"))return z(t).processRef}return null}function kg(e,t){var n=Ag(e),i=Ag(t);return n===i}function vn(e,t){var n=z(e);return!!_e(n.eventDefinitions||[],function(i){return E(i,t)})}function Mg(e,t){var n=z(e);return(n.eventDefinitions||[]).every(function(i){return E(i,t)})}function VP(e){return E(e,"bpmn:FlowNode")&&!E(e,"bpmn:EndEvent")&&!mt(e)&&!(E(e,"bpmn:IntermediateThrowEvent")&&vn(e,"bpmn:LinkEventDefinition"))&&!Pg(e)&&!ys(e)}function zP(e){return E(e,"bpmn:FlowNode")&&!E(e,"bpmn:StartEvent")&&!E(e,"bpmn:BoundaryEvent")&&!mt(e)&&!(E(e,"bpmn:IntermediateCatchEvent")&&vn(e,"bpmn:LinkEventDefinition"))&&!ys(e)}function WP(e){return E(e,"bpmn:ReceiveTask")||E(e,"bpmn:IntermediateCatchEvent")&&(vn(e,"bpmn:MessageEventDefinition")||vn(e,"bpmn:TimerEventDefinition")||vn(e,"bpmn:ConditionalEventDefinition")||vn(e,"bpmn:SignalEventDefinition"))}function UP(e){for(var t=[];e;)e=e.parent,e&&t.push(e);return t}function Au(e,t){var n=UP(t);return n.indexOf(e)!==-1}function vs(e,t,n){if(Ru(e)||Ru(t))return null;if(!E(n,"bpmn:DataAssociation")){if(Fg(e,t))return{type:"bpmn:MessageFlow"};if(Hg(e,t))return{type:"bpmn:SequenceFlow"}}var i=Mu(e,t);return i||(jg(e,t)?{type:"bpmn:Association",associationDirection:"One"}:$g(e,t)?{type:"bpmn:Association",associationDirection:"None"}:!1)}function _r(e,t){return ge(e)||Pu(e)?!0:E(t,"bpmn:Participant")&&!fe(t)?!1:E(e,"bpmn:Participant")?E(t,"bpmn:Process")||E(t,"bpmn:Collaboration"):ue(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:E(e,"bpmn:Lane")?E(t,"bpmn:Participant")||E(t,"bpmn:Lane"):E(e,"bpmn:BoundaryEvent")&&!GP(e)?!1:E(e,"bpmn:FlowElement")&&!E(e,"bpmn:DataStoreReference")?E(t,"bpmn:FlowElementsContainer")?fe(t):ue(t,["bpmn:Participant","bpmn:Lane"]):E(e,"bpmn:DataStoreReference")&&E(t,"bpmn:Collaboration")?jn(z(t).get("participants"),function(n){return!!n.get("processRef")}):ue(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?ue(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):E(e,"bpmn:MessageFlow")?E(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t:!1}function GP(e){return z(e).cancelActivity&&(Dg(e)||Ng(e))}function KP(e){return!ge(e)&&E(e,"bpmn:BoundaryEvent")}function qP(e){return E(e,"bpmn:Lane")}function YP(e){return KP(e)||E(e,"bpmn:IntermediateThrowEvent")&&Dg(e)?!0:E(e,"bpmn:IntermediateCatchEvent")&&Ng(e)}function Dg(e){var t=z(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function Ng(e){return Og(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Og(e,t){return t.some(function(n){return vn(e,n)})}function XP(e){return E(e,"bpmn:ReceiveTask")&&_e(e.incoming,function(t){return E(t.source,"bpmn:EventBasedGateway")})}function lo(e,t,n,i){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var r=e[0];return ge(r)||!YP(r)||mt(t)||!E(t,"bpmn:Activity")||ys(t)||i&&!Rg(i,t)||XP(t)?!1:"attach"}function Ig(e,t,n){if(!t)return!1;var i={replacements:[]};return A(e,function(r){mt(t)||E(r,"bpmn:StartEvent")&&r.type!=="label"&&_r(r,t)&&(z1(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(W1(r)||U1(r)||G1(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),Og(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&E(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),E(t,"bpmn:Transaction")||vn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(E(r,"bpmn:EndEvent")&&_r(r,t)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),E(r,"bpmn:BoundaryEvent")&&lo(r,t,null,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),i.replacements.length?i:!1}function Bg(e,t){return jn(e,qP)?!1:t?e.every(function(n){return _r(n,t)}):!0}function ku(e,t,n,i){return t?ge(e)||Pu(e)?!0:$P(n,t)||n&&Au(n,t)?!1:_r(e,t)||_s(e,t):!1}function Lg(e,t){return E(e,"bpmn:SubProcess")?fe(e)&&(!t||t.width>=100&&t.height>=80):!!(E(e,"bpmn:Lane")||E(e,"bpmn:Participant")||Tu(e)||Pu(e))}function ZP(e,t){var n=Tu(e),i=Tu(t);return(n||i)&&n!==i}function $g(e,t){return Au(t,e)||Au(e,t)?!1:ZP(e,t)?!0:!!Mu(e,t)}function jg(e,t){return kg(e,t)&&Pg(e)&&E(t,"bpmn:Activity")&&!QP(t,e)&&!mt(t)}function Fg(e,t){return zg(e)&&!zg(t)?!1:FP(e)&&HP(t)&&!jP(e,t)}function Hg(e,t){return VP(e)&&zP(t)&&kg(e,t)&&!(E(e,"bpmn:EventBasedGateway")&&!WP(t))}function Mu(e,t){return ue(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&ue(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:ue(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&ue(e,["bpmn:Activity","bpmn:CatchEvent"])?{type:"bpmn:DataOutputAssociation"}:!1}function _s(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(e.length!==1)return!1;e=e[0]}return t.source===e||t.target===e?!1:ue(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ge(t)&&E(e,"bpmn:FlowNode")&&!E(e,"bpmn:BoundaryEvent")&&_r(e,t.parent)}function JP(e,t){return e&&t&&e.indexOf(t)!==-1}function Vg(e,t){return ge(t)?!0:!(E(t,"bpmn:Lane")&&!JP(e,t.parent))}function zg(e){return lr(e,"bpmn:Process")||lr(e,"bpmn:Collaboration")}function QP(e,t){return e.attachers.includes(t)}const eA={__depends__:[yn],__init__:["bpmnRules"],bpmnRules:["type",at]};var tA=2e3;function Wg(e,t){e.on("saveXML.start",tA,n);function n(){var i=t.getRootElements();A(i,function(r){var o=ye(r),a,s;a=Or([r],!1),a=le(a,function(c){return c!==r&&!c.labelTarget}),s=lt(a,ye),o.set("planeElement",s)})}}Wg.$inject=["eventBus","canvas"];const nA={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Wg]};function bs(e){V.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.parent=a.parent),i.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var i=n.context,r=i.shape||i.connection,o=i.newParent||r.parent,a=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}bs.prototype.getOrdering=function(e,t){return null},Y(bs,V);function Du(e,t){bs.call(this,e);var n=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:9,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:TextAnnotation",order:{level:9}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:FlowElementsContainer"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function i(a){if(a.labelTarget)return{level:10};var s=_e(n,function(c){return ue(a,[c.type])});return s&&s.order||{level:1}}function r(a){var s=a.order;if(s||(a.order=s=i(a)),!s)throw new Error(`no order for <${a.id}>`);return s}function o(a,s,c){for(var l=s;l&&!ue(l,c);)l=l.parent;if(!l)throw new Error(`no parent for <${a.id}> in <${s&&s.id}>`);return l}this.getOrdering=function(a,s){if(a.labelTarget||E(a,"bpmn:TextAnnotation"))return{parent:t.findRoot(s)||t.getRootElement(),index:-1};var c=r(a);c.containers&&(s=o(a,s,c.containers));var l=s.children.indexOf(a),u=nf(s.children,function(p){return!a.labelTarget&&p.labelTarget?!1:c.level<r(p).level});return u!==-1&&l!==-1&&l<u&&(u-=1),{index:u,parent:s}}}Du.$inject=["eventBus","canvas"],Y(Du,bs);const iA={__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",Du]};function uo(){}uo.prototype.get=function(){return this._data},uo.prototype.set=function(e){this._data=e},uo.prototype.clear=function(){var e=this._data;return delete this._data,e},uo.prototype.isEmpty=function(){return!this._data};const rA={clipboard:["type",uo]};var oA="drop-ok",Ug="drop-not-ok",Gg="attach-ok",Kg="new-parent",qg="create",aA=2e3;function Yg(e,t,n,i,r){function o(c,l,u,p,d){if(!l)return!1;c=le(c,function(C){var x=C.labelTarget;return!C.parent&&!(ge(C)&&c.indexOf(x)!==-1)});var h=_e(c,function(C){return!Se(C)}),m=!1,y=!1,g=!1;Zg(c)&&(m=r.allowed("shape.attach",{position:u,shape:h,target:l})),m||(Zg(c)?g=r.allowed("shape.create",{position:u,shape:h,source:p,target:l}):g=r.allowed("elements.create",{elements:c,position:u,target:l}));var w=d.connectionTarget;return g||m?(h&&p&&(y=r.allowed("connection.create",{source:w===p?h:p,target:w===p?p:h,hints:{targetParent:l,targetAttach:m}})),{attach:m,connect:y}):g===null||m===null?null:!1}function a(c,l){[Gg,oA,Ug,Kg].forEach(function(u){u===l?e.addMarker(c,u):e.removeMarker(c,u)})}n.on(["create.move","create.hover"],function(c){var l=c.context,u=l.elements,p=c.hover,d=l.source,h=l.hints||{};if(!p){l.canExecute=!1,l.target=null;return}Xg(c);var m={x:c.x,y:c.y},y=l.canExecute=p&&o(u,p,m,d,h);p&&y!==null&&(l.target=p,y&&y.attach?a(p,Gg):a(p,y?Kg:Ug))}),n.on(["create.end","create.out","create.cleanup"],function(c){var l=c.hover;l&&a(l,null)}),n.on("create.end",function(c){var l=c.context,u=l.source,p=l.shape,d=l.elements,h=l.target,m=l.canExecute,y=m&&m.attach,g=m&&m.connect,w=l.hints||{};if(m===!1||!h)return!1;Xg(c);var C={x:c.x,y:c.y};g?p=i.appendShape(u,p,C,h,{attach:y,connection:g===!0?{}:g,connectionTarget:w.connectionTarget}):(d=i.createElements(d,C,h,D({},w,{attach:y})),p=_e(d,function(x){return!Se(x)})),D(l,{elements:d,shape:p}),D(c,{elements:d,shape:p})});function s(){var c=t.context();c&&c.prefix===qg&&t.cancel()}n.on("create.init",function(){n.on("elements.changed",s),n.once(["create.cancel","create.end"],aA,function(){n.off("elements.changed",s)})}),this.start=function(c,l,u){oe(l)||(l=[l]);var p=_e(l,function(m){return!Se(m)});if(p){u=D({elements:l,hints:{},shape:p},u||{}),A(l,function(m){ee(m.x)||(m.x=0),ee(m.y)||(m.y=0)});var d=le(l,function(m){return!m.hidden}),h=qe(d);A(l,function(m){Se(m)&&(m.waypoints=lt(m.waypoints,function(y){return{x:y.x-h.x-h.width/2,y:y.y-h.y-h.height/2}})),D(m,{x:m.x-h.x-h.width/2,y:m.y-h.y-h.height/2})}),t.init(c,qg,{cursor:"grabbing",autoActivate:!0,data:{shape:p,elements:l,context:u}})}}}Yg.$inject=["canvas","dragging","eventBus","modeling","rules"];function Xg(e){var t=e.context,n=t.createConstraints;n&&(n.left&&(e.x=Math.max(e.x,n.left)),n.right&&(e.x=Math.min(e.x,n.right)),n.top&&(e.y=Math.max(e.y,n.top)),n.bottom&&(e.y=Math.min(e.y,n.bottom)))}function Zg(e){return e&&e.length===1&&!Se(e[0])}var sA=750;function Jg(e,t,n,i,r){function o(a){var s=X("g");q(s,r.cls("djs-drag-group",["no-events"]));var c=X("g");return a.forEach(function(l){var u;l.hidden||(l.waypoints?(u=n._createContainer("connection",c),n.drawConnection(Ei(u),l)):(u=n._createContainer("shape",c),n.drawShape(Ei(u),l),ot(u,l.x,l.y)),i.addDragger(l,s,u))}),s}t.on("create.move",sA,function(a){var s=a.hover,c=a.context,l=c.elements,u=c.dragGroup;u||(u=c.dragGroup=o(l));var p;s?(u.parentNode||(p=e.getActiveLayer(),ie(p,u)),ot(u,a.x,a.y)):Ke(u)}),t.on("create.cleanup",function(a){var s=a.context,c=s.dragGroup;c&&Ke(c)})}Jg.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const Es={__depends__:[Mn,dr,yn,tn],__init__:["create","createPreview"],create:["type",Yg],createPreview:["type",Jg]};function Nu(e){var t=this;this._lastMoveEvent=null;function n(i){t._lastMoveEvent=i}e.on("canvas.init",function(i){var r=t._svg=i.svg;r.addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}Nu.$inject=["eventBus"],Nu.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||cA(0,0)};function cA(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,a=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}const po={__init__:["mouse"],mouse:["type",Nu]};function rn(e,t,n,i,r,o,a,s){this._canvas=e,this._create=t,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=s,r.on("copyPaste.copyElement",function(c){var l=c.descriptor,u=c.element,p=c.elements;l.priority=1,l.id=u.id;var d=_e(p,function(h){return h===u.parent});d&&(l.parent=u.parent.id),lA(u)&&(l.priority=2,l.host=u.host.id),Se(u)&&(l.priority=3,l.source=u.source.id,l.target=u.target.id,l.waypoints=uA(u)),ge(u)&&(l.priority=4,l.labelTarget=u.labelTarget.id),A(["x","y","width","height"],function(h){ee(u[h])&&(l[h]=u[h])}),l.hidden=u.hidden,l.collapsed=u.collapsed}),r.on("copyPaste.pasteElements",function(c){var l=c.hints;D(l,{createElementsBehavior:!1})})}rn.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],rn.prototype.copy=function(e){var t,n;return oe(e)||(e=e?[e]:[]),t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}),t===!1?n={}:n=this.createTree(oe(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},rn.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},rn.prototype._paste=function(e,t,n,i){A(e,function(o){ee(o.x)||(o.x=0),ee(o.y)||(o.y=0)});var r=qe(e);return A(e,function(o){Se(o)&&(o.waypoints=lt(o.waypoints,function(a){return{x:a.x-r.x-r.width/2,y:a.y-r.y-r.height/2}})),D(o,{x:o.x-r.x-r.width/2,y:o.y-r.y-r.height/2})}),this._modeling.createElements(e,n,t,D({},i))},rn.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return A(e,function(o,a){o=cn(o,"priority"),A(o,function(s){var c=D({},ln(s,["priority"]));i[s.parent]?c.parent=i[s.parent]:delete c.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:c});var l;if(Se(c)){c.source=i[s.source],c.target=i[s.target],l=i[s.id]=t.createConnection(c),r.push(l);return}if(ge(c)){c.labelTarget=i[c.labelTarget],l=i[s.id]=t.createLabel(c),r.push(l);return}c.host&&(c.host=i[c.host]),l=i[s.id]=t.createShape(c),r.push(l)})}),r},rn.prototype.createConnection=function(e){var t=this._elementFactory.createConnection(ln(e,["id"]));return t},rn.prototype.createLabel=function(e){var t=this._elementFactory.createLabel(ln(e,["id"]));return t},rn.prototype.createShape=function(e){var t=this._elementFactory.createShape(ln(e,["id"]));return t},rn.prototype.hasRelations=function(e,t){var n,i,r;return!(Se(e)&&(i=_e(t,Jt({id:e.source.id})),r=_e(t,Jt({id:e.target.id})),!i||!r)||ge(e)&&(n=_e(t,Jt({id:e.labelTarget.id})),!n))},rn.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[],o=oa(e);function a(l,u){return t.allowed("element.copy",{element:l,elements:u})}function s(l,u){var p=_e(r,function(d){return l===d.element});if(!p){r.push({element:l,depth:u});return}p.depth<u&&(r=c(p,r),r.push({element:p.element,depth:u}))}function c(l,u){var p=u.indexOf(l);return p!==-1&&u.splice(p,1),u}return bi(o,function(l,u,p){if(ge(l))return;A(l.labels,function(m){s(m,p)});function d(m){m&&m.length&&A(m,function(y){A(y.labels,function(g){s(g,p)}),s(y,p)})}A([l.attachers,l.incoming,l.outgoing],d),s(l,p);var h=[];return l.children&&(h=l.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:l,children:h}),h}),e=lt(r,function(l){return l.element}),r=lt(r,function(l){return l.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:l.descriptor,element:l.element,elements:e}),l}),r=cn(r,function(l){return l.descriptor.priority}),e=lt(r,function(l){return l.element}),A(r,function(l){var u=l.depth;if(!n.hasRelations(l.element,e)){ey(l.element,e);return}if(!a(l.element,e)){ey(l.element,e);return}i[u]||(i[u]=[]),i[u].push(l.descriptor)}),i};function lA(e){return!!e.host}function uA(e){return lt(e.waypoints,function(t){return t=Qg(t),t.original&&(t.original=Qg(t.original)),t})}function Qg(e){return D({},e)}function ey(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}const pA={__depends__:[rA,Es,po,yn],__init__:["copyPaste"],copyPaste:["type",rn]};function Ou(e,t,n){oe(n)||(n=[n]),A(n,function(i){yi(e[i])||(t[i]=e[i])})}var Iu=750;function ty(e,t,n){function i(c,l){var u=e.create(c.$type);return n.copyElement(c,u,null,l)}t.on("copyPaste.copyElement",Iu,function(c){var l=c.descriptor,u=c.element,p=z(u);if(ge(u))return l;var d=l.businessObject=i(p,!0),h=l.di=i(ye(u),!0);h.bpmnElement=d,Ou(d,l,"name"),Ou(h,l,"isExpanded"),p.default&&(l.default=p.default.id)});var r="-bpmn-js-refs";function o(c){return c[r]=c[r]||{}}function a(c,l){c[r]=l}function s(c,l,u){var p=z(c);return c.default&&(u[c.default]={element:p,property:"default"}),c.host&&(z(c).attachedToRef=z(l[c.host])),ln(u,Tt(u,function(d,h,m){var y=h.element,g=h.property;return m===c.id&&(y.set(g,p),d.push(c.id)),d},[]))}t.on("copyPaste.pasteElement",function(c){var l=c.cache,u=c.descriptor,p=u.businessObject,d=u.di;if(ge(u)){u.businessObject=z(l[u.labelTarget]),u.di=ye(l[u.labelTarget]);return}p=u.businessObject=i(p),d=u.di=i(d),d.bpmnElement=p,Ou(u,p,["isExpanded","name"]),u.type=p.$type}),t.on("copyPaste.copyElement",Iu,function(c){var l=c.descriptor,u=c.element;if(E(u,"bpmn:Participant")){var p=z(u);p.processRef&&(l.processRef=i(p.processRef,!0))}}),t.on("copyPaste.pasteElement",function(c){var l=c.descriptor,u=l.processRef;u&&(l.processRef=i(u))}),t.on("copyPaste.pasteElement",Iu,function(c){var l=c.cache,u=c.descriptor;a(l,s(u,l,o(l)))})}ty.$inject=["bpmnFactory","eventBus","moddleCopy"];var fA=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"];function fo(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",function(i){var r=i.propertyNames;if(!(!r||!r.length))return cn(r,function(o){return o==="extensionElements"})}),e.on("moddleCopy.canCopyProperty",function(i){var r=i.parent,o=tt(r)&&r.$descriptor,a=i.propertyName;if(a&&fA.indexOf(a)!==-1||a&&o&&!_e(o.properties,Jt({name:a})))return!1}),e.on("moddleCopy.canSetCopiedProperty",function(i){var r=i.property;if(dA(r,"bpmn:ExtensionElements")&&(!r.values||!r.values.length))return!1})}fo.$inject=["eventBus","bpmnFactory","moddle"],fo.prototype.copyElement=function(e,t,n,i=!1){var r=this;n&&!oe(n)&&(n=[n]),n=n||Bu(e.$descriptor);var o=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:i});return o===!1||(oe(o)&&(n=o),A(n,function(a){var s;Et(e,a)&&(s=e.get(a));var c=r.copyProperty(s,t,a,i);if(et(c)){var l=r._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:c,propertyName:a});l!==!1&&t.set(a,c)}})),t},fo.prototype.copyProperty=function(e,t,n,i=!1){var r=this,o=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:i});if(o!==!1){if(o)return tt(o)&&o.$type&&!o.$parent&&(o.$parent=t),o;var a=this._moddle.getPropertyDescriptor(t,n);if(!a.isReference)return a.isId?e&&this._copyId(e,t,i):oe(e)?Tt(e,function(s,c){return o=r.copyProperty(c,t,n,i),o?s.concat(o):s},[]):tt(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:(o=r._bpmnFactory.create(e.$type),o.$parent=t,o=r.copyElement(e,o,null,i),o):e}},fo.prototype._copyId=function(e,t,n=!1){if(n)return e;if(!this._moddle.ids.assigned(e))return this._moddle.ids.claim(e,t),e};function Bu(e,t){return Tt(e.properties,function(n,i){return t&&i.default?n:n.concat(i.name)},[])}function dA(e,t){return e&&Ue(e.$instanceOf)&&e.$instanceOf(t)}const ny={__depends__:[pA],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",ty],moddleCopy:["type",fo]};var iy=Math.round;function Lu(e,t){this._modeling=e,this._eventBus=t}Lu.$inject=["modeling","eventBus"],Lu.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,r=this._eventBus;r.fire("replace.start",{element:e,attrs:t,hints:n});var o=t.width||e.width,a=t.height||e.height,s=t.x||e.x,c=t.y||e.y,l=iy(s+o/2),u=iy(c+a/2),p=i.replaceShape(e,D({},t,{x:l,y:u,width:o,height:a}),n);return r.fire("replace.end",{element:e,newElement:p,hints:n}),p};function ry(e,t){t.on("replace.end",500,function(n){const{newElement:i,hints:r={}}=n;r.select!==!1&&e.select(i)})}ry.$inject=["selection","eventBus"];const hA={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",ry],replace:["type",Lu]};function mA(e,t,n){oe(n)||(n=[n]),A(n,function(i){yi(e[i])||(t[i]=e[i])})}var gA=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function yA(e,t){var n=e&&Et(e,"collapsed")?e.collapsed:!fe(e),i;return t&&(Et(t,"collapsed")||Et(t,"isExpanded"))?i=Et(t,"collapsed")?t.collapsed:!t.isExpanded:i=n,n!==i}function oy(e,t,n,i,r,o){function a(s,c,l){l=l||{};var u=c.type,p=s.businessObject;if(xs(p)&&(u==="bpmn:SubProcess"||u==="bpmn:AdHocSubProcess")&&yA(s,c))return i.toggleCollapse(s),s;var d=e.create(u),h={type:u,businessObject:d};h.di={},u==="bpmn:ExclusiveGateway"&&(h.di.isMarkerVisible=!0),mA(s.di,h.di,["fill","stroke","background-color","border-color","color"]);var m=Bu(p.$descriptor),y=Bu(d.$descriptor,!0),g=vA(m,y);D(d,Qt(c,gA));var w=le(g,function(b){return b==="eventDefinitions"?ay(s,c.eventDefinitionType):b==="loopCharacteristics"?!mt(d):Et(d,b)||b==="processRef"&&c.isExpanded===!1||b==="triggeredByEvent"?!1:b==="isForCompensation"?!mt(d):!0});if(d=n.copyElement(p,d,w),c.eventDefinitionType&&(ay(d,c.eventDefinitionType)||(h.eventDefinitionType=c.eventDefinitionType,h.eventDefinitionAttrs=c.eventDefinitionAttrs)),E(p,"bpmn:Activity")){if(xs(p))h.isExpanded=fe(s);else if(c&&Et(c,"isExpanded")){h.isExpanded=c.isExpanded;var C=t.getDefaultSize(d,{isExpanded:h.isExpanded});h.width=C.width,h.height=C.height,h.x=s.x-(h.width-s.width)/2,h.y=s.y-(h.height-s.height)/2}fe(s)&&!E(p,"bpmn:Task")&&h.isExpanded&&(h.width=s.width,h.height=s.height)}if(xs(p)&&!xs(d)&&(l.moveChildren=!1),E(p,"bpmn:Participant")){c.isExpanded===!0?d.processRef=e.create("bpmn:Process"):l.moveChildren=!1;var x=Je(s);ye(s).isHorizontal||(ye(h).isHorizontal=x),h.width=x?s.width:t.getDefaultSize(h).width,h.height=x?t.getDefaultSize(h).height:s.height}return o.allowed("shape.resize",{shape:d})||(h.height=t.getDefaultSize(h).height,h.width=t.getDefaultSize(h).width),d.name=p.name,ue(p,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&ue(d,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(d.default=p.default),c.host&&!E(p,"bpmn:BoundaryEvent")&&E(d,"bpmn:BoundaryEvent")&&(h.host=c.host),(h.type==="bpmn:DataStoreReference"||h.type==="bpmn:DataObjectReference")&&(h.x=s.x+(s.width-h.width)/2),r.replaceElement(s,h,{...l,targetElement:c})}this.replaceElement=a}oy.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];function xs(e){return E(e,"bpmn:SubProcess")}function ay(e,t){var n=z(e);return t&&n.get("eventDefinitions").some(function(i){return E(i,t)})}function vA(e,t){return e.filter(function(n){return t.includes(n)})}const sy={__depends__:[ny,hA,tn],bpmnReplace:["type",oy]};var _A=250;function Oi(e){this._eventBus=e,this._tools=[],this._active=null}Oi.$inject=["eventBus"],Oi.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);n.push(e),this.bindEvents(e,t)},Oi.prototype.isActive=function(e){return e&&this._active===e},Oi.prototype.length=function(e){return this._tools.length},Oi.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},Oi.prototype.bindEvents=function(e,t){var n=this._eventBus,i=[];n.on(t.tool+".init",function(r){var o=r.context;if(!o.reactivate&&this.isActive(e)){this.setActive(null);return}this.setActive(e)},this),A(t,function(r){i.push(r+".ended"),i.push(r+".canceled")}),n.on(i,_A,function(r){this._active&&(bA(r)||this.setActive(null))},this)};function bA(e){var t=e.originalEvent&&e.originalEvent.target;return t&&Ui(t,'.group[data-group="tools"]')}const ws={__depends__:[Mn],__init__:["toolManager"],toolManager:["type",Oi]};function EA(e,t){if(e==="x"){if(t>0)return"e";if(t<0)return"w"}if(e==="y"){if(t>0)return"s";if(t<0)return"n"}return null}function xA(e,t){var n=[];return A(e.concat(t),function(i){var r=i.incoming,o=i.outgoing;A(r.concat(o),function(a){var s=a.source,c=a.target;(ho(e,s)||ho(e,c)||ho(t,s)||ho(t,c))&&(ho(n,a)||n.push(a))})}),n}function ho(e,t){return e.indexOf(t)!==-1}function wA(e,t,n){var i=e.x,r=e.y,o=e.width,a=e.height,s=n.x,c=n.y;switch(t){case"n":return{x:i,y:r+c,width:o,height:a-c};case"s":return{x:i,y:r,width:o,height:a+c};case"w":return{x:i+s,y:r,width:o-s,height:a};case"e":return{x:i,y:r,width:o+s,height:a};default:throw new Error("unknown direction: "+t)}}var $u=Math.abs,SA=Math.round,Nn={x:"width",y:"height"},cy="crosshair",ii={n:"top",w:"left",s:"bottom",e:"right"},CA=1500,Ss={n:"s",w:"e",s:"n",e:"w"},Cs=20;function Ut(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var s=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(c){n.once("spaceTool.selection.ended",function(){s.activateMakeSpace(c.originalEvent)})}),n.on("spaceTool.move",CA,function(c){var l=c.context,u=l.initialized;u||(u=l.initialized=s.init(c,l)),u&&uy(c)}),n.on("spaceTool.end",function(c){var l=c.context,u=l.axis,p=l.direction,d=l.movingShapes,h=l.resizingShapes,m=l.start;if(l.initialized){uy(c);var y={x:0,y:0};y[u]=SA(c["d"+u]),s.makeSpace(d,h,y,p,m),n.once("spaceTool.ended",function(g){s.activateSelection(g.originalEvent,!0,!0)})}})}Ut.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Ut.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:cy,data:{context:{reactivate:n}},trapClick:!1})},Ut.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:cy,data:{context:{}}})},Ut.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},Ut.prototype.init=function(e,t){var n=$u(e.dx)>$u(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if($u(i)<5)return!1;i<0&&(i*=-1),Yr(e)&&(i*=-1);var o=EA(n,i),a=this._canvas.getRootElement();!Aa(e)&&e.hover&&(a=e.hover);var s=[...Or(a,!0),...a.attachers||[]],c=this.calculateAdjustments(s,n,i,r),l=this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}),u=RA(c,n,o,r,l);return D(t,c,{axis:n,direction:o,spaceToolConstraints:u,start:r}),Na("resize-"+(n==="x"?"ew":"ns")),!0},Ut.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[],s=[],c=[];function l(d){o.includes(d)||o.push(d);var h=d.label;h&&!o.includes(h)&&o.push(h)}function u(d){a.includes(d)||a.push(d)}A(e,function(d){if(!(!d.parent||ge(d))){if(Se(d)){c.push(d);return}var h=d[t],m=h+d[Nn[t]];if(TA(d)&&(n>0&&te(d)[t]>i||n<0&&te(d)[t]<i)){s.push(d);return}if(n>0&&h>i||n<0&&m<i){l(d);return}if(h<i&&m>i&&r.allowed("shape.resize",{shape:d})){u(d);return}}}),A(o,function(d){var h=d.attachers;h&&A(h,function(m){l(m)})});var p=o.concat(a);return A(s,function(d){var h=d.host;Ii(p,h)&&l(d)}),p=o.concat(a),A(c,function(d){var h=d.source,m=d.target,y=d.label;Ii(p,h)&&Ii(p,m)&&y&&l(y)}),{movingShapes:o,resizingShapes:a}},Ut.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Ut.prototype.isActive=function(){var e=this._dragging.context();return e?/^spaceTool/.test(e.prefix):!1};function ly(e){return{top:e.top-Cs,right:e.right+Cs,bottom:e.bottom+Cs,left:e.left-Cs}}function uy(e){var t=e.context,n=t.spaceToolConstraints;if(n){var i,r;ee(n.left)&&(i=Math.max(e.x,n.left),e.dx=e.dx+i-e.x,e.x=i),ee(n.right)&&(i=Math.min(e.x,n.right),e.dx=e.dx+i-e.x,e.x=i),ee(n.top)&&(r=Math.max(e.y,n.top),e.dy=e.dy+r-e.y,e.y=r),ee(n.bottom)&&(r=Math.min(e.y,n.bottom),e.dy=e.dy+r-e.y,e.y=r)}}function RA(e,t,n,i,r){var o=e.movingShapes,a=e.resizingShapes;if(a.length){var s={},c,l;return A(a,function(u){var p=u.attachers,d=u.children,h=Q(u),m=le(d,function(B){return!Se(B)&&!ge(B)&&!Ii(o,B)&&!Ii(a,B)}),y=le(d,function(B){return!Se(B)&&!ge(B)&&Ii(o,B)}),g,w,C,x=[],b=[],S,P,M,R;m.length&&(w=ly(Q(qe(m))),g=i-h[ii[n]]+w[ii[n]],n==="n"?s.bottom=l=ee(l)?Math.min(l,g):g:n==="w"?s.right=l=ee(l)?Math.min(l,g):g:n==="s"?s.top=c=ee(c)?Math.max(c,g):g:n==="e"&&(s.left=c=ee(c)?Math.max(c,g):g)),y.length&&(C=ly(Q(qe(y))),g=i-C[ii[Ss[n]]]+h[ii[Ss[n]]],n==="n"?s.bottom=l=ee(l)?Math.min(l,g):g:n==="w"?s.right=l=ee(l)?Math.min(l,g):g:n==="s"?s.top=c=ee(c)?Math.max(c,g):g:n==="e"&&(s.left=c=ee(c)?Math.max(c,g):g)),p&&p.length&&(p.forEach(function(B){Ii(o,B)?x.push(B):b.push(B)}),x.length&&(S=Q(qe(x.map(te))),P=h[ii[Ss[n]]]-(S[ii[Ss[n]]]-i)),b.length&&(M=Q(qe(b.map(te))),R=M[ii[n]]-(h[ii[n]]-i)),n==="n"?(g=Math.min(P||1/0,R||1/0),s.bottom=l=ee(l)?Math.min(l,g):g):n==="w"?(g=Math.min(P||1/0,R||1/0),s.right=l=ee(l)?Math.min(l,g):g):n==="s"?(g=Math.max(P||-1/0,R||-1/0),s.top=c=ee(c)?Math.max(c,g):g):n==="e"&&(g=Math.max(P||-1/0,R||-1/0),s.left=c=ee(c)?Math.max(c,g):g));var I=r&&r[u.id];I&&(n==="n"?(g=i+u[Nn[t]]-I[Nn[t]],s.bottom=l=ee(l)?Math.min(l,g):g):n==="w"?(g=i+u[Nn[t]]-I[Nn[t]],s.right=l=ee(l)?Math.min(l,g):g):n==="s"?(g=i-u[Nn[t]]+I[Nn[t]],s.top=c=ee(c)?Math.max(c,g):g):n==="e"&&(g=i-u[Nn[t]]+I[Nn[t]],s.left=c=ee(c)?Math.max(c,g):g))}),s}}function Ii(e,t){return e.indexOf(t)!==-1}function TA(e){return!!e.host}var ju="djs-dragging",py="djs-resizing",PA=250,Rs=Math.max;function fy(e,t,n,i,r){function o(a,s){A(a,function(c){r.addDragger(c,s),n.addMarker(c,ju)})}e.on("spaceTool.selection.start",function(a){var s=n.getLayer("space"),c=a.context,l={x:"M 0,-10000 L 0,10000",y:"M -10000,0 L 10000,0"},u=X("g");q(u,i.cls("djs-crosshair-group",["no-events"])),ie(s,u);var p=X("path");q(p,"d",l.x),me(p).add("djs-crosshair"),ie(u,p);var d=X("path");q(d,"d",l.y),me(d).add("djs-crosshair"),ie(u,d),c.crosshairGroup=u}),e.on("spaceTool.selection.move",function(a){var s=a.context.crosshairGroup;ot(s,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var s=a.context,c=s.crosshairGroup;c&&Ke(c)}),e.on("spaceTool.move",PA,function(a){var s=a.context,c=s.line,l=s.axis,u=s.movingShapes,p=s.resizingShapes;if(s.initialized){if(!s.dragGroup){var d=n.getLayer("space");c=X("path"),q(c,"d","M0,0 L0,0"),me(c).add("djs-crosshair"),ie(d,c),s.line=c;var h=X("g");q(h,i.cls("djs-drag-group",["no-events"])),ie(n.getActiveLayer(),h),o(u,h);var m=s.movingConnections=t.filter(function(b){var S=!1;A(u,function(I){A(I.outgoing,function(B){b===B&&(S=!0)})});var P=!1;A(u,function(I){A(I.incoming,function(B){b===B&&(P=!0)})});var M=!1;A(p,function(I){A(I.outgoing,function(B){b===B&&(M=!0)})});var R=!1;return A(p,function(I){A(I.incoming,function(B){b===B&&(R=!0)})}),Se(b)&&(S||M)&&(P||R)});o(m,h),s.dragGroup=h}if(!s.frameGroup){var y=X("g");q(y,i.cls("djs-frame-group",["no-events"])),ie(n.getActiveLayer(),y);var g=[];A(p,function(b){var S=r.addFrame(b,y),P=S.getBBox();g.push({element:S,initialBounds:P}),n.addMarker(b,py)}),s.frameGroup=y,s.frames=g}var w={x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y};q(c,{d:w[l]});var C={x:"y",y:"x"},x={x:a.dx,y:a.dy};x[C[s.axis]]=0,ot(s.dragGroup,x.x,x.y),A(s.frames,function(b){var S=b.element,P=b.initialBounds,M,R;s.direction==="e"?q(S,{width:Rs(P.width+x.x,5)}):(M=Rs(P.width-x.x,5),q(S,{width:M,x:P.x+P.width-M})),s.direction==="s"?q(S,{height:Rs(P.height+x.y,5)}):(R=Rs(P.height-x.y,5),q(S,{height:R,y:P.y+P.height-R}))})}}),e.on("spaceTool.cleanup",function(a){var s=a.context,c=s.movingShapes,l=s.movingConnections,u=s.resizingShapes,p=s.line,d=s.dragGroup,h=s.frameGroup;A(c,function(m){n.removeMarker(m,ju)}),A(l,function(m){n.removeMarker(m,ju)}),d&&(Ke(p),Ke(d)),A(u,function(m){n.removeMarker(m,py)}),h&&Ke(h)})}fy.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const AA={__init__:["spaceToolPreview"],__depends__:[Mn,yn,ws,dr,po],spaceTool:["type",Ut],spaceToolPreview:["type",fy]};function Ts(e,t){e.invoke(Ut,this),this._canvas=t}Ts.$inject=["injector","canvas"],Y(Ts,Ut),Ts.prototype.calculateAdjustments=function(e,t,n,i){var r=this._canvas.getRootElement(),o=e[0]===r?null:e[0],a=[];o&&(a=Yo(Sf(r.children.filter(l=>E(l,"bpmn:Artifact")),qe(o))));const s=[...e,...a];var c=Ut.prototype.calculateAdjustments.call(this,s,t,n,i);return c.resizingShapes=c.resizingShapes.filter(function(l){return!(E(l,"bpmn:TextAnnotation")||kA(l)&&(t==="y"&&Je(l)||t==="x"&&!Je(l)))}),c};function kA(e){return E(e,"bpmn:Participant")&&!z(e).processRef}const dy={__depends__:[AA],spaceTool:["type",Ts]};function Oe(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Oe.$inject=["eventBus","injector"],Oe.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},Oe.prototype.canExecute=function(e,t){const n={command:e,context:t},i=this._getHandler(e);let r=this._fire(e,"canExecute",n);if(r===void 0){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Oe.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},Oe.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Oe.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Oe.prototype.register=function(e,t){this._setHandler(e,t)},Oe.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},Oe.prototype.canUndo=function(){return!!this._getUndoAction()},Oe.prototype.canRedo=function(){return!!this._getRedoAction()},Oe.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Oe.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Oe.prototype._internalUndo=function(e){const t=e.command,n=e.context,i=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})},Oe.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const i=t?[e+"."+t,t]:[e];let r;n=this._eventBus.createEvent(n);for(const o of i)if(r=this._eventBus.fire("commandStack."+o,n),n.cancelBubble)break;return r},Oe.prototype._createId=function(){return this._uid++},Oe.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Oe.prototype._internalExecute=function(e,t){const n=e.command,i=e.context,r=this._getHandler(n);if(!r)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),r.preExecute&&r.preExecute(i),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),r.execute&&this._markDirty(r.execute(i)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),r.postExecute&&r.postExecute(i),this._fire(n,"postExecuted",e)),this._popAction()},Oe.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Oe.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:rf("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Oe.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=oe(e)?e:[e],t.dirty=t.dirty.concat(e))},Oe.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Oe.prototype._revertedAction=function(e){this._stackIdx--},Oe.prototype._getHandler=function(e){return this._handlerMap[e]},Oe.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const MA={commandStack:["type",Oe]};function ri(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}var DA=250,hy=1400;function Fu(e,t,n){V.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",hy,function(r){var o=r.context,a=o.shapes,s=o.validatedShapes;o.shapes=my(a),o.validatedShapes=my(s)}),i&&t.on("shape.move.start",DA,function(r){var o=r.context,a=o.shapes,s=[];A(a,function(c){A(c.labels,function(l){!l.hidden&&o.shapes.indexOf(l)===-1&&s.push(l),c.labelTarget&&s.push(c)})}),A(s,function(c){i.makeDraggable(o,c,!0)})}),this.preExecuted("elements.move",hy,function(r){var o=r.context,a=o.closure,s=a.enclosedElements,c=[];A(s,function(l){A(l.labels,function(u){s[u.id]||c.push(u)})}),a.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(r){var o=r.context,a=o.connection||o.shape;ri(a.labels,function(s){n.removeShape(s,{nested:!0})})}),this.execute("shape.delete",function(r){var o=r.context,a=o.shape,s=a.labelTarget;s&&(o.labelTargetIndex=Ic(s.labels,a),o.labelTarget=s,a.labelTarget=null)}),this.revert("shape.delete",function(r){var o=r.context,a=o.shape,s=o.labelTarget,c=o.labelTargetIndex;s&&(Ye(s.labels,a,c),a.labelTarget=s)})}Y(Fu,V),Fu.$inject=["injector","eventBus","modeling"];function my(e){return le(e,function(t){return e.indexOf(t.labelTarget)===-1})}const NA={__init__:["labelSupport"],labelSupport:["type",Fu]};var OA=251,gy=1401,yy="attach-ok";function Hu(e,t,n,i,r){V.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",gy,function(a){var s=a.context,c=s.shapes,l=s.validatedShapes;s.shapes=IA(c),s.validatedShapes=BA(l)}),o&&t.on("shape.move.start",OA,function(a){var s=a.context,c=s.shapes,l=Vu(c);A(l,function(u){o.makeDraggable(s,u,!0),A(u.labels,function(p){o.makeDraggable(s,p,!0)})})}),o&&t.on("shape.move.start",function(a){var s=a.context,c=s.shapes;if(c.length===1){var l=c[0],u=l.host;u&&(n.addMarker(u,yy),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(u,yy)}))}}),this.preExecuted("elements.move",gy,function(a){var s=a.context,c=s.closure,l=s.shapes,u=Vu(l);A(u,function(p){c.add(p,c.topLevel[p.host.id])})}),this.postExecuted("elements.move",function(a){var s=a.context,c=s.shapes,l=s.newHost,u;l&&c.length!==1||(l?u=c:u=le(c,function(p){var d=p.host;return LA(p)&&!$A(c,d)}),A(u,function(p){r.updateAttachment(p,l)}))}),this.postExecuted("elements.move",function(a){var s=a.context.shapes;A(s,function(c){A(c.attachers,function(l){A(l.outgoing.slice(),function(u){var p=i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target});p||r.removeConnection(u)}),A(l.incoming.slice(),function(u){var p=i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target});p||r.removeConnection(u)})})})}),this.postExecute("shape.create",function(a){var s=a.context,c=s.shape,l=s.host;l&&r.updateAttachment(c,l)}),this.postExecute("shape.replace",function(a){var s=a.context,c=s.oldShape,l=s.newShape;ri(c.attachers,function(u){var p=i.allowed("elements.move",{target:l,shapes:[u]});p==="attach"?r.updateAttachment(u,l):r.removeShape(u)}),l.attachers.length&&A(l.attachers,function(u){var p=lg(u,c,l);r.moveShape(u,p,u.parent)})}),this.postExecute("shape.resize",function(a){var s=a.context,c=s.shape,l=s.oldBounds,u=s.newBounds,p=c.attachers,d=s.hints||{};d.attachSupport!==!1&&A(p,function(h){var m=lg(h,l,u);r.moveShape(h,m,h.parent),A(h.labels,function(y){r.moveShape(y,m,y.parent)})})}),this.preExecute("shape.delete",function(a){var s=a.context.shape;ri(s.attachers,function(c){r.removeShape(c)}),s.host&&r.updateAttachment(s,null)})}Y(Hu,V),Hu.$inject=["injector","eventBus","canvas","rules","modeling"];function Vu(e){return xc(lt(e,function(t){return t.attachers||[]}))}function IA(e){var t=Vu(e);return PE("id",e,t)}function BA(e){var t=Wi(e,"id");return le(e,function(n){for(;n;){if(n.host&&t[n.host.id])return!1;n=n.parent}return!0})}function LA(e){return!!e.host}function $A(e,t){return e.indexOf(t)!==-1}const jA={__depends__:[yn],__init__:["attachSupport"],attachSupport:["type",Hu]};function Gt(e){this._model=e}Gt.$inject=["moddle"],Gt.prototype._needsId=function(e){return ue(e,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},Gt.prototype._ensureId=function(e){if(e.id){this._model.ids.claim(e.id,e);return}var t;E(e,"bpmn:Activity")?t="Activity":E(e,"bpmn:Event")?t="Event":E(e,"bpmn:Gateway")?t="Gateway":ue(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?t="Flow":t=(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},Gt.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Gt.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Gt.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",D({bpmnElement:e,bounds:this.createDiBounds()},t))},Gt.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Gt.prototype.createDiWaypoints=function(e){var t=this;return lt(e,function(n){return t.createDiWaypoint(n)})},Gt.prototype.createDiWaypoint=function(e){return this.create("dc:Point",Qt(e,["x","y"]))},Gt.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",D({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},Gt.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",D({bpmnElement:e},t))};function Mt(e,t,n){V.call(this,e),this._bpmnFactory=t;var i=this;function r(h){var m=h.context,y=m.hints||{},g;!m.cropped&&y.createElementsBehavior!==!1&&(g=m.connection,g.waypoints=n.getCroppedWaypoints(g),m.cropped=!0)}this.executed(["connection.layout","connection.create"],r),this.reverted(["connection.layout"],function(h){delete h.context.cropped});function o(h){var m=h.context;i.updateParent(m.shape||m.connection,m.oldParent)}function a(h){var m=h.context,y=m.shape||m.connection,g=m.parent||m.newParent;i.updateParent(y,g)}this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Dt(o)),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Dt(a));function s(h){var m=h.context,y=m.oldRoot,g=y.children;A(g,function(w){E(w,"bpmn:BaseElement")&&i.updateParent(w)})}this.executed(["canvas.updateRoot"],s),this.reverted(["canvas.updateRoot"],s);function c(h){var m=h.context.shape;E(m,"bpmn:BaseElement")&&i.updateBounds(m)}this.executed(["shape.move","shape.create","shape.resize"],Dt(function(h){h.context.shape.type!=="label"&&c(h)})),this.reverted(["shape.move","shape.create","shape.resize"],Dt(function(h){h.context.shape.type!=="label"&&c(h)})),e.on("shape.changed",function(h){h.element.type==="label"&&c({context:{shape:h.element}})});function l(h){i.updateConnection(h.context)}this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Dt(l)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Dt(l));function u(h){i.updateConnectionWaypoints(h.context.connection)}this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Dt(u)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Dt(u)),this.executed("connection.reconnect",Dt(function(h){var m=h.context,y=m.connection,g=m.oldSource,w=m.newSource,C=z(y),x=z(g),b=z(w);C.conditionExpression&&!ue(b,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(m.oldConditionExpression=C.conditionExpression,delete C.conditionExpression),g!==w&&x.default===C&&(m.oldDefault=x.default,delete x.default)})),this.reverted("connection.reconnect",Dt(function(h){var m=h.context,y=m.connection,g=m.oldSource,w=m.newSource,C=z(y),x=z(g),b=z(w);m.oldConditionExpression&&(C.conditionExpression=m.oldConditionExpression),m.oldDefault&&(x.default=m.oldDefault,delete b.default)}));function p(h){i.updateAttachment(h.context)}this.executed(["element.updateAttachment"],Dt(p)),this.reverted(["element.updateAttachment"],Dt(p)),this.executed("element.updateLabel",Dt(d)),this.reverted("element.updateLabel",Dt(d));function d(h){const{element:m}=h.context,y=en(m),g=ye(m),w=g&&g.get("label");Ci(m)||Ta(m)||(y&&!w?g.set("label",t.create("bpmndi:BPMNLabel")):!y&&w&&g.set("label",void 0))}}Y(Mt,V),Mt.$inject=["eventBus","bpmnFactory","connectionDocking"],Mt.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Mt.prototype.updateParent=function(e,t){if(!ge(e)&&!(E(e,"bpmn:DataStoreReference")&&e.parent&&E(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=ye(e),o=n&&n.businessObject,a=ye(n);E(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,t&&t.businessObject),E(e,"bpmn:DataOutputAssociation")&&(e.source?o=e.source.businessObject:o=null),E(e,"bpmn:DataInputAssociation")&&(e.target?o=e.target.businessObject:o=null),this.updateSemanticParent(i,o),E(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,a)}},Mt.prototype.updateBounds=function(e){var t=ye(e),n=HA(e);if(n){var i=nn(n,t.get("bounds"));D(n,{x:e.x+i.x,y:e.y+i.y})}var r=ge(e)?this._getLabel(t):t,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),D(o,{x:e.x,y:e.y,width:e.width,height:e.height})},Mt.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var i,r;E(n,"bpmn:Lane")&&(i=n.get("flowNodeRef"),$e(i,e)),E(t,"bpmn:Lane")&&(r=t.get("flowNodeRef"),Ye(r,e))}},Mt.prototype.updateDiConnection=function(e,t,n){var i=ye(e),r=ye(t),o=ye(n);i.sourceElement&&i.sourceElement.bpmnElement!==z(t)&&(i.sourceElement=t&&r),i.targetElement&&i.targetElement.bpmnElement!==z(n)&&(i.targetElement=n&&o)},Mt.prototype.updateDiParent=function(e,t){if(t&&!E(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):($e(n,e),e.$parent=null)}};function FA(e){for(;e&&!E(e,"bpmn:Definitions");)e=e.$parent;return e}Mt.prototype.getLaneSet=function(e){var t,n;return E(e,"bpmn:Lane")?(t=e.childLaneSet,t||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(E(e,"bpmn:Participant")&&(e=e.processRef),n=e.get("laneSets"),t=n[0],t||(t=this._bpmnFactory.create("bpmn:LaneSet"),t.$parent=e,n.push(t)),t)},Mt.prototype.updateSemanticParent=function(e,t,n){var i;if(e.$parent!==t&&!((E(e,"bpmn:DataInput")||E(e,"bpmn:DataOutput"))&&(E(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),"ioSpecification"in t&&t.ioSpecification===e.$parent))){if(E(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(E(e,"bpmn:FlowElement")){if(t){if(E(t,"bpmn:Participant"))t=t.processRef;else if(E(t,"bpmn:Lane"))do t=t.$parent.$parent;while(E(t,"bpmn:Lane"))}i="flowElements"}else if(E(e,"bpmn:Artifact")){for(;t&&!E(t,"bpmn:Process")&&!E(t,"bpmn:SubProcess")&&!E(t,"bpmn:Collaboration");)if(E(t,"bpmn:Participant")){t=t.processRef;break}else t=t.$parent;i="artifacts"}else if(E(e,"bpmn:MessageFlow"))i="messageFlows";else if(E(e,"bpmn:Participant")){i="participants";var r=e.processRef,o;r&&(o=FA(e.$parent||t),e.$parent&&($e(o.get("rootElements"),r),r.$parent=null),t&&(Ye(o.get("rootElements"),r),r.$parent=o))}else E(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":E(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var a;if(e.$parent&&(a=e.$parent.get(i),$e(a,e)),t?(a=t.get(i),a.push(e),e.$parent=t):e.$parent=null,n){var s=n.get(i);$e(a,e),t&&(s||(s=[],t.set(i,s)),s.push(e))}}},Mt.prototype.updateConnectionWaypoints=function(e){var t=ye(e);t.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Mt.prototype.updateConnection=function(e){var t=e.connection,n=z(t),i=t.source,r=z(i),o=t.target,a=z(t.target),s;if(E(n,"bpmn:DataAssociation"))E(n,"bpmn:DataInputAssociation")?(n.get("sourceRef")[0]=r,s=e.parent||e.newParent||a,this.updateSemanticParent(n,a,s)):E(n,"bpmn:DataOutputAssociation")&&(s=e.parent||e.newParent||r,this.updateSemanticParent(n,r,s),n.targetRef=a);else{var c=E(n,"bpmn:SequenceFlow");n.sourceRef!==r&&(c&&($e(n.sourceRef&&n.sourceRef.get("outgoing"),n),r&&r.get("outgoing")&&r.get("outgoing").push(n)),n.sourceRef=r),n.targetRef!==a&&(c&&($e(n.targetRef&&n.targetRef.get("incoming"),n),a&&a.get("incoming")&&a.get("incoming").push(n)),n.targetRef=a)}this.updateConnectionWaypoints(t),this.updateDiConnection(t,i,o)},Mt.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};function Dt(e){return function(t){var n=t.context,i=n.shape||n.connection||n.element;E(i,"bpmn:BaseElement")&&e(t)}}function HA(e){if(E(e,"bpmn:Activity")){var t=ye(e);if(t){var n=t.get("label");if(n)return n.get("bounds")}}}function oi(e,t){Sn.call(this),this._bpmnFactory=e,this._moddle=t}Y(oi,Sn),oi.$inject=["bpmnFactory","moddle"],oi.prototype._baseCreate=Sn.prototype.create,oi.prototype.create=function(e,t){if(e==="label"){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,D({type:"label",di:n},Wr,t))}return this.createElement(e,t)},oi.prototype.createElement=function(e,t){t=D({},t||{});var n,i=t.businessObject,r=t.di;if(!i){if(!t.type)throw new Error("no shape type specified");i=this._bpmnFactory.create(t.type),bd(i)}if(!zA(r)){var o=D({},r||{},{id:i.id+"_di"});e==="root"?r=this._bpmnFactory.createDiPlane(i,o):e==="connection"?r=this._bpmnFactory.createDiEdge(i,o):r=this._bpmnFactory.createDiShape(i,o)}E(i,"bpmn:Group")&&(t=D({isFrame:!0},t)),t=VA(i,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=zu(r,t,"isExpanded")),ue(i,["bpmn:Lane","bpmn:Participant"])&&(t=zu(r,t,"isHorizontal")),E(i,"bpmn:SubProcess")&&(t.collapsed=!fe(i,r)),E(i,"bpmn:ExclusiveGateway")&&(Et(r,"isMarkerVisible")?r.isMarkerVisible===void 0&&(r.isMarkerVisible=!1):r.isMarkerVisible=!0),et(t.triggeredByEvent)&&(i.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),et(t.cancelActivity)&&(i.cancelActivity=t.cancelActivity,delete t.cancelActivity);var a,s;return t.eventDefinitionType&&(a=i.get("eventDefinitions")||[],s=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(s.condition=this._bpmnFactory.create("bpmn:FormalExpression")),a.push(s),s.$parent=i,i.eventDefinitions=a,delete t.eventDefinitionType),n=this.getDefaultSize(i,r),t=D({id:i.id},n,t,{businessObject:i,di:r}),this._baseCreate(e,t)},oi.prototype.getDefaultSize=function(e,t){var n=z(e);if(t=t||ye(e),E(n,"bpmn:SubProcess"))return fe(n,t)?{width:350,height:200}:{width:100,height:80};if(E(n,"bpmn:Task"))return{width:100,height:80};if(E(n,"bpmn:Gateway"))return{width:50,height:50};if(E(n,"bpmn:Event"))return{width:36,height:36};if(E(n,"bpmn:Participant")){var i=t.isHorizontal===void 0||t.isHorizontal===!0;return fe(n,t)?i?{width:600,height:250}:{width:250,height:600}:i?{width:400,height:60}:{width:60,height:400}}return E(n,"bpmn:Lane")?{width:400,height:100}:E(n,"bpmn:DataObjectReference")?{width:36,height:50}:E(n,"bpmn:DataStoreReference")?{width:50,height:50}:E(n,"bpmn:TextAnnotation")?{width:100,height:30}:E(n,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},oi.prototype.createParticipantShape=function(e){return tt(e)||(e={isExpanded:e}),e=D({type:"bpmn:Participant"},e||{}),e.isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)};function VA(e,t,n){return A(n,function(i){t=zu(e,t,i)}),t}function zu(e,t,n){return t[n]===void 0?t:(e[n]=t[n],ln(t,[n]))}function zA(e){return ue(e,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])}function Ps(e,t){this._modeling=e,this._canvas=t}Ps.$inject=["modeling","canvas"],Ps.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;A(n,function(r){var o={x:0,y:0};et(i.left)?o.x=i.left-r.x:et(i.right)?o.x=i.right-r.width-r.x:et(i.center)?o.x=i.center-Math.round(r.width/2)-r.x:et(i.top)?o.y=i.top-r.y:et(i.bottom)?o.y=i.bottom-r.height-r.y:et(i.middle)&&(o.y=i.middle-Math.round(r.height/2)-r.y),t.moveElements([r],o,r.parent)})},Ps.prototype.postExecute=function(e){};function As(e){this._modeling=e}As.$inject=["modeling"],As.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},As.prototype.postExecute=function(e){var t=e.hints||{};WA(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))};function WA(e,t){return jn(e.outgoing,function(n){return n.target===t})}function ks(e,t){this._canvas=e,this._layouter=t}ks.$inject=["canvas","layouter"],ks.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},ks.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Ms=Math.round;function Wu(e){this._modeling=e}Wu.$inject=["modeling"],Wu.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;A(t,function(p){ee(p.x)||(p.x=0),ee(p.y)||(p.y=0)});var s=le(t,function(p){return!p.hidden}),c=qe(s);A(t,function(p){Se(p)&&(p.waypoints=lt(p.waypoints,function(d){return{x:Ms(d.x-c.x-c.width/2+r.x),y:Ms(d.y-c.y-c.height/2+r.y)}})),D(p,{x:Ms(p.x-c.x-c.width/2+r.x),y:Ms(p.y-c.y-c.height/2+r.y)})});var l=oa(t),u={};A(t,function(p){if(Se(p)){u[p.id]=ee(i)?a.createConnection(u[p.source.id],u[p.target.id],i,p,p.parent||n,o):a.createConnection(u[p.source.id],u[p.target.id],p,p.parent||n,o);return}var d=D({},o);l.indexOf(p)===-1&&(d.autoResize=!1),ge(p)&&(d=ln(d,["attach"])),u[p.id]=ee(i)?a.createShape(p,Qt(p,["x","y","width","height"]),p.parent||n,i,d):a.createShape(p,Qt(p,["x","y","width","height"]),p.parent||n,d)}),e.elements=Yo(u)};var vy=Math.round;function ai(e){this._canvas=e}ai.$inject=["canvas"],ai.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?D(t,n):D(t,{x:n.x-vy(t.width/2),y:n.y-vy(t.height/2)}),this._canvas.addShape(t,i,r),t},ai.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function mo(e){ai.call(this,e)}Y(mo,ai),mo.$inject=["canvas"];var UA=ai.prototype.execute;mo.prototype.execute=function(e){var t=e.shape;return KA(t),t.labelTarget=e.labelTarget,UA.call(this,e)};var GA=ai.prototype.revert;mo.prototype.revert=function(e){return e.shape.labelTarget=null,GA.call(this,e)};function KA(e){["width","height"].forEach(function(t){typeof e[t]>"u"&&(e[t]=0)})}function go(e,t){this._canvas=e,this._modeling=t}go.$inject=["canvas","modeling"],go.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;ri(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),ri(n.outgoing,function(i){t.removeConnection(i,{nested:!0})})},go.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Ic(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},go.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,Ye(n.children,t,i),this._canvas.addConnection(t,n),t};function Uu(e,t){this._modeling=e,this._elementRegistry=t}Uu.$inject=["modeling","elementRegistry"],Uu.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,i=e.elements;A(i,function(r){n.get(r.id)&&(r.waypoints?t.removeConnection(r):t.removeShape(r))})};function yo(e,t){this._canvas=e,this._modeling=t}yo.$inject=["canvas","modeling"],yo.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;ri(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),ri(n.outgoing,function(i){t.removeConnection(i,{nested:!0})}),ri(n.children,function(i){Se(i)?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},yo.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=Ic(i.children,n),t.removeShape(n),n},yo.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return Ye(i.children,n,r),t.addShape(n,i),n};function Ds(e){this._modeling=e}Ds.$inject=["modeling"];var _y={x:"y",y:"x"};Ds.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(g,w){g.range.min=Math.min(w[i],g.range.min),g.range.max=Math.max(w[i]+w[r],g.range.max)}function a(g){return g[i]+g[r]/2}function s(g){return g.length-1}function c(g){return g.max-g.min}function l(g,w){var C={y:0};C[i]=g-a(w),C[i]&&(C[_y[i]]=0,t.moveElements([w],C,w.parent))}var u=n[0],p=s(n),d=n[p],h,m,y=0;A(n,function(g,w){var C,x,b;if(g.elements.length<2){w&&w!==n.length-1&&(o(g,g.elements[0]),y+=c(g.range));return}C=cn(g.elements,i),x=C[0],w===p&&(x=C[s(C)]),b=a(x),g.range=null,A(C,function(S){if(l(b,S),g.range===null){g.range={min:S[i],max:S[i]+S[r]};return}o(g,S)}),w&&w!==n.length-1&&(y+=c(g.range))}),m=Math.abs(d.range.min-u.range.max),h=Math.round((m-y)/(n.length-1)),!(h<n.length-1)&&A(n,function(g,w){var C={},x;g===u||g===d||(x=n[w-1],g.range.max=0,A(g.elements,function(b,S){C[_y[i]]=0,C[i]=x.range.max-b[i]+h,g.range.min!==b[i]&&(C[i]+=b[i]-g.range.min),C[i]&&t.moveElements([b],C,b.parent),g.range.max=Math.max(b[i]+b[r],S?g.range.max:0)}))})},Ds.prototype.postExecute=function(e){};function Ns(e,t){this._layouter=e,this._canvas=t}Ns.$inject=["layouter","canvas"],Ns.prototype.execute=function(e){var t=e.connection,n=t.waypoints;return D(e,{oldWaypoints:n}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Ns.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function Gu(){}Gu.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=$e(o.children,t),Ye(i.children,t,r),t.parent=i,A(t.waypoints,function(a){a.x+=n.x,a.y+=n.y,a.original&&(a.original.x+=n.x,a.original.y+=n.y)}),t},Gu.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return $e(n.children,t),Ye(i.children,t,r),t.parent=i,A(t.waypoints,function(a){a.x-=o.x,a.y-=o.y,a.original&&(a.original.x-=o.x,a.original.y-=o.y)}),t};function Ku(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}Ku.prototype.add=function(e,t){return this.addAll([e],t)},Ku.prototype.addAll=function(e,t){var n=vx(e,!!t,this);return D(this,n),this};function vo(e){this._modeling=e}vo.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},vo.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,s=e.allConnections,c=e.enclosedConnections,l=e.topLevel,u=!1;r&&r.parent===n&&(u=!0),A(a,function(p){o.moveShape(p,t,l[p.id]&&!u&&n,{recurse:!1,layout:!1})}),A(s,function(p){var d=!!a[p.source.id],h=!!a[p.target.id];c[p.id]&&d&&h?o.moveConnection(p,t,l[p.id]&&!u&&n):o.layoutConnection(p,{connectionStart:d&&ou(p,p.source,t),connectionEnd:h&&au(p,p.target,t)})})},vo.prototype.getClosure=function(e){return new Ku().addAll(e,!0)};function Os(e){this._helper=new vo(e)}Os.$inject=["modeling"],Os.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Os.prototype.postExecute=function(e){var t=e.hints,n;t&&t.primaryShape&&(n=t.primaryShape,t.oldParent=n.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,n)};function Bi(e){this._modeling=e,this._helper=new vo(e)}Bi.$inject=["modeling"],Bi.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldBounds=Qt(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=$e(o.children,t),Ye(i.children,t,r),D(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},Bi.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;i.layout!==!1&&(A(t.incoming,function(o){r.layoutConnection(o,{connectionEnd:au(o,t,n)})}),A(t.outgoing,function(o){r.layoutConnection(o,{connectionStart:ou(o,t,n)})})),i.recurse!==!1&&this.moveChildren(e)},Bi.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return Ye(n.children,t,i),D(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},Bi.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},Bi.prototype.getNewParent=function(e){return e.newParent||e.shape.parent};function _o(e){this._modeling=e}_o.$inject=["modeling"],_o.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return oe(r)&&(e.oldWaypoints=i.waypoints,i.waypoints=r),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},_o.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),o.layoutConnection!==!1&&(n&&(!i||o.docking==="source")&&(a.connectionStart=a.connectionStart||by(oe(r)?r[0]:r)),i&&(!n||o.docking==="target")&&(a.connectionEnd=a.connectionEnd||by(oe(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},_o.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,r=e.connection;return t&&(r.source=t),n&&(r.target=n),i&&(r.waypoints=i),r};function by(e){return e.original||e}function On(e,t){this._modeling=e,this._rules=t}On.$inject=["modeling","rules"],On.prototype.preExecute=function(e){var t=this,n=this._modeling,i=this._rules,r=e.oldShape,o=e.newData,a=e.hints||{},s;function c(m,y,g){return i.allowed("connection.reconnect",{connection:g,source:m,target:y})}var l={x:o.x,y:o.y},u={x:r.x,y:r.y,width:r.width,height:r.height};s=e.newShape=e.newShape||t.createShape(o,l,r.parent,a),r.host&&n.updateAttachment(s,r.host);var p;a.moveChildren!==!1&&(p=r.children.slice(),n.moveElements(p,{x:0,y:0},s,a));var d=r.incoming.slice(),h=r.outgoing.slice();A(d,function(m){var y=m.source,g=c(y,s,m);g&&t.reconnectEnd(m,s,fs(m,s,u),a)}),A(h,function(m){var y=m.target,g=c(s,y,m);g&&t.reconnectStart(m,s,ps(m,s,u),a)})},On.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},On.prototype.execute=function(e){},On.prototype.revert=function(e){},On.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},On.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},On.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)};function bo(e){this._modeling=e}bo.$inject=["modeling"],bo.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},D(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},bo.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds,r=e.hints||{};r.layout!==!1&&(A(n.incoming,function(o){t.layoutConnection(o,{connectionEnd:fs(o,n,i)})}),A(n.outgoing,function(o){t.layoutConnection(o,{connectionStart:ps(o,n,i)})}))},bo.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return D(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t};function si(e){this._modeling=e}si.$inject=["modeling"],si.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,a={};this.moveShapes(i,t),A(r,function(s){a[s.id]=YA(s)}),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(xA(i,r),t,n,o,i,r,a)},si.prototype.execute=function(){},si.prototype.revert=function(){},si.prototype.moveShapes=function(e,t){var n=this;A(e,function(i){n._modeling.moveShape(i,t,null,{autoResize:!1,layout:!1,recurse:!1})})},si.prototype.resizeShapes=function(e,t,n){var i=this;A(e,function(r){var o=wA(r,n,t);i._modeling.resizeShape(r,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})},si.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var s=this,c=r.concat(o);A(e,function(l){var u=l.source,p=l.target,d=qA(l),h=xy(n),m={};ci(c,u)&&ci(c,p)?(d=lt(d,function(y){return wy(y,i,n)&&(y[h]=y[h]+t[h]),y.original&&wy(y.original,i,n)&&(y.original[h]=y.original[h]+t[h]),y}),s._modeling.updateWaypoints(l,d,{labelBehavior:!1})):(ci(c,u)||ci(c,p))&&(ci(r,u)?m.connectionStart=ou(l,u,t):ci(r,p)?m.connectionEnd=au(l,p,t):ci(o,u)?m.connectionStart=ps(l,u,a[u.id]):ci(o,p)&&(m.connectionEnd=fs(l,p,a[p.id])),s._modeling.layoutConnection(l,m))})};function Ey(e){return D({},e)}function qA(e){return lt(e.waypoints,function(t){return t=Ey(t),t.original&&(t.original=Ey(t.original)),t})}function xy(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function wy(e,t,n){var i=xy(n);if(/e|s/.test(n))return e[i]>t;if(/n|w/.test(n))return e[i]<t}function ci(e,t){return e.indexOf(t)!==-1}function YA(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}function Is(e){this._modeling=e}Is.$inject=["modeling"],Is.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=Sy(n),t.collapsed=!t.collapsed;var i=Cy(n,t.collapsed);return[t].concat(i)},Is.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=t.children,r=Ry(i,n);return t.collapsed=!t.collapsed,[t].concat(r)};function Sy(e){var t={};return A(e,function(n){t[n.id]=n.hidden,n.children&&(t=D({},t,Sy(n.children)))}),t}function Cy(e,t){var n=[];return A(e,function(i){i.hidden=t,n=n.concat(i),i.children&&(n=n.concat(Cy(i.children,i.collapsed||t)))}),n}function Ry(e,t){var n=[];return A(e,function(i){i.hidden=t[i.id],n=n.concat(i),i.children&&(n=n.concat(Ry(i.children,t)))}),n}function Bs(e){this._modeling=e}Bs.$inject=["modeling"],Bs.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=Ty(i,t),Py(n,t),t.host=n,t},Bs.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,Ty(n,t),Py(i,t,r),t};function Ty(e,t){return $e(e&&e.attachers,t)}function Py(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),Ye(i,t,n)}}function qu(){}qu.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},qu.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t};function Ce(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",function(){i.registerHandlers(n)})}Ce.$inject=["eventBus","elementFactory","commandStack"],Ce.prototype.getHandlers=function(){return{"shape.append":As,"shape.create":ai,"shape.delete":yo,"shape.move":Bi,"shape.resize":bo,"shape.replace":On,"shape.toggleCollapse":Is,spaceTool:si,"label.create":mo,"connection.create":ks,"connection.delete":go,"connection.move":Gu,"connection.layout":Ns,"connection.updateWaypoints":qu,"connection.reconnect":_o,"elements.create":Wu,"elements.move":Os,"elements.delete":Uu,"elements.distribute":Ds,"elements.align":Ps,"element.updateAttachment":Bs}},Ce.prototype.registerHandlers=function(e){A(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},Ce.prototype.moveShape=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},Ce.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},Ce.prototype.moveElements=function(e,t,n,i){i=i||{};var r=i.attach,o=n,a;r===!0?(a=n,o=n.parent):r===!1&&(a=null);var s={shapes:e,delta:t,newParent:o,newHost:a,hints:i};this._commandStack.execute("elements.move",s)},Ce.prototype.moveConnection=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},Ce.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},Ce.prototype.createConnection=function(e,t,n,i,r,o){typeof n=="object"&&(o=r,r=i,i=n,n=void 0),i=this._create("connection",i);var a={source:e,target:t,parent:r,parentIndex:n,connection:i,hints:o};return this._commandStack.execute("connection.create",a),a.connection},Ce.prototype.createShape=function(e,t,n,i,r){typeof i!="number"&&(r=i,i=void 0),r=r||{};var o=r.attach,a,s;e=this._create("shape",e),o?(a=n.parent,s=n):a=n;var c={position:t,shape:e,parent:a,parentIndex:i,host:s,hints:r};return this._commandStack.execute("shape.create",c),c.shape},Ce.prototype.createElements=function(e,t,n,i,r){oe(e)||(e=[e]),typeof i!="number"&&(r=i,i=void 0),r=r||{};var o={position:t,elements:e,parent:n,parentIndex:i,hints:r};return this._commandStack.execute("elements.create",o),o.elements},Ce.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},Ce.prototype.appendShape=function(e,t,n,i,r){r=r||{},t=this._create("shape",t);var o={source:e,position:n,target:i,shape:t,connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},Ce.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},Ce.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},Ce.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},Ce.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},Ce.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Ce.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},Ce.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Ce.prototype.createSpace=function(e,t,n,i,r){var o={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",o)},Ce.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Ce.prototype.reconnect=function(e,t,n,i,r){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},Ce.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,D(i,{docking:"source"}))},Ce.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,D(i,{docking:"target"}))},Ce.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},Ce.prototype._create=function(e,t){return Zx(t)?t:this._elementFactory.create(e,t)},Ce.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)};function Eo(e){this._elementRegistry=e}Eo.$inject=["elementRegistry"],Eo.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var r=e.changed||this._getVisualReferences(n).concat(t),o=e.oldProperties||XA(n,qo(i));return Ay(n,i),e.oldProperties=o,e.changed=r,r},Eo.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return Ay(n,t),i},Eo.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return E(e,"bpmn:DataObject")?ZA(e,t):[]};function XA(e,t){return Tt(t,function(n,i){return n[i]=e.get(i),n},{})}function Ay(e,t){A(t,function(n,i){e.set(i,n)})}function ZA(e,t){return t.filter(function(n){return E(n,"bpmn:DataObjectReference")&&z(n).dataObjectRef===e})}var xo="default",In="id",ky="di",JA={width:0,height:0};function wo(e,t,n,i){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=i}wo.$inject=["elementRegistry","moddle","modeling","textRenderer"],wo.prototype.execute=function(e){var t=e.element,n=[t];if(!t)throw new Error("element required");var i=this._elementRegistry,r=this._moddle.ids,o=t.businessObject,a=ik(e.properties),s=e.oldProperties||QA(t,a);return My(a,o)&&(r.unclaim(o[In]),i.updateId(t,a[In]),r.claim(a[In],o)),xo in a&&(a[xo]&&n.push(i.get(a[xo].id)),o[xo]&&n.push(i.get(o[xo].id))),Dy(t,a),e.oldProperties=s,e.changed=n,n},wo.prototype.postExecute=function(e){var t=e.element,n=t.label,i=n&&z(n).name;if(i){var r=this._textRenderer.getExternalLabelBounds(n,i);this._modeling.resizeShape(n,r,JA)}},wo.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Dy(t,i),My(n,r)&&(a.unclaim(n[In]),o.updateId(t,i[In]),a.claim(i[In],r)),e.changed};function My(e,t){return In in e&&e[In]!==t[In]}function QA(e,t){var n=qo(t),i=e.businessObject,r=ye(e);return Tt(n,function(o,a){return a!==ky?o[a]=i.get(a):o[a]=ek(r,qo(t.di)),o},{})}function ek(e,t){return Tt(t,function(n,i){return n[i]=e&&e.get(i),n},{})}function Dy(e,t){var n=e.businessObject,i=ye(e);A(t,function(r,o){o!==ky?n.set(o,r):i&&tk(i,r)})}function tk(e,t){A(t,function(n,i){e.set(i,n)})}var nk=["default"];function ik(e){var t=D({},e);return nk.forEach(function(n){n in e&&(t[n]=z(t[n]))}),t}function Ls(e,t){this._canvas=e,this._modeling=t}Ls.$inject=["canvas","modeling"],Ls.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,s=ye(r);return t.setRootElement(n),t.removeRootElement(r),Ye(a.rootElements,i),i.$parent=a,$e(a.rootElements,o),o.$parent=null,r.di=null,s.bpmnElement=i,n.di=s,e.oldRoot=r,[]},Ls.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,a=i.$parent,s=ye(n);return t.setRootElement(r),t.removeRootElement(n),$e(a.rootElements,i),i.$parent=null,Ye(a.rootElements,o),o.$parent=a,n.di=null,s.bpmnElement=o,r.di=s,[]};function Yu(e,t){this._modeling=e,this._spaceTool=t}Yu.$inject=["modeling","spaceTool"],Yu.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=Wt(i),a=o===i,s=a?i:i.parent,c=ei(s),l=Je(i);if(l?r==="left"?r="top":r==="right"&&(r="bottom"):r==="top"?r="left":r==="bottom"&&(r="right"),!c.length){var u=l?{x:i.x+zt,y:i.y,width:i.width-zt,height:i.height}:{x:i.x,y:i.y+zt,width:i.width,height:i.height-zt};n.createShape({type:"bpmn:Lane",isHorizontal:l},u,s)}var p=[];bi(o,function(b){return p.push(b),b.label&&p.push(b.label),b===i?[]:le(b.children,function(S){return S!==i})});var d,h,m,y,g;r==="top"?(d=-120,h=i.y,m=h+10,y="n",g="y"):r==="left"?(d=-120,h=i.x,m=h+10,y="w",g="x"):r==="bottom"?(d=120,h=i.y+i.height,m=h-10,y="s",g="y"):r==="right"&&(d=120,h=i.x+i.width,m=h-10,y="e",g="x");var w=t.calculateAdjustments(p,g,d,m),C=l?{x:0,y:d}:{x:d,y:0};t.makeSpace(w.movingShapes,w.resizingShapes,C,y,m);var x=l?{x:i.x+(a?zt:0),y:h-(r==="top"?120:0),width:i.width-(a?zt:0),height:120}:{x:h-(r==="left"?120:0),y:i.y+(a?zt:0),width:120,height:i.height-(a?zt:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:l},x,s)};function Xu(e){this._modeling=e}Xu.$inject=["modeling"],Xu.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,i=e.count,r=ei(n),o=r.length;if(o>i)throw new Error(`more than <${i}> child lanes`);var a=Je(n),s=a?n.height:n.width,c=Math.round(s/i),l,u,p,d;for(d=0;d<i;d++)d===i-1?l=s-c*d:l=c,u=a?{x:n.x+zt,y:n.y+d*c,width:n.width-zt,height:l}:{x:n.x+d*c,y:n.y+zt,width:l,height:n.height-zt},d<o?t.resizeShape(r[d],u):(p={type:"bpmn:Lane",isHorizontal:a},t.createShape(p,u,n))};function So(e,t){this._modeling=e,this._spaceTool=t}So.$inject=["modeling","spaceTool"],So.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds,i=e.balanced;i!==!1?this.resizeBalanced(t,n):this.resizeSpace(t,n)},So.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=MT(e,t);n.resizeShape(e,t),i.forEach(function(r){n.resizeShape(r.shape,r.newBounds)})},So.prototype.resizeSpace=function(e,t){var n=this._spaceTool,i=Q(e),r=Q(t),o=zm(r,i),a=Wt(e),s=[],c=[];bi(a,function(m){return s.push(m),(E(m,"bpmn:Lane")||E(m,"bpmn:Participant"))&&c.push(m),m.children});var l,u,p,d,h;(o.bottom||o.top)&&(l=o.bottom||o.top,u=e.y+(o.bottom?e.height:0)+(o.bottom?-10:10),p=o.bottom?"s":"n",d=o.top>0||o.bottom<0?-l:l,h=n.calculateAdjustments(s,"y",d,u),n.makeSpace(h.movingShapes,h.resizingShapes,{x:0,y:l},p)),(o.left||o.right)&&(l=o.right||o.left,u=e.x+(o.right?e.width:0)+(o.right?-10:100),p=o.right?"e":"w",d=o.left>0||o.right<0?-l:l,h=n.calculateAdjustments(c,"x",d,u),n.makeSpace(h.movingShapes,h.resizingShapes,{x:l,y:0},p))};var Co="flowNodeRef",Zu="lanes";function Ro(e){this._elementRegistry=e}Ro.$inject=["elementRegistry"],Ro.prototype._computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function a(u,p){var d=Q(p),h={x:u.x+u.width/2,y:u.y+u.height/2};return h.x>d.left&&h.x<d.right&&h.y>d.top&&h.y<d.bottom}function s(u){n.indexOf(u)===-1&&(o.push(u),n.push(u))}function c(u){var p=Wt(u);return r[p.id]||(r[p.id]=ss(p)),r[p.id]}function l(u){if(!u.parent)return[];var p=c(u);return p.filter(function(d){return a(u,d)}).map(function(d){return d.businessObject})}return t.forEach(function(u){var p=Wt(u);if(!(!p||n.indexOf(p)!==-1)){var d=p.children.filter(function(h){return E(h,"bpmn:FlowNode")});d.forEach(s),n.push(p)}}),e.forEach(s),o.forEach(function(u){var p=u.businessObject,d=p.get(Zu),h=d.slice(),m=l(u);i.push({flowNode:p,remove:h,add:m})}),t.forEach(function(u){var p=u.businessObject;u.parent||p.get(Co).forEach(function(d){i.push({flowNode:d,remove:[p],add:[]})})}),i},Ro.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(n){var i=n.flowNode,r=i.get(Zu);n.remove.forEach(function(o){$e(r,o),$e(o.get(Co),i)}),n.add.forEach(function(o){Ye(r,o),Ye(o.get(Co),i)})}),[]},Ro.prototype.revert=function(e){var t=e.updates;return t.forEach(function(n){var i=n.flowNode,r=i.get(Zu);n.add.forEach(function(o){$e(r,o),$e(o.get(Co),i)}),n.remove.forEach(function(o){Ye(r,o),Ye(o.get(Co),i)})}),[]};function $s(e){this._moddle=e}$s.$inject=["moddle"],$s.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element,r=e.claiming;return r?t.claim(n,i):t.unclaim(n),[]},$s.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element,r=e.claiming;return r?t.unclaim(n):t.claim(n,i),[]};var rk={fill:void 0,stroke:void 0};function Ju(e){this._commandStack=e,this._normalizeColor=function(t){if(t){if(Rt(t)){var n=ok(t);if(n)return n}throw new Error(`invalid color value: ${t}`)}}}Ju.$inject=["commandStack"],Ju.prototype.postExecute=function(e){var t=e.elements,n=e.colors||rk,i=this,r={};"fill"in n&&D(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&D(r,{"border-color":this._normalizeColor(n.stroke)}),A(t,function(o){var a=Se(o)?Qt(r,["border-color"]):r,s=ye(o);if(ak(a),ge(o))i._commandStack.execute("element.updateModdleProperties",{element:o,moddleElement:s.label,properties:{color:r["border-color"]}});else{if(!ue(s,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;i._commandStack.execute("element.updateProperties",{element:o,properties:{di:a}})}})};function ok(e){var t=document.createElement("canvas").getContext("2d");return t.fillStyle="transparent",t.fillStyle=e,/^#[0-9a-fA-F]{6}$/.test(t.fillStyle)?t.fillStyle:null}function ak(e){"border-color"in e&&(e.stroke=e["border-color"]),"background-color"in e&&(e.fill=e["background-color"])}var sk={width:0,height:0};function Ny(e,t,n){function i(c,l){var u=c.label||c,p=c.labelTarget||c;return Z1(u,l),[u,p]}function r(c){var l=c.element,u=l.businessObject,p=c.newLabel;if(!ge(l)&&Ci(l)&&!_a(l)&&!Oy(p)){var d=7,h=el(l);h={x:h.x,y:h.y+d},e.createLabel(l,h,{id:u.id+"_label",businessObject:u,di:l.di})}}function o(c){return c.oldLabel=en(c.element),i(c.element,c.newLabel)}function a(c){return i(c.element,c.oldLabel)}function s(c){var l=c.element,u=l.label||l,p=c.newLabel,d=c.newBounds,h=c.hints||{};if(!(!ge(u)&&!E(u,"bpmn:TextAnnotation"))){if(ge(u)&&Oy(p)){h.removeShape!==!1&&e.removeShape(u,{unsetLabel:!1});return}var m=en(l);typeof d>"u"&&(d=t.getExternalLabelBounds(u,m)),d&&e.resizeShape(u,d,sk)}}this.preExecute=r,this.execute=o,this.revert=a,this.postExecute=s}Ny.$inject=["modeling","textRenderer","bpmnFactory"];function Oy(e){return!e||!e.trim()}function gt(e,t,n,i){Ce.call(this,e,t,n),this._bpmnRules=i}Y(gt,Ce),gt.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],gt.prototype.getHandlers=function(){var e=Ce.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=Eo,e["element.updateProperties"]=wo,e["canvas.updateRoot"]=Ls,e["lane.add"]=Yu,e["lane.resize"]=So,e["lane.split"]=Xu,e["lane.updateRefs"]=Ro,e["id.updateClaim"]=$s,e["element.setColor"]=Ju,e["element.updateLabel"]=Ny,e},gt.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},gt.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),!!n)return this.createConnection(e,t,n,e.parent,i)},gt.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},gt.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},gt.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},gt.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},gt.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},gt.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},gt.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},gt.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},gt.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},gt.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},gt.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})};function Iy(){}Iy.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||te(t.source||e.source),t.connectionEnd||te(t.target||e.target)]};var js=20,ck=5,Fs=Math.round,By=20,lk={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function uk(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function pk(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function Ly(e,t,n){var i=ft(t,e,ck),r=n.split(":")[0],o=Fs((t.x-e.x)/2+e.x),a=Fs((t.y-e.y)/2+e.y),s,c,l=pk(r,i),u=/h|r|l/.test(r),p=!1,d=!1;return l?(s=u?{x:o,y:e.y}:{x:e.x,y:a},c=u?"h:h":"v:v"):(p=uk(i,r),c=u?"h:v":"v:h",p?u?(d=a===e.y,s={x:e.x+js*(/l/.test(r)?-1:1),y:d?a+js:a}):(d=o===e.x,s={x:d?o+js:o,y:e.y+js*(/t/.test(r)?-1:1)}):s={x:o,y:a}),{waypoints:Qu(e,s,c).concat(s),directions:c,turnNextDirections:d}}function fk(e,t,n){return Ly(e,t,n)}function dk(e,t,n){var i=Ly(t,e,$y(n));return{waypoints:i.waypoints.slice().reverse(),directions:$y(i.directions),turnNextDirections:i.turnNextDirections}}function hk(e,t){var n=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(n=n=="h"?"v":"h"),t.turnNextDirections&&(i=i=="h"?"v":"h");var r=n+":"+i,o=Qu(e.waypoints[e.waypoints.length-1],t.waypoints[0],r);return{waypoints:o,directions:r}}function $y(e){return e.split(":").reverse().join(":")}function mk(e,t,n){var i=Fs((t.x-e.x)/2+e.x),r=Fs((t.y-e.y)/2+e.y);if(n==="h:v")return[{x:t.x,y:e.y}];if(n==="v:h")return[{x:e.x,y:t.y}];if(n==="h:h")return[{x:i,y:e.y},{x:i,y:t.y}];if(n==="v:v")return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function Qu(e,t,n){if(n=n||"h:h",!Sk(n))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(Fy(n)){var i=fk(e,t,n),r=dk(e,t,n),o=hk(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return mk(e,t,n)}function gk(e,t,n){var i=Qu(e,t,n);return i.unshift(e),i.push(t),Vy(i)}function yk(e,t,n,i,r){var o=r&&r.preferredLayouts||[],a=RE(o,"straight")[0]||"h:h",s=lk[a]||0,c=ft(e,t,s),l=wk(c,a);n=n||te(e),i=i||te(t);var u=l.split(":"),p=Hy(n,e,u[0],Ck(c)),d=Hy(i,t,u[1],c);return gk(p,d,l)}function vk(e,t,n,i,r,o){oe(n)&&(r=n,o=i,n=te(e),i=te(t)),o=D({preferredLayouts:[]},o),r=r||[];var a=o.preferredLayouts,s=a.indexOf("straight")!==-1,c;return c=s&&bk(e,t,n,i,o),c||(c=o.connectionEnd&&xk(t,e,i,r),c)||(c=o.connectionStart&&Ek(e,t,n,r),c)?c:!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:yk(e,t,n,i,o)}function _k(e,t,n){return e>=t&&e<=n}function jy(e,t,n){var i={x:"width",y:"height"};return _k(t[e],n[e],n[e]+n[i[e]])}function bk(e,t,n,i,r){var o={},a,s;return s=ft(e,t),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(a="x"),/left|right/.test(s)&&(a="y"),r.preserveDocking==="target"?jy(a,i,e)?(o[a]=i[a],[{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y,original:{x:o.x!==void 0?o.x:n.x,y:o.y!==void 0?o.y:n.y}},{x:i.x,y:i.y}]):null:jy(a,n,t)?(o[a]=n[a],[{x:n.x,y:n.y},{x:o.x!==void 0?o.x:i.x,y:o.y!==void 0?o.y:i.y,original:{x:o.x!==void 0?o.x:i.x,y:o.y!==void 0?o.y:i.y}}]):null):null}function Ek(e,t,n,i){return ep(e,t,n,i)}function xk(e,t,n,i){var r=i.slice().reverse();return r=ep(e,t,n,r),r?r.reverse():null}function ep(e,t,n,i){function r(u){return u.length<3?!0:u.length>4?!1:!!_e(u,function(p,d){var h=u[d-1];return h&&Br(p,h)<3})}function o(u,p,d){var h=xn(p,u);switch(h){case"v":return{x:d.x,y:u.y};case"h":return{x:u.x,y:d.y}}return{x:u.x,y:u.y}}function a(u,p,d){var h;for(h=u.length-2;h!==0;h--)if(Tf(u[h],p,By)||Tf(u[h],d,By))return u.slice(h);return u}if(r(i))return null;var s=i[0],c=i.slice(),l;return c[0]=n,c[1]=o(c[1],s,n),l=a(c,e,t),l!==c&&(c=ep(e,t,n,l)),c&&xn(c)?null:c}function wk(e,t){if(Fy(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function Sk(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function Fy(e){return e&&/t|r|b|l/.test(e)}function Ck(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function Hy(e,t,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Vy(e){return e.reduce(function(t,n,i){var r=t[t.length-1],o=e[i+1];return Bc(r,o,n,0)||t.push(n),t},[])}var Rk=-10,Tk=40,Pk={default:["h:h"],fromGateway:["v:h"],toGateway:["h:v"],loop:{fromTop:["t:r"],fromRight:["r:b"],fromLeft:["l:t"],fromBottom:["b:l"]},boundaryLoop:{alternateHorizontalSide:"b",alternateVerticalSide:"l",default:"v"},messageFlow:["straight","v:v"],subProcess:["straight","h:h"],isHorizontal:!0},Ak={default:["v:v"],fromGateway:["h:v"],toGateway:["v:h"],loop:{fromTop:["t:l"],fromRight:["r:t"],fromLeft:["l:b"],fromBottom:["b:r"]},boundaryLoop:{alternateHorizontalSide:"t",alternateVerticalSide:"r",default:"h"},messageFlow:["straight","h:h"],subProcess:["straight","v:v"],isHorizontal:!1},tp={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},To={top:"t",right:"r",bottom:"b",left:"l"};function Hs(e){this._elementRegistry=e}Y(Hs,Iy),Hs.prototype.layoutConnection=function(e,t){t||(t={});var n=t.source||e.source,i=t.target||e.target,r=t.waypoints||e.waypoints,o=t.connectionStart,a=t.connectionEnd,s=this._elementRegistry,c,l;if(o||(o=zy(r&&r[0],n)),a||(a=zy(r&&r[r.length-1],i)),(E(e,"bpmn:Association")||E(e,"bpmn:DataAssociation"))&&r&&!Wy(n,i))return[].concat([o],r.slice(1,-1),[a]);var u=Zh(n,s)?Pk:Ak;return E(e,"bpmn:MessageFlow")?c=Mk(n,i,u):(E(e,"bpmn:SequenceFlow")||Wy(n,i))&&(n===i?c={preferredLayouts:Lk(n,e,u)}:E(n,"bpmn:BoundaryEvent")?c={preferredLayouts:$k(n,i,a,u)}:Po(n)||Po(i)?c={preferredLayouts:u.subProcess,preserveDocking:Nk(n)}:E(n,"bpmn:Gateway")?c={preferredLayouts:u.fromGateway}:E(i,"bpmn:Gateway")?c={preferredLayouts:u.toGateway}:c={preferredLayouts:u.default}),c&&(c=D(c,t),l=Vy(vk(n,i,o,a,r,c))),l||[o,a]};function kk(e){var t=e.host;return ft(te(e),t,Rk)}function Mk(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:Dk(e,t)}}function Dk(e,t){return E(t,"bpmn:Participant")?"source":E(e,"bpmn:Participant")?"target":Po(t)?"source":Po(e)||E(t,"bpmn:Event")?"target":E(e,"bpmn:Event")?"source":null}function Nk(e){return Po(e)?"target":"source"}function zy(e,t){return e?e.original||e:te(t)}function Wy(e,t){return E(t,"bpmn:Activity")&&E(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Po(e){return E(e,"bpmn:SubProcess")&&fe(e)}function Li(e,t){return e===t}function Ok(e,t){return t.indexOf(e)!==-1}function br(e){var t=/right|left/.exec(e);return t&&t[0]}function Er(e){var t=/top|bottom/.exec(e);return t&&t[0]}function Uy(e,t){return tp[e]===t}function Ik(e,t){var n=br(e),i=tp[n];return t.indexOf(i)!==-1}function Bk(e,t){var n=Er(e),i=tp[n];return t.indexOf(i)!==-1}function Gy(e){return e==="right"||e==="left"}function Lk(e,t,n){var i=t.waypoints,r=i&&i.length&&ft(i[0],e);return r==="top"?n.loop.fromTop:r==="right"?n.loop.fromRight:r==="left"?n.loop.fromLeft:n.loop.fromBottom}function $k(e,t,n,i){var r=te(e),o=te(t),a=kk(e),s,c,l=Li(e.host,t),u=Ok(a,["top","right","bottom","left"]),p=ft(o,r,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return l?jk(a,u,e,t,n,i):(s=Fk(a,p,u,i.isHorizontal),c=Hk(a,p,u,i.isHorizontal),[s+":"+c])}function jk(e,t,n,i,r,o){var a=t?e:o.isHorizontal?Er(e):br(e),s=To[a],c;return t?Gy(e)?c=Ky("y",n,i,r)?"h":o.boundaryLoop.alternateHorizontalSide:c=Ky("x",n,i,r)?"v":o.boundaryLoop.alternateVerticalSide:c=o.boundaryLoop.default,[s+":"+c]}function Ky(e,t,n,i){var r=Tk;return!(np(e,i,n,r)||np(e,i,{x:n.x+n.width,y:n.y+n.height},r)||np(e,i,te(t),r))}function np(e,t,n,i){return Math.abs(t[e]-n[e])<i}function Fk(e,t,n,i){if(n)return To[e];var r=Er(e),o=br(e),a=Er(t),s=br(t);if(i){if(Li(r,a)||Uy(o,s))return To[r]}else if(Li(o,s)||Uy(r,a))return To[o];return To[i?o:r]}function Hk(e,t,n,i){return n?Gy(e)?Ik(e,t)||Li(e,t)?"h":"v":Bk(e,t)||Li(e,t)?"v":"h":i?Li(Er(e),Er(t))?"h":"v":Li(br(e),br(t))?"v":"h"}Hs.$inject=["elementRegistry"];function qy(e){return D({original:e.point.original||e.point},e.actual)}function li(e,t){this._elementRegistry=e,this._graphicsFactory=t}li.$inject=["elementRegistry","graphicsFactory"],li.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var i=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,n),o=e.waypoints.slice(i.idx+1,r.idx);return o.unshift(qy(i)),o.push(qy(r)),o},li.prototype.getDockingPoint=function(e,t,n){var i=e.waypoints,r,o,a;return r=n?0:i.length-1,o=i[r],a=this._getIntersection(t,e,n),{point:o,actual:a||o,idx:r}},li.prototype._getIntersection=function(e,t,n){var i=this._getShapePath(e),r=this._getConnectionPath(t);return Fc(i,r,n)},li.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},li.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},li.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};const Yy={__init__:["modeling","bpmnUpdater"],__depends__:[BP,eA,nA,iA,sy,MA,NA,jA,tn,nl,dy],bpmnFactory:["type",Gt],bpmnUpdater:["type",Mt],elementFactory:["type",oi],modeling:["type",gt],layouter:["type",Hs],connectionDocking:["type",li]},Xy=Math.round;function Vs(e,t,n,i,r,o){this._complexPreview=e,this._connectionDocking=t,this._elementFactory=n,this._eventBus=i,this._layouter=r,this._rules=o}Vs.prototype.create=function(e,t,n){const i=this._complexPreview,r=this._connectionDocking,o=this._elementFactory,a=this._eventBus,s=this._layouter,c=this._rules,l=o.createShape(D({type:t},n)),u=a.fire("autoPlace",{source:e,shape:l});if(!u)return;D(l,{x:u.x-Xy(l.width/2),y:u.y-Xy(l.height/2)});const p=c.allowed("connection.create",{source:e,target:l,hints:{targetParent:e.parent}});let d=null;p&&(d=o.createConnection(p),d.waypoints=s.layoutConnection(d,{source:e,target:l}),d.waypoints=r.getCroppedWaypoints(d,e,l)),i.create({created:[l,d].filter(h=>!Mr(h))})},Vs.prototype.cleanUp=function(){this._complexPreview.cleanUp()},Vs.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];const Vk={__depends__:[Rl,pT,Yy],__init__:["appendPreview"],appendPreview:["type",Vs]};var Zy=Math.min,Jy=Math.max;function ip(e){e.preventDefault()}function Ao(e){e.stopPropagation()}function zk(e){return e.nodeType===Node.TEXT_NODE}function Wk(e){return[].slice.call(e)}function on(e){this.container=e.container,this.parent=Pe('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=we("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=xt(this.autoResize,this),this.handlePaste=xt(this.handlePaste,this)}on.prototype.create=function(e,t,n,i){var r=this,o=this.parent,a=this.content,s=this.container;i=this.options=i||{},t=this.style=t||{};var c=Qt(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);D(o.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var l=Qt(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return D(a.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&D(a.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),a.innerText=n,ae.bind(a,"keydown",this.keyHandler),ae.bind(a,"mousedown",Ao),ae.bind(a,"paste",r.handlePaste),i.autoResize&&ae.bind(a,"input",this.autoResize),i.resizable&&this.resizable(t),s.appendChild(o),this.setSelection(a.lastChild,a.lastChild&&a.lastChild.length),o},on.prototype.handlePaste=function(e){var t=this.options,n=this.style;e.preventDefault();var i;if(e.clipboardData?i=e.clipboardData.getData("text/plain"):i=window.clipboardData.getData("Text"),this.insertText(i),t.autoResize){var r=this.autoResize(n);r&&this.resizeHandler(r)}},on.prototype.insertText=function(e){e=Uk(e);var t=document.execCommand("insertText",!1,e);t||this._insertTextIE(e)},on.prototype._insertTextIE=function(e){var t=this.getSelection(),n=t.startContainer,i=t.endContainer,r=t.startOffset,o=t.endOffset,a=t.commonAncestorContainer,s=Wk(a.childNodes),c,l;if(zk(a)){var u=n.textContent;n.textContent=u.substring(0,r)+e+u.substring(o),c=n,l=r+e.length}else if(n===this.content&&i===this.content){var p=document.createTextNode(e);this.content.insertBefore(p,s[r]),c=p,l=p.textContent.length}else{var d=s.indexOf(n),h=s.indexOf(i);s.forEach(function(m,y){y===d?m.textContent=n.textContent.substring(0,r)+e+i.textContent.substring(o):y>d&&y<=h&&un(m)}),c=n,l=r+e.length}c&&l!==void 0&&setTimeout(function(){self.setSelection(c,l)})},on.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var i=e.getBoundingClientRect(),r=t.scrollHeight;e.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},on.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,i=parseInt(this.style.minWidth)||0,r=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,a=parseInt(this.style.maxHeight)||1/0;if(!n){n=this.resizeHandle=Pe('<div class="djs-direct-editing-resize-handle"></div>');var s,c,l,u,p=function(m){ip(m),Ao(m),s=m.clientX,c=m.clientY;var y=t.getBoundingClientRect();l=y.width,u=y.height,ae.bind(document,"mousemove",d),ae.bind(document,"mouseup",h)},d=function(m){ip(m),Ao(m);var y=Zy(Jy(l+m.clientX-s,i),o),g=Zy(Jy(u+m.clientY-c,r),a);t.style.width=y+"px",t.style.height=g+"px",e.resizeHandler({width:l,height:u,dx:m.clientX-s,dy:m.clientY-c})},h=function(m){ip(m),Ao(m),ae.unbind(document,"mousemove",d,!1),ae.unbind(document,"mouseup",h,!1)};ae.bind(n,"mousedown",p)}D(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),t.appendChild(n)},on.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),ae.unbind(t,"keydown",this.keyHandler),ae.unbind(t,"mousedown",Ao),ae.unbind(t,"input",this.autoResize),ae.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),un(n)),un(e)},on.prototype.getValue=function(){return this.content.innerText.trim()},on.prototype.getSelection=function(){var e=window.getSelection(),t=e.getRangeAt(0);return t},on.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)};function Uk(e){return e.replace(/\r\n|\r|\n/g,`
|
|
213
|
-
`)}function Kt(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._textbox=new on({container:t.getContainer(),keyHandler:xt(this._handleKey,this),resizeHandler:xt(this._handleResize,this)})}Kt.$inject=["eventBus","canvas"],Kt.prototype.registerProvider=function(e){this._providers.push(e)},Kt.prototype.isActive=function(e){return!!(this._active&&(!e||this._active.element===e))},Kt.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Kt.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},Kt.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0,this._canvas.restoreFocus&&this._canvas.restoreFocus()},Kt.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue(),o=e.context.text;(r!==o||i.height!==n.height||i.width!==n.width)&&(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},Kt.prototype.getValue=function(){return this._textbox.getValue()},Kt.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;if(t===27)return e.preventDefault(),this.cancel();if(t===13&&!e.shiftKey)return e.preventDefault(),this.complete()},Kt.prototype._handleResize=function(e){this._fire("resize",e)},Kt.prototype.activate=function(e){this.isActive()&&this.cancel();var t,n=_e(this._providers,function(i){return(t=i.activate(e))?i:null});return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};const Qy={__depends__:[Ma],__init__:["directEditing"],directEditing:["type",Kt]};function Gk(e){return function(t){var n=t.target,i=z(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=!!n.triggeredByEvent==!!i.triggeredByEvent,c=n.isExpanded===void 0||n.isExpanded===fe(e);return!o||!a||!s||!c}}var Kk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],qk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],Yk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link intermediate catch event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link intermediate throw event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],Xk=[{label:"Start event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate throw event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel end event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate end event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],Zk=[{label:"Exclusive gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event-based gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],Jk=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],Qk=[{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}}],ev=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Sub-process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},{label:"Event sub-process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],e2=ev,tv=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"User task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Service task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Send task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"Manual task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business rule task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Script task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub-process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub-process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Ad-hoc sub-process (collapsed)",actionName:"replace-with-collapsed-ad-hoc-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}},{label:"Ad-hoc sub-process (expanded)",actionName:"replace-with-ad-hoc-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}}],t2=[{label:"Data store reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],n2=[{label:"Data object reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],i2=[{label:"Message boundary event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},{label:"Timer boundary event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},{label:"Escalation boundary event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},{label:"Conditional boundary event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},{label:"Error boundary event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},{label:"Cancel boundary event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},{label:"Signal boundary event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},{label:"Compensation boundary event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},{label:"Message boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal boundary event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],r2=[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},{label:"Message start event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer start event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional start event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal start event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation start event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],o2=[{label:"Sequence flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],a2=[{label:"Expanded pool/participant",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}],s2={"bpmn:MessageEventDefinition":[{label:"Message start event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate catch event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message intermediate throw event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message end event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}}],"bpmn:TimerEventDefinition":[{label:"Timer start event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Timer intermediate catch event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}}],"bpmn:ConditionalEventDefinition":[{label:"Conditional start event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Conditional intermediate catch event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}}],"bpmn:SignalEventDefinition":[{label:"Signal start event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate catch event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal intermediate throw event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal end event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],"bpmn:ErrorEventDefinition":[{label:"Error start event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Error end event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}}],"bpmn:EscalationEventDefinition":[{label:"Escalation start event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation intermediate throw event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Escalation end event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}}],"bpmn:CompensateEventDefinition":[{label:"Compensation start event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation intermediate throw event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Compensation end event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}}]};const nv={"start-event-non-interrupting":`
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
</svg>`};function qt(e,t,n,i,r,o,a,s){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this._moddleCopy=s,this._register()}qt.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"],qt.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},qt.prototype.getPopupMenuEntries=function(e){var s;var t=e.businessObject,n=this._rules,i=[],r,o=[];if(oe(e)||!n.allowed("shape.replace",{element:e}))return{};var a=Gk(e);return E(t,"bpmn:DataObjectReference")?this._createEntries(e,t2):E(t,"bpmn:DataStoreReference")&&!E(e.parent,"bpmn:Collaboration")?this._createEntries(e,n2):(E(t,"bpmn:Event")&&!E(t,"bpmn:BoundaryEvent")&&(r=(s=t.get("eventDefinitions")[0])==null?void 0:s.$type,i=s2[r]||[],!mt(t.$parent)&&E(t.$parent,"bpmn:SubProcess")&&(i=le(i,function(c){return c.target.type!=="bpmn:StartEvent"}))),E(t,"bpmn:StartEvent")&&!E(t.$parent,"bpmn:SubProcess")?(o=le(Kk.concat(i),a),this._createEntries(e,o)):E(t,"bpmn:Participant")?(o=le(a2,function(c){return fe(e)!==c.target.isExpanded}),this._createEntries(e,o)):E(t,"bpmn:StartEvent")&&mt(t.$parent)?(o=le(r2.concat(i),function(c){var l=c.target,u=l.isInterrupting!==!1,p=t.isInterrupting===u;return a(c)||!a(c)&&!p}),this._createEntries(e,o)):E(t,"bpmn:StartEvent")&&!mt(t.$parent)&&E(t.$parent,"bpmn:SubProcess")?(o=le(qk.concat(i),a),this._createEntries(e,o)):E(t,"bpmn:EndEvent")?(o=le(Xk.concat(i),function(c){var l=c.target;return l.eventDefinitionType=="bpmn:CancelEventDefinition"&&!E(t.$parent,"bpmn:Transaction")?!1:a(c)}),this._createEntries(e,o)):E(t,"bpmn:BoundaryEvent")?(o=le(i2,function(c){var l=c.target;if(l.eventDefinitionType=="bpmn:CancelEventDefinition"&&!E(t.attachedToRef,"bpmn:Transaction"))return!1;var u=l.cancelActivity!==!1,p=t.cancelActivity==u;return a(c)||!a(c)&&!p}),this._createEntries(e,o)):E(t,"bpmn:IntermediateCatchEvent")||E(t,"bpmn:IntermediateThrowEvent")?(o=le(Yk.concat(i),a),this._createEntries(e,o)):E(t,"bpmn:Gateway")?(o=le(Zk,a),this._createEntries(e,o)):E(t,"bpmn:Transaction")?(o=le(ev,a),this._createEntries(e,o)):mt(t)&&fe(e)?(o=le(e2,a),this._createEntries(e,o)):E(t,"bpmn:AdHocSubProcess")&&fe(e)?(o=le(Qk,a),this._createEntries(e,o)):E(t,"bpmn:SubProcess")&&fe(e)?(o=le(Jk,a),this._createEntries(e,o)):E(t,"bpmn:SubProcess")&&!fe(e)?(o=le(tv,function(c){var l=c.target.type===e.type,u=c.target.isExpanded===!0;return l===u}),this._createEntries(e,o)):E(t,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,o2):E(t,"bpmn:FlowNode")?(o=le(tv,a),this._createEntries(e,o)):{})},qt.prototype.getPopupMenuHeaderEntries=function(e){var t={};return E(e,"bpmn:Activity")&&!mt(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),E(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),E(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),hg(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t},qt.prototype._createEntries=function(e,t){var n={},i=this;return A(t,function(r){n[r.actionName]=i._createEntry(r,e)}),n},qt.prototype._createSequenceFlowEntries=function(e,t){var n=z(e),i={},r=this._modeling,o=this._moddle,a=this;return A(t,function(s){switch(s.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(E(n.sourceRef,"bpmn:ExclusiveGateway")||E(n.sourceRef,"bpmn:InclusiveGateway")||E(n.sourceRef,"bpmn:ComplexGateway")||E(n.sourceRef,"bpmn:Activity"))&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&E(n.sourceRef,"bpmn:Activity")&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){var c=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:c})})});break;default:E(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e,{conditionExpression:void 0})})}),(E(n.sourceRef,"bpmn:ExclusiveGateway")||E(n.sourceRef,"bpmn:InclusiveGateway")||E(n.sourceRef,"bpmn:ComplexGateway")||E(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(i={...i,[s.actionName]:a._createEntry(s,e,function(){r.updateProperties(e.source,{default:void 0})})})}}),i},qt.prototype._createEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=function(){return r(t,e.target)},a=e.label;return a&&typeof a=="function"&&(a=a(t)),n=n||o,{label:i(a),className:e.className,action:n}},qt.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function i(l,u){if(u.active){t._modeling.updateProperties(e,{loopCharacteristics:void 0});return}var p=e.businessObject.get("loopCharacteristics");p&&E(p,u.options.loopCharacteristics)?t._modeling.updateModdleProperties(e,p,{isSequential:u.options.isSequential}):(p=t._moddle.create(u.options.loopCharacteristics,{isSequential:u.options.isSequential}),t._modeling.updateProperties(e,{loopCharacteristics:p}))}var r=z(e),o=r.loopCharacteristics,a,s,c;return o&&(a=o.isSequential,s=o.isSequential===void 0,c=o.isSequential!==void 0&&!o.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:c,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:s,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},qt.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,i=e.businessObject.dataObjectRef;if(!i)return{};function r(a,s){t._modeling.updateModdleProperties(e,i,{isCollection:!s.active})}var o=i.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:o,action:r}}},qt.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,i=this._translate;function r(a,s){var c=s.active,l;c||(l=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:l})}var o=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:i("Participant multiplicity"),active:!!o,action:r}}},qt.prototype._getNonInterruptingHeaderEntries=function(e){const t=this._translate,n=z(e),i=this,r=mg(e),o=E(e,"bpmn:BoundaryEvent")?nv["intermediate-event-non-interrupting"]:nv["start-event-non-interrupting"],a=!n[r];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:a,action:function(){i._modeling.updateProperties(e,{[r]:!!a})}}}};const c2={__depends__:[xl,sy,Rl],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",qt]};function ko(e,t,n,i,r,o,a,s,c,l,u,p,d){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=s,this._popupMenu=c,this._canvas=l,this._rules=u,this._translate=p,this._eventBus=n,this._appendPreview=d,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(h){var m=h.context,y=m.shape;if(!(!Yr(h)||!i.isOpen(y))){var g=i.getEntries(y);g.replace&&g.replace.action.click(h,y)}}),n.on("contextPad.close",function(){d.cleanUp()})}ko.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"],ko.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&D(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(i,r){t.removeElements(r.slice())}}}}),n},ko.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return oe(t)?vi(e,n=>t.includes(n)):t},ko.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._popupMenu,s=this._autoPlace,c=this._translate,l=this._appendPreview,u={};if(e.type==="label")return this._isDeleteAllowed([e])&&D(u,m()),u;var p=e.businessObject;function d(x,b){r.start(x,b)}function h(x,b){n.removeElements([b])}function m(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:c("Delete"),action:{click:h}}}}function y(x){var b=5,S=t.getPad(x).html,P=S.getBoundingClientRect(),M={x:P.left,y:P.bottom+b};return M}function g(x,b,S,P){function M(B,L){var O=i.createShape(D({type:x},P));o.start(B,O,{source:L})}var R=s?function(B,L){var O=i.createShape(D({type:x},P));s.append(L,O)}:M,I=s?function(B,L){return l.create(L,x,P),()=>{l.cleanUp()}}:null;return{group:"model",className:b,title:S,action:{dragstart:M,click:R,hover:I}}}function w(x){return function(b,S){n.splitLane(S,x),t.open(S,!0)}}if(ue(p,["bpmn:Lane","bpmn:Participant"])&&fe(e)){var C=ei(e);D(u,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:c("Add lane above"),action:{click:function(x,b){n.addLane(b,"top")}}}}),C.length<2&&((Je(e)?e.height>=120:e.width>=120)&&D(u,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:c("Divide into two lanes"),action:{click:w(2)}}}),(Je(e)?e.height>=180:e.width>=180)&&D(u,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:c("Divide into three lanes"),action:{click:w(3)}}})),D(u,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:c("Add lane below"),action:{click:function(x,b){n.addLane(b,"bottom")}}}})}return E(p,"bpmn:FlowNode")&&(E(p,"bpmn:EventBasedGateway")?D(u,{"append.receive-task":g("bpmn:ReceiveTask","bpmn-icon-receive-task",c("Append receive task")),"append.message-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",c("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",c("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",c("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":g("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",c("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):iv(p,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?D(u,{"append.compensation-activity":g("bpmn:Task","bpmn-icon-task",c("Append compensation activity"),{isForCompensation:!0})}):!E(p,"bpmn:EndEvent")&&!p.isForCompensation&&!iv(p,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")&&!mt(p)&&D(u,{"append.end-event":g("bpmn:EndEvent","bpmn-icon-end-event-none",c("Append end event")),"append.gateway":g("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",c("Append gateway")),"append.append-task":g("bpmn:Task","bpmn-icon-task",c("Append task")),"append.intermediate-event":g("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",c("Append intermediate/boundary event"))})),a.isEmpty(e,"bpmn-replace")||D(u,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:c("Change element"),action:{click:function(x,b){var S=D(y(b),{cursor:{x:x.x,y:x.y}});a.open(b,"bpmn-replace",S,{title:c("Change element"),width:300,search:!0})}}}}),E(p,"bpmn:SequenceFlow")&&D(u,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),ue(p,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&D(u,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect to other element"),action:{click:d,dragstart:d}}}),E(p,"bpmn:TextAnnotation")&&D(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using association"),action:{click:d,dragstart:d}}}),ue(p,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&D(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:c("Connect using data input association"),action:{click:d,dragstart:d}}}),E(p,"bpmn:Group")&&D(u,{"append.text-annotation":g("bpmn:TextAnnotation","bpmn-icon-text-annotation",c("Add text annotation"))}),this._isDeleteAllowed([e])&&D(u,m()),u};function iv(e,t,n){var i=e.$instanceOf(t),r=!1,o=e.eventDefinitions||[];return A(o,function(a){a.$type===n&&(r=!0)}),i&&r}const l2={__depends__:[Vk,Qy,ph,tn,Ll,Es,c2],__init__:["contextPadProvider"],contextPadProvider:["type",ko]};var u2={horizontal:["x","width"],vertical:["y","height"]},rv=5;function Bn(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(n){var i=t.allowed("elements.distribute",{elements:n});return oe(i)?i:i?n:[]})}Bn.$inject=["modeling","rules"],Bn.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)},Bn.prototype.trigger=function(e,t){var n=this._modeling,i,r;if(!(e.length<3)&&(this._setOrientation(t),r=this._filterElements(e),i=this._createGroups(r),!(i.length<=2)))return n.distributeElements(i,this._axis,this._dimension),i},Bn.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(A(t,function(o){r=o(r,n,i)}),r):e},Bn.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');var o=cn(e,i);return A(o,function(a,s){var c=n._findRange(a,i,r),l,u=t[t.length-1];u&&n._hasIntersection(u.range,c)?t[t.length-1].elements.push(a):(l={range:c,elements:[a]},t.push(l))}),t},Bn.prototype._setOrientation=function(e){var t=u2[e];this._axis=t[0],this._dimension=t[1]},Bn.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},Bn.prototype._findRange=function(e){var t=e[this._axis],n=e[this._dimension];return{min:t+rv,max:t+n-rv}};const p2={__init__:["distributeElements"],distributeElements:["type",Bn]};function zs(e){Ht.call(this,e)}zs.$inject=["eventBus"],Y(zs,Ht),zs.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return t=le(t,function(n){var i=ue(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)}),t=oa(t),t.length<3?!1:t})};var ov={horizontal:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
</svg>`},f2=900;function Mo(e,t,n,i){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",f2,this)}Mo.$inject=["popupMenu","distributeElements","translate","rules"],Mo.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&D(t,this._getEntries(e)),t},Mo.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},Mo.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,i=this._popupMenu,r={"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:ov.horizontal,action:function(o,a){t.trigger(e,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:ov.vertical,action:function(o,a){t.trigger(e,"vertical"),i.close()}}};return r};const d2={__depends__:[xl,p2],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",zs],distributeElementsMenuProvider:["type",Mo]};var av="is not a registered action",h2="is already registered";function Yt(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}Yt.$inject=["eventBus","injector"],Yt.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),s=e.get("rules",!1),c=e.get("keyboardMove",!1),l=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&i&&this.register("copy",function(){var u=i.get();if(u.length)return o.copy(u)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(u){r.stepZoom(u.value)}),a&&this.register("zoom",function(u){a.zoom(u.value)}),n&&i&&s&&this.register("removeSelection",function(){var u=i.get();if(u.length){var p=s.allowed("elements.delete",{elements:u}),d;p!==!1&&(oe(p)?d=p:d=u,d.length&&n.removeElements(d.slice()))}}),c&&this.register("moveCanvas",function(u){c.moveCanvas(u)}),l&&this.register("moveSelection",function(u){l.moveSelection(u.direction,u.accelerated)})},Yt.prototype.trigger=function(e,t){if(!this._actions[e])throw rp(e,av);return this._actions[e](t)},Yt.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);A(e,function(i,r){n._registerAction(r,i)})},Yt.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw rp(e,h2);this._actions[e]=t},Yt.prototype.unregister=function(e){if(!this.isRegistered(e))throw rp(e,av);this._actions[e]=void 0},Yt.prototype.getActions=function(){return Object.keys(this._actions)},Yt.prototype.isRegistered=function(e){return!!this._actions[e]};function rp(e,t){return new Error(e+" "+t)}const m2={__init__:["editorActions"],editorActions:["type",Yt]};function Ws(e){e.invoke(Yt,this)}Y(Ws,Yt),Ws.$inject=["injector"],Ws.prototype._registerDefaultActions=function(e){Yt.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),s=e.get("globalConnect",!1),c=e.get("distributeElements",!1),l=e.get("alignElements",!1),u=e.get("directEditing",!1),p=e.get("searchPad",!1),d=e.get("modeling",!1),h=e.get("contextPad",!1);t&&n&&i&&this._registerAction("selectElements",function(){var m=t.getRootElement(),y=n.filter(function(g){return g!==m});return i.select(y),y}),r&&this._registerAction("spaceTool",function(){r.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),s&&this._registerAction("globalConnectTool",function(){s.toggle()}),i&&c&&this._registerAction("distributeElements",function(m){var y=i.get(),g=m.type;y.length&&c.trigger(y,g)}),i&&l&&this._registerAction("alignElements",function(m){var y=i.get(),g=[],w=m.type;y.length&&(g=le(y,function(C){return!E(C,"bpmn:Lane")}),l.trigger(g,w))}),i&&d&&this._registerAction("setColor",function(m){var y=i.get();y.length&&d.setColor(y,m)}),i&&u&&this._registerAction("directEditing",function(){var m=i.get();m.length&&u.activate(m[0])}),p&&this._registerAction("find",function(){p.toggle()}),t&&d&&this._registerAction("moveToOrigin",function(){var m=t.getRootElement(),y,g;E(m,"bpmn:Collaboration")?g=n.filter(function(w){return E(w.parent,"bpmn:Collaboration")}):g=n.filter(function(w){return w!==m&&!E(w.parent,"bpmn:SubProcess")}),y=qe(g),d.moveElements(g,{x:-y.x,y:-y.y},m)}),i&&h&&this._registerAction("replaceElement",function(m){h.triggerEntry("replace","click",m)})};const g2={__depends__:[m2],editorActions:["type",Ws]};function sv(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context,i=t.shape;ue(i,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}sv.$inject=["eventBus"];var Us=10;function op(e,t,n){return n||(n="round"),Math[n](e/t)*t}var y2=1200,v2=800;function ui(e,t,n){var i=!n||n.active!==!1;this._eventBus=t;var r=this;t.on("diagram.init",v2,function(){r.setActive(i)}),t.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],y2,function(o){var a=o.originalEvent;if(!(!r.active||a&&Ft(a))){var s=o.context,c=s.gridSnappingContext;c||(c=s.gridSnappingContext={}),["x","y"].forEach(function(l){var u={},p=b2(o,l,e);p&&(u.offset=p);var d=_2(o,l);d&&D(u,d),fr(o,l)||r.snapEvent(o,l,u)})}})}ui.prototype.snapEvent=function(e,t,n){var i=this.snapValue(e[t],n);Ve(e,t,i)},ui.prototype.getGridSpacing=function(){return Us},ui.prototype.snapValue=function(e,t){var n=0;t&&t.offset&&(n=t.offset),e+=n,e=op(e,Us);var i,r;return t&&t.min&&(i=t.min,ee(i)&&(i=op(i+n,Us,"ceil"),e=Math.max(e,i))),t&&t.max&&(r=t.max,ee(r)&&(r=op(r+n,Us,"floor"),e=Math.min(e,r))),e-=n,e},ui.prototype.isActive=function(){return this.active},ui.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},ui.prototype.toggleActive=function(){this.setActive(!this.active)},ui.$inject=["elementRegistry","eventBus","config.gridSnapping"];function _2(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,a=o.snapConstraints;if(a&&a[t])return a[t];a||(a=o.snapConstraints={}),a[t]||(a[t]={});var s=n.direction;i&&(Gs(t)?(a.x.min=i.left,a.x.max=i.right):(a.y.min=i.top,a.y.max=i.bottom));var c=r.min,l=r.max;return c&&(Gs(t)?lv(s)?a.x.max=c.left:a.x.min=c.right:cv(s)?a.y.max=c.top:a.y.min=c.bottom),l&&(Gs(t)?lv(s)?a.x.min=l.left:a.x.max=l.right:cv(s)?a.y.min=l.top:a.y.max=l.bottom),a[t]}function b2(e,t,n){var i=e.context,r=e.shape,o=i.gridSnappingContext,a=o.snapLocation,s=o.snapOffset;return s&&ee(s[t])||(s||(s=o.snapOffset={}),ee(s[t])||(s[t]=0),!r)||(n.get(r.id)||(Gs(t)?s[t]+=r[t]+r.width/2:s[t]+=r[t]+r.height/2),!a)||(t==="x"?/left/.test(a)?s[t]-=r.width/2:/right/.test(a)&&(s[t]+=r.width/2):/top/.test(a)?s[t]-=r.height/2:/bottom/.test(a)&&(s[t]+=r.height/2)),s[t]}function Gs(e){return e==="x"}function cv(e){return e.indexOf("n")!==-1}function lv(e){return e.indexOf("w")!==-1}function $i(e,t){V.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=r.hints||{},a=o.autoResize;if(a){var s=r.shape,c=r.newBounds;Rt(a)?r.newBounds=n.snapComplex(c,a):r.newBounds=n.snapSimple(s,c)}})}$i.$inject=["eventBus","gridSnapping","modeling"],Y($i,V),$i.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},$i.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},$i.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),D(e,o),e},$i.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),D(e,o),e};var E2=2e3;function uv(e,t){e.on(["spaceTool.move","spaceTool.end"],E2,function(n){var i=n.context;if(i.initialized){var r=i.axis,o;r==="x"?(o=t.snapValue(n.dx),n.x=n.x+o-n.dx,n.dx=o):(o=t.snapValue(n.dy),n.y=n.y+o-n.dy,n.dy=o)}})}uv.$inject=["eventBus","gridSnapping"];const x2={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",$i],gridSnappingSpaceToolBehavior:["type",uv]}],__init__:["gridSnapping"],gridSnapping:["type",ui]};var w2=2e3;function pv(e,t,n){e.on("autoPlace",w2,function(i){var r=i.source,o=te(r),a=i.shape,s=Jh(r,a,n);return["x","y"].forEach(function(c){var l={};s[c]!==o[c]&&(s[c]>o[c]?l.min=s[c]:l.max=s[c],E(a,"bpmn:TextAnnotation")&&(S2(c)?l.offset=-a.width/2:l.offset=-a.height/2),s[c]=t.snapValue(s[c],l))}),s})}pv.$inject=["eventBus","gridSnapping","elementRegistry"];function S2(e){return e==="x"}var C2=1750;function fv(e,t,n){t.on(["create.start","shape.move.start"],C2,function(i){var r=i.context,o=r.shape,a=e.getRootElement();if(!(!E(o,"bpmn:Participant")||!E(a,"bpmn:Process")||!a.children.length)){var s=r.createConstraints;s&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))}})}fv.$inject=["canvas","eventBus","gridSnapping"];var R2=3e3;function Ks(e,t,n){V.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],R2,function(r){var o=r.context,a=o.connection,s=o.hints||{},c=a.waypoints;s.connectionStart||s.connectionEnd||s.createElementsBehavior===!1||T2(c)&&n.updateWaypoints(a,i.snapMiddleSegments(c))})}Ks.$inject=["eventBus","gridSnapping","modeling"],Y(Ks,V),Ks.prototype.snapMiddleSegments=function(e){var t=this._gridSnapping,n;e=e.slice();for(var i=1;i<e.length-2;i++)n=k2(t,e[i],e[i+1]),e[i]=n[0],e[i+1]=n[1];return e};function T2(e){return e.length>3}function P2(e){return e==="h"}function A2(e){return e==="v"}function k2(e,t,n){var i=xn(t,n),r={};return P2(i)&&(r.y=e.snapValue(t.y)),A2(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=D({},t,r),n=D({},n,r)),[t,n]}const M2={__depends__:[x2,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",pv],gridSnappingParticipantBehavior:["type",fv],gridSnappingLayoutConnectionBehavior:["type",Ks]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",sv]};var D2=30,dv=30;function Do(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(i){var r=i.element,o=i.gfx;if(E(r,"bpmn:Lane"))return n._createParticipantHit(r,o);if(E(r,"bpmn:Participant"))return fe(r)?n._createParticipantHit(r,o):n._createDefaultHit(r,o);if(E(r,"bpmn:SubProcess"))return fe(r)?n._createSubProcessHit(r,o):n._createDefaultHit(r,o)})}Do.$inject=["eventBus","interactionEvents"],Do.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},Do.prototype._createParticipantHit=function(e,t){this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height});var n=Je(e)?{width:D2,height:e.height}:{width:e.width,height:dv};return this._interactionEvents.createBoxHit(t,"all",n),!0},Do.prototype._createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"no-move",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:dv}),!0};const N2={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",Do]};function qs(e){e.invoke(nr,this)}Y(qs,nr),qs.$inject=["injector"],qs.prototype.registerBindings=function(e,t){nr.prototype.registerBindings.call(this,e,t);function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("selectElements",function(i){var r=i.keyEvent;if(e.isKey(["a","A"],r)&&e.isCmd(r))return t.trigger("selectElements"),!0}),n("find",function(i){var r=i.keyEvent;if(e.isKey(["f","F"],r)&&e.isCmd(r))return t.trigger("find"),!0}),n("spaceTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["s","S"],r))return t.trigger("spaceTool"),!0}),n("lassoTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["l","L"],r))return t.trigger("lassoTool"),!0}),n("handTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["h","H"],r))return t.trigger("handTool"),!0}),n("globalConnectTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["c","C"],r))return t.trigger("globalConnectTool"),!0}),n("directEditing",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["e","E"],r))return t.trigger("directEditing"),!0}),n("replaceElement",function(i){var r=i.keyEvent;if(!e.hasModifier(r)&&e.isKey(["r","R"],r))return t.trigger("replaceElement",r),!0})};const O2={__depends__:[al],__init__:["keyboardBindings"],keyboardBindings:["type",qs]};var I2={moveSpeed:1,moveSpeedAccelerated:10},B2=1500,hv="left",mv="up",gv="right",yv="down",L2={ArrowLeft:hv,Left:hv,ArrowUp:mv,Up:mv,ArrowRight:gv,Right:gv,ArrowDown:yv,Down:yv},$2={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function vv(e,t,n,i,r){var o=this;this._config=D({},I2,e||{}),t.addListener(B2,function(a){var s=a.keyEvent,c=L2[s.key];if(c&&!t.isCmd(s)){var l=t.isShift(s);return o.moveSelection(c,l),!0}}),this.moveSelection=function(a,s){var c=r.get();if(c.length){var l=this._config[s?"moveSpeedAccelerated":"moveSpeed"],u=$2[a](l),p=i.allowed("elements.move",{shapes:c});p&&n.moveElements(c,u)}}}vv.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const j2={__depends__:[al,tn],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",vv]};var _v=10;function No(e,t,n,i){this._dragging=i,this._rules=t;var r=this;function o(c,l){var u=c.shape,p=c.direction,d=c.resizeConstraints,h;c.delta=l,h=wT(u,p,l),c.newBounds=CT(h,d),c.canExecute=r.canResize(c)}function a(c){var l=c.resizeConstraints,u=c.minBounds;l===void 0&&(u===void 0&&(u=r.computeMinResizeBox(c)),c.resizeConstraints={min:Q(u)})}function s(c){var l=c.shape,u=c.canExecute,p=c.newBounds;if(u){if(p=Ff(p),!F2(l,p))return;n.resizeShape(l,p)}}e.on("resize.start",function(c){a(c.context)}),e.on("resize.move",function(c){var l={x:c.dx,y:c.dy};o(c.context,l)}),e.on("resize.end",function(c){s(c.context)})}No.prototype.canResize=function(e){var t=this._rules,n=Qt(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},No.prototype.activate=function(e,t,n){var i=this._dragging,r,o;if(typeof n=="string"&&(n={direction:n}),r=D({shape:t},n),o=r.direction,!o)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");i.init(e,bv(t,o),"resize",{autoActivate:!0,cursor:H2(o),data:{shape:t,context:r}})},No.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction,i,r;return i=e.minDimensions||{width:_v,height:_v},r=Wm(t,e.childrenBoxPadding),RT(n,t,i,r)},No.$inject=["eventBus","rules","modeling","dragging"];function F2(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function bv(e,t){var n=te(e),i=Q(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function H2(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var Ev="djs-resizing",xv="resize-not-ok",V2=500;function wv(e,t,n){function i(o){var a=o.shape,s=o.newBounds,c=o.frame;c||(c=o.frame=n.addFrame(a,t.getActiveLayer()),t.addMarker(a,Ev)),s.width>5&&q(c,{x:s.x,width:s.width}),s.height>5&&q(c,{y:s.y,height:s.height}),o.canExecute?me(c).remove(xv):me(c).add(xv)}function r(o){var a=o.shape,s=o.frame;s&&Ke(o.frame),t.removeMarker(a,Ev)}e.on("resize.move",V2,function(o){i(o.context)}),e.on("resize.cleanup",function(o){r(o.context)})}wv.$inject=["eventBus","canvas","previewSupport"];var Sv=-6,Cv=8,Rv=20,Oo="djs-resizer",z2=["n","w","s","e","nw","ne","se","sw"];function pi(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&A(a,xt(r.addResizer,r))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}pi.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(o){Xn(o)&&i.activate(o,e,n)}ae.bind(t,"mousedown",r),ae.bind(t,"touchstart",r)},pi.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=W2(i),a=X("g");me(a).add(Oo),me(a).add(Oo+"-"+e.id),me(a).add(Oo+"-"+i),ie(r,a);var s=X("rect");q(s,{x:-8/2+o.x,y:-8/2+o.y,width:Cv,height:Cv}),me(s).add(Oo+"-visual"),ie(a,s);var c=X("rect");return q(c,{x:-20/2+o.x,y:-20/2+o.y,width:Rv,height:Rv}),me(c).add(Oo+"-hit"),ie(a,c),da(a,t,n),a},pi.prototype.createResizer=function(e,t){var n=bv(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},pi.prototype.addResizer=function(e){var t=this;Se(e)||!this._resize.canResize({shape:e})||A(z2,function(n){t.createResizer(e,n)})},pi.prototype.removeResizers=function(){var e=this._getResizersParent();ta(e)},pi.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},pi.$inject=["eventBus","canvas","selection","resize"];function W2(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=6:e.indexOf("w")!==-1&&(t.x=Sv),e.indexOf("s")!==-1?t.y=6:e.indexOf("n")!==-1&&(t.y=Sv),t}const Tv={__depends__:[yn,Mn,dr],__init__:["resize","resizePreview","resizeHandles"],resize:["type",No],resizePreview:["type",wv],resizeHandles:["type",pi]};var U2=2e3;function Io(e,t,n,i,r,o,a){this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",function(c){s(c.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open","root.set","selection.changed"],function(){i.isActive()&&i.complete()}),e.on(["shape.remove","connection.remove"],U2,function(c){i.isActive(c.element)&&i.cancel()}),e.on(["commandStack.changed"],function(c){i.isActive()&&i.cancel()}),e.on("directEditing.activate",function(c){o.removeResizers()}),e.on("create.end",500,function(c){var l=c.context,u=l.shape,p=c.context.canExecute,d=c.isTouch;d||p&&(l.hints&&l.hints.createElementsBehavior===!1||s(u))}),e.on("autoPlace.end",500,function(c){s(c.shape)});function s(c,l){(l||ue(c,["bpmn:Task","bpmn:TextAnnotation","bpmn:Participant"])||ap(c))&&i.activate(c)}}Io.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Io.prototype.activate=function(e){var t=en(e);if(t!==void 0){var n={text:t},i=this.getEditingBBox(e);D(n,i);var r={},o=n.style||{};return D(o,{backgroundColor:null,border:null}),(ue(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||ap(e))&&D(r,{centerVertically:!0}),Ci(e)&&(D(r,{autoResize:!0}),D(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),E(e,"bpmn:TextAnnotation")&&(D(r,{resizable:!0,autoResize:!0}),D(o,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),D(n,{options:r,style:o}),n}},Io.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r={x:i.x+i.width/2,y:i.y+i.height/2},o={x:i.x,y:i.y},a=t.zoom(),s=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),l=c.fontSize*a,u=c.lineHeight,p=s.fontSize*a,d=s.lineHeight,h={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(E(e,"bpmn:Lane")||q2(e)){var m=Je(e),y=m?{width:i.height,height:30*a,x:i.x-i.height/2+15*a,y:r.y-30*a/2}:{width:i.width,height:30*a};D(o,y),D(h,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:m?"rotate(-90deg)":null})}if(K2(e)){var g=Je(e),w=g?{width:i.width,height:i.height}:{width:i.height,height:i.width,x:r.x-i.height/2,y:r.y-i.width/2};D(o,w),D(h,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:g?null:"rotate(-90deg)"})}(ue(e,["bpmn:Task","bpmn:CallActivity"])||ap(e))&&(D(o,{width:i.width,height:i.height}),D(h,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),G2(e)&&(D(o,{width:i.width,x:i.x}),D(h,{fontSize:p+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var C=90*a,x=7*a,b=4*a;if(n.labelTarget&&(D(o,{width:C,height:i.height+x+b,x:r.x-C/2,y:i.y-x}),D(h,{fontSize:l+"px",lineHeight:u,paddingTop:x+"px",paddingBottom:b+"px"})),Ci(n)&&!_a(n)&&!ge(n)){var S=el(e),P=t.getAbsoluteBBox({x:S.x,y:S.y,width:0,height:0}),M=l+x+b;D(o,{width:C,height:M,x:P.x-C/2,y:P.y-M/2}),D(h,{fontSize:l+"px",lineHeight:u,paddingTop:x+"px",paddingBottom:b+"px"})}return E(e,"bpmn:TextAnnotation")&&(D(o,{width:i.width,height:i.height,minWidth:30*a,minHeight:10*a}),D(h,{textAlign:"left",paddingTop:5*a+"px",paddingBottom:7*a+"px",paddingLeft:7*a+"px",paddingRight:5*a+"px",fontSize:p+"px",lineHeight:d})),{bounds:o,style:h}},Io.prototype.update=function(e,t,n,i){var r,o;E(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),Y2(t)&&(t=null),this._modeling.updateLabel(e,t,r)};function ap(e){return E(e,"bpmn:SubProcess")&&!fe(e)}function G2(e){return E(e,"bpmn:SubProcess")&&fe(e)}function K2(e){return E(e,"bpmn:Participant")&&!fe(e)}function q2(e){return E(e,"bpmn:Participant")&&fe(e)}function Y2(e){return!e||!e.trim()}var Pv="djs-element-hidden",Av="djs-label-hidden";function kv(e,t,n){var i=this,r=t.getDefaultLayer(),o,a,s;e.on("directEditing.activate",function(c){var l=c.active;if(o=l.element.label||l.element,E(o,"bpmn:TextAnnotation")){a=t.getAbsoluteBBox(o),s=X("g");var u=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:o.height,position:{mx:0,my:0}}),p=i.path=X("path");q(p,{d:u,strokeWidth:2,stroke:X2(o)}),ie(s,p),ie(r,s),ot(s,o.x,o.y)}E(o,"bpmn:TextAnnotation")||o.labelTarget?t.addMarker(o,Pv):(E(o,"bpmn:Task")||E(o,"bpmn:CallActivity")||E(o,"bpmn:SubProcess")||E(o,"bpmn:Participant")||E(o,"bpmn:Lane"))&&t.addMarker(o,Av)}),e.on("directEditing.resize",function(c){if(E(o,"bpmn:TextAnnotation")){var l=c.height,u=c.dy,p=Math.max(o.height/a.height*(l+u),0),d=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:o.width,containerHeight:p,position:{mx:0,my:0}});q(i.path,{d})}}),e.on(["directEditing.complete","directEditing.cancel"],function(c){var l=c.active;l&&(t.removeMarker(l.element.label||l.element,Pv),t.removeMarker(o,Av)),o=void 0,a=void 0,s&&(Ke(s),s=void 0)})}kv.$inject=["eventBus","canvas","pathMap"];function X2(e,t){var n=ye(e);return n.get("stroke")||t||"black"}const Z2={__depends__:[nl,Tv,Qy],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Io],labelEditingPreview:["type",kv]};var J2=new Kr("tt");function Q2(e){var t=Pe('<div class="djs-tooltip-container" />');return ut(t,{position:"absolute",width:"0",height:"0"}),e.insertBefore(t,e.firstChild),t}function eM(e,t,n){ut(e,{left:t+"px",top:n+"px"})}function sp(e,t){e.style.display=t===!1?"none":""}var Mv="djs-tooltip",cp="."+Mv;function St(e,t){this._eventBus=e,this._canvas=t,this._ids=J2,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=Q2(t.getContainer());var n=this;Pt.bind(this._tooltipRoot,cp,"mousedown",function(i){i.stopPropagation()}),Pt.bind(this._tooltipRoot,cp,"mouseover",function(i){n.trigger("mouseover",i)}),Pt.bind(this._tooltipRoot,cp,"mouseout",function(i){n.trigger("mouseout",i)}),this._init()}St.$inject=["eventBus","canvas"],St.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=D({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},St.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(pt(n,"data-tooltip-id"));i&&(e==="mouseover"&&i.timeout&&this.clearTimeout(i),e==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},St.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},St.prototype.clearTimeout=function(e){if(e=this.get(e),!!e){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},St.prototype.setTimeout=function(e){if(e=this.get(e),!!e){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},St.prototype.remove=function(e){var t=this.get(e);t&&(un(t.html),un(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},St.prototype.show=function(){sp(this._tooltipRoot)},St.prototype.hide=function(){sp(this._tooltipRoot,!1)},St.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},St.prototype._addTooltip=function(e){var t=e.id,n=e.html,i,r=this._tooltipRoot;n.get&&n.constructor.prototype.jquery&&(n=n.get(0)),Rt(n)&&(n=Pe(n)),i=Pe('<div data-tooltip-id="'+t+'" class="'+Mv+'">'),ut(i,{position:"absolute"}),i.appendChild(n),e.type&&Ie(i).add("djs-tooltip-"+e.type),e.className&&Ie(i).add(e.className),e.htmlContainer=i,r.appendChild(i),this._tooltips[t]=e,this._updateTooltip(e)},St.prototype._updateTooltip=function(e){var t=e.position,n=e.htmlContainer;eM(n,t.x,t.y)},St.prototype._updateTooltipVisibilty=function(e){A(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),sp(i,r))})},St.prototype._init=function(){var e=this;function t(n){e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()}this._eventBus.on("canvas.viewbox.changing",function(n){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(n){t(n.viewbox)})};const tM={__init__:["tooltips"],tooltips:["type",St]};var nM="flow elements must be children of pools/participants",iM="Data object must be placed within a pool/participant.";function Dv(e,t,n){function i(r,o,a){t.add({position:{x:r.x+5,y:r.y+5},type:"error",timeout:2e3,html:"<div>"+o+"</div>"})}e.on(["shape.move.rejected","create.rejected"],function(r){var o=r.context,a=o.shape,s=o.target;E(s,"bpmn:Collaboration")&&(E(a,"bpmn:FlowNode")?i(r,n(nM)):E(a,"bpmn:DataObjectReference")&&i(r,n(iM)))})}Dv.$inject=["eventBus","tooltips","translate"];const rM={__depends__:[tM],__init__:["modelingFeedback"],modelingFeedback:["type",Dv]};var oM=500,aM=1e3;function ji(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),i=this;function r(o){var a=X("rect");return q(a,D({x:0,y:0,rx:4,width:100,height:100},n)),a}e.on(["shape.added","shape.changed"],oM,function(o){var a=o.element,s=o.gfx,c=we(".djs-outline",s);c||(c=i.getOutline(a)||r(),ie(s,c)),i.updateShapeOutline(c,a)}),e.on(["connection.added","connection.changed"],function(o){var a=o.element,s=o.gfx,c=we(".djs-outline",s);c||(c=r(),ie(s,c)),i.updateConnectionOutline(c,a)})}ji.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&A(i,function(r){n=n||r.updateOutline(t,e)}),n||q(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})},ji.prototype.updateConnectionOutline=function(e,t){var n=qe(t);q(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})},ji.prototype.registerProvider=function(e,t){t||(t=e,e=aM),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})},ji.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ji.prototype.getOutline=function(e){var t,n=this._getProviders();return A(n,function(i){Ue(i.getOutline)&&(t=t||i.getOutline(e))}),t},ji.$inject=["eventBus","styles","elementRegistry"];var Ys=6;function lp(e,t,n){this._canvas=t;var i=this;e.on("element.changed",function(r){n.isSelected(r.element)&&i._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(r){var o=r.newSelection;i._updateMultiSelectionOutline(o)})}lp.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");ta(t);var n=e.length>1,i=this._canvas.getContainer();if(me(i)[n?"add":"remove"]("djs-multi-select"),!!n){var r=sM(qe(e)),o=X("rect");q(o,D({rx:3},r)),me(o).add("djs-selection-outline"),ie(t,o)}},lp.$inject=["eventBus","canvas","selection"];function sM(e){return{x:e.x-Ys,y:e.y-Ys,width:e.width+Ys*2,height:e.height+Ys*2}}const Nv={__depends__:[tn],__init__:["outline","multiSelectionOutline"],outline:["type",ji],multiSelectionOutline:["type",lp]};var cM=500,lM=1250,uM=1500,Xs=Math.round;function pM(e){return{x:e.x+Xs(e.width/2),y:e.y+Xs(e.height/2)}}function Ov(e,t,n,i,r){function o(s,c,l,u){return r.allowed("elements.move",{shapes:s,delta:c,position:l,target:u})}e.on("shape.move.start",uM,function(s){var c=s.context,l=s.shape,u=i.get().slice();u.indexOf(l)===-1&&(u=[l]),u=fM(u),D(c,{shapes:u,validatedShapes:u,shape:l})}),e.on("shape.move.start",lM,function(s){var c=s.context,l=c.validatedShapes,u;if(u=c.canExecute=o(l),!u)return!1}),e.on("shape.move.move",cM,function(s){var c=s.context,l=c.validatedShapes,u=s.hover,p={x:s.dx,y:s.dy},d={x:s.x,y:s.y},h;if(h=o(l,p,d,u),c.delta=p,c.canExecute=h,h===null){c.target=null;return}c.target=u}),e.on("shape.move.end",function(s){var c=s.context,l=c.delta,u=c.canExecute,p=u==="attach",d=c.shapes;if(u===!1)return!1;l.x=Xs(l.x),l.y=Xs(l.y),!(l.x===0&&l.y===0)&&n.moveElements(d,l,c.target,{primaryShape:c.shape,attach:p})}),e.on("element.mousedown",function(s){if(Xn(s)){var c=er(s);if(!c)throw new Error("must supply DOM mousedown event");return a(c,s.element)}});function a(s,c,l,u){if(tt(l)&&(u=l,l=!1),!(c.waypoints||!c.parent)&&!me(s.target).has("djs-hit-no-move")){var p=pM(c);return t.init(s,p,"shape.move",{cursor:"grabbing",autoActivate:l,data:{shape:c,context:u||{}}}),!0}}this.start=a}Ov.$inject=["eventBus","dragging","modeling","selection","rules"];function fM(e){var t=Wi(e,"id");return le(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}var Iv=499,up="djs-dragging",Bv="drop-ok",Lv="drop-not-ok",$v="new-parent",jv="attach-ok";function Fv(e,t,n,i){function r(c){var l=o(c),u=dM(l);return u}function o(c){var l=Or(c,!0),u=l.flatMap(h=>(h.incoming||[]).concat(h.outgoing||[])),p=l.concat(u),d=[...new Set(p)];return d}function a(c,l){[jv,Bv,Lv,$v].forEach(function(u){u===l?t.addMarker(c,u):t.removeMarker(c,u)})}function s(c,l,u){i.addDragger(l,c.dragGroup),u&&t.addMarker(l,up),c.allDraggedElements?c.allDraggedElements.push(l):c.allDraggedElements=[l]}e.on("shape.move.start",Iv,function(c){var l=c.context,u=l.shapes,p=l.allDraggedElements,d=r(u);if(!l.dragGroup){var h=X("g");q(h,n.cls("djs-drag-group",["no-events"]));var m=t.getActiveLayer();ie(m,h),l.dragGroup=h}d.forEach(function(y){i.addDragger(y,l.dragGroup)}),p?p=xc([p,o(u)]):p=o(u),A(p,function(y){t.addMarker(y,up)}),l.allDraggedElements=p,l.differentParents=hM(u)}),e.on("shape.move.move",Iv,function(c){var l=c.context,u=l.dragGroup,p=l.target,d=l.shape.parent,h=l.canExecute;p&&(h==="attach"?a(p,jv):l.canExecute&&d&&p.id!==d.id?a(p,$v):a(p,l.canExecute?Bv:Lv)),ot(u,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var l=c.context,u=l.target;u&&a(u,null)}),e.on("shape.move.cleanup",function(c){var l=c.context,u=l.allDraggedElements,p=l.dragGroup;A(u,function(d){t.removeMarker(d,up)}),p&&Ke(p)}),this.makeDraggable=s}Fv.$inject=["eventBus","canvas","styles","previewSupport"];function dM(e){var t=le(e,function(n){return Se(n)?_e(e,Jt({id:n.source.id}))&&_e(e,Jt({id:n.target.id})):!0});return t}function hM(e){return TE(Wi(e,function(t){return t.parent&&t.parent.id}))!==1}const mM={__depends__:[Ma,tn,Nv,yn,Mn,dr],__init__:["move","movePreview"],move:["type",Ov],movePreview:["type",Fv]};var Hv=".djs-palette-toggle",Vv=".entry",gM=Hv+", "+Vv,pp="djs-palette-",yM="shown",fp="open",zv="two-column",vM=1e3;function ze(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(i){var r=i.tool;n.updateToolHighlight(r)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}ze.$inject=["eventBus","canvas"],ze.prototype.registerProvider=function(e,t){t||(t=e,e=vM),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()},ze.prototype.getEntries=function(){var e=this._getProviders();return e.reduce(bM,{})},ze.prototype._rebuild=function(){if(this._diagramInitialized){var e=this._getProviders();e.length&&(this._container||this._init(),this._update())}},ze.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=Pe(ze.HTML_MARKUP);n.appendChild(i),Ie(n).add(pp+yM),Pt.bind(i,gM,"click",function(r){var o=r.delegateTarget;if(uf(o,Hv))return e.toggle();e.trigger("click",r)}),ae.bind(i,"mousedown",function(r){r.stopPropagation()}),Pt.bind(i,Vv,"dragstart",function(r){e.trigger("dragstart",r)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},ze.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},ze.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,i=this._eventBus,r,o=Ie(n),a=Ie(t);"twoColumn"in e?r=e.twoColumn:r=this._needsCollapse(t.clientHeight,this._entries||{}),o.toggle(zv,r),a.toggle(pp+zv,r),"open"in e&&(o.toggle(fp,e.open),a.toggle(pp+fp,e.open)),i.fire("palette.changed",{twoColumn:r,open:this.isOpen()})},ze.prototype._update=function(){var e=we(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Zo(e),A(t,function(n,i){var r=n.group||"default",o=we("[data-group="+qr(r)+"]",e);o||(o=Pe('<div class="group"></div>'),pt(o,"data-group",r),e.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),s=Pe(a);if(o.appendChild(s),!n.separator&&(pt(s,"data-action",i),n.title&&pt(s,"title",n.title),n.className&&_M(s,n.className),n.imageUrl)){var c=Pe("<img>");pt(c,"src",n.imageUrl),s.appendChild(c)}}),this.open()},ze.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=pt(o,"data-action"),r=t.originalEvent||t,this.triggerEntry(i,e,r,n)):t.preventDefault()},ze.prototype.triggerEntry=function(e,t,n,i){var r=this._entries,o,a;if(o=r[e],!!o&&(a=o.action,this._eventBus.fire("palette.trigger",{entry:o,event:n})!==!1)){if(Ue(a)){if(t==="click")return a(n,i)}else if(a[t])return a[t](n,i);n.preventDefault()}},ze.prototype._layoutChanged=function(){this._toggleState({})},ze.prototype._needsCollapse=function(e,t){var n=50,i=Object.keys(t).length*46;return e<i+n},ze.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},ze.prototype.open=function(){this._toggleState({open:!0})},ze.prototype.toggle=function(){this.isOpen()?this.close():this.open()},ze.prototype.isActiveTool=function(e){return e&&this._activeTool===e},ze.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=we(".djs-palette-entries",this._container),this._toolsContainer=we("[data-group=tools]",t)),n=this._toolsContainer,A(n.children,function(i){var r=i.getAttribute("data-action");if(r){var o=Ie(i);r=r.replace("-tool",""),o.contains("entry")&&r===e?o.add("highlighted-entry"):o.remove("highlighted-entry")}})},ze.prototype.isOpen=function(){return Ie(this._container).has(fp)},ze.prototype._getParentContainer=function(){return this._canvas.getContainer()},ze.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function _M(e,t){var n=Ie(e),i=oe(t)?t:t.split(/\s+/g);i.forEach(function(r){n.add(r)})}function bM(e,t){var n=t.getPaletteEntries();return Ue(n)?n(e):(A(n,function(i,r){e[r]=i}),e)}const EM={__init__:["palette"],palette:["type",ze]};var Wv="crosshair";function Fi(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var s=this,c={create:function(l){var u=t.getActiveLayer(),p;p=l.frame=X("rect"),q(p,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),ie(u,p)},update:function(l){var u=l.frame,p=l.bbox;q(u,{x:p.x,y:p.y,width:p.width,height:p.height})},remove:function(l){l.frame&&Ke(l.frame)}};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(l){var u=l.originalEvent.target;!l.hover&&!(u instanceof SVGElement)||e.once("lasso.selection.ended",function(){s.activateLasso(l.originalEvent,!0)})}),e.on("lasso.end",0,function(l){var u=l.context,p=dp(l),d=i.filter(function(m){return m}),h=Aa(l);s.select(d,p,h?u.selection:[])}),e.on("lasso.start",function(l){var u=l.context;u.bbox=dp(l),c.create(u),u.selection=r.get()}),e.on("lasso.move",function(l){var u=l.context;u.bbox=dp(l),c.update(u)}),e.on("lasso.cleanup",function(l){var u=l.context;c.remove(u)}),e.on("element.mousedown",1500,function(l){if(Aa(l))return s.activateLasso(l.originalEvent),!0})}Fi.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Fi.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:Wv,data:{context:{}}})},Fi.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:Wv,data:{context:{}},keepSelection:!0})},Fi.prototype.select=function(e,t,n=[]){var i=Sf(e,t);this._selection.select([...n,...Yo(i)])},Fi.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Fi.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};function dp(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y},i;return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?i={x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?i={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?i={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?i={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:i={x:n.x,y:n.y,width:0,height:0},i}const xM={__depends__:[ws,po],__init__:["lassoTool"],lassoTool:["type",Fi]};var hp=1500,Uv="grab";function xr(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,s=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",hp,function(c){if(Yr(c))return a.activateMove(c.originalEvent,!0),!1}),s&&s.addListener(hp,function(c){if(!(!Gv(c.keyEvent)||a.isActive())){var l=a._mouse.getLastMoveEvent();a.activateMove(l,!!l)}},"keyboard.keydown"),s&&s.addListener(hp,function(c){!Gv(c.keyEvent)||!a.isActive()||a.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var l=c.originalEvent.target;if(!c.hover&&!(l instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var l=t.viewbox().scale;t.scroll({dx:c.dx*l,dy:c.dy*l})}),e.on("hand.move.end",function(c){var l=c.context,u=l.reactivate;return!Yr(c)&&u&&e.once("hand.move.ended",function(p){a.activateHand(p.originalEvent,!0,!0)}),!1})}xr.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],xr.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Uv,data:{context:n||{}}})},xr.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Uv,data:{context:{reactivate:n}}})},xr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},xr.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function Gv(e){return it("Space",e)}const wM={__depends__:[ws,po],__init__:["handTool"],handTool:["type",xr]};var Kv="connect-ok",qv="connect-not-ok";function wr(e,t,n,i,r,o,a){var s=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var l=c.context,u=c.hover,p=l.canStartConnect=s.canStartConnect(u);p!==null&&(l.startTarget=u,i.addMarker(u,p?Kv:qv))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var l=c.context.startTarget,u=c.context.canStartConnect;l&&i.removeMarker(l,u?Kv:qv)}),e.on(["global-connect.ended"],function(c){var l=c.context,u=l.startTarget,p={x:c.x,y:c.y},d=s.canStartConnect(u);if(d)return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,u,p)}),!1})}wr.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],wr.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},wr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},wr.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},wr.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};const SM={__depends__:[Ll,yn,Mn,ws,po],globalConnect:["type",wr]};function mp(e,t,n,i,r,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}mp.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],mp.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,i=this._spaceTool,r=this._lassoTool,o=this._handTool,a=this._globalConnect,s=this._translate;function c(p,d,h,m,y){function g(w){var C=n.createShape(D({type:p},y));t.start(w,C)}return{group:d,className:h,title:m,action:{dragstart:g,click:g}}}function l(p){var d=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),h=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:d});t.start(p,[d,h],{hints:{autoSelect:[d]}})}function u(p){t.start(p,n.createParticipantShape())}return D(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:s("Activate hand tool"),action:{click:function(p){o.activateHand(p)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:s("Activate lasso tool"),action:{click:function(p){r.activateSelection(p)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:s("Activate create/remove space tool"),action:{click:function(p){i.activateSelection(p)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:s("Activate global connect tool"),action:{click:function(p){a.start(p)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":c("bpmn:StartEvent","event","bpmn-icon-start-event-none",s("Create start event")),"create.intermediate-event":c("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",s("Create intermediate/boundary event")),"create.end-event":c("bpmn:EndEvent","event","bpmn-icon-end-event-none",s("Create end event")),"create.exclusive-gateway":c("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",s("Create gateway")),"create.task":c("bpmn:Task","activity","bpmn-icon-task",s("Create task")),"create.data-object":c("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",s("Create data object reference")),"create.data-store":c("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",s("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:s("Create expanded sub-process"),action:{dragstart:l,click:l}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:s("Create pool/participant"),action:{dragstart:u,click:u}},"create.group":c("bpmn:Group","artifact","bpmn-icon-group",s("Create group"))}),e};const CM={__depends__:[EM,Es,dy,xM,wM,SM,wa],__init__:["paletteProvider"],paletteProvider:["type",mp]};var RM=250;function gp(e,t,n,i,r){V.call(this,e);function o(s){var c=s.canExecute.replacements;A(c,function(l){var u=l.oldElementId,p={type:l.newElementType};if(!s.visualReplacements[u]){var d=t.get(u);D(p,{x:d.x,y:d.y});var h=n.createShape(p);i.addShape(h,d.parent);var m=we('[data-element-id="'+qr(d.id)+'"]',s.dragGroup);m&&q(m,{display:"none"});var y=r.addDragger(h,s.dragGroup);s.visualReplacements[u]=y,i.removeShape(h)}})}function a(s){var c=s.visualReplacements;A(c,function(l,u){var p=we('[data-element-id="'+qr(u)+'"]',s.dragGroup);p&&q(p,{display:"inline"}),l.remove(),c[u]&&delete c[u]})}e.on("shape.move.move",RM,function(s){var c=s.context,l=c.canExecute;c.visualReplacements||(c.visualReplacements={}),l&&l.replacements?o(c):a(c)})}gp.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],Y(gp,V);const TM={__depends__:[dr],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",gp]};var PM=1250,yp=40,AM=20,kM=10,Yv=20,Xv=["x","y"],MM=Math.abs;function Zv(e){e.on(["connect.hover","connect.move","connect.end"],PM,function(t){var n=t.context,i=n.canExecute,r=n.start,o=n.hover,a=n.source,s=n.target;t.originalEvent&&Ft(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),i&&o&&DM(t,o,BM(o)),o&&IM(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Vt(r),ue(o,["bpmn:Event","bpmn:Gateway"])&&Jv(t,Vt(o)),ue(o,["bpmn:Task","bpmn:SubProcess"])&&NM(t,o),E(a,"bpmn:BoundaryEvent")&&s===a.host&&OM(t)):Qv(i,"bpmn:MessageFlow")?(E(r,"bpmn:Event")&&(n.connectionStart=Vt(r)),E(o,"bpmn:Event")&&Jv(t,Vt(o))):n.connectionStart=n.initialConnectionStart)})}Zv.$inject=["eventBus"];function DM(e,t,n){Xv.forEach(function(i){var r=e_(i,t);e[i]<t[i]+n?Ve(e,i,t[i]+n):e[i]>t[i]+r-n&&Ve(e,i,t[i]+r-n)})}function NM(e,t){var n=Vt(t);Xv.forEach(function(i){LM(e,t,i)&&Ve(e,i,n[i])})}function OM(e){var t=e.context,n=t.source,i=t.target;if(!$M(t)){var r=Vt(n),o=ft(r,i,-10),a=[];/top|bottom/.test(o)&&a.push("x"),/left|right/.test(o)&&a.push("y"),a.forEach(function(s){var c=e[s],l;MM(c-r[s])<yp&&(c>r[s]?l=r[s]+yp:l=r[s]-yp,Ve(e,s,l))})}}function Jv(e,t){Ve(e,"x",t.x),Ve(e,"y",t.y)}function Qv(e,t){return e&&e.type===t}function IM(e,t){return jn(t,function(n){return Qv(e,n)})}function e_(e,t){return e==="x"?t.width:t.height}function BM(e){return E(e,"bpmn:Task")?kM:AM}function LM(e,t,n){return e[n]>t[n]+Yv&&e[n]<t[n]+e_(n,t)-Yv}function $M(e){var t=e.hover,n=e.source;return t&&n&&t===n}function fi(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}fi.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},fi.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},fi.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},fi.prototype.getSnapLocations=function(){return this._snapLocations},fi.prototype.setSnapLocations=function(e){this._snapLocations=e},fi.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new Zs,n.initDefaults(this._defaultSnaps)),n};function Zs(){this._snapValues={}}Zs.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)},Zs.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&qR(e[n],r[n],i)},Zs.prototype.initDefaults=function(e){var t=this;A(e||{},function(n,i){A(n,function(r){t.add(i,r)})})};var jM=1250;function _n(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(r){i.initSnap(r)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],jM,function(r){var o=r.context,a=o.shape,s=o.snapContext,c=o.target;if(!(r.originalEvent&&Ft(r.originalEvent))&&!(fr(r)||!c)){var l=s.pointsForTarget(c);l.initialized||(l=i.addSnapTargetPoints(l,a,c),l.initialized=!0),n.snap(r,l)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}_n.$inject=["elementRegistry","eventBus","snapping"],_n.prototype.initSnap=function(e){var t=this._elementRegistry,n=e.context,i=n.shape,r=n.snapContext;r||(r=n.snapContext=new fi);var o;t.get(i.id)?o=Vt(i,e):o={x:e.x+Vt(i).x,y:e.y+Vt(i).y};var a={x:o.x-i.width/2,y:o.y-i.height/2},s={x:o.x+i.width/2,y:o.y+i.height/2};return r.setSnapOrigin("mid",{x:o.x-e.x,y:o.y-e.y}),ge(i)||(r.setSnapOrigin("top-left",{x:a.x-e.x,y:a.y-e.y}),r.setSnapOrigin("bottom-right",{x:s.x-e.x,y:s.y-e.y})),r},_n.prototype.addSnapTargetPoints=function(e,t,n){var i=this.getSnapTargets(t,n);return A(i,function(r){if(ge(r)){ge(t)&&e.add("mid",Vt(r));return}if(Se(r)){if(r.waypoints.length<3)return;var o=r.waypoints.slice(1,-1);A(o,function(a){e.add("mid",a)});return}e.add("mid",Vt(r))}),!ee(t.x)||!ee(t.y)||this._elementRegistry.get(t.id)&&e.add("mid",Vt(t)),e},_n.prototype.getSnapTargets=function(e,t){return Am(t).filter(function(n){return!FM(n)})};function FM(e){return!!e.hidden}var t_=1500;function Sr(e,t){t.invoke(_n,this),e.on(["create.move","create.end"],t_,WM),e.on(["create.move","create.end","shape.move.move","shape.move.end"],t_,function(n){var i=n.context,r=i.canExecute,o=i.target,a=r&&(r==="attach"||r.attach);a&&!fr(n)&&HM(n,o)})}Y(Sr,_n),Sr.$inject=["eventBus","injector"],Sr.prototype.initSnap=function(e){var t=_n.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return A(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,t.setSnapOrigin(r.id+"-docking",i_(o,i,e))}),A(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,t.setSnapOrigin(r.id+"-docking",i_(o,i,e))}),E(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},Sr.prototype.addSnapTargetPoints=function(e,t,n){_n.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);A(i,function(o){(zM(o)||VM([t,o],"bpmn:TextAnnotation"))&&(e.add("top-left",Tm(o)),e.add("bottom-right",Pm(o)))});var r=this._elementRegistry;return A(t.incoming,function(o){if(r.get(t.id)){n_(i,o.source)||e.add("mid",te(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),A(t.outgoing,function(o){if(r.get(t.id)){n_(i,o.target)||e.add("mid",te(o.target));var a=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",a.original||a)}}),E(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},Sr.prototype.getSnapTargets=function(e,t){return _n.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!E(n,"bpmn:Lane")})};function HM(e,t){var n=Q(t),i=Rg(e,t),r=e.context,o=r.shape,a;o.parent?a={x:0,y:0}:a=te(o),/top/.test(i)?Ve(e,"y",n.top-a.y):/bottom/.test(i)&&Ve(e,"y",n.bottom-a.y),/left/.test(i)?Ve(e,"x",n.left-a.x):/right/.test(i)&&Ve(e,"x",n.right-a.x)}function VM(e,t){return e.every(function(n){return E(n,t)})}function zM(e){return E(e,"bpmn:SubProcess")&&fe(e)?!0:E(e,"bpmn:Participant")}function WM(e){var t=e.context,n=t.createConstraints;if(n){var i=n.top,r=n.right,o=n.bottom,a=n.left;(a&&a>=e.x||r&&r<=e.x)&&Ve(e,"x",e.x),(i&&i>=e.y||o&&o<=e.y)&&Ve(e,"y",e.y)}}function n_(e,t){return e.indexOf(t)!==-1}function i_(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}var UM=1250;function Bo(e,t){var n=this;e.on(["resize.start"],function(i){n.initSnap(i)}),e.on(["resize.move","resize.end"],UM,function(i){var r=i.context,o=r.shape,a=o.parent,s=r.direction,c=r.snapContext;if(!(i.originalEvent&&Ft(i.originalEvent))&&!fr(i)){var l=c.pointsForTarget(a);l.initialized||(l=n.addSnapTargetPoints(l,o,a,s),l.initialized=!0),qM(s)&&Ve(i,"x",i.x),YM(s)&&Ve(i,"y",i.y),t.snap(i,l)}}),e.on(["resize.cleanup"],function(){t.hide()})}Bo.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new fi);var o=r_(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},Bo.prototype.addSnapTargetPoints=function(e,t,n,i){var r=this.getSnapTargets(t,n);return A(r,function(o){e.add("corner",Pm(o)),e.add("corner",Tm(o))}),e.add("corner",r_(t,i)),e},Bo.$inject=["eventBus","snapping"],Bo.prototype.getSnapTargets=function(e,t){return Am(t).filter(function(n){return!GM(n,e)&&!Se(n)&&!KM(n)&&!ge(n)})};function r_(e,t){var n=te(e),i=Q(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}function GM(e,t){return e.host===t}function KM(e){return!!e.hidden}function qM(e){return e==="n"||e==="s"}function YM(e){return e==="e"||e==="w"}var XM=7,ZM=1e3;function di(e){this._canvas=e,this._asyncHide=of(xt(this.hide,this),ZM)}di.$inject=["canvas"],di.prototype.snap=function(e,t){var n=e.context,i=n.snapContext,r=i.getSnapLocations(),o={x:fr(e,"x"),y:fr(e,"y")};A(r,function(a){var s=i.getSnapOrigin(a),c={x:e.x+s.x,y:e.y+s.y};if(A(["x","y"],function(l){var u;o[l]||(u=t.snap(c,a,l,XM),u!==void 0&&(o[l]={value:u,originValue:u-s[l]}))}),o.x&&o.y)return!1}),this.showSnapLine("vertical",o.x&&o.x.value),this.showSnapLine("horizontal",o.y&&o.y.value),A(["x","y"],function(a){var s=o[a];tt(s)&&Ve(e,a,s.originValue)})},di.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=X("path");return q(n,{d:"M0,0 L0,0"}),me(n).add("djs-snap-line"),ie(t,n),{update:function(i){ee(i)?e==="horizontal"?q(n,{d:"M-100000,"+i+" L+100000,"+i,display:""}):q(n,{d:"M "+i+",-100000 L "+i+", +100000",display:""}):q(n,{display:"none"})}}},di.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},di.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},di.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},di.prototype.hide=function(){A(this._snapLines,function(e){e.update()})};const JM={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",_n],resizeSnapping:["type",Bo],snapping:["type",di]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Zv],createMoveSnapping:["type",Sr]};var o_=300;function re(e,t,n,i){this._open=!1,this._results={},this._eventMaps=[],this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._canvas=e,this._eventBus=t,this._selection=n,this._translate=i,this._container=this._getBoxHtml(),this._searchInput=we(re.INPUT_SELECTOR,this._container),this._resultsContainer=we(re.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}re.$inject=["canvas","eventBus","selection","translate"],re.prototype._bindEvents=function(){var e=this;function t(n,i,r,o){e._eventMaps.push({el:n,type:r,listener:Pt.bind(n,i,r,o)})}t(document,"html","click",function(n){e.close(!1)}),t(this._container,re.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,re.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,re.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,re.INPUT_SELECTOR,"keydown",function(n){it("ArrowUp",n)&&n.preventDefault(),it("ArrowDown",n)&&n.preventDefault()}),t(this._container,re.INPUT_SELECTOR,"keyup",function(n){if(it("Escape",n))return e.close();if(it("Enter",n)){var i=e._getCurrentResult();return i?e._select(i):e.close(!1)}if(it("ArrowUp",n))return e._scrollToDirection(!0);if(it("ArrowDown",n))return e._scrollToDirection();it(["ArrowLeft","ArrowRight"],n)||e._search(n.delegateTarget.value)})},re.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){Pt.unbind(e.el,e.type,e.listener)})},re.prototype._search=function(e){var t=this;if(this._clearResults(),!!e.trim()){var n=this._searchProvider.find(e);if(n=n.filter(function(r){return!t._canvas.getRootElements().includes(r.element)}),!n.length){this._selection.select(null);return}n.forEach(function(r){var o=r.element.id,a=t._createResultNode(r,o);t._results[o]={element:r.element,node:a}});var i=we(re.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}},re.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},re.prototype._scrollToNode=function(e){if(!(!e||e===this._getCurrentResult())){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<i&&(this._resultsContainer.scrollTop=i)}},re.prototype._clearResults=function(){Zo(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")},re.prototype._getCurrentResult=function(){return we(re.RESULT_SELECTED_SELECTOR,this._resultsContainer)},re.prototype._createResultNode=function(e,t){var n=Pe(re.RESULT_HTML);return e.primaryTokens.length>0&&a_(n,e.primaryTokens,re.RESULT_PRIMARY_HTML),a_(n,e.secondaryTokens,re.RESULT_SECONDARY_HTML),pt(n,re.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},re.prototype.registerProvider=function(e){this._searchProvider=e},re.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._cachedRootElement=this._canvas.getRootElement(),this._cachedSelection=this._selection.get(),this._cachedViewbox=this._canvas.viewbox(),this._selection.select(null),this._bindEvents(),this._open=!0,Ie(this._canvas.getContainer()).add("djs-search-open"),Ie(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},re.prototype.close=function(e=!0){this.isOpen()&&(e&&(this._cachedRootElement&&this._canvas.setRootElement(this._cachedRootElement),this._cachedSelection&&this._selection.select(this._cachedSelection),this._cachedViewbox&&this._canvas.viewbox(this._cachedViewbox),this._eventBus.fire("searchPad.restored")),this._cachedRootElement=null,this._cachedSelection=null,this._cachedViewbox=null,this._unbindEvents(),this._open=!1,Ie(this._canvas.getContainer()).remove("djs-search-open"),Ie(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())},re.prototype.toggle=function(){this.isOpen()?this.close():this.open()},re.prototype.isOpen=function(){return this._open},re.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&Ie(t).remove(re.RESULT_SELECTED_CLASS);var n=pt(e,re.RESULT_ID_ATTRIBUTE),i=this._results[n].element;Ie(e).add(re.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(i,{top:o_}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},re.prototype._select=function(e){var t=pt(e,re.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:o_}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},re.prototype._getBoxHtml=function(){const e=Pe(re.BOX_HTML),t=we(re.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e};function a_(e,t,n){var i=QM(t),r=Pe(n);r.innerHTML=i,e.appendChild(r)}function QM(e){var t="";return e.forEach(function(n){var i=Od(n.value||n.matched||n.normal),r=n.match||n.matched;r?t+='<b class="'+re.RESULT_HIGHLIGHT_CLASS+'">'+i+"</b>":t+=i}),t!==""?t:null}re.CONTAINER_SELECTOR=".djs-search-container",re.INPUT_SELECTOR=".djs-search-input input",re.RESULTS_CONTAINER_SELECTOR=".djs-search-results",re.RESULT_SELECTOR=".djs-search-result",re.RESULT_SELECTED_CLASS="djs-search-result-selected",re.RESULT_SELECTED_SELECTOR="."+re.RESULT_SELECTED_CLASS,re.RESULT_ID_ATTRIBUTE="data-result-id",re.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",re.BOX_HTML=`<div class="djs-search-container djs-scrollable">
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
</div>`,re.RESULT_HTML='<div class="djs-search-result"></div>',re.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',re.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';const eD={__depends__:[wa,Ra,tn],searchPad:["type",re]};function vp(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._search=i,t.registerProvider(this)}vp.$inject=["elementRegistry","searchPad","canvas","search"],vp.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(i){return!ge(i)&&!t.includes(i)});return this._search(n.map(i=>({element:i,label:en(i),id:i.id})),e,{keys:["label","id"]}).map(tD)};function tD(e){const{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}const nD={__depends__:[eD,Gh],__init__:["bpmnSearch"],bpmnSearch:["type",vp]},iD="M44.7648 11.3263L36.9892 2.64074C36.0451 1.58628 34.5651 0.988708 33.1904 0.988708H5.98667C3.22688 0.988708 0.989624 3.34892 0.989624 6.26039V55.0235C0.989624 57.9349 3.22688 60.2952 5.98667 60.2952H40.966C43.7257 60.2952 45.963 57.9349 45.963 55.0235V14.9459C45.963 13.5998 45.6407 12.3048 44.7648 11.3263Z",rD="M1.03845 48.1347C1.03845 49.3511 1.07295 50.758 1.38342 52.064C1.69949 53.3938 2.32428 54.7154 3.56383 55.6428C6.02533 57.4841 10.1161 58.7685 14.8212 59.6067C19.5772 60.4538 25.1388 60.8738 30.6831 60.8738C36.2276 60.8738 41.7891 60.4538 46.545 59.6067C51.2504 58.7687 55.3412 57.4842 57.8028 55.6429C59.0424 54.7156 59.6673 53.3938 59.9834 52.064C60.2938 50.7579 60.3285 49.351 60.3285 48.1344V13.8415C60.3285 12.6249 60.2938 11.218 59.9834 9.91171C59.6673 8.58194 59.0423 7.2602 57.8027 6.33294C55.341 4.49168 51.2503 3.20723 46.545 2.36914C41.7891 1.522 36.2276 1.10204 30.6831 1.10205C25.1388 1.10206 19.5772 1.52206 14.8213 2.36923C10.1162 3.20734 6.02543 4.49183 3.5639 6.33314C2.32433 7.26038 1.69951 8.58206 1.38343 9.91181C1.07295 11.2179 1.03845 12.6247 1.03845 13.8411V48.1347Z",oD={width:36,height:50},aD={width:50,height:50};function s_(e,t,n){return X("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}const Cr=5;function Js(e,t){this._styles=t,e.registerProvider(this)}Js.$inject=["outline","styles"],Js.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;if(!ge(e))return E(e,"bpmn:Gateway")?(n=X("rect"),D(n.style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),q(n,D({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):ue(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?(n=X("rect"),q(n,D({x:-5,y:-5,rx:14,width:e.width+Cr*2,height:e.height+Cr*2},t))):E(e,"bpmn:EndEvent")?(n=X("circle"),q(n,D({cx:e.width/2,cy:e.height/2,r:e.width/2+Cr+1},t))):E(e,"bpmn:Event")?(n=X("circle"),q(n,D({cx:e.width/2,cy:e.height/2,r:e.width/2+Cr},t))):E(e,"bpmn:DataObjectReference")&&c_(e,"bpmn:DataObjectReference")?n=s_(iD,{x:-6,y:-6},t):E(e,"bpmn:DataStoreReference")&&c_(e,"bpmn:DataStoreReference")&&(n=s_(rD,{x:-6,y:-6},t)),n},Js.prototype.updateOutline=function(e,t){if(!ge(e))return ue(e,["bpmn:SubProcess","bpmn:Group"])?(q(t,{width:e.width+Cr*2,height:e.height+Cr*2}),!0):!!ue(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};function c_(e,t){var n;return t==="bpmn:DataObjectReference"?n=oD:t==="bpmn:DataStoreReference"&&(n=aD),e.width===n.width&&e.height===n.height}const sD={__depends__:[Nv],__init__:["outlineProvider"],outlineProvider:["type",Js]};var cD='<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>';function an(e){zr.call(this,e)}Y(an,zr),an.Viewer=Zn,an.NavigatedViewer=Zr,an.prototype.createDiagram=function(){return this.importXML(cD)},an.prototype._interactionModules=[eh,rh,sh],an.prototype._modelingModules=[sR,Rl,kR,SR,XR,Ll,nT,l2,ny,Es,d2,g2,M2,N2,O2,j2,Z2,Yy,rM,mM,CM,TM,Tv,JM,nD,sD],an.prototype._modules=[].concat(Zn.prototype._modules,an.prototype._interactionModules,an.prototype._modelingModules);const lD={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:[]},uD=bn(f.defineComponent({inheritAttrs:!1,__name:"index",props:f.mergeModels({dictType:{type:String,default:""},include:{type:[Array,String]},exclude:{type:Array},sort:{type:Boolean}},{dictMap:{type:Object},dictMapModifiers:{}}),emits:["update:dictMap"],setup(e){const t=e,n=f.useModel(e,"dictMap"),[i,{fetchDict:r,toList:o}]=Sp(t.dictType,{immediate:!1}),a=f.computed(()=>{var c;const s=o(t.dictType);if(t.sort&&s.sort((l,u)=>parseFloat(l.value)-parseFloat(u.value)),t.include){const l=typeof t.include=="string"?t.include.split(","):t.include;return s.filter(u=>l.includes(u.value))}return(c=t.exclude)!=null&&c.length?s.filter(l=>{var u;return!((u=t.exclude)!=null&&u.includes(l.value))}):s});return t.dictType&&r(),f.watch(()=>i.value,()=>{if(n.value&&typeof n.value=="object")for(const s in i.value)n.value[s]=i.value}),(s,c)=>{const l=U.Select;return f.openBlock(),f.createBlock(l,f.mergeProps({class:"dict-select",placeholder:s.$t("common.plsSelect"),showSearch:!1,options:f.unref(a),dropdownMatchSelectWidth:!1},s.$attrs),null,16,["placeholder","options"])}}}),[["__scopeId","data-v-02a7899b"]]),pD={class:"icon",viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em"};function fD(e,t){return f.openBlock(),f.createElementBlock("svg",pD,t[0]||(t[0]=[f.createElementVNode("path",{fill:"currentColor",d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372s372 166.6 372 372s-166.6 372-372 372"},null,-1),f.createElementVNode("path",{fill:"currentColor",d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7c-21.2 8.1-39.2 22.3-52.1 40.9c-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0 1 30.9-44.8c59-22.7 97.1-74.7 97.1-132.5c.1-39.3-17.1-76-48.3-103.3M472 732a40 40 0 1 0 80 0a40 40 0 1 0-80 0"},null,-1)]))}const dD=f.markRaw({name:"ant-design-question-circle",render:fD}),hD={class:"wrapper"},mD={class:"mt-xs"},gD={class:"flex-sc"},yD={class:"mt-xs"},vD={style:{maxWidth:"281px",overflow:"hidden",whiteSpace:"break-spaces"}},_D=bn(f.defineComponent({__name:"RuleConfig",props:{jsonStr:{type:String,required:!0}},emits:["submit"],setup(e,{emit:t}){const{t:n}=Zt.useI18n(),i=e,r=t,o=f.ref({});function a(p){const d=p.replace(/(false|true|\d+)(?=")/g,"$1,");return JSON.parse(`{${d}}`)}function s(p){if(typeof p=="string"&&(p.trim().startsWith("{")||p.trim().startsWith("[")))try{return JSON.parse(p),!0}catch{return!1}return!1}function c(){i.jsonStr?(s(i.jsonStr)?o.value=JSON.parse(i.jsonStr):o.value=a(i.jsonStr),o.value.fallbackFirstLinkStatus!==null&&o.value.fallbackFirstLinkStatus!==void 0&&(o.value.fallbackFirstLinkStatus=String(o.value.fallbackFirstLinkStatus))):o.value={revokeRule:!1,fallbackRule:!1,approverRemoveDuplicates:2,timeoutConfigSwitch:!1,timeoutPeriod:1,timeoutHandler:1,fallbackFirstLinkStatus:null}}function l(){Qe.Modal.destroyAll()}function u(){const p=o.value;if(p.timeoutConfigSwitch&&!p.timeoutPeriod){Qe.message.warning(n("bpmn.timeoutPeriodEmptyTip"));return}p.fallbackFirstLinkStatus&&(p.fallbackFirstLinkStatus=Number(p.fallbackFirstLinkStatus)),r("submit",o.value),Qe.Modal.destroyAll()}return f.onMounted(()=>{c()}),(p,d)=>{const h=U.Checkbox,m=U.FormItem,y=U.Radio,g=U.RadioGroup,w=U.InputNumber,C=dD,x=U.Tooltip,b=uD,S=U.Form,P=U.Button,M=U.Space;return f.openBlock(),f.createElementBlock("div",hD,[f.createVNode(S,{class:"my-nm","label-col":{span:9},"wrapper-col":{span:15},colon:!1,model:f.unref(o)},{default:f.withCtx(()=>[f.createVNode(m,{label:p.$t("bpmn.revertRule")},{default:f.withCtx(()=>[f.createVNode(h,{checked:f.unref(o).revokeRule,"onUpdate:checked":d[0]||(d[0]=R=>f.unref(o).revokeRule=R)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.revertRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),f.createVNode(m,{label:p.$t("bpmn.rollbackRule")},{default:f.withCtx(()=>[f.createVNode(h,{checked:f.unref(o).fallbackRule,"onUpdate:checked":d[1]||(d[1]=R=>f.unref(o).fallbackRule=R)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.rollbackRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),f.createVNode(m,{label:p.$t("bpmn.deduplicationApprovers")},{default:f.withCtx(()=>[f.createElementVNode("div",mD,f.toDisplayString(p.$t("bpmn.deduplicationApproversTxt")),1),f.createVNode(g,{value:f.unref(o).approverRemoveDuplicates,"onUpdate:value":d[2]||(d[2]=R=>f.unref(o).approverRemoveDuplicates=R)},{default:f.withCtx(()=>[f.createVNode(y,{value:0},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.deduplicationRadio0")),1)]),_:1}),f.createVNode(y,{value:1},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.deduplicationRadio1")),1)]),_:1}),f.createVNode(y,{value:2},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.deduplicationRadio2")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),f.createVNode(m,{label:p.$t("bpmn.timeoutRule")},{default:f.withCtx(()=>[f.createVNode(h,{checked:f.unref(o).timeoutConfigSwitch,"onUpdate:checked":d[3]||(d[3]=R=>f.unref(o).timeoutConfigSwitch=R)},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.timeoutRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),f.unref(o).timeoutConfigSwitch?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createVNode(m,{label:p.$t("wo_my.timeout")},{default:f.withCtx(()=>[f.createElementVNode("div",gD,[f.createTextVNode(f.toDisplayString(p.$t("bpmn.linkTimeoutTxt1"))+" ",1),f.createVNode(w,{class:"mx-xs",value:f.unref(o).timeoutPeriod,"onUpdate:value":d[4]||(d[4]=R=>f.unref(o).timeoutPeriod=R),min:1,max:1e4,precision:0},null,8,["value"]),f.createTextVNode(" "+f.toDisplayString(p.$t("bpmn.linkTimeoutTxt2")),1)])]),_:1},8,["label"]),f.createVNode(m,{label:p.$t("bpmn.timeoutHandle")},{default:f.withCtx(()=>[f.createElementVNode("div",yD,f.toDisplayString(p.$t("bpmn.timeoutHandleTxt")),1),f.createVNode(g,{value:f.unref(o).timeoutHandler,"onUpdate:value":d[5]||(d[5]=R=>f.unref(o).timeoutHandler=R)},{default:f.withCtx(()=>[f.createVNode(y,{value:0},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.timeoutHandleRadio0")),1)]),_:1}),f.createVNode(y,{value:1},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("bpmn.timeoutHandleRadio1")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])],64)):f.createCommentVNode("",!0),f.createVNode(m,null,{label:f.withCtx(()=>[f.createElementVNode("span",vD,f.toDisplayString(p.$t("bpmn.fallbackFirstLinkStatus")),1),f.createVNode(x,{overlayInnerStyle:{width:"600px"}},{title:f.withCtx(()=>[f.createElementVNode("div",null,f.toDisplayString(p.$t("bpmn.rollbackTooltip1")),1),f.createElementVNode("div",null,f.toDisplayString(p.$t("bpmn.rollbackTooltip2")),1),f.createElementVNode("div",null,f.toDisplayString(p.$t("bpmn.rollbackTooltip3")),1),f.createElementVNode("div",null,f.toDisplayString(p.$t("bpmn.rollbackTooltip4")),1),f.createElementVNode("div",null,f.toDisplayString(p.$t("bpmn.rollbackTooltip5")),1),f.createElementVNode("div",null,f.toDisplayString(p.$t("bpmn.rollbackTooltip6")),1)]),default:f.withCtx(()=>[f.createVNode(C)]),_:1})]),default:f.withCtx(()=>[f.createVNode(b,{"dict-type":"fallback_first_link_status",value:f.unref(o).fallbackFirstLinkStatus,"onUpdate:value":d[6]||(d[6]=R=>f.unref(o).fallbackFirstLinkStatus=R),placeholder:p.$t("common.plsSelect"),style:{width:"80%"}},null,8,["value","placeholder"])]),_:1})]),_:1},8,["model"]),f.createVNode(M,{class:"modal-btns"},{default:f.withCtx(()=>[f.createVNode(P,{onClick:l},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("common.btn_cancel1")),1)]),_:1}),f.createVNode(P,{type:"primary",onClick:u},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(p.$t("common.btn_sure")),1)]),_:1})]),_:1})])}}}),[["__scopeId","data-v-e5654449"]]),bD=f.defineComponent({__name:"Process",props:f.mergeModels({isEdit:{type:Boolean}},{formState:{},formStateModifiers:{}}),emits:["update:formState"],setup(e){const{modal:t}=Qe.App.useApp(),{t:n}=Zt.useI18n(),i=f.useModel(e,"formState"),r=f.ref(["1","2","3","4","5","6"]);function o(){t.info({title:n("ruleModel.title"),content:f.h(_D,{jsonStr:i.value.jobPriority,onSubmit:a=>{i.value.jobPriority=JSON.stringify(a)}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:850,class:"modal-comp"})}return(a,s)=>{const c=U.Input,l=U.FormItem,u=U.Form,p=U.CollapsePanel,d=U.Collapse;return f.openBlock(),f.createBlock(d,{activeKey:f.unref(r),"onUpdate:activeKey":s[4]||(s[4]=h=>f.isRef(r)?r.value=h:null)},{default:f.withCtx(()=>[f.createVNode(p,{key:"1",header:a.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(u,{layout:"vertical",model:i.value},{default:f.withCtx(()=>[f.createVNode(l,{label:a.$t("FLOW_CHART.Id"),extra:a.$t("FLOW_CHART.idTip")},{default:f.withCtx(()=>[f.createVNode(c,{value:i.value.id,"onUpdate:value":s[0]||(s[0]=h=>i.value.id=h),placeholder:a.$t("common.plsEnter"),readonly:e.isEdit},null,8,["value","placeholder","readonly"])]),_:1},8,["label","extra"]),f.createVNode(l,{label:a.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(c,{value:i.value.name,"onUpdate:value":s[1]||(s[1]=h=>i.value.name=h),placeholder:a.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(l,{label:a.$t("FLOW_CHART.Version Tag")},{default:f.withCtx(()=>[f.createVNode(c,{value:i.value.versionTag,"onUpdate:value":s[2]||(s[2]=h=>i.value.versionTag=h),disabled:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),f.createVNode(p,{key:"4",header:a.$t("FLOW_CHART.Job Configuration")},{default:f.withCtx(()=>[f.createVNode(u,{layout:"vertical",model:i.value},{default:f.withCtx(()=>[f.createVNode(l,{label:a.$t("FLOW_CHART.Job Priority")},{default:f.withCtx(()=>[f.createVNode(c,{value:i.value.jobPriority,"onUpdate:value":s[3]||(s[3]=h=>i.value.jobPriority=h),placeholder:a.$t("common.plsSelect"),readonly:"",onClick:o},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),ED=bn(f.defineComponent({__name:"TemplateConfig",props:{data:{type:Object,default:()=>{}},templateList:{type:Array,default:()=>[]}},emits:["update:data"],setup(e,{emit:t}){const n=t,i=e,r=f.computed({get:()=>i.data,set:l=>{n("update:data",l)}}),o=f.computed(()=>i.templateList.filter(l=>{var u;return(u=l==null?void 0:l.type)==null?void 0:u.split(",").includes("1")}).map(l=>({label:l.name,value:l.id}))),a=f.computed(()=>i.templateList.filter(l=>{var u;return(u=l==null?void 0:l.type)==null?void 0:u.split(",").includes("2")}).map(l=>({label:l.name,value:l.id}))),s=f.computed(()=>i.templateList.filter(l=>{var u;return(u=l==null?void 0:l.type)==null?void 0:u.split(",").includes("3")}).map(l=>({label:l.name,value:l.id}))),c=(l,u)=>u.label.toLowerCase().indexOf(l.toLowerCase())>=0;return(l,u)=>{const p=U.Select,d=U.FormItem,h=U.Form;return f.openBlock(),f.createElementBlock("div",null,[f.createVNode(h,{class:"form-query-select mx-nm mt-nm",layout:"vertical",model:r.value},{default:f.withCtx(()=>[f.createVNode(d,{label:l.$t("待办工单处理")},{default:f.withCtx(()=>[f.createVNode(p,{value:r.value[1],"onUpdate:value":u[0]||(u[0]=m=>r.value[1]=m),options:o.value,allowClear:"",placeholder:l.$t("common.plsSelect"),"show-search":"","filter-option":c},null,8,["value","options","placeholder"])]),_:1},8,["label"]),f.createVNode(d,{label:l.$t("待办工单详情")},{default:f.withCtx(()=>[f.createVNode(p,{value:r.value[2],"onUpdate:value":u[1]||(u[1]=m=>r.value[2]=m),options:a.value,allowClear:"",placeholder:l.$t("common.plsSelect"),"show-search":"","filter-option":c},null,8,["value","options","placeholder"])]),_:1},8,["label"]),f.createVNode(d,{label:l.$t("全部工单详情")},{default:f.withCtx(()=>[f.createVNode(p,{value:r.value[3],"onUpdate:value":u[2]||(u[2]=m=>r.value[3]=m),options:s.value,allowClear:"",placeholder:l.$t("common.plsSelect"),"show-search":"","filter-option":c},null,8,["value","options","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),[["__scopeId","data-v-5c46da3d"]]),xD={class:"modal-container"},wD=f.defineComponent({__name:"SelectLinkTask",props:{id:{type:String},componentInfo:{type:String,default:""},variable:{type:String,default:""},description:{type:String,default:""}},emits:["submit"],setup(e,{emit:t}){const{t:n}=Zt.useI18n(),i=e,r=t,o=f.ref({}),a=f.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"},{title:n("bpmn.action"),dataIndex:"action"}]),s=f.ref([]),c=f.ref();function l(O,F){s.value=O,c.value=F}const u=f.ref({1:void 0,2:void 0,3:void 0}),p=f.ref({}),d=f.ref(!1),h=f.ref(""),m=f.ref("");function y(){d.value=!1,h.value=JSON.stringify(u.value)}function g(){d.value=!1}function w(O){p.value=O,d.value=!0}const C=f.ref([]);async function x(){const{result:O}=await ct.getTemplateList({pageNo:1,pageSize:1e3});C.value=(O==null?void 0:O.data)||[]}const b=f.ref([]);async function S(){const{result:O}=await ct.getLinkList({pageNo:1,pageSize:1e3});b.value=(O==null?void 0:O.data)||[]}f.watchEffect(()=>{i.id&&(i.id.startsWith("common-approve-")||i.id.startsWith("common-handle-")?(m.value=i.id.slice(-4),s.value=[i.id.slice(0,-4)+"*"]):s.value=[i.id]),i.componentInfo&&(u.value=JSON.parse(i.componentInfo)||{})});function P(O){c.value=null;const F={...o.value};return Object.assign(F,O),ct.getLinkList(F)}const M=f.ref(),R=()=>{M.value.refresh()},I=()=>{o.value={},R()};f.onMounted(()=>{I(),x(),S()});function B(){Qe.Modal.destroyAll()}function L(){var O,F;if((O=c.value)!=null&&O.length)r("submit",{...c.value[0],bindComponent:h.value,hasSuffix:""});else if((F=s.value)!=null&&F.length){const G=b.value.find(ke=>ke.id===s.value[0]);r("submit",{...G,id:i.id,bindComponent:h.value,hasSuffix:m.value})}Qe.Modal.destroyAll()}return(O,F)=>{const G=U.Input,ke=U.FormItem,be=U.Button,ce=U.Space,st=U.Form,We=U.Tooltip,Ee=f.resolveComponent("a-table-ex"),Te=U.Modal;return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createElementVNode("div",xD,[f.createVNode(st,{class:"form-query mx-nm mt-nm",layout:"vertical",model:f.unref(o)},{default:f.withCtx(()=>[f.createVNode(ke,{label:O.$t("link.id")},{default:f.withCtx(()=>[f.createVNode(G,{value:f.unref(o).id,"onUpdate:value":F[0]||(F[0]=$=>f.unref(o).id=$),placeholder:O.$t("common.plsEnter"),onKeydown:f.withKeys(R,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(ke,{label:O.$t("link.description")},{default:f.withCtx(()=>[f.createVNode(G,{value:f.unref(o).description,"onUpdate:value":F[1]||(F[1]=$=>f.unref(o).description=$),placeholder:O.$t("common.plsEnter"),onKeydown:f.withKeys(R,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(ke,{class:"form-btns"},{default:f.withCtx(()=>[f.createVNode(ce,null,{default:f.withCtx(()=>[f.createVNode(be,{type:"primary",onClick:R},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(O.$t("common.btn_search")),1)]),_:1}),f.createVNode(be,{onClick:I},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(O.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),f.createVNode(Ee,{ref_key:"tableEx",ref:M,class:"table-query bordered mx-nm",columns:f.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:f.unref(s),onChange:l},loadData:P},{bodyCell:f.withCtx(({record:$,column:H})=>[H.dataIndex==="action"?(f.openBlock(),f.createBlock(We,{key:0,placement:"top"},{title:f.withCtx(()=>[f.createElementVNode("span",null,f.toDisplayString(O.$t("bpmn.tempConfigTip")),1)]),default:f.withCtx(()=>[f.createVNode(be,{type:"link",onClick:Z=>w($),style:{"padding-left":"0"},disabled:!f.unref(s).includes($.id)},{default:f.withCtx(()=>F[4]||(F[4]=[f.createTextVNode(f.toDisplayString("配置渲染模版"))])),_:2},1032,["onClick","disabled"])]),_:2},1024)):f.createCommentVNode("",!0)]),_:1},8,["columns","row-selection"]),f.createVNode(ce,{class:"modal-btns"},{default:f.withCtx(()=>{var $;return[f.createVNode(be,{onClick:B},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(O.$t("common.btn_cancel1")),1)]),_:1}),f.createVNode(be,{type:"primary",disabled:!(($=f.unref(s))!=null&&$.length),onClick:L},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(O.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})]),f.createVNode(Te,{open:f.unref(d),"onUpdate:open":F[3]||(F[3]=$=>f.isRef(d)?d.value=$:null),title:"配置渲染模版",onOk:y,onCancel:g},{default:f.withCtx(()=>[f.createVNode(ED,{data:f.unref(u),"onUpdate:data":F[2]||(F[2]=$=>f.isRef(u)?u.value=$:null),"template-list":f.unref(C)},null,8,["data","template-list"])]),_:1},8,["open"])],64)}}}),SD={class:"modal-container"},CD=f.defineComponent({__name:"SelectUser",props:{userIds:{type:String||Array},branchId:{type:String},mode:{type:String,default:"default"}},emits:["submit"],setup(e,{emit:t}){const{t:n}=Zt.useI18n(),i=e,r=t,o=f.ref({}),a=f.ref([{title:n("user.user_name"),dataIndex:"userName"},{title:n("user.user_id"),dataIndex:"userCode"},{title:n("arrears.org"),dataIndex:"branchName"}]),s=f.ref([]),c=f.ref();function l(g,w){s.value=g,c.value=w}f.watchEffect(()=>{i.userIds&&(s.value=Array.isArray(i.userIds)?i.userIds:[i.userIds])});function u(g){c.value=null;const w={...o.value,branchId:i.branchId};return Object.assign(w,g),ct.getUserList(w)}const p=f.ref(),d=()=>{p.value.refresh()},h=()=>{o.value={},d()};f.onMounted(()=>{h()});function m(){Qe.Modal.destroyAll()}function y(){var g;if((g=c.value)!=null&&g.length){const w=c.value;r("submit",i.mode==="multiple"?w:w[0])}Qe.Modal.destroyAll()}return(g,w)=>{const C=U.Input,x=U.FormItem,b=U.Button,S=U.Space,P=U.Form,M=f.resolveComponent("a-table-ex");return f.openBlock(),f.createElementBlock("div",SD,[f.createVNode(P,{class:"form-query mx-nm mt-nm",layout:"vertical",model:f.unref(o)},{default:f.withCtx(()=>[f.createVNode(x,{label:g.$t("user.key")},{default:f.withCtx(()=>[f.createVNode(C,{value:f.unref(o).userName,"onUpdate:value":w[0]||(w[0]=R=>f.unref(o).userName=R),placeholder:g.$t("common.plsEnter"),onKeydown:f.withKeys(d,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(x,{class:"form-btns"},{default:f.withCtx(()=>[f.createVNode(S,null,{default:f.withCtx(()=>[f.createVNode(b,{type:"primary",onClick:d},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_search")),1)]),_:1}),f.createVNode(b,{onClick:h},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),f.createVNode(M,{ref_key:"tableEx",ref:p,class:"table-query bordered mx-nm",columns:f.unref(a),rowKey:"userId","row-selection":{type:e.mode==="multiple"?"checkbox":"radio",selectedRowKeys:f.unref(s),onChange:l},loadData:u},null,8,["columns","row-selection"]),f.createVNode(S,{class:"modal-btns"},{default:f.withCtx(()=>{var R;return[f.createVNode(b,{onClick:m},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_cancel1")),1)]),_:1}),f.createVNode(b,{type:"primary",disabled:!((R=f.unref(s))!=null&&R.length),onClick:y},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),RD=f.defineComponent({__name:"UserTask",props:f.mergeModels({isApproval:{type:Boolean}},{formState:{},formStateModifiers:{}}),emits:["update:formState"],setup(e){const{modal:t}=Qe.App.useApp(),{t:n}=Zt.useI18n(),i=f.useModel(e,"formState"),r=f.ref(["1","2","3","4","5","6"]),o=f.ref([]),a=f.ref([]),s=f.ref([]),c=f.computed(()=>{const w=i.value.assignee;return w==null?void 0:w.startsWith("${")});function l(){const w="abcdefghijklmnopqrstuvwxyz";let C="";for(let x=0;x<2;x++)C+=w.charAt(Math.floor(Math.random()*w.length));for(let x=0;x<2;x++)C+=Math.floor(Math.random()*10);return C}function u(){t.info({title:n("link.select_link"),content:f.h(wD,{id:i.value.id,variable:i.value.assignee,description:i.value.name,componentInfo:i.value.bindComponent,onSubmit:w=>{let C=w.id;C.endsWith("*")&&(w.hasSuffix?C=C.substring(0,C.length-1)+w.hasSuffix:C=C.substring(0,C.length-1)+l()),Object.assign(i.value,{id:C,name:w.description,assignee:"","camunda:assigneeName":"",priority:void 0,userArr:[],roleArr:[]}),w.variable&&(i.value.assignee=`\${${w.variable}}`),w.bindComponent&&(i.value.bindComponent=w.bindComponent)}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:850,zIndex:100,class:"modal-comp"})}function p(){t.info({title:n("user.select_user"),content:f.h(CD,{userIds:i.value.assignee,onSubmit:w=>{Object.assign(i.value,{assignee:w.userId,"camunda:assigneeName":w.userName})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}function d(){ct.getBranchTree().then(w=>{w.code===0&&(o.value=w.result||[])})}function h(){const w={pageNo:1,pageSize:1e3,branchId:i.value.priority||void 0};ct.getUserList(w).then(C=>{var x,b;C.code===0&&(s.value=((b=(x=C.result)==null?void 0:x.data)==null?void 0:b.map(S=>({...S,label:S.userName,value:S.userId})))||[])})}function m(){const w={pageNo:1,pageSize:1e3,branchId:i.value.priority||void 0};ct.getRoleList(w).then(C=>{var x,b;C.code===0&&(a.value=((b=(x=C.result)==null?void 0:x.data)==null?void 0:b.map(S=>({...S,label:S.roleName,value:S.roleId})))||[])})}function y(){Object.assign(i.value,{userArr:[],roleArr:[]}),h(),m()}function g(w){if(w!=null&&w.length){const C=s.value.find(x=>x.userId===w[0]);i.value.priority!==C.branchId&&(Object.assign(i.value,{priority:C.branchId,roleArr:[]}),h(),m())}}return f.onMounted(()=>{d(),h(),m()}),(w,C)=>{const x=U.Input,b=U.FormItem,S=U.TreeSelect,P=U.Select,M=U.Form,R=U.CollapsePanel,I=U.Radio,B=U.RadioGroup,L=U.Checkbox,O=U.CheckboxGroup,F=U.Collapse;return f.openBlock(),f.createBlock(F,{activeKey:f.unref(r),"onUpdate:activeKey":C[10]||(C[10]=G=>f.isRef(r)?r.value=G:null)},{default:f.withCtx(()=>[f.createVNode(R,{key:"1",header:w.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(M,{layout:"vertical",model:i.value},{default:f.withCtx(()=>[f.createVNode(b,{label:w.$t("FLOW_CHART.Id")},{default:f.withCtx(()=>[f.createVNode(x,{value:i.value.id,"onUpdate:value":C[0]||(C[0]=G=>i.value.id=G),placeholder:w.$t("common.plsEnter"),readonly:"",onClick:u},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(b,{label:w.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(x,{value:i.value.name,"onUpdate:value":C[1]||(C[1]=G=>i.value.name=G),placeholder:w.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(b,{label:w.$t("FLOW_CHART.Assignee")},{default:f.withCtx(()=>[f.unref(c)?(f.openBlock(),f.createBlock(x,{key:0,value:i.value.assignee,"onUpdate:value":C[2]||(C[2]=G=>i.value.assignee=G),placeholder:w.$t("common.plsSelect"),disabled:""},null,8,["value","placeholder"])):(f.openBlock(),f.createBlock(x,{key:1,value:i.value["camunda:assigneeName"],"onUpdate:value":C[3]||(C[3]=G=>i.value["camunda:assigneeName"]=G),placeholder:w.$t("common.plsSelect"),readonly:"",onClick:p},null,8,["value","placeholder"]))]),_:1},8,["label"]),f.createVNode(b,{label:w.$t("FLOW_CHART.Priority")},{default:f.withCtx(()=>[f.createVNode(S,{value:i.value.priority,"onUpdate:value":C[4]||(C[4]=G=>i.value.priority=G),placeholder:w.$t("common.plsSelect"),"tree-data":f.unref(o),treeDefaultExpandAll:"",treeNodeFilterProp:"label","show-search":"","allow-clear":"",onChange:y},null,8,["value","placeholder","tree-data"])]),_:1},8,["label"]),f.createVNode(b,{label:w.$t("FLOW_CHART.Candidate Users")},{default:f.withCtx(()=>[f.createVNode(P,{value:i.value.userArr,"onUpdate:value":C[5]||(C[5]=G=>i.value.userArr=G),placeholder:w.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:f.unref(s),optionFilterProp:"label",disabled:f.unref(c),onChange:g},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"]),f.createVNode(b,{label:w.$t("FLOW_CHART.Candidate Groups")},{default:f.withCtx(()=>[f.createVNode(P,{value:i.value.roleArr,"onUpdate:value":C[6]||(C[6]=G=>i.value.roleArr=G),placeholder:w.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:f.unref(a),optionFilterProp:"label",disabled:f.unref(c)},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),e.isApproval?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(R,{key:"2",header:w.$t("FLOW_CHART.isAllowRollback")},{default:f.withCtx(()=>[f.createVNode(B,{value:i.value.rollback,"onUpdate:value":C[7]||(C[7]=G=>i.value.rollback=G)},{default:f.withCtx(()=>[f.createVNode(I,{value:"1"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.yes")),1)]),_:1}),f.createVNode(I,{value:"0"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.no")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])),e.isApproval?(f.openBlock(),f.createBlock(R,{key:"3",header:w.$t("FLOW_CHART.Approval Mode")},{default:f.withCtx(()=>[f.createVNode(B,{value:i.value.approvalSign,"onUpdate:value":C[8]||(C[8]=G=>i.value.approvalSign=G)},{default:f.withCtx(()=>[f.createVNode(I,{value:"orSign"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.Or Sign")),1)]),_:1}),f.createVNode(I,{value:"countersign"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.countersign")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])):f.createCommentVNode("",!0),e.isApproval?(f.openBlock(),f.createBlock(R,{key:"4",header:w.$t("FLOW_CHART.Approval Required")},{default:f.withCtx(()=>[f.createVNode(O,{value:i.value.approvalCheckbox,"onUpdate:value":C[9]||(C[9]=G=>i.value.approvalCheckbox=G)},{default:f.withCtx(()=>[f.createVNode(L,{value:"advice"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.Comments Required")),1)]),_:1}),f.createVNode(L,{value:"attachment"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(w.$t("FLOW_CHART.Attachment Required")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])):f.createCommentVNode("",!0)]),_:1},8,["activeKey"])}}}),TD=f.defineComponent({__name:"ExclusiveGateway",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const t=f.useModel(e,"formState"),n=f.ref(["1","2","3","4","5","6"]);return(i,r)=>{const o=U.Input,a=U.FormItem,s=U.Form,c=U.CollapsePanel,l=U.Collapse;return f.openBlock(),f.createBlock(l,{activeKey:f.unref(n),"onUpdate:activeKey":r[2]||(r[2]=u=>f.isRef(n)?n.value=u:null)},{default:f.withCtx(()=>[f.createVNode(c,{key:"1",header:i.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(s,{layout:"vertical",model:t.value},{default:f.withCtx(()=>[f.createVNode(a,{label:i.$t("FLOW_CHART.Id")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.id,"onUpdate:value":r[0]||(r[0]=u=>t.value.id=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(a,{label:i.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.name,"onUpdate:value":r[1]||(r[1]=u=>t.value.name=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),PD=f.defineComponent({__name:"SequenceFlow",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const t=f.useModel(e,"formState"),n=f.ref(["1","2","3","4","5","6"]);return(i,r)=>{const o=U.Input,a=U.FormItem,s=U.SelectOption,c=U.Select,l=U.Form,u=U.CollapsePanel,p=U.Collapse;return f.openBlock(),f.createBlock(p,{activeKey:f.unref(n),"onUpdate:activeKey":r[4]||(r[4]=d=>f.isRef(n)?n.value=d:null)},{default:f.withCtx(()=>[f.createVNode(u,{key:"1",header:i.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(l,{layout:"vertical",model:t.value},{default:f.withCtx(()=>[f.createVNode(a,{label:i.$t("FLOW_CHART.Id")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.id,"onUpdate:value":r[0]||(r[0]=d=>t.value.id=d),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(a,{label:i.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.name,"onUpdate:value":r[1]||(r[1]=d=>t.value.name=d),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(a,{label:i.$t("FLOW_CHART.Condition Type")},{default:f.withCtx(()=>[f.createVNode(c,{value:t.value.condType,"onUpdate:value":r[2]||(r[2]=d=>t.value.condType=d),placeholder:i.$t("common.plsSelect"),allowClear:""},{default:f.withCtx(()=>[f.createVNode(s,{value:"bpmn:FormalExpression"},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(i.$t("FLOW_CHART.Expression")),1)]),_:1})]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),t.value.condType==="bpmn:FormalExpression"?(f.openBlock(),f.createBlock(a,{key:0,label:i.$t("FLOW_CHART.Expression")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.condBody,"onUpdate:value":r[3]||(r[3]=d=>t.value.condBody=d),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])):f.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),AD={class:"modal-container"},kD=f.defineComponent({__name:"SelectLink",props:{id:{type:String}},emits:["submit"],setup(e,{emit:t}){const{t:n}=Zt.useI18n(),i=e,r=t,o=f.ref({}),a=f.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"}]),s=f.ref([]),c=f.ref();function l(g,w){s.value=g,c.value=w}f.watchEffect(()=>{i.id&&(s.value=[i.id])});function u(g){c.value=null;const w={...o.value};return Object.assign(w,g),ct.getLinkList(w)}const p=f.ref(),d=()=>{p.value.refresh()},h=()=>{o.value={},d()};f.onMounted(()=>{h()});function m(){Qe.Modal.destroyAll()}function y(){var g;(g=c.value)!=null&&g.length&&r("submit",c.value[0]),Qe.Modal.destroyAll()}return(g,w)=>{const C=U.Input,x=U.FormItem,b=U.Button,S=U.Space,P=U.Form,M=f.resolveComponent("a-table-ex");return f.openBlock(),f.createElementBlock("div",AD,[f.createVNode(P,{class:"form-query mx-nm mt-nm",layout:"vertical",model:f.unref(o)},{default:f.withCtx(()=>[f.createVNode(x,{label:g.$t("link.id")},{default:f.withCtx(()=>[f.createVNode(C,{value:f.unref(o).id,"onUpdate:value":w[0]||(w[0]=R=>f.unref(o).id=R),placeholder:g.$t("common.plsEnter"),onKeydown:f.withKeys(d,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(x,{label:g.$t("link.description")},{default:f.withCtx(()=>[f.createVNode(C,{value:f.unref(o).description,"onUpdate:value":w[1]||(w[1]=R=>f.unref(o).description=R),placeholder:g.$t("common.plsEnter"),onKeydown:f.withKeys(d,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(x,{class:"form-btns"},{default:f.withCtx(()=>[f.createVNode(S,null,{default:f.withCtx(()=>[f.createVNode(b,{type:"primary",onClick:d},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_search")),1)]),_:1}),f.createVNode(b,{onClick:h},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),f.createVNode(M,{ref_key:"tableEx",ref:p,class:"table-query bordered mx-nm",columns:f.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:f.unref(s),onChange:l},loadData:u},null,8,["columns","row-selection"]),f.createVNode(S,{class:"modal-btns"},{default:f.withCtx(()=>{var R;return[f.createVNode(b,{onClick:m},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_cancel1")),1)]),_:1}),f.createVNode(b,{type:"primary",disabled:!((R=f.unref(s))!=null&&R.length),onClick:y},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(g.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),MD=f.defineComponent({__name:"EndEvent",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const{modal:t}=Qe.App.useApp(),{t:n}=Zt.useI18n(),i=f.useModel(e,"formState"),r=f.ref(["1","2","3","4","5","6"]);function o(){const s="abcdefghijklmnopqrstuvwxyz";let c="";for(let l=0;l<2;l++)c+=s.charAt(Math.floor(Math.random()*s.length));for(let l=0;l<2;l++)c+=Math.floor(Math.random()*10);return c}function a(){t.info({title:n("link.select_link"),content:f.h(kD,{id:i.value.id,onSubmit:s=>{let c=s.id;c.endsWith("*")&&(c=c.substring(0,c.length-1)+o()),Object.assign(i.value,{id:c,name:s.description})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}return(s,c)=>{const l=U.Input,u=U.FormItem,p=U.Form,d=U.CollapsePanel,h=U.Collapse;return f.openBlock(),f.createBlock(h,{activeKey:f.unref(r),"onUpdate:activeKey":c[2]||(c[2]=m=>f.isRef(r)?r.value=m:null)},{default:f.withCtx(()=>[f.createVNode(d,{key:"1",header:s.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(p,{layout:"vertical",model:i.value},{default:f.withCtx(()=>[f.createVNode(u,{label:s.$t("FLOW_CHART.Id")},{default:f.withCtx(()=>[f.createVNode(l,{value:i.value.id,"onUpdate:value":c[0]||(c[0]=m=>i.value.id=m),placeholder:s.$t("common.plsEnter"),readonly:"",onClick:a},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(u,{label:s.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(l,{value:i.value.name,"onUpdate:value":c[1]||(c[1]=m=>i.value.name=m),placeholder:s.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),DD=f.defineComponent({__name:"Other",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(e){const t=f.useModel(e,"formState"),n=f.ref(["1","2","3","4","5","6"]);return(i,r)=>{const o=U.Input,a=U.FormItem,s=U.Form,c=U.CollapsePanel,l=U.Collapse;return f.openBlock(),f.createBlock(l,{activeKey:f.unref(n),"onUpdate:activeKey":r[2]||(r[2]=u=>f.isRef(n)?n.value=u:null)},{default:f.withCtx(()=>[f.createVNode(c,{key:"1",header:i.$t("FLOW_CHART.General")},{default:f.withCtx(()=>[f.createVNode(s,{layout:"vertical",model:t.value},{default:f.withCtx(()=>[f.createVNode(a,{label:i.$t("FLOW_CHART.Id")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.id,"onUpdate:value":r[0]||(r[0]=u=>t.value.id=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),f.createVNode(a,{label:i.$t("FLOW_CHART.Name")},{default:f.withCtx(()=>[f.createVNode(o,{value:t.value.name,"onUpdate:value":r[1]||(r[1]=u=>t.value.name=u),placeholder:i.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),ND={class:"properties-panel"},OD=bn(f.defineComponent({__name:"BpmnPropertiesPanel",props:{modeler:{type:an},isEdit:{type:Boolean},isApproval:{type:Boolean}},setup(e){const t=e,n=f.ref(""),i=f.ref({});let r,o,a;f.watch(()=>t.modeler,()=>{t.modeler&&(r=t.modeler,s())}),f.watch(i,(u,p)=>{u===p&&l()},{deep:!0});function s(){o=r.get("modeling"),r.on("element.click",u=>{c(u.element)}),r.on("selection.changed",u=>{if(u.newSelection.length)c(u.newSelection[0]);else{const p=r.get("canvas").getRootElement();c(p)}})}function c(u){if(!(u!=null&&u.businessObject)||a===u)return;a=u;const p=u.businessObject,d=p.$type;n.value="",f.nextTick(()=>{n.value=d});const h={...p.$attrs};Object.keys(p).forEach(m=>{const y=p[m];typeof y=="string"&&(h[m]=y)}),d==="bpmn:UserTask"?(Object.assign(h,{rollback:h["camunda:rollback"]==="1"?"1":"0",approvalCheckbox:[]}),Object.assign(h,{approvalSign:h["camunda:countersign"]==="true"?"countersign":"orSign",approvalCheckbox:[]}),h["camunda:advice"]==="true"&&h.approvalCheckbox.push("advice"),h["camunda:attachment"]==="true"&&h.approvalCheckbox.push("attachment"),h["camunda:bindComponent"]&&(h.bindComponent=h["camunda:bindComponent"]),h.userArr=(h.candidateUsers||"").split(",").filter(m=>m),h.roleArr=(h.candidateGroups||"").split(",").filter(m=>m)):d==="bpmn:SequenceFlow"&&p.conditionExpression&&Object.assign(h,{condType:p.conditionExpression.$type,condBody:p.conditionExpression.body}),i.value=h}function l(){var m,y;const u=i.value;function p(g){return g?"true":"false"}const d={id:u.id,name:u.name},h=n.value;if(h==="bpmn:Process")u.jobPriority&&Object.assign(d,{"camunda:jobPriority":u.jobPriority});else if(h==="bpmn:UserTask")Object.assign(d,{"camunda:orSign":p(u.approvalSign==="orSign"),"camunda:rollback":u.rollback==="1"?"1":"0","camunda:countersign":p(u.approvalSign==="countersign"),"camunda:advice":p(u.approvalCheckbox.includes("advice")),"camunda:attachment":p(u.approvalCheckbox.includes("attachment")),"camunda:assignee":u.assignee||void 0,"camunda:assigneeName":u["camunda:assigneeName"]||void 0,"camunda:priority":u.priority||void 0,"camunda:candidateUsers":((m=u.userArr)==null?void 0:m.join())||void 0,"camunda:candidateGroups":((y=u.roleArr)==null?void 0:y.join())||void 0,"camunda:bindComponent":u.bindComponent});else if(h==="bpmn:SequenceFlow")if(u.condType){const g=r.get("moddle").create("bpmn:FormalExpression",{body:u.condBody});d.conditionExpression=g}else d.conditionExpression=null;o.updateProperties(a,d)}return(u,p)=>{const d=tf;return f.openBlock(),f.createElementBlock("div",ND,[f.createVNode(d,null,{default:f.withCtx(()=>[f.unref(n)==="bpmn:Process"?(f.openBlock(),f.createBlock(bD,{key:0,formState:f.unref(i),"onUpdate:formState":p[0]||(p[0]=h=>f.isRef(i)?i.value=h:null),isEdit:e.isEdit},null,8,["formState","isEdit"])):f.unref(n)==="bpmn:UserTask"?(f.openBlock(),f.createBlock(RD,{key:1,formState:f.unref(i),"onUpdate:formState":p[1]||(p[1]=h=>f.isRef(i)?i.value=h:null),isApproval:e.isApproval},null,8,["formState","isApproval"])):f.unref(n)==="bpmn:ExclusiveGateway"?(f.openBlock(),f.createBlock(TD,{key:2,formState:f.unref(i),"onUpdate:formState":p[2]||(p[2]=h=>f.isRef(i)?i.value=h:null)},null,8,["formState"])):f.unref(n)==="bpmn:SequenceFlow"?(f.openBlock(),f.createBlock(PD,{key:3,formState:f.unref(i),"onUpdate:formState":p[3]||(p[3]=h=>f.isRef(i)?i.value=h:null)},null,8,["formState"])):f.unref(n)==="bpmn:EndEvent"?(f.openBlock(),f.createBlock(MD,{key:4,formState:f.unref(i),"onUpdate:formState":p[4]||(p[4]=h=>f.isRef(i)?i.value=h:null)},null,8,["formState"])):f.unref(n)?(f.openBlock(),f.createBlock(DD,{key:5,formState:f.unref(i),"onUpdate:formState":p[5]||(p[5]=h=>f.isRef(i)?i.value=h:null)},null,8,["formState"])):f.createCommentVNode("",!0)]),_:1})])}}}),[["__scopeId","data-v-31b3ee78"]]),ID={class:"wrapper"},BD=bn(f.defineComponent({__name:"index",props:{data:{type:Object,required:!0}},setup(e,{expose:t}){const n=e,i=f.shallowRef();function r(){i.value=new an({container:"#canvas",moddleExtensions:{camunda:lD}})}function o(){ct.getBpmnXml({code:n.data.code}).then(s=>{var c;if(s.code===0){const l=s.result.text;(c=i.value)==null||c.importXML(l)}})}f.onMounted(()=>{var s;r(),n.data.code?o():(s=i.value)==null||s.createDiagram()});function a(){var s;return(s=i.value)==null?void 0:s.saveXML({format:!0})}return t({saveXML:a}),(s,c)=>(f.openBlock(),f.createElementBlock("div",ID,[c[0]||(c[0]=f.createElementVNode("div",{id:"canvas"},null,-1)),f.createVNode(OD,{modeler:f.unref(i),isEdit:e.data.opType==="2",isApproval:e.data.isApproval},null,8,["modeler","isEdit","isApproval"])]))}}),[["__scopeId","data-v-5f499ed0"]]),LD={class:"icon",viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em"};function $D(e,t){return f.openBlock(),f.createElementBlock("svg",LD,t[0]||(t[0]=[f.createElementVNode("path",{fill:"currentColor",d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281l360-281.1c3.8-3 6.1-7.7 6.1-12.6"},null,-1)]))}const jD=f.markRaw({name:"ant-design-left",render:$D}),FD={class:"container"},HD={class:"viewer-container"},VD=bn(f.defineComponent({__name:"BpmnEditPage",props:{data:{type:Object,required:!0}},setup(e){const{t}=Zt.useI18n(),n=e,i=f.computed(()=>{const c=n.data.opType||"1";if(c==="1")return t("bpmn.add_workflow");if(c==="2")return t("bpmn.edit_workflow");if(c==="3")return t("bpmn.clone_workflow")}),r=f.inject(Ko);function o(){r==null||r.emit("changeComp",{comp:"BusTypeList"})}const a=f.ref();function s(){var c;(c=a.value)==null||c.saveXML().then(({error:l,xml:u})=>{if(l){Qe.message.error(l);return}const p={type:n.data.type,text:u};((n.data.opType||"1")==="2"?ct.bpmnUpdate(p):ct.bpmnInsert(p)).then(m=>{m.code===0&&(r==null||r.emit("changeComp",{comp:"BusTypeList"}))})})}return(c,l)=>{const u=jD,p=U.Button,d=U.Space,h=U.PageHeader,m=BD;return f.openBlock(),f.createElementBlock("div",FD,[f.createVNode(h,{class:"page-header-sticky",title:f.unref(i),onBack:o},{backIcon:f.withCtx(()=>[f.createVNode(u)]),extra:f.withCtx(()=>[f.createVNode(d,null,{default:f.withCtx(()=>[f.createVNode(p,{type:"default",onClick:o},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(c.$t("common.btn_cancel")),1)]),_:1}),f.createVNode(p,{type:"primary",onClick:s},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(c.$t("common.btn_ok")),1)]),_:1})]),_:1})]),_:1},8,["title"]),f.createElementVNode("div",HD,[f.createVNode(m,{ref_key:"bpmnViewer",ref:a,data:e.data},null,8,["data"])])])}}}),[["__scopeId","data-v-e763e4dc"]]),zD={class:"wrapper"},WD=bn(f.defineComponent({components:{BusTypeList:EE,BpmnEditPage:VD},__name:"index",setup(e){const t=f.ref("BusTypeList"),n=f.ref(),i=M_(Ko);return f.provide(Ko,i),i.on((r,o)=>{r==="changeComp"&&(t.value=o.comp,n.value=o)}),(r,o)=>{const a=I_;return f.openBlock(),f.createBlock(a,null,{default:f.withCtx(()=>[f.createElementVNode("div",zD,[(f.openBlock(),f.createBlock(f.KeepAlive,{include:"BusTypeList"},[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(f.unref(t)),{data:f.unref(n)},null,8,["data"]))],1024))])]),_:1})}}}),[["__scopeId","data-v-82fb5b00"]]);_p.createPinia();function UD(e){ic().setLang(e)}function GD(e,t){const{i18n:n,pinia:i,theme:r}=t;u_(n);const o=ic();o.setTheme(r),o.setupLangWatcher()}const KD={install:GD};bt.WfManagePage=WD,bt.default=KD,bt.setWorkflowLang=UD,Object.defineProperties(bt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
53
|
+
`+(t instanceof Ro?t.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
|
54
|
+
|
|
55
|
+
The dependencies for this derivation are:
|
|
56
|
+
|
|
57
|
+
`+n.join(`
|
|
58
|
+
`)+`
|
|
59
|
+
*/
|
|
60
|
+
`)()}}function Sy(t,e,n){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+new Array(n).join(" ")+t.name),t.dependencies&&t.dependencies.forEach(function(r){return Sy(r,e,n+1)})}var Ta=function(){function t(e,n,r,i){e===void 0&&(e="Reaction@"+On()),i===void 0&&(i=!1),this.name=e,this.onInvalidate=n,this.errorHandler=r,this.requiresObservable=i,this.observing=[],this.newObserving=[],this.dependenciesState=vt.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+On(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=hr.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,pe.pendingReactions.push(this),Ay())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(gr(),this._isScheduled=!1,Vd(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Kt()&&process.env.NODE_ENV!=="production"&&Yi({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}vr()}},t.prototype.track=function(e){if(!this.isDisposed){gr();var n=Kt(),r;n&&process.env.NODE_ENV!=="production"&&(r=Date.now(),Fn({name:this.name,type:"reaction"})),this._isRunning=!0;var i=hy(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Xd(this),Aa(i)&&this.reportExceptionInDerivation(i.cause),n&&process.env.NODE_ENV!=="production"&&$n({time:Date.now()-r}),vr()}},t.prototype.reportExceptionInDerivation=function(e){var n=this;if(this.errorHandler){this.errorHandler(e,this);return}if(pe.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";pe.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),Kt()&&Yi({type:"error",name:this.name,message:r,error:""+e}),pe.globalReactionErrorHandlers.forEach(function(i){return i(e,n)})},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(gr(),Xd(this),vr()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[ke]=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){e===void 0&&(e=!1),Vk(this,e)},t}(),Cy=100,Kd=function(t){return t()};function Ay(){pe.inBatch>0||pe.isRunningReactions||Kd(Ck)}function Ck(){pe.isRunningReactions=!0;for(var t=pe.pendingReactions,e=0;t.length>0;){++e===Cy&&(console.error("Reaction doesn't converge to a stable state after "+Cy+" iterations."+(" Probably there is a cycle in the reactive function: "+t[0])),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction()}pe.isRunningReactions=!1}var Dl=yi("Reaction",Ta);function Ak(t){var e=Kd;Kd=function(n){return t(function(){return e(n)})}}function Kt(){return process.env.NODE_ENV!=="production"&&!!pe.spyListeners.length}function Yi(t){if(process.env.NODE_ENV!=="production"&&pe.spyListeners.length)for(var e=pe.spyListeners,n=0,r=e.length;n<r;n++)e[n](t)}function Fn(t){if(process.env.NODE_ENV!=="production"){var e=Ot(Ot({},t),{spyReportStart:!0});Yi(e)}}var Ok={spyReportEnd:!0};function $n(t){process.env.NODE_ENV!=="production"&&Yi(t?Ot(Ot({},t),{spyReportEnd:!0}):Ok)}function Tk(t){return process.env.NODE_ENV==="production"?(console.warn("[mobx.spy] Is a no-op in production builds"),function(){}):(pe.spyListeners.push(t),Bd(function(){pe.spyListeners=pe.spyListeners.filter(function(e){return e!==t})}))}function Nk(){He(process.env.NODE_ENV!=="production"&&"@action fields are not reassignable")}function Oy(t){return function(e,n,r){if(r){if(process.env.NODE_ENV!=="production"&&r.get!==void 0)return He("@action cannot be used with getters");if(r.value)return{value:Xi(t,r.value),enumerable:!1,configurable:!0,writable:!0};var i=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Xi(t,i.call(this))}}}return Mk(t).apply(this,arguments)}}function Mk(t){return function(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(i){Co(this,n,U(t,i))}})}}function Dk(t,e,n,r){return r===!0?(qd(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return qd(this,e,n.value||n.initializer.call(this)),this[e]},set:Nk}:{enumerable:!1,configurable:!0,set:function(i){qd(this,e,i)},get:function(){}}}var U=function(e,n,r,i){if(arguments.length===1&&typeof e=="function")return Xi(e.name||"<unnamed action>",e);if(arguments.length===2&&typeof n=="function")return Xi(e,n);if(arguments.length===1&&typeof e=="string")return Oy(e);if(i===!0)Co(e,n,Xi(e.name||n,r.value,this));else return Oy(n).apply(null,arguments)};U.bound=Dk;function Pk(t,e){var n=typeof t=="string"?t:t.name||"<unnamed action>",r=typeof t=="function"?t:e;return process.env.NODE_ENV!=="production"&&(Mt(typeof r=="function"&&r.length===0,"`runInAction` expects a function without arguments"),(typeof n!="string"||!n)&&He("actions should have valid names, got: '"+n+"'")),yy(n,r,this,void 0)}function Rk(t){return typeof t=="function"&&t.isMobxAction===!0}function qd(t,e,n){Co(t,e,Xi(e,n.bind(t)))}function Lk(t,e){e===void 0&&(e=kd),process.env.NODE_ENV!=="production"&&(Mt(typeof t=="function","Autorun expects a function as first argument"),Mt(Rk(t)===!1,"Autorun does not accept actions since actions are untrackable"));var n=e&&e.name||t.name||"Autorun@"+On(),r=!e.scheduler&&!e.delay,i;if(r)i=new Ta(n,function(){this.track(s)},e.onError,e.requiresObservable);else{var o=Ty(e),a=!1;i=new Ta(n,function(){a||(a=!0,o(function(){a=!1,i.isDisposed||i.track(s)}))},e.onError,e.requiresObservable)}function s(){t(i)}return i.schedule(),i.getDisposer()}var Ik=function(t){return t()};function Ty(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:Ik}function Ny(t,e,n){n===void 0&&(n=kd),process.env.NODE_ENV!=="production"&&(Mt(typeof t=="function","First argument to reaction should be a function"),Mt(typeof n=="object","Third argument of reactions should be an object"));var r=n.name||"Reaction@"+On(),i=U(r,n.onError?kk(n.onError,e):e),o=!n.scheduler&&!n.delay,a=Ty(n),s=!0,l=!1,u,c=n.compareStructural?To.structural:n.equals||To.default,d=new Ta(r,function(){s||o?f():l||(l=!0,a(f))},n.onError,n.requiresObservable);function f(){if(l=!1,!d.isDisposed){var h=!1;d.track(function(){var v=t(d);h=s||!c(u,v),u=v}),s&&n.fireImmediately&&i(u,d),!s&&h===!0&&i(u,d),s&&(s=!1)}}return d.schedule(),d.getDisposer()}function kk(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}function Bk(t,e,n){return Dy("onBecomeObserved",t,e)}function My(t,e,n){return Dy("onBecomeUnobserved",t,e)}function Dy(t,e,n,r){var i=Ei(e),o=n,a=t+"Listeners";i[a]?i[a].add(o):i[a]=new Set([o]);var s=i[t];return typeof s!="function"?He(process.env.NODE_ENV!=="production"&&"Not an atom that can be (un)observed"):function(){var l=i[a];l&&(l.delete(o),l.size===0&&delete i[a])}}function jk(t){var e=t.enforceActions,n=t.computedRequiresReaction,r=t.computedConfigurable,i=t.disableErrorBoundaries,o=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(bk(),e!==void 0){(typeof e=="boolean"||e==="strict")&&XI(`Deprecated value for 'enforceActions', use 'false' => '"never"', 'true' => '"observed"', '"strict"' => "'always'" instead`);var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:He("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}pe.enforceActions=l,pe.allowStateChanges=!(l===!0||l==="strict")}n!==void 0&&(pe.computedRequiresReaction=!!n),a!==void 0&&(pe.reactionRequiresObservable=!!a),s!==void 0&&(pe.observableRequiresReaction=!!s,pe.allowStateReads=!pe.observableRequiresReaction),r!==void 0&&(pe.computedConfigurable=!!r),i!==void 0&&(i===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),pe.disableErrorBoundaries=!!i),o&&Ak(o)}function Zd(t,e,n,r){process.env.NODE_ENV!=="production"&&(Mt(arguments.length>=2&&arguments.length<=4,"'extendObservable' expected 2-4 arguments"),Mt(typeof t=="object","'extendObservable' expects an object as first argument"),Mt(!gn(t),"'extendObservable' should not be used on maps, use map.merge instead")),r=Mo(r);var i=Py(r);return Vi(t),ef(t,r.name,i.enhancer),e&&Ry(t,e,n,i),t}function Py(t){return t.defaultDecorator||(t.deep===!1?fy:Ud)}function Ry(t,e,n,r){var i,o,a,s;if(process.env.NODE_ENV!=="production"&&(Mt(!bi(e),"Extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540"),n)){var l=Fd(n);try{for(var u=pr(l),c=u.next();!c.done;c=u.next()){var d=c.value;d in e||He("Trying to declare a decorator for unspecified property '"+Jn(d)+"'")}}catch(y){i={error:y}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}gr();try{var l=ZI(e);try{for(var f=pr(l),h=f.next();!h.done;h=f.next()){var d=h.value,v=Object.getOwnPropertyDescriptor(e,d);process.env.NODE_ENV!=="production"&&(Ui(e)||He("'extendObservable' only accepts plain objects as second argument"),ky(v.value)&&He("Passing a 'computed' as initial property value is no longer supported by extendObservable. Use a getter or decorator instead"));var g=n&&d in n?n[d]:v.get?wl:r;process.env.NODE_ENV!=="production"&&typeof g!="function"&&He("Not a valid decorator for '"+Jn(d)+"', got: "+g);var m=g(t,d,v,!0);m&&Object.defineProperty(t,d,m)}}catch(x){a={error:x}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}}finally{vr()}}function Fk(t,e){return Ly(Ei(t,e))}function Ly(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=GI(t.observing).map(Ly)),e}function Iy(t,e){if(t==null)return!1;if(e!==void 0){if(xr(t)===!1||!t[ke].values.has(e))return!1;var n=Ei(t,e);return Lo(n)}return Lo(t)}function ky(t){return arguments.length>1?He(process.env.NODE_ENV!=="production"&&"isComputed expects only 1 argument. Use isObservableProp to inspect the observability of a property"):Iy(t)}function By(t,e){return typeof e!="string"?He(process.env.NODE_ENV!=="production"&&"isComputed expected a property name as second argument"):Iy(t,e)}function $k(t,e){return t==null?!1:xr(t)||!!t[ke]||$d(t)||Dl(t)||Lo(t)}function bi(t){return arguments.length!==1&&He(process.env.NODE_ENV!=="production"&&"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),$k(t)}function Io(t){return xr(t)?t[ke].getKeys():gn(t)||Qn(t)?Array.from(t.keys()):kr(t)?t.map(function(e,n){return n}):He(process.env.NODE_ENV!=="production"&&"'keys()' can only be used on observable objects, arrays, sets and maps")}function Hk(t){return xr(t)?Io(t).map(function(e){return t[e]}):gn(t)?Io(t).map(function(e){return t.get(e)}):Qn(t)?Array.from(t.values()):kr(t)?t.slice():He(process.env.NODE_ENV!=="production"&&"'values()' can only be used on observable objects, arrays, sets and maps")}function zk(t){return xr(t)?Io(t).map(function(e){return[e,t[e]]}):gn(t)?Io(t).map(function(e){return[e,t.get(e)]}):Qn(t)?Array.from(t.entries()):kr(t)?t.map(function(e,n){return[n,e]}):He(process.env.NODE_ENV!=="production"&&"'entries()' can only be used on observable objects, arrays and maps")}function Jd(t,e,n){if(arguments.length===2&&!Qn(t)){gr();var r=e;try{for(var i in r)Jd(t,i,r[i])}finally{vr()}return}if(xr(t)){var o=t[ke],a=o.values.get(e);a?o.write(e,n):o.addObservableProp(e,n,o.defaultEnhancer)}else if(gn(t))t.set(e,n);else if(Qn(t))t.add(e);else if(kr(t))typeof e!="number"&&(e=parseInt(e,10)),Mt(e>=0,"Not a valid index: '"+e+"'"),gr(),e>=t.length&&(t.length=e+1),t[e]=n,vr();else return He(process.env.NODE_ENV!=="production"&&"'set()' can only be used on observable objects, arrays and maps")}function jy(t,e,n,r){return Wk(t,e,n)}function Wk(t,e,n){return Ll(t).observe(e,n)}var Uk={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function ko(t,e,n,r){return r.detectCycles&&t.set(e,n),n}function xi(t,e,n){if(!e.recurseEverything&&!bi(t)||typeof t!="object")return t;if(t===null)return null;if(t instanceof Date)return t;if(yk(t))return xi(t.get(),e,n);bi(t)&&Io(t);var r=e.detectCycles===!0;if(r&&t!==null&&n.has(t))return n.get(t);if(kr(t)||Array.isArray(t)){var i=ko(n,t,[],e),o=t.map(function(h){return xi(h,e,n)});i.length=o.length;for(var a=0,s=o.length;a<s;a++)i[a]=o[a];return i}if(Qn(t)||Object.getPrototypeOf(t)===Set.prototype)if(e.exportMapsAsObjects===!1){var l=ko(n,t,new Set,e);return t.forEach(function(h){l.add(xi(h,e,n))}),l}else{var u=ko(n,t,[],e);return t.forEach(function(h){u.push(xi(h,e,n))}),u}if(gn(t)||Object.getPrototypeOf(t)===Map.prototype)if(e.exportMapsAsObjects===!1){var c=ko(n,t,new Map,e);return t.forEach(function(h,v){c.set(v,xi(h,e,n))}),c}else{var d=ko(n,t,{},e);return t.forEach(function(h,v){d[v]=xi(h,e,n)}),d}var f=ko(n,t,{},e);return Fd(t).forEach(function(h){f[h]=xi(t[h],e,n)}),f}function mr(t,e){typeof e=="boolean"&&(e={detectCycles:e}),e||(e=Uk),e.detectCycles=e.detectCycles===void 0?e.recurseEverything===!0:e.detectCycles===!0;var n;return e.detectCycles&&(n=new Map),xi(t,e,n)}function Vk(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;typeof t[t.length-1]=="boolean"&&(n=t.pop());var r=Xk(t);if(!r)return He(process.env.NODE_ENV!=="production"&&"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing===hr.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?hr.BREAK:hr.LOG}function Xk(t){switch(t.length){case 0:return pe.trackingDerivation;case 1:return Ei(t[0]);case 2:return Ei(t[0],t[1])}}function yr(t,e){e===void 0&&(e=void 0),gr();try{return t.apply(e)}finally{vr()}}function Pl(t){return t[ke]}function Rl(t){return typeof t=="string"||typeof t=="number"||typeof t=="symbol"}var Gk={has:function(t,e){if(e===ke||e==="constructor"||e===_l)return!0;var n=Pl(t);return Rl(e)?n.has(e):e in t},get:function(t,e){if(e===ke||e==="constructor"||e===_l)return t[e];var n=Pl(t),r=n.values.get(e);if(r instanceof Oo){var i=r.get();return i===void 0&&n.has(e),i}return Rl(e)&&n.has(e),t[e]},set:function(t,e,n){return Rl(e)?(Jd(t,e,n),!0):!1},deleteProperty:function(t,e){if(!Rl(e))return!1;var n=Pl(t);return n.remove(e),!0},ownKeys:function(t){var e=Pl(t);return e.keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return He("Dynamic observable objects cannot be frozen"),!1}};function Yk(t){var e=new Proxy(t,Gk);return t[ke].proxy=e,e}function Lr(t){return t.interceptors!==void 0&&t.interceptors.length>0}function Na(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),Bd(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function Ir(t,e){var n=Po();try{for(var r=Wd(t.interceptors||[]),i=0,o=r.length;i<o&&(e=r[i](e),Mt(!e||e.type,"Intercept handlers should return nothing or a change object"),!!e);i++);return e}finally{_i(n)}}function _r(t){return t.changeListeners!==void 0&&t.changeListeners.length>0}function Ma(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),Bd(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function br(t,e){var n=Po(),r=t.changeListeners;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](e);_i(n)}}var Kk=1e4,qk={get:function(t,e){return e===ke?t[ke]:e==="length"?t[ke].getArrayLength():typeof e=="number"?ti.get.call(t,e):typeof e=="string"&&!isNaN(e)?ti.get.call(t,parseInt(e)):ti.hasOwnProperty(e)?ti[e]:t[e]},set:function(t,e,n){return e==="length"&&t[ke].setArrayLength(n),typeof e=="number"&&ti.set.call(t,e,n),typeof e=="symbol"||isNaN(e)?t[e]=n:ti.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return He("Observable arrays cannot be frozen"),!1}};function Zk(t,e,n,r){n===void 0&&(n="ObservableArray@"+On()),r===void 0&&(r=!1);var i=new Fy(n,e,r);KI(i.values,ke,i);var o=new Proxy(i.values,qk);if(i.proxy=o,t&&t.length){var a=Al(!0);i.spliceWithArray(0,0,t),Ol(a)}return o}var Fy=function(){function t(e,n,r){this.owned=r,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new Oo(e||"ObservableArray@"+On()),this.enhancer=function(i,o){return n(i,o,e+"[..]")}}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.dehanceValues=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.prototype.intercept=function(e){return Na(this,e)},t.prototype.observe=function(e,n){return n===void 0&&(n=!1),n&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ma(this,e)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(e){if(typeof e!="number"||e<0)throw new Error("[mobx.array] Out of range: "+e);var n=this.values.length;if(e!==n)if(e>n){for(var r=new Array(e-n),i=0;i<e-n;i++)r[i]=void 0;this.spliceWithArray(n,0,r)}else this.spliceWithArray(e,n-e)},t.prototype.updateArrayLength=function(e,n){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=n},t.prototype.spliceWithArray=function(e,n,r){var i=this;Do(this.atom);var o=this.values.length;if(e===void 0?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),arguments.length===1?n=o-e:n==null?n=0:n=Math.max(0,Math.min(n,o-e)),r===void 0&&(r=ml),Lr(this)){var a=Ir(this,{object:this.proxy,type:"splice",index:e,removedCount:n,added:r});if(!a)return ml;n=a.removedCount,r=a.added}if(r=r.length===0?r:r.map(function(u){return i.enhancer(u,void 0)}),process.env.NODE_ENV!=="production"){var s=r.length-n;this.updateArrayLength(o,s)}var l=this.spliceItemsIntoValues(e,n,r);return(n!==0||r.length!==0)&&this.notifyArraySplice(e,r,l),this.dehanceValues(l)},t.prototype.spliceItemsIntoValues=function(e,n,r){var i;if(r.length<Kk)return(i=this.values).splice.apply(i,Wd([e,n],r));var o=this.values.slice(e,e+n);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+n)),o},t.prototype.notifyArrayChildUpdate=function(e,n,r){var i=!this.owned&&Kt(),o=_r(this),a=o||i?{object:this.proxy,type:"update",index:e,newValue:n,oldValue:r}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.atom.name})),this.atom.reportChanged(),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()},t.prototype.notifyArraySplice=function(e,n,r){var i=!this.owned&&Kt(),o=_r(this),a=o||i?{object:this.proxy,type:"splice",index:e,removed:r,added:n,removedCount:r.length,addedCount:n.length}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.atom.name})),this.atom.reportChanged(),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()},t}(),ti={intercept:function(t){return this[ke].intercept(t)},observe:function(t,e){e===void 0&&(e=!1);var n=this[ke];return n.observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[ke];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=this[ke];switch(arguments.length){case 0:return[];case 1:return i.spliceWithArray(t);case 2:return i.spliceWithArray(t,e)}return i.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){var r=this[ke];return r.spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[ke];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[ke].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[ke];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){process.env.NODE_ENV!=="production"&&console.warn("[mobx] `observableArray.reverse()` will not update the array in place. Use `observableArray.slice().reverse()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().reverse())` to reverse & update in place");var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){process.env.NODE_ENV!=="production"&&console.warn("[mobx] `observableArray.sort()` will not update the array in place. Use `observableArray.slice().sort()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().sort())` to sort & update in place");var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[ke],n=e.dehanceValues(e.values).indexOf(t);return n>-1?(this.splice(n,1),!0):!1},get:function(t){var e=this[ke];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[ke],r=n.values;if(t<r.length){Do(n.atom);var i=r[t];if(Lr(n)){var o=Ir(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!o)return;e=o.newValue}e=n.enhancer(e,i);var a=e!==i;a&&(r[t]=e,n.notifyArrayChildUpdate(t,e,i))}else if(t===r.length)n.spliceWithArray(t,0,[e]);else throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length)}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach(function(t){typeof Array.prototype[t]=="function"&&(ti[t]=function(){var e=this[ke];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})}),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach(function(t){typeof Array.prototype[t]=="function"&&(ti[t]=function(e,n){var r=this,i=this[ke];i.atom.reportObserved();var o=i.dehanceValues(i.values);return o[t](function(a,s){return e.call(n,a,s,r)},n)})}),["reduce","reduceRight"].forEach(function(t){ti[t]=function(){var e=this,n=this[ke];n.atom.reportObserved();var r=arguments[0];return arguments[0]=function(i,o,a){return o=n.dehanceValue(o),r(i,o,a,e)},n.values[t].apply(n.values,arguments)}});var Jk=yi("ObservableArrayAdministration",Fy);function kr(t){return jd(t)&&Jk(t[ke])}var $y,Qk={},Qd=function(){function t(e,n,r){if(n===void 0&&(n=Sa),r===void 0&&(r="ObservableMap@"+On()),this.enhancer=n,this.name=r,this[$y]=Qk,this._keysAtom=Hd(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return t.prototype._has=function(e){return this._data.has(e)},t.prototype.has=function(e){var n=this;if(!pe.trackingDerivation)return this._has(e);var r=this._hasMap.get(e);if(!r){var i=r=new Gi(this._has(e),bl,this.name+"."+Jn(e)+"?",!1);this._hasMap.set(e,i),My(i,function(){return n._hasMap.delete(e)})}return r.get()},t.prototype.set=function(e,n){var r=this._has(e);if(Lr(this)){var i=Ir(this,{type:r?"update":"add",object:this,newValue:n,name:e});if(!i)return this;n=i.newValue}return r?this._updateValue(e,n):this._addValue(e,n),this},t.prototype.delete=function(e){var n=this;if(Do(this._keysAtom),Lr(this)){var r=Ir(this,{type:"delete",object:this,name:e});if(!r)return!1}if(this._has(e)){var i=Kt(),o=_r(this),r=o||i?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},r),{name:this.name,key:e})),yr(function(){n._keysAtom.reportChanged(),n._updateHasMapEntry(e,!1);var s=n._data.get(e);s.setNewValue(void 0),n._data.delete(e)}),o&&br(this,r),i&&process.env.NODE_ENV!=="production"&&$n(),!0}return!1},t.prototype._updateHasMapEntry=function(e,n){var r=this._hasMap.get(e);r&&r.setNewValue(n)},t.prototype._updateValue=function(e,n){var r=this._data.get(e);if(n=r.prepareNewValue(n),n!==pe.UNCHANGED){var i=Kt(),o=_r(this),a=o||i?{type:"update",object:this,oldValue:r.value,name:e,newValue:n}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.name,key:e})),r.setNewValue(n),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()}},t.prototype._addValue=function(e,n){var r=this;Do(this._keysAtom),yr(function(){var s=new Gi(n,r.enhancer,r.name+"."+Jn(e),!1);r._data.set(e,s),n=s.value,r._updateHasMapEntry(e,!0),r._keysAtom.reportChanged()});var i=Kt(),o=_r(this),a=o||i?{type:"add",object:this,name:e,newValue:n}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.name,key:e})),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()},t.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var e=this,n=this.keys();return Il({next:function(){var r=n.next(),i=r.done,o=r.value;return{done:i,value:i?void 0:e.get(o)}}})},t.prototype.entries=function(){var e=this,n=this.keys();return Il({next:function(){var r=n.next(),i=r.done,o=r.value;return{done:i,value:i?void 0:[o,e.get(o)]}}})},t.prototype[$y=ke,Symbol.iterator]=function(){return this.entries()},t.prototype.forEach=function(e,n){var r,i;try{for(var o=pr(this),a=o.next();!a.done;a=o.next()){var s=No(a.value,2),l=s[0],u=s[1];e.call(n,u,l,this)}}catch(c){r={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},t.prototype.merge=function(e){var n=this;return gn(e)&&(e=e.toJS()),yr(function(){var r=Al(!0);try{Ui(e)?Fd(e).forEach(function(i){return n.set(i,e[i])}):Array.isArray(e)?e.forEach(function(i){var o=No(i,2),a=o[0],s=o[1];return n.set(a,s)}):Ao(e)?(e.constructor!==Map&&He("Cannot initialize from classes that inherit from Map: "+e.constructor.name),e.forEach(function(i,o){return n.set(o,i)})):e!=null&&He("Cannot initialize map from "+e)}finally{Ol(r)}}),this},t.prototype.clear=function(){var e=this;yr(function(){gy(function(){var n,r;try{for(var i=pr(e.keys()),o=i.next();!o.done;o=i.next()){var a=o.value;e.delete(a)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}})})},t.prototype.replace=function(e){var n=this;return yr(function(){var r,i,o,a,s=YI(e),l=new Map,u=!1;try{for(var c=pr(n._data.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(!s.has(f)){var h=n.delete(f);if(h)u=!0;else{var v=n._data.get(f);l.set(f,v)}}}}catch(M){r={error:M}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}try{for(var g=pr(s.entries()),m=g.next();!m.done;m=g.next()){var y=No(m.value,2),f=y[0],v=y[1],x=n._data.has(f);if(n.set(f,v),n._data.has(f)){var E=n._data.get(f);l.set(f,E),x||(u=!0)}}}catch(M){o={error:M}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}if(!u)if(n._data.size!==l.size)n._keysAtom.reportChanged();else for(var b=n._data.keys(),T=l.keys(),A=b.next(),S=T.next();!A.done;){if(A.value!==S.value){n._keysAtom.reportChanged();break}A=b.next(),S=T.next()}n._data=l}),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var e,n,r={};try{for(var i=pr(this),o=i.next();!o.done;o=i.next()){var a=No(o.value,2),s=a[0],l=a[1];r[typeof s=="symbol"?s:Jn(s)]=l}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var e=this;return this.name+"[{ "+Array.from(this.keys()).map(function(n){return Jn(n)+": "+(""+e.get(n))}).join(", ")+" }]"},t.prototype.observe=function(e,n){return process.env.NODE_ENV!=="production"&&Mt(n!==!0,"`observe` doesn't support fireImmediately=true in combination with maps."),Ma(this,e)},t.prototype.intercept=function(e){return Na(this,e)},t}(),gn=yi("ObservableMap",Qd),Hy,eB={},zy=function(){function t(e,n,r){if(n===void 0&&(n=Sa),r===void 0&&(r="ObservableSet@"+On()),this.name=r,this[Hy]=eB,this._data=new Set,this._atom=Hd(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(i,o){return n(i,o,r)},e&&this.replace(e)}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.clear=function(){var e=this;yr(function(){gy(function(){var n,r;try{for(var i=pr(e._data.values()),o=i.next();!o.done;o=i.next()){var a=o.value;e.delete(a)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}})})},t.prototype.forEach=function(e,n){var r,i;try{for(var o=pr(this),a=o.next();!a.done;a=o.next()){var s=a.value;e.call(n,s,s,this)}}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(e){var n=this;if(Do(this._atom),Lr(this)){var r=Ir(this,{type:"add",object:this,newValue:e});if(!r)return this}if(!this.has(e)){yr(function(){n._data.add(n.enhancer(e,void 0)),n._atom.reportChanged()});var i=Kt(),o=_r(this),r=o||i?{type:"add",object:this,newValue:e}:null;i&&process.env.NODE_ENV!=="production"&&Fn(r),o&&br(this,r),i&&process.env.NODE_ENV!=="production"&&$n()}return this},t.prototype.delete=function(e){var n=this;if(Lr(this)){var r=Ir(this,{type:"delete",object:this,oldValue:e});if(!r)return!1}if(this.has(e)){var i=Kt(),o=_r(this),r=o||i?{type:"delete",object:this,oldValue:e}:null;return i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},r),{name:this.name})),yr(function(){n._atom.reportChanged(),n._data.delete(e)}),o&&br(this,r),i&&process.env.NODE_ENV!=="production"&&$n(),!0}return!1},t.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},t.prototype.entries=function(){var e=0,n=Array.from(this.keys()),r=Array.from(this.values());return Il({next:function(){var i=e;return e+=1,i<r.length?{value:[n[i],r[i]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var e=this,n=0,r=Array.from(this._data.values());return Il({next:function(){return n<r.length?{value:e.dehanceValue(r[n++]),done:!1}:{done:!0}}})},t.prototype.replace=function(e){var n=this;return Qn(e)&&(e=e.toJS()),yr(function(){var r=Al(!0);try{Array.isArray(e)?(n.clear(),e.forEach(function(i){return n.add(i)})):Ea(e)?(n.clear(),e.forEach(function(i){return n.add(i)})):e!=null&&He("Cannot initialize set from "+e)}finally{Ol(r)}}),this},t.prototype.observe=function(e,n){return process.env.NODE_ENV!=="production"&&Mt(n!==!0,"`observe` doesn't support fireImmediately=true in combination with sets."),Ma(this,e)},t.prototype.intercept=function(e){return Na(this,e)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[Hy=ke,Symbol.iterator]=function(){return this.values()},t}(),Qn=yi("ObservableSet",zy),Wy=function(){function t(e,n,r,i){n===void 0&&(n=new Map),this.target=e,this.values=n,this.name=r,this.defaultEnhancer=i,this.keysAtom=new Oo(r+".keys")}return t.prototype.read=function(e){return this.values.get(e).get()},t.prototype.write=function(e,n){var r=this.target,i=this.values.get(e);if(i instanceof Ro){i.set(n);return}if(Lr(this)){var o=Ir(this,{type:"update",object:this.proxy||r,name:e,newValue:n});if(!o)return;n=o.newValue}if(n=i.prepareNewValue(n),n!==pe.UNCHANGED){var a=_r(this),s=Kt(),o=a||s?{type:"update",object:this.proxy||r,oldValue:i.value,name:e,newValue:n}:null;s&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},o),{name:this.name,key:e})),i.setNewValue(n),a&&br(this,o),s&&process.env.NODE_ENV!=="production"&&$n()}},t.prototype.has=function(e){var n=this.pendingKeys||(this.pendingKeys=new Map),r=n.get(e);if(r)return r.get();var i=!!this.values.get(e);return r=new Gi(i,bl,this.name+"."+Jn(e)+"?",!1),n.set(e,r),r.get()},t.prototype.addObservableProp=function(e,n,r){r===void 0&&(r=this.defaultEnhancer);var i=this.target;if(qI(i,e),Lr(this)){var o=Ir(this,{object:this.proxy||i,name:e,type:"add",newValue:n});if(!o)return;n=o.newValue}var a=new Gi(n,r,this.name+"."+Jn(e),!1);this.values.set(e,a),n=a.value,Object.defineProperty(i,e,tB(e)),this.notifyPropertyAddition(e,n)},t.prototype.addComputedProp=function(e,n,r){var i=this.target;r.name=r.name||this.name+"."+Jn(n),this.values.set(n,new Ro(r)),(e===i||sy(e,n))&&Object.defineProperty(e,n,nB(n))},t.prototype.remove=function(e){if(this.values.has(e)){var n=this.target;if(Lr(this)){var r=Ir(this,{object:this.proxy||n,name:e,type:"remove"});if(!r)return}try{gr();var i=_r(this),o=Kt(),a=this.values.get(e),s=a&&a.get();if(a&&a.set(void 0),this.keysAtom.reportChanged(),this.values.delete(e),this.pendingKeys){var l=this.pendingKeys.get(e);l&&l.set(!1)}delete this.target[e];var r=i||o?{type:"remove",object:this.proxy||n,oldValue:s,name:e}:null;o&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},r),{name:this.name,key:e})),i&&br(this,r),o&&process.env.NODE_ENV!=="production"&&$n()}finally{vr()}}},t.prototype.illegalAccess=function(e,n){console.warn("Property '"+n+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(e,n){return process.env.NODE_ENV!=="production"&&Mt(n!==!0,"`observe` doesn't support the fire immediately property for observable objects."),Ma(this,e)},t.prototype.intercept=function(e){return Na(this,e)},t.prototype.notifyPropertyAddition=function(e,n){var r=_r(this),i=Kt(),o=r||i?{type:"add",object:this.proxy||this.target,name:e,newValue:n}:null;if(i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},o),{name:this.name,key:e})),r&&br(this,o),i&&process.env.NODE_ENV!=="production"&&$n(),this.pendingKeys){var a=this.pendingKeys.get(e);a&&a.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var e,n;this.keysAtom.reportObserved();var r=[];try{for(var i=pr(this.values),o=i.next();!o.done;o=i.next()){var a=No(o.value,2),s=a[0],l=a[1];l instanceof Gi&&r.push(s)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t}();function ef(t,e,n){if(e===void 0&&(e=""),n===void 0&&(n=Sa),Object.prototype.hasOwnProperty.call(t,ke))return t[ke];process.env.NODE_ENV!=="production"&&Mt(Object.isExtensible(t),"Cannot make the designated object observable; it is not extensible"),Ui(t)||(e=(t.constructor.name||"ObservableObject")+"@"+On()),e||(e="ObservableObject@"+On());var r=new Wy(t,new Map,Jn(e),n);return Co(t,ke,r),r}var Uy=Object.create(null),Vy=Object.create(null);function tB(t){return Uy[t]||(Uy[t]={configurable:!0,enumerable:!0,get:function(){return this[ke].read(t)},set:function(e){this[ke].write(t,e)}})}function Xy(t){var e=t[ke];return e||(Vi(t),t[ke])}function nB(t){return Vy[t]||(Vy[t]={configurable:pe.computedConfigurable,enumerable:!1,get:function(){return Xy(this).read(t)},set:function(e){Xy(this).write(t,e)}})}var rB=yi("ObservableObjectAdministration",Wy);function xr(t){return jd(t)?(Vi(t),rB(t[ke])):!1}function Ei(t,e){if(typeof t=="object"&&t!==null){if(kr(t))return e!==void 0&&He(process.env.NODE_ENV!=="production"&&"It is not possible to get index atoms from arrays"),t[ke].atom;if(Qn(t))return t[ke];if(gn(t)){var n=t;if(e===void 0)return n._keysAtom;var r=n._data.get(e)||n._hasMap.get(e);return r||He(process.env.NODE_ENV!=="production"&&"the entry '"+e+"' does not exist in the observable map '"+tf(t)+"'"),r}if(Vi(t),e&&!t[ke]&&t[e],xr(t)){if(!e)return He(process.env.NODE_ENV!=="production"&&"please specify a property");var r=t[ke].values.get(e);return r||He(process.env.NODE_ENV!=="production"&&"no observable property '"+e+"' found on the observable object '"+tf(t)+"'"),r}if($d(t)||Lo(t)||Dl(t))return t}else if(typeof t=="function"&&Dl(t[ke]))return t[ke];return He(process.env.NODE_ENV!=="production"&&"Cannot obtain atom from "+t)}function Ll(t,e){if(t||He("Expecting some object"),e!==void 0)return Ll(Ei(t,e));if($d(t)||Lo(t)||Dl(t)||gn(t)||Qn(t))return t;if(Vi(t),t[ke])return t[ke];He(process.env.NODE_ENV!=="production"&&"Cannot obtain administration from "+t)}function tf(t,e){var n;return e!==void 0?n=Ei(t,e):xr(t)||gn(t)||Qn(t)?n=Ll(t):n=Ei(t),n.name}var Gy=Object.prototype.toString;function Yy(t,e,n){return n===void 0&&(n=-1),nf(t,e,n)}function nf(t,e,n,r,i){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var o=typeof t;if(o!=="function"&&o!=="object"&&typeof e!="object")return!1;var a=Gy.call(t);if(a!==Gy.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=Ky(t),e=Ky(e);var s=a==="[object Array]";if(!s){if(typeof t!="object"||typeof e!="object")return!1;var l=t.constructor,u=e.constructor;if(l!==u&&!(typeof l=="function"&&l instanceof l&&typeof u=="function"&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var c=r.length;c--;)if(r[c]===t)return i[c]===e;if(r.push(t),i.push(e),s){if(c=t.length,c!==e.length)return!1;for(;c--;)if(!nf(t[c],e[c],n-1,r,i))return!1}else{var d=Object.keys(t),f=void 0;if(c=d.length,Object.keys(e).length!==c)return!1;for(;c--;)if(f=d[c],!(iB(e,f)&&nf(t[f],e[f],n-1,r,i)))return!1}return r.pop(),i.pop(),!0}function Ky(t){return kr(t)?t.slice():Ao(t)||gn(t)||Ea(t)||Qn(t)?Array.from(t.entries()):t}function iB(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Il(t){return t[Symbol.iterator]=oB,t}function oB(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");try{process.env.NODE_ENV}catch{var qy=Nl();typeof process>"u"&&(qy.process={}),qy.process.env={}}(function(){function t(){}if(t.name!=="testCodeMinification"&&process.env.NODE_ENV!=="production"&&typeof process<"u"&&process.env.IGNORE_MOBX_MINIFY_WARNING!=="true"){var e=["process","env","NODE_ENV"].join(".");console.warn("[mobx] you are running a minified build, but '"+e+"' was not set to 'production' in your bundler. This results in an unnecessarily large and slow bundle")}})(),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Tk,extras:{getDebugName:tf},$mobx:ke});function aB(t){return!(t.prototype&&t.prototype.render)&&!Qe.isPrototypeOf(t)}function Zy(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.prefix,r=n===void 0?"":n,i=e.suffix,o=i===void 0?"":i,a=t.displayName||t.name||t.constructor&&t.constructor.name||"<component>";return r+a+o}var Jy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qy=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e_=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),t_=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},n_=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},r_=console;function sB(t){var e=Yd().allowStateChanges;return Yd().allowStateChanges=t,e}function lB(t){Yd().allowStateChanges=t}function uB(t,e,n,r,i){var o=sB(t),a=void 0;try{a=e(n,r,i)}finally{lB(o)}return a}function i_(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=t[e],i=a_[e],o=r?n===!0?function(){i.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),i.apply(this,arguments)}:i;t[e]=o}function o_(t,e){if(t==null||e==null||(typeof t>"u"?"undefined":Jy(t))!=="object"||(typeof e>"u"?"undefined":Jy(e))!=="object")return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var r=void 0,i=n.length-1;r=n[i];i--)if(e[r]!==t[r])return!0;return!1}var a_={componentWillMount:function(){var e=this,n=Zy(this),r=!1,i=!1;function o(d){var f=this[d],h=Hd("reactive "+d);Object.defineProperty(this,d,{configurable:!0,enumerable:!0,get:function(){return h.reportObserved(),f},set:function(g){!i&&o_(f,g)?(f=g,r=!0,h.reportChanged(),r=!1):f=g}})}o.call(this,"props"),o.call(this,"state");var a=this.render.bind(this),s=null,l=!1,u=function(){return s=new Ta(n+".render()",function(){if(!l&&(l=!0,typeof e.componentWillReact=="function"&&e.componentWillReact(),e.__$mobxIsUnmounted!==!0)){var f=!0;try{i=!0,r||Qe.prototype.forceUpdate.call(e),f=!1}finally{i=!1,f&&s.dispose()}}}),s.reactComponent=e,c.$mobx=s,e.render=c,c(e.props,e.state,e.context)},c=function(f,h,v){l=!1;var g=void 0,m=void 0;if(s.track(function(){try{m=uB(!1,a,f,h,v)}catch(y){g=y}}),g)throw g;return m};this.render=u},componentWillUnmount:function(){this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(e,n){return this.state!==n?!0:o_(this.props,e)}};function rf(t){if(arguments.length>1&&r_.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),t.isMobxInjector===!0&&r_.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),aB(t)){var e,n;return rf((n=e=function(i){t_(o,i);function o(){return Qy(this,o),n_(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return e_(o,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),o}(Qe),e.displayName=Zy(t),n))}if(!t)throw new Error("Please pass a valid component to 'observer'");var r=t.prototype||t;return cB(r),t.isMobXReactObserver=!0,t}function cB(t){i_(t,"componentWillMount",!0),i_(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=a_.shouldComponentUpdate)}var dB=rf(function(t){var e=t.children;return e[0]()});dB.displayName="Observer";var fB=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pB(t,e){return e={exports:{}},t(e,e.exports),e.exports}pB(function(t,e){(function(n,r){t.exports=r()})(fB,function(){var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i=Object.defineProperty,o=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,u=l&&l(Object);return function c(d,f,h){if(typeof f!="string"){if(u){var v=l(f);v&&v!==u&&c(d,v,h)}var g=o(f);a&&(g=g.concat(a(f)));for(var m=0;m<g.length;++m){var y=g[m];if(!n[y]&&!r[y]&&(!h||!h[y])){var x=s(f,y);try{i(d,y,x)}catch{}}}return d}return d}})});var s_={children:!0,key:!0,ref:!0},l_=console;if(function(t){t_(e,t);function e(){return Qy(this,e),n_(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return e_(e,[{key:"render",value:function(r){var i=r.children;return i.length>1?Te("div",null," ",i," "):i[0]}},{key:"getChildContext",value:function(){var r={},i=this.context.mobxStores;if(i)for(var o in i)r[o]=i[o];for(var a in this.props)!s_[a]&&a!=="suppressChangedStoreWarning"&&(r[a]=this.props[a]);return{mobxStores:r}}},{key:"componentWillReceiveProps",value:function(r){if(Object.keys(r).length!==Object.keys(this.props).length&&l_.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!r.suppressChangedStoreWarning)for(var i in r)!s_[i]&&this.props[i]!==r[i]&&l_.warn("MobX Provider: Provided store '"+i+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e}(Qe),!Qe)throw new Error("mobx-preact requires Preact to be available");var Br,of,u_,c_=[],qt=qe,d_=qt.__b,f_=qt.__r,p_=qt.diffed,h_=qt.__c,g_=qt.unmount,v_=qt.__;function hB(){for(var t;t=c_.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(kl),t.__H.__h.forEach(af),t.__H.__h=[]}catch(e){t.__H.__h=[],qt.__e(e,t.__v)}}qt.__b=function(t){Br=null,d_&&d_(t)},qt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),v_&&v_(t,e)},qt.__r=function(t){f_&&f_(t);var e=(Br=t.__c).__H;e&&(of===Br?(e.__h=[],Br.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(kl),e.__h.forEach(af),e.__h=[])),of=Br},qt.diffed=function(t){p_&&p_(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(c_.push(e)!==1&&u_===qt.requestAnimationFrame||((u_=qt.requestAnimationFrame)||gB)(hB)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),of=Br=null},qt.__c=function(t,e){e.some(function(n){try{n.__h.forEach(kl),n.__h=n.__h.filter(function(r){return!r.__||af(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],qt.__e(r,n.__v)}}),h_&&h_(t,e)},qt.unmount=function(t){g_&&g_(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{kl(r)}catch(i){e=i}}),n.__H=void 0,e&&qt.__e(e,n.__v))};var m_=typeof requestAnimationFrame=="function";function gB(t){var e,n=function(){clearTimeout(r),m_&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);m_&&(e=requestAnimationFrame(n))}function kl(t){var e=Br,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Br=e}function af(t){var e=Br;t.__c=t.__(),Br=e}function vB(t,e){for(var n in e)t[n]=e[n];return t}function y_(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function __(t,e){this.props=t,this.context=e}(__.prototype=new Qe).isPureReactComponent=!0,__.prototype.shouldComponentUpdate=function(t,e){return y_(this.props,t)||y_(this.state,e)};var b_=qe.__b;qe.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),b_&&b_(t)};var mB=qe.__e;qe.__e=function(t,e,n,r){if(t.then){for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e)}mB(t,e,n,r)};var x_=qe.unmount;function E_(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=vB({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return E_(r,e,n)})),t}function w_(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return w_(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function sf(){this.__u=0,this.o=null,this.__b=null}function S_(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Bl(){this.i=null,this.l=null}qe.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),x_&&x_(t)},(sf.prototype=new Qe).__c=function(t,e){var n=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var i=S_(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=w_(l,l.__c.__P,l.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},sf.prototype.componentWillUnmount=function(){this.o=[]},sf.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=E_(this.__b,n,r.__O=r.__P)}this.__b=null}var i=e.__a&&Te(wo,null,t.fallback);return i&&(i.__u&=-33),[Te(wo,null,e.__a?null:t.children),i]};var C_=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(Bl.prototype=new Qe).__a=function(t){var e=this,n=S_(e.__v),r=e.l.get(t);return r[0]++,function(i){var o=function(){e.props.revealOrder?(r.push(i),C_(e,t,r)):i()};n?n(o):o()}},Bl.prototype.render=function(t){this.i=null,this.l=new Map;var e=gl(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},Bl.prototype.componentDidUpdate=Bl.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){C_(t,n,e)})};var yB=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_B=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,bB=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,xB=/[A-Z0-9]/g,EB=typeof document<"u",wB=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function A_(t,e,n){return e.__k==null&&(e.textContent=""),UI(t,e),typeof n=="function"&&n(),t?t.__c:null}Qe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Qe.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var O_=qe.event;function SB(){}function CB(){return this.cancelBubble}function AB(){return this.defaultPrevented}qe.event=function(t){return O_&&(t=O_(t)),t.persist=SB,t.isPropagationStopped=CB,t.isDefaultPrevented=AB,t.nativeEvent=t};var OB={enumerable:!1,configurable:!0,get:function(){return this.class}},T_=qe.vnode;qe.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,r=e.type,i={},o=r.indexOf("-")===-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||EB&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||wB(n.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":bB.test(a)&&(a=l):l=a="oninput":o&&_B.test(a)?a=a.replace(xB,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&i[a=l]&&(a="oninputCapture"),i[a]=s}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=gl(n.children).forEach(function(u){u.props.selected=i.value.indexOf(u.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=gl(n.children).forEach(function(u){u.props.selected=i.multiple?i.defaultValue.indexOf(u.props.value)!=-1:i.defaultValue==u.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",OB)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),e.props=i}(t),t.$$typeof=yB,T_&&T_(t)};var N_=qe.__r;qe.__r=function(t){N_&&N_(t),t.__c};var M_=qe.diffed;qe.diffed=function(t){M_&&M_(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value)};var TB=0;function V(t,e,n,r,i,o){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?a=e[s]:l[s]=e[s];var u={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--TB,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return qe.vnode&&qe.vnode(u),u}var NB=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Da;(function(t){function e(n){var r=NB(n,[]),i=n.container;if(!i)throw new Error("Ensure the container of LogicFlow is specified and valid.");return ut({},t.defaults,r)}t.get=e})(Da||(Da={})),function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}}(Da||(Da={}));var D_={node:!1,edge:!1},MB={node:!0,edge:!0},DB=function(t){return!t||typeof t=="boolean"?Pe(t===!0?MB:D_):zi(Pe(D_),t)},PB=function(){return ui(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null};function sn(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}var P_=200,RB=9999,LB=10,lt;(function(t){t[t.DEFAULT=1]="DEFAULT",t[t.TEXT_EDIT=2]="TEXT_EDIT",t[t.SHOW_MENU=3]="SHOW_MENU",t[t.ALLOW_CONNECT=4]="ALLOW_CONNECT",t[t.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(lt||(lt={}));var Lt;(function(t){t.NODE="node",t.EDGE="edge",t.GRAPH="graph"})(Lt||(Lt={}));var Ye;(function(t){t.NODE="node",t.CIRCLE_NODE="circle-node",t.POLYGON_NODE="polygon-node",t.RECT_NODE="rect-node",t.TEXT_NODE="text-node",t.ELLIPSE_NODE="ellipse-node",t.DIAMOND_NODE="diamond-node",t.HTML_NODE="html-node",t.CUSTOM_HTML_NODE="custom-html-node",t.EDGE="edge",t.LINE_EDGE="line-edge",t.POLYLINE_EDGE="polyline-edge",t.BEZIER_EDGE="bezier-edge",t.GRAPH="graph"})(Ye||(Ye={}));var be;(function(t){t.ELEMENT_CLICK="element:click",t.NODE_ADD="node:add",t.NODE_DELETE="node:delete",t.NODE_CLICK="node:click",t.NODE_DBCLICK="node:dbclick",t.NODE_GROUP_COPY="node:group-copy-add",t.NODE_DND_ADD="node:dnd-add",t.NODE_DND_DRAG="node:dnd-drag",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DROP="node:drop",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_ROTATE="node:rotate",t.NODE_RESIZE="node:resize",t.NODE_FOCUS="node:focus",t.NODE_BLUR="node:blur",t.NODE_PROPERTIES_CHANGE="node:properties-change",t.NODE_PROPERTIES_DELETE="node:properties-delete",t.EDGE_ADD="edge:add",t.EDGE_DELETE="edge:delete",t.EDGE_CLICK="edge:click",t.EDGE_DBCLICK="edge:dbclick",t.EDGE_FOCUS="edge:focus",t.EDGE_BLUR="edge:blur",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_ADJUST="edge:adjust",t.EDGE_EXCHANGE_NODE="edge:exchange-node",t.ANCHOR_CLICK="anchor:click",t.ANCHOR_MOUSEDOWN="anchor:mousedown",t.ANCHOR_DRAGSTART="anchor:dragstart",t.ANCHOR_DRAG="anchor:drag",t.ANCHOR_DROP="anchor:drop",t.ANCHOR_DRAGEND="anchor:dragend",t.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",t.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",t.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",t.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",t.ADJUST_POINT_DRAG="adjustPoint:drag",t.ADJUST_POINT_DROP="adjustPoint:drop",t.ADJUST_POINT_DRAGEND="adjustPoint:dragend",t.BLANK_MOUSEDOWN="blank:mousedown",t.BLANK_DRAGSTART="blank:dragstart",t.BLANK_DRAG="blank:drag",t.BLANK_DROP="blank:drop",t.BLANK_MOUSEMOVE="blank:mousemove",t.BLANK_CANVAS_MOUSEMOVE="blank:canvas-mousemove",t.BLANK_MOUSEUP="blank:mouseup",t.BLANK_CLICK="blank:click",t.BLANK_CONTEXTMENU="blank:contextmenu",t.SELECTION_MOUSEDOWN="selection:mousedown",t.SELECTION_DRAGSTART="selection:dragstart",t.SELECTION_DRAG="selection:drag",t.SELECTION_DROP="selection:drop",t.SELECTION_MOUSEMOVE="selection:mousemove",t.SELECTION_MOUSEUP="selection:mouseup",t.SELECTION_CONTEXTMENU="selection:contextmenu",t.CONNECTION_NOT_ALLOWED="connection:not-allowed",t.TEXT_MOUSEDOWN="text:mousedown",t.TEXT_DRAGSTART="text:dragstart",t.TEXT_DRAG="text:drag",t.TEXT_DROP="text:drop",t.TEXT_CLICK="text:click",t.TEXT_DBCLICK="text:dbclick",t.TEXT_BLUR="text:blur",t.TEXT_MOUSEMOVE="text:mousemove",t.TEXT_MOUSEUP="text:mouseup",t.TEXT_FOCUS="text:focus",t.TEXT_ADD="text:add",t.TEXT_UPDATE="text:update",t.TEXT_CLEAR="text:clear",t.LABEL_MOUSEDOWN="label:mousedown",t.LABEL_DRAGSTART="label:dragstart",t.LABEL_DRAG="label:drag",t.LABEL_DROP="label:drop",t.LABEL_CLICK="label:click",t.LABEL_DBCLICK="label:dbclick",t.LABEL_BLUR="label:blur",t.LABEL_MOUSEMOVE="label:mousemove",t.LABEL_MOUSEUP="label:mouseup",t.LABEL_FOCUS="label:focus",t.LABEL_ADD="label:add",t.LABEL_UPDATE="label:update",t.LABEL_CLEAR="label:clear",t.LABEL_DELETE="label:delete",t.LABEL_SHOULD_ADD="label:should-add",t.LABEL_BATCH_ADD="label:batch-add",t.LABEL_SHOULD_UPDATE="label:should-update",t.LABEL_SHOULD_DELETE="label:should-delete",t.LABEL_BATCH_DELETE="label:batch-delete",t.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",t.HISTORY_CHANGE="history:change",t.GRAPH_TRANSFORM="graph:transform",t.GRAPH_RENDERED="graph:rendered",t.GRAPH_UPDATED="graph:updated",t.EDIT_CONFIG_CHANGED="editConfig:changed"})(be||(be={}));var Xt;(function(t){t[t.STATIC=-1]="STATIC",t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE",t[t.EDGE_TOP=2]="EDGE_TOP"})(Xt||(Xt={}));var Tt;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(Tt||(Tt={}));var er;(function(t){t.TEXT="text",t.LABEL="label"})(er||(er={}));var IB=0,tr=function(){function t(e){var n=e.onDragStart,r=n===void 0?lo:n,i=e.onDragging,o=i===void 0?lo:i,a=e.onDragEnd,s=a===void 0?lo:a,l=e.eventType,u=l===void 0?"":l,c=e.eventCenter,d=e.step,f=d===void 0?1:d,h=e.isStopPropagation,v=h===void 0?!0:h,g=e.model,m=e.data,y=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(x){var E,b,T=window==null?void 0:window.document;if(x.button===IB){y.isStopPropagation&&x.stopPropagation(),y.isStartDragging=!0,y.startX=x.clientX,y.startY=x.clientY,T.addEventListener("mousemove",y.handleMouseMove,!1),T.addEventListener("mouseup",y.handleMouseUp,!1);var A=(E=y.model)===null||E===void 0?void 0:E.getData();(b=y.eventCenter)===null||b===void 0||b.emit(be["".concat(y.eventType,"_MOUSEDOWN")],{e:x,data:y.data||A}),y.startTime=new Date().getTime()}},this.handleMouseMove=function(x){var E,b;if(y.isStopPropagation&&x.stopPropagation(),!!y.isStartDragging&&(y.sumDeltaX+=x.clientX-y.startX,y.sumDeltaY+=x.clientY-y.startY,y.startX=x.clientX,y.startY=x.clientY,y.step<=1||Math.abs(y.sumDeltaX)>y.step||Math.abs(y.sumDeltaY)>y.step)){var T=y.sumDeltaX%y.step,A=y.sumDeltaY%y.step,S=y.sumDeltaX-T,M=y.sumDeltaY-A;y.sumDeltaX=T,y.sumDeltaY=A;var C=(E=y.model)===null||E===void 0?void 0:E.getData();y.isDragging||((b=y.eventCenter)===null||b===void 0||b.emit(be["".concat(y.eventType,"_DRAGSTART")],{e:x,data:y.data||C}),y.onDragStart({event:x})),y.isDragging=!0,Promise.resolve().then(function(){var G,K;y.onDragging({deltaX:S,deltaY:M,event:x}),(G=y.eventCenter)===null||G===void 0||G.emit(be["".concat(y.eventType,"_MOUSEMOVE")],{deltaX:S,deltaY:M,e:x,data:y.data||C}),(K=y.eventCenter)===null||K===void 0||K.emit(be["".concat(y.eventType,"_DRAG")],{e:x,data:y.data||C})})}},this.handleMouseUp=function(x){var E=window.document;y.isStartDragging=!1,y.isStopPropagation&&x.stopPropagation(),Promise.resolve().then(function(){var b,T,A;E.removeEventListener("mousemove",y.handleMouseMove,!1),E.removeEventListener("mouseup",y.handleMouseUp,!1);var S=(b=y.model)===null||b===void 0?void 0:b.getData();(T=y.eventCenter)===null||T===void 0||T.emit(be["".concat(y.eventType,"_MOUSEUP")],{e:x,data:y.data||S}),y.isDragging&&(y.isDragging=!1,y.onDragEnd({event:x}),(A=y.eventCenter)===null||A===void 0||A.emit(be["".concat(y.eventType,"_DROP")],{e:x,data:y.data||S}))})},this.cancelDrag=function(){var x=window==null?void 0:window.document;x.removeEventListener("mousemove",y.handleMouseMove,!1),x.removeEventListener("mouseup",y.handleMouseUp,!1),y.onDragEnd({event:void 0}),y.isDragging=!1},this.destroy=function(){y.isStartDragging&&y.cancelDrag()},this.onDragStart=r,this.onDragging=o,this.onDragEnd=s,this.step=f,this.isStopPropagation=v,this.eventType=u,this.eventCenter=c,this.model=g,this.data=m}return t.prototype.setStep=function(e){this.step=e},t.prototype.setModel=function(e){this.model=e},t}(),kB=function(t){var e=t.x,n=t.y,r=t.width,i=t.height;return{x:e-r/2,y:n-i/2,x1:e+r/2,y1:n+i/2}},BB=function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,i=(e.y+n.y)/2,o=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:r-o/2,y:i-a/2,x1:r+o/2,y1:i+a/2}},jB=function(t){var e=t.points,n=Ki(e),r=La(n,8),i=r.x,o=r.y,a=r.width,s=r.height;return{x:i-a/2,y:o-s/2,x1:i+a/2,y1:o+s/2}},FB=function(t){var e=t.path,n=cf(e),r=La(n,8),i=r.x,o=r.y,a=r.width,s=r.height;return{x:i-a/2,y:o-s/2,x1:i+a/2,y1:o+s/2}},$B=function(t){if(t.modelType===Ye.LINE_EDGE)return BB(t);if(t.modelType===Ye.POLYLINE_EDGE)return jB(t);if(t.modelType===Ye.BEZIER_EDGE)return FB(t)},HB=function(t,e,n,r){var i=(e.y-t.y)*(r.x-n.x)-(t.x-e.x)*(n.y-r.y);if(i===0)return!1;var o=((e.x-t.x)*(r.x-n.x)*(n.y-t.y)+(e.y-t.y)*(r.x-n.x)*t.x-(r.y-n.y)*(e.x-t.x)*n.x)/i,a=-((e.y-t.y)*(r.y-n.y)*(n.x-t.x)+(e.x-t.x)*(r.y-n.y)*t.y-(r.x-n.x)*(e.y-t.y)*n.y)/i;return(o-t.x)*(o-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(o-n.x)*(o-r.x)<=0&&(a-n.y)*(a-r.y)<=0?{x:o,y:a}:!1},Pa=function(t,e,n){var r=t.x,i=t.y,o=e.x,a=e.y,s=n.x,l=n.y,u=(l-a)/(s-o),c=a-u*o;return(r>=o&&r<=s||r<=o&&r>=s)&&(i>=a&&i<=l||i<=a&&i>=l)&&Math.abs(i-u*r-c)<Number.EPSILON},Ra=function(t){var e=t.start,n=t.end,r=t.offset,i=t.verticalLength,o=t.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-e.y)/(n.x-e.x)),l=Math.atan(r/i),u=Math.sqrt(i*i+r*r);return o==="start"?n.x>=e.x?(a.leftX=e.x+u*Math.sin(s+l),a.leftY=e.y-u*Math.cos(s+l),a.rightX=e.x-u*Math.sin(s-l),a.rightY=e.y+u*Math.cos(s-l)):(a.leftX=e.x-u*Math.sin(s+l),a.leftY=e.y+u*Math.cos(s+l),a.rightX=e.x+u*Math.sin(s-l),a.rightY=e.y-u*Math.cos(s-l)):o==="end"&&(n.x>=e.x?(a.leftX=n.x+u*Math.sin(s-l),a.leftY=n.y-u*Math.cos(s-l),a.rightX=n.x-u*Math.sin(s+l),a.rightY=n.y+u*Math.cos(s+l)):(a.leftX=n.x-u*Math.sin(s-l),a.leftY=n.y+u*Math.cos(s-l),a.rightX=n.x+u*Math.sin(s+l),a.rightY=n.y-u*Math.cos(s+l))),a},Bo=function(){return Bo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Bo.apply(this,arguments)},nr=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},wi=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},zB=function(t,e){return Math.abs(t.centerX-e.centerX)*2<t.width+e.width&&Math.abs(t.centerY-e.centerY)*2<t.height+e.height},lf=function(t){var e=[],n={};return t.forEach(function(r){var i="".concat(r.x,"-").concat(r.y);r.id=i,n[i]=r}),Object.keys(n).forEach(function(r){e.push(n[r])}),e},jl=function(t,e){return t.width===0&&t.height===0?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},WB=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return n/e.width>r/e.height?Tt.HORIZONTAL:Tt.VERTICAL},Fl=function(t,e,n){var r=WB(n,e);return r===Tt.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},R_=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{x:(n+i)/2,y:(r+o)/2,centerX:(n+i)/2,centerY:(r+o)/2,minX:n,minY:r,maxX:i,maxY:o,height:o-r,width:i-n}},La=function(t,e){t===void 0&&(t=[]);var n=[],r=[];t.forEach(function(c){n.push(c.x),r.push(c.y)});var i=Math.min.apply(Math,wi([],nr(n),!1)),o=Math.max.apply(Math,wi([],nr(n),!1)),a=Math.min.apply(Math,wi([],nr(r),!1)),s=Math.max.apply(Math,wi([],nr(r),!1)),l=o-i,u=s-a;return e&&(l+=e,u+=e),{centerX:(i+o)/2,centerY:(a+s)/2,maxX:o,maxY:s,minX:i,minY:a,x:(i+o)/2,y:(a+s)/2,height:u,width:l}},$l=function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY;return[{x:e,y:n},{x:r,y:n},{x:r,y:i},{x:e,y:i}]},Hl=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},UB=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},VB=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},XB=function(t,e){return wi(wi([],nr(UB(t,e.x)),!1),nr(VB(t,e.y)),!1)},uf=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},GB=function(t,e){var n=-2,r=0;return e.forEach(function(i){i&&(t.x===i.x&&(r+=n),t.y===i.y&&(r+=n))}),r},L_=function(t,e,n,r,i){return uf(t,e)+uf(t,n)+GB(t,[e,n,r,i])},I_=function(t,e,n,r,i){i||(i=0),t.unshift(e[r]),n[r]&&n[r]!==r&&i<=100&&I_(t,e,n,n[r],i+1)},YB=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},Ia=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,a=r.x-n.x,s=r.y-n.y,l=(-o*(t.x-n.x)+i*(t.y-n.y))/(-a*o+i*s),u=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*o+i*s);return l>=0&&l<=1&&u>=0&&u<=1},k_=function(t,e,n){if(n.width===0&&n.height===0)return!1;var r=nr($l(n),4),i=r[0],o=r[1],a=r[2],s=r[3];return Ia(t,e,i,o)||Ia(t,e,i,s)||Ia(t,e,o,a)||Ia(t,e,a,s)},KB=function(t,e,n,r){var i=[];return t.forEach(function(o){o!==e&&(o.x===e.x||o.y===e.y)&&!k_(o,e,n)&&!k_(o,e,r)&&i.push(o)}),lf(i)},qB=function(t,e,n,r,i,o,a){var s=[],l=[e],u={},c={},d={};e.id&&(c[e.id]=0,d[e.id]=L_(e,n,e));var f={};t.forEach(function(g){g.id&&(f[g.id]=g)});for(var h=function(){var g,m=1/0;if(l.forEach(function(x){x.id&&d[x.id]<m&&(m=d[x.id],g=x)}),g===n&&n.id){var y=[];return I_(y,f,u,n.id),{value:y}}if(!g)return{value:[e,n]};YB(l,g),s.push(g),KB(t,g,r,i).forEach(function(x){if(s.indexOf(x)===-1&&(l.indexOf(x)===-1&&l.push(x),g!=null&&g.id&&(x!=null&&x.id))){var E=d[g.id]+uf(g,x);if(c[x.id]&&E>=c[x.id])return;u[x.id]=g.id,c[x.id]=E,d[x.id]=c[x.id]+L_(x,n,e,o,a)}})};l.length;){var v=h();if(typeof v=="object")return v.value}return[e,n]},B_=function(t){return Hn(t)},j_=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],r=t[e],i=t[e+1];n.x===r.x&&r.x===i.x||n.y===r.y&&r.y===i.y?t.splice(e,1):e++}return t},F_=function(t,e,n,r,i){var o=B_(n),a=B_(r),s=jl(o,i),l=jl(a,i),u=Fl(s,o,t),c=Fl(l,a,e);if(zB(s,l)){var d=JB(t,e,u,c);return wi(wi([t,u],nr(d),!1),[c,e],!1)}var f=La([u,c]),h=R_(s,f),v=R_(l,f),g=[];g=g.concat($l(h)),g=g.concat($l(v));var m={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[f,h,v].forEach(function(x){g=g.concat(XB(x,m).filter(function(E){return Hl(E,s)&&Hl(E,l)}))}),[{x:u.x,y:c.y},{x:c.x,y:u.y}].forEach(function(x){Hl(x,s)&&Hl(x,l)&&g.push(x)}),g.unshift(u),g.push(c),g=lf(g);var y=qB(g,u,c,o,a,t,e);return y.unshift(t),y.push(e),y.length>2&&(y=j_(y)),lf(y)},ZB=function(t){if(t.length===1){var e=nr(t,1),n=e[0];return[n,n]}else{for(var r=t[0],i=t[1],o=Er(r.x,r.y,i.x,i.y),a=1;a<t.length-1;a++){var s=t[a],l=t[a+1],u=Er(s.x,s.y,l.x,l.y);u>o&&(o=u,r=s,i=l)}return[r,i]}},$_=function(t,e,n){var r=ni(t,n),i=ni(e,n);return r&&i},H_=function(t,e,n){var r=ni(t,n),i=ni(e,n),o=r&&i,a=r||i;return!o&&a},z_=function(t,e,n){for(var r=void 0,i=Hn(n),o=$l(i),a=0;a<o.length;a++){var s=Ia(t,e,o[a],o[(a+1)%o.length]);s&&(r=[o[a],o[(a+1)%o.length]])}if(r)return HB(t,e,r[0],r[1])},zl=function(t,e){var n=void 0;return t.x===e.x?n=Tt.VERTICAL:t.y===e.y&&(n=Tt.HORIZONTAL),n},Ki=function(t){var e=t.split(" "),n=[];return e&&e.forEach(function(r){var i=nr(r.split(","),2),o=i[0],a=i[1];n.push({x:Number(o),y:Number(a)})}),n},JB=function(t,e,n,r){var i=[],o=zl(t,n),a=zl(e,r);if(o===a)t.y===n.y?(i.push({x:n.x,y:(n.y+r.y)/2}),i.push({x:r.x,y:(n.y+r.y)/2})):(i.push({x:(n.x+r.x)/2,y:n.y}),i.push({x:(n.x+r.x)/2,y:r.y}));else{var s={x:n.x,y:r.y},l=Pa(s,t,n),u=Pa(s,e,r);if(l||u)s={x:r.x,y:n.y};else{var c=W_(s,t,n),d=W_(s,e,r);c&&d&&(s={x:r.x,y:n.y})}i.push(s)}return i},W_=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},U_=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:r>=1&&r<=126||r>=65376&&r<=65439?e+=1:e+=2}return e},QB=function(t){var e=t.start,n=t.end,r;if(e.x===n.x&&e.y===n.y)r="";else{var i={start:e,end:n,offset:10,verticalLength:5},o=Ra(Bo(Bo({},i),{type:"start"})),a=Ra(Bo(Bo({},i),{type:"end"}));r="M".concat(o.leftX," ").concat(o.leftY,`
|
|
61
|
+
L`).concat(o.rightX," ").concat(o.rightY,`
|
|
62
|
+
L`).concat(a.rightX," ").concat(a.rightY,`
|
|
63
|
+
L`).concat(a.leftX," ").concat(a.leftY," z")}return{d:r,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},V_=function(t){var e=t.start,n=t.end,r=t.sourceNode,i=t.targetNode,o=t.offset,a=Hn(r),s=Hn(i),l=jl(a,o),u=jl(s,o),c=Fl(l,a,e),d=Fl(u,s,n);return{sNext:c,ePre:d}},cf=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(","),n=Wl(e[0]),r=Wl(e[1]),i=Wl(e[2]),o=Wl(e[3]);return[n,r,i,o]},Wl=function(t){var e=nr(t.replace(/(^\s*)/g,"").split(" "),2),n=e[0],r=e[1];return{x:+n,y:+r}},X_=function(t,e){var n=nr(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=zj(r,i,o,a,e);return[s,t[3]]},G_=function(t,e){for(var n=t.x,r=t.y,i=Ki(e),o=Number.MAX_SAFE_INTEGER,a,s=[],l=0;l<i.length;l++)s.push({start:i[l],end:i[(l+1)%i.length]});if(s.forEach(function(f){var h=f.start,v=f.end;if(h.x===v.x){var g={x:h.x,y:r},m=Pa(g,h,v);if(m){var y=Math.abs(h.x-n);y<o&&(o=y,a=g)}}else if(h.y===v.y){var g={x:n,y:h.y},m=Pa(g,h,v);if(m){var y=Math.abs(h.y-r);y<o&&(o=y,a=g)}}}),!a){var u=s[0],c=u.start,d=u.end;a={x:c.x+(d.x-c.x)/2,y:c.y+(d.y-c.y)/2}}return a},ej=function(t){return gi(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},Y_=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function tj(t,e){return typeof e!="function"?function(n,r,i){return Object.assign({type:t.edgeType},i)}:function(n,r,i){var o=e(n,r,i);return o?typeof o=="string"?Object.assign({},i,{type:o}):Object.assign({type:o},i):{type:t.edgeType}}}var nj=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,i=0;return gt(e,function(o){var a=U_(o);i=a>i?a:i}),{width:Math.ceil(i/2)*r+r/4,height:n*(r+2)+r/4}},jo=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ul=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function Fo(t,e,n){return n&&e*Math.round(t/e)||t}function rj(t,e,n){if(!t)return[];var r=Math.min.apply(Math,Ul([],jo(t.map(function(g){return g[0]})),!1)),i=Math.max.apply(Math,Ul([],jo(t.map(function(g){return g[0]})),!1)),o=Math.min.apply(Math,Ul([],jo(t.map(function(g){return g[1]})),!1)),a=Math.max.apply(Math,Ul([],jo(t.map(function(g){return g[1]})),!1)),s=-r,l=-o,u=t.map(function(g){var m=jo(g,2),y=m[0],x=m[1];return[y+s,x+l]}),c=i-r,d=a-o,f=e?e/c:1,h=n?n/d:1,v=Math.min(f,h);return u.map(function(g){var m=jo(g,2),y=m[0],x=m[1];return[y*v,x*v]})}var df=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ff=function(t,e,n){var r=df(t,2),i=r[0],o=r[1],a=df(e,2),s=a[0],l=a[1],u=df(n,2),c=u[0],d=u[1];return i>s&&i<c&&o>l&&o<d},K_=function(t,e){var n=e.multipleSelectKey,r=!1;switch(n){case"meta":r=t.metaKey;break;case"alt":r=t.altKey;break;case"shift":r=t.shiftKey;break;case"ctrl":r=t.ctrlKey;break;default:r=!1;break}return r},pf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function q_(t,e){return t instanceof Zt&&e instanceof Zt}var Z_=function(t){pf(e,t);function e(n,r,i){var o=t.call(this,3)||this;return o[0]=n,o[1]=r,o[2]=i,o.x=n,o.y=r,o.z=i,Object.setPrototypeOf(o,e.prototype),o}return e.prototype.add=function(n){if(q_(this,n))return new Zt(this.x+n.x,this.y+n.y);var r=this.z+n.z;return new hf((this.x+n.x)/r,(this.y+n.y)/r)},e.prototype.subtract=function(n){if(q_(this,n))return new Zt(this.x-n.x,this.y-n.y);var r=this.z-n.z;return r===0?new Zt(this.x-n.x,this.y-n.y):new hf((this.x-n.x)/r,(this.y-n.y)/r)},e}(Array),Zt=function(t){pf(e,t);function e(n,r,i){var o=t.call(this,n,r,i??0)||this;return Object.setPrototypeOf(o,e.prototype),o}return e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(n){var r=this;return n.reduce(function(i,o,a){return i+o*r[a]})},e.prototype.cross=function(n){return new e(this.y*n.z-this.z*n.y,this.z*n.x-this.x*n.z,this.x*n.y-this.y*n.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var n=this.getLength();return new e(this.x/n,this.y/n)},e.prototype.crossZ=function(n){return this.x*n.y-this.y*n.x},e.prototype.angle=function(n){var r=this.crossZ(n),i=Math.acos(this.normalize().dot(n.normalize()));return r>=0?i:-i},e}(Z_),hf=function(t){pf(e,t);function e(n,r){var i=t.call(this,n,r,1)||this;return Object.setPrototypeOf(i,e.prototype),i}return e.prototype.toString=function(){return"Point"},e}(Z_),Vl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$o=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},gf=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},ka=function(t){Vl(e,t);function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=t.call(this,n.length)||this;return i.fill(new Array(3)),n.forEach(function(o,a){i[a]=o}),i.columns=n[0].length,i.rows=n.length,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.getRow=function(n){return this[n]},e.prototype.getColumn=function(n){return gf([],$o(this.map(function(r){return r[n]})),!1)},e.prototype.transpose=function(){for(var n=[],r=0;r<this.columns;r++)n.push(this.getColumn(r));return new(e.bind.apply(e,gf([void 0],$o(n),!1)))},e.prototype.cross=function(n){var r=new Array(this.rows).fill("").map(function(){return[]});if(this.columns===n.rows)for(var i=0;i<this.rows;i++)for(var o=this.getRow(i),a=function(l){var u=n.getColumn(l);r[i][l]=o.reduce(function(c,d,f){return c+d*u[f]},0)},s=0;s<n.columns;s++)a(s);return new(e.bind.apply(e,gf([void 0],$o(r),!1)))},e.prototype.to2D=function(){return this.map(function(n){return[n[0],n[1]]})},e.prototype.toPoints=function(){return this.map(function(n){return new hf(n[0],n[1])})},e.prototype.toString=function(){var n=$o(this[0],2),r=n[0],i=n[1],o=$o(this[1],2),a=o[0],s=o[1],l=$o(this[2],2),u=l[0],c=l[1];return"matrix(".concat(r," ").concat(i," ").concat(a," ").concat(s," ").concat(u," ").concat(c,")")},e.prototype.translate=function(n,r){return this.cross(new Xl(n,r))},e.prototype.rotate=function(n){return this.cross(new ij(n))},e.prototype.scale=function(n,r){return this.cross(new oj(n,r))},e}(Array),ij=function(t){Vl(e,t);function e(n){var r=t.call(this,new Zt(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new Zt(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new Zt(0,0,1))||this;return Object.setPrototypeOf(r,e.prototype),r}return e.prototype.inverse=function(){return this.transpose()},e}(ka),oj=function(t){Vl(e,t);function e(n,r){var i=t.call(this,new Zt(n,0,0),new Zt(0,r,0),new Zt(0,0,1))||this;return i.sx=n,i.sy=r,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(ka),Xl=function(t){Vl(e,t);function e(n,r){var i=t.call(this,new Zt(1,0,0),new Zt(0,1,0),new Zt(n,r,1))||this;return i.tx=n,i.ty=r,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(ka);jk({});var Gl=function(){return Gl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gl.apply(this,arguments)},aj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},vf=function(t){var e=t.anchors;return e},Yl=function(t,e){for(var n=e.nodes,r,i=n.length-1;i>=0;i--){var o=n[i],a=uj(t,o);if(a){var s=o.getTargetAnchor(t);if(s){var l={node:o,anchorIndex:s.index,anchor:s.anchor};(!r||sj(o,r.node,e))&&(r=l)}}}return r},sj=function(t,e,n){return t.zIndex>e.zIndex?!0:n.nodesMap[t.id].index>n.nodesMap[e.id].index},lj=function(t,e){for(var n=vf(e),r,i=Number.MAX_SAFE_INTEGER,o=0;o<n.length;o++){var a=Er(t.x,t.y,n[o].x,n[o].y);a<i&&(i=a,r={index:o,anchor:Gl(Gl({},n[o]),{x:n[o].x,y:n[o].y,id:n[o].id})})}return r},Er=function(t,e,n,r){return Math.hypot(t-n,e-r)},ni=function(t,e,n){n===void 0&&(n=0);var r=!1,i=Hn(e),o=aj(new ka([t.x,t.y,1]).translate(-e.x,-e.y).rotate(-e.rotate).translate(e.x,e.y)[0],2),a=o[0],s=o[1],l={x:a,y:s};return l.x>=i.minX-n&&l.x<=i.maxX+n&&l.y>=i.minY-n&&l.y<=i.maxY+n&&(r=!0),r},uj=function(t,e){return ni(t,e,5)},Hn=function(t){var e=t.x,n=t.y,r=t.width,i=t.height;return{minX:e-r/2,minY:n-i/2,maxX:e+r/2,maxY:n+i/2,x:e,y:n,width:r,height:i,centerX:e,centerY:n}},cj=function(t){var e=t,n=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;return[{x:n-i/2+a,y:r-o/2+a,r:a},{x:n+i/2-a,y:r-o/2+a,r:a},{x:n-i/2+a,y:r+o/2-a,r:a},{x:n+i/2-a,y:r+o/2-a,r:a}]},J_=function(t,e,n){var r=cj(n),i,o=Number.MAX_SAFE_INTEGER;return r.forEach(function(a){var s=Er(t.x,t.y,a.x,a.y);s<o&&(o=s,i=a)}),mf(t,e,i)},mf=function(t,e,n){var r,i=n.x,o=n.y,a=n.r;if(e===Tt.HORIZONTAL){var s=i-Math.sqrt(a*a-(t.y-o)*(t.y-o)),l=i+Math.sqrt(a*a-(t.y-o)*(t.y-o)),u=Math.abs(s-t.x)<Math.abs(l-t.x)?s:l;r={x:u,y:t.y}}else if(e===Tt.VERTICAL){var c=o-Math.sqrt(a*a-(t.x-i)*(t.x-i)),d=o+Math.sqrt(a*a-(t.x-i)*(t.x-i)),f=Math.abs(c-t.y)<Math.abs(d-t.y)?c:d;r={x:t.x,y:f}}return r},Q_=function(t,e){var n=e,r=!1,i=n.x,o=n.y,a=n.width,s=n.height,l=n.radius,u={minX:i-a/2+l,maxX:i+a/2-l,minY:o-s/2+l,maxY:o+s/2-l};return t.y===o+s/2||t.y===o-s/2?r=t.x>u.minX&&t.x<u.maxX:(t.x===i+a/2||t.x===i-a/2)&&(r=t.y>u.minY&&t.y<u.maxY),r},eb=function(t,e,n){var r,i=n,o=i.x,a=i.y,s=i.rx,l=i.ry;if(e===Tt.HORIZONTAL){var u=o-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),c=o+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),d=Math.abs(u-t.x)<Math.abs(c-t.x)?u:c;r={x:d,y:t.y}}else if(e===Tt.VERTICAL){var f=a-Math.sqrt(l*l-(t.x-o)*(t.x-o)*l*l/(s*s)),h=a+Math.sqrt(l*l-(t.x-o)*(t.x-o)*l*l/(s*s)),v=Math.abs(f-t.y)<Math.abs(h-t.y)?f:h;r={x:t.x,y:v}}return r},Kl=function(t,e,n){for(var r=n.pointsPosition,i=Number.MAX_SAFE_INTEGER,o,a=[],s=0;s<r.length;s++)a.push({start:r[s],end:r[(s+1)%r.length]});return a.forEach(function(l){var u=l.start,c=l.end,d=u,f=c;u.x>c.x&&(d=c,f=u);var h={x:t.x,y:t.y};if(d.x===f.x&&e===Tt.HORIZONTAL&&(h={x:d.x,y:t.y}),d.y===f.y&&e===Tt.VERTICAL&&(h={x:t.x,y:d.y}),d.x!==f.x&&d.y!==f.y){var v=(f.y-d.y)/(f.x-d.x),g=(d.x*f.y-f.x*d.y)/(d.x-f.x);e===Tt.HORIZONTAL?h={x:(t.y-g)/v,y:t.y}:e===Tt.VERTICAL&&(h={x:t.x,y:v*t.x+g})}var m=Pa(h,u,c);if(m){var y=Er(h.x,h.y,t.x,t.y);y<i&&(i=y,o=h)}}),o},dj=function(t){var e=gi(t,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"]);return e},tb=function(t,e,n,r){var i=t.x,o=t.y;return e.x>t.x?i=t.x+n/2:e.x<t.x&&(i=t.x-n/2),e.y>t.y?o=t.y+r/2:e.y<t.y&&(o=t.y-r/2),{x:i,y:o}},nb=function(t){var e=t.rows,n=t.style,r=t.rowsLength,i=t.className,o=document.createElement("div");o.className=i,o.style.fontSize="".concat(n.fontSize),o.style.width="".concat(n.width),o.style.lineHeight="".concat(n.lineHeight),o.style.padding="".concat(n.padding),n.fontFamily&&(o.style.fontFamily="".concat(n.fontFamily)),r>1?e.forEach(function(s){var l=document.createElement("div");l.textContent=s,o.appendChild(l)}):o.textContent=e[0],document.body.appendChild(o);var a=o.clientHeight;return document.body.removeChild(o),a},rb=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,i=0;return e&&e.forEach(function(o){var a=U_(o);i=a>i?a:i}),{width:Math.ceil(i/2)*r+r/4,height:n*(r+2)+r/4}},ql=function(t){return typeof t!="object"?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let Zl;const fj=new Uint8Array(16);function pj(){if(!Zl&&(Zl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zl(fj)}const Jt=[];for(let t=0;t<256;++t)Jt.push((t+256).toString(16).slice(1));function hj(t,e=0){return Jt[t[e+0]]+Jt[t[e+1]]+Jt[t[e+2]]+Jt[t[e+3]]+"-"+Jt[t[e+4]]+Jt[t[e+5]]+"-"+Jt[t[e+6]]+Jt[t[e+7]]+"-"+Jt[t[e+8]]+Jt[t[e+9]]+"-"+Jt[t[e+10]]+Jt[t[e+11]]+Jt[t[e+12]]+Jt[t[e+13]]+Jt[t[e+14]]+Jt[t[e+15]]}const ib={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function gj(t,e,n){if(ib.randomUUID&&!t)return ib.randomUUID();t=t||{};const r=t.random||(t.rng||pj)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,hj(r)}var Si=function(){return gj()},Ba=new Map,ob=function(t){var e=Si();function n(){t();var i=Ba.get(e);if(i){var o=window.requestAnimationFrame(n);Ba.set(e,o)}}var r=window.requestAnimationFrame(n);return Ba.set(e,r),e},Jl=function(t){var e=Ba.get(t);e&&(window.cancelAnimationFrame(e),Ba.delete(t))},ja=function(){return ja=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ja.apply(this,arguments)},vj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function ab(t){var e=t.x,n=e===void 0?0:e,r=t.y,i=r===void 0?0:r,o=t.value,a=t.fontSize,s=a===void 0?12:a,l=t.fill,u=l===void 0?"currentColor":l,c=t.overflowMode,d=c===void 0?"default":c,f=t.textWidth,h=f===void 0?void 0:f,v=t.model,g={x:n,y:i,fill:u,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(gt(Zr(t),function(T){var A=vj(T,2),S=A[0],M=A[1];typeof M!="object"&&(g[S]=M)}),o){var m=String(o).split(/[\r\n]/g),y=m.length;if(d!=="default"){var x=v.BaseType,E=v.modelType;if(x===Lt.NODE&&E!==Ye.TEXT_NODE||x===Lt.EDGE&&h)return mj(t)}if(y>1){var b=m.map(function(T,A){var S=s+2,M=(A-(y-1)/2)*S;return V("tspan",{className:"lf-text-tspan",x:n,y:i+M,children:T})});return V("text",ja({},g,{children:b}))}return V("text",ja({},g,{children:o}))}return null}function mj(t){var e=t.x,n=t.y,r=t.value,i=t.model,o=t.textWidth,a=t.fontSize,s=a===void 0?12:a,l=t.lineHeight,u=t.fontFamily,c=u===void 0?"":u,d=t.wrapPadding,f=d===void 0?"0, 0":d,h=t.overflowMode,v=i.width,g=i.height,m=i.textHeight,y=o||v,x=String(r).split(/[\r\n]/g),E=x.length,b=nb({rows:x,style:{fontSize:"".concat(s,"px"),width:"".concat(y,"px"),fontFamily:c,lineHeight:l,padding:f},rowsLength:E,className:"lf-get-text-height"}),T=g>b?g:b;m&&(T=m);var A=h==="ellipsis";return A&&(T=s+2),V("g",{children:V("foreignObject",{width:y,height:T,x:e-y/2,y:n-T/2,style:{overflow:"visible",textAlign:"left"},children:V("div",{className:"lf-node-text-auto-wrap",style:{minHeight:T,width:y,padding:f},children:V("div",{className:A?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:A?x.join(""):"",style:ja({},t),children:x.map(function(S){return V("div",{className:"lf-node-text--auto-wrap-inner",children:S})})})})})})}var yf=function(){return yf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},yf.apply(this,arguments)},yj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Ho(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return gt(Zr(t),function(n){var r=yj(n,2),i=r[0],o=r[1];(i==="style"||typeof o!="object")&&(e[i]=o)}),V("line",yf({},e))}var _f=function(){return _f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_f.apply(this,arguments)},_j=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function rr(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.className,a=t.strokeWidth,s=t.radius,l=s===void 0?0:s,u=e-r/2,c=n-i/2,d={};return d["stroke-width"]=a,gt(Zr(t),function(f){var h=_j(f,2),v=h[0],g=h[1];typeof g!="object"&&(d[v]=g)}),o?d.className="lf-basic-shape ".concat(o):d.className="lf-basic-shape",l&&(d.rx=l,d.ry=l),d.x=u,d.y=c,V("rect",_f({},d))}var bf=function(){return bf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bf.apply(this,arguments)},bj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Fa(t){var e={d:""};return gt(Zr(t),function(n){var r=bj(n,2),i=r[0],o=r[1];(i==="style"||typeof o!="object")&&(e[i]=o)}),V("path",bf({},e))}var xf=function(){return xf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xf.apply(this,arguments)},xj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function zo(t){var e=t.x,n=e===void 0?0:e,r=t.y,i=r===void 0?0:r,o=t.r,a=o===void 0?4:o,s=t.className,l={cx:n,cy:i,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return gt(Zr(t),function(u){var c=xj(u,2),d=c[0],f=c[1];typeof f!="object"&&(l[d]=f)}),s?l.className="lf-basic-shape ".concat(s):l.className="lf-basic-shape",V("circle",xf({},l))}var Ef=function(){return Ef=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ef.apply(this,arguments)},Ej=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function wj(t){var e=t.x,n=e===void 0?0:e,r=t.y,i=r===void 0?0:r,o=t.rx,a=o===void 0?4:o,s=t.ry,l=s===void 0?4:s,u=t.className,c={cx:n,cy:i,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return gt(Zr(t),function(d){var f=Ej(d,2),h=f[0],v=f[1];typeof v!="object"&&(c[h]=v)}),u?c.className="lf-basic-shape ".concat(u):c.className="lf-basic-shape",V("ellipse",Ef({},c))}var Ql=function(){return Ql=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ql.apply(this,arguments)},Sj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Cj(t,e){var n=t.map(function(x){return{x:x[0],y:x[1]}}),r=n.length;if(r<3)return"";for(var i=Math.abs(e),o="",a=0;a<r;a++){var s=n[(a-1+r)%r],l=n[a],u=n[(a+1)%r],c={x:l.x-s.x,y:l.y-s.y},d={x:u.x-l.x,y:u.y-l.y},f=Math.hypot(c.x,c.y),h=Math.hypot(d.x,d.y),v={x:c.x/f,y:c.y/f},g={x:d.x/h,y:d.y/h},m={x:l.x-v.x*i,y:l.y-v.y*i},y={x:l.x+g.x*i,y:l.y+g.y*i};a===0?o+="M ".concat(m.x," ").concat(m.y," "):o+="L ".concat(m.x," ").concat(m.y," "),o+="Q ".concat(l.x," ").concat(l.y," ").concat(y.x," ").concat(y.y," ")}return o+="Z",o}function wf(t){var e=t.points,n=e===void 0?[]:e,r=t.className,i=t.radius,o={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};if(gt(Zr(t),function(s){var l=Sj(s,2),u=l[0],c=l[1];typeof c!="object"&&(o[u]=c)}),r?o.classNmae="lf-basic-shape ".concat(r):o.className="lf-basic-shape",i){var a=Cj(n,i);return o.d=a,V("path",Ql({},o))}else return o.points=n.map(function(s){return s.join(",")}).join(" "),V("polygon",Ql({},o))}var Sf=function(){return Sf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Sf.apply(this,arguments)},Aj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Oj(t){var e=t.className,n={points:"",fill:"none"};return gt(Zr(t),function(r){var i=Aj(r,2),o=i[0],a=i[1];(o==="style"||typeof a!="object")&&(n[o]=a)}),e&&(n.className="".concat(e)),V("polyline",Sf({},n))}var sb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$a=function(){return $a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$a.apply(this,arguments)},Tj=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Nj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ct;(function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(ct||(ct={}));var Mj=function(t){sb(e,t);function e(n){var r=t.call(this)||this;r.isShiftPressed=!1,r.bindKeyboardEvents=function(){document.addEventListener("keydown",r.handleKeyDown),document.addEventListener("keyup",r.handleKeyUp)},r.handleKeyDown=function(s){s.key==="Shift"&&(r.isShiftPressed=!0)},r.handleKeyUp=function(s){s.key==="Shift"&&(r.isShiftPressed=!1)},r.updateEdgePointByAnchors=function(){var s=r.nodeModel,l=s.id,u=s.anchors,c=r.graphModel.getNodeEdges(l);gt(c,function(d){if(d.sourceNodeId===l){var f=hi(u,function(h){return h.id===d.sourceAnchorId});f&&d.updateStartPoint({x:f.x,y:f.y})}else if(d.targetNodeId===l){var f=hi(u,function(v){return v.id===d.targetAnchorId});f&&d.updateEndPoint({x:f.x,y:f.y})}})},r.triggerResizeEvent=function(s,l,u,c,d,f){r.graphModel.eventCenter.emit(be.NODE_RESIZE,{preData:s,data:l,deltaX:u,deltaY:c,index:d,model:f})},r.recalcResizeInfo=function(s,l,u,c,d){u===void 0&&(u=1),c===void 0&&(c=!1),d===void 0&&(d=!1);var f=Pe(l),h=f.deltaX,v=f.deltaY,g=f.width,m=f.height,y=f.PCTResizeInfo;if(y){var x=4,E=0,b=0;switch(s){case ct.LEFT_TOP:b=(h*-1-v)/x;break;case ct.RIGHT_TOP:b=(h-v)/x;break;case ct.RIGHT_BOTTOM:b=(h+v)/x;break;case ct.LEFT_BOTTOM:b=(h*-1+v)/x;break}b!==0&&(E=Math.round(b/y.ResizeBasis.basisHeight*1e5)/1e3),y.ResizePCT.widthPCT=Math.max(Math.min(y.ResizePCT.widthPCT+E,y.ScaleLimit.maxScaleLimit),y.ScaleLimit.minScaleLimit),y.ResizePCT.heightPCT=Math.max(Math.min(y.ResizePCT.heightPCT+E,y.ScaleLimit.maxScaleLimit),y.ScaleLimit.minScaleLimit);var T=Math.round(y.ResizePCT.widthPCT*y.ResizeBasis.basisWidth/100),A=Math.round(y.ResizePCT.heightPCT*y.ResizeBasis.basisHeight/100);switch(s){case ct.LEFT_TOP:h=g-T,v=m-A;break;case ct.RIGHT_TOP:h=T-g,v=m-A;break;case ct.RIGHT_BOTTOM:h=T-g,v=A-m;break;case ct.LEFT_BOTTOM:h=g-T,v=A-m;break}return f}switch(s){case ct.LEFT_TOP:f.width=c?g:g-h*u,f.height=d?m:m-v*u;break;case ct.RIGHT_TOP:f.width=c?g:g+h*u,f.height=d?m:m-v*u;break;case ct.RIGHT_BOTTOM:f.width=c?g:g+h*u,f.height=d?m:m+v*u;break;case ct.LEFT_BOTTOM:f.width=c?g:g-h*u,f.height=d?m:m+v*u;break}return f},r.resizeNode=function(s){var l=s.deltaX,u=s.deltaY,c=r.index,d=r.props,f=d.model,h=d.graphModel,v=d.x,g=d.y;lb({x:v,y:g,deltaX:l,deltaY:u,index:c,nodeModel:f,graphModel:h,forceProportional:r.isShiftPressed,cancelCallback:function(){r.dragHandler.cancelDrag()}})},r.onDragStart=function(){r.graphModel.selectNodeById(r.nodeModel.id)},r.onDragging=function(s){var l=s.deltaX,u=s.deltaY,c=r.graphModel.transformModel,d=Nj(c.fixDeltaXY(l,u),2),f=d[0],h=d[1];r.resizeNode({deltaX:f,deltaY:h})},r.onDragEnd=function(){var s=r.nodeModel.x,l=r.nodeModel.y;r.nodeModel.moveTo(s,l),r.updateEdgePointByAnchors()};var i=n.index,o=n.model,a=n.graphModel;return r.index=i,r.nodeModel=o,r.graphModel=a,r.dragHandler=new tr({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:a.gridSize}),r.bindKeyboardEvents(),r}return e.prototype.componentWillUnmount=function(){this.dragHandler.destroy(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},e.prototype.render=function(){var n=this.props,r=n.x,i=n.y,o=n.direction,a=n.model,s=a.getResizeControlStyle(),l=s.width,u=s.height,c=Tj(s,["width","height"]);return V("g",{className:"lf-resize-control lf-resize-control-".concat(o),children:[V(rr,$a({className:"lf-resize-control-content",x:r,y:i,width:l??7,height:u??7},c)),V(rr,{className:"lf-resize-control-content",x:r,y:i,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e}(Qe),Dj=function(t){sb(e,t);function e(){return t.call(this)||this}return e.prototype.getResizeControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=Hn(r),a=o.minX,s=o.minY,l=o.maxX,u=o.maxY,c=[{index:ct.LEFT_TOP,direction:"nw",x:a,y:s},{index:ct.RIGHT_TOP,direction:"ne",x:l,y:s},{index:ct.RIGHT_BOTTOM,direction:"se",x:l,y:u},{index:ct.LEFT_BOTTOM,direction:"sw",x:a,y:u}];return Bn(c,function(d){return V(Mj,$a({},d,{model:r,graphModel:i}))})},e.prototype.getResizeOutline=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getResizeOutlineStyle();return V(rr,$a({},s,{x:r,y:i,width:o,height:a}))},e.prototype.render=function(){return V("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(Qe);function Pj(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a={x:n+(i-n)/2,y:r+(o-r)/2};return a}function Ha(t,e,n){var r=Rj(n),i=t.x-e.x,o=t.y-e.y,a=i*Math.cos(r)-o*Math.sin(r)+e.x,s=i*Math.sin(r)+o*Math.cos(r)+e.y;return{x:a,y:s}}function Rj(t){return t*Math.PI/180}function Lj(t){return t/Math.PI*180}function Ij(t,e,n,r,i,o,a,s){i===void 0&&(i=!1),o===void 0&&(o=!1);var l={x:n.x-(t.x-n.x),y:n.y-(t.y-n.y)},u=Pj(l,e),c=Ha(e,u,-r),d=Ha(l,u,-r);if(i){var f=Math.abs(c.x-d.x),h=f-a;u.x>c.x?u.x=u.x+h/2:u.x=u.x-h/2}if(o){var v=Math.abs(c.y-d.y),g=v-s;u.y>c.y?u.y=u.y+g/2:u.y=u.y-g/2}if(i||o){var m=Ha(d,u,r),y=m.x-l.x,x=m.y-l.y;u.x=u.x-y,u.y=u.y-x,d=Ha(l,u,-r),c={x:u.x-(d.x-u.x),y:u.y-(d.y-u.y)}}var E=Math.abs(c.x-d.x),b=Math.abs(c.y-d.y);return i&&(E=a),o&&(b=s),{width:E,height:b,center:u}}function kj(t,e,n,r,i,o,a,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);var u=e.deltaX,c=e.deltaY,d=e.width,f=e.height,h=Lj(n),v={x:r,y:i},g={x:o,y:a},m=Ha(v,g,h),y={x:m.x+u,y:m.y+c},x=Ij(m,y,g,h,s,l,d,f),E=x.width,b=x.height,T=x.center;return e.width=E*t,e.height=b*t,e.deltaX=(T.x-g.x)*2,e.deltaY=(T.y-g.y)*2,e}var Bj=function(t,e,n,r,i,o,a,s,l,u,c){n===void 0&&(n=1),r===void 0&&(r=!1),i===void 0&&(i=!1),o===void 0&&(o=0),c===void 0&&(c=!1);var d=Pe(e),f=d.deltaX,h=d.deltaY,v=d.width,g=d.height,m=d.PCTResizeInfo;if(m){var y=4,x=0,E=0;switch(t){case ct.LEFT_TOP:E=(f*-1-h)/y;break;case ct.RIGHT_TOP:E=(f-h)/y;break;case ct.RIGHT_BOTTOM:E=(f+h)/y;break;case ct.LEFT_BOTTOM:E=(f*-1+h)/y;break}E!==0&&(x=Math.round(E/m.ResizeBasis.basisHeight*1e5)/1e3),m.ResizePCT.widthPCT=Math.max(Math.min(m.ResizePCT.widthPCT+x,m.ScaleLimit.maxScaleLimit),m.ScaleLimit.minScaleLimit),m.ResizePCT.heightPCT=Math.max(Math.min(m.ResizePCT.heightPCT+x,m.ScaleLimit.maxScaleLimit),m.ScaleLimit.minScaleLimit);var b=Math.round(m.ResizePCT.widthPCT*m.ResizeBasis.basisWidth/100),T=Math.round(m.ResizePCT.heightPCT*m.ResizeBasis.basisHeight/100);switch(t){case ct.LEFT_TOP:f=v-b,h=g-T;break;case ct.RIGHT_TOP:f=b-v,h=g-T;break;case ct.RIGHT_BOTTOM:f=b-v,h=T-g;break;case ct.LEFT_BOTTOM:f=v-b,h=T-g;break}return d}if(o%(2*Math.PI)!==0&&a!==void 0&&s!==void 0)return kj(n,d,o,a,s,l,u,r,i);if(c){var A=v/g,S=0,M=v,C=g;switch(t){case ct.LEFT_TOP:S=Math.abs(f)>Math.abs(h)?-f:-h,A>=1?(M=v+S,C=M/A):(C=g+S,M=C*A),d.width=M,d.height=C,d.deltaX=v-M,d.deltaY=g-C;break;case ct.RIGHT_TOP:S=Math.abs(f)>Math.abs(h)?f:-h,A>=1?(M=v+S,C=M/A):(C=g-S,M=C*A),d.width=M,d.height=C,d.deltaX=M-v,d.deltaY=g-C;break;case ct.RIGHT_BOTTOM:S=Math.abs(f)>Math.abs(h)?f:h,A>=1?(M=v+S,C=M/A):(C=g+S,M=C*A),d.width=M,d.height=C,d.deltaX=M-v,d.deltaY=C-g;break;case ct.LEFT_BOTTOM:S=Math.abs(f)>Math.abs(h)?-f:h,A>=1?(M=v-S,C=M/A):(C=g+S,M=C*A),d.width=M,d.height=C,d.deltaX=v-M,d.deltaY=C-g;break}return d}switch(t){case ct.LEFT_TOP:d.width=r?v:v-f*n,d.height=i?g:g-h*n;break;case ct.RIGHT_TOP:d.width=r?v:v+f*n,d.height=i?g:g-h*n;break;case ct.RIGHT_BOTTOM:d.width=r?v:v+f*n,d.height=i?g:g+h*n;break;case ct.LEFT_BOTTOM:d.width=r?v:v-f*n,d.height=i?g:g+h*n;break}return d},jj=function(t,e){var n=t.id,r=t.anchors,i=e.getNodeEdges(n);gt(i,function(o){if(o.sourceNodeId===n){var a=hi(r,function(s){return s.id===o.sourceAnchorId});a&&o.updateStartPoint({x:a.x,y:a.y})}else if(o.targetNodeId===n){var a=hi(r,function(l){return l.id===o.targetAnchorId});a&&o.updateEndPoint({x:a.x,y:a.y})}})},Fj=function(t,e,n,r,i,o,a){a.eventCenter.emit(be.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:r,index:i,model:o})},lb=function(t){var e=t.x,n=t.y,r=t.deltaX,i=t.deltaY,o=t.index,a=t.nodeModel,s=t.graphModel,l=t.cancelCallback,u=t.forceProportional,c=u===void 0?!1:u,d=a.r,f=a.rx,h=a.ry,v=a.width,g=a.height,m=a.PCTResizeInfo,y=a.minWidth,x=a.minHeight,E=a.maxWidth,b=a.maxHeight,T=a.rotate,A=a.x,S=a.y,M=y===E,C=x===b,G={width:d||f||v,height:d||h||g,deltaX:r,deltaY:i,PCTResizeInfo:m},K=d||f&&h?1/2:1,J=e,R=n,k=Bj(o,G,K,M,C,T,J,R,A,S,c);if(k.width<y||k.width>E||k.height<x||k.height>b){l==null||l();return}(T%(2*Math.PI)==0||m||J===void 0||R===void 0)&&(k.deltaX=M?0:k.deltaX,k.deltaY=C?0:k.deltaY);var B=a.getData(),Z=a.resize(k);B.x===Z.x&&B.y===Z.y||(jj(a,s),Fj(B,Z,r,i,o,a,s))},$j=100,Hj={x:1,y:0};function zj(t,e,n,r,i){for(var o=function(h){if(h<0||h>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-h,3)+3*e.x*h*Math.pow(1-h,2)+3*n.x*Math.pow(h,2)*(1-h)+r.x*Math.pow(h,3),y:t.y*Math.pow(1-h,3)+3*e.y*h*Math.pow(1-h,2)+3*n.y*Math.pow(h,2)*(1-h)+r.y*Math.pow(h,3)}},a=0,s=2,l=r.x,u=r.y,c=r;a<i&&s<50;){c=o(1-s/$j);var d=c.x,f=c.y;a=Er(l,u,d,f),s++}return c}function Wj(t,e){return t.x*e.y-t.y*e.x}function Uj(t,e){var n=[t.x,t.y,t.z],r=[e.x,e.y,e.z];return r.reduce(function(i,o,a){return i+o*n[a]})}function Vj(t,e){var n=Wj(t,e),r=Math.acos(Uj(ub(t),ub(e)));return n>=0?r:-r}function ub(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function Xj(t){return Vj(Hj,t)}function Gj(t){return t*(180/Math.PI)}var cb={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Yj={rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Kj={baseNode:{fill:"#23272e",stroke:"#fefeff"},baseEdge:{stroke:"#fefeff"},rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},nodeText:{color:"#fefeff",overflowMode:"default",fontSize:12,lineHeight:1.2},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},qj={rect:{fill:"#72CBFF",stroke:"#3ABDF9",radius:8},circle:{fill:"#FFE075",stroke:"#F9CE3A",radius:8},ellipse:{fill:"#FFA8A8",stroke:"#FF6B66",radius:8},text:{fill:"#72CBFF",radius:8},diamond:{fill:"#96F7AF",stroke:"#40EF7E",radius:8},polygon:{fill:"#E0A8FF",stroke:"#C271FF",radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},za={colorful:qj,dark:Kj,radius:Yj,default:cb},Zj={background:"#23272e"},Jj={background:"#fefeff"},Cf={background:"#ffffff"},Wa={colorful:Jj,dark:Zj,radius:Cf,default:Cf},Qj={color:"#66676a",thickness:1},e3={color:"#dadada",thickness:1},Af={color:"#acacac",thickness:1},Ua={colorful:e3,dark:Qj,radius:Af,default:Af},db=function(t,e){var n=Pe(cb);return e&&(n=zi(n,za[e])),t&&(n=zi(n,t)),n},t3=function(t,e){if(za[t]){console.warn("theme mode ".concat(t," already exists"));return}za[t]=e,Wa[t]=e.background||Cf,Ua[t]=e.grid||Af},n3=function(t){delete za[t],delete Wa[t],delete Ua[t]},r3=function(){var t={colorful:{},dark:{},radius:{},default:{}};ut(za,t),ut(Wa,t),ut(Ua,t)},i3=db,o3=1e3,a3=999,Va=function(){return++o3},s3=function(){return--a3},jt=function(){return jt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},jt.apply(this,arguments)},Ce=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},eu=function(){function t(e,n){var r;this.BaseType=Lt.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=er.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=lt.DEFAULT,this.modelType=Ye.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.properties=(r=e.properties)!==null&&r!==void 0?r:{},this.initEdgeData(e),this.setAttributes()}return t.prototype.initEdgeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var r=this.graphModel.idGenerator,i=r&&r(e.type),o=this.createId();e.id=o||i||Si()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var a=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=a,ut(this,ej(e));var s=this.graphModel,l=s.overlapMode,u=s.eventCenter;this.updateZIndexByOverlap(l,e.zIndex||Va()),this.setAnchors(),this.initPoints(),this.formatText(e),u.on("overlap:change",function(c){var d=c.overlapMode;n.updateZIndexByOverlap(d,n.zIndex||Va())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return jt(jt({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return jt({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.edgeText;return Pe(e)},t.prototype.getEdgeAnimationStyle=function(){var e=this.graphModel.theme.edgeAnimation;return Pe(e)},t.prototype.getArrowStyle=function(){var e=this.getEdgeStyle(),n=this.getEdgeAnimationStyle(),r=this.graphModel.theme.arrow,i=this.isAnimation?n.stroke:e.stroke;return jt(jt(jt({},e),{fill:i,stroke:i}),r)},t.prototype.getOutlineStyle=function(){var e=this.graphModel,n=e.theme.outline;return Pe(n)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.prototype,"sourceNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.sourceNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.targetNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(e,n,r){var i,o,a=vf(e);if(r){if(i=hi(a,function(s){return s.id===r}),i)return i;console.warn("未在节点上找到指定的起点锚点".concat(r,",已使用默认锚点作为起点"))}return a.forEach(function(s){var l=Y_(s,n);(o===void 0||l<o)&&(o=l,i=s)}),i},t.prototype.getEndAnchor=function(e,n){var r=this,i,o,a=vf(e);if(n){if(i=hi(a,function(s){return s.id===n}),i)return i;console.warn("未在节点上找到指定的终点锚点".concat(n,",已使用默认锚点作为终点"))}return a.forEach(function(s){if(r.startPoint){var l=Y_(s,r.startPoint);(o===void 0||l<o)&&(o=l,i=s)}}),i},t.prototype.getProperties=function(){return mr(this.properties)},t.prototype.getData=function(){var e=this.properties;bi(e)&&(e=mr(e));var n={id:this.id,type:this.type,properties:e,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,startPoint:ut({},this.startPoint),endPoint:ut({},this.endPoint)};[Xt.INCREASE,Xt.STATIC].includes(this.graphModel.overlapMode)&&(n.zIndex=this.zIndex);var r=this.text,i=r.x,o=r.y,a=r.value;return a&&(n.text={x:i,y:o,value:a}),n},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.setProperty=function(e,n){Jd(this.properties,e,sn(n)),this.setAttributes()},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setProperties=function(e){this.properties=jt(jt({},mr(this.properties)),sn(e)),this.setAttributes()},t.prototype.changeEdgeId=function(e){var n=this.arrowConfig,r=n.markerEnd,i=n.markerStart;i&&i==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(e,")")),r&&r==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(e,")")),this.id=e},t.prototype.setStyle=function(e,n){var r;this.style=jt(jt({},this.style),(r={},r[e]=sn(n),r))},t.prototype.setStyles=function(e){this.style=jt(jt({},this.style),sn(e))},t.prototype.updateStyles=function(e){this.style=jt({},sn(e))},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,r,i,o=this.graphModel.editConfigModel,a=o.edgeTextDraggable,s=o.edgeTextEdit,l=this.textPosition,u=l.x,c=l.y,d=e.text,f={value:"",x:u,y:c,draggable:a,editable:s};d&&(typeof d=="string"?f=jt(jt({},f),{value:d}):(f=jt(jt({},f),{x:(n=d.x)!==null&&n!==void 0?n:u,y:(r=d.y)!==null&&r!==void 0?r:c,value:(i=d.value)!==null&&i!==void 0?i:""}),Hi(d.draggable)||(f.draggable=d.draggable),Hi(d.editable)||(f.editable=d.editable))),this.text=f},t.prototype.resetTextPosition=function(){var e=this.textPosition,n=e.x,r=e.y;this.text.x=n,this.text.y=r},t.prototype.moveText=function(e,n){var r=this.text,i=r.x,o=r.y,a=r.value,s=r.draggable,l=r.editable;this.text={value:a,editable:l,draggable:s,x:i+e,y:o+n}},t.prototype.setText=function(e){e&&ut(this.text,e)},t.prototype.updateText=function(e){this.text=jt(jt({},mr(this.text)),{value:e})},t.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){var e=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!e)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:e.x,y:e.y}),this.sourceAnchorId||(this.sourceAnchorId=e.id)}if(!this.targetAnchorId||!this.endPoint){var e=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!e)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:e.x,y:e.y}),this.targetAnchorId||(this.targetAnchorId=e.id)}},t.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},t.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e},t.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},t.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},t.prototype.openEdgeAnimation=function(){this.isAnimation=!0},t.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},t.prototype.setElementState=function(e,n){this.state=e,this.additionStateData=n},t.prototype.updateStartPoint=function(e){this.startPoint=e},t.prototype.moveStartPoint=function(e,n){this.startPoint&&(this.startPoint.x+=e,this.startPoint.y+=n)},t.prototype.updateEndPoint=function(e){this.endPoint=e},t.prototype.moveEndPoint=function(e,n){this.endPoint&&(this.endPoint.x+=e,this.endPoint.y+=n)},t.prototype.setZIndex=function(e){e===void 0&&(e=0),this.zIndex=e},t.prototype.initPoints=function(){},t.prototype.updateAttributes=function(e){ut(this,e)},t.prototype.getAdjustStart=function(){return this.startPoint},t.prototype.getAdjustEnd=function(){return this.endPoint},t.prototype.updateAfterAdjustStartAndEnd=function(e){var n=e.startPoint,r=e.endPoint;this.updateStartPoint({x:n.x,y:n.y}),this.updateEndPoint({x:r.x,y:r.y})},t.prototype.updateZIndexByOverlap=function(e,n){switch(e){case Xt.DEFAULT:this.zIndex=0;break;case Xt.EDGE_TOP:this.zIndex=1;break;case Xt.INCREASE:this.zIndex=n;break}},t.BaseType=Lt.EDGE,Ce([X],t.prototype,"type",void 0),Ce([X],t.prototype,"sourceNodeId",void 0),Ce([X],t.prototype,"targetNodeId",void 0),Ce([X],t.prototype,"startPoint",void 0),Ce([X],t.prototype,"endPoint",void 0),Ce([X],t.prototype,"textMode",void 0),Ce([X],t.prototype,"text",void 0),Ce([X],t.prototype,"properties",void 0),Ce([X],t.prototype,"points",void 0),Ce([X],t.prototype,"pointsList",void 0),Ce([X],t.prototype,"isSelected",void 0),Ce([X],t.prototype,"isHovered",void 0),Ce([X],t.prototype,"isHitable",void 0),Ce([X],t.prototype,"isHittable",void 0),Ce([X],t.prototype,"draggable",void 0),Ce([X],t.prototype,"visible",void 0),Ce([X],t.prototype,"isAnimation",void 0),Ce([X],t.prototype,"isShowAdjustPoint",void 0),Ce([X],t.prototype,"zIndex",void 0),Ce([X],t.prototype,"state",void 0),Ce([X],t.prototype,"style",void 0),Ce([X],t.prototype,"arrowConfig",void 0),Ce([Et],t.prototype,"sourceNode",null),Ce([Et],t.prototype,"targetNode",null),Ce([Et],t.prototype,"textPosition",null),Ce([U],t.prototype,"setProperty",null),Ce([U],t.prototype,"deleteProperty",null),Ce([U],t.prototype,"setProperties",null),Ce([U],t.prototype,"changeEdgeId",null),Ce([U],t.prototype,"setStyle",null),Ce([U],t.prototype,"setStyles",null),Ce([U],t.prototype,"updateStyles",null),Ce([U],t.prototype,"setTextMode",null),Ce([U],t.prototype,"formatText",null),Ce([U],t.prototype,"resetTextPosition",null),Ce([U],t.prototype,"moveText",null),Ce([U],t.prototype,"setText",null),Ce([U],t.prototype,"updateText",null),Ce([U],t.prototype,"setAnchors",null),Ce([U],t.prototype,"setSelected",null),Ce([U],t.prototype,"setHovered",null),Ce([U],t.prototype,"setHitable",null),Ce([U],t.prototype,"setHittable",null),Ce([U],t.prototype,"openEdgeAnimation",null),Ce([U],t.prototype,"closeEdgeAnimation",null),Ce([U],t.prototype,"setElementState",null),Ce([U],t.prototype,"updateStartPoint",null),Ce([U],t.prototype,"moveStartPoint",null),Ce([U],t.prototype,"updateEndPoint",null),Ce([U],t.prototype,"moveEndPoint",null),Ce([U],t.prototype,"setZIndex",null),Ce([U],t.prototype,"initPoints",null),Ce([U],t.prototype,"updateAttributes",null),Ce([U],t.prototype,"getAdjustStart",null),Ce([U],t.prototype,"getAdjustEnd",null),Ce([U],t.prototype,"updateAfterAdjustStartAndEnd",null),Ce([U],t.prototype,"updateZIndexByOverlap",null),t}(),l3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qi=function(){return qi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},qi.apply(this,arguments)},ir=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Of=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},fb=function(t){l3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.BEZIER_EDGE,i.path="",i.initEdgeData(n),i.setAttributes(),i}return e.prototype.initEdgeData=function(n){this.offset=ui(n,"properties.offset",100),t.prototype.initEdgeData.call(this,n)},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.bezier,r=t.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return qi(qi(qi({},r),Pe(n)),Pe(o))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var n=0,r=0;return this.pointsList.forEach(function(i){var o=i.x,a=i.y;n+=o,r+=a}),{x:n/this.pointsList.length,y:r/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var n=t.prototype.getData.call(this),r=this.pointsList.map(function(i){var o=i.x,a=i.y;return{x:o,y:a}});return qi(qi({},n),{pointsList:r})},e.prototype.getControls=function(){var n=this.startPoint,r=this.endPoint,i=V_({start:n,end:r,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset});return i},e.prototype.getPath=function(n){var r=Of(n,4),i=r[0],o=r[1],a=r[2],s=r[3];return"M ".concat(i.x," ").concat(i.y,`
|
|
64
|
+
C `).concat(o.x," ").concat(o.y,`,
|
|
65
|
+
`).concat(a.x," ").concat(a.y,`,
|
|
66
|
+
`).concat(s.x," ").concat(s.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=this.getControls(),r=n.sNext,i=n.ePre;this.updatePath(r,i)},e.prototype.updatePath=function(n,r){n=Pe(n),r=Pe(r);var i={x:this.startPoint.x,y:this.startPoint.y},o={x:this.endPoint.x,y:this.endPoint.y};if(!n||!r){var a=this.getControls();n=a.sNext,r=a.ePre}this.pointsList=[i,n,r,o],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,r){this.startPoint.x+=n,this.startPoint.y+=r;var i=Of(this.pointsList,3),o=i[1],a=i[2];o.x+=n,o.y+=r,this.updatePath(o,a)},e.prototype.moveEndPoint=function(n,r){this.endPoint.x+=n,this.endPoint.y+=r;var i=Of(this.pointsList,3),o=i[1],a=i[2];a.x+=n,a.y+=r,this.updatePath(o,a)},e.prototype.updateAdjustAnchor=function(n,r){var i;r==="sNext"?this.pointsList[1]=n:r==="ePre"&&(this.pointsList[2]=n),this.path=this.getPath(this.pointsList),!((i=this.text)===null||i===void 0)&&i.value&&this.setText(ut({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var r=n.startPoint,i=n.endPoint,o=n.sourceNode,a=n.targetNode,s=V_({start:r,end:i,sourceNode:o,targetNode:a,offset:this.offset}),l=s.sNext,u=s.ePre;this.pointsList=[r,l,u,i],this.initPoints()},ir([X],e.prototype,"offset",void 0),ir([X],e.prototype,"path",void 0),ir([U],e.prototype,"initPoints",null),ir([U],e.prototype,"updatePoints",null),ir([U],e.prototype,"updateStartPoint",null),ir([U],e.prototype,"updateEndPoint",null),ir([U],e.prototype,"moveStartPoint",null),ir([U],e.prototype,"moveEndPoint",null),ir([U],e.prototype,"updateAdjustAnchor",null),ir([U],e.prototype,"getAdjustStart",null),ir([U],e.prototype,"getAdjustEnd",null),ir([U],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(eu),u3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xa=function(){return Xa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Xa.apply(this,arguments)},pb=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},c3=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},hb=function(t){u3(e,t);function e(){var n=t.apply(this,c3([],pb(arguments),!1))||this;return n.modelType=Ye.LINE_EDGE,n}return e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.line,r=t.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return Xa(Xa(Xa({},r),Pe(n)),Pe(o))},e.prototype.initEdgeData=function(n){t.prototype.initEdgeData.call(this,n),this.points=this.getPath([this.startPoint,this.endPoint])},e.prototype.getPath=function(n){var r=pb(n,2),i=r[0],o=r[1];return"".concat(i.x,",").concat(i.y," ").concat(o.x,",").concat(o.y)},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e}(eu),d3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ga=function(){return Ga=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ga.apply(this,arguments)},Qt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},gb=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},f3=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Ya=function(t){d3(e,t);function e(){var n=t.apply(this,f3([],gb(arguments),!1))||this;return n.modelType=Ye.POLYLINE_EDGE,n.draggingPointList=[],n}return e.prototype.initEdgeData=function(n){this.offset=ui(n,"properties.offset",30),n.pointsList&&(this.pointsList=n.pointsList),t.prototype.initEdgeData.call(this,n)},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.polyline,r=t.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return Ga(Ga(Ga({},r),Pe(n)),Pe(o))},e.prototype.getTextPosition=function(){var n,r=(n=this.text)===null||n===void 0?void 0:n.value;if(this.dbClickPosition&&!r){var i=this.dbClickPosition,o=i.x,a=i.y;return{x:o,y:a}}var s=Ki(this.points),l=gb(ZB(s),2),u=l[0],c=l[1];return{x:(u.x+c.x)/2,y:(u.y+c.y)/2}},e.prototype.getAfterAnchor=function(n,r,i){var o,a;return i.forEach(function(s){var l;n===Tt.HORIZONTAL?l=Math.abs(r.y-s.y):n===Tt.VERTICAL&&(l=Math.abs(r.x-s.x)),(!a||a>l)&&(a=l,o=s)}),o},e.prototype.getCrossPoint=function(n,r,i){var o;return n===Tt.HORIZONTAL?o={x:i.x,y:r.y}:n===Tt.VERTICAL&&(o={x:r.x,y:i.y}),o},e.prototype.removeCrossPoints=function(n,r,i){var o=i.map(function(y){return y});if(n===1){var a=o[n],s=o[r],l=o[n-1],u=$_(l,a,this.sourceNode);if(u){var c=H_(a,s,this.sourceNode);if(c){var d=z_(a,s,this.sourceNode);d&&(o[n]=d,o.splice(n-1,1),n--,r--)}}else{var f=this.sourceNode.anchors;f.forEach(function(y){if(y.x===l.x&&y.x===a.x||y.y===l.y&&y.y===a.y){var x=Er(y.x,y.y,a.x,a.y),E=Er(l.x,l.y,a.x,a.y);x<E&&(o[n-1]=y)}})}}if(r===i.length-2){var h=o[n],v=o[r],g=o[r+1],m=$_(v,g,this.targetNode);if(m){var c=H_(h,v,this.targetNode);if(c){var d=z_(h,v,this.targetNode);d&&(o[r]=d,o.splice(r+1,1))}}else{var f=this.targetNode.anchors;f.forEach(function(x){if(x.x===g.x&&x.x===v.x||x.y===g.y&&x.y===v.y){var E=Er(x.x,x.y,v.x,v.y),b=Er(g.x,g.y,v.x,v.y);E<b&&(o[r+1]=x)}})}}return o},e.prototype.getDraggingPoints=function(n,r,i,o,a){var s=a.map(function(c){return c}),l=this.getAfterAnchor(n,i,o),u=this.getCrossPoint(n,i,l);return r==="start"?(s.unshift(u),s.unshift(l)):(s.push(u),s.push(l)),s},e.prototype.updateCrossPoints=function(n){var r=n.map(function(x){return x}),i=n[0],o=n[1],a=n[r.length-2],s=n[r.length-1],l=this,u=l.sourceNode,c=l.targetNode,d=u.modelType,f=c.modelType,h=zl(i,o),v=r[0];switch(d){case Ye.RECT_NODE:if(u.radius!==0){var g=Q_(i,u);g||(v=J_(i,h,u))}break;case Ye.CIRCLE_NODE:v=mf(i,h,u);break;case Ye.ELLIPSE_NODE:v=eb(i,h,u);break;case Ye.DIAMOND_NODE:v=Kl(i,h,u);break;case Ye.POLYGON_NODE:v=Kl(i,h,u);break}v&&(r[0]=v);var m=zl(a,s),y=r[r.length-1];switch(f){case Ye.RECT_NODE:if(c.radius!==0){var g=Q_(s,c);g||(y=J_(s,m,c))}break;case Ye.CIRCLE_NODE:y=mf(s,m,c);break;case Ye.ELLIPSE_NODE:y=eb(s,m,c);break;case Ye.DIAMOND_NODE:y=Kl(s,m,c);break;case Ye.POLYGON_NODE:y=Kl(s,m,c);break}return y&&(r[r.length-1]=y),r},e.prototype.updatePath=function(n){this.pointsList=n,this.points=this.getPath(this.pointsList)},e.prototype.getData=function(){var n=t.prototype.getData.call(this),r=this.pointsList.map(function(i){var o=i.x,a=i.y;return{x:o,y:a}});return Object.assign({},n,{pointsList:r})},e.prototype.getPath=function(n){return n.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=F_({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=n,this.points=n.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,r){this.startPoint.x+=n,this.startPoint.y+=r,this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveEndPoint=function(n,r){this.endPoint.x+=n,this.endPoint.y+=r,this.updatePoints()},e.prototype.updatePointsList=function(n,r){this.pointsList.forEach(function(a){a.x+=n,a.y+=r});var i=this.pointsList[0];this.startPoint=Object.assign({},i);var o=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},o),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(n){return n})},e.prototype.dragAppendSimple=function(n,r){var i;this.isDragging=!0;var o=n.start,a=n.end,s=n.startIndex,l=n.endIndex,u=n.direction,c=this.pointsList,d=c;return u===Tt.HORIZONTAL?(c[s]={x:o.x,y:o.y+r.y},c[l]={x:a.x,y:a.y+r.y},d=this.pointsList.map(function(f){return f})):u===Tt.VERTICAL&&(c[s]={x:o.x+r.x,y:o.y},c[l]={x:a.x+r.x,y:a.y},d=this.pointsList.map(function(f){return f})),this.updatePointsAfterDrag(d),this.draggingPointList=d,!((i=this.text)===null||i===void 0)&&i.value&&this.setText(ut({},this.text,this.textPosition)),{start:ut({},c[s]),end:ut({},c[l]),startIndex:s,endIndex:l,direction:u}},e.prototype.dragAppend=function(n,r){var i;this.isDragging=!0;var o=n.start,a=n.end,s=n.startIndex,l=n.endIndex,u=n.direction,c=this.pointsList;if(u===Tt.HORIZONTAL){c[s]={x:o.x,y:o.y+r.y},c[l]={x:a.x,y:a.y+r.y};var d=this.pointsList.map(function(m){return m});if(s!==0&&l!==this.pointsList.length-1&&(d=this.removeCrossPoints(s,l,d)),s===0){var f={x:o.x,y:o.y+r.y},h=ni(f,this.sourceNode);if(!h){var v=this.sourceNode.anchors;d=this.getDraggingPoints(u,"start",f,v,d)}}if(l===this.pointsList.length-1){var g={x:a.x,y:a.y+r.y},h=ni(g,this.targetNode);if(!h){var v=this.targetNode.anchors;d=this.getDraggingPoints(u,"end",g,v,d)}}this.updatePointsAfterDrag(d),this.draggingPointList=d}else if(u===Tt.VERTICAL){c[s]={x:o.x+r.x,y:o.y},c[l]={x:a.x+r.x,y:a.y};var d=this.pointsList.map(function(y){return y});if(s!==0&&l!==this.pointsList.length-1&&(d=this.removeCrossPoints(s,l,d)),s===0){var f={x:o.x+r.x,y:o.y},h=ni(f,this.sourceNode);if(!h){var v=this.sourceNode.anchors;d=this.getDraggingPoints(u,"start",f,v,d)}}if(l===this.pointsList.length-1){var g={x:a.x+r.x,y:a.y},h=ni(g,this.targetNode);if(!h){var v=this.targetNode.anchors;d=this.getDraggingPoints(u,"end",g,v,d)}}this.updatePointsAfterDrag(d),this.draggingPointList=d}return!((i=this.text)===null||i===void 0)&&i.value&&this.setText(ut({},this.text,this.textPosition)),{start:ut({},c[s]),end:ut({},c[l]),startIndex:s,endIndex:l,direction:u}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var n=j_(Ki(this.points));this.pointsList=n.map(function(o){return o}),this.draggingPointList=[];var r=n[0];this.startPoint=ut({},r);var i=n[n.length-1];this.endPoint=ut({},i)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(n){var r=this.updateCrossPoints(n);this.points=r.map(function(i){return"".concat(i.x,",").concat(i.y)}).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var r=n.startPoint,i=n.endPoint,o=n.sourceNode,a=n.targetNode;this.pointsList=F_({x:r.x,y:r.y},{x:i.x,y:i.y},o,a,this.offset||0),this.initPoints()},Qt([X],e.prototype,"offset",void 0),Qt([X],e.prototype,"dbClickPosition",void 0),Qt([U],e.prototype,"initPoints",null),Qt([U],e.prototype,"updatePoints",null),Qt([U],e.prototype,"updateStartPoint",null),Qt([U],e.prototype,"moveStartPoint",null),Qt([U],e.prototype,"updateEndPoint",null),Qt([U],e.prototype,"moveEndPoint",null),Qt([U],e.prototype,"updatePointsList",null),Qt([U],e.prototype,"dragAppendStart",null),Qt([U],e.prototype,"dragAppendSimple",null),Qt([U],e.prototype,"dragAppend",null),Qt([U],e.prototype,"dragAppendEnd",null),Qt([U],e.prototype,"updatePointsAfterDrag",null),Qt([U],e.prototype,"getAdjustStart",null),Qt([U],e.prototype,"getAdjustEnd",null),Qt([U],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(eu),Ht=function(){return Ht=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ht.apply(this,arguments)},Re=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},vb=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},p3=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ci=function(){function t(e,n){var r;this.BaseType=Lt.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=er.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=lt.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=Ye.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.resizeRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=(r=e.properties)!==null&&r!==void 0?r:{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e;var n=this,r=n.x,i=r===void 0?0:r,o=n.y,a=o===void 0?0:o;this.transform=new Xl(-i,-a).rotate(e).translate(i,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var r=this.graphModel.idGenerator,i=r&&r(e.type),o=this.createId();e.id=o||i||Si()}this.formatText(e),ut(this,dj(e));var a=this.graphModel,s=a.overlapMode,l=a.eventCenter;this.updateZIndexByOverlap(s,e.zIndex||Va()),l.on("overlap:change",function(u){var c=u.overlapMode;n.updateZIndexByOverlap(c,n.zIndex||Va())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,r,i,o=this.graphModel.editConfigModel,a=o.nodeTextDraggable,s=o.nodeTextEdit,l=e.x,u=e.y,c=e.text,d={value:"",x:l,y:u,draggable:a,editable:s};c&&(typeof c=="string"?d.value=c:(d=Ht(Ht({},d),{x:(n=c.x)!==null&&n!==void 0?n:l,y:(r=c.y)!==null&&r!==void 0?r:u,value:(i=c.value)!==null&&i!==void 0?i:""}),Hi(c.draggable)||(d.draggable=c.draggable),Hi(c.editable)||(d.editable=c.editable))),e.text=d},t.prototype.resize=function(e){var n=e.width,r=e.height,i=e.deltaX,o=e.deltaY,a=this.isAllowResizeNode(i,o,n,r);return a?(this.move(i/2,o/2),this.width=n,this.height=r,this.setProperties({width:n,height:r}),this.getData()):this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var e=this.text,n=e.x,r=e.y,i=e.value,o=this.properties;bi(o)&&(o=mr(o)),pn(o.width)&&(o.width=this.width),pn(o.height)&&(o.height=this.height);var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:o};return this.rotate&&(a.rotate=this.rotate),[Xt.INCREASE,Xt.STATIC].includes(this.graphModel.overlapMode)&&(a.zIndex=this.zIndex),i&&(a.text={x:n,y:r,value:i}),a},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return mr(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return Ht(Ht({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.nodeText,n=this.properties.textStyle,r=n===void 0?{}:n;return Ht(Ht({},Pe(e)),Pe(r))},t.prototype.getRotateControlStyle=function(){var e=this.graphModel.theme.rotateControl;return Pe(e)},t.prototype.getResizeControlStyle=function(){var e=this.graphModel.theme.resizeControl;return Pe(e)},t.prototype.getResizeOutlineStyle=function(){var e=this.graphModel.theme.resizeOutline;return Pe(e)},t.prototype.getAnchorStyle=function(e){var n=this.graphModel.theme.anchor;return Pe(n)},t.prototype.getAnchorLineStyle=function(e){var n=this.graphModel.theme.anchorLine;return Pe(n)},t.prototype.getOutlineStyle=function(){var e=this.graphModel.theme.outline;return Pe(e)},t.prototype.isAllowConnectedAsSource=function(e,n,r,i){var o=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,s="",l=0;l<o.length;l++){var u=o[l];if(!u.validate.call(this,this,e,n,r,i)){a=!1,s=u.message;break}}return{isAllPass:a,msg:s}},t.prototype.getConnectedSourceRules=function(){return this.sourceRules},t.prototype.isAllowConnectedAsTarget=function(e,n,r,i){var o=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var a=!0,s="",l=0;l<o.length;l++){var u=o[l];if(!u.validate.call(this,e,this,n,r,i)){a=!1,s=u.message;break}}return{isAllPass:a,msg:s}},t.prototype.isAllowMoveNode=function(e,n){var r,i,o=!0,a=!0,s=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var l=vb(s),u=l.next();!u.done;u=l.next()){var c=u.value,d=c(this,e,n);if(!d)return!1;if(typeof d=="object"){var f=d;if(!f.x&&!f.y)return!1;o=o&&f.x,a=a&&f.y}}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return{x:o,y:a}},t.prototype.getConnectedTargetRules=function(){return this.targetRules},t.prototype.getAnchorsByOffset=function(){var e=this,n=e.anchorsOffset,r=e.id,i=e.x,o=e.y;return n&&n.length>0?n.map(function(a,s){return a.length?(a=a,{id:"".concat(r,"_").concat(s),x:i+a[0],y:o+a[1]}):(a=a,Ht(Ht({},a),{x:i+a.x,y:o+a.y,id:a.id||"".concat(r,"_").concat(s)}))}):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(e){return lj(e,this)},t.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(t.prototype,"anchors",{get:function(){var e=this.getAnchorsByOffset(),n=this,r=n.x,i=n.y,o=n.rotate;return e.forEach(function(a){var s=a.x,l=a.y,u=p3(new ka([s,l,1]).translate(-r,-i).rotate(o).translate(r,i)[0],2),c=u[0],d=u[1];a.x=c,a.y=d}),e},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(e){if(!pn(e))for(var n=0;n<this.anchors.length;n++){var r=this.anchors[n];if(r.id===e)return r}},t.prototype.addNodeMoveRules=function(e){this.moveRules.includes(e)||this.moveRules.push(e)},t.prototype.isAllowMoveByXORY=function(e,n,r){var i,o;if(r)i=!0,o=!0;else{var a=this.isAllowMoveNode(e,n);typeof a=="boolean"?(i=a,o=a):(i=a.x,o=a.y)}return{isAllowMoveX:i,isAllowMoveY:o}},t.prototype.move=function(e,n,r){r===void 0&&(r=!1);var i=this.isAllowMoveByXORY(e,n,r),o=i.isAllowMoveX,a=i.isAllowMoveY;return o&&(this.x=this.x+e,this.text&&this.moveText(e,0)),a&&(this.y=this.y+n,this.text&&this.moveText(0,n)),(o||a)&&(this.rotate=this._rotate),o||a},t.prototype.getMoveDistance=function(e,n,r){r===void 0&&(r=!1);var i=this.isAllowMoveByXORY(e,n,r),o=i.isAllowMoveX,a=i.isAllowMoveY,s=0,l=0;return o&&e&&(this.x=this.x+e,this.text&&this.moveText(e,0),s=e),a&&n&&(this.y=this.y+n,this.text&&this.moveText(0,n),l=n),this.transform=new Xl(-this.x,-this.y).rotate(this.rotate).translate(this.x,this.y).toString(),[s,l]},t.prototype.moveTo=function(e,n,r){r===void 0&&(r=!1);var i=e-this.x,o=n-this.y;return!r&&!this.isAllowMoveNode(i,o)?!1:(this.text&&this.moveText(i,o),this.x=e,this.y=n,!0)},t.prototype.moveText=function(e,n){var r=this.text,i=r.x,o=r.y,a=r.value,s=r.draggable,l=r.editable;this.text={value:a,editable:l,draggable:s,x:i+e,y:o+n}},t.prototype.updateText=function(e){this.text=Ht(Ht({},mr(this.text)),{value:e})},t.prototype.addNodeResizeRules=function(e){this.resizeRules.includes(e)||this.resizeRules.push(e)},t.prototype.isAllowResizeNode=function(e,n,r,i){var o,a,s=this.resizeRules.concat(this.graphModel.nodeResizeRules);try{for(var l=vb(s),u=l.next();!u.done;u=l.next()){var c=u.value,d=c(this,e,n,r,i);if(!d)return!1}}catch(f){o={error:f}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return!0},t.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},t.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e,this.setIsShowAnchor(e)},t.prototype.setIsShowAnchor=function(e){e===void 0&&(e=!0),this.isShowAnchor=e},t.prototype.setRotatable=function(e){e===void 0&&(e=!0),this.rotatable=e},t.prototype.setResizable=function(e){e===void 0&&(e=!0),this.resizable=e},t.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},t.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},t.prototype.setElementState=function(e,n){this.state=e,this.additionStateData=n},t.prototype.updateProperties=function(e,n){var r=mr(this.properties);this.properties=e,this.setAttributes(),this.graphModel.eventCenter.emit(be.NODE_PROPERTIES_CHANGE,{id:this.id,keys:n,preProperties:r,properties:e})},t.prototype.setProperty=function(e,n){var r=mr(this.properties),i=Pe(r);um(i,e,sn(n)),this.updateProperties(i,[e])},t.prototype.setProperties=function(e){var n=mr(this.properties),r=Ht(Ht({},n),sn(e)),i=[];Hv(e,function(o,a){(Ks(n,a)&&n[a]!==o||!Ks(n,a))&&i.push(a)}),this.updateProperties(r,i)},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setStyle=function(e,n){var r;this.style=Ht(Ht({},this.style),(r={},r[e]=sn(n),r))},t.prototype.setStyles=function(e){this.style=Ht(Ht({},this.style),sn(e))},t.prototype.updateStyles=function(e){this.style=Ht({},sn(e))},t.prototype.setZIndex=function(e){e===void 0&&(e=1),this.zIndex=e},t.prototype.updateAttributes=function(e){ut(this,e)},t.prototype.updateZIndexByOverlap=function(e,n){switch(e){case Xt.DEFAULT:this.zIndex=1;break;case Xt.EDGE_TOP:this.zIndex=0;break;case Xt.INCREASE:this.zIndex=n;break}},t.BaseType=Lt.NODE,Re([X],t.prototype,"type",void 0),Re([X],t.prototype,"x",void 0),Re([X],t.prototype,"y",void 0),Re([X],t.prototype,"textMode",void 0),Re([X],t.prototype,"text",void 0),Re([X],t.prototype,"properties",void 0),Re([X],t.prototype,"_width",void 0),Re([X],t.prototype,"_height",void 0),Re([X],t.prototype,"anchorsOffset",void 0),Re([X],t.prototype,"isSelected",void 0),Re([X],t.prototype,"isHovered",void 0),Re([X],t.prototype,"isShowAnchor",void 0),Re([X],t.prototype,"isDragging",void 0),Re([X],t.prototype,"isHitable",void 0),Re([X],t.prototype,"isHittable",void 0),Re([X],t.prototype,"draggable",void 0),Re([X],t.prototype,"visible",void 0),Re([X],t.prototype,"rotatable",void 0),Re([X],t.prototype,"resizable",void 0),Re([X],t.prototype,"zIndex",void 0),Re([X],t.prototype,"state",void 0),Re([X],t.prototype,"autoToFront",void 0),Re([X],t.prototype,"style",void 0),Re([X],t.prototype,"transform",void 0),Re([X],t.prototype,"_rotate",void 0),Re([Et],t.prototype,"incoming",null),Re([Et],t.prototype,"outgoing",null),Re([U],t.prototype,"setTextMode",null),Re([U],t.prototype,"addNodeMoveRules",null),Re([U],t.prototype,"move",null),Re([U],t.prototype,"getMoveDistance",null),Re([U],t.prototype,"moveTo",null),Re([U],t.prototype,"moveText",null),Re([U],t.prototype,"updateText",null),Re([U],t.prototype,"addNodeResizeRules",null),Re([U],t.prototype,"setSelected",null),Re([U],t.prototype,"setHovered",null),Re([U],t.prototype,"setIsShowAnchor",null),Re([U],t.prototype,"setRotatable",null),Re([U],t.prototype,"setResizable",null),Re([U],t.prototype,"setHitable",null),Re([U],t.prototype,"setHittable",null),Re([U],t.prototype,"setElementState",null),Re([U],t.prototype,"setProperty",null),Re([U],t.prototype,"setProperties",null),Re([U],t.prototype,"deleteProperty",null),Re([U],t.prototype,"setStyle",null),Re([U],t.prototype,"setStyles",null),Re([U],t.prototype,"updateStyles",null),Re([U],t.prototype,"setZIndex",null),Re([U],t.prototype,"updateAttributes",null),Re([U],t.prototype,"updateZIndexByOverlap",null),t}(),h3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ka=function(){return Ka=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ka.apply(this,arguments)},Tf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},tu=function(t){h3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.CIRCLE_NODE,i.r=50,i.initNodeData(n),i.setAttributes(),i}return Object.defineProperty(e.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties.r;n&&(this.r=n)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.circle,i=this.properties.style,o=i===void 0?{}:i;return Ka(Ka(Ka({},n),Pe(r)),Pe(o))},e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.r;return[{x:r,y:i-o,id:"".concat(this.id,"_0")},{x:r+o,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+o,id:"".concat(this.id,"_2")},{x:r-o,y:i,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var r=n.width,i=n.deltaX,o=n.deltaY;return this.move(i/2,o/2),this.r=r,this.setProperties({r}),this.getData()},Tf([X],e.prototype,"r",void 0),Tf([Et],e.prototype,"width",null),Tf([Et],e.prototype,"height",null),e}(Ci),g3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qa=function(){return qa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},qa.apply(this,arguments)},Wo=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},nu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Nf=function(t){g3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.DIAMOND_NODE,i.rx=30,i.ry=50,i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.rx,i=n.ry;r&&(this.rx=r),i&&(this.ry=i)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.diamond,i=this.properties.style,o=i===void 0?{}:i;return qa(qa(qa({},n),Pe(r)),Pe(o))},Object.defineProperty(e.prototype,"points",{get:function(){var n=this,r=n.x,i=n.y,o=n.rx,a=n.ry;return[[r,i-a],[r+o,i],[r,i+a],[r-o,i]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return Bn(this.points,function(n){var r=nu(n,2),i=r[0],o=r[1];return{x:i,y:o}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return gt(this.points,function(i){var o=nu(i,1),a=o[0];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return gt(this.points,function(i){var o=nu(i,2),a=o[1];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this;return Bn(this.points,function(r,i){var o=nu(r,2),a=o[0],s=o[1];return{x:a,y:s,id:"".concat(n.id,"_").concat(i)}})},e.prototype.resize=function(n){var r=n.width,i=n.height,o=n.deltaX,a=n.deltaY;return this.move(o/2,a/2),this.rx=r,this.ry=i,this.setProperties({rx:r,ry:i}),this.getData()},Wo([X],e.prototype,"rx",void 0),Wo([X],e.prototype,"ry",void 0),Wo([Et],e.prototype,"points",null),Wo([Et],e.prototype,"pointsPosition",null),Wo([Et],e.prototype,"width",null),Wo([Et],e.prototype,"height",null),e}(Ci),v3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Za=function(){return Za=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Za.apply(this,arguments)},ru=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Mf=function(t){v3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.ELLIPSE_NODE,i.rx=30,i.ry=45,i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.rx,i=n.ry;r&&(this.rx=r),i&&(this.ry=i)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.ellipse,i=this.properties.style,o=i===void 0?{}:i;return Za(Za(Za({},n),Pe(r)),Pe(o))},Object.defineProperty(e.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.rx,a=n.ry;return[{x:r,y:i-a,id:"".concat(this.id,"_0")},{x:r+o,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a,id:"".concat(this.id,"_2")},{x:r-o,y:i,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var r=n.width,i=n.height,o=n.deltaX,a=n.deltaY;return this.move(o/2,a/2),this.rx=r,this.ry=i,this.setProperties({rx:r,ry:i}),this.getData()},ru([X],e.prototype,"rx",void 0),ru([X],e.prototype,"ry",void 0),ru([Et],e.prototype,"width",null),ru([Et],e.prototype,"height",null),e}(Ci),m3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ja=function(){return Ja=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ja.apply(this,arguments)},iu=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},ou=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},au=function(t){m3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.POLYGON_NODE,i.points=[[50,0],[100,50],[50,100],[0,50]],i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.points,i=n.width,o=n.height,a=r||this.points;this.points=rj(a,i,o)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.polygon,i=this.properties.style,o=i===void 0?{}:i;return Ja(Ja(Ja({},n),Pe(r)),Pe(o))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var n=this,r=n.x,i=n.y,o=n.width,a=n.height;return this.points.map(function(s){return{x:s[0]+r-o/2,y:s[1]+i-a/2}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(i){var o=ou(i,1),a=o[0];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(i){var o=ou(i,2),a=o[1];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,r=this,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points;return l.map(function(u,c){var d=ou(u,2),f=d[0],h=d[1];return{x:i+f-a/2,y:o+h-s/2,id:"".concat(n.id,"_").concat(c)}})},e.prototype.resize=function(n){var r=this,i=n.width,o=n.height,a=n.deltaX,s=n.deltaY;this.move(a/2,s/2);var l=Bn(this.points,function(u){var c=ou(u,2),d=c[0],f=c[1];return[d*i/r.width,f*o/r.height]});return this.points=l,this.properties.points=l,this.getData()},iu([X],e.prototype,"points",void 0),iu([Et],e.prototype,"pointsPosition",null),iu([Et],e.prototype,"width",null),iu([Et],e.prototype,"height",null),e}(Ci),y3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qa=function(){return Qa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Qa.apply(this,arguments)},_3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Uo=function(t){y3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.RECT_NODE,i.radius=0,i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.width,i=n.height,o=n.radius,a=this.getNodeStyle().radius;pn(r)||(this.width=r),pn(i)||(this.height=i),pn(o)||(this.radius=o),pn(a)||(this.radius=a)},e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.width,a=n.height;return[{x:r,y:i-a/2,id:"".concat(this.id,"_0")},{x:r+o/2,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a/2,id:"".concat(this.id,"_2")},{x:r-o/2,y:i,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.rect,i=this.properties.style,o=i===void 0?{}:i;return Qa(Qa(Qa({},n),Pe(r)),Pe(o))},_3([X],e.prototype,"radius",void 0),e}(Ci),b3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),es=function(){return es=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},es.apply(this,arguments)},mb=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},x3=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},E3=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},yb=function(t){b3(e,t);function e(){var n=t.apply(this,E3([],x3(arguments),!1))||this;return n.modelType=Ye.TEXT_NODE,n}return e.prototype.getTextStyle=function(){var n=t.prototype.getTextStyle.call(this),r=this.graphModel.theme.text,i=this.properties.textStyle;return es(es(es({},n),Pe(r)),Pe(i))},Object.defineProperty(e.prototype,"width",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),r=this.getTextStyle().fontSize,i=rb({rows:n,fontSize:r,rowsLength:n.length}).width;return i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),r=this.getTextStyle().fontSize,i=rb({rows:n,fontSize:r,rowsLength:n.length}).height;return i},enumerable:!1,configurable:!0}),mb([Et],e.prototype,"width",null),mb([Et],e.prototype,"height",null),e}(Ci),w3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Df=function(t){w3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.HTML_NODE,i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.width,i=n.height;r&&(this.width=r),i&&(this.height=i)},e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.width,a=n.height;return[{x:r,y:i-a/2,id:"".concat(this.id,"_0")},{x:r+o/2,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a/2,id:"".concat(this.id,"_2")},{x:r-o/2,y:i,id:"".concat(this.id,"_3")}]},e}(Ci),ht=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},S3={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},su=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","snapGrid","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],C3=function(){function t(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.snapGrid=!1,this.textMode=er.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=er.TEXT,this.edgeTextMode=er.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",ut(this,this.computeConfig(e))}return t.prototype.updateEditConfig=function(e){var n=this.computeConfig(e);ut(this,n)},t.prototype.computeConfig=function(e){var n=e.isSilentMode,r=e.textDraggable,i=e.textMode,o=e.textEdit,a=e.adjustEdgeStartAndEnd,s={};if(n===!1&&ut(s,this.stagedConfig),n===!0&&n!==this.isSilentMode){var l=gi(S3,su);this.stagedConfig=gi(this,su),ut(s,l)}Hi(o)||ut(s,{nodeTextEdit:o,edgeTextEdit:o}),Hi(r)||ut(s,{nodeTextDraggable:r,edgeTextDraggable:r}),i&&ut(s,{nodeTextMode:i,edgeTextMode:i}),Zs(a)&&ut(s,{adjustEdgeStart:a,adjustEdgeEnd:a});var u=gi(e,su);return ut(s,u)},t.prototype.updateTextMode=function(e){this.textMode=e,this.edgeTextMode=e,this.nodeTextMode=e},t.prototype.getConfig=function(){return gi(this,su)},ht([X],t.prototype,"isSilentMode",void 0),ht([X],t.prototype,"stopZoomGraph",void 0),ht([X],t.prototype,"stopMoveGraph",void 0),ht([X],t.prototype,"stopScrollGraph",void 0),ht([X],t.prototype,"snapGrid",void 0),ht([X],t.prototype,"textMode",void 0),ht([X],t.prototype,"textEdit",void 0),ht([X],t.prototype,"textDraggable",void 0),ht([X],t.prototype,"nodeTextEdit",void 0),ht([X],t.prototype,"nodeTextDraggable",void 0),ht([X],t.prototype,"nodeTextMultiple",void 0),ht([X],t.prototype,"nodeTextVertical",void 0),ht([X],t.prototype,"nodeTextMode",void 0),ht([X],t.prototype,"edgeTextMode",void 0),ht([X],t.prototype,"edgeTextEdit",void 0),ht([X],t.prototype,"edgeTextDraggable",void 0),ht([X],t.prototype,"edgeTextMultiple",void 0),ht([X],t.prototype,"edgeTextVertical",void 0),ht([X],t.prototype,"hideAnchors",void 0),ht([X],t.prototype,"allowRotate",void 0),ht([X],t.prototype,"allowResize",void 0),ht([X],t.prototype,"hoverOutline",void 0),ht([X],t.prototype,"nodeSelectedOutline",void 0),ht([X],t.prototype,"adjustNodePosition",void 0),ht([X],t.prototype,"autoExpand",void 0),ht([X],t.prototype,"adjustEdge",void 0),ht([X],t.prototype,"adjustEdgeMiddle",void 0),ht([X],t.prototype,"adjustEdgeStartAndEnd",void 0),ht([X],t.prototype,"adjustEdgeStart",void 0),ht([X],t.prototype,"adjustEdgeEnd",void 0),ht([X],t.prototype,"edgeSelectedOutline",void 0),ht([U],t.prototype,"updateEditConfig",null),ht([U],t.prototype,"updateTextMode",null),t}(),A3="*",O3=function(){function t(){this._events={}}return t.prototype.on=function(e,n,r){var i=this;e==null||e.split(",").forEach(function(o){o=o.trim(),i._events[o]||(i._events[o]=[]),i._events[o].push({callback:n,once:!!r})})},t.prototype.once=function(e,n){var r=this;e==null||e.split(",").forEach(function(i){i=i.trim(),r.on(i,n,!0)})},t.prototype.emit=function(e,n){var r=this;e==null||e.split(",").forEach(function(i){var o=r._events[i]||[],a=r._events[A3]||[],s=function(l){for(var u=l.length,c=0;c<u;c++)if(l[c]){var d=l[c],f=d.callback,h=d.once;h&&(l.splice(c,1),l.length===0&&delete r._events[i],u--,c--),f.apply(r,[n])}};s(o),s(a)})},t.prototype.off=function(e,n){var r=this;e||(this._events={}),e.split(",").forEach(function(i){if(!n)delete r._events[i];else{for(var o=r._events[i]||[],a=o.length,s=0;s<a;s++)o[s].callback===n&&(o.splice(s,1),a--,s--);o.length===0&&delete r._events[i]}})},t.prototype.getEvents=function(){return this._events},t.prototype.destroy=function(){this._events={}},t}(),T3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pf=function(){return Pf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Pf.apply(this,arguments)},N3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},M3=function(t){T3(e,t);function e(n){var r=t.call(this)||this;r.stepScrollX=0,r.stepScrollY=0,r.onDragging=function(s){var l=s.deltaX,u=s.deltaY;r.setState({isDragging:!0});var c=r.props.graphModel,d=c.transformModel,f=c.editConfigModel;f.stopMoveGraph!==!0&&d.translate(l,u)},r.onDragEnd=function(){r.setState({isDragging:!1})},r.zoomHandler=function(s){var l=r.props,u=l.graphModel,c=u.editConfigModel,d=u.transformModel,f=u.gridSize,h=l.graphModel,v=s.deltaX,g=s.deltaY,m=c.stopScrollGraph,y=c.stopZoomGraph;if(!m&&!s.ctrlKey&&!s.metaKey){if(s.preventDefault(),r.stepScrollX+=v,r.stepScrollY+=g,Math.abs(r.stepScrollX)>=f){var x=r.stepScrollX%f,E=r.stepScrollX-x;d.translate(-E*d.SCALE_X,0),r.stepScrollX=x}if(Math.abs(r.stepScrollY)>=f){var b=r.stepScrollY%f,T=r.stepScrollY-b;d.translate(0,-T*d.SCALE_Y),r.stepScrollY=b}return}if(!y){s.preventDefault();var A=h.getPointByClient({x:s.clientX,y:s.clientY}),S=A.canvasOverlayPosition,M=S.x,C=S.y;d.zoom(s.deltaY<0,[M,C])}},r.clickHandler=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){var u=r.props.graphModel,c=u.selectElements;c.size>0&&u.clearSelectElements(),u.eventCenter.emit(be.BLANK_CLICK,{e:s})}},r.handleContextMenu=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){s.preventDefault();var u=r.props.graphModel,c=u.getPointByClient({x:s.clientX,y:s.clientY});u.eventCenter.emit(be.BLANK_CONTEXTMENU,{e:s,position:c})}},r.mouseDownHandler=function(s){var l=r.props.graphModel,u=l.eventCenter,c=l.editConfigModel,d=l.transformModel.SCALE_X,f=l.gridSize,h=c.adjustEdge,v=c.adjustNodePosition,g=c.stopMoveGraph,m=s.target,y=!h&&!v;(m.getAttribute("name")==="canvas-overlay"||y)&&(g!==!0?(r.stepDrag.setStep(f*d),r.stepDrag.handleMouseDown(s)):u.emit(be.BLANK_MOUSEDOWN,{e:s}),r.clickHandler(s))};var i=n.graphModel,o=i.gridSize,a=i.eventCenter;return r.stepDrag=new tr({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:o,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),r.state={isDragging:!1},r}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,r=n.getTransformStyle().transform,i=this.props,o=i.children,a=i.dnd,s=this.state.isDragging;return V("svg",Pf({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:s?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},a.eventMap(),{children:V("g",{transform:r,children:o})}))},e=N3([vn],e),e}(Qe),_b=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ts=function(){return ts=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ts.apply(this,arguments)},D3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},P3=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},bb=function(t){_b(e,t);function e(){var n=t.call(this)||this;return n.onDragging=function(r){var i=r.event,o=n.props,a=o.graphModel,s=o.bezierModel,l=o.type,u=a.getPointByClient({x:i.clientX,y:i.clientY}).canvasOverlayPosition,c=u.x,d=u.y;s.updateAdjustAnchor({x:c,y:d},l),a.eventCenter.emit(be.EDGE_ADJUST,{data:s.getData()})},n.onDragEnd=function(){var r=n.props.bezierModel;r.isDragging=!1},n.dragHandler=new tr({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.render=function(){var n=this,r=this.props.position,i=r.x,o=r.y,a=this.props.bezierModel,s=a.getEdgeStyle().adjustAnchor;return V(zo,ts({className:"lf-bezier-adjust-anchor",x:i,y:o},s,{onMouseDown:function(l){n.dragHandler.handleMouseDown(l)}}))},e}(Qe),R3=function(t){_b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBezierAdjust=function(n,r){var i=n.path,o=n.id,a=cf(i),s=P3(a,4),l=s[0],u=s[1],c=s[2],d=s[3],f=n.getEdgeStyle().adjustLine,h=[];return h.push(V(Ho,ts({x1:l.x,y1:l.y,x2:u.x,y2:u.y},f))),h.push(V(bb,{position:u,bezierModel:n,graphModel:r,type:"sNext"},"".concat(o,"_ePre"))),h.push(V(Ho,ts({x1:d.x,y1:d.y,x2:c.x,y2:c.y},f))),h.push(V(bb,{position:c,bezierModel:n,graphModel:r,type:"ePre"},"".concat(o,"_sNext"))),h},e.prototype.selectedBezierEdge=function(){for(var n=this.props.graphModel,r=n.edges,i=[],o=0;o<r.length;o++){var a=r[o];a.isSelected&&a.modelType===Ye.BEZIER_EDGE&&a.draggable&&i.push(this.getBezierAdjust(a,n))}return i},e.prototype.render=function(){return V("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},e=D3([vn],e),e}(Qe),L3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),I3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},k3=function(t){L3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.background;return V("div",{className:"lf-background",children:V("div",{style:Rt(n)?n:{},className:"lf-background-area"})})},e=I3([vn],e),e}(Qe),B3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),j3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Vo=function(t){B3(e,t);function e(n){var r=t.call(this,n)||this;return r.id=Si(),r.gridOptions=r.props.graphModel.grid,r}return e.prototype.renderDot=function(){var n=this.gridOptions,r=n.config,i=n.size,o=i===void 0?1:i,a=n.visible,s=r??{},l=s.color,u=s.thickness,c=u===void 0?2:u,d=Math.min(Math.max(2,c),o/4),f=a?1:0;return V("g",{fill:l,opacity:f,children:[V("circle",{cx:0,cy:0,r:d/2}),V("circle",{cx:0,cy:o,r:d/2}),V("circle",{cx:o,cy:0,r:d/2}),V("circle",{cx:o,cy:o,r:d/2})]})},e.prototype.renderMesh=function(){var n=this.gridOptions,r=n.config,i=n.size,o=i===void 0?1:i,a=n.visible,s=r??{},l=s.color,u=s.thickness,c=u===void 0?1:u,d=Math.min(Math.max(1,c),o/2),f="M 0 0 H ".concat(o," V ").concat(o," H 0 Z"),h=a?1:0;return V("path",{d:f,stroke:l,strokeWidth:d/2,opacity:h,fill:"transparent"})},e.prototype.render=function(){var n=this.props.graphModel,r=n.transformModel,i=n.grid;this.gridOptions=i;var o=this.gridOptions,a=o.type,s=o.size,l=s===void 0?1:s,u=r.SCALE_X,c=r.SKEW_Y,d=r.SKEW_X,f=r.SCALE_Y,h=r.TRANSLATE_X,v=r.TRANSLATE_Y,g=[u,c,d,f,h,v].join(","),m="matrix(".concat(g,")");return V("div",{className:"lf-grid",children:V("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[V("defs",{children:V("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:m,x:"0",y:"0",width:l,height:l,children:[a==="dot"&&this.renderDot(),a==="mesh"&&this.renderMesh()]})}),V("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=j3([vn],e),e}(Qe);(function(t){t.defaultProps={size:LB,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};function e(n){var r=Pe(t.defaultProps);return typeof n=="number"?ut(r,{size:n}):typeof n=="boolean"?ut(r,{visible:n}):ut(r,n)}t.getGridOptions=e})(Vo||(Vo={}));var F3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},H3=function(t){F3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,r=n.getTransformStyle().transform,i=this.props.children;return V("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:V("g",{transform:r,children:i})})},e=$3([vn],e),e}(Qe),z3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ai=function(){return Ai=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ai.apply(this,arguments)},W3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},U3=function(t){z3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getNodesOutline=function(){var n=this.props.graphModel,r=n.nodes,i=n.editConfigModel,o=i.hoverOutline,a=i.nodeSelectedOutline,s=[];return r.forEach(function(l){if(l.isHovered||l.isSelected){var u=l.isHovered,c=l.isSelected,d=l.x,f=l.y,h=l.width,v=l.height;if(a&&c||o&&u){var g=l.getOutlineStyle()||{},m={};if(Object.keys(g).forEach(function(x){x!=="hover"&&(m[x]=g[x])}),u){var y=g.hover;m=Ai(Ai({},m),y)}s.push(V(rr,Ai({transform:l.transform,className:"lf-outline-node",x:d,y:f,width:h+10,height:v+10},m)))}}}),s},e.prototype.getEdgeOutline=function(){for(var n=this.props.graphModel,r=n.edges,i=n.editConfigModel,o=i.edgeSelectedOutline,a=i.hoverOutline,s=[],l=0;l<r.length;l++){var u=r[l];(o&&u.isSelected||a&&u.isHovered)&&(u.modelType===Ye.LINE_EDGE?s.push(this.getLineOutline(u)):u.modelType===Ye.POLYLINE_EDGE?s.push(this.getPolylineOutline(u)):u.modelType===Ye.BEZIER_EDGE&&s.push(this.getBezierOutline(u)))}return s},e.prototype.getLineOutline=function(n){var r=n.startPoint,i=n.endPoint,o=(r.x+i.x)/2,a=(r.y+i.y)/2,s=Math.abs(r.x-i.x)+10,l=Math.abs(r.y-i.y)+10,u=n.getOutlineStyle();return V(rr,Ai({className:"lf-outline-edge",x:o,y:a,width:s,height:l},u))},e.prototype.getPolylineOutline=function(n){var r=n.points,i=Ki(r),o=La(i,8),a=o.x,s=o.y,l=o.width,u=o.height,c=n.getOutlineStyle();return V(rr,Ai({className:"lf-outline",x:a,y:s,width:l,height:u},c))},e.prototype.getBezierOutline=function(n){var r=n.path,i=cf(r),o=La(i,8),a=o.x,s=o.y,l=o.width,u=o.height,c=n.getOutlineStyle();return V(rr,Ai({className:"lf-outline",x:a,y:s,width:l,height:u},c))},e.prototype.render=function(){return V("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=W3([vn],e),e}(Qe),V3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Oi=function(){return Oi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Oi.apply(this,arguments)},X3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},G3=function(t){V3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.snaplineModel,r=n??{},i=r.position,o=r.isShowHorizontal,a=r.isShowVertical,s=n==null?void 0:n.getStyle(),l=i??{},u=l.x,c=u===void 0?0:u,d=l.y,f=d===void 0?0:d,h=Oi(Oi({x1:-1e5,y1:f,x2:1e5,y2:f},s),{stroke:o?s==null?void 0:s.stroke:"none"}),v=Oi(Oi({x1:c,y1:-1e5,x2:c,y2:1e5},s),{stroke:a?s==null?void 0:s.stroke:"none"});return V("g",{className:"lf-snapline",children:[V(Ho,Oi({},h)),V(Ho,Oi({},v))]})},e=X3([vn],e),e}(Qe),Y3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},q3=function(t){Y3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var n=this.props,r=n.tool,i=n.graphModel,o=i.textEditElement,a=r.getTools(),s=a.map(function(l){return Te(l,{textEditElement:o,graphModel:i,lf:r.instance})});return r.components=s,s},e.prototype.triggerToolRender=function(){var n=this.props,r=n.tool,i=n.graphModel,o=document.querySelector("#ToolOverlay_".concat(i.flowId)),a=r.getInstance();a.components.forEach(function(s){return s(a,o)}),a.components=[]},e.prototype.render=function(){var n=this.props.graphModel;return V("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(n.flowId),children:this.getTools()})},e=K3([vn],e),e}(Qe),wr=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Xo=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Z3={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},J3=function(){function t(e,n){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=e;var r=n.stopMoveGraph,i=r===void 0?!1:r;this.updateTranslateLimits(i)}return t.prototype.setZoomMiniSize=function(e){this.MINI_SCALE_SIZE=e},t.prototype.setZoomMaxSize=function(e){this.MAX_SCALE_SIZE=e},t.prototype.HtmlPointToCanvasPoint=function(e){var n=Xo(e,2),r=n[0],i=n[1];return[(r-this.TRANSLATE_X)/this.SCALE_X,(i-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(e){var n=Xo(e,2),r=n[0],i=n[1];return[r*this.SCALE_X+this.TRANSLATE_X,i*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(e,n,r){var i=Xo(e,2),o=i[0],a=i[1];return[o+n/this.SCALE_X,a+r/this.SCALE_Y]},t.prototype.fixDeltaXY=function(e,n){return[e/this.SCALE_X,n/this.SCALE_Y]},t.prototype.getTransformStyle=function(){var e=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(e,")")}},t.prototype.zoom=function(e,n){e===void 0&&(e=!1);var r=this.SCALE_X,i=this.SCALE_Y;return typeof e=="number"?(r=e,i=e):e?(r+=this.ZOOM_SIZE,i+=this.ZOOM_SIZE):(r-=this.ZOOM_SIZE,i-=this.ZOOM_SIZE),r<this.MINI_SCALE_SIZE||r>this.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(n&&(this.TRANSLATE_X-=(r-this.SCALE_X)*n[0],this.TRANSLATE_Y-=(i-this.SCALE_Y)*n[1]),this.SCALE_X=r,this.SCALE_Y=i,this.emitGraphTransform("zoom"),"".concat(this.SCALE_X*100,"%"))},t.prototype.emitGraphTransform=function(e){this.eventCenter.emit(be.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.prototype.translate=function(e,n){this.TRANSLATE_X+e<=this.translateLimitMaxX&&this.TRANSLATE_X+e>=this.translateLimitMinX&&(this.TRANSLATE_X+=e),this.TRANSLATE_Y+n<=this.translateLimitMaxY&&this.TRANSLATE_Y+n>=this.translateLimitMinY&&(this.TRANSLATE_Y+=n),this.emitGraphTransform("translate")},t.prototype.focusOn=function(e,n,r,i){var o=Xo(this.CanvasPointToHtmlPoint([e,n]),2),a=o[0],s=o[1],l=Xo([r/2-a,i/2-s],2),u=l[0],c=l[1];this.TRANSLATE_X+=u,this.TRANSLATE_Y+=c,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(e){var n;n=Xo(Array.isArray(e)&&e.length===4?e:Z3[e.toString()],4),this.translateLimitMinX=n[0],this.translateLimitMinY=n[1],this.translateLimitMaxX=n[2],this.translateLimitMaxY=n[3]},wr([X],t.prototype,"SCALE_X",void 0),wr([X],t.prototype,"SKEW_Y",void 0),wr([X],t.prototype,"SKEW_X",void 0),wr([X],t.prototype,"SCALE_Y",void 0),wr([X],t.prototype,"TRANSLATE_X",void 0),wr([X],t.prototype,"TRANSLATE_Y",void 0),wr([X],t.prototype,"ZOOM_SIZE",void 0),wr([U],t.prototype,"zoom",null),wr([U],t.prototype,"resetZoom",null),wr([U],t.prototype,"translate",null),wr([U],t.prototype,"focusOn",null),t}(),Q3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rf=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},e4=function(t){Q3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.parentTransform=r.parentTransform,i}return e.prototype.setParentTransform=function(n){this.parentTransform=n},e.prototype.getCumulativeScale=function(){var n=this.SCALE_X,r=this.SCALE_Y;if(this.parentTransform)if(this.parentTransform instanceof e){var i=this.parentTransform.getCumulativeScale();n*=i.scaleX,r*=i.scaleY}else n*=this.parentTransform.SCALE_X,r*=this.parentTransform.SCALE_Y;return{scaleX:n,scaleY:r}},e.prototype.getCumulativeTranslate=function(){var n=this.TRANSLATE_X,r=this.TRANSLATE_Y;if(this.parentTransform&&this.parentTransform instanceof e){var i=this.parentTransform.getCumulativeScale(),o=i.scaleX,a=i.scaleY;n=o*n,r=a*r}return{translateX:n,translateY:r}},e.prototype.HtmlPointToCanvasPoint=function(n){var r=Rf(n,2),i=r[0],o=r[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,u=this.getCumulativeTranslate(),c=u.translateX,d=u.translateY;return[(i-c)/s,(o-d)/l]},e.prototype.CanvasPointToHtmlPoint=function(n){var r=Rf(n,2),i=r[0],o=r[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,u=this.getCumulativeTranslate(),c=u.translateX,d=u.translateY;return[i*s+c,o*l+d]},e.prototype.moveCanvasPointByHtml=function(n,r,i){var o=Rf(n,2),a=o[0],s=o[1],l=this.getCumulativeScale(),u=l.scaleX,c=l.scaleY;return[a+r/u,s+i/c]},e.prototype.fixDeltaXY=function(n,r){var i=this.getCumulativeScale(),o=i.scaleX,a=i.scaleY;return[n/o,r/a]},e}(J3),ln=function(){return ln=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ln.apply(this,arguments)},_e=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},t4=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zt=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},zn=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},n4=function(){function t(e){var n=this,r,i;this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodeResizeRules=[],this.nodes=[],this.edges=[],this.overlapMode=Xt.DEFAULT,this.gridSize=1,this.partial=!1,this.waitCleanEffects=[];var o=e.container,a=e.partial,s=e.background,l=s===void 0?{}:s,u=e.grid,c=e.idGenerator,d=e.edgeGenerator,f=e.animation,h=e.customTrajectory;this.rootEl=o,this.partial=!!a,this.background=l,typeof u=="object"&&e.snapGrid&&(this.gridSize=u.size||1),this.customStyles=e.style||{},this.grid=Vo.getGridOptions(u??!1),this.theme=db(e.style,e.themeMode),this.theme.grid=Pe(this.grid),this.theme.background=Pe(this.background),this.edgeType=e.edgeType||"polyline",this.animation=DB(f),this.overlapMode=e.overlapMode||Xt.DEFAULT,this.isMiniMap=e.isMiniMap||!1,this.width=(r=e.width)!==null&&r!==void 0?r:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=pn(e.width),this.height=(i=e.height)!==null&&i!==void 0?i:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=pn(e.height);var v=new ResizeObserver(Us(function(g){var m,y;try{for(var x=t4(g),E=x.next();!E.done;E=x.next()){var b=E.value;if(b.target===n.rootEl){var T=document.body.contains(n.rootEl);if(!T)return;n.resize(),n.eventCenter.emit("graph:resize",{target:n.rootEl,contentRect:b.contentRect})}}}catch(A){m={error:A}}finally{try{E&&!E.done&&(y=x.return)&&y.call(x)}finally{if(m)throw m.error}}},16));v.observe(this.rootEl),this.waitCleanEffects.push(function(){v.disconnect()}),this.eventCenter=new O3,this.editConfigModel=new C3(e),this.transformModel=new e4(this.eventCenter,e),this.flowId=Si(),this.idGenerator=c,this.edgeGenerator=tj(this,d),this.customTrajectory=h}return Object.defineProperty(t.prototype,"nodesMap",{get:function(){return this.nodes.reduce(function(e,n,r){return e[n.id]={index:r,model:n},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgesMap",{get:function(){return this.edges.reduce(function(e,n,r){return e[n.id]={index:r,model:n},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"modelsMap",{get:function(){return zn(zn([],zt(this.nodes),!1),zt(this.edges),!1).reduce(function(e,n){return e[n.id]=n,e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sortElements",{get:function(){for(var e=function(l){return zn([],zt(l),!1).sort(function(u,c){return u.zIndex-c.zIndex})},n=e(zn(zn([],zt(this.nodes),!1),zt(this.edges),!1)),r=[],i=[-200,-200],o=[this.width+P_,this.height+P_],a=0;a<n.length;a++){var s=n[a];s.visible&&(!this.partial||s.isSelected||this.isElementInArea(s,i,o,!1,!1))&&r.push(s)}return r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textEditElement",{get:function(){var e=this.nodes.find(function(r){return r.state===lt.TEXT_EDIT}),n=this.edges.find(function(r){return r.state===lt.TEXT_EDIT});return e||n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectElements",{get:function(){var e=new Map;return this.nodes.forEach(function(n){n.isSelected&&e.set(n.id,n)}),this.edges.forEach(function(n){n.isSelected&&e.set(n.id,n)}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectNodes",{get:function(){var e=[];return this.nodes.forEach(function(n){n.isSelected&&e.push(n)}),e},enumerable:!1,configurable:!0}),t.prototype.getAreaElement=function(e,n,r,i,o){var a=this;r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=!1);var s=[];return gt(zn(zn([],zt(this.nodes),!1),zt(this.edges),!1),function(l){var u=a.isElementInArea(l,e,n,r,i);(!o||l.visible)&&u&&s.push(l)}),s},t.prototype.getModel=function(e){return this.modelMap.get(e)},t.prototype.getNodeModelById=function(e){var n;return this.fakeNode&&e===this.fakeNode.id?this.fakeNode:(n=this.nodesMap[e])===null||n===void 0?void 0:n.model},t.prototype.getPointByClient=function(e){var n=e.x,r=e.y,i=this.rootEl.getBoundingClientRect(),o={x:n-i.left,y:r-i.top},a=zt(this.transformModel.HtmlPointToCanvasPoint([o.x,o.y]),2),s=a[0],l=a[1],u={x:s,y:l};return{domOverlayPosition:o,canvasOverlayPosition:u}},t.prototype.isElementInArea=function(e,n,r,i,o){var a;if(i===void 0&&(i=!0),o===void 0&&(o=!0),e.BaseType===Lt.NODE){e=e;for(var s=Hn(e),l=s.minX,u=s.minY,c=s.maxX,d=s.maxY,f=[{x:l,y:u},{x:c,y:u},{x:c,y:d},{x:l,y:d}],h=o,v=0;v<f.length;v++){var g=f[v],m=g.x,y=g.y;if(a=zt(this.transformModel.CanvasPointToHtmlPoint([m,y]),2),m=a[0],y=a[1],ff([m,y],n,r)!==o){h=!o;break}}return h}if(e.BaseType===Lt.EDGE){e=e;var x=e.startPoint,E=e.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([x.x,x.y]),T=this.transformModel.CanvasPointToHtmlPoint([E.x,E.y]),A=ff(b,n,r),S=ff(T,n,r);return i?A&&S:A||S}return!1},t.prototype.graphDataToModel=function(e){var n=this;if(!e){this.clearData();return}if(this.elementsModelMap.clear(),this.nodeModelMap.clear(),this.edgeModelMap.clear(),e.nodes?this.nodes=Bn(e.nodes,function(i){var o=n.getModelAfterSnapToGrid(i);return n.elementsModelMap.set(o.id,o),n.nodeModelMap.set(o.id,o),o}):this.nodes=[],e.edges){var r=this.edgeType;this.edges=Bn(e.edges,function(i){var o,a=n.getModel((o=i.type)!==null&&o!==void 0?o:r);if(!a)throw new Error("找不到".concat(i.type,"对应的边。"));var s=new a(i,n);return n.edgeModelMap.set(s.id,s),n.elementsModelMap.set(s.id,s),s})}else this.edges=[]},t.prototype.modelToGraphData=function(){var e=[];this.edges.forEach(function(r){var i=r.getData();i&&!r.virtual&&e.push(i)});var n=[];return this.nodes.forEach(function(r){var i=r.getData();i&&!r.virtual&&n.push(i)}),{nodes:n,edges:e}},t.prototype.modelToHistoryData=function(){for(var e=!1,n=[],r=0;r<this.nodes.length;r++){var i=this.nodes[r];if(i.isDragging){e=!0;break}else n.push(i.getHistoryData())}if(e)return!1;for(var o=!1,a=[],s=0;s<this.edges.length;s++){var l=this.edges[s];if(l.isDragging){o=!0;break}l.virtual||a.push(l.getHistoryData())}return o?!1:{nodes:n,edges:a}},t.prototype.getEdgeModelById=function(e){var n;return(n=this.edgesMap[e])===null||n===void 0?void 0:n.model},t.prototype.getElement=function(e){return this.modelsMap[e]},t.prototype.getNodeEdges=function(e){for(var n=[],r=0;r<this.edges.length;r++){var i=this.edges[r],o=i.sourceNodeId===e,a=i.targetNodeId===e;(o||a)&&n.push(i)}return n},t.prototype.getSelectElements=function(e){e===void 0&&(e=!0);var n=this.selectElements,r={nodes:[],edges:[]};return n.forEach(function(i){if(i.BaseType===Lt.NODE&&r.nodes.push(i.getData()),i.BaseType===Lt.EDGE){var o=i.getData(),a=n.get(o.sourceNodeId)&&n.get(o.targetNodeId);(e||a)&&r.edges.push(o)}}),r},t.prototype.updateAttributes=function(e,n){var r=this.getElement(e);r==null||r.updateAttributes(n)},t.prototype.changeNodeId=function(e,n){return n||(n=Si()),this.nodesMap[n]?(console.warn("当前流程图已存在节点".concat(n,", 修改失败")),""):this.nodesMap[e]?(this.edges.forEach(function(r){r.sourceNodeId===e&&(r.sourceNodeId=n),r.targetNodeId===e&&(r.targetNodeId=n)}),this.nodesMap[e].model.id=n,this.nodesMap[n]=this.nodesMap[e],n):(console.warn("当前流程图找不到节点".concat(e,", 修改失败")),"")},t.prototype.changeEdgeId=function(e,n){return n||(n=Si()),this.edgesMap[n]?(console.warn("当前流程图已存在边: ".concat(n,", 修改失败")),""):this.edgesMap[e]?(this.edges.forEach(function(r){r.id===e&&r.changeEdgeId(n)}),n):(console.warn("当前流程图找不到边: ".concat(n,", 修改失败")),"")},t.prototype.getTextModel=function(e){var n=this.editConfigModel,r=n.textMode,i=n.nodeTextMode,o=n.edgeTextMode;if(e.BaseType===Lt.NODE)return e.textMode||i||r||er.TEXT;if(e.BaseType===Lt.EDGE)return e.textMode||o||r||er.TEXT},t.prototype.setOverlapMode=function(e){this.overlapMode=e,this.eventCenter.emit("overlap:change",{overlapMode:e})},t.prototype.setTextMode=function(e,n){this.editConfigModel.updateEditConfig({textMode:e})},t.prototype.setFakeNode=function(e){this.fakeNode=e},t.prototype.removeFakeNode=function(){this.fakeNode=null},t.prototype.setModel=function(e,n){return this.modelMap.set(e,n)},t.prototype.toFront=function(e){var n,r,i,o=((n=this.nodesMap[e])===null||n===void 0?void 0:n.model)||((r=this.edgesMap[e])===null||r===void 0?void 0:r.model);if(o){if(this.overlapMode===Xt.STATIC)return;if(this.overlapMode===Xt.INCREASE){this.setElementZIndex(e,"top");return}(i=this.topElement)===null||i===void 0||i.setZIndex(),o.setZIndex(RB),this.topElement=o}},t.prototype.setElementZIndex=function(e,n){var r,i,o=((r=this.nodesMap[e])===null||r===void 0?void 0:r.model)||((i=this.edgesMap[e])===null||i===void 0?void 0:i.model);if(o){var a=void 0;typeof n=="number"?a=n:(n==="top"&&(a=Va()),n==="bottom"&&(a=s3())),o.setZIndex(a)}},t.prototype.deleteNode=function(e){var n=this.nodesMap[e].model,r=n.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(be.NODE_DELETE,{data:r,model:n})},t.prototype.addNode=function(e,n,r){n===void 0&&(n=be.NODE_ADD);var i=sn(e),o=i.id;o&&this.nodesMap[o]&&delete i.id;var a=this.getModelAfterSnapToGrid(i);this.nodes.push(a);var s=a.getData(),l={data:s};return r&&(l.e=r),this.eventCenter.emit(n,l),a},t.prototype.getModelAfterSnapToGrid=function(e){var n=this.getModel(e.type),r=this.editConfigModel.snapGrid;if(!n)throw new Error("找不到".concat(e.type,"对应的节点,请确认是否已注册此类型节点。"));var i=e.x,o=e.y;i&&o&&(e.x=Fo(i,this.gridSize,r),e.y=Fo(o,this.gridSize,r),typeof e.text=="object"&&e.text!==null&&(e.text.x+=e.x-i,e.text.y+=e.y-o));var a=new n(e,this);return this.nodeModelMap.set(a.id,a),this.elementsModelMap.set(a.id,a),a},t.prototype.cloneNode=function(e){var n=this.getNodeModelById(e),r=n==null?void 0:n.getData();if(r){r.x+=30,r.y+=30,r.id="",typeof r.text=="object"&&r.text!==null&&(r.text.x+=30,r.text.y+=30);var i=this.addNode(r);return i.setSelected(!0),n==null||n.setSelected(!1),i.getData()}},t.prototype.moveNode=function(e,n,r,i){var o;i===void 0&&(i=!1);var a=this.nodesMap[e];if(!a){console.warn("不存在id为".concat(e,"的节点"));return}var s=a.model;o=zt(s.getMoveDistance(n,r,i),2),n=o[0],r=o[1],this.moveEdge(e,n,r)},t.prototype.moveNode2Coordinate=function(e,n,r,i){i===void 0&&(i=!1);var o=this.nodesMap[e];if(!o){console.warn("不存在id为".concat(e,"的节点"));return}var a=o.model,s=a.x,l=a.y,u=n-s,c=r-l;this.moveNode(e,u,c,i)},t.prototype.editText=function(e){this.setElementStateById(e,lt.TEXT_EDIT)},t.prototype.addEdge=function(e){var n=sn(e),r=n.type;r||(r=this.edgeType),n.id&&this.edgesMap[n.id]&&(delete n.id,delete n.sourceAnchorId,delete n.targetAnchorId);var i=this.getModel(r);if(!i)throw new Error("找不到".concat(r,"对应的边,请确认是否已注册此类型边。"));var o=new i(ln(ln({},n),{type:r}),this);this.edgeModelMap.set(o.id,o),this.elementsModelMap.set(o.id,o);var a=o.getData();return this.edges.push(o),this.eventCenter.emit(be.EDGE_ADD,{data:a}),o},t.prototype.moveEdge=function(e,n,r){for(var i=0;i<this.edges.length;i++){var o=this.edges[i],a=o.textPosition,s=a.x,l=a.y,u=this.edges[i].sourceNodeId===e,c=this.edges[i].targetNodeId===e;u&&o.moveStartPoint(n,r),c&&o.moveEndPoint(n,r),(u||c)&&this.handleEdgeTextMove(o,s,l)}},t.prototype.handleEdgeTextMove=function(e,n,r){var i;if(e.customTextPosition){e.resetTextPosition();return}if(e.modelType===Ye.POLYLINE_EDGE&&(!((i=e.text)===null||i===void 0)&&i.value)){var o=e.text,a=G_(o,e.points);e.moveText(a.x-o.x,a.y-o.y)}var s=e.textPosition,l=s.x,u=s.y;e.moveText(l-n,u-r)},t.prototype.deleteEdgeBySourceAndTarget=function(e,n){for(var r=0;r<this.edges.length;r++)if(this.edges[r].sourceNodeId===e&&this.edges[r].targetNodeId===n){var i=this.edges[r].getData();this.edges.splice(r,1),r--,this.eventCenter.emit(be.EDGE_DELETE,{data:i})}},t.prototype.deleteEdgeById=function(e){var n=this.edgesMap[e];if(n){var r=this.edgesMap[e].index,i=this.edgesMap[e].model.getData();this.edges.splice(r,1),this.eventCenter.emit(be.EDGE_DELETE,{data:i})}},t.prototype.deleteEdgeBySource=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(be.EDGE_DELETE,{data:r})}},t.prototype.deleteEdgeByTarget=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].targetNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(be.EDGE_DELETE,{data:r})}},t.prototype.setElementStateById=function(e,n,r){this.nodes.forEach(function(i){i.id===e?i.setElementState(n,r):i.setElementState(lt.DEFAULT)}),this.edges.forEach(function(i){i.id===e?i.setElementState(n,r):i.setElementState(lt.DEFAULT)})},t.prototype.updateText=function(e,n){var r=hi(zn(zn([],zt(this.nodes),!1),zt(this.edges),!1),function(i){return i.id===e});r==null||r.updateText(n)},t.prototype.selectNodeById=function(e,n){var r;n===void 0&&(n=!1),n||this.clearSelectElements();var i=(r=this.nodesMap[e])===null||r===void 0?void 0:r.model;i==null||i.setSelected(!0)},t.prototype.selectEdgeById=function(e,n){var r;n===void 0&&(n=!1),n||this.clearSelectElements();var i=(r=this.edgesMap[e])===null||r===void 0?void 0:r.model;i==null||i.setSelected(!0)},t.prototype.selectElementById=function(e,n){n===void 0&&(n=!1),n||this.clearSelectElements();var r=this.getElement(e);r==null||r.setSelected(!0)},t.prototype.deselectElementById=function(e){var n=this.getElement(e);n&&n.setSelected(!1)},t.prototype.clearSelectElements=function(){var e;this.selectElements.forEach(function(n){n==null||n.setSelected(!1)}),this.selectElements.clear(),[Xt.DEFAULT,Xt.EDGE_TOP].includes(this.overlapMode)&&((e=this.topElement)===null||e===void 0||e.setZIndex())},t.prototype.moveNodes=function(e,n,r,i){var o,a,s,l=this;i===void 0&&(i=!1);for(var u=e.reduce(function(E,b){var T,A=(T=l.nodesMap[b])===null||T===void 0?void 0:T.model;return A&&(E[b]=A.getMoveDistance(n,r,i)),E},{}),c=0;c<this.edges.length;c++){var d=this.edges[c],f=d.textPosition,h=f.x,v=f.y,g=u[d.sourceNodeId],m=u[d.targetNodeId],y=void 0,x=void 0;g&&m&&d.modelType===Ye.POLYLINE_EDGE?(o=zt(g,2),y=o[0],x=o[1],d.updatePointsList(y,x)):(g&&(a=zt(g,2),y=a[0],x=a[1],d.moveStartPoint(y,x)),m&&(s=zt(m,2),y=s[0],x=s[1],d.moveEndPoint(y,x))),(g||m)&&this.handleEdgeTextMove(d,h,v)}},t.prototype.addNodeMoveRules=function(e){this.nodeMoveRules.includes(e)||this.nodeMoveRules.push(e)},t.prototype.addNodeResizeRules=function(e){this.nodeResizeRules.includes(e)||this.nodeResizeRules.push(e)},t.prototype.setDefaultEdgeType=function(e){this.edgeType=e},t.prototype.changeNodeType=function(e,n){var r=this.getNodeModelById(e);if(!r){console.warn("找不到id为".concat(e,"的节点"));return}var i=r.getData();i.type=n;var o=this.getModel(n);if(!o)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));var a=new o(i,this);this.nodes.splice(this.nodesMap[e].index,1,a);var s=this.getNodeEdges(e);s.forEach(function(l){if(l.sourceNodeId===e){var u=tb(a,l.startPoint,a.width,a.height);l.updateStartPoint(u)}if(l.targetNodeId===e){var u=tb(a,l.endPoint,a.width,a.height);l.updateEndPoint(u)}})},t.prototype.changeEdgeType=function(e,n){var r=this.getEdgeModelById(e);if(!r){console.warn("找不到id为".concat(e,"的边"));return}if(r.type!==n){var i=r.getData();i.type=n;var o=this.getModel(n);if(!o)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));delete i.pointsList;var a=new o(i,this);this.edges.splice(this.edgesMap[e].index,1,a)}},t.prototype.getNodeIncomingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.targetNodeId===e&&n.push(r)}),n},t.prototype.getNodeOutgoingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.sourceNodeId===e&&n.push(r)}),n},t.prototype.getAnchorIncomingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.targetAnchorId===e&&n.push(r)}),n},t.prototype.getAnchorOutgoingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.sourceAnchorId===e&&n.push(r)}),n},t.prototype.getNodeIncomingNode=function(e){var n=this,r=[];return this.edges.forEach(function(i){var o;i.targetNodeId===e&&r.push((o=n.nodesMap[i.sourceNodeId])===null||o===void 0?void 0:o.model)}),r},t.prototype.getNodeOutgoingNode=function(e){var n=this,r=[];return this.edges.forEach(function(i){i.sourceNodeId===e&&r.push(n.nodesMap[i.targetNodeId].model)}),r},t.prototype.setTheme=function(e,n){var r;if(n&&(Wa[n]&&this.updateBackgroundOptions(ln(ln({},typeof this.background=="object"?this.background:{}),Wa[n])),Ua[n]&&this.updateGridOptions(Vo.getGridOptions(ln(ln({},this.grid),Ua[n])))),e.background&&this.updateBackgroundOptions(e.background),e.grid){var i=Vo.getGridOptions((r=e.grid)!==null&&r!==void 0?r:!1);this.updateGridOptions(i)}this.theme=i3(ln(ln({},this.customStyles),e),n),this.customStyles=ln(ln({},this.customStyles),e)},t.prototype.getTheme=function(){var e=this,n=e.background,r=e.grid,i=ln(ln({},Pe(this.theme)),{background:n,grid:r});return i},t.prototype.updateGridOptions=function(e){zi(this.grid,e)},t.prototype.updateGridSize=function(e){this.gridSize=e},t.prototype.updateBackgroundOptions=function(e){Zs(e)||Zs(this.background)?this.background=e:this.background=ln(ln({},this.background),e)},t.prototype.resize=function(e,n){if(this.rootEl){var r=document.body.contains(this.rootEl);if(r){var i=this.rootEl.offsetParent!==null;if(i)try{this.width=e??this.rootEl.getBoundingClientRect().width,this.isContainerWidth=pn(e),this.height=n??this.rootEl.getBoundingClientRect().height,this.isContainerHeight=pn(n),i&&(!this.width||!this.height)&&console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")}catch(o){console.warn("获取画布宽高时发生错误:",o)}}}},t.prototype.clearData=function(){this.nodes=[],this.edges=[],this.edgeModelMap.clear(),this.nodeModelMap.clear(),this.elementsModelMap.clear()},t.prototype.getVirtualRectSize=function(){var e=this.nodes,n=[],r=[];e.forEach(function(f){var h=f.x,v=f.y,g=f.width,m=f.height,y=f.getNodeStyle().strokeWidth,x=y===void 0?0:y,E=h+g/2+x,b=h-g/2-x,T=v+m/2+x,A=v-m/2-x;n=n.concat([E,b].filter(function(S){return!Number.isNaN(S)})),r=r.concat([T,A].filter(function(S){return!Number.isNaN(S)}))});var i=Math.min.apply(Math,zn([],zt(n),!1)),o=Math.max.apply(Math,zn([],zt(n),!1)),a=Math.min.apply(Math,zn([],zt(r),!1)),s=Math.max.apply(Math,zn([],zt(r),!1)),l=o-i||0,u=s-a||0,c=i+l/2,d=a+u/2;return{width:l,height:u,x:c,y:d}},t.prototype.translateCenter=function(){var e=this,n=e.nodes,r=e.width,i=e.height,o=e.rootEl,a=e.transformModel;if(n.length){var s=r||o.clientWidth,l=i||o.clientHeight,u=this.getVirtualRectSize(),c=u.x,d=u.y;a.focusOn(c,d,s,l)}},t.prototype.fitView=function(e,n){e===void 0&&(e=20),n===void 0&&(n=20);var r=this,i=r.nodes,o=r.width,a=r.height,s=r.rootEl,l=r.transformModel;if(i.length){var u=o||s.clientWidth,c=a||s.clientHeight,d=this.getVirtualRectSize(),f=d.width,h=d.height,v=d.x,g=d.y,m=(f+n)/u,y=(h+e)/c,x=1/Math.max(m,y),E=[u/2,c/2];l.zoom(x,E),l.focusOn(v,g,u,c)}},t.prototype.openEdgeAnimation=function(e){var n=this.getEdgeModelById(e);n==null||n.openEdgeAnimation()},t.prototype.closeEdgeAnimation=function(e){var n=this.getEdgeModelById(e);n==null||n.closeEdgeAnimation()},t.prototype.getPartial=function(){return this.partial},t.prototype.setPartial=function(e){this.partial=e},t.prototype.destroy=function(){try{this.waitCleanEffects.forEach(function(e){e()})}catch(e){console.warn("error on destroy GraphModel",e)}this.waitCleanEffects.length=0,this.eventCenter.destroy()},_e([X],t.prototype,"width",void 0),_e([X],t.prototype,"height",void 0),_e([X],t.prototype,"theme",void 0),_e([X],t.prototype,"grid",void 0),_e([X],t.prototype,"edgeType",void 0),_e([X],t.prototype,"nodes",void 0),_e([X],t.prototype,"edges",void 0),_e([X],t.prototype,"fakeNode",void 0),_e([X],t.prototype,"overlapMode",void 0),_e([X],t.prototype,"background",void 0),_e([X],t.prototype,"gridSize",void 0),_e([X],t.prototype,"transformModel",void 0),_e([X],t.prototype,"editConfigModel",void 0),_e([X],t.prototype,"partial",void 0),_e([Et],t.prototype,"nodesMap",null),_e([Et],t.prototype,"edgesMap",null),_e([Et],t.prototype,"modelsMap",null),_e([Et],t.prototype,"sortElements",null),_e([Et],t.prototype,"textEditElement",null),_e([Et],t.prototype,"selectElements",null),_e([Et],t.prototype,"selectNodes",null),_e([U],t.prototype,"setOverlapMode",null),_e([U],t.prototype,"setTextMode",null),_e([U],t.prototype,"setFakeNode",null),_e([U],t.prototype,"removeFakeNode",null),_e([U],t.prototype,"setModel",null),_e([U],t.prototype,"toFront",null),_e([U],t.prototype,"setElementZIndex",null),_e([U],t.prototype,"deleteNode",null),_e([U],t.prototype,"addNode",null),_e([U],t.prototype,"cloneNode",null),_e([U],t.prototype,"moveNode",null),_e([U],t.prototype,"moveNode2Coordinate",null),_e([U],t.prototype,"editText",null),_e([U],t.prototype,"addEdge",null),_e([U],t.prototype,"moveEdge",null),_e([U],t.prototype,"deleteEdgeBySourceAndTarget",null),_e([U],t.prototype,"deleteEdgeById",null),_e([U],t.prototype,"deleteEdgeBySource",null),_e([U],t.prototype,"deleteEdgeByTarget",null),_e([U],t.prototype,"setElementStateById",null),_e([U],t.prototype,"updateText",null),_e([U],t.prototype,"selectNodeById",null),_e([U],t.prototype,"selectEdgeById",null),_e([U],t.prototype,"selectElementById",null),_e([U],t.prototype,"deselectElementById",null),_e([U],t.prototype,"clearSelectElements",null),_e([U],t.prototype,"moveNodes",null),_e([U],t.prototype,"setDefaultEdgeType",null),_e([U],t.prototype,"changeNodeType",null),_e([U],t.prototype,"changeEdgeType",null),_e([U],t.prototype,"getNodeIncomingEdge",null),_e([U],t.prototype,"getNodeOutgoingEdge",null),_e([U],t.prototype,"getAnchorIncomingEdge",null),_e([U],t.prototype,"getAnchorOutgoingEdge",null),_e([U],t.prototype,"getNodeIncomingNode",null),_e([U],t.prototype,"getNodeOutgoingNode",null),_e([U],t.prototype,"setTheme",null),_e([U],t.prototype,"getTheme",null),_e([U],t.prototype,"resize",null),_e([U],t.prototype,"clearData",null),_e([U],t.prototype,"translateCenter",null),_e([U],t.prototype,"fitView",null),_e([U],t.prototype,"openEdgeAnimation",null),_e([U],t.prototype,"closeEdgeAnimation",null),_e([U],t.prototype,"setPartial",null),t}(),Zi=function(){return Zi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Zi.apply(this,arguments)},ns=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},r4=function(){function t(e,n){n===void 0&&(n=1),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=e,this.epsilon=n}return t.prototype.getStyle=function(){return Zi({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(e,n){for(var r=e.x,i=e.y,o=!1,a=!1,s=0;s<n.length;s++){var l=n[s];if(l.id!==e.id&&(Sr(r,l.x,this.epsilon)&&(o=!0),Sr(i,l.y,this.epsilon)&&(a=!0),o&&a))break}return{isShowVertical:o,isShowHorizontal:a,position:{x:r,y:i}}},t.prototype.getHorizontalSnapline=function(e,n){var r=!1,i=0,o=e.id,a;if(o){var s=this.graphModel.fakeNode;if(s&&s.id===o)a=Hn(s);else{var l=this.graphModel.getNodeModelById(o);l&&(a=Hn(l))}}for(var u=0;u<n.length;u++){var c=n[u];if(c.id!==e.id){var d=Hn(c);if(Sr(d.minY,a==null?void 0:a.minY,this.epsilon)||Sr(d.maxY,a==null?void 0:a.minY,this.epsilon)){r=!0,i=a.minY;break}if(Sr(d.minY,a==null?void 0:a.maxY,this.epsilon)||Sr(d.maxY,a==null?void 0:a.maxY,this.epsilon)){r=!0,i=a.maxY;break}}}return{isShowHorizontal:r,isShowVertical:this.isShowVertical,position:Zi(Zi({},this.position),{y:i})}},t.prototype.getVerticalSnapline=function(e,n){var r=!1,i=0,o=e.id,a;if(o){var s=this.graphModel.fakeNode;if(s&&s.id===o)a=Hn(s);else{var l=this.graphModel.getNodeModelById(o);l&&(a=Hn(l))}}for(var u=0;u<n.length;u++){var c=n[u];if(c.id!==e.id){var d=Hn(c);if(Sr(d.minX,a==null?void 0:a.minX,this.epsilon)){r=!0,i=a.minX;break}if(Sr(d.minX,a==null?void 0:a.minX,this.epsilon)||Sr(d.maxX,a==null?void 0:a.minX,this.epsilon)){r=!0,i=a.minX;break}if(Sr(d.minX,a==null?void 0:a.maxX,this.epsilon)||Sr(d.maxX,a==null?void 0:a.maxX,this.epsilon)){r=!0,i=a.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:r,position:Zi(Zi({},this.position),{x:i})}},t.prototype.getSnapLinePosition=function(e,n){var r=this.getCenterSnapLine(e,n),i=r.isShowHorizontal,o=r.isShowVertical;if(!i){var a=this.getHorizontalSnapline(e,n);a.isShowHorizontal&&(r.isShowHorizontal=a.isShowHorizontal,r.position.y=a.position.y)}if(!o){var s=this.getVerticalSnapline(e,n);s.isShowVertical&&(r.isShowVertical=s.isShowVertical,r.position.x=s.position.x)}return r},t.prototype.setSnaplineInfo=function(e){var n=e.isShowHorizontal,r=e.isShowVertical,i=e.position;this.position=i,this.isShowHorizontal=n,this.isShowVertical=r},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(e){var n=this.graphModel.nodes,r=this.getSnapLinePosition(e,n);this.setSnaplineInfo(r)},ns([X],t.prototype,"isShowHorizontal",void 0),ns([X],t.prototype,"isShowVertical",void 0),ns([X],t.prototype,"position",void 0),ns([U],t.prototype,"clearSnapline",null),ns([U],t.prototype,"setNodeSnapLine",null),t}();function Sr(t,e,n){return Math.abs(t-e)<=n}var i4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),o4=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},a4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},s4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},l4=function(t){i4(e,t);function e(){var n=t.apply(this,s4([],a4(arguments),!1))||this;return n.handleResize=function(){var r=n.props,i=r.graphModel,o=r.options,a=i.width,s=i.height,l=i.isContainerWidth,u=i.isContainerHeight,c=a,d=s,f=!1;l&&(c=void 0,f=!0),u&&(d=void 0,f=!0),f&&i.resize(c,d),o.width=a,o.height=s},n.throttleResize=gm(n.handleResize,200),n}return e.prototype.componentDidMount=function(){window.addEventListener("resize",this.throttleResize)},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(be.GRAPH_UPDATED,{data:n})},e.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.throttleResize)},e.prototype.getComponent=function(n,r,i){i===void 0&&(i="canvas-overlay");var o=this.props.getView,a=o(n.type);return a?V(a,{model:n,graphModel:r,overlay:i},n.id):null},e.prototype.render=function(){var n=this,r=this.props,i=r.graphModel,o=r.tool,a=r.options,s=r.dnd,l=r.snaplineModel,u={};a.width&&(u.width="".concat(i.width,"px")),a.height&&(u.height="".concat(i.height,"px"));var c=i.fakeNode,d=i.editConfigModel,f=i.background,h=d.adjustEdge;return V("div",{className:"lf-graph","flow-id":i.flowId,style:u,children:[V(M3,{graphModel:i,dnd:s,children:[V("g",{className:"lf-base",children:Bn(i.sortElements,function(v){return n.getComponent(v,i)})}),c?this.getComponent(c,i):""]}),V(H3,{graphModel:i,children:[V(U3,{graphModel:i}),h?V(R3,{graphModel:i}):"",a.snapline!==!1?V(G3,{snaplineModel:l}):""]}),V(q3,{graphModel:i,tool:o}),f&&V(k3,{background:f}),V(Vo,{graphModel:i})]})},e=o4([vn],e),e}(Qe),u4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jr=function(){return jr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},jr.apply(this,arguments)},c4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},d4=function(t){u4(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(r){var i=r.event,o=n.props,a=o.anchorData,s=o.nodeModel,l=o.graphModel;l.selectNodeById(s.id),s.autoToFront&&l.toFront(s.id),l.eventCenter.emit(be.ANCHOR_DRAGSTART,{data:a,e:i,nodeModel:s}),n.setState({startX:a.x,startY:a.y,endX:a.x,endY:a.y})},n.onDragging=function(r){var i=r.event,o=n.props,a=o.graphModel,s=o.nodeModel,l=o.anchorData,u=a.transformModel,c=a.eventCenter,d=a.width,f=a.height,h=a.editConfigModel,v=h.autoExpand,g=h.stopMoveGraph;if(i){var m=i.clientX,y=i.clientY,x=a.getPointByClient({x:m,y}),E=x.domOverlayPosition,b=E.x,T=E.y,A=x.canvasOverlayPosition,S=A.x,M=A.y;n.t&&Jl(n.t);var C=[],G=10;b<10?C=[G,0]:b+10>d?C=[-10,0]:T<10?C=[0,G]:T+10>f&&(C=[0,-10]),n.setState({endX:S,endY:M,dragging:!0}),n.moveAnchorEnd(S,M),C.length>0&&!g&&v&&(n.t=ob(function(){var K=c4(C,2),J=K[0],R=K[1];u.translate(J,R);var k=n.state,B=k.endX,Z=k.endY;n.setState({endX:B-J,endY:Z-R}),n.moveAnchorEnd(B-J,Z-R)})),c.emit(be.ANCHOR_DRAG,{data:l,e:i,nodeModel:s})}},n.onDragEnd=function(r){var i=r.event;n.t&&Jl(n.t);var o=n.checkEnd(i);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var a=n.props,s=a.graphModel,l=a.nodeModel,u=a.anchorData;s.eventCenter.emit(be.ANCHOR_DRAGEND,{data:u,e:i,nodeModel:l,edgeModel:o??void 0})},n.checkEnd=function(r){var i,o=n.props,a=o.graphModel,s=o.nodeModel,l=o.anchorData,u=l.x,c=l.y,d=l.id,f=n.state,h=f.endX,v=f.endY,g=f.dragging,m=Yl({x:h,y:v},a);if(n.preTargetNode&&n.preTargetNode.state!==lt.DEFAULT&&n.preTargetNode.setElementState(lt.DEFAULT),!!g&&m&&m.node){var y=m.node,x=m.anchor.id,E="".concat(s.id,"_").concat(y.id,"_").concat(x,"_").concat(d),b=n.sourceRuleResults.get(E)||{},T=b.isAllPass,A=b.msg,S=n.targetRuleResults.get(E)||{},M=S.isAllPass,C=S.msg;if(T&&M){y.setElementState(lt.DEFAULT);var G=a.getNodeModelById(m.node.id),K=(i=a.edgeGenerator)===null||i===void 0?void 0:i.call(a,s.getData(),G==null?void 0:G.getData()),J=a.addEdge(jr(jr({},K),{sourceNodeId:s.id,sourceAnchorId:d,startPoint:{x:u,y:c},targetNodeId:m.node.id,targetAnchorId:m.anchor.id,endPoint:{x:m.anchor.x,y:m.anchor.y}})),R=n.props.anchorData;return a.eventCenter.emit(be.ANCHOR_DROP,{data:R,e:r,nodeModel:s,edgeModel:J}),J}var k=y.getData();return a.eventCenter.emit(be.CONNECTION_NOT_ALLOWED,{data:k,msg:C||A||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new tr({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.getAnchorShape=function(){var n=this.props,r=n.anchorData,i=n.style,o=n.node,a=o.getAnchorShape(r);if(a)return a;var s=r.x,l=r.y,u=jr(jr({},i),i==null?void 0:i.hover);return V("g",{children:[V(zo,jr({className:"lf-node-anchor-hover"},u,{x:s,y:l})),V(zo,jr({className:"lf-node-anchor"},i,{x:s,y:l}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){var n=this.props.graphModel.customTrajectory;return n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var n=this.props,r=n.graphModel,i=r.getAnchorIncomingEdge,o=r.getAnchorOutgoingEdge,a=n.anchorData.id;return{incomingEdgeList:i(a),outgoingEdgeList:o(a)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(n,r){var i,o,a=this.props,s=a.graphModel,l=a.nodeModel,u=a.anchorData,c=Yl({x:n,y:r},s);if(c){var d=c.node,f=c.anchor.id;if(this.preTargetNode&&this.preTargetNode!==c.node&&this.preTargetNode.setElementState(lt.DEFAULT),u.id===f)return;this.preTargetNode=d;var h="".concat(l.id,"_").concat(d.id,"_").concat(f,"_").concat(u.id);if(!this.targetRuleResults.has(h)){var v=c.anchor,g=l.isAllowConnectedAsSource(d,u,v),m=d.isAllowConnectedAsTarget(l,u,v);this.sourceRuleResults.set(h,ql(g)),this.targetRuleResults.set(h,ql(m))}var y=((i=this.sourceRuleResults.get(h))!==null&&i!==void 0?i:{}).isAllPass,x=((o=this.targetRuleResults.get(h))!==null&&o!==void 0?o:{}).isAllPass;y&&x?d.setElementState(lt.ALLOW_CONNECT):d.setElementState(lt.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==lt.DEFAULT&&this.preTargetNode.setElementState(lt.DEFAULT)},e.prototype.isShowLine=function(){var n=this.state,r=n.startX,i=n.startY,o=n.endX,a=n.endY,s=Er(r,i,o,a);return s>10},e.prototype.render=function(){var n=this,r=this.state,i=r.startX,o=r.startY,a=r.endX,s=r.endY,l=this.props,u=l.anchorData,c=l.edgeStyle,d=l.nodeModel,f=l.graphModel,h=u.edgeAddable;return V("g",{className:"lf-anchor",children:[V("g",{onClick:function(v){v.stopPropagation(),f.eventCenter.emit(be.ANCHOR_CLICK,{data:u,e:v,nodeModel:d})},onMouseDown:function(v){f.eventCenter.emit(be.ANCHOR_MOUSEDOWN,{data:u,e:v,nodeModel:d}),h!==!1&&n.dragHandler.handleMouseDown(v)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(jr({sourcePoint:{x:i,y:o},targetPoint:{x:a,y:s}},c)):V(Ho,jr({x1:i,y1:o,x2:a,y2:s},c,{"pointer-events":"none"})))]})},e}(Qe),f4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lf=function(){return Lf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Lf.apply(this,arguments)},p4=function(t){f4(e,t);function e(n){var r=t.call(this,n)||this;return r.style={},r.onDragging=function(i){var o,a=i.event,s=r.props,l=s.graphModel,u=s.nodeModel,c=s.eventCenter,d=l.selectNodes,f=u.x,h=u.y,v=a.clientX,g=a.clientY,m=l.getPointByClient({x:v,y:g}).canvasOverlayPosition,y=m.x,x=m.y,E=new Zt(y-f,x-h),b=((o=r.normal)===null||o===void 0?void 0:o.angle(E))-r.defaultAngle,T=new Xl(-f,-h).rotate(b).translate(f,h).toString();u.transform=T,u.rotate=b;var A=Bn(d,function(M){return M.id});A.indexOf(u.id)===-1&&(A=[u.id]);var S=sm(A,function(M,C){var G=l.getNodeModelById(C);return M[C]=G==null?void 0:G.getMoveDistance(0,0,!1),M},{});A.forEach(function(M){var C=l.getNodeEdges(M);C.forEach(function(G){if(S[G.sourceNodeId]){var K=l.getNodeModelById(G.sourceNodeId),J=K.anchors.find(function(R){return R.id===G.sourceAnchorId});G.updateStartPoint(J)}if(S[G.targetNodeId]){var K=l.getNodeModelById(G.targetNodeId),J=K.anchors.find(function(B){return B.id===G.targetAnchorId});G.updateEndPoint(J)}})}),c.emit(be.NODE_ROTATE,{e:a,model:u,data:u.getData()})},r.style=n.style,r.stepperDrag=new tr({onDragging:r.onDragging}),r}return e.prototype.render=function(){var n=this,r=this.props.nodeModel,i=r.x,o=r.y,a=r.width,s=r.height,l=i+a/2+20,u=o-s/2-20;return this.normal=new Zt(1,0),this.defaultAngle=this.normal.angle(new Zt(l-i,u-o)),r.defaultAngle=this.defaultAngle,V("g",{className:"lf-rotate-control",children:V("g",{onMouseDown:function(c){n.stepperDrag.handleMouseDown(c)},children:V(zo,Lf({},this.style,{cx:l,cy:u}))})})},e}(Qe),If={exports:{}};/*!
|
|
67
|
+
Copyright (c) 2018 Jed Watson.
|
|
68
|
+
Licensed under the MIT License (MIT), see
|
|
69
|
+
http://jedwatson.github.io/classnames
|
|
70
|
+
*/var xb;function h4(){return xb||(xb=1,function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(o=i(o,r(s)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var s in o)e.call(o,s)&&o[s]&&(a=i(a,s));return a}function i(o,a){return a?o?o+" "+a:o+a:o}t.exports?(n.default=n,t.exports=n):window.classNames=n})()}(If)),If.exports}var g4=h4();const kf=ul(g4);var v4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bf=function(){return Bf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Bf.apply(this,arguments)},m4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Eb=function(t){v4(e,t);function e(n){var r=t.call(this)||this;r.mouseDownHandler=function(o){var a=r.props,s=a.draggable,l=a.model,u=a.graphModel,c=u.editConfigModel.nodeTextDraggable;(s??c)&&(o.stopPropagation(),r.stepperDrag.model=l,r.stepperDrag.handleMouseDown(o))},r.onDragging=function(o){var a=o.deltaX,s=o.deltaY,l=r.props,u=l.model,c=l.graphModel.transformModel;if(a||s){var d=m4(c.fixDeltaXY(a,s),2),f=d[0],h=d[1];u.moveText(f,h)}},r.dbClickHandler=function(){var o=r.props,a=o.editable,s=o.graphModel.eventCenter,l=o.model;a&&l.setElementState(lt.TEXT_EDIT),s.emit(be.TEXT_DBCLICK,{data:l.text,model:l})};var i=n.draggable;return r.stepperDrag=new tr({onDragging:r.onDragging,step:1,eventType:"TEXT",isStopPropagation:i}),r}return e.prototype.getShape=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=r.text,s=a.value,l=a.x,u=a.y,c=a.editable,d=a.draggable,f={x:l,y:u,className:"",value:s},h=r.getTextStyle(),v=o.nodeTextDraggable||d;return V(ab,Bf({},f,h,{className:kf({"lf-element-text":c,"lf-text-draggable":!c&&v,"lf-text-disabled":!c&&!v}),model:r}))},e.prototype.render=function(){var n=this.props.model.text;if(n)return V("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e}(Qe),y4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cr=function(){return Cr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Cr.apply(this,arguments)},lu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},_4=function(t){y4(e,t);function e(n){var r=t.call(this,n)||this;return r.setHoverOn=function(){r.setState({isHovered:!0})},r.setHoverOff=function(){r.setState({isHovered:!1})},r.state={isHovered:!1},r}return e.prototype.getBackground=function(){var n=this.state.isHovered,r=this.props.model,i=r.text,o=r.getTextStyle(),a=o.background||{};if(n&&o.hover&&o.hover.background&&(a=Cr(Cr({},a),o.hover.background)),i!=null&&i.value&&(a==null?void 0:a.fill)!=="transparent"){var s=o.fontSize,l=o.textWidth,u=o.lineHeight,c=o.overflowMode,d=a.wrapPadding,f=i==null?void 0:i.value.split(/[\r\n]/g),h=f.length,v=i.x,g=i.y,m={};if(c==="autoWrap"&&l){var y=nb({rows:f,style:{fontSize:"".concat(s,"px"),width:"".concat(l,"px"),lineHeight:u,padding:d},rowsLength:h,className:"lf-get-text-height"});m=Cr(Cr({},a),{x:v,y:g,width:l,height:y})}else{var x=nj({rows:f,rowsLength:h,fontSize:s}),E=x.width,b=x.height;if(c==="ellipsis"&&(E=l,b=s+2),typeof a.wrapPadding=="string"){var T=a.wrapPadding.split(",").filter(function(Be){return Be.trim()}).map(function(Be){return parseFloat(Be.trim())});if(T.length>0&&T.length<=4){if(T.length===1){var A=lu(T,1),S=A[0];T=[S,S,S,S]}else if(T.length===2){var M=lu(T,2),C=M[0],G=M[1];T=[C,G,C,G]}else if(T.length===3){var K=lu(T,3),J=K[0],G=K[1],R=K[2];T=[J,G,R,G]}var k=lu(T,4),B=k[0],Z=k[1],ee=k[2],ce=k[3];E+=Z+ce,b+=B+ee,v=v+(Z-ce)/2,g=g+(ee-B)/2}}m=Cr(Cr({},a),{x:v-1,y:g-1,width:E,height:b})}return V(rr,Cr({},m))}return null},e.prototype.getShape=function(){var n=this.props.model,r=n.text,i=r.x,o=r.y,a=r.value;if(!a)return null;var s=n.getTextStyle(),l=Cr({x:i,y:o,value:a,model:n,className:"lf-element-text"},s);return V("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),V(ab,Cr({},l))]})},e}(Eb),b4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uu=function(){return uu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},uu.apply(this,arguments)},x4=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},cu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ti=function(t){b4(e,t);function e(n){var r=t.call(this)||this;r.onDragStart=function(l){var u=l.event,c=r.props,d=c.model,f=c.graphModel;if(u){var h=f.getPointByClient({x:u.clientX,y:u.clientY}).canvasOverlayPosition,v=h.x,g=h.y;r.moveOffset={dx:d.x-v,dy:d.y-g}}},r.onDragging=function(l){var u,c,d,f,h=l.event,v=r.props,g=v.model,m=v.graphModel,y=m.editConfigModel,x=y.stopMoveGraph,E=y.autoExpand,b=y.snapGrid,T=m.transformModel,A=m.selectNodes,S=m.width,M=m.height,C=m.gridSize;g.isDragging=!0;var G=h,K=G.clientX,J=G.clientY,R=r.mouseDownPosition,k=R.x,B=R.y;(K-k>C||J-B>C)&&(g.isDragging=!0);var Z=m.getPointByClient({x:K,y:J}).canvasOverlayPosition,ee=Z.x,ce=Z.y,Be=cu(T.CanvasPointToHtmlPoint([ee,ce]),2),me=Be[0],de=Be[1];if(ee=ee+((c=(u=r.moveOffset)===null||u===void 0?void 0:u.dx)!==null&&c!==void 0?c:0),ce=ce+((f=(d=r.moveOffset)===null||d===void 0?void 0:d.dy)!==null&&f!==void 0?f:0),ee=Fo(ee,C,b),ce=Fo(ce,C,b),!S||!M){m.moveNode2Coordinate(g.id,ee,ce);return}var Se=me<0||de<0||me>S||de>M;if(!(E&&!x&&Se)){var je=cu(T.CanvasPointToHtmlPoint([ee-g.width/2,ce-g.height/2]),2),he=je[0],Ve=je[1],$=cu(T.CanvasPointToHtmlPoint([ee+g.width/2,ce+g.height/2]),2),w=$[0],_=$[1],F=Math.max(C,20),L=[];he<0?L=[F,0]:w>m.width?L=[-F,0]:Ve<0?L=[0,F]:_>m.height&&(L=[0,-F]),r.t&&Jl(r.t);var se=A.map(function(fe){return fe.id});se.indexOf(g.id)===-1&&(se=[g.id]),L.length>0&&!x&&E?r.t=ob(function(){var fe=cu(L,2),Ne=fe[0],ze=fe[1];T.translate(Ne??0,ze??0);var rt=-(Ne??0)/T.SCALE_X,Ze=-(ze??0)/T.SCALE_X;m.moveNodes(se,rt,Ze)}):m.moveNodes(se,ee-g.x,ce-g.y)}},r.onDragEnd=function(){r.t&&Jl(r.t);var l=r.props.model;l.isDragging=!1},r.onMouseOut=function(l){PB()&&r.setHoverOff(l)},r.handleMouseUp=function(){var l=r.props.model;r.mouseUpDrag=l.isDragging},r.handleClick=function(l){var u=r.mouseUpDrag===!1,c=new Date().getTime();if(r.startTime){var d=c-r.startTime,f=r.props,h=f.model,v=f.graphModel;if(!(!u&&d>300)){u||(r.onDragEnd(),r.handleMouseUp());var g=h.getData(),m=v.getPointByClient({x:l.clientX,y:l.clientY}),y={data:g,e:l,position:m,isSelected:!1,isMultiple:!1},x=l.button===2,E=l.detail===2;if(!x){var b=v.editConfigModel,T=K_(l,b);if(y.isMultiple=T,h.isSelected&&!E&&T?(y.isSelected=!1,h.setSelected(!1)):(v.selectNodeById(h.id,T),y.isSelected=!0,b.isSilentMode||r.toFront()),E)b.nodeTextEdit&&h.text.editable&&b.textMode===er.TEXT&&(h.setSelected(!1),v.setElementStateById(h.id,lt.TEXT_EDIT)),v.eventCenter.emit(be.NODE_DBCLICK,y);else{v.eventCenter.emit(be.ELEMENT_CLICK,y),v.eventCenter.emit(be.NODE_CLICK,y);var A=l.currentTarget,S=!pn(window)&&lr(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(M){return setTimeout(M,0)};S(function(){A.focus()})}}}}},r.handleContextMenu=function(l){l.preventDefault();var u=r.props,c=u.model,d=u.graphModel,f=d.editConfigModel,h=c.getData(),v=d.getPointByClient({x:l.clientX,y:l.clientY});d.setElementStateById(c.id,lt.SHOW_MENU,v.domOverlayPosition),c.isSelected||d.selectNodeById(c.id),d.eventCenter.emit(be.NODE_CONTEXTMENU,{data:h,e:l,position:v}),f.isSilentMode||r.toFront()},r.handleMouseDown=function(l){var u=r.props,c=u.model,d=u.graphModel;r.mouseDownPosition={x:l.clientX,y:l.clientY},r.startTime=new Date().getTime();var f=d.editConfigModel;f.adjustNodePosition&&c.draggable&&r.stepDrag&&r.stepDrag.handleMouseDown(l)},r.handleFocus=function(){var l=r.props,u=l.model,c=l.graphModel;c.eventCenter.emit(be.NODE_FOCUS,{data:u.getData()})},r.handleBlur=function(){if(r.props){var l=r.props,u=l.model,c=l.graphModel;c.eventCenter.emit(be.NODE_BLUR,{data:u.getData()})}},r.setHoverOn=function(l){var u=r.props,c=u.model,d=u.graphModel;if(!c.isHovered){var f=c.getData();c.setHovered(!0),d.eventCenter.emit(be.NODE_MOUSEENTER,{data:f,e:l})}},r.setHoverOff=function(l){var u=r.props,c=u.model,d=u.graphModel,f=c.getData();c.isHovered&&(c.setHovered(!1),d.eventCenter.emit(be.NODE_MOUSELEAVE,{data:f,e:l}))};var i=n.graphModel,o=i.gridSize,a=i.eventCenter,s=n.model;return r.stepDrag=new tr({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:o,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),r.modelDisposer=Ny(function(){return r.props},function(l){l&&l.model&&r.stepDrag.setModel(l.model)}),r}return e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(n){return null},e.prototype.getAnchors=function(){var n=this,r=this.props,i=r.model,o=r.graphModel,a=i.isSelected,s=i.isHitable,l=i.isDragging,u=i.isShowAnchor;return s&&(a||u)&&!l?Bn(i.anchors,function(c,d){var f=i.getAnchorLineStyle(c),h=i.getAnchorStyle(c);return V(d4,{anchorData:c,node:n,style:h,edgeStyle:f,anchorIndex:d,nodeModel:i,graphModel:o,setHoverOff:n.setHoverOff})}):[]},e.prototype.getRotateControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.isSilentMode,s=o.allowRotate,l=r.isSelected,u=r.isHitable,c=r.rotatable,d=r.isHovered,f=s&&c,h=r.getRotateControlStyle();if(!a&&u&&(l||d)&&f)return V(p4,{graphModel:i,nodeModel:r,eventCenter:i.eventCenter,style:h})},e.prototype.getResizeControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.isSilentMode,s=o.allowResize,l=r.isSelected,u=r.isHitable,c=r.resizable,d=r.isHovered,f=s&&c,h=r.getResizeControlStyle();return!a&&u&&(l||d)&&f?V(Dj,{style:h,model:r,graphModel:i}):null},e.prototype.getText=function(){var n,r=this.props,i=r.model,o=r.graphModel,a=o.editConfigModel;if(a.nodeTextMode!==er.TEXT||i.state===lt.TEXT_EDIT)return null;if(i.text){var s=!1;return a.nodeTextDraggable&&i.text.draggable&&(s=!0),V(Eb,{editable:a.nodeTextEdit&&((n=i.text.editable)!==null&&n!==void 0?n:!0),model:i,graphModel:o,draggable:s})}return null},e.prototype.getStateClassName=function(){var n=this.props.model,r=n.state,i=n.isDragging,o=n.isSelected,a="lf-node";switch(r){case lt.ALLOW_CONNECT:a+=" lf-node-allow";break;case lt.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return i&&(a+=" lf-dragging"),o&&(a+=" lf-node-selected"),a},e.prototype.toFront=function(){var n=this.props,r=n.model,i=n.graphModel;r.autoToFront&&i.toFront(r.id)},e.prototype.render=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.hideAnchors,s=o.adjustNodePosition,l=o.allowRotate,u=o.allowResize,c=i.gridSize,d=i.transformModel.SCALE_X,f=r.isHitable,h=r.draggable,v=r.transform,g=r.getOuterGAttributes(),m=g.className,y=m===void 0?"":m,x=x4(g,["className"]),E=V("g",{className:"lf-node-content",children:[V("g",{transform:v,children:[this.getShape(),this.getText(),l&&this.getRotateControl(),u&&this.getResizeControl()]}),!a&&this.getAnchors()]}),b;return f?(s&&h&&this.stepDrag.setStep(c*d),b=V("g",uu({className:"".concat(this.getStateClassName()," ").concat(y),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu,onFocus:this.handleFocus,onBlur:this.handleBlur},x,{children:E}))):b=V("g",uu({className:"".concat(this.getStateClassName()," ").concat(y)},x,{children:E})),b},e.isObserved=!1,e}(Qe),E4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jf=function(){return jf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},jf.apply(this,arguments)},Ji=function(t){E4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle();return V(rr,jf({},r,{x:n.x,y:n.y,width:n.width,height:n.height,radius:n.radius}))},e}(Ti),w4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ff=function(){return Ff=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ff.apply(this,arguments)},du=function(t){w4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.r,a=n.getNodeStyle();return V(zo,Ff({},a,{x:r,y:i,r:o}))},e}(Ti),S4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fu=function(){return fu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},fu.apply(this,arguments)},pu=function(t){S4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points,u=n.getNodeStyle(),c={transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(o-s/2,")")};return V("g",fu({},c,{children:V(wf,fu({},u,{points:l,x:i,y:o}))}))},e}(Ti),C4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$f=function(){return $f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$f.apply(this,arguments)},Hf=function(t){C4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle();return V("g",{children:V(wf,$f({},r,{points:n.points,x:n.x,y:n.y}))})},e}(Ti),A4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zf=function(){return zf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},zf.apply(this,arguments)},Wf=function(t){A4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle();return V(wj,zf({},r,{x:n.x,y:n.y,rx:n.rx,ry:n.ry}))},e}(Ti),O4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rs=function(){return rs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},rs.apply(this,arguments)},wb=function(t){O4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBackground=function(){var n=this.props.model,r=n.getTextStyle(),i=n.width,o=n.height,a=n.x,s=n.y,l=rs(rs({},r.background),{x:a,y:s,width:i,height:o});return V(rr,rs({},l))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return V("g",{children:this.getBackground()})},e}(Ti),T4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uf=function(){return Uf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Uf.apply(this,arguments)},N4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},M4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Vf=function(t){T4(e,t);function e(){var n=t.apply(this,M4([],N4(arguments),!1))||this;return n.ref=pl(),n}return Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(n){n.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(n){this.setHtml(n)},e.prototype.shouldUpdate=function(){return this.preProperties&&this.preProperties===this.currentProperties?!1:(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this),this.rootEl.innerHTML=""},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.height,a=n.width,s=n.getNodeStyle();return this.currentProperties=JSON.stringify(n.properties),V("foreignObject",Uf({},s,{x:r-a/2,y:i-o/2,width:a,height:o,ref:this.ref}))},e}(Ti),D4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ar=function(){return Ar=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ar.apply(this,arguments)},P4=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},R4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Fr;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Fr||(Fr={}));var Sb=function(t){D4(e,t);function e(n){var r=t.call(this)||this;r.handleMouseDown=function(l){r.stepDrag&&r.stepDrag.handleMouseDown(l)},r.onDragStart=function(){var l=r.props,u=l.x,c=l.y,d=l.edgeModel,f=d.startPoint,h=d.endPoint,v=d.pointsList;r.oldEdge={startPoint:f,endPoint:h,pointsList:v},r.setState({endX:u,endY:c,dragging:!0})},r.onDragging=function(l){var u=l.deltaX,c=l.deltaY,d=r.state,f=d.endX,h=d.endY,v=r.props,g=v.graphModel,m=v.type,y=g.transformModel,x=g.editConfigModel,E=R4(y.moveCanvasPointByHtml([f,h],u,c),2),b=E[0],T=E[1];r.setState({endX:b,endY:T,dragging:!0});var A=r.props.edgeModel,S=Yl({x:f,y:h},g);if(S&&S.node&&r.isAllowAdjust(S).pass){var M=A.startPoint,C=A.endPoint,G=A.sourceNode,K=A.targetNode,J=m===Fr.SOURCE?{startPoint:{x:S.anchor.x,y:S.anchor.y},endPoint:{x:C.x,y:C.y},sourceNode:S.node,targetNode:K}:{startPoint:{x:M.x,y:M.y},endPoint:{x:S.anchor.x,y:S.anchor.y},sourceNode:G,targetNode:S.node};A.updateAfterAdjustStartAndEnd(J)}else m===Fr.SOURCE?A.updateStartPoint({x:b,y:T}):A.updateEndPoint({x:b,y:T});A.text.value&&x.adjustEdge&&A.setText(Object.assign({},A.text,A.textPosition))},r.onDragEnd=function(l){var u,c,d,f=l.event;try{r.setState({dragging:!1});var h=r.props,v=h.graphModel,g=h.edgeModel,m=h.type,y=r.state,x=y.endX,E=y.endY,b=y.dragging,T=Yl({x,y:E},v);if(!b)return;var A=!1,S=void 0;if(T&&T.node){var M=r.isAllowAdjust(T),C=M.pass,G=M.msg,K=M.newTargetNode;if(C){var J=g.getData(),R=J.text,k=J.sourceAnchorId,B=k===void 0?"":k,Z=J.targetAnchorId,ee=Z===void 0?"":Z,ce=P4(J,["text","sourceAnchorId","targetAnchorId"]);if(S=Ar(Ar({sourceAnchorId:B,targetAnchorId:ee},ce),{text:(R==null?void 0:R.value)||""}),m===Fr.SOURCE){var Be=v.getNodeModelById(T.node.id),me=v.getNodeModelById(g.targetNodeId),de=(u=v.edgeGenerator)===null||u===void 0?void 0:u.call(v,Be==null?void 0:Be.getData(),me==null?void 0:me.getData(),S);S=Ar(Ar({},de),{sourceNodeId:T.node.id,sourceAnchorId:T.anchor.id,startPoint:{x:T.anchor.x,y:T.anchor.y},targetNodeId:g.targetNodeId,endPoint:Ar({},g.endPoint)}),g.sourceNodeId===T.node.id&&g.sourceAnchorId===T.anchor.id&&(A=!0)}else if(m===Fr.TARGET){var Be=v.getNodeModelById(g.sourceNodeId),me=v.getNodeModelById(T.node.id),de=(c=v.edgeGenerator)===null||c===void 0?void 0:c.call(v,Be==null?void 0:Be.getData(),me==null?void 0:me.getData(),S);S=Ar(Ar({},de),{sourceNodeId:g.sourceNodeId,startPoint:Ar({},g.startPoint),targetNodeId:T.node.id,targetAnchorId:T.anchor.id,endPoint:{x:T.anchor.x,y:T.anchor.y}}),g.targetNodeId===T.node.id&&g.targetAnchorId===T.anchor.id&&(A=!0)}}else{A=!0;var Se=K.getData();v.eventCenter.emit(be.CONNECTION_NOT_ALLOWED,{data:Se,msg:G})}}else A=!0;if(A)r.recoveryEdge();else{var je=g.getData();v.deleteEdgeById(g.id);var he=v.addEdge(Ar({},S));v.eventCenter.emit(be.EDGE_EXCHANGE_NODE,{data:{newEdge:he.getData(),oldEdge:je}})}(d=r.preTargetNode)===null||d===void 0||d.setElementState(lt.DEFAULT)}finally{var v=r.props.graphModel;v.eventCenter.emit(be.ADJUST_POINT_DRAGEND,{e:f,data:r.stepDragData})}},r.recoveryEdge=function(){var l=r.props.edgeModel,u=r.oldEdge,c=u.startPoint,d=u.endPoint,f=u.pointsList;l.updateStartPoint(c),l.updateEndPoint(d),l.modelType!==Ye.LINE_EDGE&&(l.pointsList=f??[],l.initPoints())},r.getAdjustPointStyle=function(){var l=r.props.graphModel.theme,u=l.edgeAdjust;return u},r.state={dragging:!1,endX:0,endY:0},r.targetRuleResults=new Map,r.sourceRuleResults=new Map;var i=n.type,o=n.edgeModel,a=n.graphModel,s=a.eventCenter;return r.stepDragData={type:i,edgeData:o.getData()},r.stepDrag=new tr({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:s,data:r.stepDragData}),r}return e.prototype.isAllowAdjust=function(n){var r=this.props,i=r.edgeModel,o=i.id,a=i.sourceNode,s=i.targetNode,l=i.sourceAnchorId,u=i.targetAnchorId,c=r.type,d,f,h,v;if(c===Fr.SOURCE?(d=n.node,f=s,h=n.anchor,v=s.getAnchorInfo(u)):(d=a,f=n.node,v=n.anchor,h=a.getAnchorInfo(l)),this.preTargetNode&&this.preTargetNode!==n.node&&this.preTargetNode.setElementState(lt.DEFAULT),this.preTargetNode=n.node,v.id===h.id)return{pass:!1,msg:"",newTargetNode:f};var g="".concat(d.id,"_").concat(f.id,"_").concat(h.id,"_").concat(v.id);if(!this.targetRuleResults.has(g)){var m=d.isAllowConnectedAsSource(f,h,v,o),y=f.isAllowConnectedAsTarget(d,h,v,o);this.sourceRuleResults.set(g,ql(m)),this.targetRuleResults.set(g,ql(y))}var x=this.sourceRuleResults.get(g),E=x.isAllPass,b=x.msg,T=this.targetRuleResults.get(g),A=T.isAllPass,S=T.msg,M=E&&A?lt.ALLOW_CONNECT:lt.NOT_ALLOW_CONNECT;return c===Fr.SOURCE?d.setElementState(M):f.setElementState(M),{pass:E&&A,msg:S||b,newTargetNode:f}},e.prototype.render=function(){var n=this.props,r=n.x,i=n.y,o=n.getAdjustPointShape,a=n.edgeModel,s=this.state.dragging;return V("g",{pointerEvents:s?"none":"",onMouseDown:this.handleMouseDown,children:s?"":o(r,i,a)})},e}(Qe),L4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xf=function(){return Xf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Xf.apply(this,arguments)};(function(t){L4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getArrowAttributes=function(){var n=this.props,r=n.arrowInfo,i=n.style,o=r.start,a=r.end,s={start:o,end:a,offset:i.offset,verticalLength:i.verticalLength,type:"end"},l=Ra(s),u=l.leftX,c=l.leftY,d=l.rightX,f=l.rightY;return Xf({d:"M".concat(u," ").concat(c," L").concat(a.x," ").concat(a.y," L").concat(d," ").concat(f," z")},i)},e.prototype.getShape=function(){var n=this.getArrowAttributes(),r=n.d,i=n.strokeWidth,o=n.stroke,a=n.fill;return V(Fa,{d:r,fill:a,strokeWidth:i,stroke:o})},e.prototype.render=function(){return V("g",{className:"lf-arrow",children:this.getShape()})},e})(Qe);var I4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),is=function(){return is=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},is.apply(this,arguments)},k4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},hu=function(t){I4(e,t);function e(){var n=t.call(this)||this;return n.textRef=pl(),n.handleHover=function(r,i){var o=n.props,a=o.model,s=o.graphModel.eventCenter;a.setHovered(r);var l=r?be.EDGE_MOUSEENTER:be.EDGE_MOUSELEAVE,u=a.getData();s.emit(l,{data:u,e:i})},n.setHoverOn=function(r){var i=n.props.model.isHovered;i||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOn(),n.handleHover(!0,r))},n.setHoverOff=function(r){var i=n.props.model.isHovered;i&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOff(),n.handleHover(!1,r))},n.handleContextMenu=function(r){r.preventDefault(),n.contextMenuTime=new Date().getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var i=n.props,o=i.model,a=i.graphModel,s=a.editConfigModel,l=a.getPointByClient({x:r.clientX,y:r.clientY});a.setElementStateById(o.id,lt.SHOW_MENU,l.domOverlayPosition),s.isSilentMode||n.toFront(),o.isSelected||a.selectEdgeById(o.id);var u=o==null?void 0:o.getData();a.eventCenter.emit(be.EDGE_CONTEXTMENU,{data:u,e:r,position:l})},n.handleMouseDown=function(r){r.stopPropagation(),n.startTime=new Date().getTime()},n.handleMouseUp=function(){var r=n.props.model;n.mouseUpDrag=r.isDragging},n.handleClick=function(r){if(n.startTime&&!n.mouseUpDrag){var i=r.button===2;if(!i){var o=r.detail===2,a=n.props,s=a.model,l=a.graphModel,u=s==null?void 0:s.getData(),c=l.getPointByClient({x:r.clientX,y:r.clientY});if(o){var d=l.editConfigModel,f=l.textEditElement,h=s.id,v=s.text,g=s.modelType;if(f&&f.id===h&&l.setElementStateById(h,lt.DEFAULT),d.edgeTextEdit&&v.editable&&(s.setSelected(!1),l.setElementStateById(h,lt.TEXT_EDIT)),g===Ye.POLYLINE_EDGE){var m=s,y=l.getPointByClient({x:r.x,y:r.y}).canvasOverlayPosition,x=y.x,E=y.y;m.dbClickPosition=G_({x,y:E},m.points)}l.eventCenter.emit(be.EDGE_DBCLICK,{data:u,e:r,position:c})}else{l.eventCenter.emit(be.ELEMENT_CLICK,{data:u,e:r,position:c}),l.eventCenter.emit(be.EDGE_CLICK,{data:u,e:r,position:c});var b=r.currentTarget,T=!pn(window)&&lr(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(S){return setTimeout(S,0)};T(function(){b.focus()})}var A=l.editConfigModel;l.selectEdgeById(s.id,K_(r,A)),A.isSilentMode||n.toFront()}}},n.handleFocus=function(){var r=n.props,i=r.model,o=r.graphModel;o.eventCenter.emit(be.EDGE_FOCUS,{data:i.getData()})},n.handleBlur=function(){var r=n.props,i=r.model,o=r.graphModel;o.eventCenter.emit(be.EDGE_BLUR,{data:i.getData()})},n}return e.prototype.getShape=function(){return V("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var n,r=this.props,i=r.model,o=r.graphModel,a=o.editConfigModel;if(a.edgeTextMode!==er.TEXT||i.state===lt.TEXT_EDIT)return null;if(i.text){var s=!1;return a.edgeTextDraggable&&i.text.draggable&&(s=!0),V(_4,{ref:this.textRef,editable:a.edgeTextEdit&&((n=i.text.editable)!==null&&n!==void 0?n:!0),model:i,graphModel:o,draggable:s})}return null},e.prototype.getArrowInfo=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint,o=n.isSelected,a=this.state.hover;return{start:r,end:i,hover:a,isSelected:o}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint;return[r,i]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var n=this.props.model,r=n.id,i=n.getArrowStyle(),o=i.refY,a=o===void 0?0:o,s=i.refX,l=s===void 0?2:s,u=k4(this.getLastTwoPoints(),2),c=u[0],d=u[1],f="auto";if(c&&d){var h=d.x-c.x,v=d.y-c.y;if(h!==0||v!==0){var g=Gj(Xj({x:h,y:v}));Number.isFinite(g)&&!Number.isNaN(g)&&(f=g)}}return V("g",{children:V("defs",{children:[V("marker",{id:"marker-start-".concat(r),refX:-l,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),V("marker",{id:"marker-end-".concat(r),refX:l,refY:a,overflow:"visible",orient:f,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getArrowPath=function(n,r){var i=r.stroke,o=r.fill,a=o===void 0?i:o,s=r.strokeWidth,l=r.offset,u=l===void 0?10:l,c=r.verticalLength,d=r.strokeLinecap,f=r.strokeLinejoin,h=r.transform,v="";switch(n){case"solid":v="M".concat(-u/4,",0 L").concat(3*u/4,",").concat(c," L").concat(3*u/4,",-").concat(c," Z");break;case"hollow":v="M".concat(-u/4,",0 L").concat(3*u/4,",").concat(c," L").concat(-u/4,",0 L").concat(3*u/4,",-").concat(c," L").concat(-u/4,",0 Z");break;case"diamond":v="M".concat(-u/2,",0 L0,").concat(c," L").concat(u/2,",0 L0,-").concat(c," L").concat(-u/2,",0 Z");break;case"circle":v="M".concat(-u/2,",0 A").concat(u/4,",").concat(u/4," 0 1,0 ").concat(u/2,",0 A").concat(u/4,",").concat(u/4," 0 1,0 ").concat(-u/2,",0 Z");break;default:v="";break}return V("path",{d:v,stroke:i,fill:a,strokeWidth:s,strokeLinecap:d,strokeLinejoin:f,transform:h})},e.prototype.getStartArrow=function(){var n=this.props.model,r=n.getArrowStyle(),i=r.stroke,o=r.strokeWidth,a=r.offset,s=r.verticalLength,l=r.startArrowType,u=l===void 0?"none":l,c=r.strokeLinecap,d=r.strokeLinejoin;return this.getArrowPath(u,{stroke:i,strokeWidth:o,offset:a,verticalLength:s,strokeLinecap:c,strokeLinejoin:d})},e.prototype.getEndArrow=function(){var n=this.props.model,r=n.getArrowStyle(),i=r.stroke,o=r.strokeWidth,a=r.offset,s=r.verticalLength,l=r.endArrowType,u=l===void 0?"solid":l,c=r.strokeLinecap,d=r.strokeLinejoin;return this.getArrowPath(u,{stroke:i,strokeWidth:o,offset:a,verticalLength:s,strokeLinecap:c,strokeLinejoin:d,transform:"rotate(180)"})},e.prototype.getAdjustPointShape=function(n,r,i){var o=i.getAdjustPointStyle();return V(zo,is({className:"lf-edge-adjust-point"},o,{x:n,y:r}))},e.prototype.getAdjustPoints=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.adjustEdgeStartAndEnd,s=o.adjustEdgeStart,l=o.adjustEdgeEnd,u=r.getAdjustStart(),c=r.getAdjustEnd();return V("g",{children:[a&&s&&V(Sb,is({type:Fr.SOURCE},u,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:r,graphModel:i})),a&&l&&V(Sb,is({type:Fr.TARGET},c,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:r,graphModel:i}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return V("g",{})},e.prototype.getAppend=function(){return V("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var n=this.props,r=n.graphModel,i=n.model;r.toFront(i.id)},e.prototype.render=function(){var n=this.props.model,r=n.isSelected,i=n.isHitable,o=n.isShowAdjustPoint;return V("g",{children:[V("g",{className:["lf-edge",!i&&"pointer-none",r&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,onFocus:this.handleFocus,onBlur:this.handleBlur,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),o&&r?this.getAdjustPoints():""]})},e.isObserved=!1,e}(Qe),B4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gf=function(){return Gf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gf.apply(this,arguments)},j4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Cb=function(t){B4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,r=n.getEdgeStyle(),i=n,o=i.path,a=i.isAnimation,s=i.arrowConfig,l=n.getEdgeAnimationStyle(),u=l.strokeDasharray,c=l.stroke,d=l.strokeDashoffset,f=l.animationName,h=l.animationDuration,v=l.animationIterationCount,g=l.animationTimingFunction,m=l.animationDirection;return V(Fa,Gf({d:o},r,s,a?{strokeDasharray:u,stroke:c,style:{strokeDashoffset:d,animationName:f,animationDuration:h,animationIterationCount:v,animationTimingFunction:g,animationDirection:m}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model.path;return V(Fa,{d:n,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var n=this.props.model,r=this.state.hover,i=n.isSelected,o=n.getArrowStyle().offset,a=n.pointsList.map(function(d){return{x:d.x,y:d.y}}),s=j4(X_(a,o),2),l=s[0],u=s[1],c={start:l,end:u,hover:r,isSelected:i};return c},e.prototype.getLastTwoPoints=function(){var n=this.props.model,r=n.getArrowStyle().offset,i=n.pointsList.map(function(o){return{x:o.x,y:o.y}});return X_(i,r)},e}(hu),F4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yf=function(){return Yf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Yf.apply(this,arguments)},Ab=function(t){F4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint,o=n.isAnimation,a=n.arrowConfig,s=n.getEdgeStyle(),l=n.getEdgeAnimationStyle(),u=l.strokeDasharray,c=l.stroke,d=l.strokeDashoffset,f=l.animationName,h=l.animationDuration,v=l.animationIterationCount,g=l.animationTimingFunction,m=l.animationDirection;return V(Ho,Yf({},s,{x1:r.x,y1:r.y,x2:i.x,y2:i.y},a,o?{strokeDasharray:u,stroke:c,style:{strokeDashoffset:d,animationName:f,animationDuration:h,animationIterationCount:v,animationTimingFunction:g,animationDirection:m}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint,o={start:r,end:i},a=QB(o),s=a.d,l=a.strokeWidth,u=a.fill,c=a.strokeDasharray,d=a.stroke;return V(Fa,{d:s,fill:u,strokeWidth:l,stroke:d,strokeDasharray:c})},e}(hu),$4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qi=function(){return Qi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Qi.apply(this,arguments)},H4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},os=function(t){$4(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(){var r=n.props.model;r.dragAppendStart(),n.isShowAdjustPointTemp=r.isShowAdjustPoint,r.isShowAdjustPoint=!1},n.onDragging=function(r){var i=r.deltaX,o=r.deltaY,a=n.props,s=a.model,l=a.graphModel;n.isDragging=!0;var u=l.transformModel,c=l.editConfigModel,d=H4(u.fixDeltaXY(i,o),2),f=d[0],h=d[1],v=s,g=c.adjustEdgeMiddle;g?n.appendInfo=v.dragAppendSimple(n.appendInfo,{x:f,y:h}):n.appendInfo=v.dragAppend(n.appendInfo,{x:f,y:h})},n.onDragEnd=function(){var r,i=n.props,o=i.model,a=i.graphModel.eventCenter,s=o;s.dragAppendEnd(),n.isDragging=!1,s.isShowAdjustPoint=(r=n.isShowAdjustPointTemp)!==null&&r!==void 0?r:!1,n.appendInfo=void 0,a.emit(be.EDGE_ADJUST,{data:s.getData()})},n.beforeDragStart=function(r,i){i.draggable&&n.drag.handleMouseDown(r),n.appendInfo=i},n.drag=new tr({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return e.prototype.getEdge=function(){var n=this.props.model,r=n.points,i=n.isAnimation,o=n.arrowConfig,a=n.getEdgeStyle(),s=n.getEdgeAnimationStyle(),l=s.strokeDasharray,u=s.stroke,c=s.strokeDashoffset,d=s.animationName,f=s.animationDuration,h=s.animationIterationCount,v=s.animationTimingFunction,g=s.animationDirection;return V(Oj,Qi({points:r},a,o,i?{strokeDasharray:l,stroke:u,style:{strokeDashoffset:c,animationName:d,animationDuration:f,animationIterationCount:h,animationTimingFunction:v,animationDirection:g}}:{}))},e.prototype.getArrowInfo=function(){var n=this.props.model,r=n.points,i=n.isSelected,o=this.state.hover,a=Ki(r),s=a[0],l=a[0];return a.length>=2&&(s=a[a.length-2],l=a[a.length-1]),{start:s,end:l,hover:o,isSelected:i}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,r=n.points,i=Ki(r),o=i[0],a=i[0];return i.length>=2&&(o=i[i.length-2],a=i[i.length-1]),[o,a]},e.prototype.getAppendAttributes=function(n){var r=n.start,i=n.end,o;if(r.x===i.x&&r.y===i.y)o="";else{var a={start:r,end:i,offset:10,verticalLength:5},s=Ra(Qi(Qi({},a),{type:"start"})),l=Ra(Qi(Qi({},a),{type:"end"}));o="M".concat(s.leftX," ").concat(s.leftY,`
|
|
71
|
+
L`).concat(s.rightX," ").concat(s.rightY,`
|
|
72
|
+
L`).concat(l.rightX," ").concat(l.rightY,`
|
|
73
|
+
L`).concat(l.leftX," ").concat(l.leftY," z")}return{d:o,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},e.prototype.getAppendShape=function(n){var r=this.getAppendAttributes(n),i=r.d,o=r.strokeWidth,a=r.fill,s=r.strokeDasharray,l=r.stroke;return V(Fa,{d:i,fill:a,strokeWidth:o,stroke:l,strokeDasharray:s})},e.prototype.getAppendWidth=function(){for(var n=this,r=this.props,i=r.model,o=r.graphModel,a=i.pointsList,s=i.draggable,l=[],u=a.length,c=function(h){var v="lf-polyline-append",g={start:{x:a[h].x,y:a[h].y},end:{x:a[h+1].x,y:a[h+1].y},startIndex:h,endIndex:h+1,direction:Tt.HORIZONTAL,draggable:!0},m=V("g",{className:v,children:d.getAppendShape(g)}),y=o.editConfigModel,x=y.adjustEdge,E=y.adjustEdgeMiddle;if(x&&s){var b=g.startIndex,T=g.endIndex,A=E&&(b===0||T===u-1);g.draggable=!A,g.start.x===g.end.x?(g.draggable&&(v+="-ew-resize"),g.direction=Tt.VERTICAL):g.start.y===g.end.y&&(g.draggable&&(v+="-ns-resize"),g.direction=Tt.HORIZONTAL),m=V("g",{className:d.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(S){return n.beforeDragStart(S,g)},children:V("g",{className:v,children:d.getAppendShape(g)})})}l.push(m)},d=this,f=0;f<u-1;f++)c(f);return V("g",{children:l})},e}(hu),Go=function(){return Go=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Go.apply(this,arguments)},z4=function(){function t(e){var n=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){n.nodeConfig=null,window.document.removeEventListener("mouseup",n.stopDrag)},this.dragEnter=function(i){!n.nodeConfig||n.fakeNode||(n.fakeNode=n.lf.createFakeNode(Go(Go({},n.nodeConfig),n.clientToLocalPoint({x:i.clientX,y:i.clientY}))))},this.onDragOver=function(i){if(n.lf.graphModel.eventCenter.emit(be.BLANK_CANVAS_MOUSEMOVE,{e:i}),i.preventDefault(),n.fakeNode){var o=n.clientToLocalPoint({x:i.clientX,y:i.clientY}),a=o.x,s=o.y;n.fakeNode.moveTo(a,s);var l=n.fakeNode.getData();n.lf.setNodeSnapLine(l),n.lf.graphModel.eventCenter.emit(be.NODE_DND_DRAG,{data:l,e:i})}return!1},this.onDragLeave=function(){n.fakeNode&&(n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)},this.onDrop=function(i){!n.lf.graphModel||!i||!n.nodeConfig||(n.lf.addNode(Go(Go({},n.nodeConfig),n.clientToLocalPoint({x:i.clientX,y:i.clientY})),be.NODE_DND_ADD,i),i.preventDefault(),i.stopPropagation(),n.nodeConfig=null,n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)};var r=e.lf;this.lf=r}return t.prototype.clientToLocalPoint=function(e){var n=e.x,r=e.y,i=ui(this.lf.options,["grid","size"]),o=this.lf.graphModel.getPointByClient({x:n,y:r}),a=o.canvasOverlayPosition,s=a.x,l=a.y,u=this.lf.graphModel.editConfigModel.snapGrid;return{x:Fo(s,i,u),y:Fo(l,i,u)}},t.prototype.startDrag=function(e){var n=this.lf.graphModel.editConfigModel;n!=null&&n.isSilentMode||(this.nodeConfig=e,window.document.addEventListener("mouseup",this.stopDrag))},t.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},t}();function W4(t,e){t.on("node:mousemove",function(n){var r=n.data;e.setNodeSnapLine(r)}),t.on("node:mouseup",function(){e.clearSnapline()})}var U4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ri=function(){return ri=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ri.apply(this,arguments)},V4=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},X4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},G4=function(t){U4(e,t);function e(n){var r=t.call(this,n)||this;return r.ref=pl(),r.__prevText={type:"",text:"",id:""},r.keyupHandler=function(i){var o=r.props.graphModel.textEditElement;i.key==="Enter"&&i.altKey&&(o==null||o.setElementState(lt.DEFAULT))},r.inputHandler=function(i){var o=i.target.innerText,a=r.props.graphModel.textEditElement;a&&(r.__prevText={type:a.type,text:o.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},r.keydownHandler=function(i){i.stopPropagation()},r.state={style:{left:0,top:0}},r}return e.getDerivedStateFromProps=function(n){var r,i=n.textEditElement,o=n.graphModel,a=o.transformModel,s=o.theme,l=s.inputText,u;if(i){if(!(!((r=i.text)===null||r===void 0)&&r.value)&&i.BaseType===Lt.EDGE){var c=i.text,d=i.textPosition,f=d.x,h=d.y;c.x=f,c.y=h,i.setText(c)}var v={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(i.BaseType===Lt.EDGE){var g=s.edgeText,m=g.overflowMode,y=g.lineHeight,x=g.wrapPadding,E=g.textWidth;E&&m==="autoWrap"&&(u=ri(ri({},v),{width:E,minWidth:E,lineHeight:y,padding:x}))}else if(i.BaseType===Lt.NODE){var b=s.nodeText,m=b.overflowMode,y=b.lineHeight,x=b.wrapPadding,E=b.textWidth,T=i.width,A=i.modelType,S=i.textWidth,M=S||E||T;(A!==Ye.TEXT_NODE&&m==="autoWrap"||A===Ye.TEXT_NODE&&E)&&(u=ri(ri({},v),{width:M,minWidth:M,lineHeight:y,padding:x}))}var C=i.text,G=C.x,K=C.y,J=X4(a.CanvasPointToHtmlPoint([G,K]),2),R=J[0],k=J[1];return{style:ri(ri({left:R,top:k},u),l)}}return null},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var r=this.__prevText,i=r.text,o=r.id;n.updateText(o,i),n.eventCenter.emit(be.TEXT_UPDATE,{data:ri({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.prototype.placeCaretAtEnd=function(n){if(window.getSelection!==void 0&&document.createRange!==void 0){var r=document.createRange();r.selectNodeContents(n),r.collapse(!1);var i=window.getSelection();i==null||i.removeAllRanges(),i==null||i.addRange(r)}},e.prototype.render=function(){var n,r=this.props.graphModel.textEditElement,i=this.state.style;return r?V("div",{contentEditable:!0,className:"lf-text-input",style:i,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:(n=r.text)===null||n===void 0?void 0:n.value},r.id):null},e.toolName="text-edit-tool",e=V4([vn],e),e}(Qe),Y4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K4=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Kf=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},q4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Z4=function(t){Y4(e,t);function e(n){var r=t.call(this,n)||this;r.handleMouseDown=function(s){r.stepDrag.handleMouseDown(s)},r.handleWheelEvent=function(s){var l,u;s.preventDefault();var c=s.deltaX,d=s.deltaY,f=s.clientX,h=s.clientY,v=s.ctrlKey,g=new WheelEvent("wheel",{deltaX:c,deltaY:d,clientX:f,clientY:h,ctrlKey:v});(u=(l=r.props.lf.container)===null||l===void 0?void 0:l.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||u===void 0||u.dispatchEvent(g)},r.onDragging=function(s){var l=s.deltaX,u=s.deltaY,c=r.props,d=c.graphModel,f=c.lf,h=f.getTransform(),v=h.SCALE_X,g=h.SCALE_Y,m=d.getSelectElements(!0);d.moveNodes(m.nodes.map(function(y){return y.id}),l/v,u/g)},r.handleContextMenu=function(s){s.preventDefault();var l=r.props,u=l.graphModel,c=l.graphModel,d=c.eventCenter,f=c.selectElements,h=u.getPointByClient({x:s.clientX,y:s.clientY}),v={nodes:[],edges:[]},g=q4([],Kf(f.values()),!1);g.forEach(function(m){m.BaseType===Lt.NODE&&v.nodes.push(m.getData()),m.BaseType===Lt.EDGE&&v.edges.push(m.getData())}),d.emit(be.SELECTION_CONTEXTMENU,{data:v,e:s,position:h})};var i=n.graphModel,o=i.gridSize,a=i.eventCenter;return r.stepDrag=new tr({onDragging:r.onDragging,step:o,eventType:"SELECTION",eventCenter:a}),r}return e.prototype.render=function(){var n,r,i=this.props.graphModel,o=i.selectElements,a=i.transformModel,s=this.props.lf.getTransform(),l=s.SCALE_X,u=s.SCALE_Y;if(!(o.size<=1)){var c=Number.MAX_SAFE_INTEGER,d=Number.MAX_SAFE_INTEGER,f=Number.MIN_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER;o.forEach(function(g){var m;g.BaseType===Lt.NODE&&(m=kB(g)),g.BaseType===Lt.EDGE&&(m=$B(g)),m!==void 0&&(c=Math.min(c,m.x),d=Math.min(d,m.y),f=Math.max(f,m.x1),h=Math.max(h,m.y1))}),n=Kf(a.CanvasPointToHtmlPoint([c,d]),2),c=n[0],d=n[1],r=Kf(a.CanvasPointToHtmlPoint([f,h]),2),f=r[0],h=r[1];var v={left:"".concat(c-20*l/2,"px"),top:"".concat(d-20*u/2,"px"),width:"".concat(f-c+20*l,"px"),height:"".concat(h-d+20*u,"px"),"border-width":"".concat(2*l,"px")};return V("div",{className:"lf-multiple-select",style:v,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},e.toolName="multiple-select-tool",e=K4([vn],e),e}(Qe),qf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},J4=[G4,Z4],Q4=function(){function t(e){var n=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,gt(J4,function(o){n.isDisabled(o.toolName)||n.registerTool(o.toolName,o)});var r=e.graphModel,i=r.eventCenter;i.on("".concat(be.GRAPH_TRANSFORM,",").concat(be.NODE_CLICK,",").concat(be.BLANK_CLICK," "),function(){var o,a=r.textEditElement,s=r.editConfigModel,l=s.edgeTextEdit,u=s.nodeTextEdit;(l||u)&&a&&((o=r.textEditElement)===null||o===void 0||o.setElementState(lt.DEFAULT))})}return t.prototype.isDisabled=function(e){var n;return((n=this.instance.options.disabledTools)===null||n===void 0?void 0:n.indexOf(e))!==-1},t.prototype.registerTool=function(e,n){this.toolMap.set(e,n)},t.prototype.disableTool=function(e){var n=this.toolMap.get(e);if(n)return this.disabledToolMap.set(e,n),this.toolMap.delete(e),!0;throw new Error("禁用失败,不存在名为 ".concat(n," 的工具"))},t.prototype.enableTool=function(e){var n=this.disabledToolMap.get(e);if(n)return this.toolMap.set(e,n),this.disabledToolMap.delete(e),!0;throw new Error("不存在名为 ".concat(n," 的工具"))},t.prototype.getTools=function(){return Array.from(this.toolMap.values())},t.prototype.getInstance=function(){return this.instance},t.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},qf([X],t.prototype,"toolMap",void 0),qf([U],t.prototype,"disableTool",null),qf([U],t.prototype,"enableTool",null),t}();function e8(t){throw new Error("[mobx-utils] "+t)}function gu(t,e){e===void 0&&(e="Illegal state"),t||e8(e)}var Ob=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(Ob(Object.getPrototypeOf(t))||[])},t8=function(t){var e=Ob(t),n=e.filter(function(r,i){return e.indexOf(r)===i});return n},n8=function(t){return t8(t).filter(function(e){return e!=="constructor"&&!~e.indexOf("__")})},Tb="pending",vu="fulfilled",Zf="rejected";function r8(t){switch(this.state){case Tb:return t.pending&&t.pending(this.value);case Zf:return t.rejected&&t.rejected(this.value);case vu:return t.fulfilled?t.fulfilled(this.value):this.value}}function Nb(t,e){if(gu(arguments.length<=2,"fromPromise expects up to two arguments"),gu(typeof t=="function"||typeof t=="object"&&t&&typeof t.then=="function","Please pass a promise or function to fromPromise"),t.isPromiseBasedObservable===!0)return t;typeof t=="function"&&(t=new Promise(t));var n=t;t.then(U("observableFromPromise-resolve",function(i){n.value=i,n.state=vu}),U("observableFromPromise-reject",function(i){n.value=i,n.state=Zf})),n.isPromiseBasedObservable=!0,n.case=r8;var r=e&&e.state===vu?e.value:void 0;return Zd(n,{value:r,state:Tb},{},{deep:!1}),n}(function(t){t.reject=U("fromPromise.reject",function(n){var r=t(Promise.reject(n));return r.state=Zf,r.value=n,r});function e(n){n===void 0&&(n=void 0);var r=t(Promise.resolve(n));return r.state=vu,r.value=n,r}t.resolve=U("fromPromise.resolve",e)})(Nb||(Nb={}));var mu=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};(function(){function t(e,n){var r=this;Pk(function(){r.current=n,r.subscription=e.subscribe(r)})}return t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(e){this.current=e},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(e){this.current=e,this.dispose()},mu([X.ref],t.prototype,"current",void 0),mu([U.bound],t.prototype,"next",null),mu([U.bound],t.prototype,"complete",null),mu([U.bound],t.prototype,"error",null),t})();var yu=function(){return yu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},yu.apply(this,arguments)},as=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},i8=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function t(e){var n=this;this.model=e,this.localValues=X.map({}),this.localComputedValues=X.map({}),this.isPropertyDirty=function(r){return n.localValues.has(r)},gu(xr(e),"createViewModel expects an observable object"),n8(e).forEach(function(r){if(!(r===ke||r==="__mobxDidRunLazyInitializers")){if(gu(i8.indexOf(r)===-1,"The propertyname "+r+" is reserved and cannot be used with viewModels"),By(e,r)){var i=Ll(e,r).derivation;n.localComputedValues.set(r,Et(i.bind(n)))}var o=Object.getOwnPropertyDescriptor(e,r),a=o?{enumerable:o.enumerable}:{};Object.defineProperty(n,r,yu(yu({},a),{configurable:!0,get:function(){return By(e,r)?n.localComputedValues.get(r).get():n.isPropertyDirty(r)?n.localValues.get(r):n.model[r]},set:U(function(s){s!==n.model[r]?n.localValues.set(r,s):n.localValues.delete(r)})}))}})}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var e=this;Io(this.localValues).forEach(function(n){var r=e.localValues.get(n),i=e.model[n];kr(i)?i.replace(r):gn(i)?(i.clear(),i.merge(r)):ky(r)||(e.model[n]=r)}),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(e){this.localValues.delete(e)},as([Et],t.prototype,"isDirty",null),as([Et],t.prototype,"changedValues",null),as([U.bound],t.prototype,"submit",null),as([U.bound],t.prototype,"reset",null),as([U.bound],t.prototype,"resetProperty",null),t})();function Jf(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function Qf(t){return xr(t)||kr(t)||gn(t)}function o8(t,e){var n=new WeakMap;function r(s){var l=n.get(s.object);i(s,l),e(s,Jf(l),t)}function i(s,l){switch(s.type){case"add":o(s.newValue,l,s.name);break;case"update":a(s.oldValue),o(s.newValue,l,s.name||""+s.index);break;case"remove":case"delete":a(s.oldValue);break;case"splice":s.removed.map(a),s.added.forEach(function(d,f){return o(d,l,""+(s.index+f))});for(var u=s.index+s.addedCount;u<s.object.length;u++)if(Qf(s.object[u])){var c=n.get(s.object[u]);c&&(c.path=""+u)}break}}function o(s,l,u){if(Qf(s)){var c=n.get(s);if(c){if(c.parent!==l||c.path!==u)throw new Error("The same observable object cannot appear twice in the same tree,"+(" trying to assign it to '"+Jf(l)+"/"+u+"',")+(" but it already exists at '"+Jf(c.parent)+"/"+c.path+"'"))}else{var d={parent:l,path:u,dispose:jy(s,r)};n.set(s,d),zk(s).forEach(function(f){var h=f[0],v=f[1];return o(v,d,h)})}}}function a(s){if(Qf(s)){var l=n.get(s);if(!l)return;n.delete(s),l.dispose(),Hk(s).forEach(a)}}return o(t,void 0,""),function(){a(t)}}var a8=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){a8(e,t);function e(n,r,i){var o=i===void 0?{}:i,a=o.name,s=a===void 0?"ogm"+(Math.random()*1e3|0):a,l=o.keyToName,u=l===void 0?function(f){return""+f}:l,c=t.call(this)||this;c._keyToName=u,c._groupBy=r,c._ogmInfoKey=Symbol("ogmInfo"+s),c._base=n;for(var d=0;d<n.length;d++)c._addItem(n[d]);return c._disposeBaseObserver=jy(c._base,function(f){if(f.type==="splice")yr(function(){for(var h=0,v=f.removed;h<v.length;h++){var g=v[h];c._removeItem(g)}for(var m=0,y=f.added;m<y.length;m++){var x=y[m];c._addItem(x)}});else if(f.type==="update")yr(function(){c._removeItem(f.oldValue),c._addItem(f.newValue)});else throw new Error("illegal state")}),c}return e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(n){throw new Error("not supported")},e.prototype.set=function(n,r){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var n=0;n<this._base.length;n++){var r=this._base[n],i=r[this._ogmInfoKey];i.reaction(),delete r[this._ogmInfoKey]}},e.prototype._getGroupArr=function(n){var r=t.prototype.get.call(this,n);return r===void 0&&(r=X([],{name:"GroupArray["+this._keyToName(n)+"]",deep:!1}),t.prototype.set.call(this,n,r)),r},e.prototype._removeFromGroupArr=function(n,r){var i=t.prototype.get.call(this,n);i.length===1?t.prototype.delete.call(this,n):(r===i.length-1||(i[r]=i[i.length-1],i[r][this._ogmInfoKey].groupArrIndex=r),i.length--)},e.prototype._addItem=function(n){var r=this,i=this._groupBy(n),o=this._getGroupArr(i),a={groupByValue:i,groupArrIndex:o.length,reaction:Ny(function(){return r._groupBy(n)},function(s,l){var u=n[r._ogmInfoKey];r._removeFromGroupArr(u.groupByValue,u.groupArrIndex);var c=r._getGroupArr(s),d=c.length;c.push(n),u.groupByValue=s,u.groupArrIndex=d})};Object.defineProperty(n,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:a}),o.push(n)},e.prototype._removeItem=function(n){var r=n[this._ogmInfoKey];this._removeFromGroupArr(r.groupByValue,r.groupArrIndex),r.reaction(),delete n[this._ogmInfoKey]},e})(Qd),Promise.resolve(),typeof queueMicrotask<"u"||typeof process<"u"&&process.nextTick;var ep=function(){return ep=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ep.apply(this,arguments)},s8=function(){function t(e){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=e}return t.prototype.add=function(e){Qc(kn(this.undos),e)||(this.undos.push(e),Qc(this.curData,e)||(this.redos=[]),this.eventCenter.emit(be.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},t.prototype.undoAble=function(){return this.undos.length>1},t.prototype.undo=function(){if(this.undoAble()){var e=this.undos.pop();this.redos.push(e);var n=this.undos.pop();return this.curData=Pe(n),n}},t.prototype.redoAble=function(){return this.redos.length>0},t.prototype.redo=function(){if(this.redoAble()){var e=this.redos.pop();return this.curData=Pe(e),e}},t.prototype.watch=function(e){var n=this;this.stopWatch&&this.stopWatch(),this.undos.push(e.modelToGraphData()),this.stopWatch=o8(e,Us(function(){var r=e.modelToHistoryData();r&&n.add(ep({},r))},this.waitTime))},t.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},t}(),tp={exports:{}},Mb;function l8(){return Mb||(Mb=1,function(t){(function(e,n,r){if(!e)return;for(var i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,u=1;u<20;++u)i[111+u]="f"+u;for(u=0;u<=9;++u)i[u+96]=u.toString();function c(S,M,C){if(S.addEventListener){S.addEventListener(M,C,!1);return}S.attachEvent("on"+M,C)}function d(S){if(S.type=="keypress"){var M=String.fromCharCode(S.which);return S.shiftKey||(M=M.toLowerCase()),M}return i[S.which]?i[S.which]:o[S.which]?o[S.which]:String.fromCharCode(S.which).toLowerCase()}function f(S,M){return S.sort().join(",")===M.sort().join(",")}function h(S){var M=[];return S.shiftKey&&M.push("shift"),S.altKey&&M.push("alt"),S.ctrlKey&&M.push("ctrl"),S.metaKey&&M.push("meta"),M}function v(S){if(S.preventDefault){S.preventDefault();return}S.returnValue=!1}function g(S){if(S.stopPropagation){S.stopPropagation();return}S.cancelBubble=!0}function m(S){return S=="shift"||S=="ctrl"||S=="alt"||S=="meta"}function y(){if(!l){l={};for(var S in i)S>95&&S<112||i.hasOwnProperty(S)&&(l[i[S]]=S)}return l}function x(S,M,C){return C||(C=y()[S]?"keydown":"keypress"),C=="keypress"&&M.length&&(C="keydown"),C}function E(S){return S==="+"?["+"]:(S=S.replace(/\+{2}/g,"+plus"),S.split("+"))}function b(S,M){var C,G,K,J=[];for(C=E(S),K=0;K<C.length;++K)G=C[K],s[G]&&(G=s[G]),M&&M!="keypress"&&a[G]&&(G=a[G],J.push("shift")),m(G)&&J.push(G);return M=x(G,J,M),{key:G,modifiers:J,action:M}}function T(S,M){return S===null||S===n?!1:S===M?!0:T(S.parentNode,M)}function A(S){var M=this;if(S=S||n,!(M instanceof A))return new A(S);M.target=S,M._callbacks={},M._directMap={};var C={},G,K=!1,J=!1,R=!1;function k(de){de=de||{};var Se=!1,je;for(je in C){if(de[je]){Se=!0;continue}C[je]=0}Se||(R=!1)}function B(de,Se,je,he,Ve,$){var w,_,F=[],L=je.type;if(!M._callbacks[de])return[];for(L=="keyup"&&m(de)&&(Se=[de]),w=0;w<M._callbacks[de].length;++w)if(_=M._callbacks[de][w],!(!he&&_.seq&&C[_.seq]!=_.level)&&L==_.action&&(L=="keypress"&&!je.metaKey&&!je.ctrlKey||f(Se,_.modifiers))){var se=!he&&_.combo==Ve,fe=he&&_.seq==he&&_.level==$;(se||fe)&&M._callbacks[de].splice(w,1),F.push(_)}return F}function Z(de,Se,je,he){M.stopCallback(Se,Se.target||Se.srcElement,je,he)||de(Se,je)===!1&&(v(Se),g(Se))}M._handleKey=function(de,Se,je){var he=B(de,Se,je),Ve,$={},w=0,_=!1;for(Ve=0;Ve<he.length;++Ve)he[Ve].seq&&(w=Math.max(w,he[Ve].level));for(Ve=0;Ve<he.length;++Ve){if(he[Ve].seq){if(he[Ve].level!=w)continue;_=!0,$[he[Ve].seq]=1,Z(he[Ve].callback,je,he[Ve].combo,he[Ve].seq);continue}_||Z(he[Ve].callback,je,he[Ve].combo)}var F=je.type=="keypress"&&J;je.type==R&&!m(de)&&!F&&k($),J=_&&je.type=="keydown"};function ee(de){typeof de.which!="number"&&(de.which=de.keyCode);var Se=d(de);if(Se){if(de.type=="keyup"&&K===Se){K=!1;return}M.handleKey(Se,h(de),de)}}function ce(){clearTimeout(G),G=setTimeout(k,1e3)}function Be(de,Se,je,he){C[de]=0;function Ve(L){return function(){R=L,++C[de],ce()}}function $(L){Z(je,L,de),he!=="keyup"&&(K=d(L)),setTimeout(k,10)}for(var w=0;w<Se.length;++w){var _=w+1===Se.length,F=_?$:Ve(he||b(Se[w+1]).action);me(Se[w],F,he,de,w)}}function me(de,Se,je,he,Ve){M._directMap[de+":"+je]=Se,de=de.replace(/\s+/g," ");var $=de.split(" "),w;if($.length>1){Be(de,$,Se,je);return}w=b(de,je),M._callbacks[w.key]=M._callbacks[w.key]||[],B(w.key,w.modifiers,{type:w.action},he,de,Ve),M._callbacks[w.key][he?"unshift":"push"]({callback:Se,modifiers:w.modifiers,action:w.action,seq:he,level:Ve,combo:de})}M._bindMultiple=function(de,Se,je){for(var he=0;he<de.length;++he)me(de[he],Se,je)},c(S,"keypress",ee),c(S,"keydown",ee),c(S,"keyup",ee)}A.prototype.bind=function(S,M,C){var G=this;return S=S instanceof Array?S:[S],G._bindMultiple.call(G,S,M,C),G},A.prototype.unbind=function(S,M){var C=this;return C.bind.call(C,S,function(){},M)},A.prototype.trigger=function(S,M){var C=this;return C._directMap[S+":"+M]&&C._directMap[S+":"+M]({},S),C},A.prototype.reset=function(){var S=this;return S._callbacks={},S._directMap={},S},A.prototype.stopCallback=function(S,M){var C=this;if((" "+M.className+" ").indexOf(" mousetrap ")>-1||T(M,C.target))return!1;if("composedPath"in S&&typeof S.composedPath=="function"){var G=S.composedPath()[0];G!==S.target&&(M=G)}return M.tagName=="INPUT"||M.tagName=="SELECT"||M.tagName=="TEXTAREA"||M.isContentEditable},A.prototype.handleKey=function(){var S=this;return S._handleKey.apply(S,arguments)},A.addKeycodes=function(S){for(var M in S)S.hasOwnProperty(M)&&(i[M]=S[M]);l=null},A.init=function(){var S=A(n);for(var M in S)M.charAt(0)!=="_"&&(A[M]=function(C){return function(){return S[C].apply(S,arguments)}}(M))},A.init(),e.Mousetrap=A,t.exports&&(t.exports=A)})(typeof window<"u"?window:null,typeof window<"u"?document:null)}(tp)),tp.exports}var u8=l8();const c8=ul(u8);var Db=function(){return Db=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Db.apply(this,arguments)},$r=null;function Pb(t,e){var n,r;return t.x+=e,t.y+=e,Js(t.text)||(t.text.x+=e,t.text.y+=e),Js((n=t.properties)===null||n===void 0?void 0:n._label)||(r=t.properties)===null||r===void 0||r._label.forEach(function(i){i.x+=e,i.y+=e}),t}function Rb(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach(function(n){n.x+=e,n.y+=e}),Js(t.text)||(t.text.x+=e,t.text.y+=e),t}var Yo=40,_u=40;function d8(t,e){var n=t.keyboard,r=n.options.keyboard;n.on(["cmd + c","ctrl + c"],function(){if(_u=Yo,!(r!=null&&r.enabled)||e.textEditElement)return!0;var i=t.options.guards,o=e.getSelectElements(!1),a=i&&i.beforeClone?i.beforeClone(o):!0;return!a||o.nodes.length===0&&o.edges.length===0?($r=null,!0):($r=o,$r.nodes.forEach(function(s){return Pb(s,Yo)}),$r.edges.forEach(function(s){return Rb(s,Yo)}),!1)}),n.on(["cmd + v","ctrl + v"],function(){if(!(r!=null&&r.enabled)||e.textEditElement)return!0;if($r&&($r.nodes||$r.edges)){t.clearSelectElements();var i=t.addElements($r,_u);if(!i)return!0;i.nodes.forEach(function(o){return t.selectElementById(o.id,!0)}),i.edges.forEach(function(o){return t.selectElementById(o.id,!0)}),$r.nodes.forEach(function(o){return Pb(o,Yo)}),$r.edges.forEach(function(o){return Rb(o,Yo)}),_u=_u+Yo}return!1}),n.on(["cmd + z","ctrl + z"],function(){return!(r!=null&&r.enabled)||e.textEditElement?!0:(t.undo(),!1)}),n.on(["cmd + y","ctrl + y"],function(){return!(r!=null&&r.enabled)||e.textEditElement?!0:(t.redo(),!1)}),n.on(["backspace"],function(){if(!(r!=null&&r.enabled)||e.textEditElement)return!0;var i=e.getSelectElements(!0);return t.clearSelectElements(),i.edges.forEach(function(o){return o.id&&t.deleteEdge(o.id)}),i.nodes.forEach(function(o){return o.id&&t.deleteNode(o.id)}),!1})}var f8=function(){function t(e){e.keyboard||(e.keyboard={enabled:!1}),this.options=e;var n=e.lf;this.target=n.container,this.mousetrap=new c8(this.target),e.keyboard.enabled&&!n.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var e=this,n,r=((n=this.options.keyboard)!==null&&n!==void 0?n:{}).shortcuts;if(r)if(We(r))r.forEach(function(s){var l=s.keys,u=s.callback,c=s.action;return e.on(l,u,c)});else{var i=r.keys,o=r.callback,a=r.action;this.on(i,o,a)}},t.prototype.on=function(e,n,r){this.mousetrap.bind(this.getKeys(e),n,r)},Object.defineProperty(t.prototype,"disabled",{get:function(){var e,n;return((n=(e=this.options)===null||e===void 0?void 0:e.keyboard)===null||n===void 0?void 0:n.enabled)!==!0},enumerable:!1,configurable:!0}),t.prototype.off=function(e,n){this.mousetrap.unbind(this.getKeys(e),n)},t.prototype.enable=function(e){(this.disabled||e)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.destroy=function(){this.mousetrap.reset()},t.prototype.getKeys=function(e){var n=this;return(Array.isArray(e)?e:[e]).map(function(r){return n.formatKey(r)})},t.prototype.formatKey=function(e){return e.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t}(),Ni=function(){return Ni=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ni.apply(this,arguments)},bu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},np=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},rp=Symbol("plugin registered by Logicflow.use"),ip=function(){function t(e){var n=this,r;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(u,c){return n.viewMap.set(u,c)},this.getView=function(u){return n.viewMap.get(u)};var i=Da.get(e),o=i.container,a=i.width,s=i.height;this.options=i,this.container=this.initContainer(o,a,s),this.graphModel=new n4(Ni(Ni({},i),{container:this.container})),this.plugins=(r=i.plugins)!==null&&r!==void 0?r:[];var l=this.graphModel.eventCenter;this.tool=new Q4(this),this.dnd=new z4({lf:this}),this.history=new s8(l),this.keyboard=new f8({lf:this,keyboard:i.keyboard}),i.snapline!==!1&&(this.snaplineModel=new r4(this.graphModel,i.snaplineEpsilon),W4(l,this.snaplineModel)),i.isSilentMode||(d8(this,this.graphModel),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(i.disabledPlugins)}return t.prototype.initContainer=function(e,n,r){var i=document.createElement("div");return i.style.position="relative",i.style.width=n?"".concat(n,"px"):"100%",i.style.height=r?"".concat(r,"px"):"100%",e.innerHTML="",e.appendChild(i),i},Object.defineProperty(t.prototype,Symbol.toStringTag,{get:function(){return t.toStringTag},enumerable:!1,configurable:!0}),t.prototype.register=function(e,n,r){if(r===void 0&&(r=!0),typeof e!="string"){this.registerElement(e);return}var i={BaseEdge:hu,BaseEdgeModel:eu,BaseNode:Ti,BaseNodeModel:Ci,RectNode:Ji,RectNodeModel:Uo,CircleNode:du,CircleNodeModel:tu,PolygonNode:pu,PolygonNodeModel:au,TextNode:wb,TextNodeModel:yb,LineEdge:Ab,LineEdgeModel:hb,DiamondNode:Hf,DiamondNodeModel:Nf,PolylineEdge:os,PolylineEdgeModel:Ya,BezierEdge:Cb,BezierEdgeModel:fb,EllipseNode:Wf,EllipseNodeModel:Mf,HtmlNode:Vf,HtmlNodeModel:Df,h:Te,type:e};if(this.viewMap.forEach(function(u){var c=u.extendKey;c&&(i[c]=u)}),this.graphModel.modelMap.forEach(function(u){var c=u.extendKey;c&&(i[c]=u)}),n){var o=n(i),a=o.view,s=o.model,l=a;r&&!l.isObserved&&(l.isObserved=!0,l=vn(l)),this.setView(e,l),this.graphModel.setModel(e,s)}},t.prototype.registerElement=function(e){var n=e.view;e.isObserverView!==!1&&!n.isObserved&&(n.isObserved=!0,n=vn(n)),this.setView(e.type,n),this.graphModel.setModel(e.type,e.model)},t.prototype.batchRegister=function(e){var n=this;e===void 0&&(e=[]),gt(e,function(r){n.registerElement(r)})},t.prototype.defaultRegister=function(){var e=[{type:"rect",view:Ji,model:Uo},{type:"circle",view:du,model:tu},{type:"polygon",view:pu,model:au},{type:"text",view:wb,model:yb},{type:"ellipse",view:Wf,model:Mf},{type:"diamond",view:Hf,model:Nf},{type:"html",view:Vf,model:Df},{type:"line",view:Ab,model:hb},{type:"polyline",view:os,model:Ya},{type:"bezier",view:Cb,model:fb}];this.batchRegister(e)},t.prototype.addNode=function(e,n,r){return n===void 0&&(n=be.NODE_ADD),this.graphModel.addNode(e,n,r)},t.prototype.deleteNode=function(e){var n=this.graphModel.getNodeModelById(e);if(!n)return!1;var r=n.getData(),i=this.options.guards,o=i!=null&&i.beforeDelete?i.beforeDelete(r):!0;return o&&this.graphModel.deleteNode(e),o},t.prototype.cloneNode=function(e){var n=this.graphModel.getNodeModelById(e),r=n==null?void 0:n.getData();if(r){var i=this.options.guards,o=i!=null&&i.beforeClone?i.beforeClone(r):!0;if(o)return this.graphModel.cloneNode(e)}},t.prototype.changeNodeId=function(e,n){return this.graphModel.changeNodeId(e,n)},t.prototype.changeNodeType=function(e,n){this.graphModel.changeNodeType(e,n)},t.prototype.getNodeModelById=function(e){return this.graphModel.getNodeModelById(e)},t.prototype.getNodeDataById=function(e){var n=this.getNodeModelById(e);return n==null?void 0:n.getData()},t.prototype.getNodeIncomingEdge=function(e){return this.graphModel.getNodeIncomingEdge(e)},t.prototype.getNodeOutgoingEdge=function(e){return this.graphModel.getNodeOutgoingEdge(e)},t.prototype.getNodeIncomingNode=function(e){return this.graphModel.getNodeIncomingNode(e)},t.prototype.getNodeOutgoingNode=function(e){return this.graphModel.getNodeOutgoingNode(e)},t.prototype.createFakeNode=function(e){var n=this.graphModel.modelMap.get(e.type);if(!n)return console.warn("不存在为".concat(e.type,"类型的节点")),null;var r=new n(Ni(Ni({},e),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(r),r},t.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},t.prototype.setNodeSnapLine=function(e){var n;(n=this.snaplineModel)===null||n===void 0||n.setNodeSnapLine(e)},t.prototype.removeNodeSnapLine=function(){var e;(e=this.snaplineModel)===null||e===void 0||e.clearSnapline()},t.prototype.setDefaultEdgeType=function(e){this.graphModel.setDefaultEdgeType(e)},t.prototype.addEdge=function(e){return this.graphModel.addEdge(e)},t.prototype.getEdgeDataById=function(e){var n=this.getEdgeModelById(e);return n==null?void 0:n.getData()},t.prototype.getEdgeModelById=function(e){return this.graphModel.getEdgeModelById(e)},t.prototype.getEdgeModels=function(e){var n=e.sourceNodeId,r=e.targetNodeId,i=[],o=this.graphModel.edges;return n&&r?gt(o,function(a){a.sourceNodeId===n&&a.targetNodeId===r&&i.push(a)}):n?gt(o,function(a){a.sourceNodeId===n&&i.push(a)}):r&>(o,function(a){a.targetNodeId===r&&i.push(a)}),i},t.prototype.changeEdgeId=function(e,n){return this.graphModel.changeEdgeId(e,n)},t.prototype.changeEdgeType=function(e,n){this.graphModel.changeEdgeType(e,n)},t.prototype.deleteEdge=function(e){var n=this.graphModel.getEdgeModelById(e);if(!n)return!1;var r=n.getData(),i=this.options.guards,o=i!=null&&i.beforeDelete?i.beforeDelete(r):!0;return o&&this.graphModel.deleteEdgeById(e),o},t.prototype.deleteEdgeByNodeId=function(e){var n=e.sourceNodeId,r=e.targetNodeId;n&&r?this.graphModel.deleteEdgeBySourceAndTarget(n,r):n?this.graphModel.deleteEdgeBySource(n):r&&this.graphModel.deleteEdgeByTarget(r)},t.prototype.getNodeEdges=function(e){return this.graphModel.getNodeEdges(e)},t.prototype.addElements=function(e,n){var r=this,i=e.nodes,o=e.edges;n===void 0&&(n=40),console.log("distance",n);var a={},s={nodes:[],edges:[]};return gt(i,function(l){var u=l.id,c=r.addNode(l);u&&(a[u]=c.id),s.nodes.push(c)}),gt(o,function(l){var u=l.sourceNodeId,c=l.targetNodeId;a[u]&&(u=a[u]),a[c]&&(c=a[c]);var d=r.graphModel.addEdge(Ni(Ni({},l),{sourceNodeId:u,targetNodeId:c}));s.edges.push(d)}),s},t.prototype.selectElementById=function(e,n,r){n===void 0&&(n=!1),r===void 0&&(r=!0),this.graphModel.selectElementById(e,n),!n&&r&&this.graphModel.toFront(e)},t.prototype.deselectElementById=function(e){this.graphModel.deselectElementById(e)},t.prototype.getSelectElements=function(e){return e===void 0&&(e=!0),this.graphModel.getSelectElements(e)},t.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},t.prototype.getModelById=function(e){return this.graphModel.getElement(e)},t.prototype.getDataById=function(e){var n;return(n=this.graphModel.getElement(e))===null||n===void 0?void 0:n.getData()},t.prototype.deleteElement=function(e){var n,r,i,o=this.getModelById(e);if(!o)return!1;var a=(n={},n[Lt.NODE]=this.deleteNode,n[Lt.EDGE]=this.deleteEdge,n);return(i=(r=a[o.BaseType])===null||r===void 0?void 0:r.call(this,e))!==null&&i!==void 0?i:!1},t.prototype.setElementZIndex=function(e,n){return this.graphModel.setElementZIndex(e,n)},t.prototype.getAreaElement=function(e,n,r,i,o){return r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=!1),this.graphModel.getAreaElement(e,n,r,i,o).map(function(a){return a.getData()})},t.prototype.setProperties=function(e,n){var r;(r=this.graphModel.getElement(e))===null||r===void 0||r.setProperties(sn(n))},t.prototype.getProperties=function(e){var n;return(n=this.graphModel.getElement(e))===null||n===void 0?void 0:n.getProperties()},t.prototype.deleteProperty=function(e,n){var r;(r=this.graphModel.getElement(e))===null||r===void 0||r.deleteProperty(n)},t.prototype.updateAttributes=function(e,n){this.graphModel.updateAttributes(e,n)},t.prototype.editText=function(e){this.graphModel.editText(e)},t.prototype.updateText=function(e,n){this.graphModel.updateText(e,n)},t.prototype.updateEditConfig=function(e){var n=this.graphModel,r=n.editConfigModel,i=n.transformModel,o=r.snapGrid;if(r.updateEditConfig(e),(e==null?void 0:e.stopMoveGraph)!==void 0&&i.updateTranslateLimits(e.stopMoveGraph),e!=null&&e.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0),!pn(e==null?void 0:e.snapGrid)&&e.snapGrid!==o){var a=this.graphModel.grid.size,s=a===void 0?1:a;this.graphModel.updateGridSize(e.snapGrid?s:1)}this.emit(be.EDIT_CONFIG_CHANGED,{data:r.getConfig()})},t.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},t.prototype.setTheme=function(e,n){this.graphModel.setTheme(e,n)},t.prototype.getTheme=function(){return this.graphModel.getTheme()},t.prototype.focusByElement=function(e){var n=void 0,r=this.getNodeModelById(e);if(r){var i=r.getData(),o=i.x,a=i.y;n={x:o,y:a}}var s=this.getEdgeModelById(e);if(s){var l=s.textPosition,o=l.x,a=l.y;n={x:o,y:a}}n&&this.focusByCoordinate(n)},t.prototype.focusByCoordinate=function(e){var n=this.graphModel,r=n.transformModel,i=n.width,o=n.height,a=e.x,s=e.y;r.focusOn(a,s,i,o)},t.prototype.focusOn=function(e){if(typeof e=="string")this.focusByElement(e);else if("x"in e&&"y"in e)this.focusByCoordinate(e);else{var n=e.id,r=e.coordinate;n&&this.focusByElement(n),r&&this.focusByCoordinate(r)}},t.prototype.resize=function(e,n){this.graphModel.resize(e,n),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},t.prototype.toFront=function(e){this.graphModel.toFront(e)},t.prototype.getPointByClient=function(e,n){if(typeof e=="object")return this.graphModel.getPointByClient(e);if(typeof n=="number")return this.graphModel.getPointByClient({x:e,y:n})},t.prototype.getGraphData=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,np([r],bu(e),!1)):r},t.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},t.prototype.clearData=function(){this.graphModel.clearData(),this.render({})},t.prototype.setOverlapMode=function(e){this.graphModel.setOverlapMode(e)},t.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(sn(e)),this.options.history!==!1&&this.history.watch(this.graphModel),A_(V(l4,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(be.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},t.prototype.render=function(e){var n=Pe(e);this.adapterIn&&(n=this.adapterIn(n)),this.renderRawData(n)},t.prototype.undo=function(){if(this.history.undoAble()){var e=sn(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.redo=function(){if(this.history.redoAble()){var e=sn(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.zoom=function(e,n){var r=this.graphModel.transformModel;return r.zoom(e,n)},t.prototype.resetZoom=function(){var e=this.graphModel.transformModel;e.resetZoom()},t.prototype.setZoomMiniSize=function(e){var n=this.graphModel.transformModel;n.setZoomMiniSize(e)},t.prototype.setZoomMaxSize=function(e){var n=this.graphModel.transformModel;n.setZoomMaxSize(e)},t.prototype.getTransform=function(){var e=this.graphModel.transformModel,n=e.SCALE_X,r=e.SCALE_Y,i=e.TRANSLATE_X,o=e.TRANSLATE_Y;return{SCALE_X:n,SCALE_Y:r,TRANSLATE_X:i,TRANSLATE_Y:o}},t.prototype.translate=function(e,n){var r=this.graphModel.transformModel;r.translate(e,n)},t.prototype.resetTranslate=function(){var e=this.graphModel.transformModel,n=e.TRANSLATE_X,r=e.TRANSLATE_Y;this.translate(-n,-r)},t.prototype.translateCenter=function(){this.graphModel.translateCenter()},t.prototype.fitView=function(e,n){n===void 0&&(n=e),this.graphModel.fitView(e,n)},t.prototype.openEdgeAnimation=function(e){this.graphModel.openEdgeAnimation(e)},t.prototype.closeEdgeAnimation=function(e){this.graphModel.closeEdgeAnimation(e)},t.prototype.on=function(e,n){this.graphModel.eventCenter.on(e,n)},t.prototype.off=function(e,n){this.graphModel.eventCenter.off(e,n)},t.prototype.once=function(e,n){this.graphModel.eventCenter.once(e,n)},t.prototype.emit=function(e,n){this.graphModel.eventCenter.emit(e,n)},t.use=function(e,n){var r,i=e.pluginName;if(!i)throw new Error("请给插件指定 pluginName!");this.extensions.set(i,(r={},r[rp]=rp,r.extension=e,r.props=n,r))},t.addThemeMode=function(e,n){t3(e,n)},t.removeThemeMode=function(e){n3(e)},t.clearThemeMode=function(){r3()},t.prototype.installPlugins=function(e){var n=this;e===void 0&&(e=[]);var r=Array.from(t.extensions,function(o){var a=bu(o,2),s=a[1];return s}),i=np(np([],bu(this.plugins),!1),bu(r),!1);gt(i,function(o){var a,s;rp in o?(a=o.extension,s=o.props):a=o;var l=a==null?void 0:a.pluginName;Pv(e,l)===-1&&n.installPlugin(a,s)})},t.prototype.installPlugin=function(e,n){var r,i;if("pluginName"in e&&"install"in e){var o=e.pluginName,a=e.install,s=e.render;o&&(a&&a.call(e,this,t),s&&this.components.push(s.bind(e)),this.extension[o]=e);return}var l=e,u=l.pluginName,c=new l({lf:this,LogicFlow:t,props:n,options:(i=(r=this.options.pluginsOptions)===null||r===void 0?void 0:r[u])!==null&&i!==void 0?i:{}});c.render&&this.components.push(c.render.bind(c)),this.extension[u]=c},t.prototype.destroy=function(){var e;this.clearData(),A_(null,this.container),this.keyboard.destroy(),this.graphModel.destroy(),this.tool.destroy(),this.history.destroy();for(var n in this.extension){var r=this.extension[n];"destroy"in r&&((e=r.destroy)===null||e===void 0||e.call(r))}},t.extensions=new Map,t}();(function(t){t.toStringTag="LF.".concat(t.name)})(ip||(ip={}));const p8=ip;function vn(t){return rf(t)}var Lb={width:40,height:40},Ib={width:40,height:40},kb={width:40,height:40},Bb={width:100,height:80},jb={width:100,height:80},h8={rect:{radius:5,stroke:"rgb(24, 125, 255)"},circle:{r:18,stroke:"rgb(24, 125, 255)"},polygon:{stroke:"rgb(24, 125, 255)"},polyline:{stroke:"rgb(24, 125, 255)",hoverStroke:"rgb(24, 125, 255)",selectedStroke:"rgb(24, 125, 255)"},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"white",height:14,stroke:"transparent",radius:3}}},g8=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,r=e==="x"?n:n&3|8;return r.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t}(),v8=(globalThis==null?void 0:globalThis._ids)||new g8;function Ko(){return v8.next()}var Fb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),m8=function(t){Fb(e,t);function e(n,r){return n.id||(n.id="Event_".concat(Ko())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var n=t.prototype.getConnectedTargetRules.call(this),r={message:"起始节点不能作为边的终点",validate:function(){return!1}};return n.push(r),n},e.extendKey="StartEventModel",e}(tu),y8=function(t){Fb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="StartEventNode",e}(du),_8={type:"bpmn:startEvent",view:y8,model:m8},$b=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xu=function(){return xu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xu.apply(this,arguments)},b8=function(t){$b(e,t);function e(n,r){return n.id||(n.id="Event_".concat(Ko())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var n=t.prototype.getConnectedSourceRules.call(this),r={message:"结束节点不能作为边的起点",validate:function(){return!1}};return n.push(r),n},e.extendKey="EndEventModel",e}(tu),x8=function(t){$b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle(),i=n,o=i.x,a=i.y,s=i.r,l=t.prototype.getShape.call(this);return Te("g",{},l,Te("circle",xu(xu({},r),{cx:o,cy:a,r:s-5})))},e.extendKey="EndEventView",e}(du),E8={type:"bpmn:endEvent",view:x8,model:b8},Hb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),w8=function(t){Hb(e,t);function e(n,r){return n.id||(n.id="Flow_".concat(Ko())),t.call(this,n,r)||this}return e.extendKey="SequenceFlowModel",e}(Ya),S8=function(t){Hb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="SequenceFlowEdge",e}(os),C8={type:"bpmn:sequenceFlow",view:S8,model:w8},zb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ss=function(){return ss=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ss.apply(this,arguments)},A8=function(t){zb(e,t);function e(n,r){var i=this;return n.id||(n.id="Gateway_".concat(Ko())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),i=t.call(this,n,r)||this,i.points=[[25,0],[50,25],[25,50],[0,25]],i}return e.extendKey="ExclusiveGatewayModel",e}(au),O8=function(t){zb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points,u=n.getNodeStyle();return Te("g",{transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(o-s/2,")")},Te("polygon",ss(ss({},u),{x:i,y:o,points:l})),Te("path",ss({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},u)))},e.extendKey="ExclusiveGatewayNode",e}(pu),T8={type:"bpmn:exclusiveGateway",view:O8,model:A8},Wb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),op=function(){return op=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},op.apply(this,arguments)},N8=function(t){Wb(e,t);function e(n,r){return n.id||(n.id="Activity_".concat(Ko())),t.call(this,n,r)||this}return e.extendKey="ServiceTaskModel",e}(Uo),M8=function(t){Wb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getNodeStyle();return Te("svg",{x:r-o/2+5,y:i-a/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},Te("path",{fill:s.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Te("g",{},[Te("rect",op({x:r-o/2,y:i-a/2,rx:s,ry:s,width:o,height:a},l)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e}(Ji),D8={type:"bpmn:serviceTask",view:M8,model:N8},Ub=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Eu=function(){return Eu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Eu.apply(this,arguments)},P8=function(t){Ub(e,t);function e(n,r){return n.id||(n.id="Activity_".concat(Ko())),t.call(this,n,r)||this}return e.extendKey="UserTaskModel",e}(Uo),R8=function(t){Ub(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getNodeStyle();return Te("svg",{x:r-o/2+5,y:i-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},Te("path",{fill:s.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Te("g",{},[Te("rect",Eu(Eu({},l),{x:r-o/2,y:i-a/2,rx:s,ry:s,width:o,height:a})),this.getLabelShape()])},e.extendKey="UserTaskNode",e}(Ji),L8={type:"bpmn:userTask",view:R8,model:P8},I8={pluginName:"bpmnElement",install:function(t){t.setTheme(h8),t.register(_8),t.register(E8),t.register(T8),t.register(L8),t.register(D8),t.options.customBpmnEdge||(t.register(C8),t.setDefaultEdgeType("bpmn:sequenceFlow"))}},k8=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,r=e==="x"?n:n&3|8;return r.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t}(),B8=(globalThis==null?void 0:globalThis._ids)||new k8;function Vb(){return B8.next()}function Xb(t){return Object.prototype.toString.call(t)}function j8(t){return" ".repeat(t)}function wu(t){var e=t;return Xb(t)==="[object Object]"?(e={},Object.keys(t).forEach(function(n){var r=n;n.charAt(0)==="-"&&(r=n.substring(1)),e[r]=wu(t[n])})):Array.isArray(t)&&(e=[],t.forEach(function(n,r){e[r]=wu(n)})),e}function Su(t){return t==null?"":t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function F8(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(wu(t)).replace(/"/g,"'")}return Su(String(e))}var eo=`
|
|
74
|
+
`;function Cu(t,e,n){var r=j8(n);if(t!==0&&t!==!1&&!t)return eo+r+"<".concat(e," />");var i="";if(e==="#text")return eo+r+Su(String(t));if(e==="#cdata-section")return eo+r+"<![CDATA["+t+"]]>";if(e==="#comment")return eo+r+"<!--"+t+"-->";if("".concat(e).charAt(0)==="-")return" "+e.substring(1)+'="'+F8(t)+'"';if(Array.isArray(t))t.forEach(function(l){i+=Cu(l,e,n+1)});else if(Xb(t)==="[object Object]"){var o=Object.keys(t),a="",s="";i+=(n===0?"":eo+r)+"<"+e,o.forEach(function(l){l.charAt(0)==="-"?a+=Cu(t[l],l,n+1):s+=Cu(t[l],l,n+1)}),i+=a+(s!==""?">".concat(s).concat(eo+r,"</").concat(e,">"):" />")}else i+=eo+r+"<".concat(e,">").concat(Su(String(t)),"</").concat(e,">");return i}function $8(t){var e="";for(var n in t)e+=Cu(t[n],n,0);return e}var mn=function(){};mn.ObjTree=function(){return this},mn.ObjTree.VERSION="0.23",mn.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
|
75
|
+
`,mn.ObjTree.prototype.attr_prefix="-",mn.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},mn.ObjTree.prototype.parseHTTP=function(t,e,n){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody>"u"&&typeof r.postbody>"u"&&typeof r.parameters>"u"?r.method="get":r.method="post"),n){r.asynchronous=!0;var o=this,a=n,s=r.onComplete;r.onComplete=function(c){var d;c&&c.responseXML&&c.responseXML.documentElement&&(d=o.parseDOM(c.responseXML.documentElement)),a(d,c),s&&s(c)}}else r.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){r.uri=t;var u=new HTTP.Request(r);u&&(l=u.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var u=new Ajax.Request(t,r);u&&(l=u.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)},mn.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!=11){var r={};r[t.nodeName]=n,n=r}return n}},mn.ObjTree.prototype.parseElement=function(t){if(t.nodeType!=7){if(t.nodeType==3||t.nodeType==4||t.nodeType==8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,r={};if(t.attributes&&t.attributes.length){n={};for(var i=0;i<t.attributes.length;i++){var o=t.attributes[i].nodeName;if(typeof o=="string"){var a=t.attributes[i].nodeValue;try{a=JSON.parse(t.attributes[i].nodeValue.replace(/'/g,'"'))}catch{a=t.attributes[i].nodeValue}a&&(o=this.attr_prefix+o,typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var i=0;i<t.childNodes.length&&s;i++){var l=t.childNodes[i].nodeType;l==3||l==4||l==8||(s=!1)}if(s){n||(n="");for(var i=0;i<t.childNodes.length;i++)n+=t.childNodes[i].nodeValue}else{n||(n={});for(var i=0;i<t.childNodes.length;i++){var o=t.childNodes[i].nodeName;if(typeof o=="string"){var a=this.parseElement(t.childNodes[i]);a&&(typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],a))}}}}else n===null&&(n={});return n}},mn.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(n==1&&(t[e]=[]),t[e][t[e].length]=r):n==1?t[e]=r:n==2?t[e]=[t[e],r]:t[e][t[e].length]=r},mn.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},mn.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];i.charAt(0)!=this.attr_prefix?typeof o>"u"||o==null?n[n.length]="<"+i+" />":typeof o=="object"&&o.constructor==Array?n[n.length]=this.array_to_xml(i,o):typeof o=="object"?n[n.length]=this.hash_to_xml(i,o):n[n.length]=this.scalar_to_xml(i,o):r[r.length]=" "+i.substring(1)+'="'+this.xml_escape(o)+'"'}var a=r.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<"+t+a+`>
|
|
76
|
+
`+s+"</"+t+`>
|
|
77
|
+
`:s="<"+t+a+">"+s+"</"+t+`>
|
|
78
|
+
`:s="<"+t+a+` />
|
|
79
|
+
`),s},mn.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];typeof i>"u"||i==null?n[n.length]="<"+t+" />":typeof i=="object"&&i.constructor==Array?n[n.length]=this.array_to_xml(t,i):typeof i=="object"?n[n.length]=this.hash_to_xml(t,i):n[n.length]=this.scalar_to_xml(t,i)}return n.join("")},mn.ObjTree.prototype.scalar_to_xml=function(t,e){return t=="#text"?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+`>
|
|
80
|
+
`},mn.ObjTree.prototype.xml_escape=Su;var H8=function(t){return new mn.ObjTree().parseXML(t)},z8=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ap=function(){return ap=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ap.apply(this,arguments)},Au=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Hr;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"})(Hr||(Hr={}));var Gb=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],Yb=["properties","startPoint","endPoint","pointsList"],Kb=function(t){return String(t||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")};function qb(t){var e=t?Yb.concat(t):Yb;return function(n){function r(i){var o={};return typeof i=="string"?i:Array.isArray(i)?i.map(function(a){return r(a)}):(Object.entries(i).forEach(function(a){var s=Au(a,2),l=s[0],u=s[1];typeof u!="object"?l.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(l)?o[l]=u:o["-".concat(l)]=u:e.includes(l)?o["-".concat(l)]=r(u):o[l]=r(u)}),o)}return r(n)}}function Ou(t){var e={};return Object.entries(t).forEach(function(n){var r=Au(n,2),i=r[0],o=r[1];i.indexOf("-")===0?e[i.substring(1)]=wu(o):typeof o=="string"?e[i]=o:Object.prototype.toString.call(o)==="[object Object]"?e[i]=Ou(o):Array.isArray(o)?e[i]=o.map(function(a){return Ou(a)}):e[i]=o}),e}function W8(t,e,n){var r=new Map;e.nodes.forEach(function(o){var a,s={"-id":o.id};if(!((a=o.text)===null||a===void 0)&&a.value&&(s["-name"]=o.text.value),o.properties){var l=qb(n)(o.properties);Object.assign(s,l)}r.set(o.id,s),t[o.type]?Array.isArray(t[o.type])?t[o.type].push(s):t[o.type]=[t[o.type],s]:t[o.type]=s});var i=e.edges.map(function(o){var a,s,l=r.get(o.targetNodeId);l["bpmn:incoming"]?Array.isArray(l["bpmn:incoming"])?l["bpmn:incoming"].push(o.id):l["bpmn:incoming"]=[l["bpmn:incoming"],o.id]:l["bpmn:incoming"]=o.id;var u={"-id":o.id,"-sourceRef":o.sourceNodeId,"-targetRef":o.targetNodeId};if(!((a=o.text)===null||a===void 0)&&a.value&&(u["-name"]=(s=o.text)===null||s===void 0?void 0:s.value),o.properties){var c=qb(n)(o.properties);Object.assign(u,c)}return u});e.edges.forEach(function(o){var a=r.get(o.sourceNodeId);a["bpmn:outgoing"]?Array.isArray(a["bpmn:outgoing"])?a["bpmn:outgoing"].push(o.id):a["bpmn:outgoing"]=[a["bpmn:outgoing"],o.id]:a["bpmn:outgoing"]=o.id}),t[Hr.FLOW]=i}function U8(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var r,i=n.id,o=n.pointsList.map(function(s){var l=s.x,u=s.y;return{"-x":l,"-y":u}}),a={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=n.text)===null||r===void 0)&&r.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var r,i=n.id,o=100,a=80,s=n.x,l=n.y,u=Mi.shapeConfigMap.get(n.type);u&&(o=u.width,a=u.height),s-=o/2,l-=a/2;var c={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":s,"-y":l,"-width":o,"-height":a}};return!((r=n.text)===null||r===void 0)&&r.value&&(c["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),c})}function V8(t){var e=[],n=[],r=t["bpmn:definitions"];if(r){var i=r["bpmn:process"],o=r["bpmndi:BPMNDiagram"],a=o==null?void 0:o["bpmndi:BPMNPlane"];if(!i||!a)return{nodes:e,edges:n};Object.keys(i).forEach(function(s){if(s.indexOf("bpmn:")===0){var l=i[s];if(s===Hr.FLOW){var u=a["bpmndi:BPMNEdge"],c=(Array.isArray(u),u);n=G8(l,c)}else{var d=a["bpmndi:BPMNShape"],f=(Array.isArray(d),d);e=e.concat(X8(l,f,s))}}})}return{nodes:e,edges:n}}function X8(t,e,n){var r=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(u){return u["-bpmnElement"]===a["-id"]}):s=e;var l=Zb(s,n,a);r.push(l)});else{var i=void 0;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):i=e;var o=Zb(i,n,t);r.push(o)}return r}function Zb(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=Kb(n["-name"]),a=Mi.shapeConfigMap.get(e);a&&(r+=a.width/2,i+=a.height/2);var s;Object.entries(n).forEach(function(d){var f=Au(d,2),h=f[0],v=f[1];Gb.indexOf(h)===-1&&(s||(s={}),s[h]=v)}),s&&(s=Ou(s));var l;if(o&&(l={x:r,y:i,value:o},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=t["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(u["-x"])+Number(u["-width"])/2,l.y=Number(u["-y"])+Number(u["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:r,y:i,properties:s};return l&&(c.text=l),c}function G8(t,e){var n=[];if(Array.isArray(t))t.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(a){return a["-bpmnElement"]===i["-id"]}):o=e,n.push(Jb(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===t["-id"]}):r=e,n.push(Jb(r,t))}return n}function Jb(t,e){var n,r=e["-name"]?Kb("".concat(e["-name"])):"";if(r){var i=void 0;t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"]&&(i=t["bpmndi:BPMNLabel"]["dc:Bounds"]);var o=0;if(r.split(`
|
|
81
|
+
`).forEach(function(h){o<h.length&&(o=h.length)}),i)n={value:r,x:Number(i["-x"])+o*10/2,y:Number(i["-y"])+7};else{var a=t["di:waypoint"]||[],s=a[0],l=a[a.length-1]||s,u=(Number((s==null?void 0:s["-x"])||0)+Number((l==null?void 0:l["-x"])||0))/2,c=(Number((s==null?void 0:s["-y"])||0)+Number((l==null?void 0:l["-y"])||0))/2;n={value:r,x:u,y:c}}}var d;Object.entries(e).forEach(function(h){var v=Au(h,2),g=v[0],m=v[1];Gb.indexOf(g)===-1&&(d||(d={}),d[g]=m)}),d&&(d=Ou(d));var f={id:e["-id"],type:Hr.FLOW,pointsList:t["di:waypoint"].map(function(h){return{x:Number(h["-x"]),y:Number(h["-y"])}}),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:d};return n&&(f.text=n),f}var Mi=function(){function t(e){var n=e.lf,r=this;this.adapterOut=function(i,o){var a=ap({},r.processAttributes);W8(a,i,o);var s={"-id":"BPMNPlane_1","-bpmnElement":a["-id"]};U8(s,i);var l=r.definitionAttributes;l["bpmn:process"]=a,l["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":s};var u={"bpmn:definitions":l};return u},this.adapterIn=function(i){if(i)return V8(i)},n.adapterIn=function(i){return r.adapterIn(i)},n.adapterOut=function(i,o){return r.adapterOut(i,o)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(Vb())},this.definitionAttributes={"-id":"Definitions_".concat(Vb()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();Mi.shapeConfigMap.set(Hr.START,{width:Lb.width,height:Lb.height}),Mi.shapeConfigMap.set(Hr.END,{width:Ib.width,height:Ib.height}),Mi.shapeConfigMap.set(Hr.GATEWAY,{width:kb.width,height:kb.height}),Mi.shapeConfigMap.set(Hr.SYSTEM,{width:Bb.width,height:Bb.height}),Mi.shapeConfigMap.set(Hr.USER,{width:jb.width,height:jb.height});var Y8=function(t){z8(e,t);function e(n){var r=t.call(this,n)||this;r.adapterXmlIn=function(o){var a=typeof o=="string"?r.sanitizeNameAttributes(o):o,s=H8(a);return r.adapterIn(s)},r.adapterXmlOut=function(o,a){var s=r.adapterOut(o,a);return $8(s)};var i=n.lf;return i.adapterIn=r.adapterXmlIn,i.adapterOut=r.adapterXmlOut,r}return e.prototype.sanitizeNameAttributes=function(n){return n.replace(/name="([^"]*)"/g,function(r,i){var o=i.replace(/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">");return'name="'.concat(o,'"')})},e.pluginName="bpmnXmlAdapter",e}(Mi),K8=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var e="xxxxxxx".replace(/[x]/g,function(n){var r=Math.random()*16|0,i=n==="x"?r:r&3|8;return i.toString(16)});return e},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t}(),q8=(globalThis==null?void 0:globalThis._ids)||new K8;function Z8(){return q8.next()}var Qb=function(){return Qb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Qb.apply(this,arguments)},e0=function(){return e0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},e0.apply(this,arguments)},t0=function(){return t0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},t0.apply(this,arguments)},n0=function(){return n0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},n0.apply(this,arguments)},r0=function(){return r0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},r0.apply(this,arguments)};Te("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),Te("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"}),Te("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"});var i0=function(){return i0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},i0.apply(this,arguments)},o0=function(){return o0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},o0.apply(this,arguments)},J8=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),to=function(){return to=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},to.apply(this,arguments)},Q8=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},eF=tr,tF=function(t){J8(e,t);function e(n){var r=t.call(this)||this;return r.updatePosition=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.x,u=s.y;r.nodeModel.x=l+o/2,r.nodeModel.y=u+a/2,r.nodeModel.moveText(o/2,a/2)},r.getResize=function(i){var o=i.index,a=i.deltaX,s=i.deltaY,l=i.width,u=i.height,c=i.PCTResizeInfo,d=i.pct,f=d===void 0?1:d,h=i.freezeWidth,v=h===void 0?!1:h,g=i.freezeHeight,m=g===void 0?!1:g,y={width:l,height:u,deltaX:a,deltaY:s};if(c){var x=4,E=0,b=0;switch(o){case 0:b=(a*-1-s)/x;break;case 1:b=(a-s)/x;break;case 2:b=(a+s)/x;break;case 3:b=(a*-1+s)/x;break}b!==0&&(E=Math.round(b/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+E,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+E,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var T=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),A=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(o){case 0:a=l-T,s=u-A;break;case 1:a=T-l,s=u-A;break;case 2:a=T-l,s=A-u;break;case 3:a=l-T,s=A-u;break}return y.width=T,y.height=A,y.deltaX=a/f,y.deltaY=s/f,y}switch(o){case 0:y.width=v?l:l-a*f,y.height=m?u:u-s*f;break;case 1:y.width=v?l:l+a*f,y.height=m?u:u-s*f;break;case 2:y.width=v?l:l+a*f,y.height=m?u:u+s*f;break;case 3:y.width=v?l:l-a*f,y.height=m?u:u+s*f;break}return y},r.updateEdgePointByAnchors=function(){var i=r.nodeModel,o=i.id,a=i.anchors,s=r.getNodeEdges(o);s.sourceEdges.forEach(function(l){var u=a.find(function(c){return c.id===l.sourceAnchorId});u&&l.updateStartPoint({x:u.x,y:u.y})}),s.targetEdges.forEach(function(l){var u=a.find(function(c){return c.id===l.targetAnchorId});u&&l.updateEndPoint({x:u.x,y:u.y})})},r.updateRect=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.x,u=s.y,c=s.width,d=s.height,f=s.radius,h=s.PCTResizeInfo,v=r.nodeModel,g=v.minWidth,m=v.minHeight,y=v.maxWidth,x=v.maxHeight,E=r.index,b=g===y,T=m===x,A=r.getResize({index:E,deltaX:o,deltaY:a,width:c,height:d,PCTResizeInfo:h,pct:1,freezeWidth:b,freezeHeight:T});if(A.width<g||A.width>y||A.height<m||A.height>x){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:b?0:A.deltaX,deltaY:T?0:A.deltaY}),r.nodeModel.width=A.width,r.nodeModel.height=A.height,r.nodeModel.setProperties({nodeSize:{width:A.width,height:A.height}});var S={x:l,y:u,width:c,height:d,radius:f},M={x:r.nodeModel.x,y:r.nodeModel.y,width:r.nodeModel.width,height:r.nodeModel.height,radius:f};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:S,afterNode:M})},r.updateEllipse=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.rx,u=s.ry,c=s.x,d=s.y,f=s.PCTResizeInfo,h=r.index,v=r.nodeModel,g=v.minWidth,m=v.minHeight,y=v.maxWidth,x=v.maxHeight,E=g===y,b=m===x,T=l,A=u,S=r.getResize({index:h,deltaX:o,deltaY:a,width:T,height:A,PCTResizeInfo:f,pct:1/2,freezeWidth:E,freezeHeight:b});if(S.width<g/2||S.width>y/2||S.height<m/2||S.height>x/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:E?0:S.deltaX,deltaY:b?0:S.deltaY}),r.nodeModel.rx=S.width,r.nodeModel.ry=S.height,r.nodeModel.setProperties({nodeSize:{rx:S.width,ry:S.height}});var M={x:c,y:d},C={rx:S.width,ry:S.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:to(to({},M),{rx:l,ry:u}),afterNode:C})},r.updateDiamond=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.rx,u=s.ry,c=s.x,d=s.y,f=s.PCTResizeInfo,h=r.index,v=r.nodeModel,g=v.minWidth,m=v.minHeight,y=v.maxWidth,x=v.maxHeight,E=g===y,b=m===x,T=l,A=u,S=r.getResize({index:h,deltaX:o,deltaY:a,width:T,height:A,PCTResizeInfo:f,pct:1/2,freezeWidth:E,freezeHeight:b});if(S.width<g/2||S.width>y/2||S.height<m/2||S.height>x/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:E?0:S.deltaX,deltaY:b?0:S.deltaY}),r.nodeModel.rx=S.width,r.nodeModel.ry=S.height,r.nodeModel.setProperties({nodeSize:{rx:S.width,ry:S.height}});var M={x:c,y:d,rx:l,ry:u},C={rx:S.width,ry:S.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:M,afterNode:C})},r.eventEmit=function(i){var o=i.deltaX,a=i.deltaY,s=i.beforeNode,l=i.afterNode,u=r.nodeModel,c=u.id,d=u.modelType,f=u.type,h=to({id:c,modelType:d,type:f},s),v=to({id:c,modelType:d,type:f},l);r.graphModel.eventCenter.emit("node:resize",{preData:h,data:v,deltaX:o,deltaY:a,index:r.index,model:r.nodeModel})},r.onDragging=function(i){var o,a=i.deltaX,s=i.deltaY,l=r.graphModel.transformModel,u=r.nodeModel.modelType;o=Q8(l.fixDeltaXY(a,s),2),a=o[0],s=o[1],u===Ye.RECT_NODE||u===Ye.HTML_NODE?r.updateRect({deltaX:a,deltaY:s}):u===Ye.ELLIPSE_NODE?r.updateEllipse({deltaX:a,deltaY:s}):u===Ye.DIAMOND_NODE&&r.updateDiamond({deltaX:a,deltaY:s})},r.onDragEnd=function(){var i=r.graphModel.gridSize,o=i===void 0?1:i,a=o*Math.round(r.nodeModel.x/o),s=o*Math.round(r.nodeModel.y/o);r.nodeModel.moveTo(a,s),r.updateEdgePointByAnchors()},r.index=n.index,r.nodeModel=n.model,r.graphModel=n.graphModel,r.dragHandler=new eF({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:1}),r}return e.prototype.getNodeEdges=function(n){for(var r=this.graphModel,i=r.edges,o=[],a=[],s=0;s<i.length;s++){var l=i[s];l.sourceNodeId===n?o.push(l):i[s].targetNodeId===n&&a.push(l)}return{sourceEdges:o,targetEdges:a}},e.prototype.render=function(){var n=this.props,r=n.x,i=n.y,o=n.index,a=n.model,s=a.getControlPointStyle();return V("g",{className:"lf-resize-control-".concat(o),children:V(rr,to({className:"lf-node-control",x:r,y:i},s,{onMouseDown:this.dragHandler.handleMouseDown}))})},e}(Qe),nF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tu=function(){return Tu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Tu.apply(this,arguments)},Nu=function(t){nF(e,t);function e(){var n=t.call(this)||this;return n.state={},n}return e.prototype.getResizeControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=r.x,a=r.y,s=r.width,l=r.height,u={minX:o-s/2,minY:a-l/2,maxX:o+s/2,maxY:a+l/2},c=u.minX,d=u.minY,f=u.maxX,h=u.maxY,v=[{x:c,y:d},{x:f,y:d},{x:f,y:h},{x:c,y:h}];return v.map(function(g,m){return V(tF,Tu({index:m},g,{model:r,graphModel:i}))})},e.prototype.getGroupSolid=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getResizeOutlineStyle();return V(rr,Tu({},s,{x:r,y:i,width:o,height:a}))},e.prototype.render=function(){return V("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},e}(Qe),a0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rF=function(t){a0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.rx=o.rx,i.ry=o.ry),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.rx,basisHeight:this.ry},o={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Mf),iF=function(t){a0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Nu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r.isSelected&&!i?this.getControlGroup():""]})},e}(Wf),oF={type:"ellipse",view:iF,model:rF},s0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sp=function(){return sp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},sp.apply(this,arguments)},aF=function(t){s0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.rx=o.rx,i.ry=o.ry),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.rx,basisHeight:this.ry},o={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Nf),sF=function(t){s0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Nu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){var n=this.props.model,r=n.points,i=n.getNodeStyle();return V("g",{children:V(wf,sp({},i,{points:r}))})},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e}(Hf),lF={type:"diamond",view:sF,model:aF},l0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uF=function(t){l0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.width=o.width,i.height=o.height),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.width,basisHeight:this.height},o={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Df),cF=function(t){l0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Nu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e}(Vf),dF={type:"html",view:cF,model:uF},u0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),c0=function(t){u0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.width=o.width,i.height=o.height),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.width,basisHeight:this.height},o={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Uo),d0=function(t){u0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Nu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e}(Ji),fF={type:"rect",view:d0,model:c0},pF={pluginName:"nodeResize",step:0,install:function(t){t.register(oF),t.register(lF),t.register(dF),t.register(fF)}},f0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mu=function(){return Mu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Mu.apply(this,arguments)},no=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ro=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},p0=500,h0=300,hF=-1e4;(function(t){f0(e,t);function e(){var n=t.apply(this,ro([],no(arguments),!1))||this;return n.isGroup=!0,n.isFolded=!1,n.unfoldedWidth=p0,n.unfoldedHeight=h0,n.childrenLastFoldStatus={},n}return e.prototype.initNodeData=function(n){var r=this;t.prototype.initNodeData.call(this,n);var i=[];We(n.children)&&(i=n.children),this.children=new Set(i),this.width=p0,this.height=h0,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=hF,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,this.properties.isFolded===void 0&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout(function(){r.isFolded&&r.foldGroup(r.isFolded)})},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.foldGroup=function(n){var r=this;if(n!==this.isFolded){this.setProperty("isFolded",n),this.isFolded=n,n?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var i=ro(ro([],no(this.incoming.edges),!1),no(this.outgoing.edges),!1);this.children.forEach(function(o){var a=r.graphModel.getElement(o);if(a){var s=a.isFolded;if(a.isGroup&&!a.isFolded&&a.foldGroup(n),a.isGroup&&!n){var l=r.childrenLastFoldStatus[o];l!==void 0&&l!==a.isFolded&&a.foldGroup(l)}r.childrenLastFoldStatus[o]=!!s,a.visible=!n;var u=a.incoming.edges,c=a.outgoing.edges;i=ro(ro(ro([],no(i),!1),no(u),!1),no(c),!1)}}),this.foldEdge(n,i)}},e.prototype.getAnchorStyle=function(n){var r=t.prototype.getAnchorStyle.call(this,n);return r.stroke="transparent",r.fill="transparent",r.hover.fill="transparent",r.hover.stroke="transparent",r},e.prototype.foldEdge=function(n,r){var i=this;r.forEach(function(o,a){var s=o.id,l=o.sourceNodeId,u=o.targetNodeId,c=o.startPoint,d=o.endPoint,f=o.type,h=o.text,v=o.getProperties(),g={id:"".concat(s,"__").concat(a),sourceNodeId:l,targetNodeId:u,startPoint:c,endPoint:d,type:f,properties:v,text:h==null?void 0:h.value};o.virtual&&i.graphModel.deleteEdgeById(o.id);var m=i.graphModel.group.getNodeGroup(u);m||(m=i.graphModel.getNodeModelById(u));var y=i.graphModel.group.getNodeGroup(l);y||(y=i.graphModel.getNodeModelById(l)),n&&o.visible!==!1&&(i.children.has(l)||i.id===l?(g.startPoint=void 0,g.sourceNodeId=i.id):(g.endPoint=void 0,g.targetNodeId=i.id),(m.id!==i.id||y.id!==i.id)&&i.createVirtualEdge(g),o.visible=!1),!n&&o.visible===!1&&(m&&m.isGroup&&m.isFolded?(g.targetNodeId=m.id,g.endPoint=void 0,i.createVirtualEdge(g)):y&&y.isGroup&&y.isFolded?(g.sourceNodeId=y.id,g.startPoint=void 0,i.createVirtualEdge(g)):o.visible=!0)})},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var r=this.graphModel.addEdge(n);r.virtual=!0,r.text.editable=!1,r.isFoldedEdge=!0},e.prototype.isInRange=function(n){var r=n.minX,i=n.minY,o=n.maxX,a=n.maxY;return r>=this.x-this.width/2&&o<=this.x+this.width/2&&i>=this.y-this.height/2&&a<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(n){var r=n.minX,i=n.minY,o=n.maxX,a=n.maxY;return{x:r>=this.x-this.width/2&&o<=this.x+this.width/2,y:i>=this.y-this.height/2&&a<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(n){this.setProperty("groupAddable",n)},e.prototype.addChild=function(n){this.children.add(n),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(n){this.children.delete(n),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var n=this,r=t.prototype.getData.call(this);r.children=[],this.children.forEach(function(o){var a=n.graphModel.getNodeModelById(o);a&&!a.virtual&&r.children.push(o)});var i=r.properties;return i==null||delete i.groupAddable,i==null||delete i.isFolded,r},e.prototype.getHistoryData=function(){var n=t.prototype.getData.call(this);n.children=ro([],no(this.children),!1),n.isGroup=!0;var r=n.properties;return r==null||delete r.groupAddable,r!=null&&r.isFolded&&(n.x=n.x+this.unfoldedWidth/2-this.foldedWidth/2,n.y=n.y+this.unfoldedHeight/2-this.foldedHeight/2),n},e.prototype.isAllowAppendIn=function(n){return console.info("_nodeData",n),!0},e.prototype.toBack=function(){this.zIndex--},e})(c0),function(t){f0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props.model,r=n.resizable,i=n.properties;return r&&!i.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var n=this.props.model,r=n.width,i=n.height,o=n.x,a=n.y,s=n.radius,l=n.properties,u=n.getAddableOutlineStyle;if(!l.groupAddable)return null;var c=this.props.model.getNodeStyle().strokeWidth,d=c===void 0?0:c,f=u(),h=r+d+8,v=i+d+8;return Te("rect",Mu(Mu({},f),{width:h,height:v,x:o-h/2,y:a-v/2,rx:s,ry:s}))},e.prototype.getFoldIcon=function(){var n=this.props.model,r=n.x-n.width/2+5,i=n.y-n.height/2+5;if(!n.foldable)return null;var o=Te("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:n.properties.isFolded?"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," M").concat(r+7,",").concat(i+2," ").concat(r+7,",").concat(i+10):"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," ")});return Te("g",{},[Te("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n.x-n.width/2+5,y:n.y-n.height/2+5,onClick:function(){n.foldGroup(!n.properties.isFolded)}}),o])},e.prototype.getResizeShape=function(){return Te("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e}(d0);var g0=function(){return g0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},g0.apply(this,arguments)},v0=function(){return v0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},v0.apply(this,arguments)},m0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ls=function(){return ls=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ls.apply(this,arguments)};function gF(t){var e=function(r){m0(i,r);function i(o,a){o.id||(o.id="Flow_".concat(Z8()));var s=ls(ls(ls({},{}),o.properties),{isDefaultFlow:!1});return o.properties=s,r.call(this,o,a)||this}return i.extendKey="SequenceFlowModel",i}(Ya),n=function(r){m0(i,r);function i(){return r!==null&&r.apply(this,arguments)||this}return i.prototype.getStartArrow=function(){var o=this.props.model,a=o.properties.isDefaultFlow;return a?Te("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):Te("path",{d:""})},i.extendKey="SequenceFlowEdge",i}(os);return{type:"bpmn:sequenceFlow",view:n,model:e}}gF();var y0={width:40,height:40},_0={width:40,height:40},b0={width:100,height:80},Du={width:100,height:80},x0={width:100,height:80},E0={width:100,height:80},w0={width:100,height:80},S0={width:100,height:80},C0={width:100,height:80},A0={width:100,height:80},yn=function(){};yn.ObjTree=function(){return this},yn.ObjTree.VERSION="0.23",yn.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
|
82
|
+
`,yn.ObjTree.prototype.attr_prefix="-",yn.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e){var i=this.parseDOM(e);return i}},yn.ObjTree.prototype.parseHTTP=function(t,e,n){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody>"u"&&typeof r.postbody>"u"&&typeof r.parameters>"u"?r.method="get":r.method="post"),n){r.asynchronous=!0;var o=this,a=n,s=r.onComplete;r.onComplete=function(c){var d;c&&c.responseXML&&c.responseXML.documentElement&&(d=o.parseDOM(c.responseXML.documentElement)),a(d,c),s&&s(c)}}else r.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){r.uri=t;var u=new HTTP.Request(r);u&&(l=u.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var u=new Ajax.Request(t,r);u&&(l=u.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)},yn.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!==11){var r={};r[t.nodeName]=n,n=r}return n}},yn.ObjTree.prototype.parseElement=function(t){if(t.nodeType!==7){if(t.nodeType===3||t.nodeType===4||t.nodeType===8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,r={};if(t.attributes&&t.attributes.length){n={};for(var i=0;i<t.attributes.length;i++){var o=t.attributes[i].nodeName;if(typeof o=="string"){var a=t.attributes[i].nodeValue;try{a=JSON.parse(t.attributes[i].nodeValue.replace(/'/g,'"'))}catch{a=t.attributes[i].nodeValue}a!=null&&(o=this.attr_prefix+o,typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var i=0;i<t.childNodes.length&&s;i++){var l=t.childNodes[i].nodeType;l===3||l===4||l===8||(s=!1)}if(s){n||(n="");for(var i=0;i<t.childNodes.length;i++)n+=t.childNodes[i].nodeValue}else{n||(n={});for(var i=0;i<t.childNodes.length;i++){var o=t.childNodes[i].nodeName;if(typeof o=="string"){var a=this.parseElement(t.childNodes[i]);a&&(typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],a))}}}}else n===null&&(n={});return n}},yn.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(n===1&&(t[e]=[]),t[e][t[e].length]=r):n===1?t[e]=r:n===2?t[e]=[t[e],r]:t[e][t[e].length]=r},yn.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},yn.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(Ks(e,i)){var o=e[i];i.charAt(0)!==this.attr_prefix?typeof o>"u"||o==null?n[n.length]="<".concat(i," />"):typeof o=="object"&&o.constructor===Array?n[n.length]=this.array_to_xml(i,o):typeof o=="object"?n[n.length]=this.hash_to_xml(i,o):n[n.length]=this.scalar_to_xml(i,o):r[r.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(o),'"')}var a=r.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<".concat(t).concat(a,`>
|
|
83
|
+
`).concat(s,"</").concat(t,`>
|
|
84
|
+
`):s="<".concat(t).concat(a,">").concat(s,"</").concat(t,`>
|
|
85
|
+
`):s="<".concat(t).concat(a,` />
|
|
86
|
+
`)),s},yn.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];typeof i>"u"||i==null?n[n.length]="<".concat(t," />"):typeof i=="object"&&i.constructor===Array?n[n.length]=this.array_to_xml(t,i):typeof i=="object"?n[n.length]=this.hash_to_xml(t,i):n[n.length]=this.scalar_to_xml(t,i)}return n.join("")},yn.ObjTree.prototype.scalar_to_xml=function(t,e){return t==="#text"?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,`>
|
|
87
|
+
`)},yn.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var vF=function(t){return new yn.ObjTree().parseXML(t)};function O0(t){return Object.prototype.toString.call(t)}function T0(t){return" ".repeat(t)}function Pu(t){return O0(t)==="[object Object]"?Object.keys(t).reduce(function(e,n){var r=n;return n.charAt(0)==="-"&&(r=n.substring(1)),e[r]=Pu(t[n]),e},{}):Array.isArray(t)?t.map(function(e){return Pu(e)}):t}function mF(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(Pu(t)).replace(/"/g,"'")}return e}var N0=`
|
|
88
|
+
`;function Ru(t,e,n){var r=T0(n),i="",o=N0+r;if(e==="-json")return"";if(e==="#text")return o+t;if(e==="#cdata-section")return"".concat(o,"<![CDATA[").concat(t,"]]>");if(e==="#comment")return"".concat(o,"<!--").concat(t,"-->");if("".concat(e).charAt(0)==="-")return" ".concat(e.substring(1),'="').concat(mF(t),'"');if(Array.isArray(t))i+=t.map(function(u){return Ru(u,e,n+1)}).join("");else if(O0(t)==="[object Object]"){var a=Object.keys(t),s="",l=t["-json"]?N0+T0(n+1)+t["-json"]:"";i+="".concat(n===0?"":o,"<").concat(e),a.forEach(function(u){u.charAt(0)==="-"?s+=Ru(t[u],u,n+1):l+=Ru(t[u],u,n+1)}),i+=s+(l!==""?">".concat(l).concat(o,"</").concat(e,">"):" />")}else i+="".concat(o,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return i}function yF(t){var e="";for(var n in t)e+=Ru(t[n],n,0);return e}var _F=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lp=function(){return lp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},lp.apply(this,arguments)},M0=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},up=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},un=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Or=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},_n;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"})(_n||(_n={}));var D0=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],bF=["properties","startPoint","endPoint","pointsList"],Lu={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},P0=function(t,e){var n=Object.keys(e||{});return n.forEach(function(r){if(t[r]){var i=e[r],o=i.in,a=i.out;o&&(t[r].in=o),a&&(t[r].out=a)}else t[r]=e[r]}),t},or={"bpmn:startEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,r=e.condition;return r?n==="cdata"?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(r,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(r,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,r=e.timerValue,i=e.definitionId,o=function(){return"<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(r,"</bpmn:").concat(n,">")};return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(n&&r?">".concat(o(),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,r,i,o,a=t,s=e["-id"],l="",u="";try{for(var c=up(Object.keys(e)),d=c.next();!d.done;d=c.next()){var f=d.value;f.includes("bpmn:")&&(i=un(f.split(":"),2),l=i[1],u=(o=e[f])===null||o===void 0?void 0:o["#text"])}}catch(h){n={error:h}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return{"-definitionId":s,"-definitionType":a,"-timerType":l,"-timerValue":u}}},"bpmn:conditionExpression":{in:function(t,e){var n,r="",i="";return e["#cdata-section"]?(i="cdata",r=((n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):e["#text"]&&(i="normal",r=e["#text"]),{"-condition":r,"-expressionType":i}}}};function xF(t){var e=t??{},n=e.retainedAttrsFields,r=e.excludeFields,i=e.transformer,o=new Set(Or(Or([],un(bF),!1),un(n||[]),!1)),a={in:new Set(Or(Or([],un(Lu.in),!1),un((r==null?void 0:r.in)||[]),!1)),out:new Set(Or(Or([],un(Lu.out),!1),un((r==null?void 0:r.out)||[]),!1))};return or=P0(or,i),function(s){var l=s.nodes,u=s.edges;function c(d,f){var h,v;if((d==null?void 0:d.flag)!==1){var g;if((g=or[d.type])&&g.out){var m=g.out(d),y=Object.keys(m);y.length>0&&y.forEach(function(C){d[C]=m[C]})}d!=null&&d.children&&(d.children=d.children.map(function(C){var G=l.find(function(K){return K.id===C})||u.find(function(K){return K.id===C});return G||{}}));var x={};if(typeof d=="string")return d;if(Array.isArray(d))return d.map(function(C){return c(C,"")}).filter(function(C){return C!=null});try{for(var E=up(Object.entries(d)),b=E.next();!b.done;b=E.next()){var T=un(b.value,2),A=T[0],S=T[1];if((S==null?void 0:S.flag)===1)return;var M=[f,A].filter(function(C){return C}).join(".");a.out.has(M)||(typeof S!="object"?A.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(A)?x[A]=S:x["-".concat(A)]=S:o.has(M)?x["-".concat(A)]=c(S,M):x[A]=c(S,M))}}catch(C){h={error:C}}finally{try{b&&!b.done&&(v=E.return)&&v.call(E)}finally{if(h)throw h.error}}return x}}return c(s,"")}}function Iu(t){var e,n,r={};try{for(var i=up(Object.entries(t)),o=i.next();!o.done;o=i.next()){var a=un(o.value,2),s=a[0],l=a[1];s.indexOf("-")===0?r[s.substring(1)]=Pu(l):typeof l=="string"?r[s]=l:Object.prototype.toString.call(l)==="[object Object]"?r[s]=Iu(l):Array.isArray(l)?r[s]=l.map(function(u){return Iu(u)}):r[s]=l}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function EF(t,e,n){var r,i=new Map,o=xF(n)(e);o.nodes.forEach(function(s){var l=s["-id"],u=s["-type"],c=s.text,d=s.children,f=M0(s,["-id","-type","text","children"]),h={"-id":l};c!=null&&c["-value"]&&(h["-name"]=c["-value"]),f["-json"]&&(h["-json"]=f["-json"]),f["-properties"]&&Object.assign(h,f["-properties"]),d&&(h.children=d),t[u]||(t[u]=[]),t[u].push(h),i.set(l,h)});var a=o.edges.map(function(s){var l=s["-id"],u=s["-sourceNodeId"],c=s["-targetNodeId"],d=s.text,f=M0(s,["-id","-sourceNodeId","-targetNodeId","text"]),h=i.get(c);h["bpmn:incoming"]||(h["bpmn:incoming"]=[]),h["bpmn:incoming"].push(l);var v={"-id":l,"-sourceRef":u,"-targetRef":c};return d!=null&&d["-value"]&&(v["-name"]=d["-value"]),f["-json"]&&(v["-json"]=f["-json"]),f["-properties"]&&Object.assign(v,f["-properties"]),v});return e.edges.forEach(function(s){var l=s.sourceNodeId,u=s.id,c=i.get(l);c["bpmn:outgoing"]||(c["bpmn:outgoing"]=[]),c["bpmn:outgoing"].push(u)}),(r=t["bpmn:subProcess"])===null||r===void 0||r.forEach(function(s){var l={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},u=[];s.children.forEach(function(g){var m,y=i.get(g["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function(E){y[E]&&y[E].forEach(function(b){l[E].add(b)})});var x=(m=t[g["-type"]])===null||m===void 0?void 0:m.findIndex(function(E){return E["-id"]===g["-id"]});x>=0&&t[g["-type"]].splice(x,1),i.delete(g["-id"]),s[g["-type"]]||(s[g["-type"]]=[]),s[g["-type"]].push(y)});var c=l["bpmn:incoming"],d=l["bpmn:outgoing"];d.forEach(function(g){c.has(g)&&u.push(g)});for(var f=function(g){var m=a.findIndex(function(y){return y["-id"]===u[g]});m>=0?(s["bpmn:sequenceFlow"]||(s["bpmn:sequenceFlow"]=[]),s["bpmn:sequenceFlow"].push(a[m]),a.splice(m,1)):g++,h=g},h,v=0;v<u.length;)f(v),v=h;delete s.children}),t[_n.FLOW]=a,t}function wF(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var r,i=n.id,o=n.pointsList.map(function(s){var l=s.x,u=s.y;return{"-x":l,"-y":u}}),a={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=n.text)===null||r===void 0)&&r.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var r,i=n.id,o=100,a=80,s=n.x,l=n.y,u=Tn.shapeConfigMap.get(n.type);u&&(o=u.width,a=u.height),s-=o/2,l-=a/2;var c={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":s,"-y":l,"-width":o,"-height":a}};return!((r=n.text)===null||r===void 0)&&r.value&&(c["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),c})}var SF=["bpmn:incoming","bpmn:outgoing"];function CF(t,e){var n=[],r=[],i=new Map,o=e??{},a=o.transformer,s=o.excludeFields,l={in:new Set(Or(Or([],un(Lu.in),!1),un((s==null?void 0:s.in)||[]),!1)),out:new Set(Or(Or([],un(Lu.out),!1),un((s==null?void 0:s.out)||[]),!1))};or=P0(or,a);var u=t["bpmn:definitions"];if(u){var c=u["bpmn:process"];(function(f,h){h.forEach(function(v){try{Object.keys(f).forEach(function(g){try{v(g)}catch(m){console.error(m)}})}catch(g){console.error(g)}})})(c,[function(f){function h(g){g["-children"]||(g["-children"]=[]),Object.keys(g).forEach(function(m){var y;m.indexOf("bpmn:")===0&&!SF.includes(m)&&(c[m]||(c[m]=[]),!Array.isArray(c[m])&&(c[m]=[c[m]]),Array.isArray(g[m])?(y=c[m]).push.apply(y,Or([],un(g[m]),!1)):c[m].push(g[m]),Array.isArray(g[m])?g[m].forEach(function(x){!m.includes("Flow")&&g["-children"].push(x["-id"])}):!m.includes("Flow")&&g["-children"].push(g[m]["-id"]),delete g[m])})}if(f==="bpmn:subProcess"){var v=c[f];Array.isArray(v)?v.forEach(function(g){f==="bpmn:subProcess"&&h(g)}):h(v)}},function(f){var h=function(g){Object.keys(g).forEach(function(m){var y,x;if(m.includes("bpmn:")){var E={};or[m]&&or[m].in?(E=(x=(y=or[m]).in)===null||x===void 0?void 0:x.call(y,m,O.cloneDeep(g[m])),delete g[m]):v(g[m]);var b=void 0;(b=Reflect.ownKeys(E)).length>0&&b.forEach(function(T){Reflect.set(g,T,E[T])})}})};function v(g){i.set(g["-id"],g),Array.isArray(g)?g.forEach(function(m){v(m)}):typeof g=="object"&&h(g)}v(c[f])},function(f){if(f.indexOf("bpmn:")===0){var h=c[f];if(f==="bpmn:sequenceFlow"){var v=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];r=OF(h,v)}else{var g=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(f==="bpmn:boundaryEvent"){var m=c[f],y=function(x){var E=x["-attachedToRef"],b=i.get(E);b["-boundaryEvents"]||(b["-boundaryEvents"]=[]),b["-boundaryEvents"].push(x["-id"])};Array.isArray(m)?m.forEach(function(x){y(x)}):y(m)}n=n.concat(AF(h,g,f))}}}])}var d=function(f,h,v){Object.keys(f).forEach(function(g){var m=v?"".concat(v,".").concat(g):g;h.has(m)?delete f[g]:typeof f[g]=="object"&&d(f[g],h,m)})};return n.forEach(function(f){var h,v;if(!((h=e==null?void 0:e.mapping)===null||h===void 0)&&h.in){var g=(v=e==null?void 0:e.mapping)===null||v===void 0?void 0:v.in,m=f.type;g[m]&&(f.type=g[m])}d(f,l.in,"")}),r.forEach(function(f){var h,v;if(!((h=e==null?void 0:e.mapping)===null||h===void 0)&&h.in){var g=(v=e==null?void 0:e.mapping)===null||v===void 0?void 0:v.in,m=f.type;g[m]&&(f.type=g[m])}d(f,l.in,"")}),{nodes:n,edges:r}}function AF(t,e,n){var r=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(u){return u["-bpmnElement"]===a["-id"]}):s=e;var l=R0(s,n,a);r.push(l)});else{var i=void 0;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):i=e;var o=R0(i,n,t);r.push(o)}return r}function R0(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=n["-children"],a=n["-name"],s=Tn.shapeConfigMap.get(e);s&&(r+=s.width/2,i+=s.height/2);var l={};Object.entries(n).forEach(function(f){var h=un(f,2),v=h[0],g=h[1];D0.includes(v)||(l[v]=g)}),l=Iu(l);var u;if(a&&(u={x:r,y:i,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];u.x=Number(c["-x"])+Number(c["-width"])/2,u.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:r,y:i,properties:l};return o&&(d.children=o),u&&(d.text=u),d}function OF(t,e){var n=[];if(Array.isArray(t))t.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(a){return a["-bpmnElement"]===i["-id"]}):o=e,n.push(L0(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===t["-id"]}):r=e,n.push(L0(r,t))}return n}function L0(t,e){var n,r=e["-name"]?"".concat(e["-name"]):"";if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],o=0;r.split(`
|
|
89
|
+
`).forEach(function(u){o<u.length&&(o=u.length)}),n={value:r,x:Number(i["-x"])+o*10/2,y:Number(i["-y"])+7}}var a={};Object.entries(e).forEach(function(u){var c=un(u,2),d=c[0],f=c[1];D0.includes(d)||(a[d]=f)}),a=Iu(a);var s=t["di:waypoint"].map(function(u){return{x:Number(u["-x"]),y:Number(u["-y"])}}),l={id:e["-id"],type:_n.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(l.text=n),l}var Tn=function(){function t(e){var n=e.lf,r=this;this.adapterOut=function(i,o){var a,s,l=lp({},r.processAttributes);EF(l,i,o);var u={"-id":"BPMNPlane_1","-bpmnElement":l["-id"]};wF(u,i);var c=r.definitionAttributes;c["bpmn:process"]=l,c["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":u};var d={"bpmn:definitions":c};if(!((a=o==null?void 0:o.mapping)===null||a===void 0)&&a.out){var f=(s=o==null?void 0:o.mapping)===null||s===void 0?void 0:s.out,h=function(v){Array.isArray(v)&&v.forEach(function(g){return h(g)}),typeof v=="object"&&Object.keys(v).forEach(function(g){var m;(m=f[g])?(v[m]=O.cloneDeep(v[g]),delete v[g],h(v[m])):h(v[g])})};h(d)}return d},this.adapterIn=function(i,o){if(i)return CF(i,o)},n.adapterIn=this.adapterIn,n.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();Tn.shapeConfigMap.set(_n.START,{width:y0.width,height:y0.height}),Tn.shapeConfigMap.set(_n.END,{width:_0.width,height:_0.height}),Tn.shapeConfigMap.set(_n.INTERMEDIATE_CATCH,{width:Du.width,height:Du.height}),Tn.shapeConfigMap.set(_n.INTERMEDIATE_THROW,{width:Du.width,height:Du.height}),Tn.shapeConfigMap.set(_n.BOUNDARY,{width:b0.width,height:b0.height}),Tn.shapeConfigMap.set(_n.PARALLEL_GATEWAY,{width:x0.width,height:x0.height}),Tn.shapeConfigMap.set(_n.INCLUSIVE_GATEWAY,{width:E0.width,height:E0.height}),Tn.shapeConfigMap.set(_n.EXCLUSIVE_GATEWAY,{width:w0.width,height:w0.height}),Tn.shapeConfigMap.set(_n.SYSTEM,{width:S0.width,height:S0.height}),Tn.shapeConfigMap.set(_n.USER,{width:C0.width,height:C0.height}),Tn.shapeConfigMap.set(_n.SUBPROCESS,{width:A0.width,height:A0.height}),function(t){_F(e,t);function e(n){var r=t.call(this,n)||this;r.adapterXmlIn=function(a){var s=vF(a);return r.adapterIn(s,r.props)},r.adapterXmlOut=function(a){var s=r.adapterOut(a,r.props);return yF(s)};var i=n.lf,o=n.props;return i.adapterIn=r.adapterXmlIn,i.adapterOut=r.adapterXmlOut,r.props=o,r}return e.pluginName="BPMNAdapter",e}(Tn);var I0=function(){return I0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},I0.apply(this,arguments)};function TF(t,e,n){var r=e.x,i=e.y,o=t.x,a=t.y,s=o-r,l=a-i,u=s*Math.cos(n)-l*Math.sin(n),c=s*Math.sin(n)+l*Math.cos(n),d=u+r,f=c+i;return{x:d,y:f}}var NF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ku=function(){return ku=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ku.apply(this,arguments)},MF=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},DF=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};(function(t){NF(e,t);function e(){var n=t.apply(this,DF([],MF(arguments),!1))||this;return n.childrenPositionMap=new Map,n.onNodeRotate=function(r){var i=r.model,o=n.props,a=o.model,s=o.graphModel,l=a.transformWithContainer,u=a.isRestrict,c=n.childrenPositionMap;if(!(!l||u)&&i.id===a.id){var d={x:a.x,y:a.y};gt(Array.from(a.children),function(f){var h=s.getNodeModelById(f);if(h){var v={x:h.x,y:h.y};c.has(h.id)?v=c.get(h.id):c.set(h.id,v);var g=i.rotate*(180/Math.PI);g<0&&(g+=360);var m=g*(Math.PI/180),y=TF(v,d,m);h.moveTo(y.x,y.y),h.rotate=i.rotate}})}},n.onNodeResize=function(r){var i=r.deltaX,o=r.deltaY,a=r.index,s=r.model,l=r.preData,u=n.props,c=u.model,d=u.graphModel,f=c.transformWithContainer,h=c.isRestrict;if(!(!f||h)&&s.id===c.id){var v=l.properties,g=v||{},m=g.width,y=g.height;gt(Array.from(c.children),function(x){var E=d.getNodeModelById(x);if(E){var b=E.width/m*i,T=E.height/y*o;lb({deltaX:b,deltaY:T,index:a,nodeModel:E,graphModel:d,cancelCallback:function(){}})}})}},n.onNodeMouseMove=function(){},n.graphRendered=function(){var r=n.props.model;r.isCollapsed&&r.toggleCollapse(!0)},n}return e.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this);var n=this.props.graphModel.eventCenter;n.on("node:rotate",this.onNodeRotate),n.on("node:resize",this.onNodeResize),n.on("node:mousemove",this.onNodeMouseMove),n.on("graph:rendered",this.graphRendered)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this);var n=this.props.graphModel.eventCenter;n.off("node:rotate",this.onNodeRotate),n.off("node:resize",this.onNodeResize),n.off("node:mousemove",this.onNodeMouseMove),n.off("graph:rendered",this.graphRendered)},e.prototype.getNodesInGroup=function(n,r){var i=this,o=[];return n.isGroup&>(Array.from(n.children),function(a){o.push(a);var s=r.getNodeModelById(a);s!=null&&s.isGroup&&(o=o.concat(i.getNodesInGroup(s,r)))}),o},e.prototype.getResizeControl=function(){var n=this.props.model,r=n.resizable,i=n.isCollapsed,o=r&&!i;return o?t.prototype.getResizeControl.call(this):null},e.prototype.getAppendAreaShape=function(){var n=this.props.model,r=n.width,i=n.height,o=n.x,a=n.y,s=n.radius,l=n.groupAddable;if(!l)return null;var u=n.getNodeStyle().strokeWidth,c=u===void 0?0:u,d=n.getAddableOutlineStyle(),f=r+c+8,h=i+c+8;return Te("rect",ku(ku({},d),{width:f,height:h,x:o-f/2,y:a-h/2,rx:s,ry:s}))},e.prototype.getCollapseIcon=function(n,r){return"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," M").concat(n+7,",").concat(r+2," ").concat(n+7,",").concat(r+10)},e.prototype.getExpandIcon=function(n,r){return"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," ")},e.prototype.getOperateIcon=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=r-o/2+10,l=i-a/2+10;if(!n.collapsible)return null;var u=n!=null&&n.isCollapsed?this.getCollapseIcon(s,l):this.getExpandIcon(s,l),c=Te("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:u});return Te("g",{},[Te("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:s,y:l,onClick:function(){n.toggleCollapse(!n.isCollapsed)}}),c])},e.prototype.getShape=function(){return Te("g",{},[this.getAppendAreaShape(),t.prototype.getShape.call(this),this.getOperateIcon()])},e})(Ji);var PF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bu=function(){return Bu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Bu.apply(this,arguments)},cp=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},qo=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},us=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},RF=400,LF=230,IF=80,kF=60,BF=-1e4;(function(t){PF(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.isGroup=!0,i.isRestrict=!1,i.autoResize=!1,i.collapsible=!0,i.isCollapsed=!1,i.groupAddable=!1,i.transformWithContainer=!1,i.childrenLastCollapseStateDict=new Map,i.childrenLastCollapseStateDict=new Map,i.initNodeData(n),i.setAttributes(),i}return e.prototype.initNodeData=function(n){var r;t.prototype.initNodeData.call(this,n);var i=(r=n.properties)!==null&&r!==void 0?r:{},o=i.children,a=i.width,s=i.height,l=i.collapsedWidth,u=i.collapsedHeight,c=i.collapsible,d=i.isCollapsed,f=i.zIndex,h=i.isRestrict,v=i.autoResize,g=i.autoToFront,m=i.transformWithContainer;this.children=o?new Set(o):new Set,this.zIndex=f??BF,this.isCollapsed=d??!1,this.setProperties({isCollapsed:d??!1});var y=a??RF,x=s??LF;this.width=y,this.height=x,this.expandWidth=y,this.expandHeight=x,this.collapsedWidth=l??IF,this.collapsedHeight=u??kF,this.isRestrict=h??!1,this.transformWithContainer=m??!1,this.autoResize=v??!1,this.collapsible=c??!0,this.autoToFront=g??!1,this.text.editable=!1,this.text.draggable=!1},e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this)},e.prototype.getData=function(){var n=this,r=t.prototype.getData.call(this),i=[];return gt(Array.from(this.children),function(o){var a=n.graphModel.getNodeModelById(o);a&&!a.virtual&&i.push(o)}),r.children=i,r.properties&&(r.properties.children=i,r.properties.isCollapsed=this.isCollapsed),r},e.prototype.getNodesInGroup=function(n){var r=[];return n.isGroup&>(Array.from(n.children),function(i){r.push(i)}),r},e.prototype.getMoveDistance=function(n,r,i){i===void 0&&(i=!1);var o=qo(t.prototype.getMoveDistance.call(this,n,r,i),2),a=o[0],s=o[1],l=this.getNodesInGroup(this);return this.graphModel.moveNodes(l,n,r,i),[a,s]},e.prototype.getHistoryData=function(){var n=t.prototype.getHistoryData.call(this);n.children=Array.from(this.children),n.isGroup=!0;var r=this,i=r.x,o=r.y,a=r.collapsedWidth,s=r.collapsedHeight,l=r.expandWidth,u=r.expandHeight,c=r.isCollapsed;return c&&(n.x=i+l/2-a/2,n.y=o+u/2-s/2,n.text&&(n.text.x=n.text.x+l/2-a/2,n.text.y=n.text.y+u/2-s/2)),n},e.prototype.toggleCollapse=function(n){var r=this,i=this.graphModel,o=!!n;this.isCollapsed=o,this.setProperties({isCollapsed:o}),i.eventCenter.emit("dynamicGroup:collapse",{collapse:o,nodeModel:this}),o?this.collapse():this.expand();var a=us(us([],qo(this.incoming.edges),!1),qo(this.outgoing.edges),!1),s=Array.from(this.children);gt(s,function(l){var u,c,d=r.graphModel.elementsModelMap.get(l);if(d){var f=d.isCollapsed;if(d.isGroup){var h=d;if(h.isCollapsed||h.toggleCollapse(n),!n){var v=(u=r.childrenLastCollapseStateDict)===null||u===void 0?void 0:u.get(l);v!==void 0&&v!==d.isCollapsed&&h.toggleCollapse(v)}}if((c=r.childrenLastCollapseStateDict)===null||c===void 0||c.set(l,!!f),d.visible=!n,d.BaseType===Lt.NODE){var g=d.incoming.edges,m=d.outgoing.edges;a=us(us(us([],qo(a),!1),qo(g),!1),qo(m),!1)}}}),this.collapseEdge(o,a)},e.prototype.collapse=function(){var n=this,r=n.x,i=n.y,o=n.text,a=n.width,s=n.height,l=n.collapsedWidth,u=n.collapsedHeight;this.x=r-a/2+l/2,this.y=i-s/2+u/2,this.text.x=o.x-a/2+l/2,this.text.y=o.y-s/2+u/2,this.expandWidth=a,this.expandHeight=s,this.width=l,this.height=u},e.prototype.expand=function(){var n=this,r=n.x,i=n.y,o=n.text,a=n.expandWidth,s=n.expandHeight,l=n.collapsedWidth,u=n.collapsedHeight;this.width=a,this.height=s,this.x=r+this.width/2-l/2,this.y=i+this.height/2-u/2,this.text.x=o.x+this.width/2-l/2,this.text.y=o.y+this.height/2-u/2},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var r=this.graphModel.addEdge(n);r.virtual=!0,r.text.editable=!1,r.isCollapsedEdge=!0},e.prototype.collapseEdge=function(n,r){var i=this,o=this.graphModel;gt(r,function(a,s){var l,u=a.getData(),c=u.targetNodeId,d=u.sourceNodeId,f=Bu(Bu({},u),{id:"".concat(u.id,"__").concat(s),text:(l=u.text)===null||l===void 0?void 0:l.value});a.virtual&&o.deleteEdgeById(a.id);var h=o.dynamicGroup.getGroupByNodeId(c);h||(h=o.getNodeModelById(c));var v=o.dynamicGroup.getGroupByNodeId(d);v||(v=o.getNodeModelById(d)),n&&a.visible&&(i.children.has(d)||i.id===d?(f.startPoint=void 0,f.sourceNodeId=i.id):(f.endPoint=void 0,f.targetNodeId=i.id),(h.id!==i.id||v.id!==i.id)&&i.createVirtualEdge(f),a.visible=!1),!n&&!a.visible&&(h&&h.isGroup&&h.isCollapsed?(f.targetNodeId=h.id,f.endPoint=void 0,i.createVirtualEdge(f)):v&&v.isGroup&&v.isCollapsed?(f.sourceNodeId=v.id,f.startPoint=void 0,i.createVirtualEdge(f)):a.visible=!0)})},e.prototype.isAllowAppendIn=function(n){return!0},e.prototype.setAllowAppendChild=function(n){this.groupAddable=n},e.prototype.addChild=function(n){this.children.add(n);var r=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:r,childId:n})},e.prototype.removeChild=function(n){this.children.delete(n);var r=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:r})},e.prototype.toBack=function(){this.zIndex--},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.getAnchorStyle=function(){var n=t.prototype.getAnchorStyle.call(this);return n.stroke="transparent",n.fill="transparent",n.hover&&(n.hover.fill="transparent",n.hover.stroke="transparent"),n},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},cp([X],e.prototype,"isCollapsed",void 0),cp([X],e.prototype,"groupAddable",void 0),cp([X],e.prototype,"transformWithContainer",void 0),e})(Uo);var k0=function(){return k0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},k0.apply(this,arguments)},B0;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(B0||(B0={}));var jF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cs=function(){return cs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},cs.apply(this,arguments)},FF=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},$F=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},HF=function(t){jF(e,t);function e(n){var r=t.call(this,n)||this;r.textRef=pl(),r.setHoverOn=function(){var l=r.props.element;l.isDragging||r.state.isHovered||(r.setState({isHovered:!0}),l.setHovered(!0))},r.setHoverOff=function(){var l=r.props.element;r.state.isHovered&&(r.setState({isHovered:!1}),l.setHovered(!1))},r.handleMouseDown=function(l){var u,c=r.props,d=c.label,f=c.graphModel,h=f.editConfigModel.nodeTextDraggable;((u=d.draggable)!==null&&u!==void 0?u:h)&&!r.state.isDragging&&!r.state.isEditing&&r.stepDrag.handleMouseDown(l)},r.handleMouseUp=function(l){r.state.isDragging&&r.stepDrag.handleMouseUp(l)},r.handleDragging=function(l){var u=l.deltaX,c=l.deltaY;r.state.isDragging||r.setState({isDragging:!0});var d=r.props,f=d.label,h=d.graphModel,v=h.transformModel,g=$F(v.fixDeltaXY(u,c),2),m=g[0],y=g[1];r.setElementModelLabelInfo({x:f.x+m,y:f.y+y}),h.eventCenter.emit("label:drag",{data:f.getData(),model:f})},r.handleDragEnd=function(){r.setState({isDragging:!1})},r.handleClick=function(l){var u=r.props,c=u.label,d=u.element,f=u.graphModel;d.setSelected(!r.state.isSelected),r.setState({isSelected:!r.state.isSelected}),r.setElementModelLabelInfo({isSelected:!0}),f.eventCenter.emit("label:click",{data:c.getData(),e:l,model:d})},r.handleDbClick=function(l){var u=r.props,c=u.label,d=u.element,f=u.graphModel;if(f.eventCenter.emit("label:dblclick",{data:c.getData(),e:l,model:d}),!c.editable){d.setSelected(!0);return}if(d.setSelected(),d.setElementState(lt.TEXT_EDIT),r.setState({isEditing:!0}),r.textRef.current){r.textRef.current.contentEditable="true",r.textRef.current.focus();var h=document.createRange(),v=window.getSelection();h.selectNodeContents(r.textRef.current),h.collapse(!1),v==null||v.removeAllRanges(),v==null||v.addRange(h)}},r.handleBlur=function(l){var u=r.props,c=u.label,d=u.element,f=u.graphModel.eventCenter;f.emit("label:blur",{e:l,model:d,data:c.getData(),element:r.textRef.current}),r.setState({isDragging:!1,isHovered:!1,isSelected:!1})},r.handleInput=function(l){var u=r.props,c=u.label,d=u.graphModel;d.eventCenter.emit("label:input",{e:l,data:c.getData()})},r.reCalcLabelSize=function(){};var i=n.label,o=n.graphModel,a=o.gridSize,s=o.eventCenter;return r.stepDrag=new tr({onDragging:r.handleDragging,onDragEnd:r.handleDragEnd,step:a,eventType:"LABEL",model:i,eventCenter:s}),r.state={isEditing:!1,isHovered:!1,isDragging:!1,isSelected:!1},r}return e.prototype.setElementModelLabelInfo=function(n){var r=this.props,i=r.label,o=r.element,a=r.graphModel,s=o.properties._label,l=s,u=Yc(l,function(f){return f.id===i.id}),c=l[u];l[u]=cs(cs({},c),n);var d=a.getElement(o.id);d==null||d.setProperty("_label",l)},e.prototype.componentDidMount=function(){var n=this,r=this.props,i=r.label,o=r.element,a=r.graphModel;a.eventCenter.on("blank:click,node:click,edge:click,label:click",function(s){var l,u,c,d,f=s.data;if(((f==null?void 0:f.type)!=="label"||f.type==="label"&&f.id!==i.id||n.state.isSelected)&&n.setState({isSelected:!1}),((f==null?void 0:f.type)!=="label"||f.type=="label"&&f.id!==i.id)&&n.state.isEditing){n.setState({isEditing:!1});var h=(u=(l=n.textRef.current)===null||l===void 0?void 0:l.innerText)!==null&&u!==void 0?u:"",v=(d=(c=n.textRef.current)===null||c===void 0?void 0:c.innerHTML)!==null&&d!==void 0?d:"";n.setElementModelLabelInfo({value:h,content:v,isSelected:!1}),o.setElementState(lt.DEFAULT)}((f==null?void 0:f.type)!=="label"||f.type=="label"&&f.id!==i.id)&&n.textRef.current&&(n.textRef.current.contentEditable="false")})},e.prototype.componentDidUpdate=function(){},e.prototype.componentWillUnmount=function(){var n=this.props.graphModel;n.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var n,r=this.props,i=r.label,o=r.element,a=r.graphModel,s=this.state,l=s.isDragging,u=s.isHovered,c=s.isSelected,d=s.isEditing,f=a.transformModel,h=f.getTransformStyle().transform,v=i.id,g=i.x,m=i.y,y=i.zIndex,x=i.vertical,E=i.style,b=i.rotate,T=i.content,A=i.labelWidth,S=i.textOverflowMode,M=A??(o.BaseType==="node"?o.width-20:80),C={left:"".concat(g-M/2,"px"),top:"".concat(m-10,"px"),width:"".concat(M,"px"),height:"20px",zIndex:y??1,transform:b?"".concat(h," rotate(").concat(b,"deg)"):"".concat(h," rotate(").concat(x?-.25:0,"turn)")};return V("div",{id:"element-container-".concat(v),className:kf("lf-label-editor-container"),style:C,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:V("div",{ref:this.textRef,id:"editor-container-".concat(v),className:kf("lf-label-editor",(n={"lf-label-editor-dragging":l,"lf-label-editor-editing":d,"lf-label-editor-hover":!d&&(u||c)},n["lf-label-editor-".concat(S)]=!d,n)),onInput:this.handleInput,style:cs({maxWidth:"".concat(M,"px"),boxSizing:"border-box",display:"inline-block",background:d||o.BaseType==="edge"?"#fff":"transparent"},E),dangerouslySetInnerHTML:{__html:T}})})},e=FF([vn],e),e}(Qe),ar=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},zF=Si,WF=function(){function t(e,n,r){var i;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=n,this.graphModel=r,this.id=(i=e.id)!==null&&i!==void 0?i:zF(),this.initLabelData(e)}return t.prototype.initLabelData=function(e){ut(this,e)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,type:"label",content:this.content,value:this.value,rotate:this.rotate,style:mr(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},ar([X],t.prototype,"x",void 0),ar([X],t.prototype,"y",void 0),ar([X],t.prototype,"content",void 0),ar([X],t.prototype,"value",void 0),ar([X],t.prototype,"rotate",void 0),ar([X],t.prototype,"style",void 0),ar([X],t.prototype,"zIndex",void 0),ar([X],t.prototype,"vertical",void 0),ar([X],t.prototype,"editable",void 0),ar([X],t.prototype,"draggable",void 0),ar([X],t.prototype,"labelWidth",void 0),ar([X],t.prototype,"textOverflowMode",void 0),t}(),ju={exports:{}},dp=ju.exports,j0;function UF(){return j0||(j0=1,function(t){/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */"classList"in document.createElement("_")||function(e){if("Element"in e){var n="classList",r="prototype",i=e.Element[r],o=Object,a=String[r].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[r].indexOf||function(v){for(var g=0,m=this.length;g<m;g++)if(g in this&&this[g]===v)return g;return-1},l=function(v,g){this.name=v,this.code=DOMException[v],this.message=g},u=function(v,g){if(g==="")throw new l("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(g))throw new l("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(v,g)},c=function(v){for(var g=a.call(v.getAttribute("class")||""),m=g?g.split(/\s+/):[],y=0,x=m.length;y<x;y++)this.push(m[y]);this._updateClassName=function(){v.setAttribute("class",this.toString())}},d=c[r]=[],f=function(){return new c(this)};if(l[r]=Error[r],d.item=function(v){return this[v]||null},d.contains=function(v){return v+="",u(this,v)!==-1},d.add=function(){var v=arguments,g=0,m=v.length,y,x=!1;do y=v[g]+"",u(this,y)===-1&&(this.push(y),x=!0);while(++g<m);x&&this._updateClassName()},d.remove=function(){var v=arguments,g=0,m=v.length,y,x=!1,E;do for(y=v[g]+"",E=u(this,y);E!==-1;)this.splice(E,1),x=!0,E=u(this,y);while(++g<m);x&&this._updateClassName()},d.toggle=function(v,g){v+="";var m=this.contains(v),y=m?g!==!0&&"remove":g!==!1&&"add";return y&&this[y](v),g===!0||g===!1?g:!m},d.toString=function(){return this.join(" ")},o.defineProperty){var h={get:f,enumerable:!0,configurable:!0};try{o.defineProperty(i,n,h)}catch(v){v.number===-2146823252&&(h.enumerable=!1,o.defineProperty(i,n,h))}}else o[r].__defineGetter__&&i.__defineGetter__(n,f)}}(self);/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */(function(e){if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{new Blob;return}catch{}var n=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||function(i){var o=function(S){return Object.prototype.toString.call(S).match(/^\[object\s(.*)\]$/)[1]},a=function(){this.data=[]},s=function(M,C,G){this.data=M,this.size=M.length,this.type=C,this.encoding=G},l=a.prototype,u=s.prototype,c=i.FileReaderSync,d=function(S){this.code=this[this.name=S]},f="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),h=f.length,v=i.URL||i.webkitURL||i,g=v.createObjectURL,m=v.revokeObjectURL,y=v,x=i.btoa,E=i.atob,b=i.ArrayBuffer,T=i.Uint8Array,A=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(s.fake=u.fake=!0;h--;)d.prototype[f[h]]=h+1;return v.createObjectURL||(y=i.URL=function(S){var M=document.createElementNS("http://www.w3.org/1999/xhtml","a"),C;return M.href=S,"origin"in M||(M.protocol.toLowerCase()==="data:"?M.origin=null:(C=S.match(A),M.origin=C&&C[1])),M}),y.createObjectURL=function(S){var M=S.type,C;if(M===null&&(M="application/octet-stream"),S instanceof s)return C="data:"+M,S.encoding==="base64"?C+";base64,"+S.data:S.encoding==="URI"?C+","+decodeURIComponent(S.data):x?C+";base64,"+x(S.data):C+","+encodeURIComponent(S.data);if(g)return g.call(v,S)},y.revokeObjectURL=function(S){S.substring(0,5)!=="data:"&&m&&m.call(v,S)},l.append=function(S){var M=this.data;if(T&&(S instanceof b||S instanceof T)){for(var C="",G=new T(S),K=0,J=G.length;K<J;K++)C+=String.fromCharCode(G[K]);M.push(C)}else if(o(S)==="Blob"||o(S)==="File")if(c){var R=new c;M.push(R.readAsBinaryString(S))}else throw new d("NOT_READABLE_ERR");else S instanceof s?S.encoding==="base64"&&E?M.push(E(S.data)):S.encoding==="URI"?M.push(decodeURIComponent(S.data)):S.encoding==="raw"&&M.push(S.data):(typeof S!="string"&&(S+=""),M.push(unescape(encodeURIComponent(S))))},l.getBlob=function(S){return arguments.length||(S=null),new s(this.data.join(""),S,"raw")},l.toString=function(){return"[object BlobBuilder]"},u.slice=function(S,M,C){var G=arguments.length;return G<3&&(C=null),new s(this.data.slice(S,G>1?M:this.data.length),C,this.encoding)},u.toString=function(){return"[object Blob]"},u.close=function(){this.size=0,delete this.data},a}(e);e.Blob=function(i,o){var a=o&&o.type||"",s=new n;if(i)for(var l=0,u=i.length;l<u;l++)Uint8Array&&i[l]instanceof Uint8Array?s.append(i[l].buffer):s.append(i[l]);var c=s.getBlob(a);return!c.slice&&c.webkitSlice&&(c.slice=c.webkitSlice),c};var r=Object.getPrototypeOf||function(i){return i.__proto__};e.Blob.prototype=r(new e.Blob)})(typeof self<"u"&&self||typeof window<"u"&&window||dp.content||dp),function(e,n){var r=typeof process<"u"&&process&&process.versions&&process.versions.electron;r?e.MediumEditor=n:t.exports=n}(dp,function(){function e(n,r){return this.init(n,r)}return e.extensions={},function(n){function r(l,u){var c,d=Array.prototype.slice.call(arguments,2);u=u||{};for(var f=0;f<d.length;f++){var h=d[f];if(h)for(c in h)h.hasOwnProperty(c)&&typeof h[c]<"u"&&(l||u.hasOwnProperty(c)===!1)&&(u[c]=h[c])}return u}var i=!1;try{var o=document.createElement("div"),a=document.createTextNode(" ");o.appendChild(a),i=o.contains(a)}catch{}var s={isIE:navigator.appName==="Microsoft Internet Explorer"||navigator.appName==="Netscape"&&new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)!==null,isEdge:/Edge\/\d+/.exec(navigator.userAgent)!==null,isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:n.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(l){return!!(s.isMac&&l.metaKey||!s.isMac&&l.ctrlKey)},isKey:function(l,u){var c=s.getKeyCode(l);return Array.isArray(u)===!1?c===u:u.indexOf(c)!==-1},getKeyCode:function(l){var u=l.which;return u===null&&(u=l.charCode!==null?l.charCode:l.keyCode),u},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var u=[!0].concat(Array.prototype.slice.call(arguments));return r.apply(this,u)},defaults:function(){var u=[!1].concat(Array.prototype.slice.call(arguments));return r.apply(this,u)},createLink:function(l,u,c,d){var f=l.createElement("a");return s.moveTextRangeIntoElement(u[0],u[u.length-1],f),f.setAttribute("href",c),d&&(d==="_blank"&&f.setAttribute("rel","noopener noreferrer"),f.setAttribute("target",d)),f},findOrCreateMatchingTextNodes:function(l,u,c){for(var d=l.createTreeWalker(u,NodeFilter.SHOW_ALL,null,!1),f=[],h=0,v=!1,g=null,m=null;(g=d.nextNode())!==null;)if(!(g.nodeType>3))if(g.nodeType===3){if(!v&&c.start<h+g.nodeValue.length&&(v=!0,m=s.splitStartNodeIfNeeded(g,c.start,h)),v&&s.splitEndNodeIfNeeded(g,m,c.end,h),v&&h===c.end)break;if(v&&h>c.end+1)throw new Error("PerformLinking overshot the target!");v&&f.push(m||g),h+=g.nodeValue.length,m!==null&&(h+=m.nodeValue.length,d.nextNode()),m=null}else g.tagName.toLowerCase()==="img"&&(!v&&c.start<=h&&(v=!0),v&&f.push(g));return f},splitStartNodeIfNeeded:function(l,u,c){return u!==c?l.splitText(u-c):null},splitEndNodeIfNeeded:function(l,u,c,d){var f,h;f=d+l.nodeValue.length+(u?u.nodeValue.length:0)-1,h=c-d-(u?l.nodeValue.length:0),f>=c&&d!==f&&h!==0&&(u||l).splitText(h)},splitByBlockElements:function(l){if(l.nodeType!==3&&l.nodeType!==1)return[];var u=[],c=e.util.blockContainerElementNames.join(",");if(l.nodeType===3||l.querySelectorAll(c).length===0)return[l];for(var d=0;d<l.childNodes.length;d++){var f=l.childNodes[d];if(f.nodeType===3)u.push(f);else if(f.nodeType===1){var h=f.querySelectorAll(c);h.length===0?u.push(f):u=u.concat(e.util.splitByBlockElements(f))}}return u},findAdjacentTextNodeWithContent:function(u,c,d){var f=!1,h,v=d.createNodeIterator(u,NodeFilter.SHOW_TEXT,null,!1);for(h=v.nextNode();h;){if(h===c)f=!0;else if(f&&h.nodeType===3&&h.nodeValue&&h.nodeValue.trim().length>0)break;h=v.nextNode()}return h},findPreviousSibling:function(l){if(!l||s.isMediumEditorElement(l))return!1;for(var u=l.previousSibling;!u&&!s.isMediumEditorElement(l.parentNode);)l=l.parentNode,u=l.previousSibling;return u},isDescendant:function(u,c,d){if(!u||!c)return!1;if(u===c)return!!d;if(u.nodeType!==1)return!1;if(i||c.nodeType!==3)return u.contains(c);for(var f=c.parentNode;f!==null;){if(f===u)return!0;f=f.parentNode}return!1},isElement:function(u){return!!(u&&u.nodeType===1)},throttle:function(l,u){var c=50,d,f,h,v=null,g=0,m=function(){g=Date.now(),v=null,h=l.apply(d,f),v||(d=f=null)};return!u&&u!==0&&(u=c),function(){var y=Date.now(),x=u-(y-g);return d=this,f=arguments,x<=0||x>u?(v&&(clearTimeout(v),v=null),g=y,h=l.apply(d,f),v||(d=f=null)):v||(v=setTimeout(m,x)),h}},traverseUp:function(l,u){if(!l)return!1;do{if(l.nodeType===1){if(u(l))return l;if(s.isMediumEditorElement(l))return!1}l=l.parentNode}while(l);return!1},htmlEntities:function(l){return String(l).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(l,u){var c,d,f,h,v,g,m,y=!1,x=["insertHTML",!1,u];if(!e.util.isEdge&&l.queryCommandSupported("insertHTML"))try{return l.execCommand.apply(l,x)}catch{}if(c=l.getSelection(),c.rangeCount){if(d=c.getRangeAt(0),m=d.commonAncestorContainer,s.isMediumEditorElement(m)&&!m.firstChild)d.selectNode(m.appendChild(l.createTextNode("")));else if(m.nodeType===3&&d.startOffset===0&&d.endOffset===m.nodeValue.length||m.nodeType!==3&&m.innerHTML===d.toString()){for(;!s.isMediumEditorElement(m)&&m.parentNode&&m.parentNode.childNodes.length===1&&!s.isMediumEditorElement(m.parentNode);)m=m.parentNode;d.selectNode(m)}for(d.deleteContents(),f=l.createElement("div"),f.innerHTML=u,h=l.createDocumentFragment();f.firstChild;)v=f.firstChild,g=h.appendChild(v);d.insertNode(h),g&&(d=d.cloneRange(),d.setStartAfter(g),d.collapse(!0),e.selection.selectRange(l,d)),y=!0}return l.execCommand.callListeners&&l.execCommand.callListeners(x,y),y},execFormatBlock:function(l,u){var c=s.getTopBlockContainer(e.selection.getSelectionStart(l)),d;if(u==="blockquote"){if(c&&(d=Array.prototype.slice.call(c.childNodes),d.some(function(f){return s.isBlockContainer(f)})))return l.execCommand("outdent",!1,null);if(s.isIE)return l.execCommand("indent",!1,u)}if(c&&u===c.nodeName.toLowerCase()&&(u="p"),s.isIE&&(u="<"+u+">"),c&&c.nodeName.toLowerCase()==="blockquote"){if(s.isIE&&u==="<p>")return l.execCommand("outdent",!1,u);if((s.isFF||s.isEdge)&&u==="p")return d=Array.prototype.slice.call(c.childNodes),d.some(function(f){return!s.isBlockContainer(f)})&&l.execCommand("formatBlock",!1,u),l.execCommand("outdent",!1,u)}return l.execCommand("formatBlock",!1,u)},setTargetBlank:function(l,u){var c,d=u||!1;if(l.nodeName.toLowerCase()==="a")l.target="_blank",l.rel="noopener noreferrer";else for(l=l.getElementsByTagName("a"),c=0;c<l.length;c+=1)(d===!1||d===l[c].attributes.href.value)&&(l[c].target="_blank",l[c].rel="noopener noreferrer")},removeTargetBlank:function(l,u){var c;if(l.nodeName.toLowerCase()==="a")l.removeAttribute("target"),l.removeAttribute("rel");else for(l=l.getElementsByTagName("a"),c=0;c<l.length;c+=1)u===l[c].attributes.href.value&&(l[c].removeAttribute("target"),l[c].removeAttribute("rel"))},addClassToAnchors:function(l,u){var c=u.split(" "),d,f;if(l.nodeName.toLowerCase()==="a")for(f=0;f<c.length;f+=1)l.classList.add(c[f]);else{var h=l.getElementsByTagName("a");if(h.length===0){var v=s.getClosestTag(l,"a");l=v?[v]:[]}else l=h;for(d=0;d<l.length;d+=1)for(f=0;f<c.length;f+=1)l[d].classList.add(c[f])}},isListItem:function(l){if(!l)return!1;if(l.nodeName.toLowerCase()==="li")return!0;for(var u=l.parentNode,c=u.nodeName.toLowerCase();c==="li"||!s.isBlockContainer(u)&&c!=="div";){if(c==="li")return!0;if(u=u.parentNode,u)c=u.nodeName.toLowerCase();else return!1}return!1},cleanListDOM:function(l,u){if(u.nodeName.toLowerCase()==="li"){var c=u.parentElement;c.parentElement.nodeName.toLowerCase()==="p"&&(s.unwrap(c.parentElement,l),e.selection.moveCursor(l,u.firstChild,u.firstChild.textContent.length))}},splitOffDOMTree:function(l,u,c){for(var d=u,f=null,h=!c;d!==l;){var v=d.parentNode,g=v.cloneNode(!1),m=h?d:v.firstChild,y;for(f&&(h?g.appendChild(f):y=f),f=g;m;){var x=m.nextSibling;m===d?(m.hasChildNodes()?m=m.cloneNode(!1):m.parentNode.removeChild(m),m.textContent&&f.appendChild(m),m=h?x:null):(m.parentNode.removeChild(m),(m.hasChildNodes()||m.textContent)&&f.appendChild(m),m=x)}y&&f.appendChild(y),d=v}return f},moveTextRangeIntoElement:function(l,u,c){if(!l||!u)return!1;var d=s.findCommonRoot(l,u);if(!d)return!1;if(u===l){var f=l.parentNode,h=l.nextSibling;return f.removeChild(l),c.appendChild(l),h?f.insertBefore(c,h):f.appendChild(c),c.hasChildNodes()}for(var v=[],g,m,y,x=0;x<d.childNodes.length;x++)if(y=d.childNodes[x],!g)s.isDescendant(y,l,!0)&&(g=y);else if(s.isDescendant(y,u,!0)){m=y;break}else v.push(y);var E=m.nextSibling,b=d.ownerDocument.createDocumentFragment();return g===l?(g.parentNode.removeChild(g),b.appendChild(g)):b.appendChild(s.splitOffDOMTree(g,l)),v.forEach(function(T){T.parentNode.removeChild(T),b.appendChild(T)}),m===u?(m.parentNode.removeChild(m),b.appendChild(m)):b.appendChild(s.splitOffDOMTree(m,u,!0)),c.appendChild(b),m.parentNode===d?d.insertBefore(c,m):E?d.insertBefore(c,E):d.appendChild(c),c.hasChildNodes()},depthOfNode:function(l){for(var u=0,c=l;c.parentNode!==null;)c=c.parentNode,u++;return u},findCommonRoot:function(l,u){for(var c=s.depthOfNode(l),d=s.depthOfNode(u),f=l,h=u;c!==d;)c>d?(f=f.parentNode,c-=1):(h=h.parentNode,d-=1);for(;f!==h;)f=f.parentNode,h=h.parentNode;return f},isElementAtBeginningOfBlock:function(l){for(var u,c;!s.isBlockContainer(l)&&!s.isMediumEditorElement(l);){for(c=l;c=c.previousSibling;)if(u=c.nodeType===3?c.nodeValue:c.textContent,u.length>0)return!1;l=l.parentNode}return!0},isMediumEditorElement:function(l){return l&&l.getAttribute&&!!l.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(l){return s.traverseUp(l,function(u){return s.isMediumEditorElement(u)})},isBlockContainer:function(l){return l&&l.nodeType!==3&&s.blockContainerElementNames.indexOf(l.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(l){return s.traverseUp(l,function(u){return s.isBlockContainer(u)||s.isMediumEditorElement(u)})},getTopBlockContainer:function(l){var u=s.isBlockContainer(l)?l:!1;return s.traverseUp(l,function(c){return s.isBlockContainer(c)&&(u=c),!u&&s.isMediumEditorElement(c)?(u=c,!0):!1}),u},getFirstSelectableLeafNode:function(l){for(;l&&l.firstChild;)l=l.firstChild;if(l=s.traverseUp(l,function(c){return s.emptyElementNames.indexOf(c.nodeName.toLowerCase())===-1}),l.nodeName.toLowerCase()==="table"){var u=l.querySelector("th, td");u&&(l=u)}return l},getFirstTextNode:function(l){return s.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),s._getFirstTextNode(l)},_getFirstTextNode:function(l){if(l.nodeType===3)return l;for(var u=0;u<l.childNodes.length;u++){var c=s._getFirstTextNode(l.childNodes[u]);if(c!==null)return c}return null},ensureUrlHasProtocol:function(l){return l.indexOf("://")===-1?"http://"+l:l},warn:function(){n.console!==void 0&&typeof n.console.warn=="function"&&n.console.warn.apply(n.console,arguments)},deprecated:function(l,u,c){var d=l+" is deprecated, please use "+u+" instead.";c&&(d+=" Will be removed in "+c),s.warn(d)},deprecatedMethod:function(l,u,c,d){s.deprecated(l,u,d),typeof this[u]=="function"&&this[u].apply(this,c)},cleanupAttrs:function(l,u){u.forEach(function(c){l.removeAttribute(c)})},cleanupTags:function(l,u){u.indexOf(l.nodeName.toLowerCase())!==-1&&l.parentNode.removeChild(l)},unwrapTags:function(l,u){u.indexOf(l.nodeName.toLowerCase())!==-1&&e.util.unwrap(l,document)},getClosestTag:function(l,u){return s.traverseUp(l,function(c){return c.nodeName.toLowerCase()===u.toLowerCase()})},unwrap:function(l,u){for(var c=u.createDocumentFragment(),d=Array.prototype.slice.call(l.childNodes),f=0;f<d.length;f++)c.appendChild(d[f]);c.childNodes.length?l.parentNode.replaceChild(c,l):l.parentNode.removeChild(l)},guid:function(){function l(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return l()+l()+"-"+l()+"-"+l()+"-"+l()+"-"+l()+l()+l()}};e.util=s}(window),function(){var n=function(r){e.util.extend(this,r)};n.extend=function(r){var i=this,o;r&&r.hasOwnProperty("constructor")?o=r.constructor:o=function(){return i.apply(this,arguments)},e.util.extend(o,i);var a=function(){this.constructor=o};return a.prototype=i.prototype,o.prototype=new a,r&&e.util.extend(o.prototype,r),o},n.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(r){return this.base.options[r]}},["execAction","on","off","subscribe","trigger"].forEach(function(r){n.prototype[r]=function(){return this.base[r].apply(this.base,arguments)}}),e.Extension=n}(),function(){function n(i){return e.util.isBlockContainer(i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var r={findMatchingSelectionParent:function(i,o){var a=o.getSelection(),s,l;return a.rangeCount===0?!1:(s=a.getRangeAt(0),l=s.commonAncestorContainer,e.util.traverseUp(l,i))},getSelectionElement:function(i){return this.findMatchingSelectionParent(function(o){return e.util.isMediumEditorElement(o)},i)},exportSelection:function(i,o){if(!i)return null;var a=null,s=o.getSelection();if(s.rangeCount>0){var l=s.getRangeAt(0),u=l.cloneRange(),c;u.selectNodeContents(i),u.setEnd(l.startContainer,l.startOffset),c=u.toString().length,a={start:c,end:c+l.toString().length},this.doesRangeStartWithImages(l,o)&&(a.startsWithImage=!0);var d=this.getTrailingImageCount(i,a,l.endContainer,l.endOffset);if(d&&(a.trailingImageCount=d),c!==0){var f=this.getIndexRelativeToAdjacentEmptyBlocks(o,i,l.startContainer,l.startOffset);f!==-1&&(a.emptyBlocksIndex=f)}}return a},importSelection:function(i,o,a,s){if(!(!i||!o)){var l=a.createRange();l.setStart(o,0),l.collapse(!0);var u=o,c=[],d=0,f=!1,h=!1,v=0,g=!1,m,y=!1,x=null;for((s||i.startsWithImage||typeof i.emptyBlocksIndex<"u")&&(y=!0);!g&&u;){if(u.nodeType>3){u=c.pop();continue}if(u.nodeType===3&&!h)m=d+u.length,!f&&i.start>=d&&i.start<=m&&(y||i.start<m?(l.setStart(u,i.start-d),f=!0):x=u),f&&i.end>=d&&i.end<=m&&(i.trailingImageCount?h=!0:(l.setEnd(u,i.end-d),g=!0)),d=m;else{if(i.trailingImageCount&&h&&(u.nodeName.toLowerCase()==="img"&&v++,v===i.trailingImageCount)){for(var E=0;u.parentNode.childNodes[E]!==u;)E++;l.setEnd(u.parentNode,E+1),g=!0}if(!g&&u.nodeType===1)for(var b=u.childNodes.length-1;b>=0;)c.push(u.childNodes[b]),b-=1}g||(u=c.pop())}!f&&x&&(l.setStart(x,x.length),l.setEnd(x,x.length)),typeof i.emptyBlocksIndex<"u"&&(l=this.importSelectionMoveCursorPastBlocks(a,o,i.emptyBlocksIndex,l)),s&&(l=this.importSelectionMoveCursorPastAnchor(i,l)),this.selectRange(a,l)}},importSelectionMoveCursorPastAnchor:function(i,o){var a=function(d){return d.nodeName.toLowerCase()==="a"};if(i.start===i.end&&o.startContainer.nodeType===3&&o.startOffset===o.startContainer.nodeValue.length&&e.util.traverseUp(o.startContainer,a)){for(var s=o.startContainer,l=o.startContainer.parentNode;l!==null&&l.nodeName.toLowerCase()!=="a";)l.childNodes[l.childNodes.length-1]!==s?l=null:(s=l,l=l.parentNode);if(l!==null&&l.nodeName.toLowerCase()==="a"){for(var u=null,c=0;u===null&&c<l.parentNode.childNodes.length;c++)l.parentNode.childNodes[c]===l&&(u=c);o.setStart(l.parentNode,u+1),o.collapse(!0)}}return o},importSelectionMoveCursorPastBlocks:function(i,o,a,s){var l=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,n,!1),u=s.startContainer,c,d,f=0;for(a=a||1,u.nodeType===3&&e.util.isBlockContainer(u.previousSibling)?c=u.previousSibling:c=e.util.getClosestBlockContainer(u);l.nextNode();)if(!d)c===l.currentNode&&(d=l.currentNode);else if(d=l.currentNode,f++,f===a||d.textContent.length>0)break;return d||(d=c),s.setStart(e.util.getFirstSelectableLeafNode(d),0),s},getIndexRelativeToAdjacentEmptyBlocks:function(i,o,a,s){if(a.textContent.length>0&&s>0)return-1;var l=a;if(l.nodeType!==3&&(l=a.childNodes[s]),l){if(!e.util.isElementAtBeginningOfBlock(l))return-1;var u=e.util.findPreviousSibling(l);if(u){if(u.nodeValue)return-1}else return-1}for(var c=e.util.getClosestBlockContainer(a),d=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,n,!1),f=0;d.nextNode();){var h=d.currentNode.textContent==="";if((h||f>0)&&(f+=1),d.currentNode===c)return f;h||(f=0)}return f},doesRangeStartWithImages:function(i,o){if(i.startOffset!==0||i.startContainer.nodeType!==1)return!1;if(i.startContainer.nodeName.toLowerCase()==="img")return!0;var a=i.startContainer.querySelector("img");if(!a)return!1;for(var s=o.createTreeWalker(i.startContainer,NodeFilter.SHOW_ALL,null,!1);s.nextNode();){var l=s.currentNode;if(l===a)break;if(l.nodeValue)return!1}return!0},getTrailingImageCount:function(i,o,a,s){if(s===0||a.nodeType!==1||a.nodeName.toLowerCase()!=="img"&&!a.querySelector("img"))return 0;for(var l=a.childNodes[s-1];l.hasChildNodes();)l=l.lastChild;for(var u=i,c=[],d=0,f=!1,h=!1,v=!1,g,m=0;!v&&u;){if(u.nodeType>3){u=c.pop();continue}if(u.nodeType===3&&!h)m=0,g=d+u.length,!f&&o.start>=d&&o.start<=g&&(f=!0),f&&o.end>=d&&o.end<=g&&(h=!0),d=g;else if(u.nodeName.toLowerCase()==="img"&&m++,u===l)v=!0;else if(u.nodeType===1)for(var y=u.childNodes.length-1;y>=0;)c.push(u.childNodes[y]),y-=1;v||(u=c.pop())}return m},selectionContainsContent:function(i){var o=i.getSelection();if(!o||o.isCollapsed||!o.rangeCount)return!1;if(o.toString().trim()!=="")return!0;var a=this.getSelectedParentElement(o.getRangeAt(0));return!!(a&&(a.nodeName.toLowerCase()==="img"||a.nodeType===1&&a.querySelector("img")))},selectionInContentEditableFalse:function(i){var o,a=this.findMatchingSelectionParent(function(s){var l=s&&s.getAttribute("contenteditable");return l==="true"&&(o=!0),s.nodeName!=="#text"&&l==="false"},i);return!o&&a},getSelectionHtml:function(o){var a,s="",l=o.getSelection(),u,c;if(l.rangeCount){for(c=o.createElement("div"),a=0,u=l.rangeCount;a<u;a+=1)c.appendChild(l.getRangeAt(a).cloneContents());s=c.innerHTML}return s},getCaretOffsets:function(o,a){var s,l;return a||(a=window.getSelection().getRangeAt(0)),s=a.cloneRange(),l=a.cloneRange(),s.selectNodeContents(o),s.setEnd(a.endContainer,a.endOffset),l.selectNodeContents(o),l.setStart(a.endContainer,a.endOffset),{left:s.toString().length,right:l.toString().length}},rangeSelectsSingleNode:function(i){var o=i.startContainer;return o===i.endContainer&&o.hasChildNodes()&&i.endOffset===i.startOffset+1},getSelectedParentElement:function(i){return i?this.rangeSelectsSingleNode(i)&&i.startContainer.childNodes[i.startOffset].nodeType!==3?i.startContainer.childNodes[i.startOffset]:i.startContainer.nodeType===3?i.startContainer.parentNode:i.startContainer:null},getSelectedElements:function(i){var o=i.getSelection(),a,s,l;if(!o.rangeCount||o.isCollapsed||!o.getRangeAt(0).commonAncestorContainer)return[];if(a=o.getRangeAt(0),a.commonAncestorContainer.nodeType===3){for(s=[],l=a.commonAncestorContainer;l.parentNode&&l.parentNode.childNodes.length===1;)s.push(l.parentNode),l=l.parentNode;return s}return[].filter.call(a.commonAncestorContainer.getElementsByTagName("*"),function(u){return typeof o.containsNode=="function"?o.containsNode(u,!0):!0})},selectNode:function(i,o){var a=o.createRange();a.selectNodeContents(i),this.selectRange(o,a)},select:function(i,o,a,s,l){var u=i.createRange();return u.setStart(o,a),s?u.setEnd(s,l):u.collapse(!0),this.selectRange(i,u),u},clearSelection:function(i,o){o?i.getSelection().collapseToStart():i.getSelection().collapseToEnd()},moveCursor:function(i,o,a){this.select(i,o,a)},getSelectionRange:function(i){var o=i.getSelection();return o.rangeCount===0?null:o.getRangeAt(0)},selectRange:function(i,o){var a=i.getSelection();a.removeAllRanges(),a.addRange(o)},getSelectionStart:function(i){var o=i.getSelection().anchorNode,a=o&&o.nodeType===3?o.parentNode:o;return a}};e.selection=r}(),function(){function n(i,o){return i?i.some(function(a){if(typeof a.getInteractionElements!="function")return!1;var s=a.getInteractionElements();return s?(Array.isArray(s)||(s=[s]),s.some(function(l){return e.util.isDescendant(l,o,!0)})):!1}):!1}var r=function(i){this.base=i,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};r.prototype={InputEventOnContenteditableSupported:!e.util.isIE&&!e.util.isEdge,attachDOMEvent:function(i,o,a,s){var l=this.base.options.contentWindow,u=this.base.options.ownerDocument;i=e.util.isElement(i)||[l,u].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,(function(c){c.addEventListener(o,a,s),this.events.push([c,o,a,s])}).bind(this))},detachDOMEvent:function(i,o,a,s){var l,u,c=this.base.options.contentWindow,d=this.base.options.ownerDocument;i&&(i=e.util.isElement(i)||[c,d].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,(function(f){l=this.indexOfListener(f,o,a,s),l!==-1&&(u=this.events.splice(l,1)[0],u[0].removeEventListener(u[1],u[2],u[3]))}).bind(this)))},indexOfListener:function(i,o,a,s){var l,u,c;for(l=0,u=this.events.length;l<u;l=l+1)if(c=this.events[l],c[0]===i&&c[1]===o&&c[2]===a&&c[3]===s)return l;return-1},detachAllDOMEvents:function(){for(var i=this.events.pop();i;)i[0].removeEventListener(i[1],i[2],i[3]),i=this.events.pop()},detachAllEventsFromElement:function(i){for(var o=this.events.filter(function(u){return u&&u[0].getAttribute&&u[0].getAttribute("medium-editor-index")===i.getAttribute("medium-editor-index")}),a=0,s=o.length;a<s;a++){var l=o[a];this.detachDOMEvent(l[0],l[1],l[2],l[3])}},attachAllEventsToElement:function(i){this.listeners.editableInput&&(this.contentCache[i.getAttribute("medium-editor-index")]=i.innerHTML),this.eventsCache&&this.eventsCache.forEach(function(o){this.attachDOMEvent(i,o.name,o.handler.bind(this))},this)},enableCustomEvent:function(i){this.disabledEvents[i]!==void 0&&delete this.disabledEvents[i]},disableCustomEvent:function(i){this.disabledEvents[i]=!0},attachCustomEvent:function(i,o){this.setupListener(i),this.customEvents[i]||(this.customEvents[i]=[]),this.customEvents[i].push(o)},detachCustomEvent:function(i,o){var a=this.indexOfCustomListener(i,o);a!==-1&&this.customEvents[i].splice(a,1)},indexOfCustomListener:function(i,o){return!this.customEvents[i]||!this.customEvents[i].length?-1:this.customEvents[i].indexOf(o)},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(i,o,a){this.customEvents[i]&&!this.disabledEvents[i]&&this.customEvents[i].forEach(function(s){s(o,a)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(i){i.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=(function(i){this.handleDocumentExecCommand(i)}).bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var i=this.options.ownerDocument;if(!(!this.execCommandListener||!i.execCommand.listeners)){var o=i.execCommand.listeners.indexOf(this.execCommandListener);o!==-1&&i.execCommand.listeners.splice(o,1),i.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var i=this.options.ownerDocument;if(!i.execCommand.listeners){var o=function(s,l){i.execCommand.listeners&&i.execCommand.listeners.forEach(function(u){u({command:s[0],value:s[2],args:s,result:l})})},a=function(){var s=i.execCommand.orig.apply(this,arguments);if(!i.execCommand.listeners)return s;var l=Array.prototype.slice.call(arguments);return o(l,s),s};a.orig=i.execCommand,a.listeners=[],a.callListeners=o,i.execCommand=a}},unwrapExecCommand:function(){var i=this.options.ownerDocument;i.execCommand.orig&&(i.execCommand=i.execCommand.orig)},setupListener:function(i){if(!this.listeners[i]){switch(i){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach(function(o){this.contentCache[o.getAttribute("medium-editor-index")]=o.innerHTML},this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste);break}this.listeners[i]=!0}},attachToEachElement:function(i,o){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach(function(a){this.attachDOMEvent(a,i,o.bind(this))},this),this.eventsCache.push({name:i,handler:o})},cleanupElement:function(i){var o=i.getAttribute("medium-editor-index");o&&(this.detachAllEventsFromElement(i),this.contentCache&&delete this.contentCache[o])},focusElement:function(i){i.focus(),this.updateFocus(i,{target:i,type:"focus"})},updateFocus:function(i,o){var a=this.base.getFocusedElement(),s;a&&o.type==="click"&&this.lastMousedownTarget&&(e.util.isDescendant(a,this.lastMousedownTarget,!0)||n(this.base.extensions,this.lastMousedownTarget))&&(s=a),s||this.base.elements.some(function(u){return!s&&e.util.isDescendant(u,i,!0)&&(s=u),!!s},this);var l=!e.util.isDescendant(a,i,!0)&&!n(this.base.extensions,i);s!==a&&(a&&l&&(a.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",o,a)),s&&(s.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",o,s))),l&&this.triggerCustomEvent("externalInteraction",o)},updateInput:function(i,o){if(this.contentCache){var a=i.getAttribute("medium-editor-index"),s=i.innerHTML;s!==this.contentCache[a]&&this.triggerCustomEvent("editableInput",o,i),this.contentCache[a]=s}},handleDocumentSelectionChange:function(i){if(i.currentTarget&&i.currentTarget.activeElement){var o=i.currentTarget.activeElement,a;this.base.elements.some(function(s){return e.util.isDescendant(s,o,!0)?(a=s,!0):!1},this),a&&this.updateInput(a,{target:o,currentTarget:a})}},handleDocumentExecCommand:function(){var i=this.base.getFocusedElement();i&&this.updateInput(i,{target:i,currentTarget:i})},handleBodyClick:function(i){this.updateFocus(i.target,i)},handleBodyFocus:function(i){this.updateFocus(i.target,i)},handleBodyMousedown:function(i){this.lastMousedownTarget=i.target},handleInput:function(i){this.updateInput(i.currentTarget,i)},handleClick:function(i){this.triggerCustomEvent("editableClick",i,i.currentTarget)},handleBlur:function(i){this.triggerCustomEvent("editableBlur",i,i.currentTarget)},handleKeypress:function(i){if(this.triggerCustomEvent("editableKeypress",i,i.currentTarget),this.keypressUpdateInput){var o={target:i.target,currentTarget:i.currentTarget};setTimeout((function(){this.updateInput(o.currentTarget,o)}).bind(this),0)}},handleKeyup:function(i){this.triggerCustomEvent("editableKeyup",i,i.currentTarget)},handleMouseover:function(i){this.triggerCustomEvent("editableMouseover",i,i.currentTarget)},handleDragging:function(i){this.triggerCustomEvent("editableDrag",i,i.currentTarget)},handleDrop:function(i){this.triggerCustomEvent("editableDrop",i,i.currentTarget)},handlePaste:function(i){this.triggerCustomEvent("editablePaste",i,i.currentTarget)},handleKeydown:function(i){if(this.triggerCustomEvent("editableKeydown",i,i.currentTarget),e.util.isKey(i,e.util.keyCode.SPACE))return this.triggerCustomEvent("editableKeydownSpace",i,i.currentTarget);if(e.util.isKey(i,e.util.keyCode.ENTER)||i.ctrlKey&&e.util.isKey(i,e.util.keyCode.M))return this.triggerCustomEvent("editableKeydownEnter",i,i.currentTarget);if(e.util.isKey(i,e.util.keyCode.TAB))return this.triggerCustomEvent("editableKeydownTab",i,i.currentTarget);if(e.util.isKey(i,[e.util.keyCode.DELETE,e.util.keyCode.BACKSPACE]))return this.triggerCustomEvent("editableKeydownDelete",i,i.currentTarget)}},e.Events=r}(),function(){var n=e.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(r){n.isBuiltInButton(r)?e.Extension.call(this,this.defaults[r]):e.Extension.call(this,r)},init:function(){e.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return typeof this.action=="function"?this.action(this.base.options):this.action},getAria:function(){return typeof this.aria=="function"?this.aria(this.base.options):this.aria},getTagNames:function(){return typeof this.tagNames=="function"?this.tagNames(this.base.options):this.tagNames},createButton:function(){var r=this.document.createElement("button"),i=this.contentDefault,o=this.getAria(),a=this.getEditorOption("buttonLabels");return r.classList.add("medium-editor-action"),r.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(s){r.classList.add(s)}),r.setAttribute("data-action",this.getAction()),o&&(r.setAttribute("title",o),r.setAttribute("aria-label",o)),this.attrs&&Object.keys(this.attrs).forEach(function(s){r.setAttribute(s,this.attrs[s])},this),a==="fontawesome"&&this.contentFA&&(i=this.contentFA),r.innerHTML=i,r},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=this.getAction();i&&this.execAction(i)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var r=null;return this.useQueryState&&(r=this.base.queryCommandState(this.getAction())),r},isAlreadyApplied:function(r){var i=!1,o=this.getTagNames(),a,s;return this.knownState===!1||this.knownState===!0?this.knownState:(o&&o.length>0&&(i=o.indexOf(r.nodeName.toLowerCase())!==-1),!i&&this.style&&(a=this.style.value.split("|"),s=this.window.getComputedStyle(r,null).getPropertyValue(this.style.prop),a.forEach(function(l){this.knownState||(i=s.indexOf(l)!==-1,(i||this.style.prop!=="text-decoration")&&(this.knownState=i))},this)),i)}});n.isBuiltInButton=function(r){return typeof r=="string"&&e.extensions.button.prototype.defaults.hasOwnProperty(r)},e.extensions.button=n}(),function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}}}(),function(){var n=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.hideToolbarDefaultActions()},setToolbarPosition:function(){var r=this.base.getExtensionByName("toolbar");r&&r.setToolbarPosition()}});e.extensions.form=n}(),function(){var n=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=e.selection.getSelectionRange(this.document);return i.startContainer.nodeName.toLowerCase()==="a"||i.endContainer.nodeName.toLowerCase()==="a"||e.util.getClosestTag(e.selection.getSelectedParentElement(i),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(r){e.util.isKey(r,e.util.keyCode.K)&&e.util.isMetaCtrlKey(r)&&!r.shiftKey&&this.handleClick(r)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var r=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return r.push('<a href="#" class="medium-editor-toolbar-save">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),r.push('<a href="#" class="medium-editor-toolbar-close">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&r.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&r.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),r.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(r){var i=this.getInput(),o=this.getAnchorTargetCheckbox(),a=this.getAnchorButtonCheckbox();if(r=r||{value:""},typeof r=="string"&&(r={value:r}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),i.value=r.value,i.focus(),o&&(o.checked=r.target==="_blank"),a){var s=r.buttonClass?r.buttonClass.split(" "):[];a.checked=s.indexOf(this.customClassOption)!==-1}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var r=this.getAnchorTargetCheckbox(),i=this.getAnchorButtonCheckbox(),o={value:this.getInput().value.trim()};return this.linkValidation&&(o.value=this.checkLinkFormat(o.value)),o.target="_self",r&&r.checked&&(o.target="_blank"),i&&i.checked&&(o.buttonClass=this.customClassOption),o},doFormSave:function(){var r=this.getFormOpts();this.completeFormSave(r)},completeFormSave:function(r){this.base.restoreSelection(),this.execAction(this.action,r),this.base.checkSelection()},ensureEncodedUri:function(r){return r===decodeURI(r)?encodeURI(r):r},ensureEncodedUriComponent:function(r){return r===decodeURIComponent(r)?encodeURIComponent(r):r},ensureEncodedParam:function(r){var i=r.split("="),o=i[0],a=i[1];return o+(a===void 0?"":"="+this.ensureEncodedUriComponent(a))},ensureEncodedQuery:function(r){return r.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(r){var i=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,o=i.test(r),a="",s=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,l=r.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),u=l[1],c=l[2],d=l[3];if(s.test(r))return"tel:"+r;if(!o){var f=u.split("/")[0];(f.match(/.+(\.|:).+/)||f==="localhost")&&(a="http://")}return a+this.ensureEncodedUri(u)+(c===void 0?"":"?"+this.ensureEncodedQuery(c))+(d===void 0?"":"#"+d)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(r){var i=r.querySelector(".medium-editor-toolbar-close"),o=r.querySelector(".medium-editor-toolbar-save"),a=r.querySelector(".medium-editor-toolbar-input");this.on(r,"click",this.handleFormClick.bind(this)),this.on(a,"keyup",this.handleTextboxKeyup.bind(this)),this.on(i,"click",this.handleCloseClick.bind(this)),this.on(o,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var r=this.document,i=r.createElement("div");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),i.innerHTML=this.getTemplate(),this.attachFormEvents(i),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(r){if(r.keyCode===e.util.keyCode.ENTER){r.preventDefault(),this.doFormSave();return}r.keyCode===e.util.keyCode.ESCAPE&&(r.preventDefault(),this.doFormCancel())},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.anchor=n}(),function(){var n=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var r=this.document.createElement("div");return r.id="medium-editor-anchor-preview-"+this.getEditorId(),r.className="medium-editor-anchor-preview",r.innerHTML=this.getTemplate(),this.on(r,"click",this.handleClick.bind(this)),r},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(r){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||r.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=r.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=r.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=r,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(r){r=r||this.activeAnchor;var i=this.window.innerWidth,o=this.anchorPreview.offsetHeight,a=r.getBoundingClientRect(),s=this.diffLeft,l=this.diffTop,u=this.getEditorOption("elementsContainer"),c=["absolute","fixed"].indexOf(window.getComputedStyle(u).getPropertyValue("position"))>-1,d={},f,h,v,g,m;f=this.anchorPreview.offsetWidth/2;var y=this.base.getExtensionByName("toolbar");y&&(s=y.diffLeft,l=y.diffTop),h=s-f,c?(g=u.getBoundingClientRect(),["top","left"].forEach(function(x){d[x]=a[x]-g[x]}),d.width=a.width,d.height=a.height,a=d,i=g.width,m=u.scrollTop):m=this.window.pageYOffset,v=a.left+a.width/2,m+=o+a.top+a.height-l-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(m)+"px",this.anchorPreview.style.right="initial",v<f?(this.anchorPreview.style.left=h+f+"px",this.anchorPreview.style.right="initial"):i-v<f?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=h+v+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(r){var i=this.base.getExtensionByName("anchor"),o=this.activeAnchor;i&&o&&(r.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay((function(){if(o){var a={value:o.attributes.href.value,target:o.getAttribute("target"),buttonClass:o.getAttribute("class")};i.showForm(a),o=null}}).bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(r){var i=e.util.getClosestTag(r.target,"a");if(i!==!1){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(i.outerHTML)||/href=["']#\S+["']/.test(i.outerHTML)))return!0;var o=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&o&&o.isDisplayed&&o.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==i&&this.detachPreviewHandlers(),this.anchorToPreview=i,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay((function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}).bind(this))}},handlePreviewMouseover:function(){this.lastOver=new Date().getTime(),this.hovering=!0},handlePreviewMouseout:function(r){(!r.relatedTarget||!/anchor-preview/.test(r.relatedTarget.className))&&(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;var r=new Date().getTime()-this.lastOver;r>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=new Date().getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=n}(),function(){var n,r,i,o,a;n=[" "," ",`
|
|
90
|
+
`,"\r"," "," "," "," "," ","\u2028","\u2029"],r="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",i="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+r+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+r+"))",o=new RegExp("^("+r+")$","i"),a=new RegExp(i,"gi");function s(u){return!e.util.getClosestTag(u,"a")}var l=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var u=0,c=0;c<this.window._mediumEditors.length;c++){var d=this.window._mediumEditors[c];d!==null&&d.getExtensionByName("autoLink")!==void 0&&u++}return u===1},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(u,c){this.performLinking(c)},onKeypress:function(u){this.disableEventHandling||e.util.isKey(u,[e.util.keyCode.SPACE,e.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout((function(){try{var c=this.base.exportSelection();this.performLinking(u.target)&&this.base.importSelection(c,!0)}catch(d){window.console&&window.console.error("Failed to perform linking",d),this.disableEventHandling=!0}}).bind(this),0))},performLinking:function(u){var c=e.util.splitByBlockElements(u),d=!1;c.length===0&&(c=[u]);for(var f=0;f<c.length;f++)d=this.removeObsoleteAutoLinkSpans(c[f])||d,d=this.performLinkingWithinElement(c[f])||d;return this.base.events.updateInput(u,{target:u,currentTarget:u}),d},removeObsoleteAutoLinkSpans:function(u){if(!u||u.nodeType===3)return!1;for(var c=u.querySelectorAll('span[data-auto-link="true"]'),d=!1,f=0;f<c.length;f++){var h=c[f].textContent;if(h.indexOf("://")===-1&&(h=e.util.ensureUrlHasProtocol(h)),c[f].getAttribute("data-href")!==h&&s(c[f])){d=!0;var v=h.replace(/\s+$/,"");if(c[f].getAttribute("data-href")===v){var g=h.length-v.length,m=e.util.splitOffDOMTree(c[f],this.splitTextBeforeEnd(c[f],g));c[f].parentNode.insertBefore(m,c[f].nextSibling)}else e.util.unwrap(c[f],this.document)}}return d},splitTextBeforeEnd:function(u,c){for(var d=this.document.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,!1),f=!0;f;)f=d.lastChild()!==null;for(var h,v,g;c>0&&g!==null;)h=d.currentNode,v=h.nodeValue,v.length>c?(g=h.splitText(v.length-c),c=0):(g=d.previousNode(),c-=v.length);return g},performLinkingWithinElement:function(u){for(var c=this.findLinkableText(u),d=!1,f=0;f<c.length;f++){var h=e.util.findOrCreateMatchingTextNodes(this.document,u,c[f]);this.shouldNotLink(h)||this.createAutoLink(h,c[f].href)}return d},shouldNotLink:function(u){for(var c=!1,d=0;d<u.length&&c===!1;d++)c=!!e.util.traverseUp(u[d],function(f){return f.nodeName.toLowerCase()==="a"||f.getAttribute&&f.getAttribute("data-auto-link")==="true"});return c},findLinkableText:function(u){for(var c=u.textContent,d=null,f=[];(d=a.exec(c))!==null;){var h=!0,v=d.index+d[0].length;h=(d.index===0||n.indexOf(c[d.index-1])!==-1)&&(v===c.length||n.indexOf(c[v])!==-1),h=h&&(d[0].indexOf("/")!==-1||o.test(d[0].split(".").pop().split("?").shift())),h&&f.push({href:d[0],start:d.index,end:v})}return f},createAutoLink:function(u,c){c=e.util.ensureUrlHasProtocol(c);var d=e.util.createLink(this.document,u,c,this.getEditorOption("targetBlank")?"_blank":null),f=this.document.createElement("span");for(f.setAttribute("data-auto-link","true"),f.setAttribute("data-href",c),d.insertBefore(f,d.firstChild);d.childNodes.length>1;)f.appendChild(d.childNodes[1])}});e.extensions.autoLink=l}(),function(){var n="medium-editor-dragover";function r(o){var a=e.util.getContainerEditorElement(o),s=Array.prototype.slice.call(a.parentElement.querySelectorAll("."+n));s.forEach(function(l){l.classList.remove(n)})}var i=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(o){o.preventDefault(),o.dataTransfer.dropEffect="copy";var a=o.target.classList?o.target:o.target.parentElement;r(a),o.type==="dragover"&&a.classList.add(n)},handleDrop:function(o){o.preventDefault(),o.stopPropagation(),this.base.selectElement(o.target);var a=this.base.exportSelection();a.start=a.end,this.base.importSelection(a),o.dataTransfer.files&&Array.prototype.slice.call(o.dataTransfer.files).forEach(function(s){this.isAllowedFile(s)&&s.type.match("image")&&this.insertImageFile(s)},this),r(o.target)},isAllowedFile:function(o){return this.allowedTypes.some(function(a){return!!o.type.match(a)})},insertImageFile:function(o){if(typeof FileReader=="function"){var a=new FileReader;a.readAsDataURL(o),a.addEventListener("load",(function(s){var l=this.document.createElement("img");l.src=s.target.result,e.util.insertHTMLCommand(this.document,l.outerHTML)}).bind(this))}}});e.extensions.fileDragging=i}(),function(){var n=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(r){var i=r.key.charCodeAt(0);this.keys[i]||(this.keys[i]=[]),this.keys[i].push(r)},this)},handleKeydown:function(r){var i=e.util.getKeyCode(r);if(this.keys[i]){var o=e.util.isMetaCtrlKey(r),a=!!r.shiftKey,s=!!r.altKey;this.keys[i].forEach(function(l){l.meta===o&&l.shift===a&&(l.alt===s||l.alt===void 0)&&(r.preventDefault(),r.stopPropagation(),typeof l.command=="function"?l.command.apply(this):l.command!==!1&&this.execAction(l.command))},this)}}});e.extensions.keyboardCommands=n}(),function(){var n=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontName")+"";this.showForm(i)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(r){var i=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var r=this.document,i=r.createElement("div"),o=r.createElement("select"),a=r.createElement("a"),s=r.createElement("a"),l;i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this));for(var u=0;u<this.fonts.length;u++)l=r.createElement("option"),l.innerHTML=this.fonts[u],l.value=this.fonts[u],o.appendChild(l);return o.className="medium-editor-toolbar-select",i.appendChild(o),this.on(o,"change",this.handleFontChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",i.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"×",i.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),i},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("face")&&r.removeAttribute("face")})},handleFontChange:function(){var r=this.getSelect().value;r===""?this.clearFontName():this.execAction("fontName",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontName=n}(),function(){var n=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontSize")+"";this.showForm(i)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(r){var i=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var r=this.document,i=r.createElement("div"),o=r.createElement("input"),a=r.createElement("a"),s=r.createElement("a");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this)),o.setAttribute("type","range"),o.setAttribute("min","1"),o.setAttribute("max","7"),o.className="medium-editor-toolbar-input",i.appendChild(o),this.on(o,"change",this.handleSliderChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",i.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"×",i.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("size")&&r.removeAttribute("size")})},handleSliderChange:function(){var r=this.getInput().value;r==="4"?this.clearFontSize():this.execAction("fontSize",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=n}(),function(){var n="%ME_PASTEBIN%",r=null,i=null,o=function(u){u.stopPropagation()};function a(){return[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]]}function s(u,c,d){var f=u.clipboardData||c.clipboardData||d.dataTransfer,h={};if(!f)return h;if(f.getData){var v=f.getData("Text");v&&v.length>0&&(h["text/plain"]=v)}if(f.types)for(var g=0;g<f.types.length;g++){var m=f.types[g];h[m]=f.getData(m)}return h}var l=e.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){e.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach(function(u){this.on(u,"paste",this.handlePaste.bind(this))},this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(u,c){this.on(c,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(u,c){if(!u.defaultPrevented){var d=s(u,this.window,this.document),f=d["text/html"],h=d["text/plain"];this.window.clipboardData&&u.clipboardData===void 0&&!f&&(f=h),(f||h)&&(u.preventDefault(),this.doPaste(f,h,c))}},doPaste:function(u,c,d){var f,h="",v;if(this.cleanPastedHTML&&u)return this.cleanPaste(u);if(c){if(this.getEditorOption("disableReturn")||d&&d.getAttribute("data-disable-return"))h=e.util.htmlEntities(c);else if(f=c.split(/[\r\n]+/g),f.length>1)for(v=0;v<f.length;v+=1)f[v]!==""&&(h+="<p>"+e.util.htmlEntities(f[v])+"</p>");else h=e.util.htmlEntities(f[0]);e.util.insertHTMLCommand(this.document,h)}},handlePasteBinPaste:function(u){if(u.defaultPrevented){this.removePasteBin();return}var c=s(u,this.window,this.document),d=c["text/html"],f=c["text/plain"],h=i;if(!this.cleanPastedHTML||d){u.preventDefault(),this.removePasteBin(),this.doPaste(d,f,h),this.trigger("editablePaste",{currentTarget:h,target:h},h);return}setTimeout((function(){this.cleanPastedHTML&&(d=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(d,f,h),this.trigger("editablePaste",{currentTarget:h,target:h},h)}).bind(this),0)},handleKeydown:function(u,c){e.util.isKey(u,e.util.keyCode.V)&&e.util.isMetaCtrlKey(u)&&(u.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(c))},createPasteBin:function(u){var c,d=e.selection.getSelectionRange(this.document),f=this.window.pageYOffset;i=u,d&&(c=d.getClientRects(),c.length?f+=c[0].top:d.startContainer.getBoundingClientRect!==void 0?f+=d.startContainer.getBoundingClientRect().top:f+=d.getBoundingClientRect().top),r=d;var h=this.document.createElement("div");h.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),h.setAttribute("style","border: 1px red solid; position: absolute; top: "+f+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),h.setAttribute("contentEditable",!0),h.innerHTML=n,this.document.body.appendChild(h),this.on(h,"focus",o),this.on(h,"focusin",o),this.on(h,"focusout",o),h.focus(),e.selection.selectNode(h,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(h,"paste",this.boundHandlePaste)},removePasteBin:function(){r!==null&&(e.selection.selectRange(this.document,r),r=null),i!==null&&(i=null);var u=this.getPasteBin();u&&u&&(this.off(u,"focus",o),this.off(u,"focusin",o),this.off(u,"focusout",o),this.off(u,"paste",this.boundHandlePaste),u.parentElement.removeChild(u))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var u=this.getPasteBin();if(!u||u.firstChild&&u.firstChild.id==="mcepastebin")return!1;var c=u.innerHTML;return!c||c===n?!1:c},cleanPaste:function(u){var c,d,f,h,v=/<p|<br|<div/.test(u),g=[].concat(this.preCleanReplacements||[],a(),this.cleanReplacements||[]);for(c=0;c<g.length;c+=1)u=u.replace(g[c][0],g[c][1]);if(!v)return this.pasteHTML(u);for(f=this.document.createElement("div"),f.innerHTML="<p>"+u.split("<br><br>").join("</p><p>")+"</p>",d=f.querySelectorAll("a,p,div,br"),c=0;c<d.length;c+=1)switch(h=d[c],h.innerHTML=h.innerHTML.replace(/\n/gi," "),h.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(h);break;case"br":this.filterLineBreak(h);break}this.pasteHTML(f.innerHTML)},pasteHTML:function(u,c){c=e.util.defaults({},c,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var d,f,h,v,g=this.document.createDocumentFragment();for(g.appendChild(this.document.createElement("body")),v=g.querySelector("body"),v.innerHTML=u,this.cleanupSpans(v),d=v.querySelectorAll("*"),h=0;h<d.length;h+=1)f=d[h],f.nodeName.toLowerCase()==="a"&&this.getEditorOption("targetBlank")&&e.util.setTargetBlank(f),e.util.cleanupAttrs(f,c.cleanAttrs),e.util.cleanupTags(f,c.cleanTags),e.util.unwrapTags(f,c.unwrapTags);e.util.insertHTMLCommand(this.document,v.innerHTML.replace(/ /g," "))},isCommonBlock:function(u){return u&&(u.nodeName.toLowerCase()==="p"||u.nodeName.toLowerCase()==="div")},filterCommonBlocks:function(u){/^\s*$/.test(u.textContent)&&u.parentNode&&u.parentNode.removeChild(u)},filterLineBreak:function(u){this.isCommonBlock(u.previousElementSibling)?this.removeWithParent(u):this.isCommonBlock(u.parentNode)&&(u.parentNode.firstChild===u||u.parentNode.lastChild===u)?this.removeWithParent(u):u.parentNode&&u.parentNode.childElementCount===1&&u.parentNode.textContent===""&&this.removeWithParent(u)},removeWithParent:function(u){u&&u.parentNode&&(u.parentNode.parentNode&&u.parentNode.childElementCount===1?u.parentNode.parentNode.removeChild(u.parentNode):u.parentNode.removeChild(u))},cleanupSpans:function(u){var c,d,f,h=u.querySelectorAll(".replace-with"),v=function(g){return g&&g.nodeName!=="#text"&&g.getAttribute("contenteditable")==="false"};for(c=0;c<h.length;c+=1)d=h[c],f=this.document.createElement(d.classList.contains("bold")?"b":"i"),d.classList.contains("bold")&&d.classList.contains("italic")?f.innerHTML="<i>"+d.innerHTML+"</i>":f.innerHTML=d.innerHTML,d.parentNode.replaceChild(f,d);for(h=u.querySelectorAll("span"),c=0;c<h.length;c+=1){if(d=h[c],e.util.traverseUp(d,v))return!1;e.util.unwrap(d,this.document)}}});e.extensions.paste=l}(),function(){var n=e.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(r,i){this.initElement(i)},initElement:function(r){r.getAttribute("data-placeholder")||r.setAttribute("data-placeholder",this.text),this.updatePlaceholder(r)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(r,i){this.cleanupElement(i)},cleanupElement:function(r){r.getAttribute("data-placeholder")===this.text&&r.removeAttribute("data-placeholder")},showPlaceholder:function(r){r&&(e.util.isFF&&r.childNodes.length===0?(r.classList.add("medium-editor-placeholder-relative"),r.classList.remove("medium-editor-placeholder")):(r.classList.add("medium-editor-placeholder"),r.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(r){r&&(r.classList.remove("medium-editor-placeholder"),r.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(r,i){if(r.querySelector("img, blockquote, ul, ol, table")||r.textContent.replace(/^\s+|\s+$/g,"")!=="")return this.hidePlaceholder(r);i||this.showPlaceholder(r)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(r,i){var o=this.hideOnClick&&i===this.base.getFocusedElement();this.updatePlaceholder(i,o)},handleFocus:function(r,i){this.hidePlaceholder(i)},handleBlur:function(r,i){this.updatePlaceholder(i)}});e.extensions.placeholder=n}(),function(){var n=e.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(r,i){return this.base.extensions.forEach(function(o){if(o!==this)return r.apply(i||this,arguments)},this)},createToolbar:function(){var r=this.document.createElement("div");return r.id="medium-editor-toolbar-"+this.getEditorId(),r.className="medium-editor-toolbar",this.static?r.className+=" static-toolbar":this.relativeContainer?r.className+=" medium-editor-relative-toolbar":r.className+=" medium-editor-stalker-toolbar",r.appendChild(this.createToolbarButtons()),this.forEachExtension(function(i){i.hasForm&&r.appendChild(i.getForm())}),this.attachEventHandlers(),r},createToolbarButtons:function(){var r=this.document.createElement("ul"),i,o,a,s,l,u;return r.id="medium-editor-toolbar-actions"+this.getEditorId(),r.className="medium-editor-toolbar-actions",r.style.display="block",this.buttons.forEach(function(c){typeof c=="string"?(l=c,u=null):(l=c.name,u=c),s=this.base.addBuiltInExtension(l,u),s&&typeof s.getButton=="function"&&(o=s.getButton(this.base),i=this.document.createElement("li"),e.util.isElement(o)?i.appendChild(o):i.innerHTML=o,r.appendChild(i))},this),a=r.querySelectorAll("button"),a.length>0&&(a[0].classList.add(this.firstButtonClass),a[a.length-1].classList.add(this.lastButtonClass)),r},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle((function(){this.base.isActive&&this.positionToolbarIfShown()}).bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(r){if(r&&r.target&&e.util.isDescendant(this.getToolbarElement(),r.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout((function(){this.checkState()}).bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout((function(){this.hideToolbar()}).bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return this.getToolbarActionsElement().style.display==="block"},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay((function(){this.showToolbar()}).bind(this))},hideExtensionForms:function(){this.forEachExtension(function(r){r.hasForm&&r.isDisplayed()&&r.hideForm()})},multipleBlockElementsSelected:function(){var r=/<[^\/>][^>]*><\/[^>]+>/gim,i=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),o=e.selection.getSelectionHtml(this.document).replace(r,""),a=o.match(i);return!!a&&a.length>1},modifySelection:function(){var r=this.window.getSelection(),i=r.getRangeAt(0);if(this.standardizeSelectionStart&&i.startContainer.nodeValue&&i.startOffset===i.startContainer.nodeValue.length){var o=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),i.startContainer,this.document);if(o){for(var a=0;o.nodeValue.substr(a,1).trim().length===0;)a=a+1;i=e.selection.select(this.document,o,a,i.endContainer,i.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var r=e.selection.getSelectionElement(this.window);if(!r||this.getEditorElements().indexOf(r)===-1||r.getAttribute("data-disable-toolbar"))return this.hideToolbar();if(this.updateOnEmptySelection&&this.static)return this.showAndUpdateToolbar();if(!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected())return this.hideToolbar();this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(r){typeof r.isActive=="function"&&typeof r.setInactive=="function"&&r.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var r=[],i=null,o=e.selection.getSelectionRange(this.document),a,s=function(l){typeof l.checkState=="function"?l.checkState(a):typeof l.isActive=="function"&&typeof l.isAlreadyApplied=="function"&&typeof l.setActive=="function"&&!l.isActive()&&l.isAlreadyApplied(a)&&l.setActive()};if(o&&(this.forEachExtension(function(l){if(typeof l.queryCommandState=="function"&&(i=l.queryCommandState(),i!==null)){i&&typeof l.setActive=="function"&&l.setActive();return}r.push(l)}),a=e.selection.getSelectedParentElement(o),!!this.getEditorElements().some(function(l){return e.util.isDescendant(l,a,!0)})))for(;a&&(r.forEach(s),!e.util.isMediumEditorElement(a));)a=a.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var r=this.base.getFocusedElement(),i=this.window.getSelection();if(!r)return this;(this.static||!i.isCollapsed)&&(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(r):this.positionToolbar(i)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(r){this.getToolbarElement().style.left="0";var i=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,o=this.window.innerWidth,a=this.getToolbarElement(),s=r.getBoundingClientRect(),l=s.top+i,u=s.left+s.width/2,c=a.offsetHeight,d=a.offsetWidth,f=d/2,h;switch(this.sticky?i>l+r.offsetHeight-c-this.stickyTopOffset?(a.style.top=l+r.offsetHeight-c+"px",a.classList.remove("medium-editor-sticky-toolbar")):i>l-c-this.stickyTopOffset?(a.classList.add("medium-editor-sticky-toolbar"),a.style.top=this.stickyTopOffset+"px"):(a.classList.remove("medium-editor-sticky-toolbar"),a.style.top=l-c+"px"):a.style.top=l-c+"px",this.align){case"left":h=s.left;break;case"right":h=s.right-d;break;case"center":h=u-f;break}h<0?h=0:h+d>o&&(h=o-Math.ceil(d)-1),a.style.left=h+"px"},positionToolbar:function(r){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var i=r.getRangeAt(0),o=i.getBoundingClientRect();(!o||o.height===0&&o.width===0&&i.startContainer===i.endContainer)&&(i.startContainer.nodeType===1&&i.startContainer.querySelector("img")?o=i.startContainer.querySelector("img").getBoundingClientRect():o=i.startContainer.getBoundingClientRect());var a=this.window.innerWidth,s=this.getToolbarElement(),l=s.offsetHeight,u=s.offsetWidth,c=u/2,d=50,f=this.diffLeft-c,h=this.getEditorOption("elementsContainer"),v=["absolute","fixed"].indexOf(window.getComputedStyle(h).getPropertyValue("position"))>-1,g={},m={},y,x;v?(x=h.getBoundingClientRect(),["top","left"].forEach(function(E){m[E]=o[E]-x[E]}),m.width=o.width,m.height=o.height,o=m,a=x.width,g.top=h.scrollTop):g.top=this.window.pageYOffset,y=o.left+o.width/2,g.top+=o.top-l,o.top<d?(s.classList.add("medium-toolbar-arrow-over"),s.classList.remove("medium-toolbar-arrow-under"),g.top+=d+o.height-this.diffTop):(s.classList.add("medium-toolbar-arrow-under"),s.classList.remove("medium-toolbar-arrow-over"),g.top+=this.diffTop),y<c?(g.left=f+c,g.right="initial"):a-y<c?(g.left="auto",g.right=0):(g.left=f+y,g.right="initial"),["top","left","right"].forEach(function(E){s.style[E]=g[E]+(isNaN(g[E])?"":"px")})}});e.extensions.toolbar=n}(),function(){var n=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(r){var i="medium-editor-dragover";r.preventDefault(),r.dataTransfer.dropEffect="copy",r.type==="dragover"?r.target.classList.add(i):r.type==="dragleave"&&r.target.classList.remove(i)},handleDrop:function(r){var i="medium-editor-dragover",o;r.preventDefault(),r.stopPropagation(),r.dataTransfer.files&&(o=Array.prototype.slice.call(r.dataTransfer.files,0),o.some((function(a){if(a.type.match("image")){var s,l;s=new FileReader,s.readAsDataURL(a),l="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+l+'" />'),s.onload=(function(){var u=this.document.getElementById(l);u&&(u.removeAttribute("id"),u.removeAttribute("class"),u.src=s.result)}).bind(this)}}).bind(this))),r.target.classList.remove(i)}});e.extensions.imageDragging=n}(),function(){function n(R){var k=e.selection.getSelectionStart(this.options.ownerDocument),B=k.textContent,Z=e.selection.getCaretOffsets(k);(B[Z.left-1]===void 0||B[Z.left-1].trim()===""||B[Z.left]!==void 0&&B[Z.left].trim()==="")&&R.preventDefault()}function r(R,k){if(this.options.disableReturn||k.getAttribute("data-disable-return"))R.preventDefault();else if(this.options.disableDoubleReturn||k.getAttribute("data-disable-double-return")){var B=e.selection.getSelectionStart(this.options.ownerDocument);(B&&B.textContent.trim()===""&&B.nodeName.toLowerCase()!=="li"||B.previousElementSibling&&B.previousElementSibling.nodeName.toLowerCase()!=="br"&&B.previousElementSibling.textContent.trim()==="")&&R.preventDefault()}}function i(R){var k=e.selection.getSelectionStart(this.options.ownerDocument),B=k&&k.nodeName.toLowerCase();B==="pre"&&(R.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(k)&&(R.preventDefault(),R.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function o(R){var k,B=e.selection.getSelectionStart(this.options.ownerDocument),Z=B.nodeName.toLowerCase(),ee=/^(\s+|<br\/?>)?$/i,ce=/h\d/i;e.util.isKey(R,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&B.previousElementSibling&&ce.test(Z)&&e.selection.getCaretOffsets(B).left===0?e.util.isKey(R,e.util.keyCode.BACKSPACE)&&ee.test(B.previousElementSibling.innerHTML)?(B.previousElementSibling.parentNode.removeChild(B.previousElementSibling),R.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(R,e.util.keyCode.ENTER)&&(k=this.options.ownerDocument.createElement("p"),k.innerHTML="<br>",B.previousElementSibling.parentNode.insertBefore(k,B),R.preventDefault()):e.util.isKey(R,e.util.keyCode.DELETE)&&B.nextElementSibling&&B.previousElementSibling&&!ce.test(Z)&&ee.test(B.innerHTML)&&ce.test(B.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,B.nextElementSibling),B.previousElementSibling.parentNode.removeChild(B),R.preventDefault()):e.util.isKey(R,e.util.keyCode.BACKSPACE)&&Z==="li"&&ee.test(B.innerHTML)&&!B.previousElementSibling&&!B.parentElement.previousElementSibling&&B.nextElementSibling&&B.nextElementSibling.nodeName.toLowerCase()==="li"?(k=this.options.ownerDocument.createElement("p"),k.innerHTML="<br>",B.parentElement.parentElement.insertBefore(k,B.parentElement),e.selection.moveCursor(this.options.ownerDocument,k),B.parentElement.removeChild(B),R.preventDefault()):e.util.isKey(R,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(B,"blockquote")!==!1&&e.selection.getCaretOffsets(B).left===0?(R.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(R,e.util.keyCode.ENTER)&&e.util.getClosestTag(B,"blockquote")!==!1&&e.selection.getCaretOffsets(B).right===0?(k=this.options.ownerDocument.createElement("p"),k.innerHTML="<br>",B.parentElement.insertBefore(k,B.nextSibling),e.selection.moveCursor(this.options.ownerDocument,k),R.preventDefault()):e.util.isKey(R,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(B.parentElement)&&!B.previousElementSibling&&B.nextElementSibling&&ee.test(B.innerHTML)&&(R.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,B.nextSibling),B.parentElement.removeChild(B))}function a(R){var k=e.selection.getSelectionStart(this.options.ownerDocument),B;k&&(e.util.isMediumEditorElement(k)&&k.children.length===0&&!e.util.isBlockContainer(k)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(R,e.util.keyCode.ENTER)&&!e.util.isListItem(k)&&!e.util.isBlockContainer(k)&&(B=k.nodeName.toLowerCase(),B==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!R.shiftKey&&!R.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function s(R,k){var B=k.parentNode.querySelector('textarea[medium-editor-textarea-id="'+k.getAttribute("medium-editor-textarea-id")+'"]');B&&(B.value=k.innerHTML.trim())}function l(R){R._mediumEditors||(R._mediumEditors=[null]),this.id||(this.id=R._mediumEditors.length),R._mediumEditors[this.id]=this}function u(R){!R._mediumEditors||!R._mediumEditors[this.id]||(R._mediumEditors[this.id]=null)}function c(R,k,B){var Z=[];if(R||(R=[]),typeof R=="string"&&(R=k.querySelectorAll(R)),e.util.isElement(R)&&(R=[R]),B)for(var ee=0;ee<R.length;ee++){var ce=R[ee];e.util.isElement(ce)&&!ce.getAttribute("data-medium-editor-element")&&!ce.getAttribute("medium-editor-textarea-id")&&Z.push(ce)}else Z=Array.prototype.slice.apply(R);return Z}function d(R){var k=R.parentNode.querySelector('textarea[medium-editor-textarea-id="'+R.getAttribute("medium-editor-textarea-id")+'"]');k&&(k.classList.remove("medium-editor-hidden"),k.removeAttribute("medium-editor-textarea-id")),R.parentNode&&R.parentNode.removeChild(R)}function f(R,k){return Object.keys(k).forEach(function(B){R[B]===void 0&&(R[B]=k[B])}),R}function h(R,k,B){var Z={window:B.options.contentWindow,document:B.options.ownerDocument,base:B};return R=f(R,Z),typeof R.init=="function"&&R.init(),R.name||(R.name=k),R}function v(){return this.elements.every(function(R){return!!R.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function g(){return v.call(this)?this.options.anchorPreview!==!1:!1}function m(){return this.options.placeholder!==!1}function y(){return this.options.autoLink!==!1}function x(){return this.options.imageDragging!==!1}function E(){return this.options.keyboardCommands!==!1}function b(){return!this.options.extensions.imageDragging}function T(R){for(var k=this.options.ownerDocument.createElement("div"),B=Date.now(),Z="medium-editor-"+B,ee=R.attributes;this.options.ownerDocument.getElementById(Z);)B++,Z="medium-editor-"+B;k.className=R.className,k.id=Z,k.innerHTML=R.value,R.setAttribute("medium-editor-textarea-id",Z);for(var ce=0,Be=ee.length;ce<Be;ce++)k.hasAttribute(ee[ce].nodeName)||k.setAttribute(ee[ce].nodeName,ee[ce].value);return R.form&&this.on(R.form,"reset",(function(me){me.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(Z))}).bind(this)),R.classList.add("medium-editor-hidden"),R.parentNode.insertBefore(k,R),k}function A(R,k){if(!R.getAttribute("data-medium-editor-element")){R.nodeName.toLowerCase()==="textarea"&&(R=T.call(this,R),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=s.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),!this.options.disableEditing&&!R.getAttribute("data-disable-editing")&&(R.setAttribute("contentEditable",!0),R.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(R.getAttribute("data-disable-return")||R.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=r.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),!this.options.disableReturn&&!R.getAttribute("data-disable-return")&&this.on(R,"keyup",a.bind(this));var B=e.util.guid();R.setAttribute("data-medium-editor-element",!0),R.classList.add("medium-editor-element"),R.setAttribute("role","textbox"),R.setAttribute("aria-multiline",!0),R.setAttribute("data-medium-editor-editor-index",k),R.setAttribute("medium-editor-index",B),J[B]=R.innerHTML,this.events.attachAllEventsToElement(R)}return R}function S(){this.subscribe("editableKeydownTab",i.bind(this)),this.subscribe("editableKeydownDelete",o.bind(this)),this.subscribe("editableKeydownEnter",o.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",n.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=r.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function M(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(ee){ee!=="toolbar"&&this.options.extensions[ee]&&this.extensions.push(h(this.options.extensions[ee],ee,this))},this),b.call(this)){var R=this.options.fileDragging;R||(R={},x.call(this)||(R.allowedTypes=[])),this.addBuiltInExtension("fileDragging",R)}var k={paste:!0,"anchor-preview":g.call(this),autoLink:y.call(this),keyboardCommands:E.call(this),placeholder:m.call(this)};Object.keys(k).forEach(function(ee){k[ee]&&this.addBuiltInExtension(ee)},this);var B=this.options.extensions.toolbar;if(!B&&v.call(this)){var Z=e.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});B=new e.extensions.toolbar(Z)}B&&this.extensions.push(h(B,"toolbar",this))}function C(R,k){var B=[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]];return k&&B.forEach(function(Z){k.hasOwnProperty(Z[0])&&k[Z[0]]!==void 0&&e.util.deprecated(Z[0],Z[1],"v6.0.0")}),e.util.defaults({},k,R)}function G(R,k){var B=/^append-(.+)$/gi,Z=/justify([A-Za-z]*)$/g,ee,ce;if(ee=B.exec(R),ee)return e.util.execFormatBlock(this.options.ownerDocument,ee[1]);if(R==="fontSize")return k.size&&e.util.deprecated(".size option for fontSize command",".value","6.0.0"),ce=k.value||k.size,this.options.ownerDocument.execCommand("fontSize",!1,ce);if(R==="fontName")return k.name&&e.util.deprecated(".name option for fontName command",".value","6.0.0"),ce=k.value||k.name,this.options.ownerDocument.execCommand("fontName",!1,ce);if(R==="createLink")return this.createLink(k);if(R==="image"){var Be=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,Be)}if(R==="html"){var me=this.options.contentWindow.getSelection().toString().trim();return e.util.insertHTMLCommand(this.options.ownerDocument,me)}if(Z.exec(R)){var de=this.options.ownerDocument.execCommand(R,!1,null),Se=e.selection.getSelectedParentElement(e.selection.getSelectionRange(this.options.ownerDocument));return Se&&K.call(this,e.util.getTopBlockContainer(Se)),de}return ce=k&&k.value,this.options.ownerDocument.execCommand(R,!1,ce)}function K(R){if(R){var k,B=Array.prototype.slice.call(R.childNodes).filter(function(Z){var ee=Z.nodeName.toLowerCase()==="div";return ee&&!k&&(k=Z.style.textAlign),ee});B.length&&(this.saveSelection(),B.forEach(function(Z){if(Z.style.textAlign===k){var ee=Z.lastChild;if(ee){e.util.unwrap(Z,this.options.ownerDocument);var ce=this.options.ownerDocument.createElement("BR");ee.parentNode.insertBefore(ce,ee.nextSibling)}}},this),R.style.textAlign=k,this.restoreSelection())}}var J={};e.prototype={init:function(R,k){return this.options=C.call(this,this.defaults,k),this.origElements=R,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(l.call(this,this.options.contentWindow),this.events=new e.Events(this),this.elements=[],this.addElements(this.origElements),this.elements.length!==0&&(this.isActive=!0,M.call(this),S.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach(function(R){typeof R.destroy=="function"&&R.destroy()},this),this.events.destroy(),this.elements.forEach(function(R){this.options.spellcheck&&(R.innerHTML=R.innerHTML),R.removeAttribute("contentEditable"),R.removeAttribute("spellcheck"),R.removeAttribute("data-medium-editor-element"),R.classList.remove("medium-editor-element"),R.removeAttribute("role"),R.removeAttribute("aria-multiline"),R.removeAttribute("medium-editor-index"),R.removeAttribute("data-medium-editor-editor-index"),R.getAttribute("medium-editor-textarea-id")&&d(R)},this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,u.call(this,this.options.contentWindow))},on:function(R,k,B,Z){return this.events.attachDOMEvent(R,k,B,Z),this},off:function(R,k,B,Z){return this.events.detachDOMEvent(R,k,B,Z),this},subscribe:function(R,k){return this.events.attachCustomEvent(R,k),this},unsubscribe:function(R,k){return this.events.detachCustomEvent(R,k),this},trigger:function(R,k,B){return this.events.triggerCustomEvent(R,k,B),this},delay:function(R){var k=this;return setTimeout(function(){k.isActive&&R()},this.options.delay)},serialize:function(){var R,k,B={},Z=this.elements.length;for(R=0;R<Z;R+=1)k=this.elements[R].id!==""?this.elements[R].id:"element-"+R,B[k]={value:this.elements[R].innerHTML.trim()};return B},getExtensionByName:function(R){var k;return this.extensions&&this.extensions.length&&this.extensions.some(function(B){return B.name===R?(k=B,!0):!1}),k},addBuiltInExtension:function(R,k){var B=this.getExtensionByName(R),Z;if(B)return B;switch(R){case"anchor":Z=e.util.extend({},this.options.anchor,k),B=new e.extensions.anchor(Z);break;case"anchor-preview":B=new e.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":B=new e.extensions.autoLink;break;case"fileDragging":B=new e.extensions.fileDragging(k);break;case"fontname":B=new e.extensions.fontName(this.options.fontName);break;case"fontsize":B=new e.extensions.fontSize(k);break;case"keyboardCommands":B=new e.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":B=new e.extensions.paste(this.options.paste);break;case"placeholder":B=new e.extensions.placeholder(this.options.placeholder);break;default:e.extensions.button.isBuiltInButton(R)&&(k?(Z=e.util.defaults({},k,e.extensions.button.prototype.defaults[R]),B=new e.extensions.button(Z)):B=new e.extensions.button(R))}return B&&this.extensions.push(h(B,R,this)),B},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var R=this.getExtensionByName("toolbar");return R&&R.checkState(),this},queryCommandState:function(R){var k=/^full-(.+)$/gi,B,Z=null;B=k.exec(R),B&&(R=B[1]);try{Z=this.options.ownerDocument.queryCommandState(R)}catch{Z=null}return Z},execAction:function(R,k){var B=/^full-(.+)$/gi,Z,ee;return Z=B.exec(R),Z?(this.saveSelection(),this.selectAllContents(),ee=G.call(this,Z[1],k),this.restoreSelection()):ee=G.call(this,R,k),(R==="insertunorderedlist"||R==="insertorderedlist")&&e.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),ee},getSelectedParentElement:function(R){return R===void 0&&(R=this.options.contentWindow.getSelection().getRangeAt(0)),e.selection.getSelectedParentElement(R)},selectAllContents:function(){var R=e.selection.getSelectionElement(this.options.contentWindow);if(R){for(;R.children.length===1;)R=R.children[0];this.selectElement(R)}},selectElement:function(R){e.selection.selectNode(R,this.options.ownerDocument);var k=e.selection.getSelectionElement(this.options.contentWindow);k&&this.events.focusElement(k)},getFocusedElement:function(){var R;return this.elements.some(function(k){return!R&&k.getAttribute("data-medium-focused")&&(R=k),!!R},this),R},exportSelection:function(){var R=e.selection.getSelectionElement(this.options.contentWindow),k=this.elements.indexOf(R),B=null;return k>=0&&(B=e.selection.exportSelection(R,this.options.ownerDocument)),B!==null&&k!==0&&(B.editableElementIndex=k),B},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(R,k){if(R){var B=this.elements[R.editableElementIndex||0];e.selection.importSelection(R,B,this.options.ownerDocument,k)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(R){var k=e.selection.getSelectionElement(this.options.contentWindow),B={},Z;if(this.elements.indexOf(k)!==-1){try{if(this.events.disableCustomEvent("editableInput"),R.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),Z=R.url||R.value,Z&&Z.trim().length>0){var ee=this.options.contentWindow.getSelection();if(ee){var ce=ee.getRangeAt(0),Be=ce.commonAncestorContainer,me,de,Se,je;if(ce.endContainer.nodeType===3&&ce.startContainer.nodeType!==3&&ce.startOffset===0&&ce.startContainer.firstChild===ce.endContainer&&(Be=ce.endContainer),de=e.util.getClosestBlockContainer(ce.startContainer),Se=e.util.getClosestBlockContainer(ce.endContainer),Be.nodeType!==3&&Be.textContent.length!==0&&de===Se){var he=de||k,Ve=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),me=this.exportSelection(),Ve.appendChild(he.cloneNode(!0)),k===he?e.selection.select(this.options.ownerDocument,he.firstChild,0,he.lastChild,he.lastChild.nodeType===3?he.lastChild.nodeValue.length:he.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,he,0,he,he.childNodes.length);var $=this.exportSelection();je=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,Ve,{start:me.start-$.start,end:me.end-$.start,editableElementIndex:me.editableElementIndex}),je.length===0&&(Ve=this.options.ownerDocument.createDocumentFragment(),Ve.appendChild(Be.cloneNode(!0)),je=[Ve.firstChild.firstChild,Ve.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,je,Z.trim());var w=(Ve.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,Ve.firstChild.innerHTML.replace(/^\s+/,"")),me.start-=w,me.end-=w,this.importSelection(me)}else this.options.ownerDocument.execCommand("createLink",!1,Z);this.options.targetBlank||R.target==="_blank"?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),Z):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),Z),R.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),R.buttonClass)}}if(this.options.targetBlank||R.target==="_blank"||R.buttonClass){B=this.options.ownerDocument.createEvent("HTMLEvents"),B.initEvent("input",!0,!0,this.options.contentWindow);for(var _=0,F=this.elements.length;_<F;_+=1)this.elements[_].dispatchEvent(B)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",B,k)}},cleanPaste:function(R){this.getExtensionByName("paste").cleanPaste(R)},pasteHTML:function(R,k){this.getExtensionByName("paste").pasteHTML(R,k)},setContent:function(R,k){if(k=k||0,this.elements[k]){var B=this.elements[k];B.innerHTML=R,this.checkContentChanged(B)}},getContent:function(R){return R=R||0,this.elements[R]?this.elements[R].innerHTML.trim():null},checkContentChanged:function(R){R=R||e.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(R,{target:R,currentTarget:R})},resetContent:function(R){if(R){var k=this.elements.indexOf(R);k!==-1&&this.setContent(J[R.getAttribute("medium-editor-index")],k);return}this.elements.forEach(function(B,Z){this.setContent(J[B.getAttribute("medium-editor-index")],Z)},this)},addElements:function(R){var k=c(R,this.options.ownerDocument,!0);if(k.length===0)return!1;k.forEach(function(B){B=A.call(this,B,this.id),this.elements.push(B),this.trigger("addElement",{target:B,currentTarget:B},B)},this)},removeElements:function(R){var k=c(R,this.options.ownerDocument),B=k.map(function(Z){return Z.getAttribute("medium-editor-textarea-id")&&Z.parentNode?Z.parentNode.querySelector('div[medium-editor-textarea-id="'+Z.getAttribute("medium-editor-textarea-id")+'"]'):Z});this.elements=this.elements.filter(function(Z){return B.indexOf(Z)!==-1?(this.events.cleanupElement(Z),Z.getAttribute("medium-editor-textarea-id")&&d(Z),this.trigger("removeElement",{target:Z,currentTarget:Z},Z),!1):!0},this)}},e.getEditorFromElement=function(R){var k=R.getAttribute("data-medium-editor-editor-index"),B=R&&R.ownerDocument&&(R.ownerDocument.defaultView||R.ownerDocument.parentWindow);return B&&B._mediumEditors&&B._mediumEditors[k]?B._mediumEditors[k]:null}}(),function(){e.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}}(),e.parseVersionString=function(n){var r=n.split("-"),i=r[0].split("."),o=r.length>1?r[1]:"";return{major:parseInt(i[0],10),minor:parseInt(i[1],10),revision:parseInt(i[2],10),preRelease:o,toString:function(){return[i[0],i[1],i[2]].join(".")+(o?"-"+o:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e}())}(ju)),ju.exports}var VF=UF();const Fu=ul(VF);/*!
|
|
91
|
+
* vanilla-picker v2.12.3
|
|
92
|
+
* https://vanilla-picker.js.org
|
|
93
|
+
*
|
|
94
|
+
* Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
|
95
|
+
* Released under the ISC license.
|
|
96
|
+
*/var fp=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},pp=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),$u=function(){function t(e,n){var r=[],i=!0,o=!1,a=void 0;try{for(var s=e[Symbol.iterator](),l;!(i=(l=s.next()).done)&&(r.push(l.value),!(n&&r.length===n));i=!0);}catch(u){o=!0,a=u}finally{try{!i&&s.return&&s.return()}finally{if(o)throw a}}return r}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();String.prototype.startsWith=String.prototype.startsWith||function(t){return this.indexOf(t)===0},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var XF={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function F0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var GF=function(){function t(e,n,r,i){fp(this,t);var o=this;function a(l){if(l.startsWith("hsl")){var u=l.match(/([\-\d\.e]+)/g).map(Number),c=$u(u,4),d=c[0],f=c[1],h=c[2],v=c[3];v===void 0&&(v=1),d/=360,f/=100,h/=100,o.hsla=[d,f,h,v]}else if(l.startsWith("rgb")){var g=l.match(/([\-\d\.e]+)/g).map(Number),m=$u(g,4),y=m[0],x=m[1],E=m[2],b=m[3];b===void 0&&(b=1),o.rgba=[y,x,E,b]}else l.startsWith("#")?o.rgba=t.hexToRgb(l):o.rgba=t.nameToRgb(l)||t.hexToRgb(l)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(r===void 0){var s=e&&""+e;s&&a(s.toLowerCase())}else this.rgba=[e,n,r,i===void 0?1:i]}return pp(t,[{key:"printRGB",value:function(n){var r=n?this.rgba:this.rgba.slice(0,3),i=r.map(function(o,a){return F0(o,a===3?3:0)});return n?"rgba("+i+")":"rgb("+i+")"}},{key:"printHSL",value:function(n){var r=[360,100,100,1],i=["","%","%",""],o=n?this.hsla:this.hsla.slice(0,3),a=o.map(function(s,l){return F0(s*r[l],l===3?3:1)+i[l]});return n?"hsla("+a+")":"hsl("+a+")"}},{key:"printHex",value:function(n){var r=this.hex;return n?r:r.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(n){n.length===3&&(n[3]=1),this._rgba=n,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(n){n.length===3&&(n[3]=1),this._hsla=n,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var n=this.rgba,r=n.map(function(i,o){return o<3?i.toString(16):Math.round(i*255).toString(16)});return"#"+r.map(function(i){return i.padStart(2,"0")}).join("")},set:function(n){this.rgba=t.hexToRgb(n)}}],[{key:"hexToRgb",value:function(n){var r=(n.startsWith("#")?n.slice(1):n).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!r.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+n);var i=r.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(o){return parseInt(o,16)});return i[3]=i[3]/255,i}},{key:"nameToRgb",value:function(n){var r=n.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),i=XF[r];return i===void 0?i:t.hexToRgb(i.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(n){var r=$u(n,4),i=r[0],o=r[1],a=r[2],s=r[3];i/=255,o/=255,a/=255;var l=Math.max(i,o,a),u=Math.min(i,o,a),c=void 0,d=void 0,f=(l+u)/2;if(l===u)c=d=0;else{var h=l-u;switch(d=f>.5?h/(2-l-u):h/(l+u),l){case i:c=(o-a)/h+(o<a?6:0);break;case o:c=(a-i)/h+2;break;case a:c=(i-o)/h+4;break}c/=6}return[c,d,f,s]}},{key:"hslToRgb",value:function(n){var r=$u(n,4),i=r[0],o=r[1],a=r[2],s=r[3],l=void 0,u=void 0,c=void 0;if(o===0)l=u=c=a;else{var d=function(m,y,x){return x<0&&(x+=1),x>1&&(x-=1),x<.16666666666666666?m+(y-m)*6*x:x<.5?y:x<.6666666666666666?m+(y-m)*(.6666666666666666-x)*6:m},f=a<.5?a*(1+o):a+o-a*o,h=2*a-f;l=d(h,f,i+1/3),u=d(h,f,i),c=d(h,f,i-1/3)}var v=[l*255,u*255,c*255].map(Math.round);return v[3]=s,v}}]),t}(),YF=function(){function t(){fp(this,t),this._events=[]}return pp(t,[{key:"add",value:function(n,r,i){n.addEventListener(r,i,!1),this._events.push({target:n,type:r,handler:i})}},{key:"remove",value:function(n,r,i){this._events=this._events.filter(function(o){var a=!0;return n&&n!==o.target&&(a=!1),r&&r!==o.type&&(a=!1),i&&i!==o.handler&&(a=!1),a&&t._doRemove(o.target,o.type,o.handler),!a})}},{key:"destroy",value:function(){this._events.forEach(function(n){return t._doRemove(n.target,n.type,n.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(n,r,i){n.removeEventListener(r,i,!1)}}]),t}();function KF(t){var e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}function hp(t,e,n){var r=!1;function i(l,u,c){return Math.max(u,Math.min(l,c))}function o(l,u,c){if(c&&(r=!0),!!r){l.preventDefault();var d=e.getBoundingClientRect(),f=d.width,h=d.height,v=u.clientX,g=u.clientY,m=i(v-d.left,0,f),y=i(g-d.top,0,h);n(m/f,y/h)}}function a(l,u){var c=l.buttons===void 0?l.which:l.buttons;c===1?o(l,l,u):r=!1}function s(l,u){l.touches.length===1?o(l,l.touches[0],u):r=!1}t.add(e,"mousedown",function(l){a(l,!0)}),t.add(e,"touchstart",function(l){s(l,!0)}),t.add(window,"mousemove",a),t.add(e,"touchmove",s),t.add(window,"mouseup",function(l){r=!1}),t.add(e,"touchend",function(l){r=!1}),t.add(e,"touchcancel",function(l){r=!1})}var qF=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
|
|
97
|
+
linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,ZF=360,$0="keydown",Hu="mousedown",gp="focusin";function zr(t,e){return(e||document).querySelector(t)}function JF(t){t.preventDefault(),t.stopPropagation()}function vp(t,e,n,r,i){t.add(e,$0,function(o){n.indexOf(o.key)>=0&&r(o)})}var H0=function(){function t(e){fp(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new YF,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return pp(t,[{key:"setOptions",value:function(n){var r=this;if(!n)return;var i=this.settings;function o(u,c,d){for(var f in u)c[f]=u[f]}if(n instanceof HTMLElement)i.parent=n;else{i.parent&&n.parent&&i.parent!==n.parent&&(this._events.remove(i.parent),this._popupInited=!1),o(n,i),n.onChange&&(this.onChange=n.onChange),n.onDone&&(this.onDone=n.onDone),n.onOpen&&(this.onOpen=n.onOpen),n.onClose&&(this.onClose=n.onClose);var a=n.color||n.colour;a&&this._setColor(a)}var s=i.parent;if(s&&i.popup&&!this._popupInited){var l=function(c){return r.openHandler(c)};this._events.add(s,"click",l),vp(this._events,s,[" ","Spacebar","Enter"],l),this._popupInited=!0}else n.parent&&!i.popup&&this.show()}},{key:"openHandler",value:function(n){if(this.show()){n&&n.preventDefault(),this.settings.parent.style.pointerEvents="none";var r=n&&n.type===$0?this._domEdit:this.domElement;setTimeout(function(){return r.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(n){var r=n&&n.type,i=!1;if(!n)i=!0;else if(r===Hu||r===gp){var o=(this.__containedEvent||0)+100;n.timeStamp>o&&(i=!0)}else JF(n),i=!0;i&&this.hide()&&(this.settings.parent.style.pointerEvents="",r!==Hu&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(n,r){this.closeHandler(),this.setOptions(n),r&&this.openHandler()}},{key:"setColor",value:function(n,r){this._setColor(n,{silent:r})}},{key:"_setColor",value:function(n,r){if(typeof n=="string"&&(n=n.trim()),!!n){r=r||{};var i=void 0;try{i=new GF(n)}catch(a){if(r.failSilently)return;throw a}if(!this.settings.alpha){var o=i.hsla;o[3]=1,i.hsla=o}this.colour=this.color=i,this._setHSLA(null,null,null,null,r)}}},{key:"setColour",value:function(n,r){this.setColor(n,r)}},{key:"show",value:function(){var n=this.settings.parent;if(!n)return!1;if(this.domElement){var r=this._toggleDOM(!0);return this._setPosition(),r}var i=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',o=KF(i);return this.domElement=o,this._domH=zr(".picker_hue",o),this._domSL=zr(".picker_sl",o),this._domA=zr(".picker_alpha",o),this._domEdit=zr(".picker_editor input",o),this._domSample=zr(".picker_sample",o),this._domOkay=zr(".picker_done button",o),this._domCancel=zr(".picker_cancel button",o),o.classList.add("layout_"+this.settings.layout),this.settings.alpha||o.classList.add("no_alpha"),this.settings.editor||o.classList.add("no_editor"),this.settings.cancelButton||o.classList.add("no_cancel"),this._ifPopup(function(){return o.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var n=this,r=this,i=this.domElement,o=this._events;function a(u,c,d){o.add(u,c,d)}a(i,"click",function(u){return u.preventDefault()}),hp(o,this._domH,function(u,c){return r._setHSLA(u)}),hp(o,this._domSL,function(u,c){return r._setHSLA(null,u,1-c)}),this.settings.alpha&&hp(o,this._domA,function(u,c){return r._setHSLA(null,null,null,1-c)});var s=this._domEdit;a(s,"input",function(u){r._setColor(this.value,{fromEditor:!0,failSilently:!0})}),a(s,"focus",function(u){var c=this;c.selectionStart===c.selectionEnd&&c.select()}),this._ifPopup(function(){var u=function(f){return n.closeHandler(f)};a(window,Hu,u),a(window,gp,u),vp(o,i,["Esc","Escape"],u);var c=function(f){n.__containedEvent=f.timeStamp};a(i,Hu,c),a(i,gp,c),a(n._domCancel,"click",u)});var l=function(c){n._ifPopup(function(){return n.closeHandler(c)}),n.onDone&&n.onDone(n.colour)};a(this._domOkay,"click",l),vp(o,i,["Enter"],l)}},{key:"_setPosition",value:function(){var n=this.settings.parent,r=this.domElement;n!==r.parentNode&&n.appendChild(r),this._ifPopup(function(i){getComputedStyle(n).position==="static"&&(n.style.position="relative");var o=i===!0?"popup_right":"popup_"+i;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(a){a===o?r.classList.add(a):r.classList.remove(a)}),r.classList.add(o)})}},{key:"_setHSLA",value:function(n,r,i,o,a){a=a||{};var s=this.colour,l=s.hsla;[n,r,i,o].forEach(function(u,c){(u||u===0)&&(l[c]=u)}),s.hsla=l,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(s)}},{key:"_updateUI",value:function(n){if(!this.domElement)return;n=n||{};var r=this.colour,i=r.hsla,o="hsl("+i[0]*ZF+", 100%, 50%)",a=r.hslString,s=r.hslaString,l=this._domH,u=this._domSL,c=this._domA,d=zr(".picker_selector",l),f=zr(".picker_selector",u),h=zr(".picker_selector",c);function v(A,S,M){S.style.left=M*100+"%"}function g(A,S,M){S.style.top=M*100+"%"}v(l,d,i[0]),this._domSL.style.backgroundColor=this._domH.style.color=o,v(u,f,i[1]),g(u,f,1-i[2]),u.style.color=a,g(c,h,1-i[3]);var m=a,y=m.replace("hsl","hsla").replace(")",", 0)"),x="linear-gradient("+[m,y]+")";if(this._domA.style.background=x+", "+qF,!n.fromEditor){var E=this.settings.editorFormat,b=this.settings.alpha,T=void 0;switch(E){case"rgb":T=r.printRGB(b);break;case"hsl":T=r.printHSL(b);break;default:T=r.printHex(b)}this._domEdit.value=T}this._domSample.style.color=s}},{key:"_ifPopup",value:function(n,r){this.settings.parent&&this.settings.popup?n&&n(this.settings.popup):r&&r()}},{key:"_toggleDOM",value:function(n){var r=this.domElement;if(!r)return!1;var i=n?"":"none",o=r.style.display!==i;return o&&(r.style.display=i),o}}]),t}();{var mp=document.createElement("style");mp.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(mp),H0.StyleElement=mp}var yp={exports:{}},z0;function W0(){return z0||(z0=1,function(t,e){(function(n,r){t.exports=n()})(function(){var n="object",r="function",i="undefined",o=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],a=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],s=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],l=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function u($,w){var _=typeof $[w];return _==r||!!(_==n&&$[w])||_=="unknown"}function c($,w){return!!(typeof $[w]==n&&$[w])}function d($,w){return typeof $[w]!=i}function f($){return function(w,_){for(var F=_.length;F--;)if(!$(w,_[F]))return!1;return!0}}var h=f(u),v=f(c),g=f(d);function m($){return $&&h($,l)&&g($,s)}function y($){return c($,"body")?$.body:$.getElementsByTagName("body")[0]}var x=[].forEach?function($,w){$.forEach(w)}:function($,w){for(var _=0,F=$.length;_<F;++_)w($[_],_)},E={},b=typeof window!=i&&typeof document!=i,T={isHostMethod:u,isHostObject:c,isHostProperty:d,areHostMethods:h,areHostObjects:v,areHostProperties:g,isTextRange:m,getBody:y,forEach:x},A={version:"1.3.2",initialized:!1,isBrowser:b,supported:!0,util:T,features:{},modules:E,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==i?!0:rangyAutoInitialize}};function S($){typeof console!=i&&u(console,"log")&&console.log($)}function M($,w){b&&w?alert($):S($)}function C($){A.initialized=!0,A.supported=!1,M("Rangy is not supported in this environment. Reason: "+$,A.config.alertOnFail)}A.fail=C;function G($){M("Rangy warning: "+$,A.config.alertOnWarn)}A.warn=G;var K;({}).hasOwnProperty?(T.extend=K=function($,w,_){var F,L;for(var se in w)se==="__proto__"||se==="constructor"||se==="prototype"||w.hasOwnProperty(se)&&(F=$[se],L=w[se],_&&F!==null&&typeof F=="object"&&L!==null&&typeof L=="object"&&K(F,L,!0),$[se]=L);return w.hasOwnProperty("toString")&&($.toString=w.toString),$},T.createOptions=function($,w){var _={};return K(_,w),$&&K(_,$),_}):C("hasOwnProperty not supported"),b||C("Rangy can only run in a browser"),function(){var $;if(b){var w=document.createElement("div");w.appendChild(document.createElement("span"));var _=[].slice;try{_.call(w.childNodes,0)[0].nodeType==1&&($=function(F){return _.call(F,0)})}catch{}}$||($=function(F){for(var L=[],se=0,fe=F.length;se<fe;++se)L[se]=F[se];return L}),T.toArray=$}();var J;b&&(u(document,"addEventListener")?J=function($,w,_){$.addEventListener(w,_,!1)}:u(document,"attachEvent")?J=function($,w,_){$.attachEvent("on"+w,_)}:C("Document does not have required addEventListener or attachEvent method"),T.addListener=J);var R=[];function k($){return $.message||$.description||String($)}function B(){if(!(!b||A.initialized)){var $,w=!1,_=!1;u(document,"createRange")&&($=document.createRange(),h($,a)&&g($,o)&&(w=!0));var F=y(document);if(!F||F.nodeName.toLowerCase()!="body"){C("No body element found");return}if(F&&u(F,"createTextRange")&&($=F.createTextRange(),m($)&&(_=!0)),!w&&!_){C("Neither Range nor TextRange are available");return}A.initialized=!0,A.features={implementsDomRange:w,implementsTextRange:_};var L,se;for(var fe in E)(L=E[fe])instanceof me&&L.init(L,A);for(var Ne=0,ze=R.length;Ne<ze;++Ne)try{R[Ne](A)}catch(rt){se="Rangy init listener threw an exception. Continuing. Detail: "+k(rt),S(se)}}}function Z($,w,_){_&&($+=" in module "+_.name),A.warn("DEPRECATED: "+$+" is deprecated. Please use "+w+" instead.")}function ee($,w,_,F){$[w]=function(){return Z(w,_,F),$[_].apply($,T.toArray(arguments))}}T.deprecationNotice=Z,T.createAliasForDeprecatedMethod=ee,A.init=B,A.addInitListener=function($){A.initialized?$(A):R.push($)};var ce=[];A.addShimListener=function($){ce.push($)};function Be($){$=$||window,B();for(var w=0,_=ce.length;w<_;++w)ce[w]($)}b&&(A.shim=A.createMissingNativeApi=Be,ee(A,"createMissingNativeApi","shim"));function me($,w,_){this.name=$,this.dependencies=w,this.initialized=!1,this.supported=!1,this.initializer=_}me.prototype={init:function(){for(var $=this.dependencies||[],w=0,_=$.length,F,L;w<_;++w){if(L=$[w],F=E[L],!F||!(F instanceof me))throw new Error("required module '"+L+"' not found");if(F.init(),!F.supported)throw new Error("required module '"+L+"' not supported")}this.initializer(this)},fail:function($){throw this.initialized=!0,this.supported=!1,new Error($)},warn:function($){A.warn("Module "+this.name+": "+$)},deprecationNotice:function($,w){A.warn("DEPRECATED: "+$+" in module "+this.name+" is deprecated. Please use "+w+" instead")},createError:function($){return new Error("Error in Rangy "+this.name+" module: "+$)}};function de($,w,_){var F=new me($,w,function(L){if(!L.initialized){L.initialized=!0;try{_(A,L),L.supported=!0}catch(fe){var se="Module '"+$+"' failed to load: "+k(fe);S(se),fe.stack&&S(fe.stack)}}});return E[$]=F,F}A.createModule=function($){var w,_;arguments.length==2?(w=arguments[1],_=[]):(w=arguments[2],_=arguments[1]);var F=de($,_,w);A.initialized&&A.supported&&F.init()},A.createCoreModule=function($,w,_){de($,w,_)};function Se(){}A.RangePrototype=Se,A.rangePrototype=new Se;function je(){}A.selectionPrototype=new je,A.createCoreModule("DomUtil",[],function($,w){var _="undefined",F=$.util,L=F.getBody;F.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||w.fail("document missing a Node creation method"),F.isHostMethod(document,"getElementsByTagName")||w.fail("document missing getElementsByTagName method");var se=document.createElement("div");F.areHostMethods(se,["insertBefore","appendChild","cloneNode"])||w.fail("Incomplete Element implementation"),F.isHostProperty(se,"innerHTML")||w.fail("Element is missing innerHTML property");var fe=document.createTextNode("test");F.areHostMethods(fe,["splitText","deleteData","insertData","appendData","cloneNode"])||w.fail("Incomplete Text Node implementation");var Ne=function(Y,ue){for(var Xe=Y.length;Xe--;)if(Y[Xe]===ue)return!0;return!1};function ze(Y){var ue;return typeof Y.namespaceURI==_||(ue=Y.namespaceURI)===null||ue=="http://www.w3.org/1999/xhtml"}function rt(Y){var ue=Y.parentNode;return ue.nodeType==1?ue:null}function Ze(Y){for(var ue=0;Y=Y.previousSibling;)++ue;return ue}function at(Y){switch(Y.nodeType){case 7:case 10:return 0;case 3:case 8:return Y.length;default:return Y.childNodes.length}}function Ct(Y,ue){var Xe=[],Me;for(Me=Y;Me;Me=Me.parentNode)Xe.push(Me);for(Me=ue;Me;Me=Me.parentNode)if(Ne(Xe,Me))return Me;return null}function P(Y,ue,Xe){for(var Me=Xe?ue:ue.parentNode;Me;){if(Me===Y)return!0;Me=Me.parentNode}return!1}function I(Y,ue){return P(Y,ue,!0)}function j(Y,ue,Xe){for(var Me,Dt=Xe?Y:Y.parentNode;Dt;){if(Me=Dt.parentNode,Me===ue)return Dt;Dt=Me}return null}function q(Y){var ue=Y.nodeType;return ue==3||ue==4||ue==8}function H(Y){if(!Y)return!1;var ue=Y.nodeType;return ue==3||ue==8}function re(Y,ue){var Xe=ue.nextSibling,Me=ue.parentNode;return Xe?Me.insertBefore(Y,Xe):Me.appendChild(Y),Y}function te(Y,ue,Xe){var Me=Y.cloneNode(!1);if(Me.deleteData(0,ue),Y.deleteData(ue,Y.length-ue),re(Me,Y),Xe)for(var Dt=0,yt;yt=Xe[Dt++];)yt.node==Y&&yt.offset>ue?(yt.node=Me,yt.offset-=ue):yt.node==Y.parentNode&&yt.offset>Ze(Y)&&++yt.offset;return Me}function oe(Y){if(Y.nodeType==9)return Y;if(typeof Y.ownerDocument!=_)return Y.ownerDocument;if(typeof Y.document!=_)return Y.document;if(Y.parentNode)return oe(Y.parentNode);throw w.createError("getDocument: no document found for node")}function Le(Y){var ue=oe(Y);if(typeof ue.defaultView!=_)return ue.defaultView;if(typeof ue.parentWindow!=_)return ue.parentWindow;throw w.createError("Cannot get a window object for node")}function we(Y){if(typeof Y.contentDocument!=_)return Y.contentDocument;if(typeof Y.contentWindow!=_)return Y.contentWindow.document;throw w.createError("getIframeDocument: No Document object found for iframe element")}function ge(Y){if(typeof Y.contentWindow!=_)return Y.contentWindow;if(typeof Y.contentDocument!=_)return Y.contentDocument.defaultView;throw w.createError("getIframeWindow: No Window object found for iframe element")}function st(Y){return Y&&F.isHostMethod(Y,"setTimeout")&&F.isHostObject(Y,"document")}function et(Y,ue,Xe){var Me;if(Y?F.isHostProperty(Y,"nodeType")?Me=Y.nodeType==1&&Y.tagName.toLowerCase()=="iframe"?we(Y):oe(Y):st(Y)&&(Me=Y.document):Me=document,!Me)throw ue.createError(Xe+"(): Parameter must be a Window object or DOM node");return Me}function nt(Y){for(var ue;ue=Y.parentNode;)Y=ue;return Y}function en(Y,ue,Xe,Me){var Dt,yt,Tr,Un,xn;if(Y==Xe)return ue===Me?0:ue<Me?-1:1;if(Dt=j(Xe,Y,!0))return ue<=Ze(Dt)?-1:1;if(Dt=j(Y,Xe,!0))return Ze(Dt)<Me?-1:1;if(yt=Ct(Y,Xe),!yt)throw new Error("comparePoints error: nodes have no common ancestor");if(Tr=Y===yt?yt:j(Y,yt,!0),Un=Xe===yt?yt:j(Xe,yt,!0),Tr===Un)throw w.createError("comparePoints got to case 4 and childA and childB are the same!");for(xn=yt.firstChild;xn;){if(xn===Tr)return-1;if(xn===Un)return 1;xn=xn.nextSibling}}var ve=!1;function Ae(Y){var ue;try{return ue=Y.parentNode,!1}catch{return!0}}(function(){var Y=document.createElement("b");Y.innerHTML="1";var ue=Y.firstChild;Y.innerHTML="<br />",ve=Ae(ue),$.features.crashyTextNodes=ve})();function dt(Y){if(!Y)return"[No node]";if(ve&&Ae(Y))return"[Broken node]";if(q(Y))return'"'+Y.data+'"';if(Y.nodeType==1){var ue=Y.id?' id="'+Y.id+'"':"";return"<"+Y.nodeName+ue+">[index:"+Ze(Y)+",length:"+Y.childNodes.length+"]["+(Y.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return Y.nodeName}function wt(Y){for(var ue=oe(Y).createDocumentFragment(),Xe;Xe=Y.firstChild;)ue.appendChild(Xe);return ue}var Ft;typeof window.getComputedStyle!=_?Ft=function(Y,ue){return Le(Y).getComputedStyle(Y,null)[ue]}:typeof document.documentElement.currentStyle!=_?Ft=function(Y,ue){return Y.currentStyle?Y.currentStyle[ue]:""}:w.fail("No means of obtaining computed style properties found");function Wn(Y,ue,Xe){var Me=L(Y),Dt=Y.createElement("div");Dt.contentEditable=""+!!Xe,ue&&(Dt.innerHTML=ue);var yt=Me.firstChild;return yt?Me.insertBefore(Dt,yt):Me.appendChild(Dt),Dt}function bn(Y){return Y.parentNode.removeChild(Y)}function tn(Y){this.root=Y,this._next=Y}tn.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var Y=this._current=this._next,ue,Xe;if(this._current)if(ue=Y.firstChild,ue)this._next=ue;else{for(Xe=null;Y!==this.root&&!(Xe=Y.nextSibling);)Y=Y.parentNode;this._next=Xe}return this._current},detach:function(){this._current=this._next=this.root=null}};function nn(Y){return new tn(Y)}function cn(Y,ue){this.node=Y,this.offset=ue}cn.prototype={equals:function(Y){return!!Y&&this.node===Y.node&&this.offset==Y.offset},inspect:function(){return"[DomPosition("+dt(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}};function Nn(Y){this.code=this[Y],this.codeName=Y,this.message="DOMException: "+this.codeName}Nn.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},Nn.prototype.toString=function(){return this.message},$.dom={arrayContains:Ne,isHtmlNamespace:ze,parentElement:rt,getNodeIndex:Ze,getNodeLength:at,getCommonAncestor:Ct,isAncestorOf:P,isOrIsAncestorOf:I,getClosestAncestorIn:j,isCharacterDataNode:q,isTextOrCommentNode:H,insertAfter:re,splitDataNode:te,getDocument:oe,getWindow:Le,getIframeWindow:ge,getIframeDocument:we,getBody:L,isWindow:st,getContentDocument:et,getRootContainer:nt,comparePoints:en,isBrokenNode:Ae,inspectNode:dt,getComputedStyleProperty:Ft,createTestElement:Wn,removeNode:bn,fragmentFromNodeChildren:wt,createIterator:nn,DomPosition:cn},$.DOMException=Nn}),A.createCoreModule("DomRange",["DomUtil"],function($,w){var _=$.dom,F=$.util,L=_.DomPosition,se=$.DOMException,fe=_.isCharacterDataNode,Ne=_.getNodeIndex,ze=_.isOrIsAncestorOf,rt=_.getDocument,Ze=_.comparePoints,at=_.splitDataNode,Ct=_.getClosestAncestorIn,P=_.getNodeLength,I=_.arrayContains,j=_.getRootContainer,q=$.features.crashyTextNodes,H=_.removeNode;function re(D,z){return D.nodeType!=3&&(ze(D,z.startContainer)||ze(D,z.endContainer))}function te(D){return D.document||rt(D.startContainer)}function oe(D){return j(D.startContainer)}function Le(D){return new L(D.parentNode,Ne(D))}function we(D){return new L(D.parentNode,Ne(D)+1)}function ge(D,z,Q){var le=D.nodeType==11?D.firstChild:D;return fe(z)?Q==z.length?_.insertAfter(D,z):z.parentNode.insertBefore(D,Q==0?z:at(z,Q)):Q>=z.childNodes.length?z.appendChild(D):z.insertBefore(D,z.childNodes[Q]),le}function st(D,z,Q){if(xt(D),xt(z),te(z)!=te(D))throw new se("WRONG_DOCUMENT_ERR");var le=Ze(D.startContainer,D.startOffset,z.endContainer,z.endOffset),Oe=Ze(D.endContainer,D.endOffset,z.startContainer,z.startOffset);return Q?le<=0&&Oe>=0:le<0&&Oe>0}function et(D){for(var z,Q,le=te(D.range).createDocumentFragment(),Oe;Q=D.next();){if(z=D.isPartiallySelectedSubtree(),Q=Q.cloneNode(!z),z&&(Oe=D.getSubtreeIterator(),Q.appendChild(et(Oe)),Oe.detach()),Q.nodeType==10)throw new se("HIERARCHY_REQUEST_ERR");le.appendChild(Q)}return le}function nt(D,z,Q){var le,Oe;Q=Q||{stop:!1};for(var it,ae;it=D.next();)if(D.isPartiallySelectedSubtree()){if(z(it)===!1){Q.stop=!0;return}else if(ae=D.getSubtreeIterator(),nt(ae,z,Q),ae.detach(),Q.stop)return}else for(le=_.createIterator(it);Oe=le.next();)if(z(Oe)===!1){Q.stop=!0;return}}function en(D){for(var z;D.next();)D.isPartiallySelectedSubtree()?(z=D.getSubtreeIterator(),en(z),z.detach()):D.remove()}function ve(D){for(var z,Q=te(D.range).createDocumentFragment(),le;z=D.next();){if(D.isPartiallySelectedSubtree()?(z=z.cloneNode(!1),le=D.getSubtreeIterator(),z.appendChild(ve(le)),le.detach()):D.remove(),z.nodeType==10)throw new se("HIERARCHY_REQUEST_ERR");Q.appendChild(z)}return Q}function Ae(D,z,Q){var le=!!(z&&z.length),Oe,it=!!Q;le&&(Oe=new RegExp("^("+z.join("|")+")$"));var ae=[];return nt(new wt(D,!1),function(Ee){if(!(le&&!Oe.test(Ee.nodeType))&&!(it&&!Q(Ee))){var Ie=D.startContainer;if(!(Ee==Ie&&fe(Ie)&&D.startOffset==Ie.length)){var tt=D.endContainer;Ee==tt&&fe(tt)&&D.endOffset==0||ae.push(Ee)}}}),ae}function dt(D){var z=typeof D.getName>"u"?"Range":D.getName();return"["+z+"("+_.inspectNode(D.startContainer)+":"+D.startOffset+", "+_.inspectNode(D.endContainer)+":"+D.endOffset+")]"}function wt(D,z){if(this.range=D,this.clonePartiallySelectedTextNodes=z,!D.collapsed){this.sc=D.startContainer,this.so=D.startOffset,this.ec=D.endContainer,this.eo=D.endOffset;var Q=D.commonAncestorContainer;this.sc===this.ec&&fe(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===Q&&!fe(this.sc)?this.sc.childNodes[this.so]:Ct(this.sc,Q,!0),this._last=this.ec===Q&&!fe(this.ec)?this.ec.childNodes[this.eo-1]:Ct(this.ec,Q,!0))}}wt.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var D=this._current=this._next;return D&&(this._next=D!==this._last?D.nextSibling:null,fe(D)&&this.clonePartiallySelectedTextNodes&&(D===this.ec&&(D=D.cloneNode(!0)).deleteData(this.eo,D.length-this.eo),this._current===this.sc&&(D=D.cloneNode(!0)).deleteData(0,this.so))),D},remove:function(){var D=this._current,z,Q;fe(D)&&(D===this.sc||D===this.ec)?(z=D===this.sc?this.so:0,Q=D===this.ec?this.eo:D.length,z!=Q&&D.deleteData(z,Q-z)):D.parentNode&&H(D)},isPartiallySelectedSubtree:function(){var D=this._current;return re(D,this.range)},getSubtreeIterator:function(){var D;if(this.isSingleCharacterDataNode)D=this.range.cloneRange(),D.collapse(!1);else{D=new $t(te(this.range));var z=this._current,Q=z,le=0,Oe=z,it=P(z);ze(z,this.sc)&&(Q=this.sc,le=this.so),ze(z,this.ec)&&(Oe=this.ec,it=this.eo),ft(D,Q,le,Oe,it)}return new wt(D,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var Ft=[1,3,4,5,7,8,10],Wn=[2,9,11],bn=[5,6,10,12],tn=[1,3,4,5,7,8,10,11],nn=[1,3,4,5,7,8];function cn(D){return function(z,Q){for(var le,Oe=Q?z:z.parentNode;Oe;){if(le=Oe.nodeType,I(D,le))return Oe;Oe=Oe.parentNode}return null}}var Nn=cn([9,11]),Y=cn(bn),ue=cn([6,10,12]),Xe=cn([1]);function Me(D,z){if(ue(D,z))throw new se("INVALID_NODE_TYPE_ERR")}function Dt(D,z){if(!I(z,D.nodeType))throw new se("INVALID_NODE_TYPE_ERR")}function yt(D,z){if(z<0||z>(fe(D)?D.length:D.childNodes.length))throw new se("INDEX_SIZE_ERR")}function Tr(D,z){if(Nn(D,!0)!==Nn(z,!0))throw new se("WRONG_DOCUMENT_ERR")}function Un(D){if(Y(D,!0))throw new se("NO_MODIFICATION_ALLOWED_ERR")}function xn(D,z){if(!D)throw new se(z)}function gs(D,z){return z<=(fe(D)?D.length:D.childNodes.length)}function io(D){return!!D.startContainer&&!!D.endContainer&&!(q&&(_.isBrokenNode(D.startContainer)||_.isBrokenNode(D.endContainer)))&&j(D.startContainer)==j(D.endContainer)&&gs(D.startContainer,D.startOffset)&&gs(D.endContainer,D.endOffset)}function xt(D){if(!io(D))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+D.inspect()+")")}var vs=document.createElement("style"),oi=!1;try{vs.innerHTML="<b>x</b>",oi=vs.firstChild.nodeType==3}catch{}$.features.htmlParsingConforms=oi;var ms=oi?function(D){var z=this.startContainer,Q=rt(z);if(!z)throw new se("INVALID_STATE_ERR");var le=null;return z.nodeType==1?le=z:fe(z)&&(le=_.parentElement(z)),le===null||le.nodeName=="HTML"&&_.isHtmlNamespace(rt(le).documentElement)&&_.isHtmlNamespace(le)?le=Q.createElement("body"):le=le.cloneNode(!1),le.innerHTML=D,_.fragmentFromNodeChildren(le)}:function(D){var z=te(this),Q=z.createElement("body");return Q.innerHTML=D,_.fragmentFromNodeChildren(Q)};function Qo(D,z){xt(D);var Q=D.startContainer,le=D.startOffset,Oe=D.endContainer,it=D.endOffset,ae=Q===Oe;fe(Oe)&&it>0&&it<Oe.length&&at(Oe,it,z),fe(Q)&&le>0&&le<Q.length&&(Q=at(Q,le,z),ae?(it-=le,Oe=Q):Oe==Q.parentNode&&it>=Ne(Q)&&it++,le=0),D.setStartAndEnd(Q,le,Oe,it)}function Ge(D){xt(D);var z=D.commonAncestorContainer.parentNode.cloneNode(!1);return z.appendChild(D.cloneContents()),z.innerHTML}var ea=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],ta=0,oo=1,Ju=2,Pi=3,ao=0,ys=1,_s=2,na=3;F.extend($.rangePrototype,{compareBoundaryPoints:function(D,z){xt(this),Tr(this.startContainer,z.startContainer);var Q,le,Oe,it,ae=D==Pi||D==ta?"start":"end",Ee=D==oo||D==ta?"start":"end";return Q=this[ae+"Container"],le=this[ae+"Offset"],Oe=z[Ee+"Container"],it=z[Ee+"Offset"],Ze(Q,le,Oe,it)},insertNode:function(D){if(xt(this),Dt(D,tn),Un(this.startContainer),ze(D,this.startContainer))throw new se("HIERARCHY_REQUEST_ERR");var z=ge(D,this.startContainer,this.startOffset);this.setStartBefore(z)},cloneContents:function(){xt(this);var D,z;if(this.collapsed)return te(this).createDocumentFragment();if(this.startContainer===this.endContainer&&fe(this.startContainer))return D=this.startContainer.cloneNode(!0),D.data=D.data.slice(this.startOffset,this.endOffset),z=te(this).createDocumentFragment(),z.appendChild(D),z;var Q=new wt(this,!0);return D=et(Q),Q.detach(),D},canSurroundContents:function(){xt(this),Un(this.startContainer),Un(this.endContainer);var D=new wt(this,!0),z=D._first&&re(D._first,this)||D._last&&re(D._last,this);return D.detach(),!z},surroundContents:function(D){if(Dt(D,nn),!this.canSurroundContents())throw new se("INVALID_STATE_ERR");var z=this.extractContents();if(D.hasChildNodes())for(;D.lastChild;)D.removeChild(D.lastChild);ge(D,this.startContainer,this.startOffset),D.appendChild(z),this.selectNode(D)},cloneRange:function(){xt(this);for(var D=new $t(te(this)),z=ea.length,Q;z--;)Q=ea[z],D[Q]=this[Q];return D},toString:function(){xt(this);var D=this.startContainer;if(D===this.endContainer&&fe(D))return D.nodeType==3||D.nodeType==4?D.data.slice(this.startOffset,this.endOffset):"";var z=[],Q=new wt(this,!0);return nt(Q,function(le){(le.nodeType==3||le.nodeType==4)&&z.push(le.data)}),Q.detach(),z.join("")},compareNode:function(D){xt(this);var z=D.parentNode,Q=Ne(D);if(!z)throw new se("NOT_FOUND_ERR");var le=this.comparePoint(z,Q),Oe=this.comparePoint(z,Q+1);return le<0?Oe>0?_s:ao:Oe>0?ys:na},comparePoint:function(D,z){return xt(this),xn(D,"HIERARCHY_REQUEST_ERR"),Tr(D,this.startContainer),Ze(D,z,this.startContainer,this.startOffset)<0?-1:Ze(D,z,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:ms,toHtml:function(){return Ge(this)},intersectsNode:function(D,z){if(xt(this),j(D)!=oe(this))return!1;var Q=D.parentNode,le=Ne(D);if(!Q)return!0;var Oe=Ze(Q,le,this.endContainer,this.endOffset),it=Ze(Q,le+1,this.startContainer,this.startOffset);return z?Oe<=0&&it>=0:Oe<0&&it>0},isPointInRange:function(D,z){return xt(this),xn(D,"HIERARCHY_REQUEST_ERR"),Tr(D,this.startContainer),Ze(D,z,this.startContainer,this.startOffset)>=0&&Ze(D,z,this.endContainer,this.endOffset)<=0},intersectsRange:function(D){return st(this,D,!1)},intersectsOrTouchesRange:function(D){return st(this,D,!0)},intersection:function(D){if(this.intersectsRange(D)){var z=Ze(this.startContainer,this.startOffset,D.startContainer,D.startOffset),Q=Ze(this.endContainer,this.endOffset,D.endContainer,D.endOffset),le=this.cloneRange();return z==-1&&le.setStart(D.startContainer,D.startOffset),Q==1&&le.setEnd(D.endContainer,D.endOffset),le}return null},union:function(D){if(this.intersectsOrTouchesRange(D)){var z=this.cloneRange();return Ze(D.startContainer,D.startOffset,this.startContainer,this.startOffset)==-1&&z.setStart(D.startContainer,D.startOffset),Ze(D.endContainer,D.endOffset,this.endContainer,this.endOffset)==1&&z.setEnd(D.endContainer,D.endOffset),z}else throw new se("Ranges do not intersect")},containsNode:function(D,z){return z?this.intersectsNode(D,!1):this.compareNode(D)==na},containsNodeContents:function(D){return this.comparePoint(D,0)>=0&&this.comparePoint(D,P(D))<=0},containsRange:function(D){var z=this.intersection(D);return z!==null&&D.equals(z)},containsNodeText:function(D){var z=this.cloneRange();z.selectNode(D);var Q=z.getNodes([3]);if(Q.length>0){z.setStart(Q[0],0);var le=Q.pop();return z.setEnd(le,le.length),this.containsRange(z)}else return this.containsNodeContents(D)},getNodes:function(D,z){return xt(this),Ae(this,D,z)},getDocument:function(){return te(this)},collapseBefore:function(D){this.setEndBefore(D),this.collapse(!1)},collapseAfter:function(D){this.setStartAfter(D),this.collapse(!0)},getBookmark:function(D){var z=te(this),Q=$.createRange(z);D=D||_.getBody(z),Q.selectNodeContents(D);var le=this.intersection(Q),Oe=0,it=0;return le&&(Q.setEnd(le.startContainer,le.startOffset),Oe=Q.toString().length,it=Oe+le.toString().length),{start:Oe,end:it,containerNode:D}},moveToBookmark:function(D){var z=D.containerNode,Q=0;this.setStart(z,0),this.collapse(!0);for(var le=[z],Oe,it=!1,ae=!1,Ee,Ie,tt;!ae&&(Oe=le.pop());)if(Oe.nodeType==3)Ee=Q+Oe.length,!it&&D.start>=Q&&D.start<=Ee&&(this.setStart(Oe,D.start-Q),it=!0),it&&D.end>=Q&&D.end<=Ee&&(this.setEnd(Oe,D.end-Q),ae=!0),Q=Ee;else for(tt=Oe.childNodes,Ie=tt.length;Ie--;)le.push(tt[Ie])},getName:function(){return"DomRange"},equals:function(D){return $t.rangesEqual(this,D)},isValid:function(){return io(this)},inspect:function(){return dt(this)},detach:function(){}});function N(D){D.START_TO_START=ta,D.START_TO_END=oo,D.END_TO_END=Ju,D.END_TO_START=Pi,D.NODE_BEFORE=ao,D.NODE_AFTER=ys,D.NODE_BEFORE_AND_AFTER=_s,D.NODE_INSIDE=na}function W(D){N(D),N(D.prototype)}function ne(D,z){return function(){xt(this);var Q=this.startContainer,le=this.startOffset,Oe=this.commonAncestorContainer,it=new wt(this,!0),ae,Ee;Q!==Oe&&(ae=Ct(Q,Oe,!0),Ee=we(ae),Q=Ee.node,le=Ee.offset),nt(it,Un),it.reset();var Ie=D(it);return it.detach(),z(this,Q,le,Q,le),Ie}}function ye(D,z){function Q(ae,Ee){return function(Ie){Dt(Ie,Ft),Dt(j(Ie),Wn);var tt=(ae?Le:we)(Ie);(Ee?le:Oe)(this,tt.node,tt.offset)}}function le(ae,Ee,Ie){var tt=ae.endContainer,En=ae.endOffset;(Ee!==ae.startContainer||Ie!==ae.startOffset)&&((j(Ee)!=j(tt)||Ze(Ee,Ie,tt,En)==1)&&(tt=Ee,En=Ie),z(ae,Ee,Ie,tt,En))}function Oe(ae,Ee,Ie){var tt=ae.startContainer,En=ae.startOffset;(Ee!==ae.endContainer||Ie!==ae.endOffset)&&((j(Ee)!=j(tt)||Ze(Ee,Ie,tt,En)==-1)&&(tt=Ee,En=Ie),z(ae,tt,En,Ee,Ie))}var it=function(){};it.prototype=$.rangePrototype,D.prototype=new it,F.extend(D.prototype,{setStart:function(ae,Ee){Me(ae,!0),yt(ae,Ee),le(this,ae,Ee)},setEnd:function(ae,Ee){Me(ae,!0),yt(ae,Ee),Oe(this,ae,Ee)},setStartAndEnd:function(){var ae=arguments,Ee=ae[0],Ie=ae[1],tt=Ee,En=Ie;switch(ae.length){case 3:En=ae[2];break;case 4:tt=ae[2],En=ae[3];break}Me(Ee,!0),yt(Ee,Ie),Me(tt,!0),yt(tt,En),z(this,Ee,Ie,tt,En)},setBoundary:function(ae,Ee,Ie){this["set"+(Ie?"Start":"End")](ae,Ee)},setStartBefore:Q(!0,!0),setStartAfter:Q(!1,!0),setEndBefore:Q(!0,!1),setEndAfter:Q(!1,!1),collapse:function(ae){xt(this),ae?z(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):z(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(ae){Me(ae,!0),z(this,ae,0,ae,P(ae))},selectNode:function(ae){Me(ae,!1),Dt(ae,Ft);var Ee=Le(ae),Ie=we(ae);z(this,Ee.node,Ee.offset,Ie.node,Ie.offset)},extractContents:ne(ve,z),deleteContents:ne(en,z),canSurroundContents:function(){xt(this),Un(this.startContainer),Un(this.endContainer);var ae=new wt(this,!0),Ee=ae._first&&re(ae._first,this)||ae._last&&re(ae._last,this);return ae.detach(),!Ee},splitBoundaries:function(){Qo(this)},splitBoundariesPreservingPositions:function(ae){Qo(this,ae)},normalizeBoundaries:function(){xt(this);var ae=this.startContainer,Ee=this.startOffset,Ie=this.endContainer,tt=this.endOffset,En=function(Mn){var Wr=Mn.nextSibling;Wr&&Wr.nodeType==Mn.nodeType&&(Ie=Mn,tt=Mn.length,Mn.appendData(Wr.data),H(Wr))},Wx=function(Mn){var Wr=Mn.previousSibling;if(Wr&&Wr.nodeType==Mn.nodeType){ae=Mn;var e9=Mn.length;if(Ee=Wr.length,Mn.insertData(0,Wr.data),H(Wr),ae==Ie)tt+=Ee,Ie=ae;else if(Ie==Mn.parentNode){var Ux=Ne(Mn);tt==Ux?(Ie=Mn,tt=e9):tt>Ux&&tt--}}},Vp=!0,sr;if(fe(Ie))tt==Ie.length?En(Ie):tt==0&&(sr=Ie.previousSibling,sr&&sr.nodeType==Ie.nodeType&&(tt=sr.length,ae==Ie&&(Vp=!1),sr.appendData(Ie.data),H(Ie),Ie=sr));else{if(tt>0){var Xp=Ie.childNodes[tt-1];Xp&&fe(Xp)&&En(Xp)}Vp=!this.collapsed}if(Vp){if(fe(ae))Ee==0?Wx(ae):Ee==ae.length&&(sr=ae.nextSibling,sr&&sr.nodeType==ae.nodeType&&(Ie==sr&&(Ie=ae,tt+=ae.length),ae.appendData(sr.data),H(sr)));else if(Ee<ae.childNodes.length){var Gp=ae.childNodes[Ee];Gp&&fe(Gp)&&Wx(Gp)}}else ae=Ie,Ee=tt;z(this,ae,Ee,Ie,tt)},collapseToPoint:function(ae,Ee){Me(ae,!0),yt(ae,Ee),this.setStartAndEnd(ae,Ee)},parentElement:function(){xt(this);var ae=this.commonAncestorContainer;return ae?Xe(this.commonAncestorContainer,!0):null}}),W(D)}function Fe(D){D.collapsed=D.startContainer===D.endContainer&&D.startOffset===D.endOffset,D.commonAncestorContainer=D.collapsed?D.startContainer:_.getCommonAncestor(D.startContainer,D.endContainer)}function ft(D,z,Q,le,Oe){D.startContainer=z,D.startOffset=Q,D.endContainer=le,D.endOffset=Oe,D.document=_.getDocument(z),Fe(D)}function $t(D){ft(this,D,0,D,0)}ye($t,ft),F.extend($t,{rangeProperties:ea,RangeIterator:wt,copyComparisonConstants:W,createPrototypeRange:ye,inspect:dt,toHtml:Ge,getRangeDocument:te,rangesEqual:function(D,z){return D.startContainer===z.startContainer&&D.startOffset===z.startOffset&&D.endContainer===z.endContainer&&D.endOffset===z.endOffset}}),$.DomRange=$t}),A.createCoreModule("WrappedRange",["DomRange"],function($,w){var _,F,L=$.dom,se=$.util,fe=L.DomPosition,Ne=$.DomRange,ze=L.getBody,rt=L.getContentDocument,Ze=L.isCharacterDataNode;if($.features.implementsDomRange&&function(){var H,re=Ne.rangeProperties;function te(ve){for(var Ae=re.length,dt;Ae--;)dt=re[Ae],ve[dt]=ve.nativeRange[dt];ve.collapsed=ve.startContainer===ve.endContainer&&ve.startOffset===ve.endOffset}function oe(ve,Ae,dt,wt,Ft){var Wn=ve.startContainer!==Ae||ve.startOffset!=dt,bn=ve.endContainer!==wt||ve.endOffset!=Ft,tn=!ve.equals(ve.nativeRange);(Wn||bn||tn)&&(ve.setEnd(wt,Ft),ve.setStart(Ae,dt))}var Le;_=function(ve){if(!ve)throw w.createError("WrappedRange: Range must be specified");this.nativeRange=ve,te(this)},Ne.createPrototypeRange(_,oe),H=_.prototype,H.selectNode=function(ve){this.nativeRange.selectNode(ve),te(this)},H.cloneContents=function(){return this.nativeRange.cloneContents()},H.surroundContents=function(ve){this.nativeRange.surroundContents(ve),te(this)},H.collapse=function(ve){this.nativeRange.collapse(ve),te(this)},H.cloneRange=function(){return new _(this.nativeRange.cloneRange())},H.refresh=function(){te(this)},H.toString=function(){return this.nativeRange.toString()};var we=document.createTextNode("test");ze(document).appendChild(we);var ge=document.createRange();ge.setStart(we,0),ge.setEnd(we,0);try{ge.setStart(we,1),H.setStart=function(ve,Ae){this.nativeRange.setStart(ve,Ae),te(this)},H.setEnd=function(ve,Ae){this.nativeRange.setEnd(ve,Ae),te(this)},Le=function(ve){return function(Ae){this.nativeRange[ve](Ae),te(this)}}}catch{H.setStart=function(Ae,dt){try{this.nativeRange.setStart(Ae,dt)}catch{this.nativeRange.setEnd(Ae,dt),this.nativeRange.setStart(Ae,dt)}te(this)},H.setEnd=function(Ae,dt){try{this.nativeRange.setEnd(Ae,dt)}catch{this.nativeRange.setStart(Ae,dt),this.nativeRange.setEnd(Ae,dt)}te(this)},Le=function(Ae,dt){return function(wt){try{this.nativeRange[Ae](wt)}catch{this.nativeRange[dt](wt),this.nativeRange[Ae](wt)}te(this)}}}H.setStartBefore=Le("setStartBefore","setEndBefore"),H.setStartAfter=Le("setStartAfter","setEndAfter"),H.setEndBefore=Le("setEndBefore","setStartBefore"),H.setEndAfter=Le("setEndAfter","setStartAfter"),H.selectNodeContents=function(ve){this.setStartAndEnd(ve,0,L.getNodeLength(ve))},ge.selectNodeContents(we),ge.setEnd(we,3);var st=document.createRange();st.selectNodeContents(we),st.setEnd(we,4),st.setStart(we,2),ge.compareBoundaryPoints(ge.START_TO_END,st)==-1&&ge.compareBoundaryPoints(ge.END_TO_START,st)==1?H.compareBoundaryPoints=function(ve,Ae){return Ae=Ae.nativeRange||Ae,ve==Ae.START_TO_END?ve=Ae.END_TO_START:ve==Ae.END_TO_START&&(ve=Ae.START_TO_END),this.nativeRange.compareBoundaryPoints(ve,Ae)}:H.compareBoundaryPoints=function(ve,Ae){return this.nativeRange.compareBoundaryPoints(ve,Ae.nativeRange||Ae)};var et=document.createElement("div");et.innerHTML="123";var nt=et.firstChild,en=ze(document);en.appendChild(et),ge.setStart(nt,1),ge.setEnd(nt,2),ge.deleteContents(),nt.data=="13"&&(H.deleteContents=function(){this.nativeRange.deleteContents(),te(this)},H.extractContents=function(){var ve=this.nativeRange.extractContents();return te(this),ve}),en.removeChild(et),en=null,se.isHostMethod(ge,"createContextualFragment")&&(H.createContextualFragment=function(ve){return this.nativeRange.createContextualFragment(ve)}),ze(document).removeChild(we),H.getName=function(){return"WrappedRange"},$.WrappedRange=_,$.createNativeRange=function(ve){return ve=rt(ve,w,"createNativeRange"),ve.createRange()}}(),$.features.implementsTextRange){var at=function(H){var re=H.parentElement(),te=H.duplicate();te.collapse(!0);var oe=te.parentElement();te=H.duplicate(),te.collapse(!1);var Le=te.parentElement(),we=oe==Le?oe:L.getCommonAncestor(oe,Le);return we==re?we:L.getCommonAncestor(re,we)},Ct=function(H){return H.compareEndPoints("StartToEnd",H)==0},P=function(H,re,te,oe,Le){var we=H.duplicate();we.collapse(te);var ge=we.parentElement();if(L.isOrIsAncestorOf(re,ge)||(ge=re),!ge.canHaveHTML){var st=new fe(ge.parentNode,L.getNodeIndex(ge));return{boundaryPosition:st,nodeInfo:{nodeIndex:st.offset,containerElement:st.node}}}var et=L.getDocument(ge).createElement("span");et.parentNode&&L.removeNode(et);for(var nt,en=te?"StartToStart":"StartToEnd",ve,Ae,dt,wt,Ft=Le&&Le.containerElement==ge?Le.nodeIndex:0,Wn=ge.childNodes.length,bn=Wn,tn=bn;tn==Wn?ge.appendChild(et):ge.insertBefore(et,ge.childNodes[tn]),we.moveToElementText(et),nt=we.compareEndPoints(en,H),!(nt==0||Ft==bn);){if(nt==-1){if(bn==Ft+1)break;Ft=tn}else bn=bn==Ft+1?Ft:tn;tn=Math.floor((Ft+bn)/2),ge.removeChild(et)}if(wt=et.nextSibling,nt==-1&&wt&&Ze(wt)){we.setEndPoint(te?"EndToStart":"EndToEnd",H);var nn;if(/[\r\n]/.test(wt.data)){var cn=we.duplicate(),Nn=cn.text.replace(/\r\n/g,"\r").length;for(nn=cn.moveStart("character",Nn);(nt=cn.compareEndPoints("StartToEnd",cn))==-1;)nn++,cn.moveStart("character",1)}else nn=we.text.length;dt=new fe(wt,nn)}else ve=(oe||!te)&&et.previousSibling,Ae=(oe||te)&&et.nextSibling,Ae&&Ze(Ae)?dt=new fe(Ae,0):ve&&Ze(ve)?dt=new fe(ve,ve.data.length):dt=new fe(ge,L.getNodeIndex(et));return L.removeNode(et),{boundaryPosition:dt,nodeInfo:{nodeIndex:tn,containerElement:ge}}},I=function(H,re){var te,oe,Le=H.offset,we=L.getDocument(H.node),ge,st,et=ze(we).createTextRange(),nt=Ze(H.node);return nt?(te=H.node,oe=te.parentNode):(st=H.node.childNodes,te=Le<st.length?st[Le]:null,oe=H.node),ge=we.createElement("span"),ge.innerHTML="&#feff;",te?oe.insertBefore(ge,te):oe.appendChild(ge),et.moveToElementText(ge),et.collapse(!re),oe.removeChild(ge),nt&&et[re?"moveStart":"moveEnd"]("character",Le),et};F=function(H){this.textRange=H,this.refresh()},F.prototype=new Ne(document),F.prototype.refresh=function(){var H,re,te,oe=at(this.textRange);Ct(this.textRange)?re=H=P(this.textRange,oe,!0,!0).boundaryPosition:(te=P(this.textRange,oe,!0,!1),H=te.boundaryPosition,re=P(this.textRange,oe,!1,!1,te.nodeInfo).boundaryPosition),this.setStart(H.node,H.offset),this.setEnd(re.node,re.offset)},F.prototype.getName=function(){return"WrappedTextRange"},Ne.copyComparisonConstants(F);var j=function(H){if(H.collapsed)return I(new fe(H.startContainer,H.startOffset),!0);var re=I(new fe(H.startContainer,H.startOffset),!0),te=I(new fe(H.endContainer,H.endOffset),!1),oe=ze(Ne.getRangeDocument(H)).createTextRange();return oe.setEndPoint("StartToStart",re),oe.setEndPoint("EndToEnd",te),oe};if(F.rangeToTextRange=j,F.prototype.toTextRange=function(){return j(this)},$.WrappedTextRange=F,!$.features.implementsDomRange||$.config.preferTextRange){var q=function(H){return H("return this;")()}(Function);typeof q.Range>"u"&&(q.Range=F),$.createNativeRange=function(H){return H=rt(H,w,"createNativeRange"),ze(H).createTextRange()},$.WrappedRange=F}}$.createRange=function(H){return H=rt(H,w,"createRange"),new $.WrappedRange($.createNativeRange(H))},$.createRangyRange=function(H){return H=rt(H,w,"createRangyRange"),new Ne(H)},se.createAliasForDeprecatedMethod($,"createIframeRange","createRange"),se.createAliasForDeprecatedMethod($,"createIframeRangyRange","createRangyRange"),$.addShimListener(function(H){var re=H.document;typeof re.createRange>"u"&&(re.createRange=function(){return $.createRange(re)}),re=H=null})}),A.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function($,w){$.config.checkSelectionRanges=!0;var _="boolean",F="number",L=$.dom,se=$.util,fe=se.isHostMethod,Ne=$.DomRange,ze=$.WrappedRange,rt=$.DOMException,Ze=L.DomPosition,at,Ct,P=$.features,I="Control",j=L.getDocument,q=L.getBody,H=Ne.rangesEqual;function re(N){return typeof N=="string"?/^backward(s)?$/i.test(N):!!N}function te(N,W){if(N){if(L.isWindow(N))return N;if(N instanceof xt)return N.win;var ne=L.getContentDocument(N,w,W);return L.getWindow(ne)}else return window}function oe(N){return te(N,"getWinSelection").getSelection()}function Le(N){return te(N,"getDocSelection").document.selection}function we(N){var W=!1;return N.anchorNode&&(W=L.comparePoints(N.anchorNode,N.anchorOffset,N.focusNode,N.focusOffset)==1),W}var ge=fe(window,"getSelection"),st=se.isHostObject(document,"selection");P.implementsWinGetSelection=ge,P.implementsDocSelection=st;var et=st&&(!ge||$.config.preferTextRange);if(et)at=Le,$.isSelectionValid=function(N){var W=te(N,"isSelectionValid").document,ne=W.selection;return ne.type!="None"||j(ne.createRange().parentElement())==W};else if(ge)at=oe,$.isSelectionValid=function(){return!0};else return w.fail("Neither document.selection or window.getSelection() detected."),!1;$.getNativeSelection=at;var nt=at();if(!nt)return w.fail("Native selection was null (possibly issue 138?)"),!1;var en=$.createNativeRange(document),ve=q(document),Ae=se.areHostProperties(nt,["anchorNode","focusNode","anchorOffset","focusOffset"]);P.selectionHasAnchorAndFocus=Ae;var dt=fe(nt,"extend");P.selectionHasExtend=dt;var wt=fe(nt,"setBaseAndExtent");P.selectionHasSetBaseAndExtent=wt;var Ft=typeof nt.rangeCount==F;P.selectionHasRangeCount=Ft;var Wn=!1,bn=!0,tn=dt?function(N,W){var ne=Ne.getRangeDocument(W),ye=$.createRange(ne);ye.collapseToPoint(W.endContainer,W.endOffset),N.addRange(Me(ye)),N.extend(W.startContainer,W.startOffset)}:null;se.areHostMethods(nt,["addRange","getRangeAt","removeAllRanges"])&&typeof nt.rangeCount==F&&P.implementsDomRange&&function(){var N=window.getSelection();if(N){for(var W=N.rangeCount,ne=W>1,ye=[],Fe=we(N),ft=0;ft<W;++ft)ye[ft]=N.getRangeAt(ft);var $t=L.createTestElement(document,"",!1),D=$t.appendChild(document.createTextNode(" ")),z=document.createRange();if(z.setStart(D,1),z.collapse(!0),N.removeAllRanges(),N.addRange(z),bn=N.rangeCount==1,N.removeAllRanges(),!ne){var Q=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(Q&&parseInt(Q[1])>=36)Wn=!1;else{var le=z.cloneRange();z.setStart(D,0),le.setEnd(D,3),le.setStart(D,2),N.addRange(z),N.addRange(le),Wn=N.rangeCount==2}}for(L.removeNode($t),N.removeAllRanges(),ft=0;ft<W;++ft)ft==0&&Fe?tn?tn(N,ye[ft]):($.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),N.addRange(ye[ft])):N.addRange(ye[ft])}}(),P.selectionSupportsMultipleRanges=Wn,P.collapsedNonEditableSelectionsSupported=bn;var nn=!1,cn;ve&&fe(ve,"createControlRange")&&(cn=ve.createControlRange(),se.areHostProperties(cn,["item","add"])&&(nn=!0)),P.implementsControlRange=nn,Ae?Ct=function(N){return N.anchorNode===N.focusNode&&N.anchorOffset===N.focusOffset}:Ct=function(N){return N.rangeCount?N.getRangeAt(N.rangeCount-1).collapsed:!1};function Nn(N,W,ne){var ye=ne?"end":"start",Fe=ne?"start":"end";N.anchorNode=W[ye+"Container"],N.anchorOffset=W[ye+"Offset"],N.focusNode=W[Fe+"Container"],N.focusOffset=W[Fe+"Offset"]}function Y(N){var W=N.nativeSelection;N.anchorNode=W.anchorNode,N.anchorOffset=W.anchorOffset,N.focusNode=W.focusNode,N.focusOffset=W.focusOffset}function ue(N){N.anchorNode=N.focusNode=null,N.anchorOffset=N.focusOffset=0,N.rangeCount=0,N.isCollapsed=!0,N._ranges.length=0,Xe(N)}function Xe(N){N.type=N.rangeCount==0?"None":Ct(N)?"Caret":"Range"}function Me(N){var W;return N instanceof Ne?(W=$.createNativeRange(N.getDocument()),W.setEnd(N.endContainer,N.endOffset),W.setStart(N.startContainer,N.startOffset)):N instanceof ze?W=N.nativeRange:P.implementsDomRange&&N instanceof L.getWindow(N.startContainer).Range&&(W=N),W}function Dt(N){if(!N.length||N[0].nodeType!=1)return!1;for(var W=1,ne=N.length;W<ne;++W)if(!L.isAncestorOf(N[0],N[W]))return!1;return!0}function yt(N){var W=N.getNodes();if(!Dt(W))throw w.createError("getSingleElementFromRange: range "+N.inspect()+" did not consist of a single element");return W[0]}function Tr(N){return!!N&&typeof N.text<"u"}function Un(N,W){var ne=new ze(W);N._ranges=[ne],Nn(N,ne,!1),N.rangeCount=1,N.isCollapsed=ne.collapsed,Xe(N)}function xn(N){if(N._ranges.length=0,N.docSelection.type=="None")ue(N);else{var W=N.docSelection.createRange();if(Tr(W))Un(N,W);else{N.rangeCount=W.length;for(var ne,ye=j(W.item(0)),Fe=0;Fe<N.rangeCount;++Fe)ne=$.createRange(ye),ne.selectNode(W.item(Fe)),N._ranges.push(ne);N.isCollapsed=N.rangeCount==1&&N._ranges[0].collapsed,Nn(N,N._ranges[N.rangeCount-1],!1),Xe(N)}}}function gs(N,W){for(var ne=N.docSelection.createRange(),ye=yt(W),Fe=j(ne.item(0)),ft=q(Fe).createControlRange(),$t=0,D=ne.length;$t<D;++$t)ft.add(ne.item($t));try{ft.add(ye)}catch{throw w.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}ft.select(),xn(N)}var io;fe(nt,"getRangeAt")?io=function(N,W){try{return N.getRangeAt(W)}catch{return null}}:Ae&&(io=function(N){var W=j(N.anchorNode),ne=$.createRange(W);return ne.setStartAndEnd(N.anchorNode,N.anchorOffset,N.focusNode,N.focusOffset),ne.collapsed!==this.isCollapsed&&ne.setStartAndEnd(N.focusNode,N.focusOffset,N.anchorNode,N.anchorOffset),ne});function xt(N,W,ne){this.nativeSelection=N,this.docSelection=W,this._ranges=[],this.win=ne,this.refresh()}xt.prototype=$.selectionPrototype;function vs(N){N.win=N.anchorNode=N.focusNode=N._ranges=null,N.rangeCount=N.anchorOffset=N.focusOffset=0,N.detached=!0,Xe(N)}var oi=[];function ms(N,W){for(var ne=oi.length,ye,Fe;ne--;)if(ye=oi[ne],Fe=ye.selection,W=="deleteAll")vs(Fe);else if(ye.win==N)return W=="delete"?(oi.splice(ne,1),!0):Fe;return W=="deleteAll"&&(oi.length=0),null}var Qo=function(N){if(N&&N instanceof xt)return N.refresh(),N;N=te(N,"getNativeSelection");var W=ms(N),ne=at(N),ye=st?Le(N):null;return W?(W.nativeSelection=ne,W.docSelection=ye,W.refresh()):(W=new xt(ne,ye,N),oi.push({win:N,selection:W})),W};$.getSelection=Qo,se.createAliasForDeprecatedMethod($,"getIframeSelection","getSelection");var Ge=xt.prototype;function ea(N,W){for(var ne=j(W[0].startContainer),ye=q(ne).createControlRange(),Fe=0,ft,$t=W.length;Fe<$t;++Fe){ft=yt(W[Fe]);try{ye.add(ft)}catch{throw w.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}ye.select(),xn(N)}if(!et&&Ae&&se.areHostMethods(nt,["removeAllRanges","addRange"])){Ge.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),ue(this)};var ta=function(N,W){tn(N.nativeSelection,W),N.refresh()};Ft?Ge.addRange=function(N,W){if(nn&&st&&this.docSelection.type==I)gs(this,N);else if(re(W)&&dt)ta(this,N);else{var ne;Wn?ne=this.rangeCount:(this.removeAllRanges(),ne=0);var ye=Me(N).cloneRange();try{this.nativeSelection.addRange(ye)}catch{}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==ne+1){if($.config.checkSelectionRanges){var Fe=io(this.nativeSelection,this.rangeCount-1);Fe&&!H(Fe,N)&&(N=new ze(Fe))}this._ranges[this.rangeCount-1]=N,Nn(this,N,Pi(this.nativeSelection)),this.isCollapsed=Ct(this),Xe(this)}else this.refresh()}}:Ge.addRange=function(N,W){re(W)&&dt?ta(this,N):(this.nativeSelection.addRange(Me(N)),this.refresh())},Ge.setRanges=function(N){if(nn&&st&&N.length>1)ea(this,N);else{this.removeAllRanges();for(var W=0,ne=N.length;W<ne;++W)this.addRange(N[W])}}}else if(fe(nt,"empty")&&fe(en,"select")&&nn&&et)Ge.removeAllRanges=function(){try{if(this.docSelection.empty(),this.docSelection.type!="None"){var N;if(this.anchorNode)N=j(this.anchorNode);else if(this.docSelection.type==I){var W=this.docSelection.createRange();W.length&&(N=j(W.item(0)))}if(N){var ne=q(N).createTextRange();ne.select(),this.docSelection.empty()}}}catch{}ue(this)},Ge.addRange=function(N){this.docSelection.type==I?gs(this,N):($.WrappedTextRange.rangeToTextRange(N).select(),this._ranges[0]=N,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,Nn(this,N,!1),Xe(this))},Ge.setRanges=function(N){this.removeAllRanges();var W=N.length;W>1?ea(this,N):W&&this.addRange(N[0])};else return w.fail("No means of selecting a Range or TextRange was found"),!1;Ge.getRangeAt=function(N){if(N<0||N>=this.rangeCount)throw new rt("INDEX_SIZE_ERR");return this._ranges[N].cloneRange()};var oo;if(et)oo=function(N){var W;$.isSelectionValid(N.win)?W=N.docSelection.createRange():(W=q(N.win.document).createTextRange(),W.collapse(!0)),N.docSelection.type==I?xn(N):Tr(W)?Un(N,W):ue(N)};else if(fe(nt,"getRangeAt")&&typeof nt.rangeCount==F)oo=function(N){if(nn&&st&&N.docSelection.type==I)xn(N);else if(N._ranges.length=N.rangeCount=N.nativeSelection.rangeCount,N.rangeCount){for(var W=0,ne=N.rangeCount;W<ne;++W)N._ranges[W]=new $.WrappedRange(N.nativeSelection.getRangeAt(W));Nn(N,N._ranges[N.rangeCount-1],Pi(N.nativeSelection)),N.isCollapsed=Ct(N),Xe(N)}else ue(N)};else if(Ae&&typeof nt.isCollapsed==_&&typeof en.collapsed==_&&P.implementsDomRange)oo=function(N){var W,ne=N.nativeSelection;ne.anchorNode?(W=io(ne,0),N._ranges=[W],N.rangeCount=1,Y(N),N.isCollapsed=Ct(N),Xe(N)):ue(N)};else return w.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;Ge.refresh=function(N){var W=N?this._ranges.slice(0):null,ne=this.anchorNode,ye=this.anchorOffset;if(oo(this),N){var Fe=W.length;if(Fe!=this._ranges.length||this.anchorNode!=ne||this.anchorOffset!=ye)return!0;for(;Fe--;)if(!H(W[Fe],this._ranges[Fe]))return!0;return!1}};var Ju=function(N,W){var ne=N.getAllRanges();N.removeAllRanges();for(var ye=0,Fe=ne.length;ye<Fe;++ye)H(W,ne[ye])||N.addRange(ne[ye]);N.rangeCount||ue(N)};nn&&st?Ge.removeRange=function(N){if(this.docSelection.type==I){for(var W=this.docSelection.createRange(),ne=yt(N),ye=j(W.item(0)),Fe=q(ye).createControlRange(),ft,$t=!1,D=0,z=W.length;D<z;++D)ft=W.item(D),ft!==ne||$t?Fe.add(W.item(D)):$t=!0;Fe.select(),xn(this)}else Ju(this,N)}:Ge.removeRange=function(N){Ju(this,N)};var Pi;!et&&Ae&&P.implementsDomRange?(Pi=we,Ge.isBackward=function(){return Pi(this)}):Pi=Ge.isBackward=function(){return!1},Ge.isBackwards=Ge.isBackward,Ge.toString=function(){for(var N=[],W=0,ne=this.rangeCount;W<ne;++W)N[W]=""+this._ranges[W];return N.join("")};function ao(N,W){if(N.win.document!=j(W))throw new rt("WRONG_DOCUMENT_ERR")}function ys(N,W){if(W<0||W>(L.isCharacterDataNode(N)?N.length:N.childNodes.length))throw new rt("INDEX_SIZE_ERR")}Ge.collapse=function(N,W){ao(this,N);var ne=$.createRange(N);ne.collapseToPoint(N,W),this.setSingleRange(ne),this.isCollapsed=!0},Ge.collapseToStart=function(){if(this.rangeCount){var N=this._ranges[0];this.collapse(N.startContainer,N.startOffset)}else throw new rt("INVALID_STATE_ERR")},Ge.collapseToEnd=function(){if(this.rangeCount){var N=this._ranges[this.rangeCount-1];this.collapse(N.endContainer,N.endOffset)}else throw new rt("INVALID_STATE_ERR")},Ge.selectAllChildren=function(N){ao(this,N);var W=$.createRange(N);W.selectNodeContents(N),this.setSingleRange(W)},wt?Ge.setBaseAndExtent=function(N,W,ne,ye){this.nativeSelection.setBaseAndExtent(N,W,ne,ye),this.refresh()}:dt&&(Ge.setBaseAndExtent=function(N,W,ne,ye){ys(N,W),ys(ne,ye),ao(this,N),ao(this,ne);var Fe=$.createRange(node),ft=L.comparePoints(N,W,ne,ye)==-1;ft?Fe.setStartAndEnd(ne,ye,N,W):Fe.setStartAndEnd(N,W,ne,ye),this.setSingleRange(Fe,ft)}),Ge.deleteFromDocument=function(){if(nn&&st&&this.docSelection.type==I){for(var N=this.docSelection.createRange(),W;N.length;)W=N.item(0),N.remove(W),L.removeNode(W);this.refresh()}else if(this.rangeCount){var ne=this.getAllRanges();if(ne.length){this.removeAllRanges();for(var ye=0,Fe=ne.length;ye<Fe;++ye)ne[ye].deleteContents();this.addRange(ne[Fe-1])}}},Ge.eachRange=function(N,W){for(var ne=0,ye=this._ranges.length;ne<ye;++ne)if(N(this.getRangeAt(ne)))return W},Ge.getAllRanges=function(){var N=[];return this.eachRange(function(W){N.push(W)}),N},Ge.setSingleRange=function(N,W){this.removeAllRanges(),this.addRange(N,W)},Ge.callMethodOnEachRange=function(N,W){var ne=[];return this.eachRange(function(ye){ne.push(ye[N].apply(ye,W||[]))}),ne};function _s(N){return function(W,ne){var ye;this.rangeCount?(ye=this.getRangeAt(0),ye["set"+(N?"Start":"End")](W,ne)):(ye=$.createRange(this.win.document),ye.setStartAndEnd(W,ne)),this.setSingleRange(ye,this.isBackward())}}Ge.setStart=_s(!0),Ge.setEnd=_s(!1),$.rangePrototype.select=function(N){Qo(this.getDocument()).setSingleRange(this,N)},Ge.changeEachRange=function(N){var W=[],ne=this.isBackward();this.eachRange(function(ye){N(ye),W.push(ye)}),this.removeAllRanges(),ne&&W.length==1?this.addRange(W[0],"backward"):this.setRanges(W)},Ge.containsNode=function(N,W){return this.eachRange(function(ne){return ne.containsNode(N,W)},!0)||!1},Ge.getBookmark=function(N){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[N])}},Ge.moveToBookmark=function(N){for(var W=[],ne=0,ye,Fe;ye=N.rangeBookmarks[ne++];)Fe=$.createRange(this.win),Fe.moveToBookmark(ye),W.push(Fe);N.backward?this.setSingleRange(W[0],"backward"):this.setRanges(W)},Ge.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},Ge.restoreRanges=function(N){this.removeAllRanges();for(var W=0,ne;ne=N.ranges[W];++W)this.addRange(ne,N.backward&&W==0)},Ge.toHtml=function(){var N=[];return this.eachRange(function(W){N.push(Ne.toHtml(W))}),N.join("")},P.implementsTextRange&&(Ge.getNativeTextRange=function(){var N;if(N=this.docSelection){var W=N.createRange();if(Tr(W))return W;throw w.createError("getNativeTextRange: selection is a control selection")}else{if(this.rangeCount>0)return $.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw w.createError("getNativeTextRange: selection contains no range")}});function na(N){var W=[],ne=new Ze(N.anchorNode,N.anchorOffset),ye=new Ze(N.focusNode,N.focusOffset),Fe=typeof N.getName=="function"?N.getName():"Selection";if(typeof N.rangeCount<"u")for(var ft=0,$t=N.rangeCount;ft<$t;++ft)W[ft]=Ne.inspect(N.getRangeAt(ft));return"["+Fe+"(Ranges: "+W.join(", ")+")(anchor: "+ne.inspect()+", focus: "+ye.inspect()+"]"}Ge.getName=function(){return"WrappedSelection"},Ge.inspect=function(){return na(this)},Ge.detach=function(){ms(this.win,"delete"),vs(this)},xt.detachAll=function(){ms(null,"deleteAll")},xt.inspect=na,xt.isDirectionBackward=re,$.Selection=xt,$.selectionPrototype=Ge,$.addShimListener(function(N){typeof N.getSelection>"u"&&(N.getSelection=function(){return Qo(N)}),N=null})});var he=!1,Ve=function($){he||(he=!0,!A.initialized&&A.config.autoInitialize&&B())};return b&&(document.readyState=="complete"?Ve():(u(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",Ve,!1),J(window,"load",Ve))),A})}(yp)),yp.exports}var QF=W0();const U0=ul(QF);var _p={exports:{}},V0;function e5(){return V0||(V0=1,function(t,e){(function(n,r){t.exports=n(W0())})(function(n){return n.createModule("ClassApplier",["WrappedSelection"],function(r,i){var o=r.dom,a=o.DomPosition,s=o.arrayContains,l=r.util,u=l.forEach,c="span",d=l.isHostMethod(document,"createElementNS");function f(P,I){for(var j in P)if(P.hasOwnProperty(j)&&I(j,P[j])===!1)return!1;return!0}function h(P){return P.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function v(P,I){return!!P&&new RegExp("(?:^|\\s)"+I+"(?:\\s|$)").test(P)}function g(P,I){if(typeof P.classList=="object")return P.classList.contains(I);var j=typeof P.className=="string",q=j?P.className:P.getAttribute("class");return v(q,I)}function m(P,I){if(typeof P.classList=="object")P.classList.add(I);else{var j=typeof P.className=="string",q=j?P.className:P.getAttribute("class");q?v(q,I)||(q+=" "+I):q=I,j?P.className=q:P.setAttribute("class",q)}}var y=function(){function P(I,j,q){return j&&q?" ":""}return function(I,j){if(typeof I.classList=="object")I.classList.remove(j);else{var q=typeof I.className=="string",H=q?I.className:I.getAttribute("class");H=H.replace(new RegExp("(^|\\s)"+j+"(\\s|$)"),P),q?I.className=H:I.setAttribute("class",H)}}}();function x(P){var I=typeof P.className=="string";return I?P.className:P.getAttribute("class")}function E(P){return P&&P.split(/\s+/).sort().join(" ")}function b(P){return E(x(P))}function T(P,I){return b(P)==b(I)}function A(P,I){for(var j=I.split(/\s+/),q=0,H=j.length;q<H;++q)if(!g(P,h(j[q])))return!1;return!0}function S(P){var I=P.parentNode;return I&&I.nodeType==1&&!/^(textarea|style|script|select|iframe)$/i.test(I.nodeName)}function M(P,I,j,q,H){var re=P.node,te=P.offset,oe=re,Le=te;re==q&&te>H&&++Le,re==I&&(te==j||te==j+1)&&(oe=q,Le+=H-j),re==I&&te>j+1&&--Le,P.node=oe,P.offset=Le}function C(P,I,j){P.node==I&&P.offset>j&&--P.offset}function G(P,I,j,q){j==-1&&(j=I.childNodes.length);var H=P.parentNode,re=o.getNodeIndex(P);u(q,function(te){M(te,H,re,I,j)}),I.childNodes.length==j?I.appendChild(P):I.insertBefore(P,I.childNodes[j])}function K(P,I){var j=P.parentNode,q=o.getNodeIndex(P);u(I,function(H){C(H,j,q)}),o.removeNode(P)}function J(P,I,j,q,H){for(var re,te=[];re=P.firstChild;)G(re,I,j++,H),te.push(re);return K(P,H),te}function R(P,I){return J(P,P.parentNode,o.getNodeIndex(P),!0,I)}function k(P,I){var j=P.cloneRange();j.selectNodeContents(I);var q=j.intersection(P),H=q?q.toString():"";return H!=""}function B(P){for(var I=P.getNodes([3]),j=0,q;(q=I[j])&&!k(P,q);)++j;for(var H=I.length-1;(q=I[H])&&!k(P,q);)--H;return I.slice(j,H+1)}function Z(P,I){if(P.attributes.length!=I.attributes.length)return!1;for(var j=0,q=P.attributes.length,H,re,te;j<q;++j)if(H=P.attributes[j],te=H.name,te!="class"&&(re=I.attributes.getNamedItem(te),H===null!=(re===null)||H.specified!=re.specified||H.specified&&H.nodeValue!==re.nodeValue))return!1;return!0}function ee(P,I){for(var j=0,q=P.attributes.length,H;j<q;++j)if(H=P.attributes[j].name,!(I&&s(I,H))&&P.attributes[j].specified&&H!="class")return!0;return!1}var ce=o.getComputedStyleProperty,Be=function(){var P=document.createElement("div");return typeof P.isContentEditable=="boolean"?function(I){return I&&I.nodeType==1&&I.isContentEditable}:function(I){return!I||I.nodeType!=1||I.contentEditable=="false"?!1:I.contentEditable=="true"||Be(I.parentNode)}}();function me(P){var I;return P&&P.nodeType==1&&((I=P.parentNode)&&I.nodeType==9&&I.designMode=="on"||Be(P)&&!Be(P.parentNode))}function de(P){return(Be(P)||P.nodeType!=1&&Be(P.parentNode))&&!me(P)}var Se=/^inline(-block|-table)?$/i;function je(P){return P&&P.nodeType==1&&!Se.test(ce(P,"display"))}var he=/[^\r\n\t\f \u200B]/;function Ve(P){if(P.data.length==0)return!0;if(he.test(P.data))return!1;var I=ce(P.parentNode,"whiteSpace");switch(I){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(P.data))return!1}return je(P.previousSibling)||je(P.nextSibling)}function $(P){var I=[],j,q;for(j=0;q=P[j++];)I.push(new a(q.startContainer,q.startOffset),new a(q.endContainer,q.endOffset));return I}function w(P,I){for(var j=0,q,H,re,te=P.length;j<te;++j)q=P[j],H=I[j*2],re=I[j*2+1],q.setStartAndEnd(H.node,H.offset,re.node,re.offset)}function _(P,I){return o.isCharacterDataNode(P)?I==0?!!P.previousSibling:I==P.length?!!P.nextSibling:!0:I>0&&I<P.childNodes.length}function F(P,I,j,q){var H,re,te=j==0;if(o.isAncestorOf(I,P))return P;if(o.isCharacterDataNode(I)){var oe=o.getNodeIndex(I);if(j==0)j=oe;else if(j==I.length)j=oe+1;else throw i.createError("splitNodeAt() should not be called with offset in the middle of a data node ("+j+" in "+I.data);I=I.parentNode}if(_(I,j)){H=I.cloneNode(!1),re=I.parentNode,H.id&&H.removeAttribute("id");for(var Le,we=0;Le=I.childNodes[j];)G(Le,H,we++,q);return G(H,re,o.getNodeIndex(I)+1,q),I==P?H:F(P,re,o.getNodeIndex(H),q)}else if(P!=I){H=I.parentNode;var ge=o.getNodeIndex(I);return te||ge++,F(P,H,ge,q)}return P}function L(P,I){return P.namespaceURI==I.namespaceURI&&P.tagName.toLowerCase()==I.tagName.toLowerCase()&&T(P,I)&&Z(P,I)&&ce(P,"display")=="inline"&&ce(I,"display")=="inline"}function se(P){var I=P?"nextSibling":"previousSibling";return function(j,q){var H=j.parentNode,re=j[I];if(re){if(re&&re.nodeType==3)return re}else if(q&&(re=H[I],re&&re.nodeType==1&&L(H,re))){var te=re[P?"firstChild":"lastChild"];if(te&&te.nodeType==3)return te}return null}}var fe=se(!1),Ne=se(!0);function ze(P){this.isElementMerge=P.nodeType==1,this.textNodes=[];var I=this.isElementMerge?P.lastChild:P;I&&(this.textNodes[0]=I)}ze.prototype={doMerge:function(P){var I=this.textNodes,j=I[0];if(I.length>1){var q=o.getNodeIndex(j),H=[],re=0,te;u(I,function(oe,Le){te=oe.parentNode,Le>0&&(te.removeChild(oe),te.hasChildNodes()||o.removeNode(te),P&&u(P,function(we){we.node==oe&&(we.node=j,we.offset+=re),we.node==te&&we.offset>q&&(--we.offset,we.offset==q+1&&Le<I.length-1&&(we.node=j,we.offset=re))})),H[Le]=oe.data,re+=oe.data.length}),j.data=H.join("")}return j.data},getLength:function(){for(var P=this.textNodes.length,I=0;P--;)I+=this.textNodes[P].length;return I},toString:function(){var P=[];return u(this.textNodes,function(I,j){P[j]="'"+I.data+"'"}),"[Merge("+P.join(",")+")]"}};var rt=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],Ze={};function at(P,I,j){var q,H,re,te,oe=this;oe.cssClass=oe.className=P;var Le=null,we={};if(typeof I=="object"&&I!==null){for(typeof I.elementTagName<"u"&&(I.elementTagName=I.elementTagName.toLowerCase()),j=I.tagNames,Le=I.elementProperties,we=I.elementAttributes,H=0;te=rt[H++];)I.hasOwnProperty(te)&&(oe[te]=I[te]);q=I.normalize}else q=I;oe.normalize=typeof q>"u"?!0:q,oe.attrExceptions=[];var ge=document.createElement(oe.elementTagName);oe.elementProperties=oe.copyPropertiesToElement(Le,ge,!0),f(we,function(et,nt){oe.attrExceptions.push(et),we[et]=""+nt}),oe.elementAttributes=we,oe.elementSortedClassName=oe.elementProperties.hasOwnProperty("className")?E(oe.elementProperties.className+" "+P):P,oe.applyToAnyTagName=!1;var st=typeof j;if(st=="string")j=="*"?oe.applyToAnyTagName=!0:oe.tagNames=h(j.toLowerCase()).split(/\s*,\s*/);else if(st=="object"&&typeof j.length=="number")for(oe.tagNames=[],H=0,re=j.length;H<re;++H)j[H]=="*"?oe.applyToAnyTagName=!0:oe.tagNames.push(j[H].toLowerCase());else oe.tagNames=[oe.elementTagName]}at.prototype={elementTagName:c,elementProperties:{},elementAttributes:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,useExistingElements:!0,removeEmptyElements:!0,onElementCreate:null,copyPropertiesToElement:function(P,I,j){var q,H,re={},te,oe,Le,we;for(var ge in P)if(P.hasOwnProperty(ge))if(oe=P[ge],Le=I[ge],ge=="className")m(I,oe),m(I,this.className),I[ge]=E(I[ge]),j&&(re[ge]=oe);else if(ge=="style"){H=Le,j&&(re[ge]=te={});for(q in P[ge])P[ge].hasOwnProperty(q)&&(H[q]=oe[q],j&&(te[q]=H[q]));this.attrExceptions.push(ge)}else I[ge]=oe,j&&(re[ge]=I[ge],we=Ze.hasOwnProperty(ge)?Ze[ge]:ge,this.attrExceptions.push(we));return j?re:""},copyAttributesToElement:function(P,I){for(var j in P)P.hasOwnProperty(j)&&!/^class(?:Name)?$/i.test(j)&&I.setAttribute(j,P[j])},appliesToElement:function(P){return s(this.tagNames,P.tagName.toLowerCase())},getEmptyElements:function(P){var I=this;return P.getNodes([1],function(j){return I.appliesToElement(j)&&!j.hasChildNodes()})},hasClass:function(P){return P.nodeType==1&&(this.applyToAnyTagName||this.appliesToElement(P))&&g(P,this.className)},getSelfOrAncestorWithClass:function(P){for(;P;){if(this.hasClass(P))return P;P=P.parentNode}return null},isModifiable:function(P){return!this.applyToEditableOnly||de(P)},isIgnorableWhiteSpaceNode:function(P){return this.ignoreWhiteSpace&&P&&P.nodeType==3&&Ve(P)},postApply:function(P,I,j,q){var H=P[0],re=P[P.length-1],te=[],oe,Le=H,we=re,ge=0,st=re.length,et;u(P,function(Ae){et=fe(Ae,!q),et?(oe||(oe=new ze(et),te.push(oe)),oe.textNodes.push(Ae),Ae===H&&(Le=oe.textNodes[0],ge=Le.length),Ae===re&&(we=oe.textNodes[0],st=oe.getLength())):oe=null});var nt=Ne(re,!q);if(nt&&(oe||(oe=new ze(re),te.push(oe)),oe.textNodes.push(nt)),te.length){for(var en=0,ve=te.length;en<ve;++en)te[en].doMerge(j);I.setStartAndEnd(Le,ge,we,st)}},createContainer:function(P){var I=o.getDocument(P),j=d&&!o.isHtmlNamespace(P)&&P.namespaceURI?I.createElementNS(P.namespaceURI,this.elementTagName):I.createElement(this.elementTagName);return this.copyPropertiesToElement(this.elementProperties,j,!1),this.copyAttributesToElement(this.elementAttributes,j),m(j,this.className),this.onElementCreate&&this.onElementCreate(j,this),j},elementHasProperties:function(P,I){var j=this;return f(I,function(q,H){if(q=="className")return A(P,H);if(typeof H=="object"){if(!j.elementHasProperties(P[q],H))return!1}else if(P[q]!==H)return!1})},elementHasAttributes:function(P,I){return f(I,function(j,q){if(P.getAttribute(j)!==q)return!1})},applyToTextNode:function(P,I){if(S(P)){var j=P.parentNode;if(j.childNodes.length==1&&this.useExistingElements&&this.appliesToElement(j)&&this.elementHasProperties(j,this.elementProperties)&&this.elementHasAttributes(j,this.elementAttributes))m(j,this.className);else{var q=P.parentNode,H=this.createContainer(q);q.insertBefore(H,P),H.appendChild(P)}}},isRemovable:function(P){return P.tagName.toLowerCase()==this.elementTagName&&b(P)==this.elementSortedClassName&&this.elementHasProperties(P,this.elementProperties)&&!ee(P,this.attrExceptions)&&this.elementHasAttributes(P,this.elementAttributes)&&this.isModifiable(P)},isEmptyContainer:function(P){var I=P.childNodes.length;return P.nodeType==1&&this.isRemovable(P)&&(I==0||I==1&&this.isEmptyContainer(P.firstChild))},removeEmptyContainers:function(P){var I=this,j=P.getNodes([1],function(re){return I.isEmptyContainer(re)}),q=[P],H=$(q);u(j,function(re){K(re,H)}),w(q,H)},undoToTextNode:function(P,I,j,q){if(!I.containsNode(j)){var H=I.cloneRange();H.selectNode(j),H.isPointInRange(I.endContainer,I.endOffset)&&(F(j,I.endContainer,I.endOffset,q),I.setEndAfter(j)),H.isPointInRange(I.startContainer,I.startOffset)&&(j=F(j,I.startContainer,I.startOffset,q))}this.isRemovable(j)?R(j,q):y(j,this.className)},splitAncestorWithClass:function(P,I,j){var q=this.getSelfOrAncestorWithClass(P);q&&F(q,P,I,j)},undoToAncestor:function(P,I){this.isRemovable(P)?R(P,I):y(P,this.className)},applyToRange:function(P,I){var j=this;I=I||[];var q=$(I||[]);P.splitBoundariesPreservingPositions(q),j.removeEmptyElements&&j.removeEmptyContainers(P);var H=B(P);if(H.length){u(H,function(oe){!j.isIgnorableWhiteSpaceNode(oe)&&!j.getSelfOrAncestorWithClass(oe)&&j.isModifiable(oe)&&j.applyToTextNode(oe,q)});var re=H[H.length-1];P.setStartAndEnd(H[0],0,re,re.length),j.normalize&&j.postApply(H,P,q,!1),w(I,q)}var te=j.getEmptyElements(P);u(te,function(oe){m(oe,j.className)})},applyToRanges:function(P){for(var I=P.length;I--;)this.applyToRange(P[I],P);return P},applyToSelection:function(P){var I=r.getSelection(P);I.setRanges(this.applyToRanges(I.getAllRanges()))},undoToRange:function(P,I){var j=this;I=I||[];var q=$(I);P.splitBoundariesPreservingPositions(q),j.removeEmptyElements&&j.removeEmptyContainers(P,q);var H=B(P),re,te,oe=H[H.length-1];if(H.length){j.splitAncestorWithClass(P.endContainer,P.endOffset,q),j.splitAncestorWithClass(P.startContainer,P.startOffset,q);for(var Le=0,we=H.length;Le<we;++Le)re=H[Le],te=j.getSelfOrAncestorWithClass(re),te&&j.isModifiable(re)&&j.undoToAncestor(te,q);P.setStartAndEnd(H[0],0,oe,oe.length),j.normalize&&j.postApply(H,P,q,!0),w(I,q)}var ge=j.getEmptyElements(P);u(ge,function(st){y(st,j.className)})},undoToRanges:function(P){for(var I=P.length;I--;)this.undoToRange(P[I],P);return P},undoToSelection:function(P){var I=r.getSelection(P),j=r.getSelection(P).getAllRanges();this.undoToRanges(j),I.setRanges(j)},isAppliedToRange:function(P){if(P.collapsed||P.toString()=="")return!!this.getSelfOrAncestorWithClass(P.commonAncestorContainer);var I=P.getNodes([3]);if(I.length){for(var j=0,q;q=I[j++];)if(!this.isIgnorableWhiteSpaceNode(q)&&k(P,q)&&this.isModifiable(q)&&!this.getSelfOrAncestorWithClass(q))return!1}return!0},isAppliedToRanges:function(P){var I=P.length;if(I==0)return!1;for(;I--;)if(!this.isAppliedToRange(P[I]))return!1;return!0},isAppliedToSelection:function(P){var I=r.getSelection(P);return this.isAppliedToRanges(I.getAllRanges())},toggleRange:function(P){this.isAppliedToRange(P)?this.undoToRange(P):this.applyToRange(P)},toggleSelection:function(P){this.isAppliedToSelection(P)?this.undoToSelection(P):this.applyToSelection(P)},getElementsWithClassIntersectingRange:function(P){var I=[],j=this;return P.getNodes([3],function(q){var H=j.getSelfOrAncestorWithClass(q);H&&!s(I,H)&&I.push(H)}),I},detach:function(){}};function Ct(P,I,j){return new at(P,I,j)}at.util={hasClass:g,addClass:m,removeClass:y,getClass:x,hasSameClasses:T,hasAllClasses:A,replaceWithOwnChildren:R,elementsHaveSameNonClassAttributes:Z,elementHasNonClassAttributes:ee,splitNodeAt:F,isEditableElement:Be,isEditingHost:me,isEditable:de},r.CssClassApplier=r.ClassApplier=at,r.createClassApplier=Ct,l.createAliasForDeprecatedMethod(r,"createCssClassApplier","createClassApplier",i)}),n})}(_p)),_p.exports}e5();var X0={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0};function G0(t){var e,n,r=((e=t==null?void 0:t.extensions)===null||e===void 0?void 0:e.button)||((n=t==null?void 0:t.extensions)===null||n===void 0?void 0:n.button),i=(t==null?void 0:t.Extension)||(t==null?void 0:t.Extension),o=r||i;return o?o.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var a=this,s,l;try{U0.init()}catch{console.error("rangy.init failed")}try{(l=(s=r==null?void 0:r.prototype)===null||s===void 0?void 0:s.init)===null||l===void 0||l.call(this)}catch{console.error("ButtonBase.init failed")}this.colorPicker=new H0({parent:this.button||void 0,color:"#000",onDone:function(u){var c,d,f,h,v;try{a.coloredText&&(!((d=(c=a.coloredText).isAppliedToSelection)===null||d===void 0)&&d.call(c))&&a.coloredText.undoToSelection(),a.coloredText=U0.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:u.hex}},normalize:!0}),a.coloredText.toggleSelection(),(h=(f=a.base)===null||f===void 0?void 0:f.checkContentChanged)===null||h===void 0||h.call(f),(v=a.setInactive)===null||v===void 0||v.call(a)}catch{console.error("Picker.onDone failed")}}})},getButton:function(){return this.button},handleClick:function(){var a,s,l;(a=this.setActive)===null||a===void 0||a.call(this),(l=(s=this.colorPicker)===null||s===void 0?void 0:s.show)===null||l===void 0||l.call(s)},isAlreadyApplied:function(a){var s,l;return((l=(s=a==null?void 0:a.nodeName)===null||s===void 0?void 0:s.toLowerCase)===null||l===void 0?void 0:l.call(s))==="mark"},isActive:function(){var a,s;return(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0?void 0:s.contains("medium-editor-button-active")},setInactive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.remove("medium-editor-button-active")},setActive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.add("medium-editor-button-active")}}):(console.warn("MediumEditor button/extension base not available; using noop extension"),function(){function a(){}return a}())}var t5=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),n5=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Y0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},K0=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};(function(t){t5(e,t);function e(n){var r=t.call(this,n)||this;r.labelMap=new Map;var i=n.lf,o=n.graphModel;return r.lf=i,r.graphModel=o,r.state={tick:0},r}return e.prototype.componentDidMount=function(){var n=this,r=this.props.graphModel;this.editor=new Fu(".lf-label-editor",zi(X0,{autoLink:!0,extensions:{colorPicker:new(G0(Fu))}})),r.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",function(){}),r.eventCenter.on("node:properties-change,node:properties-delete",function(){n.setState({tick:n.state.tick+1})})},e.prototype.componentDidUpdate=function(){var n;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):((n=this.editor)===null||n===void 0||n.destroy(),this.editor=new Fu(".lf-label-editor",zi(X0,{autoLink:!0,extensions:{colorPicker:new(G0(Fu))}})))},e.prototype.componentWillUnmount=function(){var n;(n=this.editor)===null||n===void 0||n.destroy()},e.prototype.getLabels=function(){var n=this,r=this.props,i=r.lf.extension,o=r.graphModel,a=K0(K0([],Y0(o.nodes),!1),Y0(o.edges),!1),s=i.label;if(s){var l=[];return gt(a,function(u){var c,d,f=u.getData(),h=(d=(c=f.properties)===null||c===void 0?void 0:c._label)!==null&&d!==void 0?d:[];gt(h,function(v){var g=n.labelMap,m=new WF(v,u,o);g.set(m.id,m),l.push(V(HF,{label:m,element:u,graphModel:o},m.id))})}),l}return null},e.prototype.render=function(){return V("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=n5([vn],e),e})(Qe);var q0=function(){return q0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},q0.apply(this,arguments)},Z0=function(){return Z0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Z0.apply(this,arguments)},J0=function(){return J0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},J0.apply(this,arguments)},Q0=function(){return Q0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Q0.apply(this,arguments)},bp=function(){return bp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bp.apply(this,arguments)},xp=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ep=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},zu="lf:defaultNodeMenu",Wu="lf:defaultEdgeMenu",wp="lf:defaultGraphMenu",Uu="lf:defaultSelectionMenu",Sp={nodeMenu:zu,edgeMenu:Wu,graphMenu:wp,selectionMenu:Uu},ii={nodeMenu:[],edgeMenu:[],graphMenu:[],selectionMenu:[]},r5=function(){function t(e){var n=e.lf,r=this;this.__currentData=null,this.__isSilentMode=!1,this.lf=n,this.__menuDOM=document.createElement("ul"),this.__isSilentMode=n.graphModel.editConfigModel.isSilentMode,this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(i){r.setMenuConfig(i)},this.lf.addMenuConfig=function(i){r.addMenuConfig(i)},this.lf.setMenuByType=function(i){r.setMenuByType(i)},this.lf.changeMenuItemDisableStatus=function(i,o,a){r.changeMenuItemDisableStatus(i,o,a)},this.lf.getMenuConfig=function(i){return r.getMenuConfig(i)},this.lf.resetMenuConfigByType=function(i){r.resetMenuConfigByType(i)}}return t.prototype.init=function(){var e=this,n,r,i;ii.nodeMenu=[{text:"删除",callback:function(o){e.lf.deleteNode(o.id)}},{text:"编辑文本",callback:function(o){e.lf.graphModel.editText(o.id)}},{text:"复制",callback:function(o){e.lf.cloneNode(o.id)}}],(n=this.menuTypeMap)===null||n===void 0||n.set(zu,ii.nodeMenu),ii.edgeMenu=[{text:"删除",callback:function(o){e.lf.deleteEdge(o.id)}},{text:"编辑文本",callback:function(o){e.lf.graphModel.editText(o.id)}}],(r=this.menuTypeMap)===null||r===void 0||r.set(Wu,ii.edgeMenu),ii.graphMenu=[],ii.selectionMenu=[{text:"删除",callback:function(o){e.lf.clearSelectElements(),o.edges.forEach(function(a){return e.lf.deleteEdge(a.id)}),o.nodes.forEach(function(a){return e.lf.deleteNode(a.id)})}}],(i=this.menuTypeMap)===null||i===void 0||i.set(Uu,ii.selectionMenu)},t.prototype.showMenu=function(e,n,r,i){if(!this.__isSilentMode&&!(!r||!r.length)){var o=this.__menuDOM;if(o){if(o.innerHTML="",o.append.apply(o,Ep([],xp(this.__getMenuDom(r)),!1)),!o.children.length)return;if(o.style.display="block",!i){o.style.top="".concat(n,"px"),o.style.left="".concat(e,"px");return}var a=i.width,s=i.height,l=i.clientX,u=i.clientY,c=this.lf.graphModel,d=o.offsetWidth,f=!0,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,v=h-l,g=c.rootEl.getBoundingClientRect(),m=g.left+g.width;m<h&&(v=m-l),v<d&&(f=!1),f?o.style.left="".concat(e,"px"):o.style.left="".concat(e-a,"px");var y=o.offsetHeight,x=!0,E=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=E-u,T=g.top+g.height;T<E&&(b=T-u),b<y&&(x=!1),x?o.style.top="".concat(n,"px"):o.style.top="".concat(n-s,"px")}}},t.prototype.processMenuConfig=function(e,n){var r=this;if(e){var i=["nodeMenu","edgeMenu","graphMenu","selectionMenu"];i.forEach(function(o){var a,s,l,u,c=e[o],d=Sp[o];if(c!==void 0){if(n==="set")(a=r.menuTypeMap)===null||a===void 0||a.set(d,c||[]);else if(n==="add"&&Array.isArray(c)){var f=(l=(s=r.menuTypeMap)===null||s===void 0?void 0:s.get(d))!==null&&l!==void 0?l:[];(u=r.menuTypeMap)===null||u===void 0||u.set(d,f.concat(c))}}})}},t.prototype.createImageElement=function(e,n){var r=document.createElement("img");return r.src=e,r.alt=n,r.style.width="16px",r.style.height="16px",r.style.objectFit="contain",r},t.prototype.isImageFile=function(e){var n=[".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"];return n.some(function(r){return e.toLowerCase().includes(r)})},t.prototype.processIcon=function(e,n,r){var i;if(typeof n=="string"){var o=n;if(o.startsWith("data:image/")){var a=this.createImageElement(o,r||"icon");e.appendChild(a);return}if(this.isImageFile(o)){var a=this.createImageElement(o,r||"icon");e.appendChild(a);return}if(o.includes("<")&&o.includes(">")){e.innerHTML=o;return}if(o.includes(" ")||o.startsWith(".")){var s=o.replace(/^\./,"").split(" ");(i=e.classList).add.apply(i,Ep([],xp(s),!1));return}e.classList.add(o)}},t.prototype.__getMenuDom=function(e){var n=this,r=[];return e&&e.length>0&&e.forEach(function(i){var o=document.createElement("li");if(i.className?o.className="lf-menu-item ".concat(i.disabled?"lf-menu-item__disabled":""," ").concat(i.className):o.className="lf-menu-item ".concat(i.disabled?"lf-menu-item__disabled":""),i.icon){var a=document.createElement("span");a.className="lf-menu-item-icon",n.processIcon(a,i.icon,i.text),o.appendChild(a)}var s=document.createElement("span");s.className="lf-menu-item-text",i.text&&(s.innerText=i.text),o.appendChild(s),i.disabled&&o.setAttribute("disabled","true"),o.onclickCallback=i.callback,r.push(o)}),r},t.prototype.updateMenuItemDOMStatus=function(e,n){if(!(!this.__menuDOM||this.__menuDOM.style.display==="none")){var r=Array.from(this.__menuDOM.querySelectorAll(".lf-menu-item")),i=r.find(function(a){var s=a.querySelector(".lf-menu-item-text");return(s==null?void 0:s.textContent)===e});if(i){var o=i;n?(o.classList.add("lf-menu-item__disabled"),o.setAttribute("disabled","true")):(o.classList.remove("lf-menu-item__disabled"),o.removeAttribute("disabled"))}}},t.prototype.setupSilentModeListener=function(){var e=this;this.__editConfigChangeHandler=function(n){var r=n.data,i=r.isSilentMode;i!==e.__isSilentMode&&(e.__isSilentMode=i,e.updateMenuVisibility(!i))},this.lf.on("editConfig:changed",this.__editConfigChangeHandler)},t.prototype.updateMenuVisibility=function(e){this.__menuDOM&&(e?this.__currentData&&(this.__menuDOM.style.display="block"):(this.__menuDOM.style.display="none",this.__currentData=null))},t.prototype.refreshCurrentMenu=function(){var e,n,r,i,o,a,s,l,u,c,d;if(!(!this.__menuDOM||this.__menuDOM.style.display==="none"||!this.__currentData)){var f=this.__menuDOM.style,h=f.left,v=f.top,g=[];if(this.__currentData&&typeof this.__currentData=="object")if("sourceNodeId"in this.__currentData&&"targetNodeId"in this.__currentData){var m=this.lf.graphModel.getEdgeModelById(this.__currentData.id);if(m){var y=(n=this.menuTypeMap)===null||n===void 0?void 0:n.get(m.type);m.menu&&Array.isArray(m.menu)?g=m.menu:y?g=y:g=(i=(r=this.menuTypeMap)===null||r===void 0?void 0:r.get(Wu))!==null&&i!==void 0?i:[]}}else if("id"in this.__currentData&&"type"in this.__currentData){var m=this.lf.graphModel.getNodeModelById(this.__currentData.id);if(m){var y=(o=this.menuTypeMap)===null||o===void 0?void 0:o.get(m.type);m.menu&&Array.isArray(m.menu)?g=m.menu:y?g=y:g=(s=(a=this.menuTypeMap)===null||a===void 0?void 0:a.get(zu))!==null&&s!==void 0?s:[]}}else"nodes"in this.__currentData&&"edges"in this.__currentData?g=(u=(l=this.menuTypeMap)===null||l===void 0?void 0:l.get(Uu))!==null&&u!==void 0?u:[]:g=(d=(c=this.menuTypeMap)===null||c===void 0?void 0:c.get(wp))!==null&&d!==void 0?d:[];g&&g.length>0?(this.__menuDOM.innerHTML="",(e=this.__menuDOM).append.apply(e,Ep([],xp(this.__getMenuDom(g)),!1)),h&&(this.__menuDOM.style.left=h),v&&(this.__menuDOM.style.top=v)):(this.__menuDOM.style.display="none",this.__currentData=null)}},t.prototype.setMenuByType=function(e){var n,r=e.type,i=e.menu;!r||!i||((n=this.menuTypeMap)===null||n===void 0||n.set(r,i),this.refreshCurrentMenu())},t.prototype.getMenuConfig=function(e){var n,r;return(r=(n=this.menuTypeMap)===null||n===void 0?void 0:n.get(Sp[e]))!==null&&r!==void 0?r:[]},t.prototype.resetMenuConfigByType=function(e){var n;this.setMenuConfig((n={},n[e]=ii[e],n))},t.prototype.resetAllMenuConfig=function(){this.setMenuConfig(ii)},t.prototype.setMenuConfig=function(e){this.processMenuConfig(e,"set"),this.refreshCurrentMenu()},t.prototype.addMenuConfig=function(e){this.processMenuConfig(e,"add"),this.refreshCurrentMenu()},t.prototype.changeMenuItem=function(e,n){if(e==="add")this.addMenuConfig(n);else if(e==="reset")this.setMenuConfig(n);else throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'")},t.prototype.changeMenuItemDisableStatus=function(e,n,r){var i,o;if(!e||!n){console.warn("params is vaild");return}var a=(o=(i=this.menuTypeMap)===null||i===void 0?void 0:i.get(Sp[e]))!==null&&o!==void 0?o:[];if(!a.length){console.warn("menuMap: ".concat(e," is not exist"));return}var s=a.find(function(l){return l.text===n});if(!s){console.warn("menuItem: ".concat(n," is not exist"));return}s.disabled=r,this.updateMenuItemDOMStatus(n,r)},t.prototype.render=function(e,n){var r=this;e.graphModel.editConfigModel.isSilentMode||(this.__container=n,this.__currentData=null,this.setupSilentModeListener(),this.__menuDOM&&(this.__menuDOM.className="lf-menu",n.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",function(i){i.stopPropagation();for(var o=i.target;Array.from(o.classList).indexOf("lf-menu-item")===-1&&Array.from(o.classList).indexOf("lf-menu")===-1;)o=o==null?void 0:o.parentElement;Array.from(o.classList).indexOf("lf-menu-item__disabled")>-1||(Array.from(o.classList).indexOf("lf-menu-item")>-1?(o.onclickCallback(r.__currentData,o),r.__menuDOM&&(r.__menuDOM.style.display="none"),r.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!"))},!0)),this.lf.on("node:contextmenu",function(i){var o,a,s=i.data,l=i.position,u=i.e,c=l.domOverlayPosition,d=c.x,f=c.y,h=s.id,v=r.lf.graphModel.getNodeModelById(h);if(!(!v||r.__isSilentMode)){var g=[],m=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(v.type);v&&v.menu&&Array.isArray(v.menu)?g=v.menu:m?g=m:g=(a=r.menuTypeMap)===null||a===void 0?void 0:a.get(zu),r.__currentData=s,r.showMenu(d,f,g,{width:v.width,height:v.height,clientX:u.clientX,clientY:u.clientY})}}),this.lf.on("edge:contextmenu",function(i){var o,a,s,l=i.data,u=i.position,c=i.e,d=u.domOverlayPosition,f=d.x,h=d.y,v=l.id,g=r.lf.graphModel.getEdgeModelById(v);if(!(!g||r.__isSilentMode)){var m=[],y=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(g.type);g&&g.menu&&Array.isArray(g.menu)?m=g.menu:y?m=y:m=(s=(a=r.menuTypeMap)===null||a===void 0?void 0:a.get(Wu))!==null&&s!==void 0?s:[],r.__currentData=l,r.showMenu(f,h,m,{width:g.width,height:g.height,clientX:c.clientX,clientY:c.clientY})}}),this.lf.on("blank:contextmenu",function(i){var o,a,s=i.position;if(!r.__isSilentMode){var l=(a=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(wp))!==null&&a!==void 0?a:[],u=s.domOverlayPosition,c=u.x,d=u.y;r.__currentData=bp({},s.canvasOverlayPosition),r.showMenu(c,d,l)}}),this.lf.on("selection:contextmenu",function(i){var o,a=i.data,s=i.position;if(!r.__isSilentMode){var l=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(Uu),u=s.domOverlayPosition,c=u.x,d=u.y;r.__currentData=a,r.showMenu(c,d,l)}}),this.lf.on("node:mousedown",function(){r.__menuDOM.style.display="none"}),this.lf.on("edge:click",function(){r.__menuDOM.style.display="none"}),this.lf.on("blank:click",function(){r.__menuDOM.style.display="none"}))},t.prototype.destroy=function(){var e;this.__editConfigChangeHandler&&this.lf.off("editConfig:changed",this.__editConfigChangeHandler),this.__menuDOM&&((e=this===null||this===void 0?void 0:this.__container)===null||e===void 0||e.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.pluginName="menu",t}(),i5=function(){function t(e){var n=e.lf,r=this;this.lf=n,this.lf.setPatternItems=function(i){r.setPatternItems(i)}}return t.prototype.render=function(e,n){var r=this;if(this.destroy(),!this.shapeList||this.shapeList.length===0){this.domContainer=n;return}this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach(function(i){var o;(o=r.panelEl)===null||o===void 0||o.appendChild(r.createDndItem(i))}),n.appendChild(this.panelEl),this.domContainer=n},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(e){this.shapeList=e,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(e){var n=this,r=document.createElement("div");r.className=e.className?"lf-dnd-item ".concat(e.className):"lf-dnd-item";var i=document.createElement("div");if(i.className="lf-dnd-shape",e.icon&&(i.style.backgroundImage="url(".concat(e.icon,")")),r.appendChild(i),e.label){var o=document.createElement("div");o.innerText=e.label,o.className="lf-dnd-text",r.appendChild(o)}return e.disabled?(r.classList.add("disabled"),r.onmousedown=function(){e.callback&&e.callback(n.lf,n.domContainer)},r):(r.onmousedown=function(){e.type&&n.lf.dnd.startDrag({type:e.type,properties:e.properties,text:e.text}),e.callback&&e.callback(n.lf,n.domContainer)},r.ondblclick=function(a){n.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:a,data:e})},r.onclick=function(a){n.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:a,data:e})},r.oncontextmenu=function(a){n.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:a,data:e})},r)},t.pluginName="dndPanel",t}(),ex=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},tx=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},o5=function(){function t(e){var n=e.lf,r=e.options,i=this,o;this.disabled=!0,this.isWholeNode=!0,this.isWholeEdge=!0,this.originStatusSaved=!1,this.exclusiveMode=!1,this.mouseDownInfo=null,this.originalStopMoveGraph=!1,this.handleBlankMouseDown=function(a){var s=a.e;i.handleMouseDown(s)},this.draw=function(a){var s=i.lf.getPointByClient(a.clientX,a.clientY).domOverlayPosition,l=s.x,u=s.y;if(i.endPoint={x:l,y:u},i.startPoint){var c=i.startPoint,d=c.x,f=c.y,h=d,v=f,g=l-d,m=u-f;l<d&&(h=l,g=d-l),u<f&&(v=u,m=f-u),i.wrapper&&(i.wrapper.style.left="".concat(h,"px"),i.wrapper.style.top="".concat(v,"px"),i.wrapper.style.width="".concat(g,"px"),i.wrapper.style.height="".concat(m,"px"))}},this.drawOff=function(a){if(i.lf.updateEditConfig({stopMoveGraph:i.originalStopMoveGraph}),i.originStatusSaved=!1,i.mouseDownInfo){var s=i.mouseDownInfo,l=s.x,u=s.y,c=s.time,d=Math.abs(a.clientX-l)<5&&Math.abs(a.clientY-u)<5&&Date.now()-c<200;if(d){i.lf.clearSelectElements(),i.cleanupSelectionState();return}}var f=Pe(i.startPoint),h=Pe(i.endPoint);if(document.removeEventListener("mousemove",i.draw),i.exclusiveMode||document.removeEventListener("mouseup",i.drawOff),f&&h){var l=f.x,u=f.y,v=h.x,g=h.y,m=[Math.min(l,v),Math.min(u,g)],y=[Math.max(l,v),Math.max(u,g)];if(i.lf.emit("selection:selected-area",{topLeft:m,bottomRight:y}),Math.abs(v-l)<10&&Math.abs(g-u)<10){i.wrapper&&(i.wrapper.oncontextmenu=null,i.container&&i.wrapper.parentNode===i.container&&i.container.removeChild(i.wrapper),i.wrapper=void 0);return}var x=i.lf.graphModel.getAreaElement(m,y,i.isWholeEdge,i.isWholeNode,!0),E=i.lf.graphModel,b=E.dynamicGroup,T=E.group,A=[],S=i.lf.getSelectElements(),M=new Set(tx(tx([],ex(S.nodes.map(function(K){return K.id})),!1),ex(S.edges.map(function(K){return K.id})),!1));x.forEach(function(K){if(T){var J=T.getNodeGroup(K.id);if(x.includes(J))return}if(b){var J=b.getGroupByNodeId(K.id);if(x.includes(J))return}if(i.exclusiveMode&&M.has(K.id)){i.lf.deselectElementById(K.id);return}i.lf.selectElementById(K.id,!0),A.push(K)}),i.startPoint=void 0,i.endPoint=void 0,A.length>0&&i.lf.emit("selection:drop",{e:a}),i.lf.emit("selection:selected",{elements:A,leftTopPoint:m,rightBottomPoint:y})}i.wrapper&&(i.wrapper.oncontextmenu=null,i.container&&i.wrapper.parentNode===i.container&&i.container.removeChild(i.wrapper),i.wrapper=void 0)},this.lf=n,this.exclusiveMode=(o=r==null?void 0:r.exclusiveMode)!==null&&o!==void 0?o:!1,n.openSelectionSelect=function(){i.openSelectionSelect()},n.closeSelectionSelect=function(){i.closeSelectionSelect()},n.setSelectionSelectMode=function(a){i.setExclusiveMode(a)},this.handleMouseDown=this.handleMouseDown.bind(this),this.draw=this.draw.bind(this),this.drawOff=this.drawOff.bind(this)}return t.prototype.render=function(e,n){this.container=n},t.prototype.cleanupSelectionState=function(){this.wrapper&&(this.wrapper.oncontextmenu=null,this.container&&this.wrapper.parentNode===this.container&&this.container.removeChild(this.wrapper),this.wrapper=void 0),this.startPoint=void 0,this.endPoint=void 0,this.mouseDownInfo=null,document.removeEventListener("mousemove",this.draw),document.removeEventListener("mouseup",this.drawOff)},t.prototype.setExclusiveMode=function(e){e===void 0&&(e=!1),this.exclusiveMode!==e&&(this.cleanupSelectionState(),this.exclusiveMode=e,this.container&&!this.disabled&&(this.removeEventListeners(),this.addEventListeners()))},t.prototype.addEventListeners=function(){this.container&&(this.exclusiveMode?(this.container.style.pointerEvents="auto",this.container.addEventListener("mousedown",this.handleMouseDown)):(this.container.style.pointerEvents="none",this.lf.on("blank:mousedown",this.handleBlankMouseDown)))},t.prototype.removeEventListeners=function(){this.container&&(this.container.style.pointerEvents="none",this.container.removeEventListener("mousedown",this.handleMouseDown)),this.lf.off("blank:mousedown",this.handleBlankMouseDown)},t.prototype.handleMouseDown=function(e){var n;if(!(!this.container||this.disabled)){var r=e.button===2;if(!r){this.cleanupSelectionState(),this.mouseDownInfo={x:e.clientX,y:e.clientY,time:Date.now()},this.originStatusSaved||(this.originalStopMoveGraph=this.lf.getEditConfig().stopMoveGraph,this.originStatusSaved=!0),this.lf.updateEditConfig({stopMoveGraph:!0});var i=this.lf.getPointByClient(e.clientX,e.clientY).domOverlayPosition,o=i.x,a=i.y;this.startPoint={x:o,y:a},this.endPoint={x:o,y:a};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(u){u.preventDefault()},s.style.top="".concat(this.startPoint.y,"px"),s.style.left="".concat(this.startPoint.x,"px"),(n=this.container)===null||n===void 0||n.appendChild(s),this.wrapper=s,document.addEventListener("mousemove",this.draw),document.addEventListener("mouseup",this.drawOff)}}},t.prototype.setSelectionSense=function(e,n){e===void 0&&(e=!0),n===void 0&&(n=!0),this.isWholeEdge=e,this.isWholeNode=n},t.prototype.openSelectionSelect=function(){this.disabled||this.closeSelectionSelect(),this.container&&(this.cleanupSelectionState(),this.addEventListeners(),this.open())},t.prototype.closeSelectionSelect=function(){if(this.container){if(this.wrapper&&this.startPoint&&this.endPoint){var e=Pe(this.endPoint),n=new MouseEvent("mouseup",{clientX:e.x,clientY:e.y});this.drawOff(n)}this.cleanupSelectionState(),this.removeEventListeners(),this.close()}},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),nx=function(){return nx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},nx.apply(this,arguments)},rx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zo=function(){return Zo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Zo.apply(this,arguments)},ds=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},a5={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function s5(t){for(var e=t,n=1;n<e.length-1;){var r=ds(e[n-1],2),i=r[0],o=r[1],a=ds(e[n],2),s=a[0],l=a[1],u=ds(e[n+1],2),c=u[0],d=u[1];i===s&&s===c||o===l&&l===d?e.splice(n,1):n++}return e}function l5(t,e,n,r){var i=[t[0],t[1]],o=[t[0],t[1]];switch(n){case"tl":return e==="tr"?(i[1]+=r,o[0]+=r):e==="lb"&&(i[0]+=r,o[1]+=r),[i,o];case"tr":return e==="tl"?(i[1]+=r,o[0]-=r):e==="rb"&&(i[0]-=r,o[1]+=r),[i,o];case"bl":return e==="br"?(i[1]-=r,o[0]+=r):e==="lt"&&(i[0]+=r,o[1]-=r),[i,o];case"br":return e==="bl"?(i[1]-=r,o[0]-=r):e==="rt"&&(i[0]-=r,o[1]-=r),[i,o];default:return[]}}function u5(t,e,n,r){var i,o=1,a="",s="";Math.abs(t[0]-e[0])<=o?a=t[1]>e[1]?"t":"b":Math.abs(t[1]-e[1])<=o&&(a=t[0]>e[0]?"l":"r"),Math.abs(e[0]-n[0])<=o?s=e[1]>n[1]?"t":"b":Math.abs(e[1]-n[1])<=o&&(s=e[0]>n[0]?"l":"r");var l=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,r)||1/5*r,u="".concat(a).concat(s),c=a5[u]||"-",d="L ".concat(t[0]," ").concat(t[1]);if(c==="-")d+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var f=ds(l5(e,u,c,l),2),h=f[0],v=f[1];h&&v&&(d+="L ".concat(h[0]," ").concat(h[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(v[0]," ").concat(v[1]),i=ds(v,2),e[0]=i[0],e[1]=i[1])}return d}function c5(t,e){var n=0,r="";if(t.length===2)r+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(r+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){var i=t[n-1],o=t[n],a=t[n+++1];r+=u5(i,o,a,e)}r+="L ".concat(t[n][0]," ").concat(t[n][1])}return r}(function(t){rx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,r=n.points,i=n.isAnimation,o=n.arrowConfig,a=n.radius,s=a===void 0?5:a,l=n.getEdgeStyle(),u=n.getEdgeAnimationStyle(),c=s5(r.split(" ").map(function(h){return h.split(",").map(function(v){return+v})})),d=c5(c,s),f=Zo(Zo(Zo({style:i?u:{}},l),o),{fill:"none"});return Te("path",Zo({d},f))},e})(os),function(t){rx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ya);var ix=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vu=function(){return Vu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Vu.apply(this,arguments)},ox=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ax=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},d5=function(t){ix(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.id,i=n.x,o=n.y,a=n.width,s=n.height,l=n.properties,u=this.props.model.getNodeStyle();return Te("svg",{x:i-a/2,y:o-s/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[l.labelText?Te("text",{x:0,y:-5,fontSize:"16px",fill:u.stroke},l.labelText):"",l.disabledDelete?"":Te("text",{x:l.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:u.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,r)},"x")])},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.id,l=this.props.model.getNodeStyle();return Te("g",{},[Te("rect",Vu(Vu({},l),{x:r-o/2,y:i-a/2,width:o,height:a,id:s})),this.getLabelShape()])},e.prototype.toFront=function(){},e.prototype.handleCustomDeleteIconClick=function(n){var r=this.props.graphModel;r.deleteNode(n)},e}(pu),f5=function(t){ix(e,t);function e(){var n=t.apply(this,ax([],ox(arguments),!1))||this;return n.d=10,n.isResize=!1,n}return e.prototype.initNodeData=function(n){n.text={value:"",x:n.x,y:n.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,n),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var n=this,r;this.points=[],((r=this.properties)===null||r===void 0?void 0:r.node_selection_ids).length>1&&setTimeout(function(){var i;n.updatePointsByNodes(((i=n.properties)===null||i===void 0?void 0:i.node_selection_ids)||[])})},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this);return n.stroke=this.properties.strokeColor||"#008000",n.strokeDasharray="10 5",n},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(n){this.points=n},e.prototype.updateCoordinate=function(n){var r=n.x,i=n.y;this.x=r,this.y=i},e.prototype.updatePointsByNodes=function(n){var r=this,i=[],o=1/0,a=1/0,s=-1/0,l=-1/0;n.forEach(function(u){var c=r.graphModel.getNodeModelById(u);if(c){var d=c.width,f=c.height,h=c.x,v=c.y;o=Math.min(o,h-d/2-r.d),a=Math.min(a,v-f/2-r.d),s=Math.max(s,h+d/2+r.d),l=Math.max(l,v+f/2+r.d)}}),i.push([o,a],[s,a],[s,l],[o,l]),![o,a,s,l].some(function(u){return Math.abs(u)===1/0})&&(this.updatePoints(i),this.updateCoordinate({x:(s+o)/2,y:(l+a)/2}))},e.prototype.resize=function(n){var r;this.isResize=!0;for(var i=n.width,o=n.height,a={x:i/this.width,y:o/this.height},s=(this.properties.node_selection_ids||[]).slice(),l=[],u=new Set;s.length;){var c=s.shift(),d=(r=this.graphModel.nodesMap[c])===null||r===void 0?void 0:r.model;if(d){if(!Xu(d)){l.push(d);continue}u.has(d.id)||(u.add(d.id),s.push.apply(s,ax([],ox(d.properties.node_selection_ids||[]),!1)))}}var f={x:this.x-this.width/2,y:this.y-this.height/2},h=t.prototype.resize.call(this,n),v={x:this.x-this.width/2,y:this.y-this.height/2};return l.forEach(function(g){g.width=g.width*a.x,g.height=g.height*a.y;var m=(g.x-f.x)*a.x+v.x-g.x,y=(g.y-f.y)*a.y+v.y-g.y;g.move(m,y,!0)}),this.isResize=!1,h},e}(au),Cp="node-selection";(function(){function t(e){var n=e.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:Cp,view:d5,model:f5})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map(function(e){return e.id})},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){var e=this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds},x:0,y:0});e.updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var e,n=this.getNodeSelection();n&&(this.lf.setProperties(n.id,{node_selection_ids:this.selectNodesIds}),(e=this.lf.getNodeModelById(n.id))===null||e===void 0||e.updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var e=this,n=this.selectNodesIds,r=this.lf.getGraphRawData(),i=n.filter(function(o){return o!==e.currentClickNode.id});return r.nodes.find(function(o){if(o.type==="node-selection"){var a=ui(o,"properties.node_selection_ids",[]);return i.every(function(s){return a.includes(s)})}return!1})},t.prototype.onNodeChange=function(e,n){var r=e.graphModel.nodes.filter(function(i){if(!Xu(i))return!1;var o=i.properties.node_selection_ids||[];return o.includes(n.id)});Promise.resolve().then(function(){r.forEach(function(i){i.updatePointsByNodes(i.properties.node_selection_ids||[])})})},t.prototype.render=function(e){var n=this;this.lf=e,e.on("node:click",function(r){var i;if(!(!r.e.shiftKey||r.data.type===Cp)){n.currentClickNode=r.data;var o=!1;n.selectNodesIds.includes(r.data.id)&&((i=n.lf.getNodeModelById(r.data.id))===null||i===void 0||i.setSelected(!1),o=!0);var a=e.getSelectElements(!0).nodes;n.selectNodes=a,n.selectNodes.length===1?o?n.updateNodeSelection():n.addNodeSelection():n.selectNodes.length>1&&n.updateNodeSelection()}}),e.graphModel.addNodeMoveRules(function(r,i,o){if(n.onNodeChange(e,r),Xu(r)&&!r.isResize){var a=r.properties.node_selection_ids||[];return e.graphModel.moveNodes(a,i,o,!0),!0}return!0}),e.graphModel.addNodeResizeRules(function(r){return Xu(r)||n.onNodeChange(e,r),!0})},t.pluginName="node-selection",t})();var Xu=function(t){return!!(t&&t.type===Cp)},p5=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gu=function(){return Gu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gu.apply(this,arguments)};(function(t){p5(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.properties;return Te("text",{x:r-o/2+5,y:i-a/2+16,fontSize:12,fill:"blue"},s.moreText)},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=this.props.model.getNodeStyle();return Te("g",{},[Te("rect",Gu(Gu({},s),{fill:"#FFFFFF",x:r-o/2,y:i-a/2})),this.getLabelShape()])},e})(Ji);var Yu=2,sx=.16,h5=.05,g5=.05,v5=.15,lx=5,ux=4,m5=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function cx(t){var e=t.r,n=t.g,r=t.b,i=EI(e,n,r);return{h:i.h*360,s:i.s,v:i.v}}function Ku(t){var e=t.r,n=t.g,r=t.b;return"#".concat(SI(e,n,r))}function y5(t,e,n){var r=n/100,i={r:(e.r-t.r)*r+t.r,g:(e.g-t.g)*r+t.g,b:(e.b-t.b)*r+t.b};return i}function dx(t,e,n){var r;return Math.round(t.h)>=60&&Math.round(t.h)<=240?r=n?Math.round(t.h)-Yu*e:Math.round(t.h)+Yu*e:r=n?Math.round(t.h)+Yu*e:Math.round(t.h)-Yu*e,r<0?r+=360:r>=360&&(r-=360),r}function fx(t,e,n){if(t.h===0&&t.s===0)return t.s;var r;return n?r=t.s-sx*e:e===ux?r=t.s+sx:r=t.s+h5*e,r>1&&(r=1),n&&e===lx&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function px(t,e,n){var r;return n?r=t.v+g5*e:r=t.v-v5*e,r>1&&(r=1),Number(r.toFixed(2))}function Ap(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=_a(t),i=lx;i>0;i-=1){var o=cx(r),a=Ku(_a({h:dx(o,i,!0),s:fx(o,i,!0),v:px(o,i,!0)}));n.push(a)}n.push(Ku(r));for(var s=1;s<=ux;s+=1){var l=cx(r),u=Ku(_a({h:dx(l,s),s:fx(l,s),v:px(l,s)}));n.push(u)}return e.theme==="dark"?m5.map(function(c){var d=c.index,f=c.opacity,h=Ku(y5(_a(e.backgroundColor||"#141414"),_a(n[d]),f*100));return h}):n}var Op={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},qu={},Tp={};Object.keys(Op).forEach(function(t){qu[t]=Ap(Op[t]),qu[t].primary=qu[t][5],Tp[t]=Ap(Op[t],{theme:"dark",backgroundColor:"#141414"}),Tp[t].primary=Tp[t][5]});var _5=qu.blue,b5=Symbol("iconContext"),hx=function(){return p.inject(b5,{prefixCls:p.ref("anticon"),rootClassName:p.ref(""),csp:p.ref()})};function Np(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function x5(t,e){return t&&t.contains?t.contains(e):!1}var gx="data-vc-order",E5="vc-icon-key",Mp=new Map;function vx(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):E5}function Dp(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function w5(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function mx(t){return Array.from((Mp.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function yx(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Np())return null;var n=e.csp,r=e.prepend,i=document.createElement("style");i.setAttribute(gx,w5(r)),n&&n.nonce&&(i.nonce=n.nonce),i.innerHTML=t;var o=Dp(e),a=o.firstChild;if(r){if(r==="queue"){var s=mx(o).filter(function(l){return["prepend","prependQueue"].includes(l.getAttribute(gx))});if(s.length)return o.insertBefore(i,s[s.length-1].nextSibling),i}o.insertBefore(i,a)}else o.appendChild(i);return i}function S5(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Dp(e);return mx(n).find(function(r){return r.getAttribute(vx(e))===t})}function C5(t,e){var n=Mp.get(t);if(!n||!x5(document,n)){var r=yx("",e),i=r.parentNode;Mp.set(t,i),t.removeChild(r)}}function A5(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Dp(n);C5(r,n);var i=S5(e,n);if(i)return n.csp&&n.csp.nonce&&i.nonce!==n.csp.nonce&&(i.nonce=n.csp.nonce),i.innerHTML!==t&&(i.innerHTML=t),i;var o=yx(t,n);return o.setAttribute(vx(n),e),o}function _x(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){O5(t,i,n[i])})}return t}function O5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T5(t,e){process.env.NODE_ENV!=="production"&&!t&&console!==void 0&&console.error("Warning: ".concat(e))}function N5(t,e){T5(t,"[@ant-design/icons-vue] ".concat(e))}function bx(t){return typeof t=="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(typeof t.icon=="object"||typeof t.icon=="function")}function Pp(t,e,n){return n?p.h(t.tag,_x({key:e},n,t.attrs),(t.children||[]).map(function(r,i){return Pp(r,"".concat(e,"-").concat(t.tag,"-").concat(i))})):p.h(t.tag,_x({key:e},t.attrs),(t.children||[]).map(function(r,i){return Pp(r,"".concat(e,"-").concat(t.tag,"-").concat(i))}))}function xx(t){return Ap(t)[0]}function Ex(t){return t?Array.isArray(t)?t:[t]:[]}var M5=`
|
|
98
|
+
.anticon {
|
|
99
|
+
display: inline-block;
|
|
100
|
+
color: inherit;
|
|
101
|
+
font-style: normal;
|
|
102
|
+
line-height: 0;
|
|
103
|
+
text-align: center;
|
|
104
|
+
text-transform: none;
|
|
105
|
+
vertical-align: -0.125em;
|
|
106
|
+
text-rendering: optimizeLegibility;
|
|
107
|
+
-webkit-font-smoothing: antialiased;
|
|
108
|
+
-moz-osx-font-smoothing: grayscale;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.anticon > * {
|
|
112
|
+
line-height: 1;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.anticon svg {
|
|
116
|
+
display: inline-block;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.anticon::before {
|
|
120
|
+
display: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.anticon .anticon-icon {
|
|
124
|
+
display: block;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.anticon[tabindex] {
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.anticon-spin::before,
|
|
132
|
+
.anticon-spin {
|
|
133
|
+
display: inline-block;
|
|
134
|
+
-webkit-animation: loadingCircle 1s infinite linear;
|
|
135
|
+
animation: loadingCircle 1s infinite linear;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@-webkit-keyframes loadingCircle {
|
|
139
|
+
100% {
|
|
140
|
+
-webkit-transform: rotate(360deg);
|
|
141
|
+
transform: rotate(360deg);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@keyframes loadingCircle {
|
|
146
|
+
100% {
|
|
147
|
+
-webkit-transform: rotate(360deg);
|
|
148
|
+
transform: rotate(360deg);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`;function wx(t){return t&&t.getRootNode&&t.getRootNode()}function D5(t){return Np()?wx(t)instanceof ShadowRoot:!1}function P5(t){return D5(t)?wx(t):null}var R5=function(){var e=hx(),n=e.prefixCls,r=e.csp,i=p.getCurrentInstance(),o=M5;n&&(o=o.replace(/anticon/g,n.value)),p.nextTick(function(){if(Np()){var a=i.vnode.el,s=P5(a);A5(o,"@ant-design-vue-icons",{prepend:!0,csp:r.value,attachTo:s})}})},L5=["icon","primaryColor","secondaryColor"];function I5(t,e){if(t==null)return{};var n=k5(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function k5(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Zu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){B5(t,i,n[i])})}return t}function B5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var fs=p.reactive({primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1});function j5(t){var e=t.primaryColor,n=t.secondaryColor;fs.primaryColor=e,fs.secondaryColor=n||xx(e),fs.calculated=!!n}function F5(){return Zu({},fs)}var Di=function(e,n){var r=Zu({},e,n.attrs),i=r.icon,o=r.primaryColor,a=r.secondaryColor,s=I5(r,L5),l=fs;if(o&&(l={primaryColor:o,secondaryColor:a||xx(o)}),N5(bx(i),"icon should be icon definiton, but got ".concat(i)),!bx(i))return null;var u=i;return u&&typeof u.icon=="function"&&(u=Zu({},u,{icon:u.icon(l.primaryColor,l.secondaryColor)})),Pp(u.icon,"svg-".concat(u.name),Zu({},s,{"data-icon":u.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"}))};Di.props={icon:Object,primaryColor:String,secondaryColor:String,focusable:String},Di.inheritAttrs=!1,Di.displayName="IconBase",Di.getTwoToneColors=F5,Di.setTwoToneColors=j5;function $5(t,e){return U5(t)||W5(t,e)||z5(t,e)||H5()}function H5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
152
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z5(t,e){if(t){if(typeof t=="string")return Sx(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sx(t,e)}}function Sx(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function W5(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function U5(t){if(Array.isArray(t))return t}function Cx(t){var e=Ex(t),n=$5(e,2),r=n[0],i=n[1];return Di.setTwoToneColors({primaryColor:r,secondaryColor:i})}function V5(){var t=Di.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var X5=p.defineComponent({name:"InsertStyles",setup:function(){return R5(),function(){return null}}}),G5=["class","icon","spin","rotate","tabindex","twoToneColor","onClick"];function Y5(t,e){return J5(t)||Z5(t,e)||q5(t,e)||K5()}function K5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
153
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q5(t,e){if(t){if(typeof t=="string")return Ax(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ax(t,e)}}function Ax(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Z5(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function J5(t){if(Array.isArray(t))return t}function Ox(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){ps(t,i,n[i])})}return t}function ps(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q5(t,e){if(t==null)return{};var n=e$(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function e$(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}Cx(_5.primary);var Jo=function(e,n){var r,i=Ox({},e,n.attrs),o=i.class,a=i.icon,s=i.spin,l=i.rotate,u=i.tabindex,c=i.twoToneColor,d=i.onClick,f=Q5(i,G5),h=hx(),v=h.prefixCls,g=h.rootClassName,m=(r={},ps(r,g.value,!!g.value),ps(r,v.value,!0),ps(r,"".concat(v.value,"-").concat(a.name),!!a.name),ps(r,"".concat(v.value,"-spin"),!!s||a.name==="loading"),r),y=u;y===void 0&&d&&(y=-1);var x=l?{msTransform:"rotate(".concat(l,"deg)"),transform:"rotate(".concat(l,"deg)")}:void 0,E=Ex(c),b=Y5(E,2),T=b[0],A=b[1];return p.createVNode("span",Ox({role:"img","aria-label":a.name},f,{onClick:d,class:[m,o],tabindex:y}),[p.createVNode(Di,{icon:a,primaryColor:T,secondaryColor:A,style:x},null),p.createVNode(X5,null,null)])};Jo.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:[String,Array]},Jo.displayName="AntdIcon",Jo.inheritAttrs=!1,Jo.getTwoToneColor=V5,Jo.setTwoToneColor=Cx;var t$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};function Tx(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){n$(t,i,n[i])})}return t}function n$(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Rp=function(e,n){var r=Tx({},e,n.attrs);return p.createVNode(Jo,Tx({},r,{icon:t$}),null)};Rp.displayName="EditOutlined",Rp.inheritAttrs=!1;const r$=Qr(p.defineComponent({inheritAttrs:!1,__name:"index",props:p.mergeModels({dictType:{type:String,default:""},include:{type:[Array,String]},exclude:{type:Array},sort:{type:Boolean}},{dictMap:{type:Object},dictMapModifiers:{}}),emits:["update:dictMap"],setup(t){const e=t,n=p.useModel(t,"dictMap"),[r,{fetchDict:i,toList:o}]=eh(e.dictType,{immediate:!1}),a=p.computed(()=>{var l;const s=o(e.dictType);if(e.sort&&s.sort((u,c)=>parseFloat(u.value)-parseFloat(c.value)),e.include){const u=typeof e.include=="string"?e.include.split(","):e.include;return s.filter(c=>u.includes(c.value))}return(l=e.exclude)!=null&&l.length?s.filter(u=>{var c;return!((c=e.exclude)!=null&&c.includes(u.value))}):s});return e.dictType&&i(),p.watch(()=>r.value,()=>{if(n.value&&typeof n.value=="object")for(const s in r.value)n.value[s]=r.value}),(s,l)=>{const u=ie.Select;return p.openBlock(),p.createBlock(u,p.mergeProps({class:"dict-select",placeholder:s.$t("common.plsSelect"),showSearch:!1,options:p.unref(a),dropdownMatchSelectWidth:!1},s.$attrs),null,16,["placeholder","options"])}}}),[["__scopeId","data-v-02a7899b"]]),i$={class:"wrapper"},o$={class:"mt-xs"},a$={class:"flex-sc"},s$={class:"mt-xs"},l$=Qr(p.defineComponent({__name:"RuleConfig",props:{jsonStr:{type:String,required:!0}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({});function a(d){const f=d.replace(/(false|true|\d+)(?=")/g,"$1,");return JSON.parse(`{${f}}`)}function s(d){if(typeof d=="string"&&(d.trim().startsWith("{")||d.trim().startsWith("[")))try{return JSON.parse(d),!0}catch{return!1}return!1}function l(){r.jsonStr?(s(r.jsonStr)?o.value=JSON.parse(r.jsonStr):o.value=a(r.jsonStr),o.value.fallbackFirstLinkStatus!==null&&o.value.fallbackFirstLinkStatus!==void 0&&(o.value.fallbackFirstLinkStatus=String(o.value.fallbackFirstLinkStatus))):o.value={revokeRule:!1,fallbackRule:!1,approverRemoveDuplicates:2,timeoutConfigSwitch:!1,timeoutPeriod:1,timeoutHandler:1,fallbackFirstLinkStatus:null}}function u(){Wt.Modal.destroyAll()}function c(){const d=o.value;if(d.timeoutConfigSwitch&&!d.timeoutPeriod){Wt.message.warning(n("bpmn.timeoutPeriodEmptyTip"));return}d.fallbackFirstLinkStatus&&(d.fallbackFirstLinkStatus=Number(d.fallbackFirstLinkStatus)),i("submit",o.value),Wt.Modal.destroyAll()}return p.onMounted(()=>{l()}),(d,f)=>{const h=ie.Checkbox,v=ie.FormItem,g=ie.Radio,m=ie.RadioGroup,y=ie.InputNumber,x=r$,E=ie.Form,b=ie.Button,T=ie.Space;return p.openBlock(),p.createElementBlock("div",i$,[p.createVNode(E,{class:"my-nm","label-col":{span:6},"wrapper-col":{span:18},colon:!1,model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(v,{label:d.$t("bpmn.revertRule")},{default:p.withCtx(()=>[p.createVNode(h,{checked:p.unref(o).revokeRule,"onUpdate:checked":f[0]||(f[0]=A=>p.unref(o).revokeRule=A)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.revertRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.rollbackRule")},{default:p.withCtx(()=>[p.createVNode(h,{checked:p.unref(o).fallbackRule,"onUpdate:checked":f[1]||(f[1]=A=>p.unref(o).fallbackRule=A)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.rollbackRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.deduplicationApprovers")},{default:p.withCtx(()=>[p.createElementVNode("div",o$,p.toDisplayString(d.$t("bpmn.deduplicationApproversTxt")),1),p.createVNode(m,{value:p.unref(o).approverRemoveDuplicates,"onUpdate:value":f[2]||(f[2]=A=>p.unref(o).approverRemoveDuplicates=A)},{default:p.withCtx(()=>[p.createVNode(g,{value:0},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.deduplicationRadio0")),1)]),_:1}),p.createVNode(g,{value:1},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.deduplicationRadio1")),1)]),_:1}),p.createVNode(g,{value:2},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.deduplicationRadio2")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.timeoutRule")},{default:p.withCtx(()=>[p.createVNode(h,{checked:p.unref(o).timeoutConfigSwitch,"onUpdate:checked":f[3]||(f[3]=A=>p.unref(o).timeoutConfigSwitch=A)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.timeoutRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),p.unref(o).timeoutConfigSwitch?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createVNode(v,{label:d.$t("wo_my.timeout")},{default:p.withCtx(()=>[p.createElementVNode("div",a$,[p.createTextVNode(p.toDisplayString(d.$t("bpmn.linkTimeoutTxt1"))+" ",1),p.createVNode(y,{class:"mx-xs",value:p.unref(o).timeoutPeriod,"onUpdate:value":f[4]||(f[4]=A=>p.unref(o).timeoutPeriod=A),min:1,max:1e4,precision:0},null,8,["value"]),p.createTextVNode(" "+p.toDisplayString(d.$t("bpmn.linkTimeoutTxt2")),1)])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.timeoutHandle")},{default:p.withCtx(()=>[p.createElementVNode("div",s$,p.toDisplayString(d.$t("bpmn.timeoutHandleTxt")),1),p.createVNode(m,{value:p.unref(o).timeoutHandler,"onUpdate:value":f[5]||(f[5]=A=>p.unref(o).timeoutHandler=A)},{default:p.withCtx(()=>[p.createVNode(g,{value:0},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.timeoutHandleRadio0")),1)]),_:1}),p.createVNode(g,{value:1},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.timeoutHandleRadio1")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])],64)):p.createCommentVNode("",!0),p.createVNode(v,{label:d.$t("bpmn.fallbackFirstLinkStatus")},{default:p.withCtx(()=>[p.createVNode(x,{"dict-type":"fallback_first_link_status",value:p.unref(o).fallbackFirstLinkStatus,"onUpdate:value":f[6]||(f[6]=A=>p.unref(o).fallbackFirstLinkStatus=A),placeholder:d.$t("common.plsSelect"),style:{width:"80%"}},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"]),p.createVNode(T,{class:"modal-btns"},{default:p.withCtx(()=>[p.createVNode(b,{onClick:u},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(b,{type:"primary",onClick:c},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("common.btn_sure")),1)]),_:1})]),_:1})])}}}),[["__scopeId","data-v-8e7f13af"]]),u$={key:0},c$={key:1,style:{color:"#696868"}},d$=p.defineComponent({__name:"Process",props:p.mergeModels({isEdit:{type:Boolean}},{formState:{},formStateModifiers:{}}),emits:["update:formState"],setup(t){const{modal:e}=Wt.App.useApp(),{t:n}=Dn.useI18n(),r=p.useModel(t,"formState"),i=p.ref(["1","2","3","4","5","6"]);function o(){e.info({title:n("ruleModel.title"),content:p.h(l$,{jsonStr:r.value.jobPriority,onSubmit:a=>{r.value.jobPriority=JSON.stringify(a)}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:850,class:"modal-comp"})}return(a,s)=>{const l=ie.Input,u=ie.FormItem,c=ie.Form,d=ie.CollapsePanel,f=ie.Button,h=ie.Collapse;return p.openBlock(),p.createBlock(h,{activeKey:p.unref(i),"onUpdate:activeKey":s[3]||(s[3]=v=>p.isRef(i)?i.value=v:null)},{default:p.withCtx(()=>[p.createVNode(d,{key:"1",header:a.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(c,{layout:"vertical",model:r.value},{default:p.withCtx(()=>[p.createVNode(u,{label:a.$t("FLOW_CHART.Id"),extra:a.$t("FLOW_CHART.idTip")},{default:p.withCtx(()=>[p.createVNode(l,{value:r.value.id,"onUpdate:value":s[0]||(s[0]=v=>r.value.id=v),placeholder:a.$t("common.plsEnter"),readonly:t.isEdit},null,8,["value","placeholder","readonly"])]),_:1},8,["label","extra"]),p.createVNode(u,{label:a.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(l,{value:r.value.name,"onUpdate:value":s[1]||(s[1]=v=>r.value.name=v),placeholder:a.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(u,{label:a.$t("FLOW_CHART.Version Tag")},{default:p.withCtx(()=>[p.createVNode(l,{value:r.value.versionTag,"onUpdate:value":s[2]||(s[2]=v=>r.value.versionTag=v),disabled:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),p.createVNode(d,{key:"4",header:a.$t("FLOW_CHART.Job Configuration")},{default:p.withCtx(()=>[p.createVNode(c,{layout:"vertical",model:r.value},{default:p.withCtx(()=>[p.createVNode(u,{label:a.$t("FLOW_CHART.Job Priority")},{default:p.withCtx(()=>[p.createVNode(f,{onClick:o,style:{width:"100%"}},{default:p.withCtx(()=>[r.value.jobPriority?(p.openBlock(),p.createElementBlock("span",c$,[p.createTextVNode(p.toDisplayString(p.unref(n)("bpmn.has_config_rule"))+" ",1),p.createVNode(p.unref(Rp))])):(p.openBlock(),p.createElementBlock("span",u$,p.toDisplayString(p.unref(n)("bpmn.no_config_rule")),1))]),_:1})]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),f$=Qr(p.defineComponent({__name:"TemplateConfig",props:{data:{type:Object,default:()=>{}},templateList:{type:Array,default:()=>[]}},emits:["update:data"],setup(t,{emit:e}){const n=e,r=t,i=p.computed({get:()=>r.data,set:u=>{n("update:data",u)}}),o=p.computed(()=>r.templateList.filter(u=>{var c;return(c=u==null?void 0:u.type)==null?void 0:c.split(",").includes("1")}).map(u=>({label:u.name,value:u.id}))),a=p.computed(()=>r.templateList.filter(u=>{var c;return(c=u==null?void 0:u.type)==null?void 0:c.split(",").includes("2")}).map(u=>({label:u.name,value:u.id}))),s=p.computed(()=>r.templateList.filter(u=>{var c;return(c=u==null?void 0:u.type)==null?void 0:c.split(",").includes("3")}).map(u=>({label:u.name,value:u.id}))),l=(u,c)=>c.label.toLowerCase().indexOf(u.toLowerCase())>=0;return(u,c)=>{const d=ie.Select,f=ie.FormItem,h=ie.Form;return p.openBlock(),p.createElementBlock("div",null,[p.createVNode(h,{class:"form-query-select mx-nm mt-nm",layout:"vertical",model:i.value},{default:p.withCtx(()=>[p.createVNode(f,{label:u.$t("bpmn.todoHandle")},{default:p.withCtx(()=>[p.createVNode(d,{value:i.value[1],"onUpdate:value":c[0]||(c[0]=v=>i.value[1]=v),options:o.value,allowClear:"",placeholder:u.$t("common.plsSelect"),"show-search":"","filter-option":l},null,8,["value","options","placeholder"])]),_:1},8,["label"]),p.createVNode(f,{label:u.$t("bpmn.todoDetail")},{default:p.withCtx(()=>[p.createVNode(d,{value:i.value[2],"onUpdate:value":c[1]||(c[1]=v=>i.value[2]=v),options:a.value,allowClear:"",placeholder:u.$t("common.plsSelect"),"show-search":"","filter-option":l},null,8,["value","options","placeholder"])]),_:1},8,["label"]),p.createVNode(f,{label:u.$t("bpmn.AllDetail")},{default:p.withCtx(()=>[p.createVNode(d,{value:i.value[3],"onUpdate:value":c[2]||(c[2]=v=>i.value[3]=v),options:s.value,allowClear:"",placeholder:u.$t("common.plsSelect"),"show-search":"","filter-option":l},null,8,["value","options","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),[["__scopeId","data-v-8a27c7e4"]]),p$={class:"modal-container"},h$=p.defineComponent({__name:"SelectLinkTask",props:{id:{type:String},componentInfo:{type:String,default:""},variable:{type:String,default:""},description:{type:String,default:""}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({}),a=p.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"},{title:n("bpmn.action"),dataIndex:"action"}]),s=p.ref([]),l=p.ref();function u(k,B){s.value=k,l.value=B}const c=p.ref({1:void 0,2:void 0,3:void 0}),d=p.ref({}),f=p.ref(!1),h=p.ref(""),v=p.ref("");function g(){f.value=!1,h.value=m(c.value)}function m(k){return Object.entries(k).filter(([ee,ce])=>ce!==void 0).map(([ee,ce])=>`${ee}-${ce}`).join(",")}function y(k){if(typeof k!="string"||k.trim()==="")return{};const B=k.split(","),Z={};return B.forEach(ee=>{const[ce,...Be]=ee.split("-");if(ce&&Be.length>0){const me=Be.join("-");Z[ce]=me}}),Z}function x(){f.value=!1}function E(k){d.value=k,f.value=!0}const b=p.ref([]);async function T(){const{result:k}=await Gt.getTemplateList({pageNo:1,pageSize:1e3});b.value=(k==null?void 0:k.data)||[]}const A=p.ref([]);async function S(){const{result:k}=await Gt.getLinkList({pageNo:1,pageSize:1e3});A.value=(k==null?void 0:k.data)||[]}p.watchEffect(()=>{r.id&&(r.id.startsWith("common-approve-")||r.id.startsWith("common-handle-")?(v.value=r.id.slice(-4),s.value=[r.id.slice(0,-4)+"*"]):s.value=[r.id]),r.componentInfo&&(c.value=y(r.componentInfo))});function M(k){l.value=null;const B={...o.value};return Object.assign(B,k),Gt.getLinkList(B)}const C=p.ref(),G=()=>{C.value.refresh()},K=()=>{o.value={},G()};p.onMounted(()=>{K(),T(),S()});function J(){Wt.Modal.destroyAll()}function R(){var k,B;if((k=l.value)!=null&&k.length)i("submit",{...l.value[0],bindComponent:h.value,hasSuffix:""});else if((B=s.value)!=null&&B.length){const Z=A.value.find(ee=>ee.id===s.value[0]);i("submit",{...Z,id:r.id,bindComponent:h.value,hasSuffix:v.value})}Wt.Modal.destroyAll()}return(k,B)=>{const Z=ie.Input,ee=ie.FormItem,ce=ie.Button,Be=ie.Space,me=ie.Form,de=ie.Tooltip,Se=p.resolveComponent("a-table-ex"),je=ie.Modal;return p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("div",p$,[p.createVNode(me,{class:"form-query mx-nm mt-nm",layout:"vertical",model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(ee,{label:k.$t("link.id")},{default:p.withCtx(()=>[p.createVNode(Z,{value:p.unref(o).id,"onUpdate:value":B[0]||(B[0]=he=>p.unref(o).id=he),placeholder:k.$t("common.plsEnter"),onKeydown:p.withKeys(G,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(ee,{label:k.$t("link.description")},{default:p.withCtx(()=>[p.createVNode(Z,{value:p.unref(o).description,"onUpdate:value":B[1]||(B[1]=he=>p.unref(o).description=he),placeholder:k.$t("common.plsEnter"),onKeydown:p.withKeys(G,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(ee,{class:"form-btns"},{default:p.withCtx(()=>[p.createVNode(Be,null,{default:p.withCtx(()=>[p.createVNode(ce,{type:"primary",onClick:G},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_search")),1)]),_:1}),p.createVNode(ce,{onClick:K},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),p.createVNode(Se,{ref_key:"tableEx",ref:C,class:"table-query bordered mx-nm",columns:p.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:p.unref(s),onChange:u},loadData:M},{bodyCell:p.withCtx(({record:he,column:Ve})=>[Ve.dataIndex==="action"?(p.openBlock(),p.createBlock(de,{key:0,placement:"top"},{title:p.withCtx(()=>[p.createElementVNode("span",null,p.toDisplayString(k.$t("bpmn.tempConfigTip")),1)]),default:p.withCtx(()=>[p.createVNode(ce,{type:"link",onClick:$=>E(he),style:{"padding-left":"0"},disabled:!p.unref(s).includes(he.id)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("bpmn.tempConfig")),1)]),_:2},1032,["onClick","disabled"])]),_:2},1024)):p.createCommentVNode("",!0)]),_:1},8,["columns","row-selection"]),p.createVNode(Be,{class:"modal-btns"},{default:p.withCtx(()=>{var he;return[p.createVNode(ce,{onClick:J},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(ce,{type:"primary",disabled:!((he=p.unref(s))!=null&&he.length),onClick:R},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})]),p.createVNode(je,{open:p.unref(f),"onUpdate:open":B[3]||(B[3]=he=>p.isRef(f)?f.value=he:null),title:k.$t("bpmn.tempConfig"),onOk:g,onCancel:x},{default:p.withCtx(()=>[p.createVNode(f$,{data:p.unref(c),"onUpdate:data":B[2]||(B[2]=he=>p.isRef(c)?c.value=he:null),"template-list":p.unref(b)},null,8,["data","template-list"])]),_:1},8,["open","title"])],64)}}}),g$={class:"modal-container"},v$=p.defineComponent({__name:"SelectUser",props:{userIds:{type:String||Array},branchId:{type:String},mode:{type:String,default:"default"}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({}),a=p.ref([{title:n("user.user_name"),dataIndex:"userName"},{title:n("user.user_id"),dataIndex:"userCode"},{title:n("arrears.org"),dataIndex:"branchName"}]),s=p.ref([]),l=p.ref();function u(m,y){s.value=m,l.value=y}p.watchEffect(()=>{r.userIds&&(s.value=Array.isArray(r.userIds)?r.userIds:[r.userIds])});function c(m){l.value=null;const y={...o.value,branchId:r.branchId};return Object.assign(y,m),Gt.getUserList(y)}const d=p.ref(),f=()=>{d.value.refresh()},h=()=>{o.value={},f()};p.onMounted(()=>{h()});function v(){Wt.Modal.destroyAll()}function g(){var m;if((m=l.value)!=null&&m.length){const y=l.value;i("submit",r.mode==="multiple"?y:y[0])}Wt.Modal.destroyAll()}return(m,y)=>{const x=ie.Input,E=ie.FormItem,b=ie.Button,T=ie.Space,A=ie.Form,S=p.resolveComponent("a-table-ex");return p.openBlock(),p.createElementBlock("div",g$,[p.createVNode(A,{class:"form-query mx-nm mt-nm",layout:"vertical",model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(E,{label:m.$t("user.key")},{default:p.withCtx(()=>[p.createVNode(x,{value:p.unref(o).userName,"onUpdate:value":y[0]||(y[0]=M=>p.unref(o).userName=M),placeholder:m.$t("common.plsEnter"),onKeydown:p.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(E,{class:"form-btns"},{default:p.withCtx(()=>[p.createVNode(T,null,{default:p.withCtx(()=>[p.createVNode(b,{type:"primary",onClick:f},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_search")),1)]),_:1}),p.createVNode(b,{onClick:h},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),p.createVNode(S,{ref_key:"tableEx",ref:d,class:"table-query bordered mx-nm",columns:p.unref(a),rowKey:"userId","row-selection":{type:t.mode==="multiple"?"checkbox":"radio",selectedRowKeys:p.unref(s),onChange:u},loadData:c},null,8,["columns","row-selection"]),p.createVNode(T,{class:"modal-btns"},{default:p.withCtx(()=>{var M;return[p.createVNode(b,{onClick:v},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(b,{type:"primary",disabled:!((M=p.unref(s))!=null&&M.length),onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),m$=p.defineComponent({__name:"UserTask",props:{formState:{},formStateModifiers:{}},emits:p.mergeModels(["updateNodeName"],["update:formState"]),setup(t,{emit:e}){const{modal:n}=Wt.App.useApp(),{t:r}=Dn.useI18n(),i=p.inject("type"),o=p.inject("isApproval"),a=p.useModel(t,"formState"),s=p.ref(["1","2","3","4","5","6"]),l=p.ref([]),u=p.ref([]),c=p.ref([]),d=p.computed(()=>{var S;const A=a.value.assignee;return(S=String(A))==null?void 0:S.startsWith("${")});function f(){const A="abcdefghijklmnopqrstuvwxyz";let S="";for(let M=0;M<2;M++)S+=A.charAt(Math.floor(Math.random()*A.length));for(let M=0;M<2;M++)S+=Math.floor(Math.random()*10);return S}function h(){console.log(a.value,"formState.value"),n.info({title:r("link.select_link"),content:p.h(h$,{id:a.value.id,variable:a.value.assignee,description:a.value.name,componentInfo:a.value.bindComponent,onSubmit:A=>{let S=A.id;const M=S!==a.value.id;S.endsWith("*")&&(A.hasSuffix?S=S.substring(0,S.length-1)+A.hasSuffix:S=S.substring(0,S.length-1)+f()),Object.assign(a.value,{id:S,name:o?g(S):`${i}.${S}`,assignee:"","camunda:assigneeName":"",priority:void 0,userArr:M?[]:a.value.userArr,roleArr:M?[]:a.value.roleArr,approveRank:"0"}),A.variable&&(a.value.assignee=`\${${A.variable}}`),a.value.bindComponent=A.bindComponent||void 0}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}function v(){n.info({title:r("user.select_user"),content:p.h(v$,{userIds:a.value.assignee,onSubmit:A=>{Object.assign(a.value,{assignee:A.userId,"camunda:assigneeName":A.userName})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}function g(A){return A.includes("common-approve-")?`bpmn.${A.slice(0,-4)}0`:`bpmn.${A}`}function m(A){A==0?a.value.name=r("bpmn.common-approve-0"):a.value.name=r(`bpmn.${a.value.id.slice(0,-4)}${A}`)}function y(){Gt.getBranchTree().then(A=>{A.code===0&&(l.value=A.result||[])})}function x(){const A={pageNo:1,pageSize:1e3,branchId:a.value.priority||void 0};Gt.getUserList(A).then(S=>{var M,C;S.code===0&&(c.value=((C=(M=S.result)==null?void 0:M.data)==null?void 0:C.map(G=>({...G,label:G.userName,value:G.userId})))||[])})}function E(){const A={pageNo:1,pageSize:1e3,branchId:a.value.priority||void 0};Gt.getRoleList(A).then(S=>{var M,C;S.code===0&&(u.value=((C=(M=S.result)==null?void 0:M.data)==null?void 0:C.map(G=>({...G,label:G.roleName,value:G.roleId})))||[])})}function b(){Object.assign(a.value,{userArr:[],roleArr:[]}),x(),E()}function T(A){if(A!=null&&A.length){const S=c.value.find(M=>M.userId===A[0]);a.value.priority!==S.branchId&&(Object.assign(a.value,{priority:S.branchId,roleArr:[]}),x(),E())}}return p.onMounted(()=>{y(),x(),E()}),(A,S)=>{const M=ie.Input,C=ie.FormItem,G=ie.InputNumber,K=ie.TreeSelect,J=ie.Select,R=ie.Form,k=ie.CollapsePanel,B=ie.Radio,Z=ie.RadioGroup,ee=ie.Checkbox,ce=ie.CheckboxGroup,Be=ie.Collapse;return p.openBlock(),p.createBlock(Be,{activeKey:p.unref(s),"onUpdate:activeKey":S[10]||(S[10]=me=>p.isRef(s)?s.value=me:null)},{default:p.withCtx(()=>[p.createVNode(k,{key:"1",header:A.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(R,{layout:"vertical",model:a.value},{default:p.withCtx(()=>[p.createVNode(C,{label:A.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(M,{value:a.value.id,"onUpdate:value":S[0]||(S[0]=me=>a.value.id=me),placeholder:A.$t("common.plsEnter"),readonly:"",onClick:h},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(M,{value:A.$t(a.value.name),disabled:"",placeholder:A.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),a.value.id&&a.value.id.includes("common-approve-")?(p.openBlock(),p.createBlock(C,{key:0,label:A.$t("FLOW_CHART.approve-rank")},{default:p.withCtx(()=>[p.createVNode(G,{style:{width:"100%"},value:a.value.approveRank,"onUpdate:value":S[1]||(S[1]=me=>a.value.approveRank=me),min:0,max:10,placeholder:A.$t("common.plsEnter"),onChange:m},null,8,["value","placeholder"])]),_:1},8,["label"])):p.createCommentVNode("",!0),p.createVNode(C,{label:A.$t("FLOW_CHART.Assignee")},{default:p.withCtx(()=>[p.unref(d)?(p.openBlock(),p.createBlock(M,{key:0,value:a.value.assignee,"onUpdate:value":S[2]||(S[2]=me=>a.value.assignee=me),placeholder:A.$t("common.plsSelect"),disabled:""},null,8,["value","placeholder"])):(p.openBlock(),p.createBlock(M,{key:1,value:a.value["camunda:assigneeName"],"onUpdate:value":S[3]||(S[3]=me=>a.value["camunda:assigneeName"]=me),placeholder:A.$t("common.plsSelect"),readonly:"",onClick:v},null,8,["value","placeholder"]))]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Priority")},{default:p.withCtx(()=>[p.createVNode(K,{value:a.value.priority,"onUpdate:value":S[4]||(S[4]=me=>a.value.priority=me),placeholder:A.$t("common.plsSelect"),"tree-data":p.unref(l),treeDefaultExpandAll:"",treeNodeFilterProp:"label","show-search":"","allow-clear":"",onChange:b},null,8,["value","placeholder","tree-data"])]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Candidate Users")},{default:p.withCtx(()=>[p.createVNode(J,{value:a.value.userArr,"onUpdate:value":S[5]||(S[5]=me=>a.value.userArr=me),placeholder:A.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:p.unref(c),optionFilterProp:"label",disabled:p.unref(d),onChange:T},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Candidate Groups")},{default:p.withCtx(()=>[p.createVNode(J,{value:a.value.roleArr,"onUpdate:value":S[6]||(S[6]=me=>a.value.roleArr=me),placeholder:A.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:p.unref(u),optionFilterProp:"label",disabled:p.unref(d)},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),p.unref(o)?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(k,{key:"2",header:A.$t("FLOW_CHART.isAllowRollback")},{default:p.withCtx(()=>[p.createVNode(Z,{value:a.value.rollback,"onUpdate:value":S[7]||(S[7]=me=>a.value.rollback=me)},{default:p.withCtx(()=>[p.createVNode(B,{value:"1"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.yes")),1)]),_:1}),p.createVNode(B,{value:"0"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.no")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])),p.unref(o)?(p.openBlock(),p.createBlock(k,{key:"3",header:A.$t("FLOW_CHART.Approval Mode")},{default:p.withCtx(()=>[p.createVNode(Z,{value:a.value.approvalSign,"onUpdate:value":S[8]||(S[8]=me=>a.value.approvalSign=me)},{default:p.withCtx(()=>[p.createVNode(B,{value:"orSign"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.Or Sign")),1)]),_:1}),p.createVNode(B,{value:"countersign"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.countersign")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])):p.createCommentVNode("",!0),p.unref(o)?(p.openBlock(),p.createBlock(k,{key:"4",header:A.$t("FLOW_CHART.Approval Required")},{default:p.withCtx(()=>[p.createVNode(ce,{value:a.value.approvalCheckbox,"onUpdate:value":S[9]||(S[9]=me=>a.value.approvalCheckbox=me)},{default:p.withCtx(()=>[p.createVNode(ee,{value:"advice"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.Comments Required")),1)]),_:1}),p.createVNode(ee,{value:"attachment"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.Attachment Required")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])):p.createCommentVNode("",!0)]),_:1},8,["activeKey"])}}}),y$=p.defineComponent({__name:"ExclusiveGateway",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(t){const e=p.useModel(t,"formState"),n=p.ref(["1","2","3","4","5","6"]);return(r,i)=>{const o=ie.Input,a=ie.FormItem,s=ie.Form,l=ie.CollapsePanel,u=ie.Collapse;return p.openBlock(),p.createBlock(u,{activeKey:p.unref(n),"onUpdate:activeKey":i[2]||(i[2]=c=>p.isRef(n)?n.value=c:null)},{default:p.withCtx(()=>[p.createVNode(l,{key:"1",header:r.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(s,{layout:"vertical",model:e.value},{default:p.withCtx(()=>[p.createVNode(a,{label:r.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.id,"onUpdate:value":i[0]||(i[0]=c=>e.value.id=c),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.name,"onUpdate:value":i[1]||(i[1]=c=>e.value.name=c),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),_$=p.defineComponent({__name:"SequenceFlow",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(t){const e=p.useModel(t,"formState"),n=p.ref(["1","2","3","4","5","6"]);return(r,i)=>{const o=ie.Input,a=ie.FormItem,s=ie.SelectOption,l=ie.Select,u=ie.Form,c=ie.CollapsePanel,d=ie.Collapse;return p.openBlock(),p.createBlock(d,{activeKey:p.unref(n),"onUpdate:activeKey":i[4]||(i[4]=f=>p.isRef(n)?n.value=f:null)},{default:p.withCtx(()=>[p.createVNode(c,{key:"1",header:r.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(u,{layout:"vertical",model:e.value},{default:p.withCtx(()=>[p.createVNode(a,{label:r.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.id,"onUpdate:value":i[0]||(i[0]=f=>e.value.id=f),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.name,"onUpdate:value":i[1]||(i[1]=f=>e.value.name=f),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Condition Type")},{default:p.withCtx(()=>[p.createVNode(l,{value:e.value.condType,"onUpdate:value":i[2]||(i[2]=f=>e.value.condType=f),placeholder:r.$t("common.plsSelect"),allowClear:""},{default:p.withCtx(()=>[p.createVNode(s,{value:"bpmn:FormalExpression"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(r.$t("FLOW_CHART.Expression")),1)]),_:1})]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),e.value.condType==="bpmn:FormalExpression"?(p.openBlock(),p.createBlock(a,{key:0,label:r.$t("FLOW_CHART.Expression")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.condBody,"onUpdate:value":i[3]||(i[3]=f=>e.value.condBody=f),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])):p.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),b$={class:"modal-container"},x$=p.defineComponent({__name:"SelectLink",props:{id:{type:String}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({}),a=p.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"}]),s=p.ref([]),l=p.ref();function u(m,y){s.value=m,l.value=y}p.watchEffect(()=>{r.id&&(s.value=[r.id])});function c(m){l.value=null;const y={...o.value};return Object.assign(y,m),Gt.getLinkList(y)}const d=p.ref(),f=()=>{d.value.refresh()},h=()=>{o.value={},f()};p.onMounted(()=>{h()});function v(){Wt.Modal.destroyAll()}function g(){var m;(m=l.value)!=null&&m.length&&i("submit",l.value[0]),Wt.Modal.destroyAll()}return(m,y)=>{const x=ie.Input,E=ie.FormItem,b=ie.Button,T=ie.Space,A=ie.Form,S=p.resolveComponent("a-table-ex");return p.openBlock(),p.createElementBlock("div",b$,[p.createVNode(A,{class:"form-query mx-nm mt-nm",layout:"vertical",model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(E,{label:m.$t("link.id")},{default:p.withCtx(()=>[p.createVNode(x,{value:p.unref(o).id,"onUpdate:value":y[0]||(y[0]=M=>p.unref(o).id=M),placeholder:m.$t("common.plsEnter"),onKeydown:p.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(E,{label:m.$t("link.description")},{default:p.withCtx(()=>[p.createVNode(x,{value:p.unref(o).description,"onUpdate:value":y[1]||(y[1]=M=>p.unref(o).description=M),placeholder:m.$t("common.plsEnter"),onKeydown:p.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(E,{class:"form-btns"},{default:p.withCtx(()=>[p.createVNode(T,null,{default:p.withCtx(()=>[p.createVNode(b,{type:"primary",onClick:f},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_search")),1)]),_:1}),p.createVNode(b,{onClick:h},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),p.createVNode(S,{ref_key:"tableEx",ref:d,class:"table-query bordered mx-nm",columns:p.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:p.unref(s),onChange:u},loadData:c},null,8,["columns","row-selection"]),p.createVNode(T,{class:"modal-btns"},{default:p.withCtx(()=>{var M;return[p.createVNode(b,{onClick:v},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(b,{type:"primary",disabled:!((M=p.unref(s))!=null&&M.length),onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),E$=p.defineComponent({__name:"EndEvent",props:{formState:{},formStateModifiers:{}},emits:p.mergeModels(["updateNodeName"],["update:formState"]),setup(t,{emit:e}){const{modal:n}=Wt.App.useApp(),{t:r}=Dn.useI18n(),i=p.useModel(t,"formState"),o=p.ref(["1","2","3","4","5","6"]);function a(){const c="abcdefghijklmnopqrstuvwxyz";let d="";for(let f=0;f<2;f++)d+=c.charAt(Math.floor(Math.random()*c.length));for(let f=0;f<2;f++)d+=Math.floor(Math.random()*10);return d}const s=e;function l(){s("updateNodeName",i.value.id,i.value.name)}function u(){n.info({title:r("link.select_link"),content:p.h(x$,{id:i.value.id,onSubmit:c=>{let d=c.id;d.endsWith("*")&&(d=d.substring(0,d.length-1)+a()),Object.assign(i.value,{id:d,name:"bpmn.endName"})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}return(c,d)=>{const f=ie.Input,h=ie.FormItem,v=ie.Form,g=ie.CollapsePanel,m=ie.Collapse;return p.openBlock(),p.createBlock(m,{activeKey:p.unref(o),"onUpdate:activeKey":d[1]||(d[1]=y=>p.isRef(o)?o.value=y:null)},{default:p.withCtx(()=>[p.createVNode(g,{key:"1",header:c.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(v,{layout:"vertical",model:i.value},{default:p.withCtx(()=>[p.createVNode(h,{label:c.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(f,{value:i.value.id,"onUpdate:value":d[0]||(d[0]=y=>i.value.id=y),placeholder:c.$t("common.plsEnter"),readonly:"",onClick:u},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(h,{label:c.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(f,{value:c.$t(i.value.name),disabled:"",placeholder:c.$t("common.plsEnter"),onChange:l},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),w$=p.defineComponent({__name:"Other",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(t){const e=p.useModel(t,"formState"),n=p.ref(["1","2","3","4","5","6"]);return(r,i)=>{const o=ie.Input,a=ie.FormItem,s=ie.Form,l=ie.CollapsePanel,u=ie.Collapse;return p.openBlock(),p.createBlock(u,{activeKey:p.unref(n),"onUpdate:activeKey":i[2]||(i[2]=c=>p.isRef(n)?n.value=c:null)},{default:p.withCtx(()=>[p.createVNode(l,{key:"1",header:r.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(s,{layout:"vertical",model:e.value},{default:p.withCtx(()=>[p.createVNode(a,{label:r.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.id,"onUpdate:value":i[0]||(i[0]=c=>e.value.id=c),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.name,"onUpdate:value":i[1]||(i[1]=c=>e.value.name=c),disabled:"",placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),S$={class:"properties-panel"},C$=Qr(p.defineComponent({__name:"BpmnPropertiesPanel",props:{lfRef:{type:Object},isEdit:{type:Boolean},processAttrs:{type:Object}},emits:["changeProcess"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=e,i=t,o=p.ref(""),a=p.ref({}),s=p.ref({});let l;p.watch(()=>i.lfRef,()=>{i.lfRef&&(s.value=i.lfRef,u())}),p.watch(a,(h,v)=>{h===v&&d()},{deep:!0});function u(){s.value.on("node:click",({data:h,e:v,position:g})=>{c(h)}),s.value.on("edge:click,",({data:h,e:v,position:g})=>{c(h)}),s.value.on("blank:click",({e:h})=>{o.value="bpmn:process",a.value={id:i.processAttrs.id||"Process_1",name:i.processAttrs.name,jobPriority:i.processAttrs["camunda:jobPriority"]}})}function c(h){var m;if(!h||l===h)return;l=h;const v=h.type;o.value="",p.nextTick(()=>{o.value=v});const g={...h.properties,id:h.id,name:((m=h.text)==null?void 0:m.value)||""};v==="bpmn:userTask"?(Object.assign(g,{rollback:g["camunda:rollback"]==="1"?"1":"0",approvalCheckbox:[]}),Object.assign(g,{approvalSign:g["camunda:countersign"]==="true"?"countersign":"orSign",approvalCheckbox:[]}),g["camunda:assignee"]&&(g.assignee=g["camunda:assignee"]),g["camunda:priority"]&&(g.priority=g["camunda:priority"]),g["camunda:advice"]==="true"&&g.approvalCheckbox.push("advice"),g["camunda:attachment"]==="true"&&g.approvalCheckbox.push("attachment"),g["camunda:bindComponent"]&&(g.bindComponent=g["camunda:bindComponent"]),g.hasOwnProperty("camunda:approveRank")?g.approveRank=g["camunda:approveRank"]:g.id.includes("common-approve-")&&(g.approveRank=0),typeof g["camunda:candidateUsers"]=="number"?g.userArr=[g["camunda:candidateUsers"].toString()]:typeof g["camunda:candidateUsers"]=="string"?g.userArr=(g["camunda:candidateUsers"]||"").split(",").filter(y=>y):g.userArr=[],typeof g["camunda:candidateGroups"]=="number"?g.roleArr=[g["camunda:candidateGroups"].toString()]:typeof g["camunda:candidateGroups"]=="string"?g.roleArr=(g["camunda:candidateGroups"]||"").split(",").filter(y=>y):g.roleArr=[]):v==="bpmn:sequenceFlow"&&(console.log("data.properties",h.properties,h.properties["bpmn:conditionExpression"]),h.properties["bpmn:conditionExpression"]&&Object.assign(g,{condType:h.properties["bpmn:conditionExpression"]["xsi:type"],condBody:h.properties["bpmn:conditionExpression"]["#text"].replace(/\s+/g,"")})),a.value=g}function d(){var m,y;const h=a.value;function v(x){return x?"true":"false"}const g={id:h.id,name:h.name};if(console.log("bpmnType.value",o.value),o.value==="bpmn:process")h.jobPriority&&Object.assign(g,{"camunda:jobPriority":h.jobPriority}),r("changeProcess",g);else if(o.value==="bpmn:userTask"){Object.assign(g,{"camunda:orSign":v(h.approvalSign==="orSign"),"camunda:rollback":h.rollback==="1"?"1":"0","camunda:countersign":v(h.approvalSign==="countersign"),"camunda:advice":v(h.approvalCheckbox.includes("advice")),"camunda:attachment":v(h.approvalCheckbox.includes("attachment")),"camunda:assignee":h.assignee||"","camunda:assigneeName":h["camunda:assigneeName"]||"","camunda:priority":h.priority||"","camunda:candidateUsers":((m=h.userArr)==null?void 0:m.join())||"","camunda:candidateGroups":((y=h.roleArr)==null?void 0:y.join())||"","camunda:bindComponent":h.bindComponent||"","camunda:approveRank":h.approveRank,"camunda:transName":h.name,name:n(h.name)}),console.log("activeNode.id, attrs",l.id,g);const{id:x}=l,{id:E}=h;E&&x!==E&&s.value.changeNodeId(x,E),s.value.getNodeModelById(E).setProperties(g),s.value.updateText(E,n(h.name))}}function f(h,v){l.id&&(s.value.setProperties(l.id,{name:v}),s.value.updateText(l.id,v))}return(h,v)=>{const g=zm;return p.openBlock(),p.createElementBlock("div",S$,[p.createVNode(g,null,{default:p.withCtx(()=>[p.unref(o)==="bpmn:process"?(p.openBlock(),p.createBlock(d$,{key:0,formState:p.unref(a),"onUpdate:formState":v[0]||(v[0]=m=>p.isRef(a)?a.value=m:null),isEdit:t.isEdit},null,8,["formState","isEdit"])):p.unref(o)==="bpmn:userTask"?(p.openBlock(),p.createBlock(m$,{key:1,formState:p.unref(a),"onUpdate:formState":v[1]||(v[1]=m=>p.isRef(a)?a.value=m:null),onUpdateNodeName:f},null,8,["formState"])):p.unref(o)==="bpmn:exclusiveGateway"?(p.openBlock(),p.createBlock(y$,{key:2,formState:p.unref(a),"onUpdate:formState":v[2]||(v[2]=m=>p.isRef(a)?a.value=m:null)},null,8,["formState"])):p.unref(o)==="bpmn:sequenceFlow"?(p.openBlock(),p.createBlock(_$,{key:3,formState:p.unref(a),"onUpdate:formState":v[3]||(v[3]=m=>p.isRef(a)?a.value=m:null)},null,8,["formState"])):p.unref(o)==="bpmn:endEvent"?(p.openBlock(),p.createBlock(E$,{key:4,formState:p.unref(a),"onUpdate:formState":v[4]||(v[4]=m=>p.isRef(a)?a.value=m:null),onUpdateNodeName:f},null,8,["formState"])):p.unref(o)?(p.openBlock(),p.createBlock(w$,{key:5,formState:p.unref(a),"onUpdate:formState":v[5]||(v[5]=m=>p.isRef(a)?a.value=m:null)},null,8,["formState"])):p.createCommentVNode("",!0)]),_:1})])}}}),[["__scopeId","data-v-fe59c58a"]]),Lp="menu-common",Nx=200,A$=100;class Mx{constructor({lf:e}){Yp(this,"setContextMenuByType",(e,n)=>{this.menuTypeMap.set(e,n)});Yp(this,"listenDelete",()=>{this.hideContextMenu()});this.menuTypeMap=new Map,this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(Lp,[])}render(e,n){this.container=n,e.on("node:click",({data:r})=>{this._activeData=r,this.createContextMenu(),console.log(r)}),e.on("edge:click",({data:r})=>{this._activeData=r,this.createContextMenu()}),e.on("blank:click",()=>{this.hideContextMenu()})}hideContextMenu(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1}showContextMenu(e){if(!e||!e.id){console.warn("请检查传入的参数");return}this._activeData=e,this.createContextMenu()}setContextMenuItems(e){this.menuTypeMap.set(Lp,e)}getContextMenuPosition(){const e=this._activeData,n=this.lf.graphModel.getElement(e.id);if(!n){console.warn(`找不到元素${e.id}`);return}let r,i;if(n.BaseType==="edge"){r=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER;const o=n.getData();r=Math.max(o.startPoint.x,r),i=Math.min(o.startPoint.y,i),r=Math.max(o.endPoint.x,r),i=Math.min(o.endPoint.y,i),o.pointsList&&o.pointsList.forEach(a=>{r=Math.max(a.x,r),i=Math.min(a.y,i)})}return n.BaseType==="node"&&(r=e.x+n.width/2,i=e.y-n.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([r,i])}createContextMenu(){const{isSilentMode:e}=this.lf.options;if(e)return;let n=this.menuTypeMap.get(this._activeData.type)||[];n=n.concat(this.menuTypeMap.get(Lp));const r=document.createDocumentFragment();n.forEach(i=>{const o=document.createElement("div");o.className="lf-context-item";const a=document.createElement("img");a.src=i.icon,a.className="lf-context-img",i.className&&(o.className=`${o.className} ${i.className}`),a.addEventListener("click",()=>{this.hideContextMenu(),i.callback?i.callback(this._activeData):this.addNode({sourceId:this._activeData.id,x:this._activeData.x,y:this._activeData.y,properties:i.properties,type:i.type,text:i.text||""})}),o.appendChild(a),r.appendChild(o)}),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(r),this.showMenu()}addNode(e,n){const r=n!==void 0;n===void 0&&(n=e.y);const i=this.lf.getNodeModelById(e.sourceId),o=e.x-100+Nx,a=n-e.y/2-20,s=e.x+100+Nx,l=n+e.y/2+20,u=this.lf.getAreaElement([o,a],[s,l]);if(console.log(u),u.length){n=n+A$,this.addNode(e,n);return}const c=this.lf.addNode({type:e.type,x:e.x+200,y:n,properties:e.properties,text:e.text});let d,f;r&&(d={x:e.x,y:e.y+i.height/2},f={x:c.x-c.width/2,y:c.y}),this.lf.addEdge({sourceNodeId:e.sourceId,targetNodeId:c.id,startPoint:d,endPoint:f})}showMenu(){const[e,n]=this.getContextMenuPosition();this.__menuDOM.style.display="flex",this.__menuDOM.style.top=`${n}px`,this.__menuDOM.style.left=`${e+10}px`,this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}}Mx.pluginName="contextPad";const O$=(t,e)=>{const n={type:"bpmn:userTask",label:e("bpmn.userTaskName"),text:e("bpmn.userTaskName"),properties:{"camunda:transName":"bpmn.userTaskName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAp1JREFUWEftlj9oE2EYxp/3IkSckotOpqDgl5ZWcLBgxcVBdBL8gw66iCg2lxrBzcl0qpPS1lyQKm5uiuBUHBztoAjVVtOLRDA46Z06VAvmXkkwQWLS3PudQwn54KY8z/v8eO7uvRA2+KENzoc+YNg71PsNxm6VYxStnibwIQCnAF4kptcMv+RWjSlk1VqYFkM1mLCLx5jpJoh2doD4zoQpL61u6EJqA5oF5zwY9wIFE3JuWk0G0raItAATd8r7uPprQRRoYMQdV8siD6C3ZkzbeQ5gTBLGwGPPUsclnppW3GCs8HaHwZvK0iAAq5sj37Z9ujS6KvGKARP5lXNMdF8S0tT6fNidSD2VeMWAcfv9OMEvSEKaWo2XRQwYm3UOGhE80wEk5pNfMqlHEq8YMFEobmc2KpKQhpZR3eNZQ4sSrxiwNty0Sw8BPiEJAujDlp/R4crVgR8Snxagzm1m8FnPSj2QwGmtmUaAaTtzAC4ECWTCNd3PnVaDDahEoZRl5ul1ITVWy9/zQgHWBsULpQPw+QwIw2CM1IcTlsBYZgN3v6bVqyAtd9KEBgwTHsTb+4DmnJPEGgZgIAlCst4KowIfFUTx0b2otHZmo11xg+ZtZz8iGAPjCFC/gpx5EOZRxYI7oWr/hAKfQIBb7XeDDOMKMx1tthQ4okXIqBDxE4I//dkaKnYb0xXQzBdzoEgW4Hi3YbLfyQNXZ9zMYG4937qApu28Af6sDlm6RL3kWmq3eM3EbecFAXslSbpaBl56lhpt52/bYNxemSHQZd1AHR+DZz0rlW31tgfMOw4RdukE6XqYUfIySgUCNG2HdYPC+FxL/VNY2wb7gB1q7qEG68vZuB7meRJ72Z9st7S7fknEQf/Z0AcMW2i/wbAN/gbA1dYpL5kz5gAAAABJRU5ErkJggg==",properties:{actived:!0}},r={type:"bpmn:serviceTask",label:e("bpmn.serviceTaskName"),text:e("bpmn.serviceTaskName"),properties:{"camunda:transName":"bpmn.serviceTaskName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAz9JREFUWEfVmEtoE1EUhv8zqaBgwUwi+K5CJqkoumhBxY11IVTBhaBUUNCFtplQRRSrK+vKVrTgYyZUF7qRigV3dqFg3YhdtAsLapIJKK2vRToRqgtpM0cmtTVJE3IzyWKcXTL/+c83c+/cc+4luPwil/OhKsCVWjJgEVqZM75iD8rk+co08/xHePMnpy/CMaANlyE2RBJbNLvJKaRjQF/UuMaMSyKAROiZCiuXRbSFGseAsp4cALhNLCk9NtXAUTFtvqoKQOMNgJ2CSUdMVdklqM2TlQRc1ze57NfS38eJM2uY+GlabRzPjZR14xuAVYJJv5uqsjpX69Vj24jpECRpAoQRs0N5X8yrKKCsJdeDeBDAjvkgBl5JzHdm6+itlEEfAQcF4eZkRENShs4xZbZaRJ0E7MmJfwemVjMSmBSag7KWvAXiMxUBVCtmum1GAmfLAvq1ZItF/LLafE7iJaa9qUhgODd20RDL0eQzMO93kqDqGKIhMxw4UBJQ1uKnQNK9yhPxFwYZEjhmEc0SEAIoBOYNFXuxddqMhO7Pxy28wfr+uH9JRnoNIFiJKTGfnIoEHxaL8WqJi0TUW4kfgMSMx9o93R5KZb+t+WBZNw4DeFKJmUgJ8+vJJgs8WokvE46lw8qjfEAt3g2SrogaSaDmlBoYE9GviH7YKHHdRxFtVsPWVTMS6s4DtH94dWOUgKZyRszclY4Er5fT5d73aYkTTPSgfAyPm2pw+6I5aP/h743VW8ulfhCVrptEE2Y40FA+0WKFrCc+A7S2ZCzzgPTTak91NU4XBVyYj1r8PEi6UdSI8MIMK/ucAHp1Y7iggvyzYeuCGQndLPQtWYtLmTHhbjqsdDoB9OmJKIM6CmPtMppWlZZinv8noOzWIXb9R+LqZUZ2+0Lt+lLn+mbBXoNc3W4tVBE3N6zZeuz2ln9uqF28afoLWHLbyR6Kwco2tlsqqcfMSHqI2pithqq3nXZigY27abeQgpBpU1XkXG1VG3eRpKJVJ9sgA2NpVWkW8RVut8qZybphD7O9jxG5Bk1VOSIirBmgTzd6GOgSSUpA75SqCB3V1QzQ9QeY9pO6+ghYZGhroXF8gFmL5CIefwB0scE4DheJlAAAAABJRU5ErkJggg==",cls:"import_icon"},i={type:"bpmn:exclusiveGateway",label:e("bpmn.exclusiveGatewayName"),properties:{"camunda:transName":"bpmn.exclusiveGatewayName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAAHeEJUAAAAABGdBTUEAALGPC/xhBQAAAvVJREFUOBGNVEFrE0EU/mY3bQoiFlOkaUJrQUQoWMGePLX24EH0IIoHKQiCV0G8iE1covgLiqA/QTzVm1JPogc9tIJYFaQtlhQxqYjSpunu+L7JvmUTU3AgmTfvffPNN++9WSA1DO182f6xwILzD5btfAoQmwL5KJEwiQyVbSVZ0IgRyV6PTpIJ81E5ZvqfHQR0HUOBHW4L5Et2kQ6Zf7iAOhTFAA8s0pEP7AXO1uAA52SbqGk6h/6J45LaLhO64ByfcUzM39V7ZiAdS2yCePPEIQYvTUHqM/n7dgQNfBKWPjpF4ISk8q3J4nB11qw6X8l+FsF3EhlkEMfrjIer3wJTLwS2aCNcj4DbGxXTw00JmAuO+Ni6bBxVUCvS5d9aa04+so4pHW5jLTywuXAL7jJ+D06sl82Sgl2JuVBQn498zkc2bGKxULHjCnSMadBKYDYYHAtsby1EQ5lNGrQd4Y3v4Zo0XdGEmDno46yCM9Tk+RiJmUYHS/aXHPNTcjxcbTFna000PFJHIVZ5lFRqRpJWk9/+QtlOUYJj9HG5pVFEU7zqIYDVsw2s+AJaD8wTd2umgSCCyUxgGsS1Y6TBwXQQTFuZaHcd8gAGioE90hlsY+wMcs30RduYtxanjMGal8H5dMW67dmT1JFtYUEe8LiQLRsPZ6IIc7A4J5tqco3T0pnv/4u0kyzrYUq7gASuEyI8VXKvB9Odytv6jS/PNaZBln0nioJG/AVQRZvApOdhjj3Jt8QC8Im09SafwdBdvIpztpxWxpeKCC+EsFdS8DCyuCn2munFpL7ctHKp+Xc5cMybeIyMAN33SPL3ZR9QV1XVwLyzHm6Iv0/yeUuUb7PPlZC4D4HZkeu6dpF4v9j9MreGtMbxMMRLIcjJic9yHi7WQ3yVKzZVWUr5UrViJvn1FfUlwe/KYVfYyWRLSGNu16hR01U9IacajXPei0wx/5BqgInvJN+MMNtNme7ReU9SBbgntovn0kKHpFg7UogZvaZiOue/q1SBo9ktHzQAAAAASUVORK5CYII="},o={type:"bpmn:endEvent",label:e("bpmn.endName"),text:e("bpmn.endName"),properties:{"camunda:transName":"bpmn.endName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAAH6ji2bAAAABGdBTUEAALGPC/xhBQAAA1BJREFUOBFtVE1IVUEYPXOf+tq40Y3vPcmFIdSjIorWoRG0ERWUgnb5FwVhYQSl72oUoZAboxKNFtWiwKRN0M+jpfSzqJAQclHo001tKkjl3emc8V69igP3znzfnO/M9zcDcKT67azmjYWTwl9Vn7Vumeqzj1DVb6cleQY4oAVnIOPb+mKAGxQmKI5CWNJ2aLPatxWa3aB9K7/fB+/Z0jUF6TmMlFLQqrkECWQzOZxYGjTlOl8eeKaIY5yHnFn486xBustDjWT6dG7pmjHOJd+33t0iitTPkK6tEvjxq4h2MozQ6WFSX/LkDUGfFwfhEZj1Auz/U4pyAi5Sznd7uKzznXeVHlI/Aywmk6j7fsUsEuCGADrWARXXwjxWQsUbIupDHJI7kF5dRktg0eN81IbiZXiTESic50iwS+t1oJgL83jAiBupLDCQqwziaWSoAFSeIR3P5Xv5az00wyIn35QRYTwdSYbz8pH8fxUUAtxnFvYmEmgI0wYXUXcCCSpeEVpXlsRhBnCEATxWylL9+EKCAYhe1NGstUa6356kS9NVvt3DU2fd+Wtbm/+lSbylJqsqkSm9CRhvoJVlvKPvF1RKY/FcPn5j4UfIMLn8D4UYb54BNsilTDXKnF4CfTobA0FpoW/LSp306wkXM+XaOJhZaFkcNM82ASNAWMrhrUbRfmyeI1FvRBTpN06WKxa9BK0o2E4Pd3zfBBEwPsv9sQBnmLVbLEIZ/Xe9LYwJu/Er17W6HYVBc7vmuk0xUQ+pqxdom5Fnp55SiytXLPYoMXNM4u4SNSCFWnrVIzKG3EGyMXo6n/BQOe+bX3FClY4PwydVhthOZ9NnS+ntiLh0fxtlUJHAuGaFoVmttpVMeum0p3WEXbcll94l1wM/gZ0Ccczop77VvN2I7TlsZCsuXf1WHvWEhjO8DPtyOVg2/mvK9QqboEth+7pD6NUQC1HN/TwvydGBARi9MZSzLE4b8Ru3XhX2PBxf8E1er2A6516o0w4sIA+lwURhAON82Kwe2iDAC1Watq4XHaGQ7skLcFOtI5lDxuM2gZe6WFIotPAhbaeYlU4to5cuarF1QrcZ/lwrLaCJl66JBocYZnrNlvm2+MBCTmUymPrYZVbjdlr/BxlMjmNmNI3SAAAAAElFTkSuQmCC"},a={icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAUpJREFUWEftVzuywjAMlKgDPV2g4RYPuAnfDs7w4AzQ8b0Jn1vQQDp6SI0YFwFPSMC2EiYZnDLZldYrybERGI/XLs4Aofc2BMHcXV37pmnQlOh1SwMgmijxEYfu4jJVwoZARgKPXeevQLjTSXhDqlcX/l6HI7APgaeOM0LCulIAhDIA1JSwT9ABCM4qHELaVZb+6FUg4L9KgLQxBDTOqUDVEqdsYWSJU85pHN5oio2zGRDzK/DUchpYwI3BorUpdKNmZe1vo4ixDlqBkl2JOCiCaNfuDUFun0QEustrogPldYoU6P9dgWKQ5CoGkxj3XsZ+xcG4JOEdIKo9rEBRLuugfKIOb1mcPuJwwzqUf3U6jW4FCps5LnC4tsRc962D1sGgBziTyOHaHsxUD2b+wMq5RH3lwJopgZm/dnLc+sRN5Nr5KQnne64F3gEyDFZHJCakvQAAAABJRU5ErkJggg==",callback:s=>{t.deleteElement(s.id),t.extension.contextPad.hideContextMenu()}};t.extension.contextPad.setContextMenuItems([a]),t.extension.contextPad.setContextMenuByType("bpmn:startEvent",[n,r,i]),t.extension.contextPad.setContextMenuByType("bpmn:userTask",[n,r,i,o]),t.extension.contextPad.setContextMenuByType("bpmn:serviceTask",[n,r,i,o]),t.extension.contextPad.setContextMenuByType("bpmn:exclusiveGateway",[n,r])};var Ip={};const Dx=TI(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Px;function T$(){return Px||(Px=1,function(t){(function(e){e.parser=function(w,_){return new r(w,_)},e.SAXParser=r,e.SAXStream=c,e.createStream=u,e.MAX_BUFFER_LENGTH=64*1024;var n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(w,_){if(!(this instanceof r))return new r(w,_);var F=this;o(F),F.q=F.c="",F.bufferCheckPosition=e.MAX_BUFFER_LENGTH,F.opt=_||{},F.opt.lowercase=F.opt.lowercase||F.opt.lowercasetags,F.looseCase=F.opt.lowercase?"toLowerCase":"toUpperCase",F.tags=[],F.closed=F.closedRoot=F.sawRoot=!1,F.tag=F.error=null,F.strict=!!w,F.noscript=!!(w||F.opt.noscript),F.state=C.BEGIN,F.strictEntities=F.opt.strictEntities,F.ENTITIES=F.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),F.attribList=[],F.opt.xmlns&&(F.ns=Object.create(g)),F.opt.unquotedAttributeValues===void 0&&(F.opt.unquotedAttributeValues=!w),F.trackPosition=F.opt.position!==!1,F.trackPosition&&(F.position=F.line=F.column=0),K(F,"onready")}Object.create||(Object.create=function(w){function _(){}_.prototype=w;var F=new _;return F}),Object.keys||(Object.keys=function(w){var _=[];for(var F in w)w.hasOwnProperty(F)&&_.push(F);return _});function i(w){for(var _=Math.max(e.MAX_BUFFER_LENGTH,10),F=0,L=0,se=n.length;L<se;L++){var fe=w[n[L]].length;if(fe>_)switch(n[L]){case"textNode":R(w);break;case"cdata":J(w,"oncdata",w.cdata),w.cdata="";break;case"script":J(w,"onscript",w.script),w.script="";break;default:B(w,"Max buffer length exceeded: "+n[L])}F=Math.max(F,fe)}var Ne=e.MAX_BUFFER_LENGTH-F;w.bufferCheckPosition=Ne+w.position}function o(w){for(var _=0,F=n.length;_<F;_++)w[n[_]]=""}function a(w){R(w),w.cdata!==""&&(J(w,"oncdata",w.cdata),w.cdata=""),w.script!==""&&(J(w,"onscript",w.script),w.script="")}r.prototype={end:function(){Z(this)},write:$,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){a(this)}};var s;try{s=Dx.Stream}catch{s=function(){}}s||(s=function(){});var l=e.EVENTS.filter(function(w){return w!=="error"&&w!=="end"});function u(w,_){return new c(w,_)}function c(w,_){if(!(this instanceof c))return new c(w,_);s.apply(this),this._parser=new r(w,_),this.writable=!0,this.readable=!0;var F=this;this._parser.onend=function(){F.emit("end")},this._parser.onerror=function(L){F.emit("error",L),F._parser.error=null},this._decoder=null,l.forEach(function(L){Object.defineProperty(F,"on"+L,{get:function(){return F._parser["on"+L]},set:function(se){if(!se)return F.removeAllListeners(L),F._parser["on"+L]=se,se;F.on(L,se)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(s.prototype,{constructor:{value:c}}),c.prototype.write=function(w){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(w)){if(!this._decoder){var _=Dx.StringDecoder;this._decoder=new _("utf8")}w=this._decoder.write(w)}return this._parser.write(w.toString()),this.emit("data",w),!0},c.prototype.end=function(w){return w&&w.length&&this.write(w),this._parser.end(),!0},c.prototype.on=function(w,_){var F=this;return!F._parser["on"+w]&&l.indexOf(w)!==-1&&(F._parser["on"+w]=function(){var L=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);L.splice(0,0,w),F.emit.apply(F,L)}),s.prototype.on.call(F,w,_)};var d="[CDATA[",f="DOCTYPE",h="http://www.w3.org/XML/1998/namespace",v="http://www.w3.org/2000/xmlns/",g={xml:h,xmlns:v},m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,x=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function b(w){return w===" "||w===`
|
|
154
|
+
`||w==="\r"||w===" "}function T(w){return w==='"'||w==="'"}function A(w){return w===">"||b(w)}function S(w,_){return w.test(_)}function M(w,_){return!S(w,_)}var C=0;e.STATE={BEGIN:C++,BEGIN_WHITESPACE:C++,TEXT:C++,TEXT_ENTITY:C++,OPEN_WAKA:C++,SGML_DECL:C++,SGML_DECL_QUOTED:C++,DOCTYPE:C++,DOCTYPE_QUOTED:C++,DOCTYPE_DTD:C++,DOCTYPE_DTD_QUOTED:C++,COMMENT_STARTING:C++,COMMENT:C++,COMMENT_ENDING:C++,COMMENT_ENDED:C++,CDATA:C++,CDATA_ENDING:C++,CDATA_ENDING_2:C++,PROC_INST:C++,PROC_INST_BODY:C++,PROC_INST_ENDING:C++,OPEN_TAG:C++,OPEN_TAG_SLASH:C++,ATTRIB:C++,ATTRIB_NAME:C++,ATTRIB_NAME_SAW_WHITE:C++,ATTRIB_VALUE:C++,ATTRIB_VALUE_QUOTED:C++,ATTRIB_VALUE_CLOSED:C++,ATTRIB_VALUE_UNQUOTED:C++,ATTRIB_VALUE_ENTITY_Q:C++,ATTRIB_VALUE_ENTITY_U:C++,CLOSE_TAG:C++,CLOSE_TAG_SAW_WHITE:C++,SCRIPT:C++,SCRIPT_ENDING:C++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(w){var _=e.ENTITIES[w],F=typeof _=="number"?String.fromCharCode(_):_;e.ENTITIES[w]=F});for(var G in e.STATE)e.STATE[e.STATE[G]]=G;C=e.STATE;function K(w,_,F){w[_]&&w[_](F)}function J(w,_,F){w.textNode&&R(w),K(w,_,F)}function R(w){w.textNode=k(w.opt,w.textNode),w.textNode&&K(w,"ontext",w.textNode),w.textNode=""}function k(w,_){return w.trim&&(_=_.trim()),w.normalize&&(_=_.replace(/\s+/g," ")),_}function B(w,_){return R(w),w.trackPosition&&(_+=`
|
|
155
|
+
Line: `+w.line+`
|
|
156
|
+
Column: `+w.column+`
|
|
157
|
+
Char: `+w.c),_=new Error(_),w.error=_,K(w,"onerror",_),w}function Z(w){return w.sawRoot&&!w.closedRoot&&ee(w,"Unclosed root tag"),w.state!==C.BEGIN&&w.state!==C.BEGIN_WHITESPACE&&w.state!==C.TEXT&&B(w,"Unexpected end"),R(w),w.c="",w.closed=!0,K(w,"onend"),r.call(w,w.strict,w.opt),w}function ee(w,_){if(typeof w!="object"||!(w instanceof r))throw new Error("bad call to strictFail");w.strict&&B(w,_)}function ce(w){w.strict||(w.tagName=w.tagName[w.looseCase]());var _=w.tags[w.tags.length-1]||w,F=w.tag={name:w.tagName,attributes:{}};w.opt.xmlns&&(F.ns=_.ns),w.attribList.length=0,J(w,"onopentagstart",F)}function Be(w,_){var F=w.indexOf(":"),L=F<0?["",w]:w.split(":"),se=L[0],fe=L[1];return _&&w==="xmlns"&&(se="xmlns",fe=""),{prefix:se,local:fe}}function me(w){if(w.strict||(w.attribName=w.attribName[w.looseCase]()),w.attribList.indexOf(w.attribName)!==-1||w.tag.attributes.hasOwnProperty(w.attribName)){w.attribName=w.attribValue="";return}if(w.opt.xmlns){var _=Be(w.attribName,!0),F=_.prefix,L=_.local;if(F==="xmlns")if(L==="xml"&&w.attribValue!==h)ee(w,"xml: prefix must be bound to "+h+`
|
|
158
|
+
Actual: `+w.attribValue);else if(L==="xmlns"&&w.attribValue!==v)ee(w,"xmlns: prefix must be bound to "+v+`
|
|
159
|
+
Actual: `+w.attribValue);else{var se=w.tag,fe=w.tags[w.tags.length-1]||w;se.ns===fe.ns&&(se.ns=Object.create(fe.ns)),se.ns[L]=w.attribValue}w.attribList.push([w.attribName,w.attribValue])}else w.tag.attributes[w.attribName]=w.attribValue,J(w,"onattribute",{name:w.attribName,value:w.attribValue});w.attribName=w.attribValue=""}function de(w,_){if(w.opt.xmlns){var F=w.tag,L=Be(w.tagName);F.prefix=L.prefix,F.local=L.local,F.uri=F.ns[L.prefix]||"",F.prefix&&!F.uri&&(ee(w,"Unbound namespace prefix: "+JSON.stringify(w.tagName)),F.uri=L.prefix);var se=w.tags[w.tags.length-1]||w;F.ns&&se.ns!==F.ns&&Object.keys(F.ns).forEach(function(q){J(w,"onopennamespace",{prefix:q,uri:F.ns[q]})});for(var fe=0,Ne=w.attribList.length;fe<Ne;fe++){var ze=w.attribList[fe],rt=ze[0],Ze=ze[1],at=Be(rt,!0),Ct=at.prefix,P=at.local,I=Ct===""?"":F.ns[Ct]||"",j={name:rt,value:Ze,prefix:Ct,local:P,uri:I};Ct&&Ct!=="xmlns"&&!I&&(ee(w,"Unbound namespace prefix: "+JSON.stringify(Ct)),j.uri=Ct),w.tag.attributes[rt]=j,J(w,"onattribute",j)}w.attribList.length=0}w.tag.isSelfClosing=!!_,w.sawRoot=!0,w.tags.push(w.tag),J(w,"onopentag",w.tag),_||(!w.noscript&&w.tagName.toLowerCase()==="script"?w.state=C.SCRIPT:w.state=C.TEXT,w.tag=null,w.tagName=""),w.attribName=w.attribValue="",w.attribList.length=0}function Se(w){if(!w.tagName){ee(w,"Weird empty close tag."),w.textNode+="</>",w.state=C.TEXT;return}if(w.script){if(w.tagName!=="script"){w.script+="</"+w.tagName+">",w.tagName="",w.state=C.SCRIPT;return}J(w,"onscript",w.script),w.script=""}var _=w.tags.length,F=w.tagName;w.strict||(F=F[w.looseCase]());for(var L=F;_--;){var se=w.tags[_];if(se.name!==L)ee(w,"Unexpected close tag");else break}if(_<0){ee(w,"Unmatched closing tag: "+w.tagName),w.textNode+="</"+w.tagName+">",w.state=C.TEXT;return}w.tagName=F;for(var fe=w.tags.length;fe-- >_;){var Ne=w.tag=w.tags.pop();w.tagName=w.tag.name,J(w,"onclosetag",w.tagName);var ze={};for(var rt in Ne.ns)ze[rt]=Ne.ns[rt];var Ze=w.tags[w.tags.length-1]||w;w.opt.xmlns&&Ne.ns!==Ze.ns&&Object.keys(Ne.ns).forEach(function(at){var Ct=Ne.ns[at];J(w,"onclosenamespace",{prefix:at,uri:Ct})})}_===0&&(w.closedRoot=!0),w.tagName=w.attribValue=w.attribName="",w.attribList.length=0,w.state=C.TEXT}function je(w){var _=w.entity,F=_.toLowerCase(),L,se="";return w.ENTITIES[_]?w.ENTITIES[_]:w.ENTITIES[F]?w.ENTITIES[F]:(_=F,_.charAt(0)==="#"&&(_.charAt(1)==="x"?(_=_.slice(2),L=parseInt(_,16),se=L.toString(16)):(_=_.slice(1),L=parseInt(_,10),se=L.toString(10))),_=_.replace(/^0+/,""),isNaN(L)||se.toLowerCase()!==_?(ee(w,"Invalid character entity"),"&"+w.entity+";"):String.fromCodePoint(L))}function he(w,_){_==="<"?(w.state=C.OPEN_WAKA,w.startTagPosition=w.position):b(_)||(ee(w,"Non-whitespace before first tag."),w.textNode=_,w.state=C.TEXT)}function Ve(w,_){var F="";return _<w.length&&(F=w.charAt(_)),F}function $(w){var _=this;if(this.error)throw this.error;if(_.closed)return B(_,"Cannot write after close. Assign an onready handler.");if(w===null)return Z(_);typeof w=="object"&&(w=w.toString());for(var F=0,L="";L=Ve(w,F++),_.c=L,!!L;)switch(_.trackPosition&&(_.position++,L===`
|
|
160
|
+
`?(_.line++,_.column=0):_.column++),_.state){case C.BEGIN:if(_.state=C.BEGIN_WHITESPACE,L==="\uFEFF")continue;he(_,L);continue;case C.BEGIN_WHITESPACE:he(_,L);continue;case C.TEXT:if(_.sawRoot&&!_.closedRoot){for(var se=F-1;L&&L!=="<"&&L!=="&";)L=Ve(w,F++),L&&_.trackPosition&&(_.position++,L===`
|
|
161
|
+
`?(_.line++,_.column=0):_.column++);_.textNode+=w.substring(se,F-1)}L==="<"&&!(_.sawRoot&&_.closedRoot&&!_.strict)?(_.state=C.OPEN_WAKA,_.startTagPosition=_.position):(!b(L)&&(!_.sawRoot||_.closedRoot)&&ee(_,"Text data outside of root node."),L==="&"?_.state=C.TEXT_ENTITY:_.textNode+=L);continue;case C.SCRIPT:L==="<"?_.state=C.SCRIPT_ENDING:_.script+=L;continue;case C.SCRIPT_ENDING:L==="/"?_.state=C.CLOSE_TAG:(_.script+="<"+L,_.state=C.SCRIPT);continue;case C.OPEN_WAKA:if(L==="!")_.state=C.SGML_DECL,_.sgmlDecl="";else if(!b(L))if(S(m,L))_.state=C.OPEN_TAG,_.tagName=L;else if(L==="/")_.state=C.CLOSE_TAG,_.tagName="";else if(L==="?")_.state=C.PROC_INST,_.procInstName=_.procInstBody="";else{if(ee(_,"Unencoded <"),_.startTagPosition+1<_.position){var fe=_.position-_.startTagPosition;L=new Array(fe).join(" ")+L}_.textNode+="<"+L,_.state=C.TEXT}continue;case C.SGML_DECL:if(_.sgmlDecl+L==="--"){_.state=C.COMMENT,_.comment="",_.sgmlDecl="";continue}_.doctype&&_.doctype!==!0&&_.sgmlDecl?(_.state=C.DOCTYPE_DTD,_.doctype+="<!"+_.sgmlDecl+L,_.sgmlDecl=""):(_.sgmlDecl+L).toUpperCase()===d?(J(_,"onopencdata"),_.state=C.CDATA,_.sgmlDecl="",_.cdata=""):(_.sgmlDecl+L).toUpperCase()===f?(_.state=C.DOCTYPE,(_.doctype||_.sawRoot)&&ee(_,"Inappropriately located doctype declaration"),_.doctype="",_.sgmlDecl=""):L===">"?(J(_,"onsgmldeclaration",_.sgmlDecl),_.sgmlDecl="",_.state=C.TEXT):(T(L)&&(_.state=C.SGML_DECL_QUOTED),_.sgmlDecl+=L);continue;case C.SGML_DECL_QUOTED:L===_.q&&(_.state=C.SGML_DECL,_.q=""),_.sgmlDecl+=L;continue;case C.DOCTYPE:L===">"?(_.state=C.TEXT,J(_,"ondoctype",_.doctype),_.doctype=!0):(_.doctype+=L,L==="["?_.state=C.DOCTYPE_DTD:T(L)&&(_.state=C.DOCTYPE_QUOTED,_.q=L));continue;case C.DOCTYPE_QUOTED:_.doctype+=L,L===_.q&&(_.q="",_.state=C.DOCTYPE);continue;case C.DOCTYPE_DTD:L==="]"?(_.doctype+=L,_.state=C.DOCTYPE):L==="<"?(_.state=C.OPEN_WAKA,_.startTagPosition=_.position):T(L)?(_.doctype+=L,_.state=C.DOCTYPE_DTD_QUOTED,_.q=L):_.doctype+=L;continue;case C.DOCTYPE_DTD_QUOTED:_.doctype+=L,L===_.q&&(_.state=C.DOCTYPE_DTD,_.q="");continue;case C.COMMENT:L==="-"?_.state=C.COMMENT_ENDING:_.comment+=L;continue;case C.COMMENT_ENDING:L==="-"?(_.state=C.COMMENT_ENDED,_.comment=k(_.opt,_.comment),_.comment&&J(_,"oncomment",_.comment),_.comment=""):(_.comment+="-"+L,_.state=C.COMMENT);continue;case C.COMMENT_ENDED:L!==">"?(ee(_,"Malformed comment"),_.comment+="--"+L,_.state=C.COMMENT):_.doctype&&_.doctype!==!0?_.state=C.DOCTYPE_DTD:_.state=C.TEXT;continue;case C.CDATA:L==="]"?_.state=C.CDATA_ENDING:_.cdata+=L;continue;case C.CDATA_ENDING:L==="]"?_.state=C.CDATA_ENDING_2:(_.cdata+="]"+L,_.state=C.CDATA);continue;case C.CDATA_ENDING_2:L===">"?(_.cdata&&J(_,"oncdata",_.cdata),J(_,"onclosecdata"),_.cdata="",_.state=C.TEXT):L==="]"?_.cdata+="]":(_.cdata+="]]"+L,_.state=C.CDATA);continue;case C.PROC_INST:L==="?"?_.state=C.PROC_INST_ENDING:b(L)?_.state=C.PROC_INST_BODY:_.procInstName+=L;continue;case C.PROC_INST_BODY:if(!_.procInstBody&&b(L))continue;L==="?"?_.state=C.PROC_INST_ENDING:_.procInstBody+=L;continue;case C.PROC_INST_ENDING:L===">"?(J(_,"onprocessinginstruction",{name:_.procInstName,body:_.procInstBody}),_.procInstName=_.procInstBody="",_.state=C.TEXT):(_.procInstBody+="?"+L,_.state=C.PROC_INST_BODY);continue;case C.OPEN_TAG:S(y,L)?_.tagName+=L:(ce(_),L===">"?de(_):L==="/"?_.state=C.OPEN_TAG_SLASH:(b(L)||ee(_,"Invalid character in tag name"),_.state=C.ATTRIB));continue;case C.OPEN_TAG_SLASH:L===">"?(de(_,!0),Se(_)):(ee(_,"Forward-slash in opening tag not followed by >"),_.state=C.ATTRIB);continue;case C.ATTRIB:if(b(L))continue;L===">"?de(_):L==="/"?_.state=C.OPEN_TAG_SLASH:S(m,L)?(_.attribName=L,_.attribValue="",_.state=C.ATTRIB_NAME):ee(_,"Invalid attribute name");continue;case C.ATTRIB_NAME:L==="="?_.state=C.ATTRIB_VALUE:L===">"?(ee(_,"Attribute without value"),_.attribValue=_.attribName,me(_),de(_)):b(L)?_.state=C.ATTRIB_NAME_SAW_WHITE:S(y,L)?_.attribName+=L:ee(_,"Invalid attribute name");continue;case C.ATTRIB_NAME_SAW_WHITE:if(L==="=")_.state=C.ATTRIB_VALUE;else{if(b(L))continue;ee(_,"Attribute without value"),_.tag.attributes[_.attribName]="",_.attribValue="",J(_,"onattribute",{name:_.attribName,value:""}),_.attribName="",L===">"?de(_):S(m,L)?(_.attribName=L,_.state=C.ATTRIB_NAME):(ee(_,"Invalid attribute name"),_.state=C.ATTRIB)}continue;case C.ATTRIB_VALUE:if(b(L))continue;T(L)?(_.q=L,_.state=C.ATTRIB_VALUE_QUOTED):(_.opt.unquotedAttributeValues||B(_,"Unquoted attribute value"),_.state=C.ATTRIB_VALUE_UNQUOTED,_.attribValue=L);continue;case C.ATTRIB_VALUE_QUOTED:if(L!==_.q){L==="&"?_.state=C.ATTRIB_VALUE_ENTITY_Q:_.attribValue+=L;continue}me(_),_.q="",_.state=C.ATTRIB_VALUE_CLOSED;continue;case C.ATTRIB_VALUE_CLOSED:b(L)?_.state=C.ATTRIB:L===">"?de(_):L==="/"?_.state=C.OPEN_TAG_SLASH:S(m,L)?(ee(_,"No whitespace between attributes"),_.attribName=L,_.attribValue="",_.state=C.ATTRIB_NAME):ee(_,"Invalid attribute name");continue;case C.ATTRIB_VALUE_UNQUOTED:if(!A(L)){L==="&"?_.state=C.ATTRIB_VALUE_ENTITY_U:_.attribValue+=L;continue}me(_),L===">"?de(_):_.state=C.ATTRIB;continue;case C.CLOSE_TAG:if(_.tagName)L===">"?Se(_):S(y,L)?_.tagName+=L:_.script?(_.script+="</"+_.tagName,_.tagName="",_.state=C.SCRIPT):(b(L)||ee(_,"Invalid tagname in closing tag"),_.state=C.CLOSE_TAG_SAW_WHITE);else{if(b(L))continue;M(m,L)?_.script?(_.script+="</"+L,_.state=C.SCRIPT):ee(_,"Invalid tagname in closing tag."):_.tagName=L}continue;case C.CLOSE_TAG_SAW_WHITE:if(b(L))continue;L===">"?Se(_):ee(_,"Invalid characters in closing tag");continue;case C.TEXT_ENTITY:case C.ATTRIB_VALUE_ENTITY_Q:case C.ATTRIB_VALUE_ENTITY_U:var Ne,ze;switch(_.state){case C.TEXT_ENTITY:Ne=C.TEXT,ze="textNode";break;case C.ATTRIB_VALUE_ENTITY_Q:Ne=C.ATTRIB_VALUE_QUOTED,ze="attribValue";break;case C.ATTRIB_VALUE_ENTITY_U:Ne=C.ATTRIB_VALUE_UNQUOTED,ze="attribValue";break}if(L===";"){var rt=je(_);_.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(rt)?(_.entity="",_.state=Ne,_.write(rt)):(_[ze]+=rt,_.entity="",_.state=Ne)}else S(_.entity.length?E:x,L)?_.entity+=L:(ee(_,"Invalid character in entity name"),_[ze]+="&"+_.entity+L,_.entity="",_.state=Ne);continue;default:throw new Error(_,"Unknown state: "+_.state)}return _.position>=_.bufferCheckPosition&&i(_),_}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var w=String.fromCharCode,_=Math.floor,F=function(){var L=16384,se=[],fe,Ne,ze=-1,rt=arguments.length;if(!rt)return"";for(var Ze="";++ze<rt;){var at=Number(arguments[ze]);if(!isFinite(at)||at<0||at>1114111||_(at)!==at)throw RangeError("Invalid code point: "+at);at<=65535?se.push(at):(at-=65536,fe=(at>>10)+55296,Ne=at%1024+56320,se.push(fe,Ne)),(ze+1===rt||se.length>L)&&(Ze+=w.apply(null,se),se.length=0)}return Ze};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:F,configurable:!0,writable:!0}):String.fromCodePoint=F}()})(t)}(Ip)),Ip}var kp,Rx;function Bp(){return Rx||(Rx=1,kp={isArray:function(t){return Array.isArray?Array.isArray(t):Object.prototype.toString.call(t)==="[object Array]"}}),kp}var jp,Lx;function Fp(){if(Lx)return jp;Lx=1;var t=Bp().isArray;return jp={copyOptions:function(e){var n,r={};for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return r},ensureFlagExists:function(e,n){(!(e in n)||typeof n[e]!="boolean")&&(n[e]=!1)},ensureSpacesExists:function(e){(!("spaces"in e)||typeof e.spaces!="number"&&typeof e.spaces!="string")&&(e.spaces=0)},ensureAlwaysArrayExists:function(e){(!("alwaysArray"in e)||typeof e.alwaysArray!="boolean"&&!t(e.alwaysArray))&&(e.alwaysArray=!1)},ensureKeyExists:function(e,n){(!(e+"Key"in n)||typeof n[e+"Key"]!="string")&&(n[e+"Key"]=n.compact?"_"+e:e)},checkFnExists:function(e,n){return e+"Fn"in n}},jp}var $p,Ix;function kx(){if(Ix)return $p;Ix=1;var t=T$(),e=Fp(),n=Bp().isArray,r,i;function o(y){return r=e.copyOptions(y),e.ensureFlagExists("ignoreDeclaration",r),e.ensureFlagExists("ignoreInstruction",r),e.ensureFlagExists("ignoreAttributes",r),e.ensureFlagExists("ignoreText",r),e.ensureFlagExists("ignoreComment",r),e.ensureFlagExists("ignoreCdata",r),e.ensureFlagExists("ignoreDoctype",r),e.ensureFlagExists("compact",r),e.ensureFlagExists("alwaysChildren",r),e.ensureFlagExists("addParent",r),e.ensureFlagExists("trim",r),e.ensureFlagExists("nativeType",r),e.ensureFlagExists("nativeTypeAttributes",r),e.ensureFlagExists("sanitize",r),e.ensureFlagExists("instructionHasAttributes",r),e.ensureFlagExists("captureSpacesBetweenElements",r),e.ensureAlwaysArrayExists(r),e.ensureKeyExists("declaration",r),e.ensureKeyExists("instruction",r),e.ensureKeyExists("attributes",r),e.ensureKeyExists("text",r),e.ensureKeyExists("comment",r),e.ensureKeyExists("cdata",r),e.ensureKeyExists("doctype",r),e.ensureKeyExists("type",r),e.ensureKeyExists("name",r),e.ensureKeyExists("elements",r),e.ensureKeyExists("parent",r),e.checkFnExists("doctype",r),e.checkFnExists("instruction",r),e.checkFnExists("cdata",r),e.checkFnExists("comment",r),e.checkFnExists("text",r),e.checkFnExists("instructionName",r),e.checkFnExists("elementName",r),e.checkFnExists("attributeName",r),e.checkFnExists("attributeValue",r),e.checkFnExists("attributes",r),r}function a(y){var x=Number(y);if(!isNaN(x))return x;var E=y.toLowerCase();return E==="true"?!0:E==="false"?!1:y}function s(y,x){var E;if(r.compact){if(!i[r[y+"Key"]]&&(n(r.alwaysArray)?r.alwaysArray.indexOf(r[y+"Key"])!==-1:r.alwaysArray)&&(i[r[y+"Key"]]=[]),i[r[y+"Key"]]&&!n(i[r[y+"Key"]])&&(i[r[y+"Key"]]=[i[r[y+"Key"]]]),y+"Fn"in r&&typeof x=="string"&&(x=r[y+"Fn"](x,i)),y==="instruction"&&("instructionFn"in r||"instructionNameFn"in r)){for(E in x)if(x.hasOwnProperty(E))if("instructionFn"in r)x[E]=r.instructionFn(x[E],E,i);else{var b=x[E];delete x[E],x[r.instructionNameFn(E,b,i)]=b}}n(i[r[y+"Key"]])?i[r[y+"Key"]].push(x):i[r[y+"Key"]]=x}else{i[r.elementsKey]||(i[r.elementsKey]=[]);var T={};if(T[r.typeKey]=y,y==="instruction"){for(E in x)if(x.hasOwnProperty(E))break;T[r.nameKey]="instructionNameFn"in r?r.instructionNameFn(E,x,i):E,r.instructionHasAttributes?(T[r.attributesKey]=x[E][r.attributesKey],"instructionFn"in r&&(T[r.attributesKey]=r.instructionFn(T[r.attributesKey],E,i))):("instructionFn"in r&&(x[E]=r.instructionFn(x[E],E,i)),T[r.instructionKey]=x[E])}else y+"Fn"in r&&(x=r[y+"Fn"](x,i)),T[r[y+"Key"]]=x;r.addParent&&(T[r.parentKey]=i),i[r.elementsKey].push(T)}}function l(y){if("attributesFn"in r&&y&&(y=r.attributesFn(y,i)),(r.trim||"attributeValueFn"in r||"attributeNameFn"in r||r.nativeTypeAttributes)&&y){var x;for(x in y)if(y.hasOwnProperty(x)&&(r.trim&&(y[x]=y[x].trim()),r.nativeTypeAttributes&&(y[x]=a(y[x])),"attributeValueFn"in r&&(y[x]=r.attributeValueFn(y[x],x,i)),"attributeNameFn"in r)){var E=y[x];delete y[x],y[r.attributeNameFn(x,y[x],i)]=E}}return y}function u(y){var x={};if(y.body&&(y.name.toLowerCase()==="xml"||r.instructionHasAttributes)){for(var E=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,b;(b=E.exec(y.body))!==null;)x[b[1]]=b[2]||b[3]||b[4];x=l(x)}if(y.name.toLowerCase()==="xml"){if(r.ignoreDeclaration)return;i[r.declarationKey]={},Object.keys(x).length&&(i[r.declarationKey][r.attributesKey]=x),r.addParent&&(i[r.declarationKey][r.parentKey]=i)}else{if(r.ignoreInstruction)return;r.trim&&(y.body=y.body.trim());var T={};r.instructionHasAttributes&&Object.keys(x).length?(T[y.name]={},T[y.name][r.attributesKey]=x):T[y.name]=y.body,s("instruction",T)}}function c(y,x){var E;if(typeof y=="object"&&(x=y.attributes,y=y.name),x=l(x),"elementNameFn"in r&&(y=r.elementNameFn(y,i)),r.compact){if(E={},!r.ignoreAttributes&&x&&Object.keys(x).length){E[r.attributesKey]={};var b;for(b in x)x.hasOwnProperty(b)&&(E[r.attributesKey][b]=x[b])}!(y in i)&&(n(r.alwaysArray)?r.alwaysArray.indexOf(y)!==-1:r.alwaysArray)&&(i[y]=[]),i[y]&&!n(i[y])&&(i[y]=[i[y]]),n(i[y])?i[y].push(E):i[y]=E}else i[r.elementsKey]||(i[r.elementsKey]=[]),E={},E[r.typeKey]="element",E[r.nameKey]=y,!r.ignoreAttributes&&x&&Object.keys(x).length&&(E[r.attributesKey]=x),r.alwaysChildren&&(E[r.elementsKey]=[]),i[r.elementsKey].push(E);E[r.parentKey]=i,i=E}function d(y){r.ignoreText||!y.trim()&&!r.captureSpacesBetweenElements||(r.trim&&(y=y.trim()),r.nativeType&&(y=a(y)),r.sanitize&&(y=y.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")),s("text",y))}function f(y){r.ignoreComment||(r.trim&&(y=y.trim()),s("comment",y))}function h(y){var x=i[r.parentKey];r.addParent||delete i[r.parentKey],i=x}function v(y){r.ignoreCdata||(r.trim&&(y=y.trim()),s("cdata",y))}function g(y){r.ignoreDoctype||(y=y.replace(/^ /,""),r.trim&&(y=y.trim()),s("doctype",y))}function m(y){y.note=y}return $p=function(y,x){var E=t.parser(!0,{}),b={};if(i=b,r=o(x),E.opt={strictEntities:!0},E.onopentag=c,E.ontext=d,E.oncomment=f,E.onclosetag=h,E.onerror=m,E.oncdata=v,E.ondoctype=g,E.onprocessinginstruction=u,E.write(y).close(),b[r.elementsKey]){var T=b[r.elementsKey];delete b[r.elementsKey],b[r.elementsKey]=T,delete b.text}return b},$p}var Hp,Bx;function N$(){if(Bx)return Hp;Bx=1;var t=Fp(),e=kx();function n(r){var i=t.copyOptions(r);return t.ensureSpacesExists(i),i}return Hp=function(r,i){var o,a,s,l;return o=n(i),a=e(r,o),l="compact"in o&&o.compact?"_parent":"parent","addParent"in o&&o.addParent?s=JSON.stringify(a,function(u,c){return u===l?"_":c},o.spaces):s=JSON.stringify(a,null,o.spaces),s.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},Hp}var zp,jx;function Fx(){if(jx)return zp;jx=1;var t=Fp(),e=Bp().isArray,n,r;function i(E){var b=t.copyOptions(E);return t.ensureFlagExists("ignoreDeclaration",b),t.ensureFlagExists("ignoreInstruction",b),t.ensureFlagExists("ignoreAttributes",b),t.ensureFlagExists("ignoreText",b),t.ensureFlagExists("ignoreComment",b),t.ensureFlagExists("ignoreCdata",b),t.ensureFlagExists("ignoreDoctype",b),t.ensureFlagExists("compact",b),t.ensureFlagExists("indentText",b),t.ensureFlagExists("indentCdata",b),t.ensureFlagExists("indentAttributes",b),t.ensureFlagExists("indentInstruction",b),t.ensureFlagExists("fullTagEmptyElement",b),t.ensureFlagExists("noQuotesForNativeAttributes",b),t.ensureSpacesExists(b),typeof b.spaces=="number"&&(b.spaces=Array(b.spaces+1).join(" ")),t.ensureKeyExists("declaration",b),t.ensureKeyExists("instruction",b),t.ensureKeyExists("attributes",b),t.ensureKeyExists("text",b),t.ensureKeyExists("comment",b),t.ensureKeyExists("cdata",b),t.ensureKeyExists("doctype",b),t.ensureKeyExists("type",b),t.ensureKeyExists("name",b),t.ensureKeyExists("elements",b),t.checkFnExists("doctype",b),t.checkFnExists("instruction",b),t.checkFnExists("cdata",b),t.checkFnExists("comment",b),t.checkFnExists("text",b),t.checkFnExists("instructionName",b),t.checkFnExists("elementName",b),t.checkFnExists("attributeName",b),t.checkFnExists("attributeValue",b),t.checkFnExists("attributes",b),t.checkFnExists("fullTagEmptyElement",b),b}function o(E,b,T){return(!T&&E.spaces?`
|
|
162
|
+
`:"")+Array(b+1).join(E.spaces)}function a(E,b,T){if(b.ignoreAttributes)return"";"attributesFn"in b&&(E=b.attributesFn(E,r,n));var A,S,M,C,G=[];for(A in E)E.hasOwnProperty(A)&&E[A]!==null&&E[A]!==void 0&&(C=b.noQuotesForNativeAttributes&&typeof E[A]!="string"?"":'"',S=""+E[A],S=S.replace(/"/g,"""),M="attributeNameFn"in b?b.attributeNameFn(A,S,r,n):A,G.push(b.spaces&&b.indentAttributes?o(b,T+1,!1):" "),G.push(M+"="+C+("attributeValueFn"in b?b.attributeValueFn(S,A,r,n):S)+C));return E&&Object.keys(E).length&&b.spaces&&b.indentAttributes&&G.push(o(b,T,!1)),G.join("")}function s(E,b,T){return n=E,r="xml",b.ignoreDeclaration?"":"<?xml"+a(E[b.attributesKey],b,T)+"?>"}function l(E,b,T){if(b.ignoreInstruction)return"";var A;for(A in E)if(E.hasOwnProperty(A))break;var S="instructionNameFn"in b?b.instructionNameFn(A,E[A],r,n):A;if(typeof E[A]=="object")return n=E,r=S,"<?"+S+a(E[A][b.attributesKey],b,T)+"?>";var M=E[A]?E[A]:"";return"instructionFn"in b&&(M=b.instructionFn(M,A,r,n)),"<?"+S+(M?" "+M:"")+"?>"}function u(E,b){return b.ignoreComment?"":"<!--"+("commentFn"in b?b.commentFn(E,r,n):E)+"-->"}function c(E,b){return b.ignoreCdata?"":"<![CDATA["+("cdataFn"in b?b.cdataFn(E,r,n):E.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function d(E,b){return b.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in b?b.doctypeFn(E,r,n):E)+">"}function f(E,b){return b.ignoreText?"":(E=""+E,E=E.replace(/&/g,"&"),E=E.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),"textFn"in b?b.textFn(E,r,n):E)}function h(E,b){var T;if(E.elements&&E.elements.length)for(T=0;T<E.elements.length;++T)switch(E.elements[T][b.typeKey]){case"text":if(b.indentText)return!0;break;case"cdata":if(b.indentCdata)return!0;break;case"instruction":if(b.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function v(E,b,T){n=E,r=E.name;var A=[],S="elementNameFn"in b?b.elementNameFn(E.name,E):E.name;A.push("<"+S),E[b.attributesKey]&&A.push(a(E[b.attributesKey],b,T));var M=E[b.elementsKey]&&E[b.elementsKey].length||E[b.attributesKey]&&E[b.attributesKey]["xml:space"]==="preserve";return M||("fullTagEmptyElementFn"in b?M=b.fullTagEmptyElementFn(E.name,E):M=b.fullTagEmptyElement),M?(A.push(">"),E[b.elementsKey]&&E[b.elementsKey].length&&(A.push(g(E[b.elementsKey],b,T+1)),n=E,r=E.name),A.push(b.spaces&&h(E,b)?`
|
|
163
|
+
`+Array(T+1).join(b.spaces):""),A.push("</"+S+">")):A.push("/>"),A.join("")}function g(E,b,T,A){return E.reduce(function(S,M){var C=o(b,T,A&&!S);switch(M.type){case"element":return S+C+v(M,b,T);case"comment":return S+C+u(M[b.commentKey],b);case"doctype":return S+C+d(M[b.doctypeKey],b);case"cdata":return S+(b.indentCdata?C:"")+c(M[b.cdataKey],b);case"text":return S+(b.indentText?C:"")+f(M[b.textKey],b);case"instruction":var G={};return G[M[b.nameKey]]=M[b.attributesKey]?M:M[b.instructionKey],S+(b.indentInstruction?C:"")+l(G,b,T)}},"")}function m(E,b,T){var A;for(A in E)if(E.hasOwnProperty(A))switch(A){case b.parentKey:case b.attributesKey:break;case b.textKey:if(b.indentText||T)return!0;break;case b.cdataKey:if(b.indentCdata||T)return!0;break;case b.instructionKey:if(b.indentInstruction||T)return!0;break;case b.doctypeKey:case b.commentKey:return!0;default:return!0}return!1}function y(E,b,T,A,S){n=E,r=b;var M="elementNameFn"in T?T.elementNameFn(b,E):b;if(typeof E>"u"||E===null||E==="")return"fullTagEmptyElementFn"in T&&T.fullTagEmptyElementFn(b,E)||T.fullTagEmptyElement?"<"+M+"></"+M+">":"<"+M+"/>";var C=[];if(b){if(C.push("<"+M),typeof E!="object")return C.push(">"+f(E,T)+"</"+M+">"),C.join("");E[T.attributesKey]&&C.push(a(E[T.attributesKey],T,A));var G=m(E,T,!0)||E[T.attributesKey]&&E[T.attributesKey]["xml:space"]==="preserve";if(G||("fullTagEmptyElementFn"in T?G=T.fullTagEmptyElementFn(b,E):G=T.fullTagEmptyElement),G)C.push(">");else return C.push("/>"),C.join("")}return C.push(x(E,T,A+1,!1)),n=E,r=b,b&&C.push((S?o(T,A,!1):"")+"</"+M+">"),C.join("")}function x(E,b,T,A){var S,M,C,G=[];for(M in E)if(E.hasOwnProperty(M))for(C=e(E[M])?E[M]:[E[M]],S=0;S<C.length;++S){switch(M){case b.declarationKey:G.push(s(C[S],b,T));break;case b.instructionKey:G.push((b.indentInstruction?o(b,T,A):"")+l(C[S],b,T));break;case b.attributesKey:case b.parentKey:break;case b.textKey:G.push((b.indentText?o(b,T,A):"")+f(C[S],b));break;case b.cdataKey:G.push((b.indentCdata?o(b,T,A):"")+c(C[S],b));break;case b.doctypeKey:G.push(o(b,T,A)+d(C[S],b));break;case b.commentKey:G.push(o(b,T,A)+u(C[S],b));break;default:G.push(o(b,T,A)+y(C[S],M,b,T,m(C[S],b)))}A=A&&!G.length}return G.join("")}return zp=function(E,b){b=i(b);var T=[];return n=E,r="_root_",b.compact?T.push(x(E,b,0,!0)):(E[b.declarationKey]&&T.push(s(E[b.declarationKey],b,0)),E[b.elementsKey]&&E[b.elementsKey].length&&T.push(g(E[b.elementsKey],b,0,!T.length))),T.join("")},zp}var Wp,$x;function M$(){if($x)return Wp;$x=1;var t=Fx();return Wp=function(e,n){e instanceof Buffer&&(e=e.toString());var r=null;if(typeof e=="string")try{r=JSON.parse(e)}catch{throw new Error("The JSON structure is invalid")}else r=e;return t(r,n)},Wp}var Up,Hx;function D$(){if(Hx)return Up;Hx=1;var t=kx(),e=N$(),n=Fx(),r=M$();return Up={xml2js:t,xml2json:e,js2xml:n,json2xml:r},Up}var P$=D$();class R${constructor(e={}){this.options={xmlToJson:{compact:!0,spaces:2,ignoreAttributes:!1,attributesKey:"_attributes",textKey:"_text",ignoreDeclaration:!0,ignoreDoctype:!0,...e.xmlToJson},jsonToXml:{spaces:2,fullTagEmptyElement:!1,ignoreDeclaration:!1,preserveNamespaces:!0,...e.jsonToXml}},this.xmlDeclaration=`<?xml version="1.0" encoding="UTF-8"?>
|
|
164
|
+
`}xmlToJson(e){e.includes("<?xml")||(e=this.xmlDeclaration+e),e=this._repairBpmnXml(e);try{return P$.xml2json(e,this.options.xmlToJson)}catch(n){throw new Error(`XML 解析失败: ${n.message}`)}}jsonToXml(e){try{return this._convertToXml(e,"",0)}catch(n){throw new Error(`JSON 转换失败: ${n.message}`)}}_convertToXml(e,n,r){if(e==null)return"";const i=this.options.jsonToXml.spaces>0?n+" ".repeat(this.options.jsonToXml.spaces):n;if(r===0&&e._declaration){const o=e._declaration._attributes||{},a=`<?xml${this._buildAttributes(o)}?>`,{_declaration:s,...l}=e,u=this._convertToXml(l,n,r+1);return`${a}
|
|
165
|
+
${u}`}if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return this._escapeXml(String(e));if(Array.isArray(e))return e.map(o=>this._convertToXml(o,n,r+1)).join("");if(typeof e=="object"){let o="";const a=Object.entries(e);for(const[s,l]of a){if(s==="_attributes"||s==="_text"||s==="_cdata")continue;if(s==="_text"){o+=this._escapeXml(String(l));continue}if(s==="_cdata"){o+=`<![CDATA[${l}]]>`;continue}if(l==null){const g=this._buildAttributes((l==null?void 0:l._attributes)||{});o+=`${n}<${s}${g}/>
|
|
166
|
+
`;continue}const u=l._attributes||{},c=l._text,d=l._cdata,f={...l};delete f._attributes,delete f._text,delete f._cdata;const h=this._buildAttributes(u),v=Object.keys(f).length>0;if(o+=`${n}<${s}${h}`,!v&&!c&&!d)o+=`/>
|
|
167
|
+
`;else{if(o+=">",c?o+=this._escapeXml(String(c)):d&&(o+=`<![CDATA[${d}]]>`),v){o+=`
|
|
168
|
+
`;const g=Object.keys(f);for(const m of g){const y=f[m];Array.isArray(y)?y.forEach(x=>{o+=this._convertToXml({[m]:x},i,r+1)}):o+=this._convertToXml({[m]:y},i,r+1)}o+=`${n}`}o+=`</${s}>
|
|
169
|
+
`}}return o}return""}_buildAttributes(e){if(!e||typeof e!="object"||Object.keys(e).length===0)return"";const n=Object.entries(e).map(([r,i])=>typeof i=="object"&&i!==null?`${r}="${this._escapeXml(JSON.stringify(i))}"`:`${r}="${this._escapeXml(String(i))}"`).join(" ");return n?" "+n:""}_escapeXml(e){return e==null?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}_repairBpmnXml(e){let n=e;const r=/<\s*-\s*([\w:]+)\s*\/>/g;let i;for(;(i=r.exec(n))!==null;){const o=i[1],a=n.substring(0,i.index),s=n.substring(i.index+i[0].length),l=a.lastIndexOf("<"),u=a.lastIndexOf(">");if(l>u){const c=i.index;n=a.substring(0,c)+` ${o}=""`+s,r.lastIndex=c+o.length+4}}return n=n.replace(/<-\s*/g,""),n=n.replace(/(\s[\w:]+)=([^"'\s][^\s>]*)(?=\s|>)/g,'$1="$2"'),n}}function L$(t){return t.replace(/"/g,""")}const hs=new R$({compact:!0,spaces:2,ignoreComment:!0,ignoreDeclaration:!0,ignoreDoctype:!0,ignoreInstruction:!0,ignoreCdata:!0,trim:!0});function zx(t,e){const n=JSON.parse(hs.xmlToJson(t)),r=k$(n,e);return hs.jsonToXml(r)}function I$(t,e){const n=JSON.parse(hs.xmlToJson(t)),r=B$(n,e);let i=hs.jsonToXml(r);return i.includes("<?xml")||(i=hs.xmlDeclaration+i),i=L$(i),console.log(i),i}function k$(t,e){if(!t||typeof t!="object")throw new Error("data参数必须是一个对象");if(typeof e!="function")throw new Error("t参数必须是一个函数");const n=Pe(t),r=n["bpmn:definitions"];if(!r)return console.warn("数据中没有找到bpmn:definitions节点"),n;const i=r["bpmn:process"];if(i)i._attributes.properties={"camunda:jobPriority":i._attributes["camunda:jobPriority"],"camunda:versionTag":i._attributes["camunda:versionTag"],id:i._attributes.id,name:i._attributes.name},i._attributes["camunda:versionTag"]===void 0&&delete i._attributes.properties["camunda:versionTag"];else return console.warn("数据中没有找到bpmn:process节点"),n;const o=i["bpmn:endEvent"];o&&(o._attributes["camunda:transName"]="bpmn.endName",o._attributes.name=e("bpmn.endName"));const a=i["bpmn:startEvent"];a&&(a._attributes["camunda:transName"]="bpmn.startName",a._attributes.name=e("bpmn.startName"));const s=i["bpmn:userTask"];if(s){const l=Array.isArray(s)?s:[s];l.forEach(u=>{if(u&&typeof u=="object"){if(u._attributes["camunda:transName"])u._attributes.name=e(u._attributes["camunda:transName"]);else{const d=Pe(u)._attributes.name;u._attributes["camunda:transName"]=d,u._attributes.name=e(d)}if(u._attributes["camunda:bindComponent"])try{const c=JSON.parse(u._attributes["camunda:bindComponent"]);u._attributes["camunda:bindComponent"]=F$(c)}catch{}}}),!Array.isArray(s)&&l.length===1&&(i["bpmn:userTask"]=l[0])}return n}function B$(t,e){if(!t||typeof t!="object")throw new Error("data参数必须是一个对象");const n=Pe(t),r=n["bpmn:definitions"];if(r)r._attributes["xmlns:camunda"]="http://camunda.org/schema/1.0/bpmn";else return console.warn("数据中没有找到bpmn:definitions节点"),n;const i=r["bpmn:process"];if(i)e["camunda:jobPriority"]&&(i._attributes["camunda:jobPriority"]=e["camunda:jobPriority"]),e.id&&(i._attributes.id=e.id),e.name&&(i._attributes.name=e.name),e["camunda:versionTag"]&&(i._attributes["camunda:versionTag"]=e["camunda:versionTag"]);else return console.warn("数据中没有找到bpmn:process节点"),n;const o=i["bpmn:endEvent"];o&&o._attributes["camunda:transName"]&&(o._attributes.name=o._attributes["camunda:transName"],delete o._attributes["camunda:transName"],delete o._attributes.width,delete o._attributes.height);const a=i["bpmn:startEvent"];a&&a._attributes["camunda:transName"]&&(a._attributes.name=a._attributes["camunda:transName"],delete a._attributes["camunda:transName"],delete a._attributes.width,delete a._attributes.height);const s=i["bpmn:userTask"];if(s){const u=Array.isArray(s)?s:[s];u.forEach(c=>{if(c&&typeof c=="object"&&(c._attributes["camunda:transName"]&&(c._attributes.name=c._attributes["camunda:transName"]),c._attributes=j$(c._attributes),delete c._attributes.actived,delete c._attributes.width,delete c._attributes.height,delete c._attributes["camunda:transName"],delete c._attributes.transName,c._attributes["camunda:bindComponent"])){const d=$$(c._attributes["camunda:bindComponent"]);c._attributes["camunda:bindComponent"]=JSON.stringify(d)}}),!Array.isArray(s)&&u.length===1&&(i["bpmn:userTask"]=u[0])}const l=i["bpmn:exclusiveGateway"];if(l){const u=Array.isArray(l)?l:[l];u.forEach(c=>{c&&typeof c=="object"&&(delete c._attributes.width,delete c._attributes.height)}),!Array.isArray(l)&&u.length===1&&(i["bpmn:exclusiveGateway"]=u[0])}return n}function j$(t){return Object.keys(t).reduce((e,n)=>(t[n]!==""&&(e[n]=t[n]),e),{})}function F$(t){return Object.entries(t).filter(([r,i])=>i!==void 0).map(([r,i])=>`${r}-${i}`).join(",")}function $$(t){if(typeof t!="string"||t.trim()==="")return{};const e=t.split(","),n={};return e.forEach(r=>{const[i,...o]=r.split("-");if(i&&o.length>0){const a=o.join("-");n[i]=a}}),n}const H$={class:"wrapper"},z$=Qr(p.defineComponent({__name:"index",props:{data:{type:Object,required:!0}},setup(t,{expose:e}){const{t:n}=Dn.useI18n(),r=t;p.provide("type",r.data.type),p.provide("isApproval",r.data.isApproval);const i=p.ref(null),o=p.ref(null),a={baseNode:{fill:"#fff",stroke:"#1f2937",strokeWidth:1.5},baseEdge:{stroke:"#1f2937",strokeWidth:1,lineWidth:1},rect:{radius:5,stroke:"#1f2937"},circle:{r:18,stroke:"#1f2937"},diamond:{},ellipse:{},polygon:{stroke:"#1f2937"},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#1f2937",overflowMode:"ellipsis",fontSize:12,lineHeight:1.2,padding:5},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"white",height:14,stroke:"transparent",radius:3}},line:{},polyline:{stroke:"#1f2937",hoverStroke:"#1f2937",selectedStroke:"#1f2937"},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{fill:"#1f2937",offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:1},outline:{fill:"transparent",stroke:"#0095ff",strokeDasharray:"3,3",hover:{stroke:"#0095ff"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"},background:!1,grid:{size:10,visible:!1,type:"dot",config:{color:"#ababab",thickness:1}}};function s(){o.value=new p8({container:i.value,stopZoomGraph:!1,allowResize:!0,adjustEdgeStartAndEnd:!0,nodeTextDraggable:!0,nodeTextEdit:!1,edgeTextEdit:!1,grid:!1,metaKeyMultipleSelected:!0,keyboard:{enabled:!0},snapline:!0,stopScrollGraph:!1,plugins:[I8,Y8,r5,o5,i5,Mx,pF]}),o.value.setTheme(a),O$(o.value,n),o.value.setPatternItems([{type:"bpmn:startEvent",label:n("bpmn.startName"),text:n("bpmn.startName"),properties:{"camunda:transName":"bpmn.startName"},icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDQ4IDQ4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxjaXJjbGUgY3g9IjI0IiBjeT0iMjQiIHI9IjIwIiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iNCIvPjwvc3ZnPg=="},{type:"bpmn:userTask",label:n("bpmn.userTaskName"),text:n("bpmn.userTaskName"),properties:{"camunda:transName":"bpmn.userTaskName"},icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDQ4IDQ4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yNCAyMEMyNy44NjYgMjAgMzEgMTYuODY2IDMxIDEzQzMxIDkuMTM0MDEgMjcuODY2IDYgMjQgNkMyMC4xMzQgNiAxNyA5LjEzNDAxIDE3IDEzQzE3IDE2Ljg2NiAyMC4xMzQgMjAgMjQgMjBaIiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHBhdGggZD0iTTYgNDAuOFY0Mkg0MlY0MC44QzQyIDM2LjMxOTYgNDIgMzQuMDc5NCA0MS4xMjgxIDMyLjM2ODFDNDAuMzYxMSAzMC44NjI4IDM5LjEzNzIgMjkuNjM4OSAzNy42MzE5IDI4Ljg3MTlDMzUuOTIwNiAyOCAzMy42ODA0IDI4IDI5LjIgMjhIMTguOEMxNC4zMTk2IDI4IDEyLjA3OTQgMjggMTAuMzY4MSAyOC44NzE5QzguODYyNzggMjkuNjM4OSA3LjYzODkzIDMwLjg2MjggNi44NzE5NSAzMi4zNjgxQzYgMzQuMDc5NCA2IDM2LjMxOTYgNiA0MC44WiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9IjQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg=="},{type:"bpmn:exclusiveGateway",label:n("bpmn.exclusiveGatewayName"),properties:{"camunda:transName":"bpmn.exclusiveGatewayName"},icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDQ4IDQ4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yMi43OTkyIDQuMjAxMDJMNC40MTQ0IDIyLjU4NThDMy42MzMzNiAyMy4zNjY4IDMuNjMzMzUgMjQuNjMzMiA0LjQxNDQgMjUuNDE0MkwyMi43OTkyIDQzLjc5OUMyMy41ODAyIDQ0LjU4IDI0Ljg0NjYgNDQuNTggMjUuNjI3NiA0My43OTlMNDQuMDEyNCAyNS40MTQyQzQ0Ljc5MzQgMjQuNjMzMiA0NC43OTM0IDIzLjM2NjggNDQuMDEyNCAyMi41ODU4TDI1LjYyNzYgNC4yMDEwMkMyNC44NDY2IDMuNDE5OTcgMjMuNTgwMiAzLjQxOTk3IDIyLjc5OTIgNC4yMDEwMloiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzMyIgc3Ryb2tlLXdpZHRoPSI0IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHBhdGggZD0iTTE4LjA0MyAyOS45ODcxTDMwLjA0MjcgMTguMDI0OSIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9IjQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjxwYXRoIGQ9Ik0xOC4wNTI3IDE4LjAxNTZMMzAuMDMzNyAyOS45OTY1IiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PC9zdmc+"},{type:"bpmn:endEvent",label:n("bpmn.endName"),text:n("bpmn.endName"),properties:{"camunda:transName":"bpmn.endName"},icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDQ4IDQ4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxjaXJjbGUgY3g9IjI0IiBjeT0iMjQiIHI9IjIwIiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PGNpcmNsZSBjeD0iMjQiIGN5PSIyNCIgcj0iMTIiIHN0cm9rZT0iIzMzMyIgc3Ryb2tlLXdpZHRoPSI0IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48L3N2Zz4="}]),o.value.setMenuConfig({nodeMenu:[{text:n("bpmn.delete"),"camunda:transName":"bpmn.delete",disabled:!1,callback(h){var v;(v=o.value)==null||v.deleteNode(h.id)}},{text:n("bpmn.copy"),"camunda:transName":"bpmn.copy",callback(h){var v;(v=o.value)==null||v.cloneNode(h.id)}}],edgeMenu:[{text:n("bpmn.delete"),"camunda:transName":"bpmn.delete",disabled:!1,callback(h){var v;(v=o.value)==null||v.deleteEdge(h.id)}}]}),o.value.render({})}function l(){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
170
|
+
<bpmn:definitions id="Definitions_990e5cb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" targetNamespace="http://logic-flow.org" exporter="logicflow" exporterVersion="1.2.0" xmlns:camunda="http://camunda.org/schema/1.0/bpmn">
|
|
171
|
+
<bpmn:process isExecutable="true" >
|
|
172
|
+
<bpmn:startEvent id="Event_ab18b5a" name="bpmn.startName" camunda:transName="bpmn.startName" width="36" height="36"/>
|
|
173
|
+
</bpmn:process>
|
|
174
|
+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
|
|
175
|
+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_ad3c4e1">
|
|
176
|
+
<bpmndi:BPMNShape id="Event_ab18b5a_di" bpmnElement="Event_ab18b5a">
|
|
177
|
+
<dc:Bounds x="222" y="252" width="40" height="40"/>
|
|
178
|
+
<bpmndi:BPMNLabel>
|
|
179
|
+
<dc:Bounds x="187" y="305" width="110" height="14"/>
|
|
180
|
+
</bpmndi:BPMNLabel>
|
|
181
|
+
</bpmndi:BPMNShape>
|
|
182
|
+
</bpmndi:BPMNPlane>
|
|
183
|
+
</bpmndi:BPMNDiagram>
|
|
184
|
+
</bpmn:definitions>
|
|
185
|
+
`}let u=p.ref({});function c(){Gt.getBpmnXml({code:r.data.code}).then(h=>{var v;if(h.code===0){const g=h.result.text,x=new DOMParser().parseFromString(g,"text/xml").getElementsByTagName("bpmn:process")[0];if(x){const E={};for(let b=0;b<x.attributes.length;b++){const T=x.attributes[b];E[T.name]=T.value}console.log("原始 process 属性:",u),u.value=E,console.log("提取的 process 属性:",u)}(v=o.value)==null||v.render(zx(g,n)),p.nextTick(()=>{const{eventCenter:E}=o.value.graphModel;E.emit("blank:click",{})})}})}function d(h){u.value=Object.assign({},u.value,h),console.log("processAttrs",u.value)}p.onMounted(()=>{s(),r.data.code?c():(o.value.render(zx(l(),n)),p.nextTick(()=>{const{eventCenter:h}=o.value.graphModel;h.emit("blank:click",{})}))}),p.onUnmounted(()=>{o.value.destroy()});function f(){return I$(o.value.getGraphData(),u.value)}return e({saveXML:f}),(h,v)=>(p.openBlock(),p.createElementBlock("div",H$,[p.createElementVNode("div",{id:"graph",ref_key:"container",ref:i},null,512),p.createVNode(C$,{lfRef:p.unref(o),isEdit:t.data.opType==="2",processAttrs:p.unref(u),onChangeProcess:d},null,8,["lfRef","isEdit","processAttrs"])]))}}),[["__scopeId","data-v-248ac0b1"]]),W$={class:"icon",viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em"};function U$(t,e){return p.openBlock(),p.createElementBlock("svg",W$,e[0]||(e[0]=[p.createElementVNode("path",{fill:"currentColor",d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281l360-281.1c3.8-3 6.1-7.7 6.1-12.6"},null,-1)]))}const V$=p.markRaw({name:"ant-design-left",render:U$}),X$={class:"container"},G$={class:"viewer-container"},Y$=Qr(p.defineComponent({__name:"BpmnEditPage",props:{data:{type:Object,required:!0}},setup(t){const{t:e}=Dn.useI18n(),n=t,r=p.computed(()=>{const l=n.data.opType||"1";if(l==="1")return e("bpmn.add_workflow");if(l==="2")return e("bpmn.edit_workflow");if(l==="3")return e("bpmn.clone_workflow")}),i=p.inject(cl);function o(){i==null||i.emit("changeComp",{comp:"BusTypeList"})}const a=p.ref();function s(){var f;const l=(f=a.value)==null?void 0:f.saveXML();if(!l)return;const u={type:n.data.type,text:l};((n.data.opType||"1")==="2"?Gt.bpmnUpdate(u):Gt.bpmnInsert(u)).then(h=>{h.code===0&&(i==null||i.emit("changeComp",{comp:"BusTypeList"}))})}return(l,u)=>{const c=V$,d=ie.Button,f=ie.Space,h=ie.PageHeader,v=z$;return p.openBlock(),p.createElementBlock("div",X$,[p.createVNode(h,{class:"page-header-sticky",title:p.unref(r),onBack:o},{backIcon:p.withCtx(()=>[p.createVNode(c)]),extra:p.withCtx(()=>[p.createVNode(f,null,{default:p.withCtx(()=>[p.createVNode(d,{type:"default",onClick:o},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.$t("common.btn_cancel")),1)]),_:1}),p.createVNode(d,{type:"primary",onClick:s},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.$t("common.btn_ok")),1)]),_:1})]),_:1})]),_:1},8,["title"]),p.createElementVNode("div",G$,[p.createVNode(v,{ref_key:"bpmnViewer",ref:a,data:t.data},null,8,["data"])])])}}}),[["__scopeId","data-v-832ed055"]]),K$={class:"wrapper"},q$=Qr(p.defineComponent({components:{BusTypeList:jI,BpmnEditPage:Y$},__name:"index",setup(t){const e=p.ref("BusTypeList"),n=p.ref(),r=pE(cl);return p.provide(cl,r),r.on((i,o)=>{i==="changeComp"&&(e.value=o.comp,n.value=o)}),(i,o)=>{const a=mE;return p.openBlock(),p.createBlock(a,null,{default:p.withCtx(()=>[p.createElementVNode("div",K$,[(p.openBlock(),p.createBlock(p.KeepAlive,{include:"BusTypeList"},[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(p.unref(e)),{data:p.unref(n)},null,8,["data"]))],1024))])]),_:1})}}}),[["__scopeId","data-v-82fb5b00"]]);Kp.createPinia();function Z$(t){nc().setLang(t)}function J$(t,e){const{i18n:n,pinia:r,theme:i}=e;Xx(n);const o=nc();o.setTheme(i),o.setupLangWatcher()}const Q$={install:J$};pt.WfManagePage=q$,pt.default=Q$,pt.setWorkflowLang=Z$,Object.defineProperties(pt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|