@jylups/flowable-bpmn-js 0.0.0-stage → 0.0.0

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.
Files changed (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +282 -2
  3. package/assets/flowable-bpmn-js-touch.css +76 -0
  4. package/assets/flowable-bpmn-js.css +70 -0
  5. package/dist/assets/bpmn-font/css/bpmn-codes.css +110 -0
  6. package/dist/assets/bpmn-font/css/bpmn-embedded.css +168 -0
  7. package/dist/assets/bpmn-font/css/bpmn.css +166 -0
  8. package/dist/assets/bpmn-font/font/bpmn.eot +0 -0
  9. package/dist/assets/bpmn-font/font/bpmn.svg +228 -0
  10. package/dist/assets/bpmn-font/font/bpmn.ttf +0 -0
  11. package/dist/assets/bpmn-font/font/bpmn.woff +0 -0
  12. package/dist/assets/bpmn-font/font/bpmn.woff2 +0 -0
  13. package/dist/assets/bpmn-js-bpmnlint.css +263 -0
  14. package/dist/assets/bpmn-js.css +151 -0
  15. package/dist/assets/diagram-js.css +1325 -0
  16. package/dist/assets/flowable-bpmn-js-touch.css +76 -0
  17. package/dist/assets/flowable-bpmn-js.css +70 -0
  18. package/dist/assets/properties-panel.css +1905 -0
  19. package/dist/flowable-bpmn-modeler.development.js +128087 -0
  20. package/dist/flowable-bpmn-modeler.development.js.map +1 -0
  21. package/dist/flowable-bpmn-modeler.production.min.js +348 -0
  22. package/dist/flowable-bpmn-navigated-viewer.development.js +28092 -0
  23. package/dist/flowable-bpmn-navigated-viewer.development.js.map +1 -0
  24. package/dist/flowable-bpmn-navigated-viewer.production.min.js +2 -0
  25. package/dist/flowable-bpmn-viewer.development.js +26751 -0
  26. package/dist/flowable-bpmn-viewer.development.js.map +1 -0
  27. package/dist/flowable-bpmn-viewer.production.min.js +2 -0
  28. package/index.d.ts +107 -0
  29. package/index.js +32 -0
  30. package/lib/Modeler.js +68 -0
  31. package/lib/NavigatedViewer.js +30 -0
  32. package/lib/NewDiagram.js +69 -0
  33. package/lib/Theme.js +32 -0
  34. package/lib/Viewer.js +32 -0
  35. package/lib/distro/Modeler.js +5 -0
  36. package/lib/distro/NavigatedViewer.js +5 -0
  37. package/lib/distro/Viewer.js +5 -0
  38. package/lib/draw/TypedTaskRenderer.js +81 -0
  39. package/lib/draw/index.js +10 -0
  40. package/lib/features/touch/InputTracker.js +34 -0
  41. package/lib/features/touch/LICENSE +21 -0
  42. package/lib/features/touch/TouchContextPad.js +197 -0
  43. package/lib/features/touch/TouchInteraction.js +1276 -0
  44. package/lib/features/touch/TouchLabelEditing.js +60 -0
  45. package/lib/features/touch/index.js +40 -0
  46. package/lib/features/typed-tasks/ReplaceWithTypedTaskHandler.js +63 -0
  47. package/lib/features/typed-tasks/TypedTaskPaletteProvider.js +76 -0
  48. package/lib/features/typed-tasks/TypedTaskReplaceMenuProvider.js +71 -0
  49. package/lib/features/typed-tasks/TypedTasks.js +127 -0
  50. package/lib/features/typed-tasks/icons.js +99 -0
  51. package/lib/features/typed-tasks/index.js +17 -0
  52. package/lib/lint/FlowableLinting.js +23 -0
  53. package/lib/lint/index.js +44 -0
  54. package/lib/lint/module.js +15 -0
  55. package/lib/lint/rules/called-element.js +19 -0
  56. package/lib/lint/rules/service-task-implementation.js +81 -0
  57. package/lib/lint/rules/valid-durations.js +102 -0
  58. package/lib/lint/values.js +71 -0
  59. package/lib/xml/FlowableXML.js +50 -0
  60. package/lib/xml/index.js +6 -0
  61. package/package.json +80 -4
@@ -0,0 +1,348 @@
1
+ /*! @jylups/flowable-bpmn-js 0.0.0 | MIT | bpmn-js (c) Camunda Services GmbH, bpmn.io license; keep the bpmn.io watermark visible */
2
+ var FlowableBpmnJS=function(){"use strict";function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,i={exports:{}};var r=function(){if(n)return i.exports;n=1;var e=i.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var i=Math.log(Math.pow(2,t))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,t/r))/Math.log(n)*r;var o=i-Math.floor(i),s="";for(r=0;r<Math.floor(i);r++){s=Math.floor(Math.random()*n).toString(n)+s}if(o){var a=Math.pow(n,o);s=Math.floor(Math.random()*a).toString(n)+s}var l=parseInt(s,n);return l!==1/0&&l>=Math.pow(2,t)?e(t,n):s};return e.rack=function(t,n,i){var r=function(r){var s=0;do{if(s++>10){if(!i)throw new Error("too many ID collisions, use more bits");t+=i}var a=e(t,n)}while(Object.hasOwnProperty.call(o,a));return o[a]=r,a},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=t||128,r.base=n||16,r},i.exports}(),o=t(r);function s(e){if(!(this instanceof s))return new s(e);e=e||[128,36,1],this._seed=e.length?o.rack(e[0],e[1],e[2]):e}function a(e){return Array.prototype.concat.apply([],e)}s.prototype.next=function(e){return this._seed(e||!0)},s.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},s.prototype.claim=function(e,t){this._seed.set(e,t||!0)},s.prototype.assigned=function(e){return this._seed.get(e)||!1},s.prototype.unclaim=function(e){delete this._seed.hats[e]},s.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};const l=Object.prototype.toString,c=Object.prototype.hasOwnProperty;function u(e){return void 0===e}function p(e){return void 0!==e}function h(e){return null==e}function d(e){return"[object Array]"===l.call(e)}function f(e){return"[object Object]"===l.call(e)}function m(e){return"[object Number]"===l.call(e)}function g(e){const t=l.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function v(e){return"[object String]"===l.call(e)}function y(e){if(!d(e))throw new Error("must supply array")}function b(e,t){return!h(e)&&c.call(e,t)}function w(e,t){const n=N(t);let i;return E(e,function(e,t){if(n(e,t))return i=e,!1}),i}function x(e,t){const n=N(t);let i=d(e)?-1:void 0;return E(e,function(e,t){if(n(e,t))return i=t,!1}),i}function _(e,t){const n=N(t);let i=[];return E(e,function(e,t){n(e,t)&&i.push(e)}),i}function E(e,t){let n,i;if(u(e))return;const r=d(e)?j:z;for(let o in e)if(b(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function S(e,t){if(u(e))return[];y(e);const n=N(t);return e.filter(function(e,t){return!n(e,t)})}function k(e,t,n){return E(e,function(e,i){n=t(n,e,i)}),n}function O(e,t){return!!k(e,function(e,n,i){return e&&t(n,i)},!0)}function C(e,t){return!!w(e,t)}function P(e,t){let n=[];return E(e,function(e,i){n.push(t(e,i))}),n}function A(e){return e&&Object.keys(e)||[]}function T(e){return A(e).length}function R(e){return P(e,e=>e)}function M(e,t,n={}){return t=I(t),E(e,function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)}),n}function $(e,...t){e=I(e);let n={};return E(t,t=>M(t,e,n)),P(n,function(e,t){return e[0]})}const D=$;function B(e,t){t=I(t);let n=[];return E(e,function(e,i){let r=t(e,i),o={d:r,v:e};for(var s=0;s<n.length;s++){let{d:e}=n[s];if(r<e)return void n.splice(s,0,o)}n.push(o)}),P(n,e=>e.v)}function L(e){return function(t){return O(e,function(e,n){return t[n]===e})}}function I(e){return g(e)?e:t=>t[e]}function N(e){return g(e)?e:t=>t===e}function z(e){return e}function j(e){return Number(e)}function V(e,t){let n,i,r,o;function s(n){let s=Date.now(),c=n?0:o+t-s;if(c>0)return a(c);e.apply(r,i),l()}function a(e){n=setTimeout(s,e)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function c(...e){o=Date.now(),i=e,r=this,n||a(t)}return c.flush=function(){n&&s(!0),l()},c.cancel=l,c}function F(e,t){return e.bind(t)}function q(e,...t){return Object.assign(e,...t)}function H(e,t,n){let i=e;return E(t,function(e,r){if("number"!=typeof e&&"string"!=typeof e)throw new Error("illegal key type: "+typeof e+". Key should be of type number or string.");if("constructor"===e)throw new Error("illegal key: constructor");if("__proto__"===e)throw new Error("illegal key: __proto__");let o=t[r+1],s=i[e];p(o)&&h(s)&&(s=i[e]=isNaN(+o)?{}:[]),u(o)?u(n)?delete i[e]:i[e]=n:i=s}),e}function W(e,t,n){let i=e;return E(t,function(e){if(h(i))return i=void 0,!1;i=i[e]}),u(i)?n:i}function Q(e,t){let n={},i=Object(e);return E(t,function(t){t in i&&(n[t]=e[t])}),n}function X(e,t){let n={};return E(Object(e),function(e,i){-1===t.indexOf(i)&&(n[i]=e)}),n}var G=Object.freeze({__proto__:null,assign:q,bind:F,debounce:V,ensureArray:y,every:O,filter:_,find:w,findIndex:x,flatten:a,forEach:E,get:W,groupBy:M,has:b,isArray:d,isDefined:p,isFunction:g,isNil:h,isNumber:m,isObject:f,isString:v,isUndefined:u,keys:A,map:P,matchPattern:L,merge:function e(t,...n){return n.length?(E(n,function(n){n&&f(n)&&E(n,function(n,i){if("__proto__"===i)return;let r=t[i];f(n)?(f(r)||(r={}),t[i]=e(r,n)):t[i]=n})}),t):t},omit:X,pick:Q,reduce:k,set:H,size:T,some:C,sortBy:B,throttle:function(e,t){let n=!1;return function(...i){n||(e(...i),n=!0,setTimeout(()=>{n=!1},t))}},unionBy:D,uniqueBy:$,values:R,without:S});const U={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};function Y(e,t=globalThis.document){if("string"!=typeof e)throw new TypeError("String expected");const n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);const i=/<([\w:]+)/.exec(e)?.[1];if(!i)return t.createTextNode(e);if(e=e.trim(),"body"===i){const n=t.createElement("html");n.innerHTML=e;const{lastChild:i}=n;return i.remove(),i}let[r,o,s]=Object.hasOwn(U,i)?U[i]:U._default,a=t.createElement("div");for(a.innerHTML=o+e+s;r--;)a=a.lastChild;if(a.firstChild===a.lastChild){const{firstChild:e}=a;return e.remove(),e}const l=t.createDocumentFragment();return l.append(...a.childNodes),l}function K(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function Z(e,...t){const n=e.style;return E(t,function(e){e&&E(e,function(e,t){n[t]=e})}),e}function J(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}U.td=U.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],U.option=U.optgroup=[1,'<select multiple="multiple">',"</select>"],U.thead=U.tbody=U.colgroup=U.caption=U.tfoot=[1,"<table>","</table>"],U.polyline=U.ellipse=U.polygon=U.circle=U.text=U.line=U.path=U.rect=U.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];const ee=Object.prototype.toString;function te(e){return new ne(e)}function ne(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ie(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function re(e,t,n){var i=n?e:e.parentNode;return i&&"function"==typeof i.closest&&i.closest(t)||null}function oe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}ne.prototype.add=function(e){return this.list.add(e),this},ne.prototype.remove=function(e){return"[object RegExp]"==ee.call(e)?this.removeMatching(e):(this.list.remove(e),this)},ne.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},ne.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},ne.prototype.array=function(){return Array.from(this.list)},ne.prototype.has=ne.prototype.contains=function(e){return this.list.contains(e)};var se,ae={};var le=function(){if(se)return ae;var e,t,n;function i(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n="addEventListener"!==e?"on":""}return se=1,ae.bind=function(t,r,o,s){return e||i(),t[e](n+r,o,s||!1),o},ae.unbind=function(e,r,o,s){return t||i(),e[t](n+r,o,s||!1),o},ae}(),ce=K({__proto__:null,default:oe(le)},[le]),ue=["focus","blur"];var pe={bind:function(e,t,n,i,r){return-1!==ue.indexOf(n)&&(r=!0),ce.bind(e,n,function(n){var r=n.target||n.srcElement;n.delegateTarget=re(r,t,!0),n.delegateTarget&&i.call(e,n)},r)},unbind:function(e,t,n,i){return-1!==ue.indexOf(t)&&(i=!0),ce.unbind(e,t,n,i)}};function he(e,t){return e&&"function"==typeof e.matches&&e.matches(t)||!1}function de(e,t){return(t=t||document).querySelector(e)}function fe(e,t){return(t=t||document).querySelectorAll(e)}function me(e){e.parentNode&&e.parentNode.removeChild(e)}function ge(e,t){return function(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}(t,e),e}var ve={"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":2,"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":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function ye(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=ve[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function be(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return ve[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);ye(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)ye(e,i,t[i])}(e,t);return e}const we=Object.prototype.toString;function xe(e){return new _e(e)}function _e(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Ee(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Se(e){return e.cloneNode(!0)}_e.prototype.add=function(e){return this.list.add(e),this},_e.prototype.remove=function(e){return"[object RegExp]"==we.call(e)?this.removeMatching(e):(this.list.remove(e),this)},_e.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},_e.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},_e.prototype.array=function(){return Array.from(this.list)},_e.prototype.has=_e.prototype.contains=function(e){return this.list.contains(e)};var ke="http://www.w3.org/2000/svg",Oe='<svg xmlns="'+ke+'"';function Ce(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(ke)&&(e=Oe+e.substring(4)):(e=Oe+">"+e+"</svg>",t=!0);var n=function(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function Pe(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=Ce(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(ke,e),t&&be(n,t),n}var Ae=null;function Te(){return null===Ae&&(Ae=Pe("svg")),Ae}function Re(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Me(e){return Te().createSVGTransform()}var $e=/([&<>]{1})/g,De=/([&<>\n\r"]{1})/g,Be={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Le(e,t){return e.replace(t,function(e,t){return Be[t]||t})}function Ie(e,t){var n,i,r,o,s;switch(e.nodeType){case 3:t.push(Le(e.textContent,$e));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',Le(o.value,De),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(s=e.childNodes).length;n<i;++n)Ie(s.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Le(e.nodeValue,$e),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function Ne(e,t){return function(e){for(var t=e.firstChild,n=[];t;)Ie(t,n),t=t.nextSibling;return n.join("")}(e)}function ze(e){var t=e.parentNode;return t&&t.removeChild(e),e}function je(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Ve(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(je(e,i))}(n,t)),n.consolidate()}const Fe=/^class[ {]/;function qe(e){return Array.isArray(e)}function He(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function We(...e){1===e.length&&qe(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const Qe=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Xe=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Ge=/\/\*([^*]*)\*\//m;function Ue(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return Fe.test(e.toString())}(e)?Qe:Xe);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(e=>{const t=e.match(Ge),[n,i]=e.replace(Ge,"").split("="),r=(t&&t[1]||n).trim();return void 0===i||r.endsWith("?")?r:r+"?"})||[]}function Ye(e,t){const n=t||{get:function(e,t){if(!1!==t)throw i.push(e),a(`No provider for "${e}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),s=o.injector=this,a=function(e){const t=i.join(" -> ");return i.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function l(e,t){const s=e.lastIndexOf("?");if(-1!==s){const t=l(e.slice(0,s),!1),n=e.slice(s+2);if(n&&null==t)return;return n?n.split(".").reduce((e,t)=>e[t],t):t}if(!r[e]&&e.includes(".")){const n=e.split(".");let i=l(n.shift(),t);for(;n.length;){const e=n.shift();i=!1===t?i?.[e]:i[e]}return i}if(He(o,e))return o[e];if(He(r,e)){if(-1!==i.indexOf(e))throw i.push(e),a("Cannot resolve circular dependency!");return i.push(e),o[e]=r[e][0](r[e][1]),i.pop(),o[e]}return n.get(e,t)}function c(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!qe(e))throw a(`Cannot invoke "${e}". Expected a function!`);e=We(e.slice())}return{fn:e,dependencies:(e.$inject||Ue(e)).map(e=>{const n=e.replace(/\?$/,"");return He(t,n)?t[n]:l(e)})}}function u(e){const{fn:t,dependencies:n}=c(e);return new(Function.prototype.bind.call(t,null,...n))}function p(e,t,n){const{fn:i,dependencies:r}=c(e,n);return i.apply(t,r)}function h(e){return We(t=>e.get(t))}function d(e,t){if(t&&t.length){const n=Object.create(null),i=Object.create(null),o=[],s=[],a=[];let l,c,u,p;for(let e in r)l=r[e],-1!==t.indexOf(e)&&("private"===l[2]?(c=o.indexOf(l[3]),-1===c?(u=l[3].createChild([],t),p=h(u),o.push(l[3]),s.push(u),a.push(p),n[e]=[p,e,"private",u]):n[e]=[a[c],e,"private",s[c]]):n[e]=[l[2],l[1]],i[e]=!0),"factory"!==l[2]&&"type"!==l[2]||!l[1].$scope||t.forEach(t=>{-1!==l[1].$scope.indexOf(t)&&(n[e]=[l[2],l[1]],i[t]=!0)});t.forEach(e=>{if(!i[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(n)}return new Ye(e,s)}const f={factory:p,type:u,value:function(e){return e}};function m(e,t){const n=e.__init__||[];return function(){n.forEach(e=>{"string"==typeof e?t.get(e):t.invoke(e)})}}function g(e){const t=e.__exports__;if(t){const n=e.__modules__,i=Object.keys(e).reduce((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t),Object.create(null)),o=d((n||[]).concat(i)),s=We(function(e){return o.get(e)});t.forEach(function(e){r[e]=[s,e,"private",o]});const a=(e.__init__||[]).slice();return a.unshift(function(){o.init()}),m(e=Object.assign({},e,{__init__:a}),o)}return Object.keys(e).forEach(function(t){if("__init__"===t||"__depends__"===t)return;const n=e[t];if("private"===n[2])return void(r[t]=n);const i=n[0],o=n[1];r[t]=[f[i],Ke(i,o),i]}),m(e,s)}function v(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(v,e)).indexOf(t)?e:e.concat(t)}this.get=l,this.invoke=p,this.instantiate=u,this.createChild=d,this.init=function(e){const t=e.reduce(v,[]).map(g);let n=!1;return function(){n||(n=!0,t.forEach(e=>e()))}}(e)}function Ke(e,t){return"value"!==e&&qe(t)&&(t=We(t.slice())),t}function Ze(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,function(e,t){var i=e.type,r=t.element,o=t.gfx,s=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,s):n.drawConnection(o,r,s)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)})}function Je(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function et(e){return["L",e.x,e.y]}function tt(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function nt(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r;for(let r=1;r<n;r++){const n=e[r-1],o=e[r],s=e[r+1];if(!s||!t){i.push(et(o));continue}const a=Math.min(t,rt(o.x-n.x,o.y-n.y),rt(s.x-o.x,s.y-o.y));if(!a){i.push(et(o));continue}const l=it(o,n,a),c=it(o,n,.5*a),u=it(o,s,a),p=it(o,s,.5*a);i.push(et(l)),i.push(tt(c,p,u))}return i}function it(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=n/rt(i,r);return{x:e.x+i*o,y:e.y+r*o}}function rt(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function ot(e,t,n){m(t)&&(n=t,t=null),t||(t={});const i=Pe("path",t);return m(n)&&(i.dataset.cornerRadius=String(n)),st(i,e)}function st(e,t){return be(e,{d:Je(nt(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function at(e){var t=new Set(e);return _(e,function(e){for(var n=e.parent;n;){if(t.has(n))return!1;n=n.parent}return!0})}function lt(e,t,n){n=n||0,d(e)||(e=[e]),E(e,function(e,i){var r=t(e,i,n);d(r)&&r.length&&lt(r,t,n+1)})}function ct(e,t,n){var i=new Set,r=new Set;return lt(e,function(e,t,n){i.add(e);var o=e.children;if(o&&!r.has(o))return r.add(o),o}),Array.from(i)}function ut(e,t){return ct(e)}function pt(e,t,n){u(t)&&(t=!0),f(t)&&(n=t,t=!0);var i=gt((n=n||{}).allShapes),r=gt(n.allConnections),o=gt(n.enclosedElements),s=gt(n.enclosedConnections),a=gt(n.topLevel,t&&M(e,function(e){return e.id}));function l(e){a[e.source.id]&&a[e.target.id]&&(a[e.id]=[e]),i[e.source.id]&&i[e.target.id]&&(s[e.id]=o[e.id]=e),r[e.id]=e}return lt(e,function(e){if(!e.waypoints)return o[e.id]=i[e.id]=e,E(e.incoming,l),E(e.outgoing,l),e.children;r[e.id]=e}),{allShapes:i,allConnections:r,topLevel:a,enclosedConnections:s,enclosedElements:o}}function ht(e,t){var n,i,r,o;return t=!!t,d(e)||(e=[e]),E(e,function(e){var s=e;e.waypoints&&!t&&(s=ht(e.waypoints,!0));var a=s.x,l=s.y,c=s.height||0,u=s.width||0;(a<n||void 0===n)&&(n=a),(l<i||void 0===i)&&(i=l),(a+u>r||void 0===r)&&(r=a+u),(l+c>o||void 0===o)&&(o=l+c)}),{x:n,y:i,height:o-i,width:r-n}}function dt(e,t){var n={};return E(e,function(e){var i=e;i.waypoints&&(i=ht(i)),!m(t.y)&&i.x>t.x&&(n[e.id]=e),!m(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(m(t.width)&&m(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y?n[e.id]=e:m(t.width)&&m(t.height)||(n[e.id]=e))}),n}function ft(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function mt(e){return!(!e||!e.isFrame)}function gt(e,t){return q({},e||{},t||{})}Ze.prototype.canRender=function(e){},Ze.prototype.drawShape=function(e,t){},Ze.prototype.drawConnection=function(e,t){},Ze.prototype.getShapePath=function(e){},Ze.prototype.getConnectionPath=function(e){};function vt(e,t){Ze.call(this,e,1),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})}e(vt,Ze),vt.prototype.canRender=function(){return!0},vt.prototype.drawShape=function(e,t,n){var i=Pe("rect");return be(i,{x:0,y:0,width:t.width||0,height:t.height||0}),mt(t)?be(i,q({},this.FRAME_STYLE,n||{})):be(i,q({},this.SHAPE_STYLE,n||{})),ge(e,i),i},vt.prototype.drawConnection=function(e,t,n){var i=ot(t.waypoints,q({},this.CONNECTION_STYLE,n||{}));return ge(e,i),i},vt.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return Je([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},vt.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return Je(r)},vt.$inject=["eventBus","styles"];var yt={__init__:["defaultRenderer"],defaultRenderer:["type",vt],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return q(this.style(t,n),{class:e})},this.style=function(t,n){d(t)||n||(n=t,t=[]);var i=k(t,function(t,n){return q(t,e[n]||{})},{});return n?q(i,n):i},this.computeStyle=function(e,n,i){return d(n)||(i=n,n=[]),t.style(n||[],q({},i,e||{}))}}]};function bt(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function wt(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function xt(e,t){return e&&t?e.indexOf(t):-1}function _t(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function Et(e,t,n,i){if(void 0===i&&(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=_t(e,t);return Math.abs(r/o)<=i}function St(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[e,t]of Object.entries(i))if(kt(e,n))return t;return!1}function kt(e,t){const n=t[0];return O(t,function(t){return Math.abs(n[e]-t[e])<=2})}function Ot(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 Ct(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var Pt=/,?([a-z]),?/gi,At=parseFloat,Tt=Math,Rt=Tt.PI,Mt=Tt.min,$t=Tt.max,Dt=Tt.pow,Bt=Tt.abs,Lt=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,It=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,Nt="-?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][-+]?\\d+)?",zt="[\\s]*,?[\\s]*",jt=new RegExp("(?=("+Nt+"))\\1"+zt+"(?=("+Nt+"))\\2"+zt+"(?=("+Nt+"))\\3"+zt+"([01])"+zt+"([01])"+zt+"(?=("+Nt+"))\\6"+zt+"(?=("+Nt+"))\\7"+zt,"g"),Vt=Array.isArray||function(e){return e instanceof Array};function Ft(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=[];return String(e).replace(Lt,function(e,i,r){var o=[],s=i.toLowerCase();for(r.replace("a"==s?jt:It,function(){for(var e=1;e<arguments.length-2;e++)arguments[e]&&o.push(+arguments[e])}),"m"==s&&o.length>2&&(n.push([i,...o.splice(0,2)]),s="l",i="m"==i?"l":"L");o.length>=t[s]&&(n.push([i,...o.splice(0,t[s])]),t[s]););}),n.toString=qt,n}function qt(){return this.join(",").replace(Pt,"$1")}function Ht(e,t,n,i,r,o,s,a,l){var c=1-l,u=Dt(c,3),p=Dt(c,2),h=l*l*l,d=u*t+3*p*l*i+3*c*l*l*o+h*a;return{x:Kt(u*e+3*p*l*n+3*c*l*l*r+h*s),y:Kt(d)}}function Wt(e){var t=function(e,t,n,i,r,o,s,a){for(var l,c,u,p,h,d,f,m,g=[],v=[[],[]],y=0;y<2;++y)if(0==y?(c=6*e-12*n+6*r,l=-3*e+9*n-9*r+3*s,u=3*n-3*e):(c=6*t-12*i+6*o,l=-3*t+9*i-9*o+3*a,u=3*i-3*t),Bt(l)<1e-12){if(Bt(c)<1e-12)continue;0<(p=-u/c)&&p<1&&g.push(p)}else f=c*c-4*u*l,m=Tt.sqrt(f),f<0||(0<(h=(-c+m)/(2*l))&&h<1&&g.push(h),0<(d=(-c-m)/(2*l))&&d<1&&g.push(d));var b,w=g.length,x=w;for(;w--;)b=1-(p=g[w]),v[0][w]=b*b*b*e+3*b*b*p*n+3*b*p*p*r+p*p*p*s,v[1][w]=b*b*b*t+3*b*b*p*i+3*b*p*p*o+p*p*p*a;return v[0][x]=e,v[1][x]=t,v[0][x+1]=s,v[1][x+1]=a,v[0].length=v[1].length=x+2,{x0:Mt(...v[0]),y0:Mt(...v[1]),x1:$t(...v[0]),y1:$t(...v[1])}}(...e);return function(e,t,n,i){return 1===arguments.length&&(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}}(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Qt(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Xt(e,t){return Qt(t,e.x,e.y)||Qt(t,e.x2,e.y)||Qt(t,e.x,e.y2)||Qt(t,e.x2,e.y2)||Qt(e,t.x,t.y)||Qt(e,t.x2,t.y)||Qt(e,t.x,t.y2)||Qt(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 Gt(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function Ut(e,t,n,i,r,o,s,a,l){null==l&&(l=1);for(var c=(l=l>1?1:l<0?0:l)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,d=0;d<12;d++){var f=c*u[d]+c,m=Gt(f,e,n,r,s),g=Gt(f,t,i,o,a),v=m*m+g*g;h+=p[d]*Tt.sqrt(v)}return c*h}function Yt(e,t,n,i,r,o,s,a){if(!($t(e,n)<Mt(r,s)||Mt(e,n)>$t(r,s)||$t(t,i)<Mt(o,a)||Mt(t,i)>$t(o,a))){var l=(e*i-t*n)*(o-a)-(t-i)*(r*a-o*s),c=(e-n)*(o-a)-(t-i)*(r-s);if(c){var u=Kt(((e*i-t*n)*(r-s)-(e-n)*(r*a-o*s))/c),p=Kt(l/c),h=+u.toFixed(2),d=+p.toFixed(2);if(!(h<+Mt(e,n).toFixed(2)||h>+$t(e,n).toFixed(2)||h<+Mt(r,s).toFixed(2)||h>+$t(r,s).toFixed(2)||d<+Mt(t,i).toFixed(2)||d>+$t(t,i).toFixed(2)||d<+Mt(o,a).toFixed(2)||d>+$t(o,a).toFixed(2)))return{x:u,y:p}}}}function Kt(e){return Math.round(1e11*e)/1e11}function Zt(e,t,n,i,r){if(!Xt(i=i||Wt(e),r=r||Wt(t)))return[];var o,s,a=Ut(...e),l=Ut(...t),c=tn(e)?1:~~(a/5)||1,u=tn(t)?1:~~(l/5)||1,p=new Array(c+1),h=new Array(u+1),d={},f=[];for(o=0;o<c+1;o++){var m=o/c,g=Ht(...e,m);p[o]={x:g.x,y:g.y,t:m}}for(o=0;o<u+1;o++)m=o/u,g=Ht(...t,m),h[o]={x:g.x,y:g.y,t:m};for(o=0;o<c;o++)for(s=0;s<u;s++){var v,y=p[o],b=p[o+1],w=h[s],x=h[s+1],_=Bt(b.x-y.x)<.01?"y":"x",E=Bt(x.x-w.x)<.01?"y":"x",S=Yt(y.x,y.y,b.x,b.y,w.x,w.y,x.x,x.y);if(S){if(d[v=S.x.toFixed(9)+"#"+S.y.toFixed(9)])continue;d[v]=!0;var k=y.t+Bt((S[_]-y[_])/(b[_]-y[_]))*(b.t-y.t),O=w.t+Bt((S[E]-w[E])/(x[E]-w[E]))*(x.t-w.t);k>=0&&k<=1&&O>=0&&O<=1&&f.push({x:S.x,y:S.y,t1:k,t2:O})}}return f}function Jt(e,t,n){for(var i=en(sn(e)),r=en(sn(t)),o=n?0:[],s=0,a=i.length;s<a;s++)for(var l=i[s],c=0,u=r.length;c<u;c++){var p=r[c];if(Xt(l.bbox,p.bbox))for(var h=Zt(l.bez,p.bez,0,l.bbox,p.bbox),d=0,f=h.length;d<f;d++)h[d].segment1=l.segment,h[d].segment2=p.segment,h[d].bez1=l.bez,h[d].bez2=p.bez,o.push(h[d])}return o}function en(e){for(var t=[],n=0,i=0,r=0,o=0,s=0,a=e.length;s<a;s++){var l,c=e[s];"M"!=c[0]?("C"==c[0]?(l=[n,i,c[1],c[2],c[3],c[4],c[5],c[6]],n=c[5],i=c[6]):(l=[n,i,n,i,r,o,r,o],n=r,i=o),t.push({bez:l,bbox:Wt(l),segment:s})):(n=r=c[1],i=o=c[2])}return t}function tn(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function nn(e,t,n,i){return[e,t,n,i,n,i]}function rn(e,t,n,i,r,o){var s=1/3,a=2/3;return[s*e+a*n,s*t+a*i,s*r+a*n,s*o+a*i,r,o]}function on(e,t,n,i,r,o,s,a,l,c){var u,p=120*Rt/180,h=Rt/180*(+r||0),d=[],f=Tt.cos(h),m=Tt.sin(h),g=function(e,t){return{x:e*f-t*m,y:e*m+t*f}};if(c)k=c[0],O=c[1],E=c[2],S=c[3];else{e=(u=g(e,-t)).x,t=-u.y;var v=(e-(a=(u=g(a,-l)).x))/2,y=(t-(l=-u.y))/2,b=v*v/(n*n)+y*y/(i*i);b>1&&(n*=b=Tt.sqrt(b),i*=b);var w=n*n,x=i*i,_=(o==s?-1:1)*Tt.sqrt(Bt((w*x-w*y*y-x*v*v)/(w*y*y+x*v*v))),E=_*n*y/i+(e+a)/2,S=_*-i*v/n+(t+l)/2,k=Tt.asin(((t-S)/i).toFixed(9)),O=Tt.asin(((l-S)/i).toFixed(9));(k=e<E?Rt-k:k)<0&&(k=2*Rt+k),(O=a<E?Rt-O:O)<0&&(O=2*Rt+O),s&&k>O&&(k-=2*Rt),!s&&O>k&&(O-=2*Rt)}var C=O-k;if(Bt(C)>p){var P=O,A=a,T=l;O=k+p*(s&&O>k?1:-1),d=on(a=E+n*Tt.cos(O),l=S+i*Tt.sin(O),n,i,r,0,s,A,T,[O,P,E,S])}C=O-k;var R=Tt.cos(k),M=Tt.sin(k),$=Tt.cos(O),D=Tt.sin(O),B=Tt.tan(C/4),L=4/3*n*B,I=4/3*i*B,N=[e,t],z=[e+L*M,t-I*R],j=[a+L*D,l-I*$],V=[a,l];if(z[0]=2*N[0]-z[0],z[1]=2*N[1]-z[1],c)return[z,j,V].concat(d);for(var F=[],q=0,H=(d=[z,j,V].concat(d).join().split(",")).length;q<H;q++)F[q]=q%2?g(d[q-1],d[q]).y:g(d[q],d[q+1]).x;return F}function sn(e){if(function(e){return Vt(e)&&Vt(e[0])}(e)||(e=Ft(e)),function(e){for(var t=0,n=e.length;t<n;t++){var i=e[t][0];if("M"!==i&&"C"!==i)return!1}return!0}(e))return e;for(var t=function(e){for(var t=new Array(e.length),n=0,i=e.length;n<i;n++)for(var r=e[n],o=t[n]=new Array(r.length),s=0,a=r.length;s<a;s++)o[s]=r[s];return t.toString=qt,t}(function(e){if(function(e){for(var t=0,n=e.length;t<n;t++){var i=e[t][0];if("string"==typeof i&&i!==i.toUpperCase())return!1}return!0}(e))return e;var t,n=new Array(e.length),i=0,r=0,o=0,s=0,a=0;"M"==e[0][0]&&(o=i=+e[0][1],s=r=+e[0][2],a++,n[0]=["M",i,r]);for(var l,c,u=a,p=e.length;u<p;u++){if(t=(c=e[u])[0],n[u]=l=new Array(c.length),t!=t.toUpperCase())switch(l[0]=t.toUpperCase(),l[0]){case"A":l[1]=c[1],l[2]=c[2],l[3]=c[3],l[4]=c[4],l[5]=c[5],l[6]=+c[6]+i,l[7]=+c[7]+r;break;case"V":l[1]=+c[1]+r;break;case"H":l[1]=+c[1]+i;break;case"M":o=+c[1]+i,s=+c[2]+r;default:for(var h=1,d=c.length;h<d;h++)l[h]=+c[h]+(h%2?i:r)}else for(var f=0,m=c.length;f<m;f++)l[f]=c[f];switch(t=t.toUpperCase(),l[0]){case"Z":i=+o,r=+s;break;case"H":i=l[1];break;case"V":r=l[1];break;case"M":o=l[l.length-2],s=l[l.length-1];default:i=l[l.length-2],r=l[l.length-1]}}return n.toString=qt,n}(e)),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=function(e,t,n){var i,r;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C",...on(t.x,t.y,...e.slice(1))];break;case"S":"C"==n||"S"==n?(i=2*t.x-t.bx,r=2*t.y-t.by):(i=t.x,r=t.y),e=["C",i,r,...e.slice(1)];break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C",...rn(t.x,t.y,t.qx,t.qy,e[1],e[2])];break;case"Q":t.qx=e[1],t.qy=e[2],e=["C",...rn(t.x,t.y,e[1],e[2],e[3],e[4])];break;case"L":e=["C",...nn(t.x,t.y,e[1],e[2])];break;case"H":e=["C",...nn(t.x,t.y,e[1],t.y)];break;case"V":e=["C",...nn(t.x,t.y,t.x,e[1])];break;case"Z":e=["C",...nn(t.x,t.y,t.X,t.Y)]}return e},r=function(e,n){if(e[n].length>7){e[n].shift();for(var i=e[n];i.length;)o[n]="A",e.splice(n++,0,["C",...i.splice(0,6)]);e.splice(n,1),c=t.length}},o=[],s="",a="",l=0,c=t.length;l<c;l++){t[l]&&(s=t[l][0]),"C"!=s&&(o[l]=s,l&&(a=o[l-1])),t[l]=i(t[l],n,a),"A"!=o[l]&&"C"==s&&(o[l]="C"),r(t,l);var u=t[l],p=u.length;n.x=u[p-2],n.y=u[p-1],n.bx=At(u[p-4])||n.x,n.by=At(u[p-3])||n.y}return t}function an(e){return f(e)&&b(e,"waypoints")}function ln(e){return f(e)&&b(e,"labelTarget")}function cn(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function un(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function pn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function hn(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function dn(e){for(var t=e.waypoints,n=t.reduce(function(e,n,i){var r=t[i-1];if(r){var o=e[e.length-1],s=o&&o.endLength||0,a=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}(r,n);e.push({start:r,end:n,startLength:s,endLength:s+a,length:a})}return e},[]),i=n.reduce(function(e,t){return e+t.length},0),r=i/2,o=0,s=n[o];s.endLength<r;)s=n[++o];var a=(r-s.startLength)/s.length;return{x:s.start.x+(s.end.x-s.start.x)*a,y:s.start.y+(s.end.y-s.start.y)*a}}function fn(e){return an(e)?dn(e):un({x:(t=e).x+(t.width||0)/2,y:t.y+(t.height||0)/2});var t}function mn(e,t,n){f(n=n||0)||(n={x:n,y:n});var i=pn(e),r=pn(t),o=i.bottom+n.y<=r.top,s=i.left-n.x>=r.right,a=i.top-n.y>=r.bottom,l=o?"top":a?"bottom":null,c=i.right+n.x<=r.left?"left":s?"right":null;return c&&l?l+"-"+c:c||l||"intersect"}function gn(e,t,n){var i=function(e,t){return Jt(e,t)}(e,t);return 1===i.length||2===i.length&&_t(i[0],i[1])<1?un(i[0]):i.length>1?(i=B(i,function(e){var t=Math.floor(100*e.t2)||1;return t=((t=100-t)<10?"0":"")+t,e.segment2+"#"+t}),un(i[n?0:i.length-1])):null}function vn(e,t){return Math.round(e*t)/t}function yn(e){return m(e)?e+"px":e}function bn(e){for(;e.parent;)e=e.parent;return e}function wn(e,t,n){const i=Pe("g");xe(i).add(t);const r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}const xn={shape:["x","y","width","height"],connection:["waypoints"]};function _n(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||{})}function En(e,t){const n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}_n.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],_n.prototype._init=function(e){const t=this._eventBus,n=this._container=function(e){const t=(e=q({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container djs-parent bio-theme-parent"),Z(n,{position:"relative",overflow:"hidden",width:yn(e.width),height:yn(e.height)}),t.appendChild(n),n}(e),i=this._svg=Pe("svg");be(i,{width:"100%",height:"100%"}),J(i,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,e=>{this.focus()}),i.addEventListener("focusin",()=>{this._setFocused(!0)}),i.addEventListener("focusout",()=>{this._setFocused(!1)}),i.addEventListener("mouseover",()=>{this._eventBus.fire("canvas.mouseover")}),i.addEventListener("mouseout",()=>{this._eventBus.fire("canvas.mouseout")}),ge(n,i);const r=this._viewport=wn(i,"viewport");e.deferUpdate&&(this._viewboxChanged=V(this._viewboxChanged,300)),this._restoreFocus=V(this._restoreFocus,0),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)},_n.prototype._destroy=function(){this._restoreFocus.cancel(),this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},_n.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},_n.prototype._clear=function(){this._elementRegistry.getAll().forEach(e=>{const t=ft(e);"root"===t?this.removeRootElement(e):this._removeElement(e,t)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},_n.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},_n.prototype.restoreFocus=function(){this._restoreFocus()},_n.prototype._restoreFocus=function(){document.activeElement===document.body&&this.focus()},_n.prototype.isFocused=function(){return this._focused},_n.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},_n.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)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},_n.prototype._getChildIndex=function(e){return k(this._layers,function(t,n){return n.visible&&e>=n.index&&t++,t},0)},_n.prototype._createLayer=function(e,t){void 0===t&&(t=1);const n=this._getChildIndex(t);return{group:wn(this._viewport,"layer-"+e,n),index:t,visible:!0}},_n.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},_n.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?(ze(n),t.visible=!1,n):n},_n.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],ze(t.group))},_n.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},_n.prototype.findRoot=function(e){const t=this._resolveElements(e);let n;for(const e of t){const t=this._findPlaneForRoot(bn(e));if(!t)return;if(n&&t.rootElement!==n)return;n=t.rootElement}return n},_n.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},_n.prototype._findPlaneForRoot=function(e){return w(this._planes,function(t){return t.rootElement===e})},_n.prototype._resolveElement=function(e){return"string"==typeof e?this._elementRegistry.get(e):e},_n.prototype._resolveElements=function(e){return d(e)||(e=[e]),e.map(e=>this._resolveElement(e)).filter(Boolean)},_n.prototype.getContainer=function(){return this._container},_n.prototype._updateMarker=function(e,t,n){let i;(e=this._resolveElement(e)).markers=e.markers||new Set,i=this._elementRegistry._elements[e.id],i&&(E([i.gfx,i.secondaryGfx],function(i){i&&(n?(e.markers.add(t),xe(i).add(t)):(e.markers.delete(t),xe(i).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},_n.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},_n.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},_n.prototype.hasMarker=function(e,t){return!!(e=this._resolveElement(e)).markers&&e.markers.has(t)},_n.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},_n.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},_n.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,0);return this.hideLayer(n),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},_n.prototype.removeRootElement=function(e){e=this._resolveElement(e);if(this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(t){return t.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},_n.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},_n.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)},_n.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})},_n.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})},_n.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=xn[e],i=O(n,function(e){return void 0!==t[e]});if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},_n.prototype._setParent=function(e,t,n){wt(t.children,e,n),e.parent=t},_n.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 s=o.create(e,t,i);return this._elementRegistry.add(t,s),o.update(e,t,s),r.fire(e+".added",{element:t,gfx:s}),t},_n.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},_n.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},_n.prototype._removeElement=function(e,t){const n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),bt(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},_n.prototype.removeShape=function(e){return this._removeElement(e,"shape")},_n.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},_n.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},_n.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},_n.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},_n.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,n=this.getSize();let i,r,o,s,a,l,c;return e?(this._changeViewbox(function(){a=Math.min(n.width/e.width,n.height/e.height);const i=this._svg.createSVGMatrix().scale(a).translate(-e.x,-e.y);Ve(t,i)}),e):(o=this._rootElement?this.getActiveLayer():null,i=o&&o.getBBox()||{},s=Ve(t),r=s?s.matrix:function(e,t,n,i,r,o){var s=Te().createSVGMatrix();switch(arguments.length){case 0:return s;case 1:return Re(s,e);case 6:return Re(s,{a:e,b:t,c:n,d:i,e:r,f:o})}}(),a=vn(r.a,1e3),l=vn(-r.e||0,1e3),c=vn(-r.f||0,1e3),e=this._cachedViewbox={x:l?l/a:0,y:c?c/a:0,width:n.width/a,height:n.height/a,scale:a,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:n})},_n.prototype.scroll=function(e){const t=this._viewport;let n=t.getCTM();return e&&this._changeViewbox(function(){e=q({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),En(t,n)}),{x:n.e,y:n.f}},_n.prototype.scrollToElement=function(e,t){let n=100;const i=this._resolveElements(e);if(!i.length)return;const r=this.findRoot(i);if(!r)return;r!==this.getRootElement()&&this.setRootElement(r);const o=i.filter(e=>e!=r);if(!o.length)return;t||(t={}),"number"==typeof t&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};const s=ht(o),a=pn(s),l=this.viewbox(),c=this.zoom();let u,p;l.y+=t.top/c,l.x+=t.left/c,l.width-=(t.right+t.left)/c,l.height-=(t.bottom+t.top)/c;const h=pn(l);if(s.width<l.width&&s.height<l.height){const e=Math.max(0,a.right-h.right),t=Math.min(0,a.left-h.left),n=Math.max(0,a.bottom-h.bottom),i=Math.min(0,a.top-h.top);u=e||t,p=n||i}else u=s.x-l.x,p=s.y-l.y;this.scroll({dx:-u*c,dy:-p*c})},_n.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);let n,i;return this._changeViewbox(function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),vn(i.a,1e3)},_n.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},_n.prototype._setZoom=function(e,t){const n=this._svg,i=this._viewport,r=n.createSVGMatrix(),o=n.createSVGPoint();let s,a,l,c,u;l=i.getCTM();const p=l.a;return t?(s=q(o,t),a=s.matrixTransform(l.inverse()),c=r.translate(a.x,a.y).scale(1/p*e).translate(-a.x,-a.y),u=l.multiply(c)):u=r.scale(e),En(this._viewport,u),u},_n.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},_n.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let n;if(e.waypoints){n=this.getGraphics(e).getBBox()}else n=e;return{x:n.x*t.scale-t.x*t.scale,y:n.y*t.scale-t.y*t.scale,width:n.width*t.scale,height:n.height*t.scale}},_n.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Sn="data-element-id";function kn(e){this._elements={},this._eventBus=e}function On(e,t,n){var i=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e,n){var o=this.indexOf(e);if(void 0===n){if(-1!==o)return;n=this.length}-1!==o&&this.splice(o,1),this.splice(n,0,e),-1===o&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(i){e.set(i,t.inverse,n)})}function Cn(e,t){if(!(this instanceof Cn))return new Cn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}kn.$inject=["eventBus"],kn.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),be(t,Sn,i),n&&be(n,Sn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},kn.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(be(i.gfx,Sn,""),i.secondaryGfx&&be(i.secondaryGfx,Sn,""),delete t[n])},kn.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(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)},kn.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,t&&be(t,Sn,i),t},kn.prototype.get=function(e){var t;t="string"==typeof e?e:e&&be(e,Sn);var n=this._elements[t];return n&&n.element},kn.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},kn.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},kn.prototype.getAll=function(){return this.filter(function(e){return e})},kn.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)})},kn.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},kn.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")},Cn.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?On(this,t,e):function(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(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},Cn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return function(e){return!0===e.__refs_collection}(n)||On(this,t,e),n},Cn.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Cn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Cn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Pn=new Cn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),An=new Cn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Tn=new Cn({name:"attachers",collection:!0},{name:"host"}),Rn=new Cn({name:"outgoing",collection:!0},{name:"source"}),Mn=new Cn({name:"incoming",collection:!0},{name:"target"});function $n(){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)}}),Pn.bind(this,"parent"),An.bind(this,"labels"),Rn.bind(this,"outgoing"),Mn.bind(this,"incoming")}function Dn(){$n.call(this),Pn.bind(this,"children"),Tn.bind(this,"host"),Tn.bind(this,"attachers")}function Bn(){$n.call(this),Pn.bind(this,"children")}function Ln(){Dn.call(this),An.bind(this,"labelTarget")}function In(){$n.call(this),Rn.bind(this,"source"),Mn.bind(this,"target")}e(Dn,$n),e(Bn,Dn),e(Ln,Dn),e(In,$n);var Nn={connection:In,shape:Dn,label:Ln,root:Bn};function zn(){this._uid=12}zn.prototype.createRoot=function(e){return this.create("root",e)},zn.prototype.createLabel=function(e){return this.create("label",e)},zn.prototype.createShape=function(e){return this.create("shape",e)},zn.prototype.createConnection=function(e){return this.create("connection",e)},zn.prototype.create=function(e,t){return(t=q({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=Nn[e];if(!n)throw new Error("unknown type: <"+e+">");return q(new n,t)}(e,t)};var jn="__fn",Vn=Array.prototype.slice;function Fn(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function qn(){}function Hn(e){return e.childNodes[0]}function Wn(e,t,n,i,r){var o=Me();o.setTranslate(t,n);var s=Me();s.setRotate(i||0,0,0);var a=Me();a.setScale(1,1),Ve(e,[o,s,a])}function Qn(e,t,n){var i=Me();i.setTranslate(t,n),Ve(e,i)}function Xn(e,t){var n=Me();n.setRotate(t,0,0),Ve(e,n)}function Gn(e,t){this._eventBus=e,this._elementRegistry=t}Fn.prototype.on=function(e,t,n,i){if(e=d(e)?e:[e],g(t)&&(i=n,n=t,t=1e3),!m(t))throw new Error("priority must be a number");var r=n;i&&((r=F(n,i))[jn]=n[jn]||n);var o=this;e.forEach(function(e){o._addListener(e,{priority:t,callback:r,next:null})})},Fn.prototype.once=function(e,t,n,i){var r=this;if(g(t)&&(i=n,n=t,t=1e3),!m(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var t=n.apply(i,arguments);return r.off(e,o),t}o[jn]=n,this.on(e,t,o)},Fn.prototype.off=function(e,t){e=d(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},Fn.prototype.createEvent=function(e){var t=new qn;return t.init(e),t},Fn.prototype.fire=function(e,t){var n,i,r,o;if(o=Vn.call(arguments),"object"==typeof e&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof qn?t:this.createEvent(t),o[0]=n;var s=n.type;e!==s&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==s&&(n.type=s)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},Fn.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Fn.prototype._destroy=function(){this._listeners={}},Fn.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Fn.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(e,t){return e.apply(null,t)}(n.callback,t),void 0!==i&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener",e),e}return i},Fn.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},Fn.prototype._getListeners=function(e){return this._listeners[e]},Fn.prototype._setListeners=function(e,t){this._listeners[e]=t},Fn.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[jn]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},qn.prototype.stopPropagation=function(){this.cancelBubble=!0},qn.prototype.preventDefault=function(){this.defaultPrevented=!0},qn.prototype.init=function(e){q(this,e||{})},Gn.$inject=["eventBus","elementRegistry"],Gn.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n),t||(xe(t=Pe("g")).add("djs-children"),ge(n.parentNode,t))):t=n,t},Gn.prototype._clear=function(e){var t=Hn(e);return ie(t),t},Gn.prototype._createContainer=function(e,t,n,i){var r=Pe("g");xe(r).add("djs-group"),void 0!==n?function(e,t,n){var i=n||t.firstChild;if(e===i)return;t.insertBefore(e,i)}(r,t,t.childNodes[n]):ge(t,r);var o=Pe("g");xe(o).add("djs-element"),xe(o).add("djs-"+e),i&&xe(o).add("djs-frame"),ge(r,o);var s=Pe("g");return xe(s).add("djs-visual"),ge(o,s),o},Gn.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,mt(t))},Gn.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=k(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),E(t,function(e){var t=e.children;if(t){var r=n._getChildrenContainer(e),o=r.firstChild;E(t,function(e){var t=i.getGraphics(e).parentNode;t===o?o=o.nextSibling:r.insertBefore(t,o)})}})},Gn.prototype.drawShape=function(e,t,n={}){return this._eventBus.fire("render.shape",{gfx:e,element:t,attrs:n})},Gn.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Gn.prototype.drawConnection=function(e,t,n={}){return this._eventBus.fire("render.connection",{gfx:e,element:t,attrs:n})},Gn.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Gn.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),Qn(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?be(n,"display","none"):be(n,"display","block")}},Gn.prototype.remove=function(e){ze(this._elementRegistry.getGraphics(e).parentNode)};var Un={__depends__:[yt],__init__:["canvas"],canvas:["type",_n],elementRegistry:["type",kn],elementFactory:["type",zn],eventBus:["type",Fn],graphicsFactory:["type",Gn]};function Yn(e){return function(e){var t=new Ye(e);return t.init(),t}([{config:["value",e=e||{}]},Un].concat(e.modules||[]))}function Kn(e,t){this._injector=t||Yn(e),this.get("eventBus").fire("diagram.init")}function Zn(){}function Jn(e,t){this.model=e,this.properties=t}Kn.prototype.get=function(e,t){return this._injector.get(e,t)},Kn.prototype.invoke=function(e,t,n){return this._injector.invoke(e,t,n)},Kn.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Kn.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Zn.prototype.get=function(e){return this.$model.properties.get(this,e)},Zn.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Jn.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Zn.prototype);E(e.properties,function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function o(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),E(e,F(function(e,t){this.set(t,e)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var ei=q(Object.create(null),{String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0}),ti=q(Object.create(null),{String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}});function ni(e,t){var n=ti[e];return n?n(t):t}function ii(e){return!!ei[e]}function ri(e){return!!ti[e]}function oi(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function si(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName=Object.create(null),this.properties=[],this.propertiesByName=Object.create(null)}function ai(e,t){this.packageMap=Object.create(null),this.typeMap=Object.create(null),this.packages=[],this.properties=t,E(e,F(this.registerPackage,this))}function li(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function ci(e){this.model=e}function ui(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function pi(e){return e.replace(/^:/,"")}function hi(e,t={}){this.properties=new ci(this),this.factory=new Jn(this,this.properties),this.registry=new ai(e,this.properties),this.typeCache=Object.create(null),this.config=t}si.prototype.build=function(){return Q(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},si.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},si.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,s=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 a=r.indexOf(e);if(-1===a)throw new Error("property <"+i.name+"> not found in property list");r.splice(a,1),this.addProperty(t,n?void 0:a,s),o[i.name]=o[i.localName]=t},si.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=oi(r[0],i),s=oi(r[1],o.prefix).name,a=this.propertiesByName[s];if(!a)throw new Error("refined property <"+s+"> not found");this.replaceProperty(a,e,n),delete e.redefines},si.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},si.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},si.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},si.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},si.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw new Error(`cannot create <${e.name}> extending <${e.extends}>`)},si.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")},si.prototype.hasProperty=function(e){return this.propertiesByName[e]},si.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(E(e.properties,F(function(n){n=q({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))},this)),i.push(e),n[r]=e)},ai.prototype.getPackage=function(e){return this.packageMap[e]},ai.prototype.getPackages=function(){return this.packages},ai.prototype.registerPackage=function(e){e=q({},e);var t=this.packageMap;li(t,e,"prefix"),li(t,e,"uri"),E(e.types,F(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},ai.prototype.registerType=function(e,t){var n=oi((e=q({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:q({},e.meta||{})})).name,t.prefix),i=n.name,r=Object.create(null);E(e.properties,F(function(e){var t=oi(e.name,n.prefix),i=t.name;ii(e.type)||(e.type=oi(e.type,t.prefix).name),q(e,{ns:t,name:i}),r[i]=e},this)),q(e,{ns:n,name:i,propertiesByName:r}),E(e.extends,F(function(e){var t=oi(e,n.prefix),r=this.typeMap[t.name];r.traits=r.traits||[],r.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},ai.prototype.mapTypes=function(e,t,n){var i=ii(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(n,i){var o=oi(n,ii(n)?"":e.prefix);r.mapTypes(o,t,i)}function s(e){return o(e,!0)}if(!i)throw new Error("unknown type <"+e.name+">");E(i.superClass,n?s:function(e){return o(e,!1)}),t(i,!n),E(i.traits,s)},ai.prototype.getEffectiveDescriptor=function(e){var t=oi(e),n=new si(t);this.mapTypes(t,function(e,t){n.addTrait(e,t)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},ai.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},ci.prototype.set=function(e,t,n){if(!v(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.getProperty(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[pi(t)]:i?r in e?e[r]=n:ui(e,i,n):e.$attrs[pi(t)]=n},ci.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[pi(t)];var i=n.name;return!e[i]&&n.isMany&&ui(e,n,[]),e[i]},ci.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=q({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},ci.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},ci.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},ci.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(void 0!==r){const n=new TypeError(`unknown property <${t}> on <${e.$type}>`);if(r)throw n;"undefined"!=typeof console&&console.warn(n)}return null},hi.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},hi.prototype.getType=function(e){var t=this.typeCache,n=v(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},hi.prototype.createAny=function(e,t,n){var i=oi(e),r={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){H(this,[e],t)}},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}),E(n,function(e,t){f(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e}),r},hi.prototype.getPackage=function(e){return this.registry.getPackage(e)},hi.prototype.getPackages=function(){return this.registry.getPackages()},hi.prototype.getElementDescriptor=function(e){return e.$descriptor},hi.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},hi.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},hi.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var di=String.fromCharCode,fi=Object.prototype.hasOwnProperty,mi=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,gi={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function vi(e,t,n,i){return i?fi.call(gi,i)?gi[i]:"&"+i+";":di(t||parseInt(n,16))}function yi(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(mi,vi):e}Object.keys(gi).forEach(function(e){gi[e.toUpperCase()]=gi[e]});var bi="non-whitespace outside of root node";function wi(e){return new Error(e)}function xi(e){return{get:e,enumerable:!0}}function _i(e,t,n,i){n in t||(t[n]=n in e?e[n]:null),e[n]=i}function Ei(e,t){var n,i;for(n in t)null===(i=t[n])?delete e[n]:e[n]=i}function Si(e){return e+"$uri"}function ki(){return{line:0,column:0}}function Oi(e){throw e}function Ci(e){if(!this)return new Ci(e);var t,n,i,r,o,s,a,l,c,u,p,h,d=e&&e.proxy,f=Oi,m=ki,g=!1,v=!1,y="",b=!1,w=!1,x=null,_=!1;function E(e){e instanceof Error||(e=wi(e)),x=e,f(e,m)}function S(e){o&&(e instanceof Error||(e=wi(e)),o(e,m))}function k(){c=w?[]:null,u=w?function(e){var t,n,i=Object.create(null);for(t in e)i[n=e[t]]=n,i[Si(n)]=t;return i}(h):null,p=[],m=ki,_=!1,x=null,v=!1,y=""}function O(e,o=!1){var f,g,y,x,k,O,C,P,A,T,R,M,$=null,D=0,B=!1,L=!1,I=0,N=0,z="",j=0;function V(e,t){var n=e.indexOf(":");if(-1===n)return e;var i=u[e.substring(0,n)];return i?t===i?e.substr(n+1):i+e.substr(n):(S(function(e){return"missing namespace for prefix <"+e+">"}(e.substring(0,n))),null)}function F(){if(null!==M)return M;var e,t,n,i,r,o,s,a,l,c=w&&u.xmlns,p=w&&b?[]:null,d=j,m=z,v=m.length,y={},x=new Set;e:for(;d<v;d++)if(s=!1,!(32===(a=m.charCodeAt(d))||a<14&&a>8)){for((a<65||a>122||a>90&&a<97)&&95!==a&&58!==a&&(S("illegal first char attribute name"),s=!0),l=d+1;l<v;l++)if(!((a=m.charCodeAt(l))>96&&a<123||a>64&&a<91||a>47&&a<59||46===a||45===a||95===a)){if(32===a||a<14&&a>8){S("missing attribute value"),d=l;continue e}if(61===a)break;S("illegal attribute name char"),s=!0}if("xmlns:xmlns"===(o=m.substring(d,l))&&(S("illegal declaration of xmlns"),s=!0),34===(a=m.charCodeAt(l+1)))-1===(l=m.indexOf('"',d=l+2))&&-1!==(l=m.indexOf("'",d))&&(S("attribute value quote missmatch"),s=!0);else if(39===a)-1===(l=m.indexOf("'",d=l+2))&&-1!==(l=m.indexOf('"',d))&&(S("attribute value quote missmatch"),s=!0);else for(S("missing attribute value quotes"),s=!0,l+=1;l<v&&!(32===(a=m.charCodeAt(l+1))||a<14&&a>8);l++);for(-1===l&&(S("missing closing quotes"),l=v,s=!0),s||(i=m.substring(d,l)),"xmlns:xml"===o&&"http://www.w3.org/XML/1998/namespace"!==i&&E("illegal value of xmlns:xml"),d=l;l+1<v&&!(32===(a=m.charCodeAt(l+1))||a<14&&a>8);l++)d===l&&(S("illegal character after attribute end"),s=!0);if(d=l+1,!s)if(x.has(o))S("attribute <"+o+"> already defined");else if(x.add(o),w)if(b){if(null!==(n="xmlns"===o?"xmlns":120===o.charCodeAt(0)&&"xmlns:"===o.substr(0,6)?o.substr(6):null)){if(e=yi(i),t=Si(n),!(r=h[e])){if("xmlns"===n||t in u&&u[t]!==e)do{r="ns"+D++}while(void 0!==u[r]);else r=n;h[e]=r}u[n]!==r&&(f||(f=Object.create(null)),$=null,g=null,_i(u,f,n,r),"xmlns"===n&&(_i(u,f,Si(r),e),c=r),_i(u,f,t,e)),y[o]=i;continue}p.push(o,i)}else null!==(o=V(o,c))&&(y[o]=i);else y[o]=i}if(b)for(d=0,v=p.length;d<v;d++)o=V(p[d++],c),i=p[d],null!==o&&(y[o]=i);return M=y}for(m=function(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,o=0,s=0,a=N;I>=s&&(t=i.exec(e))&&!((a=t[0].length+t.index)>I);)r+=1,s=a;return-1==I?(o=a,n=e.substring(N)):0===N?n=e.substring(N,I):(o=I-s,n=-1==N?e.substring(I):e.substring(I,N+1)),{data:n,line:r,column:o}},d&&(R=Object.create({},{name:xi(function(){return A}),originalName:xi(function(){return T}),attrs:xi(F),ns:xi(function(){return g||(g=Object.assign(Object.create(null),u)),g})}));-1!==N;){if(-1===(I=60===e.charCodeAt(N)?N:e.indexOf("<",N)))return o?e.substring(N):p.length?E("unexpected end of file"):v?void(N<e.length&&e.substring(N).trim()&&S(bi)):E("missing start tag");if(v||(v=!0),N!==I)if(p.length){if(t&&(t(e.substring(N,I),yi,m),_))return}else if(e.substring(N,I).trim()&&(S(bi),_))return;if(33===(O=e.charCodeAt(I+1))){if(91===(k=e.charCodeAt(I+2))&&"CDATA["===e.substr(I+3,6)){if(-1===(N=e.indexOf("]]>",I)))return o?e.substring(I):E("unclosed cdata");if(r&&(r(e.substring(I+9,N),m),_))return;N+=3;continue}if(45===k&&45===e.charCodeAt(I+3)){if(-1===(N=e.indexOf("--\x3e",I)))return o?e.substring(I):E("unclosed comment");if(s&&(s(e.substring(I+4,N),yi,m),_))return;N+=3;continue}}if(63!==O){for(y=I+1;;y++){if(C=e.charCodeAt(y),isNaN(C))return o?e.substring(I):(N=-1,E("unclosed tag"));if(34===C)y=-1!==(k=e.indexOf('"',y+1))?k:y;else if(39===C)y=-1!==(k=e.indexOf("'",y+1))?k:y;else if(62===C){N=y;break}}if(33!==O){if(M={},47===O){if(B=!1,L=!0,!p.length)return E("missing open tag");if(y=A=p.pop(),k=I+2+y.length,e.substring(I+2,k)!==y)return E("closing tag mismatch");for(;k<N;k++)if(!(32===(O=e.charCodeAt(k))||O>8&&O<14))return E("close tag")}else{if(47===e.charCodeAt(N-1)?(y=A=e.substring(I+1,N-1),B=!0,L=!0):(y=A=e.substring(I+1,N),B=!0,L=!1),!(O>96&&O<123||O>64&&O<91||95===O||58===O))return E("illegal first char nodeName");for(k=1,x=y.length;k<x;k++)if(!((O=y.charCodeAt(k))>96&&O<123||O>64&&O<91||O>47&&O<59||45===O||95===O||46==O)){if(32===O||O<14&&O>8){A=y.substring(0,k),M=null;break}return E("invalid nodeName")}L||p.push(A)}if(w){B&&(f=null,null===M&&(b=-1!==y.indexOf("xmlns",k))&&(j=k,z=y,F(),b=!1),L||c.push(f)),T=A,null===$&&($=Object.create(null));var q=$[A];if(void 0!==q)A=q;else{if(-1!==(O=A.indexOf(":"))){if(!(P=u[A.substring(0,O)]))return E("missing namespace on <"+T+">");A=A.substr(O+1)}else P=u.xmlns;P&&(A=P+":"+A),$[T]=A}}if(B&&(j=k,z=y,n&&(d?n(R,yi,L,m):n(A,F,yi,L,m),_)))return;if(L){if(i&&(i(d?R:A,yi,B,m),_))return;w&&(B||(f=c.pop()),f&&(Ei(u,f),f=null,$=null,g=null))}N+=1}else{if(l&&(l(e.substring(I,N+1),yi,m),_))return;N+=1}}else{if(-1===(N=e.indexOf("?>",I)))return o?e.substring(I):E("unclosed question");if(a&&(a(e.substring(I,N+2),m),_))return;N+=2}}}this.on=function(e,c){if("function"!=typeof c)throw wi("required args <name, cb>");switch(e){case"openTag":n=c;break;case"text":t=c;break;case"closeTag":i=c;break;case"error":f=c;break;case"warn":o=c;break;case"cdata":r=c;break;case"attention":l=c;break;case"question":a=c;break;case"comment":s=c;break;default:throw wi("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw wi("required args <nsMap={}>");var t,n=Object.create(null);for(t in e)n[t]=e[t];return w=!0,h=n,this},this.parse=function(e){if("string"!=typeof e)throw wi("required args <xml=string>");if(g)throw wi("parse during stream; call end() first");return k(),O(e),m=ki,_=!1,x},this.write=function(e){if("string"!=typeof e)throw wi("required args <xml=string>");return g||(k(),g=!0),x||(y=O(y+e,!0)||""),this},this.end=function(){return g||k(),g=!1,x||O(y),y="",m=ki,_=!1,x},this.stop=function(){_=!0}}function Pi(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var Ai={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Ti="property";function Ri(e){return e.xml&&e.xml.serialize}function Mi(e,t){return Pi(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function $i(e){return new Error(e)}function Di(e){return e.$descriptor}function Bi(e){q(this,e),this.elementsById=Object.create(null),this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw $i("expected element");var t,n=this.elementsById,i=Di(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw $i("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Li(){}function Ii(){}function Ni(){}function zi(e,t){this.property=e,this.context=t}function ji(e,t){this.element=t,this.propertyDesc=e}function Vi(){}function Fi(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function qi(e,t,n){Fi.call(this,e,t,n)}function Hi(e,t,n){this.model=e,this.context=n}function Wi(e){e instanceof hi&&(e={model:e}),q(this,{lax:!1},e)}Li.prototype.handleEnd=function(){},Li.prototype.handleText=function(){},Li.prototype.handleNode=function(){},Ii.prototype=Object.create(Li.prototype),Ii.prototype.handleNode=function(){return this},Ni.prototype=Object.create(Li.prototype),Ni.prototype.handleText=function(e){this.body=(this.body||"")+e},zi.prototype=Object.create(Ni.prototype),zi.prototype.handleNode=function(e){if(this.element)throw $i("expected no sub nodes");return this.element=this.createReference(e),this},zi.prototype.handleEnd=function(){this.element.id=this.body},zi.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},ji.prototype=Object.create(Ni.prototype),ji.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=ni(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Vi.prototype=Object.create(Ni.prototype),Vi.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},Fi.prototype=Object.create(Vi.prototype),Fi.prototype.addReference=function(e){this.context.addReference(e)},Fi.prototype.handleText=function(e){if(!Di(this.element).bodyProperty)throw $i("unexpected body text <"+e+">");Ni.prototype.handleText.call(this,e)},Fi.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Di(t).bodyProperty;n&&void 0!==e&&(e=ni(n.type,e),t.set(n.name,e))},Fi.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Di(i),o=this.context,s=new i({}),a=this.model;return E(n,function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?E(e.split(" "),function(e){o.addReference({element:s,property:i.ns.name,id:e})}):o.addReference({element:s,property:i.ns.name,id:e}):(i?e=ni(i.type,e):"xmlns"===n?n=":"+n:(t=oi(n,r.ns.prefix),a.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+n+">",element:s,property:n,value:e})),s.set(n,e))}),s},Fi.prototype.getPropertyForNode=function(e){var t=oi(e.name),n=this.type,i=this.model,r=Di(n),o=t.name,s=r.propertiesByName[o];if(s&&!s.isAttr){const t=function(e){const t=Ri(e);return t!==Ti&&(t||null)}(s);if(t){const n=e.attributes[t];if(n){const t=function(e,t,n){const i=oi(e,t.xmlns),r=oi(`${t[i.prefix]||i.prefix}:${i.localName}`);return function(e,t){var n=e.name,i=e.localName,r=t&&t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(r,n.getPackage(r.prefix))}(n,e.ns,i);return q({},s,{effectiveType:Di(i.getType(t)).name})}}return s}var a=i.getPackage(t.prefix);if(a){const e=Mi(t,a),n=i.getType(e);if(s=w(r.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}),s)return q({},s,{effectiveType:Di(n).name})}else if(s=w(r.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}),s)return s;throw $i("unrecognized element <"+t.name+">")},Fi.prototype.toString=function(){return"ElementDescriptor["+Di(this.type).name+"]"},Fi.prototype.valueHandler=function(e,t){return new ji(e,t)},Fi.prototype.referenceHandler=function(e){return new zi(e,this.context)},Fi.prototype.handler=function(e){return"Element"===e?new Hi(this.model,e,this.context):new Fi(this.model,e,this.context)},Fi.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,ri(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(q(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},qi.prototype=Object.create(Fi.prototype),qi.prototype.createElement=function(e){var t=e.name,n=oi(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),s=o&&Mi(n,o)||t;if(!r.hasType(s))throw $i("unexpected element <"+e.originalName+">");return Fi.prototype.createElement.call(this,e)},Hi.prototype=Object.create(Vi.prototype),Hi.prototype.createElement=function(e){var t=e.name,n=oi(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Hi.prototype.handleChild=function(e){var t=new Hi(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},Hi.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Wi.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Fi?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,o=this.lax,s=new Bi(q({},t,{rootHandler:i})),a=new Ci({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function c(e,t,n){var i=t(),r=i.line,o=i.column,a=i.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var l="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:l,error:e}),!0;throw $i(l)}function u(e,t){return c(e,t,!0)}i.context=s,l.push(i);var p=/^<\?xml /i,h=/ encoding="([^"]+)"/i,d=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){u(e,t)}}var m=r.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},Object.entries(Ai).reduce(function(e,[t,n]){return e[n]=t,e},r.config&&r.config.nsMap||{}));return a.ns(m).on("openTag",function(e,t,n,i){var r=e.attrs||{},s=Object.keys(r).reduce(function(e,n){var i=t(r[n]);return e[n]=i,e},{});!function(e,t){var n=l.peek();try{l.push(n.handleNode(e))}catch(e){c(e,t,o)&&l.push(new Ii)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},i)}).on("question",function(e){if(p.test(e)){var t=h.exec(e),n=t&&t[1];n&&!d.test(n)&&s.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",f).on("text",function(e,t,n){!function(e,t){e.trim()&&f(e,t)}(t(e),n)}).on("error",c).on("warn",u),new Promise(function(t,n){var r;try{a.parse(e),function(){var e,t,n=s.elementsById,i=s.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],a=Di(r).propertiesByName[t.property];if(o||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var l=r.get(a.name),c=l.indexOf(t);-1===c&&(c=l.length),o?l[c]=o:l.splice(c,1)}else r.set(a.name,o)}}()}catch(e){r=e}var o=i.element;r||o||(r=$i("failed to parse document as <"+i.type.$descriptor.name+">"));var l=s.warnings,c=s.references,u=s.elementsById;return r?(r.warnings=l,n(r)):t({rootElement:o,elementsById:u,references:c,warnings:l})})},Wi.prototype.handler=function(e){return new qi(this.model,e)};var Qi=/<|>|'|"|&|\n\r|\n/g,Xi=/<|>|&/g;function Gi(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}function Ui(e,t){return Pi(t)?function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(e):e}function Yi(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Ki(e){return v(e)?e:(e.prefix?e.prefix+":":"")+e.localName}Gi.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},Gi.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},Gi.prototype.resolve=function(e){for(var t=this;t;){var n=e(t);if(n)return n;t=t.parent}},Gi.prototype.eachScope=function(e){for(var t=this;t;)e(t),t=t.parent},Gi.prototype.byUri=function(e){return this.resolve(function(t){return t.uriMap[e]})},Gi.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)},Gi.prototype.uriByPrefix=function(e){var t=e||"xmlns";return this.resolve(function(e){return e.prefixMap[t]})},Gi.prototype.mapPrefix=function(e,t){this.prefixMap[e||"xmlns"]=t},Gi.prototype.getNSKey=function(e){return void 0!==e.prefix?e.uri+"|"+e.prefix:e.uri},Gi.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e),i=this.byUri(t);this.eachScope(function(e){e.used[n]=i})},Gi.prototype.getUsed=function(e){return[].concat(this.wellknown,this.custom).filter(e=>{var t=this.getNSKey(e);return this.used[t]})};var Zi={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Ji={"<":"lt",">":"gt","&":"amp"};function er(e,t,n){return(e=v(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function tr(e){return er(e,Qi,Zi)}function nr(e){return er(e,Xi,Ji)}function ir(e){this.tagName=e}function rr(){}function or(e){this.tagName=e}function sr(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function ar(e,t,n){sr.call(this,e,t),this.serialization=n}function lr(){this.value="",this.write=function(e){this.value+=e}}function cr(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),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 ur(e){return e=q({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new lr,r=new cr(i,e.format);e.preamble&&r.append('<?xml version="1.0" encoding="UTF-8"?>\n');var o=new sr,s=t.$model;if(o.getNamespaces().mapDefaultPrefixes(function(e){const t=e.config&&e.config.nsMap||{},n={};for(const e in Ai)n[e]=Ai[e];for(const e in t){n[t[e]]=e}for(const t of e.getPackages())n[t.prefix]=t.uri;return n}(s)),o.build(t).serializeTo(r),!n)return i.value}}}function pr(e,t){hi.call(this,e,t)}ir.prototype.build=function(e){return this.element=e,this},ir.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+nr(this.element.id)+"</"+this.tagName+">").appendNewLine()},rr.prototype.serializeValue=rr.prototype.serializeTo=function(e){e.append(this.escape?nr(this.value):this.value)},rr.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Xi)&&(this.escape=!0),this},Yi(or,rr),or.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},sr.prototype.build=function(e){return function(e,t){var n=[{serializer:e,children:e.enter(t),index:0}];for(;n.length;){var i=n[n.length-1];if(i.index>=i.children.length)i.serializer.exit(),n.pop();else{var r=i.children[i.index++],o=r.create();i.serializer.body.push(o),r.element&&n.push({serializer:o,children:o.enter(r.element),index:0})}}}(this,e),this},sr.prototype.enter=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,i=t.isGeneric;if(this.otherAttrs=i?this.parseGenericNsAttributes(e):this.parseNsAttributes(e),this.ns=n?this.nsPropertyTagName(n):this.nsTagName(t),this.tagName=this.addTagName(this.ns),i)return this.collectGenericContainments(e);var r=function(e){return _(e.$descriptor.properties,function(t){var n=t.name;if(t.isVirtual)return!1;if(!b(e,n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)})}(e);return this.parseAttributes(_(r,function(e){return e.isAttr})),this.collectContainments(function(e){return _(e,function(e){return!e.isAttr})}(r))},sr.prototype.exit=function(){this.parseGenericAttributes(this.element,this.otherAttrs)},sr.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?q({localName:t.ns.localName},e):q({localName:Ui(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},sr.prototype.nsPropertyTagName=function(e){return function(e,t){return q({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},sr.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},sr.prototype.nsAttributeName=function(e){var t;if(t=v(e)?oi(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:q({localName:t.localName},n)},sr.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith("$")&&this.parseNsAttribute(e,t,n)).map(([e,t])=>({name:e,value:t}))},sr.prototype.collectGenericContainments=function(e){var t=this,n=[],i=e.$body;i&&n.push({create:function(){return(new rr).build({type:"String"},i)}});var r=e.$children;return r&&E(r,function(e){n.push({create:function(){return new sr(t)},element:e})}),n},sr.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=oi(t);if("xmlns"===o.prefix&&(i={prefix:o.localName,uri:n}),o.prefix||"xmlns"!==o.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var s=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(s)}},sr.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,i=[];return E(n,function(n,r){var o=t.parseNsAttribute(e,r,n);o&&i.push(o)}),i},sr.prototype.parseGenericAttributes=function(e,t){var n=this;E(t,function(t){try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){"undefined"!=typeof console&&console.warn(`missing namespace information for <${t.name}=${t.value}> on`,e,n)}})},sr.prototype.collectContainments=function(e){var t=this,n=this.element,i=[];return E(e,function(e){var r=n.get(e.name),o=e.isReference;if(e.isMany||(r=[r]),e.isBody)i.push({create:function(){return(new rr).build(e,r[0])}});else if(ri(e.type))E(r,function(n){i.push({create:function(){return new or(t.addTagName(t.nsPropertyTagName(e))).build(e,n)}})});else if(o)E(r,function(n){i.push({create:function(){return new ir(t.addTagName(t.nsPropertyTagName(e))).build(n)}})});else{var s=Ri(e);E(r,function(n){i.push({create:function(){return s?s===Ti?new sr(t,e):new ar(t,e,s):new sr(t)},element:n})})}}),i},sr.prototype.getNamespaces=function(e){var t=this.namespaces;if(!t){var n=this.getParentNamespaces();e||!n?this.namespaces=t=new Gi(n):t=n}return t},sr.prototype.getParentNamespaces=function(){if(void 0!==this.parentNamespaces)return this.parentNamespaces;for(var e=null,t=this.parent;t;){if(t.namespaces){e=t.namespaces;break}if(void 0!==t.parentNamespaces){e=t.parentNamespaces;break}t=t.parent}return this.parentNamespaces=e},sr.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},sr.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.getNamespaces(t),s=e.prefix,a=e.uri;if(!s&&!a)return{localName:e.localName};if(r=o.defaultUriByPrefix(s),!(a=a||r||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if((e=o.byUri(a))||s||(e=this.logNamespace({uri:a},r===a,!0)),!e){for(n=s,i=1;o.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:a},r===a)}return s&&o.mapPrefix(s,a),e},sr.prototype.parseAttributes=function(e){var t=this,n=this.element;E(e,function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];E(i,function(e){r.push(e.id)}),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)})},sr.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Ki(e)},sr.prototype.addAttribute=function(e,t){var n=this.attrs;v(t)&&(t=tr(t));var i=x(n,function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix}),r={name:e,value:t};-1!==i?n.splice(i,1,r):n.push(r)},sr.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return e.getUsed().filter(function(e){return"xml"!==e.prefix}).map(function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:tr(e.uri)}})}(n).concat(t)),E(t,function(t){e.append(" ").append(Ki(t.name)).append('="').append(t.value).append('"')})},sr.prototype.serializeTo=function(e){!function(e,t){var n=[{serializer:e,index:0,opened:!1,indent:!1}];for(;n.length;){var i=n[n.length-1],r=i.serializer;if(!i.opened){var o=r.body[0];if(i.indent=o&&o.constructor!==rr,t.appendIndent().append("<"+r.tagName),r.serializeAttributes(t),t.append(o?">":" />"),i.opened=!0,!o){t.appendNewLine(),n.pop();continue}i.indent&&t.appendNewLine().indent()}if(i.index<r.body.length){var s=r.body[i.index++];s instanceof sr?n.push({serializer:s,index:0,opened:!1,indent:!1}):s.serializeTo(t)}else i.indent&&t.unindent().appendIndent(),t.append("</"+r.tagName+">").appendNewLine(),n.pop()}}(this,e)},Yi(ar,sr),ar.prototype.parseNsAttributes=function(e){var t=sr.prototype.parseNsAttributes.call(this,e).filter(e=>e.name!==this.serialization),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(this.serialization),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},ar.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},pr.prototype=Object.create(hi.prototype),pr.prototype.fromXML=function(e,t,n){v(t)||(n=t,t="bpmn:Definitions");var i=new Wi(q({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},pr.prototype.toXML=function(e,t){var n=new ur(t);return new Promise(function(t,i){try{return t({xml:n.toXML(e)})}catch(e){return i(e)}})};const hr={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{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"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{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"]}],enumerations:[{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"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{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}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{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"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{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"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{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"}]}],enumerations:[],associations:[]}};function dr(e,t){return new pr(q({},hr,e),t)}function fr(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}function mr(e,t){return e.$instanceOf(t)}function gr(e){var t={},n=[],i={};function r(e,t){return function(n){e(n,t)}}function o(e){t[e.id]=e}function s(t,n){try{var r=i[t.id]&&function(t,n){if(t.gfx)throw new Error(`already rendered ${fr(t)}`);return e.element(t,i[t.id],n)}(t,n);return o(t),r}catch(e){a(e.message,{element:t,error:e}),console.error(`failed to import ${fr(t)}`,e)}}function a(t,n){e.error(t,n)}var l=this.registerDi=function(e){var t=e.bpmnElement;t?i[t.id]?a(`multiple DI elements defined for ${fr(t)}`,{element:t}):i[t.id]=e:a(`no bpmnElement referenced in ${fr(e)}`,{element:e})};function c(e){var t;t=e.plane,l(t),E(t.planeElement,u)}function u(e){l(e)}this.handleDefinitions=function(o,s){var u=o.diagrams;if(s&&-1===u.indexOf(s))throw new Error("diagram not part of <bpmn:Definitions />");if(!s&&u&&u.length&&(s=u[0]),!s)throw new Error("no diagram to display");i={},c(s);var f=s.plane;if(!f)throw new Error(`no plane for ${fr(s)}`);var m=f.bpmnElement;if(!m){if(m=function(e){return w(e.rootElements,function(e){return mr(e,"bpmn:Process")||mr(e,"bpmn:Collaboration")})}(o),!m)throw new Error("no process or collaboration to display");a(`correcting missing bpmnElement on ${fr(f)} to ${fr(m)}`),f.bpmnElement=m,l(f)}var g,v,b=function(t,n){return e.root(t,i[t.id],n)}(m,f);if(mr(m,"bpmn:Process")||mr(m,"bpmn:SubProcess"))h(m,b);else{if(!mr(m,"bpmn:Collaboration"))throw new Error(`unsupported bpmnElement for ${fr(f)}: ${fr(m)}`);v=b,E((g=m).participants,r(A,v)),n.push(function(){!function(e,t){E(e,r(d,t))}(g.messageFlows,v)}),y(g.artifacts,v),function(e,n){var i=_(e,function(e){return!t[e.id]&&mr(e,"bpmn:Process")&&e.laneSets});i.forEach(r(h,n))}(o.rootElements,b)}p(n)};var p=this.handleDeferred=function(){for(;n.length;)n.shift()()};function h(e,t){P(e,t),b(e.ioSpecification,t),y(e.artifacts,t),o(e)}function d(e,t){s(e,t)}function f(e,t){s(e,t)}function m(e,t){s(e,t)}function g(e,t){s(e,t)}function v(e,t){s(e,t)}function y(e,t){E(e,function(e){mr(e,"bpmn:Association")?n.push(function(){v(e,t)}):v(e,t)})}function b(e,t){e&&(E(e.dataInputs,r(m,t)),E(e.dataOutputs,r(g,t)))}var x=this.handleSubProcess=function(e,t){P(e,t),y(e.artifacts,t)};function S(e,t){var i=s(e,t);mr(e,"bpmn:SubProcess")&&x(e,i||t),mr(e,"bpmn:Activity")&&b(e.ioSpecification,t),n.push(function(){E(e.dataInputAssociations,r(f,t)),E(e.dataOutputAssociations,r(f,t))})}function k(e,t){s(e,t)}function O(e,t){n.push(function(){var n=s(e,t);e.childLaneSet&&C(e.childLaneSet,n||t),function(e){E(e.flowNodeRef,function(t){var n=t.get("lanes");n&&n.push(e)})}(e)})}function C(e,t){E(e.lanes,r(O,t))}function P(e,t){!function(e,t){E(e,function(e){mr(e,"bpmn:SequenceFlow")?n.push(function(){!function(e,t){s(e,t)}(e,t)}):mr(e,"bpmn:BoundaryEvent")?n.unshift(function(){S(e,t)}):mr(e,"bpmn:FlowNode")?S(e,t):mr(e,"bpmn:DataObject")||(mr(e,"bpmn:DataStoreReference")||mr(e,"bpmn:DataObjectReference")?k(e,t):a(`unrecognized flowElement ${fr(e)} in context ${fr(t&&t.businessObject)}`,{element:e,context:t}))})}(e.flowElements,t),e.laneSets&&function(e,t){E(e,r(C,t))}(e.laneSets,t)}function A(e,t){var n=s(e,t),i=e.processRef;i&&h(i,n||t)}}function vr(e,t){var n=br(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function yr(e,t){return C(t,function(t){return vr(e,t)})}function br(e){return e&&e.businessObject||e}function wr(e){return e&&e.di}function xr(e,t,n){var i,r,o,s=[];function a(e,t){var n=new gr({root:function(e,t){return i.add(e,t)},element:function(e,t,n){return i.add(e,t,n)},error:function(e,t){s.push({message:e,context:t})}});t=t||e.diagrams&&e.diagrams[0];var r=function(e,t){if(!t||!t.plane)return;var n,i=t.plane.bpmnElement,r=i;vr(i,"bpmn:Process")||vr(i,"bpmn:Collaboration")||(r=function(e){var t=e;for(;t;){if(vr(t,"bpmn:Process"))return t;t=t.$parent}}(i));n=vr(r,"bpmn:Collaboration")?r:w(e.rootElements,function(e){if(vr(e,"bpmn:Collaboration"))return w(e.participants,function(e){return e.processRef===r})});var o=[r];n&&(o=P(n.participants,function(e){return e.processRef})).push(n);var s=_r(o),a=[t],l=[i];return E(e.diagrams,function(e){if(e.plane){var t=e.plane.bpmnElement;-1!==s.indexOf(t)&&-1===l.indexOf(t)&&(a.push(e),l.push(t))}}),a}(e,t);if(!r)throw new Error("no diagram to display");E(r,function(t){n.handleDefinitions(e,t)});var a=t.plane.bpmnElement.id;o.setRootElement(o.findRoot(a+"_plane")||o.findRoot(a))}return new Promise(function(l,c){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("canvas"),r.fire("import.render.start",{definitions:t}),a(t,n),r.fire("import.render.complete",{error:void 0,warnings:s}),l({warnings:s})}catch(e){return e.warnings=s,c(e)}})}function _r(e){var t=[];return E(e,function(e){e&&(t.push(e),t=t.concat(_r(e.flowElements)))}),t}var Er,Sr='<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>',kr={verticalAlign:"middle"},Or={color:"#404040"},Cr={zIndex:"1001",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"},Pr={width:"100%",height:"100%",background:"rgba(40,40,40,0.2)"},Ar={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"},Tr='<div class="bjs-powered-by-lightbox"><div class="backdrop"></div><div class="notice"><a href="https://bpmn.io" target="_blank" rel="noopener" class="link">'+Sr+'</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>';function Rr(){Er||(Z(Er=Y(Tr),Cr),Z(de("svg",Er),kr),Z(de(".backdrop",Er),Pr),Z(de(".notice",Er),Ar),Z(de(".link",Er),Or,{margin:"15px 20px 15px 10px",alignSelf:"center"}),pe.bind(Er,".backdrop","click",function(e){document.body.removeChild(Er)})),document.body.appendChild(Er)}const Mr="djs-outline-hidden";function $r(e){e=q({},Br,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),this._init(this._container,this._moddle,e),function(e){const t=Y('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+Sr+"</a>");Z(de("svg",t),kr),Z(t,Or,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),ce.bind(t,"click",function(e){Rr(),e.preventDefault()})}(this._container)}function Dr(e,t){return e.warnings=t,e}e($r,Kn),$r.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let s=o.rootElement;const a=o.references,l=o.warnings,c=o.elementsById;i=i.concat(l),s=this._emit("import.parse.complete",(r={error:null,definitions:s,elementsById:c,references:a,warnings:i},n.get("eventBus").createEvent(r)))||s;const u=await this.importDefinitions(s,t);return i=i.concat(u.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),Dr(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},$r.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},$r.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw Dr(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return w(e.diagrams,function(e){return e.id===t})||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw Dr(t,[]),t}try{this.clear()}catch(e){throw Dr(e,[]),e}const{warnings:i}=await xr(this,t,n);return{warnings:i}},$r.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},$r.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=de(":scope > defs",t._svg),r=Ne(n),o=i?"<defs>"+Ne(i)+"</defs>":"",s=t.getContainer();let a;te(s).add(Mr);try{a=n.getBBox()}finally{te(s).remove(Mr)}const l=a.x-5,c=a.y-5,u=a.width+10,p=a.height+10;e='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+u+'" height="'+p+'" viewBox="'+l+" "+c+" "+u+" "+p+'" version="1.1">'+o+r+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},$r.prototype._setDefinitions=function(e){this._definitions=e},$r.prototype.getModules=function(){return this._modules},$r.prototype.clear=function(){this.getDefinitions()&&Kn.prototype.clear.call(this)},$r.prototype.destroy=function(){Kn.prototype.destroy.call(this),me(this._container)},$r.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},$r.prototype.off=function(e,t){this.get("eventBus").off(e,t)},$r.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=de(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},$r.prototype.getDefinitions=function(){return this._definitions},$r.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},$r.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),s=q(X(n,["additionalModules"]),{canvas:q({},n.canvas,{container:e}),modules:o});Kn.call(this,s),n&&n.container&&this.attachTo(n.container)},$r.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},$r.prototype._createContainer=function(e){const t=Y('<div class="bjs-container bio-theme-parent"></div>');return Z(t,{width:Lr(e.width),height:Lr(e.height),position:e.position}),t},$r.prototype._createModdle=function(e){return new dr(q({},this._moddleExtensions,e.moddleExtensions))},$r.prototype._modules=[];const Br={width:"100%",height:"100%",position:"relative"};function Lr(e){return e+(m(e)?"px":"")}function Ir(e){$r.call(this,e),this.on("import.parse.complete",function(e){e.error||this._collectIds(e.definitions,e.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}function Nr(e,t){return!vr(e,"bpmn:CallActivity")&&(vr(e,"bpmn:SubProcess")?!(!(t=t||wr(e))||!vr(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!vr(e,"bpmn:Participant")||!!br(e).processRef)}function zr(e){if(vr(e,"bpmn:Participant")||vr(e,"bpmn:Lane")){var t=wr(e).isHorizontal;return void 0===t||t}}function jr(e){return e&&!1!==br(e).isInterrupting}function Vr(e){return e&&!!br(e).triggeredByEvent}function Fr(e,t){return C(br(e).eventDefinitions,function(e){return vr(e,t)})}e(Ir,$r),Ir.prototype._createModdle=function(e){var t=$r.prototype._createModdle.call(this,e);return t.ids=new s([32,36,1]),t},Ir.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var qr={width:90,height:20};function Hr(e){return vr(e,"bpmn:Event")||vr(e,"bpmn:Gateway")||vr(e,"bpmn:DataStoreReference")||vr(e,"bpmn:DataObjectReference")||vr(e,"bpmn:DataInput")||vr(e,"bpmn:DataOutput")||vr(e,"bpmn:SequenceFlow")||vr(e,"bpmn:MessageFlow")||vr(e,"bpmn:Group")}function Wr(e){return ln(e.label)}function Qr(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(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}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),s=r.x,a=r.y;return Math.abs(o)<Math.PI/2?a-=15:s+=15,{x:s,y:a}}function Xr(e){return e.waypoints?Qr(e.waypoints):vr(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+qr.height/2}:{x:e.x+e.width/2,y:e.y+e.height+qr.height/2}}function Gr(e){return vr(e,"bpmn:FlowElement")||vr(e,"bpmn:Participant")||vr(e,"bpmn:Lane")||vr(e,"bpmn:SequenceFlow")||vr(e,"bpmn:MessageFlow")||vr(e,"bpmn:DataInput")||vr(e,"bpmn:DataOutput")?"name":vr(e,"bpmn:TextAnnotation")?"text":vr(e,"bpmn:Group")?"categoryValueRef":void 0}function Ur(e){var t=e.businessObject,n=Gr(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function Yr(e){let t=[];return E(e.incoming,e=>{vr(e,"bpmn:Association")&&vr(e.source,"bpmn:TextAnnotation")&&t.push({annotation:e.source,association:e})}),E(e.outgoing,e=>{vr(e,"bpmn:Association")&&vr(e.target,"bpmn:TextAnnotation")&&t.push({annotation:e.target,association:e})}),t}function Kr(e){const t=new Map;return E(ct(e),e=>{E(Yr(e),e=>{t.has(e.annotation)||t.set(e.annotation,{annotation:e.annotation,associations:[]}),t.get(e.annotation).associations.push(e.association)})}),[...t.values()]}var Zr="hsl(225, 10%, 15%)";function Jr(e,t){return C(e.eventDefinitions,function(e){return e.$type===t})}function eo(e,t,n){var i=wr(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||"white"}function to(e,t,n){var i=wr(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||Zr}function no(e,t,n,i){var r=wr(e).get("label");return i||r&&r.get("color:color")||t||to(e,n)}function io(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2;return Je([["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"]])}function ro(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return Je([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}function oo(e,t={}){return{width:so(e,t),height:ao(e,t)}}function so(e,t={}){return b(t,"width")?t.width:e.width}function ao(e,t={}){return b(t,"height")?t.height:e.height}var lo=new s,co=.95;function uo(e,t,n,i,r,o,s){Ze.call(this,t,s);var a=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,c=e&&e.defaultLabelColor;function u(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Zr,strokeWidth:2,fill:"white"})}function p(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Zr,strokeWidth:2})}function h(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o,parentGfx:s=r._svg}=t,a=Pe("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});ge(a,o);var l=de(":scope > defs",s);l||ge(s,l=Pe("defs")),ge(l,a)}function d(e,t,n,i){var r=lo.nextPrefixed("marker-");return function(e,t,n,i,r){if("sequenceflow-end"===n){h(t,{element:Pe("path",{d:"M 1 5 L 11 10 L 1 15 Z",...u({fill:r,stroke:r,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("messageflow-start"===n){h(t,{element:Pe("circle",{cx:6,cy:6,r:3.5,...u({fill:i,stroke:r,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:e})}if("messageflow-end"===n){h(t,{element:Pe("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...u({fill:i,stroke:r,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:e})}if("association-start"===n){h(t,{element:Pe("path",{d:"M 11 5 L 1 10 L 11 15",...p({fill:"none",stroke:r,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:e})}if("association-end"===n){h(t,{element:Pe("path",{d:"M 1 5 L 11 10 L 1 15",...p({fill:"none",stroke:r,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("conditional-flow-marker"===n){h(t,{element:Pe("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...u({fill:i,stroke:r})}),ref:{x:-1,y:10},scale:.5,parentGfx:e})}if("conditional-default-flow-marker"===n){h(t,{element:Pe("path",{d:"M 6 4 L 10 16",...u({stroke:r,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:e})}}(e,r,t,n,i),"url(#"+r+")"}function m(e,t,n,i,r={}){f(i)&&(r=i,i=0),i=i||0,r=u(r);var o=Pe("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return ge(e,o),o}function g(e,t,n,i,r,o){f(r)&&(o=r,r=0),r=r||0,o=u(o);var s=Pe("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return ge(e,s),s}function v(e,t,n,i){var r=ot(t,n=p(n),i);return ge(e,r),r}function y(e,t,n){return v(e,t,n,5)}function b(e,t,n){n=p(n);var i=Pe("path",{...n,d:t});return ge(e,i),i}function w(e,t,n,i){return b(t,n,q({"data-marker":e},i))}function x(e){return Z[e]}function _(e){return function(t,n,i){return x(e)(t,n,i)}}var S=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.235,my:.315}}),{fill:r?to(t,l,n.stroke):eo(t,a,n.fill),stroke:r?eo(t,a,n.fill):to(t,l,n.stroke),strokeWidth:1})},k=function(e,t,n={}){var r=n.width||t.width,o=n.height||t.height,s=n.width?1:2,c=m(e,r,o,.2*o,{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:s});b(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:o,position:{mx:.5,my:.5}}),{stroke:to(t,l,n.stroke),strokeWidth:s});for(var u=0;u<12;u++){var p=r/2,h=o/2;b(e,i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:o,position:{mx:.5,my:.5}}),{strokeWidth:1,stroke:to(t,l,n.stroke),transform:"rotate("+30*u+","+h+","+p+")"})}return c},O=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{fill:r?to(t,l,n.stroke):eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1})},C=function(e,t,n={}){return b(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.222}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1})},P=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?to(t,l,n.stroke):eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1})},A=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.2,my:.722}}),{fill:r?to(t,l,n.stroke):eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1})},T=function(e,t,n={},r){var o=b(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?to(t,l,n.stroke):"none",stroke:to(t,l,n.stroke),strokeWidth:1});return Xn(o,45),o},R=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.22,my:.5}}),{fill:r?to(t,l,n.stroke):eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1})},M=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?to(t,l,n.stroke):eo(t,a,n.fill),stroke:to(t,l,n.stroke)})},$=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.211,my:.36}}),{fill:r?to(t,l,n.stroke):eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1})},D=function(e,t,n={}){return b(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.458,my:.194}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1})},B=function(e,t,n={}){return m(e,t.width,t.height,8,{fill:to(t,l,n.stroke),stroke:to(t,l,n.stroke),strokeWidth:4})};function L(e,t,n={},i){var r=br(e),o=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(r),s=i||e;return r.get("eventDefinitions")&&r.get("eventDefinitions").length>1?r.get("parallelMultiple")?D(t,s,n):$(t,s,n,o):Jr(r,"bpmn:MessageEventDefinition")?S(t,s,n,o):Jr(r,"bpmn:TimerEventDefinition")?k(t,s,n):Jr(r,"bpmn:ConditionalEventDefinition")?C(t,s,n):Jr(r,"bpmn:SignalEventDefinition")?M(t,s,n,o):Jr(r,"bpmn:EscalationEventDefinition")?O(t,s,n,o):Jr(r,"bpmn:LinkEventDefinition")?P(t,s,n,o):Jr(r,"bpmn:ErrorEventDefinition")?A(t,s,n,o):Jr(r,"bpmn:CancelEventDefinition")?T(t,s,n,o):Jr(r,"bpmn:CompensateEventDefinition")?R(t,s,n,o):Jr(r,"bpmn:TerminateEventDefinition")?B(t,s,n):null}var I={ParticipantMultiplicityMarker:function(e,t,n={}){var r=so(t,n),o=ao(t,n);w("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2-6)/r,my:(o-15)/o}}),{strokeWidth:2,fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke)})},SubProcessMarker:function(e,t,n={}){Qn(g(e,14,14,0,{strokeWidth:1,fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke)}),t.width/2-7.5,t.height-20),w("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke)})},ParallelMarker:function(e,t,n){var r=so(t,n),o=ao(t,n);w("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.parallel)/r,my:(o-20)/o}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke)})},SequentialMarker:function(e,t,n){w("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke)})},CompensationMarker:function(e,t,n){w("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke)})},LoopMarker:function(e,t,n){var r=so(t,n),o=ao(t,n);w("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.loop)/r,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:to(t,l,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=so(t,n),o=ao(t,n);w("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.adhoc)/r,my:(o-15)/o}}),{strokeWidth:1,fill:to(t,l,n.stroke),stroke:to(t,l,n.stroke)})}};function N(e,t,n,i){I[e](t,n,i)}function z(e,t,n=[],i={}){i={fill:i.fill,stroke:i.stroke,width:so(t,i),height:ao(t,i)};var r=br(t),o=n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},r.get("isForCompensation")&&n.push("CompensationMarker"),vr(r,"bpmn:AdHocSubProcess")&&(n.push("AdhocMarker"),o||q(i,{compensation:i.compensation-18}));var s=r.get("loopCharacteristics"),a=s&&s.get("isSequential");s&&(q(i,{compensation:i.compensation-18}),n.includes("AdhocMarker")&&q(i,{seq:-23,loop:-18,parallel:-24}),void 0===a&&n.push("LoopMarker"),!1===a&&n.push("ParallelMarker"),!0===a&&n.push("SequentialMarker")),n.includes("CompensationMarker")&&1===n.length&&q(i,{compensation:-8}),E(n,function(n){N(n,e,t,i)})}function j(e,t,n={}){n=q({size:{width:100}},n);var i=o.createText(t||"",n);return xe(i).add("djs-label"),ge(e,i),i}function V(e,t,n,i={}){var r=br(t),o=oo({x:t.x,y:t.y,width:t.width,height:t.height},i);return j(e,r.name,{align:n,box:o,padding:7,style:{fill:no(t,c,l,i.stroke)}})}function F(e,t,n,i={}){var r=zr(n),o=j(e,t,{box:{height:30,width:r?ao(n,i):so(n,i)},align:"center-middle",style:{fill:no(n,c,l,i.stroke)}});r&&Wn(o,0,-(-1*ao(n,i)),270)}function H(e,t,n={}){var{width:i,height:r}=oo(t,n);return g(e,i,r,10,{...n,fill:eo(t,a,n.fill),fillOpacity:co,stroke:to(t,l,n.stroke)})}function W(e,t,n={}){var i=br(t),r=eo(t,a,n.fill),o=to(t,l,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=d(e,"association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=d(e,"association-start",r,o)),n=po(n,["markerStart","markerEnd"]),y(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function Q(e,t,n={}){var r=eo(t,a,n.fill),o=to(t,l,n.stroke),s=b(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:co,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(br(t))&&b(e,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:r,stroke:o});return s}function X(e,t,n={}){return m(e,t.width,t.height,{fillOpacity:co,...n,fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke)})}function G(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,s=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map(function(e){return e.x+","+e.y}).join(" ");i=u(i);var a=Pe("polygon",{...i,points:s});return ge(e,a),a}(e,t.width,t.height,{fill:eo(t,a,n.fill),fillOpacity:co,stroke:to(t,l,n.stroke)})}function U(e,t,n={}){var i=g(e,so(t,n),ao(t,n),0,{fill:eo(t,a,n.fill),fillOpacity:n.fillOpacity||co,stroke:to(t,l,n.stroke),strokeWidth:1.5}),r=br(t);vr(r,"bpmn:Lane")&&F(e,r.get("name"),t,n);return i}function Y(e,t,n={}){var i=H(e,t,n),r=Nr(t);if(Vr(t)&&(be(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!r)){var o=(br(t).flowElements||[]).filter(e=>vr(e,"bpmn:StartEvent"));1===o.length&&function(e,t,n,i){var r=22,o={fill:eo(i,a,n.fill),stroke:to(i,l,n.stroke),width:r,height:r},s=br(e).isInterrupting,c=s?0:3,u=s?1:1.2,p=20,h=(r-p)/2,d="translate("+h+","+h+")";m(t,p,p,{fill:o.fill,stroke:o.stroke,strokeWidth:u,strokeDasharray:c,transform:d}),L(e,t,o,i)}(o[0],e,n,t)}return V(e,t,r?"center-top":"center-middle",n),z(e,t,r?void 0:["SubProcessMarker"],n),i}function K(e,t,n={}){var i=H(e,t,n);return V(e,t,"center-middle",n),z(e,t,void 0,n),i}var Z=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return Y(e,t,n=Nr(t)?po(n,["fill","stroke","width","height"]):po(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return W(e,t,n=po(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=po(n,["fill","stroke"]);var r=br(t).get("cancelActivity");n={strokeWidth:1.5,fill:eo(t,a,n.fill),fillOpacity:1,stroke:to(t,l,n.stroke)},r||(n.strokeDasharray="6");var o=X(e,t,n);return m(e,t.width,t.height,3,{...n,fill:"none"}),i&&L(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=K(e,t,n=po(n,["fill","stroke"]));return be(b(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1}),be(b(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:to(t,l,n.stroke),stroke:to(t,l,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=po(n,["fill","stroke"]),Y(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=G(e,t,n=po(n,["fill","stroke"]));return b(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:to(t,l,n.stroke),stroke:to(t,l,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=po(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=Q(e,t,n);return b(e,r,{fill:"none",stroke:to(t,l,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=po(n,["fill","stroke"]),W(e,t,{...n,markerEnd:d(e,"association-end",eo(t,a,n.fill),to(t,l,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return Q(e,t,n=po(n,["fill","stroke"]))},"bpmn:DataObjectReference":_("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=po(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=Q(e,t,n);return b(e,r,{strokeWidth:1,fill:to(t,l,n.stroke),stroke:to(t,l,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=po(n,["fill","stroke"]),W(e,t,{...n,markerEnd:d(e,"association-end",eo(t,a,n.fill),to(t,l,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=po(n,["fill","stroke"]),b(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:eo(t,a,n.fill),fillOpacity:co,stroke:to(t,l,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=po(n,["fill","stroke"]);var r=X(e,t,{...n,strokeWidth:4});return i&&L(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=po(n,["fill","stroke"]);var r=br(t),o=G(e,t,n);m(e,t.width,t.height,.2*t.height,{fill:eo(t,"none",n.fill),stroke:to(t,l,n.stroke),strokeWidth:1});var s=r.get("eventGatewayType"),a=!!r.get("instantiate");if("Parallel"===s){var c=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});b(e,c,{fill:"none",stroke:to(t,l,n.stroke),strokeWidth:1})}else"Exclusive"===s&&(a||m(e,t.width,t.height,.26*t.height,{fill:"none",stroke:to(t,l,n.stroke),strokeWidth:1}),function(){var r=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});b(e,r,{fill:"none",stroke:to(t,l,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=G(e,t,n=po(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return wr(t).get("isMarkerVisible")&&b(e,o,{fill:to(t,l,n.stroke),stroke:to(t,l,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return G(e,t,n=po(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=po(n,["fill","stroke","width","height"]),g(e,t.width,t.height,10,{stroke:to(t,l,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:so(t,n),height:ao(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=G(e,t,n=po(n,["fill","stroke"]));return m(e,t.width,t.height,.24*t.height,{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=po(n,["fill","stroke"]);var r=X(e,t,{...n,strokeWidth:1.5});return m(e,t.width,t.height,3,{fill:"none",stroke:to(t,l,n.stroke),strokeWidth:1.5}),i&&L(t,e,n),r},"bpmn:IntermediateCatchEvent":_("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":_("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=po(n,["fill","stroke","width","height"]),U(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=K(e,t,n=po(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=po(n,["fill","stroke"]);var r=br(t),s=wr(t),c=eo(t,a,n.fill),u=to(t,l,n.stroke),p=y(e,t.waypoints,{markerEnd:d(e,"messageflow-end",c,u),markerStart:d(e,"messageflow-start",c,u),stroke:u,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var h=p.getPointAtLength(p.getTotalLength()/2),f=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:h.x,y:h.y}}),m={strokeWidth:1};"initiating"===s.get("messageVisibleKind")?(m.fill=c,m.stroke=u):(m.fill=u,m.stroke=c),b(e,f,m);var g=r.get("messageRef").get("name")||"",v={align:"center-top",fitBox:!0,style:{fill:u}},w=j(e,g,v),x=o.getDimensions(g,v).width;Wn(w,h.x-x/2,h.y+7+10,0)}return p},"bpmn:ParallelGateway":function(e,t,n={}){var r=G(e,t,n=po(n,["fill","stroke"]));return b(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:to(t,l,n.stroke),stroke:to(t,l,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=U(e,t,n=po(n,["fill","stroke","width","height"])),r=Nr(t),o=zr(t),s=br(t),a=s.get("name");if(r){v(e,o?[{x:30,y:0},{x:30,y:ao(t,n)}]:[{x:0,y:30},{x:so(t,n),y:30}],{stroke:to(t,l,n.stroke),strokeWidth:1.5}),F(e,a,t,n)}else{var u=oo(t,n);o||(u.height=so(t,n),u.width=ao(t,n));var p=j(e,a,{box:u,align:"center-middle",style:{fill:no(t,c,l,n.stroke)}});if(!o)Wn(p,0,-(-1*ao(t,n)),270)}return s.get("participantMultiplicity")&&N("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=po(n,["fill","stroke"]);var r,o=br(t),s=K(e,t,n);return o.get("instantiate")?(m(e,28,28,4.4,{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1}),r=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),b(e,r,{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1}),s},"bpmn:ScriptTask":function(e,t,n={}){var r=K(e,t,n=po(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=K(e,t,n=po(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:to(t,l,n.stroke),stroke:eo(t,a,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=po(n,["fill","stroke"]);var i=eo(t,a,n.fill),r=to(t,l,n.stroke),o=y(e,t.waypoints,{markerEnd:d(e,"sequenceflow-end",i,r),stroke:r}),s=br(t),{source:c}=t;if(c){var u=br(c);s.get("conditionExpression")&&vr(u,"bpmn:Activity")&&be(o,{markerStart:d(e,"conditional-flow-marker",i,r)}),u.get("default")&&(vr(u,"bpmn:Gateway")||vr(u,"bpmn:Activity"))&&u.get("default")===s&&be(o,{markerStart:d(e,"conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=K(e,t,n=po(n,["fill","stroke"]));return m(e,10,10,{fill:eo(t,a,n.fill),stroke:"none",transform:"translate(6, 6)"}),b(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1}),m(e,10,10,{fill:eo(t,a,n.fill),stroke:"none",transform:"translate(11, 10)"}),b(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=po(n,["fill","stroke"]),br(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=X(e,t,n);return i&&L(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return Y(e,t,n=Nr(t)?po(n,["fill","stroke","width","height"]):po(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return K(e,t,n=po(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=po(n,["fill","stroke"]);var{width:r,height:o}=oo(t,n),s=g(e,r,o,0,0,{fill:"none",stroke:"none"});return b(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:to(t,l,n.stroke)}),j(e,br(t).get("text")||"",{align:"left-top",box:oo(t,n),padding:7,style:{fill:no(t,c,l,n.stroke)}}),s},"bpmn:Transaction":function(e,t,i={}){i=Nr(t)?po(i,["fill","stroke","width","height"]):po(i,["fill","stroke"]);var r=Y(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:to(t,l,i.stroke),strokeWidth:1.5});return Nr(t)||(i={}),g(e,so(t,i),ao(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=K(e,t,n=po(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:.5}),b(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:eo(t,a,n.fill),stroke:to(t,l,n.stroke),strokeWidth:.5}),b(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:to(t,l,n.stroke),stroke:to(t,l,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:t.width,height:t.height,x:t.width/2+t.x,y:t.height/2+t.y};return j(e,Ur(t),{box:i,style:q({},o.getExternalStyle(),{fill:no(t,c,l,n.stroke)})})}(e,t,n)}};this._drawPath=b,this._renderer=x}function po(e,t=[]){return t.reduce((t,n)=>(e[n]&&(t[n]=e[n]),t),{})}e(uo,Ze),uo.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],uo.prototype.canRender=function(e){return vr(e,"bpmn:BaseElement")},uo.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},uo.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},uo.prototype.getShapePath=function(e){return ln(e)?ro(e,4):vr(e,"bpmn:Event")?io(e):vr(e,"bpmn:Activity")?ro(e,10):vr(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return Je([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,i=e.width;return Je([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e)};var ho={width:150,height:50};var fo=null;function mo(e){if(null!=e)return"number"==typeof e||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function go(e,t){var n=(fo||(fo=document.createElement("canvas").getContext("2d")),fo);if(!n)return{width:0,height:0};n.font=function(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(mo(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}(t),"letterSpacing"in n&&(n.letterSpacing=mo(t.letterSpacing)||"0px");var i=""===e,r=i?"dummy":e.trimEnd(),o=n.measureText(r);return{width:i?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function vo(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=go(o,n)).width=o?i.width:0," "===o||""===o||i.width<=t||o.length<2)return yo(e,o,r,i);o=wo(o,i.width,t)}}function yo(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 bo="­";function wo(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<t)){"-"!==n&&n!==bo||r.pop();break}r.push(n),o+=n.length}var s=r[r.length-1];return s&&s===bo&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function xo(e){this._config=q({},{size:ho,padding:0,style:{},align:"center-top"},e||{})}xo.prototype.createText=function(e,t){return this.layoutText(e,t).element},xo.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},xo.prototype.layoutText=function(e,t){for(var n=q({},this._config.size,t.box),i=q({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return f(e)?q({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),s=t.fitBox||!1,a=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),l=e.split(/\u00AD?\r?\n/),c=[],u=n.width-o.left-o.right;l.length;)c.push(vo(l,u,i));"middle"===r.vertical&&(o.top=o.bottom=0);var p=k(c,function(e,t,n){return e+(a||t.height)},0)+o.top+o.bottom,h=k(c,function(e,t,n){return t.width>e?t.width:e},0),d=o.top;"middle"===r.vertical&&(d+=(n.height-p)/2),d-=(a||c[0].height)/4;var m=Pe("text");return be(m,i),E(c,function(e){var t;switch(d+=a||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?h:u)-o.right-e.width;break;default:t=Math.max(((s?h:u)-e.width)/2+o.left,0)}var n=Pe("tspan");be(n,{x:t,y:d}),n.textContent=e.text,ge(m,n)}),{dimensions:{width:h,height:p},element:m}};function _o(e){var t=q({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=q({},t,{fontSize:n},e&&e.externalStyle||{}),r=new xo({style:t});function o(e,t,n){return r.getDimensions(e,q({box:t},n))}this.getExternalLabelBounds=function(e,t){var n=o(t,{width:Math.max(e.width,qr.width),height:30},{style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:e.y,width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=o(n,e,{style:t,align:"left-top",padding:7});return{x:e.x,y:e.y,width:e.width,height:Math.max(40,Math.round(i.height))}},this.getDimensions=function(e,t){return r.getDimensions(e,t||{})},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}_o.$inject=["config.textRenderer"];var Eo=/\{([^{}]+)\}/g,So=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var ko={__init__:["bpmnRenderer"],bpmnRenderer:["type",uo],textRenderer:["type",_o],pathMap:["type",function(){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(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var s=t.containerHeight/r.height*t.yScaleFactor,a=t.containerWidth/r.width*t.xScaleFactor,l=0;l<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*s;for(var c=0;c<r.widthElements.length;c++)o["x"+c]=r.widthElements[c]*a}var u,p,h=(u=r.d,p={mx:n,my:i,e:o},String(u).replace(Eo,function(e,t){return function(e,t,n){var i=n;return t.replace(So,function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))}),i=(null==i||i==n?e:i)+""}(e,t,p)}));return h}}]};var Oo={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}]};function Co(e,t,n){return q({id:e.id,type:e.$type,businessObject:e,di:t},n)}function Po(e,t,n){var i=e.waypoint;return!i||i.length<2?[fn(t),fn(n)]:i.map(function(e){return{x:e.x,y:e.y}})}function Ao(e,t,n){return new Error(`element ${fr(t)} referenced by ${fr(e)}#${n} not yet drawn`)}function To(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}To.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],To.prototype.add=function(e,t,n){var i,r,o;if(vr(t,"bpmndi:BPMNPlane")){var s=vr(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(Co(e,t,s)),this._canvas.addRootElement(i)}else if(vr(t,"bpmndi:BPMNShape")){var a=!Nr(e,t),l=function(e){return vr(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var c=t.bounds;i=this._elementFactory.createShape(Co(e,t,{collapsed:a,hidden:r,x:Math.round(c.x),y:Math.round(c.y),width:Math.round(c.width),height:Math.round(c.height),isFrame:l})),vr(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),vr(e,"bpmn:Lane")&&(o=0),vr(e,"bpmn:DataStoreReference")&&(function(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}(n,fn(c))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!vr(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${fr(t)} for element ${fr(e)}`);var u=this._getSource(e),p=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(Co(e,t,{hidden:r,source:u,target:p,waypoints:Po(t,u,p)})),vr(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return Hr(e)&&Ur(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},To.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${fr(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw Ao(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),-1===r.indexOf(t)&&r.push(t)},To.prototype.addLabel=function(e,t,n){var i,r,o;if(i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(i={width:(r=o.bounds).width,height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Xr(t),i=qr),q({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=Ur(n))&&t.label&&t.label.bounds&&i.width>0){var s=this._textRenderer.getDimensions(r,{box:i,style:this._textRenderer.getExternalStyle()});i=q({},i,{height:Math.ceil(s.height)})}else r&&(i=this._textRenderer.getExternalLabelBounds(i,r));return o=this._elementFactory.createLabel(Co(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!Ur(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)},To.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?Ao(e,i,t+"Ref"):new Error(`${fr(e)}#${t} Ref not specified`)},To.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},To.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},To.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Ro={__depends__:[ko,{__depends__:[Oo],bpmnImporter:["type",To]}]};function Mo(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Mo.prototype.next=function(){return this._prefix+ ++this._counter};var $o=new Mo("ov");function Do(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=$o,this._overlayDefaults=q({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),Z(o=Y('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function Bo(e,t,n){Z(e,{left:t+"px",top:n+"px"})}function Lo(e,t){e.style.display=!1===t?"none":""}function Io(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}Do.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Do.prototype.get=function(e){if(v(e)&&(e={id:e}),v(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?_(t.overlays,L({type:e.type})):t.overlays.slice():[]}return e.type?_(this._overlays,L({type:e.type})):e.id?this._overlays[e.id]:null},Do.prototype.add=function(e,t,n){if(f(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=q({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},Do.prototype.remove=function(e){var t=this.get(e)||[];d(t)||(t=[t]);var n=this;E(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(me(e.html),me(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}})},Do.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},Do.prototype.show=function(){Lo(this._overlayRoot)},Do.prototype.hide=function(){Lo(this._overlayRoot,!1)},Do.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ie(this._overlayRoot)},Do.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=ht(t);i=o.x,r=o.y}Bo(n,i,r),J(e.html,"data-container-id",t.id)},Do.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,s=i.left,a=i.top;void 0!==i.right&&(t=o.waypoints?ht(o).width:o.width,s=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?ht(o).height:o.height,a=-1*i.bottom+n);Bo(r,s||0,a||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Do.prototype._createOverlayContainer=function(e){var t=Y('<div class="djs-overlays" />');Z(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Do.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Io(this._overlayRoot,n)},Do.prototype._getOverlayContainer=function(e,t){var n=w(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},Do.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),v(o)&&(o=Y(o)),n=this._getOverlayContainer(r),Z(t=Y('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&te(t).add("djs-overlay-"+e.type),Lo(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Do.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,s=e.htmlContainer,a=!0;(i!==this._canvas.getRootElement()||n&&(p(r)&&r>t.scale||p(o)&&o<t.scale))&&(a=!1),Lo(s,a),this._updateOverlayScale(e,t)},Do.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,s=e.htmlContainer,a="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),p(n)&&t.scale<n&&(r=(1/t.scale||1)*n),p(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),p(r)&&(a="scale("+r+","+r+")"),Io(s,a)},Do.prototype._updateOverlaysVisibilty=function(e){var t=this;E(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},Do.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(e){t.hide()}),e.on("canvas.viewbox.changed",function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()}),e.on(["shape.remove","connection.remove"],function(e){var n=e.element;E(t.get({element:n}),function(e){t.remove(e.id)});var i=t._getOverlayContainer(n);if(i){me(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}}),e.on("element.changed",500,function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(E(i.overlays,function(e){t._updateOverlay(e)}),t._updateOverlayContainer(i))}),e.on("element.marker.update",function(e){var n=t._getOverlayContainer(e.element,!0);n&&te(n.html)[e.add?"add":"remove"](e.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};var No={__init__:["overlays"],overlays:["type",Do]};function zo(e,t,n,i){e.on("element.changed",function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(ft(r)+".changed",i)}),e.on("elements.changed",function(t){var n=t.elements;n.forEach(function(t){e.fire("element.changed",{element:t})}),i.updateContainments(n)}),e.on("shape.changed",function(e){i.update("shape",e.element,e.gfx)}),e.on("connection.changed",function(e){i.update("connection",e.element,e.gfx)})}zo.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var jo={__init__:["changeSupport"],changeSupport:["type",zo]};function Vo(e){this._eventBus=e}function Fo(e){return function(t,n,i,r,o){(g(t)||m(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function qo(e,t){t.invoke(Vo,this),this.executed(function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()}),this.revert(function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)})}Vo.$inject=["eventBus"],Vo.prototype.on=function(e,t,n,i,r,o){if((g(t)||m(t))&&(o=r,r=i,i=n,n=t,t=null),g(n)&&(o=r,r=i,i=n,n=1e3),f(r)&&(o=r,r=!1),!g(i))throw new Error("handlerFn must be a function");d(e)||(e=[e]);var s=this._eventBus;E(e,function(e){var a=["commandStack",e,t].filter(function(e){return e}).join(".");s.on(a,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)})},Vo.prototype.canExecute=Fo("canExecute"),Vo.prototype.preExecute=Fo("preExecute"),Vo.prototype.preExecuted=Fo("preExecuted"),Vo.prototype.execute=Fo("execute"),Vo.prototype.executed=Fo("executed"),Vo.prototype.postExecute=Fo("postExecute"),Vo.prototype.postExecuted=Fo("postExecuted"),Vo.prototype.revert=Fo("revert"),Vo.prototype.reverted=Fo("reverted"),e(qo,Vo),qo.$inject=["canvas","injector"];var Ho={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",qo]};function Wo(e){return CSS.escape(e)}var Qo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Xo(e){return(e=""+e)&&e.replace(/[&<>"']/g,function(e){return Qo[e]})}var Go="_plane";function Uo(e){return function(e){return e.replace(new RegExp(Go+"$"),"")}(e.id)}function Yo(e){var t=e.id;return vr(e,"bpmn:SubProcess")?Jo(t):t}function Ko(e){return Jo(e)}function Zo(e){return vr(wr(e),"bpmndi:BPMNPlane")}function Jo(e){return e+Go}function es(e,t,n){var i=Y('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=te(r);r.appendChild(i);var s=[];function a(e){e&&(s=function(e){for(var t=br(e),n=[],i=t;i;i=i.$parent)(vr(i,"bpmn:SubProcess")||vr(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=s.flatMap(function(e){var i=n.findRoot(Yo(e))||n.findRoot(e.id);if(!i&&vr(e,"bpmn:Process")){var r=t.find(function(t){var n=br(t);return n&&n.get("processRef")===e});i=r&&n.findRoot(r.id)}return i?[{parent:e,parentPlane:i}]:[]});i.innerHTML="";var a=r.length>1;o.toggle("bjs-breadcrumbs-shown",a),r.forEach(function(e,t){var o,s=e.parent,a=e.parentPlane,l=Xo(s.name||s.id);t===r.length-1?o=Y('<li><span class="bjs-crumb" title="'+l+'">'+l+"</span></li>"):(o=Y('<li><a class="bjs-crumb" href="'+("#"+Xo(s.id))+'" title="'+l+'">'+l+"</a></li>")).addEventListener("click",function(e){e.preventDefault(),n.setRootElement(a)});i.appendChild(o)})}e.on("element.changed",function(e){var t=br(e.element);w(s,function(e){return e===t})&&a()}),e.on("root.set",function(e){a(e.element)})}function ts(e,t){var n=null,i=new ns;e.on("root.set",function(e){var r=e.element,o=t.viewbox(),s=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,vr(r,"bpmn:SubProcess")||s){s=s||{x:0,y:0,zoom:1};var a=(o.x-s.x)*o.scale,l=(o.y-s.y)*o.scale;0===a&&0===l||t.scroll({dx:a,dy:l}),s.zoom!==o.scale&&t.zoom(s.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){i.clear(),n=null})}function ns(){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}-1!==t&&this._entries.splice(t,1)}}es.$inject=["eventBus","elementRegistry","canvas"],ts.$inject=["eventBus","canvas"];var is=180,rs=160;function os(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(e,t){n._handleImport(t.definitions)})}function ss(e){return vr(e,"bpmndi:BPMNDiagram")?e:ss(e.$parent)}os.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}),e.diagrams.filter(e=>e.plane).flatMap(e=>t._createNewDiagrams(e.plane)).forEach(function(e){t._movePlaneElementsToOrigin(e.plane)})}},os.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach(function(t){var r=t.bpmnElement;if(r){var o=r.$parent;vr(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!vr(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(yr(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}});var r=[];return n.forEach(function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}}),i.forEach(function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t._moveToDiPlane(i,o.plane)}}),r},os.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(e){if(e.bounds){var n=pn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}}),hn(t)}(e),i=n.x-is,r=n.y-rs;t.forEach(function(e){e.waypoint?e.waypoint.forEach(function(e){e.x=e.x-i,e.y=e.y-r}):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)})},os.prototype._moveToDiPlane=function(e,t){var n=ss(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},os.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},os.$inject=["eventBus","moddle"];var as=250;function ls(e,t,n,i,r){Vo.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",as,function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)},!0),this.reverted("shape.toggleCollapse",as,function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)},!0),this.executed(["shape.create","shape.move","shape.delete"],as,function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;o._canDrillDown(i)&&o._addOverlay(i),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(i)},!0),this.reverted(["shape.create","shape.move","shape.delete"],as,function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;o._canDrillDown(i)&&o._addOverlay(i),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(i)},!0),t.on("import.render.complete",function(){n.filter(function(e){return o._canDrillDown(e)}).map(function(e){o._addOverlay(e)})})}e(ls,Vo),ls.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},ls.prototype._canDrillDown=function(e){var t=this._canvas;return vr(e,"bpmn:SubProcess")&&t.findRoot(Yo(e))},ls.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=br(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;te(i.html).toggle("bjs-drilldown-empty",!r)}},ls.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,i=br(e);n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var r=Y('<button type="button" class="bjs-drilldown"><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></button>'),o=i.get("name")||i.get("id"),s=this._translate("Open {element}",{element:o});r.setAttribute("title",s),r.addEventListener("click",function(){t.setRootElement(t.findRoot(Yo(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:r}),this._updateOverlayVisibility(e)},ls.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},ls.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var cs={__depends__:[No,jo,Ho],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",es],drilldownCentering:["type",ts],drilldownOverlayBehavior:["type",ls],subprocessCompatibility:["type",os]};function us(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function ps(e){return e.originalEvent||e.srcEvent}function hs(e){us(e),us(ps(e))}function ds(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 fs(){return/mac/i.test(navigator.platform)}function ms(e,t){return(ps(e)||e).button===t}function gs(e){return ms(e,0)}function vs(e){var t=ps(e)||e;return!!gs(e)&&(fs()?t.metaKey:t.ctrlKey)}function ys(e){var t=ps(e)||e;return gs(e)&&t.shiftKey}function bs(e){return!0}function ws(e){return gs(e)||function(e){return ms(e,1)}(e)}function xs(e,t,n){var i=this;function r(n,i,r){var o,s;(function(e,t){var n=l[e]||gs;return!n(t)})(n,i)||(r?s=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(s=o,r=t.get(s)),s&&r&&!1===e.fire(n,{element:r,gfx:s,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function s(e){return o[e]}var a={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":bs,"element.mousedown":ws,"element.mouseup":ws,"element.click":ws,"element.dblclick":ws};function c(e,t,n,i){var s=o[n]=function(e){r(n,e)};i&&(l[n]=i),s.$delegate=pe.bind(e,"svg, .djs-element",t,s)}function u(e,t,n){var i=s(n);i&&pe.unbind(e,t,i.$delegate)}e.on("canvas.destroy",function(e){!function(e){E(a,function(t,n){u(e,n,t)})}(e.svg)}),e.on("canvas.init",function(e){!function(e){E(a,function(t,n){c(e,n,t)})}(e.svg)}),e.on(["shape.added","connection.added"],function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})}),e.on(["shape.changed","connection.changed"],500,function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})}),e.on("interactionEvents.createHit",500,function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)}),e.on("interactionEvents.updateHit",function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)});var p=f("djs-hit djs-hit-stroke"),h=f("djs-hit djs-hit-click-stroke"),d={all:f("djs-hit djs-hit-all"),"click-stroke":h,stroke:p,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=q({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return be(e,n),e}function g(e,t){ge(e,t)}this.removeHits=function(e){E(fe(".djs-hit",e),ze)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=ot(t);return m(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=q({x:0,y:0},n);var i=Pe("rect");return m(i,t),be(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=de(".djs-hit",t);if(n)return e.waypoints?st(n,e.waypoints):be(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=a[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=s,this.registerEvent=c,this.unregisterEvent=u}xs.$inject=["eventBus","elementRegistry","styles"];var _s={__init__:["interactionEvents"],interactionEvents:["type",xs]};function Es(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=new Set;var n=this;e.on(["shape.remove","connection.remove"],function(e){var t=e.element;n.deselect(t)}),e.on(["diagram.clear","root.set"],function(e){n.select(null)})}Es.$inject=["eventBus","canvas"],Es.prototype.deselect=function(e){if(this._selectedElements.has(e)){var t=this.get();this._selectedElements.delete(e),this._eventBus.fire("selection.changed",{oldSelection:t,newSelection:this.get()})}},Es.prototype.get=function(){return Array.from(this._selectedElements)},Es.prototype.isSelected=function(e){return this._selectedElements.has(e)},Es.prototype.select=function(e,t){var n=this.get();d(e)||(e=e?[e]:[]);var i=this._canvas,r=i.getRootElement();e=e.filter(function(e){var t=i.findRoot(e);return r===t}),t?E(e,e=>{this._selectedElements.add(e)}):this._selectedElements=new Set(e),this._eventBus.fire("selection.changed",{oldSelection:n,newSelection:this.get()})};var Ss="hover",ks="selected";function Os(e,t){function n(t,n){e.addMarker(t,n)}function i(t,n){e.removeMarker(t,n)}this._canvas=e,t.on("element.hover",function(e){n(e.element,Ss)}),t.on("element.out",function(e){i(e.element,Ss)}),t.on("selection.changed",function(e){function t(e){i(e,ks)}function r(e){n(e,ks)}var o=new Set(e.oldSelection),s=new Set(e.newSelection);for(let e of o)s.has(e)||t(e);for(let e of s)o.has(e)||r(e)})}function Cs(e,t,n,i){e.on("create.end",500,function(e){var n=e.context,i=n.canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;d(o)?t.select(o):t.select(r.filter(Ps))}}),e.on("connect.end",500,function(e){var n=e.context.connection;n&&t.select(n)}),e.on("shape.move.end",500,function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);w(n,function(e){return r.id===e.id})||t.select(r)}),e.on("element.click",function(e){if(gs(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,s=ys(e);if(r&&o)return s?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,s)}})}function Ps(e){return!e.hidden}Os.$inject=["canvas","eventBus"],Cs.$inject=["eventBus","selection","canvas","elementRegistry"];var As={__init__:["selectionVisuals","selectionBehavior"],__depends__:[_s],selection:["type",Es],selectionVisuals:["type",Os],selectionBehavior:["type",Cs]};function Ts(e){$r.call(this,e)}e(Ts,$r),Ts.prototype._modules=[Ro,cs,No,As,Oo],Ts.prototype._moddleExtensions={};function Rs(e,t,n){this._selectionWasVisible=!1;const i=V(()=>{this._selectionWasVisible=r()},300);function r(){var e=n.get();if(!e.length)return!1;var i=ht(e),r=t.viewbox(),o=pn(i),s=pn(r);return o.left>=s.left&&o.right<=s.right&&o.top>=s.top&&o.bottom<=s.bottom}e.on("canvas.viewbox.changed",i),e.on("selection.changed",i),e.on("diagram.destroy",()=>{i.cancel()}),e.on("canvas.resized",()=>{var e=n.get();if(e.length&&this._selectionWasVisible&&!r()){var i=t.getRootElement();t.scrollToElement(e.concat(i))}}),this._flush=i.flush}Rs.$inject=["eventBus","canvas","selection"];var Ms={__init__:["keepSelectionVisible"],__depends__:[As],keepSelectionVisible:["type",Rs]},$s=["c","C"],Ds=["v","V"],Bs=["d","D"],Ls=["x","X"],Is=["y","Y"],Ns=["z","Z"];function zs(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function js(e,t){return-1!==(e=d(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)||-1!==e.indexOf(function(e){var t=e.key,n=/^Key([A-Z])$/.exec(e.code||"");if(!n||"string"!=typeof t)return null;var i=n[1];if(Vs.test(t))return e.shiftKey?i:i.toLowerCase();if(e.shiftKey&&Fs.test(t)&&e.keyCode===i.charCodeAt(0))return i;return null}(t))}var Vs=/^(?!\p{Script_Extensions=Latin}|\p{Script=Common})\p{Letter}$/u,Fs=/^\P{Letter}$/u;function qs(e){return e.shiftKey}function Hs(e){return zs(e)&&!qs(e)&&js(Ns,e)}function Ws(e){return zs(e)&&(js(Is,e)||js(Ns,e)&&qs(e))}var Qs="keyboard.keydown",Xs="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 Gs(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(Xs));var i=e&&!1!==e.bind;t.on("canvas.init",function(e){n._target=e.svg,i&&n.bind(),n._fire("init")})}Gs.$inject=["config.keyboard","eventBus"],Gs.prototype._keydownHandler=function(e){this._keyHandler(e,Qs)},Gs.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Gs.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Qs,n)&&e.preventDefault()}},Gs.prototype._isEventIgnored=function(e){return!1},Gs.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(Xs)),this.unbind(),e=this._node=this._target,ce.bind(e,"keydown",this._keydownHandler),ce.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Gs.prototype.getBinding=function(){return this._node},Gs.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ce.unbind(e,"keydown",this._keydownHandler),ce.unbind(e,"keyup",this._keyupHandler)),this._node=null},Gs.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Gs.prototype.addListener=function(e,t,n){g(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Qs,e,t)},Gs.prototype.removeListener=function(e,t){this._eventBus.off(t||Qs,e)},Gs.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Gs.prototype.isCmd=zs,Gs.prototype.isShift=qs,Gs.prototype.isKey=js;function Us(e,t){var n=this;e.on("editorActions.init",500,function(e){var i=e.editorActions;n.registerBindings(t,i)})}Us.$inject=["eventBus","keyboard"],Us.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",function(e){if(Hs(e.keyEvent))return t.trigger("undo"),!0}),n("redo",function(e){if(Ws(e.keyEvent))return t.trigger("redo"),!0}),n("copy",function(e){if(function(e){return zs(e)&&js($s,e)}(e.keyEvent))return t.trigger("copy"),!0}),n("paste",function(e){if(function(e){return zs(e)&&js(Ds,e)}(e.keyEvent))return t.trigger("paste"),!0}),n("duplicate",function(e){if(function(e){return zs(e)&&js(Bs,e)}(e.keyEvent))return t.trigger("duplicate"),!0}),n("cut",function(e){if(function(e){return zs(e)&&js(Ls,e)}(e.keyEvent))return t.trigger("cut"),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(js(["+","="],n)&&zs(n))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(js("-",n)&&zs(n))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(e){var n=e.keyEvent;if(js("0",n)&&zs(n))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(e){if(js(["Backspace","Delete"],e.keyEvent))return t.trigger("removeSelection"),!0})};var Ys={__init__:["keyboard","keyboardBindings"],keyboard:["type",Gs],keyboardBindings:["type",Us]},Ks={moveSpeed:50,moveSpeedAccelerated:200};function Zs(e,t,n){var i=this;this._config=q({},Ks,e||{}),t.addListener(function(e){var n=e.keyEvent,r=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","ArrowUp","ArrowDown","ArrowRight"],n)){var o,s=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":o="left";break;case"ArrowUp":o="up";break;case"ArrowRight":o="right";break;case"ArrowDown":o="down"}return i.moveCanvas({speed:s,direction:o}),!0}}),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}Zs.$inject=["config.keyboardMove","keyboard","canvas"];var Js={__depends__:[Ys],__init__:["keyboardMove"],keyboardMove:["type",Zs]},ea=/^djs-cursor-.*$/;function ta(e){var t=te(document.body);t.removeMatching(ea),e&&t.add("djs-cursor-"+e)}function na(){ta(null)}function ia(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function ra(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function oa(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sa(e,t,n){var i,r=!1!==(e=e||{}).enabled;function o(e){return l(e.originalEvent)}function s(e){var r,o=i.start,s=i.button,a=ds(e),l=oa(a,o);(!i.dragging&&(r=l,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(i.dragging=!0,0===s&&(i.untrap=ia(t)),ta("grab")),i.dragging)&&(l=oa(a,i.last||i.start),i.last=a,n.scroll({dx:l.x,dy:l.y}));e.preventDefault()}function a(e){ce.unbind(document,"mousemove",s),ce.unbind(document,"mouseup",a),!e&&i.untrap&&i.untrap(),i=null,na()}function l(e){if(r&&!re(e.target,".djs-draggable")){var t=e.button;if(!(t>=2||e.ctrlKey||e.shiftKey||e.altKey))return i={button:t,start:ds(e)},ce.bind(document,"mousemove",s),ce.bind(document,"mouseup",a),!0}}t.on("canvas.focus.changed",function(e){e.focused?t.on("element.mousedown",500,o):t.off("element.mousedown",o)}),t.on("diagram.destroy",function(){i&&a()}),this.isActive=function(){return!!i},this.toggle=function(e){return void 0===e&&(e=!r),!(r=e)&&i&&a(),r}}sa.$inject=["config.moveCanvas","eventBus","canvas"];var aa={__init__:["moveCanvas"],moveCanvas:["type",sa]};function la(e){return Math.log(e)/Math.log(10)}function ca(e,t){var n=la(e.min),i=la(e.max);return(Math.abs(n)+Math.abs(i))/t}var ua=Math.sign||function(e){return e>=0?1:-1},pa={min:.2,max:4};function ha(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=F(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75,this.toggle(!1!==e.enabled)}ha.$inject=["config.zoomScroll","eventBus","canvas"],ha.prototype.scroll=function(e){this._canvas.scroll(e)},ha.prototype.reset=function(){this._canvas.zoom("fit-viewport")},ha.prototype.zoom=function(e,t){var n=ca(pa,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},ha.prototype._handleWheel=function(e){if(this._enabled&&!re(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||fs()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var s=t.getBoundingClientRect(),a={x:e.clientX-s.left,y:e.clientY-s.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*ua(e.deltaY)*o,this.zoom(n,a)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},ha.prototype.stepZoom=function(e,t){var n=ca(pa,10);this._zoom(e,t,n)},ha.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=la(i.zoom()),s=Math.round(o/n)*n;s+=n*r;var a=Math.pow(10,s);i.zoom(function(e,t){return Math.max(e.min,Math.min(e.max,t))}(pa,a),t)},ha.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&ce[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e};var da={__init__:["zoomScroll"],zoomScroll:["type",ha]};function fa(e){Ts.call(this,e)}function ma(e){return e&&e[e.length-1]}function ga(e){return e.y}function va(e){return e.x}e(fa,Ts),fa.prototype._navigationModules=[Ms,Js,aa,da],fa.prototype._modules=[].concat(Ts.prototype._modules,fa.prototype._navigationModules);var ya={left:va,center:va,right:function(e){return e.x+e.width},top:ga,middle:ga,bottom:function(e){return e.y+e.height}};function ba(e,t){this._modeling=e,this._rules=t}ba.$inject=["modeling","rules"],ba.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},ba.prototype._isType=function(e,t){return-1!==t.indexOf(e)},ba.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),s=o.axis,a=o.dimension,l={},c={},u=!1;if(this._isType(e,["left","top"]))l[e]=t[0][s];else if(this._isType(e,["right","bottom"]))r=ma(t),l[e]=r[s]+r[a];else if(this._isType(e,["center","middle"])){if(E(t,function(e){var t=e[s]+Math.round(e[a]/2);c[t]?c[t].elements.push(e):c[t]={elements:[e],center:t}}),n=B(c,function(e){return e.elements.length>1&&(u=!0),e.elements.length}),u)return l[e]=ma(n).center,l;i=t[0],r=ma(t=B(t,function(e){return e[s]+e[a]})),l[e]=function(e,t){return Math.round((e[s]+t[s]+t[a])/2)}(i,r)}return l},ba.prototype.trigger=function(e,t){var n,i=this._modeling,r=_(e,function(e){return!(e.waypoints||e.host||e.labelTarget)});if(d(n=this._rules.allowed("elements.align",{elements:r}))&&(r=n),!(r.length<2)&&n){var o=B(r,ya[t]),s=this._alignmentPosition(t,o);i.alignElements(o,s)}};var wa={__init__:["alignElements"],alignElements:["type",ba]};const xa=new Mo;function _a(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(e=>{this.cancel(e)})})}_a.$inject=["eventBus"],_a.prototype.schedule=function(e,t=xa.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},_a.prototype._schedule=function(e,t){const n=function(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}(),i=setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(e){n.reject(e)}}catch(e){console.error("Scheduler#_schedule execution failed",e)}});return{executionId:i,promise:n.promise}},_a.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},_a.prototype._cancel=function(e){clearTimeout(e.executionId)};var Ea={scheduler:["type",_a]},Sa=".entry";function ka(e,t,n,i){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=i,this._current=null,this._init()}ka.$inject=["canvas","elementRegistry","eventBus","scheduler"],ka.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,i=n.length?1===n.length?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=d(r)?r:[r];if(o.filter(function(e){return n.includes(e)}).length){e.close();var s=o.filter(function(t){return e._elementRegistry.get(t.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;(d(i.target)?i.target:[i.target]).includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},ka.prototype._createContainer=function(){var e=Y('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},ka.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,function(e){e.providers.push(t)})},ka.prototype.getEntries=function(e){var t=this._getProviders(),n=d(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return E(t,function(t){if(g(t[n])){var r=t[n](e);g(r)?i=r(i):E(r,function(e,t){i[t]=e})}}),i},ka.prototype.trigger=function(e,t,n){var i,r,o=this,s=t.delegateTarget||t.target;return s?(i=J(s,"data-action"),r=t.originalEvent||t,"mouseover"!==e?"mouseout"===e?(clearTimeout(this._timeout),void(this._mouseout&&(this._mouseout(),this._mouseout=null))):this.triggerEntry(i,e,r,n):void(this._timeout=setTimeout(function(){o._mouseout=o.triggerEntry(i,"hover",r,n)},300))):t.preventDefault()},ka.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries[e];if(o){var s=o.action;if(!1!==this._eventBus.fire("contextPad.trigger",{entry:o,event:n})){if(g(s)){if("click"===t)return s(n,r,i)}else if(s[t])return s[t](n,r,i);n.preventDefault()}}}},ka.prototype.open=function(e,t){!t&&this.isOpen(e)||!1!==this._eventBus.fire("contextPad.open.allowed",{target:e})&&(this.close(),this._updateAndOpen(e))},ka.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ka.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this._createHtml(e);E(n,function(e,n){var r,o=e.group||"default",s=Y(e.html||'<div class="entry" draggable="true"></div>');J(s,"data-action",n),(r=de("[data-group="+Wo(o)+"]",i))||(J(r=Y('<div class="group"></div>'),"data-group",o),i.appendChild(r)),r.appendChild(s),e.className&&function(e,t){var n=te(e);(t=d(t)?t:t.split(/\s+/g)).forEach(function(e){n.add(e)})}(s,e.className),e.title&&J(s,"title",e.title),e.imageUrl&&(J(t=Y("<img>"),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",s.appendChild(t))}),te(i).add("open"),this._current={entries:n,html:i,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},ka.prototype._createHtml=function(e){var t=this,n=Y('<div class="djs-context-pad"></div>');return pe.bind(n,Sa,"click",function(e){t.trigger("click",e)}),pe.bind(n,Sa,"dragstart",function(e){t.trigger("dragstart",e)}),pe.bind(n,Sa,"mouseover",function(e){t.trigger("mouseover",e)}),pe.bind(n,Sa,"mouseout",function(e){t.trigger("mouseout",e)}),ce.bind(n,"mousedown",function(e){e.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},ka.prototype.getPad=function(e){let t;return 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")),t=this.isOpen()&&function(e,t){return e=d(e)?e:[e],t=d(t)?t:[t],e.length===t.length&&O(e,function(e){return t.includes(e)})}(this._current.target,e)?this._current.html:this._createHtml(e),{html:t}},ka.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},ka.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return d(e)===d(n)&&(d(e)?e.length===n.length&&O(e,function(e){return n.includes(e)}):n===e)},ka.prototype.isShown=function(){return this.isOpen()&&te(this._current.html).has("open")},ka.prototype.show=function(){this.isOpen()&&(te(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},ka.prototype.hide=function(){this.isOpen()&&(te(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},ka.prototype._getPosition=function(e){if(!d(e)&&an(e)){var t=this._canvas.viewbox(),n=(o=e).waypoints[o.waypoints.length-1],i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale;return{left:i+8*this._canvas.zoom(),top:r}}var o,s=this._canvas.getContainer().getBoundingClientRect(),a=this._getTargetBounds(e);return{left:a.right-s.left+8*this._canvas.zoom(),top:a.top-s.top}},ka.prototype._updatePosition=function(){this._scheduler.schedule(()=>{if(this.isOpen()){var e=this._current.html,t=this._getPosition(this._current.target);"x"in t&&"y"in t?(e.style.left=t.x+"px",e.style.top=t.y+"px"):["top","right","bottom","left"].forEach(function(n){n in t&&(e.style[n]=t[n]+"px")})}},"ContextPad#_updatePosition")},ka.prototype._updateVisibility=function(){this._scheduler.schedule(()=>{if(this.isOpen()){var e=this,t=this._current.target;(d(t)?t:[t]).some(function(t){return e._canvas.hasMarker(t,"djs-element-hidden")})?e.hide():e.show()}},"ContextPad#_updateVisibility")},ka.prototype._getTargetBounds=function(e){var t=this;return(d(e)?e:[e]).map(function(e){return t._canvas.getGraphics(e)}).reduce(function(e,t){const n=t.getBoundingClientRect();return e.top=Math.min(e.top,n.top),e.right=Math.max(e.right,n.right),e.bottom=Math.max(e.bottom,n.bottom),e.left=Math.min(e.left,n.left),e.x=e.left,e.y=e.top,e.width=e.right-e.left,e.height=e.bottom-e.top,e},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};var Oa,Ca,Pa,Aa,Ta,Ra,Ma,$a,Da,Ba,La,Ia,Na,za,ja={__depends__:[_s,Ea,No],contextPad:["type",ka]},Va={},Fa=[],qa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ha=Array.isArray;function Wa(e,t){for(var n in t)e[n]=t[n];return e}function Qa(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Xa(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Oa.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Ga(e,s,i,r,null)}function Ga(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:null==r?++Pa:r,__i:-1,__u:0};return null==r&&null!=Ca.vnode&&Ca.vnode(o),o}function Ua(e){return e.children}function Ya(e,t){this.props=e,this.context=t}function Ka(e,t){if(null==t)return e.__?Ka(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Ka(e):null}function Za(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,i=[],r=[],o=Wa({},t);o.__v=t.__v+1,Ca.vnode&&Ca.vnode(o),ll(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,i,null==n?Ka(t):n,!!(32&t.__u),r),o.__v=t.__v,o.__.__k[o.__i]=o,ul(i,o,r),t.__e=t.__=null,o.__e!=n&&Ja(o)}}function Ja(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),Ja(e)}function el(e){(!e.__d&&(e.__d=!0)&&Aa.push(e)&&!tl.__r++||Ta!=Ca.debounceRendering)&&((Ta=Ca.debounceRendering)||Ra)(tl)}function tl(){try{for(var e,t=1;Aa.length;)Aa.length>t&&Aa.sort(Ma),e=Aa.shift(),t=Aa.length,Za(e)}finally{Aa.length=tl.__r=0}}function nl(e,t,n,i,r,o,s,a,l,c,u){var p,h,d,f,m,g,v=i&&i.__k||Fa,y=t.length;for(l=function(e,t,n,i,r){var o,s,a,l,c,u=n.length,p=u,h=0;for(e.__k=new Array(r),o=0;o<r;o++)null!=(s=t[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[o]=Ga(null,s,null,null,null):Ha(s)?s=e.__k[o]=Ga(Ua,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[o]=Ga(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,l=o+h,s.__=e,s.__b=e.__b+1,a=null,-1!=(c=s.__i=rl(s,n,l,p))&&(p--,(a=n[c])&&(a.__u|=2)),null==a||null==a.__v?(-1==c&&(r>u?h--:r<u&&h++),"function"!=typeof s.type&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):e.__k[o]=null;if(p)for(o=0;o<u;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==i&&(i=Ka(a)),dl(a,a));return i}(n,t,v,l,y),p=0;p<y;p++)null!=(d=n.__k[p])&&(h=-1!=d.__i&&v[d.__i]||Va,d.__i=p,g=ll(e,d,h,r,o,s,a,l,c,u),f=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&hl(h.ref,null,d),u.push(d.ref,d.__c||f,d)),null==m&&null!=f&&(m=f),4&d.__u?(l=il(d,l,e),h.__e&&(h.__e=null)):"function"==typeof d.type&&void 0!==g?l=g:f&&(l=f.nextSibling),d.__u&=-7);return n.__e=m,l}function il(e,t,n){var i,r;if("function"==typeof e.type){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=il(i[r],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=Ka(e)),t=n.insertBefore(e.__e,t||null));do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function rl(e,t,n,i){var r,o,s,a=e.key,l=e.type,c=t[n],u=null!=c&&!(2&c.__u);if(null===c&&null==a||u&&a==c.key&&l==c.type)return n;if(i>(u?1:0))for(r=n-1,o=n+1;r>=0||o<t.length;)if(null!=(c=t[s=r>=0?r--:o++])&&!(2&c.__u)&&a==c.key&&l==c.type)return s;return-1}function ol(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||qa.test(t)?n:n+"px"}function sl(e,t,n,i,r){var o,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||ol(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||ol(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(La,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n[Ba]=i[Ba]:(n[Ba]=Ia,e.addEventListener(t,o?za:Na,o)):e.removeEventListener(t,o?za:Na,o);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function al(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[Da])t[Da]=Ia++;else if(t[Da]<n[Ba])return;return n(Ca.event?Ca.event(t):t)}}}function ll(e,t,n,i,r,o,s,a,l,c){var u,p,h,d,f,m,g,v,y,b,w,x,_,E,S,k,O=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=t.__e=n.__e]),(u=Ca.__b)&&u(t);e:if("function"==typeof O){p=s.length;try{if(y=t.props,b=O.prototype&&O.prototype.render,w=(u=O.contextType)&&i[u.__c],x=u?w?w.props.value:u.__:i,n.__c?v=(h=t.__c=n.__c).__=h.__E:(b?t.__c=h=new O(y,x):(t.__c=h=new Ya(y,x),h.constructor=O,h.render=fl),w&&w.sub(h),h.state||(h.state={}),h.__n=i,d=h.__d=!0,h.__h=[],h._sb=[]),b&&null==h.__s&&(h.__s=h.state),b&&null!=O.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=Wa({},h.__s)),Wa(h.__s,O.getDerivedStateFromProps(y,h.__s))),f=h.props,m=h.state,h.__v=t,d)b&&null==O.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),b&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(b&&null==O.getDerivedStateFromProps&&y!==f&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,x),t.__v==n.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,x)){t.__v!=n.__v&&(h.props=y,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),Fa.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&s.push(h),a=Ka(n);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,x),b&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(f,m,g)})}if(h.context=x,h.props=y,h.__P=e,h.__e=!1,_=Ca.__r,E=0,b)h.state=h.__s,h.__d=!1,_&&_(t),u=h.render(h.props,h.state,h.context),Fa.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,_&&_(t),u=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++E<25);h.state=h.__s,null!=h.getChildContext&&(i=Wa(Wa({},i),h.getChildContext())),b&&!d&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(f,m)),S=null!=u&&u.type===Ua&&null==u.key?pl(u.props.children):u,a=nl(e,Ha(S)?S:[S],t,n,i,r,o,s,a,l,c),h.base=t.__e,t.__u&=-161,h.__h.length&&s.push(h),v&&(h.__E=h.__=null)}catch(e){if(s.length=p,t.__v=null,l||null!=o){if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=o&&(o[o.indexOf(a)]=null),t.__e=a}else if(null!=o)for(k=o.length;k--;)Qa(o[k])}else t.__e=n.__e;null==t.__k&&(t.__k=n.__k||[]),e.then||cl(t),Ca.__e(e,t,n)}}else null==o&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=function(e,t,n,i,r,o,s,a,l){var c,u,p,h,d,f,m,g=n.props||Va,v=t.props,y=t.type;if("svg"==y?r="http://www.w3.org/2000/svg":"math"==y?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=o)for(c=0;c<o.length;c++)if((d=o[c])&&"setAttribute"in d==!!y&&(y?d.localName==y:3==d.nodeType)){e=d,o[c]=null;break}if(null==e){if(null==y)return document.createTextNode(v);e=document.createElementNS(r,y,v.is&&v),a&&(Ca.__m&&Ca.__m(t,o),a=!1),o=null}if(null==y)g===v||a&&e.data==v||(e.data=v);else{if(o="textarea"==y&&null!=v.defaultValue?null:o&&Oa.call(e.childNodes),!a&&null!=o)for(g={},c=0;c<e.attributes.length;c++)g[(d=e.attributes[c]).name]=d.value;for(c in g)d=g[c],"dangerouslySetInnerHTML"==c?p=d:"children"==c||c in v||"value"==c&&"defaultValue"in v||"checked"==c&&"defaultChecked"in v||sl(e,c,null,d,r);for(c in v)d=v[c],"children"==c?h=d:"dangerouslySetInnerHTML"==c?u=d:"value"==c?f=d:"checked"==c?m=d:a&&"function"!=typeof d||g[c]===d||sl(e,c,d,g[c],r);if(u)a||p&&(u.__html==p.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(p&&(e.innerHTML=""),nl("template"==t.type?e.content:e,Ha(h)?h:[h],t,n,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&Ka(n,0),a,l),null!=o)for(c=o.length;c--;)Qa(o[c]);a&&"textarea"!=y||(c="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[c]||"progress"==y&&!f||"option"==y&&f!=g[c])&&sl(e,c,f,g[c],r),c="checked",null!=m&&m!=e[c]&&sl(e,c,m,g[c],r))}return e}(n.__e,t,n,i,r,o,s,l,c);return(u=Ca.diffed)&&u(t),128&t.__u?void 0:a}function cl(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(cl))}function ul(e,t,n){for(var i=0;i<n.length;i++)hl(n[i],n[++i],n[++i]);Ca.__c&&Ca.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){Ca.__e(e,t.__v)}})}function pl(e){return"object"!=typeof e||null==e||e.__b>0?e:Ha(e)?e.map(pl):void 0!==e.constructor?null:Wa({},e)}function hl(e,t,n){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Ca.__e(e,n)}}function dl(e,t,n){var i,r;if(Ca.unmount&&Ca.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||hl(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Ca.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&dl(i[r],t,n||"function"!=typeof e.type);n||Qa(e.__e),e.__c=e.__=e.__e=void 0}function fl(e,t,n){return this.constructor(e,n)}function ml(e,t,n){var i,r,o;t==document&&(t=document.documentElement),Ca.__&&Ca.__(e,t),i=!1?null:t.__k,r=[],o=[],ll(t,e=t.__k=Xa(Ua,null,[e]),i||Va,Va,t.namespaceURI,i?null:t.firstChild?Oa.call(t.childNodes):null,r,i?i.__e:t.firstChild,false,o),ul(r,e,o),e.props.children=null}Oa=Fa.slice,Ca={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},Pa=0,Ya.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Wa({},this.state),"function"==typeof e&&(e=e(Wa({},n),this.props)),e&&Wa(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),el(this))},Ya.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),el(this))},Ya.prototype.render=Ua,Aa=[],Ra="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ma=function(e,t){return e.__v.__b-t.__v.__b},tl.__r=0,$a=Math.random().toString(8),Da="__d"+$a,Ba="__a"+$a,La=/(PointerCapture)$|Capture$/i,Ia=0,Na=al(!1),za=al(!0);var gl=function(e,t,n,i){var r;t[0]=0;for(var o=1;o<t.length;o++){var s=t[o++],a=t[o]?(t[0]|=s?1:2,n[t[o++]]):t[++o];3===s?i[0]=a:4===s?i[1]=Object.assign(i[1]||{},a):5===s?(i[1]=i[1]||{})[t[++o]]=a:6===s?i[1][t[++o]]+=a+"":s?(r=e.apply(a,gl(e,a,n,["",null])),i.push(r),a[0]?t[0]|=2:(t[o-2]=0,t[o]=r)):i.push(a)}return i},vl=new Map;var yl,bl,wl,xl,_l=function(e){var t=vl.get(this);return t||(t=new Map,vl.set(this,t)),(t=gl(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,i=1,r="",o="",s=[0],a=function(e){1===i&&(e||(r=r.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(0,e,r):3===i&&(e||r)?(s.push(3,e,r),i=2):2===i&&"..."===r&&e?s.push(4,e,0):2===i&&r&&!e?s.push(5,0,!0,r):i>=5&&((r||!e&&5===i)&&(s.push(i,0,r,n),i=6),e&&(s.push(i,e,0,n),i=6)),r=""},l=0;l<e.length;l++){l&&(1===i&&a(),a(l));for(var c=0;c<e[l].length;c++)t=e[l][c],1===i?"<"===t?(a(),s=[s],i=3):r+=t:4===i?"--"===r&&">"===t?(i=1,r=""):r=t+r[0]:o?t===o?o="":r+=t:'"'===t||"'"===t?o=t:">"===t?(a(),i=1):i&&("="===t?(i=5,n=r,r=""):"/"===t&&(i<5||">"===e[l][c+1])?(a(),3===i&&(s=s[0]),i=s,(s=s[0]).push(2,0,i),i=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),i=2):r+=t),3===i&&"!--"===r&&(i=4,s=s[0])}return a(),s}(e)),t),arguments,[])).length>1?t:t[0]}.bind(Xa),El=0,Sl=[],kl=Ca,Ol=kl.__b,Cl=kl.__r,Pl=kl.diffed,Al=kl.__c,Tl=kl.unmount,Rl=kl.__;function Ml(e,t){kl.__h&&kl.__h(bl,e,El||t),El=0;var n=bl.__H||(bl.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function $l(e){return El=1,function(e,t){var n=Ml(yl++,2);if(n.t=e,!n.__c&&(n.__=[Wl(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],i=n.t(t,e);t!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=bl,!bl.__f)){var i=function(e,t,i){if(!n.__c.__H)return!0;var o=!1,s=n.__c.props!==e;if(n.__c.__H.__.some(function(e){if(e.__N){o=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),r){var a=r.call(this,e,t,i);return o?a||s:a}return!o||s};bl.__f=!0;var r=bl.shouldComponentUpdate,o=bl.componentWillUpdate;bl.componentWillUpdate=function(e,t,n){if(this.__e){var s=r;r=void 0,i(e,t,n),r=s}o&&o.call(this,e,t,n)},bl.shouldComponentUpdate=i}return n.__N||n.__}(Wl,e)}function Dl(e,t){var n=Ml(yl++,3);!kl.__s&&Hl(n.__H,t)&&(n.__=e,n.u=t,bl.__H.__h.push(n))}function Bl(e,t){var n=Ml(yl++,4);!kl.__s&&Hl(n.__H,t)&&(n.__=e,n.u=t,bl.__h.push(n))}function Ll(e){return El=5,Il(function(){return{current:e}},[])}function Il(e,t){var n=Ml(yl++,7);return Hl(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Nl(e,t){return El=8,Il(function(){return e},t)}function zl(){for(var e;e=Sl.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Fl),t.__h.some(ql),t.__h=[]}catch(n){t.__h=[],kl.__e(n,e.__v)}}}kl.__b=function(e){bl=null,Ol&&Ol(e)},kl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Rl&&Rl(e,t)},kl.__r=function(e){Cl&&Cl(e),yl=0;var t=(bl=e.__c).__H;t&&(wl===bl?(t.__h=[],bl.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Fl),t.__h.some(ql),t.__h=[],yl=0)),wl=bl},kl.diffed=function(e){Pl&&Pl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Sl.push(t)&&xl===kl.requestAnimationFrame||((xl=kl.requestAnimationFrame)||Vl)(zl)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),wl=bl=null},kl.__c=function(e,t){t.some(function(e){try{e.__h.some(Fl),e.__h=e.__h.filter(function(e){return!e.__||ql(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],kl.__e(n,e.__v)}}),Al&&Al(e,t)},kl.unmount=function(e){Tl&&Tl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Fl(e)}catch(e){t=e}}),n.__H=void 0,t&&kl.__e(t,n.__v))};var jl="function"==typeof requestAnimationFrame;function Vl(e){var t,n=function(){clearTimeout(i),jl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);jl&&(t=requestAnimationFrame(n))}function Fl(e){var t=bl,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),bl=t}function ql(e){var t=bl;e.__c=e.__(),bl=t}function Hl(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Wl(e,t){return"function"==typeof t?t(e):t}function Ql(e){const{navigationStack:t,setNavigationStack:n}=e,i=Il(()=>t.length<=1?[]:t.slice(0,-1).map((e,t)=>({label:e.label,onClick:()=>n(e=>e.slice(0,t+1))})),[t,n]),r=t.length>0?()=>n([]):null,o=t.length>0?t[t.length-1].label:null;return _l`
3
+ <div class="djs-popup-breadcrumbs">
4
+ ${r&&_l`
5
+ <button
6
+ type="button"
7
+ class="djs-popup-breadcrumbs-item djs-popup-breadcrumbs-item--back"
8
+ title="Back"
9
+ aria-label="Back"
10
+ onClick=${r}
11
+ >
12
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
13
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.03033 1.46967C8.32322 1.76256 8.32322 2.23744 8.03033 2.53033L4.56066 6L8.03033 9.46967C8.32322 9.76256 8.32322 10.2374 8.03033 10.5303C7.73744 10.8232 7.26256 10.8232 6.96967 10.5303L2.96967 6.53033C2.67678 6.23744 2.67678 5.76256 2.96967 5.46967L6.96967 1.46967C7.26256 1.17678 7.73744 1.17678 8.03033 1.46967Z" fill="currentColor"/>
14
+ </svg>
15
+ </button>
16
+ `}
17
+ ${i.map((e,t)=>_l`
18
+ <button
19
+ key=${t}
20
+ type="button"
21
+ class="djs-popup-breadcrumbs-item"
22
+ onClick=${e.onClick}
23
+ title=${e.label}
24
+ >
25
+ ${e.label}
26
+ </button>
27
+ <span class="djs-popup-breadcrumbs-item--separator" aria-hidden="true"></span>
28
+ `)}
29
+ ${o&&_l`
30
+ <span class="djs-popup-breadcrumbs-item djs-popup-breadcrumbs-item--current" title=${o}>
31
+ ${o}
32
+ </span>
33
+ `}
34
+ </div>
35
+ `}function Xl(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Xl(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Gl(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Xl(e))&&(i&&(i+=" "),i+=t);return i}function Ul(e){const{headerEntries:t,onSelect:n,selectedEntry:i,setSelectedEntry:r,title:o}=e,s=Il(()=>t.reduce((e,t)=>{const n=t.group||"default",i=e.find(e=>e.id===n);return i?i.entries.push(t):e.push({id:n,entries:[t]}),e},[]),[t]),a=e=>e.action&&!e.disabled;return _l`
36
+ <div class="djs-popup-header">
37
+ <h3 class="djs-popup-title" title=${o}>${o}</h3>
38
+ ${s.map(e=>_l`
39
+ <ul key=${e.id} class="djs-popup-header-group" data-header-group=${e.id}>
40
+
41
+ ${e.entries.map(e=>_l`
42
+ <li key=${e.id}>
43
+ <${a(e)?"button":"span"}
44
+ class=${function(e,t){return Gl("entry",e.className,e.active?"active":"",e.disabled?"disabled":"",t?"selected":"")}(e,e===i)}
45
+ onClick=${t=>((e,t)=>{if(a(t))return n(e,t)})(t,e)}
46
+ title=${e.title||e.label}
47
+ data-id=${e.id}
48
+ aria-disabled=${e.disabled||void 0}
49
+ onMouseEnter=${()=>a(e)&&r(e)}
50
+ onMouseLeave=${()=>a(e)&&r(null)}
51
+ onFocus=${()=>a(e)&&r(e)}
52
+ onBlur=${()=>a(e)&&r(null)}
53
+ >
54
+ ${e.imageUrl&&_l`<img class="djs-popup-entry-icon" src=${e.imageUrl} alt="" />`||e.imageHtml&&_l`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:e.imageHtml}} />`}
55
+ ${e.label?_l`
56
+ <span class="djs-popup-label">${e.label}</span>
57
+ `:null}
58
+ </${e.action?"button":"span"}>
59
+ </li>
60
+ `)}
61
+ </ul>
62
+ `)}
63
+ </div>
64
+ `}function Yl(e,t){return`${e}-entry-${t.id}`}function Kl(e){const{idPrefix:t,entry:n,selected:i,onMouseEnter:r,onMouseMove:o,onMouseLeave:s,onAction:a}=e,l=(e,t)=>{if(!n.disabled)return a(e,n,t)},c=!n.entries;return _l`
65
+ <li
66
+ class=${Gl("entry",{selected:i,disabled:n.disabled})}
67
+ data-id=${n.id}
68
+ id=${Yl(t,n)}
69
+ role="option"
70
+ aria-selected=${i||void 0}
71
+ aria-haspopup=${n.entries?"true":void 0}
72
+ title=${n.title}
73
+ aria-disabled=${n.disabled||void 0}
74
+ onClick=${l}
75
+ onMouseEnter=${r}
76
+ onMouseMove=${o}
77
+ onMouseLeave=${s}
78
+ onDragStart=${e=>c&&l(e,"dragstart")}
79
+ draggable=${c}
80
+ >
81
+ <div class="djs-popup-entry-content">
82
+ <span
83
+ class=${Gl("djs-popup-entry-name",n.className)}
84
+ >
85
+ ${n.imageUrl&&_l`<img class="djs-popup-entry-icon" src=${n.imageUrl} alt="" />`||n.imageHtml&&_l`<div class="djs-popup-entry-icon" dangerouslySetInnerHTML=${{__html:n.imageHtml}} />`}
86
+
87
+ ${n.label?_l`
88
+ <span class="djs-popup-label">
89
+ ${n.label}
90
+ </span>
91
+ `:null}
92
+ </span>
93
+ ${n.description&&_l`
94
+ <span
95
+ class="djs-popup-entry-description"
96
+ >
97
+ ${n.description}
98
+ </span>
99
+ `}
100
+ </div>
101
+ ${(n.documentationRef||n.entries)&&_l`
102
+ <div class="djs-popup-entry-actions">
103
+ ${n.documentationRef&&_l`
104
+ <a
105
+ class="djs-popup-entry-docs"
106
+ href=${n.documentationRef}
107
+ onClick=${e=>e.stopPropagation()}
108
+ title="Open entry documentation"
109
+ tabIndex="-1"
110
+ aria-hidden="true"
111
+ target="_blank"
112
+ rel="noopener"
113
+ >
114
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
115
+ <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="currentColor"/>
116
+ </svg>
117
+ </a>
118
+ `}
119
+ ${n.entries&&_l`
120
+ <div class="djs-popup-entry-chevron" aria-hidden="true">
121
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
122
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.96967 1.46967C4.26256 1.17678 4.73744 1.17678 5.03033 1.46967L9.03033 5.46967C9.32322 5.76256 9.32322 6.23744 9.03033 6.53033L5.03033 10.5303C4.73744 10.8232 4.26256 10.8232 3.96967 10.5303C3.67678 10.2374 3.67678 9.76256 3.96967 9.46967L7.43934 6L3.96967 2.53033C3.67678 2.23744 3.67678 1.76256 3.96967 1.46967Z" fill="currentColor"/>
123
+ </svg>
124
+ </div>
125
+ `}
126
+ </div>
127
+ `}
128
+ </li>
129
+ `}function Zl(e){const{selectedEntry:t,setSelectedEntry:n,groupedEntries:i,keyboardSelection:r,onPointerInteraction:o,idPrefix:s,id:a,ariaLabel:l,tabIndex:c,ariaActivedescendant:u,...p}=e,h=Ll();Bl(()=>{if(!r||!r.current)return;const e=h.current;if(!e)return;const t=e.querySelector(".selected");var n;t&&("function"==typeof(n=t).scrollIntoViewIfNeeded?n.scrollIntoViewIfNeeded():n.scrollIntoView({scrollMode:"if-needed",block:"nearest"}))},[t]);const d=()=>{r.current||n(null)};return _l`
130
+ <div
131
+ class="djs-popup-results"
132
+ ref=${h}
133
+ id=${a}
134
+ role="listbox"
135
+ aria-label=${l}
136
+ tabIndex=${c}
137
+ aria-activedescendant=${u}
138
+ onMouseMove=${()=>{r.current=!1,o()}}
139
+ >
140
+ ${i.map(e=>_l`
141
+ ${e.name&&_l`
142
+ <div key=${e.id} id=${Jl(s,e)} class="entry-header" title=${e.name}>
143
+ ${e.name}
144
+ </div>
145
+ `}
146
+ <ul
147
+ class="djs-popup-group"
148
+ data-group=${e.id}
149
+ role="group"
150
+ aria-labelledby=${e.name?Jl(s,e):void 0}
151
+ >
152
+ ${e.entries.map(e=>_l`
153
+ <${Kl}
154
+ key=${e.id}
155
+ idPrefix=${s}
156
+ entry=${e}
157
+ selected=${e===t}
158
+ onMouseEnter=${()=>(e=>{r.current||n(e)})(e)}
159
+ onMouseMove=${()=>(e=>{e!==t&&n(e)})(e)}
160
+ onMouseLeave=${d}
161
+ ...${p}
162
+ />
163
+ `)}
164
+ </ul>
165
+ `)}
166
+ </div>
167
+ `}function Jl(e,t){return`${e}-group-${t.id}`}const ec=new Mo("djs-popup");function tc(e){const{onClose:t,onSelect:n,className:i,headerEntries:r,position:o,title:s,width:a,scale:l,search:c,emptyPlaceholder:u,searchFn:h,entries:d,onOpened:f,onClosed:m,defaultTab:v}=e,[y,b]=$l([]);Dl(()=>{b([]),_(null)},[d]);const w=Il(()=>{const e=[],t=new Set;let n=!1;return d.forEach(({tab:i})=>{i?t.has(i.id)||(t.add(i.id),e.push(i)):n=!0}),e.length?n&&!v?[]:n?[v,...e.filter(e=>e.id!==v.id)]:e:[]},[d,v]),[x,_]=$l(null),E=w.some(e=>e.id===x)?x:w.length?w[0].id:null,S=Ll();Bl(()=>{const e=S.current;if(!e)return;const t=e.querySelector('[aria-selected="true"]');t&&nc(t)},[E]);const[k,O]=$l({start:!1,end:!1}),C=Nl(()=>{const{scrollLeft:e,scrollWidth:t,clientWidth:n}=S.current;O({start:e>0,end:t-n-e>1})},[]),P=Nl(e=>{const t=S.current,n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(!n)return;const{scrollLeft:i,scrollWidth:r,clientWidth:o}=t;r-o<1||(e.preventDefault(),t.scrollLeft=i+n,C())},[C]);Bl(()=>{const e=S.current;if(e)return C(),e.addEventListener("scroll",C),e.addEventListener("wheel",P,{passive:!1}),()=>{e.removeEventListener("scroll",C),e.removeEventListener("wheel",P)}},[w,E,C,P]);const A=Nl(e=>{const t=S.current,n=e>0?[...t.children]:[...t.children].reverse(),i=t.getBoundingClientRect(),r=n.find(t=>{const n=t.getBoundingClientRect();return e>0?n.right>i.right+1:n.left<i.left-1});r&&(nc(r),C())},[C]),T=Nl(e=>e.tab&&e.tab.id||v&&v.id,[v]),[R,M]=$l(""),$=R.trim().length>0,D=Il(()=>function(e){const t=[];function n(e){e.forEach(e=>{e.entries?n(e.entries):t.push(e)})}return n(e),t}(d),[d]),B=Il(()=>!!p(c)&&D.length>5,[c,D]),L=Il(()=>{const e=y.length?y[y.length-1].entries:w.length>1?d.filter(e=>T(e)===E):d;return B?$?h(D.filter(({searchable:e})=>!1!==e),R,{keys:["label","search","description"]}).map(({item:e})=>e):e.filter(({rank:e=0})=>e>=0):e},[B,$,D,R,h,y,d,w,E,T]),I=Il(()=>$?L.length?[{id:"default",entries:L}]:[]:function(e){const t=[],n=e=>t.find(t=>e.id===t.id),i=e=>!!n(e),r=e=>"string"==typeof e?{id:e}:e;return e.forEach(e=>{const o=e.group?r(e.group):{id:"default"};i(o)?n(o).entries.push(e):t.push({...o,entries:[e]})}),t}(L),[L,$]),[N,z]=$l(L[0]),j=Ll(null),V=Ll(!1),[F,q]=$l("keyboard"),H=Nl(()=>{q("keyboard")},[]),W=Nl(()=>{q("pointer")},[]),Q=Il(()=>ec.next(),[]),X=`${Q}-results`,G=N&&Yl(Q,N);Dl(()=>{const e=j.current;e&&L.includes(e)?z(e):z(L[0]),j.current=null},[L]);const U=Nl(e=>{const t=function(e){const t=[];return e.forEach(e=>{e.entries.forEach(e=>{t.push(e)})}),t}(I);let n=t.indexOf(N)+e;n<0&&(n=t.length-1),n>=t.length&&(n=0),V.current=!0,z(t[n])},[I,N]),Y=Nl(e=>{e>0&&N&&N.entries&&(V.current=!0,b(e=>[...e,N])),e<0&&y.length>0&&(V.current=!0,j.current=y[y.length+e],b(t=>t.slice(0,e)))},[N,y]),K=Nl((e,t,i)=>{if(t&&!t.disabled)return t.entries?(e.preventDefault(),Y(1)):n(e,t,i)},[n,Y]),Z=Nl(e=>{if("Enter"===e.key&&N){if(!!re(e.target,"a, button",!0))return;if(N.disabled)return;return K(e,N)}if("Backspace"===e.key){const t=e.target;if(!(he(t,"input")&&""!==t.value))return Y(-1),e.preventDefault()}return"ArrowUp"===e.key?(U(-1),e.preventDefault()):"ArrowDown"===e.key?(U(1),e.preventDefault()):"ArrowRight"===e.key?(Y(1),e.preventDefault()):"ArrowLeft"===e.key?(Y(-1),e.preventDefault()):void 0},[N,U,Y,K]),J=Nl((e,t)=>{if(_(t),!e.detail)return;const n=re(e.currentTarget,".djs-popup",!0),i=n&&n.querySelector("input");i&&i.focus()},[]),ee=Nl(e=>{if("Enter"===e.key||" "===e.key)return void e.stopPropagation();if("ArrowDown"===e.key||"ArrowUp"===e.key){const t=re(e.currentTarget,".djs-popup",!0),n=t.querySelector("input")||t.querySelector('[role="listbox"]');return void(n&&n.focus())}const t=w.findIndex(e=>e.id===E);let n;if("ArrowLeft"===e.key)n=(t-1+w.length)%w.length;else if("ArrowRight"===e.key)n=(t+1)%w.length;else if("Home"===e.key)n=0;else{if("End"!==e.key)return;n=w.length-1}e.preventDefault(),e.stopPropagation(),_(w[n].id);const i=e.currentTarget.parentNode,r=i&&i.children[n];r&&r.focus()},[w,E]),te=Nl(e=>{he(e.target,"input")&&M(()=>e.target.value)},[M]);Dl(()=>(f(),()=>{m()}),[]);const ne=!$&&y.length>0,ie=w.length>1&&!$&&0===y.length,oe=(s||r.length>0)&&!ne;return _l`
168
+ <${ic}
169
+ onClose=${t}
170
+ onKeyup=${te}
171
+ onKeydown=${Z}
172
+ className=${i}
173
+ position=${o}
174
+ width=${a}
175
+ scale=${l}
176
+ navigationStack=${y}
177
+ interactionMode=${F}
178
+ onKeyboardInteraction=${H}
179
+ >
180
+ ${oe&&_l`
181
+ <${Ul}
182
+ headerEntries=${r}
183
+ onSelect=${n}
184
+ selectedEntry=${N}
185
+ setSelectedEntry=${z}
186
+ title=${s}
187
+ />
188
+ `}
189
+ ${ne&&_l`
190
+ <${Ql}
191
+ navigationStack=${y}
192
+ setNavigationStack=${b}
193
+ />
194
+ `}
195
+ ${d.length>0&&_l`
196
+ <div class="djs-popup-body">
197
+
198
+ ${B&&_l`
199
+ <div class="djs-popup-search">
200
+ <svg class="djs-popup-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
201
+ <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"/>
202
+ </svg>
203
+ <input
204
+ type="text"
205
+ spellcheck=${!1}
206
+ role="combobox"
207
+ aria-label="${s||"Search"}"
208
+ aria-expanded="true"
209
+ aria-controls=${X}
210
+ aria-activedescendant=${G||void 0}
211
+ aria-autocomplete="list"
212
+ />
213
+ </div>
214
+ `}
215
+
216
+ ${ie&&_l`
217
+ <div class="djs-popup-tabs-container">
218
+ <div class="djs-popup-tabs" ref=${S} role="tablist">
219
+ ${w.map(e=>_l`
220
+ <button
221
+ type="button"
222
+ class="djs-popup-tab"
223
+ role="tab"
224
+ title=${e.title||void 0}
225
+ aria-controls=${X}
226
+ aria-selected=${e.id===E}
227
+ tabIndex=${e.id===E?0:-1}
228
+ onClick=${t=>J(t,e.id)}
229
+ onKeydown=${ee}
230
+ >${e.label}</button>
231
+ `)}
232
+ </div>
233
+
234
+ ${""}
235
+ ${[-1,1].map(e=>(e<0?k.start:k.end)&&_l`
236
+ <button
237
+ type="button"
238
+ class=${"djs-popup-tabs-scroll djs-popup-tabs-scroll-"+(e<0?"start":"end")}
239
+ aria-hidden="true"
240
+ tabIndex="-1"
241
+ onMousedown=${e=>e.preventDefault()}
242
+ onClick=${()=>A(e)}
243
+ >
244
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
245
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.96967 1.46967C4.26256 1.17678 4.73744 1.17678 5.03033 1.46967L9.03033 5.46967C9.32322 5.76256 9.32322 6.23744 9.03033 6.53033L5.03033 10.5303C4.73744 10.8232 4.26256 10.8232 3.96967 10.5303C3.67678 10.2374 3.67678 9.76256 3.96967 9.46967L7.43934 6L3.96967 2.53033C3.67678 2.23744 3.67678 1.76256 3.96967 1.46967Z" fill="currentColor"/>
246
+ </svg>
247
+ </button>
248
+ `)}
249
+ </div>
250
+ `}
251
+
252
+ ${$&&_l`
253
+ <div class="djs-popup-search-count" aria-live="polite">
254
+ ${L.length} ${1===L.length?"result":"results"} found
255
+ </div>
256
+ `}
257
+
258
+ <${Zl}
259
+ groupedEntries=${I}
260
+ selectedEntry=${N}
261
+ setSelectedEntry=${z}
262
+ keyboardSelection=${V}
263
+ onPointerInteraction=${W}
264
+ onAction=${K}
265
+ idPrefix=${Q}
266
+ id=${X}
267
+ ariaLabel=${s||"Results"}
268
+ tabIndex=${B?-1:0}
269
+ ariaActivedescendant=${B?void 0:G||void 0}
270
+ />
271
+
272
+ ${N&&N.documentationRef&&_l`
273
+ <div class="djs-popup-footer">
274
+ <a
275
+ class="djs-popup-footer-docs"
276
+ href=${N.documentationRef}
277
+ onClick=${e=>e.stopPropagation()}
278
+ aria-label=${N.label?`Open entry documentation for ${N.label}`:"Open entry documentation"}
279
+ target="_blank"
280
+ rel="noopener"
281
+ >
282
+ Open entry documentation
283
+
284
+ <svg aria-hidden="true" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
285
+ <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"/>
286
+ </svg>
287
+ </a>
288
+ </div>
289
+ `}
290
+ </div>
291
+ `}
292
+ ${u&&0===L.length&&_l`
293
+ <div class="djs-popup-no-results">${g(u)?u(R):u}</div>
294
+ `}
295
+ </${ic}>
296
+ `}function nc(e){"function"==typeof e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded():e.scrollIntoView({scrollMode:"if-needed",block:"nearest",inline:"nearest"})}function ic(e){const{onClose:t,onKeydown:n,onKeyup:i,onKeyboardInteraction:r,className:o,children:s,navigationStack:a,interactionMode:l,position:c}=e,u=Ll();Bl(()=>{if("function"!=typeof c)return;const e=u.current,t=c(e);e.style.left=`${t.x}px`,e.style.top=`${t.y}px`},[u.current,c]),Bl(()=>{const e=u.current;if(!e)return;(e.querySelector("input")||e.querySelector('[role="listbox"]')||e).focus()},[a]),Dl(()=>{const e=e=>{if("Escape"===e.key)return e.preventDefault(),t()},n=e=>{if(!re(e.target,".djs-popup",!0))return t()};return document.documentElement.addEventListener("keydown",e),document.body.addEventListener("click",n,!0),()=>{document.documentElement.removeEventListener("keydown",e),document.body.removeEventListener("click",n,!0)}},[]);const h=Gl("djs-popup",o,{"djs-popup--pointer":"pointer"===l});return _l`
297
+ <div
298
+ class=${h}
299
+ style=${function(e){const{width:t}=e,n="number"==typeof t?`${t}px`:t;return{transform:`scale(${e.scale})`,width:p(t)?n:void 0,maxWidth:p(t)?"unset":void 0,"transform-origin":"top left"}}(e)}
300
+ onKeydownCapture=${r}
301
+ onKeydown=${n}
302
+ onKeyup=${i}
303
+ ref=${u}
304
+ tabIndex="-1"
305
+ >
306
+ ${s}
307
+ </div>
308
+ `}var rc=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function oc(e,t,n,i){this._eventBus=t,this._canvas=n,this._search=i,this._current=null;var r=p(e&&e.scale)?e.scale:{min:1,max:1};this._config={scale:r,defaultTab:e&&e.defaultTab},t.on("diagram.destroy",()=>{this.close()}),t.on("element.changed",e=>{const t=this.isOpen()&&this._current.target;e.element===t&&this.refresh()})}function sc(e,t=[]){return Object.entries(e).map(([e,n])=>{const i={id:e,...n};return i.entries?i.entries=sc(i.entries,[...t,...ac(i.search)]):t.length&&(i.search=[...t,...ac(i.search)]),i})}function ac(e){return e?d(e)?e:[e]:[]}function lc(e,t){return pc(t)-pc(e)}oc.$inject=["config.popupMenu","eventBus","canvas","search"],oc.prototype._render=function(){const{position:e,providerId:t,entries:n,headerEntries:i,emptyPlaceholder:r,options:o}=this._current,s=sc(n),a=Object.entries(i).map(([e,t])=>({id:e,...t})),l=e&&(t=>this._ensureVisible(t,e)),c=this._updateScale(this._current.container);ml(_l`
309
+ <${tc}
310
+ onClose=${e=>this.close(e)}
311
+ onSelect=${(e,t,n)=>this.trigger(e,t,n)}
312
+ position=${l}
313
+ className=${t}
314
+ entries=${s}
315
+ headerEntries=${a}
316
+ emptyPlaceholder=${r}
317
+ scale=${c}
318
+ onOpened=${this._onOpened.bind(this)}
319
+ onClosed=${this._onClosed.bind(this)}
320
+ searchFn=${this._search}
321
+ defaultTab=${this._config.defaultTab}
322
+ ...${{...o}}
323
+ />
324
+ `,this._current.container)},oc.prototype.open=function(e,t,n,i){if(!e)throw new Error("target is missing");if(!t)throw new Error("providers for <"+t+"> not found");if(!n)throw new Error("position is missing");if(!1===this._eventBus.fire("popupMenu.open.allowed",{target:e,providerId:t}))return;this.isOpen()&&this.close();const{entries:r,headerEntries:o,emptyPlaceholder:s}=this._getContext(e,t);this._current={position:n,providerId:t,target:e,entries:r,headerEntries:o,emptyPlaceholder:s,container:this._createContainer({provider:t}),options:i},this._emit("open"),this._bindAutoClose(),this._render()},oc.prototype.refresh=function(){if(!this.isOpen())return;const{target:e,providerId:t}=this._current,{entries:n,headerEntries:i,emptyPlaceholder:r}=this._getContext(e,t);this._current={...this._current,entries:n,headerEntries:i,emptyPlaceholder:r},this._emit("refresh"),this._render()},oc.prototype._getContext=function(e,t){const n=this._getProviders(t);if(!n||!n.length)throw new Error("provider for <"+t+"> not found");const i=this._getEntries(e,n),r=this._getHeaderEntries(e,n);return{entries:i,headerEntries:r,emptyPlaceholder:this._getEmptyPlaceholder(n),empty:!(Object.keys(i).length||Object.keys(r).length)}},oc.prototype.close=function(){this.isOpen()&&(this._emit("close"),this.reset(),this._canvas.restoreFocus(),this._current=null)},oc.prototype.reset=function(){const e=this._current.container;ml(null,e),me(e)},oc.prototype._emit=function(e,t){this._eventBus.fire(`popupMenu.${e}`,t)},oc.prototype._onOpened=function(){this._emit("opened")},oc.prototype._onClosed=function(){this._emit("closed")},oc.prototype._createContainer=function(e){var t=this._canvas.getContainer();const n=Y(`<div class="djs-popup-parent djs-scrollable" data-popup=${e.provider}></div>`);return t.appendChild(n),n},oc.prototype._bindAutoClose=function(){this._eventBus.once(rc,this.close,this)},oc.prototype._unbindAutoClose=function(){this._eventBus.off(rc,this.close,this)},oc.prototype._updateScale=function(){var e,t,n=this._canvas.zoom(),i=this._config.scale,r=n;return!0!==i&&(!1===i?(e=1,t=1):(e=i.min,t=i.max),p(e)&&n<e&&(r=e),p(t)&&n>t&&(r=t)),r},oc.prototype._ensureVisible=function(e,t){var n=document.documentElement.getBoundingClientRect(),i=e.getBoundingClientRect(),r={},o=t.x,s=t.y;return t.x+i.width>n.width&&(r.x=!0),t.y+i.height>n.height&&(r.y=!0),r.x&&r.y?(o=t.x-i.width,s=t.y-i.height):r.x?(o=t.x-i.width,s=t.y):r.y&&t.y<i.height?(o=t.x,s=10):r.y&&(o=t.x,s=t.y-i.height),t.y<n.top&&(s=t.y+i.height),{x:o,y:s}},oc.prototype.isEmpty=function(e,t){if(!e)throw new Error("target is missing");if(!t)throw new Error("provider ID is missing");const n=this._getProviders(t);return!n||!n.length||this._getContext(e,t).empty},oc.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,function(e){e.providers.push(n)})},oc.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},oc.prototype._getEntries=function(e,t){var n={};return E(t,function(t){if(t.getPopupMenuEntries){var i=t.getPopupMenuEntries(e);g(i)?n=i(n):E(i,function(e,t){n[t]=e})}else E(t.getEntries(e),function(e){var t=e.id;if(!t)throw new Error("entry ID is missing");n[t]=X(e,["id"])})}),n},oc.prototype._getHeaderEntries=function(e,t){var n={};return E(t,function(t){if(t.getPopupMenuHeaderEntries){var i=t.getPopupMenuHeaderEntries(e);g(i)?n=i(n):E(i,function(e,t){n[t]=e})}else{if(!t.getHeaderEntries)return;E(t.getHeaderEntries(e),function(e){var t=e.id;if(!t)throw new Error("entry ID is missing");n[t]=X(e,["id"])})}}),n},oc.prototype._getEmptyPlaceholder=function(e){const t=e.find(e=>g(e.getEmptyPlaceholder));return t&&t.getEmptyPlaceholder()},oc.prototype.isOpen=function(){return!!this._current},oc.prototype.trigger=function(e,t,n="click"){if(e.preventDefault(),!t){let n=J(re(e.delegateTarget||e.target,".entry",!0),"data-id");t={id:n,...this._getEntry(n)}}const i=t.action;if(!1!==this._emit("trigger",{entry:t,event:e}))if(g(i)){if("click"===n)return i(e,t)}else if(i[n])return i[n](e,t)},oc.prototype._getEntry=function(e){var t=this._current.entries[e]||this._current.headerEntries[e];if(!t)throw new Error("entry not found");return t};const cc=.5,uc={FULL:131.9,START_FULL_WORD:8,START_WORD_PART:7.87,WORD_START:2.19,WORD_PART:1,NO_MATCH:-.07};function pc(e){const t=e.reduce((e,t)=>e+hc(t),0),n=e.flat(),i=n.reduce((e,t)=>e+t.value.length,0),r=n.reduce((e,t)=>e+(t.match?t.value.length:0),0);return t*(1+(i?r/i:0))}function hc(e){if(d(e))return Math.max(...e.map(hc));const t=Math.log(e.value.length);return e.match?(e.start?e.end?uc.FULL:e.wordEnd?uc.START_FULL_WORD:uc.START_WORD_PART:e.wordStart?uc.WORD_START:uc.WORD_PART)*t:uc.NO_MATCH*t}function dc(e=""){return d(e)?e.join(", "):e}function fc(e,t){return dc(e).localeCompare(dc(t))}function mc(e,t){if(!e)return{tokens:[],matchedWords:{}};const n=[],i={},r=t.map(gc),o=[`(?<all>${r.join("\\s+")})`,...r].join("|"),s=new RegExp(o,"ig");let a,l=0;for(;a=s.exec(e);){const[r]=a,o=a.index,s=a.index+r.length,c=0===o,u=s===e.length,p=!!a.groups?.all,h=c||/\s/.test(e.charAt(o-1)),d=u||/\s/.test(e.charAt(s));a.index>l&&n.push({value:e.slice(l,a.index),index:l}),n.push({value:r,index:a.index,match:!0,wordStart:h,wordEnd:d,start:c,end:u,all:p});const f=p?t:[r];for(const e of f)i[e.toLowerCase()]=!0;l=a.index+r.length}return l<e.length&&n.push({value:e.slice(l),index:l}),{tokens:n,matchedWords:i}}function gc(e){return e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}var vc={search:["value",function(e,t,n){const{keys:i}=n;if(!(t=t.trim().toLowerCase()))throw new Error("<pattern> must not be empty");const r=t.trim().toLowerCase().split(/\s+/);return e.flatMap(e=>{const t=function(e,t,n){const{matchedWords:i,tokens:r}=n.reduce((n,i)=>{const r=e[i],{tokens:o,matchedWords:s}=d(r)?r.reduce((e,n)=>{const{tokens:i,matchedWords:r}=mc(n,t);return{tokens:[...e.tokens,i],matchedWords:{...e.matchedWords,...r}}},{matchedWords:{},tokens:[]}):mc(r,t);return{tokens:{...n.tokens,[i]:o},matchedWords:{...n.matchedWords,...s}}},{matchedWords:{},tokens:{}});if(Object.keys(i).length!==t.length)return null;return r}(e,r,i);return t?{item:e,tokens:t}:[]}).sort(function(e){return(t,n)=>{let i=0,r=1;for(const o of e){const e=lc(t.tokens[o],n.tokens[o]);if(0!==e){i+=e*r,r*=cc;continue}const s=fc(t.item[o],n.item[o]);0===s||(i+=s*r,r*=cc)}return i}}(i))}]},yc={__depends__:[vc],__init__:["popupMenu"],popupMenu:["type",oc]},bc={align:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000">\n <line x1="200" y1="150" x2="200" y2="1850" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="500" y="150" width="1300" height="700" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="500" y="1150" width="700" height="700" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',bottom:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="150" y1="1650" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="150" y="350" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="1050" y="850" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',center:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="900" y1="150" x2="900" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="250" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="500" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',left:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="100" y1="150" x2="100" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="100" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="100" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',right:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="1650" y1="150" x2="1650" y2="1650" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="350" y="150" width="1300" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="850" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',top:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="150" y1="150" x2="1650" y2="150" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="150" y="150" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="1050" y="150" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',middle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <line x1="150" y1="900" x2="1650" y2="900" style="stroke:currentColor;stroke-width:100;stroke-linecap:round;"/>\n <rect x="150" y="250" width="600" height="1300" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="1050" y="500" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>'};function wc(e,t,n,i){e.registerProvider(900,this),this._contextPad=e,this._popupMenu=t,this._translate=n,this._canvas=i}wc.$inject=["contextPad","popupMenu","translate","canvas"],wc.prototype.getMultiElementContextPadEntries=function(e){var t={};return this._isAllowed(e)&&q(t,this._getEntries(e)),t},wc.prototype._isAllowed=function(e){return!this._popupMenu.isEmpty(e,"align-elements")},wc.prototype._getEntries=function(){var e=this;return{"align-elements":{group:"align-elements",title:e._translate("Align elements"),html:`<div class="entry">${bc.align}</div>`,action:{click:function(t,n){var i=e._getMenuPosition(n);q(i,{cursor:{x:t.x,y:t.y}}),e._popupMenu.open(n,"align-elements",i)}}}}},wc.prototype._getMenuPosition=function(e){var t=this._contextPad.getPad(e).html.getBoundingClientRect();return{x:t.left,y:t.bottom+5}};var xc=["left","center","right","top","middle","bottom"];function _c(e,t,n,i){this._alignElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",this)}function Ec(e){Vo.call(this,e),this.init()}function Sc(e){Ec.call(this,e)}_c.$inject=["popupMenu","alignElements","translate","rules"],_c.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&q(t,this._getEntries(e)),t},_c.prototype._isAllowed=function(e){return this._rules.allowed("elements.align",{elements:e})},_c.prototype._getEntries=function(e){var t=this._alignElements,n=this._translate,i=this._popupMenu,r={};return E(xc,function(o){r["align-elements-"+o]={group:"align",title:n("Align elements "+o),className:"bjs-align-elements-menu-entry",imageHtml:bc[o],action:function(){t.trigger(e,o),i.close()}}}),r},Ec.$inject=["eventBus"],e(Ec,Vo),Ec.prototype.addRule=function(e,t,n){var i=this;"string"==typeof e&&(e=[e]),e.forEach(function(e){i.canExecute(e,t,function(e,t,i){return n(e)},!0)})},Ec.prototype.init=function(){},Sc.$inject=["eventBus"],e(Sc,Ec),Sc.prototype.init=function(){this.addRule("elements.align",function(e){var t=_(e.elements,function(e){return!(e.waypoints||e.host||e.labelTarget)});return!((t=at(t)).length<2)&&t})};var kc={__depends__:[wa,ja,yc],__init__:["alignElementsContextPadProvider","alignElementsMenuProvider","bpmnAlignElements"],alignElementsContextPadProvider:["type",wc],alignElementsMenuProvider:["type",_c],bpmnAlignElements:["type",Sc]};function Oc(e,t,n,i){for(var r;r=Pc(e,n,t);)n=i(t,n,r);return n}function Cc(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var s=e[o];if(s){var a="x"===o?"width":"height",l=s.margin,c=s.minDistance;r[o]=l<0?Math.min(i[o]+l-t[a]/2,n[o]-c+l):Math.max(i[o]+i[a]+l+t[a]/2,n[o]+c+l)}}),r}}function Pc(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=function(e){var t=Ac(e);e.host&&(t=t.concat(Ac(e.host)));e.attachers&&(t=t.concat(e.attachers.reduce(function(e,t){return e.concat(Ac(t))},[])));return t}(e);return w(r,function(e){return e!==n&&"intersect"===mn(e,i,10)})}function Ac(e){return(t=e,t.outgoing.map(function(e){return e.target})).concat(function(e){return e.incoming.map(function(e){return e.source})}(e));var t}function Tc(){return!0}function Rc(e,t,n){e.on("autoPlace",100,function(e){var t=e.shape;return function(e,t,n){n||(n={});var i=n.defaultDistance||50,r=fn(e),o=pn(e);return{x:o.right+i+t.width/2,y:r.y}}(e.source,t)}),e.on("autoPlace.end",function(e){n.scrollToElement(e.shape)}),this.append=function(n,i,r){e.fire("autoPlace.start",{source:n,shape:i});var o=e.fire("autoPlace",{source:n,shape:i}),s=t.appendShape(n,i,o,n.parent,r);return e.fire("autoPlace.end",{source:n,shape:s}),s}}function Mc(e,t){e.on("autoPlace.end",500,function(e){t.select(e.shape)})}Rc.$inject=["eventBus","modeling","canvas"],Mc.$inject=["eventBus","selection"];var $c={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Rc],autoPlaceSelectionBehavior:["type",Mc]};function Dc(e,t){for(v(t)&&(t=[t]);e=e.parent;)if(yr(e,t))return e;return null}function Bc(e,t){var n=Dc(e,"bpmn:Process");if(n)return!0;var i,r=["bpmn:Participant","bpmn:Lane"];if(n=Dc(e,r))return zr(n);if(yr(e,r))return zr(e);for(i=br(e);i&&!vr(i,"bpmn:Process");i=i.$parent);if(!t)return!0;var o=t.find(function(e){var t=br(e);return t&&t.get("processRef")===i});return!o||zr(o)}function Lc(e,t,n){var i=Bc(e,n);return vr(t,"bpmn:TextAnnotation")?function(e,t,n){var i=pn(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};an(e)&&(r=fn(e),n?(r.x+=100,r.y-=50):(r.x+=100,r.y+=50));var o={margin:n?-30:30,minDistance:20},s=n?{y:o}:{x:o};return Oc(e,t,r,Cc(s))}(e,t,i):yr(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(e,t,n){var i=pn(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},s=n?{x:o}:{y:o};return Oc(e,t,r,Cc(s))}(e,t,i):vr(t,"bpmn:FlowNode")?function(e,t,n){var i=pn(e),r=fn(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"},s=function(e,t){t||(t={});var n=t.defaultDistance||50,i=t.direction||"e",r=t.filter,o=t.getWeight||function(t){return t.source===e?1:-1},s=t.maxDistance||250,a=t.reference||"start";function l(e,t){return"n"===i?"start"===a?pn(e).top-pn(t).bottom:"center"===a?pn(e).top-fn(t).y:pn(e).top-pn(t).top:"w"===i?"start"===a?pn(e).left-pn(t).right:"center"===a?pn(e).left-fn(t).x:pn(e).left-pn(t).left:"s"===i?"start"===a?pn(t).top-pn(e).bottom:"center"===a?fn(t).y-pn(e).bottom:pn(t).bottom-pn(e).bottom:"start"===a?pn(t).left-pn(e).right:"center"===a?fn(t).x-pn(e).right:pn(t).right-pn(e).right}r||(r=Tc);var c=e.incoming.filter(r).map(function(t){var n=o(t),i=n<0?l(t.source,e):l(e,t.source);return{id:t.source.id,distance:i,weight:n}}),u=e.outgoing.filter(r).map(function(t){var n=o(t),i=n>0?l(e,t.target):l(t.target,e);return{id:t.target.id,distance:i,weight:n}}),p=k(c.concat(u).reduce(function(e,t){return e[t.id+"__weight_"+t.weight]=t,e},{}),function(e,t){var n=t.distance,i=t.weight;return n<0||n>s||(e[String(n)]||(e[String(n)]=0),e[String(n)]+=1*i,(!e.distance||e[e.distance]<e[String(n)])&&(e.distance=n)),e},{});return p.distance||n}(e,{filter:function(e){return vr(e,"bpmn:SequenceFlow")},direction:o.directionHint}),a=30,l=o.minDistance,c=o.baseOrientation;vr(e,"bpmn:BoundaryEvent")&&-1!==(c=mn(e,e.host,-25)).indexOf(o.boundaryOrientation)&&(a*=-1);var u=n?{x:i.right+s+t.width/2,y:r.y+Ic(c,l,o)}:{x:r.x+Ic(c,l,o),y:i.bottom+s+t.height/2},p={margin:a,minDistance:l},h=n?{y:p}:{x:p};return Oc(e,t,u,Cc(h))}(e,t,i):void 0}function Ic(e,t,n){return e.includes(n.start)?-1*t:e.includes(n.end)?t:0}function Nc(e,t){e.on("autoPlace",function(e){var n=e.shape;return Lc(e.source,n,t)})}Nc.$inject=["eventBus","elementRegistry"];var zc={__depends__:[$c],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",Nc]};function jc(e,t,n,i){Vo.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],function(e){var t=e.context,n=t.hints||{},i=t.shape,o=t.parent||t.newParent;!1!==n.autoResize&&r._expand([i],o)}),this.postExecuted(["elements.move"],function(e){var t=e.context,n=a(R(t.closure.topLevel)),i=t.hints,o=!i||i.autoResize;!1!==o&&E(M(n,function(e){return e.parent.id}),function(e,t){d(o)&&(e=e.filter(function(e){return w(o,L({id:e.id}))})),r._expand(e,t)})}),this.postExecuted(["shape.toggleCollapse"],function(e){var t=e.context,n=t.hints,i=t.shape;n&&!1===n.autoResize||i.collapsed||r._expand(i.children||[],i)}),this.postExecuted(["shape.resize"],function(e){var t=e.context,n=t.hints,i=t.shape,o=i.parent;n&&!1===n.autoResize||o&&r._expand([i],o)})}function Vc(e){e.invoke(jc,this)}function Fc(e){Ec.call(this,e);var t=this;this.addRule("element.autoResize",function(e){return t.canResize(e.elements,e.target)})}function qc(e,t){Fc.call(this,e),this._modeling=t}jc.$inject=["eventBus","elementRegistry","modeling","rules"],e(jc,Vo),jc.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=pn(ht(e)),o=pn(t),s={};return r.top-o.top<i.top&&(s.top=r.top-n.top),r.left-o.left<i.left&&(s.left=r.left-n.left),o.right-r.right<i.right&&(s.right=r.right+n.right),o.bottom-r.bottom<i.bottom&&(s.bottom=r.bottom+n.bottom),hn(q({},o,s))},jc.prototype._expand=function(e,t){if("string"==typeof t&&(t=this._elementRegistry.get(t)),this._rules.allowed("element.autoResize",{elements:e,target:t})){var n=this._getOptimalBounds(e,t);if(function(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}(n,t)){var i=function(e,t){var n="";e=pn(e),t=pn(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"));return n}(Q(t,["x","y","width","height"]),n);this.resize(t,n,{autoResize:i});var r=t.parent;r&&this._expand([t],r)}}},jc.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},jc.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},jc.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},Vc.$inject=["injector"],e(Vc,jc),Vc.prototype.resize=function(e,t,n){vr(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},Fc.$inject=["eventBus"],e(Fc,Ec),Fc.prototype.canResize=function(e,t){return!1},e(qc,Fc),qc.$inject=["eventBus","modeling"],qc.prototype.canResize=function(e,t){if(vr(t.di,"bpmndi:BPMNPlane"))return!1;if(!vr(t,"bpmn:Participant")&&!vr(t,"bpmn:Lane")&&!vr(t,"bpmn:SubProcess"))return!1;var n=!0;return E(e,function(e){(vr(e,"bpmn:Lane")||ln(e))&&(n=!1)}),n};var Hc={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Vc],bpmnAutoResizeProvider:["type",qc]};function Wc(e,t,n){var i,r,o=this,s=n.get("dragging",!1);s&&t.on("drag.start",function(n){t.once("drag.move",1500,function(t){!function(t){if(!t.hover){var n=t.originalEvent,i=o._findTargetGfx(n),r=i&&e.get(i);i&&r&&(t.stopPropagation(),s.hover({element:r,gfx:i}),s.move(n))}}(t)})}),t.on("element.hover",function(e){i=e.gfx,r=e.element}),t.on("element.hover",1500,function(e){r&&t.fire("element.out",{element:r,gfx:i})}),t.on("element.out",function(){i=null,r=null}),this._findTargetGfx=function(e){var t;if(e instanceof MouseEvent)return t=ds(e),function(e){return re(e,"svg, .djs-element",!0)}(document.elementFromPoint(t.x,t.y))}}Wc.$inject=["elementRegistry","eventBus","injector"];var Qc={__init__:["hoverFix"],hoverFix:["type",Wc]},Xc=Math.round,Gc="djs-drag-active";function Uc(e){e.preventDefault()}function Yc(e,t,n,i){var r,o={threshold:5,trapClick:!0};function s(e){var n=t.viewbox(),i=t._container.getBoundingClientRect();return{x:n.x+(e.x-i.left)/n.scale,y:n.y+(e.y-i.top)/n.scale}}function a(t,n){n=n||r;var i=e.createEvent(q({},n.payload,n.data,{isTouch:n.isTouch}));return!1!==e.fire("drag."+t,i)&&e.fire(n.prefix+"."+t,i)}function l(e,i){var o,l=r.payload,c=r.displacement,u=r.globalStart,p=ds(e),h=oa(p,u),d=r.localStart,f=s(p),m=oa(f,d);if(!r.active&&(i||(o=h,Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2))>r.threshold))){if(q(l,{x:Xc(d.x+c.x),y:Xc(d.y+c.y),dx:0,dy:0},{originalEvent:e}),!1===a("start"))return g();r.active=!0,r.keepSelection||(l.previousSelection=n.get(),n.select(null)),r.cursor&&ta(r.cursor),t.addMarker(t.getRootElement(),Gc)}hs(e),r.active&&(q(l,{x:Xc(f.x+c.x),y:Xc(f.y+c.y),dx:Xc(m.x),dy:Xc(m.y)},{originalEvent:e}),a("move"))}function c(e){var t=!0;r.active&&(e&&(r.payload.originalEvent=e,hs(e)),t=a("end")),!1===t&&a("rejected"),a("ended",v(!0!==t))}function u(){g()}function p(e){js("Escape",e)&&(Uc(e),g())}function h(t){var n;r.active&&(n=ia(e),setTimeout(n,400),Uc(t)),c(t)}function d(e){l(e)}function f(e){var t=r.payload;t.hoverGfx=e.gfx,t.hover=e.element,a("hover")}function m(e){a("out");var t=r.payload;t.hoverGfx=null,t.hover=null}function g(t){var n;if(r){var i=r.active;e.off("error",u);try{i&&a("cancel")}finally{n=v(t)}i&&a("canceled",n)}}function v(o){var s;e.off("error",u);try{a("cleanup")}finally{s=function(o){var s,a;na(),a=r.trapClick?h:c;ce.unbind(document,"mousemove",l),ce.unbind(document,"dragstart",Uc),ce.unbind(document,"selectstart",Uc),ce.unbind(document,"mousedown",a,!0),ce.unbind(document,"mouseup",a,!0),ce.unbind(document,"keyup",p),ce.unbind(document,"touchstart",d,!0),ce.unbind(document,"touchcancel",g,!0),ce.unbind(document,"touchmove",l,!0),ce.unbind(document,"touchend",c,!0),e.off("element.hover",f),e.off("element.out",m),t.removeMarker(t.getRootElement(),Gc);var u=r.payload.previousSelection;s=r,r=null,!1!==o&&u&&!n.get().length&&function(e){var t=e.filter(function(e){return i.get(e.id)});t.length&&n.select(t)}(u);return s}(o)}return s}e.on("diagram.destroy",g),this.init=function(t,n,i,v){r&&g(!1),"string"==typeof n&&(v=i,i=n,n=null);var y,b,w,x,_,E=(v=q({},o,v||{})).data||{};if(x=v.trapClick?h:c,t?(y=ps(t)||t,b=ds(t),hs(t),"dragstart"===y.type&&Uc(y)):(y=null,b={x:0,y:0}),w=s(b),n||(n=w),_=function(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}(y),r=q({prefix:i,data:E,payload:{},globalStart:b,displacement:oa(n,w),localStart:w,isTouch:_},v),e.once("error",500,u),v.manual||(_?(ce.bind(document,"touchstart",d,!0),ce.bind(document,"touchcancel",g,!0),ce.bind(document,"touchmove",l,!0),ce.bind(document,"touchend",c,!0)):(ce.bind(document,"mousemove",l),ce.bind(document,"dragstart",Uc),ce.bind(document,"selectstart",Uc),ce.bind(document,"mousedown",x,!0),ce.bind(document,"mouseup",x,!0)),ce.bind(document,"keyup",p),e.on("element.hover",f),e.on("element.out",m)),!1===a("init"))return g(),!1;v.autoActivate&&l(t,!0)},this.move=l,this.hover=f,this.out=m,this.end=c,this.cancel=g,this.context=function(){return r},this.setOptions=function(e){q(o,e)}}Yc.$inject=["eventBus","canvas","selection","elementRegistry"];var Kc={__depends__:[Qc,As],dragging:["type",Yc]};function Zc(e,t,n){this._canvas=n,this._opts=q({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",function(e){var t=i._toBorderPoint(e);i.startScroll(t)}),t.on(["drag.cleanup"],function(){i.stopScroll()})}function Jc(e,t,n){return t<e&&e<n}Zc.$inject=["config.autoScroll","eventBus","canvas"],Zc.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 s=0,a=0,l=0;l<4;l++)Jc(o[l],n.scrollThresholdOut[l],n.scrollThresholdIn[l])&&(0===l?s=n.scrollStep:1==l?a=n.scrollStep:2==l?s=-n.scrollStep:3==l&&(a=-n.scrollStep));0===s&&0===a||(t.scroll({dx:s,dy:a}),this._scrolling=setTimeout(function(){i.startScroll(e)},n.scrollRepeatTimeout))},Zc.prototype.stopScroll=function(){clearTimeout(this._scrolling)},Zc.prototype.setOptions=function(e){this._opts=q({},this._opts,e)},Zc.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=ds(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};var eu={__depends__:[Kc],__init__:["autoScroll"],autoScroll:["type",Zc]};function tu(e){this._commandStack=e.get("commandStack",!1)}tu.$inject=["injector"],tu.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),void 0===n||n};var nu={__init__:["rules"],rules:["type",tu]},iu=Math.round,ru=Math.max;function ou(e,t){return function(e,t){var n,i;for(n=0;i=e[n];n++)if(_t(i,t)<=10)return{point:e[n],bendpoint:!0,index:n};return null}(e,t)||function(e,t){var n,i,r=Jt(function(e,t){return[["M",e.x,e.y],["m",0,-t],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}(t,10),(n=[],e.forEach(function(e,t){n.push([0===t?"M":"L",e.x,e.y])}),n)),o=r[0],s=r[r.length-1];return o?o!==s?o.segment2!==s.segment2?{point:e[i=ru(o.segment2,s.segment2)-1],bendpoint:!0,index:i}:{point:{x:iu(o.x+s.x)/2,y:iu(o.y+s.y)/2},index:o.segment2}:{point:{x:iu(o.x),y:iu(o.y)},index:o.segment2}:null}(e,t)}function su(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function au(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function lu(e,t){var n=t[0],i=t[1],r={x:i.x-n.x,y:i.y-n.y},o=function(e,t,n){var i=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}];return-(i[0].n*t[0]+i[1].n*t[1])/(i[0].lambda*t[0]+i[1].lambda*t[1])}([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 cu(e,t){var n=lu(e,t);return su({x:n.x-e.x,y:n.y-e.y})}function uu(e,t){return su({x:e.x-t.x,y:e.y-t.y})}var pu="djs-bendpoint",hu="djs-segment-dragger";function du(e,t,n){var i=function(e,t){var n,i=ds(t),r=e._container.getBoundingClientRect();n={x:r.left,y:r.top};var o=e.viewbox();return{x:o.x+(i.x-n.x)/o.scale,y:o.y+(i.y-n.y)/o.scale}}(e,n);return ou(t,i)}function fu(e,t){var n=Pe("g");xe(n).add(pu),ge(e,n);var i=Pe("circle");be(i,{cx:0,cy:0,r:4}),xe(i).add("djs-visual"),ge(n,i);var r=Pe("circle");return be(r,{cx:0,cy:0,r:10}),xe(r).add("djs-hit"),ge(n,r),t&&xe(n).add(t),n}function mu(e,t,n,i){var r=Pe("g");ge(e,r);var o=function(e,t,n){var i=t.x-e.x,r=t.y-e.y;return vu("h"===n?i:r)}(t,n,i),s=Pe("rect");be(s,{x:-9,y:-3,rx:3,width:18,height:6}),xe(s).add("djs-visual"),ge(r,s);var a=Pe("rect");return be(a,{x:-o/2,y:-8.5,width:o,height:17}),xe(a).add("djs-hit"),ge(r,a),Xn(r,"v"===i?90:0),r}function gu(e,t,n){var i=Pe("g"),r=Ct(t,n),o=St(t,n);return ge(e,i),mu(i,t,n,o),xe(i).add(hu),xe(i).add("h"===o?"horizontal":"vertical"),Qn(i,r.x,r.y),i}function vu(e){return Math.abs(Math.round(2*e/3))}function yu(e,t){var n=function(e,t){for(var n,i=t.waypoints,r=1/0,o=0;o<i.length-1;o++){var s=cu(e,[i[o],i[o+1]]);s<r&&(r=s,n=o)}return[i[n],i[n+1]]}(e,t);return lu(e,n)}function bu(e,t,n,i,r){function o(e,n){var o,s,a=n.waypoints,l=du(t,a,e);if(l)return o=function(e,t){var n,i,r=e.waypoints;return t.index<=0||t.bendpoint?null:(i=St((n={start:r[t.index-1],end:r[t.index]}).start,n.end))?vu("h"===i?n.end.x-n.start.x:n.end.y-n.start.y)/2:null}(n,l),s=function(e,t,n){var i,r,o,s,a,l,c=e.index,u=e.point;return!(c<=0||e.bendpoint)&&(o=Ct(i=t[c-1],r=t[c]),s=St(i,r),a=Math.abs(u.x-o.x),l=Math.abs(u.y-o.y),s&&a<=n&&l<=n)}(l,a,o)?r.start(e,n,l.index):i.start(e,n,l.index,!l.bendpoint),!1!==s||void 0}function s(e,t,i){ce.bind(e,t,function(e){n.triggerMouseEvent(t,e,i),e.stopPropagation()})}function a(e,n){var i=t.getLayer("overlays"),r=de('.djs-bendpoints[data-element-id="'+Wo(e.id)+'"]',i);return!r&&n&&(be(r=Pe("g"),{"data-element-id":e.id}),xe(r).add("djs-bendpoints"),ge(i,r),s(r,"mousedown",e),s(r,"click",e),s(r,"dblclick",e)),r}function l(e,t){return de('.djs-segment-dragger[data-segment-idx="'+e+'"]',t)}function c(e,t){t.waypoints.forEach(function(t,n){var i=fu(e);ge(e,i),Qn(i,t.x,t.y)}),fu(e,"floating")}function u(e,t){for(var n,i,r,o=t.waypoints,a=1;a<o.length;a++)St(n=o[a-1],i=o[a])&&(be(r=gu(e,n,i),{"data-segment-idx":a}),s(r,"mousemove",t))}function p(e){var t=a(e);return t||(c(t=a(e,!0),e),u(t,e)),t}function h(e){var t=a(e);t&&(!function(e){E(fe("."+hu,e),function(e){ze(e)})}(t),function(e){E(fe("."+pu,e),function(e){ze(e)})}(t),u(t,e),c(t,e))}function d(e,t,n){var i,r,o=l(t.index,e),s=n[t.index-1],a=n[t.index],c=t.point,u=Ct(s,a),p=St(s,a);o&&(i=function(e){return de(".djs-visual",e)}(o),r={x:c.x-u.x,y:c.y-u.y},"v"===p&&(r={x:r.y,y:r.x}),Qn(i,r.x,r.y))}e.on("connection.changed",function(e){h(e.element)}),e.on("connection.remove",function(e){var t=a(e.element);t&&ze(t)}),e.on("element.marker.update",function(e){var t,n=e.element;n.waypoints&&(t=p(n),e.add?xe(t).add(e.marker):xe(t).remove(e.marker))}),e.on("element.mousemove",function(e){var n,i,r=e.element,o=r.waypoints;if(o){if(n=a(r,!0),!(i=du(t,o,e.originalEvent)))return;!function(e,t){var n=de(".floating",e),i=t.point;n&&(Qn(n,i.x,i.y),xe(n).add("positioned"))}(n,i),i.bendpoint||d(n,i,o)}}),e.on("element.mousedown",function(e){if(gs(e)){var t=e.originalEvent,n=e.element;if(n.waypoints)return o(t,n)}}),e.on("selection.changed",function(e){var t=e.newSelection[0];t&&t.waypoints&&p(t)}),e.on("element.hover",function(e){var t=e.element;t.waypoints&&p(t)}),e.on("element.out",function(e){var t=e.element;if(t.waypoints){var n=a(t);if(n){var i=de(".floating",n);i&&xe(i).remove("positioned")}}}),e.on("element.updateId",function(e){var t=e.element,n=e.newId;if(t.waypoints){var i=a(t);i&&be(i,{"data-element-id":n})}}),this.addHandles=p,this.updateHandles=h,this.getBendpointsContainer=a,this.getSegmentDragger=l}bu.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var wu=Math.round,xu="reconnectStart",_u="reconnectEnd",Eu="updateWaypoints";function Su(e,t,n,i,r,o){this._injector=e,this.start=function(e,t,o,s){var a,l=n.getGraphics(t),c=t.source,u=t.target,p=t.waypoints,h=(a=s||0!==o?s||o!==p.length-1?Eu:_u:xu)===Eu?"connection.updateWaypoints":"connection.reconnect",d=r.allowed(h,{connection:t,source:c,target:u});if(!1===d&&(d=r.allowed(h,{connection:t,source:u,target:c})),!1!==d)return i.init(e,"bendpoint.move",{data:{connection:t,connectionGfx:l,context:{allowed:d,bendpointIndex:o,connection:t,source:c,target:u,insert:s,type:a}}})},t.on("bendpoint.move.hover",function(e){var t,n=e.context,i=n.connection,o=i.source,s=i.target,a=e.hover,l=n.type;if(n.hover=a,a){var c=l===Eu?"connection.updateWaypoints":"connection.reconnect";if(t=n.allowed=r.allowed(c,{connection:i,source:l===xu?a:o,target:l===_u?a:s}))return n.source=l===xu?a:o,void(n.target=l===_u?a:s);!1===t&&(t=n.allowed=r.allowed(c,{connection:i,source:l===_u?a:s,target:l===xu?a:o})),t&&(n.source=l===_u?a:s,n.target=l===xu?a:o)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(e){var t=e.context,n=t.type;t.hover=null,t.source=null,t.target=null,n!==Eu&&(t.allowed=!1)}),t.on("bendpoint.move.end",function(e){var t=e.context,n=t.allowed,i=t.bendpointIndex,r=t.connection,s=t.insert,a=r.waypoints.slice(),l=t.source,c=t.target,u=t.type,p=t.hints||{},h={x:wu(e.x),y:wu(e.y)};if(!n)return!1;u===Eu?(s?a.splice(i,0,h):a[i]=h,p.bendpointMove={insert:s,bendpointIndex:i},a=this.cropWaypoints(r,a),o.updateWaypoints(r,function(e){e=e.slice();for(var t,n,i,r=0;e[r];)t=e[r],n=e[r-1],0===_t(t,i=e[r+1])||Et(n,i,t)?e.splice(r,1):r++;return e}(a),p)):(u===xu?(p.docking="source",ku(t)&&(p.docking="target",p.newWaypoints=a.reverse())):u===_u&&(p.docking="target",ku(t)&&(p.docking="source",p.newWaypoints=a.reverse())),o.reconnect(r,l,c,h,p))},this)}function ku(e){var t=e.hover,n=e.source,i=e.target,r=e.type;return r===xu?t&&i&&t===i&&n!==i:r===_u?t&&n&&t===n&&n!==i:void 0}Su.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],Su.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};var Ou="updateWaypoints",Cu="connect-ok",Pu="connect-not-ok",Au="connect-hover",Tu="djs-updating",Ru="djs-dragging";function Mu(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(e){var t=e.context,n=t.bendpointIndex,r=t.connection,o=t.insert,s=r.waypoints,a=s.slice();t.waypoints=s,o&&a.splice(n,0,{x:e.x,y:e.y}),r.waypoints=a,xe(t.draggerGfx=fu(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(r,Ru),i.addMarker(r,Tu)}),n.on("bendpoint.move.hover",function(e){var t=e.context,n=t.allowed,r=t.hover,o=t.type;if(r){if(i.addMarker(r,Au),o===Ou)return;n?(i.removeMarker(r,Pu),i.addMarker(r,Cu)):!1===n&&(i.removeMarker(r,Cu),i.addMarker(r,Pu))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],1100,function(e){var t=e.context,n=t.hover,r=t.target;n&&(i.removeMarker(n,Au),i.removeMarker(n,r?Cu:Pu))}),n.on("bendpoint.move.move",function(t){var n=t.context,i=n.allowed,o=n.bendpointIndex,s=n.draggerGfx,a=n.hover,l=n.type,c=n.connection,u=c.source,p=c.target,h=c.waypoints.slice(),d={x:t.x,y:t.y},f=n.hints||{},m={};r&&(f.connectionStart&&(m.connectionStart=f.connectionStart),f.connectionEnd&&(m.connectionEnd=f.connectionEnd),"reconnectStart"===l?ku(n)?(m.connectionEnd=m.connectionEnd||d,m.source=p,m.target=a||u,h=h.reverse()):(m.connectionStart=m.connectionStart||d,m.source=a||u,m.target=p):"reconnectEnd"===l?ku(n)?(m.connectionStart=m.connectionStart||d,m.source=a||p,m.target=u,h=h.reverse()):(m.connectionEnd=m.connectionEnd||d,m.source=u,m.target=a||p):(m.noCropping=!0,m.noLayout=!0,h[o]=d),l===Ou&&(h=e.cropWaypoints(c,h)),m.waypoints=h,r.drawPreview(n,i,m)),Qn(s,t.x,t.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,function(e){var t=e.context,n=t.connection,o=t.draggerGfx,s=t.hover,a=t.target,l=t.waypoints;n.waypoints=l,ze(o),i.removeMarker(n,Tu),i.removeMarker(n,Ru),s&&(i.removeMarker(s,Cu),i.removeMarker(s,a?Cu:Pu)),r&&r.cleanUp(t)})}Mu.$inject=["bendpointMove","injector","eventBus","canvas"];var $u="connect-hover",Du="djs-updating";function Bu(e,t,n){return Lu(e,t,e[t]+n)}function Lu(e,t,n){return{x:"x"===t?n:e.x,y:"y"===t?n:e.y}}function Iu(e){return"x"===e?"y":"x"}function Nu(e,t,n){var i,r;return e.original?e.original:(i=fn(t),Lu(e,r=Iu(n),i[r]))}function zu(e,t,n,i,r,o){var s=e.get("connectionDocking",!1);function a(e,t){if(!s)return t;var n,i=e.waypoints;return e.waypoints=t,n=s.getCroppedWaypoints(e),e.waypoints=i,n}function l(e){r.update("connection",e.connection,e.connectionGfx)}function c(e,t,n){var i=e.newWaypoints,r=function(e,t,n,i){var r=Math.max(t[i],n[i]),o=Math.min(t[i],n[i]);return Lu(t,i,Math.min(Math.max(o+20,e[i]),r-20))}(n,i[e.segmentStartIndex+t],i[e.segmentEndIndex+t],Iu(e.axis));Qn(e.draggerGfx,r.x,r.y)}this.start=function(e,t,r){var o,s,a,l,c=n.getGraphics(t),u=r-1,p=r,h=t.waypoints,d=h[u],f=h[p],m=du(n,h,e);if(s=St(d,f))return a="v"===s?"x":"y",0===u&&(d=Nu(d,t.source,a)),p===h.length-1&&(f=Nu(f,t.target,a)),o={connection:t,segmentStartIndex:u,segmentEndIndex:p,segmentStart:d,segmentEnd:f,axis:a,dragPosition:l=m?m.point:{x:(d.x+f.x)/2,y:(d.y+f.y)/2}},i.init(e,l,"connectionSegment.move",{cursor:"x"===a?"resize-ew":"resize-ns",data:{connection:t,connectionGfx:c,context:o}})},t.on("connectionSegment.move.start",function(e){var t=e.context,i=e.connection,r=n.getLayer("overlays");t.originalWaypoints=i.waypoints.slice(),t.draggerGfx=gu(r,t.segmentStart,t.segmentEnd),xe(t.draggerGfx).add("djs-dragging"),n.addMarker(i,Du)}),t.on("connectionSegment.move.move",function(e){var t,n,i=e.context,r=i.connection,o=i.segmentStartIndex,s=i.segmentEndIndex,u=i.segmentStart,p=i.segmentEnd,h=i.axis,d=i.originalWaypoints.slice(),f=Bu(u,h,e["d"+h]),m=Bu(p,h,e["d"+h]),g=d.length,v=0;d[o]=f,d[s]=m,o<2&&(t=mn(r.source,f),1===o?"intersect"===t&&(d.shift(),d[0]=f,v--):"intersect"!==t&&(d.unshift(u),v++)),s>g-3&&(n=mn(r.target,m),s===g-2?"intersect"===n&&(d.pop(),d[d.length-1]=m):"intersect"!==n&&d.push(p)),i.newWaypoints=r.waypoints=a(r,d),c(i,v,e),i.newSegmentStartIndex=o+v,l(e)}),t.on("connectionSegment.move.hover",function(e){e.context.hover=e.hover,n.addMarker(e.hover,$u)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(e){var t=e.context.hover;t&&n.removeMarker(t,$u)}),t.on("connectionSegment.move.cleanup",function(e){var t=e.context,i=t.connection;t.draggerGfx&&ze(t.draggerGfx),n.removeMarker(i,Du)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,l(e)}),t.on("connectionSegment.move.end",function(e){var t=e.context,n=t.connection,i=t.newWaypoints,r=t.newSegmentStartIndex;i=i.map(function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}});var s=function(e,t){var n=0,i=e.filter(function(i,r){return!Et(e[r-1],e[r+1],i)||(n=r<=t?n-1:n,!1)});return{waypoints:i,segmentOffset:n}}(i,r),l=a(n,s.waypoints),c=s.segmentOffset,u={segmentMove:{segmentStartIndex:t.segmentStartIndex,newSegmentStartIndex:r+c}};o.updateWaypoints(n,l,u)})}zu.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var ju=Math.abs,Vu=Math.round;function Fu(e){return{x:e.x,y:e.y}}function qu(e){return{x:e.x+e.width,y:e.y+e.height}}function Hu(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:Vu(e.x+e.width/2),y:Vu(e.y+e.height/2)}}function Wu(e,t){var n=e.snapped;return!!n&&("string"==typeof t?n[t]:n.x&&n.y)}function Qu(e,t,n){if("string"!=typeof t)throw new Error("axis must be in [x, y]");if("number"!=typeof n&&!1!==n)throw new Error("value must be Number or false");var i,r=e[t],o=e.snapped=e.snapped||{};return!1===n?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function Xu(e){return e.children||[]}var Gu=Math.abs,Uu=Math.round;function Yu(e){function t(e,t){if(d(e)){for(var n=e.length;n--;)if(Gu(e[n]-t)<=10)return e[n]}else{var i=t%(e=+e);if(i<10)return t-i;if(i>e-10)return t-i+e}return t}function n(e,t){return e.waypoints?yu(t,e):e.width?{x:Uu(e.width/2+e.x),y:Uu(e.height/2+e.y)}:void 0}e.on("connectionSegment.move.move",1500,function(e){var i,r,o=function(e){var t=e.context,i=t.snapPoints,r=t.connection,o=r.waypoints,s=t.segmentStart,a=t.segmentStartIndex,l=t.segmentEnd,c=t.segmentEndIndex,u=t.axis;if(i)return i;var p=[o[a-1],s,l,o[c+1]];return a<2&&p.unshift(n(r.source,e)),c>o.length-3&&p.unshift(n(r.target,e)),t.snapPoints=i={horizontal:[],vertical:[]},E(p,function(e){e&&(e=e.original||e,"y"===u&&i.horizontal.push(e.y),"x"===u&&i.vertical.push(e.x))}),i}(e),s=e.x,a=e.y;if(o){var l=s-(i=t(o.vertical,s)),c=a-(r=t(o.horizontal,a));q(e,{dx:e.dx-l,dy:e.dy-c,x:i,y:r}),(l||-1!==o.vertical.indexOf(s))&&Qu(e,"x",i),(c||-1!==o.horizontal.indexOf(a))&&Qu(e,"y",r)}}),e.on(["connect.hover","connect.move","connect.end"],1500,function(e){var t=e.context.hover,i=t&&n(t,e);an(t)&&i&&i.x&&i.y&&(Qu(e,"x",i.x),Qu(e,"y",i.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(e){var i,r,o=e.context,s=function(e){var t=e.snapPoints,n=e.connection.waypoints,i=e.bendpointIndex;if(t)return t;var r=[n[i-1],n[i+1]];return e.snapPoints=t={horizontal:[],vertical:[]},E(r,function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))}),t}(o),a=o.hover,l=a&&n(a,e),c=e.x,u=e.y;if(s){var p=c-(i=t(l?s.vertical.concat([l.x]):s.vertical,c)),h=u-(r=t(l?s.horizontal.concat([l.y]):s.horizontal,u));q(e,{dx:e.dx-p,dy:e.dy-h,x:e.x-p,y:e.y-h}),(p||-1!==s.vertical.indexOf(c))&&Qu(e,"x",i),(h||-1!==s.horizontal.indexOf(u))&&Qu(e,"y",r)}})}Yu.$inject=["eventBus"];var Ku={__depends__:[Kc,nu],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",bu],bendpointMove:["type",Su],bendpointMovePreview:["type",Mu],connectionSegmentMove:["type",zu],bendpointSnapping:["type",Yu]};function Zu(e,t,n,i){function r(e,t){return i.allowed("connection.create",{source:e,target:t})}e.on("connect.hover",function(e){var t,n=e.context,i=n.start,o=e.hover;if(n.hover=o,!h(t=n.canExecute=r(i,o))){if(!1!==t)return n.source=i,void(n.target=o);h(t=n.canExecute=r(o,i))||!1!==t&&(n.source=o,n.target=i)}}),e.on(["connect.out","connect.cleanup"],function(e){var t=e.context;t.hover=null,t.source=null,t.target=null,t.canExecute=!1}),e.on("connect.end",function(e){var t=e.context,i=t.canExecute,r=t.connectionStart,o={x:e.x,y:e.y},s=t.source,a=t.target;if(!i)return!1;var l=null,c={connectionStart:Ju(t)?o:r,connectionEnd:Ju(t)?r:o};f(i)&&(l=i),t.connection=n.connect(s,a,l,c)}),this.start=function(e,n,i,r){f(i)||(r=i,i=fn(n)),t.init(e,"connect",{autoActivate:r,data:{shape:n,context:{start:n,connectionStart:i}}})}}function Ju(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}Zu.$inject=["eventBus","dragging","modeling","rules"];var ep="connect-ok",tp="connect-not-ok";function np(e,t,n){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(e){var t=e.context,n=t.canExecute,r=t.hover,o=t.source,s=t.start,a=t.startPosition,l=t.target,c=t.connectionStart||a,u=t.connectionEnd||{x:e.x,y:e.y},p=c,h=u;Ju(t)&&(p=u,h=c),i.drawPreview(t,n,{source:o||s,target:l||r,connectionStart:p,connectionEnd:h})}),t.on("connect.hover",900,function(e){var t=e.context,i=e.hover,r=t.canExecute;null!==r&&n.addMarker(i,r?ep:tp)}),t.on(["connect.out","connect.cleanup"],1100,function(e){var t=e.hover;t&&(n.removeMarker(t,ep),n.removeMarker(t,tp))}),i&&t.on("connect.cleanup",function(e){i.cleanUp(e.context)})}np.$inject=["injector","eventBus","canvas"];var ip={__depends__:[As,nu,Kc],__init__:["connectPreview"],connect:["type",Zu],connectPreview:["type",np]};function rp(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)}rp.$inject=["injector","canvas","graphicsFactory","elementFactory"],rp.prototype.drawPreview=function(e,t,n){n=n||{};var i,r=e.connectionPreviewGfx,o=e.getConnection,s=n.source,a=n.target,l=n.waypoints,c=n.connectionStart,u=n.connectionEnd,p=n.noLayout,h=n.noCropping,d=n.noNoop,f=this;r||(r=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),Ee(r),o||(o=e.getConnection=function(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(e,t,n){return f.getConnection(e,t,n)})),t&&(i=o(t,s,a)),i?(i.waypoints=l||[],this._layouter&&!p&&(i.waypoints=this._layouter.layoutConnection(i,{source:s,target:a,connectionStart:c,connectionEnd:u,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[s?fn(s):c,a?fn(a):u]),this._connectionDocking&&(s||a)&&!h&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,s,a)),this._graphicsFactory.drawConnection(r,i,{stroke:"var(--element-dragger-color)"})):!d&&this.drawNoopPreview(r,n)},rp.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||fn(n),o=t.connectionEnd||fn(i),s=this.cropWaypoints(r,o,n,i);ge(e,this.createNoopConnection(s[0],s[1]))},rp.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),s=i&&r.getShapePath(i),a=r.getConnectionPath({waypoints:[e,t]});return[e=n&&gn(o,a,!0)||e,t=i&&gn(s,a,!1)||t]},rp.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&ze(e.connectionPreviewGfx)},rp.prototype.getConnection=function(e){var t=function(e){return f(e)?e:{}}(e);return this._elementFactory.createConnection(t)},rp.prototype.createConnectionPreviewGfx=function(){var e=Pe("g");return be(e,{pointerEvents:"none"}),xe(e).add("djs-dragger"),ge(this._canvas.getActiveLayer(),e),e},rp.prototype.createNoopConnection=function(e,t){return ot([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};var op={__init__:["connectionPreview"],connectionPreview:["type",rp]};const sp=new Mo("ps");var ap=["marker-start","marker-mid","marker-end"],lp=["circle","ellipse","line","path","polygon","polyline","path","rect"];function cp(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i}cp.$inject=["elementRegistry","eventBus","canvas","styles"],cp.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")},cp.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},cp.prototype.addDragger=function(e,t,n,i="djs-dragger"){var r=Se(n=n||this.getGfx(e));return this._cloneMarkers(Hn(r),i),be(r,this._styles.cls(i,[])),ge(t,r),be(r,"data-preview-support-element-id",e.id),r},cp.prototype.addFrame=function(e,t){var n=Pe("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return ge(t,n),be(n,"data-preview-support-element-id",e.id),n},cp.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var i=this;e.childNodes&&e.childNodes.forEach(e=>{i._cloneMarkers(e,t,n)}),function(e){return-1!==lp.indexOf(e.nodeName)}(e)&&ap.forEach(function(r){if(be(e,r)){var o=function(e,t,n){var i=(r=be(e,t),r.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]);var r;return de("marker#"+i,n||document)}(e,r,i._canvas.getContainer());o&&i._cloneMarker(n,e,o,r,t)}})},cp.prototype._cloneMarker=function(e,t,n,i,r="djs-dragger"){var o=[n.id,r,sp.next()].join("-"),s=de("marker#"+n.id,e);e=e||this._canvas._svg;var a=s||Se(n);a.id=o,xe(a).add(r);var l=de(":scope > defs",e);l||ge(e,l=Pe("defs")),ge(l,a);var c=function(e){return"url(#"+e+")"}(a.id);be(t,i,c)};var up={__init__:["previewSupport"],previewSupport:["type",cp]};const pp="complex-preview";class hp{constructor(e,t,n){this._canvas=e,this._graphicsFactory=t,this._previewSupport=n,this._markers=[]}create(e){this.cleanUp();const{created:t=[],moved:n=[],removed:i=[],resized:r=[]}=e,o=this._canvas.getLayer(pp);t.filter(e=>!function(e){return e.hidden}(e)).forEach(e=>{let t;an(e)?(t=this._graphicsFactory._createContainer("connection",Pe("g")),this._graphicsFactory.drawConnection(Hn(t),e)):(t=this._graphicsFactory._createContainer("shape",Pe("g")),this._graphicsFactory.drawShape(Hn(t),e),Qn(t,e.x,e.y)),this._previewSupport.addDragger(e,o,t)}),n.forEach(({element:e,delta:t})=>{this._previewSupport.addDragger(e,o,void 0,"djs-dragging"),this._canvas.addMarker(e,"djs-element-hidden"),this._markers.push([e,"djs-element-hidden"]);const n=this._previewSupport.addDragger(e,o);an(e)?Qn(n,t.x,t.y):Qn(n,e.x+t.x,e.y+t.y)}),i.forEach(e=>{this._previewSupport.addDragger(e,o,void 0,"djs-dragging"),this._canvas.addMarker(e,"djs-element-hidden"),this._markers.push([e,"djs-element-hidden"])}),r.forEach(({shape:e,bounds:t})=>{this._canvas.addMarker(e,"djs-hidden"),this._markers.push([e,"djs-hidden"]),this._previewSupport.addDragger(e,o,void 0,"djs-dragging");const n=this._graphicsFactory._createContainer("shape",Pe("g"));this._graphicsFactory.drawShape(Hn(n),e,{width:t.width,height:t.height}),Qn(n,t.x,t.y),this._previewSupport.addDragger(e,o,n)})}cleanUp(){Ee(this._canvas.getLayer(pp)),this._markers.forEach(([e,t])=>this._canvas.removeMarker(e,t)),this._markers=[]}show(){this._canvas.showLayer(pp)}hide(){this._canvas.hideLayer(pp)}}hp.$inject=["canvas","graphicsFactory","previewSupport"];var dp={__depends__:[up],__init__:["complexPreview"],complexPreview:["type",hp]},fp=["top","bottom","left","right"],mp=10;function gp(e,t){function n(e){if(Wr(e)&&!an(e)&&!vr(e,"bpmn:Group")){var n=function(e){var t=fn(e.label),n=fn(e),i=vp(n,t);if(r=i,-1===fp.indexOf(r))return;var r;var o=function(e){var t=fn(e),n=[].concat(e.incoming.map(function(e){return e.waypoints[e.waypoints.length-2]}),e.outgoing.map(function(e){return e.waypoints[1]})).map(function(e){return vp(t,e)});return n}(e);if(e.host){var s=function(e){var t,n=e.host,i=fn(e),r=mn(i,n);t=r.indexOf("-")>=0?r.split("-"):[r];var o=fp.filter(function(e){return-1===t.indexOf(e)});return o}(e);o=o.concat(s)}var a=fp.filter(function(e){return-1===o.indexOf(e)});if(-1!==a.indexOf(i)){if("intersect"!==mn(e.label,e))return;return i}return a[0]}(e);n&&function(e,n){var i=fn(e),r=e.label,o=fn(r);if(!r.parent)return;var s,a=pn(e);switch(n){case"top":s={x:i.x,y:a.top-mp-r.height/2};break;case"left":s={x:a.left-mp-r.width/2,y:i.y};break;case"bottom":s={x:i.x,y:a.bottom+mp+r.height/2};break;case"right":s={x:a.right+mp+r.width/2,y:i.y}}var l=oa(s,o);t.moveShape(r,l)}(e,n)}}Vo.call(this,e),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(e){var t=e.context,i=t.connection,r=i.source,o=i.target;!1!==(t.hints||{}).createElementsBehavior&&(n(r),n(o))}),this.postExecuted(["label.create"],function(e){var t=e.context,i=t.shape;!1!==(t.hints||{}).createElementsBehavior&&n(i.labelTarget)}),this.postExecuted(["elements.create"],function(e){var t=e.context,i=t.elements;!1!==(t.hints||{}).createElementsBehavior&&i.forEach(function(e){n(e)})})}function vp(e,t){return mn(t,e,5)}function yp(e){Vo.call(this,e),this.preExecute("shape.append",function(e){var t=e.source,n=e.shape;e.position||(vr(n,"bpmn:TextAnnotation")?e.position={x:t.x+t.width/2+75,y:t.y-50-n.height/2}:e.position={x:t.x+t.width+80+n.width/2,y:t.y+t.height/2})},!0)}e(gp,Vo),gp.$inject=["eventBus","modeling"],e(yp,Vo),yp.$inject=["eventBus"];function bp(e,t,n){function i(e){var t=_(e,e=>vr(e,"bpmn:Participant")||vr(e,"bpmn:SubProcess"));if(!t.length)return[];var i=n.getRootElement(),r=new Set(i.children.filter(e=>vr(e,"bpmn:Artifact"))),o=new Set;return E(t,e=>{const t=new Set(R(dt(Array.from(r),ht(e))));o=o.union(t),r=r.difference(t)}),Array.from(o)}e.invoke(Vo,this),this.preExecute("elements.delete",1500,function(e){var t=e.context,n=t.elements,r=i(n);r.length&&(t.elements=n.concat(r))}),t.on("shape.move.start",function(e){var t=e.context.shapes,n=i(t);n.length&&(e.context.shapes=t.concat(n))})}function wp(e,t){e.invoke(Vo,this),this.postExecute("shape.move",function(e){var n=e.newParent,i=e.shape;E(_(i.incoming.concat(i.outgoing),function(e){return vr(e,"bpmn:Association")}),function(e){t.moveConnection(e,{x:0,y:0},n)})},!0)}e(bp,Vo),bp.$inject=["injector","eventBus","canvas"],e(wp,Vo),wp.$inject=["injector","modeling"];function xp(e,t){t.invoke(Vo,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(e){var t=e.elements;1===(t=t.filter(function(e){return _p(e,e.host)})).length&&t.map(function(e){return t.indexOf(e)}).forEach(function(i){var r=t[i];e.elements[i]=n._replaceShape(t[i],r)})},!0),this.preExecute("elements.move",500,function(e){var t=e.shapes,i=e.newHost;if(1===t.length){var r=t[0];_p(r,i)&&(e.shapes=[n._replaceShape(r,i)])}},!0)}function _p(e,t){return!ln(e)&&yr(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}function Ep(e,t){function n(e){return _(e.attachers,function(e){return vr(e,"bpmn:BoundaryEvent")})}Vo.call(this,e),this.postExecute("connection.create",function(e){var i=e.context.source,r=e.context.target,o=n(r);vr(i,"bpmn:EventBasedGateway")&&vr(r,"bpmn:ReceiveTask")&&o.length>0&&t.removeElements(o)}),this.postExecute("connection.reconnect",function(e){var i=e.context.oldSource,r=e.context.newSource;vr(i,"bpmn:Gateway")&&vr(r,"bpmn:EventBasedGateway")&&E(r.outgoing,function(e){var i=e.target,r=n(i);vr(i,"bpmn:ReceiveTask")&&r.length>0&&t.removeElements(r)})})}function Sp(e){return e.create("bpmn:Category")}function kp(e,t){var n=t.get("categoryValueRef");return n||(n=t.categoryValueRef=function(e){return e.create("bpmn:CategoryValue")}(e)),n.$parent||(n.$parent=Sp(e)),n}xp.$inject=["bpmnReplace","injector"],e(xp,Vo),xp.prototype._replaceShape=function(e,t){var n,i=(n=br(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})},Ep.$inject=["eventBus","modeling"],e(Ep,Vo);function Op(e,t,n){function i(e){return t.filter(function(e){return vr(e,"bpmn:Group")&&!e.labelTarget}).map(br).filter(function(t){return t!==e})}function r(t,n){t&&n&&function(e,t,n){wt(t.get("categoryValue"),e),e.$parent=t,wt(n.get("rootElements"),t),t.$parent=n}(t,n,e.getDefinitions())}function o(e,t,n){t&&!function(e,t){return i(t).some(function(t){var n=t.get("categoryValueRef");return n&&n.$parent===e})}(t,n)&&function(e){var t=e.$parent;t&&(bt(t.get("rootElements"),e),e.$parent=null)}(t),e&&!function(e,t){return i(t).some(function(t){return t.get("categoryValueRef")===e})}(e,n)&&function(e){var t=e.$parent;t&&(bt(t.get("categoryValue"),e),e.$parent=null)}(e)}n.invoke(Vo,this),this.executed(["shape.create","label.create"],function(e){var t=e.labelTarget||e.shape;vr(t,"bpmn:Group")&&!t.labelTarget&&r(e.categoryValue,e.category)},!0),this.reverted(["shape.create","label.create"],function(e){var t=e.labelTarget||e.shape;vr(t,"bpmn:Group")&&!t.labelTarget&&o(e.categoryValue,e.category,br(t))},!0),this.executed(["shape.move","shape.resize"],500,function(e){r(e.categoryValue,e.category)},!0),this.reverted(["shape.move","shape.resize"],function(e){var t=e.shape;e.categoryValue&&o(e.categoryValue,e.category,br(t))},!0),this.executed("group.updateRefs",function(e){Cp(e).forEach(function(e){r(e.categoryValue,e.category)})},!0),this.reverted("group.updateRefs",function(e){Cp(e).forEach(function(e){o(e.categoryValue,e.category,br(e.groupShape))})},!0),this.executed("shape.delete",function(e){var t=e.shape;vr(t,"bpmn:Group")&&!t.labelTarget&&o(e.categoryValue,e.category,br(t))},!0),this.reverted("shape.delete",function(e){var t=e.shape;vr(t,"bpmn:Group")&&!t.labelTarget&&r(e.categoryValue,e.category)},!0)}function Cp(e){return e.updates?.groups||[]}function Pp(e,t,n){function i(e){t.updateProperties(e,{isForCompensation:!0})}function r(e){t.updateProperties(e,{isForCompensation:void 0})}Vo.call(this,e),this.preExecute("shape.replace",function(e){const{newData:n,oldShape:i}=e;if(Tp(e.oldShape)&&"bpmn:CompensateEventDefinition"!==n.eventDefinitionType||"bpmn:BoundaryEvent"!==n.type){const t=i.outgoing.find(({target:e})=>Ap(e));t&&t.target&&(e._connectionTarget=t.target)}else if(!Tp(e.oldShape)&&"bpmn:CompensateEventDefinition"===n.eventDefinitionType&&"bpmn:BoundaryEvent"===n.type){const n=i.outgoing.find(({target:e})=>Rp(e));n&&n.target&&(e._connectionTarget=n.target),function(e){const n=e.outgoing.filter(e=>vr(e,"bpmn:SequenceFlow"));t.removeElements(n)}(i)}},!0),this.postExecuted("shape.replace",function(e){const{_connectionTarget:n,newShape:i}=e;n&&t.connect(i,n)},!0),this.preExecute("connection.create",function(e){const n=e.connection,r=e.source,o=e.target;Tp(r)&&Rp(o)&&(i(o),function(e,n){const i=e.outgoing.filter(e=>vr(e,"bpmn:Association")),r=i.filter(e=>Ap(e.target)&&!n.includes(e));r.forEach(e=>t.removeConnection(e))}(r,[n]))},!0),this.postExecuted("connection.delete",function(e){const t=e.source,n=e.target;Tp(t)&&Ap(n)&&r(n)},!0),this.postExecuted("connection.reconnect",function(e){const t=e.newTarget,n=e.oldSource,o=e.oldTarget;if(o!==t){const e=n;Ap(o)&&r(o),Tp(e)&&Rp(t)&&i(t)}},!0),this.postExecuted("element.updateProperties",function(e){const{element:i}=e;Ap(i)?(function(e){for(const i of e.incoming)n.canConnect(i.source,e)||t.removeConnection(i);for(const i of e.outgoing)n.canConnect(e,i.target)||t.removeConnection(i)}(i),function(e){const n=e.attachers.slice();if(!n.length)return;t.removeElements(n)}(i)):Rp(i)&&function(e){const n=e.incoming.filter(e=>Tp(e.source));t.removeElements(n)}(i)},!0)}function Ap(e){const t=br(e);return t&&t.get("isForCompensation")}function Tp(e){return e&&vr(e,"bpmn:BoundaryEvent")&&Fr(e,"bpmn:CompensateEventDefinition")}function Rp(e){return e&&vr(e,"bpmn:Activity")&&!Vr(e)}function Mp(e){e.invoke(Vo,this),this.preExecute("shape.create",1500,function(e){var t=e.context,n=t.parent,i=t.shape;vr(n,"bpmn:Lane")&&!vr(i,"bpmn:Lane")&&(t.parent=Dc(n,"bpmn:Participant"))})}function $p(e,t){Vo.call(this,e),this.preExecute("shape.create",function(e){var n=e.context.shape;if(vr(n,"bpmn:DataObjectReference")&&"label"!==n.type){var i=t.create("bpmn:DataObject");i.isCollection=n.businessObject.dataObjectRef?.isCollection||!1,n.businessObject.dataObjectRef=i}})}Op.$inject=["bpmnjs","elementRegistry","injector"],e(Op,Vo),e(Pp,Vo),Pp.$inject=["eventBus","modeling","bpmnRules"],Mp.$inject=["injector"],e(Mp,Vo),$p.$inject=["eventBus","bpmnFactory"],e($p,Vo);var Dp=20,Bp=20,Lp=2e3;function Ip(e,t,n){function i(){var t=e.getRootElement();return vr(t,"bpmn:Collaboration")?t:n.makeCollaboration()}Vo.call(this,t),t.on(["create.start","shape.move.start"],Lp,function(t){var n=t.context,i=n.shape,r=e.getRootElement();if(vr(i,"bpmn:Participant")&&vr(r,"bpmn:Process")&&r.children.length){var o=r.children.filter(function(e){return!vr(e,"bpmn:Group")&&!ln(e)&&!an(e)});if(o.length){var s=ht(o),a=function(e,t){t={width:t.width+40+30,height:t.height+40};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}}(i,s);q(i,a),n.createConstraints=function(e,t){return t=pn(t),{bottom:t.top+e.height/2-Bp,left:t.right-e.width/2+Dp,top:t.bottom-e.height/2+Bp,right:t.left+e.width/2-Dp-30}}(i,s)}}}),t.on("create.start",Lp,function(n){var i=n.context.shape,r=e.getRootElement(),o=e.getGraphics(r);function s(e){e.element=r,e.gfx=o}vr(i,"bpmn:Participant")&&vr(r,"bpmn:Process")&&(t.on("element.hover",Lp,s),t.once("create.cleanup",function(){t.off("element.hover",s)}))}),this.preExecute("elements.create",Lp,function(e){var t,n=e.elements,r=e.parent,o=function(e){return w(e,function(e){return vr(e,"bpmn:Participant")})}(n);o&&vr(r,"bpmn:Process")&&(e.parent=i(),(t=e.hints=e.hints||{}).participant=o,t.process=r,t.processRef=br(o).get("processRef"))},!0),this.preExecute("shape.create",function(e){var t=e.parent,n=e.shape;vr(n,"bpmn:Participant")&&vr(t,"bpmn:Process")&&(e.parent=i(),e.process=t,e.processRef=br(n).get("processRef"))},!0),this.execute("shape.create",function(e){var t=e.hints||{},n=e.process||t.process,i=e.shape,r=t.participant;!n||r&&i!==r||br(i).set("processRef",br(n))},!0),this.revert("shape.create",function(e){var t=e.hints||{},n=e.process||t.process,i=e.processRef||t.processRef,r=e.shape,o=t.participant;!n||o&&r!==o||br(r).set("processRef",i)},!0),this.postExecute("shape.create",function(e){var t=e.hints||{},i=e.process||e.hints.process,r=e.shape,o=t.participant;if(i){var s=i.children.slice();o?r===o&&n.moveElements(s,{x:0,y:0},o):n.moveElements(s,{x:0,y:0},r)}},!0)}Ip.$inject=["canvas","eventBus","modeling"],e(Ip,Vo);var Np="__targetRef_placeholder";function zp(e,t){function n(e,n){var i=e.get("properties"),r=w(i,function(e){return e.name===Np});return!r&&n&&wt(i,r=t.create("bpmn:Property",{name:Np})),r}function i(e,t){var i=n(e);i&&(function(e,t,n){return w(e.get("dataInputAssociations"),function(e){return e!==n&&e.targetRef===t})}(e,i,t)||bt(e.get("properties"),i))}function r(e){var t,r=e.context,o=r.connection,s=o.businessObject,a=o.target,l=a&&a.businessObject,c=r.newTarget,u=c&&c.businessObject,p=r.oldTarget||r.target,h=p&&p.businessObject,d=o.businessObject;h&&h!==l&&i(h,s),u&&u!==l&&i(u,s),l?(t=n(l,!0),d.targetRef=t):d.targetRef=null}Vo.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],jp(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],jp(r))}function jp(e){return function(t){if(vr(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function Vp(e){this._bpmnUpdater=e}function Fp(e,t,n,i){function r(e){return e.children.filter(function(e){return vr(e,"bpmn:DataStoreReference")&&!e.labelTarget})}function o(e,i){var r=e.businessObject||e;if(i=i||n.filter(function(e){return vr(e,"bpmn:Participant")&&br(e).processRef})[0]){var o=i.businessObject||i;t.execute("dataStore.updateContainment",{dataStoreBo:r,dataStoreDi:wr(e),newSemanticParent:o.processRef||o,newDiParent:wr(i)})}}Vo.call(this,i),t.registerHandler("dataStore.updateContainment",Vp),this.preExecute("shape.create",function(e){var t=e.context,n=t.shape;vr(n,"bpmn:DataStoreReference")&&"label"!==n.type&&(t.hints||(t.hints={}),t.hints.autoResize=!1)}),this.preExecute("elements.move",function(e){var t=e.context,n=t.shapes;n.filter(function(e){return vr(e,"bpmn:DataStoreReference")}).length&&(t.hints||(t.hints={}),t.hints.autoResize=n.filter(function(e){return!vr(e,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(e){var t=e.context.shape,n=t.parent;vr(t,"bpmn:DataStoreReference")&&"label"!==t.type&&vr(n,"bpmn:Collaboration")&&o(t)}),this.postExecute("shape.move",function(e){var t=e.context,n=t.shape,i=t.oldParent,r=n.parent;vr(i,"bpmn:Collaboration")||vr(n,"bpmn:DataStoreReference")&&"label"!==n.type&&vr(r,"bpmn:Collaboration")&&o(n,vr(i,"bpmn:Participant")?i:function(e,t){for(;e.parent;){if(vr(e.parent,t))return e.parent;e=e.parent}}(i,"bpmn:Participant"))}),this.postExecute("shape.delete",function(t){var n=t.context.shape,i=e.getRootElement();yr(n,["bpmn:Participant","bpmn:SubProcess"])&&vr(i,"bpmn:Collaboration")&&r(i).filter(function(e){return function(e,t){var n=e.businessObject||e,i=t.businessObject||t;for(;n.$parent;){if(n.$parent===i.processRef||i)return!0;n=n.$parent}return!1}(e,n)}).forEach(function(e){o(e)})}),this.postExecute("canvas.updateRoot",function(e){var t=e.context,n=t.oldRoot,i=t.newRoot;r(n).forEach(function(e){vr(i,"bpmn:Process")&&o(e,i)})})}zp.$inject=["eventBus","bpmnFactory"],e(zp,Vo),Vp.$inject=["bpmnUpdater"],Vp.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),[]},Vp.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),[]},Fp.$inject=["canvas","commandStack","elementRegistry","eventBus"],e(Fp,Vo);var qp=Math.max,Hp=Math.min;function Wp(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function Qp(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return m(r)&&(i=(/top|left/.test(e)?Hp:qp)(i,r)),m(o)&&(i=(/top|left/.test(e)?qp:Hp)(i,o)),i}function Xp(e,t){return void 0!==e?e:20}function Gp(e){return!e.waypoints&&"label"!==e.type}function Up(e,t){var n;if((n=void 0===e.length?_(e.children,Gp):e).length)return function(e,t){var n,i,r,o;return"object"==typeof t?(n=Xp(t.left),i=Xp(t.right),r=Xp(t.top),o=Xp(t.bottom)):n=i=r=o=Xp(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}(ht(n),t)}var Yp=Math.abs;var Kp=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],Zp=30;function Jp(e,t){return t=t||[],e.children.filter(function(e){vr(e,"bpmn:Lane")&&(Jp(e,t),t.push(e))}),t}function eh(e){return e.children.filter(function(e){return vr(e,"bpmn:Lane")})}function th(e){return Dc(e,Kp)||e}function nh(e,t){var n=th(e),i=Jp(n,vr(n,"bpmn:Process")?[]:[n]),r=pn(e),o=pn(t),s=function(e,t){return Wp(pn(t),pn(e))}(e,t),a=[],l=zr(e);return i.forEach(function(t){if(t!==e){var n,i,c=l?0:s.top,u=l?s.right:0,p=l?0:s.bottom,h=l?s.left:0,d=pn(t);s.top&&(Yp(d.bottom-r.top)<10&&(p=o.top-d.bottom),Yp(d.top-r.top)<5&&(c=o.top-d.top)),s.left&&(Yp(d.right-r.left)<10&&(u=o.left-d.right),Yp(d.left-r.left)<5&&(h=o.left-d.left)),s.bottom&&(Yp(d.top-r.bottom)<10&&(c=o.bottom-d.top),Yp(d.bottom-r.bottom)<5&&(p=o.bottom-d.bottom)),s.right&&(Yp(d.left-r.right)<10&&(h=o.right-d.left),Yp(d.right-r.right)<5&&(u=o.right-d.right)),(c||u||p||h)&&a.push({shape:t,newBounds:(n=t,i={top:c,right:u,bottom:p,left:h},{x:n.x+(i.left||0),y:n.y+(i.top||0),width:n.width-(i.left||0)+(i.right||0),height:n.height-(i.top||0)+(i.bottom||0)})})}}),a}function ih(e,t){Vo.call(this,e),this.postExecuted("shape.delete",500,function(e){var n=e.context,i=n.hints,r=n.shape,o=n.oldParent;vr(r,"bpmn:Lane")&&(i&&i.nested||function(e,n){var i,r,o,s,a,l=zr(e),c=eh(n),u=[],p=[],h=[],d=[];lt(c,function(t){return l?t.y>e.y?p.push(t):u.push(t):t.x>e.x?d.push(t):h.push(t),t.children}),c.length&&(i=l?p.length&&u.length?e.height/2:e.height:d.length&&h.length?e.width/2:e.width,u.length&&(r=t.calculateAdjustments(u,"y",i,e.y-10),t.makeSpace(r.movingShapes,r.resizingShapes,{x:0,y:i},"s")),p.length&&(o=t.calculateAdjustments(p,"y",-i,e.y+e.height+10),t.makeSpace(o.movingShapes,o.resizingShapes,{x:0,y:-i},"n")),h.length&&(s=t.calculateAdjustments(h,"x",i,e.x-10),t.makeSpace(s.movingShapes,s.resizingShapes,{x:i,y:0},"e")),d.length&&(a=t.calculateAdjustments(d,"x",-i,e.x+e.width+10),t.makeSpace(a.movingShapes,a.resizingShapes,{x:-i,y:0},"w")))}(r,o))})}ih.$inject=["eventBus","spaceTool"],e(ih,Vo);function rh(e,t){t.invoke(Vo,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(e){var t=e.elements;t.filter(function(e){return oh(e,e.host)}).map(function(e){return t.indexOf(e)}).forEach(function(i){e.elements[i]=n._replaceShape(t[i])})},!0),this.preExecute("elements.move",500,function(e){var t=e.shapes,i=e.newHost;t.forEach(function(e,r){var o,s=e.host;oh(e,(o=s,-1!==t.indexOf(o)?s:i))&&(t[r]=n._replaceShape(e))})},!0)}function oh(e,t){return!ln(e)&&vr(e,"bpmn:BoundaryEvent")&&!t}function sh(e,t,n){function i(e,i,r){var o,s,a,l,c,u,p,h,d=i.waypoints,f=e.outgoing.slice(),g=e.incoming.slice(),v=ou(d,h=m(r.width)?fn(r):r);if(v){if(o=d.slice(0,v.index),s=d.slice(v.index+(v.bendpoint?1:0)),!o.length||!s.length)return;a=v.bendpoint?d[v.index]:h,1!==o.length&&ah(e,o[o.length-1])||o.push(lh(a)),1!==s.length&&ah(e,s[0])||s.unshift(lh(a))}if(l=i.source,c=i.target,t.canConnect(l,e,i)&&(n.reconnectEnd(i,e,o||h),u=i),t.canConnect(e,c,i))if(u){p=n.connect(e,c,{type:i.type,waypoints:s});var y=wr(i),b=y&&(y.get("color:border-color")||y.get("bioc:stroke"));b&&n.setColor([p],{stroke:b})}else n.reconnectStart(i,e,s||h),p=i;var w=[].concat(u&&_(g,function(e){return e.source===u.source})||[],p&&_(f,function(e){return e.target===p.target})||[]);w.length&&n.removeElements(w)}Vo.call(this,e),this.preExecute("elements.move",function(e){var n=e.newParent,i=e.shapes,r=e.delta,o=i[0];if(o&&n){n&&n.waypoints&&(e.newParent=n=n.parent);var s=fn(o),a={x:s.x+r.x,y:s.y+r.y},l=w(n.children,function(e){return t.canInsert(i,e)&&ou(e.waypoints,a)});l&&(e.targetFlow=l,e.position=a)}},!0),this.postExecuted("elements.move",function(e){var t=e.shapes,n=e.targetFlow,r=e.position;n&&i(t[0],n,r)},!0),this.preExecute("shape.create",function(e){var n=e.parent,i=e.shape;t.canInsert(i,n)&&(e.targetFlow=n,e.parent=n.parent)},!0),this.postExecuted("shape.create",function(e){var t=e.shape,n=e.targetFlow,r=e.position;n&&i(t,n,r)},!0)}function ah(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 lh(e){return q({},e)}function ch(e,t){Vo.call(this,e),this.preExecuted("connection.create",function(e){var n=e.context,i=n.connection,r=n.source,o=n.target,s=n.hints;if((!s||!1!==s.createElementsBehavior)&&uh(i)){(vr(r,"bpmn:EventBasedGateway")?o.incoming.filter(e=>e!==i&&uh(e)):o.incoming.filter(e=>e!==i&&uh(e)&&vr(e.source,"bpmn:EventBasedGateway"))).forEach(function(e){t.removeConnection(e)})}}),this.preExecuted("shape.replace",function(e){var n=e.context.newShape;vr(n,"bpmn:EventBasedGateway")&&n.outgoing.filter(uh).reduce(function(e,t){return e.includes(t.target)?e:e.concat(t.target)},[]).forEach(function(e){e.incoming.filter(uh).forEach(function(i){const r=e.incoming.filter(uh).filter(function(e){return e.source===n});(i.source!==n||r.length>1)&&t.removeConnection(i)})})})}function uh(e){return vr(e,"bpmn:SequenceFlow")}rh.$inject=["bpmnReplace","injector"],e(rh,Vo),rh.prototype._replaceShape=function(e){var t,n,i=(n=br(e).eventDefinitions)&&n[0];return t=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},e(sh,Vo),sh.$inject=["eventBus","bpmnRules","modeling"],ch.$inject=["eventBus","modeling"],e(ch,Vo);var ph=1500;function hh(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"],ph,function(t){var i=t.context.shape||t.shape,r=t.hover;vr(r,"bpmn:Lane")&&!yr(i,["bpmn:Lane","bpmn:Participant"])&&(t.hover=th(r),t.hoverGfx=e.getGraphics(t.hover));var o=n.getRootElement();r&&r!==o&&(i.labelTarget||yr(i,["bpmn:Group","bpmn:TextAnnotation"]))&&(t.hover=o,t.hoverGfx=e.getGraphics(t.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],ph,function(t){var n=t.hover;vr(n,"bpmn:Lane")&&(t.hover=th(n)||n,t.hoverGfx=e.getGraphics(t.hover))}),t.on(["bendpoint.move.hover"],ph,function(t){var n=t.context,i=t.hover,r=n.type;vr(i,"bpmn:Lane")&&/reconnect/.test(r)&&(t.hover=th(i)||i,t.hoverGfx=e.getGraphics(t.hover))}),t.on(["connect.start"],ph,function(e){var t=e.context,n=t.start;vr(n,"bpmn:Lane")&&(t.start=th(n)||n)}),t.on("shape.move.start",2e3,function(e){var t=e.shape;vr(t,"bpmn:Lane")&&(e.shape=th(t)||t)}),t.on("spaceTool.move",2e3,function(e){var t=e.hover;t&&vr(t,"bpmn:Lane")&&(e.hover=th(t))})}hh.$inject=["elementRegistry","eventBus","canvas"];function dh(e,t,n,i){function r(t,n){var i=br(t),r=n.categoryValue||i.categoryValueRef;r||(r=kp(e,i));var o=n.category||r.$parent||Sp(e);i.categoryValueRef=r,r.$parent=o,n.categoryValue=r,n.category=o}function o(e,t){var n=br(e),i=t.categoryValue||n.categoryValueRef,r=t.category||i&&i.$parent;i&&(t.categoryValue=i,t.category=r,n.categoryValueRef=null)}function s(t,n){var r=e.create(t.$type);return i.copyElement(t,r,null,n)}n.invoke(Vo,this),this.execute("label.create",function(e){var t=e.context,n=t.labelTarget;vr(n,"bpmn:Group")&&r(n,t)}),this.revert("label.create",function(e){var t=e.context,n=t.labelTarget;vr(n,"bpmn:Group")&&o(n,t)}),this.execute("shape.delete",function(e){var t=e.context,n=t.shape,i=br(n);if(vr(n,"bpmn:Group")&&!n.labelTarget){var r=t.categoryValue=i.categoryValueRef;r&&(t.category=r.$parent,i.categoryValueRef=null)}}),this.reverted("shape.delete",function(e){var t=e.context,n=t.shape;if(vr(n,"bpmn:Group")&&!n.labelTarget){var i=t.category,r=t.categoryValue,o=br(n);r&&(o.categoryValueRef=r,r.$parent=i)}}),this.execute("shape.create",function(e){var t=e.context,n=t.shape,i=t.hints||{};vr(n,"bpmn:Group")&&!n.labelTarget&&(!1!==i.createElementsBehavior||br(n).categoryValueRef||t.categoryValue)&&r(n,t)}),this.reverted("shape.create",function(e){var t=e.context,n=t.shape,i=t.hints||{};vr(n,"bpmn:Group")&&!n.labelTarget&&(!1!==i.createElementsBehavior||br(n).categoryValueRef||t.categoryValue)&&o(n,t)}),this.executed(["shape.move","shape.resize"],function(e){var t=e.context,n=t.shape;!vr(n,"bpmn:Group")||n.labelTarget||br(n).categoryValueRef||r(n,t)}),this.reverted(["shape.move","shape.resize"],function(e){var t=e.context,n=t.shape;vr(n,"bpmn:Group")&&!n.labelTarget&&t.categoryValue&&o(n,t)}),t.on("copyPaste.copyElement",770,function(e){var t=e.descriptor,n=e.element;if(vr(n,"bpmn:Group")&&!n.labelTarget){var i=br(n);if(i.categoryValueRef){var r=i.categoryValueRef;t.categoryValue=s(r,!0),r.$parent&&(t.category=s(r.$parent,!0))}}}),t.on("copyPaste.pasteElement",770,function(e){var t=e.descriptor,n=t.businessObject,i=t.categoryValue,r=t.category;i&&(i=n.categoryValueRef=s(i)),r&&(i.$parent=s(r)),delete t.category,delete t.categoryValue})}function fh(e,t,n,i){var r,o,s,a;return 0==(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))?null:(o=e.y-n.y,s=e.x-n.x,a=((i.x-n.x)*o-(i.y-n.y)*s)/r,{x:Math.round(e.x+a*(t.x-e.x)),y:Math.round(e.y+a*(t.y-e.y))})}function mh(e){function t(e,t,n){var i,r={x:n.x,y:n.y-50},o={x:n.x-50,y:n.y},s=fh(e,t,n,r),a=fh(e,t,n,o);i=s&&a?gh(s,n)>gh(a,n)?a:s:s||a,e.original=i}e.on("bpmnElement.added",function(e){var n,i,r=e.element;r.waypoints&&(t((i=(n=r).waypoints)[0],i[1],fn(n.source)),t(i[i.length-1],i[i.length-2],fn(n.target)))})}function gh(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function vh(e){Vo.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(e){var n=e.context.shape,i=br(n),r=wr(n);if(yr(i,t)){var o=r.get("isHorizontal");void 0===o&&(o=!0),r.set("isHorizontal",o)}})}dh.$inject=["bpmnFactory","eventBus","injector","moddleCopy"],e(dh,Vo),mh.$inject=["eventBus"],vh.$inject=["eventBus"],e(vh,Vo);var yh=Math.sqrt,bh=Math.min,wh=Math.max,xh=Math.abs;function _h(e){return Math.pow(e,2)}function Eh(e,t){return yh(_h(e.x-t.x)+_h(e.y-t.y))}function Sh(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,s=n.x-e.x,a=n.y-e.y,l=r*r+o*o,c=(r*s+o*a)/l,u=c*c-(s*s+a*a-i*i)/l;if(u<0&&u>-1e-6&&(u=0),u<0)return[];var p=yh(u),h=-c+p,d=-c-p,f={x:e.x-r*h,y:e.y-o*h};return 0===u?[f]:[f,{x:e.x-r*d,y:e.y-o*d}].filter(function(n){return function(e,t,n){return kh(e.x,t.x,n.x)&&kh(e.y,t.y,n.y)}(n,e,t)})}function kh(e,t,n){return e>=bh(t,n)-Ch&&e<=wh(t,n)+Ch}function Oh(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var Ch=.1;function Ph(e,t){return xh(e.x-t.x)<=Ch&&xh(e.y-t.y)<=Ch}function Ah(e,t,n,i){var r=0,o=0,s={point:e,delta:{x:0,y:0}},a=function(e,t){var n,i,r,o,s,a,l,c,u,p,h=0;for(h=0;h<t.length-1;h++){if(Ph(n=t[h],i=t[h+1])?a=[n]:(r=Eh(e,n),o=Eh(e,i),a=Sh(n,i,e,bh(r,o))),a.length<1)throw new Error("expected between [1, 2] circle -> line intersections");1===a.length&&(l={type:"bendpoint",position:a[0],segmentIndex:h,bendpointIndex:Ph(n,a[0])?h:h+1}),2===a.length&&(l={type:"segment",position:s=Oh(a[0],a[1]),segmentIndex:h,relativeLocation:Eh(n,s)/Eh(n,i)}),c=Eh(l.position,e),(!p||u>c)&&(p=l,u=c)}return p}(e,n),l=a.segmentIndex,c=function(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var s=i.segmentMove.segmentStartIndex,a=i.segmentMove.newSegmentStartIndex;return r===s?a:r>=a?r+o<a?a:r+o:r}if(i.bendpointMove){var l,c=i.bendpointMove.insert,u=i.bendpointMove.bendpointIndex;return 0===o?r:(r>=u&&(l=c?r+1:r-1),r<u&&(l=r,c&&"bendpoint"!==n.type&&u-1===r&&Th(t,u)<n.relativeLocation&&l++),l)}return 0===o?r:i.connectionStart&&0===r?0:i.connectionEnd&&r===e.length-2?t.length-2:Math.floor((t.length-2)/2)}(n,t,a,i);if(c<0||c>t.length-2||null===c)return s;var u,p,h=Rh(n,l),d=Rh(t,c),f=a.position,m=function(e,t){var n=uu(e[0],e[1]),i=uu(e[0],t);return 0===n?0:i/n}(h,f),g=(u=d,p=au(h),au(u)-p);if("bendpoint"===a.type){var v=t.length-n.length,y=a.bendpointIndex,b=n[y];if(-1!==t.indexOf(b))return s;if(0===v){var w=t[y];return{delta:{x:r=w.x-a.position.x,y:o=w.y-a.position.y},point:{x:e.x+r,y:e.y+o}}}v<0&&0!==y&&y<n.length-1&&(m=Th(n,y))}var x,_,E={x:(d[1].x-d[0].x)*m+d[0].x,y:(d[1].y-d[0].y)*m+d[0].y},S=(x={x:e.x-f.x,y:e.y-f.y},(_=g)?{x:Math.cos(_)*x.x-Math.sin(_)*x.y,y:Math.sin(_)*x.x+Math.cos(_)*x.y}:x);return r=E.x+S.x-e.x,o=E.y+S.y-e.y,{point:un(E),delta:un({x:r,y:o})}}function Th(e,t){var n=uu(e[t-1],e[t]);return n/(n+uu(e[t],e[t+1]))}function Rh(e,t){return[e[t],e[t+1]]}function Mh(e,t,n){var i=ra(t),r=ra(n),o=oa(e,i),s=o.x*(n.width/t.width),a=o.y*(n.height/t.height);return un({x:r.x+s,y:r.y+a})}function $h(e,t,n){var i=ra(e),r=ra(t),o=ra(n),s=oa(e,i),a=oa(i,r),l=function(e,t,n){var i=pn(t),r=pn(n);if(function(e,t){return function(e,t){return e.right!==t.right&&e.left!==t.left}(e,t)||function(e,t){return e.top!==t.top&&e.bottom!==t.bottom}(e,t)}(i,r))return null;var o,s,a,l=mn(t,e);if("top"===l)o={x:0,y:r.bottom-i.bottom};else if("bottom"===l)o={x:0,y:r.top-i.top};else if("right"===l)o={x:r.left-i.left,y:0};else{if("left"!==l)return null;o={x:r.right-i.right,y:0}}if(s={x:e.x+o.x,y:e.y+o.y},a=mn(n,s),a!==l)return null;return o}(i,t,n);if(l)return l;var c=a.x*(n.width/t.width),u=a.y*(n.height/t.height),p=o.x+c,h=o.y+u;return un({x:p+s.x-e.x,y:h+s.y-e.y})}function Dh(e,t){if(t.length){var n=function(e,t){var n=t.map(function(t){return{line:t,distance:uu(e,Bh(e,t))}});return B(n,"distance")[0].line}(e,t);return Bh(e,n)}}function Bh(e,t){var n=t[0],i=t[1],r=i.x-n.x,o=i.y-n.y,s=r*r+o*o;if(0===s)return{x:n.x,y:n.y};var a=((e.x-n.x)*r+(e.y-n.y)*o)/s;return a=Math.max(0,Math.min(1,a)),{x:n.x+a*r,y:n.y+a*o}}var Lh="name",Ih="text";function Nh(e,t,n,i){function r(e){var n=e.context,r=n.element,o=n.properties;if(Lh in o&&t.updateLabel(r,o[Lh]),Ih in o&&vr(r,"bpmn:TextAnnotation")){var s=i.getTextAnnotationBounds({x:r.x,y:r.y,width:r.width,height:r.height},o[Ih]||"");t.updateLabel(r,o.text,s)}}function o(e){var t=e.context,n=t.connection,i=n.label,r=q({},t.hints),o=t.newWaypoints||n.waypoints,s=t.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),function(e,t,n,i){return Ah(fn(e),t,n,i).delta}(i,o,s,r)}Vo.call(this,e),this.postExecute("element.updateProperties",r),this.postExecute("element.updateModdleProperties",e=>{br(e.context.element)===e.context.moddleElement&&r(e)}),this.postExecute(["shape.create","connection.create"],function(e){var n=e.context;if(!1!==(n.hints||{}).createElementsBehavior){var i=n.shape||n.connection;!ln(i)&&Hr(i)&&Ur(i)&&t.updateLabel(i,Ur(i))}}),this.postExecute("shape.delete",function(e){var n=e.context,i=n.labelTarget,r=n.hints||{};i&&!1!==r.unsetLabel&&t.updateLabel(i,null,null,{removeShape:!1})}),this.preExecute("elements.move",function(e){var t=e.context,n=pt(t.shapes).allShapes;function i(e){return!!(n[e.id]||e.host&&n[e.host.id])}t.shapes=t.shapes.filter(function(e){var t=e.labelTarget;return!(t&&t.waypoints&&i(t.source)!==i(t.target))})}),this.postExecute(["connection.layout","connection.updateWaypoints"],function(e){var n=e.context;if(!1!==(n.hints||{}).labelBehavior){var i,r=n.connection.label;r&&r.parent&&(i=o(e),t.moveShape(r,i))}}),this.postExecute(["shape.replace"],function(e){var t=e.context,n=t.newShape,i=t.oldShape,r=br(n);r&&Hr(r)&&i.label&&n.label&&(n.label.x=i.label.x,n.label.y=i.label.y)}),this.preExecute("shape.resize",function(e){var t=e.context,n=t.shape,r=t.hints||{};if(ln(n)&&!r.autoResize){var o=t.newBounds,s=i.getDimensions(Ur(n)||"",{box:o,style:i.getExternalStyle()}),a=Math.ceil(s.height),l=o.y!==n.y,c=n.y+n.height;t.newBounds={width:o.width,height:a,x:o.x,y:l?c-a:o.y}}}),this.postExecute("shape.resize",function(e){var n=e.context,i=n.shape,r=n.newBounds,o=n.oldBounds;if(Wr(i)){var s,a=i.label,l=zh(Dh(fn(a),[[{x:(s=o).x,y:s.y},{x:s.x+(s.width||0),y:s.y}],[{x:s.x+(s.width||0),y:s.y},{x:s.x+(s.width||0),y:s.y+(s.height||0)}],[{x:s.x,y:s.y+(s.height||0)},{x:s.x+(s.width||0),y:s.y+(s.height||0)}],[{x:s.x,y:s.y},{x:s.x,y:s.y+(s.height||0)}]]),o,r);t.moveShape(a,l)}})}function zh(e,t,n){return un(oa(Mh(e,t,n),e))}function jh(e,t){function n(e,t){var n=e.context,i=n.connection,r=q({},n.hints),o=n.newWaypoints||i.waypoints,s=n.oldWaypoints;return void 0===r.startChanged&&(r.startChanged=!!r.connectionStart),void 0===r.endChanged&&(r.endChanged=!!r.connectionEnd),function(e,t,n,i){return Ah(e,t,n,i).point}(t,o,s,r)}Vo.call(this,e),this.postExecute(["connection.layout","connection.updateWaypoints"],function(e){var i=e.context.connection,r=i.outgoing;i.incoming.forEach(function(i){var r=i.waypoints[i.waypoints.length-1],o=n(e,r),s=[].concat(i.waypoints.slice(0,-1),[o]);t.updateWaypoints(i,s)}),r.forEach(function(i){var r=i.waypoints[0],o=n(e,r),s=[].concat([o],i.waypoints.slice(1));t.updateWaypoints(i,s)})}),this.postExecute(["connection.move"],function(e){var n=e.context,i=n.connection,r=i.outgoing,o=i.incoming,s=n.delta;o.forEach(function(e){var n=e.waypoints[e.waypoints.length-1],i={x:n.x+s.x,y:n.y+s.y},r=[].concat(e.waypoints.slice(0,-1),[i]);t.updateWaypoints(e,r)}),r.forEach(function(e){var n=e.waypoints[0],i={x:n.x+s.x,y:n.y+s.y},r=[].concat([i],e.waypoints.slice(1));t.updateWaypoints(e,r)})})}function Vh(e,t,n){var i=Qh(e),r=Xh(i,t),o=i[0];return r.length?r[r.length-1]:Mh(o.original||o,n,t)}function Fh(e,t,n){var i=Qh(e),r=Xh(i,t),o=i[i.length-1];return r.length?r[0]:Mh(o.original||o,n,t)}function qh(e,t,n){var i=Qh(e),r=Wh(t,n),o=i[0];return Mh(o.original||o,r,t)}function Hh(e,t,n){var i=Qh(e),r=Wh(t,n),o=i[i.length-1];return Mh(o.original||o,r,t)}function Wh(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Qh(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Xh(e,t){return _(P(e,Gh),function(e){return function(e,t){return"intersect"===mn(t,e,1)}(e,t)})}function Gh(e){return e.original||e}function Uh(e,t){Vo.call(this,e),this.postExecute("shape.replace",function(e){var n=e.oldShape,i=e.newShape;if(function(e,t){return vr(e,"bpmn:Participant")&&Nr(e)&&vr(t,"bpmn:Participant")&&!Nr(t)}(n,i)){var r,o,s,a,l=(o=ut([r=n]),s=[],a=[],o.forEach(function(e){e!==r&&(e.incoming.forEach(function(e){vr(e,"bpmn:MessageFlow")&&s.push(e)}),e.outgoing.forEach(function(e){vr(e,"bpmn:MessageFlow")&&a.push(e)}))},[]),{incoming:s,outgoing:a});l.incoming.forEach(function(e){var r=Fh(e,i,n);t.reconnectEnd(e,i,r)}),l.outgoing.forEach(function(e){var r=Vh(e,i,n);t.reconnectStart(e,i,r)})}},!0)}e(Nh,Vo),Nh.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],e(jh,Vo),jh.$inject=["eventBus","modeling"],Uh.$inject=["eventBus","modeling"],e(Uh,Vo);const Yh=["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:EscalationEventDefinition","bpmn:ConditionalEventDefinition","bpmn:SignalEventDefinition"];function Kh(e){const t=br(e);if(!(vr(t,"bpmn:BoundaryEvent")||vr(t,"bpmn:StartEvent")&&Vr(t.$parent)))return!1;const n=t.get("eventDefinitions");return!(!n||!n.length)&&Yh.some(e=>vr(n[0],e))}function Zh(e){return vr(e,"bpmn:BoundaryEvent")?"cancelActivity":"isInterrupting"}function Jh(e,t){e.invoke(Vo,this),this.postExecuted("shape.replace",function(e){const n=e.context.oldShape,i=e.context.newShape,r=e.context.hints;if(!Kh(i))return;const o=Zh(i);if(r.targetElement&&void 0!==r.targetElement[o])return;const s=br(n).get(o);s!==br(i).get(o)&&t.updateProperties(i,{[o]:s})})}function ed(e,t){Vo.call(this,e),this.preExecute("shape.resize",function(e){var n=e.shape,i=wr(n),r=i&&i.get("label");r&&r.get("bounds")&&t.updateModdleProperties(n,r,{bounds:void 0})},!0)}function td(e,t,n){Vo.call(this,e),this.preExecute("shape.delete",function(e){var i=e.context.shape;if(1===i.incoming.length&&1===i.outgoing.length){var r=i.incoming[0],o=i.outgoing[0];if(vr(r,"bpmn:SequenceFlow")&&vr(o,"bpmn:SequenceFlow")&&t.canConnect(r.source,o.target,r)){var s=function(e,t){var n=fh(nd(e[e.length-2]),nd(e[e.length-1]),nd(t[1]),nd(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[nd(e[0]),nd(t[t.length-1])]}(r.waypoints,o.waypoints);n.reconnectEnd(r,o.target,s)}}})}function nd(e){return e.original||e}function id(e,t){Vo.call(this,e),this.preExecute("shape.delete",function(e){var t=e.shape,n=t.parent;vr(t,"bpmn:Participant")&&(e.collaborationRoot=n)},!0),this.postExecute("shape.delete",function(e){var n=e.collaborationRoot;if(n&&!n.businessObject.participants.length){var i=t.makeProcess(),r=n.children.slice();t.moveElements(r,{x:0,y:0},i)}},!0)}function rd(e,t,n,i){Vo.call(this,e);var r=i.get("dragging",!1);function o(e){var i,r,o=e.source,s=e.target;e.parent&&(vr(e,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(o,s)||(r=!0),n.canConnectMessageFlow(o,s)&&(i="bpmn:MessageFlow")),vr(e,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(o,s)||(r=!0),n.canConnectSequenceFlow(o,s)&&(i="bpmn:SequenceFlow")),r&&t.removeConnection(e),i&&t.connect(o,s,{type:i,waypoints:e.waypoints.slice()}))}this.postExecuted("elements.move",function(e){E(e.closure.allConnections,o)},!0),this.preExecute("connection.reconnect",function(e){var i,o,s=e.context,a=s.connection,l=s.newSource||a.source,c=s.newTarget||a.target;(i=n.canConnect(l,c))&&i.type!==a.type&&(o=t.connect(l,c,{type:i.type,associationDirection:i.associationDirection,waypoints:a.waypoints.slice()}),a.parent&&t.removeConnection(a),s.connection=o,r&&function(e,t){var n,i=r.context(),o=i&&i.payload.previousSelection;if(!o||!o.length)return;if(n=o.indexOf(e),-1===n)return;o.splice(n,1,t)}(a,o))}),this.postExecuted("element.updateProperties",function(e){var n,i=e.context,r=i.properties,o=i.element,s=o.businessObject;r.default&&(n=w(o.outgoing,L({id:o.businessObject.default.id})))&&t.updateProperties(n,{conditionExpression:void 0}),r.conditionExpression&&s.sourceRef.default===s&&t.updateProperties(o.source,{default:void 0})})}function od(e,t,n,i,r,o){i.invoke(Vo,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(e){var n=e.context,i=n.parent,r=n.elements,o=k(r,function(e,n){var r=t.canReplace([n],n.host||n.parent||i);return r?e.concat(r.replacements):e},[]);o.length&&this._replaceElements(r,o)},this),this.postExecuted(["elements.move"],500,function(e){var n=e.context,i=n.newParent,r=n.newHost,o=[];E(n.closure.topLevel,function(e){o=Vr(e)?o.concat(e.children):o.concat(e)}),1===o.length&&r&&(i=r);var s=t.canReplace(o,i);s&&this._replaceElements(o,s.replacements,r)},this),this.postExecute(["shape.replace"],1500,function(e){var n,i=e.context,r=i.oldShape,o=i.newShape,s=r.attachers;s&&s.length&&(n=t.canReplace(s,o),this._replaceElements(s,n.replacements))},this),this.postExecuted(["shape.replace"],1500,function(e){var t=e.context,n=t.oldShape,i=t.newShape;r.unclaimId(n.businessObject.id,n.businessObject),r.updateProperties(i,{id:n.id})})}Jh.$inject=["injector","modeling"],e(Jh,Vo),e(ed,Vo),ed.$inject=["eventBus","modeling"],e(td,Vo),td.$inject=["eventBus","bpmnRules","modeling"],id.$inject=["eventBus","modeling"],e(id,Vo),e(rd,Vo),rd.$inject=["eventBus","modeling","bpmnRules","injector"],e(od,Vo),od.prototype._replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;E(t,function(t){var r={type:t.newElementType},o=n.get(t.oldElementId),s=e.indexOf(o);e[s]=i.replaceElement(o,r,{select:!1})}),t&&r.select(e)},od.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var sd={width:140,height:120},ad={width:300,height:60},ld={width:60,height:300},cd={width:300,height:150},ud={width:150,height:300},pd={width:140,height:120},hd={width:100,height:40};function dd(e){e.on("resize.start",1500,function(e){var t=e.context,n=t.shape,i=t.direction,r=t.balanced;(vr(n,"bpmn:Lane")||vr(n,"bpmn:Participant"))&&(t.resizeConstraints=function(e,t,n){var i=th(e),r=!0,o=!0,s=Jp(i,[i]),a=pn(e),l={},c={},u=zr(e),p=u?ad:ld;/n/.test(t)?c.top=a.bottom-p.height:/e/.test(t)?c.right=a.left+p.width:/s/.test(t)?c.bottom=a.top+p.height:/w/.test(t)&&(c.left=a.right-p.width);s.forEach(function(e){var i=pn(e);u?(i.top<a.top-10&&(r=!1),i.bottom>a.bottom+10&&(o=!1)):(i.left<a.left-10&&(r=!1),i.right>a.right+10&&(o=!1)),/n/.test(t)&&(n&&fd(a.top-i.bottom)<10&&bd(l,"top",i.top+p.height),fd(a.top-i.top)<5&&yd(c,"top",i.bottom-p.height)),/e/.test(t)&&(n&&fd(a.right-i.left)<10&&yd(l,"right",i.right-p.width),fd(a.right-i.right)<5&&bd(c,"right",i.left+p.width)),/s/.test(t)&&(n&&fd(a.bottom-i.top)<10&&yd(l,"bottom",i.bottom-p.height),fd(a.bottom-i.bottom)<5&&bd(c,"bottom",i.top+p.height)),/w/.test(t)&&(n&&fd(a.left-i.right)<10&&bd(l,"left",i.left+p.width),fd(a.left-i.left)<5&&yd(c,"left",i.right-p.width))});var h=i.children.filter(function(e){return!e.hidden&&!e.waypoints&&(vr(e,"bpmn:FlowElement")||vr(e,"bpmn:Artifact"))}),d=u?wd:xd;return h.forEach(function(e){var n=pn(e);!/n/.test(t)||u&&!r||yd(c,"top",n.top-d.top),/e/.test(t)&&(u||o)&&bd(c,"right",n.right+d.right),!/s/.test(t)||u&&!o||bd(c,"bottom",n.bottom+d.bottom),/w/.test(t)&&(u||r)&&yd(c,"left",n.left-d.left)}),{min:c,max:l}}(n,i,r)),vr(n,"bpmn:SubProcess")&&Nr(n)&&(t.minDimensions=pd),vr(n,"bpmn:TextAnnotation")&&(t.minDimensions=hd)})}dd.$inject=["eventBus"];var fd=Math.abs,md=Math.min,gd=Math.max;function vd(e,t,n,i){var r=e[t];e[t]=void 0===r?n:i(n,r)}function yd(e,t,n){return vd(e,t,n,md)}function bd(e,t,n){return vd(e,t,n,gd)}var wd={top:20,left:50,right:20,bottom:20},xd={top:50,left:20,right:20,bottom:20};function _d(e,t){e.on("resize.start",1501,function(e){var t=e.context,n=t.shape;(vr(n,"bpmn:Lane")||vr(n,"bpmn:Participant"))&&(t.balanced=!vs(e))}),e.on("resize.end",1001,function(e){var n=e.context,i=n.shape,r=n.canExecute,o=n.newBounds;if(vr(i,"bpmn:Lane")||vr(i,"bpmn:Participant"))return r&&(o=cn(o),t.resizeLane(i,o,n.balanced)),!1})}_d.$inject=["eventBus","modeling"];function Ed(e,t,n,i,r){function o(e){return yr(e,["bpmn:ReceiveTask","bpmn:SendTask"])||function(e,t){d(t)||(t=[t]);return C(t,function(t){return Fr(e,t)})}(e,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function s(t){return!!w(e.getDefinitions().get("rootElements"),L({id:t.id}))}function a(e){return vr(e,"bpmn:ErrorEventDefinition")?"errorRef":vr(e,"bpmn:EscalationEventDefinition")?"escalationRef":vr(e,"bpmn:MessageEventDefinition")?"messageRef":vr(e,"bpmn:SignalEventDefinition")?"signalRef":void 0}function l(e){if(yr(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.get("messageRef");var t=e.get("eventDefinitions")[0];return t.get(a(t))}n.invoke(Vo,this),this.executed(["shape.create","element.updateProperties","element.updateModdleProperties"],function(t){var n=t.shape||t.element;if(o(n)){var i=l(br(n));i&&!s(i)&&(wt(e.getDefinitions().get("rootElements"),i),t.addedRootElement=i)}},!0),this.reverted(["shape.create","element.updateProperties","element.updateModdleProperties"],function(t){var n=t.addedRootElement;n&&bt(e.getDefinitions().get("rootElements"),n)},!0),t.on("copyPaste.copyElement",function(e){var t=e.descriptor,n=e.element;if(!n.labelTarget&&o(n)){var i=l(br(n));i&&(t.referencedRootElement=i)}}),t.on("copyPaste.pasteElement",500,function(e){var t=e.descriptor,n=t.businessObject,o=t.referencedRootElement;o&&(s(o)||(o=i.copyElement(o,r.create(o.$type))),function(e,t){if(yr(e,["bpmn:ReceiveTask","bpmn:SendTask"]))return e.set("messageRef",t);var n=e.get("eventDefinitions")[0];n.set(a(n),t)}(n,o),delete t.referencedRootElement)})}Ed.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],e(Ed,Vo);var Sd=Math.max;function kd(e){e.on("spaceTool.getMinDimensions",function(e){var t=e.shapes,n=e.axis,i=e.start,r={};return E(t,function(e){var t=e.id;vr(e,"bpmn:Participant")&&(r[t]=function(e,t,n){var i=zr(e);if(r=e,!eh(r).length)return i?cd:ud;var r;var o=function(e){return"x"===e}(t),s={};s=o?i?cd:{width:Cd(e,n,o),height:ud.height}:i?{width:cd.width,height:Od(e,n,o)}:ud;return s}(e,n,i)),vr(e,"bpmn:Lane")&&(r[t]=zr(e)?ad:ld),vr(e,"bpmn:SubProcess")&&Nr(e)&&(r[t]=pd),vr(e,"bpmn:TextAnnotation")&&(r[t]=hd),vr(e,"bpmn:Group")&&(r[t]=sd)}),r})}function Od(e,t,n){var i;return i=function(e,t,n){var i,r=eh(e);return i=Pd(r,t,n),e.height-i.height+ad.height}(e,t,n),Sd(cd.height,i)}function Cd(e,t,n){var i;return i=function(e,t,n){var i,r=eh(e);return i=Pd(r,t,n),e.width-i.width+ld.width}(e,t,n),Sd(ud.width,i)}function Pd(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=eh(r)).length?Pd(o,t,n):r}kd.$inject=["eventBus"];var Ad=180,Td=160;function Rd(e,t,n,i,r,o,s){Vo.call(this,t),this._canvas=e,this._eventBus=t,this._modeling=n,this._elementFactory=i,this._bpmnFactory=r,this._bpmnjs=o,this._elementRegistry=s;var a=this;function l(e){return vr(e,"bpmn:SubProcess")&&!Nr(e)}function c(t){var n=t.shape,i=t.newRootElement,r=br(n);i=a._addDiagram(i||r),t.newRootElement=e.addRootElement(i)}function u(t){var n=br(t.shape);a._removeDiagram(n);var i=t.newRootElement=s.get(Yo(n));e.removeRootElement(i)}this.executed("shape.create",function(e){l(e.shape)&&c(e)},!0),this.postExecuted("elements.create",function(e){E(e.elements,function(e){if(l(e)){var t=s.get(Yo(e));if(t&&e.children&&e.children.length){var n=Md(e);a._showRecursively(n),a._moveChildrenToShape(n,t)}}})},!0),this.reverted("shape.create",function(e){l(e.shape)&&u(e)},!0),this.preExecute("shape.delete",function(e){var t=e.shape;vr(t,"bpmn:SubProcess")&&Nr(t)&&E(Kr([t]),e=>{n.removeShape(e.annotation)})},!0),this.preExecuted("shape.delete",function(e){var t=e.shape;if(l(t)){var i=s.get(Yo(t));i&&n.removeElements(i.children.slice())}},!0),this.executed("shape.delete",function(e){l(e.shape)&&u(e)},!0),this.reverted("shape.delete",function(e){l(e.shape)&&c(e)},!0),this.preExecuted("shape.replace",function(t){var n=t.oldShape,i=t.newShape;l(n)&&l(i)&&(t.oldRoot=e.removeRootElement(Yo(n)))},!0),this.postExecuted("shape.replace",function(t){var i=t.newShape,r=t.oldRoot,o=e.findRoot(Yo(i));if(r&&o){var s=r.children;n.moveElements(s,{x:0,y:0},o)}},!0),this.executed("element.updateProperties",function(e){var t=e.element;if(vr(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties.id,r=n.id;if(i!==r){if(Zo(t))return s.updateId(t,Ko(r)),void s.updateId(i,r);s.get(Ko(i))&&s.updateId(Ko(i),Ko(r))}}},!0),this.reverted("element.updateProperties",function(e){var t=e.element;if(vr(t,"bpmn:SubProcess")){var n=e.properties,i=e.oldProperties.id,r=n.id;if(i!==r){if(Zo(t))return s.updateId(t,Ko(i)),void s.updateId(r,i);var o=s.get(Ko(r));o&&s.updateId(o,Ko(i))}}},!0),t.on("element.changed",function(e){var n=e.element;if(Zo(n)){var i=n,r=s.get(Uo(i));r&&r!==i&&t.fire("element.changed",{element:r})}}),this.executed("shape.toggleCollapse",400,function(e){var t=e.shape;vr(t,"bpmn:SubProcess")&&(Nr(t)?u(e):(c(e),a._showRecursively(t.children)))},!0),this.reverted("shape.toggleCollapse",400,function(e){var t=e.shape;vr(t,"bpmn:SubProcess")&&(Nr(t)?u(e):(c(e),a._showRecursively(t.children)))},!0),this.postExecuted("shape.toggleCollapse",600,function(e){var t=e.shape;if(vr(t,"bpmn:SubProcess")){var i=e.newRootElement;if(i)if(Nr(t))a._moveChildrenToShape(i.children.slice(),t),E(Kr(t.children),e=>{n.moveShape(e.annotation,{x:0,y:0},t.parent),E(e.associations,e=>{n.moveConnection(e,{x:0,y:0},t.parent)})});else{a._disconnectSharedAnnotations(t);var r=Md(t);a._moveChildrenToShape(r,i)}}},!0),t.on("copyPaste.createTree",function(e){var t=e.element,n=e.children;if(l(t)){var i=Yo(t),r=s.get(i);r&&n.push.apply(n,r.children)}}),t.on("copyPaste.copyElement",function(e){var t=e.descriptor,n=e.element,i=e.elements,r=n.parent;if(vr(wr(r),"bpmndi:BPMNPlane")){var o=Uo(r),s=w(i,function(e){return e.id===o});s&&(t.parent=s.id)}}),t.on("copyPaste.pasteElement",function(e){var t=e.descriptor;t.parent&&(l(t.parent)||t.parent.hidden)&&(t.hidden=!0)})}function Md(e){return e.children.slice().concat((t=e.children,n=[],E(Kr(t),e=>{n.push(e.annotation),n.push.apply(n,e.associations)}),n)).concat(function(e){return ct(e.children||[]).reduce(function(t,n){return n.label&&n.label.parent!==e&&t.push(n.label),t},[])}(e));var t,n}function $d(e,t){e.invoke(Vo,this),this.postExecuted("shape.replace",function(e){var n=e.context.oldShape,i=e.context.newShape;if(vr(i,"bpmn:SubProcess")&&!vr(i,"bpmn:AdHocSubProcess")&&(vr(n,"bpmn:Task")||vr(n,"bpmn:CallActivity"))&&Nr(i)){var r,o={x:(r=i).x+r.width/6,y:r.y+r.height/2};t.createShape({type:"bpmn:StartEvent"},o,i)}})}function Dd(e,t){Vo.call(this,e),this.preExecute("connection.create",function(e){const{target:t}=e;vr(t,"bpmn:TextAnnotation")&&(e.parent=t.parent)},!0),this.preExecute(["shape.create","shape.resize","elements.move"],function(e){const t=e.shapes||[e.shape];1===t.length&&vr(t[0],"bpmn:TextAnnotation")&&(e.hints=e.hints||{},e.hints.autoResize=!1)},!0),this.preExecute("shape.resize",function(e){var n=e.context,i=n.shape,r=n.hints||{};if(vr(i,"bpmn:TextAnnotation")&&!r.autoResize){var o=n.newBounds,s=t.getTextAnnotationBounds(o,Ur(i)||""),a=o.y!==i.y&&Math.abs(o.y+o.height-(i.y+i.height))<=1,l=i.y+i.height;n.newBounds={width:o.width,height:s.height,x:o.x,y:a?l-s.height:o.y}}})}function Bd(e,t){Vo.call(this,e),this.postExecuted("shape.toggleCollapse",1500,function(e){var n=e.shape;if(!Nr(n)){var i=ut(n);i.forEach(function(e){var t=e.incoming.slice(),n=e.outgoing.slice();E(t,function(e){r(e,!0)}),E(n,function(e){r(e,!1)})})}function r(e,r){-1!==i.indexOf(e.source)&&-1!==i.indexOf(e.target)||vr(e,"bpmn:Association")&&(vr(e.source,"bpmn:TextAnnotation")||vr(e.target,"bpmn:TextAnnotation"))||(r?t.reconnectEnd(e,n,fn(n)):t.reconnectStart(e,n,fn(n)))}},!0)}e(Rd,Vo),Rd.prototype._moveChildrenToShape=function(e,t){var n=this._modeling;if(e.length){var i=e.filter(function(e){return!e.hidden});if(i.length){var r,o=ht(i);if(t.x){var s=fn(t),a=fn(o);r={x:s.x-a.x,y:s.y-a.y}}else r={x:Ad-o.x,y:Td-o.y};n.moveElements(e,r,t,{autoResize:!1})}else n.moveElements(e,{x:0,y:0},t,{autoResize:!1})}},Rd.prototype._disconnectSharedAnnotations=function(e){var t=this._modeling,n=new Set(Yr(e).map(e=>e.annotation));n.size&&E(Kr(e.children),e=>{n.has(e.annotation)&&E(e.associations,e=>{t.removeConnection(e)})})},Rd.prototype._showRecursively=function(e,t){var n=this,i=[];return e.forEach(function(e){e.hidden=!!t,i=i.concat(e),e.children&&(i=i.concat(n._showRecursively(e.children,e.collapsed||t)))}),i},Rd.prototype._addDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams;return e.businessObject||(e=this._createNewDiagram(e)),t.push(e.di.$parent),e},Rd.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});return i.$parent=r,n.createRoot({id:Yo(e),type:e.$type,di:i,businessObject:e,collapsed:!0})},Rd.prototype._removeDiagram=function(e){var t=this._bpmnjs.getDefinitions().diagrams,n=w(t,function(t){return t.plane.bpmnElement.id===e.id});return t.splice(t.indexOf(n),1),n},Rd.$inject=["canvas","eventBus","modeling","elementFactory","bpmnFactory","bpmnjs","elementRegistry"],$d.$inject=["injector","modeling"],e($d,Vo),e(Dd,Vo),Dd.$inject=["eventBus","textRenderer"],e(Bd,Vo),Bd.$inject=["eventBus","modeling"];function Ld(e,t,n){Vo.call(this,e),this.executed(["shape.toggleCollapse"],500,function(e){var t,n=e.context.shape;vr(n,"bpmn:SubProcess")&&(n.collapsed?wr(n).isExpanded=!1:((t=n.children).length&&t.forEach(function(e){"label"!==e.type||e.businessObject.name||(e.hidden=!0)}),wr(n).isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],500,function(e){var t=e.context.shape;t.collapsed?wr(t).isExpanded=!1:wr(t).isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],500,function(e){var i,r=e.context.shape,o=t.getDefaultSize(r);i=r.collapsed?function(e,t){return{x:e.x+(e.width-t.width)/2,y:e.y+(e.height-t.height)/2,width:t.width,height:t.height}}(r,o):function(e,t){var n,i,r,o=e.children,s=t;return n=(r=o,r.filter(function(e){return!e.hidden})).concat([e]),(i=Up(n))?(s.width=Math.max(i.width,s.width),s.height=Math.max(i.height,s.height),s.x=i.x+(i.width-s.width)/2,s.y=i.y+(i.height-s.height)/2):(s.x=e.x+(e.width-s.width)/2,s.y=e.y+(e.height-s.height)/2),s}(r,o),n.resizeShape(r,i,null,{autoResize:!r.collapsed&&"nwse"})})}function Id(e,t,n,i){t.invoke(Vo,this),this.preExecute("shape.delete",function(e){var t=e.context.shape,r=t.businessObject;ln(t)||(vr(t,"bpmn:Participant")&&Nr(t)&&n.ids.unclaim(r.processRef.id),i.unclaimId(r.id,r))}),this.preExecute("connection.delete",function(e){var t=e.context.connection.businessObject;i.unclaimId(t.id,t)}),this.preExecute("canvas.updateRoot",function(){var t=e.getRootElement(),i=t.businessObject;vr(t,"bpmn:Collaboration")&&n.ids.unclaim(i.id)})}function Nd(e,t){Vo.call(this,e),this.preExecute("connection.delete",function(e){var n=e.context.connection,i=n.source;(function(e,t){if(!vr(e,"bpmn:SequenceFlow"))return!1;var n=br(t),i=br(e);return n.get("default")===i})(n,i)&&t.updateProperties(i,{default:null})})}e(Ld,Vo),Ld.$inject=["eventBus","elementFactory","modeling"],e(Id,Vo),Id.$inject=["canvas","injector","moddle","modeling"],e(Nd,Vo),Nd.$inject=["eventBus","modeling"];var zd=["shape.create","shape.delete","shape.move","shape.resize"],jd=[...zd,"spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move"];function Vd(e,t){var n;function i(){if(!n)throw new Error("out of bounds release");return n}Vo.call(this,e),this.preExecute(jd,5e3,function(){(n=n||new Fd).enter()}),this.postExecuted(jd,500,function(){!function(){if(!n)throw new Error("out of bounds release");var e=n.leave();e&&(t.updateLaneRefs(n.flowNodes,n.lanes),n=null)}()}),this.preExecute(zd,function(e){var t=e.context.shape,n=i();t&&!t.labelTarget&&(vr(t,"bpmn:Lane")&&n.addLane(t),vr(t,"bpmn:FlowNode")&&n.addFlowNode(t))})}function Fd(){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}}Vd.$inject=["eventBus","modeling"],e(Vd,Vo);var qd=["connection.create","connection.delete","connection.layout","connection.move","connection.reconnect","connection.updateWaypoints","shape.create","shape.delete","shape.move","shape.resize"],Hd=[...qd,"elements.create","elements.delete","elements.move","label.create","spaceTool"];function Wd(e,t){var n;function i(){if(!n)throw new Error("out of bounds release");return n}Vo.call(this,e),this.preExecute(Hd,5e3,function(){(n=n||new Qd).enter()}),this.postExecuted(Hd,500,function(){!function(){if(!n)throw new Error("out of bounds release");var e=n.leave();e&&(t.updateCategoryValueRefs(Array.from(n.affectedFlowElements),Array.from(n.affectedGroupEntries.values())),n=null)}()}),this.preExecute(qd,function(e){var t=e.context.connection||e.context.shape,n=i();t&&!t.labelTarget&&(vr(t,"bpmn:FlowElement")&&n.addFlowElement(t),vr(t,"bpmn:Group")&&n.addGroup(t))}),this.preExecute("label.create",function(e){var t=e.context.labelTarget;vr(t,"bpmn:Group")&&i().addGroup(t)})}function Qd(){this.affectedFlowElements=new Set,this.affectedGroupEntries=new Map,this.counter=0,this.addFlowElement=function(e){this.affectedFlowElements.add(e)},this.addGroup=function(e){this.affectedGroupEntries.has(e)||this.affectedGroupEntries.set(e,{categoryValue:e.businessObject.categoryValueRef,groupShape:e})},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function Xd(e,t){Vo.call(this,e),this.postExecuted("elements.create",function(e){const n=e.context.elements;for(const e of n)Gd(e)&&!Ud(e)&&t.updateProperties(e,{isForCompensation:void 0})})}function Gd(e){const t=br(e);return t&&t.isForCompensation}function Ud(e){return e.incoming.filter(e=>function(e){return e&&vr(e,"bpmn:BoundaryEvent")&&Fr(e,"bpmn:CompensateEventDefinition")}(e.source)).length>0}Wd.$inject=["eventBus","modeling"],e(Wd,Vo),e(Xd,Vo),Xd.$inject=["eventBus","modeling"];var Yd={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","artifactBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","categoryRootElementReferenceBehavior","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","updateCategoryValueRefsBehavior","unsetDefaultFlowBehavior","setCompensationActivityAfterPasteBehavior"],adaptiveLabelPositioningBehavior:["type",gp],appendBehavior:["type",yp],associationBehavior:["type",wp],attachEventBehavior:["type",xp],artifactBehavior:["type",bp],boundaryEventBehavior:["type",Ep],categoryRootElementReferenceBehavior:["type",Op],compensateBoundaryEventBehaviour:["type",Pp],createBehavior:["type",Mp],createDataObjectBehavior:["type",$p],createParticipantBehavior:["type",Ip],dataInputAssociationBehavior:["type",zp],dataStoreBehavior:["type",Fp],deleteLaneBehavior:["type",ih],detachEventBehavior:["type",rh],dropOnFlowBehavior:["type",sh],eventBasedGatewayBehavior:["type",ch],fixHoverBehavior:["type",hh],groupBehavior:["type",dh],importDockingFix:["type",mh],isHorizontalFix:["type",vh],labelBehavior:["type",Nh],layoutConnectionBehavior:["type",jh],messageFlowBehavior:["type",Uh],nonInterruptingBehavior:["type",Jh],removeElementBehavior:["type",td],removeEmbeddedLabelBoundsBehavior:["type",ed],removeParticipantBehavior:["type",id],replaceConnectionBehavior:["type",rd],replaceElementBehaviour:["type",od],resizeBehavior:["type",dd],resizeLaneBehavior:["type",_d],rootElementReferenceBehavior:["type",Ed],spaceToolBehavior:["type",kd],subProcessPlaneBehavior:["type",Rd],subProcessStartEventBehavior:["type",$d],textAnnotationBehavior:["type",Dd],toggleCollapseConnectionBehaviour:["type",Bd],toggleElementCollapseBehaviour:["type",Ld],unclaimIdBehavior:["type",Id],unsetDefaultFlowBehavior:["type",Nd],updateFlowNodeRefsBehavior:["type",Vd],updateCategoryValueRefsBehavior:["type",Wd],setCompensationActivityAfterPasteBehavior:["type",Xd]};function Kd(e,t){var n=mn(e,t,-15);return"intersect"!==n?n:null}function Zd(e){Ec.call(this,e)}function Jd(e){return!e||ln(e)}function ef(e){do{if(vr(e,"bpmn:Process"))return br(e);if(vr(e,"bpmn:Participant"))return br(e).processRef||br(e)}while(e=e.parent)}function tf(e){return vr(e,"bpmn:TextAnnotation")}function nf(e){return vr(e,"bpmn:Group")&&!e.labelTarget}function rf(e){return vr(e,"bpmn:BoundaryEvent")&&lf(e,"bpmn:CompensateEventDefinition")}function of(e){return br(e).isForCompensation}function sf(e){for(var t=e;t=t.parent;){if(vr(t,"bpmn:FlowElementsContainer"))return br(t);if(vr(t,"bpmn:Participant"))return br(t).processRef}return null}function af(e,t){return sf(e)===sf(t)}function lf(e,t){return!!w(br(e).eventDefinitions||[],function(e){return vr(e,t)})}function cf(e,t){return(br(e).eventDefinitions||[]).every(function(e){return vr(e,t)})}function uf(e,t){var n=function(e){for(var t=[];e;)(e=e.parent)&&t.push(e);return t}(t);return-1!==n.indexOf(e)}function pf(e,t,n){if(Jd(e)||Jd(t))return null;if(!vr(n,"bpmn:DataAssociation")){if(kf(e,t))return{type:"bpmn:MessageFlow"};if(Of(e,t))return{type:"bpmn:SequenceFlow"}}var i=Cf(e,t);return i||(Sf(e,t)?{type:"bpmn:Association",associationDirection:"One"}:!!Ef(e,t)&&{type:"bpmn:Association",associationDirection:"None"})}function hf(e,t){return!(!ln(e)&&!nf(e))||!(vr(t,"bpmn:Participant")&&!Nr(t))&&(vr(e,"bpmn:Participant")?vr(t,"bpmn:Process")||vr(t,"bpmn:Collaboration"):yr(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:vr(e,"bpmn:Lane")?vr(t,"bpmn:Participant")||vr(t,"bpmn:Lane"):!(vr(e,"bpmn:BoundaryEvent")&&!function(e){return br(e).cancelActivity&&(mf(e)||gf(e))}(e))&&(vr(e,"bpmn:FlowElement")&&!vr(e,"bpmn:DataStoreReference")?vr(t,"bpmn:FlowElementsContainer")?Nr(t):yr(t,["bpmn:Participant","bpmn:Lane"]):vr(e,"bpmn:DataStoreReference")&&vr(t,"bpmn:Collaboration")?C(br(t).get("participants"),function(e){return!!e.get("processRef")}):yr(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?yr(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!vr(e,"bpmn:MessageFlow")&&(vr(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)))}function df(e){return!ln(e)&&vr(e,"bpmn:BoundaryEvent")}function ff(e){return vr(e,"bpmn:Lane")}function mf(e){var t=br(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function gf(e){return vf(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function vf(e,t){return t.some(function(t){return lf(e,t)})}function yf(e,t,n,i){if(Array.isArray(e)||(e=[e]),1!==e.length)return!1;var r=e[0];return!ln(r)&&(!!function(e){return!!df(e)||!(!vr(e,"bpmn:IntermediateThrowEvent")||!mf(e))||vr(e,"bpmn:IntermediateCatchEvent")&&gf(e)}(r)&&(!Vr(t)&&(!(!vr(t,"bpmn:Activity")||of(t))&&(!(i&&!Kd(i,t))&&(!function(e){return vr(e,"bpmn:ReceiveTask")&&w(e.incoming,function(e){return vr(e.source,"bpmn:EventBasedGateway")})}(t)&&"attach")))))}function bf(e,t,n){if(!t)return!1;var i={replacements:[]};return E(e,function(e){Vr(t)||vr(e,"bpmn:StartEvent")&&"label"!==e.type&&hf(e,t)&&(jr(e)||i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),(function(e){return Fr(e,"bpmn:ErrorEventDefinition")}(e)||function(e){return Fr(e,"bpmn:EscalationEventDefinition")}(e)||function(e){return Fr(e,"bpmn:CompensateEventDefinition")}(e))&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"}),vf(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&vr(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:StartEvent"})),vr(t,"bpmn:Transaction")||lf(e,"bpmn:CancelEventDefinition")&&"label"!==e.type&&(vr(e,"bpmn:EndEvent")&&hf(e,t)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:EndEvent"}),vr(e,"bpmn:BoundaryEvent")&&yf(e,t,0,n)&&i.replacements.push({oldElementId:e.id,newElementType:"bpmn:BoundaryEvent"}))}),!!i.replacements.length&&i}function wf(e,t){return!C(e,ff)&&(void 0===t||null!==t&&e.every(function(e){return hf(e,t)}))}function xf(e,t,n,i){return!!t&&(!(!ln(e)&&!nf(e))||(hf(e,t)||Pf(e,t)))}function _f(e,t,n){return vr(e,"bpmn:SubProcess")?Nr(e)&&(!t||t.width>=100&&t.height>=80):!!vr(e,"bpmn:Lane")||(!!vr(e,"bpmn:Participant")||(tf(e)?!n||("e"===n||"w"===n):!!nf(e)||!!ln(e)&&(!n||("e"===n||"w"===n))))}function Ef(e,t){return!uf(t,e)&&!uf(e,t)&&(!!function(e,t){var n=tf(e),i=tf(t);return(n||i)&&n!==i}(e,t)||!!Cf(e,t))}function Sf(e,t){return af(e,t)&&rf(e)&&vr(t,"bpmn:Activity")&&(n=e,!t.attachers.includes(n))&&!Vr(t);var n}function kf(e,t){return!(Mf(e)&&!Mf(t))&&(vr(n=e,"bpmn:InteractionNode")&&!vr(n,"bpmn:BoundaryEvent")&&(!vr(n,"bpmn:Event")||vr(n,"bpmn:ThrowEvent")&&cf(n,"bpmn:MessageEventDefinition"))&&function(e){return vr(e,"bpmn:InteractionNode")&&!of(e)&&(!vr(e,"bpmn:Event")||vr(e,"bpmn:CatchEvent")&&cf(e,"bpmn:MessageEventDefinition"))&&!(vr(e,"bpmn:BoundaryEvent")&&!lf(e,"bpmn:MessageEventDefinition"))}(t)&&!function(e,t){return ef(e)===ef(t)}(e,t));var n}function Of(e,t){return vr(n=e,"bpmn:FlowNode")&&!vr(n,"bpmn:EndEvent")&&!Vr(n)&&!(vr(n,"bpmn:IntermediateThrowEvent")&&lf(n,"bpmn:LinkEventDefinition"))&&!rf(n)&&!of(n)&&function(e){return vr(e,"bpmn:FlowNode")&&!vr(e,"bpmn:StartEvent")&&!vr(e,"bpmn:BoundaryEvent")&&!Vr(e)&&!(vr(e,"bpmn:IntermediateCatchEvent")&&lf(e,"bpmn:LinkEventDefinition"))&&!of(e)}(t)&&af(e,t)&&!(vr(e,"bpmn:EventBasedGateway")&&!function(e){return vr(e,"bpmn:ReceiveTask")||vr(e,"bpmn:IntermediateCatchEvent")&&(lf(e,"bpmn:MessageEventDefinition")||lf(e,"bpmn:TimerEventDefinition")||lf(e,"bpmn:ConditionalEventDefinition")||lf(e,"bpmn:SignalEventDefinition"))}(t));var n}function Cf(e,t){return yr(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&yr(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!yr(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!yr(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Pf(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(1!==e.length)return!1;e=e[0]}return t.source!==e&&t.target!==e&&(yr(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ln(t)&&vr(e,"bpmn:FlowNode")&&!vr(e,"bpmn:BoundaryEvent")&&hf(e,t.parent))}function Af(e,t){return e&&t&&-1!==e.indexOf(t)}function Tf(e,t){return!!ln(t)||!(vr(t,"bpmn:Lane")&&!Af(e,t.parent))&&!(vr(t,"bpmn:MessageFlow")&&!function(e,t){var n=Rf(t.source),i=Rf(t.target);return Af(e,n)&&Af(e,i)}(e,t))}function Rf(e){for(;e;e=e.parent)if(vr(e,"bpmn:Participant"))return e;return null}function Mf(e){return Dc(e,"bpmn:Process")||Dc(e,"bpmn:Collaboration")}e(Zd,Ec),Zd.$inject=["eventBus"],Zd.prototype.init=function(){this.addRule("connection.start",function(e){return function(e){if(Jd(e))return null;return yr(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}(e.source)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return pf(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection;return pf(e.source,e.target,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){return _f(e.shape,e.newBounds,e.direction)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return!(an(i)&&!Pf(t,i))&&O(t,function(e){return an(e)?pf(e.source,e.target,e):e.host?yf(e,e.host,null,n):xf(e,i)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position,r=e.hints;if(r?.keyboardMove){if(n.some(function(e){return df(e)&&!n.includes(e.host)}))return!1}return yf(n,t,null,i)||bf(n,t,i)||wf(n,t)||Pf(n,t)}),this.addRule("shape.create",function(e){return xf(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return yf(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element;return Tf(e.elements,t)})},Zd.prototype.canConnectMessageFlow=kf,Zd.prototype.canConnectSequenceFlow=Of,Zd.prototype.canConnectDataAssociation=Cf,Zd.prototype.canConnectAssociation=Ef,Zd.prototype.canConnectCompensationAssociation=Sf,Zd.prototype.canMove=wf,Zd.prototype.canAttach=yf,Zd.prototype.canReplace=bf,Zd.prototype.canDrop=hf,Zd.prototype.canInsert=Pf,Zd.prototype.canCreate=xf,Zd.prototype.canConnect=pf,Zd.prototype.canResize=_f,Zd.prototype.canCopy=Tf;var $f={__depends__:[nu],__init__:["bpmnRules"],bpmnRules:["type",Zd]};function Df(e,t){e.on("saveXML.start",2e3,function(){E(t.getRootElements(),function(e){var t,n=wr(e);t=P(_(ut([e]),function(t){return t!==e&&!t.labelTarget}),wr),n.set("planeElement",t)})})}Df.$inject=["eventBus","canvas"];var Bf={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Df]};function Lf(e){Vo.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(e){var n=e.context,i=n.shape||n.connection,r=n.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.parent=o.parent),n.parentIndex=o.index)}),this.preExecute(["shape.move","connection.move"],function(e){var n=e.context,i=n.shape||n.connection,r=n.newParent||i.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.newParent=o.parent),n.newParentIndex=o.index)})}function If(e,t){Lf.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(e){var t=e.order;if(t||(e.order=t=function(e){if(e.labelTarget)return{level:10};var t=w(n,function(t){return yr(e,[t.type])});return t&&t.order||{level:1}}(e)),!t)throw new Error(`no order for <${e.id}>`);return t}this.getOrdering=function(e,n){if(e.labelTarget||vr(e,"bpmn:TextAnnotation"))return{parent:t.findRoot(n)||t.getRootElement(),index:-1};var r=i(e);r.containers&&(n=function(e,t,n){for(var i=t;i&&!yr(i,n);)i=i.parent;if(!i)throw new Error(`no parent for <${e.id}> in <${t&&t.id}>`);return i}(e,n,r.containers));var o=n.children.indexOf(e),s=x(n.children,function(t){return!(!e.labelTarget&&t.labelTarget)&&r.level<i(t).level});return-1!==s&&-1!==o&&o<s&&(s-=1),{index:s,parent:n}}}Lf.prototype.getOrdering=function(e,t){return null},e(Lf,Vo),If.$inject=["eventBus","canvas"],e(If,Lf);var Nf={__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",If]};function zf(){}zf.prototype.get=function(){return this._data},zf.prototype.set=function(e){this._data=e},zf.prototype.clear=function(){var e=this._data;return delete this._data,e},zf.prototype.isEmpty=function(){return!this._data};var jf={clipboard:["type",zf]},Vf="drop-ok",Ff="drop-not-ok",qf="attach-ok",Hf="new-parent",Wf="create";function Qf(e,t,n,i,r){function o(t,n){[qf,Vf,Ff,Hf].forEach(function(i){i===n?e.addMarker(t,i):e.removeMarker(t,i)})}function s(){var e=t.context();e&&e.prefix===Wf&&t.cancel()}n.on(["create.move","create.hover"],function(e){var t=e.context,n=t.elements,i=e.hover,s=t.source,a=t.hints||{};if(!i)return t.canExecute=!1,void(t.target=null);Xf(e);var l={x:e.x,y:e.y},c=t.canExecute=i&&function(e,t,n,i,o){if(!t)return!1;var s=w(e=_(e,function(t){var n=t.labelTarget;return!(t.parent||ln(t)&&-1!==e.indexOf(n))}),function(e){return!an(e)}),a=!1,l=!1,c=!1;Gf(e)&&(a=r.allowed("shape.attach",{position:n,shape:s,target:t})),a||(c=Gf(e)?r.allowed("shape.create",{position:n,shape:s,source:i,target:t}):r.allowed("elements.create",{elements:e,position:n,target:t}));var u=o.connectionTarget;return c||a?(s&&i&&(l=r.allowed("connection.create",{source:u===i?s:i,target:u===i?i:s,hints:{targetParent:t,targetAttach:a}})),{attach:a,connect:l}):(null===c||null===a)&&null}(n,i,l,s,a);i&&null!==c&&(t.target=i,c&&c.attach?o(i,qf):o(i,c?Hf:Ff))}),n.on(["create.end","create.out","create.cleanup"],function(e){var t=e.hover;t&&o(t,null)}),n.on("create.end",function(e){var t=e.context,n=t.source,r=t.shape,o=t.elements,s=t.target,a=t.canExecute,l=a&&a.attach,c=a&&a.connect,u=t.hints||{};if(!1===a||!s)return!1;Xf(e);var p={x:e.x,y:e.y};r=c?i.appendShape(n,r,p,s,{attach:l,connection:!0===c?{}:c,connectionTarget:u.connectionTarget}):w(o=i.createElements(o,p,s,q({},u,{attach:l})),function(e){return!an(e)}),q(t,{elements:o,shape:r}),q(e,{elements:o,shape:r})}),n.on("create.init",function(){n.on("elements.changed",s),n.once(["create.cancel","create.end"],2e3,function(){n.off("elements.changed",s)})}),this.start=function(e,n,i){d(n)||(n=[n]);var r=w(n,function(e){return!an(e)});if(r){i=q({elements:n,hints:{},shape:r},i||{}),E(n,function(e){m(e.x)||(e.x=0),m(e.y)||(e.y=0)});var o=ht(_(n,function(e){return!e.hidden}));E(n,function(e){an(e)&&(e.waypoints=P(e.waypoints,function(e){return{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2}})),q(e,{x:e.x-o.x-o.width/2,y:e.y-o.y-o.height/2})}),t.init(e,Wf,{cursor:"grabbing",autoActivate:!0,data:{shape:r,elements:n,context:i}})}}}function Xf(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom&&(e.y=Math.min(e.y,t.bottom)))}function Gf(e){return e&&1===e.length&&!an(e[0])}Qf.$inject=["canvas","dragging","eventBus","modeling","rules"];function Uf(e,t,n,i,r){t.on("create.move",750,function(t){var o=t.hover,s=t.context,a=s.elements,l=s.dragGroup;l||(l=s.dragGroup=function(e){var t=Pe("g");be(t,r.cls("djs-drag-group",["no-events"]));var o=Pe("g");return e.forEach(function(e){var r;e.hidden||(e.waypoints?(r=n._createContainer("connection",o),n.drawConnection(Hn(r),e)):(r=n._createContainer("shape",o),n.drawShape(Hn(r),e),Qn(r,e.x,e.y)),i.addDragger(e,t,r))}),t}(a)),o?(l.parentNode||ge(e.getActiveLayer(),l),Qn(l,t.x,t.y)):ze(l)}),t.on("create.cleanup",function(e){var t=e.context.dragGroup;t&&ze(t)})}Uf.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var Yf={__depends__:[Kc,up,nu,As],__init__:["create","createPreview"],create:["type",Qf],createPreview:["type",Uf]};function Kf(e){var t=this;function n(e){t._lastMoveEvent=e}this._lastMoveEvent=null,e.on("canvas.init",function(e){(t._svg=e.svg).addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}Kf.$inject=["eventBus"],Kf.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,s=t;n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,s,!1,!1,!1,!1,0,null);return n}(0,0)};var Zf={__init__:["mouse"],mouse:["type",Kf]};function Jf(e,t,n,i,r,o,s,a){this._canvas=e,this._create=t,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=s,this._rules=a,r.on("copyPaste.copyElement",function(e){var t=e.descriptor,n=e.element,i=e.elementsSet;t.priority=1,t.id=n.id,i.has(n.parent)&&(t.parent=n.parent.id),function(e){return!!e.host}(n)&&(t.priority=2,t.host=n.host.id),an(n)&&(t.priority=3,t.source=n.source.id,t.target=n.target.id,t.waypoints=function(e){return P(e.waypoints,function(e){return(e=em(e)).original&&(e.original=em(e.original)),e})}(n)),ln(n)&&(t.priority=4,t.labelTarget=n.labelTarget.id),E(["x","y","width","height"],function(e){m(n[e])&&(t[e]=n[e])}),t.hidden=n.hidden,t.collapsed=n.collapsed}),r.on("copyPaste.elementsCopied",2e3,function(e){!1!==e.hints?.clip&&n.set(e.tree)}),r.on("copyPaste.pasteElements",2e3,function(e){e.tree||(e.tree=n.get())}),r.on("copyPaste.pasteElements",function(e){q(e.hints,{createElementsBehavior:!1})})}function em(e){return q({},e)}function tm(e,t){var n=t.indexOf(e);return-1===n?t:t.splice(n,1)}Jf.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],Jf.prototype.copy=function(e,t={}){var n,i;return d(e)||(e=e?[e]:[]),i=!1===(n=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))?{}:this.createTree(d(n)?n:e),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:i,hints:t}),i},Jf.prototype.paste=function(e={}){var t=this._eventBus.createEvent({type:"copyPaste.pasteElements",hints:{},...e});if(!1!==this._eventBus.fire(t)){var n=t.tree;if(n){var i=t.hints,r=this._createElements(n);if(t.element&&t.point)return this._paste(r,t.element,t.point,i);this._create.start(this._mouse.getLastMoveEvent(),r,{hints:i})}}},Jf.prototype.duplicate=function(e,t={}){var n=this.copy(e,{clip:!1});return this.paste({...t,tree:n})},Jf.prototype.cut=function(e){var t=this.copy(e),n=this._getElementIdsFromTree(t),i=e.filter(function(e){return n[e.id]});return i.length>0&&this._modeling.removeElements(i),t},Jf.prototype._getElementIdsFromTree=function(e){var t={};return E(e,function(e){E(e,function(e){e.id&&(t[e.id]=!0)})}),t},Jf.prototype._paste=function(e,t,n,i){E(e,function(e){m(e.x)||(e.x=0),m(e.y)||(e.y=0)});var r=ht(e);return E(e,function(e){an(e)&&(e.waypoints=P(e.waypoints,function(e){return{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2}})),q(e,{x:e.x-r.x-r.width/2,y:e.y-r.y-r.height/2})}),this._modeling.createElements(e,n,t,q({},i))},Jf.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return E(e,function(e,o){E(e=B(e,"priority"),function(e){var o,s=q({},X(e,["priority"]));return i[e.parent]?s.parent=i[e.parent]:delete s.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:s}),an(s)?(s.source=i[e.source],s.target=i[e.target],o=i[e.id]=t.createConnection(s),void r.push(o)):ln(s)?(s.labelTarget=i[s.labelTarget],o=i[e.id]=t.createLabel(s),void r.push(o)):(s.host&&(s.host=i[s.host]),o=i[e.id]=t.createShape(s),void r.push(o))})}),r},Jf.prototype.createConnection=function(e){return this._elementFactory.createConnection(X(e,["id"]))},Jf.prototype.createLabel=function(e){return this._elementFactory.createLabel(X(e,["id"]))},Jf.prototype.createShape=function(e){return this._elementFactory.createShape(X(e,["id"]))},Jf.prototype.hasRelations=function(e,t,n){return n||(n=new Set(t)),!!(!an(e)||n.has(e.source)&&n.has(e.target))&&!(ln(e)&&!n.has(e.labelTarget))},Jf.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[],o=new Map;function s(e,t){var n=o.get(e);if(!n){var i={element:e,depth:t};return r.push(i),void o.set(e,i)}if(n.depth<t){r=function(e,t){var n=t.indexOf(e);-1!==n&&t.splice(n,1);return t}(n,r);var s={element:n.element,depth:t};r.push(s),o.set(e,s)}}lt(at(e),function(e,t,i){if(!ln(e)){E(e.labels,function(e){s(e,i)}),E([e.attachers,e.incoming,e.outgoing],function(e){e&&e.length&&E(e,function(e){E(e.labels,function(e){s(e,i)}),s(e,i)})}),s(e,i);var r=[];return e.children&&(r=e.children.slice()),n._eventBus.fire("copyPaste.createTree",{element:e,children:r}),r}}),e=P(r,function(e){return e.element});var a=new Set(e);return r=P(r,function(t){return t.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:t.descriptor,element:t.element,elements:e,elementsSet:a}),t}),r=B(r,function(e){return e.descriptor.priority}),e=P(r,function(e){return e.element}),E(r,function(r){var o=r.depth;return n.hasRelations(r.element,e,a)&&function(e,n){return t.allowed("element.copy",{element:e,elements:n})}(r.element,e)?(i[o]||(i[o]=[]),void i[o].push(r.descriptor)):(tm(r.element,e),void a.delete(r.element))}),i};var nm={__depends__:[jf,Yf,Zf,nu],__init__:["copyPaste"],copyPaste:["type",Jf]};function im(e,t,n){d(n)||(n=[n]),E(n,function(n){u(e[n])||(t[n]=e[n])})}function rm(e,t,n){function i(t,i){var r=e.create(t.$type);return n.copyElement(t,r,null,i)}t.on("copyPaste.copyElement",750,function(e){var t=e.descriptor,n=e.element,r=br(n);if(ln(n))return t;var o=t.businessObject=i(r,!0),s=t.di=i(wr(n),!0);s.bpmnElement=o,im(o,t,"name"),im(s,t,"isExpanded"),r.default&&(t.default=r.default.id)});var r="-bpmn-js-refs";t.on("copyPaste.pasteElement",function(e){var t=e.cache,n=e.descriptor,r=n.businessObject,o=n.di;if(ln(n))return n.businessObject=br(t[n.labelTarget]),void(n.di=wr(t[n.labelTarget]));r=n.businessObject=i(r),(o=n.di=i(o)).bpmnElement=r,im(n,r,["isExpanded","name"]),n.type=r.$type}),t.on("copyPaste.copyElement",750,function(e){var t=e.descriptor,n=e.element;if(vr(n,"bpmn:Participant")){var r=br(n);r.processRef&&(t.processRef=i(r.processRef,!0))}}),t.on("copyPaste.pasteElement",function(e){var t=e.descriptor,n=t.processRef;n&&(t.processRef=i(n))}),t.on("copyPaste.createTree",function(e){var t=e.element,n=e.children;vr(t,"bpmn:SubProcess")&&E(Kr(n),e=>{n.push(e.annotation)})}),t.on("copyPaste.pasteElement",750,function(e){var t=e.cache;!function(e,t){e[r]=t}(t,function(e,t,n){var i=br(e);return e.default&&(n[e.default]={element:i,property:"default"}),e.host&&(br(e).attachedToRef=br(t[e.host])),X(n,k(n,function(t,n,r){var o=n.element,s=n.property;return r===e.id&&(o.set(s,i),t.push(e.id)),t},[]))}(e.descriptor,t,function(e){return e[r]=e[r]||{}}(t)))})}rm.$inject=["bpmnFactory","eventBus","moddleCopy"];const om=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing","categoryValue"],sm=["errorRef","escalationRef","messageRef","signalRef","dataObjectRef"];function am(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",e=>{const{propertyNames:t}=e;if(t&&t.length)return B(t,e=>"extensionElements"===e)}),e.on("moddleCopy.canCopyProperty",e=>{const{parent:t,property:n,propertyName:i}=e,r=f(t)&&t.$descriptor;return i&&sm.includes(i)?n:(!i||!om.includes(i))&&(!(i&&r&&!w(r.properties,L({name:i})))&&void 0)}),e.on("moddleCopy.canSetCopiedProperty",e=>{const{property:t}=e;if(vr(t,"bpmn:ExtensionElements")&&(!t.values||!t.values.length))return!1})}function lm(e,t){return k(e.properties,(e,n)=>t&&n.default?e:e.concat(n.name),[])}am.$inject=["eventBus","bpmnFactory","moddle"],am.prototype.copyElement=function(e,t,n,i=!1){n&&!d(n)&&(n=[n]),n=n||lm(e.$descriptor);const r=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t,clone:i});return!1===r||(d(r)&&(n=r),E(n,n=>{let r;b(e,n)&&(r=e.get(n));const o=this.copyProperty(r,t,n,i);if(!p(o))return;!1!==this._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:o,propertyName:n})&&t.set(n,o)})),t},am.prototype.copyProperty=function(e,t,n,i=!1){let r=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n,clone:i});if(!1===r)return;if(r)return f(r)&&r.$type&&!r.$parent&&(r.$parent=t),r;const o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference){if(o.isId)return e&&this._copyId(e,t,i);if(d(e))return k(e,(e,r)=>{const o=this.copyProperty(r,t,n,i);return o?e.concat(o):e},[]);if(f(e)&&e.$type){if(this._moddle.getElementDescriptor(e).isGeneric)return;return r=this._bpmnFactory.create(e.$type),r.$parent=t,r=this.copyElement(e,r,null,i),r}return e}},am.prototype._copyId=function(e,t,n=!1){return n?e:this._moddle.ids.assigned(e)?void 0:(this._moddle.ids.claim(e,t),e)};var cm={__depends__:[nm],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",rm],moddleCopy:["type",am]},um=Math.round;function pm(e,t){this._modeling=e,this._eventBus=t}function hm(e,t){t.on("replace.end",500,function(t){const{newElement:n,hints:i={}}=t;!1!==i.select&&e.select(n)})}pm.$inject=["modeling","eventBus"],pm.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,s=t.height||e.height,a=t.x||e.x,l=t.y||e.y,c=um(a+o/2),u=um(l+s/2),p=i.replaceShape(e,q({},t,{x:c,y:u,width:o,height:s}),n);return r.fire("replace.end",{element:e,newElement:p,hints:n}),p},hm.$inject=["selection","eventBus"];var dm={__init__:["replace","replaceSelectionBehavior"],replaceSelectionBehavior:["type",hm],replace:["type",pm]};var fm=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function mm(e,t,n,i,r,o){this.replaceElement=function(s,a,l){l=l||{};var c=a.type,p=s.businessObject;if(gm(p)&&("bpmn:SubProcess"===c||"bpmn:AdHocSubProcess"===c)&&function(e,t){var n=e&&b(e,"collapsed")?e.collapsed:!Nr(e);return n!==(t&&(b(t,"collapsed")||b(t,"isExpanded"))?b(t,"collapsed")?t.collapsed:!t.isExpanded:n)}(s,a))return i.toggleCollapse(s),s;var h=e.create(c),f={type:c,businessObject:h,di:{}};"bpmn:ExclusiveGateway"===c&&(f.di.isMarkerVisible=!0),function(e,t,n){d(n)||(n=[n]),E(n,function(n){u(e[n])||(t[n]=e[n])})}(s.di,f.di,["fill","stroke","background-color","border-color","color"]);var m=function(e,t){return e.filter(function(e){return t.includes(e)})}(lm(p.$descriptor),lm(h.$descriptor,!0));q(h,Q(a,fm));var g=_(m,function(e){return"eventDefinitions"===e?vm(s,a.eventDefinitionType):"loopCharacteristics"===e?!Vr(h):!b(h,e)&&(("processRef"!==e||!1!==a.isExpanded)&&("triggeredByEvent"!==e&&("isForCompensation"!==e||!Vr(h))))});if(h=n.copyElement(p,h,g),a.eventDefinitionType&&(vm(h,a.eventDefinitionType)||(f.eventDefinitionType=a.eventDefinitionType,f.eventDefinitionAttrs=a.eventDefinitionAttrs)),vr(p,"bpmn:Activity")){if(gm(p))f.isExpanded=Nr(s);else if(a&&b(a,"isExpanded")){f.isExpanded=a.isExpanded;var v=t.getDefaultSize(h,{isExpanded:f.isExpanded});f.width=v.width,f.height=v.height,f.x=s.x-(f.width-s.width)/2,f.y=s.y-(f.height-s.height)/2}Nr(s)&&!vr(p,"bpmn:Task")&&f.isExpanded&&(f.width=s.width,f.height=s.height)}if(gm(p)&&!gm(h)&&(l.moveChildren=!1),vr(p,"bpmn:Participant")){!0===a.isExpanded?h.processRef=e.create("bpmn:Process"):l.moveChildren=!1;var y=zr(s);wr(s).isHorizontal||(wr(f).isHorizontal=y),f.width=y?s.width:t.getDefaultSize(f).width,f.height=y?t.getDefaultSize(f).height:s.height}return o.allowed("shape.resize",{shape:h})||(f.height=t.getDefaultSize(f).height,f.width=t.getDefaultSize(f).width),h.name=p.name,yr(p,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&yr(h,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(h.default=p.default),a.host&&!vr(p,"bpmn:BoundaryEvent")&&vr(h,"bpmn:BoundaryEvent")&&(f.host=a.host),"bpmn:DataStoreReference"!==f.type&&"bpmn:DataObjectReference"!==f.type||(f.x=s.x+(s.width-f.width)/2),r.replaceElement(s,f,{...l,targetElement:a})}}function gm(e){return vr(e,"bpmn:SubProcess")}function vm(e,t){var n=br(e);return t&&n.get("eventDefinitions").some(function(e){return vr(e,t)})}mm.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules"];var ym={__depends__:[cm,dm,As],bpmnReplace:["type",mm]};function bm(e){this._eventBus=e,this._tools=[],this._active=null}bm.$inject=["eventBus"],bm.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)},bm.prototype.isActive=function(e){return e&&this._active===e},bm.prototype.length=function(e){return this._tools.length},bm.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},bm.prototype.bindEvents=function(e,t){var n=this._eventBus,i=[];n.on(t.tool+".init",function(t){t.context.reactivate||!this.isActive(e)?this.setActive(e):this.setActive(null)},this),E(t,function(e){i.push(e+".ended"),i.push(e+".canceled")}),n.on(i,250,function(e){this._active&&(function(e){var t=e.originalEvent&&e.originalEvent.target;return t&&re(t,'.group[data-group="tools"]')}(e)||this.setActive(null))},this)};var wm={__depends__:[Kc],__init__:["toolManager"],toolManager:["type",bm]};var xm=Math.abs,_m=Math.round,Em={x:"width",y:"height"},Sm="crosshair",km={n:"top",w:"left",s:"bottom",e:"right"},Om={n:"s",w:"e",s:"n",e:"w"};function Cm(e,t,n,i,r,o,s){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=s;var a=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(e){n.once("spaceTool.selection.ended",function(){a.activateMakeSpace(e.originalEvent)})}),n.on("spaceTool.move",1500,function(e){var t=e.context,n=t.initialized;n||(n=t.initialized=a.init(e,t)),n&&Am(e)}),n.on("spaceTool.end",function(e){var t=e.context,i=t.axis,r=t.direction,o=t.movingShapes,s=t.resizingShapes,l=t.start;if(t.initialized){Am(e);var c={x:0,y:0};c[i]=_m(e["d"+i]),a.makeSpace(o,s,c,r,l),n.once("spaceTool.ended",function(e){a.activateSelection(e.originalEvent,!0,!0)})}})}function Pm(e){return{top:e.top-20,right:e.right+20,bottom:e.bottom+20,left:e.left-20}}function Am(e){var t,n,i=e.context.spaceToolConstraints;i&&(m(i.left)&&(t=Math.max(e.x,i.left),e.dx=e.dx+t-e.x,e.x=t),m(i.right)&&(t=Math.min(e.x,i.right),e.dx=e.dx+t-e.x,e.x=t),m(i.top)&&(n=Math.max(e.y,i.top),e.dy=e.dy+n-e.y,e.y=n),m(i.bottom)&&(n=Math.min(e.y,i.bottom),e.dy=e.dy+n-e.y,e.y=n))}Cm.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Cm.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:Sm,data:{context:{reactivate:n}},trapClick:!1})},Cm.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:Sm,data:{context:{}}})},Cm.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},Cm.prototype.init=function(e,t){var n=xm(e.dx)>xm(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(xm(i)<5)return!1;i<0&&(i*=-1),vs(e)&&(i*=-1);var o=function(e,t){if("x"===e){if(t>0)return"e";if(t<0)return"w"}if("y"===e){if(t>0)return"s";if(t<0)return"n"}return null}(n,i),s=this._canvas.getRootElement();!ys(e)&&e.hover&&(s=e.hover);var a=[...ut(s),...s.attachers||[]],l=this.calculateAdjustments(a,n,i,r),c=function(e,t,n,i,r){var o=e.movingShapes,s=e.resizingShapes;if(!s.length)return;var a,l,c={},u=new Set(o),p=new Set(s);return E(s,function(e){var o,s,h,d,f,g,v=e.attachers,y=e.children,b=pn(e),w=_(y,function(e){return!(an(e)||ln(e)||u.has(e)||p.has(e))}),x=_(y,function(e){return!an(e)&&!ln(e)&&u.has(e)}),E=[],S=[];w.length&&(s=Pm(pn(ht(w))),o=i-b[km[n]]+s[km[n]],"n"===n?c.bottom=l=m(l)?Math.min(l,o):o:"w"===n?c.right=l=m(l)?Math.min(l,o):o:"s"===n?c.top=a=m(a)?Math.max(a,o):o:"e"===n&&(c.left=a=m(a)?Math.max(a,o):o)),x.length&&(h=Pm(pn(ht(x))),o=i-h[km[Om[n]]]+b[km[Om[n]]],"n"===n?c.bottom=l=m(l)?Math.min(l,o):o:"w"===n?c.right=l=m(l)?Math.min(l,o):o:"s"===n?c.top=a=m(a)?Math.max(a,o):o:"e"===n&&(c.left=a=m(a)?Math.max(a,o):o)),v&&v.length&&(v.forEach(function(e){u.has(e)?E.push(e):S.push(e)}),E.length&&(d=pn(ht(E.map(fn))),f=b[km[Om[n]]]-(d[km[Om[n]]]-i)),S.length&&(g=pn(ht(S.map(fn)))[km[n]]-(b[km[n]]-i)),"n"===n?(o=Math.min(f||1/0,g||1/0),c.bottom=l=m(l)?Math.min(l,o):o):"w"===n?(o=Math.min(f||1/0,g||1/0),c.right=l=m(l)?Math.min(l,o):o):"s"===n?(o=Math.max(f||-1/0,g||-1/0),c.top=a=m(a)?Math.max(a,o):o):"e"===n&&(o=Math.max(f||-1/0,g||-1/0),c.left=a=m(a)?Math.max(a,o):o));var k=r&&r[e.id];k&&("n"===n?(o=i+e[Em[t]]-k[Em[t]],c.bottom=l=m(l)?Math.min(l,o):o):"w"===n?(o=i+e[Em[t]]-k[Em[t]],c.right=l=m(l)?Math.min(l,o):o):"s"===n?(o=i-e[Em[t]]+k[Em[t]],c.top=a=m(a)?Math.max(a,o):o):"e"===n&&(o=i-e[Em[t]]+k[Em[t]],c.left=a=m(a)?Math.max(a,o):o))}),c}(l,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:l.resizingShapes,start:r}));return q(t,l,{axis:n,direction:o,spaceToolConstraints:c,start:r}),ta("resize-"+("x"===n?"ew":"ns")),!0},Cm.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],s=[],a=new Set,l=new Set,c=[],u=[];function p(e){a.has(e)||(a.add(e),o.push(e));var t=e.label;t&&!a.has(t)&&(a.add(t),o.push(t))}return E(e,function(e){if(e.parent&&!ln(e))if(an(e))u.push(e);else{var o=e[t],a=o+e[Em[t]];if(function(e){return!!e.host}(e)&&(n>0&&fn(e)[t]>i||n<0&&fn(e)[t]<i))c.push(e);else{var h;if(!(n>0&&o>i||n<0&&a<i))return o<i&&a>i&&r.allowed("shape.resize",{shape:e})?(h=e,void(l.has(h)||(l.add(h),s.push(h)))):void 0;p(e)}}}),E(o,function(e){var t=e.attachers;t&&E(t,function(e){p(e)})}),E(c,function(e){var t=e.host;(a.has(t)||l.has(t))&&p(e)}),E(u,function(e){var t=e.source,n=e.target,i=e.label;(a.has(t)||l.has(t))&&(a.has(n)||l.has(n))&&i&&p(i)}),{movingShapes:o,resizingShapes:s}},Cm.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Cm.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^spaceTool/.test(e.prefix)};var Tm="djs-dragging",Rm="djs-resizing",Mm=Math.max;function $m(e,t,n,i,r){function o(e,t){E(e,function(e){r.addDragger(e,t),n.addMarker(e,Tm)})}e.on("spaceTool.selection.start",function(e){var t=n.getLayer("space"),r=e.context,o="M 0,-10000 L 0,10000",s="M -10000,0 L 10000,0",a=Pe("g");be(a,i.cls("djs-crosshair-group",["no-events"])),ge(t,a);var l=Pe("path");be(l,"d",o),xe(l).add("djs-crosshair"),ge(a,l);var c=Pe("path");be(c,"d",s),xe(c).add("djs-crosshair"),ge(a,c),r.crosshairGroup=a}),e.on("spaceTool.selection.move",function(e){Qn(e.context.crosshairGroup,e.x,e.y)}),e.on("spaceTool.selection.cleanup",function(e){var t=e.context.crosshairGroup;t&&ze(t)}),e.on("spaceTool.move",250,function(e){var t=e.context,s=t.line,a=t.axis,l=t.movingShapes,c=t.resizingShapes;if(t.initialized){if(!t.dragGroup){var u=n.getLayer("space");be(s=Pe("path"),"d","M0,0 L0,0"),xe(s).add("djs-crosshair"),ge(u,s),t.line=s;var p=Pe("g");be(p,i.cls("djs-drag-group",["no-events"])),ge(n.getActiveLayer(),p),o(l,p);var h=new Set(l);E(c,function(e){h.add(e)});var d=new Set,f=t.movingConnections=[];h.forEach(function(e){E(e.outgoing,function(e){!d.has(e)&&an(e)&&h.has(e.target)&&(d.add(e),f.push(e))})}),o(f,p),t.dragGroup=p}if(!t.frameGroup){var m=Pe("g");be(m,i.cls("djs-frame-group",["no-events"])),ge(n.getActiveLayer(),m);var g=[];E(c,function(e){var t=r.addFrame(e,m),i=t.getBBox();g.push({element:t,initialBounds:i}),n.addMarker(e,Rm)}),t.frameGroup=m,t.frames=g}be(s,{d:{x:"M"+e.x+", -10000 L"+e.x+", 10000",y:"M -10000, "+e.y+" L 10000, "+e.y}[a]});var v={x:e.dx,y:e.dy};v[{x:"y",y:"x"}[t.axis]]=0,Qn(t.dragGroup,v.x,v.y),E(t.frames,function(e){var n,i,r=e.element,o=e.initialBounds;"e"===t.direction?be(r,{width:Mm(o.width+v.x,5)}):be(r,{width:n=Mm(o.width-v.x,5),x:o.x+o.width-n}),"s"===t.direction?be(r,{height:Mm(o.height+v.y,5)}):be(r,{height:i=Mm(o.height-v.y,5),y:o.y+o.height-i})})}}),e.on("spaceTool.cleanup",function(e){var t=e.context,i=t.movingShapes,r=t.movingConnections,o=t.resizingShapes,s=t.line,a=t.dragGroup,l=t.frameGroup;E(i,function(e){n.removeMarker(e,Tm)}),E(r,function(e){n.removeMarker(e,Tm)}),a&&(ze(s),ze(a)),E(o,function(e){n.removeMarker(e,Rm)}),l&&ze(l)})}$m.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var Dm={__init__:["spaceToolPreview"],__depends__:[Kc,nu,wm,up,Zf],spaceTool:["type",Cm],spaceToolPreview:["type",$m]};function Bm(e,t){e.invoke(Cm,this),this._canvas=t}Bm.$inject=["injector","canvas"],e(Bm,Cm),Bm.prototype.calculateAdjustments=function(e,t,n,i){var r=this._canvas.getRootElement(),o=e[0]===r?null:e[0],s=[];o&&(s=R(dt(r.children.filter(e=>vr(e,"bpmn:Artifact")),ht(o))));const a=[...e,...s];var l=Cm.prototype.calculateAdjustments.call(this,a,t,n,i);return l.resizingShapes=l.resizingShapes.filter(function(e){return!vr(e,"bpmn:TextAnnotation")&&(!function(e){return vr(e,"bpmn:Participant")&&!br(e).processRef}(e)||!("y"===t&&zr(e)||"x"===t&&!zr(e)))}),l};var Lm={__depends__:[Dm],spaceTool:["type",Bm]};function Im(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)}Im.$inject=["eventBus","injector"],Im.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()},Im.prototype.canExecute=function(e,t){const n={command:e,context:t},i=this._getHandler(e);let r=this._fire(e,"canExecute",n);if(void 0===r){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Im.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,!1!==e&&this._fire("changed",{trigger:"clear"})},Im.prototype.undo=function(){let e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),e=this._getUndoAction(),e&&e.id===t.id);)t=e;this._popAction()}},Im.prototype.redo=function(){let e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),e=this._getRedoAction(),e&&e.id===t.id);)t=e;this._popAction()}},Im.prototype.register=function(e,t){this._setHandler(e,t)},Im.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)},Im.prototype.canUndo=function(){return!!this._getUndoAction()},Im.prototype.canRedo=function(){return!!this._getRedoAction()},Im.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Im.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Im.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)})},Im.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 e of i)if(r=this._eventBus.fire("commandStack."+e,n),n.cancelBubble)break;return r},Im.prototype._createId=function(){return this._uid++},Im.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Im.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()},Im.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)},Im.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:$("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Im.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=d(e)?e:[e],t.dirty=t.dirty.concat(e))},Im.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Im.prototype._revertedAction=function(e){this._stackIdx--},Im.prototype._getHandler=function(e){return this._handlerMap[e]},Im.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};var Nm={commandStack:["type",Im]};function zm(e,t){if("function"!=typeof t)throw new Error("removeFn iterator must be a function");if(!e)return[];for(var n;n=e[0];)t(n);return e}function jm(e,t,n){Vo.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=Vm(n),t.validatedShapes=Vm(i)}),i&&t.on("shape.move.start",250,function(e){var t=e.context,n=new Set(t.shapes),r=new Set;for(const e of n)for(const t of e.labels)t.hidden||n.has(t)||r.add(t),e.labelTarget&&r.add(e);for(const e of r)i.makeDraggable(t,e,!0)}),this.preExecuted("elements.move",1400,function(e){var t=e.context.closure,n=t.enclosedElements,i=[];E(n,function(e){E(e.labels,function(e){n[e.id]||i.push(e)})}),t.addAll(i)}),this.preExecute(["connection.delete","shape.delete"],function(e){var t=e.context;zm((t.connection||t.shape).labels,function(e){n.removeShape(e,{nested:!0})})}),this.execute("shape.delete",function(e){var t=e.context,n=t.shape,i=n.labelTarget;i&&(t.labelTargetIndex=xt(i.labels,n),t.labelTarget=i,n.labelTarget=null)}),this.revert("shape.delete",function(e){var t=e.context,n=t.shape,i=t.labelTarget,r=t.labelTargetIndex;i&&(wt(i.labels,n,r),n.labelTarget=i)})}function Vm(e){var t=new Set(e);return _(e,function(e){return!t.has(e.labelTarget)})}e(jm,Vo),jm.$inject=["injector","eventBus","modeling"];var Fm={__init__:["labelSupport"],labelSupport:["type",jm]},qm="attach-ok";function Hm(e,t,n,i,r){Vo.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",1401,function(e){var t,n,i=e.context,r=i.shapes,o=i.validatedShapes;i.shapes=(n=Wm(t=r),D("id",t,n)),i.validatedShapes=function(e){var t=M(e,"id");return _(e,function(e){for(;e;){if(e.host&&t[e.host.id])return!1;e=e.parent}return!0})}(o)}),o&&t.on("shape.move.start",251,function(e){var t=e.context;E(Wm(t.shapes),function(e){o.makeDraggable(t,e,!0),E(e.labels,function(e){o.makeDraggable(t,e,!0)})})}),o&&t.on("shape.move.start",function(e){var i=e.context.shapes;if(1===i.length){var r=i[0].host;r&&(n.addMarker(r,qm),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(r,qm)}))}}),this.preExecuted("elements.move",1401,function(e){var t=e.context,n=t.closure;E(Wm(t.shapes),function(e){n.add(e,n.topLevel[e.host.id])})}),this.postExecuted("elements.move",function(e){var t=e.context,n=t.shapes,i=t.newHost;i&&1!==n.length||E(i?n:_(n,function(e){var t,i=e.host;return function(e){return!!e.host}(e)&&(t=i,!(-1!==n.indexOf(t)))}),function(e){r.updateAttachment(e,i)})}),this.postExecuted("elements.move",function(e){E(e.context.shapes,function(e){E(e.attachers,function(e){E(e.outgoing.slice(),function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)}),E(e.incoming.slice(),function(e){i.allowed("connection.reconnect",{connection:e,source:e.source,target:e.target})||r.removeConnection(e)})})})}),this.postExecute("shape.create",function(e){var t=e.context,n=t.shape,i=t.host;i&&r.updateAttachment(n,i)}),this.postExecute("shape.replace",function(e){var t=e.context,n=t.oldShape,o=t.newShape;zm(n.attachers,function(e){"attach"===i.allowed("elements.move",{target:o,shapes:[e]})?r.updateAttachment(e,o):r.removeShape(e)}),o.attachers.length&&E(o.attachers,function(e){var t=$h(e,n,o);r.moveShape(e,t,e.parent)})}),this.postExecute("shape.resize",function(e){var t=e.context,n=t.shape,i=t.oldBounds,o=t.newBounds,s=n.attachers;!1!==(t.hints||{}).attachSupport&&E(s,function(e){var t=$h(e,i,o);r.moveShape(e,t,e.parent),E(e.labels,function(e){r.moveShape(e,t,e.parent)})})}),this.preExecute("shape.delete",function(e){var t=e.context.shape;zm(t.attachers,function(e){r.removeShape(e)}),t.host&&r.updateAttachment(t,null)})}function Wm(e){return a(P(e,function(e){return e.attachers||[]}))}e(Hm,Vo),Hm.$inject=["injector","eventBus","canvas","rules","modeling"];var Qm={__depends__:[nu],__init__:["attachSupport"],attachSupport:["type",Hm]};function Xm(e){this._model=e}function Gm(e,t,n){Vo.call(this,e),this._bpmnFactory=t;var i=this;function r(e){E(e.context.oldRoot.children,function(e){vr(e,"bpmn:BaseElement")&&i.updateParent(e)})}function o(e){var t=e.context.shape;vr(t,"bpmn:BaseElement")&&i.updateBounds(t)}function s(e){i.updateConnection(e.context)}function a(e){i.updateConnectionWaypoints(e.context.connection)}function l(e){i.updateAttachment(e.context)}function c(e){const{element:n}=e.context,i=Ur(n),r=wr(n),o=r&&r.get("label");Hr(n)||Zo(n)||(i&&!o?r.set("label",t.create("bpmndi:BPMNLabel")):!i&&o&&r.set("label",void 0))}this.executed(["connection.layout","connection.create"],function(e){var t,i=e.context,r=i.hints||{};i.cropped||!1===r.createElementsBehavior||((t=i.connection).waypoints=n.getCroppedWaypoints(t),i.cropped=!0)}),this.reverted(["connection.layout"],function(e){delete e.context.cropped}),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Um(function(e){var t=e.context;i.updateParent(t.shape||t.connection,t.oldParent)})),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],Um(function(e){var t=e.context,n=t.shape||t.connection,r=t.parent||t.newParent;i.updateParent(n,r)})),this.executed(["canvas.updateRoot"],r),this.reverted(["canvas.updateRoot"],r),this.executed(["shape.move","shape.create","shape.resize"],Um(function(e){"label"!==e.context.shape.type&&o(e)})),this.reverted(["shape.move","shape.create","shape.resize"],Um(function(e){"label"!==e.context.shape.type&&o(e)})),e.on("shape.changed",function(e){"label"===e.element.type&&o({context:{shape:e.element}})}),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],Um(s)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],Um(s)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],Um(a)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],Um(a)),this.executed("connection.reconnect",Um(function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=br(n),s=br(i),a=br(r);o.conditionExpression&&!yr(a,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(t.oldConditionExpression=o.conditionExpression,delete o.conditionExpression),i!==r&&s.default===o&&(t.oldDefault=s.default,delete s.default)})),this.reverted("connection.reconnect",Um(function(e){var t=e.context,n=t.connection,i=t.oldSource,r=t.newSource,o=br(n),s=br(i),a=br(r);t.oldConditionExpression&&(o.conditionExpression=t.oldConditionExpression),t.oldDefault&&(s.default=t.oldDefault,delete a.default)})),this.executed(["element.updateAttachment"],Um(l)),this.reverted(["element.updateAttachment"],Um(l)),this.executed("element.updateLabel",Um(c)),this.reverted("element.updateLabel",Um(c)),this.executed("shape.delete",Um(function(e){const t=e.context,n=t.labelTarget,i=n&&wr(n),r=i&&i.get("label");r&&(t.oldDiLabel=r,i.set("label",void 0))})),this.reverted("shape.delete",Um(function(e){const{labelTarget:t,oldDiLabel:n}=e.context;n&&wr(t).set("label",n)}))}function Um(e){return function(t){var n=t.context;vr(n.shape||n.connection||n.element,"bpmn:BaseElement")&&e(t)}}Xm.$inject=["moddle"],Xm.prototype._needsId=function(e){return yr(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"])},Xm.prototype._ensureId=function(e){var t;e.id?this._model.ids.claim(e.id,e):(t=vr(e,"bpmn:Activity")?"Activity":vr(e,"bpmn:Event")?"Event":vr(e,"bpmn:Gateway")?"Gateway":yr(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e)))},Xm.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},Xm.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},Xm.prototype.createDiShape=function(e,t){return this.create("bpmndi:BPMNShape",q({bpmnElement:e,bounds:this.createDiBounds()},t))},Xm.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},Xm.prototype.createDiWaypoints=function(e){var t=this;return P(e,function(e){return t.createDiWaypoint(e)})},Xm.prototype.createDiWaypoint=function(e){return this.create("dc:Point",Q(e,["x","y"]))},Xm.prototype.createDiEdge=function(e,t){return this.create("bpmndi:BPMNEdge",q({bpmnElement:e,waypoint:this.createDiWaypoints([])},t))},Xm.prototype.createDiPlane=function(e,t){return this.create("bpmndi:BPMNPlane",q({bpmnElement:e},t))},e(Gm,Vo),Gm.$inject=["eventBus","bpmnFactory","connectionDocking"],Gm.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Gm.prototype.updateParent=function(e,t){if(!(ln(e)||vr(e,"bpmn:DataStoreReference")&&e.parent&&vr(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=wr(e),o=n&&n.businessObject,s=wr(n);vr(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,o,t&&t.businessObject),vr(e,"bpmn:DataOutputAssociation")&&(o=e.source?e.source.businessObject:null),vr(e,"bpmn:DataInputAssociation")&&(o=e.target?e.target.businessObject:null),this.updateSemanticParent(i,o),vr(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,o),this.updateDiParent(r,s)}},Gm.prototype.updateBounds=function(e){var t=wr(e),n=function(e){if(!vr(e,"bpmn:Activity"))return;var t=wr(e);if(!t)return;var n=t.get("label");if(!n)return;return n.get("bounds")}(e);if(n){var i=oa(n,t.get("bounds"));q(n,{x:e.x+i.x,y:e.y+i.y})}var r=ln(e)?this._getLabel(t):t,o=r.bounds;o||(o=this._bpmnFactory.createDiBounds(),r.set("bounds",o)),q(o,{x:e.x,y:e.y,width:e.width,height:e.height})},Gm.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(vr(n,"bpmn:Lane")&&bt(n.get("flowNodeRef"),e),vr(t,"bpmn:Lane")&&wt(t.get("flowNodeRef"),e))},Gm.prototype.updateDiConnection=function(e,t,n){var i=wr(e),r=wr(t),o=wr(n);i.sourceElement&&i.sourceElement.bpmnElement!==br(t)&&(i.sourceElement=t&&r),i.targetElement&&i.targetElement.bpmnElement!==br(n)&&(i.targetElement=n&&o)},Gm.prototype.updateDiParent=function(e,t){if(t&&!vr(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(bt(n,e),e.$parent=null)}},Gm.prototype.getLaneSet=function(e){var t,n;return vr(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(vr(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},Gm.prototype.updateSemanticParent=function(e,t,n){var i;if(e.$parent!==t&&(!vr(e,"bpmn:DataInput")&&!vr(e,"bpmn:DataOutput")||(vr(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(vr(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(vr(e,"bpmn:FlowElement")){if(t)if(vr(t,"bpmn:Participant"))t=t.processRef;else if(vr(t,"bpmn:Lane"))do{t=t.$parent.$parent}while(vr(t,"bpmn:Lane"));i="flowElements"}else if(vr(e,"bpmn:Artifact")){for(;t&&!vr(t,"bpmn:Process")&&!vr(t,"bpmn:SubProcess")&&!vr(t,"bpmn:Collaboration");){if(vr(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(vr(e,"bpmn:MessageFlow"))i="messageFlows";else if(vr(e,"bpmn:Participant")){i="participants";var r,o=e.processRef;o&&(r=function(e){for(;e&&!vr(e,"bpmn:Definitions");)e=e.$parent;return e}(e.$parent||t),e.$parent&&(bt(r.get("rootElements"),o),o.$parent=null),t&&(wt(r.get("rootElements"),o),o.$parent=r))}else vr(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":vr(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(`no parent for <${e.id}> in <${t.id}>`);var s;if(e.$parent&&bt(s=e.$parent.get(i),e),t?((s=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var a=n.get(i);bt(s,e),t&&(a||(a=[],t.set(i,a)),a.push(e))}}},Gm.prototype.updateConnectionWaypoints=function(e){wr(e).set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Gm.prototype.updateConnection=function(e){var t,n=e.connection,i=br(n),r=n.source,o=br(r),s=n.target,a=br(n.target);if(vr(i,"bpmn:DataAssociation"))vr(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=o,t=e.parent||e.newParent||a,this.updateSemanticParent(i,a,t)):vr(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t),i.targetRef=a);else{var l=vr(i,"bpmn:SequenceFlow");i.sourceRef!==o&&(l&&(bt(i.sourceRef&&i.sourceRef.get("outgoing"),i),o&&o.get("outgoing")&&o.get("outgoing").push(i)),i.sourceRef=o),i.targetRef!==a&&(l&&(bt(i.targetRef&&i.targetRef.get("incoming"),i),a&&a.get("incoming")&&a.get("incoming").push(i)),i.targetRef=a)}this.updateConnectionWaypoints(n),this.updateDiConnection(n,r,s)},Gm.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};const Ym={width:100,height:80},Km={width:100,height:80},Zm={width:50,height:50},Jm={width:36,height:36},eg={width:350,height:200},tg={width:100,height:80},ng={width:600,height:250},ig={width:250,height:600},rg={width:400,height:60},og={width:60,height:400},sg={width:400,height:100},ag={width:36,height:50},lg={width:50,height:50},cg={width:100,height:40},ug={width:300,height:300};function pg(e,t){zn.call(this),this._bpmnFactory=e,this._moddle=t}function hg(e,t,n){return void 0===t[n]?t:(e[n]=t[n],X(t,[n]))}function dg(e,t){this._modeling=e,this._canvas=t}function fg(e){this._modeling=e}function mg(e,t){this._canvas=e,this._layouter=t}e(pg,zn),pg.$inject=["bpmnFactory","moddle"],pg.prototype._baseCreate=zn.prototype.create,pg.prototype.create=function(e,t){if("label"===e){var n=t.di||this._bpmnFactory.createDiLabel();return this._baseCreate(e,q({type:"label",di:n},qr,t))}return this.createElement(e,t)},pg.prototype.createElement=function(e,t){var n,i,r,o=(t=q({},t||{})).businessObject,s=t.di;if(!o){if(!t.type)throw new Error("no shape type specified");o=this._bpmnFactory.create(t.type)}if(!yr(s,["bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane"])){var a=q({},s||{},{id:o.id+"_di"});s="root"===e?this._bpmnFactory.createDiPlane(o,a):"connection"===e?this._bpmnFactory.createDiEdge(o,a):this._bpmnFactory.createDiShape(o,a)}return vr(o,"bpmn:Group")&&(t=q({isFrame:!0},t)),t=function(e,t,n){return E(n,function(n){t=hg(e,t,n)}),t}(o,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&(t=hg(s,t,"isExpanded")),yr(o,["bpmn:Lane","bpmn:Participant"])&&(t=hg(s,t,"isHorizontal")),vr(o,"bpmn:SubProcess")&&(t.collapsed=!Nr(o,s)),vr(o,"bpmn:ExclusiveGateway")&&(b(s,"isMarkerVisible")?void 0===s.isMarkerVisible&&(s.isMarkerVisible=!1):s.isMarkerVisible=!0),p(t.triggeredByEvent)&&(o.triggeredByEvent=t.triggeredByEvent,delete t.triggeredByEvent),p(t.cancelActivity)&&(o.cancelActivity=t.cancelActivity,delete t.cancelActivity),t.eventDefinitionType&&(i=o.get("eventDefinitions")||[],r=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),"bpmn:ConditionalEventDefinition"===t.eventDefinitionType&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=o,o.eventDefinitions=i,delete t.eventDefinitionType),n=this.getDefaultSize(o,s),t=q({id:o.id},n,t,{businessObject:o,di:s}),this._baseCreate(e,t)},pg.prototype.getDefaultSize=function(e,t){return function(e,t){const n=br(e);if(t=t||wr(e),vr(n,"bpmn:SubProcess"))return Nr(n,t)?{...eg}:{...tg};if(vr(n,"bpmn:Task"))return{...Km};if(vr(n,"bpmn:Gateway"))return{...Zm};if(vr(n,"bpmn:Event"))return{...Jm};if(vr(n,"bpmn:Participant")){const e=!t||void 0===t.isHorizontal||!0===t.isHorizontal;return Nr(n,t)?e?{...ng}:{...ig}:e?{...rg}:{...og}}return vr(n,"bpmn:Lane")?{...sg}:vr(n,"bpmn:DataObjectReference")?{...ag}:vr(n,"bpmn:DataStoreReference")?{...lg}:vr(n,"bpmn:TextAnnotation")?{...cg}:vr(n,"bpmn:Group")?{...ug}:{...Ym}}(e,t)},pg.prototype.createParticipantShape=function(e){return f(e)||(e={isExpanded:e}),!1!==(e=q({type:"bpmn:Participant"},e||{})).isExpanded&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},dg.$inject=["modeling","canvas"],dg.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;E(n,function(e){var n={x:0,y:0};p(i.left)?n.x=i.left-e.x:p(i.right)?n.x=i.right-e.width-e.x:p(i.center)?n.x=i.center-Math.round(e.width/2)-e.x:p(i.top)?n.y=i.top-e.y:p(i.bottom)?n.y=i.bottom-e.height-e.y:p(i.middle)&&(n.y=i.middle-Math.round(e.height/2)-e.y),t.moveElements([e],n,e.parent)})},dg.prototype.postExecute=function(e){},fg.$inject=["modeling"],fg.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},fg.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,C(t.outgoing,function(e){return e.target===n})||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},mg.$inject=["canvas","layouter"],mg.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,s=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,s)),this._canvas.addConnection(t,r,o),t},mg.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var gg=Math.round;function vg(e){this._modeling=e}vg.$inject=["modeling"],vg.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,s=this._modeling;E(t,function(e){m(e.x)||(e.x=0),m(e.y)||(e.y=0)});var a=ht(_(t,function(e){return!e.hidden}));E(t,function(e){an(e)&&(e.waypoints=P(e.waypoints,function(e){return{x:gg(e.x-a.x-a.width/2+r.x),y:gg(e.y-a.y-a.height/2+r.y)}})),q(e,{x:gg(e.x-a.x-a.width/2+r.x),y:gg(e.y-a.y-a.height/2+r.y)})});var l=new Set(at(t)),c={};E(t,function(e){if(an(e))c[e.id]=m(i)?s.createConnection(c[e.source.id],c[e.target.id],i,e,e.parent||n,o):s.createConnection(c[e.source.id],c[e.target.id],e,e.parent||n,o);else{var t=q({},o);l.has(e)||(t.autoResize=!1),ln(e)&&(t=X(t,["attach"])),c[e.id]=m(i)?s.createShape(e,Q(e,["x","y","width","height"]),e.parent||n,i,t):s.createShape(e,Q(e,["x","y","width","height"]),e.parent||n,t)}}),e.elements=R(c)};var yg=Math.round;function bg(e){this._canvas=e}function wg(e){bg.call(this,e)}bg.$inject=["canvas"],bg.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 void 0!==n.width?q(t,n):q(t,{x:n.x-yg(t.width/2),y:n.y-yg(t.height/2)}),this._canvas.addShape(t,i,r),t},bg.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},e(wg,bg),wg.$inject=["canvas"];var xg=bg.prototype.execute;wg.prototype.execute=function(e){var t=e.shape;return function(e){["width","height"].forEach(function(t){void 0===e[t]&&(e[t]=0)})}(t),t.labelTarget=e.labelTarget,xg.call(this,e)};var _g=bg.prototype.revert;function Eg(e,t){this._canvas=e,this._modeling=t}function Sg(e,t){this._modeling=e,this._elementRegistry=t}function kg(e,t){this._canvas=e,this._modeling=t}function Og(e){this._modeling=e}wg.prototype.revert=function(e){return e.shape.labelTarget=null,_g.call(this,e)},Eg.$inject=["canvas","modeling"],Eg.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;zm(n.incoming,function(e){t.removeConnection(e,{nested:!0})}),zm(n.outgoing,function(e){t.removeConnection(e,{nested:!0})})},Eg.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=xt(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},Eg.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,wt(n.children,t,i),this._canvas.addConnection(t,n),t},Sg.$inject=["modeling","elementRegistry"],Sg.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;E(e.elements,function(e){n.get(e.id)&&(e.waypoints?t.removeConnection(e):t.removeShape(e))})},kg.$inject=["canvas","modeling"],kg.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;zm(n.incoming,function(e){t.removeConnection(e,{nested:!0})}),zm(n.outgoing,function(e){t.removeConnection(e,{nested:!0})}),zm(n.children,function(e){an(e)?t.removeConnection(e,{nested:!0}):t.removeShape(e,{nested:!0})})},kg.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=xt(i.children,n),t.removeShape(n),n},kg.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return wt(i.children,n,r),t.addShape(n,i),n},Og.$inject=["modeling"];var Cg={x:"y",y:"x"};function Pg(e,t){this._layouter=e,this._canvas=t}function Ag(){}function Tg(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function Rg(e){this._modeling=e}function Mg(e){this._helper=new Rg(e)}function $g(e){this._modeling=e,this._helper=new Rg(e)}function Dg(e){this._modeling=e}function Bg(e){return e.original||e}function Lg(e,t){this._modeling=e,this._rules=t}function Ig(e){this._modeling=e}function Ng(e){this._modeling=e}function zg(e){return q({},e)}function jg(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function Vg(e,t,n){var i=jg(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i]<t:void 0}function Fg(e){this._modeling=e}function qg(e){var t={};return E(e,function(e){t[e.id]=e.hidden,e.children&&(t=q({},t,qg(e.children)))}),t}function Hg(e,t){var n=[];return E(e,function(e){e.hidden=t,n=n.concat(e),e.children&&(n=n.concat(Hg(e.children,e.collapsed||t)))}),n}function Wg(e,t){var n=[];return E(e,function(e){e.hidden=t[e.id],n=n.concat(e),e.children&&(n=n.concat(Wg(e.children,t)))}),n}function Qg(e){this._modeling=e}function Xg(e,t){return bt(e&&e.attachers,t)}function Gg(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),wt(i,t,n)}}function Ug(){}function Yg(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",function(){i.registerHandlers(n)})}function Kg(e){this._elementRegistry=e}function Zg(e,t){E(t,function(t,n){e.set(n,t)})}Og.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(e,t){e.range.min=Math.min(t[i],e.range.min),e.range.max=Math.max(t[i]+t[r],e.range.max)}function s(e){return e[i]+e[r]/2}function a(e){return e.length-1}function l(e){return e.max-e.min}var c,u,p=n[0],h=a(n),d=n[h],f=0;E(n,function(e,c){var u,p,d;e.elements.length<2?c&&c!==n.length-1&&(o(e,e.elements[0]),f+=l(e.range)):(p=(u=B(e.elements,i))[0],c===h&&(p=u[a(u)]),d=s(p),e.range=null,E(u,function(n){!function(e,n){var r={y:0};r[i]=e-s(n),r[i]&&(r[Cg[i]]=0,t.moveElements([n],r,n.parent))}(d,n),null!==e.range?o(e,n):e.range={min:n[i],max:n[i]+n[r]}}),c&&c!==n.length-1&&(f+=l(e.range)))}),u=Math.abs(d.range.min-p.range.max),(c=Math.round((u-f)/(n.length-1)))<n.length-1||E(n,function(e,o){var s,a={};e!==p&&e!==d&&(s=n[o-1],e.range.max=0,E(e.elements,function(n,o){a[Cg[i]]=0,a[i]=s.range.max-n[i]+c,e.range.min!==n[i]&&(a[i]+=n[i]-e.range.min),a[i]&&t.moveElements([n],a,n.parent),e.range.max=Math.max(n[i]+n[r],o?e.range.max:0)}))})},Og.prototype.postExecute=function(e){},Pg.$inject=["layouter","canvas"],Pg.prototype.execute=function(e){var t=e.connection;return q(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Pg.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},Ag.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=bt(o.children,t),wt(i.children,t,r),t.parent=i,E(t.waypoints,function(e){e.x+=n.x,e.y+=n.y,e.original&&(e.original.x+=n.x,e.original.y+=n.y)}),t},Ag.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return bt(n.children,t),wt(i.children,t,r),t.parent=i,E(t.waypoints,function(e){e.x-=o.x,e.y-=o.y,e.original&&(e.original.x-=o.x,e.original.y-=o.y)}),t},Tg.prototype.add=function(e,t){return this.addAll([e],t)},Tg.prototype.addAll=function(e,t){return q(this,pt(e,!!t,this)),this},Rg.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},Rg.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,s=e.allShapes,a=e.allConnections,l=e.enclosedConnections,c=e.topLevel,u=!1;r&&r.parent===n&&(u=!0),E(s,function(e){o.moveShape(e,t,c[e.id]&&!u&&n,{recurse:!1,layout:!1})}),E(a,function(e){var i=!!s[e.source.id],r=!!s[e.target.id];l[e.id]&&i&&r?o.moveConnection(e,t,c[e.id]&&!u&&n):o.layoutConnection(e,{connectionStart:i&&qh(e,e.source,t),connectionEnd:r&&Hh(e,e.target,t)})})},Rg.prototype.getClosure=function(e){return(new Tg).addAll(e,!0)},Mg.$inject=["modeling"],Mg.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Mg.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},$g.$inject=["modeling"],$g.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=Q(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=bt(o.children,t),wt(i.children,t,r),q(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},$g.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;!1!==i.layout&&(E(t.incoming,function(e){r.layoutConnection(e,{connectionEnd:Hh(e,t,n)})}),E(t.outgoing,function(e){r.layoutConnection(e,{connectionStart:qh(e,t,n)})})),!1!==i.recurse&&this.moveChildren(e)},$g.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return wt(n.children,t,i),q(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},$g.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},$g.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},Dg.$inject=["modeling"],Dg.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 d(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},Dg.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.hints||{},s={};o.connectionStart&&(s.connectionStart=o.connectionStart),o.connectionEnd&&(s.connectionEnd=o.connectionEnd),!1!==o.layoutConnection&&(!n||i&&"source"!==o.docking||(s.connectionStart=s.connectionStart||Bg(d(r)?r[0]:r)),!i||n&&"target"!==o.docking||(s.connectionEnd=s.connectionEnd||Bg(d(r)?r[r.length-1]:r)),o.newWaypoints&&(s.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,s))},Dg.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},Lg.$inject=["modeling","rules"],Lg.prototype.preExecute=function(e){var t,n=this,i=this._modeling,r=this._rules,o=e.oldShape,s=e.newData,a=e.hints||{};function l(e,t,n){return r.allowed("connection.reconnect",{connection:n,source:e,target:t})}var c,u={x:s.x,y:s.y},p={x:o.x,y:o.y,width:o.width,height:o.height};t=e.newShape=e.newShape||n.createShape(s,u,o.parent,a),o.host&&i.updateAttachment(t,o.host),!1!==a.moveChildren&&(c=o.children.slice(),i.moveElements(c,{x:0,y:0},t,a));var h=o.incoming.slice(),d=o.outgoing.slice();E(h,function(e){l(e.source,t,e)&&n.reconnectEnd(e,t,Fh(e,t,p),a)}),E(d,function(e){var i=e.target;l(t,i,e)&&n.reconnectStart(e,t,Vh(e,t,p),a)})},Lg.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},Lg.prototype.execute=function(e){},Lg.prototype.revert=function(e){},Lg.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},Lg.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},Lg.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},Ig.$inject=["modeling"],Ig.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(void 0===n.x||void 0===n.y||void 0===n.width||void 0===n.height)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},q(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Ig.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds;!1!==(e.hints||{}).layout&&(E(n.incoming,function(e){t.layoutConnection(e,{connectionEnd:Fh(e,n,i)})}),E(n.outgoing,function(e){t.layoutConnection(e,{connectionStart:Vh(e,n,i)})}))},Ig.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return q(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Ng.$inject=["modeling"],Ng.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,s={};this.moveShapes(i,t),E(r,function(e){s[e.id]=function(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}(e)}),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(function(e,t){var n=[],i=new Set(e);E(t,function(e){i.add(e)});var r=new Set;return i.forEach(function(e){var t=e.incoming,o=e.outgoing;E(t.concat(o),function(e){var t=e.source,o=e.target;(i.has(t)||i.has(o))&&(r.has(e)||(r.add(e),n.push(e)))})}),n}(i,r),t,n,o,i,r,s)},Ng.prototype.execute=function(){},Ng.prototype.revert=function(){},Ng.prototype.moveShapes=function(e,t){var n=this;E(e,function(e){n._modeling.moveShape(e,t,null,{autoResize:!1,layout:!1,recurse:!1})})},Ng.prototype.resizeShapes=function(e,t,n){var i=this;E(e,function(e){var r=function(e,t,n){var i=e.x,r=e.y,o=e.width,s=e.height,a=n.x,l=n.y;switch(t){case"n":return{x:i,y:r+l,width:o,height:s-l};case"s":return{x:i,y:r,width:o,height:s+l};case"w":return{x:i+a,y:r,width:o-a,height:s};case"e":return{x:i,y:r,width:o+a,height:s};default:throw new Error("unknown direction: "+t)}}(e,n,t);i._modeling.resizeShape(e,r,null,{attachSupport:!1,autoResize:!1,layout:!1})})},Ng.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,s){var a=this,l=new Set(r),c=new Set(o);E(e,function(e){var r=e.source,o=e.target,u=function(e){return P(e.waypoints,function(e){return(e=zg(e)).original&&(e.original=zg(e.original)),e})}(e),p=jg(n),h={},d=l.has(r)||c.has(r),f=l.has(o)||c.has(o);d&&f?(u=P(u,function(e){return Vg(e,i,n)&&(e[p]=e[p]+t[p]),e.original&&Vg(e.original,i,n)&&(e.original[p]=e.original[p]+t[p]),e}),a._modeling.updateWaypoints(e,u,{labelBehavior:!1})):(d||f)&&(l.has(r)?h.connectionStart=qh(e,r,t):l.has(o)?h.connectionEnd=Hh(e,o,t):c.has(r)?h.connectionStart=Vh(e,r,s[r.id]):c.has(o)&&(h.connectionEnd=Fh(e,o,s[o.id])),a._modeling.layoutConnection(e,h))})},Fg.$inject=["modeling"],Fg.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=qg(n),t.collapsed=!t.collapsed;var i=Hg(n,t.collapsed);return[t].concat(i)},Fg.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=Wg(t.children,n);return t.collapsed=!t.collapsed,[t].concat(i)},Qg.$inject=["modeling"],Qg.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=Xg(i,t),Gg(n,t),t.host=n,t},Qg.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,Xg(n,t),Gg(i,t,r),t},Ug.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},Ug.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},Yg.$inject=["eventBus","elementFactory","commandStack"],Yg.prototype.getHandlers=function(){return{"shape.append":fg,"shape.create":bg,"shape.delete":kg,"shape.move":$g,"shape.resize":Ig,"shape.replace":Lg,"shape.toggleCollapse":Fg,spaceTool:Ng,"label.create":wg,"connection.create":mg,"connection.delete":Eg,"connection.move":Ag,"connection.layout":Pg,"connection.updateWaypoints":Ug,"connection.reconnect":Dg,"elements.create":vg,"elements.move":Mg,"elements.delete":Sg,"elements.distribute":Og,"elements.align":dg,"element.updateAttachment":Qg}},Yg.prototype.registerHandlers=function(e){E(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},Yg.prototype.moveShape=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},Yg.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},Yg.prototype.moveElements=function(e,t,n,i){var r,o=(i=i||{}).attach,s=n;!0===o?(r=n,s=n.parent):!1===o&&(r=null);var a={shapes:e,delta:t,newParent:s,newHost:r,hints:i};this._commandStack.execute("elements.move",a)},Yg.prototype.moveConnection=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},Yg.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},Yg.prototype.createConnection=function(e,t,n,i,r,o){"object"==typeof n&&(o=r,r=i,i=n,n=void 0);var s={source:e,target:t,parent:r,parentIndex:n,connection:i=this._create("connection",i),hints:o};return this._commandStack.execute("connection.create",s),s.connection},Yg.prototype.createShape=function(e,t,n,i,r){"number"!=typeof i&&(r=i,i=void 0);var o,s,a=(r=r||{}).attach;e=this._create("shape",e),a?(o=n.parent,s=n):o=n;var l={position:t,shape:e,parent:o,parentIndex:i,host:s,hints:r};return this._commandStack.execute("shape.create",l),l.shape},Yg.prototype.createElements=function(e,t,n,i,r){d(e)||(e=[e]),"number"!=typeof i&&(r=i,i=void 0);var o={position:t,elements:e,parent:n,parentIndex:i,hints:r=r||{}};return this._commandStack.execute("elements.create",o),o.elements},Yg.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},Yg.prototype.appendShape=function(e,t,n,i,r){r=r||{};var o={source:e,position:n,target:i,shape:t=this._create("shape",t),connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},Yg.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},Yg.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},Yg.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},Yg.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},Yg.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Yg.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},Yg.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Yg.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)},Yg.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Yg.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)},Yg.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,q(i,{docking:"source"}))},Yg.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,q(i,{docking:"target"}))},Yg.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},Yg.prototype._create=function(e,t){return t instanceof $n?t:this._elementFactory.create(e,t)},Yg.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)},Kg.$inject=["elementRegistry"],Kg.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||function(e,t){return k(t,function(t,n){return t[n]=e.get(n),t},{})}(n,A(i));return Zg(n,i),e.oldProperties=o,e.changed=r,r},Kg.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return Zg(n,t),i},Kg.prototype._getVisualReferences=function(e){var t=this._elementRegistry;return vr(e,"bpmn:DataObject")?function(e,t){return t.filter(function(t){return vr(t,"bpmn:DataObjectReference")&&br(t).dataObjectRef===e})}(e,t):[]};var Jg="default",ev="id",tv="di",nv={width:0,height:0};function iv(e,t,n,i){this._elementRegistry=e,this._moddle=t,this._modeling=n,this._textRenderer=i}function rv(e,t){return ev in e&&e[ev]!==t[ev]}function ov(e,t){var n=e.businessObject,i=wr(e);E(t,function(e,t){t!==tv?n.set(t,e):i&&function(e,t){E(t,function(t,n){e.set(n,t)})}(i,e)})}iv.$inject=["elementRegistry","moddle","modeling","textRenderer"],iv.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,s=function(e){var t=q({},e);return sv.forEach(function(n){n in e&&(t[n]=br(t[n]))}),t}(e.properties),a=e.oldProperties||function(e,t){var n=A(t),i=e.businessObject,r=wr(e);return k(n,function(e,n){return e[n]=n!==tv?i.get(n):function(e,t){return k(t,function(t,n){return t[n]=e&&e.get(n),t},{})}(r,A(t.di)),e},{})}(t,s);return rv(s,o)&&(r.unclaim(o[ev]),i.updateId(t,s[ev]),r.claim(s[ev],o)),Jg in s&&(s[Jg]&&n.push(i.get(s[Jg].id)),o[Jg]&&n.push(i.get(o[Jg].id))),ov(t,s),e.oldProperties=a,e.changed=n,n},iv.prototype.postExecute=function(e){var t=e.element.label,n=t&&br(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,nv)}},iv.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,s=this._moddle.ids;return ov(t,i),rv(n,r)&&(s.unclaim(n[ev]),o.updateId(t,i[ev]),s.claim(i[ev],r)),e.changed};var sv=["default"];function av(e,t){this._canvas=e,this._modeling=t}function lv(e,t){this._modeling=e,this._spaceTool=t}function cv(e){this._modeling=e}function uv(e,t){this._modeling=e,this._spaceTool=t}av.$inject=["canvas","modeling"],av.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,s=o.$parent,a=wr(r);return t.setRootElement(n),t.removeRootElement(r),wt(s.rootElements,i),i.$parent=s,bt(s.rootElements,o),o.$parent=null,r.di=null,a.bpmnElement=i,n.di=a,e.oldRoot=r,[]},av.prototype.revert=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=e.oldRoot,o=r.businessObject,s=i.$parent,a=wr(n);return t.setRootElement(r),t.removeRootElement(n),bt(s.rootElements,i),i.$parent=null,wt(s.rootElements,o),o.$parent=s,n.di=null,a.bpmnElement=o,r.di=a,[]},lv.$inject=["modeling","spaceTool"],lv.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=th(i),s=o===i,a=s?i:i.parent,l=eh(a),c=zr(i);if(c?"left"===r?r="top":"right"===r&&(r="bottom"):"top"===r?r="left":"bottom"===r&&(r="right"),!l.length){var u=c?{x:i.x+Zp,y:i.y,width:i.width-Zp,height:i.height}:{x:i.x,y:i.y+Zp,width:i.width,height:i.height-Zp};n.createShape({type:"bpmn:Lane",isHorizontal:c},u,a)}var p,h,d,f,m,g=[];lt(o,function(e){return g.push(e),e.label&&g.push(e.label),e===i?[]:_(e.children,function(e){return e!==i})}),"top"===r?(p=-120,d=(h=i.y)+10,f="n",m="y"):"left"===r?(p=-120,d=(h=i.x)+10,f="w",m="x"):"bottom"===r?(p=120,d=(h=i.y+i.height)-10,f="s",m="y"):"right"===r&&(p=120,d=(h=i.x+i.width)-10,f="e",m="x");var v=t.calculateAdjustments(g,m,p,d),y=c?{x:0,y:p}:{x:p,y:0};t.makeSpace(v.movingShapes,v.resizingShapes,y,f,d);var b=c?{x:i.x+(s?Zp:0),y:h-("top"===r?120:0),width:i.width-(s?Zp:0),height:120}:{x:h-("left"===r?120:0),y:i.y+(s?Zp:0),width:120,height:i.height-(s?Zp:0)};e.newLane=n.createShape({type:"bpmn:Lane",isHorizontal:c},b,a)},cv.$inject=["modeling"],cv.prototype.preExecute=function(e){var t=this._modeling,n=e.shape,i=e.count,r=eh(n),o=r.length;if(o>i)throw new Error(`more than <${i}> child lanes`);var s,a,l,c,u=zr(n),p=u?n.height:n.width,h=Math.round(p/i);for(c=0;c<i;c++)s=c===i-1?p-h*c:h,a=u?{x:n.x+Zp,y:n.y+c*h,width:n.width-Zp,height:s}:{x:n.x+c*h,y:n.y+Zp,width:s,height:n.height-Zp},c<o?t.resizeShape(r[c],a):(l={type:"bpmn:Lane",isHorizontal:u},t.createShape(l,a,n))},uv.$inject=["modeling","spaceTool"],uv.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds;!1!==e.balanced?this.resizeBalanced(t,n):this.resizeSpace(t,n)},uv.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=nh(e,t);n.resizeShape(e,t),i.forEach(function(e){n.resizeShape(e.shape,e.newBounds)})},uv.prototype.resizeSpace=function(e,t){var n,i,r,o,s,a=this._spaceTool,l=pn(e),c=Wp(pn(t),l),u=th(e),p=[],h=[];lt(u,function(e){return p.push(e),(vr(e,"bpmn:Lane")||vr(e,"bpmn:Participant"))&&h.push(e),e.children}),(c.bottom||c.top)&&(n=c.bottom||c.top,i=e.y+(c.bottom?e.height:0)+(c.bottom?-10:10),r=c.bottom?"s":"n",o=c.top>0||c.bottom<0?-n:n,s=a.calculateAdjustments(p,"y",o,i),a.makeSpace(s.movingShapes,s.resizingShapes,{x:0,y:n},r)),(c.left||c.right)&&(n=c.right||c.left,i=e.x+(c.right?e.width:0)+(c.right?-10:100),r=c.right?"e":"w",o=c.left>0||c.right<0?-n:n,s=a.calculateAdjustments(h,"x",o,i),a.makeSpace(s.movingShapes,s.resizingShapes,{x:n,y:0},r))};var pv="flowNodeRef",hv="lanes";function dv(){}dv.prototype._computeUpdates=function(e,t){var n=[],i=[],r={},o=[];function s(e){-1===n.indexOf(e)&&(o.push(e),n.push(e))}function a(e){if(!e.parent)return[];var t=function(e){var t=th(e);return r[t.id]||(r[t.id]=Jp(t)),r[t.id]}(e);return t.filter(function(t){return n=e,i=pn(t),r=n.x+n.width/2,o=n.y+n.height/2,r>i.left&&r<i.right&&o>i.top&&o<i.bottom;var n,i,r,o}).map(function(e){return e.businessObject})}return t.forEach(function(e){var t=th(e);if(t&&-1===n.indexOf(t)){var i=t.children.filter(function(e){return vr(e,"bpmn:FlowNode")});i.forEach(s),n.push(t)}}),e.forEach(s),o.forEach(function(e){var t=e.businessObject,n=t.get(hv).slice(),r=a(e);i.push({flowNode:t,remove:n,add:r})}),t.forEach(function(e){var t=e.businessObject;e.parent||t.get(pv).forEach(function(e){i.push({flowNode:e,remove:[t],add:[]})})}),i},dv.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(e){var t=e.flowNode,n=t.get(hv);e.remove.forEach(function(e){bt(n,e),bt(e.get(pv),t)}),e.add.forEach(function(e){wt(n,e),wt(e.get(pv),t)})}),[]},dv.prototype.revert=function(e){return e.updates.forEach(function(e){var t=e.flowNode,n=t.get(hv);e.add.forEach(function(e){bt(n,e),bt(e.get(pv),t)}),e.remove.forEach(function(e){wt(n,e),wt(e.get(pv),t)})}),[]};var fv="categoryValueRef";function mv(e,t){this._bpmnFactory=e,this._elementRegistry=t}function gv(e){for(;e.parent;)e=e.parent;return e}function vv(e){this._moddle=e}mv.$inject=["bpmnFactory","elementRegistry"],mv.prototype._computeUpdates=function(e,t){var n=this._elementRegistry,i=this._bpmnFactory,r=new Map,o=[],s=new Map;function a(e,t,n){if(t){var i=s.get(e);i||(i={},s.set(e,i)),n&&i.present||!n&&i.past||(n?i.present={categoryValue:t,root:gv(e)}:i.past={categoryValue:t})}}function l(e){r.set(e,br(e))}function c(){n.filter(function(e){return vr(e,"bpmn:FlowElement")&&!ln(e)&&e.parent}).forEach(l)}function u(e){return e.reduce(function(e,t){var n=gv(t),i=e.get(n);return i||(i=[],e.set(n,i)),i.push(t),e},new Map)}var p=u(e=Array.from(e||[]));t.length&&c(),e.forEach(l),n.filter(function(e){return vr(e,"bpmn:Group")&&!ln(e)&&e.parent}).forEach(function(e){var t=br(e).get("categoryValueRef");if(!t){var n=gv(e),r=dt(p.get(n)||[],e);Object.keys(r).length>0&&(t=function(e){var t=br(e),n=t.get("categoryValueRef");return n||(n=kp(i,t),o.push(function(e,t){return{groupShape:e,categoryValue:t,category:t.$parent}}(e,n))),n}(e))}a(e,t,!0)}),t.forEach(function(e){a(e.groupShape,e.categoryValue,!1)}),o.length&&c();var h=Array.from(r.keys()),d=Array.from(s.values()).reduce(function(e,t){return t.present&&e.add(t.present.categoryValue),t.past&&e.add(t.past.categoryValue),e},new Set),f=new Map,m=u(h);return s.forEach(function(e,t){var n=e.present;if(n){var i=m.get(n.root)||[],r=dt(i,t);i.forEach(function(e){if(r[e.id]){var t=f.get(e);t||(t=new Set,f.set(e,t)),t.add(n.categoryValue)}})}}),{flowElements:h.reduce(function(e,t){var n=r.get(t),i=n.get(fv),o=new Set(i),s=f.get(t)||new Set,a=Array.from(s).filter(function(e){return!o.has(e)}),l=i.filter(function(e){return d.has(e)&&!s.has(e)});return(a.length||l.length)&&e.push({businessObject:n,categoryValuesToAdd:a,categoryValuesToRemove:l}),e},[]),groups:o}},mv.prototype.execute=function(e){var t=e.updates;return t||(t=e.updates=this._computeUpdates(e.affectedFlowElements,e.affectedGroupEntries)),t.groups.forEach(function(e){br(e.groupShape).categoryValueRef=e.categoryValue,e.categoryValue.$parent=e.category}),t.flowElements.forEach(function(e){var t=e.businessObject.get(fv);e.categoryValuesToRemove.forEach(function(e){bt(t,e)}),e.categoryValuesToAdd.forEach(function(e){wt(t,e,!0)})}),[]},mv.prototype.revert=function(e){var t=e.updates;return t.flowElements.forEach(function(e){var t=e.businessObject.get(fv);e.categoryValuesToAdd.forEach(function(e){bt(t,e)}),e.categoryValuesToRemove.forEach(function(e){wt(t,e,!0)})}),t.groups.forEach(function(e){br(e.groupShape).categoryValueRef=null}),[]},vv.$inject=["moddle"],vv.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element;return e.claiming?t.claim(n,i):t.unclaim(n),[]},vv.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element;return e.claiming?t.unclaim(n):t.claim(n,i),[]};var yv={fill:void 0,stroke:void 0};function bv(e){this._commandStack=e,this._normalizeColor=function(e){if(e){if(v(e)){var t=function(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}(e);if(t)return t}throw new Error(`invalid color value: ${e}`)}}}bv.$inject=["commandStack"],bv.prototype.postExecute=function(e){var t=e.elements,n=e.colors||yv,i=this,r={};"fill"in n&&q(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&q(r,{"border-color":this._normalizeColor(n.stroke)}),E(t,function(e){var t=an(e)?Q(r,["border-color"]):r,n=wr(e);if(function(e){"border-color"in e&&(e.stroke=e["border-color"]);"background-color"in e&&(e.fill=e["background-color"])}(t),ln(e)){if(!n||!vr(n.label,"bpmndi:BPMNLabel"))return;i._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:n.label,properties:{color:r["border-color"]}})}else{if(!yr(n,["bpmndi:BPMNEdge","bpmndi:BPMNShape"]))return;i._commandStack.execute("element.updateProperties",{element:e,properties:{di:t}})}})};var wv={width:0,height:0};function xv(e,t,n){function i(e,t){var n=e.label||e,i=e.labelTarget||e;return function(e,t){var n=e.businessObject,i=Gr(n);if(i)if("categoryValueRef"===i){if(!n[i])return e;n[i].value=t}else n[i]=t}(n,t),[n,i]}this.preExecute=function(t){var n=t.element,i=n.businessObject,r=t.newLabel;if(!ln(n)&&Hr(n)&&!Wr(n)&&!_v(r)){var o=Xr(n);o={x:o.x,y:o.y+7},e.createLabel(n,o,{id:i.id+"_label",businessObject:i,di:n.di})}},this.execute=function(e){return e.oldLabel=Ur(e.element),i(e.element,e.newLabel)},this.revert=function(e){return i(e.element,e.oldLabel)},this.postExecute=function(n){var i=n.element,r=i.label||i,o=n.newLabel,s=n.newBounds,a=n.hints||{};if(ln(r)||vr(r,"bpmn:TextAnnotation"))if(ln(r)&&_v(o))!1!==a.removeShape&&e.removeShape(r,{unsetLabel:!1});else{var l=Ur(i);void 0===s&&(s=t.getExternalLabelBounds(r,l)),s&&e.resizeShape(r,s,wv)}}}function _v(e){return!e||!e.trim()}function Ev(e,t,n,i){Yg.call(this,e,t,n),this._bpmnRules=i}function Sv(){}xv.$inject=["modeling","textRenderer","bpmnFactory"],e(Ev,Yg),Ev.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],Ev.prototype.getHandlers=function(){var e=Yg.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=Kg,e["element.updateProperties"]=iv,e["canvas.updateRoot"]=av,e["lane.add"]=lv,e["lane.resize"]=uv,e["lane.split"]=cv,e["lane.updateRefs"]=dv,e["group.updateRefs"]=mv,e["id.updateClaim"]=vv,e["element.setColor"]=bv,e["element.updateLabel"]=xv,e},Ev.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},Ev.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)},Ev.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},Ev.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},Ev.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},Ev.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},Ev.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},Ev.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},Ev.prototype.makeProcess=function(){var e=this._create("root",{type:"bpmn:Process"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},Ev.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},Ev.prototype.updateCategoryValueRefs=function(e,t){this._commandStack.execute("group.updateRefs",{affectedFlowElements:e,affectedGroupEntries:t})},Ev.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},Ev.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},Ev.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})},Sv.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||fn(t.source||e.source),t.connectionEnd||fn(t.target||e.target)]};var kv=Math.round,Ov={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function Cv(e,t,n){var i,r,o,s=mn(t,e,5),a=n.split(":")[0],l=kv((t.x-e.x)/2+e.x),c=kv((t.y-e.y)/2+e.y),u=(o=s,{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[a].test(o)),p=/h|r|l/.test(a),h=!1,d=!1;return u?(i=p?{x:l,y:e.y}:{x:e.x,y:c},r=p?"h:h":"v:v"):(h=function(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}(s,a),r=p?"h:v":"v:h",h?p?(d=c===e.y,i={x:e.x+20*(/l/.test(a)?-1:1),y:d?c+20:c}):i={x:(d=l===e.x)?l+20:l,y:e.y+20*(/t/.test(a)?-1:1)}:i={x:l,y:c}),{waypoints:Av(e,i,r).concat(i),directions:r,turnNextDirections:d}}function Pv(e){return e.split(":").reverse().join(":")}function Av(e,t,n){if(!function(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}(n=n||"h:h"))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(Dv(n)){var i=function(e,t,n){return Cv(e,t,n)}(e,t,n),r=function(e,t,n){var i=Cv(t,e,Pv(n));return{waypoints:i.waypoints.slice().reverse(),directions:Pv(i.directions),turnNextDirections:i.turnNextDirections}}(e,t,n),o=function(e,t){var n=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(n="h"==n?"v":"h"),t.turnNextDirections&&(i="h"==i?"v":"h");var r=n+":"+i;return{waypoints:Av(e.waypoints[e.waypoints.length-1],t.waypoints[0],r),directions:r}}(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return function(e,t,n){var i=kv((t.x-e.x)/2+e.x),r=kv((t.y-e.y)/2+e.y);if("h:v"===n)return[{x:t.x,y:e.y}];if("v:h"===n)return[{x:e.x,y:t.y}];if("h:h"===n)return[{x:i,y:e.y},{x:i,y:t.y}];if("v:v"===n)return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(e,t,n)}function Tv(e,t,n,i,r){var o=S(r&&r.preferredLayouts||[],"straight")[0]||"h:h",s=mn(e,t,Ov[o]||0),a=function(e,t){if(Dv(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}}(s,o);n=n||fn(e),i=i||fn(t);var l=a.split(":"),c=Bv(n,e,l[0],function(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]}(s));return function(e,t,n){var i=Av(e,t,n);return i.unshift(e),i.push(t),Lv(i)}(c,Bv(i,t,l[1],s),a)}function Rv(e,t,n,i,r,o){var s;return d(n)&&(r=n,o=i,n=fn(e),i=fn(t)),r=r||[],s=-1!==(o=q({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")&&function(e,t,n,i,r){var o,s,a={};if(s=mn(e,t),!/^(top|bottom|left|right)$/.test(s))return null;/top|bottom/.test(s)&&(o="x");/left|right/.test(s)&&(o="y");return"target"===r.preserveDocking?Mv(o,i,e)?(a[o]=i[o],[{x:void 0!==a.x?a.x:n.x,y:void 0!==a.y?a.y:n.y,original:{x:void 0!==a.x?a.x:n.x,y:void 0!==a.y?a.y:n.y}},{x:i.x,y:i.y}]):null:Mv(o,n,t)?(a[o]=n[o],[{x:n.x,y:n.y},{x:void 0!==a.x?a.x:i.x,y:void 0!==a.y?a.y:i.y,original:{x:void 0!==a.x?a.x:i.x,y:void 0!==a.y?a.y:i.y}}]):null}(e,t,n,i,o),s||(s=o.connectionEnd&&function(e,t,n,i){var r=i.slice().reverse();return r=$v(e,t,n,r),r?r.reverse():null}(t,e,i,r),s||((s=o.connectionStart&&$v(e,t,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:Tv(e,t,n,i,o))))}function Mv(e,t,n){return function(e,t,n){return e>=t&&e<=n}(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function $v(e,t,n,i){if(function(e){return e.length<3||!(e.length>4)&&!!w(e,function(t,n){var i=e[n-1];return i&&_t(t,i)<3})}(i))return null;var r,o=i[0],s=i.slice();return s[0]=n,s[1]=function(e,t,n){switch(St(t,e)){case"v":return{x:n.x,y:e.y};case"h":return{x:e.x,y:n.y}}return{x:e.x,y:e.y}}(s[1],o,n),r=function(e,t,n){var i;for(i=e.length-2;0!==i;i--)if(Ot(e[i],t,20)||Ot(e[i],n,20))return e.slice(i);return e}(s,e,t),r!==s&&(s=$v(e,t,n,r)),s&&St(s)?null:s}function Dv(e){return e&&/t|r|b|l/.test(e)}function Bv(e,t,n,i){if("h"===n&&(n=/left/.test(i)?"l":"r"),"v"===n&&(n=/top/.test(i)?"t":"b"),"t"===n)return{original:e,x:e.x,y:t.y};if("r"===n)return{original:e,x:t.x+t.width,y:e.y};if("b"===n)return{original:e,x:e.x,y:t.y+t.height};if("l"===n)return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function Lv(e){return e.reduce(function(t,n,i){return Et(t[t.length-1],e[i+1],n,0)||t.push(n),t},[])}var Iv={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},Nv={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},zv={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},jv={top:"t",right:"r",bottom:"b",left:"l"};function Vv(e){this._elementRegistry=e}function Fv(e,t){return vr(t,"bpmn:Participant")?"source":vr(e,"bpmn:Participant")?"target":Qv(t)?"source":Qv(e)||vr(t,"bpmn:Event")?"target":vr(e,"bpmn:Event")?"source":null}function qv(e){return Qv(e)?"target":"source"}function Hv(e,t){return e?e.original||e:fn(t)}function Wv(e,t){return vr(t,"bpmn:Activity")&&vr(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function Qv(e){return vr(e,"bpmn:SubProcess")&&Nr(e)}function Xv(e,t){return e===t}function Gv(e){var t=/right|left/.exec(e);return t&&t[0]}function Uv(e){var t=/top|bottom/.exec(e);return t&&t[0]}function Yv(e,t){return zv[e]===t}function Kv(e){return"right"===e||"left"===e}function Zv(e,t,n){var i=t.waypoints,r=i&&i.length&&mn(i[0],e);return"top"===r?n.loop.fromTop:"right"===r?n.loop.fromRight:"left"===r?n.loop.fromLeft:n.loop.fromBottom}function Jv(e,t,n,i){var r,o,s,a,l=fn(e),c=fn(t),u=(a=(s=e).host,mn(fn(s),a,-10)),p=Xv(e.host,t),h=-1!==["top","right","bottom","left"].indexOf(u),d=mn(c,l,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return p?function(e,t,n,i,r,o){var s,a=t?e:o.isHorizontal?Uv(e):Gv(e),l=jv[a];s=t?Kv(e)?ey("y",n,i,r)?"h":o.boundaryLoop.alternateHorizontalSide:ey("x",n,i,r)?"v":o.boundaryLoop.alternateVerticalSide:o.boundaryLoop.default;return[l+":"+s]}(u,h,e,t,n,i):(r=function(e,t,n,i){if(n)return jv[e];var r=Uv(e),o=Gv(e),s=Uv(t),a=Gv(t);if(i){if(Xv(r,s)||Yv(o,a))return jv[r]}else if(Xv(o,a)||Yv(r,s))return jv[o];return jv[i?o:r]}(u,d,h,i.isHorizontal),o=function(e,t,n,i){if(n)return Kv(e)?function(e,t){var n=Gv(e),i=zv[n];return-1!==t.indexOf(i)}(e,t)||Xv(e,t)?"h":"v":function(e,t){var n=Uv(e),i=zv[n];return-1!==t.indexOf(i)}(e,t)||Xv(e,t)?"v":"h";var r=Uv(e),o=Gv(e),s=Uv(t),a=Gv(t);if(s&&!a)return"v";if(a&&!s)return"h";return i?Xv(r,s)?"h":"v":Xv(o,a)?"v":"h"}(u,d,h,i.isHorizontal),[r+":"+o])}function ey(e,t,n,i){return!(ty(e,i,n,40)||ty(e,i,{x:n.x+n.width,y:n.y+n.height},40)||ty(e,i,fn(t),40))}function ty(e,t,n,i){return Math.abs(t[e]-n[e])<i}function ny(e){return q({original:e.point.original||e.point},e.actual)}function iy(e,t){this._elementRegistry=e,this._graphicsFactory=t}e(Vv,Sv),Vv.prototype.layoutConnection=function(e,t){t||(t={});var n,i,r=t.source||e.source,o=t.target||e.target,s=t.waypoints||e.waypoints,a=t.connectionStart,l=t.connectionEnd,c=this._elementRegistry;if(a||(a=Hv(s&&s[0],r)),l||(l=Hv(s&&s[s.length-1],o)),(vr(e,"bpmn:Association")||vr(e,"bpmn:DataAssociation"))&&s&&!Wv(r,o))return[].concat([a],s.slice(1,-1),[l]);var u=Bc(r,c)?Iv:Nv;return vr(e,"bpmn:MessageFlow")?n=function(e,t,n){return{preferredLayouts:n.messageFlow,preserveDocking:Fv(e,t)}}(r,o,u):(vr(e,"bpmn:SequenceFlow")||Wv(r,o))&&(n=r===o?{preferredLayouts:Zv(r,e,u)}:vr(r,"bpmn:BoundaryEvent")?{preferredLayouts:Jv(r,o,l,u)}:Qv(r)||Qv(o)?{preferredLayouts:u.subProcess,preserveDocking:qv(r)}:vr(r,"bpmn:Gateway")?{preferredLayouts:u.fromGateway}:vr(o,"bpmn:Gateway")?{preferredLayouts:u.toGateway}:{preferredLayouts:u.default}),n&&(i=Lv(Rv(r,o,a,l,s,n=q(n,t)))),i||[a,l]},Vv.$inject=["elementRegistry"],iy.$inject=["elementRegistry","graphicsFactory"],iy.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(ny(i)),o.push(ny(r)),o},iy.prototype.getDockingPoint=function(e,t,n){var i,r,o=e.waypoints;return{point:r=o[i=n?0:o.length-1],actual:this._getIntersection(t,e,n)||r,idx:i}},iy.prototype._getIntersection=function(e,t,n){return gn(this._getShapePath(e),this._getConnectionPath(t),n)},iy.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},iy.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},iy.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};var ry={__init__:["modeling","bpmnUpdater"],__depends__:[Yd,$f,Bf,Nf,ym,Nm,Fm,Qm,As,jo,Lm],bpmnFactory:["type",Xm],bpmnUpdater:["type",Gm],elementFactory:["type",pg],modeling:["type",Ev],layouter:["type",Vv],connectionDocking:["type",iy]};const oy=Math.round;function sy(e,t,n,i,r,o){this._complexPreview=e,this._connectionDocking=t,this._elementFactory=n,this._eventBus=i,this._layouter=r,this._rules=o}sy.prototype.create=function(e,t,n){const i=this._complexPreview,r=this._connectionDocking,o=this._elementFactory,s=this._eventBus,a=this._layouter,l=this._rules,c=o.createShape(q({type:t},n)),u=s.fire("autoPlace",{source:e,shape:c});if(!u)return;q(c,{x:u.x-oy(c.width/2),y:u.y-oy(c.height/2)});const p=l.allowed("connection.create",{source:e,target:c,hints:{targetParent:e.parent}});let d=null;p&&(d=o.createConnection(p),d.waypoints=a.layoutConnection(d,{source:e,target:c}),d.waypoints=r.getCroppedWaypoints(d,e,c)),i.create({created:[c,d].filter(e=>!h(e))})},sy.prototype.cleanUp=function(){this._complexPreview.cleanUp()},sy.$inject=["complexPreview","connectionDocking","elementFactory","eventBus","layouter","rules"];var ay={__depends__:[zc,dp,ry],__init__:["appendPreview"],appendPreview:["type",sy]},ly=Math.min,cy=Math.max;function uy(e){e.preventDefault()}function py(e){e.stopPropagation()}function hy(e){this.container=e.container,this.parent=Y('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=de("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.focusoutHandler=e.focusoutHandler||function(){},this.autoResize=F(this.autoResize,this),this.handlePaste=F(this.handlePaste,this)}function dy(e,t){this._eventBus=e,this._canvas=t,this._providers=[],this._active=null,this._textbox=new hy({container:t.getContainer(),keyHandler:F(this._handleKey,this),resizeHandler:F(this._handleResize,this),focusoutHandler:F(this._handleFocusout,this)}),e.on(["diagram.clear","diagram.destroy"],()=>this._cleanup())}hy.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,s=this.container;i=this.options=i||{};var a=Q(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);q(r.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"},a);var l=Q(t,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return q(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&q(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),o.innerText=n,ce.bind(o,"keydown",this.keyHandler),ce.bind(o,"mousedown",py),ce.bind(o,"paste",this.handlePaste),ce.bind(o,"focusout",this.focusoutHandler),i.autoResize&&ce.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),s.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},hy.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},hy.prototype.insertText=function(e){e=function(e){return e.replace(/\r\n|\r|\n/g,"\n")}(e),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},hy.prototype._insertTextIE=function(e){var t,n,i,r=this.getSelection(),o=r.startContainer,s=r.endContainer,a=r.startOffset,l=r.endOffset,c=r.commonAncestorContainer,u=(t=c.childNodes,[].slice.call(t));if(function(e){return e.nodeType===Node.TEXT_NODE}(c)){var p=o.textContent;o.textContent=p.substring(0,a)+e+p.substring(l),n=o,i=a+e.length}else if(o===this.content&&s===this.content){var h=document.createTextNode(e);this.content.insertBefore(h,u[a]),n=h,i=h.textContent.length}else{var d=u.indexOf(o),f=u.indexOf(s);u.forEach(function(t,n){n===d?t.textContent=o.textContent.substring(0,a)+e+s.textContent.substring(l):n>d&&n<=f&&me(t)}),n=o,i=a+e.length}n&&void 0!==i&&setTimeout(function(){self.setSelection(n,i)})},hy.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})}},hy.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,s=parseInt(this.style.maxHeight)||1/0;if(!n){var a,l,c,u;n=this.resizeHandle=Y('<div class="djs-direct-editing-resize-handle"></div>');var p=function(n){uy(n),py(n);var p=ly(cy(c+n.clientX-a,i),o),h=ly(cy(u+n.clientY-l,r),s);t.style.width=p+"px",t.style.height=h+"px",e.resizeHandler({width:c,height:u,dx:n.clientX-a,dy:n.clientY-l})},h=function(e){uy(e),py(e),ce.unbind(document,"mousemove",p,!1),ce.unbind(document,"mouseup",h,!1)};ce.bind(n,"mousedown",function(e){uy(e),py(e),a=e.clientX,l=e.clientY;var n=t.getBoundingClientRect();c=n.width,u=n.height,ce.bind(document,"mousemove",p),ce.bind(document,"mouseup",h)})}q(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)},hy.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),ce.unbind(t,"keydown",this.keyHandler),ce.unbind(t,"mousedown",py),ce.unbind(t,"input",this.autoResize),ce.unbind(t,"paste",this.handlePaste),ce.unbind(t,"focusout",this.focusoutHandler),n&&(n.removeAttribute("style"),me(n)),me(e)},hy.prototype.getValue=function(){return this.content.innerText.trim()},hy.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},hy.prototype.setSelection=function(e,t){var n=document.createRange();null===e?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},dy.$inject=["eventBus","canvas"],dy.prototype.registerProvider=function(e){this._providers.push(e)},dy.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},dy.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},dy.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{active:this._active})},dy.prototype.close=function(){this._fire("deactivate"),this._cleanup(),this._canvas.restoreFocus&&this._canvas.restoreFocus()},dy.prototype._cleanup=function(){this._active&&(this._textbox.destroy(),this._active=null,this.resizable=void 0)},dy.prototype.complete=function(){var e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===e.context.text&&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()}},dy.prototype.getValue=function(){return this._textbox.getValue()},dy.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return 27===t?(e.preventDefault(),this.cancel()):13!==t||e.shiftKey?void 0:(e.preventDefault(),this.complete())},dy.prototype._handleResize=function(e){this._fire("resize",e)},dy.prototype._handleFocusout=function(e){e.relatedTarget&&this._textbox.parent.contains(e.relatedTarget)||this.complete()},dy.prototype.activate=function(e){if(this.isActive()&&this.cancel(),!1===this._eventBus.fire("directEditing.activate.allowed",{element:e}))return!1;var t,n=w(this._providers,function(n){return(t=n.activate(e))?n: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};var fy={__depends__:[_s],__init__:["directEditing"],directEditing:["type",dy]};const my={task:{label:"Task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},"user-task":{label:"User task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},"service-task":{label:"Service task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},"send-task":{label:"Send task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},"receive-task":{label:"Receive task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},"manual-task":{label:"Manual task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},"rule-task":{label:"Business rule task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},"script-task":{label:"Script task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},"call-activity":{label:"Call activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},transaction:{label:"Transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},"event-subprocess":{label:"Event sub-process",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},"collapsed-subprocess":{label:"Sub-process (collapsed)",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},"expanded-subprocess":{label:"Sub-process (expanded)",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},"collapsed-ad-hoc-subprocess":{label:"Ad-hoc sub-process (collapsed)",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:AdHocSubProcess",isExpanded:!1}},"expanded-ad-hoc-subprocess":{label:"Ad-hoc sub-process (expanded)",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:AdHocSubProcess",isExpanded:!0}},"exclusive-gateway":{label:"Exclusive gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},"parallel-gateway":{label:"Parallel gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},"inclusive-gateway":{label:"Inclusive gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},"complex-gateway":{label:"Complex gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},"event-based-gateway":{label:"Event-based gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}},"data-store-reference":{label:"Data store reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}},"data-object-reference":{label:"Data object reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}},"expanded-pool":{label:"Expanded pool/participant",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},"collapsed-pool":{label:"Empty pool/participant",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}},"none-start-event":{label:"Start event",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},"none-intermediate-throwing":{label:"Intermediate throw event",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},"none-boundary-event":{label:"Boundary event",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:BoundaryEvent"}},"none-end-event":{label:"End event",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},"message-start":{label:"Message start event",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!0}},"timer-start":{label:"Timer start event",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!0}},"conditional-start":{label:"Conditional start event",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!0}},"signal-start":{label:"Signal start event",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!0}},"error-start":{label:"Error start event",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",isInterrupting:!0}},"escalation-start":{label:"Escalation start event",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!0}},"compensation-start":{label:"Compensation start event",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",isInterrupting:!0}},"non-interrupting-message-start":{label:"Message start event (non-interrupting)",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},"non-interrupting-timer-start":{label:"Timer start event (non-interrupting)",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},"non-interrupting-conditional-start":{label:"Conditional start event (non-interrupting)",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},"non-interrupting-signal-start":{label:"Signal start event (non-interrupting)",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},"non-interrupting-escalation-start":{label:"Escalation start event (non-interrupting)",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}},"message-intermediate-catch":{label:"Message intermediate catch event",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},"message-intermediate-throw":{label:"Message intermediate throw event",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},"timer-intermediate-catch":{label:"Timer intermediate catch event",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},"escalation-intermediate-throw":{label:"Escalation intermediate throw event",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},"conditional-intermediate-catch":{label:"Conditional intermediate catch event",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},"link-intermediate-catch":{label:"Link intermediate catch event",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},"link-intermediate-throw":{label:"Link intermediate throw event",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},"compensation-intermediate-throw":{label:"Compensation intermediate throw event",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},"signal-intermediate-catch":{label:"Signal intermediate catch event",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},"signal-intermediate-throw":{label:"Signal intermediate throw event",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},"message-boundary":{label:"Message boundary event",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!0}},"timer-boundary":{label:"Timer boundary event",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!0}},"escalation-boundary":{label:"Escalation boundary event",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!0}},"conditional-boundary":{label:"Conditional boundary event",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!0}},"error-boundary":{label:"Error boundary event",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition",cancelActivity:!0}},"cancel-boundary":{label:"Cancel boundary event",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition",cancelActivity:!0}},"signal-boundary":{label:"Signal boundary event",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!0}},"compensation-boundary":{label:"Compensation boundary event",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition",cancelActivity:!0}},"non-interrupting-message-boundary":{label:"Message boundary event (non-interrupting)",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},"non-interrupting-timer-boundary":{label:"Timer boundary event (non-interrupting)",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},"non-interrupting-escalation-boundary":{label:"Escalation boundary event (non-interrupting)",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},"non-interrupting-conditional-boundary":{label:"Conditional boundary event (non-interrupting)",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},"non-interrupting-signal-boundary":{label:"Signal boundary event (non-interrupting)",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}},"message-end":{label:"Message end event",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},"escalation-end":{label:"Escalation end event",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},"error-end":{label:"Error end event",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},"cancel-end":{label:"Cancel end event",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},"compensation-end":{label:"Compensation end event",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},"signal-end":{label:"Signal end event",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},"terminate-end":{label:"Terminate end event",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}};function gy(e,t={}){var n=my[e];if(!n)throw new Error("unknown popup entry <"+e+">");return{...n,actionName:"replace-with-"+e,...t}}var vy=[gy("none-start-event",{actionName:"replace-with-none-start"}),gy("none-intermediate-throwing"),gy("none-end-event",{actionName:"replace-with-none-end"}),gy("message-start"),gy("timer-start"),gy("conditional-start"),gy("signal-start")],yy=[gy("none-start-event",{actionName:"replace-with-none-start"}),gy("none-intermediate-throwing"),gy("none-end-event",{actionName:"replace-with-none-end"})],by=[gy("none-start-event",{actionName:"replace-with-none-start"}),gy("none-intermediate-throwing",{actionName:"replace-with-none-intermediate-throw"}),gy("none-end-event",{actionName:"replace-with-none-end"}),gy("message-intermediate-catch"),gy("message-intermediate-throw"),gy("timer-intermediate-catch"),gy("escalation-intermediate-throw"),gy("conditional-intermediate-catch"),gy("link-intermediate-catch"),gy("link-intermediate-throw"),gy("compensation-intermediate-throw"),gy("signal-intermediate-catch"),gy("signal-intermediate-throw")],wy=[gy("none-start-event",{actionName:"replace-with-none-start"}),gy("none-intermediate-throwing",{actionName:"replace-with-none-intermediate-throw"}),gy("none-end-event",{actionName:"replace-with-none-end"}),gy("message-end"),gy("escalation-end"),gy("error-end"),gy("cancel-end"),gy("compensation-end"),gy("signal-end"),gy("terminate-end")],xy=[gy("exclusive-gateway"),gy("parallel-gateway"),gy("inclusive-gateway"),gy("complex-gateway"),gy("event-based-gateway")],_y=[gy("transaction"),gy("event-subprocess"),gy("expanded-ad-hoc-subprocess",{actionName:"replace-with-ad-hoc-subprocess",label:"Ad-hoc sub-process"}),gy("collapsed-subprocess")],Ey=[gy("expanded-subprocess",{actionName:"replace-with-subprocess",label:"Sub-process"}),gy("transaction"),gy("event-subprocess"),gy("collapsed-ad-hoc-subprocess")],Sy=[gy("transaction"),gy("expanded-subprocess",{actionName:"replace-with-subprocess",label:"Sub-process"}),gy("expanded-ad-hoc-subprocess",{actionName:"replace-with-ad-hoc-subprocess",label:"Ad-hoc sub-process"}),gy("event-subprocess")],ky=Sy,Oy=[gy("task"),gy("user-task"),gy("service-task"),gy("send-task"),gy("receive-task"),gy("manual-task"),gy("rule-task"),gy("script-task"),gy("call-activity"),gy("collapsed-subprocess"),gy("expanded-subprocess"),gy("collapsed-ad-hoc-subprocess"),gy("expanded-ad-hoc-subprocess",{actionName:"replace-with-ad-hoc-subprocess"})],Cy=[gy("data-store-reference")],Py=[gy("data-object-reference")],Ay=[gy("message-boundary"),gy("timer-boundary"),gy("escalation-boundary"),gy("conditional-boundary"),gy("error-boundary"),gy("cancel-boundary"),gy("signal-boundary"),gy("compensation-boundary"),gy("non-interrupting-message-boundary"),gy("non-interrupting-timer-boundary"),gy("non-interrupting-escalation-boundary"),gy("non-interrupting-conditional-boundary"),gy("non-interrupting-signal-boundary")],Ty=[gy("message-start"),gy("timer-start"),gy("conditional-start"),gy("signal-start"),gy("error-start"),gy("escalation-start"),gy("compensation-start"),gy("non-interrupting-message-start"),gy("non-interrupting-timer-start"),gy("non-interrupting-conditional-start"),gy("non-interrupting-signal-start"),gy("non-interrupting-escalation-start")],Ry=[{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"}],My=[gy("expanded-pool"),gy("collapsed-pool",{label:function(e){var t="Empty pool/participant";return e.children&&e.children.length&&(t+=" (removes content)"),t}})],$y={"bpmn:MessageEventDefinition":[gy("message-start"),gy("message-intermediate-catch"),gy("message-intermediate-throw"),gy("message-end")],"bpmn:TimerEventDefinition":[gy("timer-start"),gy("timer-intermediate-catch")],"bpmn:ConditionalEventDefinition":[gy("conditional-start"),gy("conditional-intermediate-catch")],"bpmn:SignalEventDefinition":[gy("signal-start"),gy("signal-intermediate-catch"),gy("signal-intermediate-throw"),gy("signal-end")],"bpmn:ErrorEventDefinition":[gy("error-start"),gy("error-end")],"bpmn:EscalationEventDefinition":[gy("escalation-start"),gy("escalation-intermediate-throw"),gy("escalation-end")],"bpmn:CompensateEventDefinition":[gy("compensation-start"),gy("compensation-intermediate-throw"),gy("compensation-end")]},Dy={"start-event-non-interrupting":'\n <svg viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg">\n <g transform="translate(0 995.64)">\n <path d="m1899 28.357c21.545 567.43-598.38 1023.5-1133.6 835.92-548.09-147.21-801.57-873.95-463.59-1330 302.62-480.3 1071.7-507.54 1407.6-49.847 122.14 153.12 190.07 348.07 189.59 543.91z" fill="none" stroke="currentColor" stroke-dasharray="418.310422, 361.2328165" stroke-linecap="round" stroke-width="100"/>\n </g>\n </svg>',"intermediate-event-non-interrupting":'\n <svg viewBox="0 0 2048 2048" xmlns="http://www.w3.org/2000/svg">\n <g transform="translate(0 995.64)" fill="none" stroke="currentColor" stroke-linecap="round">\n <circle cx="1024" cy="28.357" r="875" stroke-dasharray="418.310422, 361.2328165" stroke-width="100"/>\n <circle cx="1024" cy="28.357" r="685" stroke-dasharray="348.31044857,261.23283643" stroke-dashoffset="500" stroke-width="100"/>\n </g>\n </svg>'};function By(e,t,n,i,r,o,s,a){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=s,this._moddleCopy=a,this._register()}By.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate","moddleCopy"],By.prototype._register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},By.prototype.getPopupMenuEntries=function(e){var t,n=e.businessObject,i=this._rules,r=[],o=[];if(d(e)||!i.allowed("shape.replace",{element:e}))return{};var s,a=(s=e,function(e){var t=e.target,n=br(s),i=n.eventDefinitions&&n.eventDefinitions[0],r=n.$type===t.type,o=(i&&i.$type)===t.eventDefinitionType,a=!!t.triggeredByEvent==!!n.triggeredByEvent,l=void 0===t.isExpanded||t.isExpanded===Nr(s);return!(r&&o&&a&&l)});return vr(n,"bpmn:DataObjectReference")?this._createEntries(e,Cy):vr(n,"bpmn:DataStoreReference")&&!vr(e.parent,"bpmn:Collaboration")?this._createEntries(e,Py):(vr(n,"bpmn:Event")&&!vr(n,"bpmn:BoundaryEvent")&&(t=n.get("eventDefinitions")[0]?.$type,r=$y[t]||[],!Vr(n.$parent)&&vr(n.$parent,"bpmn:SubProcess")&&(r=_(r,function(e){return"bpmn:StartEvent"!==e.target.type}))),vr(n,"bpmn:StartEvent")&&!vr(n.$parent,"bpmn:SubProcess")?(o=_(vy.concat(r),a),this._createEntries(e,o)):vr(n,"bpmn:Participant")?(o=_(My,function(t){return Nr(e)!==t.target.isExpanded}),this._createEntries(e,o)):vr(n,"bpmn:StartEvent")&&Vr(n.$parent)?(o=_(Ty.concat(r),function(e){var t=!1!==e.target.isInterrupting,i=n.isInterrupting===t;return a(e)||!a(e)&&!i}),this._createEntries(e,o)):vr(n,"bpmn:StartEvent")&&!Vr(n.$parent)&&vr(n.$parent,"bpmn:SubProcess")?(o=_(yy.concat(r),a),this._createEntries(e,o)):vr(n,"bpmn:EndEvent")?(o=_(wy.concat(r),function(e){return!("bpmn:CancelEventDefinition"==e.target.eventDefinitionType&&!vr(n.$parent,"bpmn:Transaction"))&&a(e)}),this._createEntries(e,o)):vr(n,"bpmn:BoundaryEvent")?(o=_(Ay,function(e){var t=e.target;if("bpmn:CancelEventDefinition"==t.eventDefinitionType&&!vr(n.attachedToRef,"bpmn:Transaction"))return!1;var i=!1!==t.cancelActivity,r=n.cancelActivity==i;return a(e)||!a(e)&&!r}),this._createEntries(e,o)):vr(n,"bpmn:IntermediateCatchEvent")||vr(n,"bpmn:IntermediateThrowEvent")?(o=_(by.concat(r),a),this._createEntries(e,o)):vr(n,"bpmn:Gateway")?(o=_(xy,a),this._createEntries(e,o)):vr(n,"bpmn:Transaction")?(o=_(Sy,a),this._createEntries(e,o)):Vr(n)&&Nr(e)?(o=_(ky,a),this._createEntries(e,o)):vr(n,"bpmn:AdHocSubProcess")&&Nr(e)?(o=_(Ey,a),this._createEntries(e,o)):vr(n,"bpmn:SubProcess")&&Nr(e)?(o=_(_y,a),this._createEntries(e,o)):vr(n,"bpmn:SubProcess")&&!Nr(e)?(o=_(Oy,function(t){return t.target.type===e.type===(!0===t.target.isExpanded)}),this._createEntries(e,o)):vr(n,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,Ry):vr(n,"bpmn:FlowNode")?(o=_(Oy,a),this._createEntries(e,o)):{})},By.prototype.getPopupMenuHeaderEntries=function(e){var t={};return vr(e,"bpmn:Activity")&&!Vr(e)&&(t={...t,...this._getLoopCharacteristicsHeaderEntries(e)}),vr(e,"bpmn:DataObjectReference")&&(t={...t,...this._getCollectionHeaderEntries(e)}),vr(e,"bpmn:Participant")&&(t={...t,...this._getParticipantMultiplicityHeaderEntries(e)}),Kh(e)&&(t={...t,...this._getNonInterruptingHeaderEntries(e)}),t},By.prototype._createEntries=function(e,t){var n={},i=this;return E(t,function(t){n[t.actionName]=i._createEntry(t,e)}),n},By.prototype._createSequenceFlowEntries=function(e,t){var n=br(e),i={},r=this._modeling,o=this._moddle,s=this;return E(t,function(t){switch(t.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(vr(n.sourceRef,"bpmn:ExclusiveGateway")||vr(n.sourceRef,"bpmn:InclusiveGateway")||vr(n.sourceRef,"bpmn:ComplexGateway")||vr(n.sourceRef,"bpmn:Activity"))&&(i={...i,[t.actionName]:s._createEntry(t,e,function(){r.updateProperties(e.source,{default:n})})});break;case"replace-with-conditional-flow":!n.conditionExpression&&vr(n.sourceRef,"bpmn:Activity")&&(i={...i,[t.actionName]:s._createEntry(t,e,function(){var t=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:t})})});break;default:vr(n.sourceRef,"bpmn:Activity")&&n.conditionExpression&&(i={...i,[t.actionName]:s._createEntry(t,e,function(){r.updateProperties(e,{conditionExpression:void 0})})}),(vr(n.sourceRef,"bpmn:ExclusiveGateway")||vr(n.sourceRef,"bpmn:InclusiveGateway")||vr(n.sourceRef,"bpmn:ComplexGateway")||vr(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n&&(i={...i,[t.actionName]:s._createEntry(t,e,function(){r.updateProperties(e.source,{default:void 0})})})}}),i},By.prototype._createEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=e.label;return o&&"function"==typeof o&&(o=o(t)),n=n||function(){return r(t,e.target)},{label:i(o),className:e.className,action:n}},By.prototype._getLoopCharacteristicsHeaderEntries=function(e){var t=this,n=this._translate;function i(n,i){if(i.active)t._modeling.updateProperties(e,{loopCharacteristics:void 0});else{var r=e.businessObject.get("loopCharacteristics");r&&vr(r,i.options.loopCharacteristics)?t._modeling.updateModdleProperties(e,r,{isSequential:i.options.isSequential}):(r=t._moddle.create(i.options.loopCharacteristics,{isSequential:i.options.isSequential}),t._modeling.updateProperties(e,{loopCharacteristics:r}))}}var r,o,s,a=br(e).loopCharacteristics;return a&&(r=a.isSequential,o=void 0===a.isSequential,s=void 0!==a.isSequential&&!a.isSequential),{"toggle-parallel-mi":{className:"bpmn-icon-parallel-mi-marker",title:n("Parallel multi-instance"),active:s,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},"toggle-sequential-mi":{className:"bpmn-icon-sequential-mi-marker",title:n("Sequential multi-instance"),active:r,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},"toggle-loop":{className:"bpmn-icon-loop-marker",title:n("Loop"),active:o,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}}},By.prototype._getCollectionHeaderEntries=function(e){var t=this,n=this._translate,i=e.businessObject.dataObjectRef;if(!i)return{};var r=i.isCollection;return{"toggle-is-collection":{className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:r,action:function(n,r){t._modeling.updateModdleProperties(e,i,{isCollection:!r.active})}}}},By.prototype._getParticipantMultiplicityHeaderEntries=function(e){var t=this,n=this._bpmnFactory,i=this._translate;var r=e.businessObject.participantMultiplicity;return{"toggle-participant-multiplicity":{className:"bpmn-icon-parallel-mi-marker",title:i("Participant multiplicity"),active:!!r,action:function(i,r){var o;r.active||(o=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:o})}}}},By.prototype._getNonInterruptingHeaderEntries=function(e){const t=this._translate,n=br(e),i=this,r=Zh(e),o=vr(e,"bpmn:BoundaryEvent")?Dy["intermediate-event-non-interrupting"]:Dy["start-event-non-interrupting"],s=!n[r];return{"toggle-non-interrupting":{imageHtml:o,title:t("Toggle non-interrupting"),active:s,action:function(){i._modeling.updateProperties(e,{[r]:!!s})}}}};var Ly={__depends__:[yc,ym,zc],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",By]};function Iy(e,t,n,i,r,o,s,a,l,c,u,p,h){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=s,this._create=a,this._popupMenu=l,this._canvas=c,this._rules=u,this._translate=p,this._eventBus=n,this._appendPreview=h,!1!==e.autoPlace&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(e){var t=e.context.shape;if(vs(e)&&i.isOpen(t)){var n=i.getEntries(t);n.replace&&n.replace.action.click(e,t)}}),n.on("contextPad.close",function(){h.cleanUp()})}function Ny(e,t,n){var i=e.$instanceOf(t),r=!1;return E(e.eventDefinitions||[],function(e){e.$type===n&&(r=!0)}),i&&r}Iy.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","appendPreview"],Iy.prototype.getMultiElementContextPadEntries=function(e){var t=this._modeling,n={};return this._isDeleteAllowed(e)&&q(n,{delete:{group:"edit",className:"bpmn-icon-trash",title:this._translate("Delete"),action:{click:function(e,n){t.removeElements(n.slice())}}}}),n},Iy.prototype._isDeleteAllowed=function(e){var t=this._rules.allowed("elements.delete",{elements:e});return d(t)?O(e,e=>t.includes(e)):t},Iy.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,s=this._popupMenu,a=this._autoPlace,l=this._translate,c=this._appendPreview,u={};if("label"===e.type)return this._isDeleteAllowed([e])&&q(u,f()),u;var p=e.businessObject;function h(e,t){r.start(e,t)}function d(e,t){n.removeElements([t])}function f(){return{delete:{group:"edit",className:"bpmn-icon-trash",title:l("Delete"),action:{click:d}}}}function m(e,t,n,r){function s(t,n){var s=i.createShape(q({type:e},r));o.start(t,s,{source:n})}var l=a?function(t,n){var o=i.createShape(q({type:e},r));a.append(n,o)}:s,u=a?function(t,n){return c.create(n,e,r),()=>{c.cleanUp()}}:null;return{group:"model",className:t,title:n,action:{dragstart:s,click:l,hover:u}}}function g(e){return function(i,r){n.splitLane(r,e),t.open(r,!0)}}if(yr(p,["bpmn:Lane","bpmn:Participant"])&&Nr(e)){var v=eh(e);q(u,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:l("Add lane above"),action:{click:function(e,t){n.addLane(t,"top")}}}}),v.length<2&&((zr(e)?e.height>=120:e.width>=120)&&q(u,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:l("Divide into two lanes"),action:{click:g(2)}}}),(zr(e)?e.height>=180:e.width>=180)&&q(u,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:l("Divide into three lanes"),action:{click:g(3)}}})),q(u,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:l("Add lane below"),action:{click:function(e,t){n.addLane(t,"bottom")}}}})}return vr(p,"bpmn:FlowNode")&&(vr(p,"bpmn:EventBasedGateway")?q(u,{"append.receive-task":m("bpmn:ReceiveTask","bpmn-icon-receive-task",l("Append receive task")),"append.message-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",l("Append message intermediate catch event"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",l("Append timer intermediate catch event"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",l("Append conditional intermediate catch event"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":m("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",l("Append signal intermediate catch event"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):Ny(p,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?q(u,{"append.compensation-activity":m("bpmn:Task","bpmn-icon-task",l("Append compensation activity"),{isForCompensation:!0})}):vr(p,"bpmn:EndEvent")||p.isForCompensation||Ny(p,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Vr(p)||q(u,{"append.end-event":m("bpmn:EndEvent","bpmn-icon-end-event-none",l("Append end event")),"append.gateway":m("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",l("Append gateway")),"append.append-task":m("bpmn:Task","bpmn-icon-task",l("Append task")),"append.intermediate-event":m("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",l("Append intermediate/boundary event"))})),s.isEmpty(e,"bpmn-replace")||q(u,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:l("Change element"),action:{click:function(e,n){var i=q(function(e){var n=t.getPad(e).html.getBoundingClientRect();return{x:n.left,y:n.bottom+5}}(n),{cursor:{x:e.x,y:e.y}});s.open(n,"bpmn-replace",i,{title:l("Change element"),width:"var(--bpmn-replace-popup-width, 300px)",search:!0})}}}}),vr(p,"bpmn:SequenceFlow")&&q(u,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",l("Add text annotation"))}),vr(p,"bpmn:MessageFlow")&&q(u,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",l("Add text annotation"))}),yr(p,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&q(u,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",l("Add text annotation")),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:l("Connect to other element"),action:{click:h,dragstart:h}}}),vr(p,"bpmn:TextAnnotation")&&q(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:l("Connect using association"),action:{click:h,dragstart:h}}}),yr(p,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&q(u,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:l("Connect using data input association"),action:{click:h,dragstart:h}}}),vr(p,"bpmn:Group")&&q(u,{"append.text-annotation":m("bpmn:TextAnnotation","bpmn-icon-text-annotation",l("Add text annotation"))}),this._isDeleteAllowed([e])&&q(u,f()),u};var zy={__depends__:[ay,fy,ja,As,ip,Yf,Ly],__init__:["contextPadProvider"],contextPadProvider:["type",Iy]},jy={horizontal:["x","width"],vertical:["y","height"]};function Vy(e,t){this._modeling=e,this._filters=[],this.registerFilter(function(e){var n=t.allowed("elements.distribute",{elements:e});return d(n)?n:n?e:[]})}Vy.$inject=["modeling","rules"],Vy.prototype.registerFilter=function(e){if("function"!=typeof e)throw new Error("the filter has to be a function");this._filters.push(e)},Vy.prototype.trigger=function(e,t){var n,i,r=this._modeling;if(!(e.length<3||(this._setOrientation(t),i=this._filterElements(e),(n=this._createGroups(i)).length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},Vy.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(E(t,function(e){r=e(r,n,i)}),r):e},Vy.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"');return E(B(e,i),function(e,o){var s,a=n._findRange(e,i,r),l=t[t.length-1];l&&n._hasIntersection(l.range,a)?t[t.length-1].elements.push(e):(s={range:a,elements:[e]},t.push(s))}),t},Vy.prototype._setOrientation=function(e){var t=jy[e];this._axis=t[0],this._dimension=t[1]},Vy.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)},Vy.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};var Fy={__init__:["distributeElements"],distributeElements:["type",Vy]};function qy(e){Ec.call(this,e)}qy.$inject=["eventBus"],e(qy,Ec),qy.prototype.init=function(){this.addRule("elements.distribute",function(e){var t=e.elements;return!((t=at(t=_(t,function(e){var t=yr(e,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(e.labelTarget||t)}))).length<3)&&t})};var Hy={horizontal:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <polyline points="450 400 450 150 1350 150 1350 400" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>\n <rect x="150" y="450" width="600" height="1200" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="1050" y="450" width="600" height="800" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>',vertical:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1800 1800">\n <polyline points="400 1350 150 1350 150 450 400 450" style="fill:none;stroke:currentColor;stroke-width:100;stroke-linejoin:round;"/>\n <rect x="450" y="150" width="1200" height="600" rx="1" style="fill:none;stroke:currentColor;stroke-width:100;"></rect>\n <rect x="450" y="1050" width="800" height="600" rx="1" style="fill:currentColor;stroke:currentColor;stroke-width:100;opacity:.5;"></rect>\n </svg>'};function Wy(e,t,n,i){this._distributeElements=t,this._translate=n,this._popupMenu=e,this._rules=i,e.registerProvider("align-elements",900,this)}Wy.$inject=["popupMenu","distributeElements","translate","rules"],Wy.prototype.getPopupMenuEntries=function(e){var t={};return this._isAllowed(e)&&q(t,this._getEntries(e)),t},Wy.prototype._isAllowed=function(e){return this._rules.allowed("elements.distribute",{elements:e})},Wy.prototype._getEntries=function(e){var t=this._distributeElements,n=this._translate,i=this._popupMenu;return{"distribute-elements-horizontal":{group:"distribute",title:n("Distribute elements horizontally"),className:"bjs-align-elements-menu-entry",imageHtml:Hy.horizontal,action:function(n,r){t.trigger(e,"horizontal"),i.close()}},"distribute-elements-vertical":{group:"distribute",title:n("Distribute elements vertically"),imageHtml:Hy.vertical,action:function(n,r){t.trigger(e,"vertical"),i.close()}}}};var Qy={__depends__:[yc,Fy],__init__:["bpmnDistributeElements","distributeElementsMenuProvider"],bpmnDistributeElements:["type",qy],distributeElementsMenuProvider:["type",Wy]},Xy="is not a registered action";function Gy(e,t){this._eventBus=e,this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}function Uy(e,t){return new Error(e+" "+t)}Gy.$inject=["eventBus","injector"],Gy.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),s=e.get("canvas",!1),a=e.get("rules",!1),l=e.get("keyboardMove",!1),c=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.redo()})),o&&i&&this.register("copy",function(){var e=i.get();if(e.length)return o.copy(e)}),o&&i&&this.register("duplicate",function(){var e=i.get();if(e.length)return o.duplicate(e)}),o&&this.register("paste",function(){o.paste()}),o&&i&&a&&this.register("cut",function(){var e=i.get();if(e.length){var t=a.allowed("elements.delete",{elements:e});if(!1!==t){var n=d(t)?t:e;return o.cut(n.slice())}}}),r&&this.register("stepZoom",function(e){r.stepZoom(e.value)}),s&&this.register("zoom",function(e){s.zoom(e.value)}),n&&i&&a&&this.register("removeSelection",function(){var e=i.get();if(e.length){var t,r=a.allowed("elements.delete",{elements:e});!1!==r&&(t=d(r)?r:e).length&&n.removeElements(t.slice())}}),l&&this.register("moveCanvas",function(e){l.moveCanvas(e)}),c&&this.register("moveSelection",function(e){c.moveSelection(e.direction,e.accelerated)})},Gy.prototype.trigger=function(e,t){if(!this._actions[e])throw Uy(e,Xy);if(!1!==this._eventBus.fire("editorActions.allowed",{action:e,opts:t}))return this._actions[e](t)},Gy.prototype.register=function(e,t){var n=this;if("string"==typeof e)return this._registerAction(e,t);E(e,function(e,t){n._registerAction(t,e)})},Gy.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw Uy(e,"is already registered");this._actions[e]=t},Gy.prototype.unregister=function(e){if(!this.isRegistered(e))throw Uy(e,Xy);this._actions[e]=void 0},Gy.prototype.getActions=function(){return Object.keys(this._actions)},Gy.prototype.isRegistered=function(e){return!!this._actions[e]};var Yy={__init__:["editorActions"],editorActions:["type",Gy]};function Ky(e){e.invoke(Gy,this)}e(Ky,Gy),Ky.$inject=["injector"],Ky.prototype._registerDefaultActions=function(e){Gy.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),s=e.get("handTool",!1),a=e.get("globalConnect",!1),l=e.get("distributeElements",!1),c=e.get("alignElements",!1),u=e.get("directEditing",!1),p=e.get("searchPad",!1),h=e.get("modeling",!1),d=e.get("contextPad",!1);t&&n&&i&&this._registerAction("selectElements",function(){var e=t.getRootElement(),r=n.filter(function(t){return t!==e});return i.select(r),r}),r&&this._registerAction("spaceTool",function(){r.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),s&&this._registerAction("handTool",function(){s.toggle()}),a&&this._registerAction("globalConnectTool",function(){a.toggle()}),i&&l&&this._registerAction("distributeElements",function(e){var t=i.get(),n=e.type;t.length&&l.trigger(t,n)}),i&&c&&this._registerAction("alignElements",function(e){var t=i.get(),n=[],r=e.type;t.length&&(n=_(t,function(e){return!vr(e,"bpmn:Lane")}),c.trigger(n,r))}),i&&h&&this._registerAction("setColor",function(e){var t=i.get();t.length&&h.setColor(t,e)}),i&&u&&this._registerAction("directEditing",function(){var e=i.get();e.length&&u.activate(e[0])}),p&&this._registerAction("find",function(){p.toggle()}),t&&h&&this._registerAction("moveToOrigin",function(){var e,i,r=t.getRootElement();e=ht(i=vr(r,"bpmn:Collaboration")?n.filter(function(e){return vr(e.parent,"bpmn:Collaboration")}):n.filter(function(e){return e!==r&&!vr(e.parent,"bpmn:SubProcess")})),h.moveElements(i,{x:-e.x,y:-e.y},r)}),i&&d&&this._registerAction("replaceElement",function(e){d.triggerEntry("replace","click",e)})};var Zy={__depends__:[Yy],editorActions:["type",Ky]};function Jy(e){e.on(["create.init","shape.move.init"],function(e){var t=e.context;yr(e.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(t.gridSnappingContext||(t.gridSnappingContext={}),t.gridSnappingContext.snapLocation="top-left")})}function eb(e,t){Vo.call(this,e),this._gridSnapping=t;var n=this;this.preExecute("shape.resize",function(e){var t=e.context,i=(t.hints||{}).autoResize;if(i){var r=t.shape,o=t.newBounds;v(i)?t.newBounds=n.snapComplex(o,i):t.newBounds=n.snapSimple(r,o)}})}Jy.$inject=["eventBus"],eb.$inject=["eventBus","gridSnapping","modeling"],e(eb,Vo),eb.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},eb.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},eb.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),q(e,o),e},eb.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),q(e,o),e};function tb(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,function(e){var n,i=e.context;i.initialized&&("x"===i.axis?(n=t.snapValue(e.dx),e.x=e.x+n-e.dx,e.dx=n):(n=t.snapValue(e.dy),e.y=e.y+n-e.dy,e.dy=n))})}tb.$inject=["eventBus","gridSnapping"];var nb={__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",eb],gridSnappingSpaceToolBehavior:["type",tb]};function ib(e,t,n){return n||(n="round"),Math[n](e/t)*t}function rb(e,t,n){var i=!n||!1!==n.active;this._eventBus=t;var r=this;t.on("diagram.init",800,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"],1200,function(t){var n=t.originalEvent;if(!(!r.active||n&&zs(n))){var i=t.context,o=i.gridSnappingContext;o||(o=i.gridSnappingContext={}),["x","y"].forEach(function(n){var i={},o=function(e,t,n){var i=e.context,r=e.shape,o=i.gridSnappingContext,s=o.snapLocation,a=o.snapOffset;if(a&&m(a[t]))return a[t];a||(a=o.snapOffset={});m(a[t])||(a[t]=0);if(!r)return a[t];n.get(r.id)||(ob(t)?a[t]+=r[t]+r.width/2:a[t]+=r[t]+r.height/2);if(!s)return a[t];"x"===t?/left/.test(s)?a[t]-=r.width/2:/right/.test(s)&&(a[t]+=r.width/2):/top/.test(s)?a[t]-=r.height/2:/bottom/.test(s)&&(a[t]+=r.height/2);return a[t]}(t,n,e);o&&(i.offset=o);var s=function(e,t){var n=e.context,i=n.createConstraints,r=n.resizeConstraints||{},o=n.gridSnappingContext,s=o.snapConstraints;if(s&&s[t])return s[t];s||(s=o.snapConstraints={});s[t]||(s[t]={});var a=n.direction;i&&(ob(t)?(s.x.min=i.left,s.x.max=i.right):(s.y.min=i.top,s.y.max=i.bottom));var l=r.min,c=r.max;l&&(ob(t)?ab(a)?s.x.max=l.left:s.x.min=l.right:sb(a)?s.y.max=l.top:s.y.min=l.bottom);c&&(ob(t)?ab(a)?s.x.min=c.left:s.x.max=c.right:sb(a)?s.y.min=c.top:s.y.max=c.bottom);return s[t]}(t,n);s&&q(i,s),Wu(t,n)||r.snapEvent(t,n,i)})}})}function ob(e){return"x"===e}function sb(e){return-1!==e.indexOf("n")}function ab(e){return-1!==e.indexOf("w")}rb.prototype.snapEvent=function(e,t,n){Qu(e,t,this.snapValue(e[t],n))},rb.prototype.getGridSpacing=function(){return 10},rb.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e=ib(e+=r,10),t&&t.min&&m(n=t.min)&&(n=ib(n+r,10,"ceil"),e=Math.max(e,n)),t&&t.max&&m(i=t.max)&&(i=ib(i+r,10,"floor"),e=Math.min(e,i)),e-=r},rb.prototype.isActive=function(){return this.active},rb.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},rb.prototype.toggleActive=function(){this.setActive(!this.active)},rb.$inject=["elementRegistry","eventBus","config.gridSnapping"];var lb={__depends__:[nb],__init__:["gridSnapping"],gridSnapping:["type",rb]};function cb(e,t,n){e.on("autoPlace",2e3,function(e){var i=e.source,r=fn(i),o=e.shape,s=Lc(i,o,n);return["x","y"].forEach(function(e){var n={};s[e]!==r[e]&&(s[e]>r[e]?n.min=s[e]:n.max=s[e],vr(o,"bpmn:TextAnnotation")&&(!function(e){return"x"===e}(e)?n.offset=-o.height/2:n.offset=-o.width/2),s[e]=t.snapValue(s[e],n))}),s})}cb.$inject=["eventBus","gridSnapping","elementRegistry"];function ub(e,t,n){t.on(["create.start","shape.move.start"],1750,function(t){var i=t.context,r=i.shape,o=e.getRootElement();vr(r,"bpmn:Participant")&&vr(o,"bpmn:Process")&&o.children.length&&(i.createConstraints&&(r.width=n.snapValue(r.width,{min:r.width}),r.height=n.snapValue(r.height,{min:r.height})))})}ub.$inject=["canvas","eventBus","gridSnapping"];function pb(e,t,n){Vo.call(this,e),this._gridSnapping=t;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,function(e){var t=e.context,r=t.connection,o=t.hints||{},s=r.waypoints;o.connectionStart||o.connectionEnd||!1===o.createElementsBehavior||function(e){return e.length>3}(s)&&n.updateWaypoints(r,i.snapMiddleSegments(s))})}function hb(e,t,n){var i=St(t,n),r={};return function(e){return"h"===e}(i)&&(r.y=e.snapValue(t.y)),function(e){return"v"===e}(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=q({},t,r),n=q({},n,r)),[t,n]}pb.$inject=["eventBus","gridSnapping","modeling"],e(pb,Vo),pb.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i<e.length-2;i++)t=hb(n,e[i],e[i+1]),e[i]=t[0],e[i+1]=t[1];return e};var db={__depends__:[lb,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",cb],gridSnappingParticipantBehavior:["type",ub],gridSnappingLayoutConnectionBehavior:["type",pb]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",Jy]};function fb(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(e){var t=e.element,i=e.gfx;return vr(t,"bpmn:Lane")?n._createParticipantHit(t,i):vr(t,"bpmn:Participant")?Nr(t)?n._createParticipantHit(t,i):n._createDefaultHit(t,i):vr(t,"bpmn:SubProcess")?Nr(t)?n._createSubProcessHit(t,i):n._createDefaultHit(t,i):void 0})}fb.$inject=["eventBus","interactionEvents"],fb.prototype._createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},fb.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=zr(e)?{width:30,height:e.height}:{width:e.width,height:30};return this._interactionEvents.createBoxHit(t,"all",n),!0},fb.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:30}),!0};var mb={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",fb]};function gb(e){e.invoke(Us,this)}e(gb,Us),gb.$inject=["injector"];var vb={selectElements:{key:"A",modifier:"cmd"},find:{key:"F",modifier:"cmd"},spaceTool:{key:"S"},lassoTool:{key:"L"},handTool:{key:"H"},globalConnectTool:{key:"C"},directEditing:{key:"E"},replaceElement:{key:"R"}};gb.prototype.registerBindings=function(e,t){Us.prototype.registerBindings.call(this,e,t),E(vb,function(n,i){if(t.isRegistered(i)){var r=[n.key.toLowerCase(),n.key.toUpperCase()],o="cmd"===n.modifier;e.addListener(function(n){var s=n.keyEvent;if(e.isKey(r,s)){if(o){if(!e.isCmd(s))return}else if(e.hasModifier(s))return;return t.trigger(i,s),!0}})}})};var yb={__depends__:[Ys],__init__:["keyboardBindings"],keyboardBindings:["type",gb]},bb={moveSpeed:1,moveSpeedAccelerated:10},wb={ArrowLeft:"left",ArrowUp:"up",ArrowRight:"right",ArrowDown:"down"},xb={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 _b(e,t,n,i,r){var o=this;this._config=q({},bb,e||{}),t.addListener(1500,function(e){var n=e.keyEvent,i=wb[n.key];if(i&&!t.isCmd(n)){var r=t.isShift(n);return o.moveSelection(i,r),!0}}),this.moveSelection=function(e,t){var o=r.get();if(o.length){var s=this._config[t?"moveSpeedAccelerated":"moveSpeed"],a=xb[e](s);i.allowed("elements.move",{shapes:o,hints:{keyboardMove:!0}})&&n.moveElements(o,a)}}}_b.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];var Eb={__depends__:[Ys,As],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",_b]};function Sb(e,t,n,i){this._dragging=i,this._rules=t;var r=this;function o(e,t){var n,i=e.shape,o=e.direction,s=e.resizeConstraints;e.delta=t,n=function(e,t,n){var i=n.x,r=n.y,o={x:e.x,y:e.y,width:e.width,height:e.height};return-1!==t.indexOf("n")?(o.y=e.y+r,o.height=e.height-r):-1!==t.indexOf("s")&&(o.height=e.height+r),-1!==t.indexOf("e")?o.width=e.width+i:-1!==t.indexOf("w")&&(o.x=e.x+i,o.width=e.width-i),o}(i,o,t),e.newBounds=function(e,t){if(!t)return e;var n=pn(e);return hn({top:Qp("top",n,t),right:Qp("right",n,t),bottom:Qp("bottom",n,t),left:Qp("left",n,t)})}(n,s),e.canExecute=r.canResize(e)}e.on("resize.start",function(e){var t,n,i;t=e.context,n=t.resizeConstraints,i=t.minBounds,void 0===n&&(void 0===i&&(i=r.computeMinResizeBox(t)),t.resizeConstraints={min:pn(i)})}),e.on("resize.move",function(e){var t={x:e.dx,y:e.dy};o(e.context,t)}),e.on("resize.end",function(e){!function(e){var t=e.shape,i=e.canExecute,r=e.newBounds;if(i){if(!function(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}(t,r=cn(r)))return;n.resizeShape(t,r)}}(e.context)})}function kb(e,t){var n=fn(e),i=pn(e),r={x:n.x,y:n.y};return-1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}function Ob(e){var t="resize-";return"n"===e||"s"===e?t+"ns":"e"===e||"w"===e?t+"ew":"nw"===e||"se"===e?t+"nwse":t+"nesw"}Sb.prototype.canResize=function(e){var t=this._rules,n=Q(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},Sb.prototype.activate=function(e,t,n){var i,r,o=this._dragging;if("string"==typeof n&&(n={direction:n}),!(r=(i=q({shape:t},n)).direction))throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");o.init(e,kb(t,r),"resize",{autoActivate:!0,cursor:Ob(r),data:{shape:t,context:i}})},Sb.prototype.computeMinResizeBox=function(e){var t=e.shape;return function(e,t,n,i){var r=pn(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},s=i?pn(i):o;return hn({top:Hp(o.top,s.top),left:Hp(o.left,s.left),bottom:qp(o.bottom,s.bottom),right:qp(o.right,s.right)})}(e.direction,t,e.minDimensions||{width:10,height:10},Up(t,e.childrenBoxPadding))},Sb.$inject=["eventBus","rules","modeling","dragging"];var Cb="djs-resizing",Pb="resize-not-ok";function Ab(e,t,n){e.on("resize.move",500,function(e){var i,r,o,s;i=e.context,r=i.shape,o=i.newBounds,(s=i.frame)||(s=i.frame=n.addFrame(r,t.getActiveLayer()),t.addMarker(r,Cb)),o.width>5&&be(s,{x:o.x,width:o.width}),o.height>5&&be(s,{y:o.y,height:o.height}),i.canExecute?xe(s).remove(Pb):xe(s).add(Pb)}),e.on("resize.cleanup",function(e){var n,i;n=e.context,i=n.shape,n.frame&&ze(n.frame),t.removeMarker(i,Cb)})}Ab.$inject=["eventBus","canvas","previewSupport"];var Tb=-6,Rb="djs-resizer",Mb=["n","w","s","e","nw","ne","se","sw"];function $b(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",function(e){var t=e.newSelection;r.removeResizers(),1===t.length&&E(t,F(r.addResizer,r))}),e.on("shape.changed",function(e){var t=e.element;n.isSelected(t)&&(r.removeResizers(),r.addResizer(t))})}$b.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(t){gs(t)&&i.activate(t,e,n)}ce.bind(t,"mousedown",r),ce.bind(t,"touchstart",r)},$b.prototype._createResizer=function(e,t,n,i){var r=this._getResizersParent(),o=function(e){var t={x:0,y:0};-1!==e.indexOf("e")?t.x=6:-1!==e.indexOf("w")&&(t.x=Tb);-1!==e.indexOf("s")?t.y=6:-1!==e.indexOf("n")&&(t.y=Tb);return t}(i),s=Pe("g");xe(s).add(Rb),xe(s).add(Rb+"-"+e.id),xe(s).add(Rb+"-"+i),ge(r,s);var a=Pe("rect");be(a,{x:-4+o.x,y:-4+o.y,rx:2,width:8,height:8}),xe(a).add(Rb+"-visual"),ge(s,a);var l=Pe("rect");return be(l,{x:-10+o.x,y:-10+o.y,width:20,height:20}),xe(l).add(Rb+"-hit"),ge(s,l),Wn(s,t,n),s},$b.prototype.createResizer=function(e,t){var n=kb(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},$b.prototype.addResizer=function(e){var t=this;an(e)||E(Mb,function(n){t._resize.canResize({shape:e,direction:n})&&t.createResizer(e,n)})},$b.prototype.removeResizers=function(){Ee(this._getResizersParent())},$b.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},$b.$inject=["eventBus","canvas","selection","resize"];var Db={__depends__:[nu,Kc,up],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Sb],resizePreview:["type",Ab],resizeHandles:["type",$b]};function Bb(e,t,n,i,r,o,s){function a(e,t){(t||yr(e,["bpmn:Activity","bpmn:Event","bpmn:TextAnnotation","bpmn:Participant"]))&&i.activate(e)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=s,i.registerProvider(this),e.on("element.dblclick",function(e){a(e.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"],2e3,function(e){i.isActive(e.element)&&i.cancel()}),e.on(["commandStack.changed"],function(e){i.isActive()&&i.cancel()}),e.on("directEditing.activate",function(e){o.removeResizers()}),e.on("create.end",500,function(e){var t=e.context,n=t.shape,i=e.context.canExecute;e.isTouch||i&&(t.hints&&!1===t.hints.createElementsBehavior||a(n))}),e.on("autoPlace.end",500,function(e){a(e.shape)})}function Lb(e){return vr(e,"bpmn:SubProcess")&&!Nr(e)}Bb.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Bb.prototype.activate=function(e){var t=Ur(e);if(void 0!==t){var n={text:t};q(n,this.getEditingBBox(e));var i={},r=n.style||{};return q(r,{backgroundColor:null,border:null}),(yr(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||Lb(e))&&q(i,{centerVertically:!0}),Hr(e)&&(q(i,{resizable:!0,autoResize:!0}),q(r,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),vr(e,"bpmn:TextAnnotation")&&(q(i,{resizable:!0,autoResize:!0}),q(r,{backgroundColor:"#ffffff",border:"1px solid #ccc"})),q(n,{options:i,style:r}),n}},Bb.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,s={x:i.x,y:i.y},a=t.zoom(),l=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),u=c.fontSize*a,p=c.lineHeight,h=l.fontSize*a,d=l.lineHeight,f={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};if(vr(e,"bpmn:Lane")||function(e){return vr(e,"bpmn:Participant")&&Nr(e)}(e)){var m=zr(e);q(s,m?{width:i.height,height:30*a,x:i.x-i.height/2+15*a,y:o-30*a/2}:{width:i.width,height:30*a}),q(f,{fontSize:h+"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(function(e){return vr(e,"bpmn:Participant")&&!Nr(e)}(e)){var g=zr(e);q(s,g?{width:i.width,height:i.height}:{width:i.height,height:i.width,x:r-i.height/2,y:o-i.width/2}),q(f,{fontSize:h+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:g?null:"rotate(-90deg)"})}(yr(e,["bpmn:Task","bpmn:CallActivity"])||Lb(e))&&(q(s,{width:i.width,height:i.height}),q(f,{fontSize:h+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),function(e){return vr(e,"bpmn:SubProcess")&&Nr(e)}(e)&&(q(s,{width:i.width,x:i.x}),q(f,{fontSize:h+"px",lineHeight:d,paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"}));var v=i.width+2;if(n.labelTarget&&(q(s,{width:v,height:i.height+2,x:i.x-1,y:i.y-1}),q(f,{fontSize:u+"px",lineHeight:p})),Hr(n)&&!Wr(n)&&!ln(n)){var y=Xr(e),b=t.getAbsoluteBBox({x:y.x,y:y.y,width:0,height:0}),w=u,x=qr.width*a+2;q(s,{width:x,height:w+2,x:b.x-x/2,y:b.y-w/2-1}),q(f,{fontSize:u+"px",lineHeight:p})}return vr(e,"bpmn:TextAnnotation")&&(q(s,{width:i.width+2,height:i.height+2,x:i.x-1,y:i.y-1,minWidth:30*a,minHeight:10*a}),q(f,{textAlign:"left",paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:7*a+"px",paddingRight:7*a+"px",fontSize:h+"px",lineHeight:d})),{bounds:s,style:f}},Bb.prototype.update=function(e,t,n,i){var r,o,s;vr(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}),(s=t)&&s.trim()||(t=null),this._modeling.updateLabel(e,t,r)};var Ib="djs-element-hidden",Nb="djs-label-hidden";function zb(e,t,n){var i,r,o,s=this,a=t.getDefaultLayer();e.on("directEditing.activate",function(e){var l=e.active;if(vr(i=l.element.label||l.element,"bpmn:TextAnnotation")){r=t.getAbsoluteBBox(i),o=Pe("g");var c=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i.width,containerHeight:i.height,position:{mx:0,my:0}}),u=s.path=Pe("path");be(u,{d:c,strokeWidth:2,stroke:jb(i)}),ge(o,u),ge(a,o),Qn(o,i.x,i.y)}vr(i,"bpmn:TextAnnotation")||i.labelTarget?t.addMarker(i,Ib):(vr(i,"bpmn:Task")||vr(i,"bpmn:CallActivity")||vr(i,"bpmn:SubProcess")||vr(i,"bpmn:Participant")||vr(i,"bpmn:Lane"))&&t.addMarker(i,Nb)}),e.on("directEditing.resize",function(e){if(vr(i,"bpmn:TextAnnotation")){var t=e.height,o=e.dy,a=Math.max(i.height/r.height*(t+o),0),l=n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:i.width,containerHeight:a,position:{mx:0,my:0}});be(s.path,{d:l})}}),e.on(["directEditing.complete","directEditing.cancel"],function(e){var n=e.active;n&&(t.removeMarker(n.element.label||n.element,Ib),t.removeMarker(i,Nb)),i=void 0,r=void 0,o&&(ze(o),o=void 0)})}function jb(e,t){return wr(e).get("stroke")||t||"black"}zb.$inject=["eventBus","canvas","pathMap"];var Vb={__depends__:[jo,Db,fy],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Bb],labelEditingPreview:["type",zb]};function Fb(e,t,n){this._eventBus=e,this._elementRegistry=n,this._outlineOffset=5,this._outlineStyle=t.cls("djs-outline",["no-fill"]);var i=this;function r(e){var t;f(t=e)&&h(t.parent)||i.createOutline(e)}e.on("element.hover",function(e){r(e.element)}),e.on("selection.changed",function(e){E(e.newSelection,r)}),e.on(["shape.changed","connection.changed"],500,function(e){var t=e.element,n=de(".djs-outline",e.gfx);n&&i.updateOutline(t,n)})}Fb.prototype.createOutline=function(e){var t=this._elementRegistry.getGraphics(e);if(!t)throw new Error("cannot create outline for non-rendered element");var n=de(".djs-outline",t);return n||(ge(t,n=this.getOutline(e)||this._createOutlineGfx()),this.updateOutline(e,n)),n},Fb.prototype._createOutlineGfx=function(){var e=Pe("rect");return be(e,q({x:0,y:0,rx:4,width:100,height:100},this._outlineStyle)),e},Fb.prototype.updateOutline=function(e,t){e.waypoints?this.updateConnectionOutline(t,e):this.updateShapeOutline(t,e)},Fb.prototype.updateShapeOutline=function(e,t){var n=!1,i=this._getProviders();i.length&&E(i,function(i){n=n||i.updateOutline(t,e)}),n||be(e,{x:-this._outlineOffset,y:-this._outlineOffset,width:t.width+2*this._outlineOffset,height:t.height+2*this._outlineOffset})},Fb.prototype.updateConnectionOutline=function(e,t){var n=ht(t);be(e,{x:n.x-this._outlineOffset,y:n.y-this._outlineOffset,width:n.width+2*this._outlineOffset,height:n.height+2*this._outlineOffset})},Fb.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("outline.getProviders",e,function(e){e.providers.push(t)})},Fb.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Fb.prototype.getOutline=function(e){var t;return E(this._getProviders(),function(n){g(n.getOutline)&&(t=t||n.getOutline(e))}),t},Fb.$inject=["eventBus","styles","elementRegistry"];function qb(e,t,n){this._canvas=t;var i=this;e.on("element.changed",function(e){n.isSelected(e.element)&&i._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(e){var t=e.newSelection;i._updateMultiSelectionOutline(t)})}qb.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");Ee(t);var n=e.length>1;if(xe(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),n){var i=function(e){return{x:e.x-6,y:e.y-6,width:e.width+12,height:e.height+12}}(ht(e)),r=Pe("rect");be(r,q({rx:3},i)),xe(r).add("djs-selection-outline"),ge(t,r)}},qb.$inject=["eventBus","canvas","selection"];var Hb={__depends__:[As],__init__:["outline","multiSelectionOutline"],outline:["type",Fb],multiSelectionOutline:["type",qb]};const Wb=["bpmn:Event","bpmn:SequenceFlow","bpmn:Gateway"],Qb={class:"bjs-label-link",stroke:"var(--element-selected-outline-secondary-stroke-color)",strokeDasharray:"5, 5"};function Xb(e,t,n,i,r){const o=t.getLayer("overlays");function s(e,t){const n=fn(e),i=an(t)?Dh(n,function(e){for(var t=[],n=0;n<e.length-1;n++)t.push([e[n],e[n+1]]);return t}(t.waypoints)):fn(t),s=ot([i,n],Qb),c=s.getAttribute("d"),u=gn(r.isSelected(e)?a(e):l(e),c);if(!u)return;let p;if(an(t))p=i;else{p=gn(r.isSelected(t)?a(t):l(t),c)||fn(t)}uu(p,u)<15||(st(s,[p,u]),ge(o,s))}function a(e){const t=i.getOutline(e);if(!t)return l(e);if(t.x){return ro({x:e.x+Gb(t,"x")-2,y:e.y+Gb(t,"y")-2,width:Gb(t,"width")+4,height:Gb(t,"height")+4},Gb(t,"rx"))}if(t.cx){const n=Gb(t,"r");return io({x:e.x+Gb(t,"cx")-n,y:e.y+Gb(t,"cy")-n,width:2*n,height:2*n})}}function l(e){return n.getShapePath(e)}e.on(["selection.changed","shape.changed"],function(){fe(`.${Qb.class}`,o).forEach(ze)}),e.on("selection.changed",function({newSelection:e}){const t=e.filter(e=>yr(e,Wb));if(1===t.length){const e=t[0];ln(e)?s(e,e.labelTarget):e.labels?.length&&s(e.labels[0],e)}if(2===t.length){const e=t.find(ln),n=t.find(t=>t.labels?.includes(e));e&&n&&s(e,n)}}),e.on("shape.changed",function({element:e}){yr(e,Wb)&&function(e){return r.isSelected(e)}(e)&&(ln(e)?s(e,e.labelTarget):e.labels?.length&&s(e.labels[0],e))})}function Gb(e,t){return parseFloat(be(e,t)||0)}Xb.$inject=["eventBus","canvas","graphicsFactory","outline","selection"];var Ub={__depends__:[As,Hb],__init__:["labelLink"],labelLink:["type",Xb]},Yb=new Mo("tt");function Kb(e,t){e.style.display=!1===t?"none":""}var Zb="djs-tooltip",Jb="."+Zb;function ew(e,t){var n,i;this._eventBus=e,this._canvas=t,this._ids=Yb,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=t.getContainer(),Z(i=Y('<div class="djs-tooltip-container" />'),{position:"absolute",width:"0",height:"0"}),n.insertBefore(i,n.firstChild),i);var r=this;pe.bind(this._tooltipRoot,Jb,"mousedown",function(e){e.stopPropagation()}),pe.bind(this._tooltipRoot,Jb,"mouseover",function(e){r.trigger("mouseover",e)}),pe.bind(this._tooltipRoot,Jb,"mouseout",function(e){r.trigger("mouseout",e)}),this._init()}ew.$inject=["eventBus","canvas"],ew.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=q({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},ew.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(J(n,"data-tooltip-id"));i&&("mouseover"===e&&i.timeout&&this.clearTimeout(i),"mouseout"===e&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},ew.prototype.get=function(e){return"string"!=typeof e&&(e=e.id),this._tooltips[e]},ew.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},ew.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},ew.prototype.remove=function(e){var t=this.get(e);t&&(me(t.html),me(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},ew.prototype.show=function(){Kb(this._tooltipRoot)},ew.prototype.hide=function(){Kb(this._tooltipRoot,!1)},ew.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},ew.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),v(i)&&(i=Y(i)),Z(t=Y('<div data-tooltip-id="'+n+'" class="'+Zb+'">'),{position:"absolute"}),t.appendChild(i),e.type&&te(t).add("djs-tooltip-"+e.type),e.className&&te(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},ew.prototype._updateTooltip=function(e){var t=e.position;!function(e,t,n){Z(e,{left:t+"px",top:n+"px"})}(e.htmlContainer,t.x,t.y)},ew.prototype._updateTooltipVisibilty=function(e){E(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),Kb(i,r))})},ew.prototype._init=function(){var e=this;this._eventBus.on("canvas.viewbox.changing",function(t){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(t){var n;n=t.viewbox,e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()})};var tw={__init__:["tooltips"],tooltips:["type",ew]};function nw(e,t,n){function i(e,n,i){t.add({position:{x:e.x+5,y:e.y+5},type:"error",timeout:2e3,html:"<div>"+n+"</div>"})}e.on(["shape.move.rejected","create.rejected"],function(e){var t=e.context,r=t.shape;vr(t.target,"bpmn:Collaboration")&&(vr(r,"bpmn:FlowNode")?i(e,n("flow elements must be children of pools/participants")):vr(r,"bpmn:DataObjectReference")&&i(e,n("Data object must be placed within a pool/participant.")))})}nw.$inject=["eventBus","tooltips","translate"];var iw={__depends__:[tw],__init__:["modelingFeedback"],modelingFeedback:["type",nw]},rw=Math.round;function ow(e,t,n,i,r){function o(e,t,n,i){return r.allowed("elements.move",{shapes:e,delta:t,position:n,target:i})}function s(e,n,i,r){if(f(i)&&(r=i,i=!1),!n.waypoints&&n.parent&&!xe(e.target).has("djs-hit-no-move")){var o=function(e){return{x:e.x+rw(e.width/2),y:e.y+rw(e.height/2)}}(n);return!1!==t.init(e,o,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:r||{}}})||void 0}}e.on("shape.move.start",1500,function(e){var t=e.context,n=e.shape,r=i.get().slice();-1===r.indexOf(n)&&(r=[n]),r=function(e){var t=M(e,"id");return _(e,function(e){for(;e=e.parent;)if(t[e.id])return!1;return!0})}(r),q(t,{shapes:r,validatedShapes:r,shape:n})}),e.on("shape.move.start",1250,function(e){var t=e.context,n=t.validatedShapes;if(!(t.canExecute=o(n)))return!1}),e.on("shape.move.move",500,function(e){var t,n=e.context,i=n.validatedShapes,r=e.hover,s={x:e.dx,y:e.dy};t=o(i,s,{x:e.x,y:e.y},r),n.delta=s,n.canExecute=t,n.target=null!==t?r:null}),e.on("shape.move.end",function(e){var t=e.context,i=t.delta,r=t.canExecute,o="attach"===r,s=t.shapes;if(!1===r)return!1;i.x=rw(i.x),i.y=rw(i.y),0===i.x&&0===i.y||n.moveElements(s,i,t.target,{primaryShape:t.shape,attach:o})}),e.on("element.mousedown",function(e){if(gs(e)){var t=ps(e);if(!t)throw new Error("must supply DOM mousedown event");return s(t,e.element)}}),this.start=s}ow.$inject=["eventBus","dragging","modeling","selection","rules"];var sw="djs-dragging",aw="drop-ok",lw="drop-not-ok",cw="new-parent",uw="attach-ok";function pw(e,t,n,i){function r(e){var t=function(e){var t=new Set;e.forEach(function(e){t.add(e.id)});var n=_(e,function(e){return!an(e)||t.has(e.source.id)&&t.has(e.target.id)});return n}(o(e));return t}function o(e){var t=ut(e),n=t.flatMap(e=>(e.incoming||[]).concat(e.outgoing||[])),i=t.concat(n);return[...new Set(i)]}function s(e,n){[uw,aw,lw,cw].forEach(function(i){i===n?t.addMarker(e,i):t.removeMarker(e,i)})}e.on("shape.move.start",499,function(e){var s=e.context,l=s.shapes,c=s.allDraggedElements,u=r(l);if(!s.dragGroup){var p=Pe("g");be(p,n.cls("djs-drag-group",["no-events"])),ge(t.getActiveLayer(),p),s.dragGroup=p}u.forEach(function(e){i.addDragger(e,s.dragGroup)}),E(c=c?a([c,o(l)]):o(l),function(e){t.addMarker(e,sw)}),s.allDraggedElements=c,s.differentParents=1!==T(M(l,function(e){return e.parent&&e.parent.id}))}),e.on("shape.move.move",499,function(e){var t=e.context,n=t.dragGroup,i=t.target,r=t.shape.parent,o=t.canExecute;i&&("attach"===o?s(i,uw):t.canExecute&&r&&i.id!==r.id?s(i,cw):s(i,t.canExecute?aw:lw)),Qn(n,e.dx,e.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(e){var t=e.context.target;t&&s(t,null)}),e.on("shape.move.cleanup",function(e){var n=e.context,i=n.allDraggedElements,r=n.dragGroup;E(i,function(e){t.removeMarker(e,sw)}),r&&ze(r)}),this.makeDraggable=function(e,n,r){i.addDragger(n,e.dragGroup),r&&t.addMarker(n,sw),e.allDraggedElements?e.allDraggedElements.push(n):e.allDraggedElements=[n]}}pw.$inject=["eventBus","canvas","styles","previewSupport"];var hw={__depends__:[_s,As,Hb,nu,Kc,up],__init__:["move","movePreview"],move:["type",ow],movePreview:["type",pw]};const dw=300;function fw(e){this._canvas=e,this._mount=null,this._current=null,this._showTimer=null}fw.$inject=["canvas"],fw.prototype.add=function(e){const{container:t,selector:n,showDelay:i=dw}=e;pe.bind(t,n,"mouseover",t=>this._show(t.delegateTarget,e,i)),pe.bind(t,n,"mouseout",e=>{const{delegateTarget:t,relatedTarget:n}=e;n&&t.contains(n)||this._hide()})},fw.prototype._show=function(e,t,n){const i=t.getContent(e);i&&(this._current={target:e,content:i,getPosition:t.getPosition},clearTimeout(this._showTimer),this._showTimer=setTimeout(()=>this._render(),n))},fw.prototype._hide=function(){clearTimeout(this._showTimer),this._current=null,this._render()},fw.prototype._render=function(){const e=this._getMount();if(!this._current)return void ml(null,e);const{target:t,content:n,getPosition:i}=this._current,{x:r,y:o,placement:s="right"}=i(t);ml(_l`<div
325
+ class="djs-hover-tooltip djs-hover-tooltip--${s}"
326
+ style=${{left:`${r}px`,top:`${o}px`}}
327
+ >${n}</div>`,e)},fw.prototype._getMount=function(){return this._mount||(this._mount=Y('<div class="djs-hover-tooltip-container"></div>'),this._canvas.getContainer().appendChild(this._mount)),this._mount};var mw={__init__:["hoverTooltip"],hoverTooltip:["type",fw]},gw=".djs-palette-toggle",vw=".entry",yw=gw+", "+vw,bw="djs-palette-",ww="open",xw="two-column";function _w(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(e){var t=e.tool;n.updateToolHighlight(t)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}function Ew(e,t){var n=t.getPaletteEntries();return g(n)?n(e):(E(n,function(t,n){e[n]=t}),e)}function Sw(e){const{title:t,shortcut:n}=e,i=n?_l`<kbd class="djs-palette-tooltip-shortcut">${n}</kbd>`:null;return _l`
328
+ <span class="djs-palette-tooltip-label">${t}</span>
329
+ ${i}
330
+ `}_w.$inject=["eventBus","canvas"],_w.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,function(e){e.providers.push(t)}),this._rebuild()},_w.prototype.getEntries=function(){return this._getProviders().reduce(Ew,{})},_w.prototype._rebuild=function(){this._diagramInitialized&&(this._getProviders().length&&(this._container||this._init(),this._update()))},_w.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=Y(_w.HTML_MARKUP);n.appendChild(i),te(n).add(bw+"shown"),pe.bind(i,yw,"click",function(t){if(he(t.delegateTarget,gw))return e.toggle();e.trigger("click",t)}),ce.bind(i,"mousedown",function(e){e.stopPropagation()}),pe.bind(i,vw,"dragstart",function(t){e.trigger("dragstart",t)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},_w.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},_w.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=te(i),s=te(n);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle(xw,t),s.toggle(bw+xw,t),"open"in e&&(o.toggle(ww,e.open),s.toggle(bw+ww,e.open)),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},_w.prototype._update=function(){var e=de(".djs-palette-entries",this._container),t=this._entries=this.getEntries();ie(e),E(t,function(t,n){var i=t.group||"default",r=de("[data-group="+Wo(i)+"]",e);r||(J(r=Y('<div class="group"></div>'),"data-group",i),e.appendChild(r));var o=Y(t.html||(t.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'));if(r.appendChild(o),!t.separator&&(J(o,"data-action",n),t.title&&(J(o,"aria-label",t.title),J(o,"role","button")),t.className&&function(e,t){var n=te(e);(d(t)?t:t.split(/\s+/g)).forEach(function(e){n.add(e)})}(o,t.className),t.imageUrl)){var s=Y("<img>");J(s,"src",t.imageUrl),o.appendChild(s)}}),this.open()},_w.prototype.trigger=function(e,t,n){var i,r,o=t.delegateTarget||t.target;return o?(i=J(o,"data-action"),r=t.originalEvent||t,this.triggerEntry(i,e,r,n)):t.preventDefault()},_w.prototype.triggerEntry=function(e,t,n,i){var r,o;if((r=this._entries[e])&&(o=r.action,!1!==this._eventBus.fire("palette.trigger",{entry:r,event:n}))){if(g(o)){if("click"===t)return o(n,i)}else if(o[t])return o[t](n,i);n.preventDefault()}},_w.prototype._layoutChanged=function(){this._toggleState({})},_w.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},_w.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},_w.prototype.open=function(){this._toggleState({open:!0})},_w.prototype.toggle=function(){this.isOpen()?this.close():this.open()},_w.prototype.isActiveTool=function(e){return e&&this._activeTool===e},_w.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=de(".djs-palette-entries",this._container),this._toolsContainer=de("[data-group=tools]",t)),E(this._toolsContainer.children,function(t){var n=t.getAttribute("data-action");if(n){var i=te(t);n=n.replace("-tool",""),i.contains("entry")&&n===e?i.add("highlighted-entry"):i.remove("highlighted-entry")}})},_w.prototype.isOpen=function(){return te(this._container).has(ww)},_w.prototype._getParentContainer=function(){return this._canvas.getContainer()},_w.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function kw(e,t,n){this._palette=t,this._hoverTooltip=n,this._entries={},e.on("palette.create",e=>this._init(e.container)),e.on("palette.changed",()=>this._updateEntries())}kw.$inject=["eventBus","palette","hoverTooltip"],kw.prototype._init=function(e){this._updateEntries(),this._hoverTooltip.add({container:e,selector:".djs-palette-entries .entry",getContent:e=>{const t=this._entries[J(e,"data-action")];return t&&t.title?_l`<${Sw}
331
+ title=${t.title}
332
+ shortcut=${t.shortcut}
333
+ />`:null},getPosition:e=>{const t=e.getBoundingClientRect();return{x:t.right+8,y:t.top+t.height/2,placement:"right"}}})},kw.prototype._updateEntries=function(){this._entries=this._palette.getEntries()};var Ow={__depends__:[mw],__init__:["palette","paletteTooltip"],palette:["type",_w],paletteTooltip:["type",kw]},Cw="crosshair",Pw="selected";function Aw(e,t,n,i,r,o,s){this._selection=r,this._dragging=n,this._mouse=s;var a=this,l={create:function(e){var n=t.getActiveLayer(),i=e.frame=Pe("rect");be(i,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),ge(n,i),c(!0),this.update(e)},update:function(e){var n=e.frame,i=e.bbox;n&&i&&be(n,{x:i.x,y:i.y,width:i.width,height:i.height});var r=e.marked,o=e.lastMarked;if(r&&o){for(const e of o)r.has(e)||t.removeMarker(e,Pw);for(const e of r)o.has(e)||t.addMarker(e,Pw)}},remove:function(e){this.update(e),e.frame&&ze(e.frame),c(!1)}};function c(e){xe(t.getContainer()).toggle("djs-dragging-active-lasso",e)}o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("lasso.selection.ended",function(){a.activateLasso(t.originalEvent,!0)})}),e.on("lasso.end",0,function(e){var t=e.context;a._select(Array.from(t.marked))}),e.on("lasso.start",function(e){var t=e.context;t.bbox=Tw(e),t.add=ys(e),t.lastMarked=new Set(r.get()),t.add?t.marked=t.lastMarked:t.marked=new Set,t.initialMarked=t.marked,l.create(t)}),e.on("lasso.move",function(e){var t=e.context,n=function(e){var t=i.getAll();return new Set(R(dt(t,e)))}(t.bbox=Tw(e)),r=t.initialMarked.union(n);t.lastMarked=t.marked,t.marked=r,l.update(t)}),e.on("lasso.cleanup",function(e){var t=e.context;t.lastMarked=t.marked,t.marked=new Set(r.get()),l.remove(e.context)}),e.on("element.mousedown",1500,function(e){if(ys(e))return a.activateLasso(e.originalEvent),!0})}function Tw(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?{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?{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?{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?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}Aw.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Aw.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:Cw,data:{context:{}},keepSelection:!0})},Aw.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:Cw,data:{context:{}},keepSelection:!0})},Aw.prototype._select=function(e){this._selection.select(e)},Aw.prototype.select=function(e,t,n=[]){var i=R(dt(e,t));this._select([...n,...i])},Aw.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Aw.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};var Rw={__depends__:[wm,Zf],__init__:["lassoTool"],lassoTool:["type",Aw]},Mw=1500,$w="grab";function Dw(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var s=this,a=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",Mw,function(e){if(vs(e))return s.activateMove(e.originalEvent,!0),!1}),a&&a.addListener(Mw,function(e){if(Bw(e.keyEvent)&&!s.isActive()){var t=s._mouse.getLastMoveEvent();s.activateMove(t,!!t)}},"keyboard.keydown"),a&&a.addListener(Mw,function(e){Bw(e.keyEvent)&&s.isActive()&&s.toggle()},"keyboard.keyup"),e.on("hand.end",function(t){var n=t.originalEvent.target;if(!(t.hover||n instanceof SVGElement))return!1;e.once("hand.ended",function(){s.activateMove(t.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(e){var n=t.viewbox().scale;t.scroll({dx:e.dx*n,dy:e.dy*n})}),e.on("hand.move.end",function(t){var n=t.context.reactivate;return!vs(t)&&n&&e.once("hand.move.ended",function(e){s.activateHand(e.originalEvent,!0,!0)}),!1})}function Bw(e){return js("Space",e)}Dw.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],Dw.prototype.activateMove=function(e,t,n){"object"==typeof t&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:$w,data:{context:n||{}}})},Dw.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:$w,data:{context:{reactivate:n}}})},Dw.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},Dw.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};var Lw={__depends__:[wm,Zf],__init__:["handTool"],handTool:["type",Dw]},Iw="connect-ok",Nw="connect-not-ok";function zw(e,t,n,i,r,o,s){var a=this;this._dragging=t,this._rules=o,this._mouse=s,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(e){var t=e.context,n=e.hover,r=t.canStartConnect=a.canStartConnect(n);null!==r&&(t.startTarget=n,i.addMarker(n,r?Iw:Nw))}),e.on(["global-connect.out","global-connect.cleanup"],function(e){var t=e.context.startTarget,n=e.context.canStartConnect;t&&i.removeMarker(t,n?Iw:Nw)}),e.on(["global-connect.ended"],function(t){var i=t.context.startTarget,r={x:t.x,y:t.y};if(a.canStartConnect(i))return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,i,r)}),!1})}zw.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],zw.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},zw.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},zw.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},zw.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var jw={__depends__:[ip,nu,Kc,wm,Zf],globalConnect:["type",zw]};function Vw(e,t,n,i,r,o,s,a){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=s,this._translate=a,e.registerProvider(this)}Vw.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],Vw.prototype.getPaletteEntries=function(){var e={},t=this._create,n=this._elementFactory,i=this._spaceTool,r=this._lassoTool,o=this._handTool,s=this._globalConnect,a=this._translate;function l(e,i,r,o,s){function a(i){var r=n.createShape(q({type:e},s));t.start(i,r)}return{group:i,className:r,title:o,action:{dragstart:a,click:a}}}function c(e){var i=n.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),r=n.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:i});t.start(e,[i,r],{hints:{autoSelect:[i]}})}function u(e){t.start(e,n.createParticipantShape())}return q(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:a("Activate hand tool"),shortcut:vb.handTool.key,action:{click:function(e){o.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:a("Activate lasso tool"),shortcut:vb.lassoTool.key,action:{click:function(e){r.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:a("Activate create/remove space tool"),shortcut:vb.spaceTool.key,action:{click:function(e){i.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:a("Activate global connect tool"),shortcut:vb.globalConnectTool.key,action:{click:function(e){s.start(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":l("bpmn:StartEvent","event","bpmn-icon-start-event-none",a("Create start event")),"create.intermediate-event":l("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",a("Create intermediate/boundary event")),"create.end-event":l("bpmn:EndEvent","event","bpmn-icon-end-event-none",a("Create end event")),"create.exclusive-gateway":l("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",a("Create gateway")),"create.task":l("bpmn:Task","activity","bpmn-icon-task",a("Create task")),"create.data-object":l("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",a("Create data object reference")),"create.data-store":l("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",a("Create data store reference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:a("Create expanded sub-process"),action:{dragstart:c,click:c}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:a("Create pool/participant"),action:{dragstart:u,click:u}},"create.group":l("bpmn:Group","artifact","bpmn-icon-group",a("Create group"))}),e};var Fw={__depends__:[Ow,Yf,Lm,Rw,Lw,jw,Oo],__init__:["paletteProvider"],paletteProvider:["type",Vw]};function qw(e,t,n,i,r){Vo.call(this,e),e.on("shape.move.move",250,function(e){var o=e.context,s=o.canExecute;o.visualReplacements||(o.visualReplacements={}),s&&s.replacements?function(e){E(e.canExecute.replacements,function(o){var s=o.oldElementId,a={type:o.newElementType};if(!e.visualReplacements[s]){var l=t.get(s);q(a,{x:l.x,y:l.y});var c=n.createShape(a);i.addShape(c,l.parent);var u=de('[data-element-id="'+Wo(l.id)+'"]',e.dragGroup);u&&be(u,{display:"none"});var p=r.addDragger(c,e.dragGroup);e.visualReplacements[s]=p,i.removeShape(c)}})}(o):function(e){var t=e.visualReplacements;E(t,function(n,i){var r=de('[data-element-id="'+Wo(i)+'"]',e.dragGroup);r&&be(r,{display:"inline"}),n.remove(),t[i]&&delete t[i]})}(o)})}qw.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],e(qw,Vo);var Hw={__depends__:[up],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",qw]},Ww=40,Qw=["x","y"],Xw=Math.abs;function Gw(e){e.on(["connect.hover","connect.move","connect.end"],1250,function(e){var t=e.context,n=t.canExecute,i=t.start,r=t.hover,o=t.source,s=t.target;e.originalEvent&&zs(e.originalEvent)||(t.initialConnectionStart||(t.initialConnectionStart=t.connectionStart),n&&r&&function(e,t,n){Qw.forEach(function(i){var r=Kw(i,t);e[i]<t[i]+n?Qu(e,i,t[i]+n):e[i]>t[i]+r-n&&Qu(e,i,t[i]+r-n)})}(e,r,function(e){return vr(e,"bpmn:Task")?10:20}(r)),r&&function(e,t){return C(t,function(t){return Yw(e,t)})}(n,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(t.connectionStart=Hu(i),yr(r,["bpmn:Event","bpmn:Gateway"])&&Uw(e,Hu(r)),yr(r,["bpmn:Task","bpmn:SubProcess"])&&function(e,t){var n=Hu(t);Qw.forEach(function(i){(function(e,t,n){return e[n]>t[n]+20&&e[n]<t[n]+Kw(n,t)-20})(e,t,i)&&Qu(e,i,n[i])})}(e,r),vr(o,"bpmn:BoundaryEvent")&&s===o.host&&function(e){var t=e.context,n=t.source,i=t.target;if(function(e){var t=e.hover,n=e.source;return t&&n&&t===n}(t))return;var r=Hu(n),o=mn(r,i,-10),s=[];/top|bottom/.test(o)&&s.push("x");/left|right/.test(o)&&s.push("y");s.forEach(function(t){var n,i=e[t];Xw(i-r[t])<Ww&&(n=i>r[t]?r[t]+Ww:r[t]-Ww,Qu(e,t,n))})}(e)):Yw(n,"bpmn:MessageFlow")?(vr(i,"bpmn:Event")&&(t.connectionStart=Hu(i)),vr(r,"bpmn:Event")&&Uw(e,Hu(r))):t.connectionStart=t.initialConnectionStart)})}function Uw(e,t){Qu(e,"x",t.x),Qu(e,"y",t.y)}function Yw(e,t){return e&&e.type===t}function Kw(e,t){return"x"===e?t.width:t.height}function Zw(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function Jw(){this._snapValues={}}Gw.$inject=["eventBus"],Zw.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},Zw.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,-1===this._snapLocations.indexOf(e)&&this._snapLocations.push(e)},Zw.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},Zw.prototype.getSnapLocations=function(){return this._snapLocations},Zw.prototype.setSnapLocations=function(e){this._snapLocations=e},Zw.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new Jw).initDefaults(this._defaultSnaps),n},Jw.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),-1===n.x.indexOf(t.x)&&n.x.push(t.x),-1===n.y.indexOf(t.y)&&n.y.push(t.y)},Jw.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&function(e,t,n){var i,r;for(n=void 0===n?10:n,i=0;i<t.length;i++)if(r=t[i],ju(r-e)<=n)return r}(e[n],r[n],i)},Jw.prototype.initDefaults=function(e){var t=this;E(e||{},function(e,n){E(e,function(e){t.add(n,e)})})};function ex(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(e){i.initSnap(e)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],1250,function(e){var t=e.context,r=t.shape,o=t.snapContext,s=t.target;if((!e.originalEvent||!zs(e.originalEvent))&&!Wu(e)&&s){var a=o.pointsForTarget(s);a.initialized||((a=i.addSnapTargetPoints(a,r,s)).initialized=!0),n.snap(e,a)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}ex.$inject=["elementRegistry","eventBus","snapping"],ex.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new Zw);var s=(t=n.get(r.id)?Hu(r,e):{x:e.x+Hu(r).x,y:e.y+Hu(r).y}).x-r.width/2,a=t.y-r.height/2,l=t.x+r.width/2,c=t.y+r.height/2;return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),ln(r)||(o.setSnapOrigin("top-left",{x:s-e.x,y:a-e.y}),o.setSnapOrigin("bottom-right",{x:l-e.x,y:c-e.y})),o},ex.prototype.addSnapTargetPoints=function(e,t,n){return E(this.getSnapTargets(t,n),function(n){if(ln(n))ln(t)&&e.add("mid",Hu(n));else if(an(n)){if(n.waypoints.length<3)return;E(n.waypoints.slice(1,-1),function(t){e.add("mid",t)})}else e.add("mid",Hu(n))}),m(t.x)&&m(t.y)?(this._elementRegistry.get(t.id)&&e.add("mid",Hu(t)),e):e},ex.prototype.getSnapTargets=function(e,t){return Xu(t).filter(function(e){return!e.hidden})};function tx(e,t){t.invoke(ex,this),e.on(["create.move","create.end"],1500,nx),e.on(["create.move","create.end","shape.move.move","shape.move.end"],1500,function(e){var t=e.context,n=t.canExecute,i=t.target;n&&("attach"===n||n.attach)&&!Wu(e)&&function(e,t){var n,i=pn(t),r=Kd(e,t),o=e.context,s=o.shape;n=s.parent?{x:0,y:0}:fn(s);/top/.test(r)?Qu(e,"y",i.top-n.y):/bottom/.test(r)&&Qu(e,"y",i.bottom-n.y);/left/.test(r)?Qu(e,"x",i.left-n.x):/right/.test(r)&&Qu(e,"x",i.right-n.x)}(e,i)})}function nx(e){var t=e.context.createConstraints;if(t){var n=t.top,i=t.right,r=t.bottom,o=t.left;(o&&o>=e.x||i&&i<=e.x)&&Qu(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&Qu(e,"y",e.y)}}function ix(e,t){return-1!==e.indexOf(t)}function rx(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}e(tx,ex),tx.$inject=["eventBus","injector"],tx.prototype.initSnap=function(e){var t=ex.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return E(n.outgoing,function(n){var r=n.waypoints[0];r=r.original||r,t.setSnapOrigin(n.id+"-docking",rx(r,i,e))}),E(n.incoming,function(n){var r=n.waypoints[n.waypoints.length-1];r=r.original||r,t.setSnapOrigin(n.id+"-docking",rx(r,i,e))}),vr(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},tx.prototype.addSnapTargetPoints=function(e,t,n){ex.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);E(i,function(n){var i;(function(e){if(vr(e,"bpmn:SubProcess")&&Nr(e))return!0;return vr(e,"bpmn:Participant")}(n)||(i="bpmn:TextAnnotation",[t,n].every(function(e){return vr(e,i)})))&&(e.add("top-left",Fu(n)),e.add("bottom-right",qu(n)))});var r=this._elementRegistry;return E(t.incoming,function(n){if(r.get(t.id)){ix(i,n.source)||e.add("mid",fn(n.source));var o=n.waypoints[0];e.add(n.id+"-docking",o.original||o)}}),E(t.outgoing,function(n){if(r.get(t.id)){ix(i,n.target)||e.add("mid",fn(n.target));var o=n.waypoints[n.waypoints.length-1];e.add(n.id+"-docking",o.original||o)}}),vr(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},tx.prototype.getSnapTargets=function(e,t){var n=ex.prototype.getSnapTargets.call(this,e,t);return e.labelTarget&&e.labelTarget.parent&&e.labelTarget.parent!==t&&(n=n.concat(ex.prototype.getSnapTargets.call(this,e,e.labelTarget.parent))),n.filter(function(e,t){return!vr(e,"bpmn:Lane")&&n.indexOf(e)===t})};function ox(e,t){var n=this;e.on(["resize.start"],function(e){n.initSnap(e)}),e.on(["resize.move","resize.end"],1250,function(e){var i=e.context,r=i.shape,o=r.parent,s=i.direction,a=i.snapContext;if(!(e.originalEvent&&zs(e.originalEvent)||Wu(e))){var l=a.pointsForTarget(o);l.initialized||((l=n.addSnapTargetPoints(l,r,o,s)).initialized=!0),function(e){return"n"===e||"s"===e}(s)&&Qu(e,"x",e.x),function(e){return"e"===e||"w"===e}(s)&&Qu(e,"y",e.y),t.snap(e,l)}}),e.on(["resize.cleanup"],function(){t.hide()})}function sx(e,t){var n=fn(e),i=pn(e),r={x:n.x,y:n.y};return-1!==t.indexOf("n")?r.y=i.top:-1!==t.indexOf("s")&&(r.y=i.bottom),-1!==t.indexOf("e")?r.x=i.right:-1!==t.indexOf("w")&&(r.x=i.left),r}ox.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new Zw);var o=sx(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},ox.prototype.addSnapTargetPoints=function(e,t,n,i){return E(this.getSnapTargets(t,n),function(t){e.add("corner",qu(t)),e.add("corner",Fu(t))}),e.add("corner",sx(t,i)),e},ox.$inject=["eventBus","snapping"],ox.prototype.getSnapTargets=function(e,t){return Xu(t).filter(function(t){return!(n=t,i=e,n.host===i||an(t)||function(e){return!!e.hidden}(t)||ln(t));var n,i})};function ax(e){this._canvas=e,this._asyncHide=V(F(this.hide,this),1e3)}ax.$inject=["canvas"],ax.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:Wu(e,"x"),y:Wu(e,"y")};E(i,function(i){var o=n.getSnapOrigin(i),s={x:e.x+o.x,y:e.y+o.y};if(E(["x","y"],function(e){var n;r[e]||void 0!==(n=t.snap(s,i,e,7))&&(r[e]={value:n,originValue:n-o[e]})}),r.x&&r.y)return!1}),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),E(["x","y"],function(t){var n=r[t];f(n)&&Qu(e,t,n.originValue)})},ax.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=Pe("path");return be(n,{d:"M0,0 L0,0"}),xe(n).add("djs-snap-line"),ge(t,n),{update:function(t){m(t)?be(n,"horizontal"===e?{d:"M-100000,"+t+" L+100000,"+t,display:""}:{d:"M "+t+",-100000 L "+t+", +100000",display:""}):be(n,{display:"none"})}}},ax.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},ax.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},ax.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},ax.prototype.hide=function(){E(this._snapLines,function(e){e.update()})};var lx={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",ex],resizeSnapping:["type",ox],snapping:["type",ax]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Gw],createMoveSnapping:["type",tx]};function cx(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=de(cx.INPUT_SELECTOR,this._container),this._resultsContainer=de(cx.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy","drag.init","elements.changed"],this.close,this)}function ux(e,t,n){var i=function(e){var t="";return e.forEach(function(e){var n=Xo(e.value||e.matched||e.normal),i=e.match||e.matched;t+=i?'<b class="'+cx.RESULT_HIGHLIGHT_CLASS+'">'+n+"</b>":n}),""!==t?t:null}(t),r=Y(n);r.innerHTML=i,e.appendChild(r)}cx.$inject=["canvas","eventBus","selection","translate"],cx.prototype._bindEvents=function(){var e=this;function t(t,n,i,r){e._eventMaps.push({el:t,type:i,listener:pe.bind(t,n,i,r)})}t(document,"html","click",function(t){e.close(!1)}),t(this._container,cx.INPUT_SELECTOR,"click",function(e){e.stopPropagation(),e.delegateTarget.focus()}),t(this._container,cx.RESULT_SELECTOR,"mouseover",function(t){t.stopPropagation(),e._scrollToNode(t.delegateTarget),e._preselect(t.delegateTarget)}),t(this._container,cx.RESULT_SELECTOR,"click",function(t){t.stopPropagation(),e._select(t.delegateTarget)}),t(this._container,cx.INPUT_SELECTOR,"keydown",function(e){js("ArrowUp",e)&&e.preventDefault(),js("ArrowDown",e)&&e.preventDefault()}),t(this._container,cx.INPUT_SELECTOR,"keyup",function(t){if(js("Escape",t))return e.close();if(js("Enter",t)){var n=e._getCurrentResult();return n?e._select(n):e.close(!1)}return js("ArrowUp",t)?e._scrollToDirection(!0):js("ArrowDown",t)?e._scrollToDirection():void(js(["ArrowLeft","ArrowRight"],t)||e._search(t.delegateTarget.value))})},cx.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){pe.unbind(e.el,e.type,e.listener)})},cx.prototype._search=function(e){var t=this;if(this._clearResults(),e.trim()){var n=this._searchProvider.find(e);if((n=n.filter(function(e){return!t._canvas.getRootElements().includes(e.element)})).length){n.forEach(function(e){var n=e.element.id,i=t._createResultNode(e,n);t._results[n]={element:e.element,node:i}});var i=de(cx.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}else this._selection.select(null)}},cx.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},cx.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)}},cx.prototype._clearResults=function(){ie(this._resultsContainer),this._results={},this._eventBus.fire("searchPad.cleared")},cx.prototype._getCurrentResult=function(){return de(cx.RESULT_SELECTED_SELECTOR,this._resultsContainer)},cx.prototype._createResultNode=function(e,t){var n=Y(cx.RESULT_HTML);return e.primaryTokens.length>0&&ux(n,e.primaryTokens,cx.RESULT_PRIMARY_HTML),ux(n,e.secondaryTokens,cx.RESULT_SECONDARY_HTML),J(n,cx.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},cx.prototype.registerProvider=function(e){this._searchProvider=e},cx.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,te(this._canvas.getContainer()).add("djs-search-open"),te(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},cx.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,te(this._canvas.getContainer()).remove("djs-search-open"),te(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._eventBus.fire("searchPad.closed"),this._canvas.restoreFocus())},cx.prototype.toggle=function(){this.isOpen()?this.close():this.open()},cx.prototype.isOpen=function(){return this._open},cx.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&te(t).remove(cx.RESULT_SELECTED_CLASS);var n=J(e,cx.RESULT_ID_ATTRIBUTE),i=this._results[n].element;te(e).add(cx.RESULT_SELECTED_CLASS),this._canvas.scrollToElement(i,{top:300}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},cx.prototype._select=function(e){var t=J(e,cx.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this._cachedSelection=null,this._cachedViewbox=null,this.close(!1),this._canvas.scrollToElement(n,{top:300}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},cx.prototype._getBoxHtml=function(){const e=Y(cx.BOX_HTML),t=de(cx.INPUT_SELECTOR,e);return t&&t.setAttribute("aria-label",this._translate("Search in diagram")),e},cx.CONTAINER_SELECTOR=".djs-search-container",cx.INPUT_SELECTOR=".djs-search-input input",cx.RESULTS_CONTAINER_SELECTOR=".djs-search-results",cx.RESULT_SELECTOR=".djs-search-result",cx.RESULT_SELECTED_CLASS="djs-search-result-selected",cx.RESULT_SELECTED_SELECTOR="."+cx.RESULT_SELECTED_CLASS,cx.RESULT_ID_ATTRIBUTE="data-result-id",cx.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",cx.BOX_HTML='<div class="djs-search-container djs-scrollable">\n <div class="djs-search-input">\n <svg class="djs-search-icon" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <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"/>\n </svg>\n <input type="text" spellcheck="false" />\n </div>\n <div class="djs-search-results" />\n</div>',cx.RESULT_HTML='<div class="djs-search-result"></div>',cx.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',cx.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';var px={__depends__:[Oo,No,As],searchPad:["type",cx]};function hx(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._search=i,t.registerProvider(this)}function dx(e){const{item:{element:t},tokens:n}=e;return{element:t,primaryTokens:n.label,secondaryTokens:n.id}}hx.$inject=["elementRegistry","searchPad","canvas","search"],hx.prototype.find=function(e){var t=this._canvas.getRootElements(),n=this._elementRegistry.filter(function(e){return!ln(e)&&!t.includes(e)});return this._search(n.map(e=>({element:e,label:Ur(e),id:e.id})),e,{keys:["label","id"]}).map(dx)};var fx={__depends__:[px,vc],__init__:["bpmnSearch"],bpmnSearch:["type",hx]};const mx={width:36,height:50},gx={width:50,height:50};function vx(e,t,n){return Pe("path",{d:e,strokeWidth:2,transform:`translate(${t.x}, ${t.y})`,...n})}function yx(e,t){this._styles=t,e.registerProvider(this)}function bx(e,t){var n;return"bpmn:DataObjectReference"===t?n=mx:"bpmn:DataStoreReference"===t&&(n=gx),e.width===n.width&&e.height===n.height}yx.$inject=["outline","styles"],yx.prototype.getOutline=function(e){const t=this._styles.cls("djs-outline",["no-fill"]);var n;return function(e){return ln(e)&&Hr(e.labelTarget)}(e)?(be(n=Pe("rect"),q({x:-5,y:-5,rx:4,width:e.width+10,height:e.height+10},t)),n):ln(e)?void 0:(vr(e,"bpmn:Gateway")?(q((n=Pe("rect")).style,{"transform-box":"fill-box",transform:"rotate(45deg)","transform-origin":"center"}),be(n,q({x:2,y:2,rx:4,width:e.width-4,height:e.height-4},t))):yr(e,["bpmn:Task","bpmn:SubProcess","bpmn:Group","bpmn:CallActivity"])?be(n=Pe("rect"),q({x:-5,y:-5,rx:14,width:e.width+10,height:e.height+10},t)):vr(e,"bpmn:EndEvent")?be(n=Pe("circle"),q({cx:e.width/2,cy:e.height/2,r:e.width/2+5+1},t)):vr(e,"bpmn:Event")?be(n=Pe("circle"),q({cx:e.width/2,cy:e.height/2,r:e.width/2+5},t)):vr(e,"bpmn:DataObjectReference")&&bx(e,"bpmn:DataObjectReference")?n=vx("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",{x:-6,y:-6},t):vr(e,"bpmn:DataStoreReference")&&bx(e,"bpmn:DataStoreReference")&&(n=vx("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",{x:-6,y:-6},t)),n)},yx.prototype.updateOutline=function(e,t){if(!ln(e))return yr(e,["bpmn:SubProcess","bpmn:Group"])?(be(t,{width:e.width+10,height:e.height+10}),!0):!!yr(e,["bpmn:Event","bpmn:Gateway","bpmn:DataStoreReference","bpmn:DataObjectReference"])};var wx={__depends__:[Hb],__init__:["outlineProvider"],outlineProvider:["type",yx]};function xx(e){Ir.call(this,e)}e(xx,Ir),xx.Viewer=Ts,xx.NavigatedViewer=fa,xx.prototype.createDiagram=function(){return this.importXML('<?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>')},xx.prototype._interactionModules=[Ms,Js,aa,da],xx.prototype._modelingModules=[kc,zc,eu,Hc,Ku,ip,op,zy,cm,Yf,Qy,Zy,db,mb,yb,Eb,Vb,Ub,ry,iw,hw,Fw,Hw,Db,lx,fx,wx],xx.prototype._modules=[].concat(Ts.prototype._modules,xx.prototype._interactionModules,xx.prototype._modelingModules);var _x,Ex,Sx,kx,Ox,Cx,Px,Ax,Tx,Rx,Mx,$x,Dx,Bx,Lx,Ix={},Nx=[],zx=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,jx=Array.isArray;function Vx(e,t){for(var n in t)e[n]=t[n];return e}function Fx(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function qx(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?_x.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Hx(e,s,i,r,null)}function Hx(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:null==r?++Sx:r,__i:-1,__u:0};return null==r&&null!=Ex.vnode&&Ex.vnode(o),o}function Wx(e){return e.children}function Qx(e,t){this.props=e,this.context=t}function Xx(e,t){if(null==t)return e.__?Xx(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Xx(e):null}function Gx(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,i=[],r=[],o=Vx({},t);o.__v=t.__v+1,Ex.vnode&&Ex.vnode(o),o_(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,i,null==n?Xx(t):n,!!(32&t.__u),r),o.__v=t.__v,o.__.__k[o.__i]=o,a_(i,o,r),t.__e=t.__=null,o.__e!=n&&Ux(o)}}function Ux(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),Ux(e)}function Yx(e){(!e.__d&&(e.__d=!0)&&kx.push(e)&&!Kx.__r++||Ox!=Ex.debounceRendering)&&((Ox=Ex.debounceRendering)||Cx)(Kx)}function Kx(){try{for(var e,t=1;kx.length;)kx.length>t&&kx.sort(Px),e=kx.shift(),t=kx.length,Gx(e)}finally{kx.length=Kx.__r=0}}function Zx(e,t,n,i,r,o,s,a,l,c,u){var p,h,d,f,m,g,v=i&&i.__k||Nx,y=t.length;for(l=function(e,t,n,i,r){var o,s,a,l,c,u=n.length,p=u,h=0;for(e.__k=new Array(r),o=0;o<r;o++)null!=(s=t[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[o]=Hx(null,s,null,null,null):jx(s)?s=e.__k[o]=Hx(Wx,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[o]=Hx(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,l=o+h,s.__=e,s.__b=e.__b+1,a=null,-1!=(c=s.__i=t_(s,n,l,p))&&(p--,(a=n[c])&&(a.__u|=2)),null==a||null==a.__v?(-1==c&&(r>u?h--:r<u&&h++),"function"!=typeof s.type&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):e.__k[o]=null;if(p)for(o=0;o<u;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==i&&(i=Xx(a)),p_(a,a));return i}(n,t,v,l,y),p=0;p<y;p++)null!=(d=n.__k[p])&&(h=-1!=d.__i&&v[d.__i]||Ix,d.__i=p,g=o_(e,d,h,r,o,s,a,l,c,u),f=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&u_(h.ref,null,d),u.push(d.ref,d.__c||f,d)),null==m&&null!=f&&(m=f),4&d.__u?(l=Jx(d,l,e),h.__e&&(h.__e=null)):"function"==typeof d.type&&void 0!==g?l=g:f&&(l=f.nextSibling),d.__u&=-7);return n.__e=m,l}function Jx(e,t,n){var i,r;if("function"==typeof e.type){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=Jx(i[r],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=Xx(e)),t=n.insertBefore(e.__e,t||null));do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function e_(e,t){return t=t||[],null==e||"boolean"==typeof e||(jx(e)?e.some(function(e){e_(e,t)}):t.push(e)),t}function t_(e,t,n,i){var r,o,s,a=e.key,l=e.type,c=t[n],u=null!=c&&!(2&c.__u);if(null===c&&null==a||u&&a==c.key&&l==c.type)return n;if(i>(u?1:0))for(r=n-1,o=n+1;r>=0||o<t.length;)if(null!=(c=t[s=r>=0?r--:o++])&&!(2&c.__u)&&a==c.key&&l==c.type)return s;return-1}function n_(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||zx.test(t)?n:n+"px"}function i_(e,t,n,i,r){var o,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||n_(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||n_(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(Mx,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n[Rx]=i[Rx]:(n[Rx]=$x,e.addEventListener(t,o?Bx:Dx,o)):e.removeEventListener(t,o?Bx:Dx,o);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function r_(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[Tx])t[Tx]=$x++;else if(t[Tx]<n[Rx])return;return n(Ex.event?Ex.event(t):t)}}}function o_(e,t,n,i,r,o,s,a,l,c){var u,p,h,d,f,m,g,v,y,b,w,x,_,E,S,k,O=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=t.__e=n.__e]),(u=Ex.__b)&&u(t);e:if("function"==typeof O){p=s.length;try{if(y=t.props,b=O.prototype&&O.prototype.render,w=(u=O.contextType)&&i[u.__c],x=u?w?w.props.value:u.__:i,n.__c?v=(h=t.__c=n.__c).__=h.__E:(b?t.__c=h=new O(y,x):(t.__c=h=new Qx(y,x),h.constructor=O,h.render=h_),w&&w.sub(h),h.state||(h.state={}),h.__n=i,d=h.__d=!0,h.__h=[],h._sb=[]),b&&null==h.__s&&(h.__s=h.state),b&&null!=O.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=Vx({},h.__s)),Vx(h.__s,O.getDerivedStateFromProps(y,h.__s))),f=h.props,m=h.state,h.__v=t,d)b&&null==O.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),b&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(b&&null==O.getDerivedStateFromProps&&y!==f&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,x),t.__v==n.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,x)){t.__v!=n.__v&&(h.props=y,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),Nx.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&s.push(h),a=Xx(n);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,x),b&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(f,m,g)})}if(h.context=x,h.props=y,h.__P=e,h.__e=!1,_=Ex.__r,E=0,b)h.state=h.__s,h.__d=!1,_&&_(t),u=h.render(h.props,h.state,h.context),Nx.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,_&&_(t),u=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++E<25);h.state=h.__s,null!=h.getChildContext&&(i=Vx(Vx({},i),h.getChildContext())),b&&!d&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(f,m)),S=null!=u&&u.type===Wx&&null==u.key?l_(u.props.children):u,a=Zx(e,jx(S)?S:[S],t,n,i,r,o,s,a,l,c),h.base=t.__e,t.__u&=-161,h.__h.length&&s.push(h),v&&(h.__E=h.__=null)}catch(e){if(s.length=p,t.__v=null,l||null!=o){if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=o&&(o[o.indexOf(a)]=null),t.__e=a}else if(null!=o)for(k=o.length;k--;)Fx(o[k])}else t.__e=n.__e;null==t.__k&&(t.__k=n.__k||[]),e.then||s_(t),Ex.__e(e,t,n)}}else null==o&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=c_(n.__e,t,n,i,r,o,s,l,c);return(u=Ex.diffed)&&u(t),128&t.__u?void 0:a}function s_(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(s_))}function a_(e,t,n){for(var i=0;i<n.length;i++)u_(n[i],n[++i],n[++i]);Ex.__c&&Ex.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){Ex.__e(e,t.__v)}})}function l_(e){return"object"!=typeof e||null==e||e.__b>0?e:jx(e)?e.map(l_):void 0!==e.constructor?null:Vx({},e)}function c_(e,t,n,i,r,o,s,a,l){var c,u,p,h,d,f,m,g=n.props||Ix,v=t.props,y=t.type;if("svg"==y?r="http://www.w3.org/2000/svg":"math"==y?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=o)for(c=0;c<o.length;c++)if((d=o[c])&&"setAttribute"in d==!!y&&(y?d.localName==y:3==d.nodeType)){e=d,o[c]=null;break}if(null==e){if(null==y)return document.createTextNode(v);e=document.createElementNS(r,y,v.is&&v),a&&(Ex.__m&&Ex.__m(t,o),a=!1),o=null}if(null==y)g===v||a&&e.data==v||(e.data=v);else{if(o="textarea"==y&&null!=v.defaultValue?null:o&&_x.call(e.childNodes),!a&&null!=o)for(g={},c=0;c<e.attributes.length;c++)g[(d=e.attributes[c]).name]=d.value;for(c in g)d=g[c],"dangerouslySetInnerHTML"==c?p=d:"children"==c||c in v||"value"==c&&"defaultValue"in v||"checked"==c&&"defaultChecked"in v||i_(e,c,null,d,r);for(c in v)d=v[c],"children"==c?h=d:"dangerouslySetInnerHTML"==c?u=d:"value"==c?f=d:"checked"==c?m=d:a&&"function"!=typeof d||g[c]===d||i_(e,c,d,g[c],r);if(u)a||p&&(u.__html==p.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(p&&(e.innerHTML=""),Zx("template"==t.type?e.content:e,jx(h)?h:[h],t,n,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&Xx(n,0),a,l),null!=o)for(c=o.length;c--;)Fx(o[c]);a&&"textarea"!=y||(c="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[c]||"progress"==y&&!f||"option"==y&&f!=g[c])&&i_(e,c,f,g[c],r),c="checked",null!=m&&m!=e[c]&&i_(e,c,m,g[c],r))}return e}function u_(e,t,n){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Ex.__e(e,n)}}function p_(e,t,n){var i,r;if(Ex.unmount&&Ex.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||u_(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Ex.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&p_(i[r],t,n||"function"!=typeof e.type);n||Fx(e.__e),e.__c=e.__=e.__e=void 0}function h_(e,t,n){return this.constructor(e,n)}function d_(e,t,n){var i,r,o,s;t==document&&(t=document.documentElement),Ex.__&&Ex.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],s=[],o_(t,e=(!i&&n||t).__k=qx(Wx,null,[e]),r||Ix,Ix,t.namespaceURI,!i&&n?[n]:r?null:t.firstChild?_x.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i,s),a_(o,e,s),e.props.children=null}function f_(e,t,n){var i,r,o,s,a=Vx({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=void 0===t[o]&&null!=s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?_x.call(arguments,2):n),Hx(e.type,a,i||e.key,r||e.ref,null)}function m_(e){function t(e){var n,i;return this.getChildContext||(n=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,Yx(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Lx++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}_x=Nx.slice,Ex={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},Sx=0,Qx.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Vx({},this.state),"function"==typeof e&&(e=e(Vx({},n),this.props)),e&&Vx(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Yx(this))},Qx.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Yx(this))},Qx.prototype.render=Wx,kx=[],Cx="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Px=function(e,t){return e.__v.__b-t.__v.__b},Kx.__r=0,Ax=Math.random().toString(8),Tx="__d"+Ax,Rx="__a"+Ax,Mx=/(PointerCapture)$|Capture$/i,$x=0,Dx=r_(!1),Bx=r_(!0),Lx=0;var g_,v_,y_,b_,w_=0,x_=[],__=Ex,E_=__.__b,S_=__.__r,k_=__.diffed,O_=__.__c,C_=__.unmount,P_=__.__;function A_(e,t){__.__h&&__.__h(v_,e,w_||t),w_=0;var n=v_.__H||(v_.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function T_(e){return w_=1,R_(H_,e)}function R_(e,t,n){var i=A_(g_++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):H_(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=v_,!v_.__f)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=!1,s=i.__c.props!==e;if(i.__c.__H.__.some(function(e){if(e.__N){r=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),o){var a=o.call(this,e,t,n);return r?a||s:a}return!r||s};v_.__f=!0;var o=v_.shouldComponentUpdate,s=v_.componentWillUpdate;v_.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}s&&s.call(this,e,t,n)},v_.shouldComponentUpdate=r}return i.__N||i.__}function M_(e,t){var n=A_(g_++,3);!__.__s&&q_(n.__H,t)&&(n.__=e,n.u=t,v_.__H.__h.push(n))}function $_(e,t){var n=A_(g_++,4);!__.__s&&q_(n.__H,t)&&(n.__=e,n.u=t,v_.__h.push(n))}function D_(e){return w_=5,B_(function(){return{current:e}},[])}function B_(e,t){var n=A_(g_++,7);return q_(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function L_(e,t){return w_=8,B_(function(){return e},t)}function I_(e){var t=v_.context[e.__c],n=A_(g_++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(v_)),t.props.value):e.__}function N_(){for(var e;e=x_.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(V_),t.__h.some(F_),t.__h=[]}catch(n){t.__h=[],__.__e(n,e.__v)}}}__.__b=function(e){v_=null,E_&&E_(e)},__.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),P_&&P_(e,t)},__.__r=function(e){S_&&S_(e),g_=0;var t=(v_=e.__c).__H;t&&(y_===v_?(t.__h=[],v_.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(V_),t.__h.some(F_),t.__h=[],g_=0)),y_=v_},__.diffed=function(e){k_&&k_(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==x_.push(t)&&b_===__.requestAnimationFrame||((b_=__.requestAnimationFrame)||j_)(N_)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),y_=v_=null},__.__c=function(e,t){t.some(function(e){try{e.__h.some(V_),e.__h=e.__h.filter(function(e){return!e.__||F_(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],__.__e(n,e.__v)}}),O_&&O_(e,t)},__.unmount=function(e){C_&&C_(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{V_(e)}catch(e){t=e}}),n.__H=void 0,t&&__.__e(t,n.__v))};var z_="function"==typeof requestAnimationFrame;function j_(e){var t,n=function(){clearTimeout(i),z_&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);z_&&(t=requestAnimationFrame(n))}function V_(e){var t=v_,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),v_=t}function F_(e){var t=v_;e.__c=e.__(),v_=t}function q_(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function H_(e,t){return"function"==typeof t?t(e):t}function W_(e,t){for(var n in t)e[n]=t[n];return e}function Q_(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var i in t)if("__source"!==i&&e[i]!==t[i])return!0;return!1}function X_(e,t){this.props=e,this.context=t}(X_.prototype=new Qx).isPureReactComponent=!0,X_.prototype.shouldComponentUpdate=function(e,t){return Q_(this.props,e)||Q_(this.state,t)};var G_=Ex.__b;Ex.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),G_&&G_(e)};var U_="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Y_(e){function t(t){var n=W_({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=U_,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var K_=Ex.__e;Ex.__e=function(e,t,n,i){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k||[]),r.__c(e,t);K_(e,t,n,i)};var Z_=Ex.unmount;function J_(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=W_({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return J_(e,t,n)})),e}function eE(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return eE(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function tE(){this.__u=0,this.o=null,this.__b=null}function nE(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function iE(){this.i=null,this.l=null}Ex.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Z_&&Z_(e)},(tE.prototype=new Qx).__c=function(e,t){var n=t.__c,i=this;null==i.o&&(i.o=[]),i.o.push(n);var r=nE(i.__v),o=!1,s=function(){o||i.__z||(o=!0,n.__R=null,r?r(l):l())};n.__R=s;var a=n.__P;n.__P=null;var l=function(){if(! --i.__u){if(i.state.__a){var e=i.state.__a;i.__v.__k[0]=eE(e,e.__c.__P,e.__c.__O)}var t;for(i.setState({__a:i.__b=null});t=i.o.pop();)t.__P=a,t.forceUpdate()}};i.__u++||32&t.__u||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(s,s)},tE.prototype.componentWillUnmount=function(){this.o=[]},tE.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=J_(this.__b,n,i.__O=i.__P)}this.__b=null}var r=t.__a&&qx(Wx,null,e.fallback);return r&&(r.__u&=-33),[qx(Wx,null,t.__a?null:e.children),r]};var rE=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function oE(e){return this.getChildContext=function(){return e.context},e.children}function sE(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){d_(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var i=t.__v;null!==i&&!i.__m&&null!==i.__;)i=i.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:i.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}d_(qx(oE,{context:t.context},e.__v),t.v)}function aE(e,t){var n=qx(sE,{__v:e,h:t});return n.containerInfo=t,n}(iE.prototype=new Qx).__a=function(e){var t=this,n=nE(t.__v),i=t.l.get(e);return i[0]++,function(r){var o=function(){t.props.revealOrder?(i.push(r),rE(t,e,i)):r()};n?n(o):o()}},iE.prototype.render=function(e){this.i=null,this.l=new Map;var t=e_(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},iE.prototype.componentDidUpdate=iE.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){rE(e,n,t)})};var lE="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,cE=/^(?: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]/,uE=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,pE=/[A-Z0-9]/g,hE="undefined"!=typeof document,dE=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};Qx.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Qx.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var fE=Ex.event;Ex.event=function(e){return fE&&(e=fE(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var mE={configurable:!0,get:function(){return this.class}},gE=Ex.vnode;Ex.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,i={},r=-1==n.indexOf("-");for(var o in t){var s=t[o];if(!("value"===o&&"defaultValue"in t&&null==s||hE&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===s?s="":"translate"===a&&"no"===s?s=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||dE(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":uE.test(o)&&(o=a):a=o="oninput":r&&cE.test(o)?o=o.replace(pE,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===a&&i[o=a]&&(o="oninputCapture"),i[o]=s}}"select"==n&&(i.multiple&&Array.isArray(i.value)&&(i.value=e_(t.children).forEach(function(e){e.props.selected=-1!=i.value.indexOf(e.props.value)})),null!=i.defaultValue&&(i.value=e_(t.children).forEach(function(e){e.props.selected=i.multiple?-1!=i.defaultValue.indexOf(e.props.value):i.defaultValue==e.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",mE)):t.className&&(i.class=i.className=t.className),e.props=i}(e),e.$$typeof=lE,gE&&gE(e)};var vE=Ex.__r;Ex.__r=function(e){vE&&vE(e),e.__c};var yE=Ex.diffed;Ex.diffed=function(e){yE&&yE(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};var bE=function(e,t){var n,i=Ex.debounceRendering;Ex.debounceRendering=function(e){n=e};try{var r=e(t);return n&&n(),r}finally{Ex.debounceRendering=i}},wE=qx,xE=0;function _E(e,t,n,i,r,o){t||(t={});var s,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--xE,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return Ex.vnode&&Ex.vnode(c),c}function EE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function SE(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch(e){}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}),n}var kE,OE={exports:{}};
334
+ /*!
335
+ Copyright (c) 2018 Jed Watson.
336
+ Licensed under the MIT License (MIT), see
337
+ http://jedwatson.github.io/classnames
338
+ */var CE,PE=(kE||(kE=1,CE=OE,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=i(e,n(r)))}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var r="";for(var o in n)e.call(n,o)&&n[o]&&(r=i(r,o));return r}function i(e,t){return t?e?e+" "+t:e+t:e}CE.exports?(t.default=t,CE.exports=t):window.classNames=t}()),OE.exports),AE=EE(PE);let TE=[],RE=[];function ME(e){if(e<768)return!1;for(let t=0,n=TE.length;;){let i=t+n>>1;if(e<TE[i])n=i;else{if(!(e>=RE[i]))return!0;t=i+1}if(t==n)return!1}}function $E(e){return e>=127462&&e<=127487}(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?RE:TE).push(n+=e[t])})();function DE(e,t,n=!0,i=!0){return(n?BE:LE)(e,t,i)}function BE(e,t,n){if(t==e.length)return t;t&&NE(e.charCodeAt(t))&&zE(e.charCodeAt(t-1))&&t--;let i=IE(e,t);for(t+=jE(i);t<e.length;){let r=IE(e,t);if(8205==i||8205==r||n&&ME(r))t+=jE(r),i=r;else{if(!$E(r))break;{let n=0,i=t-2;for(;i>=0&&$E(IE(e,i));)n++,i-=2;if(n%2==0)break;t+=2}}}return t}function LE(e,t,n){for(;t>1;){let i=BE(e,t-2,n);if(i<t)return i;t--}return 0}function IE(e,t){let n=e.charCodeAt(t);if(!zE(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return NE(i)?i-56320+(n-55296<<10)+65536:n}function NE(e){return e>=56320&&e<57344}function zE(e){return e>=55296&&e<56320}function jE(e){return e<65536?1:2}class VE{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=YE(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),qE.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=YE(this,e,t);let n=[];return this.decompose(e,t,n,0),qE.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new QE(this),r=new QE(e);for(let e=t,o=t;;){if(i.next(e),r.next(e),e=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new QE(this,e)}iterRange(e,t=this.length){return new XE(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new GE(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new FE(e):qE.from(FE.split(e,[])):VE.empty}}class FE extends VE{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let o=this.text[r],s=i+o.length;if((t?n:s)>=e)return new UE(i,s,n,o);i=s+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new FE(WE(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=HE(r.text,e.text.slice(),0,r.length);if(t.length<=32)n.push(new FE(t,e.length+r.length));else{let e=t.length>>1;n.push(new FE(t.slice(0,e)),new FE(t.slice(e)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof FE))return super.replace(e,t,n);[e,t]=YE(this,e,t);let i=HE(this.text,HE(n.text,WE(this.text,0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new FE(i,r):qE.from(FE.split(i,[]),r)}sliceString(e,t=this.length,n="\n"){[e,t]=YE(this,e,t);let i="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let s=this.text[o],a=r+s.length;r>e&&o&&(i+=n),e<a&&t>r&&(i+=s.slice(Math.max(0,e-r),t-r)),r=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,32==n.length&&(t.push(new FE(n,i)),n=[],i=-1);return i>-1&&t.push(new FE(n,i)),t}}class qE extends VE{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,i){for(let r=0;;r++){let o=this.children[r],s=i+o.length,a=n+o.lines-1;if((t?a:s)>=e)return o.lineInner(e,t,n,i);i=s+1,n=a+1}}decompose(e,t,n,i){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let s=this.children[r],a=o+s.length;if(e<=a&&t>=o){let r=i&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!r?n.push(s):s.decompose(e-o,t-o,n,r)}o=a+1}}replace(e,t,n){if([e,t]=YE(this,e,t),n.lines<this.lines)for(let i=0,r=0;i<this.children.length;i++){let o=this.children[i],s=r+o.length;if(e>=r&&t<=s){let a=o.replace(e-r,t-r,n),l=this.lines-o.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let r=this.children.slice();return r[i]=a,new qE(r,this.length-(t-e)+n.length)}return super.replace(r,s,a)}r=s+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=YE(this,e,t);let i="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let s=this.children[r],a=o+s.length;o>e&&r&&(i+=n),e<a&&t>o&&(i+=s.sliceString(e-o,t-o,n)),o=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof qE))return 0;let n=0,[i,r,o,s]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==o||r==s)return n;let a=this.children[i],l=e.children[r];if(a!=l)return n+a.scanIdentical(l,t);n+=a.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new FE(n,t)}let i=Math.max(32,n>>5),r=i<<1,o=i>>1,s=[],a=0,l=-1,c=[];function u(e){let t;if(e.lines>r&&e instanceof qE)for(let t of e.children)u(t);else e.lines>o&&(a>o||!a)?(p(),s.push(e)):e instanceof FE&&a&&(t=c[c.length-1])instanceof FE&&e.lines+t.lines<=32?(a+=e.lines,l+=e.length+1,c[c.length-1]=new FE(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>i&&p(),a+=e.lines,l+=e.length+1,c.push(e))}function p(){0!=a&&(s.push(1==c.length?c[0]:qE.from(c,l)),l=-1,a=c.length=0)}for(let t of e)u(t);return p(),1==s.length?s[0]:new qE(s,t)}}function HE(e,t,n=0,i=1e9){for(let r=0,o=0,s=!0;o<e.length&&r<=i;o++){let a=e[o],l=r+a.length;l>=n&&(l>i&&(a=a.slice(0,i-r)),r<n&&(a=a.slice(n-r)),s?(t[t.length-1]+=a,s=!1):t.push(a)),r=l+1}return t}function WE(e,t,n){return HE(e,[""],t,n)}VE.empty=new FE([""],0);class QE{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof FE?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],o=r>>1,s=i instanceof FE?i.text.length:i.children.length;if(o==(t>0?s:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof FE){let r=i.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=i.children[o+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof FE?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class XE{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new QE(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class GE{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(VE.prototype[Symbol.iterator]=function(){return this.iter()},QE.prototype[Symbol.iterator]=XE.prototype[Symbol.iterator]=GE.prototype[Symbol.iterator]=function(){return this});let UE=class{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}};function YE(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function KE(e,t,n=!0,i=!0){return DE(e,t,n,i)}function ZE(e,t){let n=e.charCodeAt(t);if(!(i=n,i>=55296&&i<56320&&t+1!=e.length))return n;var i;let r=e.charCodeAt(t+1);return function(e){return e>=56320&&e<57344}(r)?r-56320+(n-55296<<10)+65536:n}function JE(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function eS(e){return e<65536?1:2}const tS=/\r\n?|\n/;var nS=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(nS||(nS={}));class iS{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(n,i,r),i+=r):i+=o,n+=r}}iterChangedRanges(e,t=!1){aS(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new iS(e)}composeDesc(e){return this.empty?e:e.empty?this:cS(this,e)}mapDesc(e,t=!1){return e.empty?this:lS(this,e,t)}mapPos(e,t=-1,n=nS.Simple){let i=0,r=0;for(let o=0;o<this.sections.length;){let s=this.sections[o++],a=this.sections[o++],l=i+s;if(a<0){if(l>e)return r+(e-i);r+=s}else{if(n!=nS.Simple&&l>=e&&(n==nS.TrackDel&&i<e&&l>e||n==nS.TrackBefore&&i<e||n==nS.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!s)return e==i||t<0?r:r+a;r+=a}i=l}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let r=i+this.sections[n++];if(this.sections[n++]>=0&&i<=t&&r>=e)return!(i<e&&r>t)||"cover";i=r}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeDesc");return new iS(e)}static create(e){return new iS(e)}}class rS extends iS{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return aS(this,(t,n,i,r,o)=>e=e.replace(i,i+(n-t),o),!1),e}mapDesc(e,t=!1){return lS(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i<t.length;i+=2){let o=t[i],s=t[i+1];if(s>=0){t[i]=s,t[i+1]=o;let a=i>>1;for(;n.length<a;)n.push(VE.empty);n.push(o?e.slice(r,r+o):VE.empty)}r+=o}return new rS(t,n)}compose(e){return this.empty?e:e.empty?this:cS(this,e,!0)}map(e,t=!1){return e.empty?this:lS(this,e,t,!0)}iterChanges(e,t=!1){aS(this,e,t)}get desc(){return iS.create(this.sections)}filter(e){let t=[],n=[],i=[],r=new uS(this);e:for(let o=0,s=0;;){let a=o==e.length?1e9:e[o++];for(;s<a||s==a&&0==r.len;){if(r.done)break e;let e=Math.min(r.len,a-s);oS(i,e,-1);let o=-1==r.ins?-1:0==r.off?r.ins:0;oS(t,e,o),o>0&&sS(n,t,r.text),r.forward(e),s+=e}let l=e[o++];for(;s<l;){if(r.done)break e;let e=Math.min(r.len,l-s);oS(t,e,-1),oS(i,e,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(e),s+=e}}return{changes:new rS(t,n),filtered:iS.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):0==i?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],o=0,s=null;function a(e=!1){if(!e&&!i.length)return;o<t&&oS(i,t-o,-1);let n=new rS(i,r);s=s?s.compose(n.map(s)):n,i=[],r=[],o=0}return function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof rS){if(l.length!=t)throw new RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);a(),s=s?s.compose(l.map(s)):l}else{let{from:e,to:s=e,insert:c}=l;if(e>s||e<0||s>t)throw new RangeError(`Invalid change range ${e} to ${s} (in doc of length ${t})`);let u=c?"string"==typeof c?VE.of(c.split(n||tS)):c:VE.empty,p=u.length;if(e==s&&0==p)return;e<o&&a(),e>o&&oS(i,e-o,-1),oS(i,s-e,p),sS(r,i,u),o=s}}(e),a(!s),s}static empty(e){return new rS(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let r=e[i];if("number"==typeof r)t.push(r,-1);else{if(!Array.isArray(r)||"number"!=typeof r[0]||r.some((e,t)=>t&&"string"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;n.length<i;)n.push(VE.empty);n[i]=VE.of(r.slice(1)),t.push(r[0],n[i].length)}}}return new rS(t,n)}static createSet(e,t){return new rS(e,t)}}function oS(e,t,n,i=!1){if(0==t&&n<=0)return;let r=e.length-2;r>=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&0==t&&0==e[r]?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function sS(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<i;)e.push(VE.empty);e.push(n)}}function aS(e,t,n){let i=e.inserted;for(let r=0,o=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)r+=a,o+=a;else{let c=r,u=o,p=VE.empty;for(;c+=a,u+=l,l&&i&&(p=p.append(i[s-2>>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(r,c,o,u,p),r=c,o=u}}}function lS(e,t,n,i=!1){let r=[],o=i?[]:null,s=new uS(e),a=new uS(t);for(let e=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);oS(r,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(a.len<s.len||a.len==s.len&&!n))){let t=a.len;for(oS(r,a.ins,-1);t;){let n=Math.min(s.len,t);s.ins>=0&&e<s.i&&s.len<=n&&(oS(r,0,s.ins),o&&sS(o,r,s.text),e=s.i),s.forward(n),t-=n}a.next()}else{if(!(s.ins>=0)){if(s.done&&a.done)return o?rS.createSet(r,o):iS.create(r);throw new Error("Mismatched change set lengths")}{let t=0,n=s.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else{if(!(0==a.ins&&a.len<n))break;n-=a.len,a.next()}oS(r,t,e<s.i?s.ins:0),o&&e<s.i&&sS(o,r,s.text),e=s.i,s.forward(s.len-n)}}}}function cS(e,t,n=!1){let i=[],r=n?[]:null,o=new uS(e),s=new uS(t);for(let e=!1;;){if(o.done&&s.done)return r?rS.createSet(i,r):iS.create(i);if(0==o.ins)oS(i,o.len,0,e),o.next();else if(0!=s.len||s.done){if(o.done||s.done)throw new Error("Mismatched change set lengths");{let t=Math.min(o.len2,s.len),n=i.length;if(-1==o.ins){let n=-1==s.ins?-1:s.off?0:s.ins;oS(i,t,n,e),r&&n&&sS(r,i,s.text)}else-1==s.ins?(oS(i,o.off?0:o.len,t,e),r&&sS(r,i,o.textBit(t))):(oS(i,o.off?0:o.len,s.off?0:s.ins,e),r&&!s.off&&sS(r,i,s.text));e=(o.ins>t||s.ins>=0&&s.len>t)&&(e||i.length>n),o.forward2(t),s.forward(t)}}else oS(i,0,s.ins,e),r&&sS(r,i,s.text),s.next()}}class uS{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?VE.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?VE.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class pS{constructor(e,t,n,i){this.from=e,this.to=t,this.flags=n,this.goalColumn=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get undirectional(){return(64&this.flags)>0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new pS(n,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return hS.range(e,t,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return hS.range(this.anchor,i,void 0,void 0,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||this.goalColumn!=e.goalColumn||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return hS.range(e.anchor,e.head)}static create(e,t,n,i){return new pS(e,t,n,i)}}class hS{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:hS.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new hS([this.main],0)}addRange(e,t=!0){return hS.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,hS.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new hS(e.ranges.map(e=>pS.fromJSON(e)),e.main)}static single(e,t=e){return new hS([hS.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let r=e[i];if(r.empty?r.from<=n:r.from<n)return hS.normalized(e.slice(),t);n=r.to}return new hS(e,t)}static cursor(e,t=0,n,i){return pS.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n)),i)}static range(e,t,n,i,r){let o=null==i?7:Math.min(6,i);return r||e==t||(r=t<e?1:-1),r&&(o|=r<0?8:16),t<e?pS.create(t,e,32|o,n):pS.create(e,t,o,n)}static undirectionalRange(e,t){return pS.create(e,t,64,void 0)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let i=e[n],r=e[n-1];if(i.empty?i.from<=r.to:i.from<r.to){let o=r.from,s=Math.max(i.to,r.to);n<=t&&t--,e.splice(--n,2,i.anchor>i.head?hS.range(s,o):hS.range(o,s))}}return new hS(e,t)}}function dS(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let fS=0;class mS{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=fS++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new mS(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:gS),!!e.static,e.enables)}of(e){return new vS([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new vS(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new vS(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function gS(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class vS{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=fS++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,o=e[r]>>1,s=2==this.type,a=!1,l=!1,c=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:1&(null!==(t=e[n.id])&&void 0!==t?t:1)||c.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||bS(e,c)){let t=n(e);if(s?!yS(t,e.values[o],i):!i(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[r];if(null!=l){let r=DS(t,l);if(this.dependencies.every(n=>n instanceof mS?t.facet(n)===e.facet(n):!(n instanceof _S)||t.field(n,!1)==e.field(n,!1))||(s?yS(a=n(e),r,i):i(a=n(e),r)))return e.values[o]=r,0}else a=n(e);return e.values[o]=a,1}}}get extension(){return this}}function yS(e,t,n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function bS(e,t){let n=!1;for(let i of t)1&$S(e,i)&&(n=!0);return n}function wS(e,t,n){let i=n.map(t=>e[t.id]),r=n.map(e=>e.type),o=i.filter(e=>!(1&e)),s=e[t.id]>>1;function a(e){let n=[];for(let t=0;t<i.length;t++){let o=DS(e,i[t]);if(2==r[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of i)$S(e,t);return e.values[s]=a(e),1},update(e,n){if(!bS(e,o))return 0;let i=a(e);return t.compare(i,e.values[s])?0:(e.values[s]=i,1)},reconfigure(e,r){let o=bS(e,i),l=r.config.facets[t.id],c=r.facet(t);if(l&&!o&&gS(n,l))return e.values[s]=c,0;let u=a(e);return t.compare(u,c)?(e.values[s]=c,0):(e.values[s]=u,1)}}}const xS=mS.define({static:!0});class _S{constructor(e,t,n,i,r){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=r,this.provides=void 0}static define(e){let t=new _S(fS++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(xS).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let i=e.values[t],r=this.updateF(i,n);return this.compareF(i,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>{let i,r=e.facet(xS),o=n.facet(xS);return(i=r.find(e=>e.field==this))&&i!=o.find(e=>e.field==this)?(e.values[t]=i.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,xS.of({field:this,create:e})]}get extension(){return this}}const ES=4,SS=3,kS=2,OS=1;function CS(e){return t=>new AS(t,e)}const PS={highest:CS(0),high:CS(OS),default:CS(kS),low:CS(SS),lowest:CS(ES)};class AS{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class TS{of(e){return new RS(this,e)}reconfigure(e){return TS.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class RS{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class MS{constructor(e,t,n,i,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let i=[],r=Object.create(null),o=new Map;for(let n of function(e,t,n){let i=[[],[],[],[],[]],r=new Map;function o(e,s){let a=r.get(e);if(null!=a){if(a<=s)return;let t=i[a].indexOf(e);t>-1&&i[a].splice(t,1),e instanceof RS&&n.delete(e.compartment)}if(r.set(e,s),Array.isArray(e))for(let t of e)o(t,s);else if(e instanceof RS){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=t.get(e.compartment)||e.inner;n.set(e.compartment,i),o(i,s)}else if(e instanceof AS)o(e.inner,e.prec);else if(e instanceof _S)i[s].push(e),e.provides&&o(e.provides,s);else if(e instanceof vS)i[s].push(e),e.facet.extensions&&o(e.facet.extensions,kS);else{let t=e.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${e}).`);if(t==e)throw new Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(t,s)}}return o(e,kS),i.reduce((e,t)=>e.concat(t))}(e,t,o))n instanceof _S?i.push(n):(r[n.facet.id]||(r[n.facet.id]=[])).push(n);let s=Object.create(null),a=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let c=null==n?void 0:n.config.facets;for(let e in r){let t=r[e],i=t[0].facet,o=c&&c[e]||[];if(t.every(e=>0==e.type))if(s[i.id]=a.length<<1|1,gS(o,t))a.push(n.facet(i));else{let e=i.combine(t.map(e=>e.value));a.push(n&&i.compare(e,n.facet(i))?n.facet(i):e)}else{for(let e of t)0==e.type?(s[e.id]=a.length<<1|1,a.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[i.id]=l.length<<1,l.push(e=>wS(e,i,t))}}let u=l.map(e=>e(s));return new MS(e,o,u,s,a,r)}}function $S(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function DS(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const BS=mS.define(),LS=mS.define({combine:e=>e.some(e=>e),static:!0}),IS=mS.define({combine:e=>e.length?e[0]:void 0,static:!0}),NS=mS.define(),zS=mS.define(),jS=mS.define(),VS=mS.define({combine:e=>!!e.length&&e[0]});class FS{constructor(e,t){this.type=e,this.value=t}static define(){return new qS}}class qS{of(e){return new FS(this,e)}}class HS{constructor(e){this.map=e}of(e){return new WS(this,e)}}class WS{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new WS(this.type,t)}is(e){return this.type==e}static define(e={}){return new HS(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let e=i.map(t);e&&n.push(e)}return n}}WS.reconfigure=WS.define(),WS.appendConfig=WS.define();class QS{constructor(e,t,n,i,r,o){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&dS(n,t.newLength),r.some(e=>e.type==QS.time)||(this.annotations=r.concat(QS.time.of(Date.now())))}static create(e,t,n,i,r,o){return new QS(e,t,n,i,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(QS.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function XS(e,t){let n=[];for(let i=0,r=0;;){let o,s;if(i<e.length&&(r==t.length||t[r]>=e[i]))o=e[i++],s=e[i++];else{if(!(r<t.length))return n;o=t[r++],s=t[r++]}!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function GS(e,t,n){var i;let r,o,s;return n?(r=t.changes,o=rS.empty(t.changes.length),s=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(r)),{changes:s,selection:t.selection?t.selection.map(o):null===(i=e.selection)||void 0===i?void 0:i.map(r),effects:WS.mapEffects(e.effects,r).concat(WS.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function US(e,t,n){let i=t.selection,r=ZS(t.annotations);return t.userEvent&&(r=r.concat(QS.userEvent.of(t.userEvent))),{changes:t.changes instanceof rS?t.changes:rS.of(t.changes||[],n,e.facet(IS)),selection:i&&(i instanceof hS?i:hS.single(i.anchor,i.head)),effects:ZS(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}function YS(e,t,n){let i=US(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(n=!1);for(let r=1;r<t.length;r++){!1===t[r].filter&&(n=!1);let o=!!t[r].sequential;i=GS(i,US(e,t[r],o?i.changes.newLength:e.doc.length),o)}let r=QS.create(e,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(jS),i=e;for(let r=n.length-1;r>=0;r--){let o=n[r](e);o&&Object.keys(o).length&&(i=GS(i,US(t,o,e.changes.newLength),!0))}return i==e?e:QS.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let i of t.facet(NS)){let t=i(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:XS(n,t))}if(!0!==n){let i,r;if(!1===n)r=e.changes.invertedDesc,i=rS.empty(t.doc.length);else{let t=e.changes.filter(n);i=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=QS.create(t,i,e.selection&&e.selection.map(r),WS.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let i=t.facet(zS);for(let n=i.length-1;n>=0;n--){let r=i[n](e);e=r instanceof QS?r:Array.isArray(r)&&1==r.length&&r[0]instanceof QS?r[0]:YS(t,ZS(r),!1)}return e}(r):r)}QS.time=FS.define(),QS.userEvent=FS.define(),QS.addToHistory=FS.define(),QS.remote=FS.define();const KS=[];function ZS(e){return null==e?KS:Array.isArray(e)?e:[e]}var JS=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(JS||(JS={}));const ek=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let tk;try{tk=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch($_){}function nk(e){return t=>{if(!/\S/.test(t))return JS.Space;if(function(e){if(tk)return tk.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||ek.test(n)))return!0}return!1}(t))return JS.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return JS.Word;return JS.Other}}class ik{constructor(e,t,n,i,r,o){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)$S(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null!=n)return $S(this,n),DS(this,n);if(t)throw new RangeError("Field is not present in this state")}update(...e){return YS(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:r}=n;for(let t of e.effects)t.is(TS.reconfigure)?(n&&(r=new Map,n.compartments.forEach((e,t)=>r.set(t,e)),n=null),r.set(t.value.compartment,t.value.extension)):t.is(WS.reconfigure)?(n=null,i=t.value):t.is(WS.appendConfig)&&(n=null,i=ZS(i).concat(t.value));if(n)t=e.startState.values.slice();else{n=MS.resolve(i,r,this),t=new ik(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values}let o=e.startState.facet(LS)?e.newSelection:e.newSelection.asSingle();new ik(n,e.newDoc,o,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:hS.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],o=ZS(n.effects);for(let n=1;n<t.ranges.length;n++){let s=e(t.ranges[n]),a=this.changes(s.changes),l=a.map(i);for(let e=0;e<n;e++)r[e]=r[e].map(l);let c=i.mapDesc(a,!0);r.push(s.range.map(c)),i=i.compose(l),o=WS.mapEffects(o,l).concat(WS.mapEffects(ZS(s.effects),c))}return{changes:i,selection:hS.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof rS?e:rS.of(e,this.doc.length,this.facet(ik.lineSeparator))}toText(e){return VE.of(e.split(this.facet(ik.lineSeparator)||tS))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:($S(this,t),DS(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof _S&&null!=this.config.address[i.id]&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n)for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let r=n[t],o=e[t];i.push(r.init(e=>r.spec.fromJSON(o,e)))}return ik.create({doc:e.doc,selection:hS.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=MS.resolve(e.extensions||[],new Map),n=e.doc instanceof VE?e.doc:VE.of((e.doc||"").split(t.staticFacet(ik.lineSeparator)||tS)),i=e.selection?e.selection instanceof hS?e.selection:hS.single(e.selection.anchor,e.selection.head):hS.single(0);return dS(i,n.length),t.staticFacet(LS)||(i=i.asSingle()),new ik(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(ik.tabSize)}get lineBreak(){return this.facet(ik.lineSeparator)||"\n"}get readOnly(){return this.facet(VS)}phrase(e,...t){for(let t of this.facet(ik.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>t.length?e:t[i-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(BS))for(let o of r(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return nk(t.length?t[0]:"")}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,s=e-n;for(;o>0;){let e=KE(t,o,!1);if(r(t.slice(e,o))!=JS.Word)break;o=e}for(;s<i;){let e=KE(t,s);if(r(t.slice(s,e))!=JS.Word)break;s=e}return o==s?null:hS.range(o+n,s+n)}}function rk(e,t,n={}){let i={};for(let t of e)for(let e of Object.keys(t)){let r=t[e],o=i[e];if(void 0===o)i[e]=r;else if(o===r||void 0===r);else{if(!Object.hasOwnProperty.call(n,e))throw new Error("Config merge conflict for field "+e);i[e]=n[e](o,r)}}for(let e in t)void 0===i[e]&&(i[e]=t[e]);return i}ik.allowMultipleSelections=LS,ik.tabSize=mS.define({combine:e=>e.length?e[0]:4}),ik.lineSeparator=IS,ik.readOnly=VS,ik.phrases=mS.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(n=>e[n]==t[n])}}),ik.languageData=BS,ik.changeFilter=NS,ik.transactionFilter=zS,ik.transactionExtender=jS,TS.reconfigure=WS.define();class ok{eq(e){return this==e}range(e,t=e){return ak.create(e,t,this)}}function sk(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}ok.prototype.startSide=ok.prototype.endSide=0,ok.prototype.point=!1,ok.prototype.mapMode=nS.TrackDel;let ak=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,i){return new e(t,n,i)}};function lk(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class ck{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return pk(this.to)}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let o=i,s=r.length;;){if(o==s)return o;let i=o+s>>1,a=r[i]-e||(n?this.value[i].endSide:this.value[i].startSide)-t;if(i==o)return a>=0?o:s;a>=0?s=i:o=i+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,r);r<o;r++)if(!1===i(this.from[r]+e,this.to[r]+e,this.value[r]))return!1}map(e,t,n,i,r){let o=[],s=[],a=[],l=-1,c=-1;e:for(let u=0;u<this.value.length;u++){let p,h,d=this.value[u],f=this.from[u]+e,m=this.to[u]+e;if(f==m){let e=t.mapPos(f,d.startSide,d.mapMode);if(null==e)continue;if(p=h=e,d.startSide!=d.endSide&&(h=t.mapPos(f,d.endSide),h<p))continue}else if(p=t.mapPos(f,d.startSide),h=t.mapPos(m,d.endSide),p>h||p==h&&d.startSide>0&&d.endSide<=0)continue;if(!((h-p||d.endSide-d.startSide)<0))if(l<0&&(l=p),d.point&&(c=Math.max(c,h-p)),(p-n||d.startSide-i)>=0)o.push(d),s.push(p-l),a.push(h-l),n=h,i=d.endSide;else{if(p==h)for(let e=o.length;e>0;e--){if((p-(a[e-1]+l)||d.startSide-o[e-1].endSide)>=0){o.splice(e,0,d),s.splice(e,0,p-l),a.splice(e,0,h-l);continue e}if((p-(s[e-1]+l)||d.endSide-o[e-1].startSide)>0)break}r(p,h,d)}}return{mapped:o.length?new ck(s,a,o,c):null,pos:l}}}class uk{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new uk(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(lk)),this.isEmpty)return t.length?uk.of(t):this;let s=new fk(this,null,-1).goto(0),a=0,l=[],c=new hk;for(;s.value||a<t.length;)if(a<t.length&&(s.from-t[a].from||s.startSide-t[a].value.startSide)>=0){let e=t[a++];c.addInner(e.from,e.to,e.value,!1)||l.push(e)}else 1==s.rangeIndex&&s.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(s.chunkIndex)<t[a].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||r<this.chunkPos[s.chunkIndex])&&c.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||r<s.from||o(s.from,s.to,s.value))&&(c.addInner(s.from,s.to,s.value,!1)||l.push(ak.create(s.from,s.to,s.value))),s.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?uk.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t,n=[],i=[],r=-1,o=(e,n,i)=>{t||(t=new hk),t.addRange(e,n,i,!1)};for(let t=0;t<this.chunk.length;t++){let s=this.chunkPos[t],a=this.chunk[t],l=e.touchesRange(s,s+a.length);if(!1===l)r=Math.max(r,a.maxPoint),n.push(a),i.push(e.mapPos(s));else if(!0===l){let[t,l]=n.length?[pk(i)+pk(n).length,pk(pk(n).value).endSide]:[-1,-1],{mapped:c,pos:u}=a.map(s,e,t,l,o);c&&(r=Math.max(r,c.maxPoint),n.push(c),i.push(u))}}let s=this.nextLayer.map(e);return t&&(s=t.finishInner(s)),0==n.length?s:new uk(i,n,s||uk.empty,r)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let r=this.chunkPos[i],o=this.chunk[i];if(t>=r&&e<=r+o.length&&!1===o.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return mk.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return mk.from(e).goto(t)}static compare(e,t,n,i,r=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),s=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),a=dk(o,s,n),l=new vk(o,a,r),c=new vk(s,a,r);n.iterGaps((e,t,n)=>yk(l,e,c,t,n,i)),n.empty&&0==n.length&&yk(l,0,c,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=999999999);let r=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),o=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let s=dk(r,o),a=new vk(r,s,0).goto(n),l=new vk(o,s,0).goto(n);for(;;){if(a.to!=l.to||!bk(a.active,l.active)||a.point&&(!l.point||!sk(a.point,l.point)))return!1;if(a.to>i)return!0;a.next(),l.next()}}static spans(e,t,n,i,r=-1){let o=new vk(e,null,r).goto(t),s=t,a=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),r=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,a);i.point(s,e,o.point,n,r,o.pointRank),a=Math.min(o.openEnd(e),n.length)}else e>s&&(i.span(s,e,o.active,a),a=o.openEnd(e));if(o.to>n)return a+(o.point&&o.to>n?1:0);s=o.to,o.next()}}static of(e,t=!1){let n=new hk;for(let i of e instanceof ak?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let i=e[n];if(lk(t,i)>0)return e.slice().sort(lk);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return uk.empty;let t=pk(e);for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=uk.empty;i=i.nextLayer)t=new uk(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}function pk(e){return e[e.length-1]}uk.empty=new uk([],[],null,-1),uk.empty.nextLayer=uk.empty;class hk{finishChunk(e){this.chunks.push(new ck(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addRange(e,t,n,!0)}addRange(e,t,n,i){this.addInner(e,t,n,i)||(this.nextLayer||(this.nextLayer=new hk)).addRange(e,t,n,i)}addInner(e,t,n,i){let r=e-this.lastTo||n.startSide-this.last.endSide;if(i&&r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(uk.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=uk.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function dk(e,t,n){let i=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&i.set(t.chunk[e],t.chunkPos[e]);let r=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=i.get(e.chunk[t]);null==o||(n?n.mapPos(o):o)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(o,o+e.chunk[t].length))||r.add(e.chunk[t])}return r}class fk{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class mk{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&i.push(new fk(o,t,n,r));return 1==i.length?i[0]:new mk(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)gk(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)gk(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),gk(this.heap,0)}}}function gk(e,t){for(let n=e[t];;){let i=1+(t<<1);if(i>=e.length)break;let r=e[i];if(i+1<e.length&&r.compare(e[i+1])>=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class vk{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=mk.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){wk(this.active,e),wk(this.activeTo,e),wk(this.activeRank,e),this.minActive=_k(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||i-this.activeTo[t])>0;)t++;xk(this.active,t,n),xk(this.activeTo,t,i),xk(this.activeRank,t,r),e&&xk(e,t,this.cursor.from),this.minActive=_k(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&wk(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function yk(e,t,n,i,r,o){e.goto(t),n.goto(i);let s=i+r,a=i,l=i-t,c=!!o.boundChange;for(let t=!1;;){let i=e.to+l-n.to,r=i||e.endSide-n.endSide,u=r<0?e.to+l:n.to,p=Math.min(u,s);if(e.point||n.point?(e.point&&n.point&&sk(e.point,n.point)&&bk(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(a,p,e.point,n.point),t=!1):(t&&(o.boundChange(a),t=!1),p>a&&!bk(e.active,n.active)&&o.compareRange(a,p,e.active,n.active),c&&p<s&&(i||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>s)break;a=u,r<=0&&e.next(),r>=0&&n.next()}}function bk(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!sk(e[n],t[n]))return!1;return!0}function wk(e,t){for(let n=t,i=e.length-1;n<i;n++)e[n]=e[n+1];e.pop()}function xk(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function _k(e,t){let n=-1,i=1e9;for(let r=0;r<t.length;r++)(t[r]-i||e[r].endSide-e[n].endSide)<0&&(n=r,i=t[r]);return n}function Ek(e,t,n=e.length){let i=0;for(let r=0;r<n&&r<e.length;)9==e.charCodeAt(r)?(i+=t-i%t,r++):(i++,r=KE(e,r));return i}const Sk="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),kk="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Ok="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class Ck{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(e,t,r,o){let s=[],a=/^@(\w+)\b/.exec(e[0]),l=a&&"keyframes"==a[1];if(a&&null==t)return r.push(e[0]+";");for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,r);else if(o&&"object"==typeof o){if(!a)throw new RangeError("The value of a property ("+n+") should be a primitive value.");i(Pk(n),o,s,l)}else null!=o&&(/^--/.test(n)||(n=n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())),s.push(n+": "+o+";"))}(s.length||l)&&r.push((!n||a||o?e:e.map(n)).join(", ")+" {"+s.join(" ")+"}")}for(let t in e)i(Pk(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=Ok[Sk]||1;return Ok[Sk]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let i=e[kk],r=n&&n.nonce;i?r&&i.setNonce(r):i=new Tk(e,r),i.mount(Array.isArray(t)?t:[t],e)}}function Pk(e){if(/^@/.test(e))return[e];let t=[],n=0,i=null,r=0,o=0;for(let s=0;s<e.length;s++){let a=e[s];"\\"==a?s++:'"'==a||"'"==a?a==i?i=!1:i||(i=a):"["!=a&&"("!=a||i?"]"!=a&&")"!=a||i?","!=a||n||i||(t.push(e.slice(o,r)),o=s+1):n--:n++,/\S/.test(a)?r=s+1:s==o&&o++}return t.push(e.slice(o,r)),t}let Ak=new Map;class Tk{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=Ak.get(n);if(t)return e[kk]=t;this.sheet=new i.CSSStyleSheet,Ak.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[kk]=this}mount(e,t){let n=this.sheet,i=0,r=0,o=!1;for(let t=0;t<e.length;t++){let s=e[t],a=this.modules.indexOf(s);if(a<r&&a>-1&&(this.modules.splice(a,1),o=!0,r--,a=-1),-1==a){if(this.modules.splice(r++,0,s),o=!0,n)for(let e=0;e<s.rules.length;e++)n.insertRule(s.rules[e],i++)}else{for(;r<a;)i+=this.modules[r++].rules.length;i+=s.rules.length,r++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{if(o){let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e}let e=t.head||t;this.styleTag.parentNode!=e&&e.insertBefore(this.styleTag,e.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var Rk={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Mk={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},$k="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Dk="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Bk=0;Bk<10;Bk++)Rk[48+Bk]=Rk[96+Bk]=String(Bk);for(Bk=1;Bk<=24;Bk++)Rk[Bk+111]="F"+Bk;for(Bk=65;Bk<=90;Bk++)Rk[Bk]=String.fromCharCode(Bk+32),Mk[Bk]=String.fromCharCode(Bk);for(var Lk in Rk)Mk.hasOwnProperty(Lk)||(Mk[Lk]=Rk[Lk]);function Ik(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?e.setAttribute(i,r):null!=r&&(e[i]=r)}t++}for(;t<arguments.length;t++)Nk(e,arguments[t]);return e}function Nk(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var n=0;n<t.length;n++)Nk(e,t[n])}}let zk="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},jk="undefined"!=typeof document?document:{documentElement:{style:{}}};const Vk=/Edge\/(\d+)/.exec(zk.userAgent),Fk=/MSIE \d/.test(zk.userAgent),qk=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zk.userAgent),Hk=!!(Fk||qk||Vk),Wk=!Hk&&/gecko\/(\d+)/i.test(zk.userAgent),Qk=!Hk&&/Chrome\/(\d+)/.exec(zk.userAgent),Xk="webkitFontSmoothing"in jk.documentElement.style,Gk=!Hk&&/Apple Computer/.test(zk.vendor),Uk=Gk&&(/Mobile\/\w+/.test(zk.userAgent)||zk.maxTouchPoints>2);var Yk={mac:Uk||/Mac/.test(zk.platform),windows:/Win/.test(zk.platform),linux:/Linux|X11/.test(zk.platform),ie:Hk,ie_version:Fk?jk.documentMode||6:qk?+qk[1]:Vk?+Vk[1]:0,gecko:Wk,gecko_version:Wk?+(/Firefox\/(\d+)/.exec(zk.userAgent)||[0,0])[1]:0,chrome:!!Qk,chrome_version:Qk?+Qk[1]:0,ios:Uk,android:/Android\b/.test(zk.userAgent),webkit:Xk,webkit_version:Xk?+(/\bAppleWebKit\/(\d+)/.exec(zk.userAgent)||[0,0])[1]:0,safari:Gk,safari_version:Gk?+(/\bVersion\/(\d+(\.\d+)?)/.exec(zk.userAgent)||[0,0])[1]:0,tabSize:null!=jk.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function Kk(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const Zk=Object.create(null);function Jk(e,t,n){if(e==t)return!0;e||(e=Zk),t||(t=Zk);let i=Object.keys(e),r=Object.keys(t);if(i.length-0!=r.length-0)return!1;for(let o of i)if(o!=n&&(-1==r.indexOf(o)||e[o]!==t[o]))return!1;return!0}function eO(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function tO(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let i=e.attributes[n];t[i.name]=i.value}return t}class nO{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var iO=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(iO||(iO={}));class rO extends ok{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new oO(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new aO(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,i=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:r,end:o}=lO(e,i);t=(r?i?-3e8:-1:5e8)-1,n=1+(o?i?2e8:1:-6e8)}return new aO(e,t,n,i,e.widget||null,!0)}static line(e){return new sO(e)}static set(e,t=!1){return uk.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}rO.none=uk.empty;class oO extends rO{constructor(e){let{start:t,end:n}=lO(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Kk(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Zk}eq(e){return this==e||e instanceof oO&&this.tagName==e.tagName&&Jk(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}oO.prototype.point=!1;class sO extends rO{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof sO&&this.spec.class==e.spec.class&&Jk(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}sO.prototype.mapMode=nS.TrackBefore,sO.prototype.point=!0;class aO extends rO{constructor(e,t,n,i,r,o){super(t,n,r,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?nS.TrackBefore:nS.TrackAfter:nS.TrackDel}get type(){return this.startSide!=this.endSide?iO.WidgetRange:this.startSide<=0?iO.WidgetBefore:iO.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof aO&&function(e,t){return e==t||!!(e&&t&&e.compare(t))}(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function lO(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return null==n&&(n=e.inclusive),null==i&&(i=e.inclusive),{start:null!=n?n:t,end:null!=i?i:t}}function cO(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}aO.prototype.point=!0;class uO extends ok{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(e){return e==this||e instanceof uO&&this.tagName==e.tagName&&Jk(this.attributes,e.attributes)}static create(e){return new uO(e.tagName,e.attributes||Zk,null==e.rank?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return uk.of(e,t)}}uO.prototype.startSide=uO.prototype.endSide=-1;const pO=e=>1==e.nodeType,hO=e=>3==e.nodeType;function dO(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function fO(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function mO(e,t){if(!t.anchorNode)return!1;try{return fO(e,t.anchorNode)}catch(e){return!1}}function gO(e){return hO(e)?MO(e,0,e.nodeValue.length).getClientRects():pO(e)?e.getClientRects():[]}function vO(e,t,n,i){return!!n&&(wO(e,t,n,i,-1)||wO(e,t,n,i,1))}function yO(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function bO(e){return pO(e)&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function wO(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:xO(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||!pO(n))return!1;t=yO(e)+(r<0?0:1),e=n}else{if(!pO(e))return!1;if(e=e.childNodes[t+(r<0?-1:0)],pO(e)&&("IMG"==e.nodeName||"BR"==e.nodeName||"false"==e.contentEditable))return!1;t=r<0?xO(e):0}}}function xO(e){return hO(e)?e.nodeValue.length:e.childNodes.length}function _O(e,t){let{left:n,right:i}=e;if(n==i)return e;let r=t?n:i;return{left:r,right:r,top:e.top,bottom:e.bottom}}function EO(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function SO(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function kO(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let o=e.parentNode;o&&(o!=n.body&&(t&&!i||!r));)if(pO(o))!r&&o.scrollHeight>o.clientHeight&&/scroll|auto/.test(getComputedStyle(o).overflowY)&&(r=o),t&&!i&&o.scrollWidth>o.clientWidth&&/scroll|auto/.test(getComputedStyle(o).overflowX)&&(i=o),o=o.assignedSlot||o.parentNode;else{if(11!=o.nodeType)break;o=o.host}return{x:i,y:r}}class OO{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?xO(t):0),n,Math.min(e.focusOffset,n?xO(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}function CO(e){let t=[];for(let n=e;n;n=11==n.nodeType?n.host:n.parentNode)pO(n)&&t.push({node:n,left:n.scrollLeft,top:n.scrollTop});return t}function PO(e,t=!0){for(let{node:n,left:i,top:r}of e)t&&n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}let AO,TO=null;function RO(e){if(e.setActive)return e.setActive();if(TO)return e.focus(TO);let t=CO(e);e.focus(null==TO?{get preventScroll(){return TO={preventScroll:!0},!0}}:void 0),TO||(TO=!1,PO(t))}function MO(e,t,n=t){let i=AO||(AO=document.createRange());return i.setEnd(e,n),i.setStart(e,t),i}function $O(e,t,n,i){let r={key:t,code:t,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",r);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function DO(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function BO(e,t){for(let n=e,i=t;;){if(hO(n)&&i>0)return{node:n,offset:i};if(pO(n)&&i>0){if("false"==n.contentEditable)return null;n=n.childNodes[i-1],i=xO(n)}else{if(!n.parentNode||bO(n))return null;i=yO(n),n=n.parentNode}}}function LO(e,t){for(let n=e,i=t;;){if(hO(n)&&i<n.nodeValue.length)return{node:n,offset:i};if(pO(n)&&i<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[i],i=0}else{if(!n.parentNode||bO(n))return null;i=yO(n)+1,n=n.parentNode}}}Yk.safari&&Yk.safari_version>=26&&(TO=!1);class IO{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new IO(e.parentNode,yO(e),t)}static after(e,t){return new IO(e.parentNode,yO(e)+1,t)}}var NO=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(NO||(NO={}));const zO=NO.LTR,jO=NO.RTL;function VO(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const FO=VO("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),qO=VO("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),HO=Object.create(null),WO=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);HO[t]=n,HO[n]=-t}function QO(e){return e<=247?FO[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?qO[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const XO=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class GO{get dir(){return this.level%2?jO:zO}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,i){let r=-1;for(let o=0;o<e.length;o++){let s=e[o];if(s.from<=t&&s.to>=t){if(s.level==n)return o;(r<0||(0!=i?i<0?s.from<t:s.to>t:e[r].level>s.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function UO(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!UO(i.inner,r.inner))return!1}return!0}const YO=[];function KO(e,t,n,i,r,o,s){let a=i%2?2:1;if(i%2==r%2)for(let l=t,c=0;l<n;){let t=!0,u=!1;if(c==o.length||l<o[c].from){let e=YO[l];e!=a&&(t=!1,u=16==e)}let p=t||1!=a?null:[],h=t?i:i+1,d=l;e:for(;;)if(c<o.length&&d==o[c].from){if(u)break e;let f=o[c];if(!t)for(let e=f.to,t=c+1;;){if(e==n)break e;if(!(t<o.length&&o[t].from==e)){if(YO[e]==a)break e;break}e=o[t++].to}if(c++,p)p.push(f);else{f.from>l&&s.push(new GO(l,f.from,h)),ZO(e,f.direction==zO!=!(h%2)?i+1:i,r,f.inner,f.from,f.to,s),l=f.to}d=f.to}else{if(d==n||(t?YO[d]!=a:YO[d]==a))break;d++}p?KO(e,l,d,i+1,r,p,s):l<d&&s.push(new GO(l,d,h)),l=d}else for(let l=n,c=o.length;l>t;){let n=!0,u=!1;if(!c||l>o[c-1].to){let e=YO[l-1];e!=a&&(n=!1,u=16==e)}let p=n||1!=a?null:[],h=n?i:i+1,d=l;e:for(;;)if(c&&d==o[c-1].to){if(u)break e;let f=o[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||o[n-1].to!=e){if(YO[e-1]==a)break e;break}e=o[--n].from}if(p)p.push(f);else{f.to<l&&s.push(new GO(f.to,l,h)),ZO(e,f.direction==zO!=!(h%2)?i+1:i,r,f.inner,f.from,f.to,s),l=f.from}d=f.from}else{if(d==t||(n?YO[d-1]!=a:YO[d-1]==a))break;d--}p?KO(e,d,l,i+1,r,p,s):d<l&&s.push(new GO(d,l,h)),l=d}}function ZO(e,t,n,i,r,o,s){let a=t%2?2:1;!function(e,t,n,i,r){for(let o=0;o<=i.length;o++){let s=o?i[o-1].to:t,a=o<i.length?i[o].from:n,l=o?256:r;for(let t=s,n=l,i=l;t<a;t++){let r=QO(e.charCodeAt(t));512==r?r=n:8==r&&4==i&&(r=16),YO[t]=4==r?2:r,7&r&&(i=r),n=r}for(let e=s,t=l,i=l;e<a;e++){let r=YO[e];if(128==r)e<a-1&&t==YO[e+1]&&24&t?r=YO[e]=t:YO[e]=256;else if(64==r){let r=e+1;for(;r<a&&64==YO[r];)r++;let o=e&&8==t||r<n&&8==YO[r]?1==i?1:8:256;for(let t=e;t<r;t++)YO[t]=o;e=r-1}else 8==r&&1==i&&(YO[e]=1);t=r,7&r&&(i=r)}}}(e,r,o,i,a),function(e,t,n,i,r){let o=1==r?2:1;for(let s=0,a=0,l=0;s<=i.length;s++){let c=s?i[s-1].to:t,u=s<i.length?i[s].from:n;for(let t,n,i,s=c;s<u;s++)if(n=HO[t=e.charCodeAt(s)])if(n<0){for(let e=a-3;e>=0;e-=3)if(WO[e+1]==-n){let t=WO[e+2],n=2&t?r:4&t?1&t?o:r:0;n&&(YO[s]=YO[WO[e]]=n),a=e;break}}else{if(189==WO.length)break;WO[a++]=s,WO[a++]=t,WO[a++]=l}else if(2==(i=YO[s])||1==i){let e=i==r;l=e?0:1;for(let t=a-3;t>=0;t-=3){let n=WO[t+2];if(2&n)break;if(e)WO[t+2]|=2;else{if(4&n)break;WO[t+2]|=4}}}}}(e,r,o,i,a),function(e,t,n,i){for(let r=0,o=i;r<=n.length;r++){let s=r?n[r-1].to:e,a=r<n.length?n[r].from:t;for(let l=s;l<a;){let s=YO[l];if(256==s){let s=l+1;for(;;)if(s==a){if(r==n.length)break;s=n[r++].to,a=r<n.length?n[r].from:t}else{if(256!=YO[s])break;s++}let c=1==o,u=c==(1==(s<t?YO[s]:i))?c?1:2:i;for(let t=s,i=r,o=i?n[i-1].to:e;t>l;)t==o&&(t=n[--i].from,o=i?n[i-1].to:e),YO[--t]=u;l=s}else o=s,l++}}}(r,o,i,a),KO(e,r,o,t,n,i,s)}function JO(e){return[new GO(0,e,0)]}let eC="";function tC(e,t,n,i,r){var o;if(!e.length)return null;let s,a=i.head-e.from;if(i.head==e.from&&i.assoc<0){if(!r)return null;a=t[s=0].side(!1,n)}else if(i.head==e.to&&i.assoc>0){if(r)return null;a=t[s=t.length-1].side(!0,n)}else s=GO.find(t,a,null!==(o=i.bidiLevel)&&void 0!==o?o:-1,i.assoc);let l=t[s],c=l.side(r,n);if(a==c){let e=s+=r?1:-1;if(e<0||e>=t.length)return null;l=t[s=e],a=l.side(!r,n),c=l.side(r,n)}let u=KE(e.text,a,l.forward(r,n));(u<l.from||u>l.to)&&(u=c),eC=e.text.slice(Math.min(a,u),Math.max(a,u));let p=s==(r?t.length-1:0)?null:t[s+(r?1:-1)];if(u==c){if(!p)return r?hS.cursor(e.to,1):hS.cursor(e.from,-1);if(p.level+(r?0:1)<l.level)return hS.cursor(p.side(!r,n)+e.from,p.forward(r,n)?1:-1,p.level)}return hS.cursor(u+e.from,l.forward(r,n)?-1:1,l.level)}function nC(e,t,n){for(let i=t;i<n;i++){let t=QO(e.charCodeAt(i));if(1==t)return zO;if(2==t||4==t)return jO}}const iC=mS.define(),rC=mS.define(),oC=mS.define(),sC=mS.define(),aC=mS.define(),lC=mS.define(),cC=mS.define(),uC=mS.define(),pC=mS.define(),hC=mS.define({combine:e=>e.some(e=>e)}),dC=mS.define({combine:e=>e.some(e=>e)}),fC=mS.define();class mC{constructor(e,t,n,i,r,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new mC(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new mC(hS.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const gC=WS.define({map:(e,t)=>e.map(t)}),vC=WS.define();function yC(e,t,n){let i=e.facet(sC);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const bC=mS.define({combine:e=>!e.length||e[0]});let wC=0;const xC=mS.define({combine:e=>e.filter((t,n)=>{for(let i=0;i<n;i++)if(e[i].plugin==t.plugin)return!1;return!0})});class _C{constructor(e,t,n,i,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.baseExtensions=r(this),this.extension=this.baseExtensions.concat(xC.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(xC.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:i,provide:r,decorations:o}=t||{};return new _C(wC++,e,n,i,e=>{let t=[];return o&&t.push(OC.of(t=>{let n=t.plugin(e);return n?o(n):rO.none})),r&&t.push(r(e)),t})}static fromClass(e,t){return _C.define((t,n)=>new e(t,n),t)}}class EC{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(yC(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){yC(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){yC(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const SC=mS.define(),kC=mS.define(),OC=mS.define(),CC=mS.define(),PC=mS.define(),AC=mS.define(),TC=mS.define();function RC(e,t){let n=e.state.facet(TC);if(!n.length)return n;let i=n.map(t=>t instanceof Function?t(e):t),r=[];return uk.spans(i,t.from,t.to,{point(){},span(e,n,i,o){let s=e-t.from,a=n-t.from,l=r;for(let e=i.length-1;e>=0;e--,o--){let t,n=i[e].spec.bidiIsolate;if(o>0&&l.length&&(t=l[l.length-1]).to==s&&t.direction==n)t.to=a,l=t.inner;else{let e={from:s,to:a,direction:n,inner:[]};l.push(e),l=e.inner}}}}),MC(t.text,r)}function MC(e,t){for(let n of t){if(null==n.direction){for(let t=n.from,i=0;t<n.to;i++){let r=i<n.inner.length?n.inner[i]:null,o=nC(e,t,r?r.from:n.to);if(o){n.direction=o;break}if(!r)break;t=r.to}null==n.direction&&(n.direction=NO.LTR)}MC(e,n.inner)}return t}const $C=mS.define();function DC(e){let t=0,n=0,i=0,r=0;for(let o of e.state.facet($C)){let s=o(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(n=Math.max(n,s.right)),null!=s.top&&(i=Math.max(i,s.top)),null!=s.bottom&&(r=Math.max(r,s.bottom)))}return{left:t,right:n,top:i,bottom:r}}const BC=mS.define();class LC{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new LC(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>n.toA)){if(i.toA<n.fromA)break;n=n.join(i),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let i=0,r=0,o=0;;){let s=i<e.length?e[i].fromB:1e9,a=r<t.length?t[r]:1e9,l=Math.min(s,a);if(1e9==l)break;let c=l+o,u=l,p=c;for(;;)if(r<t.length&&t[r]<=u){let n=t[r+1];r+=2,u=Math.max(u,n);for(let t=i;t<e.length&&e[t].fromB<=u;t++)o=e[t].toA-e[t].toB;p=Math.max(p,n+o)}else{if(!(i<e.length&&e[i].fromB<=u))break;{let t=e[i++];u=Math.max(u,t.toB),p=Math.max(p,t.toA),o=t.toA-t.toB}}n.push(new LC(c,p,l,u))}return n}}class IC{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=rS.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let i=[];this.changes.iterChangedRanges((e,t,n,r)=>i.push(new LC(e,t,n,r))),this.changedRanges=i}static create(e,t,n){return new IC(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}const NC=[];class zC{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return NC}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;null==t[i]&&e.removeAttribute(i)}for(let n in t){let i=t[n];"style"==n?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,n){return null}domPosFor(e,t){let n=yO(this.dom),i=this.length?e>0:t>0;return new IO(this.parent.dom,n+(i?1:0),0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof FC)return e;return null}static get(e){return e.cmTile}}class jC extends zC{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let t,n=this.dom,i=null,r=(null==e?void 0:e.node)==n?e:null,o=0;for(let s of this.children){if(s.sync(e),o+=s.length+s.breakAfter,t=i?i.nextSibling:n.firstChild,r&&t!=s.dom&&(r.written=!0),s.dom.parentNode==n)for(;t&&t!=s.dom;)t=VC(t);else n.insertBefore(s.dom,t);i=s.dom}for(t=i?i.nextSibling:n.firstChild,r&&t&&(r.written=!0);t;)t=VC(t);this.length=o}}function VC(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class FC extends jC{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=zC.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,i=0,r=0;;)if(i==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&r++,i=t.pop()}else{let o=n.children[i++];if(o instanceof qC)t.push(i),n=o,i=0;else{let t=r+o.length,n=e(o,r);if(void 0!==n)return n;r=t+o.breakAfter}}}resolveBlock(e,t){let n,i,r=-1,o=-1;if(this.blockTiles((s,a)=>{let l=a+s.length;if(e>=a&&e<=l){if(s.isWidget()&&t>=-1&&t<=1){if(32&s.flags)return!0;16&s.flags&&(n=void 0)}(a<e||e==l&&(t<-1?s.length:s.covers(1)))&&(!n||!s.isWidget()&&n.isWidget())&&(n=s,r=e-a),(l>e||e==a&&(t>1?s.length:s.covers(-1)))&&(!i||!s.isWidget()&&i.isWidget())&&(i=s,o=e-a)}}),!n&&!i)throw new Error("No tile at position "+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:o}}}class qC extends jC{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new qC(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class HC extends jC{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let i=new HC(t||document.createElement("div"),e);return t&&n||(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n=!1){let i=null,r=-1,o=null,s=-1;!function e(a,l){for(let c=0,u=0;c<a.children.length&&u<=l;c++){let p=a.children[c],h=u+p.length;h>=l&&(p.isComposite()?e(p,l-u):(!o||n&&o.isHidden&&(t>0&&!(32&o.flags)||n&&WC(o,p)))&&(h>l||32&p.flags&&t<=1)?(o=p,s=l-u):(u<l||16&p.flags&&(!n||!p.isHidden)&&t>=-1)&&(i=p,r=l-u)),u=h}}(this,e);let a=(t<0?i:o)||i||o;return a?{tile:a,offset:a==i?r:s}:null}coordsIn(e,t,n){let i=this.resolveInline(e,t,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),t,n):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=gO(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:i}=n;if(this.dom.contains(e.dom))return e.isText()?new IO(e.dom,Math.min(e.dom.nodeValue.length,i)):e.domPosFor(i,16&e.flags?1:32&e.flags?-1:t);let r=n.tile.parent,o=!1;for(let e of r.children){if(o)return new IO(e.dom,0);e==n.tile&&(o=!0)}}return new IO(this.dom,0)}}function WC(e,t){let n=e.coordsIn(0,1),i=t.coordsIn(0,1);return n&&i&&i.top<n.bottom}class QC extends jC{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new QC(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class XC extends zC{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,n){let i=this.dom.nodeValue.length;e>i&&(e=i);let r=e,o=e,s=0;0==e&&t<0||e==i&&t>=0?Yk.chrome||Yk.gecko||(e?(r--,s=1):o<i&&(o++,s=-1)):t<0?r--:o<i&&o++;let a=MO(this.dom,r,o).getClientRects();if(!a.length)return null;let l=a[(s?s<0:t>=0)?0:a.length-1];return Yk.safari&&!s&&0==l.width&&(l=Array.prototype.find.call(a,e=>e.width)||l),null==n?l:_O(l,(s?s>0:t<0)==n)}static of(e,t){let n=new XC(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class GC extends zC{constructor(e,t,n,i){super(e,t,i),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;if(n)return _O(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let i=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let r=i?t.length-1:0;n=t[r],!(e>0?0==r:r==t.length-1||n.top<n.bottom);r+=i?-1:1);return _O(n,!i)}}get overrideDOMText(){if(!this.length)return VE.empty;let{root:e}=this;if(!e)return VE.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,i,r){return r||(r=e.toDOM(t),e.editable||(r.contentEditable="false")),new GC(r,n,e,i)}}class UC extends zC{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return VE.empty}coordsIn(e,t,n){let i=this.dom.getBoundingClientRect();return null==n?i:_O(i,t>0==n)}}class YC{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:i,index:r,beforeBreak:o,parents:s}=this;for(;e||t>0;)if(i.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(r==i.children.length){if(!e&&!s.length)break;n&&n.leave(i),o=!!i.breakAfter,({tile:i,index:r}=s.pop()),r++}else{let a=i.children[r],l=a.breakAfter;!(t>0?a.length<=e:a.length<e)||n&&!1===n.skip(a,0,a.length)&&a.isComposite?(s.push({tile:i,index:r}),i=a,r=0,n&&a.isComposite()&&n.enter(a)):(o=!!l,r++,e-=a.length)}else{let t=i.length;if(r<t&&e){let o=Math.min(e,t-r);n&&n.skip(i,r,r+o),e-=o,r+=o}if(r==t)o=!!i.breakAfter,({tile:i,index:r}=s.pop()),r++;else if(!e)break}return this.tile=i,this.index=r,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class KC{constructor(e,t,n,i){this.from=e,this.to=t,this.wrapper=n,this.rank=i}}class ZC{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,i){var r;this.flushBuffer();let o=this.ensureMarks(t,n),s=o.lastChild;if(s&&s.isText()&&!(8&s.flags)&&s.length+e.length<512){this.cache.reused.set(s,2),(o.children[o.children.length-1]=new XC(s.dom,s.text+e)).parent=o}else o.append(i||XC.of(e,null===(r=this.cache.find(XC))||void 0===r?void 0:r.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?oP(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let i=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],r=i.lastChild;if(r instanceof QC&&r.mark.eq(n.mark))r.dom!=n.dom&&r.setDOM(oP(n.dom)),i=r;else{let{dom:e}=n;if(this.cache.reused.get(n)){zC.get(n.dom)&&(e=oP(n.dom))}let t=QC.of(n.mark,e);i.append(t),i=t}this.cache.reused.set(n,2)}let r=zC.get(e.text);r&&this.cache.reused.set(r,2);let o=new XC(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,i.append(o)}addInlineWidget(e,t,n){let i=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);i||this.flushBuffer();let r=this.ensureMarks(t,n);i||16&e.flags||r.append(this.getBuffer(1)),r.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){(this.afterWidget||this.lastBlock).length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=rP);let i=HC.start(e,t||(null===(n=this.cache.find(HC))||void 0===n?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let i=this.curLine;for(let r=e.length-1;r>=0;r--){let o,s=e[r];if(t>0&&(o=i.lastChild)&&o instanceof QC&&o.mark.eq(s))i=o,t--;else{let e=QC.of(s,null===(n=this.cache.find(QC,e=>e.mark.eq(s)))||void 0===n?void 0:n.dom);i.append(e),i=e,t=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;e&&iP(this.curLine,!1)&&("BR"==e.dom.nodeName||!e.isWidget()||Yk.ios&&iP(this.curLine,!0))||this.curLine.append(this.cache.findWidget(aP,0,32)||new GC(aP.toDOM(),0,aP,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=102*e.rank+e.value.rank,n=new KC(e.from,e.to,e.value,t),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-n.rank||this.wrappers[i-1].to-n.to)<0;)i--;this.wrappers.splice(i,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let i=t.lastChild;if(n.from<this.pos&&i instanceof qC&&i.wrapper.eq(n.wrapper))t=i;else{let i=qC.of(n.wrapper,null===(e=this.cache.find(qC,e=>e.wrapper.eq(n.wrapper)))||void 0===e?void 0:e.dom);t.append(i),t=i}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(UC,void 0,1);return n&&(n.flags=t),n||new UC(t)}flushBuffer(){!this.afterWidget||32&this.afterWidget.flags||(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class JC{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:i}=this.cursor.next(this.skipCount);if(this.skipCount=0,i)throw new Error("Ran out of text content when drawing inline views");this.text=t;let r=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,r)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}const eP=[GC,HC,XC,QC,UC,qC,FC];for(let e=0;e<eP.length;e++)eP[e].bucket=e;class tP{constructor(e){this.view=e,this.buckets=eP.map(()=>[]),this.index=eP.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let i=e.bucket,r=this.buckets[i],o=this.index[i];for(let e=0;e<r.length;e++){let s=(e+o)%r.length,a=r[s];if((!t||t(a))&&!this.reused.has(a))return r.splice(s,1),s<o&&this.index[i]--,this.reused.set(a,n),a}return null}findWidget(e,t,n){let i=this.buckets[0];if(i.length)for(let r=0,o=0;;r++){if(r==i.length){if(o)return null;o=1,r=0}let s=i[r];if(!this.reused.has(s)&&(0==o?s.widget.compare(e):s.widget.constructor==e.constructor&&e.updateDOM(s.dom,this.view,s.widget)))return i.splice(r,1),r<this.index[0]&&this.index[0]--,s.widget==e&&s.length==t&&(497&s.flags)==n?(this.reused.set(s,1),s):(this.reused.set(s,2),new GC(s.dom,t,e,-498&s.flags|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class nP{constructor(e,t,n,i,r){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=r,this.openWidget=!1,this.openMarks=0,this.cache=new tP(e),this.text=new JC(e.state.doc),this.builder=new ZC(this.cache,new FC(e,e.contentDOM),uk.iter(n)),this.cache.reused.set(t,2),this.old=new YC(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let i=0,r=0,o=0;;){let s=o<e.length?e[o++]:null,a=s?s.fromA:this.old.root.length;if(a>i){let e=a-i;this.preserve(e,!o,!s),i=a,r+=e}if(!s)break;t&&s.fromA<=t.range.fromA&&s.toA>=t.range.toA?(this.forward(s.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(r,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,s.toA),this.emit(t.range.toB,s.toB)):(this.forward(s.fromA,s.toA),this.emit(r,s.toB)),r=s.toB,i=s.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let i=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof QC&&t.push(i.mark)}return t}(this.old),r=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let o=n>0||t<e.length?GC.of(e.widget,this.view,n-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&o.flags?(o.flags&=-2,this.builder.addBlockWidget(o)):(this.builder.ensureLine(null),this.builder.addInlineWidget(o,i,r),r=i.length)}else if(e.isText())this.builder.ensureLine(null),t||n!=e.length||this.cache.reused.has(e)?(this.cache.add(e),this.builder.addText(e.text.slice(t,n),i,r)):this.builder.addText(e.text,i,r,this.cache.reuse(e)),r=i.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof UC)this.cache.add(e);else{if(!(e instanceof QC))return!1;this.builder.ensureLine(null),this.builder.addMark(e,i,r),this.cache.reused.set(e,1),r=i.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof QC&&i.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?i.length&&(i.length=r=0):e instanceof QC&&(i.shift(),r=Math.min(r,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,i=this.builder,r=-1,o=uk.spans(this.decorations,e,t,{point:(e,t,o,s,a,l)=>{if(o instanceof aO){if(this.disallowBlockEffectsFor[l]){if(o.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(r=s.length,a>s.length)i.continueWidget(t-e);else{let r=o.widget||(o.block?sP.block:sP.inline),l=function(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;e.block&&(t|=256);return t}(o),c=this.cache.findWidget(r,t-e,l)||GC.of(r,this.view,t-e,l);o.block?(o.startSide>0&&i.addLineStartIfNotCovered(n),i.addBlockWidget(c)):(i.ensureLine(n),i.addInlineWidget(c,s,a))}n=null}else n=function(e,t){let n=t.spec.attributes,i=t.spec.class;if(!n&&!i)return e;e||(e={class:"cm-line"});n&&Kk(n,e);i&&(e.class+=" "+i);return e}(n,o);t>e&&this.text.skip(t-e)},span:(e,t,o,s)=>{for(let r=e;r<t;){let a=this.text.next(Math.min(512,t-r));null==a?(i.addLineStartIfNotCovered(n),i.addBreak(),r++):(i.ensureLine(n),i.addText(a,o,r==e?s:o.length),r+=a.length),n=null}r=o.length}});r>-1&&(this.openWidget=o>r),this.openWidget||i.addLineStartIfNotCovered(n),this.openMarks=o}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let i=e.parentNode;;i=i.parentNode){let e=zC.get(i);if(i==this.view.contentDOM)break;e instanceof QC?t.push(e):(null==e?void 0:e.isLine())?n=e:e instanceof qC||("DIV"!=i.nodeName||n?n||t.push(QC.of(new oO({tagName:i.nodeName.toLowerCase(),attributes:tO(i)}),i)):n=new HC(i,rP))}return n?{line:n,marks:t}:null}}function iP(e,t){let n=e=>{for(let i of e.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}const rP={class:"cm-line"};function oP(e){let t=zC.get(e);return t&&t.setDOM(e.cloneNode()),e}class sP extends nO{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}sP.inline=new sP("span"),sP.block=new sP("div");const aP=new class extends nO{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class lP{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=rO.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new FC(e,e.contentDOM),this.updateInner([new LC(0,0,0,e.state.doc.length)],null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?i=this.domChanged.newSel.head:function(e,t){let n=!1;t&&e.iterChangedRanges((e,i)=>{e<t.to&&i>t.from&&(n=!0)});return n}(e.changes,this.hasComposition)||e.selectionSet||(i=e.state.selection.main.head));let r=i>-1?function(e,t,n){let i=uP(e,n);if(!i)return null;let{node:r,from:o,to:s}=i,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(i.from,i.to)!=a)return null;let l=t.invertedDesc;return{range:new LC(l.mapPos(o),l.mapPos(s),o,s),text:r}}(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:i}=this.hasComposition;n=new LC(t,i,e.changes.mapPos(t,-1),e.changes.mapPos(i,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Yk.ie||Yk.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,s=this.blockWrappers;this.updateDeco();let a=function(e,t,n){let i=new pP;return uk.compare(e,t,n,i),i.changes}(o,this.decorations,e.changes);a.length&&(n=LC.extendWithRanges(n,a));let l=function(e,t,n){let i=new hP;return uk.compare(e,t,n,i),i.changes}(s,this.blockWrappers,e.changes);return l.length&&(n=LC.extendWithRanges(n,l)),r&&!n.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(n=r.range.addToSet(n.slice())),!(2&this.tile.flags&&0==n.length)&&(this.updateInner(n,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,i=new nP(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&zC.get(t.text)&&i.cache.reused.set(zC.get(t.text),2),this.tile=i.run(e,t),cP(n,i.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=Yk.chrome||Yk.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),!i||!i.written&&n.selectionRange.focusNode==i.node&&this.tile.dom.contains(i.node)||(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof dP&&i.push(e.dom);n.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(vC)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let{dom:n}=this.tile,i=this.view.root.activeElement,r=i==n,o=!r&&!(this.view.state.facet(bC)||n.tabIndex>-1)&&mO(n,this.view.observer.selectionRange)&&!(i&&n.contains(i));if(!(r||t||o))return;let s=this.forceSelection;this.forceSelection=!1;let a,l,c=this.view.state.selection.main;if(c.empty?l=a=this.inlineDOMNearPos(c.anchor,c.assoc||1):(l=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),a=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),Yk.gecko&&c.empty&&!this.hasComposition&&(pO((u=a).node)&&u.node.firstChild&&(0==u.offset||"false"==u.node.childNodes[u.offset-1].contentEditable)&&(u.offset==u.node.childNodes.length||"false"==u.node.childNodes[u.offset].contentEditable))){let e=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null)),a=l=new IO(e,0),s=!0}var u;let p=this.view.observer.selectionRange;!s&&p.focusNode&&(vO(a.node,a.offset,p.anchorNode,p.anchorOffset)&&vO(l.node,l.offset,p.focusNode,p.focusOffset)||this.suppressWidgetCursorChange(p,c))||(this.view.observer.ignore(()=>{Yk.android&&Yk.chrome&&n.contains(p.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(pO(n)&&"false"==n.contentEditable)return!0;return!1}(p.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=dO(this.view.root);if(e)if(c.empty){if(Yk.gecko){let e=function(e,t){return pO(e)?(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(t<e.childNodes.length&&"false"==e.childNodes[t].contentEditable?2:0):0}(a.node,a.offset);if(e&&3!=e){let t=(1==e?BO:LO)(a.node,a.offset);t&&(a=new IO(t.node,t.offset))}}e.collapse(a.node,a.offset),null!=c.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=c.bidiLevel)}else if(e.extend){e.collapse(a.node,a.offset);try{e.extend(l.node,l.offset)}catch(e){}}else{let t=document.createRange();c.anchor>c.head&&([a,l]=[l,a]),t.setEnd(l.node,l.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}else;o&&this.view.root.activeElement==n&&(n.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new IO(p.anchorNode,p.anchorOffset),this.impreciseHead=l.precise?null:new IO(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&vO(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=dO(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let s=o.posAtStart;if(t.head==s||t.head==s+o.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(i,r)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let i=n.posAtStart;if(!n.isComposite())return n.isText()?e==n.dom?i+t:i+(t?n.length:0):i;{let r;if(e==n.dom)r=n.dom.childNodes[t];else{let i=0==xO(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==i&&t.firstChild!=t.lastChild&&(i=e==t.firstChild?-1:1),e=t}r=i<0?e:e.nextSibling}if(r==n.dom.firstChild)return i;for(;r&&!zC.get(r);)r=r.nextSibling;if(!r)return i+n.length;for(let e=0,t=i;;e++){let i=n.children[e];if(i.dom==r)return t;t+=i.length+i.breakAfter}}}domAtPos(e,t){let{tile:n,offset:i}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(i,t):n.domIn(i,t)}inlineDOMNearPos(e,t){let n,i,r=-1,o=!1,s=-1,a=!1;return this.tile.blockTiles((t,l)=>{if(t.isWidget()){if(32&t.flags&&l>=e)return!0;16&t.flags&&(o=!0)}else{let c=l+t.length;if(l<=e&&(n=t,r=e-l,o=c<e),c>=e&&!i&&(i=t,s=e-l,a=l>e),l>e&&i)return!0}}),n||i?(o&&i?n=null:a&&n&&(i=null),n&&t<0||!i?n.domIn(r,t):i.domIn(s,t)):this.domAtPos(e,t)}coordsAt(e,t,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof dP?null:i.coordsInWidget(r,t,!0):i.coordsIn(r,t,n)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;return function e(t,n){if(t.isComposite())for(let i of t.children){if(i.length>=n){let t=e(i,n);if(t)return t}if((n-=i.length)<0)break}else if(t.isText()&&n<t.length){let e=KE(t.text,n);if(e==n)return null;let i=MO(t.dom,n,e).getClientRects();for(let e=0;e<i.length;e++){let t=i[e];if(e==i.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:i}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,a=this.view.textDirection==NO.LTR,l=0,c=(e,u,p)=>{for(let h=0;h<e.children.length&&!(u>i);h++){let i=e.children[h],d=u+i.length,f=i.dom.getBoundingClientRect(),{height:m}=f;if(p&&!h&&(l+=f.top-p.top),i instanceof qC)d>n&&c(i,u,f);else if(u>=n&&(l>0&&t.push(-l),t.push(m+l),l=0,o)){let e=i.dom.lastChild,t=e?gO(e):[];if(t.length){let e=t[t.length-1],n=a?e.right-f.left:f.right-e.left;n>s&&(s=n,this.minWidth=r,this.minWidthFrom=u,this.minWidthTo=d)}}p&&h==e.children.length-1&&(l+=p.bottom-f.bottom),u=d+i.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?NO.RTL:NO.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t,n=0;for(let i of e.children){if(!i.isText()||/[^ -~]/.test(i.text))return;let e=gO(i.dom);if(1!=e.length)return;n+=e[0].width,t=e[0].height}if(n)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:n/e.length,textHeight:t}}});if(e)return e;let t,n,i,r=document.createElement("div");return r.className="cm-line",r.style.width="99999px",r.style.position="absolute",r.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(r);let e=gO(r.firstChild)[0];t=r.getBoundingClientRect().height,n=e&&e.width?e.width/27:7,i=e&&e.height?e.height:t,r.remove()}),{lineHeight:t,charWidth:n,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],o=r?r.from-1:this.view.state.doc.length;if(o>n){let i=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(rO.replace({widget:new dP(i),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return rO.set(e)}updateDeco(){let e=1,t=this.view.state.facet(OC).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,i=this.view.state.facet(PC).map((e,t)=>{let i="function"==typeof e;return i&&(n=!0),i?e(this.view):e});for(i.length&&(this.dynamicDecorationMap[e++]=n,t.push(uk.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(CC).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);return this.view.scrollDOM.scrollTop=t.top-e.yMargin,void(this.view.scrollDOM.scrollLeft=e.xMargin)}for(let t of this.view.state.facet(fC))try{if(t(this.view,e.range,e))return!0}catch(e){yC(this.view.state,e,"scroll handler")}let t,{range:n}=e,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1));if(!i)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,t.left),top:Math.min(i.top,t.top),right:Math.max(i.right,t.right),bottom:Math.max(i.bottom,t.bottom)});let r=DC(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:s,offsetHeight:a}=this.view.scrollDOM;if(function(e,t,n,i,r,o,s,a){let l=e.ownerDocument,c=l.defaultView||window;for(let u=e,p=!1;u&&!p;)if(pO(u)){let e,h=u==l.body,d=1,f=1,m=!0,g=!0;if(h)e=EO(c);else{let t=getComputedStyle(u);if(/^(fixed|sticky)$/.test(t.position)&&(p=!0),(u.scrollHeight<=u.clientHeight||!/auto|scroll/.test(t.overflowY))&&(g=!1),(u.scrollWidth<=u.clientWidth||!/auto|scroll/.test(t.overflowX))&&(m=!1),!m&&!g){u=u.assignedSlot||u.parentNode;continue}let n=u.getBoundingClientRect();({scaleX:d,scaleY:f}=SO(u,n)),e={left:n.left,right:n.left+u.clientWidth*d,top:n.top,bottom:n.top+u.clientHeight*f}}let v=0,y=0;if(g)if("nearest"==r)t.top<e.top+s?(y=t.top-(e.top+s),n>0&&t.bottom>e.bottom+y&&(y=t.bottom-e.bottom+s)):t.bottom>e.bottom-s&&(y=t.bottom-e.bottom+s,n<0&&t.top-y<e.top&&(y=t.top-(e.top+s)));else{let i=t.bottom-t.top,o=e.bottom-e.top;y=("center"==r&&i<=o?t.top+i/2-o/2:"start"==r||"center"==r&&n<0?t.top-s:t.bottom-o+s)-e.top}if(m&&("nearest"==i?t.left<e.left+o?(v=t.left-(e.left+o),n>0&&t.right>e.right+v&&(v=t.right-e.right+o)):t.right>e.right-o&&(v=t.right-e.right+o,n<0&&t.left<e.left+v&&(v=t.left-(e.left+o))):v=("center"==i?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==i==a?t.left-o:t.right-(e.right-e.left)+o)-e.left),v||y)if(h)c.scrollBy(v,y);else{let e=0,n=0;if(y){let e=u.scrollTop;u.scrollTop+=y/f,n=(u.scrollTop-e)*f}if(v){let t=u.scrollLeft;u.scrollLeft+=v/d,e=(u.scrollLeft-t)*d}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-v)<1&&(i="nearest"),n&&Math.abs(n-y)<1&&(r="nearest")}if(h)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else{if(11!=u.nodeType)break;u=u.host}}(this.view.scrollDOM,o,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==NO.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(n.head,1);if(e){let t=CO(e.dom);e.dom.scrollIntoView({block:"nearest"}),PO(t,!1)}}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){cP(this.tile)}}function cP(e,t){let n=null==t?void 0:t.get(e);if(1!=n){null==n&&e.destroy();for(let n of e.children)cP(n,t)}}function uP(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=BO(n.focusNode,n.focusOffset),r=LO(n.focusNode,n.focusOffset),o=i||r;if(r&&i&&r.node!=i.node){let t=zC.get(r.node);if(!t||t.isText()&&t.text!=r.node.nodeValue)o=r;else if(e.docView.lastCompositionAfterCursor){let e=zC.get(i.node);!e||e.isText()&&e.text!=i.node.nodeValue||(o=r)}}if(e.docView.lastCompositionAfterCursor=o!=i,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}let pP=class{constructor(){this.changes=[]}compareRange(e,t){cO(e,t,this.changes)}comparePoint(e,t){cO(e,t,this.changes)}boundChange(e){cO(e,e,this.changes)}};class hP{constructor(){this.changes=[]}compareRange(e,t){cO(e,t,this.changes)}comparePoint(){}boundChange(e){cO(e,e,this.changes)}}class dP extends nO{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function fP(e,t,n,i,r){let o=Math.round((i-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((r-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+function(e,t,n){for(let i=0,r=0;;){if(r>=t)return i;if(i==e.length)break;r+=9==e.charCodeAt(i)?n-r%n:1,i=KE(e,i)}return e.length}(s,o,e.state.tabSize)}function mP(e,t,n,i){let r=function(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let e;for(let r of i.type){if(r.from>t)break;if(!(r.to<t)){if(r.from<t&&r.to>t)return r;e&&(r.type!=iO.Text||e.type==r.type&&!(n<0?r.from<t:r.to>t))||(e=r)}}return e||i}return i}(e,t.head,t.assoc||-1),o=i&&r.type==iO.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),i=e.textDirectionAt(r.from),s=e.posAndSideAtCoords({x:n==(i==NO.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(s)return hS.cursor(s.pos,s.assoc)}return hS.cursor(n?r.to:r.from,n?1:-1)}function gP(e,t,n,i){let r=e.state.doc.lineAt(t.head),o=e.bidiSpans(r),s=e.textDirectionAt(r.from);for(let a=t,l=null;;){let t=tC(r,o,s,a,n),c=eC;if(!t){if(r.number==(n?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(n?1:-1)),o=e.bidiSpans(r),t=n?hS.cursor(r.from,-1):hS.cursor(r.to,1)}if(l){if(!l(c))return a}else{if(!i)return t;l=i(c)}a=t}}function vP(e,t,n){for(;;){let i=0;for(let r of e)r.between(t-1,t+1,(e,r,o)=>{if(t>e&&t<r){let o=i||n||(t-e<r-t?-1:1);t=o<0?e:r,i=o}});if(!i)return t}}function yP(e,t){let n=null;for(let i=0;i<t.ranges.length;i++){let r=t.ranges[i],o=null;if(r.empty){let t=vP(e,r.from,0);t!=r.from&&(o=hS.cursor(t,-1))}else{let t=vP(e,r.from,-1),n=vP(e,r.to,1);t==r.from&&n==r.to||(o=r.undirectional?hS.undirectionalRange(r.from,r.to):hS.range(r.from==r.anchor?t:n,r.from==r.head?t:n))}o&&(n||(n=t.ranges.slice()),n[i]=o)}return n?hS.create(n,t.mainIndex):t}function bP(e,t,n){let i=vP(e.state.facet(AC).map(t=>t(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:hS.cursor(i,i<n.from?1:-1)}class wP{constructor(e,t){this.pos=e,this.assoc=t}}function xP(e,t,n,i){let r,o=e.contentDOM.getBoundingClientRect(),s=o.top+e.viewState.paddingTop,{x:a,y:l}=t,c=l-s;for(;;){if(c<0)return new wP(0,1);if(c>e.viewState.docHeight)return new wP(e.state.doc.length,-1);if(r=e.elementAtHeight(c),null==i)break;if(r.type==iO.Text){if(i<0?r.to<e.viewport.from:r.from>e.viewport.to)break;let t=e.docView.coordsAt(i<0?r.from:r.to,i>0?-1:1);if(t&&(i<0?t.top<=c+s:t.bottom>=c+s))break}let t=e.viewState.heightOracle.textHeight/2;c=i>0?r.bottom+t:r.top-t}if(e.viewport.from>=r.to||e.viewport.to<=r.from){if(n)return null;if(r.type==iO.Text){let t=fP(e,o,r,a,l);return new wP(t,t==r.from?1:-1)}}if(r.type!=iO.Text)return c<(r.top+r.bottom)/2?new wP(r.from,1):new wP(r.to,-1);let u=e.docView.lineAt(r.from,2);return u&&u.length==r.length||(u=e.docView.lineAt(r.from,-2)),new _P(e,a,l,e.textDirectionAt(r.from)).scanTile(u,r.from)}class _P{constructor(e,t,n,i){this.view=e,this.x=t,this.y=n,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[GO.find(i,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[GO.find(i,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:i}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+i.from<t)}scan(e,t,n=!1){let i,r,o,s=0,a=e.length-1,l=new Set,c=this.bidiIn(e[0],e[a]),u=-1,p=1e9;e:for(;s<a;){let n=a-s,h=s+a>>1;t:if(l.has(h)){for(let e=1;e<n;e++){let t=h+e;if(t>=a&&(t-=n),!l.has(t)){h=t;break t}}break e}l.add(h);let d=t(h),f=0;if(d)for(let e=0;e<d.length;e++){let t=d[e];if(!(0==t.width&&d.length>1))if(t.bottom<this.y)(!i||i.bottom<t.bottom)&&(i=t),f=1;else if(t.top>this.y)(!r||r.top>t.top)&&(r=t),f=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,n=Math.abs(e);n<p&&(u=h,p=n,o=t),e&&(f=e<0==(this.baseDir==NO.LTR)?-1:1)}}-1!=f||c&&!this.baseDirAt(e[h],1)?1!=f||c&&!this.baseDirAt(e[h+1],-1)||(s=h+1):a=h}if(!o){if(!r&&!i)return{i:0,after:!1};let n=i&&(!r||this.y-i.bottom<r.top-this.y)?i:r;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(p&&!n){let{top:n,bottom:s}=o;if(i&&i.bottom>(n+n+s)/3)return this.y=i.bottom-1,this.scan(e,t,!0);if(r&&r.top<(n+s+s)/3)return this.y=r.top+1,this.scan(e,t,!0)}let h=(c?this.dirAt(e[u],1):this.baseDir)==NO.LTR;return{i:u,after:this.x>(o.left+o.right)/2==h}}scanText(e,t){let n=[];for(let i=0;i<e.length;i=KE(e.text,i))n.push(t+i);n.push(t+e.length);let i=this.scan(n,i=>{let r=n[i]-t,o=n[i+1]-t;return MO(e.dom,r,o).getClientRects()});return i.after?new wP(n[i.i+1],-1):new wP(n[i.i],1)}scanTile(e,t){if(!e.length)return new wP(t,1);if(1==e.children.length){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let i=0,r=t;i<e.children.length;i++)n.push(r+=e.children[i].length);let i=this.scan(n,t=>{let n=e.children[t];return 48&n.flags?null:(pO(n.dom)?n.dom:MO(n.dom,0,n.length)).getClientRects()}),r=e.children[i.i],o=n[i.i];return r.isText()?this.scanText(r,o):r.isComposite()?this.scanTile(r,o):i.after?new wP(n[i.i+1],-1):new wP(o,1)}}const EP="￿";class SP{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(ik.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=EP}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let e=this.text.length;this.readNode(i);let r=zC.get(i),o=i.nextSibling;if(o==t){(null==r?void 0:r.breakAfter)&&!o&&n!=this.view.contentDOM&&this.lineBreak();break}let s=zC.get(o);(r&&s?r.breakAfter:(r?r.breakAfter:bO(i))||bO(o)&&("BR"!=i.nodeName||(null==r?void 0:r.isWidget()))&&this.text.length>e)&&!OP(o,t)&&this.lineBreak(),i=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r,o=-1,s=1;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,n),s=this.lineSeparator.length):(r=i.exec(t))&&(o=r.index,s=r[0].length),this.append(t.slice(n,o<0?t.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=s-1);n=o+s}}readNode(e){let t=zC.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else hO(e)?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():pO(e)&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(hO(e)?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(kP(e,n.node,n.offset)?t:0))}}function kP(e,t,n){for(;;){if(!t||n<xO(t))return!1;if(t==e)return!0;n=yO(t)+1,t=t.parentNode}}function OP(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=zC.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(n||(n=[])).push(t)}if(n)for(let e of n){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}class CP{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class PP{constructor(e,t,n,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView,s=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=AP(e.docView.tile,t,n,0))){let t=r||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}=e.observer.selectionRange;n&&(t.push(new CP(n,i)),r==n&&o==i||t.push(new CP(r,o)));return t}(e),n=new SP(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,i=2==e.length?e[1].pos:n;return n<0||i<0?null:n==i?hS.create([hS.cursor(i+t,-1)]):hS.single(n+t,i+t)}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!fO(e.contentDOM,t.focusNode)?s.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),i=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!fO(e.contentDOM,t.anchorNode)?s.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),a=e.viewport;if((Yk.ios||Yk.chrome)&&n!=i&&Math.min(n,i)<=s.main.from&&Math.max(n,i)>=s.main.to&&(a.from>0||a.to<e.state.doc.length)){let t=Math.min(n,i),r=Math.max(n,i),o=a.from-t,s=a.to-r;0!=o&&1!=o&&0!=t||0!=s&&-1!=s&&r!=e.state.doc.length||(n=0,i=e.state.doc.length)}if(e.inputState.composing>-1&&s.ranges.length>1)this.newSel=s.replaceRange(hS.range(i,n));else if(e.lineWrapping&&i==n&&(!s.main.empty||s.main.head!=n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),i=0;t&&(i=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=hS.create([hS.cursor(n,i)])}else this.newSel=hS.single(i,n)}}}function AP(e,t,n,i){if(e.isComposite()){let r=-1,o=-1,s=-1,a=-1;for(let l=0,c=i,u=i;l<e.children.length;l++){let i=e.children[l],p=c+i.length;if(c<t&&p>n)return AP(i,t,n,c);if(p>=t&&-1==r&&(r=l,o=c),c>n&&i.dom.parentNode==e.dom){s=l,a=u;break}u=p,c=p+i.breakAfter}return{from:o,to:a<0?i+e.length:a,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:s<e.children.length&&s>=0?e.children[s].dom:null}}return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function TP(e,t){let n,{newSel:i}=t,{state:r}=e,o=r.selection.main,s=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:i}=t.bounds,a=o.from,l=null;(8===s||Yk.android&&t.text.length<i-e)&&(a=o.to,l="end");let c,u,p=r.doc.sliceString(e,i,EP);!o.empty&&o.from>=e&&o.to<=i&&(t.typeOver||p!=t.text)&&p.slice(0,o.from-e)==t.text.slice(0,o.from-e)&&p.slice(o.to-e)==t.text.slice(c=t.text.length-(p.length-(o.to-e)))?n={from:o.from,to:o.to,insert:VE.of(t.text.slice(o.from-e,c).split(EP))}:(u=MP(p,t.text,a-e,l))&&(Yk.chrome&&13==s&&u.toB==u.from+2&&t.text.slice(u.from,u.toB)==EP+EP&&u.toB--,n={from:e+u.from,to:e+u.toA,insert:VE.of(t.text.slice(u.from,u.toB).split(EP))})}else i&&(!e.hasFocus&&r.facet(bC)||$P(i,o))&&(i=null);if(!n&&!i)return!1;if((Yk.mac||Yk.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(i&&2==n.insert.length&&(i=hS.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:VE.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:r.toText(e.inputState.insertingText)}:Yk.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(i&&(i=hS.single(i.main.anchor-1,i.main.head-1)),n={from:o.from,to:o.to,insert:VE.of([" "])}),n)return RP(e,n,i,s);if(i&&!$P(i,o)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin,"select.pointer"==n&&(i=yP(r.facet(AC).map(t=>t(e)),i))),e.dispatch({selection:i,scrollIntoView:t,userEvent:n}),!0}return!1}function RP(e,t,n,i=-1){if(Yk.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(Yk.android&&(t.to==r.to&&(t.from==r.from||t.from==r.from-1&&" "==e.state.sliceDoc(t.from,r.from))&&1==t.insert.length&&2==t.insert.lines&&$O(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&0==t.insert.length||8==i&&t.insert.length<t.to-t.from&&t.to>r.head)&&$O(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&0==t.insert.length&&$O(e.contentDOM,"Delete",46)))return!0;let o,s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>o||(o=function(e,t,n){let i,r=e.state,o=r.selection.main,s=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let n=t.from<o.from?-1:1,i=n<0?o.from:o.to,a=vP(r.facet(AC).map(t=>t(e)),i,n);t.from==a&&(s=a)}if(s>-1)i={changes:t,selection:hS.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=o.from<t.from?r.sliceDoc(o.from,t.from):"",s=o.to>t.to?r.sliceDoc(t.to,o.to):"";i=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=r.changes(t),a=n&&n.main.to<=s.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let l,c=e.state.sliceDoc(t.from,t.to),u=n&&uP(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(o.head);let p=o.to-t.to;i=r.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:s,range:a||n.map(s)};let i=n.to-p,u=i-c.length;if(e.state.sliceDoc(u,i)!=c||i>=l.from&&u<=l.to)return{range:n};let h=r.changes({from:u,to:i,insert:t.insert}),d=n.to-o.to;return{changes:h,range:a?hS.range(Math.max(0,a.anchor+d),Math.max(0,a.head+d)):n.map(h)}})}else i={changes:s,selection:a&&r.selection.replaceRange(a)}}let a="input.type";(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1));return r.update(i,{userEvent:a,scrollIntoView:!0})}(e,t,n));return e.state.facet(lC).some(n=>n(e,t.from,t.to,s,a))||e.dispatch(a()),!0}function MP(e,t,n,i){let r=Math.min(e.length,t.length),o=0;for(;o<r&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==r&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if("end"==i){n-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.length<t.length){o-=n<=o&&n>=s?o-n:0,a=o+(a-s),s=o}else if(a<o){o-=n<=o&&n>=a?o-n:0,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function $P(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class DP{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Yk.safari&&e.contentDOM.addEventListener("input",()=>null),Yk.gecko&&function(e){rA.has(e)||(rA.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,i=t.target;i!=e.contentDOM;i=i.parentNode)if(!i||11==i.nodeType||(n=zC.get(i))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=LP(e),n=this.handlers,i=this.view.contentDOM;for(let e in t)if("scroll"!=e){let r=!t[e].handlers.length,o=n[e];o&&r!=!o.handlers.length&&(i.removeEventListener(e,this.handleEvent),o=null),o||i.addEventListener(e,this.handleEvent,{passive:r})}for(let e in n)"scroll"==e||t[e]||i.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&zP.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Yk.android&&Yk.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Yk.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(IP.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||NP.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};n.shiftKey&&Yk.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&((t=this.view.win).visualViewport&&t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85)&&(n.shiftKey=!1);let i=this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n};return setTimeout(()=>{this.pendingIOSKey==i&&this.flushIOSKey()},50),!0}var t;return 229!=e.keyCode&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!(!t||this.view.observer.pendingRecords().length)&&(!("Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,$O(this.view.contentDOM,t.key,t.keyCode,t.mods)))}ignoreDuringComposition(e){return!(!/^key/.test(e.type)||e.synthetic)&&(this.composing>0||!!(Yk.safari&&!Yk.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function BP(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(e){yC(n.state,e)}}}function LP(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,i=e&&e.plugin.domEventHandlers,r=e&&e.plugin.domEventObservers;if(i)for(let e in i){let r=i[e];r&&n(e).handlers.push(BP(t.value,r))}if(r)for(let e in r){let i=r[e];i&&n(e).observers.push(BP(t.value,i))}}for(let e in FP)n(e).handlers.push(FP[e]);for(let e in qP)n(e).observers.push(qP[e]);return t}const IP=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],NP="dthko",zP=[16,17,18,20,91,92,224,225];function jP(e){return.7*Math.max(0,e)+8}class VP{constructor(e,t,n,i){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=kO(e.contentDOM),this.atoms=e.state.facet(AC).map(t=>t(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ik.allowMultipleSelections)&&function(e,t){let n=e.state.facet(iC);return n.length?n[0](t):Yk.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=dO(e.root);if(!i||0==i.rangeCount)return!0;let r=i.getRangeAt(0).getClientRects();for(let e=0;e<r.length;e++){let n=r[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)||1!=ZP(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&function(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,i=0,r=0,o=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:s}=this.scrollParents.y.getBoundingClientRect());let a=DC(this.view);e.clientX-a.left<=i+6?t=-jP(i-e.clientX):e.clientX+a.right>=o-6&&(t=jP(e.clientX-o)),e.clientY-a.top<=r+6?n=-jP(r-e.clientY):e.clientY+a.bottom>=s-6&&(n=jP(e.clientY-s)),this.setScrollSpeed(t,n)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=yP(this.atoms,this.style.get(e,this.extend,this.multiple));!this.mustSelect&&n.eq(t.state.selection,!1===this.dragging)||this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}const FP=Object.create(null),qP=Object.create(null),HP=Yk.ie&&Yk.ie_version<15||Yk.ios&&Yk.webkit_version<604;function WP(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function QP(e,t){t=WP(e.state,uC,t);let n,{state:i}=e,r=1,o=i.toText(t),s=o.lines==i.selection.ranges.length,a=null!=eA&&i.selection.ranges.every(e=>e.empty)&&eA==o.toString();if(a){let e=-1;n=i.changeByRange(n=>{let a=i.doc.lineAt(n.from);if(a.from==e)return{range:n};e=a.from;let l=i.toText((s?o.line(r++).text:t)+i.lineBreak);return{changes:{from:a.from,insert:l},range:hS.cursor(n.from+l.length,-1)}})}else n=s?i.changeByRange(e=>{let t=o.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:hS.cursor(e.from+t.length,-1)}}):i.replaceSelection(o);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function XP(e,t,n,i){if(1==i)return hS.cursor(t,n);if(2==i)return function(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),o=t-r.from;if(0==r.length)return hS.cursor(t);0==o?n=1:o==r.length&&(n=-1);let s=o,a=o;n<0?s=KE(r.text,o,!1):a=KE(r.text,o);let l=i(r.text.slice(s,a));for(;s>0;){let e=KE(r.text,s,!1);if(i(r.text.slice(e,s))!=l)break;s=e}for(;a<r.length;){let e=KE(r.text,a);if(i(r.text.slice(a,e))!=l)break;a=e}return hS.undirectionalRange(s+r.from,a+r.from)}(e.state,t,n);{let i=e.docView.lineAt(t,n),r=e.state.doc.lineAt(i?i.posAtEnd:t),o=i?i.posAtStart:r.from,s=i?i.posAtEnd:r.to;return s<e.state.doc.length&&s==r.to&&s++,hS.undirectionalRange(o,s)}}qP.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,Yk.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())},qP.wheel=qP.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},FP.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),qP.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")},qP.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},qP.touchend=(e,t)=>{e.inputState.touchActive=!1},FP.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(oC))if(n=i(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=ZP(t),r=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),r=r.map(e.changes))},get(t,o,s){let a,l=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c=XP(e,l.pos,l.assoc,i);if(n.pos!=l.pos&&!o){let t=XP(e,n.pos,n.assoc,i),r=Math.min(t.from,c.from),o=Math.max(t.to,c.to);c=r<c.from?hS.range(r,o,c.assoc):hS.range(o,r,c.assoc)}return o?r.replaceRange(r.main.extend(c.from,c.to,c.assoc)):s&&1==i&&r.ranges.length>1&&(a=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:i,to:r}=e.ranges[n];if(i<=t&&r>=t)return hS.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(r,l.pos))?a:s?r.addRange(c):hS.create([c])}}}(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new VP(e,t,n,i)),i&&e.observer.ignore(()=>{RO(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};const GP=Yk.ie&&Yk.ie_version<=11;let UP=null,YP=0,KP=0;function ZP(e){if(!GP)return e.detail;let t=UP,n=KP;return UP=e,KP=Date.now(),YP=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(YP+1)%3:1}function JP(e,t,n,i){if(!(n=WP(e.state,uC,n)))return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:o}=e.inputState,s=i&&o&&function(e,t){let n=e.state.facet(rC);return n.length?n[0](t):Yk.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:o.from,to:o.to}:null,a={from:r,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}FP.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.tile.nearest(t.target);if(i&&i.isWidget()){let e=i.posAtStart,t=e+i.length;(e>=n.to||t<=n.from)&&(n=hS.undirectionalRange(e,t))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",WP(e.state,pC,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},FP.dragend=e=>(e.inputState.draggedContent=null,!1),FP.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,o=()=>{++r==n.length&&JP(e,t,i.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=o,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(i[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return JP(e,t,n,!0),!0}return!1},FP.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=HP?null:t.clipboardData;return n?(QP(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),QP(e,n.value)},50)}(e),!1)};let eA=null;FP.copy=FP.cut=(e,t)=>{if(!mO(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=function(e){let t=[],n=[],i=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let r=-1;for(let{from:i}of e.selection.ranges){let o=e.doc.lineAt(i);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:WP(e,pC,t.join(e.lineBreak)),ranges:n,linewise:i}}(e.state);if(!n&&!r)return!1;eA=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=HP?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}(e,n),!1)};const tA=FS.define();function nA(e,t){let n=[];for(let i of e.facet(cC)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:tA.of(!0)}):null}function iA(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=nA(e.state,t);n?e.dispatch(n):e.update([])}},10)}qP.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),iA(e)},qP.blur=e=>{e.observer.clearSelectionRange(),iA(e)},qP.compositionstart=qP.compositionupdate=(e,t)=>{if(!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0)){let{main:t}=e.state.selection;t.empty||e.lineBlockAt(t.from).from==e.lineBlockAt(t.to).from||e.state.readOnly||e.dispatch({changes:e.state.selection.ranges.filter(e=>!e.empty).map(e=>({from:e.from,to:e.to})),userEvent:"input"}),e.inputState.composing=0}},qP.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Yk.chrome&&Yk.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},qP.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},FP.beforeinput=(e,t)=>{var n,i;if("insertText"!=t.inputType&&"insertCompositionText"!=t.inputType||(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let i=null===(n=t.dataTransfer)||void 0===n?void 0:n.getData("text/plain"),r=t.getTargetRanges();if(i&&r.length){let t=r[0],n=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return RP(e,{from:n,to:o,insert:e.state.toText(i)},null),!0}}let r;if(Yk.chrome&&Yk.android&&(r=IP.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout(()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Yk.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),Yk.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>qP.compositionend(e,t),20),!1};const rA=new Set;const oA=["pre-wrap","normal","pre-line","break-spaces"];let sA=!1;function aA(){sA=!1}class lA{constructor(e){this.lineWrapping=e,this.doc=VE.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return oA.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let i=e[n];i<0?n++:this.heightSamples[Math.floor(10*i)]||(t=!0,this.heightSamples[Math.floor(10*i)]=!0)}return t}refresh(e,t,n,i,r,o){let s=oA.indexOf(e)>-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=r,a){this.heightSamples={};for(let e=0;e<o.length;e++){let t=o[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return a}}class cA{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class uA{constructor(e,t,n,i,r){this.from=e,this.length=t,this.top=n,this.height=i,this._content=r}get type(){return"number"==typeof this._content?iO.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof aO?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new uA(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var pA=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(pA||(pA={}));const hA=.001;class dA{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>hA&&(sA=!0),this.height=e)}replace(e,t,n){return dA.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let r=this,o=n.doc;for(let s=i.length-1;s>=0;s--){let{fromA:a,toA:l,fromB:c,toB:u}=i[s],p=r.lineAt(a,pA.ByPosNoHeight,n.setDoc(t),0,0),h=p.to>=l?p:r.lineAt(l,pA.ByPosNoHeight,n,0,0);for(u+=h.to-l,l=h.to;s>0&&p.from<=i[s-1].toA;)a=i[s-1].fromA,c=i[s-1].fromB,s--,a<p.from&&(p=r.lineAt(a,pA.ByPosNoHeight,n,0,0));c+=p.from-a,a=p.from;let d=xA.build(n.setDoc(o),e,c,u);r=fA(r,r.replace(a,l,d))}return r.updateHeight(n,0)}static empty(){return new vA(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,i=0,r=0;for(;;)if(t==n)if(i>2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,i-=r.size}else{if(!(r>2*i))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}}else if(i<r){let n=e[t++];n&&(i+=n.size)}else{let t=e[--n];t&&(r+=t.size)}let o=!1;return null==e[t-1]?(o=!0,t--):null==e[t]&&(o=!0,n++),new bA(dA.of(e.slice(0,t)),o,dA.of(e.slice(n)))}}function fA(e,t){return e==t?e:(e.constructor!=t.constructor&&(sA=!0),t)}dA.prototype.size=1;const mA=rO.replace({});class gA extends dA{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new uA(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,i){return this.spaceAbove&&e<n+this.spaceAbove?new uA(i,0,n,this.spaceAbove,mA):this.mainBlock(n,i)}lineAt(e,t,n,i,r){let o=this.mainBlock(i,r);return this.spaceAbove?this.blockAt(0,n,i,r).join(o):o}forEachLine(e,t,n,i,r,o){e<=r+this.length&&t>=r&&o(this.lineAt(0,pA.ByPos,n,i,r))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class vA extends gA{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new uA(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let i=n[0];return 1==n.length&&(i instanceof vA||i instanceof yA&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof yA?i=new vA(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):dA.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setMeasuredHeight(i):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class yA extends dA{constructor(e){super(e,0)}heightMetrics(e,t){let n,i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,o=r-i+1,s=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*o);n=t/o,this.length>o+1&&(s=(this.height-t)/(this.length-o-1))}else n=this.height/o;return{firstLine:i,lastLine:r,perLine:n,perChar:s}}blockAt(e,t,n,i){let{firstLine:r,lastLine:o,perLine:s,perChar:a}=this.heightMetrics(t,i);if(t.lineWrapping){let r=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(r),l=s+o.length*a,c=Math.max(n,e-l/2);return new uA(o.from,o.length,c,l,0)}{let i=Math.max(0,Math.min(o-r,Math.floor((e-n)/s))),{from:a,length:l}=t.doc.line(r+i);return new uA(a,l,n+s*i,s,0)}}lineAt(e,t,n,i,r){if(t==pA.ByHeight)return this.blockAt(e,n,i,r);if(t==pA.ByPosNoHeight){let{from:t,to:i}=n.doc.lineAt(e);return new uA(t,i-t,0,0,0)}let{firstLine:o,perLine:s,perChar:a}=this.heightMetrics(n,r),l=n.doc.lineAt(e),c=s+l.length*a,u=l.number-o,p=i+s*u+a*(l.from-r-u);return new uA(l.from,l.length,Math.max(i,Math.min(p,i+this.height-c)),c,0)}forEachLine(e,t,n,i,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(n,r);for(let c=e,u=i;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-s;u+=a*n+l*(e-r-n)}let i=a+l*t.length;o(new uA(t.from,t.length,u,i,0)),u+=i,c=t.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let e=n[n.length-1];e instanceof yA?n[n.length-1]=new yA(e.length+i):n.push(null,new yA(i-1))}if(e>0){let t=n[0];t instanceof yA?n[0]=new yA(e+t.length):n.unshift(new yA(e-1),null)}return dA.of(n)}decomposeLeft(e,t){t.push(new yA(e-1),null)}decomposeRight(e,t){t.push(null,new yA(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let n=[],o=Math.max(t,i.from),s=-1;for(i.from>t&&n.push(new yA(i.from-t-1).updateHeight(e,t));o<=r&&i.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let r=i.heights[i.index++],a=0;r<0&&(a=-r,r=i.heights[i.index++]),-1==s?s=r:Math.abs(r-s)>=hA&&(s=-2);let l=new vA(t,r,a);l.outdated=!1,n.push(l),o+=t+1}o<=r&&n.push(null,new yA(r-o).updateHeight(e,o));let a=dA.of(n);return(s<0||Math.abs(a.height-this.height)>=hA||Math.abs(s-this.heightMetrics(e,t).perLine)>=hA)&&(sA=!0),fA(this,a)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class bA extends dA{constructor(e,t,n){super(e.length+(t?1:0)+n.length,e.height+n.height,(t?1:0)|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,i){let r=n+this.left.height;return e<r?this.left.blockAt(e,t,n,i):this.right.blockAt(e,t,r,i+this.left.length+this.break)}lineAt(e,t,n,i,r){let o=i+this.left.height,s=r+this.left.length+this.break,a=t==pA.ByHeight?e<o:e<s,l=a?this.left.lineAt(e,t,n,i,r):this.right.lineAt(e,t,n,o,s);if(this.break||(a?l.to<s:l.from>s))return l;let c=t==pA.ByPosNoHeight?pA.ByPosNoHeight:pA.ByPos;return a?l.join(this.right.lineAt(s,c,n,o,s)):this.left.lineAt(s,c,n,i,r).join(l)}forEachLine(e,t,n,i,r,o){let s=i+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,i,r,o),t>=a&&this.right.forEachLine(e,t,n,s,a,o);else{let l=this.lineAt(a,pA.ByPos,n,i,r);e<l.from&&this.left.forEachLine(e,Math.min(t,l.from-1),n,i,r,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(Math.max(e,l.to+1),t,n,s,a,o)}}replace(e,t,n){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let e of n)r.push(e);if(e>0&&wA(r,o-1),t<this.length){let e=r.length;this.decomposeRight(t,r),wA(r,e)}return dA.of(r)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?dA.of(this.break?[e,null,t]:[e,t]):(this.left=fA(this.left,e),this.right=fA(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,i){let{left:r,right:o}=this,s=t+r.length+this.break,a=null;return i&&i.from<=t+r.length&&i.more?a=r=r.updateHeight(e,t,n,i):r.updateHeight(e,t,n),i&&i.from<=s+o.length&&i.more?a=o=o.updateHeight(e,s,n,i):o.updateHeight(e,s,n),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function wA(e,t){let n,i;null==e[t]&&(n=e[t-1])instanceof yA&&(i=e[t+1])instanceof yA&&e.splice(t-1,3,new yA(n.length+1+i.length))}class xA{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof vA?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new vA(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let i=n.widget?n.widget.estimatedHeight:0,r=n.widget?n.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new gA(o,i,n)):(o||r||i>=5)&&this.addLineDeco(i,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new vA(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new yA(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof vA)return e;let t=new vA(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof vA||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new vA(0,-1,0));let n=e;for(let e of this.nodes)e instanceof vA&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,i){let r=new xA(n,e);return uk.spans(t,n,i,r,0),r.finish(n)}}class _A{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,i){(e<t||n&&n.heightRelevant||i&&i.heightRelevant)&&cO(e,t,this.changes,5)}}function EA(e,t){let n=e.getBoundingClientRect(),i=e.ownerDocument,r=i.defaultView||window,o=Math.max(0,n.left),s=Math.min(r.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(r.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=i.body;)if(pO(t)){let n=window.getComputedStyle(t);if((t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=n.overflow){let n=t.getBoundingClientRect();o=Math.max(o,n.left),s=Math.min(s,n.right),a=Math.max(a,n.top),l=Math.min(t==e.parentNode?r.innerHeight:l,n.bottom)}t="absolute"==n.position||"fixed"==n.position?t.offsetParent:t.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}}function SA(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class kA{constructor(e,t,n,i){this.from=e,this.to=t,this.size=n,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i.from!=r.from||i.to!=r.to||i.size!=r.size)return!1}return!0}draw(e,t){return rO.replace({widget:new OA(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class OA extends nO{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class CA{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=RA,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=NO.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(kC).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new lA(n),this.stateDeco=MA(t),this.heightMap=dA.empty().applyChanges(this.stateDeco,VE.empty,this.heightOracle.setDoc(t.doc),[new LC(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=rO.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>i>=e&&i<=t)){let{from:t,to:n}=this.lineBlockAt(i);e.push(new PA(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?RA:$A.get(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(DA(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=MA(this.state);let i=e.changedRanges,r=LC.extendWithRanges(i,function(e,t,n){let i=new _A;return uk.compare(e,t,n,i,0),i.changes}(n,this.stateDeco,e?e.changes:rS.empty(this.state.doc.length))),o=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);aA(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||sA)&&(e.flags|=2),s?(this.scrollAnchorPos=e.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let l=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(l||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(dC)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),i=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?NO.RTL:NO.LTR;let o=this.heightOracle.mustRefreshForWrapping(r)||"refresh"===this.mustMeasureContent,s=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let l=0,c=0;if(s.width&&s.height){let{scaleX:e,scaleY:n}=SO(t,s);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,l|=16,o=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,p=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==p||(this.paddingTop=u,this.paddingBottom=p,l|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=16);let h=kO(this.view.contentDOM,!1).y;h!=this.scrollParent&&(this.scrollParent=h,this.scrollAnchorHeight=-1,this.scrollOffset=0);let d=this.getScrollOffset();this.scrollOffset!=d&&(this.scrollAnchorHeight=-1,this.scrollOffset=d),this.scrolledToBottom=DO(this.scrollParent||e.win);let f=(this.printing?SA:EA)(t,this.paddingTop),m=f.top-this.pixelViewport.top,g=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(a=!0)),!this.inView&&!this.scrollTarget&&!function(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}(e.dom))return 0;let y=s.width;if(this.contentDOMWidth==y&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=s.width,this.editorHeight=e.scrollDOM.clientHeight,l|=16),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(t)&&(o=!0),o||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:n,charWidth:s,textHeight:a}=e.docView.measureTextSize();o=n>0&&i.refresh(r,n,s,a,Math.max(5,y/s),t),o&&(e.docView.minWidth=0,l|=16)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),aA();for(let n of this.viewports){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(o?dA.empty().applyChanges(this.stateDeco,VE.empty,this.heightOracle,[new LC(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new cA(n.from,r))}sA&&(l|=2)}let b=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return b&&(2&l&&(l|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),l|=this.updateForViewport()),(2&l||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:s}=this,a=new PA(i.lineAt(o-1e3*n,pA.ByHeight,r,0,0).from,i.lineAt(s+1e3*(1-n),pA.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(e<a.from||e>a.to){let n,o=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),s=i.lineAt(e,pA.ByPos,r,0,0);n="center"==t.y?(s.top+s.bottom)/2-o/2:"start"==t.y||"nearest"==t.y&&e<a.from?s.top:s.bottom-o,a=new PA(i.lineAt(n-500,pA.ByHeight,r,0,0).from,i.lineAt(n+o+500,pA.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new PA(this.heightMap.lineAt(n,pA.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,pA.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,pA.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,pA.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:s}=this;return(0==e||i<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||r>=s+Math.max(10,Math.min(n,250)))&&i>o-2e3&&r<s+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let i of e)t.touchesRange(i.from,i.to)||n.push(new kA(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,i=n?1e4:2e3,r=i>>1,o=i<<1;if(this.defaultTextDirection!=NO.LTR&&!n)return[];let s=[],a=(i,o,l,c)=>{if(o-i<r)return;let u=this.state.selection.main,p=[u.from];u.empty||p.push(u.to);for(let e of p)if(e>i&&e<o)return a(i,e-10,l,c),void a(e+10,o,l,c);let h=function(e,t){for(let n of e)if(t(n))return n;return}(e,e=>e.from>=l.from&&e.to<=l.to&&Math.abs(e.from-i)<r&&Math.abs(e.to-o)<r&&!p.some(t=>e.from<t&&e.to>t));if(!h){if(o<l.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(hS.cursor(o),!1,!0).head;e>i&&(o=e)}let e=this.gapSize(l,i,o,c);h=new kA(i,o,e,n||e<2e6?e:2e6)}s.push(h)},l=t=>{if(t.length<o||t.type!=iO.Text)return;let r=function(e,t,n){let i=[],r=e,o=0;uk.spans(n,e,t,{span(){},point(e,t){e>r&&(i.push({from:r,to:e}),o+=e-r),r=t}},20),r<t&&(i.push({from:r,to:t}),o+=t-r);return{total:o,ranges:i}}(t.from,t.to,this.stateDeco);if(r.total<o)return;let s,l,c=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,o=i/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=c){let i=TA(r,c),s=((this.visibleBottom-this.visibleTop)/2+o)/t.height;e=i-s,n=i+s}else e=(this.visibleTop-t.top-o)/t.height,n=(this.visibleBottom-t.top+o)/t.height;s=AA(r,e),l=AA(r,n)}else{let n=r.total*this.heightOracle.charWidth,o=i*this.heightOracle.charWidth,a=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+a<this.pixelViewport.left&&(a=n.size-n.displaySize);let u,p,h=this.pixelViewport.left+a,d=this.pixelViewport.right+a;if(null!=c){let e=TA(r,c),t=((d-h)/2+o)/n;u=e-t,p=e+t}else u=(h-o)/n,p=(d+o)/n;s=AA(r,u),l=AA(r,p)}s>t.from&&a(t.from,s,t,r),l<t.to&&a(l,t.to,t,r)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(l):l(e);return s}gapSize(e,t,n,i){let r=TA(i,n)-TA(i,t);return this.heightOracle.lineWrapping?e.height*r:i.total*this.heightOracle.charWidth*r}updateLineGaps(e){kA.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=rO.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];uk.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let i=0;if(n.length!=this.visibleRanges.length)i=12;else for(let t=0;t<n.length&&!(8&i);t++){let r=this.visibleRanges[t],o=n[t];r.from==o.from&&r.to==o.to||(i|=4,e&&e.mapPos(r.from,-1)==o.from&&e.mapPos(r.to,1)==o.to||(i|=8))}return this.visibleRanges=n,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||DA(this.heightMap.lineAt(e,pA.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||DA(this.heightMap.lineAt(this.scaler.fromDOM(e),pA.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+12-this.paddingTop);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return DA(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class PA{constructor(e,t){this.from=e,this.to=t}}function AA({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:r}=t[e],o=r-n;if(i<=o)return n+i;i-=o}}function TA(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}const RA={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function MA(e){let t=e.facet(OC).filter(e=>"function"!=typeof e),n=e.facet(PC).filter(e=>"function"!=typeof e);return n.length&&t.push(uk.join(n)),t}class $A{constructor(e,t){this.scale=e,this.viewports=t}static get(e,t,n){let i=0,r=0,o=0,s=n.map(({from:n,to:r})=>{let o=t.lineAt(n,pA.ByPos,e,0,0).top,s=t.lineAt(r,pA.ByPos,e,0,0).bottom;return i+=s-o,{from:n,to:r,top:o,bottom:s,domTop:0,domBottom:0}});if(t.height-i<10)return RA;let a=(7e6-i)/(t.height-i);for(let e of s)e.domTop=o+(e.top-r)*a,o=e.domBottom=e.domTop+(e.bottom-e.top),r=e.bottom;return new $A(a,s)}toDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return i+(e-n)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);n=r.bottom,i=r.domBottom}}fromDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return n+(e-i)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);n=r.bottom,i=r.domBottom}}eq(e){return e instanceof $A&&(this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to))}}function DA(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new uA(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(e=>DA(e,t)):e._content)}const BA=mS.define({combine:e=>e.join(" ")}),LA=mS.define({combine:e=>e.indexOf(!0)>-1}),IA=Ck.newName(),NA=Ck.newName(),zA=Ck.newName(),jA={"&light":"."+NA,"&dark":"."+zA};function VA(e,t,n){return new Ck(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}const FA=VA("."+IA,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},".cm-panels-top":{top:"0"},".cm-panels-bottom":{bottom:"0"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"baseline",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{background:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat",backgroundSize:".4em",backgroundPosition:"calc(min(50%, 0px)) center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},jA),qA={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},HA=Yk.ie&&Yk.ie_version<=11;class WA{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new OO,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(Yk.ie&&Yk.ie_version<=11||Yk.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),!window.EditContext||!Yk.android||!1===e.constructor.EDIT_CONTEXT||Yk.chrome&&Yk.chrome_version<126||(this.editContext=new GA(e),e.state.facet(bC)&&(e.contentDOM.editContext=this.editContext.editContext)),HA&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(this.pendingRecords().length>0),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(bC)?n.root.activeElement!=this.dom:!mO(this.dom,i))return;let r=i.anchorNode&&n.docView.tile.nearest(i.anchorNode);r&&r.isWidget()&&r.widget.ignoreEvent(e)?t||(this.selectionChanged=!1):(Yk.ie&&Yk.ie_version<=11||Yk.android&&Yk.chrome)&&!n.state.selection.main.empty&&i.focusNode&&vO(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=dO(e.root);if(!t)return!1;let n=Yk.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return XA(e,n)}let n=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?XA(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let i=mO(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,i=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=i)return!1;for(i=Math.min(i,xO(n));;)if(i){if(!pO(n))return!1;let e=n.childNodes[i-1];"false"==e.contentEditable?i--:(n=e,i=xO(n))}else{if(n==e)return!0;i=yO(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(pO(n))!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else{if(11!=n.nodeType)break;n=n.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,qA),HA&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),HA&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;if(e){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&$O(this.dom,e.key,e.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(n=this.delayedAndroidKey)||void 0===n?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,i=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(i=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&mO(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new PP(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.selectionChanged,n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=TP(this.view,n);return this.view.state==i&&(n.domChanged||t)&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=QA(t,e.previousSibling||e.target.previousSibling,-1),i=QA(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(bC)!=e.state.facet(bC)&&(e.view.contentDOM.editContext=e.state.facet(bC)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function QA(e,t,n){for(;t;){let i=zC.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function XA(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return vO(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}class GA{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let i=e.state.selection.main,{anchor:r,head:o}=i,s=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:s,drifted:!1});let l=a-s>n.text.length;s==this.from&&r<this.from?s=r:a==this.to&&r>this.to&&(a=r);let c=MP(e.state.sliceDoc(s,a),n.text,(l?i.from:i.to)-s,l?"end":null);if(!c){let t=hS.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));return void($P(t,i)||e.dispatch({selection:t,userEvent:"select"}))}let u={from:c.from+s,to:c.toA+s,insert:VE.of(n.text.slice(c.from,c.toB).split("\n"))};if((Yk.mac||Yk.android)&&u.from==o-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(u={from:s,to:a,insert:VE.of([n.text.replace("."," ")])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);RP(e,u,hS.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let i=[],r=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);r=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||r||new DOMRect,i.push(r)}t.updateCharacterBounds(n.rangeStart,i)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,i=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(i)){let r=this.toEditorPos(e.rangeStart),o=this.toEditorPos(e.rangeEnd);if(r<o){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(i)?1:2}px`;n.push(rO.mark({attributes:{style:e}}).range(r,o))}}}e.dispatch({effects:vC.of(rO.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{let t=dO(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges((r,o,s,a,l)=>{if(n)return;let c=l.length-(o-r);if(i&&o>=i.to){if(i.from==r&&i.to==o&&i.insert.eq(l))return i=this.pendingContextChange=null,t+=c,void(this.to+=c);i=null,this.revertPending(e.state)}if(r+=t,(o+=t)<=this.from)this.from+=c,this.to+=c;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+l.length>3e4)return void(n=!0);this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),l.toString()),this.to+=c}t+=c}),i&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);this.editContext.selectionStart==n&&this.editContext.selectionEnd==i||this.editContext.updateSelection(n,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class UA{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new CA(this,e.state||ik.create(e)),e.scrollTo&&e.scrollTo.is(gC)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(xC).map(e=>new EC(e));for(let e of this.plugins)e.update(this);this.observer=new WA(this),this.inputState=new DP(this),this.inputState.ensureHandlers(this.plugins),this.docView=new lP(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=1==e.length&&e[0]instanceof QS?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,i=!1,r=this.state;for(let t of e){if(t.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=t.state}if(this.destroyed)return void(this.viewState.state=r);let o=this.hasFocus,s=0,a=null;e.some(e=>e.annotation(tA))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=nA(r,o),a||(s=1));let l=this.observer.delayedAndroidKey,c=null;if(l?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(ik.phrases)!=this.state.facet(ik.phrases))return this.setState(r);t=IC.create(this,r,e),t.flags|=s;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection,{x:n,y:i}=this.state.facet(UA.cursorScrollMargin);u=new mC(e.empty?e:hS.cursor(e.head,e.head>e.anchor?-1:1),"nearest","nearest",i,n)}for(let e of t.effects)e.is(gC)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=ZA.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(BC)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(t.startState.facet(BA)!=t.state.facet(BA)&&(this.viewState.mustMeasureContent=!0),(n||i||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!t.empty)for(let e of this.state.facet(aC))try{e(t)}catch(e){yC(this.state,e,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!TP(this,c)&&l.force&&$O(this.contentDOM,l.key,l.keyCode)})}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new CA(this,e),this.plugins=e.facet(xC).map(e=>new EC(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new lP(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(xC),n=e.state.facet(xC);if(t!=n){let i=[];for(let r of n){let n=t.indexOf(r);if(n<0)i.push(new EC(r));else{let t=this.plugins[n];t.mustUpdate=e,i.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){yC(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:r,scrollAnchorHeight:o,scaleY:s}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0){if(DO(n||this.win))r=-1,o=this.viewState.heightMap.height/this.viewState.scaleY;else{let e=this.viewState.scrollAnchorAt(i);r=e.from,o=e.top}s=this.viewState.scaleY}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let l=[];4&a||([this.measureRequests,l]=[l,this.measureRequests]);let c=l.map(e=>{try{return e.read(this)}catch(e){return yC(this.state,e),KA}}),u=IC.create(this,this.state,[]),p=!1;u.flags|=a,t?t.flags|=a:t=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),p=this.docView.update(u),p&&this.docViewUpdate());for(let e=0;e<l.length;e++)if(c[e]!=KA)try{let t=l[e];t.write&&t.write(c[e],this)}catch(e){yC(this.state,e)}if(p&&this.docView.updateSelection(!0),!u.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}{let e=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)/this.viewState.scaleY-o/s;if((e>1||e<-1)&&!(Yk.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i+=e,n?r<0?n.scrollTop=n.scrollHeight:n.scrollTop+=e:this.win.scrollBy(0,e),o=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(aC))e(t)}get themeClasses(){return IA+" "+(this.state.facet(LA)?zA:NA)+" "+this.state.facet(BA)}updateAttrs(){let e=JA(this,SC,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(bC)?"true":"false",class:"cm-content",style:`${Yk.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),JA(this,kC,t);let n=this.observer.ignore(()=>{let n=eO(this.contentDOM,this.contentAttrs,t),i=eO(this.dom,this.editorAttrs,e);return n||i});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)if(e.is(UA.announce)){t&&(this.announceDOM.textContent="",this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=" "},200),t=!1),this.announceDOM.appendChild(document.createElement("div")).textContent=e.value}}mountStyles(){this.styleModules=this.state.facet(BC);let e=this.state.facet(UA.cspNonce);Ck.mount(this.root,this.styleModules.concat(FA).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key)return void(this.measureRequests[t]=e);this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return bP(this,e,gP(this,e,t,n))}moveByGroup(e,t){return bP(this,e,gP(this,e,t,t=>function(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return e=>{let t=i(e);return r==JS.Space&&(r=t),r==t}}(this,e.head,t)))}visualLineSide(e,t){return t?hS.cursor(e.to,1):hS.cursor(e.from,-1)}moveToLineBoundary(e,t,n=!0){return mP(this,e,t,n)}moveVertically(e,t,n){return bP(this,e,function(e,t,n,i){let r=t.head,o=n?1:-1;if(r==(n?e.state.doc.length:0))return hS.cursor(r,t.assoc);let s,a=t.goalColumn,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(c)null==a&&(a=c.left-l.left),s=o<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(r-t.from))),s=(o<0?t.top:t.bottom)+u}let p=l.left+a,h=e.viewState.heightOracle.textHeight>>1,d=null!=i?i:h;for(let t=0;;t+=h){let i=s+(d+t)*o,r=xP(e,{x:p,y:i},!1,o);if(n?i>l.bottom:i<l.top)return hS.cursor(r.pos,r.assoc);let c=e.coordsAtPos(r.pos,r.assoc),u=c?(c.top+c.bottom)/2:0;if(!c||(n?u>s:u<s))return hS.cursor(r.pos,r.assoc,void 0,a)}}(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=xP(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),xP(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.state.doc.lineAt(e),i=this.bidiSpans(n),r=i[GO.find(i,e-n.from,-1,t)];return n.length&&(e==n.from&&t<0||e==n.to&&t>0)&&r.dir!=this.textDirectionAt(n.from)&&(e==n.to?(e=n.from+r.from,t=1):(e=n.from+r.to,t=-1)),this.docView.coordsAt(e,t,r.dir==NO.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(hC)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>YA)return JO(e.length);let t,n=this.textDirectionAt(e.from);for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||UO(i.isolates,t=RC(this,e))))return i.order;t||(t=RC(this,e));let i=function(e,t,n){if(!e)return[new GO(0,0,t==jO?1:0)];if(t==zO&&!n.length&&!XO.test(e))return JO(e.length);if(n.length)for(;e.length>YO.length;)YO[YO.length]=256;let i=[],r=t==zO?0:1;return ZO(e,r,r,n,0,e.length,i),i}(e.text,n,t);return this.bidiCache.push(new ZA(e.from,e.to,n,t,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Yk.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{RO(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var n,i,r,o;return gC.of(new mC("number"==typeof e?hS.cursor(e):e,null!==(n=t.y)&&void 0!==n?n:"nearest",null!==(i=t.x)&&void 0!==i?i:"nearest",null!==(r=t.yMargin)&&void 0!==r?r:5,null!==(o=t.xMargin)&&void 0!==o?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return gC.of(new mC(hS.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return _C.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return _C.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Ck.newName(),i=[BA.of(n),BC.of(VA(`.${n}`,e))];return t&&t.dark&&i.push(LA.of(!0)),i}static baseTheme(e){return PS.lowest(BC.of(VA("."+IA,e,jA)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&zC.get(n)||zC.get(e);return(null===(t=null==i?void 0:i.root)||void 0===t?void 0:t.view)||null}}UA.styleModule=BC,UA.inputHandler=lC,UA.clipboardInputFilter=uC,UA.clipboardOutputFilter=pC,UA.scrollHandler=fC,UA.focusChangeEffect=cC,UA.perLineTextDirection=hC,UA.exceptionSink=sC,UA.updateListener=aC,UA.editable=bC,UA.mouseSelectionStyle=oC,UA.dragMovesSelection=rC,UA.clickAddsSelectionRange=iC,UA.decorations=OC,UA.blockWrappers=CC,UA.outerDecorations=PC,UA.atomicRanges=AC,UA.bidiIsolatedRanges=TC,UA.cursorScrollMargin=mS.define({combine:e=>{let t=5,n=5;for(let i of e)"number"==typeof i?t=n=i:({x:t,y:n}=i);return{x:t,y:n}}}),UA.scrollMargins=$C,UA.darkTheme=LA,UA.cspNonce=mS.define({combine:e=>e.length?e[0]:""}),UA.contentAttributes=kC,UA.editorAttributes=SC,UA.lineWrapping=UA.contentAttributes.of({class:"cm-lineWrapping"}),UA.announce=WS.define();const YA=4096,KA={};class ZA{constructor(e,t,n,i,r,o){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:NO.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir!=i||t.touchesRange(o.from,o.to)||n.push(new ZA(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function JA(e,t,n){for(let i=e.state.facet(t),r=i.length-1;r>=0;r--){let t=i[r],o="function"==typeof t?t(e):t;o&&Kk(o,n)}return n}const eT=Yk.mac?"mac":Yk.windows?"win":Yk.linux?"linux":"key";function tT(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const nT=PS.default(UA.domEventHandlers({keydown:(e,t)=>function(e,t,n,i){aT=t;let r=function(e){var t=!($k&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Dk&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Mk:Rk)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),o=ZE(r,0),s=eS(o)==r.length&&" "!=r,a="",l=!1,c=!1,u=!1;oT&&oT.view==n&&oT.scope==i&&(a=oT.prefix+" ",zP.indexOf(t.keyCode)<0&&(c=!0,oT=null));let p,h,d=new Set,f=e=>{if(e){for(let t of e.run)if(!d.has(t)&&(d.add(t),t(n)))return e.stopPropagation&&(u=!0),!0;e.preventDefault&&(e.stopPropagation&&(u=!0),c=!0)}return!1},m=e[i];m&&(f(m[a+tT(r,t,!s)])?l=!0:!s||!(t.altKey||t.metaKey||t.ctrlKey)||Yk.windows&&t.ctrlKey&&t.altKey||Yk.mac&&t.altKey&&!t.ctrlKey&&!t.metaKey||!(p=Rk[t.keyCode])||p==r?s&&t.shiftKey&&f(m[a+tT(r,t,!0)])&&(l=!0):(f(m[a+tT(p,t,!0)])||t.shiftKey&&(h=Mk[t.keyCode])!=r&&h!=p&&f(m[a+tT(h,t,!1)]))&&(l=!0),!l&&f(m._any)&&(l=!0));c&&(l=!0);l&&u&&t.stopPropagation();return aT=null,l}(function(e){let t=e.facet(iT),n=rT.get(t);n||rT.set(t,n=function(e,t=eT){let n=Object.create(null),i=Object.create(null),r=(e,t)=>{let n=i[e];if(null==n)i[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,i,o,s,a)=>{var l,c;let u=n[e]||(n[e]=Object.create(null)),p=i.split(/ (?!$)/).map(e=>function(e,t){const n=e.split(/-(?!$)/);let i,r,o,s,a=n[n.length-1];"Space"==a&&(a=" ");for(let e=0;e<n.length-1;++e){const a=n[e];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))i=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))o=!0;else{if(!/^mod$/i.test(a))throw new Error("Unrecognized modifier name: "+a);"mac"==t?s=!0:r=!0}}return i&&(a="Alt-"+a),r&&(a="Ctrl-"+a),s&&(a="Meta-"+a),o&&(a="Shift-"+a),a}(e,t));for(let t=1;t<p.length;t++){let n=p.slice(0,t).join(" ");r(n,!0),u[n]||(u[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let i=oT={view:t,prefix:n,scope:e};return setTimeout(()=>{oT==i&&(oT=null)},sT),!0}]})}let h=p.join(" ");r(h,!1);let d=u[h]||(u[h]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(l=u._any)||void 0===l?void 0:l.run)||void 0===c?void 0:c.slice())||[]});o&&d.run.push(o),s&&(d.preventDefault=!0),a&&(d.stopPropagation=!0)};for(let i of e){let e=i.scope?i.scope.split(" "):["editor"];if(i.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:r}=i;for(let t in e)e[t].run.push(e=>r(e,aT))}let r=i[t]||i.key;if(r)for(let t of e)o(t,r,i.run,i.preventDefault,i.stopPropagation),i.shift&&o(t,"Shift-"+r,i.shift,i.preventDefault,i.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[])));return n}(t.state),e,t,"editor")})),iT=mS.define({enables:nT}),rT=new WeakMap;let oT=null;const sT=4e3;let aT=null;let lT=class extends nO{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?gO(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),i=_O(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return i.bottom-i.top>1.5*r?{left:i.left,right:i.right,top:i.top,bottom:i.top+r}:i}ignoreEvent(){return!1}};function cT(e){let t=_C.fromClass(class{constructor(t){this.view=t,this.placeholder=e?rO.set([rO.widget({widget:new lT(e),side:1}).range(0)]):rO.none}get decorations(){return this.view.state.doc.length?rO.none:this.placeholder}},{decorations:e=>e.decorations});return"string"==typeof e?[t,UA.contentAttributes.of({"aria-placeholder":e})]:t}const uT="-10000px";class pT{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let r=null;this.tooltipViews=this.tooltips.map(e=>r=n(e,r))}update(e,t){var n;let i=e.state.facet(this.facet),r=i.filter(e=>e);if(i===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let o=[],s=t?[]:null;for(let n=0;n<r.length;n++){let i=r[n],a=-1;if(i){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==i.create&&(a=e)}if(a<0)o[n]=this.createTooltipView(i,n?o[n-1]:null),s&&(s[n]=!!i.above);else{let i=o[n]=this.tooltipViews[a];s&&(s[n]=t[a]),i.update&&i.update(e)}}}for(let e of this.tooltipViews)o.indexOf(e)<0&&(this.removeTooltipView(e),null===(n=e.destroy)||void 0===n||n.call(e));return t&&(s.forEach((e,n)=>t[n]=e),t.length=s.length),this.input=i,this.tooltips=r,this.tooltipViews=o,!0}}function hT(e={}){return mT.of(e)}function dT(e){let t=e.dom.ownerDocument.documentElement,n=t.clientWidth,i=getComputedStyle(t);if(!/stable/.test(i.scrollbarGutter||""))return{left:0,right:n};let r=t.getBoundingClientRect(),o=e.win.scrollX;return{left:Math.max(0,r.left+o-parseFloat(i.marginLeft)),right:Math.min(n,r.right+o+parseFloat(i.marginRight))}}function fT(e){let{left:t,right:n}=dT(e);return{top:0,left:t,right:n,bottom:e.dom.ownerDocument.documentElement.clientHeight}}const mT=mS.define({combine:e=>{var t,n,i;return{position:Yk.ios?"absolute":(null===(t=e.find(e=>e.position))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find(e=>e.parent))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(i=e.find(e=>e.tooltipSpace))||void 0===i?void 0:i.tooltipSpace)||fT}}}),gT=new WeakMap,vT=_C.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(mT);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new pT(e,xT,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(mT);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=uT,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),null===(e=t.destroy)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(n=this.intersectionObserver)||void 0===n||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1,i=0;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(Yk.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);else i=dT(this.view).left;let r=this.view.scrollDOM.getBoundingClientRect(),o=DC(this.view);return{visible:{left:r.left+o.left,top:r.top+o.top,right:r.right-o.right,bottom:r.bottom-o.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(mT).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n,fixedLeft:i}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:o}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,p=e.pos[a],h=e.size[a];if(!p||!1!==l.clip&&(p.bottom<=Math.max(n.top,i.top)||p.top>=Math.min(n.bottom,i.bottom)||p.right<Math.max(n.left,i.left)-.1||p.left>Math.min(n.right,i.right)+.1)){u.style.top=uT;continue}let d=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=d?7:0,m=h.right-h.left,g=null!==(t=gT.get(c))&&void 0!==t?t:h.bottom-h.top,v=c.offset||wT,y=this.view.textDirection==NO.LTR,b=h.width>i.right-i.left?y?i.left:i.right-h.width:y?Math.max(i.left,Math.min(p.left-(d?14:0)+v.x,i.right-m)):Math.min(Math.max(i.left,p.left-m+(d?14:0)-v.x),i.right-m),w=this.above[a];!l.strictSide&&(w?p.top-g-f-v.y<i.top:p.bottom+g+f+v.y>i.bottom)&&w==i.bottom-p.bottom>p.top-i.top&&(w=this.above[a]=!w);let x=(w?p.top-i.top:i.bottom-p.bottom)-f;if(x<g&&!1!==c.resize){if(x<this.view.defaultLineHeight){u.style.top=uT;continue}gT.set(c,g),u.style.height=(g=x)/o+"px"}else u.style.height&&(u.style.height="");let _=w?p.top-g-f-v.y:p.bottom+f+v.y,E=b+m;if(!0!==c.overlap)for(let e of s)e.left<E&&e.right>b&&e.top<_+g&&e.bottom>_&&(_=w?e.top-g-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(_-e.parent.top)/o+"px",yT(u,(b-e.parent.left)/r)):(u.style.top=_/o+"px",yT(u,(b-e.fixedLeft)/r)),d){let e=p.left+(y?v.x:-v.x)-(b+14-7);d.style.left=e/r+"px"}!0!==c.overlap&&s.push({left:b,top:_,right:E,bottom:_+g}),u.classList.toggle("cm-tooltip-above",w),u.classList.toggle("cm-tooltip-below",!w),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=uT}},{eventObservers:{scroll(){this.maybeMeasure()}}});function yT(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const bT=UA.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),wT={x:0,y:0},xT=mS.define({enables:[vT,bT]}),_T=mS.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class ET{static create(e){return new ET(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new pT(e,_T,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let i=n[e];if(void 0!==i)if(void 0===t)t=i;else if(t!==i)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const ST=xT.compute([_T],e=>{let t=e.facet(_T);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos})),create:ET.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),kT=mS.define();class OT{constructor(e,t,n,i,r,o){this.view=e,this.source=t,this.field=n,this.locked=i,this.setHover=r,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let i,r=1;if(n.isWidget())i=n.posAtStart;else{if(i=e.posAtCoords(t),null==i)return;let n=e.coordsAtPos(i);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(i)).find(e=>e.from<=i&&e.to>=i),s=o&&o.dir==NO.RTL?-1:1;r=t.x<n.left?-s:s}this.activateHover(e,i,r)}activateHover(e,t,n,i){let r=this.source(e,t,n),o=t=>{if(t&&(!Array.isArray(t)||t.length)){let n=Array.isArray(t)?t:[t];i&&this.locked.set(n,i),e.dispatch({effects:this.setHover.of(n)})}};if(r&&"then"in r){let n=this.pending={pos:t};r.then(e=>{this.pending==n&&(this.pending=null,o(e))},t=>yC(e.state,t,"hover tooltip"))}else o(r)}get tooltip(){let e=this.view.plugin(vT),t=e?e.manager.tooltips.findIndex(e=>e.create==ET.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:r}=this;if(i.length&&!this.locked.has(i)&&r&&!function(e,t){let n,{left:i,right:r,top:o,bottom:s}=e.getBoundingClientRect();if(n=e.querySelector(".cm-tooltip-arrow")){let e=n.getBoundingClientRect();o=Math.min(e.top,o),s=Math.max(e.bottom,s)}return t.clientX>=i-CT&&t.clientX<=r+CT&&t.clientY>=o-CT&&t.clientY<=s+CT}(r.dom,e)||this.pending){let{pos:r}=i[0]||this.pending,o=null!==(n=null===(t=i[0])||void 0===t?void 0:t.end)&&void 0!==n?n:r;(r==o?this.view.posAtCoords(this.lastMove)==r:function(e,t,n,i,r){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,s)<r)return!1;let a=e.posAtCoords({x:i,y:r},!1);return a>=t&&a<=n}(this.view,r,o,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t);let{active:i}=this;!i.length||this.locked.has(i)||this.view.dom.contains(n.relatedTarget)||this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const CT=4;function PT(e,t={}){let n=WS.define(),i=new WeakMap,r=_S.define({create:()=>[],update(e,o){let s=i.get(e);if(e.length&&(t.hideOnChange&&(o.docChanged||o.selection)||s&&s(o)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(o,e)))),o.docChanged&&e.length){let t=[];for(let n of e){let e=o.changes.mapPos(n.pos,-1,nS.TrackDel);if(null!=e){let i=Object.assign(Object.create(null),n);i.pos=e,null!=i.end&&(i.end=o.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of o.effects)t.is(n)&&(e=t.value,s=void 0),(t.is(TT)&&!t.value||t.value==r)&&(e=[]);return e.length&&s&&i.set(e,s),e},provide:e=>_T.from(e)});const o=_C.define(o=>new OT(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,o,kT.of(o),ST]}}function AT(e,t){let n=e.plugin(vT);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const TT=WS.define(),RT=mS.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}}),MT=_C.fromClass(class{constructor(e){this.input=e.state.facet(BT),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(RT);this.top=new $T(e,!0,t.topContainer),this.bottom=new $T(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(RT);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new $T(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new $T(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(BT);if(n!=this.input){let t=n.filter(e=>e),i=[],r=[],o=[],s=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),s.push(t)):(t=this.panels[a],t.update&&t.update(e)),i.push(t),(t.top?r:o).push(t)}this.specs=t,this.panels=i,this.top.sync(r),this.bottom.sync(o);for(let e of s)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>UA.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class $T{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=DT(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=DT(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function DT(e){let t=e.nextSibling;return e.remove(),t}const BT=mS.define({enables:MT});class LT extends ok{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}LT.prototype.elementClass="",LT.prototype.toDOM=void 0,LT.prototype.mapMode=nS.TrackBefore,LT.prototype.startSide=LT.prototype.endSide=-1,LT.prototype.point=!0;const IT=mS.define(),NT=mS.define(),zT=mS.define(),jT=mS.define({combine:e=>e.some(e=>e)});const VT=_C.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(zT).map(t=>new WT(e,t)),this.fixed=!e.state.facet(jT);for(let e of this.gutters)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<.8*(n.to-n.from))}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(jT)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=uk.iter(this.view.state.facet(IT),this.view.viewport.from),i=[],r=this.gutters.map(e=>new HT(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==iO.Text&&t){qT(n,i,o.from);for(let e of r)e.line(this.view,o,i);t=!1}else if(o.widget)for(let e of r)e.widget(this.view,o)}else if(e.type==iO.Text){qT(n,i,e.from);for(let t of r)t.line(this.view,e,i)}else if(e.widget)for(let t of r)t.widget(this.view,e);for(let e of r)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(zT),n=e.state.facet(zT),i=e.docChanged||e.heightChanged||e.viewportChanged||!uk.eq(e.startState.facet(IT),e.state.facet(IT),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(i=!0);else{i=!0;let r=[];for(let i of n){let n=t.indexOf(i);n<0?r.push(new WT(this.view,i)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>UA.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==NO.LTR?{left:i,right:r}:{right:i,left:r}})});function FT(e){return Array.isArray(e)?e:[e]}function qT(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class HT{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=uk.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let t=new QT(e,o,r,n);i.elements.push(t),i.dom.appendChild(t.dom)}else i.elements[this.i].update(e,o,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];qT(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let o=this.gutter;(0!=i.length||o.config.renderEmptyElements)&&this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),i=n?[n]:null;for(let n of e.state.facet(NT)){let r=n(e,t.widget,t);r&&(i||(i=[])).push(r)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class WT{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,i=>{let r,o=i.target;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let e=o.getBoundingClientRect();r=(e.top+e.bottom)/2}else r=i.clientY;let s=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[n](e,s,i)&&i.preventDefault()});this.markers=FT(t.markers(e)),t.initialSpacer&&(this.spacer=new QT(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=FT(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!uk.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class QT{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,o=0;;){let s=o,a=r<t.length?t[r++]:null,l=!1;if(a){let e=a.elementClass;e&&(n+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(a)){s=e,l=!0;break}}else s=this.markers.length;for(;o<s;){let e=this.markers[o++];if(e.toDOM){e.destroy(i);let t=i.nextSibling;i.remove(),i=t}}if(!a)break;a.toDOM&&(l?i=i.nextSibling:this.dom.insertBefore(a.toDOM(e),i)),l&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}const XT=mS.define(),GT=mS.define(),UT=mS.define({combine:e=>rk(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let i=n[e],r=t[e];n[e]=i?(e,t,n)=>i(e,t,n)||r(e,t,n):r}return n}})});class YT extends LT{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function KT(e,t){return e.state.facet(UT).formatNumber(t,e.state)}const ZT=zT.compute([UT],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(XT),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new YT(KT(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let i of e.state.facet(GT)){let r=i(e,t,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(UT)!=e.state.facet(UT),initialSpacer:e=>new YT(KT(e,eR(e.state.doc.lines))),updateSpacer(e,t){let n=KT(t.view,eR(t.view.state.doc.lines));return n==e.number?e:new YT(n)},domEventHandlers:e.facet(UT).domEventHandlers,side:"before"}));function JT(e={}){return[UT.of(e),[VT],ZT]}function eR(e){let t=9;for(;t<e;)t=10*t+9;return t}const tR=1024;let nR=0;class iR{constructor(e,t){this.from=e,this.to=t}}class rR{constructor(e={}){this.id=nR++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=aR.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}rR.closedBy=new rR({deserialize:e=>e.split(" ")}),rR.openedBy=new rR({deserialize:e=>e.split(" ")}),rR.group=new rR({deserialize:e=>e.split(" ")}),rR.isolate=new rR({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),rR.contextHash=new rR({perNode:!0}),rR.lookAhead=new rR({perNode:!0}),rR.mounted=new rR({perNode:!0});class oR{constructor(e,t,n,i=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=i}static get(e){return e&&e.props&&e.props[rR.mounted.id]}}const sR=Object.create(null);class aR{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):sR,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),i=new aR(e.name||"",t,e.id,n);if(e.props)for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(rR.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(rR.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}}aR.none=new aR("",Object.create(null),0,8);class lR{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let i=null;for(let t of e){let e=t(n);if(e){i||(i=Object.assign({},n.props));let t=e[1],r=e[0];r.combine&&r.id in i&&(t=r.combine(i[r.id],t)),i[r.id]=t}}t.push(i?new aR(n.name,i,n.id,n.flags):n)}return new lR(t)}}const cR=new WeakMap,uR=new WeakMap;var pR;!function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"}(pR||(pR={}));class hR{constructor(e,t,n,i,r){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,r&&r.length){this.props=Object.create(null);for(let[e,t]of r)this.props["number"==typeof e?e:e.id]=t}}toString(){let e=oR.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new kR(this.topNode,e)}cursorAt(e,t=0,n=0){let i=cR.get(this)||this.topNode,r=new kR(i);return r.moveTo(e,t),cR.set(this,r._tree),r}get topNode(){return new yR(this,0,0,null)}resolve(e,t=0){let n=gR(cR.get(this)||this.topNode,e,t,!1);return cR.set(this,n),n}resolveInner(e,t=0){let n=gR(uR.get(this)||this.topNode,e,t,!0);return uR.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let i=e.resolveInner(t,n),r=null;for(let e=i instanceof yR?i:i.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(r||(r=[i])).push(o.resolve(t,n)),e=o}else{let o=oR.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let s=new yR(o.tree,o.overlay[0].from+e.from,-1,e);(r||(r=[i])).push(gR(s,t,n,!1))}}return r?ER(r):i}(this,e,t)}iterate(e){let{enter:t,leave:n,from:i=0,to:r=this.length}=e,o=e.mode||0,s=(o&pR.IncludeAnonymous)>0;for(let e=this.cursor(o|pR.IncludeAnonymous);;){let o=!1;if(e.from<=r&&e.to>=i&&(!s&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;o=!0}for(;o&&n&&(s||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;o=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:AR(aR.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new hR(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new hR(aR.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=tR,reused:o=[],minRepeatType:s=i.types.length}=e,a=Array.isArray(n)?new dR(n,n.length):n,l=i.types,c=0,u=0;function p(e,t,n,y,b,w){let{id:x,start:_,end:E,size:S}=a,k=u,O=c;if(S<0){if(a.next(),-1==S){let t=o[x];return n.push(t),void y.push(_-e)}if(-3==S)return void(c=x);if(-4==S)return void(u=x);throw new RangeError(`Unrecognized record size: ${S}`)}let C,P,A=l[x],T=_-e;if(E-_<=r&&(P=g(a.pos-t,b))){let t=new Uint16Array(P.size-P.skip),n=a.pos-P.size,r=t.length;for(;a.pos>n;)r=v(P.start,t,r);C=new fR(t,E-P.start,i),T=P.start-e}else{let e=a.pos-S;a.next();let t=[],n=[],l=x>=s?x:-1,c=0,g=E,v=k;for(;a.pos>e;)l>=0&&a.id==l&&a.size>=0?(a.end<=g-r&&(f(t,n,_,c,a.end,g,l,v,O),c=t.length,g=a.end,v=u),a.next()):w>2500?h(_,e,t,n):(l>=0&&-1==a.size&&o[a.id].type==i.types[l]&&(c<t.length&&f(t,n,_,c,a.end,g,l,v,O),c=t.length+1,g=a.start,v=u),p(_,e,t,n,l,w+1));if(l>=0&&c>0&&c<t.length&&f(t,n,_,c,_,g,l,v,O),t.reverse(),n.reverse(),l>-1&&c>0){let e=d(A,O);C=AR(A,t,n,0,t.length,0,E-_,e,e)}else C=m(A,t,n,E-_,k-E,O)}n.push(C),y.push(T)}function h(e,t,n,o){let s=[],l=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:i}=a;if(i>4)a.next();else{if(c>-1&&t<c)break;c<0&&(c=n-r),s.push(e,t,n),l++,a.next()}}if(l){let t=new Uint16Array(4*l),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;n.push(new fR(t,s[2]-r,i)),o.push(r-e)}}function d(e,t){return(n,i,r)=>{let o,s,a=0,l=n.length-1;if(l>=0&&(o=n[l])instanceof hR){if(!l&&o.type==e&&o.length==r)return o;(s=o.prop(rR.lookAhead))&&(a=i[l]+o.length+s-r)}return m(e,n,i,r,a,t)}}function f(e,t,n,r,o,s,a,l,c){let u=[],p=[];for(;e.length>r;)u.push(e.pop()),p.push(t.pop()+n-o);e.push(m(i.types[a],u,p,s-o,l-s,c)),t.push(o-n)}function m(e,t,n,i,r,o,s){if(o){let e=[rR.contextHash,o];s=s?[e].concat(s):[e]}if(r>25){let e=[rR.lookAhead,r];s=s?[e].concat(s):[e]}return new hR(e,t,n,i,s)}function g(e,t){let n=a.fork(),i=0,o=0,l=0,c=n.end-r,u={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=o,u.skip=l,l+=4,i+=4,n.next();continue}let a=n.pos-e;if(e<0||a<r||n.start<c)break;let p=n.id>=s?4:0,h=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size&&-4!=n.size)break e;p+=4}else n.id>=s&&(p+=4);n.next()}o=h,i+=e,l+=p}return(t<0||i==e)&&(u.size=i,u.start=o,u.skip=l),u.size>4?u:void 0}function v(e,t,n){let{id:i,start:r,end:o,size:l}=a;if(a.next(),l>=0&&i<s){let s=n;if(l>4){let i=a.pos-(l-4);for(;a.pos>i;)n=v(e,t,n)}t[--n]=s,t[--n]=o-e,t[--n]=r-e,t[--n]=i}else-3==l?c=i:-4==l&&(u=i);return n}let y=[],b=[];for(;a.pos>0;)p(e.start||0,e.bufferStart||0,y,b,-1,0);let w=null!==(t=e.length)&&void 0!==t?t:y.length?b[0]+y[0].length:0;return new hR(l[e.topID],y.reverse(),b.reverse(),w)}(e)}}hR.empty=new hR(aR.none,[],[],0);class dR{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new dR(this.buffer,this.index)}}class fR{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return aR.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],i=this.set.types[t],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),n==(e+=4))return r;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,n,i,r){let{buffer:o}=this,s=-1;for(let a=e;a!=t&&!(mR(r,i,o[a+1],o[a+2])&&(s=a,n>0));a=o[a+3]);return s}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),o=0;for(let s=e,a=0;s<t;){r[a++]=i[s++],r[a++]=i[s++]-n;let t=r[a++]=i[s++]-n;r[a++]=i[s++]-e,o=Math.max(o,t)}return new fR(r,o,this.set)}}function mR(e,t,n,i){switch(e){case-2:return n<t;case-1:return i>=t&&n<t;case 0:return n<t&&i>t;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function gR(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!i&&e instanceof yR&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=i?0:pR.IgnoreOverlays;if(i)for(let i=e,s=i.parent;s;i=s,s=i.parent)i instanceof yR&&i.index<0&&(null===(r=s.enter(t,n,o))||void 0===r?void 0:r.from)!=i.from&&(e=s);for(;;){let i=e.enter(t,n,o);if(!i)return e;e=i}}class vR{cursor(e=0){return new kR(this,e)}getChild(e,t=null,n=null){let i=bR(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return bR(this,e,t,n)}resolve(e,t=0){return gR(this,e,t,!1)}resolveInner(e,t=0){return gR(this,e,t,!0)}matchContext(e){return wR(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class yR extends vR{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,i,r=0){for(let o=this;;){for(let{children:s,positions:a}=o._tree,l=t>0?s.length:-1;e!=l;e+=t){let l,c=s[e],u=a[e]+o.from;if(r&pR.EnterBracketed&&c instanceof hR&&(l=oR.get(c))&&!l.overlay&&l.bracketed&&n>=u&&n<=u+c.length||mR(i,n,u,u+c.length))if(c instanceof fR){if(r&pR.ExcludeBuffers)continue;let s=c.findChild(0,c.buffer.length,t,n-u,i);if(s>-1)return new _R(new xR(o,c,e,u),null,s)}else if(r&pR.IncludeAnonymous||!c.type.isAnonymous||OR(c)){let s;if(!(r&pR.IgnoreMounts)&&(s=oR.get(c))&&!s.overlay)return new yR(s.tree,u,e,o);let a=new yR(c,u,e,o);return r&pR.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?c.children.length-1:0,t,n,i,r)}}if(r&pR.IncludeAnonymous||!o.type.isAnonymous)return null;if(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let i;if(!(n&pR.IgnoreOverlays)&&(i=oR.get(this._tree))&&i.overlay){let r=e-this.from,o=n&pR.EnterBracketed&&i.bracketed;for(let{from:e,to:n}of i.overlay)if((t>0||o?e<=r:e<r)&&(t<0||o?n>=r:n>r))return new yR(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function bR(e,t,n,i){let r=e.cursor(),o=[];if(!r.firstChild())return o;if(null!=n)for(let e=!1;!e;)if(e=r.type.is(n),!r.nextSibling())return o;for(;;){if(null!=i&&r.type.is(i))return o;if(r.type.is(t)&&o.push(r.node),!r.nextSibling())return null==i?o:[]}}function wR(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class xR{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class _R extends vR{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new _R(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&pR.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new _R(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new _R(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new _R(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let o=n.buffer[this.index+1];e.push(n.slice(i,r,o)),t.push(0)}return new hR(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ER(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;i<e.length;i++){let r=e[i];(r.from>n.from||r.to<n.to)&&(n=r,t=i)}let i=n instanceof yR&&n.index<0?null:n.parent,r=e.slice();return i?r[t]=i:r.splice(t,1),new SR(r,n)}class SR{constructor(e,t){this.heads=e,this.node=t}get next(){return ER(this.heads)}}class kR{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~pR.EnterBracketed,e instanceof yR)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof yR?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&pR.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&pR.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&pR.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(i.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=i)}else({index:t,_parent:n}=this._tree);for(;n;({index:t,_parent:n}=n))if(t>-1)for(let i=t+e,r=e<0?-1:n._tree.children.length;i!=r;i+=e){let e=n._tree.children[i];if(this.mode&pR.IncludeAnonymous||e instanceof fR||!e.type.isAnonymous||OR(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let i=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,n=r+1;break e}i=this.stack[--r]}for(let e=n;e<this.stack.length;e++)t=new _R(this.buffer,t,this.stack[e]);return this.bufferNode=new _R(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return wR(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,r=this.stack.length-1;i>=0;r--){if(r<0)return wR(this._tree,e,i);let o=n[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function OR(e){return e.children.some(e=>e instanceof fR||!e.type.isAnonymous||OR(e))}const CR=new WeakMap;function PR(e,t){if(!e.isAnonymous||t instanceof fR||t.type!=e)return 1;let n=CR.get(t);if(null==n){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof hR)){n=1;break}n+=PR(e,i)}CR.set(t,n)}return n}function AR(e,t,n,i,r,o,s,a,l){let c=0;for(let n=i;n<r;n++)c+=PR(e,t[n]);let u=Math.ceil(1.5*c/8),p=[],h=[];return function t(n,i,r,s,a){for(let c=r;c<s;){let r=c,d=i[c],f=PR(e,n[c]);for(c++;c<s;c++){let t=PR(e,n[c]);if(f+t>=u)break;f+=t}if(c==r+1){if(f>u){let e=n[r];t(e.children,e.positions,0,e.children.length,i[r]+a);continue}p.push(n[r])}else{let t=i[c-1]+n[c-1].length-d;p.push(AR(e,n,i,r,c,d,t,null,l))}h.push(d+a-o)}}(t,n,i,r,0),(a||l)(p,h,s)}class TR{constructor(e,t,n,i,r=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(o?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new TR(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,o=e.length?e[0]:null;for(let s=0,a=0,l=0;;s++){let c=s<t.length?t[s]:null,u=c?c.fromA:1e9;if(u-a>=n)for(;o&&o.from<u;){let t=o;if(a>=t.from||u<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,u)-l;t=e>=n?null:new TR(e,n,t.tree,t.offset+l,t.openStart||s>0,t.openEnd||!!c)}if(t&&i.push(t),o.to>u)break;o=r<e.length?e[r++]:null}if(!c)break;a=c.toA,l=c.toA-c.toB}return i}}class RR{startParse(e,t,n){return"string"==typeof e&&(e=new MR(e)),n=n?n.length?n.map(e=>new iR(e.from,e.to)):[new iR(0,0)]:[new iR(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let e=i.advance();if(e)return e}}}class MR{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function $R(e){return(t,n,i,r)=>new zR(t,e,n,i,r)}class DR{constructor(e,t,n,i,r,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=i,this.target=r,this.from=o}}function BR(e){if(!e.length||e.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class LR{constructor(e,t,n,i,r,o,s,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=r,this.bracketed=o,this.target=s,this.prev=a,this.depth=0,this.ranges=[]}}const IR=new rR({perNode:!0});class NR{constructor(e,t){this.cursor=t,this.overlay=null,this.covered=null,this.fragmentCursor=new WR(e)}}class zR{constructor(e,t,n,i,r){this.nest=t,this.input=n,this.fragments=i,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.scan=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;this.baseParse=null,this.baseTree=e,this.scan=new NR(this.fragments,new kR(new yR(e,this.ranges[0].from,0,null),pR.IncludeAnonymous|pR.IgnoreMounts))}if(this.scan){if(!this.scanInner())return null;if(this.scan=null,null!=this.stoppedAt)for(let e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return null!=this.stoppedAt&&(e=new hR(e.type,e.children,e.positions,e.length,e.propValues.concat([[IR,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[rR.mounted.id]=new oR(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;if(this.scan){e=this.scan.cursor.from;for(let t=this.scan.overlay;t;t=t.prev)e=Math.min(e,t.start)}for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}scanInner(){let e=this.scan,{fragmentCursor:t,cursor:n}=e,{overlay:i,covered:r}=e,o=0;e:for(let s,a;;){if(o>=2e3)return e.overlay=i,e.covered=r,!1;o++;let l,c=!0;if(null!=this.stoppedAt&&n.from>=this.stoppedAt)c=!1;else if(t.hasNode(n)){if(i){let e=i.mounts.find(e=>e.frag.from<=n.from&&e.frag.to>=n.to&&e.mount.overlay);if(e)for(let t of e.mount.overlay){let r=t.from+e.pos,o=t.to+e.pos;r>=n.from&&o<=n.to&&!i.ranges.some(e=>e.from<o&&e.to>r)&&i.ranges.push({from:r,to:o})}}c=!1}else if(r&&(a=jR(r.ranges,n.from,n.to)))c=2!=a;else if(!n.type.isAnonymous&&(s=this.nest(n,this.input))&&(n.from<n.to||!s.overlay)){n.tree||(FR(n),i&&i.depth++,r&&r.depth++);let e=t.findMounts(n.from,s.parser);if("function"==typeof s.overlay)i=new LR(s.parser,s.overlay,e,this.inner.length,n.from,!!s.bracketed,n.tree,i);else{let t=QR(this.ranges,s.overlay||(n.from<n.to?[new iR(n.from,n.to)]:[]));t.length&&(BR(t),o+=20),!t.length&&s.overlay||this.inner.push(new DR(s.parser,t.length?s.parser.startParse(this.input,GR(e,t),t):s.parser.startParse(""),s.overlay?s.overlay.map(e=>new iR(e.from-n.from,e.to-n.from)):null,!!s.bracketed,n.tree,t.length?t[0].from:n.from)),s.overlay?t.length&&(r={ranges:t,depth:0,prev:r}):c=!1}}else if(i&&(l=i.predicate(n))&&(!0===l&&(l=new iR(n.from,n.to)),l.from<l.to)){let e=i.ranges.length-1;e>=0&&i.ranges[e].to==l.from?i.ranges[e]={from:i.ranges[e].from,to:l.to}:i.ranges.push(l)}if(c&&n.firstChild())i&&i.depth++,r&&r.depth++;else for(;!n.nextSibling();){if(!n.parent())break e;if(i&&! --i.depth){let e=QR(this.ranges,i.ranges);e.length&&(BR(e),o+=20,this.inner.splice(i.index,0,new DR(i.parser,i.parser.startParse(this.input,GR(i.mounts,e),e),i.ranges.map(e=>new iR(e.from-i.start,e.to-i.start)),i.bracketed,i.target,e[0].from))),i=i.prev}r&&! --r.depth&&(r=r.prev)}}return!0}}function jR(e,t,n){for(let i of e){if(i.from>=n)break;if(i.to>t)return i.from<=t&&i.to>=n?2:1}return 0}function VR(e,t,n,i,r,o){if(t<n){let s=e.buffer[t+1];i.push(e.slice(t,n,s)),r.push(s-o)}}function FR(e){let{node:t}=e,n=[],i=t.context.buffer;do{n.push(e.index),e.parent()}while(!e.tree);let r=e.tree,o=r.children.indexOf(i),s=r.children[o],a=s.buffer,l=[o];r.children[o]=function e(i,r,o,c,u,p){let h=n[p],d=[],f=[];VR(s,i,h,d,f,c);let m=a[h+1],g=a[h+2];l.push(d.length);let v=p?e(h+4,a[h+3],s.set.types[a[h]],m,g-m,p-1):t.toTree();return d.push(v),f.push(m-c),VR(s,a[h+3],r,d,f,c),new hR(o,d,f,u)}(0,a.length,aR.none,0,s.length,n.length-1);for(let t of l){let n=e.tree.children[t],i=e.tree.positions[t];e.yield(new yR(n,i+e.from,t,e._tree))}}class qR{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(pR.IncludeAnonymous|pR.IgnoreMounts|pR.ExcludeBuffers)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)if(t.to>=n&&t.enter(n,1,pR.IncludeAnonymous|pR.IgnoreMounts|pR.IgnoreOverlays|pR.ExcludeBuffers));else{if(!(t.to<=n))break;t.next(!1)||(this.done=!0)}}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(!(t.children.length&&0==t.positions[0]&&t.children[0]instanceof hR))break;t=t.children[0]}return!1}}function HR(e){let t=e.tree.prop(IR);return null==t?e.to:Math.min(e.to,t-e.offset)}let WR=class{constructor(e){if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=HR(t),this.inner=new qR(t.tree,-t.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=HR(e),this.inner=new qR(e.tree,-e.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let r=null===(n=e.tree)||void 0===n?void 0:n.prop(rR.mounted);if(r&&r.parser==t)for(let t=this.fragI;t<this.fragments.length;t++){let n=this.fragments[t];if(n.from>=e.to)break;n.tree==this.curFrag.tree&&i.push({frag:n,pos:e.from-n.offset,mount:r})}}}return i}};function QR(e,t){let n=null,i=t;for(let r=1,o=0;r<e.length;r++){let s=e[r-1].to,a=e[r].from;for(;o<i.length;o++){let e=i[o];if(e.from>=a)break;e.to<=s||(n||(i=n=t.slice()),e.from<s?(n[o]=new iR(e.from,s),e.to>a&&n.splice(o+1,0,new iR(a,e.to))):e.to>a?n[o--]=new iR(a,e.to):n.splice(o--,1))}}return i}function XR(e,t,n,i){let r=0,o=0,s=!1,a=!1,l=-1e9,c=[];for(;;){let u=r==e.length?1e9:s?e[r].to:e[r].from,p=o==t.length?1e9:a?t[o].to:t[o].from;if(s!=a){let e=Math.max(l,n),t=Math.min(u,p,i);e<t&&c.push(new iR(e,t))}if(l=Math.min(u,p),1e9==l)break;u==l&&(s?(s=!1,r++):s=!0),p==l&&(a?(a=!1,o++):a=!0)}return c}function GR(e,t){let n=[];for(let{pos:i,mount:r,frag:o}of e){let e=i+(r.overlay?r.overlay[0].from:0),s=e+r.tree.length,a=Math.max(o.from,e),l=Math.min(o.to,s);if(r.overlay){let s=r.overlay.map(e=>new iR(e.from+i,e.to+i)),c=XR(t,s,a,l);for(let t=0,i=a;;t++){let s=t==c.length,a=s?l:c[t].from;if(a>i&&n.push(new TR(i,a,r.tree,-e,o.from>=i||o.openStart,o.to<=a||o.openEnd)),s)break;i=c[t].to}}else n.push(new TR(a,l,r.tree,-e,o.from>=e||o.openStart,o.to<=s||o.openEnd))}return n}let UR=0;class YR{constructor(e,t,n,i){this.name=e,this.set=t,this.base=n,this.modified=i,this.id=UR++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n="string"==typeof e?e:"?";if(e instanceof YR&&(t=e),null==t?void 0:t.base)throw new Error("Can not derive from a modified tag");let i=new YR(n,[],null,[]);if(i.set.push(i),t)for(let e of t.set)i.set.push(e);return i}static defineModifier(e){let t=new ZR(e);return e=>e.modified.indexOf(t)>-1?e:ZR.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let KR=0;class ZR{constructor(e){this.name=e,this.instances=[],this.id=KR++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>n.base==e&&function(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}(t,n.modified));if(n)return n;let i=[],r=new YR(e.name,i,e,t);for(let e of t)e.instances.push(r);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let i=0,r=t.length;i<r;i++)t.push(t[i].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of o)i.push(ZR.get(t,e));return r}}function JR(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let e of n.split(" "))if(e){let n=[],r=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!i)throw new RangeError("Invalid path: "+e);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),t+=i[0].length,t==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){r=0;break}if("/"!=s)throw new RangeError("Invalid path: "+e);o=e.slice(t)}let s=n.length-1,a=n[s];if(!a)throw new RangeError("Invalid path: "+e);let l=new tM(i,r,s>0?n.slice(0,s):null);t[a]=l.sort(t[a])}}return eM.add(t)}const eM=new rR({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth<=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let o=new tM(r.tags,r.mode,r.context);n?n.next=o:i=o,n=o}return i}});class tM{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function nM(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:i,all:r=null}=t||{};return{style:e=>{let t=r;for(let i of e)for(let e of i.set){let i=n[e.id];if(i){t=t?t+" "+i:i;break}}return t},scope:i}}function iM(e,t,n,i=0,r=e.length){let o=new rM(i,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),i,r,"",o.highlighters),o.flush(r)}tM.empty=new tM([],2,null);class rM{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,r){let{type:o,from:s,to:a}=e;if(s>=n||a<=t)return;o.isTop&&(r=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=i,c=function(e){let t=e.type.prop(eM);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||tM.empty,u=function(e,t){let n=null;for(let i of e){let e=i.style(t);e&&(n=n?n+" "+e:e)}return n}(r,c.tags);if(u&&(l&&(l+=" "),l+=u,1==c.mode&&(i+=(i?" ":"")+u)),this.startSpan(Math.max(t,s),l),c.opaque)return;let p=e.tree&&e.tree.prop(rR.mounted);if(p&&p.overlay){let o=e.node.enter(p.overlay[0].from+s,1),c=this.highlighters.filter(e=>!e.scope||e.scope(p.tree.type)),u=e.firstChild();for(let h=0,d=s;;h++){let f=h<p.overlay.length?p.overlay[h]:null,m=f?f.from+s:a,g=Math.max(t,d),v=Math.min(n,m);if(g<v&&u)for(;e.from<v&&(this.highlightRange(e,g,v,i,r),this.startSpan(Math.min(v,e.to),l),!(e.to>=m)&&e.nextSibling()););if(!f||m>n)break;d=f.to+s,d>t&&(this.highlightRange(o.cursor(),Math.max(t,f.from+s),Math.min(n,d),"",c),this.startSpan(Math.min(n,d),l))}u&&e.parent()}else if(e.firstChild()){p&&(i="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,r),this.startSpan(Math.min(n,e.to),l)}}while(e.nextSibling());e.parent()}}}const oM=YR.define,sM=oM(),aM=oM(),lM=oM(aM),cM=oM(aM),uM=oM(),pM=oM(uM),hM=oM(uM),dM=oM(),fM=oM(dM),mM=oM(),gM=oM(),vM=oM(),yM=oM(vM),bM=oM(),wM={comment:sM,lineComment:oM(sM),blockComment:oM(sM),docComment:oM(sM),name:aM,variableName:oM(aM),typeName:lM,tagName:oM(lM),propertyName:cM,attributeName:oM(cM),className:oM(aM),labelName:oM(aM),namespace:oM(aM),macroName:oM(aM),literal:uM,string:pM,docString:oM(pM),character:oM(pM),attributeValue:oM(pM),number:hM,integer:oM(hM),float:oM(hM),bool:oM(uM),regexp:oM(uM),escape:oM(uM),color:oM(uM),url:oM(uM),keyword:mM,self:oM(mM),null:oM(mM),atom:oM(mM),unit:oM(mM),modifier:oM(mM),operatorKeyword:oM(mM),controlKeyword:oM(mM),definitionKeyword:oM(mM),moduleKeyword:oM(mM),operator:gM,derefOperator:oM(gM),arithmeticOperator:oM(gM),logicOperator:oM(gM),bitwiseOperator:oM(gM),compareOperator:oM(gM),updateOperator:oM(gM),definitionOperator:oM(gM),typeOperator:oM(gM),controlOperator:oM(gM),punctuation:vM,separator:oM(vM),bracket:yM,angleBracket:oM(yM),squareBracket:oM(yM),paren:oM(yM),brace:oM(yM),content:dM,heading:fM,heading1:oM(fM),heading2:oM(fM),heading3:oM(fM),heading4:oM(fM),heading5:oM(fM),heading6:oM(fM),contentSeparator:oM(dM),list:oM(dM),quote:oM(dM),emphasis:oM(dM),strong:oM(dM),link:oM(dM),monospace:oM(dM),strikethrough:oM(dM),inserted:oM(),deleted:oM(),changed:oM(),invalid:oM(),meta:bM,documentMeta:oM(bM),annotation:oM(bM),processingInstruction:oM(bM),definition:YR.defineModifier("definition"),constant:YR.defineModifier("constant"),function:YR.defineModifier("function"),standard:YR.defineModifier("standard"),local:YR.defineModifier("local"),special:YR.defineModifier("special")};for(let e in wM){let t=wM[e];t instanceof YR&&(t.name=e)}var xM;nM([{tag:wM.link,class:"tok-link"},{tag:wM.heading,class:"tok-heading"},{tag:wM.emphasis,class:"tok-emphasis"},{tag:wM.strong,class:"tok-strong"},{tag:wM.keyword,class:"tok-keyword"},{tag:wM.atom,class:"tok-atom"},{tag:wM.bool,class:"tok-bool"},{tag:wM.url,class:"tok-url"},{tag:wM.labelName,class:"tok-labelName"},{tag:wM.inserted,class:"tok-inserted"},{tag:wM.deleted,class:"tok-deleted"},{tag:wM.literal,class:"tok-literal"},{tag:wM.string,class:"tok-string"},{tag:wM.number,class:"tok-number"},{tag:[wM.regexp,wM.escape,wM.special(wM.string)],class:"tok-string2"},{tag:wM.variableName,class:"tok-variableName"},{tag:wM.local(wM.variableName),class:"tok-variableName tok-local"},{tag:wM.definition(wM.variableName),class:"tok-variableName tok-definition"},{tag:wM.special(wM.variableName),class:"tok-variableName2"},{tag:wM.definition(wM.propertyName),class:"tok-propertyName tok-definition"},{tag:wM.typeName,class:"tok-typeName"},{tag:wM.namespace,class:"tok-namespace"},{tag:wM.className,class:"tok-className"},{tag:wM.macroName,class:"tok-macroName"},{tag:wM.propertyName,class:"tok-propertyName"},{tag:wM.operator,class:"tok-operator"},{tag:wM.comment,class:"tok-comment"},{tag:wM.meta,class:"tok-meta"},{tag:wM.invalid,class:"tok-invalid"},{tag:wM.punctuation,class:"tok-punctuation"}]);const _M=new rR;const EM=new rR;class SM{constructor(e,t,n=[],i=""){this.data=e,this.name=i,ik.prototype.hasOwnProperty("tree")||Object.defineProperty(ik.prototype,"tree",{get(){return CM(this)}}),this.parser=t,this.extension=[LM.of(this),ik.languageData.of((e,t,n)=>{let i=kM(e,t,n),r=i.type.prop(_M);if(!r)return[];let o=e.facet(r),s=i.type.prop(EM);if(s){let r=i.resolve(t-i.from,n);for(let t of s)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(o)}}return o})].concat(n)}isActiveAt(e,t,n=-1){return kM(e,t,n).type.prop(_M)==this.data}findRegions(e){let t=e.facet(LM);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(e,t)=>{if(e.prop(_M)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(rR.mounted);if(r){if(r.tree.prop(_M)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(r.overlay){let e=n.length;if(i(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let r=e.children[n];r instanceof hR&&i(r,e.positions[n]+t)}};return i(CM(e),0),n}get allowsNesting(){return!0}}function kM(e,t,n){let i=e.facet(LM),r=CM(e).topNode;if(!i||i.allowsNesting)for(let e=r;e;e=e.enter(t,n,pR.ExcludeBuffers|pR.EnterBracketed))e.type.isTop&&(r=e);return r}SM.setState=WS.define();class OM extends SM{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=(n=e.languageData,mS.define({combine:n?e=>e.concat(n):void 0}));var n;return new OM(t,e.parser.configure({props:[_M.add(e=>e.isTop?t:void 0)]}),e.name)}configure(e,t){return new OM(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function CM(e){let t=e.field(SM.state,!1);return t?t.tree:hR.empty}class PM{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let AM=null;class TM{constructor(e,t,n=[],i,r,o,s,a){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new TM(e,t,[],hR.empty,0,n,[],null)}startParse(){return this.parser.startParse(new PM(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=hR.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(TR.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(TR.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=AM;AM=this;try{return e()}finally{AM=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=RM(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:r,viewport:o,skipped:s}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,i,r)=>t.push({fromA:e,toA:n,fromB:i,toB:r})),n=TR.applyChanges(n,t),i=hR.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){s=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);n<i&&s.push({from:n,to:i})}}}return new TM(this.parser,t,n,i,r,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:i}=this.skipped[t];n<e.to&&i>e.from&&(this.fragments=RM(this.fragments,n,i),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends RR{createParse(t,n,i){let r=i[0].from,o=i[i.length-1].to,s={parsedPos:r,advance(){let t=AM;if(t){for(let e of i)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new hR(aR.none,[],[],o-r)},stoppedAt:null,stopAt(){}};return s}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return AM}}function RM(e,t,n){return TR.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class MM{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new MM(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=TM.create(e.facet(LM).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new MM(n)}}SM.state=_S.define({create:MM.init,update(e,t){for(let e of t.effects)if(e.is(SM.setState))return e.value;return t.startState.facet(LM)!=t.state.facet(LM)?MM.init(t.state):e.apply(t)}});let $M=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&($M=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const DM="undefined"!=typeof navigator&&(null===(xM=navigator.scheduling)||void 0===xM?void 0:xM.isInputPending)?()=>navigator.scheduling.isInputPending():null,BM=_C.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(SM.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(SM.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=$M(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,r=n.field(SM.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!DM?Math.max(25,e.timeRemaining()-5):1e9),s=r.context.treeLen<i&&n.doc.length>i+1e3,a=r.context.work(()=>DM&&DM()||Date.now()>o,i+(s?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:SM.setState.of(new MM(r.context))})),this.chunkBudget>0&&(!a||s)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>yC(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),LM=mS.define({combine:e=>e.length?e[0]:null,enables:e=>[SM.state,BM,UA.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class IM{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const NM=mS.define(),zM=mS.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function jM(e){let t=e.facet(zM);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function VM(e,t){let n="",i=e.tabSize,r=e.facet(zM)[0];if("\t"==r){for(;t>=i;)n+="\t",t-=i;r=" "}for(let e=0;e<t;e++)n+=r;return n}function FM(e,t){e instanceof ik&&(e=new qM(e));for(let n of e.state.facet(NM)){let i=n(e,t);if(void 0!==i)return i}let n=CM(e.state);return n.length>=t?function(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let e=[];for(let t=r;t&&!(t.from<i.node.from||t.to>i.node.to||t.from==i.node.from&&t.type==i.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)i={node:e[t],next:i}}return WM(i,e,n)}(e,n,t):null}class qM{constructor(e,t={}){this.state=e,this.options=t,this.unit=jM(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return null!=i&&i>=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:n.text.slice(i-n.from),from:i}:{text:n.text.slice(0,i-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,t);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.countColumn(n,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return Ek(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(i);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const HM=new rR;function WM(e,t,n){for(let i=e;i;i=i.next){let e=QM(i.node);if(e)return e(GM.create(t,n,i))}return 0}function QM(e){let t=e.type.prop(HM);if(t)return t;let n,i=e.firstChild;if(i&&(n=i.type.prop(rR.closedBy))){let t=e.lastChild,i=t&&n.indexOf(t.name)>-1;return e=>KM(e,!0,1,void 0,i&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?XM:null}function XM(){return 0}class GM extends qM{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new GM(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(UM(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return WM(this.context.next,this.base,this.pos)}}function UM(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function YM({closing:e,align:t=!0,units:n=1}){return i=>KM(i,t,n,e)}function KM(e,t,n,i,r){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=i&&o.slice(s,s+i.length)==i||r==e.pos+s,l=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=null==r||r<=o.from?o.to:Math.min(o.to,r);for(let e=n.to;;){let r=t.childAfter(e);if(!r||r==i)return null;if(!r.type.isSkipped){if(r.from>=s)return null;let e=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+e}}e=r.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}function ZM({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}function JM(){return ik.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return e;let o=n.sliceString(r.from,i);if(!t.some(e=>e.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=FM(s,t.from);if(null==n)continue;let i=/^\s*/.exec(t.text)[0],r=VM(s,n);i!=r&&l.push({from:t.from,to:t.from+i.length,insert:r})}return l.length?[e,{changes:l,sequential:!0}]:e})}const e$=new rR;function t$(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}class n${constructor(e,t){let n;function i(e){let t=Ck.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof SM?e=>e.prop(_M)==o.data:o?e=>e==o:void 0,this.style=nM(e.map(e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))})),{all:r}).style,this.module=n?new Ck(n):null,this.themeType=t.themeType}static define(e,t){return new n$(e,t||{})}}const i$=mS.define(),r$=mS.define({combine:e=>e.length?[e[0]]:null});function o$(e){let t=e.facet(i$);return t.length?t:e.facet(r$)}function s$(e,t){let n,i=[l$];return e instanceof n$&&(e.module&&i.push(UA.styleModule.of(e.module)),n=e.themeType),n?i.push(i$.computeN([UA.darkTheme],t=>t.facet(UA.darkTheme)==("dark"==n)?[e]:[])):i.push(i$.of(e)),i}class a${constructor(e){this.markCache=Object.create(null),this.tree=CM(e.state),this.decorations=this.buildDeco(e,o$(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=CM(e.state),n=o$(e.state),i=n!=o$(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!i&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return rO.none;let n=new hk;for(let{from:i,to:r}of e.visibleRanges)iM(this.tree,t,(e,t,i)=>{n.add(e,t,this.markCache[i]||(this.markCache[i]=rO.mark({class:i})))},i,r);return n.finish()}}const l$=PS.high(_C.fromClass(a$,{decorations:e=>e.decorations})),c$=UA.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),u$="()[]{}",p$=mS.define({combine:e=>rk(e,{afterCursor:!0,brackets:u$,maxScanDistance:1e4,renderMatch:f$})}),h$=rO.mark({class:"cm-matchingBracket"}),d$=rO.mark({class:"cm-nonmatchingBracket"});function f$(e){let t=[],n=e.matched?h$:d$;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function m$(e){let t=[],n=e.facet(p$);for(let i of e.selection.ranges){if(!i.empty)continue;let r=_$(e,i.head,-1,n)||i.head>0&&_$(e,i.head-1,1,n)||n.afterCursor&&(_$(e,i.head,1,n)||i.head<e.doc.length&&_$(e,i.head+1,-1,n));r&&(t=t.concat(n.renderMatch(r,e)))}return rO.set(t,!0)}const g$=_C.fromClass(class{constructor(e){this.paused=!1,this.decorations=m$(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=m$(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),v$=[g$,c$];function y$(e={}){return[p$.of(e),v$]}const b$=new rR;function w$(e,t,n){let i=e.prop(t<0?rR.openedBy:rR.closedBy);if(i)return i;if(1==e.name.length){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function x$(e){let t=e.type.prop(b$);return t?t(e.node):e}function _$(e,t,n,i={}){let r=i.maxScanDistance||1e4,o=i.brackets||u$,s=CM(e),a=s.resolveInner(t,n);for(let i=a;i;i=i.parent){let r=w$(i.type,n,o);if(r&&i.from<i.to){let s=x$(i);if(s&&(n>0?t>=s.from&&t<s.to:t>s.from&&t<=s.to))return E$(e,t,n,i,s,r,o)}}return function(e,t,n,i,r,o,s){if(n<0?!t:t==e.doc.length)return null;let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),p=0;for(let e=0;!u.next().done&&e<=o;){let o=u.value;n<0&&(e+=o.length);let a=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=s.indexOf(o[e]);if(!(t<0||i.resolveInner(a+e,1).type!=r))if(t%2==0==n>0)p++;else{if(1==p)return{start:c,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};p--}}n>0&&(e+=o.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,s,a.type,r,o)}function E$(e,t,n,i,r,o,s){let a=i.parent,l={from:r.from,to:r.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(i.from):u.childAfter(i.to)))do{if(n<0?u.to<=i.from:u.from>=i.to){if(0==c&&o.indexOf(u.type.name)>-1&&u.from<u.to){let e=x$(u);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(w$(u.type,n,s))c++;else if(w$(u.type,-n,s)){if(0==c){let e=x$(u);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}c--}}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}const S$=Object.create(null),k$=[aR.none],O$=[],C$=Object.create(null),P$=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])P$[e]=T$(S$,t);function A$(e,t){O$.indexOf(e)>-1||(O$.push(e),console.warn(t))}function T$(e,t){let n=[];for(let i of t.split(" ")){let t=[];for(let n of i.split(".")){let i=e[n]||wM[n];i?"function"==typeof i?t.length?t=t.map(i):A$(n,`Modifier ${n} used at start of tag`):t.length?A$(n,`Tag ${n} used as modifier`):t=Array.isArray(i)?i:[i]:A$(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(e=>e.id),o=C$[r];if(o)return o.id;let s=C$[r]=aR.define({id:k$.length,name:i,props:[JR({[i]:n})]});return k$.push(s),s.id}NO.RTL,NO.LTR;class R${constructor(e,t,n,i){this.state=e,this.pos=t,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=CM(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),r=i.search(L$(e,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function M$(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function $$(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,i]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let e=1;e<i.length;e++)n[i[e]]=!0}let i=M$(t)+M$(n)+"*$";return[new RegExp("^"+i),new RegExp(i)]}(t);return e=>{let r=e.matchBefore(i);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}class D${constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}}function B$(e){return e.selection.main.from}function L$(e,t){var n;let{source:i}=e,r=t&&"^"!=i[0],o="$"!=i[i.length-1];return r||o?new RegExp(`${r?"^":""}(?:${i})${o?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const I$=FS.define();function N$(e,t,n,i){let{main:r}=e.selection,o=n-r.from,s=i-r.from;return{...e.changeByRange(a=>{if(a!=r&&n!=i&&e.sliceDoc(a.from+o,a.from+s)!=e.sliceDoc(n,i))return{range:a};let l=e.toText(t);return{changes:{from:a.from+o,to:i==r.from?a.to:a.from+s,insert:l},range:hS.cursor(a.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const z$=new WeakMap;function j$(e){if(!Array.isArray(e))return e;let t=z$.get(e);return t||z$.set(e,t=$$(e)),t}const V$=WS.define(),F$=WS.define();class q${constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=ZE(e,t),i=eS(n);this.chars.push(n);let r=e.slice(t,t+i),o=r.toUpperCase();this.folded.push(ZE(o==r?r.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:i,precise:r,byWord:o}=this;if(1==t.length){let i=ZE(e,0),r=eS(i),o=r==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;o+=-200}return this.ret(o,[0,r])}let s=e.indexOf(this.pattern);if(0==s)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,l=0;if(s<0){for(let r=0,o=Math.min(e.length,200);r<o&&l<a;){let o=ZE(e,r);o!=t[l]&&o!=n[l]||(i[l++]=r),r+=eS(o)}if(l<a)return null}let c=0,u=0,p=!1,h=0,d=-1,f=-1,m=/[a-z]/.test(e),g=!0;for(let i=0,l=Math.min(e.length,200),v=0;i<l&&u<a;){let l=ZE(e,i);s<0&&(c<a&&l==t[c]&&(r[c++]=i),h<a&&(l==t[h]||l==n[h]?(0==h&&(d=i),f=i+1,h++):h=0));let y,b=l<255?l>=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(y=JE(l))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!i||1==b&&m||0==v&&0!=b)&&(t[u]==l||n[u]==l&&(p=!0)?o[u++]=i:o.length&&(g=!1)),v=b,i+=eS(l)}return u==a&&0==o[0]&&g?this.result((p?-200:0)-100,o,e):h==a&&0==d?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):h==a?this.ret(-900-e.length,[d,f]):u==a?this.result((p?-200:0)-100-700+(g?0:-1100),o,e):2==t.length?null:this.result((i[0]?-700:0)-200-1100,i,e)}result(e,t,n){let i=[],r=0;for(let e of t){let t=e+(this.astral?eS(ZE(n,e)):1);r&&i[r-1]==e?i[r-1]=t:(i[r++]=e,i[r++]=t)}return this.ret(e-n.length,i)}}class H${constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const W$=mS.define({combine:e=>rk(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:X$,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>Q$(e(n),t(n)),optionClass:(e,t)=>n=>Q$(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function Q$(e,t){return e?t?e+" "+t:e:t}function X$(e,t,n,i,r,o){let s,a,l=e.textDirection==NO.RTL,c=l,u=!1,p="top",h=t.left-r.left,d=r.right-t.right,f=i.right-i.left,m=i.bottom-i.top;if(c&&h<Math.min(f,d)?c=!1:!c&&d<Math.min(f,h)&&(c=!0),f<=(c?h:d))s=Math.max(r.top,Math.min(n.top,r.bottom-m))-t.top,a=Math.min(400,c?h:d);else{u=!0,a=Math.min(400,(l?t.right:r.right-t.left)-30);let e=r.bottom-t.bottom;e>=m||e>t.top?s=n.bottom-t.top:(p="bottom",s=t.bottom-n.top)}return{style:`${p}: ${s/((t.bottom-t.top)/o.offsetHeight)}px; max-width: ${a/((t.right-t.left)/o.offsetWidth)}px`,class:"cm-completionInfo-"+(u?l?"left-narrow":"right-narrow":c?"left":"right")}}const G$=WS.define();function U$(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class Y${constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:r,selected:o}=i.open,s=e.state.facet(W$);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,i){let r=document.createElement("span");r.className="cm-completionLabel";let o=e.displayLabel||e.label,s=0;for(let e=0;e<i.length;){let t=i[e++],n=i[e++];t>s&&r.appendChild(document.createTextNode(o.slice(s,t)));let a=r.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(o.slice(t,n))),a.className="cm-completionMatchedText",s=n}return s<o.length&&r.appendChild(document.createTextNode(o.slice(s))),r},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=U$(r.length,o,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:i}=e.state.field(t).open;for(let t,r=n.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]<i.length)return this.applyCompletion(e,i[+t[1]]),void n.preventDefault();if(n.target==this.list){let t=this.list.classList.contains("cm-completionListIncompleteTop")&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=t&&(e.dispatch({effects:G$.of(t)}),n.preventDefault())}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(W$).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:F$.of(null)})}),this.showOptions(r,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:r,selected:o,disabled:s}=n.open;i.open&&i.open.options==r||(this.range=U$(r.length,o,e.state.facet(W$).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),s!=(null===(t=i.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=U$(t.options.length,t.selected,this.view.state.facet(W$).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:r}=i;if(!r)return;let o="string"==typeof r?document.createTextNode(r):r(i);if(!o)return;"then"in o?o.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,i)}).catch(e=>yC(this.view.state,e,"completion info")):(this.addInfoPane(o,i),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:i}=e;n.appendChild(t),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,i=this.range.from;n;n=n.nextSibling,i++)"LI"==n.nodeName&&n.id?i==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby")):i--;return t&&function(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.top<n.top?e.scrollTop-=(n.top-i.top)/r:i.bottom>n.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return i.top>Math.min(r.bottom,t.bottom)-10||i.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(W$).positionInfo(this.view,t,i,n,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",e=>{e.target==i&&e.preventDefault()});let r=null;for(let o=n.from;o<n.to;o++){let{completion:s,match:a}=e[o],{section:l}=s;if(l){let e="string"==typeof l?l:l.name;if(e!=r&&(o>n.from||0==n.from))if(r=e,"string"!=typeof l&&l.header)i.appendChild(l.header(l));else{i.appendChild(document.createElement("completion-section")).textContent=e}}const c=i.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let u=this.optionClass(s);u&&(c.className=u);for(let e of this.optionContent){let t=e(s,this.view.state,this.view,a);t&&c.appendChild(t)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function K$(e,t){return n=>new Y$(n,e,t)}function Z$(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class J${constructor(e,t,n,i,r,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=i,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new J$(this.options,iD(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,i,r,o){if(i&&!o&&e.some(e=>e.isPending))return i.setDisabled();let s=function(e,t){let n=[],i=null,r=null,o=e=>{n.push(e);let{section:t}=e.completion;if(t){i||(i=[]);let e="string"==typeof t?t:t.name;i.some(t=>t.name==e)||i.push("string"==typeof t?{name:e}:t)}},s=t.facet(W$);for(let i of e)if(i.hasResult()){let e=i.result.getMatch;if(!1===i.result.filter)for(let t of i.result.options)o(new D$(t,i.source,e?e(t):[],1e9-n.length));else{let n,a=t.sliceDoc(i.from,i.to),l=s.filterStrict?new H$(a):new q$(a);for(let t of i.result.options)if(n=l.match(t.label)){let s=t.displayLabel?e?e(t,n.matched):[]:n.matched,a=n.score+(t.boost||0);if(o(new D$(t,i.source,s,a)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;r||(r=Object.create(null)),r[e]=Math.max(a,r[e]||-1e9)}}}}if(i){let e=Object.create(null),t=0,o=(e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?r[t.name]-r[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of i.sort(o))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let a=[],l=null,c=s.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||c(e.completion,t.completion))){let t=e.completion;!l||l.label!=t.label||l.detail!=t.detail||null!=l.type&&null!=t.type&&l.type!=t.type||l.apply!=t.apply||l.boost!=t.boost?a.push(e):Z$(e.completion)>Z$(l)&&(a[a.length-1]=e),l=e.completion}return a}(e,t);if(!s.length)return i&&e.some(e=>e.isPending)?i.setDisabled():null;let a=t.facet(W$).selectOnOpen?0:-1;if(i&&i.selected!=a&&-1!=i.selected){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){a=t;break}}return new J$(s,iD(n,a),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:pD,above:r.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new J$(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new J$(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class eD{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new eD(rD,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(W$),i=(n.override||t.languageDataAt("autocomplete",B$(t)).map(j$)).map(t=>{let i=this.active.find(e=>e.source==t)||new sD(t,this.active.some(e=>0!=e.state)?1:0);return i.update(e,n)});i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let r=this.open,o=e.effects.some(e=>e.is(lD));r&&e.docChanged&&(r=r.map(e.changes)),e.selection||i.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;i<t.length&&!t[i].hasResult();)i++;let r=n==e.length,o=i==t.length;if(r||o)return r==o;if(e[n++].result!=t[i++].result)return!1}}(i,this.active)||o?r=J$.build(i,t,this.id,r,n,o):r&&r.disabled&&!i.some(e=>e.isPending)&&(r=null),!r&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new sD(e.source,0):e));for(let t of e.effects)t.is(G$)&&(r=r&&r.setSelected(t.value,this.id));return i==this.active&&r==this.open?this:new eD(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?tD:nD}}const tD={"aria-autocomplete":"list"},nD={};function iD(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const rD=[];function oD(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(I$);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class sD{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=oD(e,t),i=this;(8&n||16&n&&this.touches(e))&&(i=new sD(i.source,0)),4&n&&0==i.state&&(i=new sD(this.source,1)),i=i.updateFor(e,n);for(let t of e.effects)if(t.is(V$))i=new sD(i.source,1,t.value);else if(t.is(F$))i=new sD(i.source,0);else if(t.is(lD))for(let e of t.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(B$(e.state))}}class aD extends sD{constructor(e,t,n,i,r,o){super(e,3,t),this.limit=n,this.result=i,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),s=B$(e.state);if(s>o||!i||2&t&&(B$(e.startState)==this.from||s<this.limit))return new sD(this.source,4&t?1:0);let a=e.changes.mapPos(this.limit);return function(e,t,n,i){if(!e)return!1;let r=t.sliceDoc(n,i);return"function"==typeof e?e(r,n,i,t):L$(e,!0).test(r)}(i.validFor,e.state,r,o)?new aD(this.source,this.explicit,a,i,r,o):i.update&&(i=i.update(i,r,o,new R$(e.state,s,!1)))?new aD(this.source,this.explicit,a,i,i.from,null!==(n=i.to)&&void 0!==n?n:B$(e.state)):new sD(this.source,1,this.explicit)}map(e){if(e.empty)return this;let t=this.result.map?this.result.map(this.result,e):this.result;return t?new aD(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new sD(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}const lD=WS.define({map:(e,t)=>e.map(e=>e.map(t))}),cD=_S.define({create:()=>eD.start(),update:(e,t)=>e.update(t),provide:e=>[xT.from(e,e=>e.tooltip),UA.contentAttributes.from(e,e=>e.attrs)]});function uD(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(cD).active.find(e=>e.source==t.source);return i instanceof aD&&("string"==typeof n?e.dispatch({...N$(e.state,n,i.from,i.to),annotations:I$.of(t.completion)}):n(e,t.completion,i.from,i.to),!0)}const pD=K$(cD,uD);function hD(e,t="option"){return n=>{let i=n.state.field(cD,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(W$).interactionDelay)return!1;let r,o=1;"page"==t&&(r=AT(n,i.open.tooltip))&&(o=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:s}=i.open.options,a=i.open.selected>-1?i.open.selected+o*(e?1:-1):e?0:s-1;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:G$.of(a)}),!0}}const dD=e=>!!e.state.field(cD,!1)&&(e.dispatch({effects:V$.of(!0)}),!0);class fD{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const mD=_C.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(cD).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(cD),n=e.state.facet(W$);if(!e.selectionSet&&!e.docChanged&&e.startState.field(cD)==t)return;let i=e.transactions.some(e=>{let t=oD(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(i||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){yC(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(V$)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),r):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(cD);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(W$).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=B$(t),i=new R$(t,n,e.explicit,this.view),r=new fD(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:F$.of(null)}),yC(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(W$).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(W$),i=this.view.state.field(cD);for(let r=0;r<this.running.length;r++){let o=this.running[r];if(void 0===o.done)continue;if(this.running.splice(r--,1),o.done){let i=B$(o.updates.length?o.updates[0].startState:this.view.state),r=Math.min(i,o.done.from+(o.active.explicit?0:1)),s=new aD(o.active.source,o.active.explicit,r,o.done,o.done.from,null!==(e=o.done.to)&&void 0!==e?e:i);for(let e of o.updates)s=s.update(e,n);if(s.hasResult()){t.push(s);continue}}let s=i.active.find(e=>e.source==o.active.source);if(s&&s.isPending)if(null==o.done){let e=new sD(o.active.source,0);for(let t of o.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(s)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:lD.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(cD,!1);if(t&&t.tooltip&&this.view.state.facet(W$).closeOnBlur){let n=t.open&&AT(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:F$.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:V$.of(!1)}),20),this.composing=0}}}),gD="object"==typeof navigator&&/Win/.test(navigator.platform),vD=PS.highest(UA.domEventHandlers({keydown(e,t){let n=t.state.field(cD,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||!e.key||e.key.length>1||e.ctrlKey&&(!gD||!e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(e=>e.source==i.source),o=i.completion.commitCharacters||r.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&uD(t,i),!1}})),yD=UA.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class bD{constructor(e,t,n,i){this.field=e,this.line=t,this.from=n,this.to=i}}class wD{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,nS.TrackDel),n=e.mapPos(this.to,1,nS.TrackDel);return null==t||null==n?null:new wD(this.field,t,n)}}class xD{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],i=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let r of this.lines){if(n.length){let n=o,s=/^\t*/.exec(r)[0].length;for(let t=0;t<s;t++)n+=e.facet(zM);i.push(t+n.length-s),r=n+r.slice(s)}n.push(r),t+=r.length+1}let s=this.fieldPositions.map(e=>new wD(e.field,i[e.line]+e.from,i[e.line]+e.to));return{text:n,ranges:s}}static parse(e){let t,n=[],i=[],r=[];for(let o of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let e=t[1]?+t[1]:null,s=t[2]||t[3]||"",a=-1;0===e&&(e=1e9);let l=s.replace(/\\[{}]/g,e=>e[1]);for(let t=0;t<n.length;t++)(null!=e?n[t].seq==e:l&&n[t].name==l)&&(a=t);if(a<0){let t=0;for(;t<n.length&&(null==e||null!=n[t].seq&&n[t].seq<e);)t++;n.splice(t,0,{seq:e,name:l}),a=t;for(let e of r)e.field>=a&&e.field++}for(let e of r)if(e.line==i.length&&e.from>t.index){let n=t[2]?3+(t[1]||"").length:2;e.from-=n,e.to-=n}r.push(new bD(a,i.length,t.index,t.index+l.length)),o=o.slice(0,t.index)+s+o.slice(t.index+t[0].length)}o=o.replace(/\\([{}])/g,(e,t,n)=>{for(let e of r)e.line==i.length&&e.from>n&&(e.from--,e.to--);return t}),i.push(o)}return new xD(i,r)}}let _D=rO.widget({widget:new class extends nO{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),ED=rO.mark({class:"cm-snippetField"});class SD{constructor(e,t){this.ranges=e,this.active=t,this.deco=rO.set(e.map(e=>(e.from==e.to?_D:ED).range(e.from,e.to)),!0)}map(e){let t=[];for(let n of this.ranges){let i=n.map(e);if(!i)return null;t.push(i)}return new SD(t,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}}const kD=WS.define({map:(e,t)=>e&&e.map(t)}),OD=WS.define(),CD=_S.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(kD))return n.value;if(n.is(OD)&&e)return new SD(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>UA.decorations.from(e,e=>e?e.deco:rO.none)});function PD(e,t){return hS.create(e.filter(e=>e.field==t).map(e=>hS.range(e.from,e.to)))}function AD(e){let t=xD.parse(e);return(e,n,i,r)=>{let{text:o,ranges:s}=t.instantiate(e.state,i),{main:a}=e.state.selection,l={changes:{from:i,to:r==a.from?a.to:r,insert:VE.of(o)},scrollIntoView:!0,annotations:n?[I$.of(n),QS.userEvent.of("input.complete")]:void 0};if(s.length&&(l.selection=PD(s,0)),s.some(e=>e.field>0)){let t=new SD(s,0),n=l.effects=[kD.of(t)];void 0===e.state.field(CD,!1)&&n.push(WS.appendConfig.of([CD,$D,BD,yD]))}e.dispatch(e.state.update(l))}}function TD(e){return({state:t,dispatch:n})=>{let i=t.field(CD,!1);if(!i||e<0&&0==i.active)return!1;let r=i.active+e,o=e>0&&!i.ranges.some(t=>t.field==r+e);return n(t.update({selection:PD(i.ranges,r),effects:kD.of(o?null:new SD(i.ranges,r)),scrollIntoView:!0})),!0}}const RD=[{key:"Tab",run:TD(1),shift:TD(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(CD,!1)&&(t(e.update({effects:kD.of(null)})),!0)}],MD=mS.define({combine:e=>e.length?e[0]:RD}),$D=PS.highest(iT.compute([MD],e=>e.facet(MD)));function DD(e,t){return{...t,apply:AD(e)}}const BD=UA.domEventHandlers({mousedown(e,t){let n,i=t.state.field(CD,!1);if(!i||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=i.ranges.find(e=>e.from<=n&&e.to>=n);return!(!r||r.field==i.active)&&(t.dispatch({selection:PD(i.ranges,r.field),effects:kD.of(i.ranges.some(e=>e.field>r.field)?new SD(i.ranges,r.field):null),scrollIntoView:!0}),!0)}}),LD={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ID=WS.define({map(e,t){let n=t.mapPos(e,-1,nS.TrackAfter);return null==n?void 0:n}}),ND=new class extends ok{};ND.startSide=1,ND.endSide=-1;const zD=_S.define({create:()=>uk.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(ID)&&(e=e.update({add:[ND.range(n.value,n.value+1)]}));return e}});function jD(){return[HD,zD]}const VD="()[]{}<>«»»«[]{}";function FD(e){for(let t=0;t<16;t+=2)if(VD.charCodeAt(t)==e)return VD.charAt(t+1);return JE(e<128?e:e+1)}const qD="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),HD=UA.inputHandler.of((e,t,n,i)=>{if((qD?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||2==i.length&&1==eS(ZE(i,0))||t!=r.from||n!=r.to)return!1;let o=function(e,t){let n=function(e,t){return e.languageDataAt("closeBrackets",t)[0]||LD}(e,e.selection.main.head),i=n.brackets||LD.brackets;for(let r of i){let o=FD(ZE(r,0));if(t==r)return o==r?UD(e,r,i.indexOf(r+r+r)>-1,n):XD(e,r,o,n.before||LD.before);if(t==o&&WD(e,e.selection.main.from))return GD(e,r,o)}return null}(e.state,i);return!!o&&(e.dispatch(o),!0)});function WD(e,t){let n=!1;return e.field(zD).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function QD(e,t){let n=e.sliceString(t,t+2);return n.slice(0,eS(ZE(n,0)))}function XD(e,t,n,i){let r=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:ID.of(o.to+t.length),range:hS.range(o.anchor+t.length,o.head+t.length)};let s=QD(e.doc,o.head);return!s||/\s/.test(s)||i.indexOf(s)>-1?{changes:{insert:t+n,from:o.head},effects:ID.of(o.head+t.length),range:hS.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function GD(e,t,n){let i=null,r=e.changeByRange(t=>t.empty&&QD(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:hS.cursor(t.head+n.length)}:i={range:t});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function UD(e,t,n,i){let r=i.stringPrefixes||LD.stringPrefixes,o=null,s=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:ID.of(i.to+t.length),range:hS.range(i.anchor+t.length,i.head+t.length)};let s,a=i.head,l=QD(e.doc,a);if(l==t){if(YD(e,a))return{changes:{insert:t+t,from:a},effects:ID.of(a+t.length),range:hS.cursor(a+t.length)};if(WD(e,a)){let i=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+i.length,insert:i},range:hS.cursor(a+i.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(s=KD(e,a-2*t.length,r))>-1&&YD(e,s))return{changes:{insert:t+t+t+t,from:a},effects:ID.of(a+t.length),range:hS.cursor(a+t.length)};if(e.charCategorizer(a)(l)!=JS.Word&&KD(e,a,r)>-1&&!function(e,t,n,i){let r=CM(e).resolveInner(t,-1),o=i.reduce((e,t)=>Math.max(e,t.length),0);for(let s=0;s<5;s++){let s=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),a=s.indexOf(n);if(!a||a>-1&&i.indexOf(s.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=r.to==t&&r.parent;if(!l)break;r=l}return!1}(e,a,t,r))return{changes:{insert:t+t,from:a},effects:ID.of(a+t.length),range:hS.cursor(a+t.length)}}return{range:o=i}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function YD(e,t){let n=CM(e).resolveInner(t+1);return n.parent&&n.from==t}function KD(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=JS.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&i(e.sliceDoc(n-1,n))!=JS.Word)return n}return-1}function ZD(e={}){return[vD,cD,W$.of(e),mD,eB,yD]}const JD=[{key:"Ctrl-Space",run:dD},{mac:"Alt-`",run:dD},{mac:"Alt-i",run:dD},{key:"Escape",run:e=>{let t=e.state.field(cD,!1);return!(!t||!t.active.some(e=>0!=e.state))&&(e.dispatch({effects:F$.of(null)}),!0)}},{key:"ArrowDown",run:hD(!0)},{key:"ArrowUp",run:hD(!1)},{key:"PageDown",run:hD(!0,"page")},{key:"PageUp",run:hD(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(cD,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(W$).interactionDelay)&&uD(e,t.open.options[t.open.selected])}}],eB=PS.highest(iT.computeN([W$],e=>e.facet(W$).defaultKeymap?[JD]:[]));function tB(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(i(n.update(r)),!0)}}const nB=tB(lB,0),iB=tB(aB,0),rB=tB((e,t)=>aB(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>i.from?t[o].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}(t)),0);function oB(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const sB=50;function aB(e,t,n=t.selection.ranges){let i=n.map(e=>oB(t,e.from).block);if(!i.every(e=>e))return null;let r=n.map((e,n)=>function(e,{open:t,close:n},i,r){let o,s,a=e.sliceDoc(i-sB,i),l=e.sliceDoc(r,r+sB),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(l)[0].length,p=a.length-c;if(a.slice(p-t.length,p)==t&&l.slice(u,u+n.length)==n)return{open:{pos:i-c,margin:c&&1},close:{pos:r+u,margin:u&&1}};r-i<=2*sB?o=s=e.sliceDoc(i,r):(o=e.sliceDoc(i,i+sB),s=e.sliceDoc(r-sB,r));let h=/^\s*/.exec(o)[0].length,d=/\s*$/.exec(s)[0].length,f=s.length-d-n.length;return o.slice(h,h+t.length)==t&&s.slice(f,f+n.length)==n?{open:{pos:i+h+t.length,margin:/\s/.test(o.charAt(h+t.length))?1:0},close:{pos:r-d-n.length,margin:/\s/.test(s.charAt(f-1))?1:0}}:null}(t,i[n],e.from,e.to));if(2!=e&&!r.every(e=>e))return{changes:t.changes(n.map((e,t)=>r[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}]))};if(1!=e&&r.some(e=>e)){let e=[];for(let t,n=0;n<r.length;n++)if(t=r[n]){let r=i[n],{open:o,close:s}=t;e.push({from:o.pos-r.open.length,to:o.pos+o.margin},{from:s.pos-s.margin,to:s.pos+r.close.length})}return{changes:e}}return null}function lB(e,t,n=t.selection.ranges){let i=[],r=-1;e:for(let{from:e,to:o}of n){let n,s=i.length,a=1e9;for(let s=e;s<=o;){let l=t.doc.lineAt(s);if(null==n&&(n=oB(t,l.from).line,!n))continue e;if(l.from>r&&(e==o||o>l.from)){r=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,o=l.text.slice(e,e+n.length)==n?e:-1;e<l.text.length&&e<a&&(a=e),i.push({line:l,comment:o,token:n,indent:e,empty:t,single:!1})}s=l.to+1}if(a<1e9)for(let e=s;e<i.length;e++)i[e].indent<i[e].line.text.length&&(i[e].indent=a);i.length==s+1&&(i[s].single=!0)}if(2!=e&&i.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:r,empty:o,single:s}of i)!s&&o||e.push({from:t.from+r,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&i.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:r}of i)if(n>=0){let i=t.from+n,o=i+r.length;" "==t.text[o-t.from]&&o++,e.push({from:i,to:o})}return{changes:e}}return null}const cB=FS.define(),uB=FS.define(),pB=mS.define(),hB=mS.define({combine:e=>rk(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}),dB=_S.define({create:()=>TB.empty,update(e,t){let n=t.state.facet(hB),i=t.annotation(cB);if(i){let r=wB.fromTransaction(t,i.selection),o=i.side,s=0==o?e.undone:e.done;return s=r?xB(s,s.length,n.minDepth,r):kB(s,t.startState.selection),new TB(0==o?i.rest:s,0==o?s:i.rest)}let r=t.annotation(uB);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(QS.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=wB.fromTransaction(t),s=t.annotation(QS.time),a=t.annotation(QS.userEvent);return o?e=e.addChanges(o,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new TB(e.done.map(wB.fromJSON),e.undone.map(wB.fromJSON))});function fB(e={}){return[dB,hB.of(e),UA.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?gB:"historyRedo"==e.inputType?vB:null;return!!n&&(e.preventDefault(),n(t))}})]}function mB(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(dB,!1);if(!r)return!1;let o=r.pop(e,n,t);return!!o&&(i(o),!0)}}const gB=mB(0,!1),vB=mB(1,!1),yB=mB(0,!0),bB=mB(1,!0);class wB{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new wB(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new wB(e.changes&&rS.fromJSON(e.changes),[],e.mapped&&iS.fromJSON(e.mapped),e.startSelection&&hS.fromJSON(e.startSelection),e.selectionsAfter.map(hS.fromJSON))}static fromTransaction(e,t){let n=EB;for(let t of e.startState.facet(pB)){let i=t(e);i.length&&(n=n.concat(i))}return!n.length&&e.changes.empty?null:new wB(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,EB)}static selection(e){return new wB(void 0,EB,void 0,void 0,e)}}function xB(e,t,n,i){let r=t+1>n+20?t-n-1:0,o=e.slice(r,t);return o.push(i),o}function _B(e,t){return e.length?t.length?e.concat(t):e:t}const EB=[],SB=200;function kB(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-SB));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),xB(e,e.length-1,1e9,n.setSelAfter(i)))}return[wB.selection([t])]}function OB(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function CB(e,t){if(!e.length)return e;let n=e.length,i=EB;for(;n;){let r=PB(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[wB.selection(i)]:EB}function PB(e,t,n){let i=_B(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):EB,n);if(!e.changes)return wB.selection(i);let r=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new wB(r,WS.mapEffects(e.effects,t),s,e.startSelection.map(o),i)}const AB=/^(input\.type|delete)($|\.)/;class TB{constructor(e,t,n=0,i=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new TB(this.done,this.undone):this}addChanges(e,t,n,i,r){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&e.changes&&(!n||AB.test(n))&&(!s.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,function(e,t){let n=[],i=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,r,o)=>{for(let e=0;e<n.length;){let t=n[e++],s=n[e++];o>=t&&r<=s&&(i=!0)}}),i}(s.changes,e.changes))||"input.type.compose"==n)?xB(o,o.length-1,i.minDepth,new wB(e.changes.compose(s.changes),_B(WS.mapEffects(e.effects,s.changes),s.effects),s.mapped,s.startSelection,EB)):xB(o,o.length,i.minDepth,e),new TB(o,EB,t,n)}addSelection(e,t,n,i){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:EB;return r.length>0&&t-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&function(e,t){return e.ranges.length==t.ranges.length&&0===e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length}(r[r.length-1],e)?this:new TB(kB(this.done,e),this.undone,t,n)}addMapping(e){return new TB(CB(this.done,e),CB(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=0==e?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1],o=r.selectionsAfter[0]||(r.startSelection?r.startSelection.map(r.changes.invertedDesc,1):t.selection);if(n&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:cB.of({side:e,rest:OB(i),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let n=1==i.length?EB:i.slice(0,i.length-1);return r.mapped&&(n=CB(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:cB.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}TB.empty=new TB(EB,EB);const RB=[{key:"Mod-z",run:gB,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:vB,preventDefault:!0},{linux:"Ctrl-Shift-z",run:vB,preventDefault:!0},{key:"Mod-u",run:yB,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:bB,preventDefault:!0}];function MB(e,t){return hS.create(e.ranges.map(t),e.mainIndex)}function $B(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function DB({state:e,dispatch:t},n){let i=MB(e.selection,n);return!i.eq(e.selection,!0)&&(t($B(e,i)),!0)}function BB(e,t){return hS.cursor(t?e.to:e.from)}function LB(e,t){return DB(e,n=>n.empty?e.moveByChar(n,t):BB(n,t))}function IB(e){return e.textDirectionAt(e.state.selection.main.head)==NO.LTR}const NB=e=>LB(e,!IB(e)),zB=e=>LB(e,IB(e));function jB(e,t){return DB(e,n=>n.empty?e.moveByGroup(n,t):BB(n,t))}function VB(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function FB(e,t,n){let i,r,o=CM(e).resolveInner(t.head),s=n?rR.closedBy:rR.openedBy;for(let i=t.head;;){let t=n?o.childAfter(i):o.childBefore(i);if(!t)break;VB(e,t,s)?o=t:i=n?t.to:t.from}return r=o.type.prop(s)&&(i=n?_$(e,o.from,1):_$(e,o.to,-1))&&i.matched?n?i.end.to:i.end.from:n?o.to:o.from,hS.cursor(r,n?-1:1)}function qB(e,t){return DB(e,n=>{if(!n.empty)return BB(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const HB=e=>qB(e,!1),WB=e=>qB(e,!0);function QB(e){let t,n=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,i=0,r=0;if(n){for(let t of e.state.facet(UA.scrollMargins)){let n=t(e);(null==n?void 0:n.top)&&(i=Math.max(null==n?void 0:n.top,i)),(null==n?void 0:n.bottom)&&(r=Math.max(null==n?void 0:n.bottom,r))}t=e.scrollDOM.clientHeight-i-r}else t=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:r,selfScroll:n,height:Math.max(e.defaultLineHeight,t-5)}}function XB(e,t){let n,i=QB(e),{state:r}=e,o=MB(r.selection,n=>n.empty?e.moveVertically(n,t,i.height):BB(n,t));if(o.eq(r.selection))return!1;if(i.selfScroll){let t=e.coordsAtPos(r.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),a=s.top+i.marginTop,l=s.bottom-i.marginBottom;t&&t.top>a&&t.bottom<l&&(n=UA.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-a}))}return e.dispatch($B(r,o),{effects:n}),!0}const GB=e=>XB(e,!1),UB=e=>XB(e,!0);function YB(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=hS.cursor(i.from+n))}return r}function KB(e,t,n){let i=MB(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=hS.range(e.head,e.anchor));let i=n(e);return hS.range(e.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return!i.eq(e.state.selection)&&(e.dispatch($B(e.state,i)),!0)}function ZB(e,t){return KB(e,t,n=>e.moveByChar(n,t))}const JB=e=>ZB(e,!IB(e)),eL=e=>ZB(e,IB(e));function tL(e,t){return KB(e,t,n=>e.moveByGroup(n,t))}function nL(e,t){return KB(e,t,n=>e.moveVertically(n,t))}const iL=e=>nL(e,!1),rL=e=>nL(e,!0);function oL(e,t){return KB(e,t,n=>e.moveVertically(n,t,QB(e).height))}const sL=e=>oL(e,!1),aL=e=>oL(e,!0),lL=({state:e,dispatch:t})=>(t($B(e,{anchor:0})),!0),cL=({state:e,dispatch:t})=>(t($B(e,{anchor:e.doc.length})),!0),uL=({state:e,dispatch:t})=>(t($B(e,{anchor:e.selection.main.anchor,head:0})),!0),pL=({state:e,dispatch:t})=>(t($B(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function hL(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let i of n.selection.ranges){let o=n.doc.lineAt(i.head);if(t?o.to<e.state.doc.length:o.from>0)for(let n=i;;){let i=e.moveVertically(n,t);if(i.head<o.from||i.head>o.to){r.some(e=>e.head==i.head)||r.push(i);break}if(i.head==n.head)break;n=i}}return r.length!=i.ranges.length&&(e.dispatch($B(n,hS.create(r,r.length-1))),!0)}function dL(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(i=>{let{from:r,to:o}=i;if(r==o){let s=t(i);s<r?(n="delete.backward",s=fL(e,s,!1)):s>r&&(n="delete.forward",s=fL(e,s,!0)),r=Math.min(r,s),o=Math.max(o,s)}else r=fL(e,r,!1),o=fL(e,o,!0);return r==o?{range:i}:{changes:{from:r,to:o},range:hS.cursor(r,r<i.head?-1:1)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?UA.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function fL(e,t,n){if(e instanceof UA)for(let i of e.state.facet(UA.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{e<t&&i>t&&(t=n?i:e)});return t}const mL=(e,t,n)=>dL(e,i=>{let r,o,s=i.from,{state:a}=e,l=a.doc.lineAt(s);if(n&&!t&&s>l.from&&s<l.from+200&&!/[^ \t]/.test(r=l.text.slice(0,s-l.from))){if("\t"==r[r.length-1])return s-1;let e=Ek(r,a.tabSize)%jM(a)||jM(a);for(let t=0;t<e&&" "==r[r.length-1-t];t++)s--;o=s}else o=KE(l.text,s-l.from,t,t)+l.from,o==s&&l.number!=(t?a.doc.lines:1)?o+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(l.text.slice(o-l.from,s-l.from))&&(o=KE(l.text,o-l.from,!1,!1)+l.from);return o}),gL=e=>mL(e,!1,!0),vL=e=>mL(e,!0,!1),yL=(e,t)=>dL(e,n=>{let i=n.head,{state:r}=e,o=r.doc.lineAt(i),s=r.charCategorizer(i);for(let e=null;;){if(i==(t?o.to:o.from)){i==n.head&&o.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let a=KE(o.text,i-o.from,t)+o.from,l=o.text.slice(Math.min(i,a)-o.from,Math.max(i,a)-o.from),c=s(l);if(null!=e&&c!=e)break;" "==l&&i==n.head||(e=c),i=a}return i}),bL=e=>yL(e,!1);function wL(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),o=e.doc.lineAt(i.to);if(i.empty||i.to!=o.from||(o=e.doc.lineAt(i.to-1)),n>=r.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(i)}else t.push({from:r.from,to:o.to,ranges:[i]});n=o.number+1}return t}function xL(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of wL(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),s=o.length+1;if(n){i.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak});for(let n of t.ranges)r.push(hS.range(Math.min(e.doc.length,n.anchor+s),Math.min(e.doc.length,n.head+s)))}else{i.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text});for(let e of t.ranges)r.push(hS.range(e.anchor-s,e.head-s))}}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:hS.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function _L(e,t,n){if(e.readOnly)return!1;let i=[];for(let t of wL(e))n?i.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):i.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const EL=kL(!1),SL=kL(!0);function kL(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:r}=n,o=t.doc.lineAt(i),s=!e&&i==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,i=CM(e).resolveInner(t),r=i.childBefore(t),o=i.childAfter(t);return r&&o&&r.to<=t&&o.from>=t&&(n=r.type.prop(rR.closedBy))&&n.indexOf(o.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(o.from).from&&!/\S/.test(e.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}(t,i);e&&(i=r=(r<=o.to?o:t.doc.lineAt(r)).to);let a=new qM(t,{simulateBreak:i,simulateDoubleBreak:!!s}),l=FM(a,i);for(null==l&&(l=Ek(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));r<o.to&&/\s/.test(o.text[r-o.from]);)r++;s?({from:i,to:r}=s):i>o.from&&i<o.from+100&&!/\S/.test(o.text.slice(0,i))&&(i=o.from);let c=["",VM(t,l)];return s&&c.push(VM(t,a.lineIndent(o.from,-1))),{changes:{from:i,to:r,insert:VE.of(c)},range:hS.cursor(i+1+c[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function OL(e,t){let n=-1;return e.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let s=e.doc.lineAt(o);s.number>n&&(i.empty||i.to>s.from)&&(t(s,r,i),n=s.number),o=s.to+1}let o=e.changes(r);return{changes:r,range:hS.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}const CL=[{key:"Ctrl-b",run:NB,shift:JB,preventDefault:!0},{key:"Ctrl-f",run:zB,shift:eL},{key:"Ctrl-p",run:HB,shift:iL},{key:"Ctrl-n",run:WB,shift:rL},{key:"Ctrl-a",run:e=>DB(e,t=>e.moveToLineBoundary(t,!1,!1)),shift:e=>KB(e,!1,t=>hS.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>DB(e,t=>e.moveToLineBoundary(t,!0,!1)),shift:e=>KB(e,!0,t=>hS.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:vL},{key:"Ctrl-h",run:gL},{key:"Ctrl-k",run:e=>dL(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:bL},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:VE.of(["",""])},range:hS.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:KE(i.text,n-i.from,!1)+i.from,o=n==i.to?n+1:KE(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(r,n))},range:hS.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:UB}],PL=[{key:"ArrowLeft",run:NB,shift:JB,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>jB(e,!IB(e)),shift:e=>tL(e,!IB(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>DB(e,t=>YB(e,t,!IB(e))),shift:e=>{let t=!IB(e);return KB(e,t,n=>YB(e,n,t))},preventDefault:!0},{key:"ArrowRight",run:zB,shift:eL,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>jB(e,IB(e)),shift:e=>tL(e,IB(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>DB(e,t=>YB(e,t,IB(e))),shift:e=>{let t=IB(e);return KB(e,t,n=>YB(e,n,t))},preventDefault:!0},{key:"ArrowUp",run:HB,shift:iL,preventDefault:!0},{mac:"Cmd-ArrowUp",run:lL,shift:uL},{mac:"Ctrl-ArrowUp",run:GB,shift:sL},{key:"ArrowDown",run:WB,shift:rL,preventDefault:!0},{mac:"Cmd-ArrowDown",run:cL,shift:pL},{mac:"Ctrl-ArrowDown",run:UB,shift:aL},{key:"PageUp",run:GB,shift:sL},{key:"PageDown",run:UB,shift:aL},{key:"Home",run:e=>DB(e,t=>YB(e,t,!1)),shift:e=>KB(e,!1,t=>YB(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:lL,shift:uL},{key:"End",run:e=>DB(e,t=>YB(e,t,!0)),shift:e=>KB(e,!0,t=>YB(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:cL,shift:pL},{key:"Enter",run:EL,shift:EL},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:gL,shift:gL,preventDefault:!0},{key:"Delete",run:vL,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:bL,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>yL(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>dL(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>dL(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(CL.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),AL=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>DB(e,t=>FB(e.state,t,!IB(e))),shift:e=>{let t=!IB(e);return KB(e,t,n=>FB(e.state,n,t))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>DB(e,t=>FB(e.state,t,IB(e))),shift:e=>{let t=IB(e);return KB(e,t,n=>FB(e.state,n,t))}},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>xL(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>_L(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>xL(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>_L(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>hL(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>hL(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=hS.create([n.main]):n.main.empty||(i=hS.create([hS.cursor(n.main.head)])),!!i&&(t($B(e,i)),!0)}},{key:"Mod-Enter",run:SL},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=wL(e).map(({from:t,to:n})=>hS.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:hS.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=MB(e.selection,t=>{let n=CM(e),i=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=i.node.from&&e.node.to<=i.node.to&&(i=e)}for(let e=i;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return hS.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t($B(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(OL(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=Ek(i,e.tabSize),o=0,s=VM(e,Math.max(0,r-jM(e)));for(;o<i.length&&o<s.length&&i.charCodeAt(o)==s.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+i.length,insert:s.slice(o)})}),{userEvent:"delete.dedent"})),!0)},{key:"Mod-]",run:({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(OL(e,(t,n)=>{n.push({from:t.from,insert:e.facet(zM)})}),{userEvent:"input.indent"})),!0)},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new qM(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=OL(e,(t,r,o)=>{let s=FM(i,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let a=/^\s*/.exec(t.text)[0],l=VM(e,s);(a!=l||o.from<t.from+a.length)&&(n[t.from]=s,r.push({from:t.from,to:t.from+a.length,insert:l}))});return r.changes.empty||t(e.update(r,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(wL(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),i=MB(t.selection,t=>{let n;if(e.lineWrapping){let i=e.lineBlockAt(t.head),r=e.coordsAtPos(t.head,t.assoc||1);r&&(n=i.bottom+e.documentTop-r.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t){let n=!1,i=MB(e.selection,t=>{let i=_$(e,t.head,-1)||_$(e,t.head,1)||t.head>0&&_$(e,t.head-1,1)||t.head<e.doc.length&&_$(e,t.head+1,-1);if(!i||!i.end)return t;n=!0;let r=i.start.from==t.head?i.end.to:i.end.from;return hS.cursor(r)});return!!n&&(t($B(e,i)),!0)}(e,t)},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=oB(e.state,n.from);return i.line?nB(e):!!i.block&&rB(e)}},{key:"Alt-A",mac:"Ctrl-A",run:iB},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat(PL);class TL{constructor(e,t,n,i,r,o,s,a,l,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=r,this.score=o,this.buffer=s,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new TL(e,[],t,n,n,0,[],0,i?new RL(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,i=65535&e,{parser:r}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),s=r.dynamicPrecedence(i);if(s&&(this.score+=s),0==n)return i<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,i,!0),this.reducePos),i<r.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),void this.reduceContext(i,this.reducePos);let a=this.stack.length-3*(n-1)-(262144&e?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from;i<r.minRepeatTerm&&l==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-l;c>=2e3&&!(null===(t=this.p.parser.nodeSet.types[i])||void 0===t?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=c));let u=a?this.stack[a-1]:0,p=this.bufferBase+this.buffer.length-u;if(i<r.minRepeatTerm||131072&e){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,l,e,p+4,!0)}if(262144&e)this.state=this.stack[a];else{let e=this.stack[a-3];this.state=r.getGoto(e,i,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,t,n,i=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&0==this.buffer[e-4]&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t)return void(this.buffer[e-2]=n)}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&(0!=this.buffer[r-4]||this.buffer[r-1]<0)){let e=!1;for(let t=r;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=i}else this.buffer.push(e,t,n,i)}shift(e,t,n,i){if(131072&e)this.pushState(65535&e,this.pos);else if(262144&e)this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4);else{let r=e,{parser:o}=this.p;this.pos=i;let s=o.stateFlag(r,1);!s&&(i>n||t<=o.maxNode)&&(this.reducePos=i),this.pushState(r,s?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,i,4)}}apply(e,t,n,i){65536&e?this.reduce(e):this.shift(e,t,n,i)}useNode(e,t,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.reducePos=this.pos=n+e.length;this.pushState(t,n),this.buffer.push(i,n,r,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&0==e.buffer[t-4]&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new TL(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new ML(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(!(65536&n))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let i,r=0;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let i=t[e+1];n.some((e,t)=>1&t&&e==i)||n.push(t[e],i)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let i=t[e+1];if(i==this.state)continue;let r=this.split();r.pushState(i,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(t[e],this.pos),r.reducePos=this.pos,r.score-=200,n.push(r)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(65536&t))return!1;if(!e.validAction(this.state,t)){let n=t>>19,i=65535&t,r=this.stack.length-3*n;if(r<0||e.getGoto(this.stack[r],i,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(i,r)=>{if(!t.includes(i))return t.push(i),e.allActions(i,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let i=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],i,!1)>=0)return n<<19|65536|i}}else{let e=n(t,r+1);if(null!=e)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.storeNode(this.curContext.hash,this.reducePos,this.reducePos,-3,!0)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new RL(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return!(e<=this.lookAhead)&&(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class RL{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class ML{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class $L{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new $L(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new $L(this.stack,this.pos,this.index)}}function DL(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let i=0,r=0;i<e.length;){let o=0;for(;;){let t=e.charCodeAt(i++),n=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),o+=r,n)break;o*=46}n?n[r++]=o:n=new t(o)}return n}class BL{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const LL=new BL;class IL{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=LL,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,r=this.pos+e;for(;r<n.from;){if(!i)return null;let e=this.ranges[--i];r-=n.from-e.to,n=e}for(;t<0?r>n.to:r>=n.to;){if(i==this.ranges.length-1)return null;let e=this.ranges[++i];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t,n,i=this.chunkOff+e;if(i>=0&&i<this.chunk.length)t=this.pos+e,n=this.chunk.charCodeAt(i);else{let i=this.resolveOffset(e,1);if(null==i)return-1;if(t=i,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)n=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let e=this.rangeIndex,i=this.range;for(;i.to<=t;)i=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>i.to&&(this.chunk2=this.chunk2.slice(0,i.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=LL,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class NL{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;!function(e,t,n,i,r,o){let s=0,a=1<<i,{dialect:l}=n.p.parser;e:for(;0!=(a&e[s]);){let n=e[s+1];for(let i=s+3;i<n;i+=2)if((e[i+1]&a)>0){let n=e[i];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||VL(n,t.token.value,r,o))){t.acceptToken(n);break}}let i=t.next,c=0,u=e[s+2];if(!(t.next<0&&u>c&&65535==e[n+3*u-3])){for(;c<u;){let r=c+u>>1,o=n+r+(r<<1),a=e[o],l=e[o+1]||65536;if(i<a)u=r;else{if(!(i>=l)){s=e[o+2],t.advance();continue e}c=r+1}}break}s=e[n+3*u-1]}}(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}NL.prototype.contextual=NL.prototype.fallback=NL.prototype.extend=!1,NL.prototype.fallback=NL.prototype.extend=!1;class zL{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function jL(e,t,n){for(let i,r=t;65535!=(i=e[r]);r++)if(i==n)return r-t;return-1}function VL(e,t,n,i){let r=jL(n,i,t);return r<0||jL(n,i,e)<r}const FL="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let qL=null;function HL(e,t,n){let i=e.cursor(pR.IncludeAnonymous);for(i.moveTo(t);;)if(!(n<0?i.childBefore(t):i.childAfter(t)))for(;;){if((n<0?i.to<t:i.from>t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}let WL=class{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?HL(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?HL(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;if(e<this.safeFrom)return null;let n=this.trees[t],i=this.index[t];if(i==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=n.children[i],o=this.start[t]+n.positions[i];if(o>e)return this.nextStart=o,null;if(r instanceof hR){let n=o>this.lastRepeatPos&&r.type.id>=this.minRepeat;if(o==e||n){let t,i=o+r.length;if(o>=this.safeFrom&&i<=this.safeTo&&(!(t=r.prop(rR.lookAhead))||i+t<this.fragment.to)&&(n&&(this.lastRepeat=r,this.lastRepeatPos=o),o==e))return r}this.index[t]++,o+r.length>=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}};class QL{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new BL)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:r}=i,o=i.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,a=0;for(let i=0;i<r.length;i++){if(!(1<<i&o))continue;let l=r[i],c=this.tokens[i];if((!n||l.fallback)&&((l.contextual||c.start!=e.pos||c.mask!=o||c.context!=s)&&(this.updateCachedToken(c,l,e),c.mask=o,c.context=s),c.lookAhead>c.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let i=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(n=c,t>i))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new BL,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new BL,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:t}=n.p;for(let i=0;i<t.specialized.length;i++)if(t.specialized[i]==e.value){let r=t.specializers[i](this.stream.read(e.start,e.end),n);if(r>=0&&n.p.parser.dialect.allows(r>>1)){1&r?e.extended=r>>1:e.value=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let t=0;t<i;t+=3)if(this.actions[t]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=n,i}addActions(e,t,n,i){let{state:r}=e,{parser:o}=e.p,{data:s}=o;for(let e=0;e<2;e++)for(let a=o.stateSlot(r,e?2:1);;a+=3){if(65535==s[a]){if(1!=s[a+1]){0==i&&2==s[a+1]&&(i=this.putAction(JL(s,a+2),t,n,i));break}a=JL(s,a+2)}s[a]==t&&(i=this.putAction(JL(s,a+1),t,n,i))}return i}}class XL{constructor(e,t,n,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new IL(t,i),this.tokens=new QL(e,this.stream),this.topTerm=e.top[1];let{from:r}=i[0];this.stacks=[TL.start(this,e.top[0],r)],this.fragments=n.length&&this.stream.end-r>4*e.bufferLength?new WL(n,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,i=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<n.length;o++){let s=n[o];for(;;){if(this.tokens.mainToken=null,s.pos>i)r.push(s);else{if(this.advanceStack(s,r,n))continue;{e||(e=[],t=[]),e.push(s);let n=this.tokens.getMainToken(s);t.push(n.value,n.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return FL&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw FL&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return FL&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort((e,t)=>t.score-e.score);r.length>e;)r.pop();r.some(e=>e.reducePos>i)&&this.recovering--}else if(r.length>1){e:for(let e=0;e<r.length-1;e++){let t=r[e];for(let n=e+1;n<r.length;n++){let i=r[n];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if(!((t.score-i.score||t.buffer.length-i.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(n--,1)}}}r.length>12&&(r.sort((e,t)=>t.score-e.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let e=1;e<r.length;e++)r[e].pos<this.minStackPos&&(this.minStackPos=r[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}tryReuse(e,t,n,i){if(!n)return null;let r=e.curContext&&e.curContext.tracker.strict,o=r?e.curContext.hash:0;for(;n;){let s=this.parser.nodeSet.types[n.type.id]!=n.type?-1:this.parser.getGoto(e.state,n.type.id);if(s>-1&&n.length&&(!r||(n.prop(rR.contextHash)||0)==o))return e.useNode(n,s,t),n;if(0==n.children.length||n.positions[0]>0)break;let a=n.children[0];if(!(a instanceof hR&&(!i||a.type.id>=this.parser.minRepeatTerm)))break;n=a}return null}advanceStack(e,t,n){let i=e.pos,{parser:r}=this,o=FL?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.reducePos<i&&e.buffer.length&&e.buffer[e.buffer.length-2]<=e.reducePos&&this.fragments.lastRepeatPos==e.reducePos&&this.tryReuse(e,e.reducePos,this.fragments.lastRepeat,!0)||this.tryReuse(e,i,this.fragments.nodeAt(i),!1);if(t)return FL&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(t.type.id)})`),!0}let s=r.stateSlot(e.state,4);if(s>0)return e.reduce(s),FL&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(65535&s)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let s=0;s<a.length;){let l=a[s++],c=a[s++],u=a[s++],p=s==a.length||!n,h=p?e:e.split(),d=this.tokens.mainToken;if(h.apply(l,c,d?d.start:h.pos,u),FL&&console.log(o+this.stackID(h)+` (via ${65536&l?`reduce of ${r.getName(65535&l)}`:"shift"} for ${r.getName(c)} @ ${i}${h==e?"":", split"})`),p)return!0;h.pos>i?t.push(h):n.push(h)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return GL(e,t),!0}}runRecovery(e,t,n){let i=null,r=!1;for(let o=0;o<e.length;o++){let s=e[o],a=t[o<<1],l=t[1+(o<<1)],c=FL?this.stackID(s)+" -> ":"";if(s.deadEnd){if(r)continue;if(r=!0,s.restart(),FL&&console.log(c+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))continue}let u=s.split(),p=c;for(let e=0;e<10&&u.forceReduce();e++){if(FL&&console.log(p+this.stackID(u)+" (via force-reduce)"),this.advanceFully(u,n))break;FL&&(p=this.stackID(u)+" -> ")}for(let e of s.recoverByInsert(a))FL&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>s.pos?(l==s.pos&&(l++,a=0),s.recoverByDelete(a,l),FL&&console.log(c+this.stackID(s)+` (via recover-delete ${this.parser.getName(a)})`),GL(s,n)):(!i||i.score<u.score)&&(i=u)}return i}stackToTree(e){return e.close(),hR.build({buffer:$L.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(qL||(qL=new WeakMap)).get(e);return t||qL.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function GL(e,t){for(let n=0;n<t.length;n++){let i=t[n];if(i.pos==e.pos&&i.sameState(e))return void(t[n].score<e.score&&(t[n]=e))}t.push(e)}class UL{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}const YL=e=>e;class KL{constructor(e){this.start=e.start,this.shift=e.shift||YL,this.reduce=e.reduce||YL,this.reuse=e.reuse||YL,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}class ZL extends RR{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),i=[];for(let e=0;e<t.length;e++)i.push([]);function r(e,t,n){i[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=rR[e]);for(let n=1;n<t.length;){let i=t[n++];if(i>=0)r(i,e,t[n++]);else{let o=t[n+-i];for(let s=-i;s>0;s--)r(t[n++],e,o);n++}}}this.nodeSet=new lR(t.map((t,r)=>aR.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:i[r],top:n.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=tR;let o=DL(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(eI),this.states=DL(e.states,Uint32Array),this.data=DL(e.stateData),this.goto=DL(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new NL(o,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new XL(this,e,t,n);for(let r of this.wrappers)i=r(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return-1;for(let r=i[t+1];;){let t=i[r++],o=1&t,s=i[r++];if(o&&n)return s;for(let n=r+(t>>1);r<n;r++)if(i[r]==e)return s;if(o)return-1}}hasAction(e,t){let n=this.data;for(let i=0;i<2;i++)for(let r,o=this.stateSlot(e,i?2:1);;o+=3){if(65535==(r=n[o])){if(1!=n[o+1]){if(2==n[o+1])return JL(n,o+2);break}r=n[o=JL(n,o+2)]}if(r==t||0==r)return JL(n,o+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),i=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==i;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=JL(this.data,n+2)}i=t(JL(this.data,n+1))}return i}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=JL(this.data,n+2)}if(!(1&this.data[n+2])){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(ZL.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let r=e.specializers.find(e=>e.from==n.external);if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[i]=eI(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let i of e.split(" ")){let e=t.indexOf(i);e>=0&&(n[e]=!0)}let i=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n,r=this.dialects[t[e]];65535!=(n=this.data[r++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[n]=1;return new UL(e,n,i)}static deserialize(e){return new ZL(e)}}function JL(e,t){return e[t]|e[t+1]<<16}function eI(e){if(e.external){let t=e.extend?1:0;return(n,i)=>e.external(n,i)<<1|t}return e.get}class tI{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class nI{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=n.facet(fI).markerFilter;i&&(e=i(e,n));let r=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new hk,s=[],a=0,l=n.doc.iter(),c=0,u=n.doc.length;for(let e=0;;){let t,n,i=e==r.length?null:r[e];if(!i&&!s.length)break;if(s.length)t=a,n=s.reduce((e,t)=>Math.min(e,t.to),i&&i.from>t?i.from:1e8);else{if(t=i.from,t>u)break;n=i.to,s.push(i),e++}for(;e<r.length;){let i=r[e];if(i.from!=t||!(i.to>i.from||i.to==t)){n=Math.min(i.from,n);break}s.push(i),e++,n=Math.min(i.to,n)}n=Math.min(n,u);let p=!1;if(s.some(e=>e.from==t&&(e.to==n||n==u))&&(p=t==n,!p&&n-t<10)){let e=t-(c+l.value.length);e>0&&(l.next(e),c=t);for(let e=t;;){if(e>=n){p=!0;break}if(!l.lineBreak&&c+l.value.length>e)break;e=c+l.value.length,c+=l.value.length,l.next()}}let h=kI(s);if(p)o.add(t,t,rO.widget({widget:new bI(h),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");o.add(t,n,rO.mark({class:"cm-lintRange cm-lintRange-"+h+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>n)}))}if(a=n,a==u)break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1)}let p=o.finish();return new nI(p,t,iI(p))}}function iI(e,t=null,n=0){let i=null;return e.between(n,1e9,(e,n,{spec:r})=>{if(!(t&&r.diagnostics.indexOf(t)<0))if(i){if(r.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new tI(i.from,n,i.diagnostic)}else i=new tI(e,n,t||r.diagnostics[0])}),i}function rI(e,t){return e.field(lI,!1)?t:t.concat(WS.appendConfig.of(CI))}const oI=WS.define(),sI=WS.define(),aI=WS.define(),lI=_S.define({create:()=>new nI(rO.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);i=iI(n,e.selected.diagnostic,r)||iI(n,null,r)}!n.size&&r&&t.state.facet(fI).autoPanel&&(r=null),e=new nI(n,r,i)}for(let n of t.effects)if(n.is(oI)){let i=t.state.facet(fI).autoPanel?n.value.length?xI.open:null:e.panel;e=nI.init(n.value,i,t.state)}else n.is(sI)?e=new nI(e.diagnostics,n.value?xI.open:null,e.selected):n.is(aI)&&(e=new nI(e.diagnostics,e.panel,n.value));return e},provide:e=>[BT.from(e,e=>e.panel),UA.decorations.from(e,e=>e.diagnostics)]}),cI=rO.mark({class:"cm-lintRange cm-lintRange-active"});function uI(e,t,n){let i,{diagnostics:r}=e.state.field(lI),o=-1,s=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(e,r,{spec:a})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=a.diagnostics,o=e,s=r,!1});let a=e.state.facet(fI).tooltipFilter;return i&&a&&(i=a(i,e.state)),i?{pos:o,end:s,above:!0,create:()=>({dom:pI(e,i)})}:null}function pI(e,t){return Ik("ul",{class:"cm-tooltip-lint"},t.map(t=>yI(e,t,!1)))}const hI=e=>{let t=e.state.field(lI,!1);return!(!t||!t.panel)&&(e.dispatch({effects:sI.of(!1)}),!0)},dI=_C.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(fI);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(fI);t.length&&function(e,t,n){let i=[],r=-1;for(let o of e)o.then(n=>{i.push(n),clearTimeout(r),i.length==e.length?t(i):r=setTimeout(()=>t(i),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(function(e,t){return{effects:rI(e,[oI.of(t)])}}(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{yC(this.view.state,e)})}}update(e){let t=e.state.facet(fI);(e.docChanged||t!=e.startState.facet(fI)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});const fI=mS.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...rk(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:mI,tooltipFilter:mI,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,i,r)=>e(n,i,r)||t(n,i,r):e:t,autoPanel:(e,t)=>e||t})})});function mI(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function gI(e,t={}){return[fI.of({source:e,config:t}),dI,CI]}function vI(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let i=n[e];if(/[a-zA-Z]/.test(i)&&!t.some(e=>e.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function yI(e,t,n){var i;let r=n?vI(t.actions):[];return Ik("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ik("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(i=t.actions)||void 0===i?void 0:i.map((n,i)=>{let o=0,s=i=>{if(i.preventDefault(),o>Date.now()-100)return;let r=iI(e.state.field(lI).diagnostics,t);r&&n.apply(e,r.from,r.to),o=Date.now()},{name:a}=n,l=r[i]?a.indexOf(r[i]):-1,c=l<0?a:[a.slice(0,l),Ik("u",a.slice(l,l+1)),a.slice(l+1)];return Ik("button",{type:"button",class:"cm-diagnosticAction"+(n.markClass?" "+n.markClass:""),onclick:s,onmousedown:s,"aria-label":` Action: ${a}${l<0?"":` (access key "${r[i]})"`}.`},c)}),t.source&&Ik("div",{class:"cm-diagnosticSource"},t.source))}class bI extends nO{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Ik("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class wI{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=yI(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class xI{constructor(e){this.view=e,this.items=[];this.list=Ik("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(27==t.keyCode)hI(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],i=vI(n.actions);for(let r=0;r<i.length;r++)if(i[r].toUpperCase().charCodeAt(0)==t.keyCode){let t=iI(this.view.state.field(lI).diagnostics,n);t&&n.actions[r].apply(e,t.from,t.to)}}}t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=Ik("div",{class:"cm-panel-lint"},this.list,Ik("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>hI(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(lI).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(lI),n=0,i=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(e,s,{spec:a})=>{for(let e of a.diagnostics){if(o.has(e))continue;o.add(e);let s,a=-1;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){a=t;break}a<0?(s=new wI(this.view,e),this.items.splice(n,0,s),i=!0):(s=this.items[a],a>n&&(this.items.splice(n,a-n),i=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute("aria-selected")||(s.dom.setAttribute("aria-selected","true"),r=s):s.dom.hasAttribute("aria-selected")&&s.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new wI(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=iI(this.view.state.field(lI).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:aI.of(t)})}static open(e){return new xI(e)}}function _I(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const EI=UA.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:_I("#f11")},".cm-lintRange-warning":{backgroundImage:_I("orange")},".cm-lintRange-info":{backgroundImage:_I("#999")},".cm-lintRange-hint":{backgroundImage:_I("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function SI(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}function kI(e){let t="hint",n=1;for(let i of e){let e=SI(i.severity);e>n&&(n=e,t=i.severity)}return t}const OI=PT(uI,{hideOn:function(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(fI).hideOn(e,n,i);if(null!=r)return r;let o=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(oI))&&!e.changes.touchesRange(o.from,Math.max(o.to,i)))}}),CI=[lI,UA.decorations.compute([lI],e=>{let{selected:t,panel:n}=e.field(lI);return t&&n&&t.from!=t.to?rO.set([cI.range(t.from,t.to)]):rO.none}),OI,EI];class PI{static create(e,t,n,i,r){return new PI(e,t,n,i+(i<<8)+e+(t<<4)|0,r,[],[])}constructor(e,t,n,i,r,o,s){this.type=e,this.value=t,this.from=n,this.hash=i,this.end=r,this.children=o,this.positions=s,this.blankFirstLine=!1,this.hashProp=[[rR.contextHash,i]]}addChild(e,t){e.prop(rR.contextHash)!=this.hash&&(e=new hR(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new hR(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new hR(aR.none,e,t,n,this.hashProp)})}}var AI;!function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"}(AI||(AI={}));class TI{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class RI{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return BI(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let i=t;i<e;i++)n+=9==this.text.charCodeAt(i)?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=9==this.text.charCodeAt(t)?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function MI(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let i=(e.type==AI.OrderedList?FI:VI)(n,t,!1);return i>0&&(e.type!=AI.BulletList||zI(n,t,!1)<0)&&n.text.charCodeAt(n.pos+i-1)==e.value}const $I={[AI.Blockquote]:(e,t,n)=>62==n.next&&(n.markers.push(gN(AI.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(DI(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0),[AI.ListItem]:(e,t,n)=>!(n.next<0?e.blankFirstLine&&1==e.children.length:n.indent<n.baseIndent+e.value)&&(n.moveBaseColumn(n.baseIndent+e.value),!0),[AI.OrderedList]:MI,[AI.BulletList]:MI,[AI.Document]:()=>!0};function DI(e){return 32==e||9==e||10==e||13==e}function BI(e,t=0){for(;t<e.length&&DI(e.charCodeAt(t));)t++;return t}function LI(e,t,n){for(;t>n&&DI(e.charCodeAt(t-1));)t--;return t}function II(e){if(96!=e.next&&126!=e.next)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(96==e.next)for(let n=t;n<e.text.length;n++)if(96==e.text.charCodeAt(n))return-1;return t}function NI(e){return 62!=e.next?-1:32==e.text.charCodeAt(e.pos+1)?2:1}function zI(e,t,n){if(42!=e.next&&45!=e.next&&95!=e.next)return-1;let i=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)i++;else if(!DI(n))return-1}return n&&45==e.next&&HI(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(nN.SetextHeading)>-1||i<3?-1:1}function jI(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function VI(e,t,n){return 45!=e.next&&43!=e.next&&42!=e.next||e.pos!=e.text.length-1&&!DI(e.text.charCodeAt(e.pos+1))||!(!n||jI(t,AI.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?-1:1}function FI(e,t,n){let i=e.pos,r=e.next;for(;r>=48&&r<=57;){if(i++,i==e.text.length)return-1;r=e.text.charCodeAt(i)}return i==e.pos||i>e.pos+9||46!=r&&41!=r||i<e.text.length-1&&!DI(e.text.charCodeAt(i+1))||n&&!jI(t,AI.OrderedList)&&(e.skipSpace(i+1)==e.text.length||i>e.pos+1||49!=e.next)?-1:i+1-e.pos}function qI(e){if(35!=e.next)return-1;let t=e.pos+1;for(;t<e.text.length&&35==e.text.charCodeAt(t);)t++;if(t<e.text.length&&!DI(e.text.charCodeAt(t)))return-1;let n=t-e.pos;return n>6?-1:n}function HI(e){if(45!=e.next&&61!=e.next||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&DI(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}const WI=/^[ \t]*$/,QI=/-->/,XI=/\?>/,GI=[[/^<(?:script|pre|style|textarea)(?:\s|>|$)/i,/<\/(?:script|pre|style|textarea)>/i],[/^\s*<!--/,QI],[/^\s*<\?/,XI],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,WI],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,WI]];function UI(e,t,n){if(60!=e.next)return-1;let i=e.text.slice(e.pos);for(let e=0,t=GI.length-(n?1:0);e<t;e++)if(GI[e][0].test(i))return e;return-1}function YI(e,t){let n=e.countIndent(t,e.pos,e.indent),i=e.skipSpace(t),r=e.countIndent(i,t,n);return r>=n+5||i==e.text.length?n+1:r}function KI(e,t,n){let i=e.length-1;i>=0&&e[i].to==t&&e[i].type==AI.CodeText?e[i].to=n:e.push(gN(AI.CodeText,t,n))}const ZI={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let i=t.findColumn(n),r=e.lineStart+i,o=e.lineStart+t.text.length,s=[],a=[];for(KI(s,r,o);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){KI(a,e.lineStart-1,e.lineStart);for(let e of t.markers)a.push(e)}else{if(t.indent<n)break;{if(a.length){for(let e of a)e.type==AI.CodeText?KI(s,e.from,e.to):s.push(e);a=[]}KI(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e);o=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<o&&KI(s,n,o)}}return a.length&&(a=a.filter(e=>e.type!=AI.CodeText),a.length&&(t.markers=a.concat(t.markers))),e.addNode(e.buffer.writeElements(s,-r).finish(AI.CodeBlock,o-r),r),!0},FencedCode(e,t){let n=II(t);if(n<0)return!1;let i=e.lineStart+t.pos,r=t.next,o=n-t.pos,s=t.skipSpace(n),a=LI(t.text,t.text.length,s),l=[gN(AI.CodeMark,i,i+o)];s<a&&l.push(gN(AI.CodeInfo,e.lineStart+s,e.lineStart+a));for(let n=!0,i=!0,s=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let a=t.pos;if(t.indent-t.baseIndent<4)for(;a<t.text.length&&t.text.charCodeAt(a)==r;)a++;if(a-t.pos>=o&&t.skipSpace(a)==t.text.length){for(let e of t.markers)l.push(e);i&&s&&KI(l,e.lineStart-1,e.lineStart),l.push(gN(AI.CodeMark,e.lineStart+t.pos,e.lineStart+a)),e.nextLine();break}{s=!0,n||(KI(l,e.lineStart-1,e.lineStart),i=!1);for(let e of t.markers)l.push(e);let r=e.lineStart+t.basePos,o=e.lineStart+t.text.length;r<o&&(KI(l,r,o),i=!1)}}return e.addNode(e.buffer.writeElements(l,-i).finish(AI.FencedCode,e.prevLineEnd()-i),i),!0},Blockquote(e,t){let n=NI(t);return!(n<0)&&(e.startContext(AI.Blockquote,t.pos),e.addNode(AI.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(zI(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(AI.HorizontalRule,n),!0},BulletList(e,t){let n=VI(t,e,!1);if(n<0)return!1;e.block.type!=AI.BulletList&&e.startContext(AI.BulletList,t.basePos,t.next);let i=YI(t,t.pos+1);return e.startContext(AI.ListItem,t.basePos,i-t.baseIndent),e.addNode(AI.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(i),e.block.blankFirstLine=i>=t.text.length,null},OrderedList(e,t){let n=FI(t,e,!1);if(n<0)return!1;e.block.type!=AI.OrderedList&&e.startContext(AI.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let i=YI(t,t.pos+n);return e.startContext(AI.ListItem,t.basePos,i-t.baseIndent),e.addNode(AI.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(i),e.block.blankFirstLine=i==t.text.length,null},ATXHeading(e,t){let n=qI(t);if(n<0)return!1;let i=t.pos,r=e.lineStart+i,o=LI(t.text,t.text.length,i),s=o;for(;s>i&&t.text.charCodeAt(s-1)==t.next;)s--;s!=o&&s!=i&&DI(t.text.charCodeAt(s-1))||(s=t.text.length);let a=e.buffer.write(AI.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(i+n+1,s),r+n+1),-r);s<t.text.length&&a.write(AI.HeaderMark,s-i,o-i);let l=a.finish(AI.ATXHeading1-1+n,t.text.length-i);return e.nextLine(),e.addNode(l,r),!0},HTMLBlock(e,t){let n=UI(t,0,!1);if(n<0)return!1;let i=e.lineStart+t.pos,r=GI[n][1],o=[],s=r!=WI;for(;!r.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){s=!1;break}for(let e of t.markers)o.push(e)}s&&e.nextLine();let a=r==QI?AI.CommentBlock:r==XI?AI.ProcessingInstructionBlock:AI.HTMLBlock,l=e.prevLineEnd();return e.addNode(e.buffer.writeElements(o,-i).finish(a,l-i),i),!0},SetextHeading:void 0};class JI{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(-1==this.stage)return!1;let i=n.content+"\n"+t.scrub(),r=this.advance(i);return r>-1&&r<i.length&&this.complete(e,n,r)}finish(e,t){return(2==this.stage||3==this.stage)&&BI(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,gN(AI.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(!1===e&&(this.stage=-1),!1)}advance(e){for(;;){if(-1==this.stage)return-1;if(0==this.stage){if(!this.nextStage(PN(e,this.pos,this.start,!0)))return-1;if(58!=e.charCodeAt(this.pos))return this.stage=-1;this.elts.push(gN(AI.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else{if(1!=this.stage){if(2==this.stage){let t=BI(e,this.pos),n=0;if(t>this.pos){let i=CN(e,t,this.start);if(i){let t=eN(e,i.to-this.start);t>0&&(this.nextStage(i),n=t)}}return n||(n=eN(e,this.pos)),n>0&&n<e.length?n:-1}return eN(e,this.pos)}if(!this.nextStage(ON(e,BI(e,this.pos),this.start)))return-1}}}}function eN(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(10==n)break;if(!DI(n))return-1}return t}class tN{nextLine(e,t,n){let i=t.depth<e.stack.length?-1:HI(t),r=t.next;if(i<0)return!1;let o=gN(AI.HeaderMark,e.lineStart+t.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(n,gN(61==r?AI.SetextHeading1:AI.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const nN={LinkReference:(e,t)=>91==t.content.charCodeAt(0)?new JI(t):null,SetextHeading:()=>new tN},iN=[(e,t)=>qI(t)>=0,(e,t)=>II(t)>=0,(e,t)=>NI(t)>=0,(e,t)=>VI(t,e,!0)>=0,(e,t)=>FI(t,e,!0)>=0,(e,t)=>zI(t,e,!0)>=0,(e,t)=>UI(t,0,!0)>=0],rN={text:"",end:0};class oN{constructor(e,t,n,i){this.parser=e,this.input=t,this.ranges=i,this.line=new RI,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=PI.create(AI.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new MN(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(null!=this.stoppedAt&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(0!=n){if(1==n)return null;e.forward();continue e}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let t=new TI(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4)for(let n of this.parser.endLeafBlock)if(n(this,e,t))break e;for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+="\n"+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return!!t&&(this.absoluteLineStart+=t,this.lineStart=DN(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0)}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=rN;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let i=this.ranges[n].from,r=this.lineChunkAt(i);t.end=i+r.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+r,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw new Error("Unhandled block context "+AI[t.type]);let i=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>i&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t,n=this.input.chunk(e);if(this.input.lineChunks)t="\n"==n?"":n;else{let e=n.indexOf("\n");t=e<0?n:n.slice(0,e)}return e+t.length>this.to?t.slice(0,this.to-e):t}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=PI.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){"number"==typeof e&&(e=new hR(this.parser.nodeSet.types[e],hN,hN,(null!=n?n:this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(TN(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?sN(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=TN(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(AI.Paragraph,e.content.length),e.start)}elt(e,t,n,i){return"string"==typeof e?gN(this.parser.getNodeType(e),t,n,i):new mN(e,t)}get buffer(){return new dN(this.parser.nodeSet)}}function sN(e,t,n,i,r){let o=e[t].to,s=[],a=[],l=n.from+i;function c(n,r){for(;r?n>=o:n>o;){let r=e[t+1].from-o;i+=r,n+=r,t++,o=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){c(u.from+i,!0);let n,p=u.from+i,h=r.get(u.tree);h?n=h:u.to+i>o?(n=sN(e,t,u,i,r),c(u.to+i,!1)):n=u.toTree(),s.push(n),a.push(p-l)}return c(n.to+i,!1),new hR(n.type,s,a,n.to+i-l,n.tree?n.tree.propValues:void 0)}class aN extends RR{constructor(e,t,n,i,r,o,s,a,l){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=i,this.endLeafBlock=r,this.skipContextMarkup=o,this.inlineParsers=s,this.inlineNames=a,this.wrappers=l,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let i=new oN(this,e,t,n);for(let r of this.wrappers)i=r(i,e,t,n);return i}configure(e){let t=cN(e);if(!t)return this;let{nodeSet:n,skipContextMarkup:i}=this,r=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),a=this.inlineParsers.slice(),l=this.inlineNames.slice(),c=this.endLeafBlock.slice(),u=this.wrappers;if(lN(t.defineNodes)){i=Object.assign({},i);let e,r=n.types.slice();for(let n of t.defineNodes){let{name:t,block:o,composite:s,style:a}="string"==typeof n?{name:n}:n;if(r.some(e=>e.name==t))continue;s&&(i[r.length]=(e,t,n)=>s(t,n,e.value));let l=r.length,c=s?["Block","BlockContext"]:o?l>=AI.ATXHeading1&&l<=AI.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;r.push(aR.define({id:l,name:t,props:c&&[[rR.group,c]]})),a&&(e||(e={}),Array.isArray(a)||a instanceof YR?e[t]=a:Object.assign(e,a))}n=new lR(r),e&&(n=n.extend(JR(e)))}if(lN(t.props)&&(n=n.extend(...t.props)),lN(t.remove))for(let e of t.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(r[t]=o[t]=void 0),n>-1&&(a[n]=void 0)}if(lN(t.parseBlock))for(let e of t.parseBlock){let t=s.indexOf(e.name);if(t>-1)r[t]=e.parse,o[t]=e.leaf;else{let t=e.before?uN(s,e.before):e.after?uN(s,e.after)+1:s.length-1;r.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&c.push(e.endLeaf)}if(lN(t.parseInline))for(let e of t.parseInline){let t=l.indexOf(e.name);if(t>-1)a[t]=e.parse;else{let t=e.before?uN(l,e.before):e.after?uN(l,e.after)+1:l.length-1;a.splice(t,0,e.parse),l.splice(t,0,e.name)}}return t.wrap&&(u=u.concat(t.wrap)),new aN(n,r,o,s,c,i,a,l,u)}getNodeType(e){let t=this.nodeTypes[e];if(null==t)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new AN(this,e,t);e:for(let e=t;e<n.end;){let t=n.char(e);for(let i of this.inlineParsers)if(i){let r=i(n,t,e);if(r>=0){e=r;continue e}}e++}return n.resolveMarkers(0)}}function lN(e){return null!=e&&e.length>0}function cN(e){if(!Array.isArray(e))return e;if(0==e.length)return null;let t=cN(e[0]);if(1==e.length)return t;let n=cN(e.slice(1));if(!n||!t)return t||n;let i=(e,t)=>(e||hN).concat(t||hN),r=t.wrap,o=n.wrap;return{props:i(t.props,n.props),defineNodes:i(t.defineNodes,n.defineNodes),parseBlock:i(t.parseBlock,n.parseBlock),parseInline:i(t.parseInline,n.parseInline),remove:i(t.remove,n.remove),wrap:r?o?(e,t,n,i)=>r(o(e,t,n,i),t,n,i):r:o}}function uN(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let pN=[aR.none];for(let e,t=1;e=AI[t];t++)pN[t]=aR.define({id:t,name:e,props:t>=AI.Escape?[]:[[rR.group,t in $I?["Block","BlockContext"]:["Block","LeafBlock"]]],top:"Document"==e});const hN=[];class dN{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,i=0){return this.content.push(e,t,n,4+4*i),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return hR.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let fN=class{constructor(e,t,n,i=hN){this.type=e,this.from=t,this.to=n,this.children=i}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new dN(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class mN{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return hN}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function gN(e,t,n,i){return new fN(e,t,n,i)}const vN={resolve:"Emphasis",mark:"EmphasisMark"},yN={resolve:"Emphasis",mark:"EmphasisMark"},bN={},wN={};class xN{constructor(e,t,n,i,r=n-t){this.type=e,this.from=t,this.to=n,this.side=i,this.size=r}}const _N="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let EN=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{EN=new RegExp("[\\p{S}|\\p{P}]","u")}catch($_){}const SN={Escape(e,t,n){if(92!=t||n==e.end-1)return-1;let i=e.char(n+1);for(let t=0;t<32;t++)if(_N.charCodeAt(t)==i)return e.append(gN(AI.Escape,n,n+2));return-1},Entity(e,t,n){if(38!=t)return-1;let i=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return i?e.append(gN(AI.Entity,n,n+1+i[0].length)):-1},InlineCode(e,t,n){if(96!=t||n&&96==e.char(n-1))return-1;let i=n+1;for(;i<e.end&&96==e.char(i);)i++;let r=i-n,o=0;for(;i<e.end;i++)if(96==e.char(i)){if(o++,o==r&&96!=e.char(i+1))return e.append(gN(AI.InlineCode,n,i+1,[gN(AI.CodeMark,n,n+r),gN(AI.CodeMark,i+1-r,i+1)]))}else o=0;return-1},HTMLTag(e,t,n){if(60!=t||n==e.end-1)return-1;let i=e.slice(n+1,e.end),r=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(i);if(r)return e.append(gN(AI.Autolink,n,n+1+r[0].length,[gN(AI.LinkMark,n,n+1),gN(AI.URL,n+1,n+r[0].length),gN(AI.LinkMark,n+r[0].length,n+1+r[0].length)]));let o=/^!--(?:-?>|[^]*?-->)/.exec(i);if(o)return e.append(gN(AI.Comment,n,n+1+o[0].length));let s=/^\?[^]*?\?>/.exec(i);if(s)return e.append(gN(AI.ProcessingInstruction,n,n+1+s[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/[a-zA-Z][\w-]*\s*>|[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*\/?>)/.exec(i);return a?e.append(gN(AI.HTMLTag,n,n+1+a[0].length)):-1},Emphasis(e,t,n){if(95!=t&&42!=t)return-1;let i=n+1;for(;e.char(i)==t;)i++;let r=e.slice(n-1,n),o=e.slice(i,i+1),s=EN.test(r),a=EN.test(o),l=/\s|^$/.test(r),c=/\s|^$/.test(o),u=!c&&(!a||l||s),p=!l&&(!s||c||a),h=u&&(42==t||!p||s),d=p&&(42==t||!u||a);return e.append(new xN(95==t?vN:yN,n,i,(h?1:0)|(d?2:0)))},HardBreak(e,t,n){if(92==t&&10==e.char(n+1))return e.append(gN(AI.HardBreak,n,n+2));if(32==t){let t=n+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=n+2)return e.append(gN(AI.HardBreak,n,t+1))}return-1},Link:(e,t,n)=>91==t?e.append(new xN(bN,n,n+1,1)):-1,Image:(e,t,n)=>33==t&&91==e.char(n+1)?e.append(new xN(wN,n,n+2,1)):-1,LinkEnd(e,t,n){if(93!=t)return-1;for(let t=e.parts.length-1;t>=0;t--){let i=e.parts[t];if(i instanceof xN&&(i.type==bN||i.type==wN)){if(!i.side||e.skipSpace(i.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let r=e.takeContent(t),o=e.parts[t]=kN(e,r,i.type==bN?AI.Link:AI.Image,i.from,n+1);if(i.type==bN)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof xN&&t.type==bN&&(t.side=0)}return o.to}}return-1}};function kN(e,t,n,i,r){let{text:o}=e,s=e.char(r),a=r;if(t.unshift(gN(AI.LinkMark,i,i+(n==AI.Image?2:1))),t.push(gN(AI.LinkMark,r-1,r)),40==s){let n,i=e.skipSpace(r+1),s=ON(o,i-e.offset,e.offset);s&&(i=e.skipSpace(s.to),i!=s.to&&(n=CN(o,i-e.offset,e.offset),n&&(i=e.skipSpace(n.to)))),41==e.char(i)&&(t.push(gN(AI.LinkMark,r,r+1)),a=i+1,s&&t.push(s),n&&t.push(n),t.push(gN(AI.LinkMark,i,a)))}else if(91==s){let n=PN(o,r-e.offset,e.offset,!1);n&&(t.push(n),a=n.to)}return gN(n,i,a,t)}function ON(e,t,n){if(60==e.charCodeAt(t)){for(let i=t+1,r=!1;i<e.length;i++){let o=e.charCodeAt(i);if(62==o&&!r)return gN(AI.URL,t+n,i+1+n);if(60==o&&!r||10==o)return!1;r=92==o}return null}{let i=0,r=t;for(let t=!1;r<e.length;r++){let n=e.charCodeAt(r);if(DI(n))break;if(t)t=!1;else if(40==n)i++;else if(41==n){if(!i)break;i--}else 92==n&&(t=!0)}return r>t?gN(AI.URL,t+n,r+n):r==e.length&&null}}function CN(e,t,n){let i=e.charCodeAt(t);if(39!=i&&34!=i&&40!=i)return!1;let r=40==i?41:i;for(let i=t+1,o=!1;i<e.length;i++){let s=e.charCodeAt(i);if(o)o=!1;else{if(s==r)return gN(AI.LinkTitle,t+n,i+1+n);92==s&&(o=!0)}}return null}function PN(e,t,n,i){for(let r=!1,o=t+1,s=Math.min(e.length,o+999);o<s;o++){let s=e.charCodeAt(o);if(r)r=!1;else{if(93==s)return!i&&gN(AI.LinkLabel,t+n,o+1+n);if(i&&!DI(s)&&(i=!1),91==s)return!1;92==s&&(r=!0)}}return null}class AN{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,i,r){return this.append(new xN(e,t,n,(i?1:0)|(r?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof xN&&(t.type==bN||t.type==wN))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof xN&&n.type.resolve&&2&n.side))continue;let i,r=n.type==vN||n.type==yN,o=n.to-n.from,s=t-1;for(;s>=e;s--){let e=this.parts[s];if(e instanceof xN&&1&e.side&&e.type==n.type&&!(r&&(1&n.side||2&e.side)&&(e.size+n.size)%3==0&&(e.size%3||n.size%3))){i=e;break}}if(!i)continue;let a=n.type.resolve,l=[],c=i.from,u=n.to;if(r){let e=Math.min(2,i.to-i.from,o);c=i.to-e,u=n.from+e,a=1==e?"Emphasis":"StrongEmphasis"}i.type.mark&&l.push(this.elt(i.type.mark,c,i.to));for(let e=s+1;e<t;e++)this.parts[e]instanceof fN&&l.push(this.parts[e]),this.parts[e]=null;n.type.mark&&l.push(this.elt(n.type.mark,n.from,u));let p=this.elt(a,c,u,l);this.parts[s]=r&&i.from!=c?new xN(i.type,i.from,c,i.side,i.size):null,(this.parts[t]=r&&n.to!=u?new xN(n.type,u,n.to,n.side,n.size):null)?this.parts.splice(t,0,p):this.parts[t]=p}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof fN&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof xN&&n.type==e&&1&n.side)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof xN?t:null}skipSpace(e){return BI(this.text,e-this.offset)+this.offset}elt(e,t,n,i){return"string"==typeof e?gN(this.parser.getNodeType(e),t,n,i):new mN(e,t)}}function TN(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),i=0;for(let e of t){for(;i<n.length&&n[i].to<e.to;)i++;if(i<n.length&&n[i].from<e.from){let t=n[i];t instanceof fN&&(n[i]=new fN(t.type,t.from,t.to,TN(t.children,[e])))}else n.splice(i++,0,e)}return n}AN.linkStart=bN,AN.imageStart=wN,AN.emphasisAsterisk=yN,AN.emphasisUnderscore=vN;const RN=[AI.CodeBlock,AI.ListItem,AI.OrderedList,AI.BulletList];class MN{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&"\n"!=this.input.read(e-1,e);)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(pR.IncludeAnonymous|pR.IgnoreMounts),n.firstChild());let i=e+this.fragment.offset;for(;n.to<=i;)if(!n.parent())return!1;for(;;){if(n.from>=i)return this.fragment.from<=t;if(!n.childAfter(i))return!1}}matches(e){let t=this.cursor.tree;for(;t&&t.type.isAnonymous&&t.children[0]instanceof hR;)t=t.children[0];return t&&t.prop(rR.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),r=e.absoluteLineStart,o=r,s=e.block.children.length,a=e.lineStart-e.block.from>>2,l=o,c=s;e:for(;;){if(t.to-n>Math.min(i,e.to)||t.type.isAnonymous&&t.tree&&(t.to-t.from>a||!$N(t.tree))){if(t.type.isAnonymous&&t.firstChild())continue;break}let r=DN(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,r);else{let n=new hR(e.parser.nodeSet.types[AI.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,r)}for((t.type.isAnonymous||t.type.is("Block"))&&(t.type.isAnonymous||RN.indexOf(t.type.id)<0?(o=t.to-n,s=e.block.children.length):(o=l,s=c),l=t.to-n,c=e.block.children.length);;){if(t.nextSibling())continue e;if(!t.parent()||!t.type.isAnonymous)break e}}for(;e.block.children.length>s;)e.block.children.pop(),e.block.positions.pop();return o-r}}function $N(e){for(;e.type.isAnonymous;){let t=e.children[e.children.length-1];if(!(t instanceof hR))return!1;e=t}return e.type.is("Block")&&RN.indexOf(e.type.id)<0}function DN(e,t){let n=e;for(let i=1;i<t.length;i++){let r=t[i-1].to,o=t[i].from;r<e&&(n-=o-r)}return n}const BN=JR({"Blockquote/...":wM.quote,HorizontalRule:wM.contentSeparator,"ATXHeading1/... SetextHeading1/...":wM.heading1,"ATXHeading2/... SetextHeading2/...":wM.heading2,"ATXHeading3/...":wM.heading3,"ATXHeading4/...":wM.heading4,"ATXHeading5/...":wM.heading5,"ATXHeading6/...":wM.heading6,"Comment CommentBlock":wM.comment,Escape:wM.escape,Entity:wM.character,"Emphasis/...":wM.emphasis,"StrongEmphasis/...":wM.strong,"Link/... Image/...":wM.link,"OrderedList/... BulletList/...":wM.list,"BlockQuote/...":wM.quote,"InlineCode CodeText":wM.monospace,"URL Autolink":wM.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":wM.processingInstruction,"CodeInfo LinkLabel":wM.labelName,LinkTitle:wM.string,Paragraph:wM.content}),LN=new aN(new lR(pN).extend(BN),Object.keys(ZI).map(e=>ZI[e]),Object.keys(ZI).map(e=>nN[e]),Object.keys(ZI),iN,$I,Object.keys(SN).map(e=>SN[e]),Object.keys(SN),[]);wM.special(wM.content),wM.processingInstruction,wM.special(wM.content),wM.processingInstruction;const IN={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},NN={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},zN={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function jN(e){return 45==e||46==e||58==e||e>=65&&e<=90||95==e||e>=97&&e<=122||e>=161}let VN=null,FN=null,qN=0;function HN(e,t){let n=e.pos+t;if(qN==n&&FN==e)return VN;let i=e.peek(t),r="";for(;jN(i);)r+=String.fromCharCode(i),i=e.peek(++t);return FN=e,qN=n,VN=r?r.toLowerCase():i==WN||i==QN?void 0:null}const WN=63,QN=33;function XN(e,t){this.name=e,this.parent=t}const GN=[6,10,7,8,9],UN=new KL({start:null,shift:(e,t,n,i)=>GN.indexOf(t)>-1?new XN(HN(i,1)||"",e):e,reduce:(e,t)=>21==t&&e?e.parent:e,reuse(e,t,n,i){let r=t.type.id;return 6==r||37==r?new XN(HN(i,1)||"",e):e},strict:!1}),YN=new zL((e,t)=>{if(60!=e.next)return void(e.next<0&&t.context&&e.acceptToken(58));e.advance();let n=47==e.next;n&&e.advance();let i=HN(e,0);if(void 0===i)return;if(!i)return e.acceptToken(n?15:14);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(11);if(r&&NN[r])return e.acceptToken(58,-2);if(t.dialectEnabled(0))return e.acceptToken(12);for(let e=t.context;e;e=e.parent)if(e.name==i)return;e.acceptToken(13)}else{if("script"==i)return e.acceptToken(7);if("style"==i)return e.acceptToken(8);if("textarea"==i)return e.acceptToken(9);if(IN.hasOwnProperty(i))return e.acceptToken(10);r&&zN[r]&&zN[r][i]?e.acceptToken(58,-1):e.acceptToken(6)}},{contextual:!0}),KN=new zL(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(59);break}if(45==e.next)t++;else{if(62==e.next&&t>=2){n>=3&&e.acceptToken(59,-2);break}t=0}e.advance()}});const ZN=new zL((e,t)=>{if(47==e.next&&62==e.peek(1)){let n=t.dialectEnabled(1)||function(e){for(;e;e=e.parent)if("svg"==e.name||"math"==e.name)return!0;return!1}(t.context);e.acceptToken(n?5:4,2)}else 62==e.next&&e.acceptToken(4,1)});function JN(e,t,n){let i=2+e.length;return new zL(r=>{for(let o=0,s=0,a=0;;a++){if(r.next<0){a&&r.acceptToken(t);break}if(0==o&&60==r.next||1==o&&47==r.next||o>=2&&o<i&&r.next==e.charCodeAt(o-2))o++,s++;else{if(o==i&&62==r.next){a>s?r.acceptToken(t,-s):r.acceptToken(n,-(s-2));break}if((10==r.next||13==r.next)&&a){r.acceptToken(t,1);break}o=s=0}r.advance()}})}const ez=JN("script",55,1),tz=JN("style",56,2),nz=JN("textarea",57,3),iz=JR({"Text RawText IncompleteTag IncompleteCloseTag":wM.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":wM.angleBracket,TagName:wM.tagName,"MismatchedCloseTag/TagName":[wM.tagName,wM.invalid],AttributeName:wM.attributeName,"AttributeValue UnquotedAttributeValue":wM.attributeValue,Is:wM.definitionOperator,"EntityReference CharacterReference":wM.character,Comment:wM.blockComment,ProcessingInst:wM.processingInstruction,DoctypeDecl:wM.documentMeta}),rz=ZL.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:UN,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[iz],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[ez,tz,nz,ZN,YN,KN,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function oz(e){const t=[];return e.iterate({enter:e=>{"EmptyInsert"===e.type.name&&t.push({from:e.from,to:e.to,severity:"warning",message:"this insert is empty and will be ignored",type:"emptyInsert"})}}),t}const sz=125,az=126,lz=4,cz=134,uz=21,pz=141,hz=25,dz=142,fz=43,mz=70,gz=154,vz=73,yz=155,bz=75,wz=156,xz=168,_z=92,Ez=93,Sz=170,kz=100,Oz=172,Cz="undefined"!=typeof process&&process.env&&/\bfparse(:dbg)?\b/.test(process.env.LOG),Pz="undefined"!=typeof process&&process.env&&/\bfparse:dbg\b/.test(process.env.LOG),Az="undefined"!=typeof process&&process.env&&/\bcontext\b/.test(process.env.LOG),Tz=[9,11,12,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Rz=Dz("\n\r"),Mz="*".charCodeAt(0),$z=Dz("'./-+*^");function Dz(e){return Array.from(e).map(e=>e.charCodeAt(0))}function Bz(e){return 63===e||e>=65&&e<=90||95===e||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=55296&&e<=56319||e>=56320&&e<=57343}function Lz(e){return e>=48&&e<=57||183===e||e>=768&&e<=879||e>=8255&&e<=8256}function Iz(e){return Tz.includes(e)}function Nz(e,t){return t.concat(e.split(/\n/g).join("\n"+t))}function zz(e,t=0){const n=e.peek(t);return n===Mz&&e.peek(t+1)===Mz?{offset:2,token:"**"}:(i=n,$z.includes(i)?{offset:1,token:String.fromCharCode(n)}:null);var i}function jz(e,t=0,n=!1){for(let i=!1,r=[],o=0;;o++){const s=e.peek(t+o);if(!(Bz(s)||(i||n)&&Lz(s)))return r.length?{token:String.fromCharCode(...r),offset:o}:null;i||(i=!0),r.push(s)}}function Vz(e,t){for(let n=!1,i=0;;i++){if(!Iz(e.peek(t+i)))return n?{token:" ",offset:i}:null;n||(n=!0)}}const Fz={[sz]:"identifier",[az]:"nameIdentifier"},qz=new zL((e,t)=>{Pz&&console.log("%s: T <identifier | nameIdentifier>",e.pos);const n=function(e,t){const{keys:n,prefixes:i}=t.contextCache(),r=t.tokens;for(let t=0,o=[],s=null;;){const a=r.length+o.length>0,l=o.length>0,c=jz(e,t,a)||a&&zz(e,t)||l&&Vz(e,t);if(!c)return s;const{token:u,offset:p}=c;if(t+=p," "===u)continue;o=[...o,u];const h=[...r,...o].join(" ");if(n.has(h)){const e=o[0];s={token:e,offset:e.length,term:126}}if(!i.has(h)){if(Yz.some(e=>e===h)){const e=o[0];s={token:e,offset:e.length,term:125}}if(!Yz.some(e=>e.startsWith(h)))return s}}}(e,t.context),i=t.context.tokens,r=n||jz(e,0,i.length>0);r&&(e.advance(r.offset),e.acceptToken(n?n.term:125),Cz&&console.log("%s: MATCH <%s> <%s>",e.pos,n?Fz[n.term]:"identifier",r.token))},{contextual:!0}),Hz=new zL((e,t)=>{Pz&&console.log("%s: T <propertyIdentifier>",e.pos);const n=jz(e,0,t.context.tokens.length>0);n&&(e.advance(n.offset),e.acceptToken(124),Cz&&console.log("%s: MATCH <propertyIdentifier> <%s>",e.pos,n.token))}),Wz=new zL((e,t)=>{let n;Pz&&console.log("%s: T <insertSemi>",e.pos);let i=!1;for(n=0;;n++){const t=e.peek(n);if(!Tz.includes(t)){Rz.includes(t)&&(i=!0);break}}if(i){const t=jz(e,n+1);if(Vz(e,n+1)||t&&/^(then|else|return|satisfies)$/.test(t.token))return;Cz&&console.log("%s: MATCH <insertSemi>",e.pos),e.acceptToken(127)}}),Qz={[wz]:"FunctionInvocation",[yz]:"FilterExpression",[gz]:"PathExpression"},Xz={[Oz]:"Context",[Sz]:"FunctionDefinition",[cz]:"ForExpression",[xz]:"List",[pz]:"IfExpression",[dz]:"QuantifiedExpression"},Gz={[kz]:"Context",[Ez]:"FunctionDefinition",[lz]:"ForExpression",[_z]:"List",[uz]:"IfExpression",[hz]:"QuantifiedExpression",[mz]:"PathExpression",[bz]:"FunctionInvocation",[vz]:"FilterExpression",[fz]:"ArithmeticExpression"};class Uz{constructor(e){this.fn=e}get(e){return this.fn(e)}static of(e){return new Uz(e)}}const Yz=Object.keys({"date and time":1,date:1,time:1,duration:1});function Kz(e,t){const n=nj(e),i=function(e){const t=[];for(let n=1;n<=e.length;n++)t.push(e.substring(0,n));return t}(n);t.keys.add(n);for(const e of i)t.prefixes.add(e);return t.originalMap.set(n,e),t}function Zz(e){const t=Jz();for(const n of e.getKeys())Kz(n,t);return t}function Jz(e){return{keys:new Set(e?.keys),prefixes:new Set(e?.prefixes),originalMap:new Map(e?.originalMap)}}class ej{constructor(e={}){this.value=e}getKeys(){return Object.keys(this.value)}get(e){const t=this.value[e],n=this.constructor;return n.isAtomic(t)?t:n.of(t)}set(e,t){return new(0,this.constructor)({...this.value,[e]:t})}merge(e){const t=this.constructor;return new t(t.__merge(this.value,e))}static isAtomic(e){return null==e||e instanceof this||e instanceof Uz||"object"!=typeof e}static of(...e){return new this(e.reduce((e,t)=>this.__merge(e,t),{}))}static __unwrap(e){return e?e instanceof this?e.value:this.isAtomic(e)?{}:e:{}}static __merge(e,t){const n=Object.assign({},this.__unwrap(e));for(const[e,i]of Object.entries(this.__unwrap(t)))i instanceof Uz?n[e]=i:b(n,e)?n[e]=this.__merge(n[e],i):n[e]=i;return n}}class tj{constructor({name:e="Expressions",tokens:t=[],children:n=[],parent:i=null,context:r,value:o,raw:s,__cache:a}){this.name=e,this.tokens=t,this.children=n,this.parent=i,this.context=r,this.value=o,this.raw=s,this.__cache=a}get root(){let e=this;for(;e.parent;)e=e.parent;return e}get cache(){const e=this.root;return e.__cache||(e.__cache=new WeakMap),e.__cache}enterScope(e){const t=this.of({name:e,parent:this});return Az&&console.log("[%s] enter",t.path,t.context),t}exitScope(e){return this.parent?(Az&&console.log("[%s] exit %o\n%s",this.path,this.context,Nz(e," ")),this.parent.pushChild(this)):(Az&&console.log("[%s] NO exit %o\n%s",this.path,this.context,Nz(e," ")),this)}token(e){return Az&&console.log("[%s] token <%s> + <%s>",this.path,this.tokens.join(" "),e),this.assign({tokens:[...this.tokens,e]})}literal(e){return Az&&console.log("[%s] literal %o",this.path,e),this.pushChild(this.of({name:"Literal",value:e}))}computedValue(){for(let e=this;;e=sj(e.children)){if(!e)return null;if(!h(e.value))return e.value}}contextCache(){let e=this.cache.get(this.context);return e||(e=Zz(this.context),this.cache.set(this.context,e)),e}get path(){return this.parent?.path?.concat(" > ",this.name)||this.name}get(e){const t=e&&nj(e),n=this.contextCache().originalMap.get(t);if(void 0===n)return;const i=this.context.get(n);return i instanceof Uz?i.get(this):i}resolveName(e){const t=this.tokens.join(" "),n=this.assign({tokens:[]}),i=this.of({name:e,parent:n,value:this.get(t),raw:t});return Az&&console.log("[%s] resolve %s <%s=%s>",e,i.path,t,i.value),n.pushChild(i)}pushChild(e){if(!e)return this;const t=this.assign({children:[...this.children,e]});return e.parent=t,t}pushChildren(e){let t=this;for(const n of e)t=t.pushChild(n);return t}declareName(){if(0===this.tokens.length)throw Error("no tokens to declare name");const e=this.tokens.join(" ");return Az&&console.log("[%s] declareName <%s>",this.path,e),this.assign({tokens:[]}).pushChild(this.of({name:"Name",value:e}))}define(e,t){if("string"!=typeof e)return Az&&console.log("[%s] no define <%s=%s>",this.path,e,t),this;Az&&console.log("[%s] define <%s=%s>",this.path,e,t);const n=this.context,i=n.set(e,t),r=Kz(e,Jz(this.cache.get(n)||Zz(n)));return this.cache.set(i,r),this.assign({context:i})}assign(e={}){return tj.of({...this,...e})}of(e={}){const t={context:this.context,parent:this.parent};return tj.of({...t,...e})}static of(e){const{name:t,tokens:n=[],children:i=[],parent:r=null,context:o,value:s,raw:a,__cache:l}=e;if(!o)throw new Error("must provide <context>");return new tj({name:t,tokens:[...n],children:[...i],context:o,parent:r,value:s,raw:a,__cache:l})}}function nj(e){return e.replace(/\s*([./\-'+]|\*\*?)\s*/g," $1 ").replace(/\s{2,}/g," ").trim()}function ij(e,t,n){const i=e.children.filter(e=>e.name!==t),r=e.children.filter(e=>e.name===t),o=i[0],s=i[Math.max(1,i.length-1)],a=o?.computedValue(),l=s?.computedValue()??null;return e.assign({children:r}).enterScope(t).pushChildren(i).exitScope(n).define(a,l)}function rj(e={},t=ej){const n=tj.of({context:t.of(e)});return new KL({start:n,reduce(e,n,i,r){if(21===n){const[n,i]=e.children.slice(-2);e=e.assign({value:t.of(n?.computedValue(),i?.computedValue())})}if(92===n&&(e=e.assign({value:t.of(...e.children.map(e=>e?.computedValue()))})),73===n){const[t,n]=e.children.slice(-2);e=e.assign({value:t?.computedValue()})}if(75===n){const[n,...i]=e.children;e="get value"===n?.raw?function(e,t){if(!t.length)return e.assign({value:null});"Name"===t[0].name&&(t=function(e,t){const n={};for(let t=0;t<e.length;t+=2){const[i,r]=e.slice(t,t+2);n[i.value]=r}return t.map(e=>n[e])}(t,["m","key"]));if(2!==t.length)return e.assign({value:null});const[n,i]=t,r=i?.computedValue(),o=n?.computedValue();if(!o||"object"!=typeof o||"string"!=typeof r)return e.assign({value:null});return e.assign({value:[nj(r),r].reduce((e,t)=>o.get(t)||e,null)})}(e,i):e.assign({value:n?.computedValue()||t.of(void 0)})}const o=Xz[n];if(o)return e.enterScope(o);const s=Qz[n];if(s){const{children:i,context:r}=e,o=i.slice(0,-1),a=sj(i);let l=null;return 154===n&&(l=t.of(a?.computedValue())),155===n&&(l=t.of(r,a?.computedValue()).set("item",a?.computedValue())),e.assign({children:o}).enterScope(s).pushChild(a).assign({context:l||r})}const a=r.read(r.pos,i.pos);if(Gz[n])return e.exitScope(a);if(101===n){const n=e.children.filter(e=>"ContextEntry"!==e.name),i=n[0],r=sj(n);return ij(e,"ContextEntry",a).assign({value:t.of(e.value).set(i?.computedValue(),r?.computedValue())})}if(7===n||29===n)return ij(e,"InExpression",a);if(140===n)return e.define("partial",Uz.of(e=>sj(e.children)?.computedValue()));if(79===n){const t=sj(e.children).computedValue();return e.define(t,1)}if(145===n||146===n||147===n){const t=e.children.slice(0,-1),n=sj(e.children);return e.assign({children:t}).enterScope("ArithmeticExpression").pushChild(n)}if(148===n)return e.enterScope("ArithmeticExpression");if(9===n||10===n||104===n)return e.token(a);if(83===n)return e.literal(a.replace(/^"|"$/g,"").replace(/\\(["\\])/g,"$1"));if(84===n)return e.literal("true"===a);if(82===n)return e.literal(parseFloat(a));if(161===n)return e.literal(null);if(49===n)return e.resolveName("VariableName");if(71===n)return e.resolveName("PathName");if(8===n||103===n)return e.declareName();if((131===n||39===n)&&e.tokens.length>0)throw new Error("uncleared name");if(131===n){let t=e;for(;t.parent;)t=t.exitScope(a);return t}return e}})}const oj=rj({});function sj(e){return e[e.length-1]}const aj=JR({StringLiteral:wM.string,NumericLiteral:wM.number,BooleanLiteral:wM.bool,"AtLiteral!":wM.special(wM.string),CompareOp:wM.compareOperator,ArithOp:wM.arithmeticOperator,"for if then else some every return":wM.controlKeyword,"in instance of and or satisfies between as":wM.operatorKeyword,function:wM.definitionKeyword,"Type/...":wM.typeName,"Wildcard!":wM.modifier,null:wM.null,LineComment:wM.lineComment,BlockComment:wM.blockComment,"VariableName!":wM.variableName,'"?"':wM.self,"DateTimeConstructor! SpecialFunctionName!":wM.standard(wM.function(wM.variableName)),"FunctionInvocation/VariableName!":wM.function(wM.variableName),"Name!":wM.definition(wM.variableName),"Key/Name! ContextEntryType/Name!":wM.definition(wM.propertyName),"PathExpression/PathName!":wM.propertyName,"FormalParameter/ParameterName!":wM.function(wM.definition(wM.variableName)),"( )":wM.paren,"[ ]":wM.squareBracket,"{ }":wM.brace,".":wM.derefOperator,", ;":wM.separator,"..":wM.punctuation}),lj={__proto__:null,for:10,in:34,return:40,if:44,then:46,else:48,some:52,every:54,satisfies:60,or:64,and:68,between:76,instance:90,of:93,days:105,time:107,duration:109,years:111,months:113,date:115,list:121,context:127,function:134,null:162,true:332,false:332,"?":176,external:192,not:217},cj=ZL.deserialize({version:14,states:"CvO`QYOOO`QYOOO$yQYOOOOQU'#Ce'#CeO%TQYO'#C`O&^QYO'#FTOOQQ'#Ff'#FfO&hQYO'#FfO`QYO'#DXOOQU'#Eq'#EqO(_Q^O'#D_OOQU'#D`'#D`OOQU'#D_'#D_OOQO'#Fn'#FnO*[QWO'#DyOOQQ'#EQ'#EQOOQQ'#ER'#EROOQQ'#ES'#ESO*aOWO'#EVO*[QWO'#ETOOQQ'#ET'#ETOOQQ'#Ft'#FtOOQQ'#Fr'#FrOOQQ'#Fz'#FzOOQQ'#EX'#EXO`QYO'#EZOOQQ'#FV'#FVO*iQ^O'#FVO,`QYO'#E[O,gQWO'#E]OOQP'#GO'#GOO,lQXO'#EdOOQQ'#F{'#F{OOQQ'#FU'#FUQOQWOOOOQQ'#FW'#FWOOQQ'#F_'#F_O`QYO'#CqOOQQ'#F`'#F`O%TQYO'#CuO,zQYO'#DzOOQQ'#Fs'#FsO-PQYO'#EUOOQO'#EU'#EUO`QYO'#EYO`QYO'#EXOOQO'#F|'#F|Q-XQWOOO-^QYO'#DTO.TQWO'#FbOOQO'#DV'#DVO.`QYO'#FfO.gQWOOO/^QYO'#CdO/kQYO'#FYOOQQ'#Cc'#CcO/pQYO'#FXOOQQ'#Cb'#CbO/xQYO,58zO`QYO,59kOOQQ'#Fc'#FcOOQQ'#Fd'#FdOOQQ'#Fe'#FeO`QYO,59sO`QYO,59sO`QYO,59sOOQQ'#Fl'#FlO/}QYO,5:`OOQQ'#Fm'#FmO`QYO,5:cO`QYO,59gO`QYO,59iO`QYO,59kO1|QYO,59kO2TQYO,59tOOQQ,5:l,5:lO2YQYO,59sOOQU-E8o-E8oO3|QYO'#FoOOQQ,5:e,5:eOOQQ,5:q,5:qOOQQ,5:o,5:oO4TQYO,5:uOOQQ,5;q,5;qO4_QYO,5:tO4lQWO,5:vO4qQYO,5:wOOQP'#Eh'#EhO5hQXO'#EgOOQO'#Ef'#EfO5oQWO'#EeO5tQWO'#GPO5|QWO,5;OO6RQYO,59]OOQQ'#Cy'#CyO6YQYO'#FaOOQQ'#Cx'#CxO6bQYO,59aO6gQYO,5:fO6lQYO,5:pO6qQYO,5:tO6xQYO,5:sO`QYO'#EzQ-XQWOOO`QYO'#EpO7oQWO,5;|O`QYOOOOQR'#Cf'#CfOOQQ'#Em'#EmO8iQYO,59OO`QYO,5;tOOQQ'#F['#F[O%TQYO'#EnO8yQYO,5;sO`QYO1G.fOOQQ'#F^'#F^O9pQYO1G/VO<gQYO1G/_O<qQYO1G/_O<{QYO1G/_O>oQYO'#DuOOQQ'#Du'#DuOOQQ1G/z1G/zO@iQYO1G/}O@pQYO1G/ROAyQYO1G/TOCSQYO1G/VO`QYO1G/VOOQQ1G/V1G/VOCjQYO1G/`ODXQ^O'#CdOEkQYO'#FqOOQO'#D}'#D}OEuQWO'#D|OEzQWO'#FpOOQO'#D{'#D{OOQO'#EO'#EOOFSQWO,5<ZOOQQ1G0a1G0aO`QYO1G0`O`QYO'#EvOFXQWO,5<]OOQQ1G0b1G0bOFdQWO'#E_OFoQWO'#F}OOQO'#E^'#E^OFwQWO1G0cOOQP'#Ex'#ExOF|QXO,5;RO`QYO,5;POGTQXO'#EyOG`QWO,5<kOOQQ1G0j1G0jO`QYO1G.wO%TQYO'#EoOGhQYO,5;{O`QYO1G.{OGpQYO1G0QOOQO1G0[1G0[OOQO,5;f,5;fOOQO-E8x-E8xOOQO,5;[,5;[OOQO-E8n-E8nOGuQWOOOOQQ-E8k-E8kOGzQYO'#CnOOQQ1G1`1G1`OOQQ,5;Y,5;YOOQQ-E8l-E8lOH[QYO7+$QOOQQ7+%i7+%iO`QYO7+$qOIRQYO,5:uOI`QWO7+$qOIeQYO'#D^OOQQ'#D]'#D]OKXQYO'#DaOK^QYO'#DaOKcQYO'#DaOKhQ`O'#DiOKmQ`O'#DlOKrQ`O'#DpOOQQ7+$z7+$zO`QYO,5:hO%TQYO'#EuOKwQWO,5<[OOQQ1G1u1G1uOL}QYO7+%zOM[QYO,5;bOOQO-E8t-E8tOCjQYO,5:yO%TQYO'#EwOMiQWO,5<iOMqQYO7+%}OOQP-E8v-E8vOMxQYO1G0kOOQO,5;e,5;eOOQO-E8w-E8wONSQYO7+$cOOQQ,5;Z,5;ZOOQQ-E8m-E8mONZQYO7+$gOOQO7+%l7+%lO`QYO,59YO! QQYO<<H]OOQQ<<H]<<H]O/}QYO'#ErO!!ZQYO,59xO!#}QYO,59{O!$SQYO,59{O!$XQYO,59{O!$^QYO,5:TO%TQYO,5:WO!${QbO,5:[O!%SQYO1G0SOOQO,5;a,5;aOOQO-E8s-E8sO!%^QYO<<IfOOQQ<<If<<IfOOQO1G0e1G0eOOQO,5;c,5;cOOQO-E8u-E8uO!(`QYO'#EaOOQQ<<Ii<<IiO`QYO<<IiO`QYO<<G}O!)VQYO1G.tOOQQ,5;^,5;^OOQQ-E8p-E8pO!)dQYO1G/gOOQQ1G/g1G/gO!)iQbO'#D_O!)zQ`O'#D^O!*VQ`O1G/oO!*[QWO'#DoO!*aQ`O'#FhOOQO'#Dn'#DnO!*iQ`O1G/rOOQO'#Ds'#DsO!*nQ`O'#FjOOQO'#Dr'#DrO!*vQ`O1G/vOOQQAN?TAN?TO!*{QYOAN=iOOQQ7+%R7+%RO!+rQ`O,59xOOQQ7+%Z7+%ZO!$^QYO,5:ZO%TQYO'#EsO!+}Q`O,5<SOOQQ7+%^7+%^O!$^QYO'#EtO!,VQ`O,5<UO!,_Q`O7+%bOOQO1G/u1G/uOOQO,5;_,5;_OOQO-E8q-E8qOOQO,5;`,5;`OOQO-E8r-E8rOCjQYO<<H|OOQQAN>hAN>hO/}QYO'#ErO!$^QYO<<H|O!,dQ`O7+%bO!,iQ`O1G/vO!${QbO,5:[O!,nQ`O'#Dp",stateData:"!-R~O#uOS#vOSPOSQOS~OTsO[VO]UOftOjvOkvOt}Ou}OxiO!V{O!W{O!XxO!ZzO!e!OO!j|O!lgO!syO!zjO#VnO#qRO#rRO$ZZO$i_O$j`O$k`O$laO$mbO~OTsO]UOftOjvOkvOt}Ou}OxiO!V{O!W{O!XxO!ZzO!e!OO!j|O!lgO!syO!zjO#VnO#qRO#rRO$ZZO$i_O$j`O$k`O$laO$mbO~O[!TO#`!UO~P#VO#qRO#rRO~OZ!dO[!^O]!^O^!_O_!_O`!`Oa!kOp!hOr!iOt!]Ou!]Ov!jO}!lO!l!fOx$bX~O#o#wX$t#wX~P%]O$i!mOT$YX[$YX]$YXf$YXj$YXk$YXt$YXu$YXx$YX!V$YX!W$YX!X$YX!Z$YX!e$YX!j$YX!l$YX!s$YX!z$YX#V$YX#q$YX#r$YX$Z$YX$j$YX$k$YX$l$YX$m$YX~O#qRO#rROZ!RX[!RX]!RX^!RX_!RX`!RXa!RXp!RXr!RXt!RXu!RXv!RXx!RX}!RX!l!RX#o!RX#s!RX$t!RX$P!RXc!RXz!RX!j!RXg!RXd!RX#U!RXh!RXn!RX~Ox!pO~O$j`O$k`O~O#s!uOZ#yX[#yX]#yX^#yX_#yX`#yXa#yXp#yXr#yXt#yXu#yXv#yXx#yX}#yX!l#yX#o#yX$t#yX$P#yXc#yXz#yX!j#yXg#yXd#yX#U#yXh#yXn#yX~O!j$eP~P`Ox!xO~O#p!yO$j`O$k`O#U$sP~Or#UO~Or#VOx!xX~O$t#YO~O#owX$PwX$twXzwXcwX!jwXgwXdwX#UwXhwXnwX~P%]O$P#[O#o$UXz$UX~O#o#_X~P&hOx#^O~OZ#_O[#_O]#_O^#_O_#_O`#_O#qRO#rRO#}#_O$]WX~OaWXzWX$PWX~P.lOa#cO~O$P#dOd#{X~Od#gO~O#qRO#rRO$ZZO~OTsO[VO]UOftOjvOkvOt}Ou}O!V{O!W{O!XxO!ZzO!e!OO!j|O!lgO!syO!zjO#VnO#qRO#rRO$ZZO$i_O$j`O$k`O$laO$mbO~Ox#sO~P0YO!O#uO~OZ!dO}!lO!l!fO[{a]{a^{a_{a`{aa{ap{ar{at{au{av{ax$bX#o{a$t{a$P{ac{az{a!j{ag{ad{a#U{ah{an{a~Oz$eP~P`Oc$POz$OO~P%]Oc$PO$P$QO!j$eX~P%]O!j$SO~O#qRO#rROz$qP~OZ#_O[#_O]#_O^#_O_#_O`#_O#p!yO#}#_O~O$]#ZX~P4|O$]$ZO~O$P$[O#U$sX~O#U$^O~Og$_O~P%]O$P$`On$TX~On$bO~O!Y$cO~O!V$dO~Oc$PO~P%]O#o!{a$t!{a$P!{ac!{az!{a!j!{ag!{ad!{a#U!{ah!{an!{a~P%]O$P#[O#o$Uaz$Ua~OZ#_O[#_O]#_O^#_O_#_O`#_O#qRO#rRO#}#_O~OaWa$]WazWa$PWa~P7zO$P#dOd#{a~OZ!dO[!^O]!^O^!_O_!_O`!`O}!lO!l!fOx$bX~Oasipsirsitsiusivsi#osi$tsi$Psicsizsi!jsigsidsi#Usihsinsi~P9ROZ!dO`!`O}!lO!l!fO[{i]{ia{ip{ir{it{iu{iv{ix$bX#o{i$t{i$P{ic{iz{i!j{ig{id{i#U{ih{in{i~O^!_O_!_O~P:yO^{i_{i~P:yOZ!dO}!lO!l!fO[{i]{i^{i_{i`{ia{ip{ir{it{iu{iv{ix$bX#o{i$t{i$P{ic{iz{i!j{ig{id{i#U{ih{in{i~O#qRO#rROZ!iX[!iX]!iX^!iX_!iX`!iXa!iXp!iXr!iXt!iXu!iXv!iXx!iX}!iX!l!iX#o!iX$t!iX$P!iXc!iXz!iX!j!iXg!iXd!iX#U!iXh!iXn!iX~O!j$pO~P%]Oa!kOr!iOt!]Ou!]Ov!jOpoi#ooi$toi$Poicoizoi!joigoidoi#Uoihoinoi~P9ROa!kOt!]Ou!]Ov!jOpqirqi#oqi$tqi$Pqicqizqi!jqigqidqi#Uqihqinqi~P9ROa!kOp!hOr$qOt!]Ou!]Ov!jO~P9RO!U$vO!X$wO!Z$xO!^$yO!a$zO!e${O#qRO#rRO$ZZO~OZ#eX[#eX]#eX^#eX_#eX`#eXa#eXp#eXr#eXt#eXu#eXv#eXx#eXz#eX}#eX!l#eX#q#eX#r#eX#s#eX$P#eX~P.lO$P$QOz$eX~P%]O$]$}O~O$P%OOz$dX~Oz%QO~O$P$QO!j$eaz$ea~O$]%UOz#RX$P#RX~O$P%VOz$qX~Oz%XO~O$]#Za~P4|O#p!yO$j`O$k`O~O$P$[O#U$sa~O$P$`On$Ta~O!W%bO~OzrO~Oc%cOdbX$PbXnbX~P%]O#oSq$tSq$PSqcSqzSq!jSqgSqdSq#USqhSqnSq~P%]Oc$POz$OO$PwX~P%]Oz%eO~OZ%fO[!QX]!QX^!QX_!QX`!QXa!QXp!QXr!QXt!QXu!QXv!QXx!QX}!QX!l!QX#o!QX$t!QX$P!QXc!QXz!QX!j!QXg!QXd!QX#U!QXh!QXn!QX~Or%hO~Or%iO~Or%jO~O!_%kO~O!_%lO~O!_%mO~O$P%OOz$da~OZ!dO[!^O]!^O^!_O_!_O`!`Oa!kOp!hOr!iOt!]Ou!]Ov!jO}!lOx$bX~Oz%rO!j%rO!l%qO~PLPO!j#ja$P#jaz#ja~P%]O$P%VOz$qa~O#S%xO~P`O#U#Xi$P#Xi~P%]Oh%yO~P%]O#oiq$tiq$Piqciqziq!jiqgiqdiq#Uiqhiqniq~P%]Oasypsyrsytsyusyvsy#osy$tsy$Psycsyzsy!jsygsydsy#Usyhsynsy~P9ROZ%fO[!Qa]!Qa^!Qa_!Qa`!Qaa!Qap!Qar!Qat!Qau!Qav!Qax!Qa}!Qa!l!Qa#o!Qa$t!Qa$P!Qac!Qaz!Qa!j!Qag!Qad!Qa#U!Qah!Qan!Qa~O!V%}O~O!Y%}O~O!V&OO~O!U$vO!X$wO!Z$xO!^$yO!a$zO!e&tO#qRO#rRO$ZZO~O![$^P~P!$^Oz!pi$P!pi~P%]OT$aXZ!|y[$aX]$aX^!|y_!|y`!|ya!|yf$aXj$aXk$aXp!|yr!|yt$aXu$aXv!|yx$aX}!|y!V$aX!W$aX!X$aX!Z$aX!e$aX!j$aX!l$aX!s$aX!z$aX#V$aX#o!|y#q$aX#r$aX$Z$aX$i$aX$j$aX$k$aX$l$aX$m$aX$t!|y$P!|yc!|yz!|yg!|yd!|y#U!|yh!|yn!|y~O#o#TX$t#TX$P#TXc#TXz#TX!j#TXg#TXd#TX#U#TXh#TXn#TX~P%]Odbi$Pbinbi~P%]O!W&^O~O#qRO#rROZ!RX![!RX$P!RX~OZ&oO![!QX$P!QX~O![&`O~O$]&aO~O$P&bO![$[X~O![&dO~O$P&eO![$^X~O![&gO~O#oe!R$te!R$Pe!Rce!Rze!R!je!Rge!Rde!R#Ue!Rhe!Rne!R~P%]OZ&oO![!Qa$P!Qa~O$P&bO![$[a~O$P&eO![$^a~O$_&mO~O$_&pO~O![&qO~O!_&sO~O$Z$j~$j$k`_$iZQP^Q~",goto:"E`$tPPPP$uP%m%p%v&W'qPPPPPPP'zPP$uPPP$uPP'}(QP$uP$uP$uPPP(WP(cP$u$uPP(l)R)^*g)RPPPPPPP)RPP)RP+m+p)RP+v+|$u,TP$uP$u,W-O-R-X-OP-a.X-a-a/W0OP$u0v$u1n1n2f2iP2oPP1n2u2{/S3PPP3XP3[3c3i3o3u5S5^5d5j5p5w5}6T6ZPPPPPPPP6a6j8n9f:^:aP:iP:l:o;g<_<b<g=T=r>bP?YP?]P?a@R@sAkAqAt$uAzAzPPPPPBr8nCjDbDeE]!kjOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR![SQ!YSR$m#dW!WSw#d$`W#x!p!x%O%VT&S%l&b#WXOPQWYilu|}!]!a!b!c!e!g!h!i!j!k#Y#[#^#b#f#l#s#u$P$Q$Z$_$b$q$}%U%X%c%f%k%m%x%y&P&a&e&m&o&p&sb!VSw!x#d$`%O%V%l&bU#`!V#a#vR#v!pU#`!V#a#vT$X!z$YR$l#bR#TwQ#RwR%_$`U!RQ#^#sQ#t!kR$g#[QrQQ$i#^R$s#sQ$|#uQ%s%UQ&R%kU&W%m&e&sQ&h&aT&n&m&pc$u#u%U%k%m&a&e&m&p&s!jkOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yU$t#u%U&mS%{%f&o]&Q%k%m&a&e&p&s#Q[OPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s#u$P$Q$Z$_$b$q$}%U%X%c%f%k%m%x%y&a&e&m&o&p&sR#m!eR&V%lQ&T%lR&i&bQ&Z%mR&r&sS&X%m&sR&k&eR#n!e!k]OPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR#}!pQ#z!pR%o%OS#y!p%OT$T!x%V!keOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%y!jeOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yQ!rbT!{o$[!kcOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%y!kdOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%y!khOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%y!kpOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR$W!xQ$U!xR%t%VQ%w%XR&[%xQ!}oR%[$[T!|o$[S!zo$[T$X!z$YRrQS#a!V#vR$j#aQ#e!YR$n#eQ$a#RR%`$aQ#]!RR$h#]!rYOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s#u$P$Q$Z$_$b$q$}%U%X%c%f%x%y&mU!oY#l&PQ#l!e_&P%k%m&a&e&o&p&sQ%g$tS%|%g&_R&_&QQ&c&TR&j&cQ&f&XR&l&fQ%P#zR%p%PS$R!v#wR%T$RQ%W$UR%u%WQ$Y!zR%Y$YQ$]!}R%]$]Q#Z!PR$f#ZQrOQ!PPR$e#YUTOP#YW!QQ!k#[#^Q!nWQ!tiQ!vlQ#PuQ#W|Q#X}Q#h!]Q#i!aQ#j!bQ#k!cQ#o!gQ#p!hQ#q!iQ#r!jQ#w!pQ$k#bQ$o#fQ$r#sQ%R$PQ%S$QQ%Z$ZQ%^$_Q%a$bQ%d$qQ%n$}S%v%X%xQ%z%cR&]%y!kqOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%y!kSOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR!ZSS!XS#dT#Qw$`R#b!WR#f![!kuOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%y!kwOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR#SwV!SQ#^#s!V!aT!Q!t!v#P#W#X#h#o#p#q#r#w$k$o$r%R%S%Z%^%a%d%n%v%z&]!X!bT!Q!t!v#P#W#X#h#i#o#p#q#r#w$k$o$r%R%S%Z%^%a%d%n%v%z&]!Z!cT!Q!t!v#P#W#X#h#i#j#o#p#q#r#w$k$o$r%R%S%Z%^%a%d%n%v%z&]!kWOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR&U%lT&Y%m&s!_!eT!Q!n!t!v#P#W#X#h#i#j#k#o#p#q#r#w$k$o$r%R%S%Z%^%a%d%n%v%z&]!_!gT!Q!n!t!v#P#W#X#h#i#j#k#o#p#q#r#w$k$o$r%R%S%Z%^%a%d%n%v%z&]!k^OPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yQ!q^R!scR#{!pQ!wlR#|!p!kfOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%y!klOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%y!kmOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR$V!x!koOPQWilu|}!]!a!b!c!g!h!i!j!k!p#Y#[#^#b#f#s$P$Q$Z$_$b$q$}%X%c%x%yR#Oo",nodeNames:"⚠ LineComment BlockComment Expression ForExpression for InExpressions InExpression Name Identifier Identifier . ArithOp ArithOp ArithOp ArithOp ArithOp in IterationContext .. return IfExpression if then else QuantifiedExpression some every InExpressions InExpression satisfies Disjunction or Conjunction and Comparison CompareOp CompareOp between PositiveUnaryTest ( PositiveUnaryTests ) ArithmeticExpression InstanceOfExpression instance of Type QualifiedName VariableName BacktickIdentifier SpecialType days time duration years months date > ListType list < ContextType context ContextEntryTypes ContextEntryType FunctionType function ArgumentTypes ArgumentType PathExpression PathName ] FilterExpression [ FunctionInvocation SpecialFunctionName NamedParameters NamedParameter ParameterName PositionalParameters null NumericLiteral StringLiteral BooleanLiteral DateTimeLiteral DateTimeConstructor AtLiteral ? SimplePositiveUnaryTest Interval ParenthesizedExpression List FunctionDefinition FormalParameters FormalParameter external FunctionBody } { Context ContextEntry Key Name Identifier Expressions UnaryTests Wildcard not",maxTerm:174,context:oj,nodeProps:[["group",-17,4,21,25,31,33,35,43,44,70,73,75,88,89,91,92,93,100,"Expr",49,"Expr Expr",-5,81,82,83,84,85,"Expr Literal"],["closedBy",40,")",74,"]",99,"}"],["openedBy",42,"(",72,"[",98,"{"]],propSources:[aj],skippedNodes:[0,1,2],repeatNodeCount:14,tokenData:".v~RvXY#iYZ$^Z[#i]^$^pq#iqr$crs$nwx(Wxy(]yz(bz{(g{|(t|}(y}!O)O!O!P)]!P!Q*g!Q![,b![!],y!]!^-O!^!_-T!_!`$i!`!a-d!b!c-n!}#O-s#P#Q-x#Q#R(o#S#T-}#o#p.l#q#r.q$f$g#i#BY#BZ#i$IS$I_#i$I|$I}$^$I}$JO$^$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~#nY#u~XY#iZ[#ipq#i$f$g#i#BY#BZ#i$IS$I_#i$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~$cO#v~~$fP!_!`$i~$nOt~~$qXOY$nYZ%^Zr$nrs&zs#O$n#O#P'R#P;'S$n;'S;=`(Q<%lO$n~%aVOr%^rs%vs#O%^#O#P%{#P;'S%^;'S;=`&t<%lO%^~%{O$j~~&ORO;'S%^;'S;=`&X;=`O%^~&[WOr%^rs%vs#O%^#O#P%{#P;'S%^;'S;=`&t;=`<%l%^<%lO%^~&wP;=`<%l%^~'RO$j~$k~~'URO;'S$n;'S;=`'_;=`O$n~'bYOY$nYZ%^Zr$nrs&zs#O$n#O#P'R#P;'S$n;'S;=`(Q;=`<%l$n<%lO$n~(TP;=`<%l$n~(]O#}~~(bOx~~(gOz~~(lP_~z{(o~(tO`~~(yO]~~)OO$P~R)TP[P!`!a)WQ)]O$_Q~)bQZ~!O!P)h!Q![)m~)mOc~~)rR$i~!Q![)m!g!h){#X#Y){~*OR{|*X}!O*X!Q![*_~*[P!Q![*_~*dP$i~!Q![*_~*lQ^~z{*r!P!Q+y~*uTOz*rz{+U{;'S*r;'S;=`+s<%lO*r~+XVOz*rz{+U{!P*r!P!Q+n!Q;'S*r;'S;=`+s<%lO*r~+sOQ~~+vP;=`<%l*r~,OSP~OY+yZ;'S+y;'S;=`,[<%lO+y~,_P;=`<%l+y~,gS$i~!O!P,s!Q![,b!g!h){#X#Y){~,vP!Q![)m~-OO$]~~-TO$t~R-[P!_QuP!_!`-_P-dOuPR-kP![QuP!_!`-_~-sO$m~~-xO!l~~-}O!j~~.QTO#S-}#S#T.a#T;'S-};'S;=`.f<%lO-}~.fO$Z~~.iP;=`<%l-}~.qO#V~~.vO#U~",tokenizers:[Hz,qz,Wz,0,1],topRules:{Expression:[0,3],Expressions:[1,105],UnaryTests:[2,106]},dialects:{camunda:2657},dynamicPrecedences:{33:-1,70:1,75:-1,77:-1},specialized:[{term:125,get:e=>lj[e]||-1}],tokenPrec:2660});function uj(e,t){return function(e){return e.replace(/^`|`$/g,"")}(t.substring(e.from,e.to))}function pj(e,t){return t.some(t=>t.has(e))}function hj(e,t,n){const i=new Set(t);e.push(i);const r=n(i);return e.pop(),r}function dj(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling}function fj(e,t){const n=[];return dj(e,e=>{"PathExpression"===e.name?n.push(...fj(e,t)):"VariableName"!==e.name&&"PathName"!==e.name||n.push(uj(e,t))}),n}function mj(e){const t=e.firstChild;return t?"FilterExpression"===t.name?t:"PathExpression"===t.name?mj(t):null:null}function gj(e){const t=e.firstChild;return!!t&&("Context"===t.name||"PathExpression"===t.name&&gj(t))}function vj(e,t){const n=[];return dj(e,e=>{if("ContextEntry"===e.name){const i=e.getChild("Key")?.getChild("Name");i&&n.push(uj(i,t))}}),n}function yj(e,t){const n=[],i=e.getChild("InExpressions");return i&&dj(i,e=>{if("InExpression"===e.name){const i=e.getChild("Name")?.getChild("Identifier");i&&n.push(t.substring(i.from,i.to))}}),n}function bj(e,t){const n=[],i=e.getChild("FormalParameters");return i&&dj(i,e=>{if("FormalParameter"===e.name){const i=e.getChild("ParameterName")?.getChild("Name")?.getChild("Identifier");i&&n.push(t.substring(i.from,i.to))}}),n}function wj(e,t){return e.find(e=>e.name===t)}function xj(e,t){const n=function(e,t){let n=wj(e,t);return n||(n={name:t},e.push(n)),n}(e,t[0]);if(t.length<=1)return;if(n.type||(n.type="Context",n.entries=n.entries||[]),"Context"!==n.type)return;let i=n.entries;for(let e=1;e<t.length;e++){const n=t[e],r=e===t.length-1;let o=wj(i,n);o?r||o.type||(o.type="Context",o.entries=o.entries||[]):(o=r?{name:n}:{name:n,type:"Context",entries:[]},i.push(o)),r||(o.entries=o.entries||[],i=o.entries)}}function _j(e){if(e.entries){e.entries.sort((e,t)=>e.name.localeCompare(t.name));for(const t of e.entries)_j(t)}}const Ej=new Set(["for","return","some","every","InExpressions","satisfies"]);function Sj(e,t,n){const i=new Set,r=[new Set];function o(e,t){return!(pj(e,r)||n.has(e)||"none"!==t&&"item"===e)}const s=(e,n="none")=>{const{name:a}=e;if(!e.type.isError){if("FunctionInvocation"===a){const r=e.getChild("VariableName");if(r){const e=uj(r,t);o(e,n)&&i.add(e)}return void dj(e,e=>{"VariableName"!==e.name&&"("!==e.name&&")"!==e.name&&s(e,n)})}if("PathExpression"===a){const r=mj(e);if(gj(e))dj(e,e=>s(e,n));else if(r)s(r,n);else{const r=fj(e,t);r.length>0&&o(r[0],n)&&i.add(r.join("."))}return}if("VariableName"===a&&"PathExpression"!==e.parent?.name&&"FunctionInvocation"!==e.parent?.name){const r=uj(e,t),s="variable-list"===n&&"item"!==r;return void(o(r,n)&&!s&&i.add(r))}if("Context"!==a||"List"===e.parent?.name){if("FilterExpression"===a){let n="none";const i=["item"],o=e.getChild("List");return o?(dj(o,e=>{"Context"===e.name&&i.push(...vj(e,t))}),n="list-literal"):dj(e,e=>{"VariableName"===e.name&&(s(e,"none"),n="variable-list")}),void hj(r,i,()=>{dj(e,e=>{"Comparison"!==e.name&&"Expression"!==e.name||s(e,n)})})}if("ForExpression"===a||"QuantifiedExpression"===a){const i=yj(e,t),o=e.getChild("InExpressions");return o&&dj(o,e=>{"InExpression"===e.name&&dj(e,e=>{"Name"!==e.name&&"in"!==e.name&&"Identifier"!==e.name&&s(e,n)})}),void hj(r,i,()=>{dj(e,e=>{Ej.has(e.name)||s(e,"none")})})}if("FunctionDefinition"===a){const n=bj(e,t);return void hj(r,n,()=>{const t=e.getChild("FunctionBody");t&&s(t,"none")})}dj(e,e=>s(e,n))}else hj(r,[],i=>{dj(e,e=>{if("ContextEntry"===e.name){dj(e,e=>{"Key"!==e.name&&s(e,n)});const r=e.getChild("Key")?.getChild("Name");r&&i.add(uj(r,t))}})})}};return s(e),Array.from(i).sort()}function kj(e){let t=!1,n=!1;return dj(e,e=>{if("StringLiteral"===e.name)t=!0;else if("NumericLiteral"===e.name)n=!0;else if("ArithmeticExpression"===e.name){const i=kj(e);t=t||i.hasString,n=n||i.hasNumber}}),{hasString:t,hasNumber:n}}function Oj(e,t,n,i,r){if("VariableName"===e.name&&"PathExpression"!==e.parent?.name){const o=uj(e,t),s=wj(n,o);pj(o,i)||!s||s.type||(s.type=r)}else if("PathExpression"===e.name){const o=fj(e,t);if(o.length>0){const e=o[0],t=wj(n,e);pj(e,i)||!t||t.type||(t.type=r)}}else dj(e,e=>{Oj(e,t,n,i,r)})}function Cj(e,t,n,i,r){if("VariableName"!==e.name)return;const o=uj(e,n),s=wj(i,o);if(pj(o,r)||!s)return;if(s.type)return;const a={NumericLiteral:"Number",StringLiteral:"String",BooleanLiteral:"Boolean"}[t.name];a&&(s.type=a)}function Pj(e,t,n,i,r="none"){const{name:o}=e;if("PathExpression"===o){const o=e.firstChild;if("Context"===o?.name||"PathExpression"===o?.name||"FilterExpression"===o?.name)return void Pj(o,t,n,i,r);const s=fj(e,t);if(s.length>0){const e=s[0];pj(e,i)||"none"!==r&&"item"===e||!wj(n,e)||xj(n,s)}return}if("Context"!==o||"List"===e.parent?.name){if("FilterExpression"===o){let r="none",o=null;const s=["item"],a=e.getChild("List");return a?(dj(a,e=>{"Context"===e.name&&s.push(...vj(e,t))}),r="list-literal"):dj(e,e=>{if("VariableName"===e.name){o=uj(e,t);const s=wj(n,o);!pj(o,i)&&s&&(s.type||(s.type="List")),r="variable-list"}}),void hj(i,s,()=>{dj(e,e=>{"Comparison"!==e.name&&"Expression"!==e.name||(!function(e,t,n,i,r){const o=n?wj(i,n):null;if(!o)return;const s=e=>{if("List"===o.type){if("PathExpression"===e.name){const n=fj(e,t);if(n.length>1&&"item"===n[0]){const e=o.entries||[];for(let t=1;t<n.length;t++)wj(e,n[t])||e.push({name:n[t]});o.entries=e}}else if("VariableName"===e.name){const n=uj(e,t);if(!pj(n,r)&&"item"!==n&&"PathExpression"!==e.parent?.name){const e=o.entries||[];wj(e,n)||e.push({name:n}),o.entries=e}}dj(e,s)}};s(e)}(e,t,o,n,i),Pj(e,t,n,i,r))})})}if("Comparison"===o){const r=[];dj(e,e=>{"CompareOp"!==e.name&&r.push(e)}),2===r.length&&(Cj(r[0],r[1],t,n,i),Cj(r[1],r[0],t,n,i))}if("ArithmeticExpression"===o){const{hasString:o,hasNumber:s}=kj(e),a=o&&!s?"String":!o&&s?"Number":null;return a&&Oj(e,t,n,i,a),void dj(e,e=>{["ArithmeticExpression","ArithOp","NumericLiteral","StringLiteral"].includes(e.name)||Pj(e,t,n,i,r)})}if("ForExpression"===o||"QuantifiedExpression"===o){const o=yj(e,t),s=e.getChild("InExpressions");return s&&dj(s,e=>{"InExpression"===e.name&&dj(e,e=>{["Name","in","Identifier"].includes(e.name)||Pj(e,t,n,i,r)})}),void hj(i,o,()=>{dj(e,e=>{Ej.has(e.name)||Pj(e,t,n,i,"none")})})}if("FunctionDefinition"===o){const r=bj(e,t);return void hj(i,r,()=>{const r=e.getChild("FunctionBody");r&&Pj(r,t,n,i,"none")})}dj(e,e=>{Pj(e,t,n,i,r)})}else hj(i,[],o=>{dj(e,e=>{if("ContextEntry"===e.name){dj(e,e=>{"Key"!==e.name&&Pj(e,t,n,i,r)});const s=e.getChild("Key")?.getChild("Name");s&&o.add(uj(s,t))}})})}function Aj(e,t,n){const i=function(e){const t=[];for(const n of e)xj(t,n.split("."));return t}(Sj(e,t,n));Pj(e,t,i,[new Set]);for(const e of i)_j(e);return i.sort((e,t)=>e.name.localeCompare(t.name)),i}const Tj=new Set(["for","return","some","every","InExpressions","satisfies"]);function Rj(e,t,n){const i=[],r=[],o=e=>{const{name:s}=e;if("Context"!==s){if("FunctionDefinition"===s){const n=bj(e,t);return void hj(r,n,()=>{const t=e.getChild("FunctionBody");t&&o(t)})}if("ForExpression"===s||"QuantifiedExpression"===s){const n=e.getChild("InExpressions");return n&&dj(n,e=>{"InExpression"===e.name&&dj(e,e=>{"Name"!==e.name&&"in"!==e.name&&"Identifier"!==e.name&&o(e)})}),void hj(r,yj(e,t),()=>{dj(e,e=>{Tj.has(e.name)||o(e)})})}if("FunctionInvocation"===s){const o=e.getChild("VariableName");o&&(e=>{const o=uj(e,t),s=!pj(o,r)&&n.has(o)?"builtin":"user",{from:a,to:l}=e;i.push({name:o,type:s,from:a,to:l})})(o)}dj(e,o)}else hj(r,[],n=>{dj(e,e=>{if("ContextEntry"!==e.name)return;dj(e,e=>{"Key"!==e.name&&o(e)});const i=e.getChild("Key")?.getChild("Name");i&&n.add(uj(i,t))})})};return o(e),i.sort((e,t)=>e.from-t.from)}function Mj(e){return!$j(e)}function $j(e){if(e.type.isError)return!0;let t=e.firstChild;for(;t;){if($j(t))return!0;t=t.nextSibling}return!1}class Dj{constructor(e={}){this.builtinNames=new Set(e.builtins?.map(e=>e.name)??[]);const t={top:"unaryTests"===e.dialect?"UnaryTests":"Expression",dialect:e.parserDialect};e.reservedNameBuiltins&&e.reservedNameBuiltins.length>0&&(t.contextTracker=rj(e.reservedNameBuiltins.reduce((e,t)=>(e[t.name]=()=>{},e),{}))),this.parser=cj.configure(t)}analyzeExpression(e){const t=this.parser.parse(e);return this.analyzeTree(t,e)}analyzeTree(e,t){const n=e.topNode;return{valid:Mj(n),inputs:Aj(n,t,this.builtinNames),functions:Rj(n,t,this.builtinNames)}}}var Bj,Lj,Ij,Nj,zj,jj,Vj,Fj,qj,Hj,Wj,Qj,Xj,Gj,Uj,Yj,Kj,Zj,Jj,eV,tV,nV,iV,rV,oV,sV,aV,lV,cV,uV,pV,hV,dV,fV,mV,gV,vV,yV,bV,wV,xV,_V,EV,SV,kV,OV,CV,PV,AV,TV,RV,MV,$V,DV,BV,LV,IV,NV,zV,jV,VV,FV,qV,HV,WV,QV,XV,GV,UV,YV,KV,ZV,JV,eF,tF,nF,iF,rF,oF,sF,aF,lF,cF,uF,pF,hF,dF,fF,mF,gF={exports:{}};function vF(){if(Lj)return Bj;Lj=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return Bj={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function yF(){if(Nj)return Ij;Nj=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return Ij=e}function bF(){return zj||(zj=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=vF(),o=yF(),s=(t=e.exports={}).re=[],a=t.safeRe=[],l=t.src=[],c=t.safeSrc=[],u=t.t={};let p=0;const h="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[h,i]],f=(e,t,n)=>{const i=(e=>{for(const[t,n]of d)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=p++;o(e,r,t),u[e]=r,l[r]=t,c[r]=i,s[r]=new RegExp(t,n?"g":void 0),a[r]=new RegExp(i,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),f("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${h}+`),f("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),f("FULL",`^${l[u.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),f("LOOSE",`^${l[u.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),f("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),f("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?`+`(?:${l[u.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",l[u.COERCE],!0),f("COERCERTLFULL",l[u.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(gF,gF.exports)),gF.exports}function wF(){if(Vj)return jj;Vj=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return jj=n=>n?"object"!=typeof n?e:n:t}function xF(){if(qj)return Fj;qj=1;const e=/^[0-9]+$/,t=(t,n)=>{if("number"==typeof t&&"number"==typeof n)return t===n?0:t<n?-1:1;const i=e.test(t),r=e.test(n);return i&&r&&(t=+t,n=+n),t===n?0:i&&!r?-1:r&&!i?1:t<n?-1:1};return Fj={compareIdentifiers:t,rcompareIdentifiers:(e,n)=>t(n,e)},Fj}function _F(){if(Wj)return Hj;Wj=1;const e=yF(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=vF(),{safeRe:i,t:r}=bF(),o=wF(),{compareIdentifiers:s}=xF();class a{constructor(s,l){if(l=o(l),s instanceof a){if(s.loose===!!l.loose&&s.includePrerelease===!!l.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",s,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const c=s.trim().match(l.loose?i[r.LOOSE]:i[r.FULL]);if(!c)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<n)return t}return e}):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof a)){if("string"==typeof t&&t===this.version)return 0;t=new a(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof a||(e=new a(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(t){if(t instanceof a||(t=new a(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const i=this.prerelease[n],r=t.prerelease[n];if(e("prerelease compare",n,i,r),void 0===i&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===i)return-1;if(i!==r)return s(i,r)}while(++n)}compareBuild(t){t instanceof a||(t=new a(t,this.options));let n=0;do{const i=this.build[n],r=t.build[n];if(e("build compare",n,i,r),void 0===i&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===i)return-1;if(i!==r)return s(i,r)}while(++n)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[r.PRERELEASELOOSE]:i[r.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let i=this.prerelease.length;for(;--i>=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let i=[t,e];!1===n&&(i=[t]),0===s(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Hj=a}function EF(){if(Xj)return Qj;Xj=1;const e=_F();return Qj=(t,n,i=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(e){if(!i)return null;throw e}}}function SF(){if(pV)return uV;pV=1;const e=_F();return uV=(t,n,i)=>new e(t,i).compare(new e(n,i)),uV}function kF(){if(vV)return gV;vV=1;const e=_F();return gV=(t,n,i)=>{const r=new e(t,i),o=new e(n,i);return r.compare(o)||r.compareBuild(o)},gV}function OF(){if(EV)return _V;EV=1;const e=SF();return _V=(t,n,i)=>e(t,n,i)>0,_V}function CF(){if(kV)return SV;kV=1;const e=SF();return SV=(t,n,i)=>e(t,n,i)<0,SV}function PF(){if(CV)return OV;CV=1;const e=SF();return OV=(t,n,i)=>0===e(t,n,i),OV}function AF(){if(AV)return PV;AV=1;const e=SF();return PV=(t,n,i)=>0!==e(t,n,i),PV}function TF(){if(RV)return TV;RV=1;const e=SF();return TV=(t,n,i)=>e(t,n,i)>=0,TV}function RF(){if($V)return MV;$V=1;const e=SF();return MV=(t,n,i)=>e(t,n,i)<=0,MV}function MF(){if(BV)return DV;BV=1;const e=PF(),t=AF(),n=OF(),i=TF(),r=CF(),o=RF();return DV=(s,a,l,c)=>{switch(a){case"===":return"object"==typeof s&&(s=s.version),"object"==typeof l&&(l=l.version),s===l;case"!==":return"object"==typeof s&&(s=s.version),"object"==typeof l&&(l=l.version),s!==l;case"":case"=":case"==":return e(s,l,c);case"!=":return t(s,l,c);case">":return n(s,l,c);case">=":return i(s,l,c);case"<":return r(s,l,c);case"<=":return o(s,l,c);default:throw new TypeError(`Invalid operator: ${a}`)}},DV}function $F(){if(VV)return jV;VV=1;const e=/\s+/g;class t{constructor(n,o){if(o=i(o),n instanceof t)return n.loose===!!o.loose&&n.includePrerelease===!!o.includePrerelease?n:new t(n.raw,o);if(n instanceof r)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!f(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&d))+":"+e,i=n.get(t);if(i)return i;const s=this.options.loose,m=s?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];e=e.replace(m,C(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[l.COMPARATORTRIM],c),o("comparator trim",e),e=e.replace(a[l.TILDETRIM],u),o("tilde trim",e),e=e.replace(a[l.CARETTRIM],p),o("caret trim",e);let g=e.split(" ").map(e=>v(e,this.options)).join(" ").split(/\s+/).map(e=>O(e,this.options));s&&(g=g.filter(e=>(o("loose invalid filter",e,this.options),!!e.match(a[l.COMPARATORLOOSE])))),o("range list",g);const y=new Map,b=g.map(e=>new r(e,this.options));for(const e of b){if(f(e))return[e];y.set(e.value,e)}y.size>1&&y.has("")&&y.delete("");const w=[...y.values()];return n.set(t,w),w}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>g(t,n)&&e.set.some(e=>g(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(P(this.set[t],e,this.options))return!0;return!1}}jV=t;const n=new(zV?NV:(zV=1,NV=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}})),i=wF(),r=DF(),o=yF(),s=_F(),{safeRe:a,t:l,comparatorTrimReplace:c,tildeTrimReplace:u,caretTrimReplace:p}=bF(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:d}=vF(),f=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let n=!0;const i=e.slice();let r=i.pop();for(;n&&i.length;)n=i.every(e=>r.intersects(e,t)),r=i.pop();return n},v=(e,t)=>(e=e.replace(a[l.BUILD],""),o("comp",e,t),e=x(e,t),o("caret",e),e=b(e,t),o("tildes",e),e=E(e,t),o("xrange",e),e=k(e,t),o("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{const n=t.loose?a[l.TILDELOOSE]:a[l.TILDE];return e.replace(n,(t,n,i,r,s)=>{let a;return o("tilde",e,t,n,i,r,s),y(n)?a="":y(i)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:y(r)?a=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${i}.${r}-${s} <${n}.${+i+1}.0-0`):a=`>=${n}.${i}.${r} <${n}.${+i+1}.0-0`,o("tilde return",a),a})},x=(e,t)=>e.trim().split(/\s+/).map(e=>_(e,t)).join(" "),_=(e,t)=>{o("caret",e,t);const n=t.loose?a[l.CARETLOOSE]:a[l.CARET],i=t.includePrerelease?"-0":"";return e.replace(n,(t,n,r,s,a)=>{let l;return o("caret",e,t,n,r,s,a),y(n)?l="":y(r)?l=`>=${n}.0.0${i} <${+n+1}.0.0-0`:y(s)?l="0"===n?`>=${n}.${r}.0${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${i} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),l="0"===n?"0"===r?`>=${n}.${r}.${s}-${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),l="0"===n?"0"===r?`>=${n}.${r}.${s}${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),o("caret return",l),l})},E=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map(e=>S(e,t)).join(" ")),S=(e,t)=>{e=e.trim();const n=t.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return e.replace(n,(n,i,r,s,a,l)=>{o("xRange",e,n,i,r,s,a,l);const c=y(r),u=c||y(s),p=u||y(a),h=p;return"="===i&&h&&(i=""),l=t.includePrerelease?"-0":"",c?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&h?(u&&(s=0),a=0,">"===i?(i=">=",u?(r=+r+1,s=0,a=0):(s=+s+1,a=0)):"<="===i&&(i="<",u?r=+r+1:s=+s+1),"<"===i&&(l="-0"),n=`${i+r}.${s}.${a}${l}`):u?n=`>=${r}.0.0${l} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${l} <${r}.${+s+1}.0-0`),o("xRange return",n),n})},k=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[l.STAR],"")),O=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),C=e=>(t,n,i,r,o,s,a,l,c,u,p,h)=>`${n=y(i)?"":y(r)?`>=${i}.0.0${e?"-0":""}`:y(o)?`>=${i}.${r}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=y(c)?"":y(u)?`<${+c+1}.0.0-0`:y(p)?`<${c}.${+u+1}.0-0`:h?`<=${c}.${u}.${p}-${h}`:e?`<${c}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),P=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==r.ANY&&e[n].semver.prerelease.length>0){const i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0};return jV}function DF(){if(qV)return FV;qV=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(i,r){if(r=n(r),i instanceof t){if(i.loose===!!r.loose)return i;i=i.value}i=i.trim().split(/\s+/).join(" "),s("comparator",i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const n=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,i){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,i).test(this.value):""===e.operator?""===e.value||new l(this.value,i).test(e.semver):(!(i=n(i)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!i.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,i)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,i)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}FV=t;const n=wF(),{safeRe:i,t:r}=bF(),o=MF(),s=yF(),a=_F(),l=$F();return FV}function BF(){if(WV)return HV;WV=1;const e=$F();return HV=(t,n,i)=>{try{n=new e(n,i)}catch(e){return!1}return n.test(t)},HV}function LF(){if(tF)return eF;tF=1;const e=$F();return eF=(t,n)=>{try{return new e(t,n).range||"*"}catch(e){return null}},eF}function IF(){if(iF)return nF;iF=1;const e=_F(),t=DF(),{ANY:n}=t,i=$F(),r=BF(),o=OF(),s=CF(),a=RF(),l=TF();return nF=(c,u,p,h)=>{let d,f,m,g,v;switch(c=new e(c,h),u=new i(u,h),p){case">":d=o,f=a,m=s,g=">",v=">=";break;case"<":d=s,f=l,m=o,g="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(r(c,u,h))return!1;for(let e=0;e<u.set.length;++e){const i=u.set[e];let r=null,o=null;if(i.forEach(e=>{e.semver===n&&(e=new t(">=0.0.0")),r=r||e,o=o||e,d(e.semver,r.semver,h)?r=e:m(e.semver,o.semver,h)&&(o=e)}),r.operator===g||r.operator===v)return!1;if((!o.operator||o.operator===g)&&f(c,o.semver))return!1;if(o.operator===v&&m(c,o.semver))return!1}return!0},nF}var NF=function(){if(mF)return fF;mF=1;const e=bF(),t=vF(),n=_F(),i=xF(),r=EF(),o=function(){if(Uj)return Gj;Uj=1;const e=EF();return Gj=(t,n)=>{const i=e(t,n);return i?i.version:null},Gj}(),s=function(){if(Kj)return Yj;Kj=1;const e=EF();return Yj=(t,n)=>{const i=e(t.trim().replace(/^[=v]+/,""),n);return i?i.version:null},Yj}(),a=function(){if(Jj)return Zj;Jj=1;const e=_F();return Zj=(t,n,i,r,o)=>{"string"==typeof i&&(o=r,r=i,i=void 0);try{return new e(t instanceof e?t.version:t,i).inc(n,r,o).version}catch(e){return null}},Zj}(),l=function(){if(tV)return eV;tV=1;const e=EF();return eV=(t,n)=>{const i=e(t,null,!0),r=e(n,null,!0),o=i.compare(r);if(0===o)return null;const s=o>0,a=s?i:r,l=s?r:i,c=!!a.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(a))return l.minor&&!l.patch?"minor":"patch"}const u=c?"pre":"";return i.major!==r.major?u+"major":i.minor!==r.minor?u+"minor":i.patch!==r.patch?u+"patch":"prerelease"},eV}(),c=function(){if(iV)return nV;iV=1;const e=_F();return nV=(t,n)=>new e(t,n).major,nV}(),u=function(){if(oV)return rV;oV=1;const e=_F();return rV=(t,n)=>new e(t,n).minor,rV}(),p=function(){if(aV)return sV;aV=1;const e=_F();return sV=(t,n)=>new e(t,n).patch,sV}(),h=function(){if(cV)return lV;cV=1;const e=EF();return lV=(t,n)=>{const i=e(t,n);return i&&i.prerelease.length?i.prerelease:null}}(),d=SF(),f=function(){if(dV)return hV;dV=1;const e=SF();return hV=(t,n,i)=>e(n,t,i),hV}(),m=function(){if(mV)return fV;mV=1;const e=SF();return fV=(t,n)=>e(t,n,!0),fV}(),g=kF(),v=function(){if(bV)return yV;bV=1;const e=kF();return yV=(t,n)=>t.sort((t,i)=>e(t,i,n)),yV}(),y=function(){if(xV)return wV;xV=1;const e=kF();return wV=(t,n)=>t.sort((t,i)=>e(i,t,n)),wV}(),b=OF(),w=CF(),x=PF(),_=AF(),E=TF(),S=RF(),k=MF(),O=function(){if(IV)return LV;IV=1;const e=_F(),t=EF(),{safeRe:n,t:i}=bF();return LV=(r,o)=>{if(r instanceof e)return r;if("number"==typeof r&&(r=String(r)),"string"!=typeof r)return null;let s=null;if((o=o||{}).rtl){const e=o.includePrerelease?n[i.COERCERTLFULL]:n[i.COERCERTL];let t;for(;(t=e.exec(r))&&(!s||s.index+s[0].length!==r.length);)s&&t.index+t[0].length===s.index+s[0].length||(s=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else s=r.match(o.includePrerelease?n[i.COERCEFULL]:n[i.COERCE]);if(null===s)return null;const a=s[2],l=s[3]||"0",c=s[4]||"0",u=o.includePrerelease&&s[5]?`-${s[5]}`:"",p=o.includePrerelease&&s[6]?`+${s[6]}`:"";return t(`${a}.${l}.${c}${u}${p}`,o)}}(),C=DF(),P=$F(),A=BF(),T=function(){if(XV)return QV;XV=1;const e=$F();return QV=(t,n)=>new e(t,n).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" ")),QV}(),R=function(){if(UV)return GV;UV=1;const e=_F(),t=$F();return GV=(n,i,r)=>{let o=null,s=null,a=null;try{a=new t(i,r)}catch(e){return null}return n.forEach(t=>{a.test(t)&&(o&&-1!==s.compare(t)||(o=t,s=new e(o,r)))}),o},GV}(),M=function(){if(KV)return YV;KV=1;const e=_F(),t=$F();return YV=(n,i,r)=>{let o=null,s=null,a=null;try{a=new t(i,r)}catch(e){return null}return n.forEach(t=>{a.test(t)&&(o&&1!==s.compare(t)||(o=t,s=new e(o,r)))}),o},YV}(),$=function(){if(JV)return ZV;JV=1;const e=_F(),t=$F(),n=OF();return ZV=(i,r)=>{i=new t(i,r);let o=new e("0.0.0");if(i.test(o))return o;if(o=new e("0.0.0-0"),i.test(o))return o;o=null;for(let t=0;t<i.set.length;++t){const r=i.set[t];let s=null;r.forEach(t=>{const i=new e(t.semver.version);switch(t.operator){case">":0===i.prerelease.length?i.patch++:i.prerelease.push(0),i.raw=i.format();case"":case">=":s&&!n(i,s)||(s=i);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}),!s||o&&!n(o,s)||(o=s)}return o&&i.test(o)?o:null},ZV}(),D=LF(),B=IF(),L=function(){if(oF)return rF;oF=1;const e=IF();return rF=(t,n,i)=>e(t,n,">",i),rF}(),I=function(){if(aF)return sF;aF=1;const e=IF();return sF=(t,n,i)=>e(t,n,"<",i),sF}(),N=function(){if(cF)return lF;cF=1;const e=$F();return lF=(t,n,i)=>(t=new e(t,i),n=new e(n,i),t.intersects(n,i))}(),z=function(){if(pF)return uF;pF=1;const e=BF(),t=SF();return uF=(n,i,r)=>{const o=[];let s=null,a=null;const l=n.sort((e,n)=>t(e,n,r));for(const t of l)e(t,i,r)?(a=t,s||(s=t)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);const c=[];for(const[e,t]of o)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const u=c.join(" || "),p="string"==typeof i.raw?i.raw:String(i);return u.length<p.length?u:i},uF}(),j=function(){if(dF)return hF;dF=1;const e=$F(),t=DF(),{ANY:n}=t,i=BF(),r=SF(),o=[new t(">=0.0.0-0")],s=[new t(">=0.0.0")],a=(e,t,a)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=a.includePrerelease?o:s}if(1===t.length&&t[0].semver===n){if(a.includePrerelease)return!0;t=s}const u=new Set;let p,h,d,f,m,g,v;for(const t of e)">"===t.operator||">="===t.operator?p=l(p,t,a):"<"===t.operator||"<="===t.operator?h=c(h,t,a):u.add(t.semver);if(u.size>1)return null;if(p&&h){if(d=r(p.semver,h.semver,a),d>0)return null;if(0===d&&(">="!==p.operator||"<="!==h.operator))return null}for(const e of u){if(p&&!i(e,String(p),a))return null;if(h&&!i(e,String(h),a))return null;for(const n of t)if(!i(e,String(n),a))return!1;return!0}let y=!(!h||a.includePrerelease||!h.semver.prerelease.length)&&h.semver,b=!(!p||a.includePrerelease||!p.semver.prerelease.length)&&p.semver;y&&1===y.prerelease.length&&"<"===h.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,p)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if(f=l(p,e,a),f===e&&f!==p)return!1}else if(">="===p.operator&&!i(p.semver,String(e),a))return!1;if(h)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(m=c(h,e,a),m===e&&m!==h)return!1}else if("<="===h.operator&&!i(h.semver,String(e),a))return!1;if(!e.operator&&(h||p)&&0!==d)return!1}return!(p&&g&&!h&&0!==d||h&&v&&!p&&0!==d||b||y)},l=(e,t,n)=>{if(!e)return t;const i=r(e.semver,t.semver,n);return i>0?e:i<0||">"===t.operator&&">="===e.operator?t:e},c=(e,t,n)=>{if(!e)return t;const i=r(e.semver,t.semver,n);return i<0?e:i>0||"<"===t.operator&&"<="===e.operator?t:e};return hF=(t,n,i={})=>{if(t===n)return!0;t=new e(t,i),n=new e(n,i);let r=!1;e:for(const e of t.set){for(const t of n.set){const n=a(e,t,i);if(r=r||null!==n,n)continue e}if(r)return!1}return!0}}();return fF={parse:r,valid:o,clean:s,inc:a,diff:l,major:c,minor:u,patch:p,prerelease:h,compare:d,rcompare:f,compareLoose:m,compareBuild:g,sort:v,rsort:y,gt:b,lt:w,eq:x,neq:_,gte:E,lte:S,cmp:k,coerce:O,Comparator:C,Range:P,satisfies:A,toComparators:T,maxSatisfying:R,minSatisfying:M,minVersion:$,validRange:D,outside:B,gtr:L,ltr:I,intersects:N,simplifyRange:z,subset:j,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}}();function zF(e,t){for(const[n,i]of Object.entries(e)){const e=t[n];if(e&&!1===jF(i,e))return!1}return!0}function jF(e,t){if(!NF.validRange(e))return null;const n=NF.coerce(t);return n?NF.satisfies(n,e):null}function VF(e){const t=[];return e.iterate({enter:e=>{const n=e.node;if(!n.type.isError)return;const i=n.parent,r=FF(n),o={from:n.from,to:n.to,severity:"error",type:"Syntax Error"};if(n.from!==n.to)o.message=`Unrecognized token in <${i.name}>`;else if(r)o.message=`Unrecognized token <${r.name}> in <${i.name}>`,o.to=r.to;else{const e=i.enterUnfinishedNodesBefore(n.to);o.message=`Incomplete <${(e||i).name}>`}t.push(o)}}),t}function FF(e){return e?e.nextSibling||FF(e.parent):null}var qF={create:e=>({enter(t){if("FilterExpression"!==t.name)return;const n=e.readContent(t.from,t.to);if(/\[\s*0\s*\]$/.test(n)){const{from:i,to:r}=t;e.report({from:i,to:r,message:"First item is accessed via [1]",severity:"warning",type:"first-item",actions:[{name:"fix",apply(t,o=i,s=r){e.updateContent(o,s,n.replace(/\[\s*0\s*\]$/,"[1]"))}}]})}}})};const HF=[qF];function WF(e){const{readContent:t,syntaxTree:n,updateContent:i}=e,r=[],o={readContent:t,report:e=>{r.push(e)},updateContent:i},s=HF.map(e=>e.create(o));return n.iterate({enter:e=>{for(const t of s)t.enter&&t.enter(e)},leave:e=>{for(const t of s)t.leave&&t.leave(e)}}),r}function QF(e={}){const{syntaxTree:t,expression:n,engines:i,builtins:r=[]}=e;if(!i||!Object.keys(i).length||!r.length)return[];const o=function(e,t){const n=new Map;for(const i of e)i.engines&&!zF(i.engines,t)&&n.set(i.name,i);return n}(r,i);if(!o.size)return[];const s=new Dj({builtins:r}),{valid:a,functions:l=[]}=s.analyzeTree(t,n);return a?l.reduce((e,t)=>{if("builtin"!==t.type)return e;const n=o.get(t.name);return n?(e.push({from:t.from,to:t.to,severity:"warning",type:"compatibility",message:`Function '${t.name}' requires ${XF(n.engines)}`}),e):e},[]):[]}function XF(e){return Object.entries(e).map(([e,t])=>`${function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(e)} ${t}`).join(", ")}const GF=({builtins:e=[],engines:t}={})=>n=>{if(0===n.state.doc.length)return[];const i=CM(n.state),r=(o={syntaxTree:i,expression:n.state.doc.toString(),builtins:e,engines:t,readContent:(e,t)=>n.state.sliceDoc(e,t),updateContent:(e,t,i)=>n.dispatch({changes:{from:e,to:t,insert:i}})},[...VF(o.syntaxTree),...WF(o),...QF(o)]);var o;return r.map(e=>({...e,source:e.type}))};const UF=gI(function(){const e=GF();return t=>{const n=e(t);if(0===t.state.doc.length)return[];return[...n,...function(e){return[...oz(e)]}(CM(t.state)).map(e=>({...e,source:"feelers linter"}))]}}()),YF=123,KF=125,ZF=(e,t=0)=>{const n=e.peek(t)===KF,i=e.peek(t+1)===KF;return n&&i||-1===e.peek(t)},JF=new zL((e,t)=>{let n=0;for(;!ZF(e,n);)n++;n>0&&(e.advance(n),e.acceptToken(2))}),eq=(e,t=0)=>{const n=e.peek(t)===YF,i=e.peek(t+1)===YF;return n&&i||-1===e.peek(t)},tq=new zL((e,t)=>{let n=0;for(;!eq(e,n);)n++;n>0&&(e.advance(n),e.acceptToken(3))}),nq=new zL((e,t)=>{let n=0;for(;-1!==e.peek(n);)n++;n>0&&(e.advance(n),e.acceptToken(1))}),iq=JR({ConditionalSpanner:wM.special(wM.bracket),ConditionalSpannerClose:wM.special(wM.bracket),ConditionalSpannerCloseNl:wM.special(wM.bracket),LoopSpanner:wM.special(wM.bracket),LoopSpannerClose:wM.special(wM.bracket),LoopSpannerCloseNl:wM.special(wM.bracket),EmptyInsert:wM.special(wM.bracket),Insert:wM.special(wM.bracket)}),rq=ZL.deserialize({version:14,states:"$bOQOaOOOfOXO'#CbOOO`'#Cm'#CmOqOWO'#CcOvOWO'#CfOOO`'#Cp'#CpOOO`'#Ci'#CiO{OaO'#ClO!jOSOOQOOOOOO!oOPO,58{O!tOXO,58|OOO`,58|,58|O!|OQO,58}O#ROQO,59QOOO`-E6g-E6gOOO`1G.g1G.gO#WOPO1G.gOOO`1G.h1G.hO#]OaO1G.iO#qOaO1G.lOOO`7+$R7+$RO$VOPO7+$TO$_OPO7+$WOOO`<<Go<<GoOOO`<<Gr<<Gr",stateData:"$g~ORUO_WObPOeROgSO^`P~OQYO_ZOc[O~OQ]O~OQ^O~ORUObPOeROgSO^`XW`XX`XZ`X[`X~OPXO~Oc`O~OQaOcbO~OfcO~OfdO~OceO~ORUObPOeROgSOW`PX`P~ORUObPOeROgSOZ`P[`P~OWhOXhO~OZiO[iO~O",goto:"!ZePPPPPfflPPlPPrPPz!TPP!TXQOVcdXTOVcdUVOcdR_VQXOQfcRgdXUOVcd",nodeNames:"⚠ Feel FeelBlock SimpleTextBlock Feelers Insert EmptyInsert ConditionalSpanner ConditionalSpannerClose ConditionalSpannerCloseNl LoopSpanner LoopSpannerClose LoopSpannerCloseNl",maxTerm:23,propSources:[iq],skippedNodes:[0],repeatNodeCount:1,tokenData:"%X~RR!_!`[#o#pa#q#r$r~aO_~~dP#o#pg~lQb~str!P!Q!{~uQ#]#^{#`#a!^~!OP#Y#Z!R~!UPpq!X~!^Oe~~!aP#c#d!d~!gP#c#d!j~!mP#d#e!p~!sPpq!v~!{Og~~#OQ#]#^#U#`#a#u~#XP#Y#Z#[~#_P#q#r#b~#eP#q#r#h~#mPW~YZ#p~#uOX~~#xP#c#d#{~$OP#c#d$R~$UP#d#e$X~$[P#q#r$_~$bP#q#r$e~$jPZ~YZ$m~$rO[~R$uP#q#r$xR%PPcPfQYZ%SQ%XOfQ",tokenizers:[0,1,nq,JF,tq],topRules:{Feelers:[0,4]},tokenPrec:0}),oq={ConditionalSpanner:t$,LoopSpanner:t$};function sq(e){return new IM(function(e){const t=rq.configure({wrap:$R(t=>"Feel"==t.name||"FeelBlock"==t.name?{parser:cj}:e&&"SimpleTextBlock"==t.name?{parser:e}:null),props:[e$.add(oq)]});return OM.define({parser:t})}(e),[])}const aq=e=>`url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='3'><path d='m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0' stroke='${(e=>e.startsWith("#")?`%23${e.slice(1)}`:e)(e)}' fill='none' stroke-width='1.2'/></svg>")`,lq=({variant:e,settings:t,styles:n})=>[UA.theme({"&":{color:t.foreground},"& .cm-lintRange-error":{backgroundImage:aq(t.error)},"& .cm-lintRange-warning":{backgroundImage:aq(t.warning)}},{dark:"dark"===e}),s$(n$.define(n))],cq=lq({variant:"light",settings:{foreground:"#24292f",warning:"#debd71",error:"#9f1c15"},styles:[{tag:wM.keyword,color:"#a31515"},{tag:wM.bool,color:"#a31515"},{tag:wM.null,color:"#a31515"},{tag:wM.typeName,color:"#a31515"},{tag:wM.string,color:"#1a7f37"},{tag:wM.special(wM.string),color:"#1a7f37"},{tag:wM.number,color:"#06704a"},{tag:wM.arithmeticOperator,color:"#0969da"},{tag:wM.compareOperator,color:"#0969da"},{tag:wM.special(wM.bracket),color:"#b54a00",fontWeight:"bold"},{tag:wM.variableName,color:"#0550ae"},{tag:wM.definition(wM.variableName),color:"#0550ae"},{tag:wM.special(wM.variableName),color:"#0550ae"},{tag:wM.propertyName,color:"#0550ae"},{tag:wM.definition(wM.propertyName),color:"#0550ae"},{tag:wM.function(wM.variableName),color:"#8250df"},{tag:wM.function(wM.special(wM.variableName)),color:"#8250df"},{tag:wM.function(wM.definition(wM.variableName)),color:"#8250df"},{tag:wM.function(wM.propertyName),color:"#8250df"},{tag:wM.lineComment,color:"#69727b"},{tag:wM.blockComment,color:"#69727b"},{tag:wM.heading,color:"#953800",fontWeight:"bold"},{tag:wM.strong,fontWeight:"bold"},{tag:wM.emphasis,fontStyle:"italic"},{tag:wM.strikethrough,textDecoration:"line-through"},{tag:wM.link,color:"#0969da",textDecoration:"underline"},{tag:wM.url,color:"#0969da"},{tag:wM.escape,color:"#0969da"},{tag:wM.quote,color:"#69727b"},{tag:wM.processingInstruction,color:"#69727b"},{tag:wM.contentSeparator,color:"#69727b",fontWeight:"bold"},{tag:wM.meta,color:"#69727b"},{tag:wM.inserted,color:"#1a7f37"},{tag:wM.deleted,color:"#a31515"},{tag:wM.tagName,color:"#953800"},{tag:wM.attributeName,color:"#953800"},{tag:wM.angleBracket,color:"#69727b"},{tag:wM.attributeValue,color:"#1a7f37"}]}),uq=lq({variant:"dark",settings:{foreground:"#adbac7",warning:"#fff890",error:"#ff0000"},styles:[{tag:wM.keyword,color:"#f47067"},{tag:wM.bool,color:"#f47067"},{tag:wM.null,color:"#f47067"},{tag:wM.typeName,color:"#f47067"},{tag:wM.string,color:"#aff5b4"},{tag:wM.special(wM.string),color:"#aff5b4"},{tag:wM.number,color:"#6bc46d"},{tag:wM.arithmeticOperator,color:"#89dceb"},{tag:wM.compareOperator,color:"#89dceb"},{tag:wM.special(wM.bracket),color:"#ffa657",fontWeight:"bold"},{tag:wM.variableName,color:"#79c0ff"},{tag:wM.definition(wM.variableName),color:"#79c0ff"},{tag:wM.special(wM.variableName),color:"#79c0ff"},{tag:wM.propertyName,color:"#79c0ff"},{tag:wM.definition(wM.propertyName),color:"#79c0ff"},{tag:wM.function(wM.variableName),color:"#dcbdfb"},{tag:wM.function(wM.special(wM.variableName)),color:"#dcbdfb"},{tag:wM.function(wM.definition(wM.variableName)),color:"#dcbdfb"},{tag:wM.function(wM.propertyName),color:"#dcbdfb"},{tag:wM.lineComment,color:"#8b949e"},{tag:wM.blockComment,color:"#8b949e"},{tag:wM.heading,color:"#e3b341",fontWeight:"bold"},{tag:wM.strong,fontWeight:"bold"},{tag:wM.emphasis,fontStyle:"italic"},{tag:wM.strikethrough,textDecoration:"line-through"},{tag:wM.link,color:"#89dceb",textDecoration:"underline"},{tag:wM.url,color:"#89dceb"},{tag:wM.escape,color:"#89dceb"},{tag:wM.quote,color:"#8b949e"},{tag:wM.processingInstruction,color:"#8b949e"},{tag:wM.contentSeparator,color:"#8b949e",fontWeight:"bold"},{tag:wM.meta,color:"#8b949e"},{tag:wM.inserted,color:"#aff5b4"},{tag:wM.deleted,color:"#f47067"},{tag:wM.tagName,color:"#e3b341"},{tag:wM.attributeName,color:"#e3b341"},{tag:wM.angleBracket,color:"#8b949e"},{tag:wM.attributeValue,color:"#aff5b4"}]});function pq(e){return{all:e=e||new Map,on:function(t,n){var i=e.get(t);i?i.push(n):e.set(t,[n])},off:function(t,n){var i=e.get(t);i&&(n?i.splice(i.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var i=e.get(t);i&&i.slice().map(function(e){e(n)}),(i=e.get("*"))&&i.slice().map(function(e){e(t,n)})}}}const hq=LN.configure({wrap:$R(e=>"HTMLTag"===e.name||"HTMLBlock"===e.name?{parser:rz}:null)});function dq({container:e,tooltipContainer:t,hostLanguage:n,hostLanguageParser:i,onChange:r=()=>{},onKeyDown:o=()=>{},onLint:s=()=>{},contentAttributes:a={},readOnly:l=!1,value:c="",enableGutters:u=!1,singleLine:p=!1,lineWrap:h=!1,darkMode:d=!1}){this._events=pq(),this.on("lint",({diagnostics:e})=>s(e));const f=UA.updateListener.of(e=>{e.docChanged&&r(e.state.doc.toString())}),m=UA.updateListener.of(e=>{const t=e.transactions.flatMap(e=>e.effects).filter(e=>e.is(oI));if(!t.length)return;const n=t.flatMap(e=>e.value);this._events.emit("lint",{diagnostics:n})}),g=UA.contentAttributes.of(a),v=UA.domEventHandlers({keydown:o});"string"==typeof t&&(t=document.querySelector(t)||void 0);const y=t,b=y?hT({tooltipSpace:function(){return y.getBoundingClientRect()}}):[],w=sq(i||n&&(e=>{if("markdown"===e)return hq})(n)||void 0),x=[y$(),f,g,jD(),JM(),v,iT.of([...AL]),w,UF,m,b,d?uq:cq,...u?[JT()]:[],...p?[ik.transactionFilter.of(e=>e.newDoc.lines>1?[]:e)]:[],...h?[UA.lineWrapping]:[]];return l&&x.push(UA.editable.of(!1)),p&&c&&(c=c.toString().split("\n")[0]),this._cmEditor=new UA({state:ik.create({doc:c,extensions:x}),parent:e}),this}dq.prototype.setValue=function(e){this._cmEditor.dispatch({changes:{from:0,to:this._cmEditor.state.doc.length,insert:e}})},dq.prototype.focus=function(e){const t=this._cmEditor;if(t.contentDOM.focus(),t.focus(),"number"==typeof e){const n=t.state.doc.length;t.dispatch({selection:{anchor:e<=n?e:n}})}},dq.prototype.getSelection=function(){return this._cmEditor.state.selection},dq.prototype.on=function(e,t){this._events.on(e,t)},dq.prototype.off=function(e,t){this._events.off(e,t)};const fq=[DD("function(${params}) ${body}",{label:"function",detail:"definition",type:"keyword"}),DD("for ${var} in ${collection} return ${value}",{label:"for",detail:"expression",type:"keyword"}),DD("every ${var} in ${collection} satisfies ${condition}",{label:"every",detail:"quantified expression",type:"keyword"}),DD("some ${var} in ${collection} satisfies ${condition}",{label:"some",detail:"quantified expression",type:"keyword"}),DD("if ${condition} then ${value} else ${other value}",{label:"if",detail:"block",type:"keyword"}),DD("{ ${key}: ${value} }",{label:"context",detail:"block",type:"keyword"}),DD("null",{label:"null",detail:"literal",type:"keyword"}),DD("true",{label:"true",detail:"literal",type:"keyword"}),DD("false",{label:"false",detail:"literal",type:"keyword"})];function mq(e){const{context:t,after:n,before:i,keyword:r}=e;return function(e,t){const{nodes:n,before:i,after:r,keyword:o}=e;return e=>{const{state:s,pos:a}=e,l=Eq(CM(s).resolveInner(a,-1),n);if(!l)return null;const[c]=l;return xq(c,a,[o,i])||function(e,t,n){return _q(e,t,n,1)}(c,a,[o,r])||r&&!xq(c,a,[r])?null:t(e)}}({nodes:t,before:i,after:n,keyword:r},$$([{label:r,type:"keyword",boost:10}]))}const gq=[mq({context:"InExpression",keyword:"in"}),mq({context:"IfExpression",keyword:"then",after:"if",before:"else"}),mq({context:"IfExpression",keyword:"else",after:"then"}),mq({context:"QuantifiedExpression",keyword:"satisfies"}),mq({context:"ForExpression",after:"InExpressions",keyword:"return"})],vq=["Name","StringLiteral","LineComment","BlockComment","PathExpression","Context","Key","ParameterName"],yq=["Expr","ContextEntry"];function bq(e){return function(e,{include:t,exclude:n}){const i=[...n,...t];return t=>{const{state:r,pos:o}=t,s=Eq(CM(r).resolveInner(o,-1),i);if(s){const[e,t]=s;if(n.includes(t))return null}return e(t)}}(e,{include:yq,exclude:vq})}function wq(e){return bq($$(e))}function xq(e,t,n){return _q(e,t,n,-1)}function _q(e,t,n,i){let r=e[i>0?"childAfter":"childBefore"](t);for(;r;){if(n.includes(r.name))return r;if(r.type.isError&&r.firstChild&&n.includes(r.firstChild.name))return r.firstChild;r=r[i>0?"nextSibling":"prevSibling"]}return null}function Eq(e,t){for(Array.isArray(t)||(t=[t]);e;e=e.parent){const n=e.type,i=t.find(e=>e&&n.is(e));if(i)return[e,i];if(n.isTop)break}return null}const Sq=OM.define({parser:cj.configure({props:[HM.add({Context:YM({closing:"}"}),"List FilterExpression":YM({closing:"]"}),"ParenthesizedExpression FunctionInvocation":ZM({except:/^\s*\)/}),"ForExpression QuantifiedExpression IfExpression":ZM({except:/^\s*(then|else|return|satisfies)\b/}),FunctionDefinition:ZM({except:/^\s*(\(|\))/})}),e$.add({Context:t$,List:t$,ParenthesizedExpression:t$,FunctionDefinition(e){const t=e.getChild(")");return t?{from:t.to,to:e.to}:null}})]}),languageData:{indentOnInput:/^\s*(\)|\}|\]|then|else|return|satisfies)$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}}),kq=Sq.configure({top:"UnaryTests"},"FEEL unary tests"),Oq=Sq.configure({top:"Expression"},"FEEL expression");const Cq=[{name:"not",type:"function",params:[{name:"negand"}],info:'<p>Returns the logical negation of the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">not(negand: boolean): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">not(true)\n// false\n\nnot(null)\n// null\n</code></pre>\n'},{name:"get value",type:"function",params:[{name:"context"},{name:"key"}],info:'<p>Returns the value of the context entry with the given key.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get value(context: context, key: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get value({foo: 123}, &quot;foo&quot;)\n// 123\n\nget value({a: 1}, &quot;b&quot;)\n// null\n</code></pre>\n'},{name:"get entries",type:"function",params:[{name:"context"}],info:'<p>Returns the entries of the context as a list of key-value-pairs.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get entries(context: context): list&lt;context&gt;\n</code></pre>\n<p>The return value is a list of contexts. Each context contains two entries for &quot;key&quot; and &quot;value&quot;.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get entries({foo: 123})\n// [{key: &quot;foo&quot;, value: 123}]\n</code></pre>\n'},{name:"context put",type:"function",params:[{name:"context"},{name:"keys"},{name:"value"}],info:'<p>Adds a new entry with the given value to the context. The path of the entry is defined by the keys. Returns a new context that includes the entry.</p>\n<p>If <code>keys</code> contains the keys <code>[k1, k2]</code> then it adds the nested entry <code>k1.k2 = value</code> to the context.</p>\n<p>If an entry for the same keys already exists in the context, it overrides the value.</p>\n<p>If <code>keys</code> are empty, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context put(context: context, keys: list&lt;string&gt;, value: Any): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context put({x:1}, [&quot;y&quot;], 2)\n// {x:1, y:2}\n\ncontext put({x:1, y: {z:0}}, [&quot;y&quot;, &quot;z&quot;], 2)\n// {x:1, y: {z:2}}\n\ncontext put({x:1}, [&quot;y&quot;, &quot;z&quot;], 2)\n// {x:1, y: {z:2}}\n</code></pre>\n'},{name:"string",type:"function",params:[{name:"from"}],info:'<p>Returns the given value as a string representation.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">string(from: Any): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">string(1.1)\n// &quot;1.1&quot;\n\nstring(date(&quot;2012-12-25&quot;))\n// &quot;2012-12-25&quot;\n</code></pre>\n'},{name:"number",type:"function",params:[{name:"from"}],info:'<p>Parses the given string to a number.</p>\n<p>Returns <code>null</code> if the string is not a number.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">number(from: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">number(&quot;1500.5&quot;)\n// 1500.5\n</code></pre>\n'},{name:"number",type:"function",params:[{name:"from"},{name:"grouping separator"}],info:'<p>Parses the given string to a number using the specified grouping separator.</p>\n<p>Returns <code>null</code> if the string is not a number.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">number(from: string, grouping separator: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">number(&quot;1,500&quot;, &quot;,&quot;)\n// 1500\n</code></pre>\n'},{name:"number",type:"function",params:[{name:"from"},{name:"grouping separator"},{name:"decimal separator"}],info:'<p>Parses the given string to a number using the specified grouping and decimal separators.</p>\n<p>Returns <code>null</code> if the string is not a number.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">number(from: string, grouping separator: string, decimal separator: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">number(&quot;1 500.5&quot;, &quot; &quot;, &quot;.&quot;)\n// 1500.5\n</code></pre>\n'},{name:"context",type:"function",params:[{name:"entries"}],info:'<p>Constructs a context of the given list of key-value pairs. It is the reverse function to <a href="https://docs.camunda.io/docs/components/modeler/feel/builtin-functions/feel-built-in-functions-context#get-entriescontext">get entries()</a>.</p>\n<p>Each key-value pair must be a context with two entries: <code>key</code> and <code>value</code>. The entry with name <code>key</code> must have a value of the type <code>string</code>.</p>\n<p>It might override context entries if the keys are equal. The entries are overridden in the same order as the contexts in the given list.</p>\n<p>Returns <code>null</code> if one of the entries is not a context or if a context doesn&#39;t contain the required entries.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context(entries: list&lt;context&gt;): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context([{&quot;key&quot;:&quot;a&quot;, &quot;value&quot;:1}, {&quot;key&quot;:&quot;b&quot;, &quot;value&quot;:2}])\n// {a:1, b:2}\n</code></pre>\n'},{name:"date",type:"function",params:[{name:"from"}],info:'<p>Returns a date from the given value.</p>\n<p>Returns <code>null</code> if the string is not a valid calendar date. For example, <code>&quot;2024-06-31&quot;</code> is invalid because June has\nonly 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">date(from: string): date\n</code></pre>\n<p>Parses the given string into a date.</p>\n<pre><code class="language-feel">date(from: date and time): date\n</code></pre>\n<p>Extracts the date component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">date(&quot;2018-04-29&quot;)\n// date(&quot;2018-04-29&quot;)\n\ndate(date and time(&quot;2012-12-25T11:00:00&quot;))\n// date(&quot;2012-12-25&quot;)\n</code></pre>\n'},{name:"date",type:"function",params:[{name:"year"},{name:"month"},{name:"day"}],info:'<p>Returns a date from the given components.</p>\n<p>Returns <code>null</code> if the components don&#39;t represent a valid calendar date. For example, <code>2024,6,31</code> is invalid because\nJune has only 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">date(year: number, month: number, day: number): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">date(2012, 12, 25)\n// date(&quot;2012-12-25&quot;)\n</code></pre>\n'},{name:"time",type:"function",params:[{name:"from"}],info:'<p>Returns a time from the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">time(from: string): time\n</code></pre>\n<p>Parses the given string into a time.</p>\n<pre><code class="language-feel">time(from: date and time): time\n</code></pre>\n<p>Extracts the time component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">time(&quot;12:00:00&quot;)\n// time(&quot;12:00:00&quot;)\n\ntime(date and time(&quot;2012-12-25T11:00:00&quot;))\n// time(&quot;11:00:00&quot;)\n</code></pre>\n'},{name:"time",type:"function",params:[{name:"hour"},{name:"minute"},{name:"second"}],info:'<p>Returns a time from the given components.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">time(hour: number, minute: number, second: number): time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">time(23, 59, 0)\n// time(&quot;23:59:00&quot;)\n</code></pre>\n'},{name:"time",type:"function",params:[{name:"hour"},{name:"minute"},{name:"second"},{name:"offset"}],info:'<p>Returns a time from the given components, including a timezone offset.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">time(hour: number, minute: number, second: number, offset: days and time duration): time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">time(14, 30, 0, duration(&quot;PT1H&quot;))\n// time(&quot;14:30:00+01:00&quot;)\n</code></pre>\n'},{name:"date and time",type:"function",params:[{name:"from"}],info:'<p>Parses the given string into a date and time. The function supports strings in the format <code>YYYY-MM-DDThh:mm:ss</code> with\noptional timezone information either as offset (e.g., <code>+01:00</code> or <code>Z</code>), as IANA timezone ID (e.g., <code>@Europe/Berlin</code>), or\nas a combination of both (e.g., <code>+01:00[Europe/Berlin]</code>).</p>\n<p>Returns <code>null</code> if the string is not a valid calendar date. For example, <code>&quot;2024-06-31T10:00:00&quot;</code> is invalid because\nJune has only 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">date and time(from: string): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">date and time(&quot;2018-04-29T09:30:00&quot;)\n// date and time(&quot;2018-04-29T09:30:00&quot;)\n\ndate and time(&quot;2018-04-29T09:30:00+02:00&quot;)\n// date and time(&quot;2018-04-29T09:30:00+02:00&quot;)\n\ndate and time(&quot;2018-04-29T09:30:00@Europe/Berlin&quot;)\n// date and time(&quot;2018-04-29T09:30:00@Europe/Berlin&quot;)\n\ndate and time(&quot;2018-04-29T09:30:00+02:00[Europe/Berlin]&quot;)\n// date and time(&quot;2018-04-29T09:30:00@Europe/Berlin&quot;)\n</code></pre>\n'},{name:"date and time",type:"function",params:[{name:"date"},{name:"time"}],info:'<p>Returns a date and time from the given components.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">date and time(date: date, time: time): date and time\n</code></pre>\n<pre><code class="language-feel">date and time(date: date and time, time: time): date and time\n</code></pre>\n<p>Returns a date and time value that consists of the date component of <code>date</code> combined with <code>time</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">date and time(date(&quot;2012-12-24&quot;),time(&quot;T23:59:00&quot;))\n// date and time(&quot;2012-12-24T23:59:00&quot;)\n\ndate and time(date and time(&quot;2012-12-25T11:00:00&quot;),time(&quot;T23:59:00&quot;))\n// date and time(&quot;2012-12-25T23:59:00&quot;)\n</code></pre>\n'},{name:"duration",type:"function",params:[{name:"from"}],info:'<p>Parses the given string into a duration. The duration is either a days and time duration or a years and months duration.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">duration(from: string): days and time duration\n</code></pre>\n<pre><code class="language-feel">duration(from: string): years and months duration\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">duration(&quot;P5D&quot;)\n// duration(&quot;P5D&quot;)\n\nduration(&quot;P32Y&quot;)\n// duration(&quot;P32Y&quot;)\n</code></pre>\n'},{name:"years and months duration",type:"function",params:[{name:"from"},{name:"to"}],info:'<p>Returns the years and months duration between <code>from</code> and <code>to</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">years and months duration(from: date, to: date): years and months duration\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">years and months duration(date(&quot;2011-12-22&quot;), date(&quot;2013-08-24&quot;))\n// duration(&quot;P1Y8M&quot;)\n</code></pre>\n'},{name:"from json",type:"function",params:[{name:"value"}],info:'<p>Parses a JSON string into a FEEL value. The function converts JSON primitives, objects, and arrays into their corresponding FEEL types.</p>\n<p>Returns <code>null</code> if the string is not a valid JSON value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">from json(value: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">from json(&quot;{\\&quot;a\\&quot;: 1, \\&quot;b\\&quot;: 2}&quot;)\n// {a: 1, b: 2}\n\nfrom json(&quot;true&quot;)\n// true\n\nfrom json(&quot;\\&quot;2023-06-14\\&quot;&quot;)\n// &quot;2023-06-14&quot;\n</code></pre>\n',engines:{camunda:">=8.9"}},{name:"to json",type:"function",params:[{name:"value"}],info:'<p>Converts a FEEL value into a JSON string. The function converts FEEL primitives, contexts, and lists into their\ncorresponding JSON types. Temporal values are converted to their ISO 8601 string representation, including timezone\ninformation for date and time values (format: <code>2025-11-24T10:00:00+01:00[Europe/Berlin]</code>).</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">to json(value: Any): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">to json({a: 1, b: 2})\n// &quot;{\\&quot;a\\&quot;:1,\\&quot;b\\&quot;:2}&quot;\n\nto json(true)\n// &quot;true&quot;\n\nto json(@&quot;2023-06-14&quot;)\n// &quot;\\&quot;2023-06-14\\&quot;&quot;\n\nto json(@&quot;2025-11-24T10:00:00@Europe/Berlin&quot;)\n// &quot;\\&quot;2025-11-24T10:00:00+01:00[Europe/Berlin]\\&quot;&quot;\n\nto json(@&quot;P3Y&quot;)\n// &quot;\\&quot;P3Y\\&quot;&quot;\n</code></pre>\n',engines:{camunda:">=8.9"}},{name:"list contains",type:"function",params:[{name:"list"},{name:"element"}],info:'<p>Returns <code>true</code> if the given list contains the element. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">list contains(list: list, element: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">list contains([1,2,3], 2)\n// true\n</code></pre>\n'},{name:"count",type:"function",params:[{name:"list"}],info:'<p>Returns the number of elements of the given list.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">count(list: list): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">count([1,2,3])\n// 3\n</code></pre>\n'},{name:"min",type:"function",params:[{name:"list"}],info:'<p>Returns the minimum of the given list.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">min(list: list): Any\n</code></pre>\n<p>All elements in <code>list</code> should have the same type and be comparable.</p>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">min([1,2,3])\n// 1\n\nmin(1,2,3)\n// 1\n</code></pre>\n'},{name:"max",type:"function",params:[{name:"list"}],info:'<p>Returns the maximum of the given list.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">max(list: list): Any\n</code></pre>\n<p>All elements in <code>list</code> should have the same type and be comparable.</p>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">max([1,2,3])\n// 3\n\nmax(1,2,3)\n// 3\n</code></pre>\n'},{name:"sum",type:"function",params:[{name:"list"}],info:'<p>Returns the sum of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">sum(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">sum([1,2,3])\n// 6\n\nsum(1,2,3)\n// 6\n</code></pre>\n'},{name:"product",type:"function",params:[{name:"list"}],info:'<p>Returns the product of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">product(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">product([2, 3, 4])\n// 24\n\nproduct(2, 3, 4)\n// 24\n</code></pre>\n'},{name:"mean",type:"function",params:[{name:"list"}],info:'<p>Returns the arithmetic mean (i.e. average) of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">mean(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">mean([1,2,3])\n// 2\n\nmean(1,2,3)\n// 2\n</code></pre>\n'},{name:"median",type:"function",params:[{name:"list"}],info:'<p>Returns the median element of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">median(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">median(8, 2, 5, 3, 4)\n// 4\n\nmedian([6, 1, 2, 3])\n// 2.5\n</code></pre>\n'},{name:"stddev",type:"function",params:[{name:"list"}],info:'<p>Returns the standard deviation of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">stddev(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">stddev(2, 4, 7, 5)\n// 2.0816659994661326\n\nstddev([2, 4, 7, 5])\n// 2.0816659994661326\n</code></pre>\n'},{name:"mode",type:"function",params:[{name:"list"}],info:'<p>Returns the mode of the given list of numbers.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">mode(list: list&lt;number&gt;): number\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">mode(6, 3, 9, 6, 6)\n// [6]\n\nmode([6, 1, 9, 6, 1])\n// [1, 6]\n</code></pre>\n'},{name:"all",type:"function",params:[{name:"list"}],info:'<p>Returns <code>false</code> if any element of the given list is <code>false</code>. Otherwise, returns <code>true</code>.</p>\n<p>If the given list is empty, it returns <code>true</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">all(list: list&lt;boolean&gt;): boolean\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">all([true,false])\n// false\n\nall(false,null,true)\n// false\n</code></pre>\n<p>:::info\nThe function <code>all()</code> replaced the previous function <code>and()</code>. The previous function is deprecated and\nshould not be used anymore.\n:::</p>\n'},{name:"any",type:"function",params:[{name:"list"}],info:'<p>Returns <code>true</code> if any element of the given list is <code>true</code>. Otherwise, returns <code>false</code>.</p>\n<p>If the given list is empty, it returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">any(list: list&lt;boolean&gt;): boolean\n</code></pre>\n<p>The parameter <code>list</code> can be passed as a list or as a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">any([false,true])\n// true\n\nany(false,null,true)\n// true\n</code></pre>\n<p>:::info\nThe function <code>any()</code> replaced the previous function <code>or()</code>. The previous function is deprecated and\nshould not be used anymore.\n:::</p>\n'},{name:"sublist",type:"function",params:[{name:"list"},{name:"start position"}],info:'<p>Returns a partial list of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">sublist(list: list, start position: number): list\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">sublist([1,2,3], 2)\n// [2,3]\n</code></pre>\n'},{name:"sublist",type:"function",params:[{name:"list"},{name:"start position"},{name:"length"}],info:'<p>Returns a partial list of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">sublist(list: list, start position: number, length: number): list\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">sublist([1,2,3], 1, 2)\n// [1,2]\n</code></pre>\n'},{name:"append",type:"function",params:[{name:"list"},{name:"items"}],info:'<p>Returns the given list with all <code>items</code> appended.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">append(list: list, items: Any): list\n</code></pre>\n<p>The parameter <code>items</code> can be a single element or a sequence of elements.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">append([1], 2, 3)\n// [1,2,3]\n</code></pre>\n'},{name:"concatenate",type:"function",params:[{name:"lists"}],info:'<p>Returns a list that includes all elements of the given lists.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">concatenate(lists: list): list\n</code></pre>\n<p>The parameter <code>lists</code> is a sequence of lists.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">concatenate([1,2],[3])\n// [1,2,3]\n\nconcatenate([1],[2],[3])\n// [1,2,3]\n</code></pre>\n'},{name:"insert before",type:"function",params:[{name:"list"},{name:"position"},{name:"newItem"}],info:'<p>Returns the given list with <code>newItem</code> inserted at <code>position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">insert before(list: list, position: number, newItem: Any): list\n</code></pre>\n<p>The <code>position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">insert before([1,3],1,2)\n// [2,1,3]\n</code></pre>\n'},{name:"remove",type:"function",params:[{name:"list"},{name:"position"}],info:'<p>Returns the given list without the element at <code>position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">remove(list: list, position: number): list\n</code></pre>\n<p>The <code>position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">remove([1,2,3], 2)\n// [1,3]\n</code></pre>\n'},{name:"reverse",type:"function",params:[{name:"list"}],info:'<p>Returns the given list in revered order.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">reverse(list: list): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">reverse([1,2,3])\n// [3,2,1]\n</code></pre>\n'},{name:"index of",type:"function",params:[{name:"list"},{name:"match"}],info:'<p>Returns an ascending list of positions containing <code>match</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">index of(list: list, match: Any): list&lt;number&gt;\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">index of([1,2,3,2],2)\n// [2,4]\n</code></pre>\n'},{name:"union",type:"function",params:[{name:"list"}],info:'<p>Returns a list that includes all elements of the given lists without duplicates.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">union(list: list): list\n</code></pre>\n<p>The parameter <code>list</code> is a sequence of lists.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">union([1,2],[2,3])\n// [1,2,3]\n</code></pre>\n'},{name:"distinct values",type:"function",params:[{name:"list"}],info:'<p>Returns the given list without duplicates.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">distinct values(list: list): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">distinct values([1,2,3,2,1])\n// [1,2,3]\n</code></pre>\n'},{name:"flatten",type:"function",params:[{name:"list"}],info:'<p>Returns a list that includes all elements of the given list without nested lists.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">flatten(list: list): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">flatten([[1,2],[[3]], 4])\n// [1,2,3,4]\n</code></pre>\n'},{name:"sort",type:"function",params:[{name:"list"},{name:"precedes"}],info:'<p>Returns the given list sorted by the <code>precedes</code> function.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">sort(list: list, precedes: function&lt;(Any, Any) -&gt; boolean&gt;): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">sort(list: [3,1,4,5,2], precedes: function(x,y) x &lt; y)\n// [1,2,3,4,5]\n</code></pre>\n'},{name:"string join",type:"function",params:[{name:"list"}],info:'<p>Joins a list of strings into a single string. This is similar to\nJava&#39;s <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Collectors.html#joining(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)">joining</a>\nfunction.</p>\n<p>If an item of the list is <code>null</code>, the item is ignored for the result string. If an item is\nneither a string nor <code>null</code>, the function returns <code>null</code> instead of a string.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">string join(list: list&lt;string&gt;): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">string join([&quot;a&quot;,&quot;b&quot;,&quot;c&quot;])\n// &quot;abc&quot;\n\nstring join([&quot;a&quot;,null,&quot;c&quot;])\n// &quot;ac&quot;\n\nstring join([])\n// &quot;&quot;\n</code></pre>\n'},{name:"string join",type:"function",params:[{name:"list"},{name:"delimiter"}],info:'<p>Joins a list of strings into a single string. This is similar to\nJava&#39;s <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Collectors.html#joining(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)">joining</a>\nfunction.</p>\n<p>If an item of the list is <code>null</code>, the item is ignored for the result string. If an item is\nneither a string nor <code>null</code>, the function returns <code>null</code> instead of a string.</p>\n<p>The resulting string contains a <code>delimiter</code> between each element.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">string join(list: list&lt;string&gt;, delimiter: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">string join([&quot;a&quot;], &quot;X&quot;)\n// &quot;a&quot;\n\nstring join([&quot;a&quot;,&quot;b&quot;,&quot;c&quot;], &quot;, &quot;)\n// &quot;a, b, c&quot;\n</code></pre>\n'},{name:"decimal",type:"function",params:[{name:"n"},{name:"scale"}],info:'<p>Rounds the given value at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">decimal(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">decimal(1/3, 2)\n// .33\n\ndecimal(1.5, 0)\n// 2\n</code></pre>\n'},{name:"floor",type:"function",params:[{name:"n"}],info:'<p>Rounds the given value with rounding mode flooring.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">floor(n: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">floor(1.5)\n// 1\n\nfloor(-1.5)\n// -2\n</code></pre>\n'},{name:"floor",type:"function",params:[{name:"n"},{name:"scale"}],info:'<p>Rounds the given value with rounding mode flooring at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">floor(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">floor(-1.56, 1)\n// -1.6\n</code></pre>\n'},{name:"ceiling",type:"function",params:[{name:"n"}],info:'<p>Rounds the given value with rounding mode ceiling.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">ceiling(n: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">ceiling(1.5)\n// 2\n\nceiling(-1.5)\n// -1\n</code></pre>\n'},{name:"ceiling",type:"function",params:[{name:"n"},{name:"scale"}],info:'<p>Rounds the given value with rounding mode ceiling at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">ceiling(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">ceiling(-1.56, 1)\n// -1.5\n</code></pre>\n'},{name:"round up",type:"function",params:[{name:"n"},{name:"scale"}],info:'<p>Rounds the given value with the rounding mode round-up at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">round up(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">round up(5.5)\n// 6\n\nround up(-5.5)\n// -6\n\nround up(1.121, 2)\n// 1.13\n\nround up(-1.126, 2)\n// -1.13\n</code></pre>\n'},{name:"round down",type:"function",params:[{name:"n"},{name:"scale"}],info:'<p>Rounds the given value with the rounding mode round-down at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">round down(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">round down(5.5, 0)\n// 5\n\nround down (-5.5, 0)\n// -5\n\nround down (1.121, 2)\n// 1.12\n\nround down (-1.126, 2)\n// -1.12\n</code></pre>\n'},{name:"round half up",type:"function",params:[{name:"n"},{name:"scale"}],info:'<p>Rounds the given value with the rounding mode round-half-up at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">round half up(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">round half up(5.5, 0)\n// 6\n\nround half up(-5.5, 0)\n// -6\n\nround half up(1.121, 2)\n// 1.12\n\nround half up(-1.126, 2)\n// -1.13\n</code></pre>\n'},{name:"round half down",type:"function",params:[{name:"n"},{name:"scale"}],info:'<p>Rounds the given value with the rounding mode round-half-down at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">round half down(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">round half down (5.5, 0)\n// 5\n\nround half down (-5.5, 0)\n// -5\n\nround half down (1.121, 2)\n// 1.12\n\nround half down (-1.126, 2)\n// -1.13\n</code></pre>\n'},{name:"abs",type:"function",params:[{name:"number"}],info:'<p>Returns the absolute value of the given numeric value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">abs(number: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">abs(10)\n// 10\n\nabs(-10)\n// 10\n</code></pre>\n'},{name:"modulo",type:"function",params:[{name:"dividend"},{name:"divisor"}],info:'<p>Returns the remainder of the division of dividend by divisor.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">modulo(dividend: number, divisor: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">modulo(12, 5)\n// 2\n</code></pre>\n'},{name:"sqrt",type:"function",params:[{name:"number"}],info:'<p>Returns the square root of the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">sqrt(number: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">sqrt(16)\n// 4\n</code></pre>\n'},{name:"log",type:"function",params:[{name:"number"}],info:'<p>Returns the natural logarithm (base e) of the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">log(number: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">log(10)\n// 2.302585092994046\n</code></pre>\n'},{name:"exp",type:"function",params:[{name:"number"}],info:'<p>Returns the Euler’s number e raised to the power of the given number .</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">exp(number: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">exp(5)\n// 148.4131591025766\n</code></pre>\n'},{name:"odd",type:"function",params:[{name:"number"}],info:'<p>Returns <code>true</code> if the given value is odd. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">odd(number: number): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">odd(5)\n// true\n\nodd(2)\n// false\n</code></pre>\n'},{name:"even",type:"function",params:[{name:"number"}],info:'<p>Returns <code>true</code> if the given is even. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">even(number: number): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">even(5)\n// false\n\neven(2)\n// true\n</code></pre>\n'},{name:"before",type:"function",params:[{name:"point1"},{name:"point2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">before(point1: Any, point2: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">before(1, 10)\n// true\n\nbefore(10, 1)\n// false\n</code></pre>\n'},{name:"before",type:"function",params:[{name:"range"},{name:"point"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">before(range: range, point: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">before([1..5], 10)\n// true\n</code></pre>\n'},{name:"before",type:"function",params:[{name:"point"},{name:"range"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">before(point: Any, range: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">before(1, [2..5])\n// true\n</code></pre>\n'},{name:"before",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">before(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">before([1..5], [6..10])\n// true\n\nbefore([1..5),[5..10])\n// true\n</code></pre>\n'},{name:"after",type:"function",params:[{name:"point1"},{name:"point2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">after(point1: Any, point2: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">after(10, 1)\n// true\n\nafter(1, 10)\n// false\n</code></pre>\n'},{name:"after",type:"function",params:[{name:"range"},{name:"point"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">after(range: range, point: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">after([1..5], 10)\n// false\n</code></pre>\n'},{name:"after",type:"function",params:[{name:"point"},{name:"range"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">after(point: Any, range: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">after(12, [2..5])\n// true\n</code></pre>\n'},{name:"after",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">after(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">after([6..10], [1..5])\n// true\n\nafter([5..10], [1..5))\n// true\n</code></pre>\n'},{name:"meets",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">meets(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">meets([1..5], [5..10])\n// true\n\nmeets([1..3], [4..6])\n// false\n\nmeets([1..3], [3..5])\n// true\n\nmeets([1..5], (5..8])\n// false\n</code></pre>\n'},{name:"met by",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">met by(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">met by([5..10], [1..5])\n// true\n\nmet by([3..4], [1..2])\n// false\n\nmet by([3..5], [1..3])\n// true\n\nmet by((5..8], [1..5))\n// false\n\nmet by([5..10], [1..5))\n// false\n</code></pre>\n'},{name:"overlaps",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">overlaps(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">overlaps([5..10], [1..6])\n// true\n\noverlaps((3..7], [1..4])\n// true\n\noverlaps([1..3], (3..6])\n// false\n\noverlaps((5..8], [1..5))\n// false\n\noverlaps([4..10], [1..5))\n// true\n</code></pre>\n'},{name:"overlaps before",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">overlaps before(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">overlaps before([1..5], [4..10])\n// true\n\noverlaps before([3..4], [1..2])\n// false\n\noverlaps before([1..3], (3..5])\n// false\n\noverlaps before([1..5), (3..8])\n// true\n\noverlaps before([1..5), [5..10])\n// false\n</code></pre>\n'},{name:"overlaps after",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">overlaps after(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">overlaps after([4..10], [1..5])\n// true\n\noverlaps after([3..4], [1..2])\n// false\n\noverlaps after([3..5], [1..3))\n// false\n\noverlaps after((5..8], [1..5))\n// false\n\noverlaps after([4..10], [1..5))\n// true\n</code></pre>\n'},{name:"finishes",type:"function",params:[{name:"point"},{name:"range"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">finishes(point: Any, range: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">finishes(5, [1..5])\n// true\n\nfinishes(10, [1..7])\n// false\n</code></pre>\n'},{name:"finishes",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">finishes(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">finishes([3..5], [1..5])\n// true\n\nfinishes((1..5], [1..5))\n// false\n\nfinishes([5..10], [1..10))\n// false\n</code></pre>\n'},{name:"finished by",type:"function",params:[{name:"range"},{name:"point"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">finished by(range: range, point: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">finished by([5..10], 10)\n// true\n\nfinished by([3..4], 2)\n// false\n</code></pre>\n'},{name:"finished by",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">finished by(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">finished by([1..5], [3..5])\n// true\n\nfinished by((5..8], [1..5))\n// false\n\nfinished by([5..10], (1..10))\n// false\n</code></pre>\n'},{name:"includes",type:"function",params:[{name:"range"},{name:"point"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">includes(range: range, point: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">includes([5..10], 6)\n// true\n\nincludes([3..4], 5)\n// false\n</code></pre>\n'},{name:"includes",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">includes(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">includes([1..10], [4..6])\n// true\n\nincludes((5..8], [1..5))\n// false\n\nincludes([1..10], [1..5))\n// true\n</code></pre>\n'},{name:"during",type:"function",params:[{name:"point"},{name:"range"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">during(point: Any, range: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">during(5, [1..10])\n// true\n\nduring(12, [1..10])\n// false\n\nduring(1, (1..10])\n// false\n</code></pre>\n'},{name:"during",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">during(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">during([4..6], [1..10))\n// true\n\nduring((1..5], (1..10])\n// true\n</code></pre>\n'},{name:"starts",type:"function",params:[{name:"point"},{name:"range"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">starts(point: Any, range: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">starts(1, [1..5])\n// true\n\nstarts(1, (1..8])\n// false\n</code></pre>\n'},{name:"starts",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">starts(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">starts((1..5], [1..5])\n// false\n\nstarts([1..10], [1..5])\n// false\n\nstarts((1..5), (1..10))\n// true\n</code></pre>\n'},{name:"started by",type:"function",params:[{name:"range"},{name:"point"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">started by(range: range, point: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">started by([1..10], 1)\n// true\n\nstarted by((1..10], 1)\n// false\n</code></pre>\n'},{name:"started by",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">started by(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">started by([1..10], [1..5])\n// true\n\nstarted by((1..10], [1..5))\n// false\n\nstarted by([1..10], [1..10))\n// true\n</code></pre>\n'},{name:"coincides",type:"function",params:[{name:"point1"},{name:"point2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">coincides(point1: Any, point2: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">coincides(5, 5)\n// true\n\ncoincides(3, 4)\n// false\n</code></pre>\n'},{name:"coincides",type:"function",params:[{name:"range1"},{name:"range2"}],info:'<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">coincides(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">coincides([1..5], [1..5])\n// true\n\ncoincides((1..5], [1..5))\n// false\n\ncoincides([1..5], [2..6])\n// false\n</code></pre>\n'},{name:"substring",type:"function",params:[{name:"string"},{name:"start position"}],info:'<p>Returns a substring of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">substring(string: string, start position: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">substring(&quot;foobar&quot;, 3)\n// &quot;obar&quot;\n\nsubstring(&quot;foobar&quot;, -2)\n// &quot;ar&quot;\n</code></pre>\n'},{name:"substring",type:"function",params:[{name:"string"},{name:"start position"},{name:"length"}],info:'<p>Returns a substring of the given value, starting at <code>start position</code> with the given <code>length</code>. If <code>length</code> is greater than\nthe remaining characters of the value, it returns all characters from <code>start position</code> until the end.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">substring(string: string, start position: number, length: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">substring(&quot;foobar&quot;, 3, 3)\n// &quot;oba&quot;\n\nsubstring(&quot;foobar&quot;, -3, 2)\n// &quot;ba&quot;\n\nsubstring(&quot;foobar&quot;, 3, 10)\n// &quot;obar&quot;\n</code></pre>\n'},{name:"string length",type:"function",params:[{name:"string"}],info:'<p>Returns the number of characters in the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">string length(string: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">string length(&quot;foo&quot;)\n// 3\n</code></pre>\n'},{name:"upper case",type:"function",params:[{name:"string"}],info:'<p>Returns the given value with all characters are uppercase.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">upper case(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">upper case(&quot;aBc4&quot;)\n// &quot;ABC4&quot;\n</code></pre>\n'},{name:"lower case",type:"function",params:[{name:"string"}],info:'<p>Returns the given value with all characters are lowercase.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">lower case(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">lower case(&quot;aBc4&quot;)\n// &quot;abc4&quot;\n</code></pre>\n'},{name:"substring before",type:"function",params:[{name:"string"},{name:"match"}],info:'<p>Returns a substring of the given value that contains all characters before <code>match</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">substring before(string: string, match: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">substring before(&quot;foobar&quot;, &quot;bar&quot;)\n// &quot;foo&quot;\n</code></pre>\n'},{name:"substring after",type:"function",params:[{name:"string"},{name:"match"}],info:'<p>Returns a substring of the given value that contains all characters after <code>match</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">substring after(string: string, match: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">substring after(&quot;foobar&quot;, &quot;ob&quot;)\n// &quot;ar&quot;\n</code></pre>\n'},{name:"contains",type:"function",params:[{name:"string"},{name:"match"}],info:'<p>Returns <code>true</code> if the given value contains the substring <code>match</code>. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">contains(string: string, match: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">contains(&quot;foobar&quot;, &quot;of&quot;)\n// false\n</code></pre>\n'},{name:"starts with",type:"function",params:[{name:"string"},{name:"match"}],info:'<p>Returns <code>true</code> if the given value starts with the substring <code>match</code>. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">starts with(string: string, match: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">starts with(&quot;foobar&quot;, &quot;fo&quot;)\n// true\n</code></pre>\n'},{name:"ends with",type:"function",params:[{name:"string"},{name:"match"}],info:'<p>Returns <code>true</code> if the given value ends with the substring <code>match</code>. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">ends with(string: string, match: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">ends with(&quot;foobar&quot;, &quot;r&quot;)\n// true\n</code></pre>\n'},{name:"matches",type:"function",params:[{name:"input"},{name:"pattern"}],info:'<p>Returns <code>true</code> if the given value matches the <code>pattern</code>. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">matches(input: string, pattern: string): boolean\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">matches(&quot;foobar&quot;, &quot;^fo*bar&quot;)\n// true\n</code></pre>\n'},{name:"matches",type:"function",params:[{name:"input"},{name:"pattern"},{name:"flags"}],info:'<p>Returns <code>true</code> if the given value matches the <code>pattern</code>. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">matches(input: string, pattern: string, flags: string): boolean\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p>The <code>flags</code> can contain one or more of the following characters:</p>\n<ul>\n<li><code>s</code> (dot-all)</li>\n<li><code>m</code> (multi-line)</li>\n<li><code>i</code> (case insensitive)</li>\n<li><code>x</code> (comments)</li>\n</ul>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">matches(&quot;FooBar&quot;, &quot;foo&quot;, &quot;i&quot;)\n// true\n</code></pre>\n'},{name:"replace",type:"function",params:[{name:"input"},{name:"pattern"},{name:"replacement"}],info:'<p>Returns the resulting string after replacing all occurrences of <code>pattern</code> with <code>replacement</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">replace(input: string, pattern: string, replacement: string): string\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p>The <code>replacement</code> can access the match groups by using <code>$</code> and the number of the group, for example,\n<code>$1</code> to access the first group.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">replace(&quot;abcd&quot;, &quot;(ab)|(a)&quot;, &quot;[1=$1][2=$2]&quot;)\n// &quot;[1=ab][2=]cd&quot;\n\nreplace(&quot;0123456789&quot;, &quot;(\\d{3})(\\d{3})(\\d{4})&quot;, &quot;($1) $2-$3&quot;)\n// &quot;(012) 345-6789&quot;\n</code></pre>\n'},{name:"replace",type:"function",params:[{name:"input"},{name:"pattern"},{name:"replacement"},{name:"flags"}],info:'<p>Returns the resulting string after replacing all occurrences of <code>pattern</code> with <code>replacement</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">replace(input: string, pattern: string, replacement: string, flags: string): string\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p>The <code>replacement</code> can access the match groups by using <code>$</code> and the number of the group, for example,\n<code>$1</code> to access the first group.</p>\n<p>The <code>flags</code> can contain one or more of the following characters:</p>\n<ul>\n<li><code>s</code> (dot-all)</li>\n<li><code>m</code> (multi-line)</li>\n<li><code>i</code> (case insensitive)</li>\n<li><code>x</code> (comments)</li>\n</ul>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">replace(&quot;How do you feel?&quot;, &quot;Feel&quot;, &quot;FEEL&quot;, &quot;i&quot;)\n// &quot;How do you FEEL?&quot;\n</code></pre>\n'},{name:"split",type:"function",params:[{name:"string"},{name:"delimiter"}],info:'<p>Splits the given value into a list of substrings, breaking at each occurrence of the <code>delimiter</code> pattern.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">split(string: string, delimiter: string): list&lt;string&gt;\n</code></pre>\n<p>The <code>delimiter</code> is a string that contains a regular expression.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">split(&quot;John Doe&quot;, &quot;\\s&quot; )\n// [&quot;John&quot;, &quot;Doe&quot;]\n\nsplit(&quot;a;b;c;;&quot;, &quot;;&quot;)\n// [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;&quot;, &quot;&quot;]\n</code></pre>\n'},{name:"now",type:"function",params:[],info:'<p>Returns the current date and time including the timezone.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">now(): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">now()\n// date and time(&quot;2020-07-31T14:27:30@Europe/Berlin&quot;)\n</code></pre>\n<p>In Camunda, <code>now()</code> uses the default time zone of the cluster. FEEL shows the zone ID after <code>@</code>, for example <code>@Europe/Berlin</code>. If you store the result in a variable, the zone ID is written in brackets after the offset instead, for example <code>2026-09-29T12:31:01.641Z[GMT]</code>, which some ISO 8601 parsers reject. To store the value without the zone ID, convert it to a fixed offset. See <a href="https://docs.camunda.io/components/concepts/variables#variable-values">variable values</a>.</p>\n<pre><code class="language-feel">date and time(now(), &quot;Z&quot;)\n// date and time(&quot;2020-07-31T12:27:30Z&quot;)\n</code></pre>\n'},{name:"today",type:"function",params:[],info:'<p>Returns the current date.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">today(): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">today()\n// date(&quot;2020-07-31&quot;)\n</code></pre>\n'},{name:"day of week",type:"function",params:[{name:"date"}],info:'<p>Returns the day of the week according to the Gregorian calendar. Note that it always returns the English name of the day.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">day of week(date: date): string\n</code></pre>\n<pre><code class="language-feel">day of week(date: date and time): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">day of week(date(&quot;2019-09-17&quot;))\n// &quot;Tuesday&quot;\n\nday of week(date and time(&quot;2019-09-17T12:00:00&quot;))\n// &quot;Tuesday&quot;\n</code></pre>\n'},{name:"day of year",type:"function",params:[{name:"date"}],info:'<p>Returns the Gregorian number of the day within the year.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">day of year(date: date): number\n</code></pre>\n<pre><code class="language-feel">day of year(date: date and time): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">day of year(date(&quot;2019-09-17&quot;))\n// 260\n\nday of year(date and time(&quot;2019-09-17T12:00:00&quot;))\n// 260\n</code></pre>\n'},{name:"week of year",type:"function",params:[{name:"date"}],info:'<p>Returns the Gregorian number of the week within the year, according to ISO 8601.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">week of year(date: date): number\n</code></pre>\n<pre><code class="language-feel">week of year(date: date and time): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">week of year(date(&quot;2019-09-17&quot;))\n// 38\n\nweek of year(date and time(&quot;2019-09-17T12:00:00&quot;))\n// 38\n</code></pre>\n'},{name:"month of year",type:"function",params:[{name:"date"}],info:'<p>Returns the month of the year according to the Gregorian calendar. Note that it always returns the English name of the month.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">month of year(date: date): string\n</code></pre>\n<pre><code class="language-feel">month of year(date: date and time): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">month of year(date(&quot;2019-09-17&quot;))\n// &quot;September&quot;\n\nmonth of year(date and time(&quot;2019-09-17T12:00:00&quot;))\n// &quot;September&quot;\n</code></pre>\n'},{name:"abs",type:"function",params:[{name:"n"}],info:'<p>Returns the absolute value of a given duration.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">abs(n: days and time duration): days and time duration\n</code></pre>\n<pre><code class="language-feel">abs(n: years and months duration): years and months duration\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">abs(duration(&quot;-PT5H&quot;))\n// &quot;duration(&quot;PT5H&quot;)&quot;\n\nabs(duration(&quot;PT5H&quot;))\n// &quot;duration(&quot;PT5H&quot;)&quot;\n\nabs(duration(&quot;-P2M&quot;))\n// duration(&quot;P2M&quot;)\n</code></pre>\n'},{name:"fromAi",type:"function",params:[{name:"value"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter, which must be a FEEL variable reference in the form <code>toolCall.&lt;parameterName&gt;</code> (for example, <code>toolCall.userId</code>).</p>\n<ul>\n<li>The purpose of this function is solely to tag the value as being generated by an AI integration.</li>\n<li>The actual handling is not performed by the FEEL engine, but by a custom integration such as a connector or a job worker.</li>\n</ul>\n<p>The main use case of this function is for <a href="https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/agentic-ai-aiagent-tool-definitions">tool definitions</a> used by the <a href="https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/agentic-ai-aiagent">AI Agent connector</a>.</p>\n<p>See the following function overloads for additional function parameters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.searchQuery)\n// toolCall.searchQuery contents\n\nfromAi(toolCall.userId)\n// toolCall.userId contents\n</code></pre>\n',engines:{camunda:">=8.8"}},{name:"fromAi",type:"function",params:[{name:"value"},{name:"description"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter, which must be a FEEL variable reference in the form <code>toolCall.&lt;parameterName&gt;</code> (for example, <code>toolCall.userId</code>).</p>\n<p>In addition to the previous overload, it also accepts an optional <code>description</code> parameter to provide a textual description of the value. The description must be <code>null</code> or a string constant.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.searchQuery, &quot;The search query used to find the best match.&quot;)\n// toolCall.searchQuery contents\n\nfromAi(toolCall.searchQuery, null)\n// toolCall.searchQuery contents\n</code></pre>\n',engines:{camunda:">=8.8"}},{name:"fromAi",type:"function",params:[{name:"value"},{name:"description"},{name:"type"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter, which must be a FEEL variable reference in the form <code>toolCall.&lt;parameterName&gt;</code> (for example, <code>toolCall.userId</code>).</p>\n<p>In addition to the previous overload, it also accepts an optional <code>type</code> parameter to provide type information about the value. The type must be <code>null</code> or a string constant.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string, type: string): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.searchQuery, &quot;The search query used to find the best match.&quot;, &quot;string&quot;)\n// toolCall.searchQuery contents\n\nfromAi(toolCall.userId, &quot;The user&#39;s ID&quot;, &quot;number&quot;)\n// toolCall.userId contents\n\nfromAi(toolCall.userId, null, &quot;number&quot;)\n// toolCall.userId contents\n\nfromAi(value: toolCall.userId, type: &quot;number&quot;)\n// toolCall.userId contents\n</code></pre>\n',engines:{camunda:">=8.8"}},{name:"fromAi",type:"function",params:[{name:"value"},{name:"description"},{name:"type"},{name:"schema"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter, which must be a FEEL variable reference in the form <code>toolCall.&lt;parameterName&gt;</code> (for example, <code>toolCall.userId</code>).</p>\n<p>In addition to the previous overload, it also accepts an optional <code>schema</code> parameter to provide a (partial) <a href="https://json-schema.org/">JSON schema</a> for the value.</p>\n<ul>\n<li>The schema must be <code>null</code> or a context (map) containing only constant values. For example, function calls within the schema are not supported.</li>\n<li>The schema is not validated by the FEEL engine but might be by a custom integration consuming the information.</li>\n<li>From the engine side it is possible to specify both a <code>type</code> and a <code>schema</code>, and it depends on the integration as to which value takes precedence. The <a href="https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/agentic-ai-aiagent">AI Agent connector</a> will override any type specified in the schema if the <code>type</code> parameter is also provided.</li>\n</ul>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string, type: string, schema: context): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.documentType, &quot;The document type to provide&quot;, &quot;string&quot;, {\n enum: [&quot;invoice&quot;, &quot;receipt&quot;, &quot;contract&quot;]\n})\n// toolCall.documentType contents\n\nfromAi(value: toolCall.documentType, description: &quot;The document type to provide&quot;, schema: {\n type: &quot;string&quot;,\n enum: [&quot;invoice&quot;, &quot;receipt&quot;, &quot;contract&quot;]\n})\n// toolCall.documentType contents\n\nfromAi(toolCall.tags, &quot;Tags to apply to the blog post&quot;, &quot;array&quot;, {\n items: {\n type: &quot;string&quot;\n }\n})\n// toolCall.tags contents\n</code></pre>\n',engines:{camunda:">=8.8"}},{name:"fromAi",type:"function",params:[{name:"value"},{name:"description"},{name:"type"},{name:"schema"},{name:"options"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns the unmodified <code>value</code> parameter, which must be a FEEL variable reference in the form <code>toolCall.&lt;parameterName&gt;</code> (for example, <code>toolCall.userId</code>).</p>\n<p>In addition to the previous overload, it also accepts an optional <code>options</code> parameter to provide additional options for the integration handling the value definition.</p>\n<ul>\n<li>The options parameter must be <code>null</code> or a context (map) containing only constant values. For example, function calls within options are not supported.</li>\n</ul>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">fromAi(value: Any, description: string, type: string, schema: context, options: context): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">fromAi(toolCall.documentType, &quot;The document type to provide&quot;, &quot;string&quot;, null, {\n required: false\n})\n// toolCall.documentType contents\n\nfromAi(value: toolCall.documentType, options: {\n required: false\n})\n// toolCall.documentType contents\n</code></pre>\n',engines:{camunda:">=8.8"}},{name:"is defined",type:"function",params:[{name:"value"}],info:'<p><em>Camunda Extension</em></p>\n<p>Checks if a given value is not <code>null</code>. If the value is <code>null</code> then the function returns <code>false</code>.\nOtherwise, the function returns <code>true</code>.</p>\n<p>The function requires one argument. Calling <code>is defined()</code> without an argument is invalid.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">is defined(value: Any): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">is defined(1)\n// true\n\nis defined(null)\n// false\n\nis defined(x)\n// false - if no variable &quot;x&quot; exists\n\nis defined(x.y)\n// false - if no variable &quot;x&quot; exists or it doesn&#39;t have a property &quot;y&quot;\n\nis defined()\n// error - expected one argument\n</code></pre>\n<p>:::caution Breaking change</p>\n<p>This function worked differently in previous versions. It returned <code>true</code> if the value was <code>null</code>.\nSince this version, the function returns <code>false</code> if the value is <code>null</code>.</p>\n<p>:::</p>\n'},{name:"get or else",type:"function",params:[{name:"value"},{name:"default"}],info:'<p><em>Camunda Extension</em></p>\n<p>Return the provided value parameter if not <code>null</code>, otherwise return the default parameter</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get or else(value: Any, default: Any): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get or else(&quot;this&quot;, &quot;default&quot;)\n// &quot;this&quot;\n\nget or else(null, &quot;default&quot;)\n// &quot;default&quot;\n\nget or else(null, null)\n// null\n</code></pre>\n',engines:{camunda:">=8.3"}},{name:"assert",type:"function",params:[{name:"value"},{name:"condition"}],info:'<p><em>Camunda Extension</em></p>\n<p>Verify that the given condition is met. If the condition is <code>true</code>, the function returns the value.\nOtherwise, the evaluation fails with an error.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">assert(value: Any, condition: Any)\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">assert(x, x != null)\n// &quot;value&quot; - if x is &quot;value&quot;\n// error - if x is null or doesn&#39;t exist\n\nassert(x, x &gt;= 0)\n// 4 - if x is 4\n// error - if x is less than zero\n</code></pre>\n',engines:{camunda:">=8.3"}},{name:"assert",type:"function",params:[{name:"value"},{name:"condition"},{name:"cause"}],info:'<p><em>Camunda Extension</em></p>\n<p>Verify that the given condition is met. If the condition is <code>true</code>, the function returns the value.\nOtherwise, the evaluation fails with an error containing the given message.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">assert(value: Any, condition: Any, cause: String)\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">assert(x, x != null, &quot;&#39;x&#39; should not be null&quot;)\n// &quot;value&quot; - if x is &quot;value&quot;\n// error(&#39;x&#39; should not be null) - if x is null or doesn&#39;t exist\n\nassert(x, x &gt;= 0, &quot;&#39;x&#39; should be positive&quot;)\n// 4 - if x is 4\n// error(&#39;x&#39; should be positive) - if x is less than zero\n</code></pre>\n',engines:{camunda:">=8.3"}},{name:"get value",type:"function",params:[{name:"context"},{name:"keys"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns the value of the context entry for a context path defined by the given keys.</p>\n<p>If <code>keys</code> contains the keys <code>[k1, k2]</code> then it returns the value at the nested entry <code>k1.k2</code> of the context.</p>\n<p>If <code>keys</code> are empty or the nested entry defined by the keys doesn&#39;t exist in the context, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">get value(context: context, keys: list&lt;string&gt;): Any\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">get value({x:1, y: {z:0}}, [&quot;y&quot;, &quot;z&quot;])\n// 0\n\nget value({x: {y: {z:0}}}, [&quot;x&quot;, &quot;y&quot;])\n// {z:0}\n\nget value({a: {b: 3}}, [&quot;b&quot;])\n// null\n</code></pre>\n'},{name:"context put",type:"function",params:[{name:"context"},{name:"key"},{name:"value"}],info:'<p>Adds a new entry with the given key and value to the context. Returns a new context that includes the entry.</p>\n<p>If an entry for the same key already exists in the context, it overrides the value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context put(context: context, key: string, value: Any): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context put({x:1}, &quot;y&quot;, 2)\n// {x:1, y:2}\n</code></pre>\n<p>:::info\nThe function <code>context put()</code> replaced the previous function <code>put()</code> (Camunda Extension). The\nprevious function is deprecated and should not be used anymore.\n:::</p>\n'},{name:"context merge",type:"function",params:[{name:"contexts"}],info:'<p>Union the given contexts. Returns a new context that includes all entries of the given contexts.</p>\n<p>If an entry for the same key already exists in a context, it overrides the value. The entries are overridden in the same order as in the list of contexts.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">context merge(contexts: list&lt;context&gt;): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">context merge([{x:1}, {y:2}])\n// {x:1, y:2}\n\ncontext merge([{x:1, y: 0}, {y:2}])\n// {x:1, y:2}\n</code></pre>\n<p>:::info\nThe function <code>context merge()</code> replaced the previous function <code>put all()</code> (Camunda Extension). The\nprevious function is deprecated and should not be used anymore.\n:::</p>\n',engines:{camunda:">=8.2"}},{name:"date and time",type:"function",params:[{name:"date"},{name:"timezone"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns the given date and time value at the given timezone.</p>\n<p>If <code>date</code> has a different timezone than <code>timezone</code> then it adjusts the time to match the local time of <code>timezone</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">date and time(date: date and time, timezone: string): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">date and time(@&quot;2020-07-31T14:27:30@Europe/Berlin&quot;, &quot;America/Los_Angeles&quot;)\n// date and time(&quot;2020-07-31T05:27:30@America/Los_Angeles&quot;)\n\ndate and time(@&quot;2020-07-31T14:27:30&quot;, &quot;Z&quot;)\n// date and time(&quot;2020-07-31T12:27:30Z&quot;)\n</code></pre>\n'},{name:"duplicate values",type:"function",params:[{name:"list"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns all duplicate values of the given list.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">duplicate values(list: list): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">duplicate values([1,2,3,2,1])\n// [1,2]\n</code></pre>\n',engines:{camunda:">=8.3"}},{name:"string join",type:"function",params:[{name:"list"},{name:"delimiter"},{name:"prefix"},{name:"suffix"}],info:'<p><em>Camunda Extension</em></p>\n<p>Joins a list of strings into a single string. This is similar to\nJava&#39;s <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Collectors.html#joining(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)">joining</a>\nfunction.</p>\n<p>If an item of the list is <code>null</code>, the item is ignored for the result string. If an item is\nneither a string nor <code>null</code>, the function returns <code>null</code> instead of a string.</p>\n<p>The resulting string starts with <code>prefix</code>, contains a <code>delimiter</code> between each element, and ends\nwith <code>suffix</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">string join(list: list&lt;string&gt;, delimiter: string, prefix: string, suffix: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">string join([&quot;a&quot;,&quot;b&quot;,&quot;c&quot;], &quot;, &quot;, &quot;[&quot;, &quot;]&quot;)\n// &quot;[a, b, c]&quot;\n</code></pre>\n'},{name:"is empty",type:"function",params:[{name:"list"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given list is empty. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">is empty(list: list): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">is empty([])\n// true\n\nis empty([1,2,3])\n// false\n</code></pre>\n',engines:{camunda:">=8.6"}},{name:"partition",type:"function",params:[{name:"list"},{name:"size"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns consecutive sublists of a list, each of the same size (the final list may be smaller).</p>\n<p>If <code>size</code> is less than <code>0</code>, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">partition(list: list, size: number): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">partition([1,2,3,4,5], 2)\n// [[1,2], [3,4], [5]]\n\npartition([], 2)\n// []\n\npartition([1,2], 0)\n// null\n</code></pre>\n',engines:{camunda:">=8.7"}},{name:"random number",type:"function",params:[],info:'<p><em>Camunda Extension</em></p>\n<p>Returns a random number between <code>0</code> and <code>1</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">random number(): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">random number()\n// 0.9701618132579795\n</code></pre>\n',engines:{camunda:">=8.2"}},{name:"extract",type:"function",params:[{name:"string"},{name:"pattern"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns all matches of the pattern in the given string. Returns an empty list if the pattern doesn&#39;t\nmatch.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">extract(string: string, pattern: string): list&lt;string&gt;\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">extract(&quot;references are 1234, 1256, 1378&quot;, &quot;12[0-9]*&quot;)\n// [&quot;1234&quot;,&quot;1256&quot;]\n</code></pre>\n'},{name:"trim",type:"function",params:[{name:"string"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns the given string without leading and trailing spaces.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">trim(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">trim(&quot; hello world &quot;)\n// &quot;hello world&quot;\n\ntrim(&quot;hello world &quot;)\n// &quot;hello world&quot;\n</code></pre>\n',engines:{camunda:">=8.6"}},{name:"uuid",type:"function",params:[],info:'<p><em>Camunda Extension</em></p>\n<p>Returns a UUID (Universally Unique Identifier) with 36 characters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">uuid(): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">uuid()\n// &quot;7793aab1-d761-4d38-916b-b7270e309894&quot;\n</code></pre>\n',engines:{camunda:">=8.6"}},{name:"to base64",type:"function",params:[{name:"value"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns the given string encoded in Base64 format.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">to base64(value: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">to base64(&quot;FEEL&quot;)\n// &quot;RkVFTA==&quot;\n</code></pre>\n',engines:{camunda:">=8.6"}},{name:"from base64",type:"function",params:[{name:"value"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns the given Base64 encoded string decoded to a plain string.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">from base64(value: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">from base64(&quot;RkVFTA==&quot;)\n// &quot;FEEL&quot;\n</code></pre>\n',engines:{camunda:">=8.9"}},{name:"is blank",type:"function",params:[{name:"string"}],info:'<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given string is blank (empty or contains only whitespaces).</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">is blank(string: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">is blank(&quot;&quot;)\n// true\n\nis blank(&quot; &quot;)\n// true\n\nis blank(&quot;hello world&quot;)\n// false\n</code></pre>\n',engines:{camunda:">=8.8"}},{name:"last day of month",type:"function",params:[{name:"date"}],info:'<p><em>Camunda Extension</em></p>\n<p>Takes the month of the given date or date-time value and returns the last day of this month.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class="language-feel">last day of month(date: date): date\n</code></pre>\n<pre><code class="language-feel">last day of month(date: date and time): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class="language-feel">last day of month(date(&quot;2022-10-01&quot;))\n// date(&quot;2022-10-31&quot;))\n\nlast day of month(date and time(&quot;2022-10-16T12:00:00&quot;))\n// date(&quot;2022-10-31&quot;))\n</code></pre>\n',engines:{camunda:">=8.2"}}];var Pq=[UA.theme({"& .cm-content":{padding:"0px"},"& .cm-line":{padding:"0px"},"&.cm-editor.cm-focused":{outline:"none"},"& .cm-completionInfo":{whiteSpace:"pre-wrap",overflow:"hidden",textOverflow:"ellipsis"},"&.cm-editor":{height:"100%"},"& .cm-completionInfo > *":{whiteSpace:"normal"},"& .cm-completionInfo ul":{margin:0,paddingLeft:"15px"},"& .cm-completionInfo pre":{marginBottom:0,whiteSpace:"pre-wrap"},"& .cm-completionInfo p":{marginTop:0},"& .cm-completionInfo p:not(:last-of-type)":{marginBottom:0}}),cq];function Aq(e){return e&&e.from===e.to}function Tq(e){return!!e&&("PathExpression"===e.name||Tq(e.parent))}function Rq({variables:e}){return t=>{const n=CM(t.state).resolve(t.pos,-1);if(!Tq(n))return null;const i=function(e){for(;e;){if("PathExpression"===e.name)return e;e=e.parent}}(n),r=n===i||"."===n.name?t.pos:n.from,o=Mq(i,t);let s=e;for(var a=0;a<o.length-1;a++){var l=s.find(e=>e.name===o[a].name);if(!l)return null;if("optional"!==l.isList&&!!l.isList!==o[a].isList)return null;s=l.entries}if(!s)return null;return{from:r,options:s.map(e=>({label:e.name,type:"variable",info:e.info,detail:e.detail}))}}}function Mq(e,t){let n=[];for(let i=e.firstChild;i;i=i.nextSibling)"."!==i.name&&("PathExpression"===i.name?n.push(...Mq(i,t)):"FilterExpression"===i.name?n.push(...$q(i,t)):n.push({name:Dq(i,t),isList:!1}));return n}function $q(e,t){const n=e.firstChild;if("PathExpression"===n.name){const e=Mq(n,t);return e[e.length-1].isList=!0,e}return[{name:Dq(n,t),isList:!0}]}function Dq(e,t){return t.state.sliceDoc(e.from,e.to)}function Bq({variables:e=[],builtins:t=[]}){const n=function(e,t){return[].concat(e.map(e=>Lq(e)),t.map(e=>Lq(e)))}(e,t),i=/^[\w ]*$/;return n.length?e=>{const{pos:t,state:r}=e,o=CM(r).resolve(t,-1);if(function(e,t){const n=e.nextSibling;return Aq(e)||n&&n.from===t&&Aq(n)}(o,t))return Tq(o)?null:e.explicit?{from:t,options:n,validFor:i}:null;if(!function(e){return e&&e.parent&&"VariableName"===e.parent.name}(o)||Tq(o))return null;const s="function"==typeof e.matchBefore?e.matchBefore(/\w[\w ]*$/):null;return{from:s?s.from:o.from,options:n,validFor:i}}:e=>null}function Lq(e,t){return"function"===e.type?function(e,t){const{name:n,info:i,detail:r,params:o=[]}=e,s=o.map(({name:e,type:t},n)=>({name:e||`param ${n+1}`,type:t})),a=`${n}(${s.map(e=>"${"+e.name+"}").join(", ")})`,l=s.map(({name:e,type:t})=>t?`${e}: ${t}`:e).join(", "),c=`${n}(${l})`;return DD(a,{label:c,type:"function",info:i,detail:r,boost:t})}(e,t):{label:e.name,type:"variable",info:e.info,detail:e.detail,boost:t}}function Iq(e){return function(e={}){const t="unaryTests"===e.dialect?kq:Oq,n=e.parserDialect,i=rj(e.context),r=t.configure({contextTracker:i,dialect:n}),o=e.completions||[wq(fq),gq].flat();return new IM(r,[...o.map(e=>r.data.of({autocomplete:e}))])}(e)}function Nq({builtins:e=[],engines:t}={}){return gI(GF({builtins:e,engines:t}))}const zq=mS.define(),jq=mS.define(),Vq=mS.define(),Fq=mS.define(),qq=mS.define();function Hq({dialect:e="expression",parserDialect:t,variables:n=[],builtins:i=[],engines:r,completions:o}){const s=function(e){return e.slice().reverse().reduce((e,t)=>(e[t.name]=()=>{},e),{})}([...n,...i]),a=o??function({variables:e=[],builtins:t=[]}){return[Rq({variables:e}),Bq({variables:e,builtins:t}),wq(fq),...gq]}({builtins:Wq(i,r),variables:n});return[Vq.of(e),zq.of(i),jq.of(n),Fq.of(t),qq.of(r),Iq({dialect:e,parserDialect:t,context:s,completions:a}),Nq({builtins:i,engines:r})]}function Wq(e,t){return t&&Object.keys(t).length?e.filter(e=>!e.engines||zF(e.engines,t)):e}function Qq(e){return{builtins:e.facet(zq)[0],variables:e.facet(jq)[0],dialect:e.facet(Vq)[0],parserDialect:e.facet(Fq)[0],engines:e.facet(qq)[0]}}const Xq=Cq.map(e=>({...e,info:()=>Y(e.info)})),Gq=new TS,Uq=new TS;function Yq({extensions:e=[],dialect:t="expression",parserDialect:n,container:i,contentAttributes:r={},tooltipContainer:o,onChange:s=()=>{},onKeyDown:a=()=>{},onLint:l=()=>{},placeholder:c="",readOnly:u=!1,value:p="",builtins:h=Xq,variables:d=[],engines:f}){this._events=pq();const m=UA.updateListener.of(e=>{e.docChanged&&s(e.state.doc.toString())}),g=UA.updateListener.of(e=>{const t=e.transactions.flatMap(e=>e.effects).filter(e=>e.is(oI));if(!t.length)return;const n=t.flatMap(e=>e.value);this._events.emit("lint",{diagnostics:n})}),v=UA.domEventObservers({keydown:a});"string"==typeof o&&(o=document.querySelector(o));const y=o?hT({tooltipSpace:function(){return o.getBoundingClientRect()}}):[],b=[ZD(),Gq.of(Hq({dialect:t,builtins:h,variables:d,parserDialect:n,engines:f})),y$(),JM(),jD(),fB(),UA.contentAttributes.of(r),m,v,iT.of([...AL,...RB]),g,y,Uq.of(cT(c)),Pq,...e];return u&&b.push(UA.editable.of(!1)),this.on("lint",({diagnostics:e})=>l(e)),this._cmEditor=new UA({state:ik.create({doc:p,extensions:b}),parent:i}),this}Yq.prototype.setValue=function(e){this._cmEditor.dispatch({changes:{from:0,to:this._cmEditor.state.doc.length,insert:e},annotations:QS.addToHistory.of(!1)})},Yq.prototype.focus=function(e){const t=this._cmEditor;if(t.contentDOM.focus(),t.focus(),"number"==typeof e){const n=t.state.doc.length;t.dispatch({selection:{anchor:e<=n?e:n}})}},Yq.prototype.on=function(e,t){this._events.on(e,t)},Yq.prototype.off=function(e,t){this._events.off(e,t)},Yq.prototype.getSelection=function(){return this._cmEditor.state.selection},Yq.prototype.setVariables=function(e){const t=Qq(this._cmEditor.state);this._cmEditor.dispatch({effects:[Gq.reconfigure(Hq({...t,variables:e}))]})},Yq.prototype.setEngines=function(e){const t=Qq(this._cmEditor.state);this._cmEditor.dispatch({effects:[Gq.reconfigure(Hq({...t,engines:e}))]}),function(e){let t=e.plugin(dI);t&&t.force()}(this._cmEditor)},Yq.prototype.setPlaceholder=function(e){this._cmEditor.dispatch({effects:Uq.reconfigure(cT(e))})};
339
+ /*!
340
+ * tabbable 6.5.2
341
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
342
+ */
343
+ var Kq=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Zq=Kq.join(","),Jq="undefined"==typeof Element,eH=Jq?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,tH=!Jq&&Element.prototype.getRootNode?function(e){return null==e||null==e.getRootNode?void 0:e.getRootNode()}:function(e){return null==e?void 0:e.ownerDocument},nH=function(e,t){void 0===t&&(t=!0);var n=null==e||null==e.getAttribute?void 0:e.getAttribute("inert");return""===n||"true"===n||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):nH(e.parentNode))},iH=function(e,t,n){if(nH(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(Zq));return t&&eH.call(e,Zq)&&i.unshift(e),i=i.filter(n)},rH=function(e,t,n){for(var i=[],r=Array.from(e);r.length;){var o=r.shift();if(!nH(o,!1))if("SLOT"===o.tagName){var s=o.assignedElements(),a=s.length?s:o.children,l=rH(a,!0,n);n.flatten?i.push.apply(i,l):i.push({scopeParent:o,candidates:l})}else{eH.call(o,Zq)&&n.filter(o)&&(t||!e.includes(o))&&i.push(o);var c=o.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(o),u=!nH(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(o));if(c&&u){var p=rH(!0===c?o.children:c.children,!0,n);n.flatten?i.push.apply(i,p):i.push({scopeParent:o,candidates:p})}else r.unshift.apply(r,o.children)}}return i},oH=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},sH=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null==e.getAttribute||null==(t=e.getAttribute("contenteditable"))?void 0:t.toLowerCase();return""===n||"true"===n||"plaintext-only"===n}(e))&&!oH(e)?0:e.tabIndex},aH=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},lH=function(e){return"INPUT"===e.tagName},cH=function(e){return function(e){return lH(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||tH(e),i=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=i(window.CSS.escape(e.name));else try{t=i(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!r||r===e}(e)},uH=function(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return 0===n&&0===i},pH=function(e,t){return!(t.disabled||function(e){return lH(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,i=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var r=getComputedStyle(e).visibility;if("hidden"===r||"collapse"===r)return!0;var o=eH.call(e,"details>summary:first-of-type")?e.parentElement:e;if(eH.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return uH(e)}else{if("function"==typeof i){for(var s=e;e;){var a=e.parentElement,l=tH(e);if(a&&!a.shadowRoot&&!0===i(a))return uH(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=s}if(e.isConnected)return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var i=t.children.item(n);if("LEGEND"===i.tagName)return!!eH.call(t,"fieldset[disabled] *")||!i.contains(e)}return!0}t=t.parentElement}return!1}(t))},hH=function(e,t){return!(cH(t)||sH(t)<0||!pH(e,t))},dH=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},fH=function(e){var t=[],n=[];return e.forEach(function(e,i){var r=!!e.scopeParent,o=r?e.scopeParent:e,s=function(e,t){var n=sH(e);return n<0&&t&&!oH(e)?0:n}(o,r),a=r?fH(e.candidates):o;0===s?r?t.push.apply(t,a):t.push(o):n.push({documentOrder:i,tabIndex:s,item:e,isScope:r,content:a})}),n.sort(aH).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},mH=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==eH.call(e,Zq)&&hH(t,e)},gH=Kq.concat("iframe:not([inert]):not([inert] *)").join(","),vH=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==eH.call(e,gH)&&pH(t,e)};
344
+ /*!
345
+ * focus-trap 8.2.6
346
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
347
+ */
348
+ function yH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function bH(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=SH(e))||t){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function wH(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function _H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xH(Object(n),!0).forEach(function(t){wH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function EH(e){return function(e){if(Array.isArray(e))return yH(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||SH(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SH(e,t){if(e){if("string"==typeof e)return yH(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yH(e,t):void 0}}var kH=new WeakMap,OH=new WeakMap,CH=function(e){var t=null==e?void 0:e.preexistingTrap;if(t){var n=OH.get(t);1===n?OH.delete(t):OH.set(t,n-1),e.preexistingTrap=void 0}},PH={getActiveTrap:function(e){return(null==e?void 0:e.length)>0?e[e.length-1]:null},activateTrap:function(e,t){t!==PH.getActiveTrap(e)&&PH.pauseTrap(e);var n=e.indexOf(t);-1===n||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),PH.unpauseTrap(e)},pauseTrap:function(e){var t=PH.getActiveTrap(e);null==t||t._setPausedState(!0)},unpauseTrap:function(e){var t=PH.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},AH=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},TH=function(e){return AH(e)&&!e.shiftKey},RH=function(e){return AH(e)&&e.shiftKey},MH=function(e){return setTimeout(e,0)},$H=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return"function"==typeof e?e.apply(void 0,n):e},DH=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},BH=[],LH=function(e,t){var n,i=(null==t?void 0:t.document)||document,r=(null==t?void 0:t.trapStack)||BH,o=_H({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,delayReturnFocus:!0,isolateSubtrees:!1,isKeyForward:TH,isKeyBackward:RH},t),s={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,subtreeIsolated:!1,activation:void 0,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,unpausing:void 0,recentNavEvent:void 0},a=function(e,t,n){return e&&void 0!==e[t]?e[t]:o[n||t]},l=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return s.containerGroups.findIndex(function(t){var i=t.container,r=t.tabbableNodes;return i.contains(e)||(null==n?void 0:n.includes(i))||r.find(function(t){return t===e})})},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.hasFallback,r=void 0!==n&&n,s=t.params,a=void 0===s?[]:s,l=o[e];if("function"==typeof l&&(l=l.apply(void 0,EH(a))),!0===l&&(l=void 0),!l){if(void 0===l||!1===l)return l;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var c=l;if("string"==typeof l){try{c=i.querySelector(l)}catch(t){throw new Error("`".concat(e,'` appears to be an invalid selector; error="').concat(t.message,'"'),{cause:t})}if(!c&&!r)throw new Error("`".concat(e,"` as selector refers to no known node"))}return c},u=function(e){var t=e.activeElement;return t?t.shadowRoot&&null!==t.shadowRoot.activeElement?u(t.shadowRoot):t:null},p=function(){var e=c("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!vH(e,o.tabbableOptions)){var t=u(i);if(l(t)>=0)e=t;else{var n=s.tabbableGroups[0];e=n&&n.firstTabbableNode||c("fallbackFocus")}}else null===e&&(e=c("fallbackFocus"));if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},h=function(){if(s.containerGroups=s.containers.map(function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?rH([e],t.includeContainer,{filter:hH.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dH}):iH(e,t.includeContainer,hH.bind(null,t)),fH(n)}(e,o.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?rH([e],t.includeContainer,{filter:pH.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):iH(e,t.includeContainer,pH.bind(null,t))}(e,o.tabbableOptions),i=t.length>0?t[0]:void 0,r=t.length>0?t[t.length-1]:void 0,s=n.find(function(e){return mH(e)}),a=n.slice().reverse().find(function(e){return mH(e)}),l=!!t.find(function(e){return sH(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:l,firstTabbableNode:i,lastTabbableNode:r,firstDomTabbableNode:s,lastDomTabbableNode:a,nextTabbableNode:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t.indexOf(e);return r<0?i?n.slice(n.indexOf(e)+1).find(function(e){return mH(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return mH(e)}):t[r+(i?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(e){return e.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},d=function(e){!1!==e&&(e!==u(i)?e&&e.focus?(e.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):d(p()):s.mostRecentlyFocusedNode=e)},f=function(e){var t=c("setReturnFocus",{params:[e]});return t||!1!==t&&e},m=function(e){var t=e.target,n=e.event,i=e.isBackward,r=void 0!==i&&i;t=t||DH(n),h();var a=null;if(s.tabbableGroups.length>0){var u=l(t,n),p=u>=0?s.containerGroups[u]:void 0;if(u<0)a=r?s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:s.tabbableGroups[0].firstTabbableNode;else if(r){var d=s.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(d<0&&(p.container===t||vH(t,o.tabbableOptions)&&!mH(t,o.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(d=Math.max(0,s.tabbableGroups.findIndex(function(e){return s.containerGroups.indexOf(e)>=u}))),d>=0){var f=0===d?s.tabbableGroups.length-1:d-1,m=s.tabbableGroups[f];a=sH(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else AH(n)||(a=p.nextTabbableNode(t,!1))}else{var g=s.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(g<0&&(p.container===t||vH(t,o.tabbableOptions)&&!mH(t,o.tabbableOptions)&&!p.nextTabbableNode(t))){var v=s.tabbableGroups.findIndex(function(e){return s.containerGroups.indexOf(e)>u});g=v>0?v-1:s.tabbableGroups.length-1}if(g>=0){var y=g===s.tabbableGroups.length-1?0:g+1,b=s.tabbableGroups[y];a=sH(t)>=0?b.firstTabbableNode:b.firstDomTabbableNode}else AH(n)||(a=p.nextTabbableNode(t))}}else a=c("fallbackFocus");return a},g=function(e){var t=DH(e);l(t,e)>=0||($H(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate}):$H(o.allowOutsideClick,e)||e.preventDefault())},v=function(e){var t=DH(e),n=l(t,e)>=0;if(n||t instanceof Document)n&&(s.mostRecentlyFocusedNode=t);else{var i;e.stopImmediatePropagation();var r=!0;if(s.mostRecentlyFocusedNode)if(sH(s.mostRecentlyFocusedNode)>0){var a=l(s.mostRecentlyFocusedNode),c=s.containerGroups[a].tabbableNodes;if(c.length>0){var u=c.findIndex(function(e){return e===s.mostRecentlyFocusedNode});u>=0&&(o.isKeyForward(s.recentNavEvent)?u+1<c.length&&(i=c[u+1],r=!1):u-1>=0&&(i=c[u-1],r=!1))}}else s.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return sH(e)>0})})||(r=!1);else r=!1;r&&(i=m({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),d(i||(s.mostRecentlyFocusedNode||p()))}s.recentNavEvent=void 0},y=function(e){(o.isKeyForward(e)||o.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];s.recentNavEvent=e;var n=m({event:e,isBackward:t});n&&(AH(e)&&e.preventDefault(),d(n))}(e,o.isKeyBackward(e))},b=function(e){(function(e){return"Escape"===(null==e?void 0:e.key)||"Esc"===(null==e?void 0:e.key)||27===(null==e?void 0:e.keyCode)})(e)&&!1!==$H(o.escapeDeactivates,e)&&(e.preventDefault(),n.deactivate())},w=function(e){var t=DH(e);l(t,e)>=0||$H(o.clickOutsideDeactivates,e)||$H(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},x=function(){if(s.active&&(PH.activateTrap(r,n),!s.paused)){var e;if(o.delayInitialFocus)e=new Promise(function(e){s.delayInitialFocusTimer=MH(function(){d(p()),e()})});else if(d(p()),!s.active||s.paused)return;return i.addEventListener("focusin",v,!0),i.addEventListener("mousedown",g,{capture:!0,passive:!1}),i.addEventListener("touchstart",g,{capture:!0,passive:!1}),i.addEventListener("click",w,{capture:!0,passive:!1}),i.addEventListener("keydown",y,{capture:!0,passive:!1}),i.addEventListener("keydown",b),e}},_=function(){if(s.active)return i.removeEventListener("focusin",v,!0),i.removeEventListener("mousedown",g,!0),i.removeEventListener("touchstart",g,!0),i.removeEventListener("click",w,!0),i.removeEventListener("keydown",y,!0),i.removeEventListener("keydown",b),n},E="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver(function(e){var t=s.mostRecentlyFocusedNode;if(t){var n=e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===t||"function"==typeof e.contains&&e.contains(t)})});if(n&&s.containers.some(function(e){return null==e?void 0:e.isConnected})){h();var i=p();d(i)}}}):void 0,S=function(){E&&(E.disconnect(),s.active&&!s.paused&&s.containers.map(function(e){E.observe(e,{subtree:!0,childList:!0})}))};return n={get active(){return s.active},get paused(){return s.paused},activate:function(e){if(s.active)return this;var t={};s.activation=t,kH.set(i,{});var o,l=a(e,"onActivate"),c=a(e,"onPostActivate"),p=a(e,"checkCanFocusTrap"),d=PH.getActiveTrap(r),f=!1;d&&!d.paused&&(null===(o=d._setSubtreeIsolation)||void 0===o||o.call(d,!1),f=!0,t.preexistingTrap=d,OH.set(d,(OH.get(d)||0)+1));try{p||h(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=u(i),null==l||l({trap:n});var m=function(){if(s.active&&s.activation===t){p&&h();var e=function(){s.active&&s.activation===t&&(s.paused||n._setSubtreeIsolation(!0),S(),null==c||c({trap:n}))};CH(t);var i=x();i?i.then(e):e()}};if(p)return p(s.containers.concat()).then(m,m),this;m()}catch(e){var g;if(CH(t),d===PH.getActiveTrap(r)&&f&&!OH.has(d))null===(g=d._setSubtreeIsolation)||void 0===g||g.call(d,!0);throw e}return this},deactivate:function(e){var t;if(!s.active)return this;var l=_H({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},e);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,s.unpausing=void 0,s.paused||n._setSubtreeIsolation(!1),s.alreadySilent.clear(),_(),s.active=!1,s.paused=!1,S();var c=s.activation,u={};kH.set(i,u),PH.deactivateTrap(r,n);var p,h=null===(t=s.activation)||void 0===t?void 0:t.preexistingTrap;(CH(s.activation),OH.has(h)||h!==PH.getActiveTrap(r)||null==h||!h.active||h.paused)||(null===(p=h._setSubtreeIsolation)||void 0===p||p.call(h,!0));var m=a(l,"onDeactivate"),g=a(l,"onPostDeactivate"),v=a(l,"checkCanReturnFocus"),y=a(l,"delayReturnFocus"),b=a(l,"returnFocus","returnFocusOnDeactivate");null==m||m({trap:n});var w=function(){if(b&&s.activation===c&&kH.get(i)===u){var e=f(s.nodeFocusedBeforeActivation);s.activation===c&&kH.get(i)===u&&d(e)}null==g||g({trap:n})},x=function(){y&&b?MH(w):w()};return b&&v?(v(f(s.nodeFocusedBeforeActivation)).then(x,x),this):(x(),this)},pause:function(e){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return s.active?(s.manuallyPaused=!1,r[r.length-1]!==this?this:(s.paused&&kH.set(i,{}),this._setPausedState(!1,e))):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return s.containers=t.map(function(e){return"string"==typeof e?i.querySelector(e):e}),o.isolateSubtrees&&function(e){s.active&&!s.paused&&n._setSubtreeIsolation(!1),s.adjacentElements.clear(),s.alreadySilent.clear();var t,i=new Set,r=new Set,o=bH(e);try{for(o.s();!(t=o.n()).done;){var a=t.value;i.add(a);for(var l="undefined"!=typeof ShadowRoot&&a.getRootNode()instanceof ShadowRoot,c=a;c;){i.add(c);var u=c.parentElement,p=[];u?p=u.children:!u&&l&&(p=c.getRootNode().children,u=c.getRootNode().host,l="undefined"!=typeof ShadowRoot&&u.getRootNode()instanceof ShadowRoot);var h,d=bH(p);try{for(d.s();!(h=d.n()).done;){var f=h.value;r.add(f)}}catch(e){d.e(e)}finally{d.f()}c=u}}}catch(e){o.e(e)}finally{o.f()}i.forEach(function(e){r.delete(e)}),s.adjacentElements=r}(s.containers),s.active&&(h(),s.paused||n._setSubtreeIsolation(!0)),S(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(e,t){if(s.paused===e)return this;if(s.paused=e,e){var i=a(t,"onPause"),r=a(t,"onPostPause");null==i||i({trap:n}),s.unpausing=void 0,_(),n._setSubtreeIsolation(!1),S(),null==r||r({trap:n})}else{var o=a(t,"onUnpause"),l=a(t,"onPostUnpause"),c={};if(s.unpausing=c,null==o||o({trap:n}),s.unpausing!==c)return this;!function(){if(s.active&&!s.paused){h();var e=function(){s.unpausing===c&&(OH.has(n)||n._setSubtreeIsolation(!0),S(),null==l||l({trap:n}))},t=x();t?t.then(e):e()}}()}return this}},_setSubtreeIsolation:{value:function(e){if(o.isolateSubtrees){if(s.subtreeIsolated===e)return;s.subtreeIsolated=e,s.adjacentElements.forEach(function(t){var n;if(e)if("aria-hidden"===o.isolateSubtrees)"true"!==t.ariaHidden&&"true"!==(null===(n=t.getAttribute("aria-hidden"))||void 0===n?void 0:n.toLowerCase())||s.alreadySilent.add(t),t.setAttribute("aria-hidden","true");else(t.inert||t.hasAttribute("inert"))&&s.alreadySilent.add(t),t.setAttribute("inert",!0);else if(s.alreadySilent.has(t));else if("aria-hidden"===o.isolateSubtrees)t.removeAttribute("aria-hidden");else t.removeAttribute("inert")})}}}}),n.updateContainerElements(e),n};function IH(e){return _E("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",...e,children:_E("path",{fillRule:"evenodd",d:"M10,12 L3,12 C2.44771525,12 2,11.5522847 2,11 C2,10.4477153 2.44771525,10 3,10 L8,10 L8,5 C8,4.44771525 8.44771525,4 9,4 C9.55228475,4 10,4.44771525 10,5 L10,12 Z",transform:"rotate(-45 6 8)"})})}function NH(e){return _E("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",...e,children:_E("path",{fillRule:"evenodd",d:"M12 4.7L11.3 4L8 7.3L4.7 4L4 4.7L7.3 8L4 11.3L4.7 12L8 8.7L11.3 12L12 11.3L8.7 8L12 4.7Z",fill:"currentColor"})})}function zH(e){return _E("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",...e,children:_E("path",{fillRule:"evenodd",d:"M9,13 L9,9 L9,9 L13,9 C13.5522847,9 14,8.55228475 14,8 C14,7.44771525 13.5522847,7 13,7 L9,7 L9,7 L9,3 C9,2.44771525 8.55228475,2 8,2 C7.44771525,2 7,2.44771525 7,3 L7,7 L7,7 L3,7 C2.44771525,7 2,7.44771525 2,8 C2,8.55228475 2.44771525,9 3,9 L7,9 L7,9 L7,13 C7,13.5522847 7.44771525,14 8,14 C8.55228475,14 9,13.5522847 9,13 Z"})})}function jH(e){return _E("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",...e,children:_E("path",{fillRule:"evenodd",d:"M9,4 L9,11 C9,12.1 8.6,12.55 7.5,12.55 L2.5,12.55 C1.4,12.55 1,12.1 1,11 L1,4 L9,4 Z M7.5,5.5 L2.5,5.5 L2.5,9.8 C2.5,10.46 3,11 3.61111111,11 L6.38888889,11 C7,11 7.5,10.46 7.5,9.8 L7.5,5.5 Z M10,1 L8,1 L7,0 L3,0 L2,1 L0,1 L0,2.5 L10,2.5 L10,1 Z",transform:"translate(3 2)"})})}function VH(e){return _E("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[_E("path",{fill:"#fff",style:{mixBlendMode:"multiply"},d:"M0 0h16v16H0z"}),_E("path",{fill:"#fff",style:{mixBlendMode:"multiply"},d:"M0 0h16v16H0z"}),_E("path",{d:"M7 3H5v2h2V3zM11 3H9v2h2V3zM7 7H5v2h2V7zM11 7H9v2h2V7zM7 11H5v2h2v-2zM11 11H9v2h2v-2z",fill:"#161616"})]})}function FH(e){return _E("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:_E("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.637 12.637v-4.72h1.362v4.721c0 .36-.137.676-.411.95-.275.275-.591.412-.95.412H3.362c-.38 0-.703-.132-.967-.396A1.315 1.315 0 0 1 2 12.638V3.362c0-.38.132-.703.396-.967S2.982 2 3.363 2h4.553v1.363H3.363v9.274h9.274ZM14 2H9.28l-.001 1.362h2.408L5.065 9.984l.95.95 6.622-6.622v2.409H14V2Z",fill:"currentcolor"})})}function qH(e){return _E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round",...e,children:[_E("circle",{cx:"12",cy:"12",r:"9"}),_E("path",{d:"M12 16v-4"}),_E("path",{d:"M12 8h.01"})]})}function HH(e){return _E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",...e,children:[_E("path",{d:"M26,28H6a2.0027,2.0027,0,0,1-2-2V6A2.0027,2.0027,0,0,1,6,4H16V6H6V26H26V16h2V26A2.0027,2.0027,0,0,1,26,28Z"}),_E("polygon",{points:"20 2 20 4 26.586 4 18 12.586 19.414 14 28 5.414 28 12 30 12 30 2 20 2"})]})}function WH(e){return _E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",...e,children:_E("path",{d:"M6 15L6 14 2.7 14 7 9.7 6.3 9 2 13.3 2 10 1 10 1 15zM10 1L10 2 13.3 2 9 6.3 9.7 7 14 2.7 14 6 15 6 15 1z"})})}function QH(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}function XH(e){const{element:t,headerProvider:n,translate:i=QH}=e,{getElementIcon:r,getDocumentationRef:o,getElementLabel:s,getTypeLabel:a}=n,l=s(t),c=a(t),u=o&&o(t),p=r(t);return _E("div",{class:"bio-properties-panel-header",children:[_E("div",{class:"bio-properties-panel-header-icon",children:p&&_E(p,{width:"32",height:"32",viewBox:"0 0 32 32"})}),_E("div",{class:"bio-properties-panel-header-labels",children:[_E("div",{class:"bio-properties-panel-header-type",children:c}),l?_E("div",{class:"bio-properties-panel-header-label",children:l}):null]}),_E("div",{class:"bio-properties-panel-header-actions",children:u?_E("a",{rel:"noreferrer",class:"bio-properties-panel-header-link",href:u,title:i("Open documentation"),target:"_blank",children:_E(FH,{})}):null})]})}const GH=m_({description:{},getDescriptionForId:()=>{}}),UH=m_({diagnostics:{}}),YH=m_({errors:{}}),KH=m_({eventBus:null}),ZH=m_({}),JH=m_({layout:{},setLayout:()=>{},getLayoutForKey:()=>{},setLayoutForKey:()=>{}}),eW=m_({tooltip:{},getTooltipForId:()=>{}});const tW="bio-properties-panel-tooltip";function nW(e){const{forId:t,element:n}=e,i=function(e,t){const{getTooltipForId:n}=I_(eW);return n(e,t)}(t,n),r=e.value||i;return r?_E(iW,{...e,value:r,forId:`bio-properties-panel-${t}`}):e.children}function iW(e){const{forId:t,value:n,parent:i,direction:r="right",position:o,showDelay:s=250,hideDelay:a=250,focusable:l=!0}=e,[c,u]=T_(!1),[p,h]=T_(null),[d,f]=T_(null),m=D_(null),g=D_(null),v=D_(null),y=D_(null),b=(e,t)=>{clearTimeout(m.current),clearTimeout(g.current),c||(t?m.current=setTimeout(()=>{u(!0)},s):u(!0))},w=(e=!1)=>{clearTimeout(m.current),clearTimeout(g.current),e?g.current=setTimeout(()=>{u(!1)},a):u(!1)};M_(()=>()=>{clearTimeout(m.current),clearTimeout(g.current)},[]),M_(()=>{if(!c)return;const e=e=>{v.current&&!v.current.contains(e.target)&&y.current&&!y.current.contains(e.target)&&w(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[c,w]),$_(()=>{if(!c||o)return h(null),void f(null);if(!v.current||!y.current)return;const{tooltipPosition:e,arrowOffset:t}=function(e,t,n){if(!e)return{tooltipPosition:null,arrowOffset:null};const i=e.getBoundingClientRect(),r=`calc(100% - ${i.x}px)`;let o=i.top-10,s=null;if(t&&"right"===n){const e=t.getBoundingClientRect(),n=0,i=window.innerHeight-e.height,r=o;if(o>i&&(o=i),o<n&&(o=n),o!==r){s=16-(o-r)}}return{tooltipPosition:{right:r,top:o},arrowOffset:s}}(v.current,y.current,r);h(e),f(t)},[c,o]);const x=({relatedTarget:e})=>{if(e===v.current||e===y.current||e?.parentElement===y.current)return;const t=window.getSelection();if(t&&t.toString().length>0){const e=t.getRangeAt(0);if(y.current?.contains(e.commonAncestorContainer)||y.current?.contains(t.anchorNode)||y.current?.contains(t.focusNode))return}w(!0)},_=()=>{clearTimeout(g.current)},E=()=>{const e=o||(p?`right: ${p.right}; top: ${p.top}px;`:void 0),i=null!=d?`margin-top: ${d}px;`:void 0;return _E("div",{class:`bio-properties-panel-tooltip bio-theme-parent ${r}`,role:"tooltip",id:tW,"aria-labelledby":t,style:e,ref:y,onClick:e=>e.stopPropagation(),onMouseEnter:_,onMouseLeave:x,children:[_E("div",{class:"bio-properties-panel-tooltip-content",children:n}),_E("div",{class:"bio-properties-panel-tooltip-arrow",style:i})]})};return _E("div",{class:"bio-properties-panel-tooltip-wrapper",tabIndex:l?"0":void 0,ref:v,onMouseEnter:e=>{b(0,!0)},onMouseLeave:x,onFocusIn:b,onFocusOut:e=>{const{relatedTarget:t}=e;y.current?.contains(t)||v.current?.contains(t)||w(!1)},onKeyDown:e=>{"Escape"===e.code&&w(!1)},children:[e.children,c?i?aE(E(),i.current):E():null]})}function rW(e,t){const n=L_(t(e),[e,t]);return M_(()=>()=>{n.flush?.()},[n]),n}const oW=["info","warning","error"],sW={error:"has-error",warning:"has-warning"},aW="error";function lW(e){return sW[e?.severity]}function cW(e,t=aW){return e?v(e)?{severity:t,message:e}:{...e,message:e.message||"",severity:oW.includes(e.severity)?e.severity:t}:null}const uW=oW.length-1;function pW(e){let t=null;for(const n of e||[]){const e=cW(n);if(e&&((!t||fW(e)>fW(t))&&(t=e,fW(t)===uW)))break}return t}function hW(e){if(!e)return null;const t=v(e)?e:e.message;return t?{severity:aW,message:t}:null}function dW(e,t){return pW(t.flatMap(t=>e[t]||[]))}function fW(e){return oW.indexOf(e.severity)}const mW=[];function gW(e){const{diagnostics:t}=I_(UH),{errors:n}=I_(YH),i=t[e];if(i&&i.length)return i;const r=hW(n[e]);return r?[r]:mW}function vW(){const{diagnostics:e}=I_(UH),{errors:t}=I_(YH);return B_(()=>{const n={...e};for(const e in t){if(n[e]&&n[e].length)continue;const i=hW(t[e]);i&&(n[e]=[i])}return n},[e,t])}function yW(e){return function(e,t){return dW(e,t.map(e=>e.id))}(vW(),e)}function bW(e){return function(e,t){return dW(e,t.flatMap(e=>[e.id,...(e.entries||[]).map(e=>e.id)]))}(vW(),e)}function wW(e,t,n){const i=I_(KH);n||({eventBus:n}=i);const r=D_(!1);n&&!r.current&&n.on(e,t),M_(()=>(n&&r.current&&n.on(e,t),r.current=!0,()=>{n&&n.off(e,t)}),[t,e,n])}function xW(e,t){const{getLayoutForKey:n,setLayoutForKey:i}=I_(JH);return[n(e,t),L_(t=>{i(e,t)},[i])]}function _W(e){const t=D_();return M_(()=>{t.current=e}),t.current}function EW(e){const{onShow:t}=I_(JH),n=D_(),i=D_(!1),r=L_(n=>{n.id===e&&(t(),i.current||(i.current=!0))},[e]);return M_(()=>{i.current&&n.current&&(g(n.current.focus)&&n.current.focus(),g(n.current.select)&&n.current.select(),i.current=!1)}),wW("propertiesPanel.showEntry",r),n}function SW(e,t,n){const[i,r]=T_(null),o=L_(()=>{const n=function(e,t){return e.current?re(e.current,t,!0):null}(e,t);n!==i&&r(n)},[e,t,i]);M_(()=>{o()},[o]),wW("propertiesPanel.attach",o),wW("propertiesPanel.detach",o),M_(()=>{const t="undefined"!=typeof IntersectionObserver?IntersectionObserver:null;if(!t)return;const r=e.current;if(!r||!i)return;const o=new t(e=>{0!==i.scrollHeight&&e.forEach(e=>{e.intersectionRatio<1?n(!0):1===e.intersectionRatio&&n(!1)})},{root:i,rootMargin:"0px 0px 999999% 0px",threshold:[1]});return o.observe(r),()=>{o.unobserve(r)}},[e,i,n])}function kW(e){const t=D_(e);return $_(()=>{t.current=e}),L_((...e)=>t.current(...e),[])}function OW(e){const{element:t,entries:n=[],id:i,label:r,shouldOpen:o=!1,translate:s=QH}=e,a=D_(null),[l,c]=xW(["groups",i,"open"],o),u=L_(()=>c(!0),[c]),[p,h]=T_(!1),[d,f]=T_(!1);M_(()=>{const e=requestAnimationFrame(()=>{const e=n.find(e=>{const{id:t,isEdited:n}=e,i=de(`[data-entry-id="${t}"]`);if(!g(n)||!i)return!1;return n(de(".bio-properties-panel-input",i))});h(e)});return()=>cancelAnimationFrame(e)},[n,h]);const m=yW(n);SW(a,"div.bio-properties-panel-scroll-container",f);const v={...I_(JH),onShow:u};return _E("div",{class:"bio-properties-panel-group","data-group-id":"group-"+i,ref:a,children:[_E("div",{class:AE("bio-properties-panel-group-header",p?"":"empty",l?"open":"",d&&l?"sticky":""),onClick:()=>c(!l),children:[_E("div",{class:"bio-properties-panel-group-header-title",children:_E(nW,{value:e.tooltip,forId:"group-"+i,element:t,children:r})}),_E("div",{class:"bio-properties-panel-group-header-buttons",children:[_E(CW,{edited:p,severity:m?.severity,translate:s}),_E("button",{type:"button",title:s("Toggle section"),class:"bio-properties-panel-group-header-button bio-properties-panel-arrow",children:_E(IH,{class:l?"bio-properties-panel-arrow-down":"bio-properties-panel-arrow-right"})})]})]}),_E("div",{class:AE("bio-properties-panel-group-entries",l?"open":""),children:_E(JH.Provider,{value:v,children:n.map(e=>{const{component:n,id:i}=e;return qx(n,{...e,element:t,key:i})})})})]})}function CW(e){const{edited:t,severity:n,translate:i=QH}=e;return"error"===n?_E("div",{title:i("Section contains an error"),class:"bio-properties-panel-dot bio-properties-panel-dot--error"}):"warning"===n?_E("div",{title:i("Section contains a warning"),class:"bio-properties-panel-dot bio-properties-panel-dot--warning"}):t?_E("div",{title:i("Section contains edits"),class:"bio-properties-panel-dot"}):null}function PW(e){const{text:t,icon:n}=e;return _E("div",{class:"bio-properties-panel open",children:_E("section",{class:"bio-properties-panel-placeholder",children:[n&&_E(n,{class:"bio-properties-panel-placeholder-icon"}),_E("p",{class:"bio-properties-panel-placeholder-text",children:t})]})})}const AW={},TW={},RW={};function MW(e){const{element:t,headerProvider:n,placeholderProvider:i,groups:r,layoutConfig:o,layoutChanged:s,descriptionConfig:a,descriptionLoaded:l,tooltipConfig:c,tooltipLoaded:u,eventBus:p}=e,[h,f]=T_(BW(o));!function(e,t){const n=D_(!1);$_(()=>{if(n.current)return e();n.current=!0},t)}(()=>{const e=BW(o);f(e)},[o]),$_(()=>{"function"==typeof s&&s(h)},[h,s]);const m={layout:h,setLayout:f,getLayoutForKey:(e,t)=>W(h,e,t),setLayoutForKey:(e,t)=>{f(n=>{const i=q({},n);return H(i,e,t),i})}};wW("propertiesPanel.getLayoutContext",kW(()=>m),p);const g=B_(()=>function(e={}){return{...TW,...e}}(a),[a]);M_(()=>{"function"==typeof l&&l(g)},[g,l]);const v={description:g,getDescriptionForId:(e,t)=>g[e]&&g[e](t)},y=B_(()=>function(e={}){return{...RW,...e}}(c),[c]);M_(()=>{"function"==typeof u&&u(y)},[y,u]);const b={tooltip:y,getTooltipForId:(e,t)=>y[e]&&y[e](t)},[w,x]=T_({});wW("propertiesPanel.setDiagnostics",({diagnostics:e})=>x(function(e){const t={};for(const n in e)t[n]=DW(e[n]).map(e=>cW(e)).filter(Boolean);return t}(e)),p);wW("propertiesPanel.setErrors",({errors:e})=>x(function(e){const t={};for(const n in e){const i=hW(e[n]);i&&(t[n]=[i])}return t}(e)),p);const _=B_(()=>({diagnostics:w}),[w]),E=B_(()=>({errors:$W(w)}),[w]),S={eventBus:p},k={element:t};return i&&!t?_E(PW,{...i.getEmpty()}):i&&d(t)?_E(PW,{...i.getMultiple()}):_E(JH.Provider,{value:k,children:_E(UH.Provider,{value:_,children:_E(YH.Provider,{value:E,children:_E(GH.Provider,{value:v,children:_E(eW.Provider,{value:b,children:_E(JH.Provider,{value:m,children:_E(KH.Provider,{value:S,children:_E("div",{class:"bio-properties-panel bio-theme-parent",children:[n?_E(XH,{element:t,headerProvider:n}):null,_E("div",{class:"bio-properties-panel-scroll-container",children:r.map(e=>{const{component:n=OW,id:i}=e;return qx(n,{...e,key:i,element:t})})})]})})})})})})})})}function $W(e){const t={};for(const n in e){const i=e[n].find(({severity:e})=>"error"===e);i&&(t[n]=i.message)}return t}function DW(e){return d(e)?e:[e]}function BW(e={},t=AW){return{...t,...e}}function LW(e){const{element:t,entries:n=[],id:i,label:r,open:o,remove:s,translate:a=QH}=e,[l,c]=T_(o),{onShow:u}=I_(JH),p={...I_(JH),onShow:L_(()=>{c(!0),g(u)&&u()},[u,c])},h=a("<empty>"),d=n.length>0;return _E("div",{"data-entry-id":i,class:AE("bio-properties-panel-collapsible-entry",l?"open":""),children:[_E("div",{class:"bio-properties-panel-collapsible-entry-header",onClick:d?()=>c(!l):null,children:[_E("div",{class:AE("bio-properties-panel-collapsible-entry-header-title",!r&&"empty"),children:r||h}),d&&_E("button",{type:"button",title:a("Toggle list item"),class:"bio-properties-panel-arrow bio-properties-panel-collapsible-entry-arrow",children:_E(IH,{class:l?"bio-properties-panel-arrow-down":"bio-properties-panel-arrow-right"})}),s?_E("button",{type:"button",title:a("Delete item"),class:"bio-properties-panel-remove-entry",onClick:s,children:_E(jH,{})}):null]}),_E("div",{class:AE("bio-properties-panel-collapsible-entry-entries",l?"open":""),children:_E(JH.Provider,{value:p,children:n.map(e=>{const{component:n,id:i}=e;return qx(n,{...e,element:t,key:i})})})})]})}function IW(e){const{autoFocusEntry:t,autoOpen:n,translate:i=QH}=e;return M_(()=>{if(n&&t){const e=de(`[data-entry-id="${t}"]`),n=de(".bio-properties-panel-input",e);n&&(g(n.select)?n.select():g(n.focus)&&n.focus(),n.scrollIntoView())}},[n,t]),_E("div",{class:"bio-properties-panel-list-item",children:_E(LW,{...e,open:n,translate:i})})}const NW=()=>{},zW={error:"bio-properties-panel-list-badge--error",warning:"bio-properties-panel-list-badge--warning"};function jW(e){const{add:t,element:n,id:i,items:r,label:o,shouldOpen:s=!1,translate:a=QH}=e;M_(()=>{null!=e.shouldSort&&console.warn("the property 'shouldSort' is no longer supported")},[e.shouldSort]);const l=D_(null),[c,u]=xW(["groups",i,"open"],s),[p,h]=T_(!1),d=L_(()=>u(!0),[u]),[f,m]=T_([]),[g,v]=T_(!1),y=_W(n),b=L_(()=>u(!c),[c]),w=n===y&&c&&g?function(e,t){const n=e.map(e=>e.id),i=t.map(e=>e.id);return n.filter(e=>!i.includes(e))}(r,f):[];M_(()=>{m(r),v(!1)},[r]),SW(l,"div.bio-properties-panel-scroll-container",h);const x=!!r.length,_={...I_(JH),onShow:d},E=bW(r);return _E("div",{class:"bio-properties-panel-group","data-group-id":"group-"+i,ref:l,children:[_E("div",{class:AE("bio-properties-panel-group-header",x?"":"empty",x&&c?"open":"",p&&c?"sticky":""),onClick:x?b:NW,children:[_E("div",{class:"bio-properties-panel-group-header-title",children:_E(nW,{value:e.tooltip,forId:"group-"+i,element:n,children:o})}),_E("div",{class:"bio-properties-panel-group-header-buttons",children:[t?_E("button",{type:"button",title:a("Create new list item"),class:"bio-properties-panel-group-header-button bio-properties-panel-add-entry",onClick:e=>{v(!0),u(!0),t(e)},children:[_E(zH,{}),x?null:_E("span",{class:"bio-properties-panel-add-entry-label",children:a("Create")})]}):null,x?_E("div",{title:a("List contains {numOfItems} item"+(1!=r.length?"s":""),{numOfItems:r.length}),class:AE("bio-properties-panel-list-badge",zW[E?.severity]),children:r.length}):null,x?_E("button",{type:"button",title:a("Toggle section"),class:"bio-properties-panel-group-header-button bio-properties-panel-arrow",children:_E(IH,{class:c?"bio-properties-panel-arrow-down":"bio-properties-panel-arrow-right"})}):null]})]}),_E("div",{class:AE("bio-properties-panel-list",c&&x?"open":""),children:_E(JH.Provider,{value:_,children:r.map((e,t)=>{if(!e)return;const{id:i}=e,r=w.includes(e.id);return qx(IW,{...e,autoOpen:r,element:n,index:t,key:i,translate:a})})})})]})}function VW(e){const{element:t,forId:n,value:i}=e,r=function(e,t){const{getDescriptionForId:n}=I_(GH);return n(e,t)}(n,t),o=i||r;if(o)return _E("div",{class:"bio-properties-panel-description",children:o})}const FW={error:"bio-properties-panel-error",warning:"bio-properties-panel-warning",info:"bio-properties-panel-info"};function qW(e){const{diagnostic:t,forId:n,element:i}=e;if(!t)return null;const{action:r,message:o,severity:s}=t;return _E("div",{class:FW[s],children:[o&&_E("span",{class:AE("bio-properties-panel-error-message","bio-properties-panel-diagnostic-message"),children:["info"===s&&_E(qH,{class:"bio-properties-panel-diagnostic-icon","aria-hidden":"true"}),o]}),r&&_E(HW,{action:r,forId:n,element:i})]})}function HW(e){const{action:t,forId:n,element:i}=e,r=D_();return M_(()=>()=>{const e=r.current;if(e&&e===document.activeElement){const e=document.getElementById(WW(n));e&&e.focus()}},[n]),_E(nW,{value:t.tooltip,forId:`${n}-diagnostic-action`,element:i,focusable:!1,children:_E("button",{type:"button",ref:r,id:WW(`${n}-diagnostic-action`),class:AE("bio-properties-panel-error-action","bio-properties-panel-diagnostic-action"),onClick:t.onClick,"aria-label":t.ariaLabel,"aria-describedby":t.tooltip?tW:void 0,children:t.label})})}function WW(e){return`bio-properties-panel-${e}`}function QW(e){const{id:t,label:n,onChange:i,disabled:r,value:o=!1,onFocus:s,onBlur:a,tooltip:l}=e,[c,u]=T_(o);M_(()=>{o!==c&&u(o)},[o]);return _E("div",{class:"bio-properties-panel-checkbox",children:[_E("input",{ref:EW(t),id:UW(t),name:t,onFocus:s,onBlur:a,type:"checkbox",class:"bio-properties-panel-input",onChange:e=>{(({target:e})=>{i(e.checked)})(e),u(e.target.value)},checked:c,disabled:r}),_E("label",{for:UW(t),class:"bio-properties-panel-label",children:_E(nW,{value:l,forId:t,element:e.element,children:n})})]})}function XW(e){const{element:t,id:n,description:i,label:r,getValue:o,setValue:s,disabled:a,onFocus:l,onBlur:c,tooltip:u}=e,p=o(t),h=function(e){return pW(gW(e))}(n);return _E("div",{class:AE("bio-properties-panel-entry","bio-properties-panel-checkbox-entry",lW(h)),"data-entry-id":n,children:[_E(QW,{disabled:a,id:n,label:r,onChange:s,onFocus:l,onBlur:c,value:p,tooltip:u,element:t},t),_E(qW,{diagnostic:h,forId:n,element:t}),_E(VW,{forId:n,element:t,value:i})]})}function GW(e){return e&&!!e.checked}function UW(e){return`bio-properties-panel-${e}`}function YW({onClick:e,title:t,translate:n=QH}){return _E("button",{type:"button",title:t=t??n("Open pop-up editor"),class:"bio-properties-panel-open-feel-popup",onClick:e,children:_E(WH,{})})}const KW=()=>{},ZW=Y_((e,t)=>{const{onInput:n,disabled:i,tooltipContainer:r,enableGutters:o,value:s,onLint:a=KW,onOpenPopup:l=KW,popupOpen:c,contentAttributes:u={},hostLanguage:p=null,singleLine:h=!1}=e,d=D_(),[f,m]=T_(),[g,v]=T_(s||"");!function(e,t){const[n,i]=T_(void 0);t.current=B_(()=>({focus:t=>{e?e.focus(t):(void 0===t&&(t=1/0),i(t))}}),[e]),M_(()=>{void 0!==n&&e&&(e.focus(n),i(!1))},[e,n])}(f,t);const y=kW(e=>{n(e),v(e)});M_(()=>{let e;return e=new dq({container:d.current,onChange:y,value:g,onLint:a,contentAttributes:u,tooltipContainer:r,enableGutters:o,hostLanguage:p,singleLine:h,lineWrap:!0}),m(e),()=>{a([]),d.current.innerHTML="",m(null)}},[]),M_(()=>{f&&s!==g&&(f.setValue(s),v(s))},[s]);return _E("div",{class:AE("bio-properties-panel-feelers-editor-container",c?"popupOpen":null),children:[c&&_E("div",{class:"bio-properties-panel-feelers-editor__popup-placeholder",children:"Opened in popup"}),_E("div",{name:e.name,class:AE("bio-properties-panel-feelers-editor bio-properties-panel-input",g?"edited":null,i?"disabled":null),ref:d,onClick:()=>{t.current.focus()}}),!i&&_E(YW,{onClick:()=>l("feelers")})]})}),JW=()=>{},eQ=Y_((e,t)=>{const{contentAttributes:n,enableGutters:i,value:r,onInput:o,onKeyDown:s=JW,onBlur:a=JW,onFeelToggle:l=JW,onLint:c=JW,onOpenPopup:u=JW,placeholder:p,popupOpen:h,disabled:d,tooltipContainer:f,variables:m,feelLanguageContext:g,translate:v=QH}=e,y=D_(),[b,w]=T_(),[x,_]=T_(r||""),{builtins:E,dialect:S,parserDialect:k,engines:O}=g||{};!function(e,t){const[n,i]=T_(void 0);t.current=B_(()=>({focus:t=>{e?e.focus(t):(void 0===t&&(t=1/0),i(t))}}),[e]),M_(()=>{void 0!==n&&e&&(e.focus(n),i(!1))},[e,n])}(b,t);const C=kW(e=>{o(e),_(e)}),P=kW(()=>{a()});M_(()=>{let e;return e=new Yq({container:y.current,onChange:C,onKeyDown:t=>{if(s(t),"Backspace"!==t.key||!e)return;const n=e.getSelection(),i=n.ranges[n.mainIndex];0===i.from&&0===i.to&&l()},onLint:c,placeholder:p,readOnly:d,tooltipContainer:f,value:x,variables:m,builtins:E,dialect:S,parserDialect:k,engines:O,extensions:[...i?[JT()]:[],UA.lineWrapping,UA.domEventHandlers({blur:P})],contentAttributes:n}),w(e),()=>{c([]),y.current.innerHTML="",w(null)}},[]),M_(()=>{b&&r!==x&&(b.setValue(r),_(r))},[r]),M_(()=>{b&&b.setVariables(m)},[m]),M_(()=>{b&&b.setPlaceholder(p)},[p]),M_(()=>{b&&b.setEngines(O)},[O]);return _E("div",{class:AE("bio-properties-panel-feel-editor-container",d?"disabled":null,h?"popupOpen":null),children:[h&&_E("div",{class:"bio-properties-panel-feel-editor__open-popup-placeholder",children:v("Opened in editor")}),_E("div",{name:e.name,class:AE("bio-properties-panel-input",x?"edited":null),ref:y,onClick:()=>{t.current.focus()}}),!d&&_E(YW,{onClick:()=>u("feel"),translate:v})]})});function tQ(e){return function(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}(e)&&1===e.key.length&&/^[a-zA-Z]$/.test(e.key)}function nQ(e){const{id:t,label:n,onInput:i,value:r,switcherLabel:o,inline:s,onFocus:a,onBlur:l,inputRef:c,tooltip:u}=e,[p,h]=T_(r);return M_(()=>{r!==p&&h(r)},[r]),_E("div",{class:AE("bio-properties-panel-toggle-switch",{inline:s}),children:[_E("label",{class:"bio-properties-panel-label",for:iQ(t),children:_E(nW,{value:u,forId:t,element:e.element,children:n})}),_E("div",{class:"bio-properties-panel-field-wrapper",children:[_E("label",{class:"bio-properties-panel-toggle-switch__switcher",children:[_E("input",{ref:c,id:iQ(t),class:"bio-properties-panel-input",type:"checkbox",onFocus:a,onBlur:l,name:t,onInput:e=>{(async()=>{i(!r)})(),h(e.target.value)},checked:!!p}),_E("span",{class:"bio-properties-panel-toggle-switch__slider"})]}),o&&_E("p",{class:"bio-properties-panel-toggle-switch__label",children:o})]})]})}function iQ(e){return`bio-properties-panel-${e}`}function rQ(e){const{debounce:t,disabled:n,displayLabel:i=!0,id:r,inputRef:o,label:s,max:a,min:l,onInput:c,step:u,value:p="",onFocus:h,onBlur:d,onKeyDown:f,tooltip:m}=e,[g,v]=T_(p),y=B_(()=>t(e=>{e.validity.valid&&c(e.value?parseFloat(e.value):void 0)}),[c,t]);return M_(()=>{p!==g&&v(p)},[p]),_E("div",{class:"bio-properties-panel-numberfield",children:[i&&_E("label",{for:oQ(r),class:"bio-properties-panel-label",children:_E(nW,{value:m,forId:r,element:e.element,children:s})}),_E("input",{id:oQ(r),ref:o,type:"number",name:r,spellCheck:"false",autoComplete:"off",disabled:n,class:"bio-properties-panel-input",max:a,min:l,onInput:e=>{y(e.target),v(e.target.value)},onFocus:h,onBlur:d,onKeyDown:f,step:u,value:g})]})}function oQ(e){return`bio-properties-panel-${e}`}function sQ(e){return`bio-properties-panel-${e}`}function aQ(e){const{id:t,element:n,items:i=[],component:r,label:o="<empty>",open:s,onAdd:a,onRemove:l,autoFocusEntry:c,translate:u=QH,...p}=e,h=D_(null),[d,f]=T_(!!s),[m,g]=T_(!1),v=!!i.length,y=function(e=[],t){const n=_W(e.slice())||[];if(t)return[];return n?e.filter(e=>!n.includes(e)):[]}(i,_W(n)!==n);return M_(()=>{d&&!v&&f(!1)},[d,v]),SW(h,"div.bio-properties-panel-scroll-container",g),_E("div",{"data-entry-id":t,class:AE("bio-properties-panel-entry","bio-properties-panel-list-entry",v?"":"empty",d?"open":""),ref:h,children:[_E("div",{class:AE("bio-properties-panel-list-entry-header",m&&d?"sticky":""),onClick:()=>v&&f(!d),children:[_E("div",{class:AE("bio-properties-panel-list-entry-header-title",d&&"open"),children:o}),_E("div",{class:"bio-properties-panel-list-entry-header-buttons",children:[_E("button",{type:"button",title:u("Create new list item"),onClick:function(e){e.stopPropagation(),a(),d||f(!0)},class:"bio-properties-panel-add-entry",children:[_E(zH,{}),v?null:_E("span",{class:"bio-properties-panel-add-entry-label",children:u("Create")})]}),v&&_E("div",{title:u("List contains {numOfItems} item"+(1!=i.length?"s":""),{numOfItems:i.length}),class:"bio-properties-panel-list-badge",children:i.length}),v&&_E("button",{type:"button",title:u("Toggle list item"),class:"bio-properties-panel-arrow",children:_E(IH,{class:d?"bio-properties-panel-arrow-down":"bio-properties-panel-arrow-right"})})]})]}),v&&_E(lQ,{...p,autoFocusEntry:c,component:r,element:n,id:t,items:i,newItems:y,onRemove:l,open:d,translate:u})]})}function lQ(e){const{autoFocusEntry:t,component:n,element:i,id:r,items:o,newItems:s,onRemove:a,open:l,translate:c,...u}=e,p=function(e=[]){const t=B_(()=>new Map,e);return e=>{let n=t.get(e);return n||(n=Math.random().toString().slice(-6),t.set(e,n)),n}}(),h=s[0];return M_(()=>{if(h&&t){const e=de(`[data-entry-id="${r}"]`),n=de("boolean"==typeof t?".bio-properties-panel-input":t,e);n&&(g(n.select)?n.select():g(n.focus)&&n.focus())}},[h,t,r]),_E("ol",{class:AE("bio-properties-panel-list-entry-items",l?"open":""),children:o.map((e,t)=>{const o=p(e);return _E("li",{class:"bio-properties-panel-list-entry-item",children:[_E(n,{...u,element:i,id:r,index:t,item:e,open:e===h}),a&&_E("button",{type:"button",title:c("Delete item"),class:"bio-properties-panel-remove-entry bio-properties-panel-remove-list-entry",onClick:()=>a&&a(e),children:_E(jH,{})})]},o)})})}function cQ(e){const{id:t,label:n,onChange:i,options:r=[],value:o="",disabled:s,onFocus:a,onBlur:l,tooltip:c}=e,u=EW(t),[p,h]=T_(o);return M_(()=>{o!==p&&h(o)},[o]),_E("div",{class:"bio-properties-panel-select",children:[_E("label",{for:hQ(t),class:"bio-properties-panel-label",children:_E(nW,{value:c,forId:t,element:e.element,children:n})}),_E("select",{ref:u,id:hQ(t),name:t,class:"bio-properties-panel-input",onInput:e=>{(({target:e})=>{i(e.value)})(e),h(e.target.value)},onFocus:a,onBlur:l,value:p,disabled:s,children:r.map((e,t)=>e.children?_E("optgroup",{label:e.label,children:e.children.map((e,t)=>_E("option",{value:e.value,disabled:e.disabled,children:e.label},t))},t):_E("option",{value:e.value,disabled:e.disabled,children:e.label},t))})]})}function uQ(e){const{element:t,id:n,description:i,label:r,getValue:o,setValue:s,getOptions:a,disabled:l,onFocus:c,onBlur:u,validate:p,tooltip:h}=e,d=a(t),f=gW(n),[m,v]=T_(null);let y=o(t);M_(()=>{if(g(p)){const e=p(y)||null;v(e)}},[y,p]);const b=pW([...f,m]);return _E("div",{class:AE("bio-properties-panel-entry",lW(b)),"data-entry-id":n,children:[_E(cQ,{id:n,label:r,value:y,onChange:e=>{if(e!==y){let t=null;g(p)&&(t=p(e)||null),s(e,t),v(t)}},onFocus:c,onBlur:u,options:d,disabled:l,tooltip:h,element:t},t),_E(qW,{diagnostic:b,forId:n,element:t}),_E(VW,{forId:n,element:t,value:i})]})}function pQ(e){return e&&!!e.value}function hQ(e){return`bio-properties-panel-${e}`}function dQ(e){const{id:t,element:n,label:i,debounce:r,onInput:o,value:s="",disabled:a,monospace:l,onFocus:c,onBlur:u,onPaste:p,autoResize:h=!0,placeholder:d,rows:f=(h?1:2),tooltip:m,translate:g=QH}=e,[v,y]=T_(s),b=EW(t),w=D_(),x=D_(v);x.current=v;const{eventBus:_}=I_(KH),[E,S]=T_(!1),k=L_(e=>{o(""===e?void 0:e)},[o]),O=rW(k,r),C=e=>{e!==x.current&&(y(e),O(e))};return M_(()=>()=>{_&&_.fire("propertiesPanel.closePopup")},[]),M_(()=>{s!==v&&y(s)},[s]),_E("div",{class:"bio-properties-panel-textarea",children:[_E("label",{for:gQ(t),class:"bio-properties-panel-label",children:_E(nW,{value:m,forId:t,element:n,children:i})}),_E("div",{class:AE("bio-properties-panel-textarea-container",E?"popupOpen":null),ref:w,children:[E&&_E("div",{class:"bio-properties-panel-textarea__open-popup-placeholder",children:g("Opened in editor")}),_E("textarea",{ref:b,id:gQ(t),name:t,spellCheck:"false",class:AE("bio-properties-panel-input",l?"bio-properties-panel-input-monospace":"",h?"auto-resize":""),onInput:e=>{e.target.value!==v&&(y(e.target.value),O(e.target.value))},onFocus:c,onKeyDown:e=>{tQ(e)&&O.flush?.()},onBlur:e=>{const t=e.target.value.trim();O.cancel?.(),k(t),y(t),u&&u(e)},onPaste:e=>{const t=e.target,n=!t.value,i=0===t.selectionStart&&t.selectionEnd===t.value.length;if(n||i){const t=e.clipboardData.getData("text").trim();return y(t),O(t),p&&p(e),void e.preventDefault()}p&&p(e)},placeholder:d,rows:f,value:v,disabled:a,"data-gramm":"false"}),_&&!a&&_E(YW,{onClick:()=>{const e=_.fire("propertiesPanel.openPopup",{element:n,entryId:t,label:i,onInput:C,sourceElement:b.current,value:v});e&&_.once("propertiesPanelPopup.close",()=>{O.flush?.(),S(!1)}),S(!0===e)},translate:g})]})]})}function fQ(e){const{element:t,id:n,description:i,debounce:r,label:o,getValue:s,setValue:a,rows:l,monospace:c,disabled:u,validate:p,onFocus:h,onBlur:d,onPaste:f,placeholder:m,autoResize:v,tooltip:y,translate:b}=e,w=gW(n),[x,_]=T_(null);let E=s(t);M_(()=>{if(g(p)){const e=p(E)||null;_(e)}},[E,p]);const S=kW(e=>{if(e!==s(t)){let t=null;g(p)&&(t=p(e)||null),a(e,t),_(t)}}),k=pW([...w,x]);return _E("div",{class:AE("bio-properties-panel-entry",lW(k)),"data-entry-id":n,children:[_E(dQ,{id:n,label:o,value:E,onInput:S,onFocus:h,onBlur:d,onPaste:f,rows:l,debounce:r,monospace:c,disabled:u,placeholder:m,autoResize:v,tooltip:y,translate:b,element:t},t),_E(qW,{diagnostic:k,forId:n,element:t}),_E(VW,{forId:n,element:t,value:i})]})}function mQ(e){return e&&!!e.value}function gQ(e){return`bio-properties-panel-${e}`}function vQ(e){const{debounce:t,disabled:n=!1,id:i,label:r,onInput:o,onFocus:s,onBlur:a,onPaste:l,placeholder:c,value:u="",tooltip:p}=e,[h,d]=T_(u||""),f=EW(i),m=L_(e=>{o(""===e?void 0:e)},[o]),g=rW(m,t);M_(()=>{u!==h&&d(u)},[u]);return _E("div",{class:"bio-properties-panel-textfield",children:[_E("label",{for:wQ(i),class:"bio-properties-panel-label",children:_E(nW,{value:p,forId:i,element:e.element,children:r})}),_E("input",{ref:f,id:wQ(i),type:"text",name:i,spellCheck:"false",autoComplete:"off",disabled:n,class:"bio-properties-panel-input",onInput:e=>{e.target.value!==h&&(d(e.target.value),g(e.target.value))},onFocus:s,onKeyDown:e=>{tQ(e)&&g.flush?.()},onBlur:e=>{const t=e.target.value.trim();g.cancel?.(),m(t),d(t),a&&a(e)},onPaste:e=>{const t=e.target,n=!t.value,i=0===t.selectionStart&&t.selectionEnd===t.value.length;if(n||i){const t=e.clipboardData.getData("text").trim();return d(t),g(t),l&&l(e),void e.preventDefault()}l&&l(e)},placeholder:c,value:h})]})}function yQ(e){const{element:t,id:n,description:i,debounce:r,disabled:o,label:s,getValue:a,setValue:l,validate:c,onFocus:u,onBlur:p,onPaste:h,placeholder:d,tooltip:f}=e,m=gW(n),[v,y]=T_(null);let b=a(t);M_(()=>{if(g(c)){const e=c(b)||null;y(e)}},[b,c]);const w=kW(e=>{if(e!==a(t)){let t=null;g(c)&&(t=c(e)||null),l(e,t),y(t)}}),x=pW([...m,v]);return _E("div",{class:AE("bio-properties-panel-entry",lW(x)),"data-entry-id":n,children:[_E(vQ,{debounce:r,disabled:o,id:n,label:s,onInput:w,onFocus:u,onBlur:p,onPaste:h,placeholder:d,value:b,tooltip:f,element:t},t),_E(qW,{diagnostic:x,forId:n,element:t}),_E(VW,{forId:n,element:t,value:i})]})}function bQ(e){return e&&!!e.value}function wQ(e){return`bio-properties-panel-${e}`}Y_((e,t)=>{const{id:n,disabled:i,onInput:r,onKeyDown:o,value:s,onFocus:a,onBlur:l,placeholder:c}=e,u=D_();return t.current={focus:e=>{const t=u.current;t&&(t.focus(),"number"==typeof e&&(e>s.length&&(e=s.length),t.setSelectionRange(e,e)))}},_E("input",{id:sQ(n),type:"text",ref:u,name:n,spellCheck:"false",autoComplete:"off",disabled:i,class:"bio-properties-panel-input",onInput:e=>r(e.target.value),onFocus:a,onKeyDown:o,onBlur:l,placeholder:c,value:s||""})}),Y_((e,t)=>{const{id:n,debounce:i,disabled:r,onInput:o,value:s,min:a,max:l,step:c,onFocus:u,onBlur:p,onKeyDown:h}=e,d=D_();return t.current={focus:()=>{const e=d.current;e&&e.focus()}},_E(rQ,{id:n,debounce:i,disabled:r,displayLabel:!1,inputRef:d,max:l,min:a,onInput:o,step:c,value:s,onFocus:u,onBlur:p,onKeyDown:h})}),Y_((e,t)=>{const{id:n,disabled:i,onInput:r,value:o,onFocus:s,onBlur:a,placeholder:l}=e,c=D_();return t.current={focus:()=>{const e=c.current;e&&(e.focus(),e.setSelectionRange(0,0))}},_E("textarea",{id:sQ(n),type:"text",ref:c,name:n,spellCheck:"false",autoComplete:"off",disabled:i,class:"bio-properties-panel-input",onInput:e=>r(e.target.value),onFocus:s,onBlur:a,placeholder:l,value:o||"","data-gramm":"false"})}),Y_((e,t)=>{const{id:n,onInput:i,value:r,onFocus:o,onBlur:s,switcherLabel:a}=e,l=D_();return t.current={focus:()=>{const e=l.current;e&&e.focus()}},_E(nQ,{id:n,value:r,inputRef:l,onInput:i,onFocus:o,onBlur:s,switcherLabel:a})}),Y_((e,t)=>{const{id:n,disabled:i,onInput:r,value:o,onFocus:s,onBlur:a}=e,l=D_();return t.current={focus:()=>{const e=l.current;e&&e.focus()}},_E("input",{ref:l,id:sQ(n),name:n,onFocus:s,onBlur:a,type:"checkbox",class:"bio-properties-panel-input",onChange:({target:e})=>{r(e.checked)},checked:o,disabled:i})});function xQ(e){return function(t){return!1===e?t:V(t,m(e)?e:600)}}xQ.$inject=["config.debounceInput"];var _Q={debounceInput:["factory",xQ]};function EQ({element:e,label:t}){let n="";return e&&e.type&&(n=`${e.type} / `),`${n}${t}`}function SQ(e,t){let n,i,r;function o(t){const o={x:t.clientX-i,y:t.clientY-r};return e.call(n,t,o)}function s(){document.removeEventListener("dragover",o,!0),document.removeEventListener("dragenter",kQ,!0),document.removeEventListener("dragend",s),document.removeEventListener("drop",kQ)}return function(e){n=this,i=e.clientX,r=e.clientY,e.dataTransfer&&e.dataTransfer.setDragImage(t||Y('<canvas width="0" height="0" />'),0,0),document.addEventListener("dragover",o,!0),document.addEventListener("dragenter",kQ,!0),document.addEventListener("dragend",s),document.addEventListener("drop",kQ)}}function kQ(e){e.preventDefault(),e.stopPropagation()}const OQ=()=>{},CQ=300,PQ=200;const AQ=Y_(function(e,t){const{className:n,delayInitialFocus:i,position:r,width:o,height:s,resizable:a=!1,minWidth:l=CQ,minHeight:c=PQ,onClose:u,onPostActivate:h=OQ,onPostDeactivate:d=OQ,returnFocus:f=!0,closeOnEscape:m=!0,allowFocusMove:g=()=>!0,title:v}=e,y=D_(null),b=D_(null),w=t||b,x=()=>{y.current&&y.current.activate()},{top:_,left:E}=r||function(e,t,n){if(!e||!t)return{};const i=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight;n&&(e=TQ(e,n.minWidth,.9*i),t=TQ(t,n.minHeight,.9*r));return{left:Math.max(0,(i-e)/2),top:Math.max(0,(r-t)/2)}}(o,s,a?{minWidth:l,minHeight:c}:null),S={};return a&&(S.minWidth=`min(${l}px, 90vw)`,S.minHeight=`min(${c}px, 90vh)`),p(_)&&p(E)&&(S.top=_+"px",S.left=E+"px"),o&&(S.width=o+"px"),s&&(S.height=s+"px"),$_(()=>{if(!r||!w.current)return;const e=w.current,{width:t,height:n}=e.getBoundingClientRect();e.style.top=Math.max(0,Math.min(r.top,window.innerHeight-n))+"px",e.style.left=Math.max(0,Math.min(r.left,window.innerWidth-t))+"px"},[r,o,s,w]),M_(()=>(w.current&&w.current.addEventListener("focusin",x),()=>{w.current&&w.current.removeEventListener("focusin",x)}),[w]),M_(()=>(w.current&&(y.current=LH(w.current,{clickOutsideDeactivates:!0,delayInitialFocus:i,fallbackFocus:w.current,isKeyForward:e=>RQ(e)&&!e.shiftKey&&g(e),isKeyBackward:e=>RQ(e)&&e.shiftKey&&g(e),onPostActivate:h,onPostDeactivate:d,returnFocusOnDeactivate:f}),y.current.activate()),()=>y.current&&y.current.deactivate()),[w]),_E("div",{"aria-label":v,tabIndex:-1,ref:w,onKeyDown:e=>{e.stopPropagation(),m&&"Escape"===e.key&&u()},role:"dialog",class:AE("bio-properties-panel-popup","bio-theme-parent",a&&"resizable",n),style:S,children:e.children})});function TQ(e,t,n){return Math.max(Math.min(e,n),Math.min(t,n))}function RQ(e){return"Tab"===e.key}function MQ(e){return e.closest(".bio-properties-panel-popup")}AQ.Title=function(e){const{eventBus:t}=I_(KH),{children:n,className:i,draggable:r,title:o,showCloseButton:s=!1,closeButtonTooltip:a="Close popup",onClose:l,...c}=e,u=D_({startPosition:null,newPosition:null}),p=D_(),h=D_(),d=(e,n)=>{!function(e){e.preventDefault(),e.stopPropagation()}(e);const{x:i,y:r}=n,o={x:u.current.startPosition.x+i,y:u.current.startPosition.y+r},s=MQ(h.current);s.style.top=o.y+"px",s.style.left=o.x+"px",t?.fire("feelPopup.dragover",{newPosition:o,delta:n})};return _E("div",{class:AE("bio-properties-panel-popup__header",r&&"draggable",i),ref:h,draggable:r,onDragStart:e=>{SQ(d,p.current)(e),e.stopPropagation();const n=MQ(h.current).getBoundingClientRect();u.current.startPosition={x:n.left,y:n.top},t?.fire("feelPopup.dragstart")},onDragEnd:()=>{u.current.newPosition=null,t?.fire("feelPopup.dragend")},...c,children:[r&&_E(Wx,{children:[_E("div",{ref:p,class:"bio-properties-panel-popup__drag-preview"}),_E("div",{class:"bio-properties-panel-popup__drag-handle",children:_E(VH,{})})]}),_E("div",{class:"bio-properties-panel-popup__title",children:o}),n,s&&_E("button",{type:"button",title:a,class:"bio-properties-panel-popup__close",onClick:l,children:_E(NH,{})})]})},AQ.Body=function(e){const{children:t,className:n,...i}=e;return _E("div",{class:AE("bio-properties-panel-popup__body",n),...i,children:t})},AQ.Footer=function(e){const{children:t,className:n,...i}=e;return _E("div",{class:AE("bio-properties-panel-popup__footer",n),...i,children:e.children})};const $Q=700,DQ=400;function BQ(e){const{entryId:t,onInput:n,onClose:i,title:r,type:o,value:s,links:a,variables:l,hostLanguage:c,singleLine:u,sourceElement:p,tooltipContainer:h,feelLanguageContext:d,width:f=$Q,height:m=DQ,position:g}=e,v=D_(),y=D_(),b=D_(!1);return M_(()=>{v.current&&v.current.focus()},[v]),_E(AQ,{className:"bio-properties-panel-feel-popup",title:r,returnFocus:!1,closeOnEscape:!1,delayInitialFocus:!1,allowFocusMove:e=>!function(e){const t=e.target.closest(".cm-editor");return!(!t||!t.querySelector(".cm-snippetField"))}(e),onPostDeactivate:()=>{p&&p.focus()},height:m,width:f,position:g,resizable:!0,ref:y,children:[_E(AQ.Title,{title:r,showCloseButton:!0,closeButtonTooltip:"Save and close",onClose:i,draggable:!0,children:_E(Wx,{children:(a||[]).map((e,t)=>_E("a",{rel:"noreferrer",href:e.href,target:"_blank",class:"bio-properties-panel-feel-popup__title-link",children:[e.title,_E(HH,{})]},t))})}),_E(AQ.Body,{children:_E("div",{onKeyDownCapture:e=>{"Escape"===e.key&&(b.current=function(e){const t=e.closest(".cm-editor");return t?t.querySelector(".cm-tooltip-autocomplete"):null}(e.target))},onKeyDown:e=>{"Escape"===e.key&&(b.current||(i(),b.current=!1))},class:"bio-properties-panel-feel-popup__body",children:["feel"===o&&_E(eQ,{enableGutters:!0,name:t,onInput:n,value:s,variables:l,feelLanguageContext:d,ref:v,tooltipContainer:h}),"feelers"===o&&_E(ZW,{contentAttributes:{"aria-label":r},enableGutters:!0,hostLanguage:c,name:t,onInput:n,value:s,ref:v,singleLine:u,tooltipContainer:h})]})})]})}const LQ=700,IQ=400;function NQ(e){const{entryId:t,onInput:n,onClose:i,title:r,value:o,sourceElement:s,width:a=LQ,height:l=IQ,position:c}=e,u=D_(),p=D_();return M_(()=>{u.current&&u.current.focus()},[u]),_E(AQ,{className:"bio-properties-panel-text-popup",title:r,returnFocus:!1,closeOnEscape:!0,delayInitialFocus:!1,onClose:i,onPostDeactivate:()=>{s&&s.focus()},height:l,width:a,position:c,resizable:!0,ref:p,children:[_E(AQ.Title,{title:r,showCloseButton:!0,closeButtonTooltip:"Save and close",onClose:i,draggable:!0}),_E(AQ.Body,{children:_E("textarea",{id:zQ(t),name:t,class:"bio-properties-panel-input",ref:u,onInput:e=>n(e.target.value),value:o||"",spellCheck:"false",autoComplete:"off","aria-label":r,"data-gramm":"false"})})]})}function zQ(e){return`bio-properties-panel-popup-${e}`}const jQ="text";class VQ{constructor(e,t={}){this._eventBus=e,this._config=t,this._isOpen=!1,this.registerProvider("feel",500,BQ),this.registerProvider("feelers",500,BQ),this.registerProvider("text",500,NQ),e.on("propertiesPanel.openPopup",(e,t)=>this.open(t.entryId,t,t.sourceElement)),e.on(["propertiesPanel.closePopup","propertiesPanel.detach","diagram.destroy"],()=>{this.close()})}registerProvider(e,t,n){n||(n=t,t=1e3),this._eventBus.on("propertiesPanelPopup.getProviders."+e,t,function(e){e.providers.push(n)})}_getProviders(e){const t=this._eventBus.createEvent({type:"propertiesPanelPopup.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers}isOpen(){return this._isOpen}open(e,t,n){return this.close(),this._openPopup({...t,entryId:e,sourceElement:n})}commit(){this._isOpen&&this._eventBus.fire("propertiesPanelPopup.commit")}close(){this._closePopup()}_openPopup(e){const{element:t,label:n,sourceElement:i,type:r=jQ}=e,o=this._getProviders(r)[0];return!!o&&(this._isOpen=!0,this._eventBus.fire("propertiesPanelPopup.open",{container:this._config.feelPopupContainer,config:{...e,type:r,component:o,links:this._config.getFeelPopupLinks?.(r)||[],onClose:()=>{this._closePopup(),setTimeout(()=>{i&&i.focus()},0)},title:EQ({element:t,label:n})}}),!0)}_closePopup(){this._isOpen&&(this._isOpen=!1,this._eventBus.fire("propertiesPanelPopup.close"))}}VQ.$inject=["eventBus","config.propertiesPanel"];class FQ{constructor(e){this._eventBus=e,this._container=null,this._element=null,e.on("propertiesPanelPopup.open",e=>{this._renderPopup(e)}),e.on("propertiesPanelPopup.close",()=>{this._removePopup()})}_renderPopup(e){let{container:t,config:n}=e;const i=this._eventBus.fire("propertiesPanel.getLayoutContext");t=this._container=function(e){if(v(e))return de(e);return e}(t)||document.body;const r=this._element=function(){const e=document.createElement("div");return e.classList.add("bio-properties-panel-popup-container"),e}();t.appendChild(r),this._emit("feelPopup.open");const o=_E(n.component,{...n,eventBus:this._eventBus});d_(_E(KH.Provider,{value:{eventBus:this._eventBus},children:i?_E(JH.Provider,{value:i,children:_E(qQ,{type:n.type,children:o})}):o}),r),this._emit("feelPopup.opened",{domNode:r})}_removePopup(){this._container&&(this._emit("feelPopup.close",{domNode:this._element}),d_(null,this._element),this._element.remove(),this._container=null,this._element=null,this._emit("feelPopup.closed"))}_emit(e,t){this._eventBus.fire(e,t)}}function qQ({type:e="text",children:t}){const[n,i]=xW(["popups",e],{}),r=kW(({domNode:e})=>{const t=de(".bio-properties-panel-popup",e);if(!t?.isConnected)return;const{width:n,height:r,top:o,left:s}=t.getBoundingClientRect();bE(()=>i({size:{width:n,height:r},position:{top:o,left:s}}))});return wW("feelPopup.close",r),f_(t,{...n.size,position:n.position,...t.props})}FQ.$inject=["eventBus"];var HQ={__init__:["feelPopup","feelPopupRenderer"],feelPopup:["type",VQ],feelPopupRenderer:["type",FQ]};const WQ=m_({selectedElement:null,injector:null,getService:()=>null});function QQ(e,t){const{getService:n}=I_(WQ);return n(e,t)}function XQ(){return XQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},XQ.apply(null,arguments)}function GQ(){return GQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},GQ.apply(null,arguments)}function UQ(){return UQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},UQ.apply(null,arguments)}function YQ(){return YQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},YQ.apply(null,arguments)}function KQ(){return KQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},KQ.apply(null,arguments)}function ZQ(){return ZQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ZQ.apply(null,arguments)}function JQ(){return JQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},JQ.apply(null,arguments)}var eX=({styles:e={},...t})=>wE("svg",JQ({width:"32",height:"32",xmlns:"http://www.w3.org/2000/svg"},t),wE("path",{stroke:"#000",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"1.1,4.3",d:"M1.5 30.5L27 5"}),wE("path",{d:"M31.803.197L26.5 16.107l-1.52-1.52 3.783-11.35-11.35 3.783-1.52-1.52z"}));function tX(){return tX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},tX.apply(null,arguments)}function nX(){return nX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},nX.apply(null,arguments)}function iX(){return iX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},iX.apply(null,arguments)}function rX(){return rX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},rX.apply(null,arguments)}function oX(){return oX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},oX.apply(null,arguments)}function sX(){return sX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},sX.apply(null,arguments)}function aX(){return aX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},aX.apply(null,arguments)}function lX(){return lX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},lX.apply(null,arguments)}function cX(){return cX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},cX.apply(null,arguments)}function uX(){return uX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},uX.apply(null,arguments)}function pX(){return pX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},pX.apply(null,arguments)}function hX(){return hX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},hX.apply(null,arguments)}function dX(){return dX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},dX.apply(null,arguments)}function fX(){return fX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},fX.apply(null,arguments)}function mX(){return mX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},mX.apply(null,arguments)}function gX(){return gX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},gX.apply(null,arguments)}function vX(){return vX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},vX.apply(null,arguments)}function yX(){return yX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},yX.apply(null,arguments)}function bX(){return bX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},bX.apply(null,arguments)}function wX(){return wX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},wX.apply(null,arguments)}function xX(){return xX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},xX.apply(null,arguments)}function _X(){return _X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_X.apply(null,arguments)}function EX(){return EX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},EX.apply(null,arguments)}function SX(){return SX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},SX.apply(null,arguments)}var kX=({styles:e={},...t})=>wE("svg",SX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.049C8.195-.111.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.454 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.215-2.282-2.022-5.3-3.217-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.082 11.082 0 0116 5.021zm-3.956 3.946l-3.096 3.097 3.985 3.985-3.913 3.913 3.047 3.048 3.913-3.913 3.988 3.987 3.097-3.096L19.076 16l3.914-3.913-3.048-3.048-3.913 3.913-3.986-3.985zm-.002 1.222l3.988 3.987 3.913-3.913 1.826 1.826-3.913 3.913 3.985 3.986-1.873 1.873-3.985-3.985-3.913 3.913-1.827-1.827 3.914-3.913-3.988-3.987 1.873-1.873z"}));function OX(){return OX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},OX.apply(null,arguments)}var CX=({styles:e={},...t})=>wE("svg",OX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm-.56 5.772l-7.408 5.231 7.409 5.234v-5.057c2.385 1.687 4.771 3.371 7.157 5.057V10.793l-7.157 5.055v-5.055zm-.865 1.665v7.125l-5.048-3.562 5.048-3.563zm7.161 0v7.132l-5.048-3.566 5.048-3.566z"}));function PX(){return PX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},PX.apply(null,arguments)}var AX=({styles:e={},...t})=>wE("svg",PX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.97.04h-.127C8.713-.018 2.003 5.334.437 12.286c-1.51 6.123.98 13.005 6.136 16.665 5.125 3.788 12.546 4.105 17.912.623 5.272-3.276 8.33-9.766 7.325-15.916-.904-6.241-5.79-11.7-11.95-13.143A16.082 16.082 0 0015.97.04zm-.181 1.724c.115 0 .23 0 .347.003 6.625-.066 12.823 5.149 13.89 11.69 1.13 5.91-1.908 12.349-7.262 15.138-5.473 3.013-12.866 1.884-17.116-2.726C1.291 21.372.444 13.914 3.802 8.602c2.493-4.112 7.169-6.819 11.987-6.838zm.283 1.554c-.117 0-.234.002-.351.005-6.1 0-11.691 5.049-12.346 11.114-.78 5.684 2.795 11.612 8.218 13.52 5.139 1.943 11.416.101 14.624-4.38 3.461-4.583 3.262-11.538-.596-15.831-2.36-2.747-5.924-4.423-9.549-4.428zm-.078 1.695c.078 0 .156 0 .234.003 5.4 0 10.321 4.556 10.734 9.942.563 5.13-2.958 10.364-7.971 11.678-4.832 1.41-10.457-.935-12.746-5.446-2.463-4.559-1.2-10.795 3.014-13.883a11.072 11.072 0 016.735-2.294zm-5.352 4.266V22.761h10.716V9.279H10.642zm.863.866h8.987v11.75h-8.987v-11.75zm.927 1.323v.862h7.133v-.862h-7.133zm0 2.602v.866h7.133v-.866h-7.133zm0 3.008v.862h7.133v-.862h-7.133zm0 2.717v.863h7.133v-.863h-7.133z"}));function TX(){return TX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},TX.apply(null,arguments)}var RX=({styles:e={},...t})=>wE("svg",TX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm6.132 4.194c-1.21 2.455-2.422 4.91-3.633 7.364l-4.516-5.875-4.103 12.133 4.6-5.912c1.58 1.81 3.162 3.619 4.744 5.429L22.13 9.215zM14.383 13.1l4.295 5.445 1.073-2.387-1.027 4.131-4.384-5.157-1.778 2.75 1.821-4.782z"}));function MX(){return MX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},MX.apply(null,arguments)}var $X=({styles:e={},...t})=>wE("svg",MX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm.006 3.927c-1.672 4.654-2.734 9.502-4.406 14.155 1.534-1.525 2.872-3.234 4.406-4.759l4.406 4.76c-1.496-4.71-2.91-9.446-4.406-14.156zm.032 2.929c.822 2.586 1.598 5.186 2.42 7.771l-2.42-2.612c-.682.597-2.452 2.884-2.338 2.388.87-2.487 1.447-5.067 2.338-7.547z"}));function DX(){return DX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},DX.apply(null,arguments)}var BX=({styles:e={},...t})=>wE("svg",DX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm1.78 4.093v3.555H9.785v6.714h7.994v3.554l5.829-6.911-5.83-6.912zm.974 2.584l3.61 4.295-3.61 4.294v-1.933h-7.88v-4.688h7.88v-1.968z"}));function LX(){return LX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},LX.apply(null,arguments)}var IX=({styles:e={},...t})=>wE("svg",LX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm-7.245 5.475v11.06h14.502v-11.06H8.754zm3.222 1.728h8.057c-1.427.878-2.854 2.806-4.281 3.016l-3.776-3.016zm9.554 1.017v6.587H10.48V13.24l5.524 4.414 5.526-4.414z"}));function NX(){return NX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},NX.apply(null,arguments)}var zX=({styles:e={},...t})=>wE("svg",NX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.003C8.195-.156.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.407 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 4.975zm.006 3.073l-7.62 5.531 2.91 8.95h9.42l2.91-8.95-7.62-5.53zm0 1.067l6.604 4.794-2.523 7.757h-8.162l-2.522-7.757 6.603-4.794z"}));function jX(){return jX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},jX.apply(null,arguments)}var VX=({styles:e={},...t})=>wE("svg",jX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M10.638 9.563V23.056h10.724V9.563H10.638zm.863.866h8.995v11.76H11.5V10.43zm.928 1.324v.862h7.139v-.862h-7.14zm0 2.605v.866h7.139v-.866h-7.14zm0 3.01v.863h7.139v-.863h-7.14zm0 2.72v.863h7.139v-.864h-7.14zM15.999.308h-.004l-.188.001h-.011l-.188.004h-.011L15.41.32h-.011l-.187.008h-.005L15.2.33l-.187.01h-.005l-.005.001-.187.013h-.011L14.62.37h-.01l-.186.018h-.011l-.185.02-.005.001h-.006l-.185.022-.005.001h-.005l-.185.025h-.005l-.005.001-.185.027h-.005l-.005.001-.184.029h-.005l-.005.001-.183.031-.006.001-.005.001-.182.033-.006.001-.005.001-.182.035-.005.001-.005.001-.182.038h-.005l-.005.002-.181.04h-.005l-.005.002-.18.042-.006.001-.005.001-.18.044-.005.002h-.005l-.17.045-.152.054-.139.082-.121.106-.1.127-.074.143-.046.155-.017.16.013.16.043.156.07.145.097.13.119.108.137.085.15.058.159.03.16-.001.133-.023.165-.043.168-.041.171-.04.171-.037.172-.036.17-.033.173-.03.17-.03.177-.027.171-.025.175-.022.175-.02.175-.02.176-.016.175-.014.177-.012.176-.01.177-.007.174-.006.177-.003.178-.001h.177l.178.004.174.006.177.007.176.01.177.012.175.014.176.017.175.018.175.02.175.023.171.025.176.027.17.03.174.03.17.033.171.036.154.033.16.02.161-.01.156-.04.146-.069.131-.094.111-.117.087-.135.061-.15.032-.158.002-.16-.027-.16-.057-.15L20 1.023l-.108-.12-.128-.097-.145-.073-.128-.038-.158-.035-.005-.001-.005-.001L19.14.62h-.005l-.005-.002-.182-.035h-.006L18.938.58l-.182-.033h-.006l-.005-.002-.183-.03-.005-.001-.006-.001-.183-.029h-.005l-.006-.001-.184-.027h-.005l-.005-.001-.185-.024h-.005L17.968.43 17.783.41l-.006-.001h-.005l-.185-.02h-.006l-.005-.001L17.39.37h-.005L17.38.368l-.187-.015h-.005l-.005-.001-.187-.013h-.011L16.8.328h-.011L16.6.32h-.011l-.187-.006h-.011L16.204.31h-.011L16.005.31H16zm9.016 2.935l-.16.004-.158.033-.15.062-.134.09-.116.111-.093.132-.067.147-.038.156-.01.161.022.16.05.153.078.141.103.124.102.087.045.034.142.106.137.105.14.11.136.11.135.112.134.115.134.117.13.115.132.122.128.12.127.122.126.125.124.126.124.128.121.13.118.128.118.132.117.133.113.134.113.136.11.136.109.137.109.142.104.14.103.14.101.142.1.144.099.146.095.145.094.147.093.15.092.15.087.149.087.15.084.152.084.155.08.152.08.155.04.081.084.138.11.119.128.096.145.072.155.043.16.013.16-.016.155-.046.144-.074.127-.099.106-.12.083-.14.055-.151.026-.16-.004-.16-.034-.158-.05-.124-.042-.085-.002-.004-.003-.005-.084-.165-.002-.004-.003-.005-.086-.164-.002-.004-.003-.005-.088-.162-.002-.005-.003-.005-.09-.161-.002-.005-.003-.004-.092-.16-.003-.005-.002-.005-.094-.16-.003-.004-.003-.004-.096-.159-.002-.004-.003-.005-.098-.157-.003-.004-.003-.005-.1-.156-.003-.004-.003-.005-.101-.154-.003-.005-.003-.004-.104-.154-.003-.004-.003-.005-.106-.152-.003-.005-.003-.004-.108-.151-.003-.004-.003-.005-.11-.15-.003-.004-.003-.004-.111-.15-.004-.003-.003-.005-.113-.147-.004-.004-.003-.005-.115-.146-.004-.004-.003-.004-.117-.145-.004-.004-.003-.004-.12-.144-.003-.004-.003-.004-.121-.142-.004-.004-.003-.004-.123-.141-.003-.004-.004-.004-.125-.14-.003-.004-.004-.004-.127-.138-.003-.004-.004-.004-.128-.136-.004-.004-.004-.004-.13-.135-.004-.004-.004-.004-.132-.134-.003-.004-.004-.003-.134-.133-.004-.003-.004-.004-.135-.13-.004-.004-.004-.004-.136-.128-.004-.004-.004-.004-.138-.126-.004-.004-.004-.003-.14-.125-.004-.004-.004-.003-.14-.123-.005-.004-.004-.003-.142-.121-.004-.004-.004-.003-.144-.12-.004-.003-.004-.003-.145-.117-.004-.004-.004-.003-.147-.115-.004-.004-.004-.003-.148-.113-.004-.003-.004-.004-.149-.111-.004-.003-.004-.004-.05-.036-.14-.083-.15-.055-.16-.027zm-18.381.344l-.161.008-.157.037-.147.066-.111.074-.04.032-.005.003-.004.004-.145.117-.004.003-.004.004-.144.119-.004.003-.004.004-.142.12-.004.004-.004.004-.141.123-.004.003-.004.004-.14.125-.004.003-.004.004-.138.126-.004.004-.004.004-.136.128-.004.004-.004.004-.135.13-.004.004-.004.003-.134.133-.004.003L4.682 5l-.132.134-.003.004-.004.004-.13.135-.004.004-.004.004-.128.136-.004.004-.004.004-.126.138-.004.004-.003.004-.125.14-.004.004-.003.004-.123.14-.004.005-.003.004-.121.142-.004.004-.003.004-.12.144-.003.004-.003.004-.117.145-.004.004-.003.004-.115.146-.004.005-.003.004-.113.147-.003.005-.004.004-.111.149-.003.004-.004.004-.11.15-.002.005-.003.004-.108.151-.003.004-.003.005-.106.152-.003.005-.003.004-.104.154-.003.004-.003.005-.102.154-.003.005-.002.004-.1.156-.003.005-.003.004-.098.157-.003.005-.003.004-.096.159-.002.004-.003.005-.094.16-.003.004-.002.004-.092.16-.003.005-.003.005-.09.161-.002.005-.003.005-.088.162-.002.005-.003.004-.086.164-.002.005-.002.004-.084.165-.003.005-.002.004-.082.166-.002.004-.003.005-.08.167-.002.004-.002.005-.078.168-.002.004-.002.005-.045.1-.053.153-.023.16.007.16.037.157.065.148.092.132.114.114.134.09.148.064.157.035.161.006.16-.025.152-.054.14-.08.121-.106.1-.126.065-.118.043-.095.074-.16.075-.155.077-.157.08-.155.08-.152.083-.155.085-.152.086-.15.088-.149.091-.15.094-.15.094-.147.095-.145.099-.146.1-.144.1-.142.104-.14.104-.14.11-.142.107-.137.11-.136.114-.136.113-.134.117-.133.118-.132.117-.129.122-.13.124-.127.123-.126.127-.125.127-.122.128-.12.132-.122.13-.115.133-.117.135-.115.135-.111.136-.11.037-.03.117-.11.094-.132.068-.146.04-.156.01-.161-.02-.16-.05-.154-.076-.141-.102-.125-.123-.104-.14-.08-.153-.051-.16-.023zM16 3.595h-.005l-.148.001h-.01l-.147.003h-.011l-.147.005h-.011l-.146.007h-.011l-.146.009h-.011l-.146.01h-.005l-.005.001-.146.012h-.011l-.145.014h-.006l-.005.001-.05.006-.158.031-.15.06-.135.088-.117.111-.094.13-.069.147-.04.156-.01.16.019.16.049.154.076.142.102.125.123.105.14.08.152.051.16.023.134-.003.045-.005.135-.013.133-.01.136-.01.135-.007.137-.006.136-.004.136-.003h.274l.136.003.136.004.136.006.136.007.136.01.133.01.135.013.135.014.135.016.134.018.132.018.134.021.133.023.133.024.133.025.13.027.132.03.132.03.129.031.13.034.129.035.129.036.13.04.126.038.128.042.126.042.128.045.127.047.126.047.12.048.127.051.123.052.006.002.147.048.16.021.16-.009.157-.038.147-.067.131-.093.112-.116.089-.135.062-.149.033-.158.004-.16-.027-.16-.055-.151-.083-.139-.107-.12-.127-.099-.118-.063-.004-.001-.005-.003-.005-.002-.133-.056-.005-.002-.005-.002-.134-.054-.004-.002-.005-.002-.135-.053-.005-.002-.005-.002-.135-.051-.005-.002-.005-.002-.135-.05-.005-.001-.005-.002-.137-.048-.005-.001-.005-.002-.137-.046-.005-.002-.005-.002-.137-.044-.005-.002-.005-.001-.138-.043-.006-.002-.005-.001-.138-.042-.005-.001-.005-.002-.14-.04H19.4l-.005-.002-.14-.038-.005-.001-.005-.002-.14-.036-.005-.001-.005-.001-.141-.035-.005-.001-.005-.001-.142-.033-.005-.001-.005-.001-.142-.031-.005-.002h-.005l-.142-.03-.005-.001-.005-.001-.143-.028h-.005l-.005-.002-.143-.025-.006-.001-.005-.001-.143-.024-.005-.001-.006-.001-.143-.022-.006-.001h-.005l-.144-.022h-.005l-.006-.001-.144-.019h-.005l-.006-.001-.144-.017h-.006l-.005-.001-.145-.016h-.011l-.145-.014H17.1l-.005-.001-.146-.012h-.01l-.146-.01-.006-.001h-.005l-.146-.009h-.011l-.147-.006h-.01L16.32 3.6h-.011l-.147-.003h-.011l-.147-.001H16zm-5.482 1.366l-.16.008-.157.037-.123.053-.06.032-.005.002-.004.003-.128.069-.004.002-.005.003-.126.07-.005.003-.004.002-.126.072-.005.003-.004.003-.125.073-.004.003-.005.003-.124.075-.004.003-.005.002-.123.077-.004.003-.005.003-.122.078-.004.003-.005.003-.121.08-.004.002-.005.003-.12.082-.005.003-.004.003-.12.083-.004.003-.004.003-.118.084-.005.003-.004.003-.118.086-.004.003-.004.003-.117.088-.004.003-.004.003-.116.089-.004.003-.004.004-.114.09-.005.003-.004.003-.113.092-.004.004-.004.003-.113.093-.004.004-.004.003-.111.095-.005.003-.004.004-.11.096-.004.004-.004.003-.11.098-.003.003-.004.004-.108.1-.004.003-.004.003-.107.101-.004.004-.004.003-.106.102-.004.004-.003.004-.105.103-.004.004-.004.004-.103.105-.004.004-.004.003-.102.106-.003.004-.004.004-.1.107-.004.004-.004.004-.099.108-.004.004-.003.004-.098.11-.003.003-.004.004-.096.11-.004.005-.003.004-.095.111-.003.004-.004.004-.093.113-.003.004-.004.004-.092.113-.003.004-.003.005-.09.114-.004.004-.003.004-.089.116-.003.004-.003.004-.088.117-.003.004-.003.004-.086.118-.003.004-.003.005-.084.118-.003.004-.003.005-.083.12-.003.003-.003.005-.082.12-.003.005-.002.004-.068.103-.076.142-.048.154-.018.16.011.161.041.156.07.146.095.13.117.11.136.086.15.06.158.03.162.002.158-.03.15-.057.138-.085.119-.109.082-.105.065-.099.075-.11.077-.113.077-.107.08-.11.08-.108.084-.108.083-.105.086-.106.086-.104.088-.104.089-.101.09-.102.093-.101.093-.099.094-.097.095-.096.098-.097.098-.095.099-.093.1-.092.103-.091.101-.089.104-.088.104-.086.106-.086.106-.083.106-.082.109-.082.108-.079.11-.078.11-.076.112-.076.112-.074.113-.072.113-.071.115-.07.115-.068.118-.067.117-.065.12-.065.054-.029.135-.088.116-.111.094-.132.068-.146.04-.156.009-.161-.02-.16-.05-.153-.078-.142-.102-.125-.123-.103-.141-.079-.153-.051-.16-.022zm13.91 2.116l-.162.008-.157.037-.147.066-.132.092-.113.116-.09.134-.063.148-.034.157-.005.162.025.159.055.152.082.138.086.103.09.09.094.098.092.099.093.1.091.103.089.101.088.104.086.104.086.106.083.105.083.108.08.108.081.11.077.107.077.112.075.111.075.114.072.113.071.113.07.114.068.118.067.115.065.118.064.117.062.117.061.121.059.119.059.122.056.121.054.12.055.125.051.123.051.125.048.123.048.127.047.126.044.125.043.128.042.129.039.126.038.13.022.076.058.15.085.137.11.119.129.096.145.07.155.043.16.013.161-.017.154-.046.144-.075.126-.1.106-.12.082-.14.055-.151.025-.16-.005-.16-.026-.132-.023-.082-.002-.005-.001-.005-.042-.139-.001-.005-.002-.005-.043-.138-.001-.005-.002-.005-.044-.137-.002-.005-.002-.005-.046-.137-.002-.005-.001-.005-.048-.137-.002-.005-.002-.005-.05-.135-.001-.005-.002-.005-.051-.135-.002-.005-.002-.005-.053-.135-.002-.005-.002-.005-.054-.133-.002-.005-.002-.005-.057-.133-.002-.005-.002-.005-.057-.132-.003-.005-.002-.005-.06-.132-.001-.005-.002-.004-.061-.132-.003-.004-.002-.005-.063-.13-.002-.005-.002-.005-.064-.13-.003-.004-.002-.005-.066-.129-.002-.004-.003-.005-.067-.128-.002-.005-.003-.004-.069-.128-.002-.004-.003-.005-.07-.126-.003-.005-.003-.004-.072-.126-.002-.005-.003-.004-.074-.125-.002-.004-.003-.005-.075-.124-.003-.004-.003-.005-.076-.123-.003-.004-.003-.005-.078-.122-.003-.004-.003-.005-.08-.121-.003-.004-.003-.005-.081-.12-.003-.005-.003-.004-.083-.12-.003-.004-.003-.004-.084-.118-.003-.005-.003-.004-.086-.118-.003-.004-.004-.004-.087-.117-.003-.004-.003-.004-.09-.116-.002-.004-.004-.004-.09-.114-.003-.005-.004-.004-.091-.113-.004-.004-.003-.004-.094-.113-.003-.004-.003-.004-.095-.111-.004-.004-.003-.004-.096-.11-.004-.005-.003-.004-.098-.11-.004-.003-.003-.004-.1-.108-.003-.004-.004-.004-.1-.107-.004-.004-.004-.004-.102-.106-.003-.003-.004-.004-.093-.095-.124-.103-.14-.08-.153-.05-.16-.023zM4.45 13.135l-.161.002-.158.032-.15.06-.135.088-.118.11-.094.131-.069.146-.035.129-.026.132v.005l-.002.005-.025.143-.001.005-.001.006-.024.143-.001.005-.001.006-.022.143-.001.006-.001.005-.02.144-.001.005-.001.005-.019.145v.005l-.001.006-.017.144v.006l-.001.005-.016.145v.011l-.014.145v.005l-.001.006-.012.146v.01l-.01.146-.001.006v.005l-.009.146v.011l-.007.146v.011l-.004.147v.011l-.003.147v.01l-.002.148v.01l.001.148v.01l.003.147v.011l.005.147v.01l.007.147v.011l.009.146v.011l.01.146v.01l.013.146v.011l.014.145v.005l.001.006.016.145v.011l.018.144v.006l.001.005.019.144v.006l.001.005.021.144v.005l.002.006.022.143v.006l.002.005.024.143v.005l.002.006.025.143.001.005.001.005.028.143.001.005.001.005.03.142v.005l.002.006.03.141.002.005.001.005.033.142v.005l.002.005.035.14v.006l.002.005.036.14.002.005.001.005.038.14.001.005.002.005.04.14v.005l.002.005.042.138.001.006.002.005.042.138.002.005.002.005.017.054.064.148.09.134.114.114.132.092.148.065.157.037.16.007.16-.023.153-.052.14-.08.123-.104.102-.125.076-.142.049-.153.02-.16-.011-.161-.031-.13-.017-.051-.039-.126-.038-.13-.037-.128-.035-.13-.033-.128-.033-.134-.03-.13-.029-.131-.026-.13-.026-.133-.024-.133-.023-.133-.02-.132-.02-.136-.017-.132-.016-.135-.014-.135-.012-.133-.012-.138-.009-.133-.007-.136-.006-.138-.004-.134-.003-.136v-.274l.003-.136.004-.134.006-.139.007-.136.01-.133.01-.138.013-.132.014-.135.016-.135.017-.132.02-.137.02-.13.023-.134.024-.133.024-.126.016-.16-.014-.161-.044-.155-.072-.145-.098-.128-.12-.108-.137-.084-.15-.057-.16-.029zm26.698 1.601l-.161.01-.157.04-.146.067-.131.093-.112.117-.088.135-.061.149-.033.157-.005.134.006.14.006.176.003.177.001.178-.001.177-.003.178-.006.177-.007.176-.01.177-.012.176-.015.176-.016.173-.018.175-.02.175-.024.174-.025.175-.026.17-.03.174-.03.173-.033.17-.036.172-.037.17-.04.17-.042.172-.043.168-.045.166-.048.169-.05.167-.052.168-.053.164-.056.166-.058.166-.06.16-.062.165-.062.158-.066.165-.068.16-.07.16-.07.158-.075.159-.074.155-.079.158-.08.158-.06.15-.03.158-.001.161.029.159.058.15.085.137.108.119.13.097.144.07.156.044.16.013.16-.017.155-.046.143-.074.127-.1.107-.12.07-.115.083-.164.003-.005.002-.004.082-.166.002-.005.003-.004.08-.167.002-.005.002-.004.078-.168.002-.005.002-.004.076-.169.002-.004.002-.005.074-.17.002-.004.002-.005.072-.17.002-.005.002-.005.07-.171.001-.005.002-.005.068-.172.002-.004.002-.005.065-.173.002-.005.002-.005.063-.173.002-.005.002-.005.06-.174.003-.005.001-.005.06-.175.001-.005.002-.005.057-.176.001-.005.002-.005.055-.177.001-.005.002-.005.052-.177.002-.005.001-.005.051-.178.001-.005.002-.005.048-.179.002-.005v-.005l.047-.179.001-.005.002-.005.044-.18v-.005l.002-.005.042-.18.001-.006.001-.005.04-.181.001-.005.001-.005.037-.182.002-.005v-.005l.036-.182v-.006l.002-.005.033-.182v-.006l.002-.005.03-.183.001-.005.001-.005.029-.184v-.005l.001-.006.027-.184v-.005l.001-.005.024-.185v-.005l.001-.005.022-.185v-.006l.001-.005.02-.185v-.006l.001-.005.017-.186v-.005l.001-.005.015-.187v-.005l.001-.005.013-.187v-.01l.01-.187.001-.006v-.005l.009-.187v-.011l.006-.187V16.7l.004-.188v-.011l.001-.188v-.01l-.001-.188v-.011l-.004-.188v-.011l-.006-.187v-.011l-.007-.145-.022-.16-.05-.152-.08-.141-.103-.124-.125-.102-.141-.077-.153-.05-.16-.02zm-30.21.572l-.161.001-.158.032-.15.06-.136.087-.117.11-.095.131-.068.146-.04.156-.012.133-.001.14v.01l.001.188v.011l.004.188v.011l.006.187v.011l.008.187v.011l.011.187v.005l.001.005.013.187v.01l.016.187v.01l.018.186v.011l.02.185.001.005v.006l.022.185.001.005v.005l.025.185v.005l.001.005.027.184v.006l.001.005.029.184v.005l.001.005.031.183.001.005.001.006.033.182.001.005.001.006.035.182.001.005.001.005.038.182v.005l.002.005.04.181v.005l.002.005.042.18.001.006.001.005.044.18.002.005v.005l.047.18.001.004.002.005.048.179.002.005.001.005.05.178.002.005.001.005.053.177.002.005.001.005.055.177.002.005.001.005.057.176.002.005.001.005.06.175.001.005.002.005.061.174.002.005.002.005.063.173.002.005.002.005.065.173.002.005.002.004.067.172.002.005.002.005.07.171.002.005.002.005.072.17.002.005.002.004.074.17.002.005.002.004.076.169.002.004.002.005.078.168.002.004.002.005.08.167.003.004.002.005.082.166.002.004.003.005.02.04.086.136.11.118.13.095.146.07.156.041.16.012.16-.019.155-.048.142-.075.126-.1.105-.123.08-.14.054-.152.024-.16-.006-.16-.036-.158-.051-.123-.018-.034-.078-.158-.074-.155-.074-.16-.071-.157-.07-.16-.068-.16-.067-.165-.062-.158-.062-.164-.059-.161-.058-.166-.056-.166-.053-.164-.052-.168-.05-.167-.048-.17-.045-.165-.043-.168-.043-.172-.039-.17-.037-.17-.036-.172-.033-.17-.03-.173-.03-.174-.027-.17-.025-.175-.022-.174-.021-.175-.018-.175-.017-.173-.014-.176-.012-.176-.01-.177-.007-.176-.006-.177-.003-.178-.001-.177v-.134l-.013-.16-.044-.156-.072-.144-.097-.129-.12-.108-.137-.085-.15-.057-.159-.028zm26.798 2.024l-.16.007-.157.038-.148.066-.132.092-.113.115-.09.134-.062.148-.03.127-.001.004-.023.134-.024.133-.026.133-.026.13-.03.132-.03.129-.032.134-.033.128-.035.13-.037.128-.038.13-.04.126-.04.128-.044.128-.044.126-.046.126-.048.126-.05.125-.05.125-.051.122-.054.123-.055.122-.056.12-.058.122-.06.12-.061.12-.063.119-.062.116-.067.119-.066.116-.069.115-.069.115-.07.113-.073.113-.074.112-.076.113-.077.112-.077.107-.08.11-.08.107-.085.11-.044.056-.088.135-.06.15-.033.158-.002.16.027.16.057.15.083.138.108.12.128.098.144.072.155.045.16.015.161-.016.155-.044.144-.073.128-.098.09-.099.05-.061.003-.004.003-.005.089-.115.003-.004.003-.005.088-.116.003-.004.003-.005.086-.117.003-.004.003-.005.084-.118.003-.004.003-.005.083-.12.003-.004.003-.004.081-.12.003-.005.003-.004.08-.121.003-.005.003-.004.078-.122.003-.005.003-.004.077-.123.002-.005.003-.004.075-.124.003-.005.003-.004.073-.125.003-.005.003-.004.072-.126.002-.004.003-.005.07-.126.003-.005.002-.005.07-.127.002-.004.002-.005.068-.128.002-.005.002-.004.066-.13.003-.004.002-.005.064-.13.002-.004.003-.005.062-.13.002-.005.003-.005.06-.13.003-.005.002-.005.06-.132.002-.005.002-.005.057-.132.003-.005.002-.005.056-.133.002-.005.002-.005.054-.134.002-.004.002-.005.053-.135.002-.005.002-.005.051-.135.002-.005.002-.005.05-.135.001-.005.002-.005.048-.137.001-.005.002-.005.046-.137.002-.005.002-.005.044-.137.002-.005.002-.005.042-.138.002-.005.001-.006.042-.138.001-.005.002-.005.04-.14v-.005l.002-.005.038-.14.001-.005.002-.005.036-.14.001-.005.001-.005.035-.141.001-.005.001-.005.033-.142.001-.005.001-.005.031-.141.001-.006.002-.005.029-.142v-.005l.002-.005.028-.143v-.005l.002-.005.025-.143.001-.006.001-.005.024-.143.001-.005.001-.006.001-.006.01-.161-.02-.16-.05-.154-.077-.141-.102-.125-.123-.104-.141-.079-.153-.051-.16-.022zM6.841 23.019l-.16.024-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.018.16.011.161.041.156.07.146.077.109.04.048.003.004.003.004.095.111.003.004.004.004.096.11.004.005.003.004.098.109.003.004.004.004.1.108.003.004.003.004.101.107.004.004.003.004.102.105.004.004.004.004.103.105.004.004.004.003.105.104.003.004.004.003.106.102.004.004.004.004.107.1.004.004.004.004.108.099.004.003.004.004.11.098.003.003.004.004.11.096.004.003.005.004.11.095.005.003.004.004.113.093.004.003.004.004.113.091.004.004.005.003.114.09.004.004.004.003.116.089.004.003.004.003.117.088.004.003.004.003.118.086.004.003.005.003.118.084.004.003.005.003.119.083.004.003.005.003.12.081.005.003.004.003.121.08.005.003.004.003.122.078.005.003.004.003.123.076.005.003.004.003.124.075.005.003.004.003.125.073.004.003.005.002.126.073.004.002.005.003.126.07.005.003.004.002.128.07.004.002.005.002.128.067.005.003.004.002.13.066.004.002.005.003.13.064.004.002.005.003.13.062.005.002.004.003.132.06.004.003.005.002.132.06.005.002.005.002.132.057.005.002.005.002.133.057.005.002.005.002.133.054.005.002.005.002.13.05.154.045.16.016.16-.015.156-.045.144-.072.128-.098.108-.12.083-.138.057-.15.028-.16-.003-.16-.032-.159-.061-.149-.088-.135-.11-.117-.132-.094-.12-.058-.124-.049-.126-.051-.122-.051-.122-.054-.12-.054-.126-.058-.119-.057-.12-.06-.12-.06-.118-.063-.117-.064-.119-.066-.116-.066-.115-.068-.115-.07-.113-.07-.115-.074-.112-.074-.11-.075-.11-.076-.112-.08-.11-.08-.109-.081-.106-.082-.104-.082-.106-.086-.105-.087-.101-.086-.105-.091-.1-.09-.1-.091-.1-.094-.097-.094-.1-.098-.093-.095-.096-.1-.093-.098-.092-.101-.089-.1-.09-.102-.088-.104-.036-.043-.114-.114-.133-.091-.148-.065-.157-.036-.161-.006zm15.063 2.701l-.16.014-.156.044-.12.057-.06.034-.12.066-.117.064-.118.062-.12.061-.12.06-.118.057-.126.058-.12.054-.122.054-.122.05-.126.052-.125.05-.124.046-.127.047-.125.044-.129.043-.126.04-.13.042-.128.038-.127.035-.13.036-.131.034-.129.031-.132.03-.13.03-.135.027-.133.026-.13.023-.13.022-.137.021-.132.02-.134.017-.132.015-.138.015-.135.013-.133.01-.138.01-.136.007-.134.006-.136.004-.14.003-.16.018-.155.047-.142.076-.127.1-.105.122-.08.14-.054.151-.025.16.006.16.035.158.064.148.09.134.114.114.133.092.147.065.157.036.134.008.145-.002h.011l.147-.005h.01l.147-.007h.011l.146-.009h.011l.146-.01h.005l.005-.001.146-.012h.011l.145-.014h.005l.006-.001.145-.016h.011l.144-.018h.006l.005-.001.144-.02h.011l.144-.021.005-.001h.006l.143-.023.006-.001h.005l.143-.025h.005l.006-.002.143-.026h.005l.005-.002.143-.027.005-.001.005-.001.142-.03h.005l.005-.002.142-.03.005-.002.005-.001.142-.033.005-.001.005-.001.14-.035.006-.001.005-.001.14-.037h.005l.005-.002.14-.038.005-.002h.005l.14-.04.005-.002.005-.001.138-.042.005-.001.006-.002.138-.043.005-.001.005-.002.137-.044.005-.002.005-.002.137-.046.005-.002.005-.001.137-.048.005-.002.005-.002.135-.05.005-.001.005-.002.135-.051.005-.002.005-.002.135-.053.005-.002.004-.002.134-.054.005-.002.005-.002.133-.057.005-.002.005-.002.132-.057.005-.003.005-.002.132-.06.005-.001.004-.002.131-.061.005-.003.005-.002.13-.062.005-.003.005-.002.13-.064.004-.003.005-.002.128-.066.005-.002.005-.003.128-.067.005-.002.004-.003.127-.069.005-.002.005-.003.126-.07.005-.003.004-.003.065-.037.132-.093.112-.115.089-.135.062-.149.034-.157.003-.161-.026-.16-.055-.15-.082-.14-.107-.12-.127-.1-.144-.073-.154-.046-.16-.016zM6.33 27.127l-.16.023-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.02.16.012.161.041.156.07.146.094.13.096.093.032.026.004.003.004.004.145.117.004.003.004.004.146.115.005.003.004.004.147.113.005.003.004.004.149.111.004.003.004.003.15.11.005.003.004.003.151.108.004.003.005.003.152.106.005.003.004.003.154.104.004.003.005.003.154.102.005.002.004.003.156.1.005.003.004.003.157.098.005.003.004.002.159.096.004.003.005.003.16.094.004.003.004.002.16.092.005.003.005.002.161.09.005.003.005.002.162.088.005.003.004.002.164.086.005.003.004.002.165.084.005.003.004.002.166.082.004.002.005.003.167.08.004.002.005.002.168.078.004.002.005.002.168.076.005.002.005.002.17.074.004.002.005.002.17.072.005.002.005.002.17.07.006.002.005.001.171.068.005.002.005.002.173.065.005.002.005.002.173.063.005.002.005.002.174.06.005.003.005.001.175.06.005.001.005.002.176.057.005.001.005.002.176.055.006.001.005.002.177.052.005.002.005.001.178.05.005.002.005.002.178.048.006.001.005.002.179.046.005.001.005.002.18.044h.005l.005.002.18.042.006.001.005.001.159.035.16.02.16-.01.157-.04.146-.069.13-.094.112-.117.087-.136.06-.149.033-.158.002-.161-.028-.159-.057-.15-.084-.138-.108-.12-.128-.098-.144-.072-.128-.039-.154-.033-.168-.04-.171-.041-.17-.044-.168-.046-.167-.047-.168-.05-.165-.051-.166-.054-.166-.056-.163-.057-.165-.06-.161-.062-.164-.064-.16-.065-.16-.068-.162-.07-.157-.07-.157-.074-.157-.075-.156-.077-.153-.079-.156-.082-.153-.082-.154-.086-.15-.086-.152-.09-.148-.09-.147-.092-.149-.095-.145-.095-.144-.098-.145-.1-.143-.102-.14-.103-.14-.104-.14-.108-.139-.11-.136-.11-.027-.022-.133-.091-.148-.065-.157-.036-.161-.006zm19.215.087l-.16.01-.157.039-.146.067-.11.076-.064.051-.139.11-.14.108-.14.104-.14.103-.143.101-.145.101-.144.098-.145.095-.149.095-.148.093-.147.089-.152.09-.15.086-.154.086-.153.082-.156.082-.153.079-.156.077-.157.075-.158.073-.157.071-.16.07-.16.068-.161.065-.164.064-.161.061-.165.06-.163.058-.166.056-.166.054-.166.051-.167.05-.167.047-.17.046-.168.044-.171.042-.168.039-.17.037-.11.023-.154.047-.143.075-.126.1-.106.122-.081.139-.054.152-.025.16.006.16.035.158.063.148.09.133.114.115.132.092.148.065.157.037.16.007.133-.016.115-.024.005-.001.005-.001.181-.04h.005l.005-.002.18-.042.006-.001.005-.001.18-.044.005-.002.005-.001.18-.046.004-.002h.005l.179-.05h.005l.005-.002.178-.05.005-.002.005-.002.177-.052.005-.002.005-.001.177-.055.005-.002.005-.001.176-.057.005-.002.005-.002.175-.059.005-.001.005-.002.174-.061.005-.002.005-.002.173-.063.005-.002.005-.002.173-.065.004-.002.005-.002.172-.068.005-.002.005-.002.171-.07.005-.001.005-.002.17-.072.005-.002.004-.002.17-.074.005-.002.004-.002.169-.076.004-.002.005-.002.168-.078.004-.002.005-.003.167-.08.004-.002.005-.002.166-.082.004-.002.005-.003.165-.084.004-.002.005-.003.163-.086.005-.002.005-.003.162-.088.005-.002.005-.003.161-.09.005-.002.004-.003.16-.092.005-.003.005-.002.16-.094.004-.003.004-.003.158-.096.005-.002.004-.003.158-.098.004-.003.005-.003.156-.1.004-.003.004-.003.155-.101.005-.003.004-.003.154-.104.004-.003.004-.003.153-.106.004-.003.005-.003.151-.108.004-.003.005-.003.15-.11.004-.003.004-.003.149-.112.004-.003.004-.003.148-.113.004-.004.004-.003.147-.115.004-.004.004-.003.068-.055.116-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.05-.153-.08-.14-.103-.125-.124-.102-.142-.077-.153-.05-.16-.02z"}));function FX(){return FX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},FX.apply(null,arguments)}var qX=({styles:e={},...t})=>wE("svg",FX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16.012 9.222c-1.673 4.657-2.735 9.508-4.409 14.164 1.536-1.526 2.874-3.236 4.41-4.762l4.408 4.762c-1.497-4.712-2.911-9.451-4.409-14.164zm.032 2.93c.823 2.588 1.599 5.19 2.421 7.777l-2.42-2.614c-.683.598-2.454 2.886-2.34 2.39.871-2.489 1.448-5.07 2.34-7.552zM16.012.312c-1.448.02-2.93.157-4.302.628-.852.447-.255 1.863.66 1.574 2.255-.608 4.648-.607 6.922-.108.934.075 1.228-1.376.338-1.67C18.451.44 17.227.317 16.012.311zm9.012 2.934c-.913-.104-1.272 1.258-.454 1.648 1.834 1.36 3.293 3.185 4.31 5.22.526.776 1.842.098 1.515-.78a15.522 15.522 0 00-5.06-6.006c-.1-.044-.203-.07-.31-.082zM6.65 3.59c-.762.089-1.24.809-1.805 1.267C3.38 6.295 2.163 8.007 1.37 9.905c-.266.898 1.094 1.484 1.564.675a14.825 14.825 0 014.327-5.56c.476-.515.09-1.419-.612-1.431zm9.362.007c-.698.066-1.689-.16-2.033.635-.282.733.535 1.358 1.217 1.125 1.806-.147 3.63.203 5.293.907.902.255 1.472-1.112.656-1.573-1.6-.735-3.374-1.089-5.133-1.094zm-5.479 1.365c-.835.15-1.517.76-2.21 1.226-1.203.94-2.318 2.061-3.057 3.402-.33.904 1.063 1.552 1.547.723 1.045-1.656 2.596-2.925 4.285-3.873.545-.499.171-1.463-.565-1.478zm13.903 2.115c-.875-.07-1.22 1.173-.501 1.627 1.325 1.34 2.188 3.062 2.748 4.84.468.84 1.869.21 1.557-.699-.604-2.118-1.751-4.097-3.351-5.615a.93.93 0 00-.453-.153zM4.467 13.132c-.822-.07-.996.826-1.046 1.455-.256 1.93-.094 3.933.562 5.769.406.844 1.807.365 1.612-.551a11.498 11.498 0 01-.334-5.808.874.874 0 00-.794-.865zm26.687 1.6c-.746-.037-1.014.785-.879 1.395.043 2.393-.57 4.771-1.66 6.894-.31.884 1.02 1.536 1.53.75a15.632 15.632 0 001.821-8.372.876.876 0 00-.812-.667zm-30.197.571c-.782-.073-1.044.775-.933 1.404.068 2.414.661 4.833 1.809 6.962.534.77 1.842.076 1.505-.798a14.833 14.833 0 01-1.603-6.861.876.876 0 00-.778-.707zm26.787 2.024c-.777-.048-.952.797-1.021 1.392-.354 1.692-1.202 3.231-2.216 4.608-.407.872.925 1.638 1.48.852 1.361-1.733 2.296-3.827 2.582-6.017a.874.874 0 00-.825-.835zM6.857 23.012c-.808.018-1.082 1.122-.47 1.59 1.393 1.607 3.187 2.886 5.194 3.599.91.222 1.43-1.165.598-1.596a11.495 11.495 0 01-4.723-3.396.899.899 0 00-.599-.197zm15.057 2.7c-.81.194-1.504.76-2.325.972-1.203.458-2.5.536-3.758.664-.869.307-.573 1.728.346 1.663 2.201-.034 4.412-.626 6.293-1.778.604-.495.227-1.532-.556-1.521zM6.346 27.118c-.833.008-1.11 1.218-.395 1.617 1.986 1.602 4.358 2.749 6.868 3.226.933.076 1.227-1.376.338-1.67a14.838 14.838 0 01-6.345-3.066.929.929 0 00-.466-.107zm19.208.087c-.766.09-1.241.841-1.922 1.158-1.516.991-3.251 1.58-4.996 2.005-.872.405-.346 1.849.584 1.604 2.543-.526 4.98-1.66 6.963-3.344.47-.52.072-1.42-.63-1.423z"}));function HX(){return HX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},HX.apply(null,arguments)}var WX=({styles:e={},...t})=>wE("svg",HX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M8.742 10.464v11.072h14.516V10.464H8.742zm3.224 1.73h8.066a69569 69569 0 00-4.034 3.22l-4.032-3.22zm9.565 1.018v6.594H10.469v-6.593L16 17.63l5.532-4.419zM16 0h-.005l-.188.001h-.011l-.188.004h-.011l-.187.006h-.011l-.187.008h-.005L15.2.02l-.187.01h-.005l-.005.001-.187.013h-.011L14.62.06h-.01l-.186.018h-.011l-.185.02-.005.001h-.006l-.185.022-.005.001h-.005l-.185.025h-.005l-.005.001-.185.027h-.005l-.005.001-.184.029h-.005l-.005.001-.183.031-.006.001-.005.001-.182.033-.006.001-.005.001-.182.035-.005.001-.005.001-.182.038h-.005l-.005.002-.181.04h-.005l-.005.002-.18.042-.006.001-.005.001-.18.044-.005.002h-.005l-.17.045-.152.054-.139.082-.121.106-.1.127-.074.143-.046.155-.017.16.013.16.043.156.07.145.097.13.119.108.137.085.15.058.159.03.16-.001.133-.023.165-.043.168-.041.171-.04.171-.037.172-.036.17-.033.173-.03.17-.03.177-.027.171-.025.175-.022.175-.02.175-.02.176-.016.175-.014.177-.012.176-.01.177-.007.174-.006.177-.003L16 1.73h.177l.178.004.174.006.177.007.176.01.177.012.175.014.176.017.175.018.175.02.175.023.171.025.176.027.17.03.174.03.17.033.171.036.154.033.16.02.161-.01.156-.04.146-.069.131-.094.111-.117.087-.135.061-.15.032-.158.002-.16-.027-.16-.057-.15L20 .714l-.108-.12-.128-.097-.145-.073-.128-.038-.158-.035-.005-.001-.005-.001L19.14.31h-.005l-.005-.002-.182-.035h-.006l-.005-.002-.182-.033h-.006l-.005-.002-.183-.03-.005-.001-.006-.001-.183-.029h-.005l-.006-.001-.184-.027h-.005l-.005-.001-.185-.024h-.005L17.968.12 17.783.1l-.006-.001h-.005l-.185-.02h-.006l-.005-.001L17.39.06h-.005L17.38.06l-.187-.015h-.005l-.005-.001-.187-.013h-.011L16.8.02h-.011L16.6.01h-.011l-.187-.006h-.011L16.204 0h-.011L16.005 0H16zm9.015 2.935l-.16.004-.158.033-.15.062-.134.09-.116.111-.093.132-.067.147-.038.156-.01.161.022.16.05.153.078.141.103.124.102.087.045.034.142.106.137.105.14.11.136.11.135.112.134.115.134.117.13.115.132.122.128.12.127.122.126.125.124.126.124.128.121.13.118.128.118.132.117.133.113.134.113.136.11.136.109.137.109.142.104.14.103.14.101.142.1.144.099.146.095.145.094.147.093.15.092.15.087.149.087.15.084.152.084.155.08.152.08.155.04.081.084.138.11.119.128.096.145.072.155.043.16.013.16-.016.155-.046.144-.074.127-.099.106-.12.083-.14.055-.151.026-.16-.004-.16-.034-.158-.05-.124-.042-.085-.002-.004-.003-.005-.084-.165-.002-.004-.003-.005-.086-.164-.002-.004-.003-.005-.088-.162-.002-.005-.003-.005-.09-.161-.002-.005-.003-.004-.092-.16-.003-.005-.002-.005-.094-.16-.003-.004-.003-.004-.096-.159-.002-.004-.003-.005-.098-.157-.003-.004-.003-.005-.1-.156-.003-.004-.003-.005-.101-.154-.003-.005-.003-.004-.104-.154-.003-.004-.003-.005-.106-.152-.003-.005-.003-.004-.108-.151-.003-.004-.003-.005-.11-.15-.003-.004-.003-.004-.111-.15-.004-.003-.003-.005-.113-.147-.004-.004-.003-.005-.115-.146-.004-.004-.003-.004-.117-.145-.004-.004-.003-.004-.12-.144-.003-.004-.003-.004-.121-.142-.004-.004-.003-.004-.123-.141-.003-.004-.004-.004-.125-.14-.003-.004-.004-.004-.127-.138-.003-.004-.004-.004-.128-.136-.004-.004-.004-.004-.13-.135-.004-.004-.004-.004-.132-.134-.003-.004-.004-.003-.134-.133-.004-.003-.004-.004-.135-.13-.004-.004-.004-.004-.136-.128-.004-.004-.004-.004-.138-.126-.004-.004-.004-.003-.14-.125-.004-.004-.004-.003-.14-.123-.005-.004-.004-.003-.142-.121-.004-.004-.004-.003-.144-.12-.004-.003-.004-.003-.145-.117-.004-.004-.004-.003-.147-.115-.004-.004-.004-.003-.148-.113-.004-.003-.004-.004-.149-.111-.004-.003-.004-.004-.05-.036-.14-.083-.15-.055-.16-.027zM6.634 3.28l-.161.008-.157.037-.147.066-.111.074-.04.032-.005.003-.004.004-.145.117-.004.003-.004.004-.144.119-.004.003-.004.004-.142.12-.004.004-.004.004-.141.123-.004.003-.004.004-.14.125-.004.003-.004.004-.138.126-.004.004-.004.004-.136.128-.004.004-.004.004-.135.13-.004.004-.004.003-.134.133-.004.003-.004.004-.132.134-.003.004-.004.004-.13.135-.004.004-.004.004-.128.136-.004.004-.004.004-.126.138-.004.004-.003.004-.125.14-.004.004-.003.004-.123.14-.004.005-.003.004-.121.142-.004.004-.003.004-.12.144-.003.004-.003.004-.117.145-.004.004-.003.004-.115.146-.004.005-.003.004-.113.147-.003.005-.004.004-.111.149-.003.004-.004.004-.11.15-.002.005-.003.004-.108.151-.003.004-.003.005-.106.152-.003.005-.003.004-.104.154-.003.004-.003.005-.102.154-.003.005-.002.004-.1.156-.003.005-.003.004-.098.157-.003.005-.003.004-.096.159-.002.004-.003.005-.094.16-.003.004-.002.004-.092.16-.003.005-.003.005-.09.161-.002.005-.003.005-.088.162-.002.005-.003.004-.086.164-.002.005-.002.004-.084.165-.003.005-.002.004-.082.166-.002.004-.003.005-.08.167-.002.004-.002.005-.078.168-.002.004-.002.005-.045.1-.053.153-.023.16.007.16.037.157.065.148.092.132.114.114.134.09.148.064.157.035.161.006.16-.025.152-.054.14-.08.121-.106.1-.126.065-.118.043-.095.074-.16.075-.155.077-.157.08-.155.08-.152.083-.155.085-.152.086-.15.088-.149.091-.15.094-.15.094-.147.095-.145.099-.146.1-.144.1-.142.104-.14.104-.14.11-.142.107-.137.11-.136.114-.136.113-.134.117-.133.118-.132.117-.129.122-.13.124-.127.123-.126.127-.125.127-.122.128-.12.132-.122.13-.115.133-.117.135-.115.135-.111.136-.11.037-.03.117-.11.094-.132.068-.146.04-.156.01-.161-.02-.16-.05-.154-.076-.141-.102-.125-.123-.104-.14-.08-.153-.051-.16-.023zM16 3.286h-.005l-.148.001h-.01l-.147.003h-.011l-.147.005h-.011l-.146.007h-.011l-.146.009h-.011l-.146.01h-.005l-.005.001-.146.012h-.011l-.145.014h-.006l-.005.001-.05.006-.158.031-.15.06-.135.088-.117.111-.094.13-.069.147-.04.156-.01.16.019.16.049.154.076.142.102.125.123.105.14.08.152.051.16.023.134-.003.045-.005.135-.013.133-.01.136-.01.135-.007.137-.006.136-.004.136-.003h.274l.136.003.136.004.136.006.136.007.136.01.133.01.135.013.135.014.135.016.134.018.132.018.134.021.133.023.133.024.133.025.13.027.132.03.132.03.129.031.13.034.129.035.129.036.13.04.126.038.128.042.126.042.128.045.127.047.126.047.12.048.127.051.123.052.006.002.147.048.16.021.16-.009.157-.038.147-.067.131-.093.112-.116.089-.135.062-.149.033-.158.004-.16-.027-.16-.055-.151-.083-.139-.107-.12-.127-.099-.118-.063-.004-.001-.005-.003-.005-.002-.133-.056-.005-.002-.005-.002-.134-.054-.004-.002-.005-.002-.135-.053-.005-.002-.005-.002-.135-.051-.005-.002-.005-.002-.135-.05-.005-.001-.005-.002-.137-.048-.005-.001-.005-.002-.137-.046-.005-.002-.005-.002-.137-.044-.005-.002-.005-.001-.138-.043-.006-.002-.005-.001-.138-.042-.005-.001-.005-.002-.14-.04H19.4l-.005-.002-.14-.038-.005-.001-.005-.002-.14-.036-.005-.001-.005-.001-.141-.035-.005-.001-.005-.001-.142-.033-.005-.001-.005-.001-.142-.031-.005-.002h-.005l-.142-.03-.005-.001-.005-.001-.143-.028h-.005l-.005-.002-.143-.025-.006-.001-.005-.001-.143-.024-.005-.001-.006-.001-.143-.022-.006-.001h-.005l-.144-.022h-.005l-.006-.001-.144-.019h-.005l-.006-.001-.144-.017h-.006l-.005-.001-.145-.016h-.011l-.145-.014H17.1l-.005-.001-.146-.012h-.01l-.146-.01-.006-.001h-.005l-.146-.009h-.011l-.147-.006h-.01l-.147-.005h-.011l-.147-.003h-.011l-.147-.001H16zm-5.482 1.366l-.16.008-.157.037-.123.053-.06.032-.005.002-.004.003-.128.069-.004.002-.005.003-.126.07-.005.003-.004.002-.126.072-.005.003-.004.003-.125.073-.004.003-.005.003-.124.075-.004.003-.005.002-.123.077-.004.003-.005.003-.122.078-.004.003-.005.003-.121.08-.004.002-.005.003-.12.082-.005.003-.004.003-.12.083-.004.003-.004.003-.118.084-.005.003-.004.003-.118.086-.004.003-.004.003-.117.088-.004.003-.004.003-.116.089-.004.003-.004.004-.114.09-.005.003-.004.003-.113.092-.004.004-.004.003-.113.093-.004.004-.004.003-.111.095-.005.003-.004.004-.11.096-.004.004-.004.003-.11.098-.003.003-.004.004-.108.1-.004.003-.004.003-.107.101-.004.004-.004.003-.106.102-.004.004-.003.004-.105.103-.004.004-.004.004-.103.105-.004.004-.004.003-.102.106-.003.004-.004.004-.1.107-.004.004-.004.004-.099.108-.004.004-.003.004-.098.11-.003.003-.004.004-.096.11-.004.005-.003.004-.095.111-.003.004-.004.004-.093.113-.003.004-.004.004-.092.113-.003.004-.003.005-.09.114-.004.004-.003.004-.089.116-.003.004-.003.004-.088.117-.003.004-.003.004-.086.118-.003.004-.003.005-.084.118-.003.004-.003.005-.083.12-.003.003-.003.005-.082.12-.003.005-.002.004-.068.103-.076.142-.048.154-.018.16.011.161.041.156.07.146.095.13.117.11.136.086.15.06.158.03.162.002.158-.03.15-.057.138-.085.119-.109.082-.105.065-.099.075-.11.077-.113.077-.107.08-.11.08-.108.084-.108.083-.105.086-.106.086-.104.088-.104.089-.101.09-.102.093-.101.093-.099.094-.097.095-.096.098-.097.098-.095.099-.093.1-.092.103-.091.101-.089.104-.088.104-.086.106-.086.106-.083.106-.082.109-.082.108-.079.11-.078.11-.076.112-.076.112-.074.113-.072.113-.071.115-.07.115-.068.118-.067.117-.065.12-.065.054-.029.135-.088.116-.111.094-.132.068-.146.04-.156.009-.161-.02-.16-.05-.153-.078-.142-.102-.125-.123-.103-.141-.079-.153-.051-.16-.022zm13.91 2.116l-.162.008-.157.037-.147.066-.132.092-.113.116-.09.134-.063.148-.034.157-.005.162.025.159.055.152.082.138.086.103.09.09.094.098.092.099.093.1.091.103.089.101.088.104.086.104.086.106.083.105.083.108.08.108.081.11.077.107.077.112.075.111.075.114.072.113.071.113.07.114.068.118.067.115.065.118.064.117.062.117.061.121.059.119.059.122.056.121.054.12.055.125.051.123.051.125.048.123.048.127.047.126.044.125.043.128.042.129.039.126.038.13.022.076.058.15.085.137.11.119.129.096.145.07.155.043.16.013.161-.017.154-.046.144-.075.126-.1.106-.12.082-.14.055-.151.025-.16-.005-.16-.026-.132-.023-.082-.002-.005-.001-.005-.042-.139-.001-.005-.002-.005-.043-.138-.001-.005-.002-.005-.044-.137-.002-.005-.002-.005-.046-.137-.002-.005-.001-.005-.048-.137-.002-.005-.002-.005-.05-.135-.001-.005-.002-.005-.051-.135-.002-.005-.002-.005-.053-.135-.002-.005-.002-.005-.054-.133-.002-.005-.002-.005-.057-.133-.002-.005-.002-.005-.057-.132-.003-.005-.002-.005-.06-.132-.001-.005-.002-.004-.061-.132-.003-.004-.002-.005-.063-.13-.002-.005-.002-.005-.064-.13-.003-.004-.002-.005-.066-.129-.002-.004-.003-.005-.067-.128-.002-.005-.003-.004-.069-.128-.002-.004-.003-.005-.07-.126-.003-.005-.003-.004-.072-.126-.002-.005-.003-.004-.074-.125-.002-.004-.003-.005-.075-.124-.003-.004-.003-.005-.076-.123-.003-.004-.003-.005-.078-.122-.003-.004-.003-.005-.08-.121-.003-.004-.003-.005-.081-.12-.003-.005-.003-.004-.083-.12-.003-.004-.003-.004-.084-.118-.003-.005-.003-.004-.086-.118-.003-.004-.004-.004-.087-.117-.003-.004-.003-.004-.09-.116-.002-.004-.004-.004-.09-.114-.003-.005-.004-.004-.091-.113-.004-.004-.003-.004-.094-.113-.003-.004-.003-.004-.095-.111-.004-.004-.003-.004-.096-.11-.004-.005-.003-.004-.098-.11-.004-.003-.003-.004-.1-.108-.003-.004-.004-.004-.1-.107-.004-.004-.004-.004-.102-.106-.003-.003-.004-.004-.093-.095-.124-.103-.14-.08-.153-.05-.16-.023zM4.45 12.826l-.161.002-.158.032-.15.06-.135.088-.118.11-.094.131-.069.146-.035.129-.026.132v.005l-.002.005-.025.143-.001.005-.001.006-.024.143-.001.005-.001.006-.022.143-.001.006-.001.005-.02.144-.001.005-.001.005-.019.145v.005l-.001.006-.017.144v.006l-.001.005-.016.145v.011l-.014.145v.005l-.001.006-.012.146v.01l-.01.146-.001.006v.005l-.009.146v.011l-.007.146v.011l-.004.147v.011l-.003.147v.01l-.002.148v.01l.001.148v.01l.003.147v.011l.005.147v.01l.007.147v.011l.009.146v.011l.01.146v.01l.013.146v.011l.014.145v.005l.001.006.016.145v.011l.018.144v.006l.001.005.019.144v.006l.001.005.021.144v.005l.002.006.022.143v.006l.002.005.024.143v.005l.002.006.025.143.001.005.001.005.028.143.001.005.001.005.03.142v.005l.002.006.03.141.002.005.001.005.033.142v.005l.002.005.035.14v.006l.002.005.036.14.002.005.001.005.038.14.001.005.002.005.04.14v.005l.002.005.042.138.001.006.002.005.042.138.002.005.002.005.017.054.064.148.09.134.114.114.132.092.148.065.157.037.16.007.16-.023.153-.052.14-.08.123-.104.102-.125.076-.142.049-.153.02-.16-.011-.161-.031-.13-.017-.051-.039-.126-.038-.13-.037-.128-.035-.13-.033-.128-.033-.134-.03-.13-.029-.131-.026-.13-.026-.133-.024-.133-.023-.133-.02-.132-.02-.136-.017-.132-.016-.135-.014-.135-.012-.133-.012-.138-.009-.133-.007-.136-.006-.138-.004-.134-.003-.136v-.274l.003-.136.004-.134.006-.139.007-.136.01-.133.01-.138.013-.132.014-.135.016-.135.017-.132.02-.137.02-.13.023-.134.024-.133.024-.126.016-.16-.014-.161-.044-.155-.072-.145-.098-.128-.12-.108-.137-.084-.15-.057-.16-.029zm26.698 1.601l-.161.01-.157.04-.146.067-.131.093-.112.117-.088.135-.061.149-.033.157-.005.134.006.14.006.176.003.177.001.178-.001.177-.003.178-.006.177-.007.176-.01.177-.012.176-.015.176-.016.173-.018.175-.02.175-.024.174-.025.175-.026.17-.03.174-.03.173-.033.17-.036.172-.037.17-.04.17-.042.172-.043.168-.045.166-.048.169-.05.167-.052.168-.053.164-.056.166-.058.166-.06.16-.062.165-.062.158-.066.165-.068.16-.07.16-.07.158-.075.159-.074.155-.079.158-.08.158-.06.15-.03.158-.001.161.029.159.058.15.085.137.108.119.13.097.144.07.156.044.16.013.16-.017.155-.046.143-.074.127-.1.107-.12.07-.115.083-.164.003-.005.002-.004.082-.166.002-.005.003-.004.08-.167.002-.005.002-.004.078-.168.002-.005.002-.004.076-.169.002-.004.002-.005.074-.17.002-.004.002-.005.072-.17.002-.005.002-.005.07-.171.001-.005.002-.005.068-.172.002-.004.002-.005.065-.173.002-.005.002-.005.063-.173.002-.005.002-.005.06-.174.003-.005.001-.005.06-.175.001-.005.002-.005.057-.176.001-.005.002-.005.055-.177.001-.005.002-.005.052-.177.002-.005.001-.005.051-.178.001-.005.002-.005.048-.179.002-.005v-.005l.047-.179.001-.005.002-.005.044-.18v-.005l.002-.005.042-.18.001-.006.001-.005.04-.181.001-.005.001-.005.037-.182.002-.005v-.005l.036-.182v-.006l.002-.005.033-.182v-.006l.002-.005.03-.183.001-.005.001-.005.029-.184v-.005l.001-.006.027-.184v-.005l.001-.005.024-.185v-.005l.001-.005.022-.185v-.006l.001-.005.02-.185v-.006l.001-.005.017-.186v-.005l.001-.005.015-.187v-.005l.001-.005.013-.187v-.01l.01-.187.001-.006v-.005l.009-.187v-.011l.006-.187v-.011l.004-.188v-.011l.001-.188v-.01l-.001-.188v-.011l-.004-.188v-.011l-.006-.187v-.011l-.007-.145-.022-.16-.05-.152-.08-.141-.103-.124-.125-.102-.141-.077-.153-.05-.16-.02zM.938 15L.777 15l-.158.032-.15.06-.136.087-.117.11-.095.131-.068.146-.04.156-.012.133-.001.14v.01l.001.188v.011l.004.188v.011l.006.187v.011l.008.187v.011l.011.187v.005l.001.005.013.187v.01l.016.187v.01l.018.186v.011l.02.185.001.005v.006l.022.185.001.005v.005l.025.185v.005l.001.005.027.184v.006l.001.005.029.184v.005l.001.005.031.183.001.005.001.006.033.182.001.005.001.006.035.182.001.005.001.005.038.182v.005l.002.005.04.181v.005l.002.005.042.18.001.006.001.005.044.18.002.005v.005l.047.18.001.004.002.005.048.179.002.005.001.005.05.178.002.005.001.005.053.177.002.005.001.005.055.177.002.005.001.005.057.176.002.005.001.005.06.175.001.005.002.005.061.174.002.005.002.005.063.173.002.005.002.005.065.173.002.005.002.004.067.172.002.005.002.005.07.171.002.005.002.005.072.17.002.005.002.004.074.17.002.005.002.004.076.169.002.004.002.005.078.168.002.004.002.005.08.167.003.004.002.005.082.166.002.004.003.005.02.04.086.136.11.118.13.095.146.07.156.041.16.012.16-.019.155-.048.142-.075.126-.1.105-.123.08-.14.054-.152.024-.16-.006-.16-.036-.158-.051-.123-.018-.034-.078-.158L3.1 22.1l-.074-.16-.071-.157-.07-.16-.068-.16-.067-.165-.062-.158-.062-.164-.059-.161-.058-.166-.056-.166-.053-.164-.052-.168-.05-.167-.048-.17-.045-.165-.043-.168-.043-.172-.039-.17-.037-.17-.036-.172-.033-.17-.03-.173-.03-.174-.027-.17-.025-.175-.022-.174-.021-.175-.018-.175-.017-.173-.014-.176-.012-.176-.01-.177-.007-.176-.006-.177-.003-.178L1.73 16v-.134l-.013-.16-.044-.156-.072-.144-.097-.129-.12-.108-.137-.085-.15-.057L.938 15zm26.798 2.024l-.16.007-.157.038-.148.066-.132.092-.113.115-.09.134-.062.148-.03.127-.001.004-.023.134-.024.133-.026.133-.026.13-.03.132-.03.129-.032.134-.033.128-.035.13-.037.128-.038.13-.04.126-.04.128-.044.128-.044.126-.046.126-.048.126-.05.125-.05.125-.051.122-.054.123-.055.122-.056.12-.058.122-.06.12-.061.12-.063.119-.062.116-.067.119-.066.116-.069.115-.069.115-.07.113-.073.113-.074.112-.076.113-.077.112-.077.107-.08.11-.08.107-.085.11-.044.056-.088.135-.06.15-.033.158-.002.16.027.16.057.15.083.138.108.12.128.098.144.072.155.045.16.015.161-.016.155-.044.144-.073.128-.098.09-.099.05-.061.003-.004.003-.005.089-.115.003-.004.003-.005.088-.116.003-.004.003-.005.086-.117.003-.004.003-.005.084-.118.003-.004.003-.005.083-.12.003-.004.003-.004.081-.12.003-.005.003-.004.08-.121.003-.005.003-.004.078-.122.003-.005.003-.004.077-.123.002-.005.003-.004.075-.124.003-.005.003-.004.073-.125.003-.005.003-.004.072-.126.002-.004.003-.005.07-.126.003-.005.002-.005.07-.127.002-.004.002-.005.068-.128.002-.005.002-.004.066-.13.003-.004.002-.005.064-.13.002-.004.003-.005.062-.13.002-.005.003-.005.06-.13.003-.005.002-.005.06-.132.002-.005.002-.005.057-.132.003-.005.002-.005.056-.133.002-.005.002-.005.054-.134.002-.004.002-.005.053-.135.002-.005.002-.005.051-.135.002-.005.002-.005.05-.135.001-.005.002-.005.048-.137.001-.005.002-.005.046-.137.002-.005.002-.005.044-.137.002-.005.002-.005.042-.138.002-.005.001-.006.042-.138.001-.005.002-.005.04-.14V19.4l.002-.005.038-.14.001-.005.002-.005.036-.14.001-.005.001-.005.035-.141.001-.005.001-.005.033-.142.001-.005.001-.005.031-.141.001-.006.002-.005.029-.142v-.005l.002-.005.028-.143v-.005l.002-.005.025-.143.001-.006.001-.005.024-.143.001-.005.001-.006.001-.006.01-.161-.02-.16-.05-.154-.077-.141-.102-.125-.123-.104-.141-.079-.153-.051-.16-.022zM6.841 22.71l-.16.024-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.018.16.011.161.041.156.07.146.077.109.04.048.003.004.003.004.095.111.003.004.004.004.096.11.004.005.003.004.098.109.003.004.004.004.1.108.003.004.003.004.101.107.004.004.003.004.102.105.004.004.004.004.103.105.004.004.004.003.105.104.003.004.004.003.106.102.004.004.004.004.107.1.004.004.004.004.108.099.004.003.004.004.11.098.003.003.004.004.11.096.004.003.005.004.11.095.005.003.004.004.113.093.004.003.004.004.113.091.004.004.005.003.114.09.004.004.004.003.116.089.004.003.004.003.117.088.004.003.004.003.118.086.004.003.005.003.118.084.004.003.005.003.119.083.004.003.005.003.12.081.005.003.004.003.121.08.005.003.004.003.122.078.005.003.004.003.123.076.005.003.004.003.124.075.005.003.004.003.125.073.004.003.005.002.126.073.004.002.005.003.126.07.005.003.004.002.128.07.004.002.005.002.128.067.005.003.004.002.13.066.004.002.005.003.13.064.004.002.005.003.13.062.005.002.004.003.132.06.004.003.005.002.132.06.005.002.005.002.132.057.005.002.005.002.133.057.005.002.005.002.133.054.005.002.005.002.13.05.154.045.16.016.16-.015.156-.045.144-.072.128-.098.108-.12.083-.138.057-.15.028-.16-.003-.16-.032-.159-.061-.149-.088-.135-.11-.117-.132-.094-.12-.058-.124-.049-.126-.051-.122-.051-.122-.054-.12-.054-.126-.058-.119-.057-.12-.06-.12-.06-.118-.063-.117-.064-.119-.066-.116-.066-.115-.068-.115-.07-.113-.07-.115-.074-.112-.074-.11-.075-.11-.076-.112-.08-.11-.08-.109-.081-.106-.082-.104-.082-.106-.086-.105-.087-.101-.086-.105-.091-.1-.09-.1-.091-.1-.094-.097-.094-.1-.098-.093-.095-.096-.1-.093-.098-.092-.101-.089-.1-.09-.102-.088-.104-.036-.043-.114-.114-.133-.091-.148-.065-.157-.036-.161-.006zm15.063 2.701l-.16.014-.156.044-.12.057-.06.034-.12.066-.117.064-.118.062-.12.061-.12.06-.118.057-.126.058-.12.054-.122.054-.122.05-.126.052-.125.05-.124.046-.127.047-.125.044-.129.043-.126.04-.13.042-.128.038-.127.035-.13.036-.131.034-.129.031-.132.03-.13.03-.135.027-.133.026-.13.023-.13.022-.137.021-.132.02-.134.017-.132.015-.138.015-.135.013-.133.01-.138.01-.136.007-.134.006-.136.004-.14.003-.16.018-.155.047-.142.076-.127.1-.105.122-.08.14-.054.151-.025.16.006.16.035.158.064.148.09.134.114.114.133.092.147.065.157.036.134.008.145-.002h.011l.147-.005h.01l.147-.007h.011l.146-.009h.011l.146-.01h.005l.005-.001.146-.012h.011l.145-.014h.005l.006-.001.145-.016h.011l.144-.018h.006l.005-.001.144-.02h.011l.144-.021.005-.001h.006l.143-.023.006-.001h.005l.143-.025h.005l.006-.002.143-.026h.005l.005-.002.143-.027.005-.001.005-.001.142-.03h.005l.005-.002.142-.03.005-.002.005-.001.142-.033.005-.001.005-.001.14-.035.006-.001.005-.001.14-.037h.005l.005-.002.14-.038.005-.002h.005l.14-.04.005-.002.005-.001.138-.042.005-.001.006-.002.138-.043.005-.001.005-.002.137-.044.005-.002.005-.002.137-.046.005-.002.005-.001.137-.048.005-.002.005-.002.135-.05.005-.001.005-.002.135-.051.005-.002.005-.002.135-.053.005-.002.004-.002.134-.054.005-.002.005-.002.133-.057.005-.002.005-.002.132-.057.005-.003.005-.002.132-.06.005-.001.004-.002.131-.061.005-.003.005-.002.13-.062.005-.003.005-.002.13-.064.004-.003.005-.002.128-.066.005-.002.005-.003.128-.067.005-.002.004-.003.127-.069.005-.002.005-.003.126-.07.005-.003.004-.003.065-.037.132-.093.112-.115.089-.135.062-.149.034-.157.003-.161-.026-.16-.055-.15-.082-.14-.107-.12-.127-.1-.144-.073-.154-.046-.16-.016zM6.33 26.818l-.16.023-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.02.16.012.161.041.156.07.146.094.13.096.093.032.026.004.003.004.004.145.117.004.003.004.004.146.115.005.003.004.004.147.113.005.003.004.004.149.111.004.003.004.003.15.11.005.003.004.003.151.108.004.003.005.003.152.106.005.003.004.003.154.104.004.003.005.003.154.102.005.002.004.003.156.1.005.003.004.003.157.098.005.003.004.002.159.096.004.003.005.003.16.094.004.003.004.002.16.092.005.003.005.002.161.09.005.003.005.002.162.088.005.003.004.002.164.086.005.003.004.002.165.084.005.003.004.002.166.082.004.002.005.003.167.08.004.002.005.002.168.078.004.002.005.002.168.076.005.002.005.002.17.074.004.002.005.002.17.072.005.002.005.002.17.07.006.002.005.001.171.068.005.002.005.002.173.065.005.002.005.002.173.063.005.002.005.002.174.06.005.003.005.001.175.06.005.001.005.002.176.057.005.001.005.002.176.055.006.001.005.002.177.052.005.002.005.001.178.05.005.002.005.002.178.048.006.001.005.002.179.046.005.001.005.002.18.044h.005l.005.002.18.042.006.001.005.001.159.035.16.02.16-.01.157-.04.146-.069.13-.094.112-.117.087-.136.06-.149.033-.158.002-.161-.028-.159-.057-.15-.084-.138-.108-.12-.128-.098-.144-.072-.128-.039-.154-.033-.168-.04-.171-.041-.17-.044-.168-.046-.167-.047-.168-.05-.165-.051-.166-.054-.166-.056-.163-.057-.165-.06-.161-.062-.164-.064-.16-.065-.16-.068-.162-.07-.157-.07-.157-.074-.157-.075-.156-.077-.153-.079-.156-.082-.153-.082-.154-.086-.15-.086-.152-.09-.148-.09-.147-.092-.149-.095-.145-.095-.144-.098-.145-.1-.143-.102-.14-.103-.14-.104-.14-.108-.139-.11-.136-.11-.027-.022-.133-.091-.148-.065-.157-.036-.161-.006zm19.215.087l-.16.01-.157.039-.146.067-.11.076-.064.051-.139.11-.14.108-.14.104-.14.103-.143.101-.145.101-.144.098-.145.095-.149.095-.148.093-.147.089-.152.09-.15.086-.154.086-.153.082-.156.082-.153.079-.156.077-.157.075-.158.073-.157.071-.16.07-.16.068-.161.065-.164.064-.161.061-.165.06-.163.058-.166.056-.166.054-.166.051-.167.05-.167.047-.17.046-.168.044-.171.042-.168.039-.17.037-.11.023-.154.047-.143.075-.126.1-.106.122-.081.139-.054.152-.025.16.006.16.035.158.063.148.09.133.114.115.132.092.148.065.157.037.16.007.133-.016.115-.024.005-.001.005-.001.181-.04h.005l.005-.002.18-.042.006-.001.005-.001.18-.044.005-.002.005-.001.18-.046.004-.002h.005l.179-.05h.005l.005-.002.178-.05.005-.002.005-.002.177-.052.005-.002.005-.001.177-.055.005-.002.005-.001.176-.057.005-.002.005-.002.175-.059.005-.001.005-.002.174-.061.005-.002.005-.002.173-.063.005-.002.005-.002.173-.065.004-.002.005-.002.172-.068.005-.002.005-.002.171-.07.005-.001.005-.002.17-.072.005-.002.004-.002.17-.074.005-.002.004-.002.169-.076.004-.002.005-.002.168-.078.004-.002.005-.003.167-.08.004-.002.005-.002.166-.082.004-.002.005-.003.165-.084.004-.002.005-.003.163-.086.005-.002.005-.003.162-.088.005-.002.005-.003.161-.09.005-.002.004-.003.16-.092.005-.003.005-.002.16-.094.004-.003.004-.003.158-.096.005-.002.004-.003.158-.098.004-.003.005-.003.156-.1.004-.003.004-.003.155-.101.005-.003.004-.003.154-.104.004-.003.004-.003.153-.106.004-.003.005-.003.151-.108.004-.003.005-.003.15-.11.004-.003.004-.003.149-.112.004-.003.004-.003.148-.113.004-.004.004-.003.147-.115.004-.004.004-.003.068-.055.116-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.05-.153-.08-.14-.103-.125-.124-.102-.142-.077-.153-.05-.16-.02z"}));function QX(){return QX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},QX.apply(null,arguments)}var XX=({styles:e={},...t})=>wE("svg",QX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M23.637 13.902l-7.625-5.535-7.624 5.535 2.912 8.956h9.425l2.912-8.956zm-1.017.33l-2.524 7.762H11.93l-2.524-7.762 6.607-4.796 6.608 4.796zM16.012.311c-1.448.02-2.93.157-4.302.628-.852.447-.255 1.863.66 1.574 2.255-.608 4.648-.607 6.922-.108.934.075 1.228-1.376.338-1.67C18.451.44 17.227.317 16.012.311zm9.012 2.934c-.913-.104-1.272 1.258-.454 1.648 1.834 1.36 3.293 3.185 4.31 5.22.526.776 1.842.098 1.515-.78a15.522 15.522 0 00-5.06-6.006c-.1-.044-.203-.07-.31-.082zM6.65 3.59c-.762.089-1.24.809-1.805 1.267C3.38 6.295 2.163 8.007 1.37 9.905c-.266.898 1.094 1.484 1.564.675a14.825 14.825 0 014.327-5.56c.476-.515.09-1.419-.612-1.431zm9.362.007c-.698.066-1.689-.16-2.033.635-.282.733.535 1.358 1.217 1.125 1.806-.147 3.63.203 5.293.907.902.255 1.472-1.112.656-1.573-1.6-.735-3.374-1.089-5.133-1.094zm-5.479 1.365c-.835.15-1.517.76-2.21 1.226-1.203.94-2.318 2.061-3.057 3.402-.33.904 1.063 1.552 1.547.723 1.045-1.656 2.596-2.925 4.285-3.873.545-.499.171-1.463-.565-1.478zm13.903 2.115c-.875-.07-1.22 1.173-.501 1.627 1.325 1.34 2.188 3.062 2.748 4.84.468.84 1.869.21 1.557-.699-.604-2.118-1.751-4.097-3.351-5.615a.93.93 0 00-.453-.153zM4.467 13.132c-.822-.07-.996.826-1.046 1.455-.256 1.93-.094 3.933.562 5.769.406.844 1.807.365 1.612-.551a11.498 11.498 0 01-.334-5.808.874.874 0 00-.794-.865zm26.687 1.6c-.746-.037-1.014.785-.879 1.395.043 2.393-.57 4.771-1.66 6.894-.31.884 1.02 1.536 1.53.75a15.632 15.632 0 001.821-8.372.876.876 0 00-.812-.667zm-30.197.571c-.782-.073-1.044.775-.933 1.404.068 2.414.661 4.833 1.809 6.962.534.77 1.842.076 1.505-.798a14.833 14.833 0 01-1.603-6.861.876.876 0 00-.778-.707zm26.787 2.024c-.777-.048-.952.797-1.021 1.392-.354 1.692-1.202 3.231-2.216 4.608-.407.872.925 1.638 1.48.852 1.361-1.733 2.296-3.827 2.582-6.017a.874.874 0 00-.825-.835zM6.857 23.012c-.808.018-1.082 1.122-.47 1.59 1.393 1.607 3.187 2.886 5.194 3.599.91.222 1.43-1.165.598-1.596a11.495 11.495 0 01-4.723-3.396.899.899 0 00-.599-.197zm15.057 2.7c-.81.194-1.504.76-2.325.972-1.203.458-2.5.536-3.758.664-.869.307-.573 1.728.346 1.663 2.201-.034 4.412-.626 6.293-1.778.604-.495.227-1.532-.556-1.521zM6.346 27.118c-.833.008-1.11 1.218-.395 1.617 1.986 1.602 4.358 2.749 6.868 3.226.933.076 1.227-1.376.338-1.67a14.838 14.838 0 01-6.345-3.066.929.929 0 00-.466-.107zm19.208.087c-.766.09-1.241.841-1.922 1.158-1.516.991-3.251 1.58-4.996 2.005-.872.405-.346 1.849.584 1.604 2.543-.526 4.98-1.66 6.963-3.344.47-.52.072-1.42-.63-1.423z"}));function GX(){return GX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},GX.apply(null,arguments)}var UX=({styles:e={},...t})=>wE("svg",GX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M13.51 9.081v4.428H9.08v4.982h4.428v4.428h4.982V18.49h4.428v-4.982H18.49V9.081h-4.982zm.83.83h3.32v4.428h4.429v3.322H17.66v4.428h-3.32v-4.454H9.91v-3.296h4.428V9.911zM16 0h-.005l-.188.001h-.011l-.188.004h-.011l-.187.006h-.011l-.187.008h-.005L15.2.02l-.187.01h-.005l-.005.001-.187.013h-.011L14.62.06h-.01l-.186.018h-.011l-.185.02-.005.001h-.006l-.185.022-.005.001h-.005l-.185.025h-.005l-.005.001-.185.027h-.005l-.005.001-.184.029h-.005l-.005.001-.183.031-.006.001-.005.001-.182.033-.006.001-.005.001-.182.035-.005.001-.005.001-.182.038h-.005l-.005.002-.181.04h-.005l-.005.002-.18.042-.006.001-.005.001-.18.044-.005.002h-.005l-.17.045-.152.054-.139.082-.121.106-.1.127-.074.143-.046.155-.017.16.013.16.043.156.07.145.097.13.119.108.137.085.15.058.159.03.16-.001.133-.023.165-.043.168-.041.171-.04.171-.037.172-.036.17-.033.173-.03.17-.03.177-.027.171-.025.175-.022.175-.02.175-.02.176-.016.175-.014.177-.012.176-.01.177-.007.174-.006.177-.003L16 1.73h.177l.178.004.174.006.177.007.176.01.177.012.175.014.176.017.175.018.175.02.175.023.171.025.176.027.17.03.174.03.17.033.171.036.154.033.16.02.161-.01.156-.04.146-.069.131-.094.111-.117.087-.135.061-.15.032-.158.002-.16-.027-.16-.057-.15L20 .714l-.108-.12-.128-.097-.145-.073-.128-.038-.158-.035-.005-.001-.005-.001L19.14.31h-.005l-.005-.002-.182-.035h-.006l-.005-.002-.182-.033h-.006l-.005-.002-.183-.03-.005-.001-.006-.001-.183-.029h-.005l-.006-.001-.184-.027h-.005l-.005-.001-.185-.024h-.005L17.968.12 17.783.1l-.006-.001h-.005l-.185-.02h-.006l-.005-.001L17.39.06h-.005L17.38.06l-.187-.015h-.005l-.005-.001-.187-.013h-.011L16.8.02h-.011L16.6.01h-.011l-.187-.006h-.011L16.204 0h-.011L16.005 0H16zm9.015 2.935l-.16.004-.158.033-.15.062-.134.09-.116.111-.093.132-.067.147-.038.156-.01.161.022.16.05.153.078.141.103.124.102.087.045.034.142.106.137.105.14.11.136.11.135.112.134.115.134.117.13.115.132.122.128.12.127.122.126.125.124.126.124.128.121.13.118.128.118.132.117.133.113.134.113.136.11.136.109.137.109.142.104.14.103.14.101.142.1.144.099.146.095.145.094.147.093.15.092.15.087.149.087.15.084.152.084.155.08.152.08.155.04.081.084.138.11.119.128.096.145.072.155.043.16.013.16-.016.155-.046.144-.074.127-.099.106-.12.083-.14.055-.151.026-.16-.004-.16-.034-.158-.05-.124-.042-.085-.002-.004-.003-.005-.084-.165-.002-.004-.003-.005-.086-.164-.002-.004-.003-.005-.088-.162-.002-.005-.003-.005-.09-.161-.002-.005-.003-.004-.092-.16-.003-.005-.002-.005-.094-.16-.003-.004-.003-.004-.096-.159-.002-.004-.003-.005-.098-.157-.003-.004-.003-.005-.1-.156-.003-.004-.003-.005-.101-.154-.003-.005-.003-.004-.104-.154-.003-.004-.003-.005-.106-.152-.003-.005-.003-.004-.108-.151-.003-.004-.003-.005-.11-.15-.003-.004-.003-.004-.111-.15-.004-.003-.003-.005-.113-.147-.004-.004-.003-.005-.115-.146-.004-.004-.003-.004-.117-.145-.004-.004-.003-.004-.12-.144-.003-.004-.003-.004-.121-.142-.004-.004-.003-.004-.123-.141-.003-.004-.004-.004-.125-.14-.003-.004-.004-.004-.127-.138-.003-.004-.004-.004-.128-.136-.004-.004-.004-.004-.13-.135-.004-.004-.004-.004-.132-.134-.003-.004-.004-.003-.134-.133-.004-.003-.004-.004-.135-.13-.004-.004-.004-.004-.136-.128-.004-.004-.004-.004-.138-.126-.004-.004-.004-.003-.14-.125-.004-.004-.004-.003-.14-.123-.005-.004-.004-.003-.142-.121-.004-.004-.004-.003-.144-.12-.004-.003-.004-.003-.145-.117-.004-.004-.004-.003-.147-.115-.004-.004-.004-.003-.148-.113-.004-.003-.004-.004-.149-.111-.004-.003-.004-.004-.05-.036-.14-.083-.15-.055-.16-.027zM6.634 3.28l-.161.008-.157.037-.147.066-.111.074-.04.032-.005.003-.004.004-.145.117-.004.003-.004.004-.144.119-.004.003-.004.004-.142.12-.004.004-.004.004-.141.123-.004.003-.004.004-.14.125-.004.003-.004.004-.138.126-.004.004-.004.004-.136.128-.004.004-.004.004-.135.13-.004.004-.004.003-.134.133-.004.003-.004.004-.132.134-.003.004-.004.004-.13.135-.004.004-.004.004-.128.136-.004.004-.004.004-.126.138-.004.004-.003.004-.125.14-.004.004-.003.004-.123.14-.004.005-.003.004-.121.142-.004.004-.003.004-.12.144-.003.004-.003.004-.117.145-.004.004-.003.004-.115.146-.004.005-.003.004-.113.147-.003.005-.004.004-.111.149-.003.004-.004.004-.11.15-.002.005-.003.004-.108.151-.003.004-.003.005-.106.152-.003.005-.003.004-.104.154-.003.004-.003.005-.102.154-.003.005-.002.004-.1.156-.003.005-.003.004-.098.157-.003.005-.003.004-.096.159-.002.004-.003.005-.094.16-.003.004-.002.004-.092.16-.003.005-.003.005-.09.161-.002.005-.003.005-.088.162-.002.005-.003.004-.086.164-.002.005-.002.004-.084.165-.003.005-.002.004-.082.166-.002.004-.003.005-.08.167-.002.004-.002.005-.078.168-.002.004-.002.005-.045.1-.053.153-.023.16.007.16.037.157.065.148.092.132.114.114.134.09.148.064.157.035.161.006.16-.025.152-.054.14-.08.121-.106.1-.126.065-.118.043-.095.074-.16.075-.155.077-.157.08-.155.08-.152.083-.155.085-.152.086-.15.088-.149.091-.15.094-.15.094-.147.095-.145.099-.146.1-.144.1-.142.104-.14.104-.14.11-.142.107-.137.11-.136.114-.136.113-.134.117-.133.118-.132.117-.129.122-.13.124-.127.123-.126.127-.125.127-.122.128-.12.132-.122.13-.115.133-.117.135-.115.135-.111.136-.11.037-.03.117-.11.094-.132.068-.146.04-.156.01-.161-.02-.16-.05-.154-.076-.141-.102-.125-.123-.104-.14-.08-.153-.051-.16-.023zM16 3.286h-.005l-.148.001h-.01l-.147.003h-.011l-.147.005h-.011l-.146.007h-.011l-.146.009h-.011l-.146.01h-.005l-.005.001-.146.012h-.011l-.145.014h-.006l-.005.001-.05.006-.158.031-.15.06-.135.088-.117.111-.094.13-.069.147-.04.156-.01.16.019.16.049.154.076.142.102.125.123.105.14.08.152.051.16.023.134-.003.045-.005.135-.013.133-.01.136-.01.135-.007.137-.006.136-.004.136-.003h.274l.136.003.136.004.136.006.136.007.136.01.133.01.135.013.135.014.135.016.134.018.132.018.134.021.133.023.133.024.133.025.13.027.132.03.132.03.129.031.13.034.129.035.129.036.13.04.126.038.128.042.126.042.128.045.127.047.126.047.12.048.127.051.123.052.006.002.147.048.16.021.16-.009.157-.038.147-.067.131-.093.112-.116.089-.135.062-.149.033-.158.004-.16-.027-.16-.055-.151-.083-.139-.107-.12-.127-.099-.118-.063-.004-.001-.005-.003-.005-.002-.133-.056-.005-.002-.005-.002-.134-.054-.004-.002-.005-.002-.135-.053-.005-.002-.005-.002-.135-.051-.005-.002-.005-.002-.135-.05-.005-.001-.005-.002-.137-.048-.005-.001-.005-.002-.137-.046-.005-.002-.005-.002-.137-.044-.005-.002-.005-.001-.138-.043-.006-.002-.005-.001-.138-.042-.005-.001-.005-.002-.14-.04H19.4l-.005-.002-.14-.038-.005-.001-.005-.002-.14-.036-.005-.001-.005-.001-.141-.035-.005-.001-.005-.001-.142-.033-.005-.001-.005-.001-.142-.031-.005-.002h-.005l-.142-.03-.005-.001-.005-.001-.143-.028h-.005l-.005-.002-.143-.025-.006-.001-.005-.001-.143-.024-.005-.001-.006-.001-.143-.022-.006-.001h-.005l-.144-.022h-.005l-.006-.001-.144-.019h-.005l-.006-.001-.144-.017h-.006l-.005-.001-.145-.016h-.011l-.145-.014H17.1l-.005-.001-.146-.012h-.01l-.146-.01-.006-.001h-.005l-.146-.009h-.011l-.147-.006h-.01l-.147-.005h-.011l-.147-.003h-.011l-.147-.001H16zm-5.482 1.366l-.16.008-.157.037-.123.053-.06.032-.005.002-.004.003-.128.069-.004.002-.005.003-.126.07-.005.003-.004.002-.126.072-.005.003-.004.003-.125.073-.004.003-.005.003-.124.075-.004.003-.005.002-.123.077-.004.003-.005.003-.122.078-.004.003-.005.003-.121.08-.004.002-.005.003-.12.082-.005.003-.004.003-.12.083-.004.003-.004.003-.118.084-.005.003-.004.003-.118.086-.004.003-.004.003-.117.088-.004.003-.004.003-.116.089-.004.003-.004.004-.114.09-.005.003-.004.003-.113.092-.004.004-.004.003-.113.093-.004.004-.004.003-.111.095-.005.003-.004.004-.11.096-.004.004-.004.003-.11.098-.003.003-.004.004-.108.1-.004.003-.004.003-.107.101-.004.004-.004.003-.106.102-.004.004-.003.004-.105.103-.004.004-.004.004-.103.105-.004.004-.004.003-.102.106-.003.004-.004.004-.1.107-.004.004-.004.004-.099.108-.004.004-.003.004-.098.11-.003.003-.004.004-.096.11-.004.005-.003.004-.095.111-.003.004-.004.004-.093.113-.003.004-.004.004-.092.113-.003.004-.003.005-.09.114-.004.004-.003.004-.089.116-.003.004-.003.004-.088.117-.003.004-.003.004-.086.118-.003.004-.003.005-.084.118-.003.004-.003.005-.083.12-.003.003-.003.005-.082.12-.003.005-.002.004-.068.103-.076.142-.048.154-.018.16.011.161.041.156.07.146.095.13.117.11.136.086.15.06.158.03.162.002.158-.03.15-.057.138-.085.119-.109.082-.105.065-.099.075-.11.077-.113.077-.107.08-.11.08-.108.084-.108.083-.105.086-.106.086-.104.088-.104.089-.101.09-.102.093-.101.093-.099.094-.097.095-.096.098-.097.098-.095.099-.093.1-.092.103-.091.101-.089.104-.088.104-.086.106-.086.106-.083.106-.082.109-.082.108-.079.11-.078.11-.076.112-.076.112-.074.113-.072.113-.071.115-.07.115-.068.118-.067.117-.065.12-.065.054-.029.135-.088.116-.111.094-.132.068-.146.04-.156.009-.161-.02-.16-.05-.153-.078-.142-.102-.125-.123-.103-.141-.079-.153-.051-.16-.022zm13.91 2.116l-.162.008-.157.037-.147.066-.132.092-.113.116-.09.134-.063.148-.034.157-.005.162.025.159.055.152.082.138.086.103.09.09.094.098.092.099.093.1.091.103.089.101.088.104.086.104.086.106.083.105.083.108.08.108.081.11.077.107.077.112.075.111.075.114.072.113.071.113.07.114.068.118.067.115.065.118.064.117.062.117.061.121.059.119.059.122.056.121.054.12.055.125.051.123.051.125.048.123.048.127.047.126.044.125.043.128.042.129.039.126.038.13.022.076.058.15.085.137.11.119.129.096.145.07.155.043.16.013.161-.017.154-.046.144-.075.126-.1.106-.12.082-.14.055-.151.025-.16-.005-.16-.026-.132-.023-.082-.002-.005-.001-.005-.042-.139-.001-.005-.002-.005-.043-.138-.001-.005-.002-.005-.044-.137-.002-.005-.002-.005-.046-.137-.002-.005-.001-.005-.048-.137-.002-.005-.002-.005-.05-.135-.001-.005-.002-.005-.051-.135-.002-.005-.002-.005-.053-.135-.002-.005-.002-.005-.054-.133-.002-.005-.002-.005-.057-.133-.002-.005-.002-.005-.057-.132-.003-.005-.002-.005-.06-.132-.001-.005-.002-.004-.061-.132-.003-.004-.002-.005-.063-.13-.002-.005-.002-.005-.064-.13-.003-.004-.002-.005-.066-.129-.002-.004-.003-.005-.067-.128-.002-.005-.003-.004-.069-.128-.002-.004-.003-.005-.07-.126-.003-.005-.003-.004-.072-.126-.002-.005-.003-.004-.074-.125-.002-.004-.003-.005-.075-.124-.003-.004-.003-.005-.076-.123-.003-.004-.003-.005-.078-.122-.003-.004-.003-.005-.08-.121-.003-.004-.003-.005-.081-.12-.003-.005-.003-.004-.083-.12-.003-.004-.003-.004-.084-.118-.003-.005-.003-.004-.086-.118-.003-.004-.004-.004-.087-.117-.003-.004-.003-.004-.09-.116-.002-.004-.004-.004-.09-.114-.003-.005-.004-.004-.091-.113-.004-.004-.003-.004-.094-.113-.003-.004-.003-.004-.095-.111-.004-.004-.003-.004-.096-.11-.004-.005-.003-.004-.098-.11-.004-.003-.003-.004-.1-.108-.003-.004-.004-.004-.1-.107-.004-.004-.004-.004-.102-.106-.003-.003-.004-.004-.093-.095-.124-.103-.14-.08-.153-.05-.16-.023zM4.45 12.826l-.161.002-.158.032-.15.06-.135.088-.118.11-.094.131-.069.146-.035.129-.026.132v.005l-.002.005-.025.143-.001.005-.001.006-.024.143-.001.005-.001.006-.022.143-.001.006-.001.005-.02.144-.001.005-.001.005-.019.145v.005l-.001.006-.017.144v.006l-.001.005-.016.145v.011l-.014.145v.005l-.001.006-.012.146v.01l-.01.146-.001.006v.005l-.009.146v.011l-.007.146v.011l-.004.147v.011l-.003.147v.01l-.002.148v.01l.001.148v.01l.003.147v.011l.005.147v.01l.007.147v.011l.009.146v.011l.01.146v.01l.013.146v.011l.014.145v.005l.001.006.016.145v.011l.018.144v.006l.001.005.019.144v.006l.001.005.021.144v.005l.002.006.022.143v.006l.002.005.024.143v.005l.002.006.025.143.001.005.001.005.028.143.001.005.001.005.03.142v.005l.002.006.03.141.002.005.001.005.033.142v.005l.002.005.035.14v.006l.002.005.036.14.002.005.001.005.038.14.001.005.002.005.04.14v.005l.002.005.042.138.001.006.002.005.042.138.002.005.002.005.017.054.064.148.09.134.114.114.132.092.148.065.157.037.16.007.16-.023.153-.052.14-.08.123-.104.102-.125.076-.142.049-.153.02-.16-.011-.161-.031-.13-.017-.051-.039-.126-.038-.13-.037-.128-.035-.13-.033-.128-.033-.134-.03-.13-.029-.131-.026-.13-.026-.133-.024-.133-.023-.133-.02-.132-.02-.136-.017-.132-.016-.135-.014-.135-.012-.133-.012-.138-.009-.133-.007-.136-.006-.138-.004-.134-.003-.136v-.274l.003-.136.004-.134.006-.139.007-.136.01-.133.01-.138.013-.132.014-.135.016-.135.017-.132.02-.137.02-.13.023-.134.024-.133.024-.126.016-.16-.014-.161-.044-.155-.072-.145-.098-.128-.12-.108-.137-.084-.15-.057-.16-.029zm26.698 1.601l-.161.01-.157.04-.146.067-.131.093-.112.117-.088.135-.061.149-.033.157-.005.134.006.14.006.176.003.177.001.178-.001.177-.003.178-.006.177-.007.176-.01.177-.012.176-.015.176-.016.173-.018.175-.02.175-.024.174-.025.175-.026.17-.03.174-.03.173-.033.17-.036.172-.037.17-.04.17-.042.172-.043.168-.045.166-.048.169-.05.167-.052.168-.053.164-.056.166-.058.166-.06.16-.062.165-.062.158-.066.165-.068.16-.07.16-.07.158-.075.159-.074.155-.079.158-.08.158-.06.15-.03.158-.001.161.029.159.058.15.085.137.108.119.13.097.144.07.156.044.16.013.16-.017.155-.046.143-.074.127-.1.107-.12.07-.115.083-.164.003-.005.002-.004.082-.166.002-.005.003-.004.08-.167.002-.005.002-.004.078-.168.002-.005.002-.004.076-.169.002-.004.002-.005.074-.17.002-.004.002-.005.072-.17.002-.005.002-.005.07-.171.001-.005.002-.005.068-.172.002-.004.002-.005.065-.173.002-.005.002-.005.063-.173.002-.005.002-.005.06-.174.003-.005.001-.005.06-.175.001-.005.002-.005.057-.176.001-.005.002-.005.055-.177.001-.005.002-.005.052-.177.002-.005.001-.005.051-.178.001-.005.002-.005.048-.179.002-.005v-.005l.047-.179.001-.005.002-.005.044-.18v-.005l.002-.005.042-.18.001-.006.001-.005.04-.181.001-.005.001-.005.037-.182.002-.005v-.005l.036-.182v-.006l.002-.005.033-.182v-.006l.002-.005.03-.183.001-.005.001-.005.029-.184v-.005l.001-.006.027-.184v-.005l.001-.005.024-.185v-.005l.001-.005.022-.185v-.006l.001-.005.02-.185v-.006l.001-.005.017-.186v-.005l.001-.005.015-.187v-.005l.001-.005.013-.187v-.01l.01-.187.001-.006v-.005l.009-.187v-.011l.006-.187v-.011l.004-.188v-.011l.001-.188v-.01l-.001-.188v-.011l-.004-.188v-.011l-.006-.187v-.011l-.007-.145-.022-.16-.05-.152-.08-.141-.103-.124-.125-.102-.141-.077-.153-.05-.16-.02zM.938 15L.777 15l-.158.032-.15.06-.136.087-.117.11-.095.131-.068.146-.04.156-.012.133-.001.14v.01l.001.188v.011l.004.188v.011l.006.187v.011l.008.187v.011l.011.187v.005l.001.005.013.187v.01l.016.187v.01l.018.186v.011l.02.185.001.005v.006l.022.185.001.005v.005l.025.185v.005l.001.005.027.184v.006l.001.005.029.184v.005l.001.005.031.183.001.005.001.006.033.182.001.005.001.006.035.182.001.005.001.005.038.182v.005l.002.005.04.181v.005l.002.005.042.18.001.006.001.005.044.18.002.005v.005l.047.18.001.004.002.005.048.179.002.005.001.005.05.178.002.005.001.005.053.177.002.005.001.005.055.177.002.005.001.005.057.176.002.005.001.005.06.175.001.005.002.005.061.174.002.005.002.005.063.173.002.005.002.005.065.173.002.005.002.004.067.172.002.005.002.005.07.171.002.005.002.005.072.17.002.005.002.004.074.17.002.005.002.004.076.169.002.004.002.005.078.168.002.004.002.005.08.167.003.004.002.005.082.166.002.004.003.005.02.04.086.136.11.118.13.095.146.07.156.041.16.012.16-.019.155-.048.142-.075.126-.1.105-.123.08-.14.054-.152.024-.16-.006-.16-.036-.158-.051-.123-.018-.034-.078-.158L3.1 22.1l-.074-.16-.071-.157-.07-.16-.068-.16-.067-.165-.062-.158-.062-.164-.059-.161-.058-.166-.056-.166-.053-.164-.052-.168-.05-.167-.048-.17-.045-.165-.043-.168-.043-.172-.039-.17-.037-.17-.036-.172-.033-.17-.03-.173-.03-.174-.027-.17-.025-.175-.022-.174-.021-.175-.018-.175-.017-.173-.014-.176-.012-.176-.01-.177-.007-.176-.006-.177-.003-.178L1.73 16v-.134l-.013-.16-.044-.156-.072-.144-.097-.129-.12-.108-.137-.085-.15-.057L.938 15zm26.798 2.024l-.16.007-.157.038-.148.066-.132.092-.113.115-.09.134-.062.148-.03.127-.001.004-.023.134-.024.133-.026.133-.026.13-.03.132-.03.129-.032.134-.033.128-.035.13-.037.128-.038.13-.04.126-.04.128-.044.128-.044.126-.046.126-.048.126-.05.125-.05.125-.051.122-.054.123-.055.122-.056.12-.058.122-.06.12-.061.12-.063.119-.062.116-.067.119-.066.116-.069.115-.069.115-.07.113-.073.113-.074.112-.076.113-.077.112-.077.107-.08.11-.08.107-.085.11-.044.056-.088.135-.06.15-.033.158-.002.16.027.16.057.15.083.138.108.12.128.098.144.072.155.045.16.015.161-.016.155-.044.144-.073.128-.098.09-.099.05-.061.003-.004.003-.005.089-.115.003-.004.003-.005.088-.116.003-.004.003-.005.086-.117.003-.004.003-.005.084-.118.003-.004.003-.005.083-.12.003-.004.003-.004.081-.12.003-.005.003-.004.08-.121.003-.005.003-.004.078-.122.003-.005.003-.004.077-.123.002-.005.003-.004.075-.124.003-.005.003-.004.073-.125.003-.005.003-.004.072-.126.002-.004.003-.005.07-.126.003-.005.002-.005.07-.127.002-.004.002-.005.068-.128.002-.005.002-.004.066-.13.003-.004.002-.005.064-.13.002-.004.003-.005.062-.13.002-.005.003-.005.06-.13.003-.005.002-.005.06-.132.002-.005.002-.005.057-.132.003-.005.002-.005.056-.133.002-.005.002-.005.054-.134.002-.004.002-.005.053-.135.002-.005.002-.005.051-.135.002-.005.002-.005.05-.135.001-.005.002-.005.048-.137.001-.005.002-.005.046-.137.002-.005.002-.005.044-.137.002-.005.002-.005.042-.138.002-.005.001-.006.042-.138.001-.005.002-.005.04-.14V19.4l.002-.005.038-.14.001-.005.002-.005.036-.14.001-.005.001-.005.035-.141.001-.005.001-.005.033-.142.001-.005.001-.005.031-.141.001-.006.002-.005.029-.142v-.005l.002-.005.028-.143v-.005l.002-.005.025-.143.001-.006.001-.005.024-.143.001-.005.001-.006.001-.006.01-.161-.02-.16-.05-.154-.077-.141-.102-.125-.123-.104-.141-.079-.153-.051-.16-.022zM6.841 22.71l-.16.024-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.018.16.011.161.041.156.07.146.077.109.04.048.003.004.003.004.095.111.003.004.004.004.096.11.004.005.003.004.098.109.003.004.004.004.1.108.003.004.003.004.101.107.004.004.003.004.102.105.004.004.004.004.103.105.004.004.004.003.105.104.003.004.004.003.106.102.004.004.004.004.107.1.004.004.004.004.108.099.004.003.004.004.11.098.003.003.004.004.11.096.004.003.005.004.11.095.005.003.004.004.113.093.004.003.004.004.113.091.004.004.005.003.114.09.004.004.004.003.116.089.004.003.004.003.117.088.004.003.004.003.118.086.004.003.005.003.118.084.004.003.005.003.119.083.004.003.005.003.12.081.005.003.004.003.121.08.005.003.004.003.122.078.005.003.004.003.123.076.005.003.004.003.124.075.005.003.004.003.125.073.004.003.005.002.126.073.004.002.005.003.126.07.005.003.004.002.128.07.004.002.005.002.128.067.005.003.004.002.13.066.004.002.005.003.13.064.004.002.005.003.13.062.005.002.004.003.132.06.004.003.005.002.132.06.005.002.005.002.132.057.005.002.005.002.133.057.005.002.005.002.133.054.005.002.005.002.13.05.154.045.16.016.16-.015.156-.045.144-.072.128-.098.108-.12.083-.138.057-.15.028-.16-.003-.16-.032-.159-.061-.149-.088-.135-.11-.117-.132-.094-.12-.058-.124-.049-.126-.051-.122-.051-.122-.054-.12-.054-.126-.058-.119-.057-.12-.06-.12-.06-.118-.063-.117-.064-.119-.066-.116-.066-.115-.068-.115-.07-.113-.07-.115-.074-.112-.074-.11-.075-.11-.076-.112-.08-.11-.08-.109-.081-.106-.082-.104-.082-.106-.086-.105-.087-.101-.086-.105-.091-.1-.09-.1-.091-.1-.094-.097-.094-.1-.098-.093-.095-.096-.1-.093-.098-.092-.101-.089-.1-.09-.102-.088-.104-.036-.043-.114-.114-.133-.091-.148-.065-.157-.036-.161-.006zm15.063 2.701l-.16.014-.156.044-.12.057-.06.034-.12.066-.117.064-.118.062-.12.061-.12.06-.118.057-.126.058-.12.054-.122.054-.122.05-.126.052-.125.05-.124.046-.127.047-.125.044-.129.043-.126.04-.13.042-.128.038-.127.035-.13.036-.131.034-.129.031-.132.03-.13.03-.135.027-.133.026-.13.023-.13.022-.137.021-.132.02-.134.017-.132.015-.138.015-.135.013-.133.01-.138.01-.136.007-.134.006-.136.004-.14.003-.16.018-.155.047-.142.076-.127.1-.105.122-.08.14-.054.151-.025.16.006.16.035.158.064.148.09.134.114.114.133.092.147.065.157.036.134.008.145-.002h.011l.147-.005h.01l.147-.007h.011l.146-.009h.011l.146-.01h.005l.005-.001.146-.012h.011l.145-.014h.005l.006-.001.145-.016h.011l.144-.018h.006l.005-.001.144-.02h.011l.144-.021.005-.001h.006l.143-.023.006-.001h.005l.143-.025h.005l.006-.002.143-.026h.005l.005-.002.143-.027.005-.001.005-.001.142-.03h.005l.005-.002.142-.03.005-.002.005-.001.142-.033.005-.001.005-.001.14-.035.006-.001.005-.001.14-.037h.005l.005-.002.14-.038.005-.002h.005l.14-.04.005-.002.005-.001.138-.042.005-.001.006-.002.138-.043.005-.001.005-.002.137-.044.005-.002.005-.002.137-.046.005-.002.005-.001.137-.048.005-.002.005-.002.135-.05.005-.001.005-.002.135-.051.005-.002.005-.002.135-.053.005-.002.004-.002.134-.054.005-.002.005-.002.133-.057.005-.002.005-.002.132-.057.005-.003.005-.002.132-.06.005-.001.004-.002.131-.061.005-.003.005-.002.13-.062.005-.003.005-.002.13-.064.004-.003.005-.002.128-.066.005-.002.005-.003.128-.067.005-.002.004-.003.127-.069.005-.002.005-.003.126-.07.005-.003.004-.003.065-.037.132-.093.112-.115.089-.135.062-.149.034-.157.003-.161-.026-.16-.055-.15-.082-.14-.107-.12-.127-.1-.144-.073-.154-.046-.16-.016zM6.33 26.818l-.16.023-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.02.16.012.161.041.156.07.146.094.13.096.093.032.026.004.003.004.004.145.117.004.003.004.004.146.115.005.003.004.004.147.113.005.003.004.004.149.111.004.003.004.003.15.11.005.003.004.003.151.108.004.003.005.003.152.106.005.003.004.003.154.104.004.003.005.003.154.102.005.002.004.003.156.1.005.003.004.003.157.098.005.003.004.002.159.096.004.003.005.003.16.094.004.003.004.002.16.092.005.003.005.002.161.09.005.003.005.002.162.088.005.003.004.002.164.086.005.003.004.002.165.084.005.003.004.002.166.082.004.002.005.003.167.08.004.002.005.002.168.078.004.002.005.002.168.076.005.002.005.002.17.074.004.002.005.002.17.072.005.002.005.002.17.07.006.002.005.001.171.068.005.002.005.002.173.065.005.002.005.002.173.063.005.002.005.002.174.06.005.003.005.001.175.06.005.001.005.002.176.057.005.001.005.002.176.055.006.001.005.002.177.052.005.002.005.001.178.05.005.002.005.002.178.048.006.001.005.002.179.046.005.001.005.002.18.044h.005l.005.002.18.042.006.001.005.001.159.035.16.02.16-.01.157-.04.146-.069.13-.094.112-.117.087-.136.06-.149.033-.158.002-.161-.028-.159-.057-.15-.084-.138-.108-.12-.128-.098-.144-.072-.128-.039-.154-.033-.168-.04-.171-.041-.17-.044-.168-.046-.167-.047-.168-.05-.165-.051-.166-.054-.166-.056-.163-.057-.165-.06-.161-.062-.164-.064-.16-.065-.16-.068-.162-.07-.157-.07-.157-.074-.157-.075-.156-.077-.153-.079-.156-.082-.153-.082-.154-.086-.15-.086-.152-.09-.148-.09-.147-.092-.149-.095-.145-.095-.144-.098-.145-.1-.143-.102-.14-.103-.14-.104-.14-.108-.139-.11-.136-.11-.027-.022-.133-.091-.148-.065-.157-.036-.161-.006zm19.215.087l-.16.01-.157.039-.146.067-.11.076-.064.051-.139.11-.14.108-.14.104-.14.103-.143.101-.145.101-.144.098-.145.095-.149.095-.148.093-.147.089-.152.09-.15.086-.154.086-.153.082-.156.082-.153.079-.156.077-.157.075-.158.073-.157.071-.16.07-.16.068-.161.065-.164.064-.161.061-.165.06-.163.058-.166.056-.166.054-.166.051-.167.05-.167.047-.17.046-.168.044-.171.042-.168.039-.17.037-.11.023-.154.047-.143.075-.126.1-.106.122-.081.139-.054.152-.025.16.006.16.035.158.063.148.09.133.114.115.132.092.148.065.157.037.16.007.133-.016.115-.024.005-.001.005-.001.181-.04h.005l.005-.002.18-.042.006-.001.005-.001.18-.044.005-.002.005-.001.18-.046.004-.002h.005l.179-.05h.005l.005-.002.178-.05.005-.002.005-.002.177-.052.005-.002.005-.001.177-.055.005-.002.005-.001.176-.057.005-.002.005-.002.175-.059.005-.001.005-.002.174-.061.005-.002.005-.002.173-.063.005-.002.005-.002.173-.065.004-.002.005-.002.172-.068.005-.002.005-.002.171-.07.005-.001.005-.002.17-.072.005-.002.004-.002.17-.074.005-.002.004-.002.169-.076.004-.002.005-.002.168-.078.004-.002.005-.003.167-.08.004-.002.005-.002.166-.082.004-.002.005-.003.165-.084.004-.002.005-.003.163-.086.005-.002.005-.003.162-.088.005-.002.005-.003.161-.09.005-.002.004-.003.16-.092.005-.003.005-.002.16-.094.004-.003.004-.003.158-.096.005-.002.004-.003.158-.098.004-.003.005-.003.156-.1.004-.003.004-.003.155-.101.005-.003.004-.003.154-.104.004-.003.004-.003.153-.106.004-.003.005-.003.151-.108.004-.003.005-.003.15-.11.004-.003.004-.003.149-.112.004-.003.004-.003.148-.113.004-.004.004-.003.147-.115.004-.004.004-.003.068-.055.116-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.05-.153-.08-.14-.103-.125-.124-.102-.142-.077-.153-.05-.16-.02z",opacity:".98"}));function YX(){return YX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},YX.apply(null,arguments)}var KX=({styles:e={},...t})=>wE("svg",YX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16.012 8.816L9.21 21.026h13.606l-6.803-12.21zm0 1.776l5.332 9.57H10.681l5.331-9.57zm0-10.281c-1.448.02-2.93.157-4.302.628-.852.447-.255 1.863.66 1.574 2.255-.608 4.648-.607 6.922-.108.934.075 1.228-1.376.338-1.67C18.451.44 17.227.317 16.012.311zm9.012 2.934c-.913-.104-1.272 1.258-.454 1.648 1.834 1.36 3.293 3.185 4.31 5.22.526.776 1.842.098 1.515-.78a15.522 15.522 0 00-5.06-6.006c-.1-.044-.203-.07-.31-.082zM6.65 3.59c-.762.089-1.24.809-1.805 1.267C3.38 6.295 2.163 8.007 1.37 9.905c-.266.898 1.094 1.484 1.564.675a14.825 14.825 0 014.327-5.56c.476-.515.09-1.419-.612-1.431zm9.362.007c-.698.066-1.689-.16-2.033.635-.282.733.535 1.358 1.217 1.125 1.806-.147 3.63.203 5.293.907.902.255 1.472-1.112.656-1.573-1.6-.735-3.374-1.089-5.133-1.094zm-5.479 1.365c-.835.15-1.517.76-2.21 1.226-1.203.94-2.318 2.061-3.057 3.402-.33.904 1.063 1.552 1.547.723 1.045-1.656 2.596-2.925 4.285-3.873.545-.499.171-1.463-.565-1.478zm13.903 2.115c-.875-.07-1.22 1.173-.501 1.627 1.325 1.34 2.188 3.062 2.748 4.84.468.84 1.869.21 1.557-.699-.604-2.118-1.751-4.097-3.351-5.615a.93.93 0 00-.453-.153zM4.467 13.132c-.822-.07-.996.826-1.046 1.455-.256 1.93-.094 3.933.562 5.769.406.844 1.807.365 1.612-.551a11.498 11.498 0 01-.334-5.808.874.874 0 00-.794-.865zm26.687 1.6c-.746-.037-1.014.785-.879 1.395.043 2.393-.57 4.771-1.66 6.894-.31.884 1.02 1.536 1.53.75a15.632 15.632 0 001.821-8.372.876.876 0 00-.812-.667zm-30.197.571c-.782-.073-1.044.775-.933 1.404.068 2.414.661 4.833 1.809 6.962.534.77 1.842.076 1.505-.798a14.833 14.833 0 01-1.603-6.861.876.876 0 00-.778-.707zm26.787 2.024c-.777-.048-.952.797-1.021 1.392-.354 1.692-1.202 3.231-2.216 4.608-.407.872.925 1.638 1.48.852 1.361-1.733 2.296-3.827 2.582-6.017a.874.874 0 00-.825-.835zM6.857 23.012c-.808.018-1.082 1.122-.47 1.59 1.393 1.607 3.187 2.886 5.194 3.599.91.222 1.43-1.165.598-1.596a11.495 11.495 0 01-4.723-3.396.899.899 0 00-.599-.197zm15.057 2.7c-.81.194-1.504.76-2.325.972-1.203.458-2.5.536-3.758.664-.869.307-.573 1.728.346 1.663 2.201-.034 4.412-.626 6.293-1.778.604-.495.227-1.532-.556-1.521zM6.346 27.118c-.833.008-1.11 1.218-.395 1.617 1.986 1.602 4.358 2.749 6.868 3.226.933.076 1.227-1.376.338-1.67a14.838 14.838 0 01-6.345-3.066.929.929 0 00-.466-.107zm19.208.087c-.766.09-1.241.841-1.922 1.158-1.516.991-3.251 1.58-4.996 2.005-.872.405-.346 1.849.584 1.604 2.543-.526 4.98-1.66 6.963-3.344.47-.52.072-1.42-.63-1.423z"}));function ZX(){return ZX=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ZX.apply(null,arguments)}var JX=({styles:e={},...t})=>wE("svg",ZX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.998 8.406c-3.018-.041-5.92 1.926-7.031 4.727-1.138 2.695-.51 6.012 1.537 8.103 1.99 2.141 5.268 2.93 8.014 1.927 2.878-.98 4.992-3.827 5.068-6.87.153-2.957-1.624-5.88-4.3-7.137a7.552 7.552 0 00-3.288-.75zm0 1.384c2.759-.052 5.373 1.973 6.015 4.655.704 2.578-.482 5.517-2.791 6.867-2.358 1.48-5.682 1.086-7.618-.918-2.043-1.971-2.407-5.381-.84-7.745 1.11-1.763 3.15-2.88 5.234-2.86zm1.962 1.765l-2.074 3.762c-.64.068-.793 1.04-.202 1.3.39.27.696-.18 1.052-.165h3.17v-.865h-3.182l1.993-3.615c-.252-.14-.505-.278-.757-.417zm-1.965-8.268h-.158l-.147.003h-.011l-.147.005h-.011l-.146.007h-.011l-.146.009h-.011l-.146.01h-.005l-.005.001-.146.012h-.011l-.145.014h-.006l-.005.001-.05.006-.158.031-.15.06-.135.088-.117.111-.094.13-.069.147-.04.156-.01.16.019.16.049.154.076.142.102.125.123.105.14.08.152.051.16.023.134-.003.045-.005.135-.013.133-.01.136-.01.135-.007.137-.006.136-.004.136-.003h.274l.136.003.136.004.136.006.136.007.136.01.133.01.135.013.135.014.135.016.134.018.132.018.134.021.133.023.133.024.133.025.13.027.132.03.132.03.129.031.13.034.129.035.129.036.13.04.126.038.128.042.126.042.128.045.127.047.126.048.12.047.127.051.123.052.006.002.147.048.16.021.16-.009.157-.038.147-.067.131-.093.112-.116.089-.135.062-.149.033-.158.004-.16-.027-.16-.055-.151-.083-.138-.107-.121-.127-.099-.118-.063-.004-.001-.005-.003-.005-.002-.133-.056-.005-.002-.005-.002-.134-.054-.004-.002-.005-.002-.135-.053-.005-.002-.005-.002-.135-.051-.005-.002-.005-.002-.135-.05-.005-.001-.005-.002-.137-.048-.005-.001-.005-.002-.137-.046-.005-.002-.005-.002-.137-.044-.005-.002-.005-.001-.138-.043-.005-.002-.006-.001-.138-.042-.005-.001-.005-.002-.14-.04H19.4l-.005-.002-.14-.038-.005-.001-.005-.002-.14-.036-.005-.001-.005-.001-.141-.035-.005-.001-.005-.001-.142-.033-.005-.001-.005-.001-.141-.031-.006-.002h-.005l-.142-.03-.005-.001-.005-.001-.143-.028h-.005l-.005-.001-.143-.026-.006-.001-.005-.001-.143-.024-.005-.001-.006-.001-.143-.022-.006-.001h-.005l-.144-.022h-.005l-.006-.001-.144-.019h-.005l-.006-.001-.144-.017h-.006l-.005-.001-.145-.016h-.011l-.145-.014H17.1l-.005-.001-.146-.012h-.01l-.146-.01-.006-.001h-.005l-.146-.009h-.011l-.147-.006h-.01l-.147-.005h-.011l-.147-.003h-.01l-.148-.001h-.01zM10.357 4.66l-.156.037-.123.053-.06.032-.005.002-.004.003-.128.069-.004.002-.005.003-.126.07-.005.003-.004.002-.126.072-.005.003-.004.003-.125.073-.004.003-.005.003-.124.075-.004.003-.005.002-.123.077-.004.003-.005.003-.122.078-.004.003-.005.003-.121.08-.004.002-.005.003-.12.082-.005.003-.004.003-.12.083-.004.003-.004.003-.118.084-.005.003-.004.003-.118.086-.004.003-.004.003-.117.088-.004.003-.004.003-.116.089-.004.003-.004.004-.114.09-.005.003-.004.003-.113.092-.004.004-.004.003-.113.093-.004.004-.004.003-.111.095-.004.003-.005.004-.11.096-.004.004-.004.003-.109.098-.004.003-.004.004-.108.1-.004.003-.004.003-.107.101-.004.004-.004.003-.106.102-.003.004-.004.004-.105.103-.004.004-.004.004-.103.105-.004.004-.004.003-.102.106-.003.004-.004.004-.1.107-.004.004-.004.004-.099.108-.004.004-.003.004-.098.11-.003.003-.004.004-.096.11-.004.005-.003.004-.095.111-.003.004-.004.004-.093.113-.003.004-.004.004-.092.113-.003.004-.003.005-.09.114-.004.004-.003.004-.089.116-.003.004-.003.004-.088.117-.003.004-.003.005-.086.117-.003.004-.003.005-.084.118-.003.004-.003.005-.083.12-.003.003-.003.005-.082.12-.003.005-.002.004-.068.103-.076.142-.048.154-.018.16.011.161.041.156.07.146.095.13.117.11.136.086.15.06.158.03.162.002.158-.029.15-.058.138-.085.119-.108.082-.106.065-.099.075-.11.077-.113.077-.107.08-.11.08-.108.084-.108.083-.105.086-.106.086-.104.088-.104.089-.101.09-.102.093-.101.093-.099.094-.097.095-.096.098-.097.098-.095.099-.093.1-.092.103-.091.101-.089.104-.088.104-.086.106-.086.106-.083.106-.082.109-.082.108-.079.11-.078.11-.076.112-.076.112-.074.113-.072.113-.071.115-.07.115-.068.118-.067.117-.065.12-.065.054-.029.135-.088.116-.111.094-.132.068-.146.04-.156.009-.161-.02-.16-.05-.153-.078-.142-.102-.125-.123-.103-.141-.079-.153-.051-.16-.022-.16.008zm13.91 2.116l-.158.037-.147.066-.132.092-.113.116-.09.134-.063.148-.034.157-.005.162.026.159.054.152.082.139.086.102.09.09.094.098.093.099.092.1.091.103.089.101.088.104.086.104.086.106.083.105.083.108.08.108.081.11.077.107.077.112.075.111.075.114.072.113.071.113.07.115.068.117.067.115.065.118.064.117.062.118.061.12.059.119.059.122.056.121.054.12.055.125.051.123.051.125.048.123.049.127.046.126.044.125.043.128.042.129.039.126.038.13.022.076.058.15.086.137.109.119.129.096.145.07.155.043.16.013.161-.017.155-.046.143-.074.126-.1.106-.122.082-.138.055-.152.025-.16-.005-.16-.026-.132-.023-.082-.002-.005-.001-.005-.042-.139-.001-.005-.002-.005-.043-.138-.001-.005-.002-.005-.044-.137-.002-.005-.002-.005-.046-.137-.002-.005-.001-.005-.048-.137-.002-.005-.002-.005-.05-.135-.001-.005-.002-.005-.051-.135-.002-.005-.002-.005-.053-.135-.002-.005-.002-.005-.054-.133-.002-.005-.002-.005-.057-.133-.002-.005-.002-.005-.057-.132-.003-.005-.002-.005-.059-.132-.002-.005-.002-.004-.061-.132-.003-.004-.002-.005-.062-.13-.003-.005-.002-.005-.064-.13-.003-.004-.002-.005-.066-.129-.002-.004-.003-.005-.067-.128-.002-.005-.003-.004-.069-.128-.002-.004-.003-.005-.07-.126-.003-.005-.003-.004-.072-.126-.002-.005-.003-.004-.073-.125-.003-.004-.003-.005-.075-.124-.003-.004-.003-.005-.076-.123-.003-.004-.003-.005-.078-.122-.003-.004-.003-.005-.08-.121-.003-.004-.003-.005-.08-.12-.004-.005-.003-.004-.083-.12-.003-.004-.003-.004-.084-.118-.003-.005-.003-.004-.086-.117-.003-.005-.003-.004-.088-.117-.003-.004-.003-.004-.09-.116-.002-.004-.004-.004-.09-.114-.003-.005-.004-.004-.091-.113-.004-.004-.003-.004-.093-.113-.004-.004-.003-.004-.095-.111-.004-.004-.003-.004-.096-.11-.004-.005-.003-.004-.098-.109-.004-.004-.003-.004-.1-.108-.003-.004-.004-.004-.1-.107-.004-.004-.004-.004-.102-.106-.003-.003-.004-.004-.093-.095-.124-.103-.14-.08-.153-.05-.16-.023-.16.008zM4.288 12.828l-.158.032-.15.06-.135.088-.117.11-.095.131-.069.146-.035.129-.026.132v.005l-.002.005-.025.143-.001.005-.001.006-.024.143-.001.005-.001.006-.022.143-.001.006-.001.005-.02.144-.001.005-.001.006-.019.144v.005l-.001.006-.017.144v.006l-.001.005-.016.145v.011l-.014.145v.006l-.001.005-.012.146v.01l-.01.146-.001.006v.005l-.009.146v.011l-.007.146v.011l-.004.147v.011l-.003.147v.01l-.002.148v.01l.001.148v.01l.003.147v.011l.005.147v.01l.007.147v.011l.009.146v.011l.01.146v.01l.013.146v.011l.014.145v.005l.001.006.016.145v.011l.018.144v.006l.001.005.019.144v.006l.001.005.021.144v.005l.002.006.022.143v.006l.002.005.024.143v.005l.002.006.025.143.001.005.001.005.028.143.001.005.001.005.03.142v.005l.002.006.03.141.002.005.001.006.033.14v.006l.002.005.035.14v.006l.002.005.036.14.002.005.001.005.038.14.001.005.002.005.04.14v.005l.002.005.042.138.001.006.002.005.042.138.002.005.002.005.017.054.064.148.09.134.114.114.132.092.148.065.157.037.16.007.16-.023.153-.052.14-.08.123-.103.102-.126.076-.142.049-.153.02-.16-.01-.161-.032-.13-.017-.051-.039-.126-.038-.13-.037-.128-.035-.13-.033-.128-.033-.134-.03-.13-.029-.131-.026-.13-.026-.132-.024-.134-.023-.133-.02-.132-.02-.136-.017-.132-.016-.135-.014-.135-.012-.133-.012-.138-.009-.133-.007-.136-.006-.138-.004-.134-.003-.136v-.274l.003-.136.004-.134.006-.139.007-.136.01-.132.01-.139.013-.132.014-.135.016-.135.017-.132.02-.137.02-.13.023-.134.024-.133.024-.126.016-.16-.014-.161-.044-.155-.072-.145-.098-.128-.12-.108-.137-.084-.15-.057-.16-.029-.16.002zm23.286 4.202l-.156.038-.148.066-.132.092-.113.115-.09.134-.062.148-.03.127-.001.004-.023.134-.024.134-.026.132-.026.13-.03.132-.03.129-.032.134-.033.128-.035.13-.037.128-.038.13-.04.126-.04.128-.044.128-.044.126-.046.126-.048.126-.05.125-.05.125-.051.122-.054.123-.055.122-.056.12-.058.122-.06.12-.061.12-.062.119-.063.116-.067.119-.066.116-.068.115-.07.115-.07.113-.073.113-.074.112-.076.113-.077.112-.077.107-.08.11-.08.108-.085.109-.044.056-.088.135-.06.15-.033.158-.002.16.027.16.057.15.083.138.108.12.128.098.144.072.155.045.16.015.161-.016.155-.044.144-.073.128-.098.09-.099.05-.061.003-.004.003-.005.089-.115.003-.004.003-.005.088-.116.003-.004.003-.005.086-.117.003-.004.003-.005.084-.118.003-.004.003-.005.083-.12.003-.004.003-.004.082-.12.003-.005.002-.004.08-.121.003-.005.003-.004.078-.122.003-.005.003-.004.077-.123.002-.005.003-.004.075-.124.003-.005.003-.004.073-.125.003-.004.003-.005.072-.126.002-.004.003-.005.07-.126.003-.005.002-.005.07-.127.002-.004.002-.005.068-.128.002-.005.002-.004.066-.13.003-.004.002-.005.064-.13.002-.004.003-.005.062-.13.003-.005.002-.005.06-.13.003-.005.002-.005.06-.132.002-.005.002-.005.057-.132.003-.005.002-.005.056-.133.002-.005.002-.005.054-.134.002-.004.002-.005.053-.135.002-.005.002-.005.051-.135.002-.005.002-.005.05-.135.001-.005.002-.005.048-.137.001-.005.002-.005.046-.137.002-.005.002-.005.044-.137.002-.005.002-.005.042-.138.002-.005.002-.006.04-.138.002-.005.002-.005.04-.14V19.4l.002-.005.038-.14.001-.005.002-.005.036-.14.001-.005.001-.005.035-.141.001-.005.001-.005.033-.141.001-.006.001-.005.031-.141.002-.006v-.005l.03-.142.001-.005.001-.005.028-.143v-.005l.002-.005.025-.143.001-.006.001-.005.024-.143.001-.005.001-.006.001-.006.01-.161-.02-.16-.05-.154-.077-.141-.102-.125-.123-.104-.141-.079-.153-.051-.16-.022-.16.007zM6.681 22.734l-.152.053-.14.08-.122.105-.101.126-.076.142-.048.154-.018.16.011.161.041.156.07.146.077.11.04.047.003.004.003.004.095.111.003.004.004.004.096.11.004.005.003.004.098.109.003.004.004.004.1.108.003.004.003.004.101.107.004.004.003.004.102.106.004.003.004.004.103.105.004.004.004.004.105.103.004.004.003.003.106.102.004.004.004.004.107.1.004.004.004.004.108.099.004.003.004.004.11.098.003.003.004.004.11.096.005.004.004.003.11.095.005.003.004.004.113.093.004.003.004.004.113.091.004.004.005.003.114.09.004.004.004.003.116.089.004.003.004.003.117.088.004.003.004.003.118.086.004.003.005.003.118.084.004.003.005.003.119.083.004.003.005.003.12.081.005.003.004.003.121.08.005.003.004.003.122.078.005.003.004.003.123.076.005.003.004.003.124.075.005.003.004.003.125.073.004.003.005.003.126.072.004.002.005.003.126.07.005.003.004.002.128.07.004.002.005.002.128.068.005.002.004.002.13.066.004.003.005.002.13.064.004.002.005.003.13.062.005.002.004.003.132.06.004.003.005.002.132.06.005.002.005.002.132.057.005.002.005.003.133.056.005.002.005.002.133.054.005.002.005.002.13.05.154.045.16.016.161-.015.155-.045.144-.072.128-.098.108-.12.083-.138.057-.15.028-.16-.003-.16-.032-.158-.061-.15-.088-.135-.11-.117-.132-.094-.12-.058-.124-.049-.126-.051-.122-.051-.122-.054-.12-.054-.126-.058-.119-.057-.12-.06-.12-.06-.118-.063-.117-.064-.119-.066-.116-.066-.115-.068-.115-.07-.113-.07-.115-.074-.112-.074-.11-.075-.11-.076-.112-.079-.11-.08-.109-.082-.106-.082-.104-.082-.106-.086-.105-.087-.101-.086-.105-.091-.1-.09-.1-.091-.1-.094-.097-.094-.1-.098-.093-.095-.096-.1-.093-.098-.092-.101-.089-.1-.09-.102-.088-.104-.036-.043-.114-.114-.133-.091-.148-.065-.157-.036-.161-.006-.16.024zm15.063 2.691l-.156.044-.12.057-.06.034-.12.066-.116.064-.119.062-.12.061-.12.06-.118.057-.126.058-.12.054-.122.054-.122.05-.126.052-.125.05-.124.046-.127.047-.125.044-.129.043-.126.04-.13.042-.128.038-.127.036-.13.035-.131.034-.129.031-.132.03-.13.03-.135.027-.133.026-.13.023-.13.022-.137.021-.132.02-.134.017-.132.015-.138.015-.135.013-.133.01-.138.01-.136.007-.134.006-.136.004-.14.003-.16.018-.155.047-.142.076-.127.1-.105.122-.08.14-.054.151-.025.16.006.16.035.158.064.148.09.134.114.114.133.092.147.065.157.036.134.008.145-.002h.011l.147-.005h.01l.147-.007h.011l.146-.009h.011l.146-.01h.005l.005-.001.146-.012h.011l.145-.014h.005l.006-.001.145-.016h.011l.144-.018h.006l.005-.001.144-.02h.011l.144-.021h.005l.006-.002.143-.022h.006l.005-.002.143-.024h.005l.006-.002.143-.026h.005l.005-.002.143-.027.005-.001.005-.001.142-.03h.005l.005-.002.142-.03.005-.002.005-.001.142-.033.005-.001.005-.001.14-.035.006-.001.005-.001.14-.036.005-.002.005-.001.14-.038.005-.001.005-.002.14-.04h.005l.005-.002.138-.042.005-.001.006-.002.138-.043.005-.001.005-.002.137-.044.005-.002.005-.002.137-.046.005-.002.005-.001.137-.048.005-.002.005-.002.135-.05.005-.001.005-.002.135-.051.005-.002.005-.002.135-.053.005-.002.004-.002.134-.054.005-.002.005-.002.133-.056.005-.003.005-.002.132-.057.005-.002.005-.003.132-.059.005-.002.004-.002.131-.061.005-.003.005-.002.13-.062.005-.003.005-.002.13-.064.004-.002.005-.003.129-.066.004-.002.005-.003.128-.067.005-.002.004-.003.127-.069.005-.002.005-.003.126-.07.005-.003.004-.002.065-.038.132-.093.112-.115.089-.135.062-.149.034-.157.004-.161-.027-.16-.055-.15-.082-.14-.107-.12-.127-.1-.144-.073-.154-.045-.16-.017-.161.014zM15.994 0l-.187.001h-.011l-.188.004h-.011l-.187.006h-.011l-.187.008h-.005L15.2.02l-.187.01h-.005l-.005.001-.187.013h-.01L14.62.06h-.01l-.186.018h-.011l-.185.02-.005.001h-.006l-.185.022-.005.001h-.005l-.185.025h-.005l-.005.001-.184.027h-.006l-.005.001-.184.029h-.005l-.005.001-.183.031-.005.001-.006.001-.182.033-.006.001-.005.001-.182.035-.005.001-.005.001-.182.038h-.005l-.005.002-.181.04h-.005l-.005.002-.18.042-.006.001-.005.001-.18.044-.005.002h-.005l-.17.045-.152.054-.139.082-.121.106-.1.127-.074.143-.046.155-.017.16.013.16.043.156.07.145.097.13.119.108.137.085.15.058.159.03.16-.001.133-.023.165-.043.168-.041.171-.04.171-.037.172-.036.17-.033.173-.03.17-.03.177-.027.171-.025.175-.022.175-.02.175-.02.176-.016.175-.014.177-.012.176-.01.177-.007.174-.006.177-.003L16 1.73h.177l.178.004.174.006.177.007.176.01.177.012.175.014.176.017.175.018.175.02.175.023.171.025.177.027.17.03.173.03.17.033.171.036.154.033.16.02.161-.01.156-.04.146-.069.131-.094.111-.117.088-.135.06-.15.032-.158.002-.16-.027-.16-.057-.15L20 .714l-.108-.12-.128-.097-.144-.073-.129-.038-.158-.035-.005-.001-.005-.001L19.14.31h-.005l-.005-.002-.182-.035h-.006l-.005-.002-.182-.033h-.006l-.005-.002-.183-.03-.005-.001-.005-.001-.184-.029h-.005l-.006-.001-.184-.027h-.005l-.005-.001-.185-.024h-.005L17.968.12 17.783.1l-.006-.001h-.005l-.185-.02h-.006l-.005-.001L17.39.06 17.385.06h-.005l-.187-.015h-.005l-.005-.001-.187-.013h-.01L16.799.02h-.011L16.6.01h-.011l-.187-.006h-.011L16.204 0h-.011L16.005 0h-.01zm8.86 2.939l-.157.033-.15.062-.134.09-.116.111-.093.132-.067.147-.038.156-.01.161.022.16.05.153.078.141.103.124.102.087.045.034.142.106.137.105.14.11.136.11.135.112.134.115.134.117.13.115.132.122.128.12.127.122.127.125.123.126.124.128.121.13.118.128.118.132.117.133.113.134.113.136.11.136.109.137.109.142.104.14.103.14.101.142.1.144.099.146.095.145.094.147.093.15.092.15.087.149.087.15.085.152.083.155.08.152.08.155.04.081.084.138.11.119.128.096.145.072.155.043.16.013.161-.016.155-.046.143-.074.127-.099.106-.12.083-.14.055-.151.026-.16-.004-.16-.034-.158-.05-.124-.042-.085-.002-.004-.003-.005-.084-.165-.002-.004-.003-.005-.086-.164-.002-.004-.003-.005-.088-.162-.002-.005-.003-.005-.09-.161-.002-.005-.003-.004-.092-.16-.002-.005-.003-.005-.094-.16-.003-.004-.003-.004-.096-.159-.002-.004-.003-.005-.098-.157-.003-.004-.003-.005-.1-.156-.003-.004-.002-.005-.102-.154-.003-.005-.003-.004-.104-.154-.003-.004-.003-.005-.106-.152-.003-.004-.003-.005-.108-.151-.003-.004-.003-.005-.11-.15-.003-.004-.003-.004-.111-.15-.004-.003-.003-.005-.113-.147-.004-.004-.003-.005-.115-.146-.004-.004-.003-.004-.117-.145-.004-.004-.003-.004-.12-.144-.003-.004-.003-.004-.121-.142-.003-.004-.004-.004-.123-.141-.003-.004-.004-.004-.125-.14-.003-.004-.004-.004-.127-.138-.003-.004-.004-.004-.128-.136-.004-.004-.004-.004-.13-.135-.004-.004-.003-.004-.133-.134-.003-.004-.004-.003-.134-.133-.004-.003-.004-.004-.135-.13-.004-.004-.004-.004-.136-.128-.004-.004-.004-.004-.138-.126-.004-.004-.004-.003-.14-.125-.004-.004-.004-.003-.14-.123-.005-.004-.004-.003-.142-.121-.004-.004-.004-.003-.144-.12-.004-.003-.004-.003-.145-.117-.004-.004-.004-.003-.147-.115-.004-.004-.004-.003-.148-.113-.004-.003-.004-.004-.149-.111-.004-.003-.004-.004-.05-.036-.14-.083-.15-.055-.16-.027-.16.004zm-18.381.348l-.157.037-.147.066-.111.074-.04.032-.005.003-.004.004-.145.117-.004.003-.004.004-.144.119-.004.003-.004.004-.142.12-.004.004-.004.004-.141.123-.004.003-.004.004-.14.125-.004.003-.004.004-.138.126-.004.004-.004.004-.136.128-.004.004-.004.004-.135.13-.004.004-.004.003-.134.133-.004.003-.004.004-.132.134-.003.004-.004.004-.13.135-.004.004-.004.004-.128.136-.004.004-.004.004-.126.138-.004.004-.003.004-.125.14-.004.004-.003.004-.123.14-.004.005-.003.004-.121.142-.004.004-.003.004-.12.144-.003.004-.003.004-.117.145-.004.004-.003.004-.115.146-.004.005-.003.004-.113.147-.003.005-.004.004-.111.149-.003.004-.004.004-.11.15-.002.005-.003.004-.108.151-.003.005-.003.004-.106.152-.003.005-.003.004-.104.154-.003.004-.003.005-.102.154-.003.005-.002.004-.1.156-.003.005-.003.004-.098.157-.003.005-.003.004-.096.159-.002.004-.003.005-.094.16-.003.004-.002.004-.092.16-.003.005-.003.005-.09.161-.002.005-.003.005-.088.162-.002.005-.003.004-.086.164-.002.005-.002.004-.084.165-.003.005-.002.004-.082.166-.002.005-.003.004-.08.167-.002.004-.002.005-.078.168-.002.004-.002.005-.045.1-.053.153-.023.16.007.16.037.157.065.148.092.132.114.114.134.09.148.064.157.035.161.006.16-.025.152-.054.14-.08.121-.106.1-.126.065-.118.043-.095.074-.16.075-.155.077-.157.08-.155.08-.152.083-.155.085-.152.086-.15.088-.149.091-.15.094-.15.094-.147.095-.145.099-.146.1-.144.1-.142.104-.14.104-.14.11-.142.107-.137.11-.136.114-.136.113-.134.117-.133.118-.132.117-.129.122-.13.124-.127.123-.126.127-.125.127-.122.128-.12.132-.122.13-.115.133-.117.135-.115.135-.111.136-.11.037-.03.117-.11.094-.132.068-.146.04-.156.01-.161-.02-.16-.05-.154-.076-.141-.102-.125-.123-.104-.14-.08-.153-.051-.16-.023-.161.008zm24.514 11.15l-.157.04-.146.067-.131.093-.112.117-.088.135-.061.149-.033.157-.005.134.006.14.006.176.003.177.001.178-.001.177-.003.178-.006.177-.007.176-.01.177-.012.176-.015.176-.016.173-.018.175-.02.175-.024.174-.024.175-.027.17-.03.174-.03.173-.033.17-.036.172-.037.17-.04.17-.042.172-.043.168-.045.166-.048.169-.05.167-.052.168-.053.164-.056.166-.058.166-.06.161-.061.164-.063.158-.066.165-.068.16-.07.16-.07.158-.075.159-.074.155-.078.158-.081.158-.06.15-.03.158-.001.161.029.159.058.15.085.137.108.12.13.096.144.07.156.044.16.013.16-.017.155-.046.143-.074.127-.1.107-.12.07-.115.083-.164.003-.005.002-.004.082-.166.002-.005.003-.004.08-.167.002-.005.002-.004.078-.168.002-.004.002-.005.076-.169.002-.004.002-.005.074-.17.002-.004.002-.005.072-.17.002-.005.002-.005.07-.17.002-.006.001-.005.068-.172.002-.004.002-.005.065-.173.002-.005.002-.005.063-.173.002-.005.002-.005.06-.174.003-.005.001-.005.06-.175.001-.005.002-.005.057-.176.001-.005.002-.005.055-.177.001-.005.002-.005.052-.177.002-.005.001-.005.051-.178.001-.005.002-.005.048-.179.002-.005v-.005l.047-.179.001-.005.002-.005.044-.18v-.005l.002-.005.042-.18.001-.006.001-.005.04-.18.001-.006.001-.005.038-.182v-.005l.002-.005.035-.182v-.006l.002-.005.033-.182v-.006l.002-.005.03-.183.001-.005.001-.005.029-.184v-.005l.001-.006.027-.184v-.005l.001-.005.024-.185v-.005l.001-.005.022-.185v-.006l.001-.005.02-.185v-.006l.001-.005.017-.186v-.005l.001-.005.015-.187v-.005l.001-.005.013-.187v-.01l.01-.187.001-.006v-.005l.009-.187v-.011l.006-.187v-.011l.004-.188v-.011l.001-.188v-.01l-.001-.188v-.011l-.004-.188v-.011l-.006-.187v-.011l-.007-.145-.022-.16-.05-.152-.08-.141-.103-.124-.125-.102-.141-.077-.153-.05-.16-.02-.161.009zM.777 15l-.158.032-.15.06-.136.087-.117.11-.095.131-.068.146-.04.156-.012.133-.001.14v.01l.001.188v.011l.004.188v.011l.006.187v.011l.008.187v.011l.011.187v.005l.001.005.013.187v.01l.016.187v.01l.018.186v.011l.02.185.001.005v.006l.022.185.001.005v.005l.025.185v.005l.001.005.027.184v.006l.001.005.029.184v.005l.001.005.031.183.001.005.001.006.033.182.001.005.001.006.035.182.001.005.001.005.038.182v.005l.002.005.04.181v.005l.002.005.042.18.001.006.001.005.044.18.002.005v.005l.047.18.001.004.002.005.048.179.002.005.001.005.05.178.002.005.001.005.053.177.002.005.001.005.055.177.002.005.001.005.057.176.002.005.001.005.06.175.001.005.002.005.061.174.002.005.002.005.063.173.002.005.002.005.065.173.002.005.002.004.067.172.002.005.002.005.07.171.002.005.002.005.072.17.002.005.002.005.074.169.002.005.002.004.076.169.002.005.002.004.078.168.002.004.002.005.08.167.003.004.002.005.082.166.002.004.003.005.02.04.086.136.11.118.13.095.146.07.156.041.16.012.16-.019.155-.048.142-.075.126-.1.105-.123.08-.14.054-.152.024-.16-.006-.16-.036-.158-.051-.123-.018-.034-.078-.158L3.1 22.1l-.074-.16-.071-.156-.07-.162-.068-.16-.067-.164-.062-.158-.062-.164-.059-.161-.058-.166-.056-.166-.053-.164-.052-.168-.05-.167-.048-.17-.045-.165-.043-.168-.043-.172-.039-.17-.037-.17-.036-.172-.033-.17-.03-.173-.03-.174-.027-.17-.025-.175-.022-.174-.021-.175-.018-.175-.017-.173-.014-.176-.012-.176-.01-.177-.007-.176-.006-.177-.003-.178L1.73 16v-.134l-.013-.16-.044-.156-.072-.144-.097-.129-.12-.108-.137-.085-.15-.057L.938 15 .777 15zM6.17 26.842l-.152.052-.14.08-.122.105-.101.126-.076.142-.048.154-.02.16.012.161.041.156.07.146.094.13.096.093.032.026.004.003.004.004.145.117.004.003.004.004.146.115.005.003.004.004.147.113.005.003.004.004.149.111.004.003.004.003.15.11.005.003.004.003.151.108.005.003.004.003.152.106.005.003.004.003.154.104.004.003.005.003.154.102.005.002.004.003.156.1.005.003.004.003.157.098.005.003.004.002.159.096.004.003.005.003.16.094.004.003.004.002.16.092.005.003.005.002.161.09.005.003.005.003.162.088.005.002.004.002.164.087.005.002.004.002.165.084.005.003.004.002.166.082.004.002.005.003.167.08.004.002.005.002.168.078.004.002.005.002.169.076.004.002.005.002.17.074.004.002.005.002.17.072.005.002.005.002.17.07.006.002.005.001.171.068.005.002.005.002.173.065.005.002.005.002.173.063.005.002.005.002.174.061.005.002.005.001.175.06.005.001.005.002.176.057.005.001.005.002.177.055.005.001.005.002.177.052.005.002.005.001.178.051.005.001.005.002.178.048.006.002h.005l.179.047.005.001.005.002.18.044h.005l.005.002.18.042.006.001.005.001.159.035.16.02.16-.01.157-.04.146-.069.13-.094.112-.117.087-.136.06-.149.033-.158.002-.161-.028-.159-.057-.15-.084-.138-.108-.12-.128-.098-.144-.072-.128-.039-.154-.033-.168-.04-.171-.041-.169-.044-.17-.045-.166-.048-.168-.05-.165-.051-.166-.054-.166-.056-.163-.057-.165-.06-.161-.062-.164-.064-.16-.065-.16-.068-.162-.07-.157-.07-.157-.074-.157-.075-.156-.077-.153-.079-.156-.082-.153-.082-.154-.086-.15-.086-.152-.09-.148-.09-.147-.092-.149-.095-.145-.095-.144-.098-.145-.1-.143-.102-.14-.103-.14-.104-.14-.108-.139-.11-.136-.11-.027-.022-.133-.091-.148-.065-.157-.036-.161-.006-.16.024zm19.214.073l-.156.039-.146.067-.11.076-.064.051-.139.11-.14.108-.14.104-.14.103-.143.101-.145.101-.144.098-.145.095-.149.095-.148.093-.147.089-.152.09-.15.086-.154.086-.153.082-.156.082-.153.079-.156.077-.157.075-.157.073-.158.071-.16.07-.16.068-.161.065-.164.064-.161.061-.165.06-.163.058-.166.056-.166.054-.166.051-.167.05-.167.048-.17.045-.168.044-.171.042-.168.039-.17.037-.11.023-.154.047-.143.075-.126.1-.106.122-.081.139-.054.152-.025.16.006.16.035.158.063.148.09.133.114.115.132.092.148.065.157.037.16.008.133-.017.115-.024h.005l.005-.002.181-.04h.005l.005-.002.18-.042.006-.001.005-.001.18-.044.005-.002h.005l.18-.047.004-.001.005-.002.179-.048.005-.002.005-.001.178-.05.005-.002.005-.002.177-.052.005-.002.005-.001.177-.055.005-.002.005-.001.176-.057.005-.002.005-.002.175-.059.005-.001.005-.002.174-.061.005-.002.005-.002.173-.063.005-.002.005-.002.173-.065.005-.002.004-.002.172-.068.005-.001.005-.002.171-.07.005-.002.005-.002.17-.072.005-.002.005-.002.169-.074.005-.002.004-.002.169-.076.004-.002.005-.002.168-.078.004-.002.005-.002.167-.08.004-.003.005-.002.166-.082.004-.002.005-.003.165-.084.004-.002.005-.002.163-.087.005-.002.005-.002.162-.088.005-.003.005-.003.161-.09.005-.002.004-.003.16-.092.005-.002.005-.003.16-.094.004-.003.004-.003.158-.096.005-.002.004-.003.158-.098.004-.003.005-.003.156-.1.004-.003.004-.002.155-.102.005-.003.004-.003.154-.104.004-.003.005-.003.152-.106.004-.003.005-.003.151-.108.004-.003.005-.003.15-.11.004-.003.004-.003.149-.111.004-.004.004-.003.148-.113.004-.004.004-.003.147-.115.004-.004.004-.003.068-.055.116-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.05-.153-.08-.14-.103-.125-.124-.102-.142-.077-.153-.05-.16-.02-.16.009z"}));function eG(){return eG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},eG.apply(null,arguments)}var tG=({styles:e={},...t})=>wE("svg",eG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.003C8.195-.157.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.408 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.215-2.282-2.022-5.3-3.217-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.082 11.082 0 0116 4.975zm-2.15 3.281v5.534H8.213v4.38h5.636v5.534h4.31V18.17h5.639v-4.38h-5.64V8.256h-4.31zm.865.865h2.583v5.534h5.635v2.65h-5.635v5.533h-2.583v-5.534h-5.64v-2.649h5.64V9.121z"}));function nG(){return nG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},nG.apply(null,arguments)}var iG=({styles:e={},...t})=>wE("svg",nG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm.006 3.521L9.206 20.745h13.598L16.005 8.542zm0 1.775l5.329 9.564H10.677l5.328-9.564z"}));function rG(){return rG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},rG.apply(null,arguments)}var oG=({styles:e={},...t})=>wE("svg",rG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.97.04h-.127C8.713-.018 2.003 5.334.437 12.286c-1.51 6.123.98 13.005 6.136 16.665 5.125 3.788 12.546 4.105 17.912.623 5.272-3.276 8.33-9.766 7.325-15.916-.904-6.241-5.79-11.7-11.95-13.143A16.082 16.082 0 0015.97.04zm-.181 1.724c.115 0 .23 0 .347.003 6.625-.066 12.823 5.149 13.89 11.69 1.13 5.91-1.908 12.349-7.262 15.138-5.473 3.013-12.866 1.884-17.116-2.726C1.291 21.372.444 13.914 3.802 8.602c2.493-4.112 7.169-6.819 11.987-6.838zm.283 1.554c-.117 0-.234.002-.351.005-6.1 0-11.691 5.049-12.346 11.114-.78 5.684 2.795 11.612 8.218 13.52 5.139 1.943 11.416.101 14.624-4.38 3.461-4.583 3.262-11.538-.596-15.831-2.36-2.747-5.924-4.423-9.549-4.428zm-.078 1.695c.078 0 .156 0 .234.003 5.4 0 10.321 4.556 10.734 9.942.563 5.13-2.958 10.364-7.971 11.678-4.832 1.41-10.457-.935-12.746-5.446-2.463-4.559-1.2-10.795 3.014-13.883a11.072 11.072 0 016.735-2.294zm-.137 3.42c-2.965.02-5.792 1.968-6.884 4.722-1.137 2.693-.509 6.007 1.536 8.096 1.988 2.14 5.263 2.929 8.007 1.926 2.875-.98 4.987-3.824 5.063-6.865.154-2.954-1.622-5.875-4.295-7.13a7.545 7.545 0 00-3.427-.75zm.27 1.381c2.708.013 5.249 2.014 5.88 4.652.704 2.576-.481 5.512-2.788 6.862-2.356 1.478-5.677 1.084-7.611-.918-2.042-1.97-2.405-5.376-.839-7.738 1.11-1.762 3.146-2.877 5.229-2.857h.13zm1.831 1.764l-2.072 3.76c-.64.068-.792 1.039-.202 1.298.39.27.696-.18 1.051-.164h3.168v-.864h-3.18l1.992-3.612-.757-.418z"}));function sG(){return sG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},sG.apply(null,arguments)}var aG=({styles:e={},...t})=>wE("svg",sG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.848.001C8.113-.093.931 6.281.125 13.983c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.207C29.105 4.938 23.55.48 17.367.06A16.448 16.448 0 0015.848 0v.001zm.293 1.727c7.113-.099 13.662 5.97 14.077 13.08.56 6.299-3.516 12.735-9.582 14.679-5.798 2.004-12.806-.12-16.283-5.237C.717 19.159.874 11.638 5.016 6.876 7.722 3.638 11.902 1.63 16.14 1.728zm-.415 1.555C9.157 3.258 3.256 9.156 3.278 15.729c-.16 5.965 4.365 11.725 10.293 12.737 5.409 1.065 11.37-1.744 13.775-6.753 2.534-4.986 1.386-11.627-2.953-15.251-2.364-2.077-5.512-3.27-8.667-3.18zm.507 1.692c5.82-.026 11.013 5.318 10.79 11.143-.024 5.3-4.313 10.267-9.636 10.803-5.075.667-10.426-2.588-11.885-7.553-1.535-4.744.494-10.46 4.925-12.885a11.072 11.072 0 015.806-1.508z"}));function lG(){return lG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},lG.apply(null,arguments)}function cG(){return cG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},cG.apply(null,arguments)}function uG(){return uG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},uG.apply(null,arguments)}function pG(){return pG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},pG.apply(null,arguments)}function hG(){return hG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},hG.apply(null,arguments)}function dG(){return dG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},dG.apply(null,arguments)}function fG(){return fG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},fG.apply(null,arguments)}function mG(){return mG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},mG.apply(null,arguments)}function gG(){return gG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},gG.apply(null,arguments)}function vG(){return vG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},vG.apply(null,arguments)}function yG(){return yG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},yG.apply(null,arguments)}function bG(){return bG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},bG.apply(null,arguments)}function wG(){return wG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},wG.apply(null,arguments)}function xG(){return xG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},xG.apply(null,arguments)}function _G(){return _G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_G.apply(null,arguments)}function EG(){return EG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},EG.apply(null,arguments)}function SG(){return SG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},SG.apply(null,arguments)}function kG(){return kG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},kG.apply(null,arguments)}function OG(){return OG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},OG.apply(null,arguments)}function CG(){return CG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},CG.apply(null,arguments)}function PG(){return PG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},PG.apply(null,arguments)}function AG(){return AG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},AG.apply(null,arguments)}function TG(){return TG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},TG.apply(null,arguments)}function RG(){return RG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},RG.apply(null,arguments)}function MG(){return MG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},MG.apply(null,arguments)}function $G(){return $G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},$G.apply(null,arguments)}function DG(){return DG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},DG.apply(null,arguments)}function BG(){return BG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},BG.apply(null,arguments)}function LG(){return LG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},LG.apply(null,arguments)}function IG(){return IG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},IG.apply(null,arguments)}function NG(){return NG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},NG.apply(null,arguments)}function zG(){return zG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},zG.apply(null,arguments)}function jG(){return jG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},jG.apply(null,arguments)}var VG=({styles:e={},...t})=>wE("svg",jG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M5.637 3A5.644 5.644 0 000 8.637v15.417a5.644 5.644 0 005.637 5.637h20.726A5.644 5.644 0 0032 24.054V8.637A5.644 5.644 0 0026.363 3H5.637zm0 1.778h20.726a3.83 3.83 0 013.859 3.859v15.417a3.83 3.83 0 01-3.859 3.858h-4.201V16.695H9.838v11.217H5.637a3.83 3.83 0 01-3.859-3.858V8.637a3.83 3.83 0 013.859-3.859zm5.33 13.046h10.066v10.065H10.967V17.824zm4.189 1.431V22.06H12.35v1.689h2.804V26.554h1.69V23.749h2.804V22.06h-2.804V19.255h-1.69z"}));function FG(){return FG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},FG.apply(null,arguments)}var qG=({styles:e={},...t})=>wE("svg",FG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M5.636 3A5.642 5.642 0 000 8.636v15.418a5.643 5.643 0 005.636 5.636h20.728A5.643 5.643 0 0032 24.054V8.636A5.642 5.642 0 0026.364 3H5.636zm0 1.778h20.728a3.83 3.83 0 013.858 3.858v15.418a3.83 3.83 0 01-3.858 3.858h-4.203V16.723H9.84v11.189H5.636a3.83 3.83 0 01-3.858-3.858V8.636a3.83 3.83 0 013.858-3.858zm5.331 13.074h10.066v10.06H10.967v-10.06zm1.336 3.996v1.711h7.394v-1.71h-7.394z"}));function HG(){return HG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},HG.apply(null,arguments)}function WG(){return WG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},WG.apply(null,arguments)}function QG(){return QG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},QG.apply(null,arguments)}function XG(){return XG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},XG.apply(null,arguments)}var GG={Association:({styles:e={},...t})=>wE("svg",XQ({width:"32",height:"32",xmlns:"http://www.w3.org/2000/svg"},t),wE("path",{stroke:"#000",strokeWidth:"2",fill:"none",strokeDasharray:"3.3,6",strokeLinecap:"square",d:"M1.5 30.5l29-29"})),BusinessRuleTask:({styles:e={},...t})=>wE("svg",GQ({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zM5.296 7.398v12.665h16.87V7.398H5.296zm.718 4.386h15.433v3.44H9.985v-3.432h-.719v3.431H6.014v-3.44zm0 4.158h3.252v3.403H6.014v-3.403zm3.97 0h11.463v3.403H9.985v-3.403z"}),wE("path",{d:"M6.079 8.209v3.587H21.44V8.209z"})),CallActivity:({styles:e={},...t})=>wE("svg",UQ({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M24.978 3c3.761 0 6.89 2.979 7.018 6.695l.004.238V22.4c0 3.747-3.05 6.804-6.783 6.93l-.24.003H7.023c-3.761 0-6.89-2.978-7.018-6.695L0 22.4V9.933C0 6.187 3.05 3.13 6.783 3.004L7.023 3h17.955zm0 3.667H7.022c-1.842 0-3.255 1.344-3.35 3.079l-.005.187V22.4c0 1.761 1.35 3.167 3.16 3.262l.195.005L10 25.666V15h12v10.666h2.978c1.842 0 3.255-1.344 3.35-3.079l.005-.187V9.933c0-1.761-1.35-3.166-3.16-3.261l-.195-.005zm-3.732 9.087H10.754v9.912h10.491v-9.912zm-4.475 1.817v2.658h2.658v1.542H16.77v2.658H15.23V21.77H12.57V20.23h2.658V17.57h1.542z"})),Collaboration:({styles:e={},...t})=>wE("svg",YQ({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("g",{fillRule:"evenodd"},wE("path",{fillRule:"nonzero",d:"M0 0v8.62h32V0H0zm1.655 7.054v-5.37h28.62v5.37H1.656zM0 23.38V32h32v-8.62H0zm1.655 7.054v-5.37h28.62v5.37H1.656z"}),wE("path",{d:"M24 8l4 7h-8l4-7zm0 2l-2.28 4h4.56L24 10zM23.5 21h1v3h-1zM23.5 15h1v3h-1zM8 24l-4-7h8l-4 7zm0-2l2.28-4H5.72L8 22zM7.5 8h1v3h-1zM7.5 14h1v3h-1z"}))),ConditionalFlow:({styles:e={},...t})=>wE("svg",KQ({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M32 .041S20.42 5.95 14.537 8.713c1.26 1.15 2.432 2.392 3.648 3.588-5.703 5.78-3.15 3.303-8.087 8.316l-8.472 1.377L0 32l10.006-1.626.098-.598 1.279-7.873c4.975-5.052 2.403-2.555 8.118-8.346 1.218 1.214 2.43 2.435 3.648 3.648C26.29 11.018 32 .041 32 .041zM9.603 22.397L8.54 28.91 2.03 29.97l1.061-6.515 6.512-1.058z"})),SequenceFlow:({styles:e={},...t})=>wE("svg",ZQ({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M32 .06S20.33 6.014 14.403 8.798c1.27 1.16 2.451 2.41 3.676 3.616L0 30.734 1.325 32l18.08-18.32c1.227 1.223 2.448 2.453 3.676 3.676C26.247 11.12 32 .06 32 .06z"})),DataInput:({styles:e={},...t})=>wE("svg",tX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M20.833 0H3.488v32H28V7.36L20.833 0zm-2.105 1.818v7.507h7.454v20.857H5.306V1.818h13.422zm1.818.493l5.06 5.196h-5.06V2.311zm-9.182.86v3.744H7.081v3.222h4.283v3.743l5.7-5.354-5.7-5.354zm.808 1.868l3.711 3.487-3.71 3.487V9.329H7.888V7.723h4.283V5.039z"})),DataInputAssociation:eX,DataOutput:({styles:e={},...t})=>wE("svg",iX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M20.833 0H3.488v32H28V7.36L20.833 0zm-2.105 1.818v7.507h7.454v20.857H5.306V1.818h13.422zm1.818.493l5.06 5.196h-5.06V2.311zm-9.182.86v3.744H7.081v3.222h4.283v3.743l5.7-5.354-5.7-5.354z"})),DataOutputAssociation:eX,DataObjectReference:({styles:e={},...t})=>wE("svg",nX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M21.345 0H4v32h24.512V7.36L21.345 0zM19.24 1.818v7.507h7.454v20.857H5.818V1.818H19.24zm1.818.493l5.06 5.196h-5.06V2.311z"})),DataStoreReference:({styles:e={},...t})=>wE("svg",rX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16.008 1c-3.712 0-7.417.306-10.319.939-1.45.316-2.7.71-3.68 1.226C1.065 3.662.297 4.304.061 5.23a.823.823 0 00-.035.15L0 5.502l.017.084c-.012 7.41 0 14.46 0 22.08l.017.082c.203.985.995 1.656 1.975 2.172.98.517 2.23.91 3.68 1.226 2.902.633 6.607.94 10.319.94 3.711 0 7.416-.307 10.318-.94 1.451-.316 2.701-.71 3.68-1.226.98-.516 1.772-1.187 1.975-2.172l.017-.082V5.541a.825.825 0 000-.106v-.016l-.002-.013a.823.823 0 00-.046-.197c-.244-.916-1.007-1.55-1.943-2.044-.98-.516-2.23-.91-3.68-1.226C23.423 1.306 19.718 1 16.006 1zm0 1.646c3.62 0 7.245.308 9.968.901 1.36.297 2.497.67 3.263 1.074.612.323.932.643 1.063.882-.131.24-.451.56-1.063.882-.766.404-1.902.777-3.263 1.074-2.723.594-6.349.901-9.968.901-3.62 0-7.245-.307-9.968-.901-1.361-.297-2.497-.67-3.264-1.074-.611-.322-.931-.642-1.062-.882.13-.24.451-.56 1.062-.882.767-.403 1.903-.777 3.264-1.074 2.723-.593 6.348-.9 9.968-.9zM1.664 7.647c.112.067.227.132.345.194.98.517 2.23.91 3.68 1.226 2.902.633 6.607.94 10.319.94 3.711 0 7.416-.307 10.318-.94 1.451-.316 2.701-.71 3.68-1.226.119-.062.234-.127.346-.194v1.93c-.08.245-.398.619-1.113.995-.766.404-1.902.777-3.263 1.074-2.723.594-6.349.901-9.968.901-3.62 0-7.245-.307-9.968-.9-1.361-.298-2.497-.671-3.264-1.075-.714-.376-1.032-.75-1.112-.995v-1.93zm0 4.187c.112.067.227.132.345.195.98.516 2.23.91 3.68 1.226 2.902.632 6.607.938 10.319.938 3.711 0 7.416-.306 10.318-.938 1.451-.317 2.701-.71 3.68-1.226.119-.063.234-.128.346-.195v1.93c-.08.245-.398.619-1.113.995-.766.404-1.902.777-3.263 1.074-2.723.594-6.349.901-9.968.901-3.62 0-7.245-.307-9.968-.9-1.361-.298-2.497-.67-3.264-1.075-.714-.376-1.032-.75-1.112-.995v-1.93zm0 4.188c.112.067.227.131.345.194.98.516 2.23.91 3.68 1.226 2.902.633 6.607.939 10.319.939 3.711 0 7.416-.306 10.318-.94 1.451-.316 2.701-.709 3.68-1.225.119-.063.234-.127.346-.194V27.47c-.08.245-.398.618-1.113.995-.766.404-1.902.777-3.263 1.074-2.723.594-6.349.9-9.968.9-3.62 0-7.245-.306-9.968-.9-1.361-.297-2.497-.67-3.264-1.074-.714-.377-1.032-.75-1.112-.995V16.022z"})),DefaultFlow:({styles:e={},...t})=>wE("svg",oX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M32 .06S20.33 6.014 14.403 8.798c1.27 1.16 2.451 2.41 3.676 3.616L6.84 23.804H.046v1.755h5.063L0 30.735 1.325 32l6.357-6.441h7.145v-1.756H9.414l9.99-10.123c1.228 1.223 2.45 2.453 3.677 3.676C26.247 11.12 32 .06 32 .06z"})),CancelEndEvent:({styles:e={},...t})=>wE("svg",sX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm-3.955 3.918L8.94 12.072l3.985 3.985-3.913 3.913 3.048 3.047 3.913-3.913 3.987 3.987 3.096-3.096-3.987-3.987 3.913-3.913-3.047-3.048-3.913 3.913-3.985-3.985z"})),CompensateEndEvent:({styles:e={},...t})=>wE("svg",aX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm-.56 5.744l-7.407 5.23 7.408 5.234v-5.057c2.384 1.687 4.771 3.371 7.157 5.057V10.801l-7.157 5.054v-5.054z"})),ErrorEndEvent:({styles:e={},...t})=>wE("svg",lX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm6.132 4.166l-3.633 7.363-4.516-5.874-4.102 12.131 4.599-5.91 4.743 5.427 2.909-13.137z"})),EscalationEndEvent:({styles:e={},...t})=>wE("svg",cX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm.006 3.9c-1.672 4.653-2.733 9.5-4.406 14.153 1.535-1.525 2.872-3.234 4.406-4.759l4.406 4.76c-1.497-4.71-2.91-9.445-4.406-14.155z"})),LinkEndEvent:({styles:e={},...t})=>wE("svg",uX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.676 0C7.943.007.834 6.45.104 14.16c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 4.958 23.394.313 16.978.032A18.532 18.532 0 0015.676 0zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm1.78 4.065v3.555H9.779v6.713h7.994v3.554l5.828-6.91-5.828-6.912z"})),MessageEndEvent:({styles:e={},...t})=>wE("svg",pX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.676 0C7.943.007.834 6.45.104 14.16c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 4.958 23.394.313 16.978.032A18.532 18.532 0 0015.676 0zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm-5.91 5.448l6.041 4.9 6.04-4.9H10.084zm-1.34 1.137v9.92h14.513v-9.718l-7.132 5.786-7.381-5.988z"})),MultipleEndEvent:({styles:e={},...t})=>wE("svg",hX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.676 0C7.943.007.834 6.45.104 14.16c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 4.958 23.394.313 16.978.032A18.529 18.529 0 0015.676 0zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm.011 3.039l-7.619 5.53 2.91 8.95h9.418l2.91-8.95-7.619-5.53z"})),EndEvent:({styles:e={},...t})=>wE("svg",dX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.84.042C8.654-.01 1.913 5.437.4 12.454-1.057 18.62 1.554 25.495 6.784 29.09c5.076 3.636 12.31 3.92 17.59.544 5.309-3.251 8.435-9.744 7.445-15.921C30.91 7.307 25.795 1.738 19.442.422a16.064 16.064 0 00-3.602-.38zm.382 5.01c5.28-.017 10.13 4.353 10.669 9.61.687 5.025-2.552 10.281-7.423 11.792-4.754 1.617-10.486-.447-12.962-4.856-2.74-4.575-1.574-11.094 2.768-14.27a11.05 11.05 0 016.948-2.276z"})),SignalEndEvent:({styles:e={},...t})=>wE("svg",fX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm.006 3.492c-2.261 4.07-4.532 8.136-6.797 12.204h13.595L15.999 8.55z"})),TerminateEndEvent:({styles:e={},...t})=>wE("svg",mX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.676.051C7.943.058.834 6.501.104 14.21c-.783 6.565 2.912 13.427 8.942 16.216 5.6 2.737 12.789 1.87 17.434-2.344 4.725-4.09 6.79-11.06 4.714-17.006C29.22 5.009 23.394.364 16.978.083A18.532 18.532 0 0015.676.05zm.317 5.006c5.695-.165 10.916 4.858 10.983 10.555.246 5.212-3.67 10.33-8.864 11.204-5.026 1.007-10.6-1.898-12.36-6.777-1.894-4.826.039-10.928 4.649-13.46a11.082 11.082 0 015.592-1.522zm.006 2.859c-5.264-.2-9.495 5.551-7.755 10.516 1.366 5.085 8.108 7.436 12.339 4.301 4.455-2.807 4.708-9.943.462-13.058A8.128 8.128 0 0016 7.915z"})),EventSubProcess:({styles:e={},...t})=>wE("svg",gX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M7.295 4.78h1.779V3.003h-1.78V4.78zm3.558 0h1.779V3.003h-1.78V4.78zm3.557 0h1.78V3.003h-1.78V4.78zm3.558 0h1.78V3.003h-1.78V4.78zm3.558 0h1.779V3.003h-1.779V4.78zm3.558 0c.55.014 1.106-.034 1.654.045l.245-1.762c-.629-.096-1.266-.05-1.9-.061V4.78zM5.732 3.004a5.933 5.933 0 00-.915.093c.111.582.226 1.164.315 1.75.358-.101.947.098.746-.483-.096-.382.164-1.208-.146-1.36zm22.372 2.281c.427.234.812.547 1.13.915.42-.4 1.002-.777 1.33-1.18a5.863 5.863 0 00-1.593-1.289l-.867 1.554zm-25.27-1.44c-.587.354-1.11.811-1.539 1.345.47.333.96.86 1.417 1.077.299-.362.66-.673 1.065-.913-.328-.493-.55-1.055-.944-1.509zM30.515 7.26c-.563.046-.557.342-.378.784.154.25-.097.862.25.85.525-.023 1.14.043 1.612-.032a5.891 5.891 0 00-.362-2.027l-1.122.425zM.268 7.114A6.042 6.042 0 000 9.052h1.78c-.013-.5.047-1.003.208-1.478L.296 7.027l-.026.079-.002.008zM30.22 12.45H32v-1.779h-1.779v1.779zm-30.22.16h1.78v-1.779H0v1.78zm30.22 3.398H32v-1.78h-1.779v1.78zm-30.22.16h1.78v-1.779H0v1.779zm30.22 3.398H32v-1.78h-1.779v1.78zm-30.22.16h1.78v-1.78H0v1.78zm30.22 3.397H32v-1.779h-1.779v1.78zm-30.22.16h1.78v-1.778H0v1.778zm30.137 1.47a4.059 4.059 0 01-.522 1.32c.506.283 1.046.715 1.53.908a5.836 5.836 0 00.744-1.918c-.576-.094-1.209-.264-1.752-.31zm-29.984.51c.157.676.435 1.325.82 1.904l1.486-.977a4.065 4.065 0 01-.577-1.347l-1.73.42zm28.427 1.943c-.371.277-.79.49-1.234.627l.548 1.693a5.84 5.84 0 001.835-.96l-1.082-1.412-.066.05-.001.002zm-26.164 1.47c.567.413 1.21.722 1.886.907.14-.569.343-1.175.444-1.722a4.062 4.062 0 01-1.283-.624l-1.047 1.438zm3.88 1.119h1.779v-1.78h-1.78v1.78zm3.55 0h1.787v-1.78H9.846v1.78zm3.565 0h1.78v-1.78h-1.78v1.78zm3.558 0h1.78v-1.78h-1.78v1.78zm3.451 0h1.743v-1.78h-1.743v1.78zm3.665 0h1.779v-1.78h-1.78v1.78zm-1.922-.545V16.776H9.846V29.25h12.318zM10.967 17.905h10.068V27.97H10.967V17.905zm1.336 3.998v1.711h7.396v-1.711h-7.396z",opacity:".97"})),ComplexGateway:({styles:e={},...t})=>wE("svg",vX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16.001 0a1.29 1.29 0 00-.917.373L.373 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.917.372A1.294 1.294 0 0016.002 0zM16 2.181l13.821 13.821L16 29.823 2.179 16.003 16 2.18zm-.327 6.79v.007l-.145.027-.118.08-.083.123-.028.145v4.954L11.793 10.8l-.125-.08-.14-.029-.144.027-.122.082-.46.46-.085.125-.026.142.028.14.08.125 3.505 3.505H9.347l-.001-.002-.145.032-.118.08-.083.122-.028.146v.652l.029.147.082.119.12.08.144.032h4.956L10.8 20.207v-.001l-.084.124-.026.142.028.14.08.124.46.461.126.082.14.029.143-.027.124-.084L15.3 17.69v4.964-.001l.028.147.082.12.12.08.144.031h.652l.148-.03.118-.08.083-.12.028-.146v-4.962l3.505 3.505.126.082.14.027.142-.027.124-.084.461-.46.083-.123s.028-.144.027-.146l-.028-.14-.082-.126-3.496-3.496h4.948l.148-.03.119-.08.082-.12.028-.147v-.652l-.028-.145-.083-.122-.119-.08s-.147-.033-.147-.031h-4.964l3.512-3.512.082-.122.029-.144-.028-.14-.084-.124-.46-.461-.123-.082-.14-.027-.145.027-.122.082-3.507 3.507V9.348l-.028-.146-.082-.122-.12-.08-.147-.029h-.652z"})),EventBasedGateway:({styles:e={},...t})=>wE("svg",yX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16 0a1.29 1.29 0 00-.918.373L.371 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.915.372A1.294 1.294 0 0016 0zm-.002 2.181l13.821 13.821-13.821 13.821-13.821-13.82L15.998 2.18zm0 5.876l-.254.185-7.377 5.355 2.915 8.964h9.433l2.915-8.964-7.631-5.54zm0 1.07l6.614 4.8-2.526 7.769h-8.175l-2.526-7.768 6.614-4.802z"})),ExclusiveGateway:({styles:e={},...t})=>wE("svg",_X({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16 0a1.29 1.29 0 00-.918.373L.371 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.915.372A1.294 1.294 0 0016 0zm-.002 2.181l13.821 13.821-13.821 13.821-13.821-13.82L15.998 2.18zm-5.162 7.69l-.166.032-.141.096-.532.532s-.097.142-.097.144l-.03.164.032.162.093.144 4.857 4.858-4.855 4.855v-.001L9.9 21l-.03.164.032.162s.093.142.093.144l.531.532.146.095.162.032.164-.03.144-.097 4.855-4.856 4.857 4.857.145.095.162.032.164-.03.144-.097.531-.532.095-.14.033-.168-.033-.162-.095-.146L17.144 16 22 11.144l.095-.14.033-.166-.033-.163-.097-.144-.532-.532-.14-.095-.163-.032-.166.032-.141.095L16 14.855l-4.858-4.858v-.002l-.144-.092-.162-.032z"})),Gateway:({styles:e={},...t})=>wE("svg",bX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M.373 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.917.373a1.313 1.313 0 00-1.833 0L.373 15.084zm1.806.918L16 2.182l13.821 13.82L16 29.823 2.179 16.003z"})),InclusiveGateway:({styles:e={},...t})=>wE("svg",wX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16.001 0a1.29 1.29 0 00-.917.373L.373 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.917.372A1.294 1.294 0 0016.002 0zM16 2.181l13.821 13.821L16 29.823 2.179 16.003 16 2.18zm0 6.379a7.447 7.447 0 00-7.44 7.441A7.447 7.447 0 0016 23.443 7.447 7.447 0 0023.443 16a7.447 7.447 0 00-7.441-7.441zm0 .825a6.61 6.61 0 016.617 6.616A6.61 6.61 0 0116 22.618 6.61 6.61 0 019.385 16 6.61 6.61 0 0116 9.385z"})),ParallelGateway:({styles:e={},...t})=>wE("svg",xX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16.001 0a1.29 1.29 0 00-.917.373L.373 15.084a1.316 1.316 0 00.002 1.834l14.71 14.709a1.313 1.313 0 001.833 0l14.711-14.711a1.316 1.316 0 00-.002-1.834L16.917.372A1.294 1.294 0 0016.002 0zM16 2.181l13.821 13.821L16 29.823 2.179 16.003 16 2.18zm-.377 5.708l-.168.032-.136.092-.096.14-.032.168v6.868h-6.87l-.002-.002-.166.037-.137.092v-.002l-.095.141-.033.167v.753s.032.169.034.17l.094.138.138.092.167.036h6.87v6.867l-.001-.001.033.17.095.138.138.092s.166.035.167.037h.752l.17-.036.137-.092.095-.137.033-.17v-6.867h6.868l.17-.035.137-.092.095-.137.033-.17v-.753s-.033-.165-.032-.167l-.096-.14-.138-.093s-.17-.037-.17-.035H16.81V8.323l-.033-.168-.094-.14-.138-.092-.17-.034h-.752z"})),Group:({styles:e={},...t})=>wE("svg",EX({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M6.34.016c-2.333.025-4.684 1.77-5.29 4.17C.608 5.848.88 7.608.804 9.314v2.922h2.041c.038-2.332-.076-4.673.062-7C3.14 3.355 4.869 1.938 6.643 2.04h8.956V.009c-3.086 0-6.173-.02-9.258 0v.007zm13.094 2.023h1.92V.009h-1.92v2.03zm5.756 0c1.265-.069 2.66.045 3.602 1.055 1.036.983 1.201 2.523 1.122 3.91v6.313h2.078c-.03-2.677.062-5.36-.047-8.032-.17-2.743-2.62-5.111-5.215-5.236-.511-.064-1.027-.02-1.54-.033v2.023zM.803 18.319h2.041v-2.026H.804v2.026zm29.11 1.084h2.08v-2.03h-2.08v2.03zM.804 26.148c.004 2.218 1.393 4.366 3.313 5.28 1.728.853 3.681.448 5.521.544.43-.112 1.29.231 1.435-.183v-1.847c-1.788-.043-3.584.094-5.365-.082-1.67-.354-2.919-2.048-2.863-3.844v-3.644H.804v3.777zm29.11-.068c.04 1.961-1.508 3.787-3.381 3.842-1.954.06-3.914.02-5.87.026v2.03c2.118-.042 4.242.08 6.355-.063 2.524-.264 4.818-2.644 4.94-5.323.08-1.039.014-2.085.035-3.126h-2.078v2.613zm-15.006 5.898h1.92v-2.03h-1.92v2.03z"})),CancelIntermediateCatchEvent:kX,CompensateIntermediateCatchEvent:CX,ConditionalIntermediateCatchEvent:AX,ErrorIntermediateCatchEvent:RX,EscalationIntermediateCatchEvent:$X,LinkIntermediateCatchEvent:BX,MessageIntermediateCatchEvent:IX,MultipleIntermediateCatchEvent:zX,ConditionalIntermediateCatchEventNonInterrupting:VX,EscalationIntermediateCatchEventNonInterrupting:qX,MessageIntermediateCatchEventNonInterrupting:WX,MultipleIntermediateCatchEventNonInterrupting:XX,ParallelIntermediateCatchEventNonInterrupting:UX,SignalIntermediateCatchEventNonInterrupting:KX,TimerIntermediateCatchEventNonInterrupting:JX,ParallelMultipleIntermediateCatchEvent:tG,SignalIntermediateCatchEvent:iG,TimerIntermediateCatchEvent:oG,IntermediateThrowEvent:aG,CompensateIntermediateThrowEvent:({styles:e={},...t})=>wE("svg",lG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.003C8.195-.156.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.407 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 4.975zm-.56 5.772l-7.408 5.231 7.409 5.234v-5.057c2.385 1.687 4.771 3.371 7.157 5.057V10.747l-7.157 5.055v-5.055z"})),EscalationIntermediateThrowEvent:({styles:e={},...t})=>wE("svg",cG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm.006 3.927c-1.672 4.654-2.734 9.502-4.406 14.155 1.534-1.525 2.872-3.234 4.406-4.759l4.406 4.76c-1.496-4.71-2.91-9.446-4.406-14.156z"})),LinkIntermediateThrowEvent:({styles:e={},...t})=>wE("svg",uG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.049C8.195-.11.935 6.286.125 14.03c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.93 23.445.453 17.201.095c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.22.872 11.725 4.985 6.962c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 5.021c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 5.021zm1.78 4.093v3.555H9.785v6.714h7.994v3.554l5.829-6.911-5.83-6.912z"})),MessageIntermediateThrowEvent:({styles:e={},...t})=>wE("svg",pG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.003C8.195-.156.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.407 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 4.975zm-5.91 5.475l6.04 4.901 6.042-4.9H10.088zm-1.341 1.138v9.921h14.514V11.79l-7.132 5.787-7.382-5.99z"})),MultipleIntermediateThrowEvent:({styles:e={},...t})=>wE("svg",hG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.003C8.195-.156.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.407 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 4.975zm.006 3.073l-7.62 5.532 2.91 8.95h9.42l2.91-8.95-7.62-5.532z"})),SignalIntermediateThrowEvent:({styles:e={},...t})=>wE("svg",dG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.975.003C8.195-.156.935 6.24.125 13.985c-.855 6.55 2.741 13.46 8.74 16.314 5.666 2.847 13.012 1.99 17.71-2.33 4.745-4.162 6.727-11.243 4.532-17.206C29.09 4.884 23.445.407 17.201.049c-.408-.03-.817-.046-1.226-.046zm-.181 1.724c7.134-.269 13.84 5.68 14.399 12.804.686 6.283-3.267 12.792-9.283 14.862-5.847 2.162-13.025.06-16.557-5.141C.728 19.174.872 11.679 4.985 6.916c2.632-3.171 6.671-5.174 10.809-5.19zm.283 1.553c-6.6-.21-12.671 5.585-12.79 12.185-.292 5.964 4.129 11.817 10.034 12.953 5.47 1.198 11.584-1.613 14.025-6.702 2.525-4.97 1.396-11.585-2.912-15.216-2.282-2.021-5.3-3.216-8.357-3.22zM16 4.975c5.818-.154 11.117 5.082 11.024 10.905.103 5.384-4.23 10.5-9.636 11.043-5.075.667-10.426-2.587-11.885-7.552-1.53-4.73.48-10.428 4.888-12.864A11.083 11.083 0 0116 4.975zm.006 3.52c-2.261 4.07-4.533 8.136-6.798 12.205h13.596L16.005 8.495z"})),Lane:({styles:e={},...t})=>wE("svg",fG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M0 7v18.62h32V7H0zm1.655 17.056V8.684h28.62v15.372H1.656z"})),ManualTask:({styles:e={},...t})=>wE("svg",mG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zm4.43 1.328c-.222.005-.43.09-.606.203-.985.638-4.356 2.977-5.096 3.486-.67.46-1.12 1.153-1.38 1.974-.27.858-.235 1.793-.232 2.576.002.59.016 1.104.17 1.727.22.908.634 1.63 1.23 2.118.597.49 1.363.732 2.23.734 3.038.012 6.078.016 9.119 0 .327-.002.645-.127.848-.37.204-.241.287-.56.291-.914a1.732 1.732 0 00-.097-.625h.327c.335 0 .641-.11.852-.316.21-.206.317-.475.374-.754a1.783 1.783 0 00-.126-1.143 1.18 1.18 0 00.877-.521c.196-.306.257-.666.258-1.025.001-.375-.088-.738-.293-1.033a1.179 1.179 0 00-.958-.512h-.478c.108-.237.156-.505.155-.782-.003-.373-.098-.721-.316-.99a1.21 1.21 0 00-.943-.43c-2.273-.004-4.236.018-6.412.012l-.19-.001c.102-.104.202-.205.312-.314.337-.336.662-.652.83-.869.4-.516.46-1.215.123-1.729-.178-.272-.439-.456-.72-.494a.93.93 0 00-.148-.008zm.029.728l.022.001c.055.008.115.027.209.172.132.201.126.606-.09.884-.079.102-.431.465-.767.8-.337.334-.657.643-.815.836-.153.186-.096.338-.056.435.04.096.085.212.298.263.063.014.066.01.086.012l.066.003c2.429.027 4.986-.004 7.223-.003.194 0 .293.056.379.162.086.105.151.286.153.533 0 .257-.065.467-.155.59-.09.124-.183.182-.37.183-1.706-.001-3.411-.005-5.117-.009v.731c2.23.004 4.461.01 6.692.012.17 0 .265.06.361.2.096.138.164.364.163.615 0 .268-.058.501-.143.634-.085.132-.162.193-.385.195-2.32-.001-4.554-.006-6.688-.003v.73c1.905 0 3.809.003 5.713.001.194.005.316.09.416.26.102.173.151.442.093.728-.04.193-.102.313-.17.38-.067.065-.148.108-.343.108h-5.71l.002.734c1.445 0 2.89-.01 4.334-.001.162 0 .232.041.297.123.064.081.123.238.12.488-.003.244-.061.385-.12.455-.06.07-.127.11-.296.11-3.037.016-6.076.012-9.113 0-.735-.002-1.316-.196-1.77-.568-.454-.372-.793-.935-.986-1.728-.134-.546-.146-.978-.148-1.558-.003-.796-.018-1.664.199-2.354.222-.705.582-1.24 1.096-1.593.75-.515 4.14-2.866 5.079-3.474a.504.504 0 01.241-.087z"})),MessageFlow:({styles:e={},...t})=>wE("svg",gG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M4.073 26.607l1.295 1.296L1.325 32l-.662-.633L0 30.735l4.073-4.128zm6.953-7.046l1.296 1.296L1.325 32l7.555-7.656-1.295-1.296 1.455-1.474 1.986-2.013zM32 .06s-2.699 5.189-5.417 10.462l-.326.633c-1.14 2.214-2.265 4.407-3.176 6.2-1.228-1.222-2.449-2.452-3.676-3.675l-3.57 3.618-1.297-1.296 3.541-3.588c-.98-.964-1.932-1.958-2.923-2.91l-.753-.706c2.68-1.258 6.533-3.165 9.95-4.876l.617-.309C28.838 1.673 32 .06 32 .06zm-4.126 4.06l-.015.007-.115.057-.048.024-.115.057L17.7 9.172l5.017 4.948 5.157-10z"})),Participant:({styles:e={},...t})=>wE("svg",vG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M0 5v22.069h32V5H0zm30.276 1.684v18.82H6.62V6.684h23.655zm-28.62 0h3.31v18.82h-3.31V6.684z"})),Process:({styles:e={},...t})=>wE("svg",yG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{fillRule:"evenodd",d:"M16.177 0l.137.002c.452.009.9.037 1.342.082.346.036.62.303.68.646l.437 2.536c.055.319.296.57.608.655.986.269 1.923.653 2.796 1.14.28.155.624.145.885-.039l2.083-1.47a.775.775 0 01.937.022c.86.699 1.645 1.484 2.343 2.343.22.27.223.653.023.937l-1.439 2.038a.833.833 0 00-.031.896c.512.889.92 1.846 1.204 2.855a.833.833 0 00.653.601l2.435.42c.342.059.61.333.645.679a15.928 15.928 0 01.08 2.064l-.003.114c-.012.382-.038.76-.077 1.134a.775.775 0 01-.645.68l-2.396.412a.835.835 0 00-.656.61 12.511 12.511 0 01-1.2 2.917.832.832 0 00.034.892l1.396 1.978c.2.284.196.667-.023.936a16.104 16.104 0 01-2.343 2.343.775.775 0 01-.937.023l-1.99-1.404a.833.833 0 00-.88-.026c-.907.516-1.886.922-2.916 1.2a.833.833 0 00-.61.656l-.414 2.396a.775.775 0 01-.679.646 16.096 16.096 0 01-3.312 0 .775.775 0 01-.679-.646l-.423-2.452a.834.834 0 00-.598-.636 12.474 12.474 0 01-1.468-.514 12.49 12.49 0 01-1.417-.68.833.833 0 00-.878.03l-2.026 1.43a.775.775 0 01-.937-.023 16.069 16.069 0 01-2.342-2.342.774.774 0 01-.024-.936l1.402-1.986a.833.833 0 00.032-.896 12.507 12.507 0 01-1.214-2.911.833.833 0 00-.655-.606l-2.386-.412a.775.775 0 01-.646-.678 16.097 16.097 0 010-3.314.775.775 0 01.646-.678l2.386-.412a.833.833 0 00.655-.606 12.507 12.507 0 011.214-2.911.833.833 0 00-.032-.896L3.552 6.853a.774.774 0 01.023-.936 16.091 16.091 0 012.343-2.343.775.775 0 01.937-.023l2.03 1.433c.26.177.6.182.874.028.915-.512 1.88-.9 2.87-1.167a.833.833 0 00.612-.656l.424-2.46a.775.775 0 01.679-.645C14.845.032 15.348.004 15.85 0h.326zM16 6.4c-5.302 0-9.6 4.297-9.6 9.599 0 5.302 4.298 9.6 9.6 9.6s9.6-4.298 9.6-9.6-4.298-9.6-9.6-9.6zm-3 4.283c0-1.425 1.637-2.203 2.715-1.29l5.69 4.815c.794.672.794 1.91 0 2.583l-5.69 4.815c-1.078.913-2.715.134-2.715-1.29z"})),ReceiveTask:({styles:e={},...t})=>wE("svg",bG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zM5.23 7.764v11.577h17.55V7.764H5.23zm1.816.758h13.917l-6.959 4.577-6.958-4.577zm-1.06.21l8.018 5.274 8.018-5.275v9.853H5.987V8.73z"})),ScriptTask:({styles:e={},...t})=>wE("svg",wG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zm2.99 3.077l-.077.045-.026.015c-1.09.646-1.84 1.239-2.336 1.818-.496.579-.735 1.162-.742 1.725-.014 1.119.812 1.958 1.544 2.708.732.75 1.385 1.456 1.446 2.041.032.298-.039.598-.364 1.008-.324.408-.911.897-1.85 1.445l-1.388.808h8.56l.101-.059c.996-.58 1.667-1.116 2.094-1.655.429-.54.603-1.107.547-1.638-.11-1.052-.967-1.818-1.688-2.556-.721-.739-1.306-1.436-1.298-2.092.004-.331.132-.7.535-1.171.402-.47 1.08-1.02 2.119-1.636l1.362-.806h-8.54zm.241.867h5.271a6.83 6.83 0 00-1.113 1.01c-.496.58-.736 1.163-.743 1.726-.014 1.119.812 1.958 1.544 2.708.732.75 1.385 1.456 1.446 2.041.032.298-.039.598-.364 1.008-.312.393-.872.862-1.753 1.386H8.728c.367-.286.658-.566.88-.847.43-.54.604-1.107.548-1.638-.11-1.052-.968-1.818-1.688-2.556-.721-.739-1.306-1.435-1.298-2.092.004-.331.132-.7.534-1.171.389-.454 1.04-.984 2.021-1.575zm-1.233 1.48v.4h4.12v-.4h-4.12zm-.154 2.158v.4H12.6v-.4H8.34zm1.931 2.158v.4h4.126v-.4H10.27zm.59 2.158v.4h4.276v-.4h-4.276z"})),SendTask:({styles:e={},...t})=>wE("svg",xG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zm-1.38 3.16l8.332 4.717L21.78 8.16H5.114zm.021 1.745v9.309H21.8V9.905l-8.353 4.655-8.31-4.655z"})),ServiceTask:({styles:e={},...t})=>wE("svg",_G({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M6.494 3C2.916 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.012C28.015 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5zm1.22 1.681V7.84c-.329.093-.63.223-.914.382l-.83-.82-1.554 1.561.83.82c-.16.288-.285.594-.372.911l-1.177.002v2.2l1.189-.004c.109.431.345.819.58 1.165v-1.898l-1.038.004v-.737l1.034-.002.058-.294c.084-.429.252-.838.493-1.203l.165-.25-.727-.718.523-.526.728.719.247-.165c.379-.25.793-.417 1.206-.505l.291-.06-.002-1.01h.75L9.19 8.417H11.16c-.185-.221-.951-.508-1.237-.588L9.93 6.68H7.713zm2.078 2.105l.003 1.158a4.19 4.19 0 00-.915.383l-.83-.821-1.553 1.562.83.82c-.16.288-.286.593-.373.91l-1.176.003v2.2l1.188-.004c.094.326.224.624.383.905l-.85.847 1.57 1.543.847-.843c.29.161.599.286.919.373v1.198c.756.006 1.56.003 2.206.003V17.81a4.19 4.19 0 00.915-.383l.847.835 1.554-1.56-.848-.836c.16-.288.286-.594.373-.912l1.152-.007V12.75l-1.165.007a4.09 4.09 0 00-.382-.905l.805-.807-1.57-1.546-.804.806a4.16 4.16 0 00-.915-.372l.007-1.147H9.792zm.732.73h.751l-.006 1.005.297.058c.43.085.844.252 1.21.492l.25.162.701-.704.528.52-.702.704.169.25c.248.374.412.779.505 1.196l.061.292 1.016-.006v.737l-1.01.006-.058.292c-.085.43-.252.838-.494 1.205l-.165.25.744.733-.523.525-.743-.734-.248.165c-.378.247-.789.418-1.203.503l-.294.058v1.067h-.745v-1.059l-.295-.057a3.395 3.395 0 01-1.21-.492l-.248-.162-.747.743-.528-.52.747-.744-.17-.25a3.546 3.546 0 01-.506-1.196l-.06-.291-1.04.004v-.738l1.034-.002.058-.294c.085-.428.252-.837.493-1.203l.165-.25-.726-.718.522-.526.728.72.248-.166a3.546 3.546 0 011.205-.504l.292-.06-.003-1.01zm.388 2.685a1.65 1.65 0 00-1.645 1.645c0 .904.74 1.645 1.645 1.645a1.65 1.65 0 001.645-1.645 1.65 1.65 0 00-1.645-1.645zm0 .73a.91.91 0 01.915.915.91.91 0 01-.915.914.91.91 0 01-.915-.914.91.91 0 01.915-.915z"})),CompensateStartEvent:({styles:e={},...t})=>wE("svg",EG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.995.001C9.705-.084 3.643 3.964 1.257 9.775-1.235 15.485.06 22.577 4.42 27.03c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994 0zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626C2.101 23.171.377 16.07 2.848 10.44c2.14-5.205 7.515-8.774 13.147-8.708zm-.566 9.03l-7.415 5.235 7.415 5.238v-5.062c2.386 1.689 4.775 3.375 7.163 5.062V10.761l-7.163 5.058v-5.058zm-.866 1.666v7.13L9.51 15.993l5.052-3.565zm7.166 0v7.137l-5.052-3.568 5.052-3.569z"})),ConditionalStartEvent:({styles:e={},...t})=>wE("svg",SG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16 0C7.174 0 0 7.174 0 16s7.174 16 16 16 16-7.174 16-16S24.826 0 16 0zm0 1.73c7.892 0 14.27 6.378 14.27 14.27 0 7.891-6.379 14.27-14.27 14.27S1.73 23.891 1.73 16C1.73 8.108 8.108 1.73 16 1.73zm-5.362 7.523v13.493h10.724V9.253H10.638zm.863.866h8.995V21.88H11.501V10.12zm.928 1.324v.863h7.139v-.863h-7.139zm0 2.605v.867h7.139v-.867h-7.139zm0 3.01v.864h7.139v-.863h-7.139zm0 2.72v.863h7.139v-.863h-7.139z"})),ErrorStartEvent:({styles:e={},...t})=>wE("svg",kG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.995.005C9.705-.08 3.643 3.968 1.257 9.78-1.235 15.49.06 22.581 4.42 27.034c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994.005zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626-4.814-3.838-6.538-10.939-4.067-16.57 2.14-5.205 7.515-8.774 13.147-8.708zm6.13 7.45l-3.635 7.37-4.52-5.88c-1.37 4.048-2.738 8.095-4.106 12.143l4.603-5.917 4.748 5.433 2.91-13.149zm-7.754 3.889l4.299 5.449 1.073-2.39-1.028 4.135-4.387-5.16-1.78 2.75 1.823-4.784z"})),EscalationStartEvent:({styles:e={},...t})=>wE("svg",OG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.995.001C9.705-.084 3.643 3.964 1.257 9.775-1.235 15.485.06 22.577 4.42 27.03c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994 0zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626C2.101 23.171.377 16.07 2.848 10.44c2.14-5.205 7.515-8.774 13.147-8.708zm0 7.183c-1.674 4.658-2.736 9.509-4.41 14.166 1.535-1.526 2.874-3.236 4.41-4.763l4.41 4.763c-1.499-4.713-2.913-9.453-4.41-14.166zm.032 2.931c.822 2.588 1.598 5.19 2.42 7.778l-2.42-2.615c-.683.598-2.455 2.887-2.34 2.39.871-2.489 1.448-5.07 2.34-7.553z"})),MessageStartEvent:({styles:e={},...t})=>wE("svg",CG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.995.001C9.705-.084 3.643 3.964 1.257 9.775-1.235 15.485.06 22.577 4.42 27.03c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994 0zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626C2.101 23.171.377 16.07 2.848 10.44c2.14-5.205 7.515-8.774 13.147-8.708zm-7.257 8.732v11.069h14.513v-11.07H8.738zm3.224 1.73h8.064c-1.428.878-2.857 2.807-4.285 3.018l-3.779-3.019zm9.562 1.017v6.593H10.465V13.21l5.528 4.417 5.53-4.418z"})),MultipleStartEvent:({styles:e={},...t})=>wE("svg",PG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.995.001C9.705-.084 3.643 3.964 1.257 9.775-1.235 15.485.06 22.577 4.42 27.03c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994 0zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626C2.101 23.171.377 16.07 2.848 10.44c2.14-5.205 7.515-8.774 13.147-8.708zm0 6.328l-7.626 5.536c.97 2.986 1.942 5.971 2.913 8.957h9.426l2.912-8.957-7.625-5.536zm0 1.068l6.609 4.798-2.525 7.763H11.91l-2.524-7.763 6.609-4.798z"})),ConditionalStartEventNonInterrupting:({styles:e={},...t})=>wE("svg",AG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M10.632 9.189V22.68h10.723V9.189H10.632zm.862.865h8.994v11.76H11.494v-11.76zm.928 1.324v.863h7.138v-.863h-7.138zm0 2.605v.866h7.138v-.866h-7.138zm0 3.01v.863h7.138v-.863h-7.138zm0 2.72v.862h7.138v-.863h-7.138zM16.12 0h-.232l-.22.004h-.012l-.221.006h-.012l-.22.01h-.012l-.22.013h-.012l-.22.016h-.012l-.22.019h-.005l-.006.001-.22.021h-.006l-.005.001-.22.025h-.011l-.22.028h-.005l-.006.002-.219.03h-.005l-.006.001-.218.033-.006.001-.006.001-.217.036-.006.001-.006.001-.217.039-.006.001-.006.001-.216.042-.006.001-.006.001-.215.045-.006.001-.006.002-.215.047-.006.002-.006.001-.214.05-.006.002-.006.002-.115.029-.152.053-.14.081-.122.106-.1.126-.075.143-.047.154-.018.16.012.16.042.156.07.145.095.13.118.11.137.086.15.059.158.03h.161l.132-.022.11-.028.202-.047.203-.046.208-.043.202-.039.206-.037.206-.034.205-.03.208-.03.205-.025.209-.023.208-.02.21-.017.209-.015.207-.011.21-.009.21-.006.207-.003h.21l.21.002.207.005.207.008.212.011.207.014.208.017.209.019.208.022.205.025.206.028.207.03.208.035.205.036.202.039.052.01.16.018.16-.012.156-.042.146-.07.13-.096.109-.119.085-.136.06-.15.03-.159v-.16l-.03-.16-.059-.15-.086-.136-.109-.118-.13-.096-.145-.07-.128-.038-.057-.011-.006-.002h-.006l-.216-.042-.006-.001-.006-.001-.217-.039H18.9l-.006-.002-.217-.035-.006-.001-.006-.001-.218-.032-.006-.001-.006-.001-.218-.03h-.006l-.006-.001-.219-.027h-.011l-.22-.024-.005-.001h-.006l-.22-.021h-.006l-.006-.001-.22-.017-.005-.001h-.006L17.06.03h-.012l-.22-.012h-.012l-.22-.01h-.012l-.22-.005h-.012L16.132 0h-.012zm8.715 2.783l-.157.034-.149.063-.134.089-.116.112-.092.132-.067.147-.038.157-.008.16.021.16.051.153.079.141.103.124.102.087.052.038h.001l.087.064v.001l.082.061.002.001.076.059h.001l.084.065.082.066.002.001.079.063.002.002.077.063.081.067.002.002.077.065.076.065.001.002.08.07.078.07h.002l.075.068.077.072.002.001.073.069.077.073.072.07.002.001.077.076.07.07v.001l.075.076.07.073.002.001.074.079.002.002.069.074.069.075.074.082.07.08.002.001.068.079h.001l.067.079.068.082.065.078.001.002.068.083.067.084.063.081.001.002.067.087.002.002.063.084.001.001.064.087.008.01.008.01.095.12.093.121.09.119.087.119.088.122.086.123.084.12.081.122.001.002.084.126.08.126.08.127.077.126.079.131.074.127.075.131.073.131.07.13.07.133.069.133.045.09.086.137.109.119.13.096.144.07.156.042.16.013.16-.017.155-.047.143-.075.126-.1.106-.121.082-.14.054-.151.025-.16-.005-.16-.035-.158-.05-.124-.048-.095-.002-.004-.002-.004-.073-.14-.002-.005-.002-.004-.074-.14-.002-.004-.002-.004-.076-.14-.002-.003-.002-.004-.077-.139-.003-.004-.002-.004-.078-.138-.003-.004-.002-.003-.08-.137-.002-.004-.003-.004-.081-.136-.002-.004-.003-.004-.083-.136-.002-.003-.002-.004-.085-.135-.002-.004-.003-.003-.085-.134-.003-.004-.002-.004-.087-.132-.003-.004-.003-.004-.088-.132-.003-.003-.002-.004-.09-.13-.003-.005-.003-.003-.091-.13-.003-.004-.002-.004-.093-.129-.003-.003-.003-.004-.094-.128-.003-.004-.003-.003-.095-.127-.003-.004-.003-.004-.097-.125-.003-.004-.003-.004-.09-.114-.06-.082-.003-.003-.002-.003-.069-.091-.002-.004-.002-.003-.07-.09-.003-.003-.002-.003-.07-.09-.003-.003-.002-.003-.071-.09-.002-.003-.003-.002-.072-.089-.002-.003-.002-.003-.073-.088-.002-.003-.002-.002-.074-.087-.002-.003-.002-.003-.074-.086-.003-.003-.002-.003-.074-.086-.003-.002-.002-.003-.075-.085-.003-.003-.002-.002-.076-.084-.002-.003-.003-.003-.076-.083-.002-.003-.003-.003-.077-.082-.002-.003-.003-.002-.077-.082-.003-.003-.003-.002-.078-.081-.002-.003-.003-.003-.078-.08-.003-.002-.003-.003-.079-.08-.002-.002-.003-.002-.08-.08-.002-.002-.003-.002-.08-.078-.003-.003-.003-.002-.08-.077-.003-.003-.003-.002-.082-.077-.002-.002-.003-.002-.082-.076-.003-.002-.002-.003-.083-.075-.003-.002-.002-.003-.084-.074-.002-.002-.003-.002-.084-.074-.003-.002-.002-.002-.085-.073-.002-.002-.003-.003-.085-.071-.003-.003-.002-.002-.086-.07-.003-.003-.002-.002-.086-.07-.003-.003-.003-.002-.086-.07-.003-.002-.003-.002-.087-.069-.002-.002-.003-.002-.088-.068-.002-.002-.003-.002-.088-.067-.003-.003-.003-.002-.088-.066-.003-.002-.003-.002-.089-.066-.003-.002-.003-.002-.057-.042-.14-.082-.15-.055-.16-.026-.16.004zM6.377 3.21l-.157.037-.148.066-.111.074-.007.006-.003.002-.003.002-.086.069-.003.002-.002.002-.086.07-.003.002-.002.002-.086.07-.002.003-.003.002-.085.071-.002.002-.003.003-.084.071-.003.003-.002.002-.084.072-.003.003-.002.002-.083.073-.003.003-.002.002-.083.074-.002.002-.003.003-.082.074-.003.003-.002.002-.081.076-.003.002-.003.002-.08.077-.003.002-.003.003-.08.076-.002.003-.003.002-.08.078-.002.002-.003.003-.079.078-.002.003-.003.002-.078.08-.003.002-.002.002-.078.08-.002.003-.003.002-.077.08-.003.004-.002.002-.077.081-.002.003-.003.003-.076.082-.002.002-.003.003-.075.082-.002.003-.003.003-.074.083-.003.003-.002.003-.074.084-.003.003-.002.002-.074.085-.002.003-.002.003-.073.085-.003.003-.002.003-.072.086-.002.003-.003.003-.071.087-.003.003-.002.002-.07.088-.003.003-.002.003-.07.088-.003.003-.002.003-.07.09-.002.002-.002.003-.069.09-.002.003-.003.003-.068.09-.002.003-.002.003-.067.092-.003.003-.002.003-.067.092-.002.003-.002.003-.066.092-.002.003-.002.004-.066.093-.002.003-.002.003-.065.094-.002.003-.002.004-.064.094-.002.003-.002.004-.063.095-.002.003-.002.003-.063.097-.002.003-.002.003-.046.073-.05.07-.003.002-.002.003-.067.093-.003.003-.002.003-.066.094-.002.003-.002.003-.066.094-.002.003-.002.003-.064.094-.002.004-.002.003-.064.094-.002.004-.002.003-.062.095-.002.003-.002.003-.062.096-.002.003-.002.003-.06.096-.003.003-.002.003-.06.096-.001.004-.002.003-.059.096-.002.004-.002.003-.058.097-.002.003-.001.003-.057.098-.002.003-.002.003-.056.098-.002.003-.002.003-.055.098-.002.004-.001.003-.055.098-.001.004-.002.003-.054.099-.001.003-.002.003-.052.1-.002.002-.002.004-.051.1-.002.002-.002.004-.05.1-.002.003-.002.003-.05.1v.003l-.002.004-.05.1v.003l-.002.004-.048.1-.002.004-.001.003-.047.101-.002.003-.001.004-.013.027-.052.152-.024.16.006.16.037.157.064.148.091.133.114.114.134.09.147.065.157.036.162.006.159-.024.152-.053.14-.08.122-.105.1-.126.066-.117.01-.023.044-.095.045-.095.002-.003.042-.087.048-.097.048-.095v-.001l.048-.092.001-.001.047-.09.05-.093.002-.002.049-.09.052-.092.001-.002.051-.089.001-.002.051-.087.053-.088.001-.002.055-.091.057-.091.057-.09.001-.002.057-.089.055-.083.001-.002.06-.09.06-.088.062-.089.001-.001.06-.084.063-.088.065-.089.017-.023.016-.025.06-.094.059-.09v-.002l.058-.086.057-.086.001-.001.062-.09.062-.088.001-.002.06-.085.002-.002.06-.082.063-.087.064-.084.002-.002.061-.08.065-.084.064-.08v-.001l.067-.083.067-.082.07-.083.069-.08.063-.074.074-.083.068-.077.002-.002.07-.076.07-.075.072-.077.001-.001.067-.07.076-.078.002-.002.07-.07.075-.075.002-.002.072-.07.075-.072.002-.002.073-.069.074-.068.001-.001.08-.073.076-.068.002-.002.072-.063v-.001l.078-.067.079-.068.002-.001.08-.068.002-.002.077-.063.082-.066.001-.001.075-.06.002-.002.006-.004.117-.111.094-.131.068-.146.04-.156.01-.161-.019-.16-.049-.154-.076-.141-.102-.125-.123-.105-.14-.079-.153-.052-.16-.023-.16.007zm24.596 11.088l-.156.04-.146.067-.131.094-.112.117-.087.135-.061.15-.033.157-.004.134.007.142.005.152.004.15.002.149v.153l.001.011v.015l.004.11.002.11v.002l.002.106v.321l-.003.102-.002.106-.004.107-.005.105-.006.106-.006.106-.008.106v.002l-.008.103v.002l-.01.1-.01.105-.01.105-.013.105-.012.099v.002l-.014.108-.014.1-.016.105-.016.103v.002l-.017.099-.018.104-.019.103v.002l-.019.097-.02.104-.022.103v.001l-.022.098-.023.103v.002l-.024.096-.025.103v.002l-.024.096-.027.102v.003l-.026.093v.001l-.029.103v.002l-.03.099-.028.097v.002l-.03.095-.03.096v.001l-.033.1-.031.095v.002l-.035.1v.003l-.034.094v.003l-.035.096v.001l-.034.09v.002l-.038.098-.036.093v.002l-.038.095-.079.194-.08.188-.085.189-.087.19-.09.184-.092.183-.095.184-.05.093-.064.148-.034.158-.005.16.026.16.054.151.082.14.106.12.127.1.143.075.154.046.16.017.161-.013.156-.042.144-.071.13-.096.109-.119.072-.112.053-.099.003-.005.003-.006.102-.195.003-.006.003-.006.098-.196.003-.006.003-.006.096-.197.002-.006.003-.006.093-.2.002-.006.003-.006.09-.2.002-.006.003-.007.086-.202.003-.006.002-.006.084-.203.002-.005.001-.005.04-.102.002-.003.001-.003.04-.103.001-.003.001-.003.04-.103v-.004l.001-.003.039-.103v-.003l.002-.003.037-.104.001-.003.001-.003.037-.104v-.004l.002-.003.035-.104.002-.003v-.004l.035-.104.002-.004v-.003l.034-.105.002-.003v-.003l.034-.105v-.004l.002-.003.032-.106.001-.003.001-.003.031-.106.001-.003.001-.004.031-.106.001-.003.001-.004.03-.106v-.003l.002-.004.028-.107.001-.003.001-.003.028-.107.001-.004.001-.003.027-.107.001-.004v-.003l.027-.108.001-.003v-.004l.026-.108.001-.003v-.004l.025-.108.001-.003v-.004l.025-.108v-.004l.001-.003.023-.109v-.003l.001-.004.022-.109v-.003l.002-.004.02-.109.001-.004v-.003l.02-.11.002-.003v-.004l.02-.11v-.007l.019-.11v-.003l.001-.004.017-.11v-.004l.001-.003.017-.11v-.008l.016-.11v-.004l.001-.004.015-.11v-.008l.015-.111v-.008l.013-.111v-.007l.013-.112v-.007l.011-.112v-.004l.001-.004.01-.112v-.007l.01-.112v-.008l.008-.112v-.008l.007-.113v-.007l.007-.113v-.008l.005-.113v-.007l.005-.114v-.007l.003-.114v-.007l.003-.114v-.129l.001-.114v-.13l-.003-.114v-.008l-.003-.115v-.007l-.003-.102v-.155l-.003-.158v-.01l-.004-.158v-.01l-.006-.158v-.01l-.007-.148-.023-.16-.051-.152-.08-.14-.103-.124-.125-.102-.142-.077-.153-.05-.16-.02-.161.01zm-30.213.66l-.157.034-.149.063-.134.09-.115.113-.092.132-.067.147-.037.156-.009.134.001.11V15.95l.006.22v.012l.01.22v.012l.012.22v.006l.001.006.015.22v.005l.001.006.018.22.001.006v.006l.022.219v.006l.001.006.024.219.001.006v.006l.028.218.001.006v.006l.031.218.001.006.001.006.033.218.001.006.001.005.037.218v.006l.002.005.04.217v.006l.001.006.043.216.001.006.001.006.046.216v.005l.002.006.048.215.002.006.001.006.051.214.002.006v.006l.055.214.002.005.001.006.057.213.002.006.001.005.06.213.002.005.001.006.063.212.002.005.001.006.066.21.002.006.002.006.068.21.002.005.002.005.07.21.003.005.002.005.074.208.002.006.002.005.077.207.002.006.002.005.08.206.002.005.002.006.082.204.002.006.002.005.086.204.002.005.002.006.088.202.002.005.003.006.09.2.003.006.002.005.094.2.002.006.003.005.096.199.002.005.003.005.03.062.086.137.11.118.128.097.145.07.156.043.16.013.16-.017.155-.047.143-.074.127-.1.106-.121.081-.14.055-.15.025-.16-.005-.161-.034-.158-.05-.124-.028-.055-.092-.19-.087-.188-.087-.192-.083-.19-.08-.193-.078-.194-.076-.196-.073-.195-.07-.197-.067-.198-.065-.199-.063-.2-.059-.2-.056-.2-.055-.204-.05-.201-.049-.202-.046-.205-.043-.206-.04-.203-.038-.207-.034-.204-.032-.207-.028-.205-.026-.207-.023-.208-.02-.207-.018-.207-.014-.208-.011-.207-.009-.208-.005-.207-.002-.104-.017-.16-.046-.155-.074-.143-.1-.126-.121-.107-.139-.081-.152-.055-.159-.025-.161.004zm24.585 11.83l-.156.039-.146.068-.11.076-.015.012-.163.129-.166.127-.168.125-.17.124-.17.12-.172.118-.173.115-.176.114-.177.111-.18.11-.178.105-.182.104-.182.101-.184.1-.184.095-.189.095-.186.09-.188.089-.19.086-.19.082-.193.081-.195.078-.191.074-.197.073-.195.07-.196.065-.198.064-.198.061-.2.058-.2.055-.2.052-.2.049-.151.035-.153.05-.141.078-.125.103-.103.124-.078.14-.05.154-.022.16.009.16.038.157.067.147.093.132.116.112.134.089.149.062.158.034.16.003.133-.02.158-.035.006-.002.006-.001.213-.052.006-.002.007-.001.212-.056.006-.001.006-.002.212-.058.006-.002.006-.002.211-.061.006-.002.006-.002.21-.064.006-.002.006-.002.21-.067.005-.002.006-.002.208-.07.006-.002.006-.003.207-.073.006-.002.006-.002.206-.077.006-.002.005-.002.206-.08.005-.001.006-.003.204-.082.006-.002.005-.002.203-.085.006-.003.005-.002.202-.088.006-.002.005-.003.2-.09.006-.003.006-.003.2-.093.005-.003.005-.002.198-.096.006-.003.005-.003.197-.099.005-.002.005-.003.196-.102.005-.002.005-.003.195-.105.005-.002.005-.003.193-.107.005-.003.005-.003.191-.11.005-.003.005-.003.19-.112.005-.003.005-.003.189-.115.005-.003.005-.003.187-.117.005-.003.004-.004.186-.12.005-.003.004-.003.184-.122.005-.003.005-.004.182-.125.004-.003.005-.003.18-.128.005-.003.005-.003.179-.13.004-.003.005-.004.177-.132.004-.004.005-.003.175-.135.005-.003.004-.004.173-.137.005-.003.004-.004.019-.015.115-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.052-.153-.079-.14-.103-.124-.125-.102-.142-.078-.153-.05-.16-.02-.16.01zm-19.17.054l-.153.051-.14.079-.124.103-.103.125-.077.141-.05.153-.02.16.009.161.04.156.067.147.093.131.095.094.047.04.005.004.005.004.17.14.005.004.005.004.172.137.004.004.005.003.086.067.003.002.003.002.087.067.003.002.003.002.088.066.002.003.003.002.089.065.002.002.003.002.09.065.002.002.003.002.09.064.002.002.003.002.09.063.003.002.003.002.09.063.003.002.003.002.092.062.002.002.003.002.092.061.003.002.003.002.092.06.003.003.003.001.093.06.003.002.003.002.093.06.003.001.003.002.094.058.003.002.003.002.095.058.003.001.003.002.095.057.003.002.003.002.095.056.003.002.003.002.096.055.004.002.003.001.096.055.003.002.003.002.098.053.003.002.003.002.097.053.004.002.003.001.098.053.003.001.003.002.099.052.003.001.003.002.1.05.003.002.003.002.1.05.003.002.003.001.1.05h.003l.004.003.1.048.004.001.003.002.101.048.003.001.004.002.101.046.004.002.003.001.102.046.004.002.003.001.103.045.003.002.003.001.103.045.004.001.003.002.104.043.003.001.004.002.104.042.003.002.004.001.104.042.004.001.003.002.105.04.004.002.003.001.106.04.003.002h.004l.106.04.004.001.003.002.107.038.003.001.004.001.107.038.003.001.004.001.107.037.004.001.004.001.108.036.003.001.004.001.108.035.004.001.003.001.11.034.003.001.004.001.109.033.004.002h.003l.11.033h.004l.003.002.11.031.004.001.004.001.084.023.081.028.004.001.003.001.109.037.003.001.004.001.109.036.003.001.004.001.109.035h.003l.004.002.11.033.003.001.003.001.11.033.003.001.004.001.109.031.004.002h.003l.11.031.003.001.004.001.11.03h.003l.003.001.11.029h.004l.003.002.11.027.003.001.004.001.11.027h.003l.004.001.004.001.16.022.16-.008.157-.038.147-.067.132-.092.112-.116.09-.134.062-.149.034-.157.004-.161-.025-.16-.055-.151-.082-.139-.107-.12-.127-.1-.143-.074-.124-.04h-.003l-.104-.025-.103-.026h-.002l-.095-.026h-.001l-.101-.027h-.002l-.1-.028h-.002l-.103-.03-.104-.032-.097-.03h-.002l-.103-.033-.102-.033-.101-.034-.106-.036-.027-.01-.027-.007-.107-.03-.104-.029-.104-.03h-.002l-.097-.03-.102-.032-.102-.032-.102-.034-.103-.035-.096-.034-.1-.036-.101-.037h-.002l-.094-.036-.096-.037-.097-.04h-.002l-.099-.04-.098-.042h-.002l-.092-.04-.097-.043-.095-.043-.097-.044h-.002l-.09-.043-.094-.045-.094-.046-.093-.047-.09-.046-.096-.05-.088-.047-.002-.001-.09-.049-.094-.052-.002-.002-.087-.049-.087-.05h-.002l-.088-.053h-.001l-.09-.055-.086-.052-.002-.001-.089-.055-.084-.054h-.002l-.09-.059h-.001l-.085-.056-.001-.001-.084-.056-.082-.056h-.001l-.086-.06-.082-.058H7.79l-.086-.062-.002-.002-.08-.058-.081-.06h-.001l-.085-.064-.002-.002-.076-.058-.002-.002-.082-.064-.161-.128-.162-.133-.04-.034-.132-.092-.147-.066-.157-.038-.16-.008-.16.022z"})),EscalationStartEventNonInterrupting:({styles:e={},...t})=>wE("svg",TG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16 9.209c-1.674 4.655-2.735 9.504-4.408 14.16 1.534-1.526 2.873-3.235 4.407-4.761l4.408 4.76c-1.497-4.71-2.91-9.448-4.408-14.16zm.031 2.93c.822 2.586 1.598 5.187 2.42 7.774l-2.42-2.614c-.682.598-2.453 2.886-2.34 2.389.873-2.488 1.45-5.068 2.34-7.55zM16.132.364c-1.51.016-3.055.139-4.492.614-.854.442-.266 1.861.651 1.578 2.266-.58 4.656-.596 6.944-.144.935.063 1.21-1.391.318-1.674-1.118-.26-2.274-.361-3.42-.374zm8.865 2.777c-.931-.1-1.262 1.29-.425 1.666 1.863 1.364 3.222 3.298 4.322 5.296.617.737 1.875-.145 1.398-.979-1.184-2.275-2.808-4.384-4.923-5.866a.863.863 0 00-.372-.117zM6.55 3.564c-.734.078-1.196.762-1.735 1.206C3.552 6.02 2.55 7.511 1.681 9.053c-.31.533-.71 1.33-.03 1.767.615.432 1.282-.132 1.446-.742.796-1.475 1.746-2.89 2.934-4.08.43-.548 1.292-.822 1.34-1.595a.874.874 0 00-.822-.839zm24.582 11.078c-.771-.033-1.004.82-.873 1.437.13 2.395-.471 4.797-1.615 6.897-.33.876.984 1.559 1.512.785a14.276 14.276 0 001.761-8.54.865.865 0 00-.785-.579zm-30.195.666c-.774-.06-1.032.785-.905 1.407.117 2.41.732 4.81 1.858 6.945.528.774 1.84.09 1.51-.786A15.932 15.932 0 011.728 16a.876.876 0 00-.79-.692zm24.57 11.817c-.762.099-1.243.835-1.919 1.16-1.514 1.002-3.237 1.632-4.978 2.092-.864.423-.307 1.855.616 1.591 2.528-.578 4.93-1.75 6.913-3.421.469-.522.07-1.42-.631-1.422zm-19.16.042c-.845.001-1.12 1.228-.395 1.628 1.665 1.401 3.667 2.348 5.76 2.912.618.178 1.482.565 1.893-.177.355-.628-.226-1.297-.87-1.326-1.972-.515-3.912-1.285-5.5-2.594-.26-.213-.522-.472-.888-.443z"})),MessageStartEventNonInterrupting:({styles:e={},...t})=>wE("svg",RG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M8.746 10.393v11.064h14.506V10.393H8.746zm3.223 1.728h8.06c-1.428.879-2.856 2.807-4.283 3.018l-3.777-3.018zm9.557 1.018v6.59H10.473v-6.59l5.525 4.416 5.528-4.416zM16.132 0c-1.51.016-3.055.139-4.492.614-.854.442-.266 1.861.651 1.578 2.266-.58 4.656-.596 6.944-.144.935.063 1.21-1.391.318-1.674-1.118-.26-2.274-.361-3.42-.374zm8.865 2.777c-.931-.1-1.262 1.29-.425 1.666 1.863 1.364 3.222 3.298 4.322 5.296.617.737 1.875-.145 1.398-.979-1.184-2.275-2.808-4.384-4.923-5.866a.863.863 0 00-.372-.117zM6.55 3.2c-.734.078-1.196.762-1.735 1.206C3.552 5.656 2.55 7.147 1.681 8.69c-.31.533-.71 1.33-.03 1.767.615.432 1.282-.132 1.446-.742.796-1.475 1.746-2.89 2.934-4.08.43-.548 1.292-.822 1.34-1.595a.874.874 0 00-.822-.839zm24.582 11.078c-.771-.033-1.004.82-.873 1.437.13 2.395-.471 4.797-1.615 6.897-.33.876.984 1.559 1.512.785a14.276 14.276 0 001.761-8.54.865.865 0 00-.785-.579zm-30.195.666c-.774-.06-1.032.785-.905 1.407.117 2.41.732 4.81 1.858 6.945.528.774 1.84.09 1.51-.786a15.932 15.932 0 01-1.672-6.874.876.876 0 00-.79-.692zm24.57 11.817c-.762.099-1.243.835-1.919 1.16-1.514 1.002-3.237 1.632-4.978 2.092-.864.423-.307 1.855.616 1.591 2.528-.578 4.93-1.75 6.913-3.421.469-.522.07-1.42-.631-1.422zm-19.16.042c-.845.001-1.12 1.228-.395 1.628 1.665 1.401 3.667 2.348 5.76 2.912.618.178 1.482.565 1.893-.177.355-.628-.226-1.297-.87-1.326-1.972-.515-3.912-1.285-5.5-2.594-.26-.213-.522-.472-.888-.443z"})),MultipleStartEventNonInterrupting:({styles:e={},...t})=>wE("svg",MG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M23.621 13.524L16 7.99l-7.622 5.534 2.911 8.952h9.422l2.911-8.952zm-1.016.33l-2.523 7.759h-8.165l-2.524-7.76L16 9.059l6.606 4.796zM16.132 0c-1.51.016-3.055.139-4.492.614-.854.442-.266 1.861.651 1.578 2.266-.58 4.656-.596 6.944-.144.935.063 1.21-1.391.318-1.674-1.118-.26-2.274-.361-3.42-.374zm8.865 2.777c-.931-.1-1.262 1.29-.425 1.666 1.863 1.364 3.222 3.298 4.322 5.296.617.737 1.875-.145 1.398-.979-1.184-2.275-2.808-4.384-4.923-5.866a.863.863 0 00-.372-.117zM6.55 3.2c-.734.078-1.196.762-1.735 1.206C3.552 5.656 2.55 7.147 1.681 8.69c-.31.533-.71 1.33-.03 1.767.615.432 1.282-.132 1.446-.742.796-1.475 1.746-2.89 2.934-4.08.43-.548 1.292-.822 1.34-1.595a.874.874 0 00-.822-.839zm24.582 11.078c-.771-.033-1.004.82-.873 1.437.13 2.395-.471 4.797-1.615 6.897-.33.876.984 1.559 1.512.785a14.276 14.276 0 001.761-8.54.865.865 0 00-.785-.579zm-30.195.666c-.774-.06-1.032.785-.905 1.407.117 2.41.732 4.81 1.858 6.945.528.774 1.84.09 1.51-.786a15.932 15.932 0 01-1.672-6.874.876.876 0 00-.79-.692zm24.57 11.817c-.762.099-1.243.835-1.919 1.16-1.514 1.002-3.237 1.632-4.978 2.092-.864.423-.307 1.855.616 1.591 2.528-.578 4.93-1.75 6.913-3.421.469-.522.07-1.42-.631-1.422zm-19.16.042c-.845.001-1.12 1.228-.395 1.628 1.665 1.401 3.667 2.348 5.76 2.912.618.178 1.482.565 1.893-.177.355-.628-.226-1.297-.87-1.326-1.972-.515-3.912-1.285-5.5-2.594-.26-.213-.522-.472-.888-.443z"})),ParallelMultipleStartEventNonInterrupting:({styles:e={},...t})=>wE("svg",$G({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M13.503 9.016v4.428H9.075v4.98h4.428v4.428h4.98v-4.427h4.428v-4.981h-4.427V9.016h-4.981zm.83.83h3.32v4.428h4.428v3.32h-4.428v4.428h-3.32v-4.454H9.905v-3.294h4.428V9.846zM16.12 0h-.232l-.22.004h-.012l-.221.006h-.012l-.22.01h-.012l-.22.013h-.012l-.22.016h-.012l-.22.019h-.005l-.006.001-.22.021h-.006l-.005.001-.22.025h-.011l-.22.028h-.005l-.006.002-.219.03h-.005l-.006.001-.218.033-.006.001-.006.001-.217.036-.006.001-.006.001-.217.039-.006.001-.006.001-.216.042-.006.001-.006.001-.215.045-.006.001-.006.002-.215.047-.006.002-.006.001-.214.05-.006.002-.006.002-.115.029-.152.053-.14.081-.122.106-.1.126-.075.143-.047.154-.018.16.012.16.042.156.07.145.095.13.118.11.137.086.15.059.158.03h.161l.132-.022.11-.028.202-.047.203-.046.208-.043.202-.039.206-.037.206-.034.205-.03.208-.03.205-.025.209-.023.208-.02.21-.017.209-.015.207-.011.21-.009.21-.006.207-.003h.21l.21.002.207.005.207.008.212.011.207.014.208.017.209.019.208.022.205.025.206.028.207.03.208.035.205.036.202.039.052.01.16.018.16-.012.156-.042.146-.07.13-.096.109-.119.085-.136.06-.15.03-.159v-.16l-.03-.16-.059-.15-.086-.136-.109-.118-.13-.096-.145-.07-.128-.038-.057-.011-.006-.002h-.006l-.216-.042-.006-.001-.006-.001-.217-.039H18.9l-.006-.002-.217-.035-.006-.001-.006-.001-.218-.032-.006-.001-.006-.001-.218-.03h-.006l-.006-.001-.219-.027h-.011l-.22-.024-.005-.001h-.006l-.22-.021h-.006l-.006-.001-.22-.017-.005-.001h-.006L17.06.03h-.012l-.22-.012h-.012l-.22-.01h-.012l-.22-.005h-.012L16.132 0h-.012zm8.715 2.783l-.157.034-.149.063-.134.089-.116.112-.092.132-.067.147-.038.157-.008.16.021.16.051.153.079.141.103.124.102.087.052.038h.001l.087.064v.001l.082.061.002.001.076.059h.001l.084.065.082.066.002.001.079.063.002.002.077.063.081.067.002.002.077.065.076.065.001.002.08.07.078.07h.002l.075.068.077.072.002.001.073.069.077.073.072.07.002.001.077.076.07.07v.001l.075.076.07.073.002.001.074.079.002.002.069.074.069.075.074.082.07.08.002.001.068.079h.001l.067.079.068.082.065.078.001.002.068.083.067.084.063.081.001.002.067.087.002.002.063.084.001.001.064.087.008.01.008.01.095.12.093.121.09.119.087.119.088.122.086.123.084.12.081.122.001.002.084.126.08.126.08.127.077.126.079.131.074.127.075.131.073.131.07.13.07.133.069.133.045.09.086.137.109.119.13.096.144.07.156.042.16.013.16-.017.155-.047.143-.075.126-.1.106-.121.082-.14.054-.151.025-.16-.005-.16-.035-.158-.05-.124-.048-.095-.002-.004-.002-.004-.073-.14-.002-.005-.002-.004-.074-.14-.002-.004-.002-.004-.076-.14-.002-.003-.002-.004-.077-.139-.003-.004-.002-.004-.078-.138-.003-.004-.002-.003-.08-.137-.002-.004-.003-.004-.081-.136-.002-.004-.003-.004-.083-.136-.002-.003-.002-.004-.085-.135-.002-.004-.003-.003-.085-.134-.003-.004-.002-.004-.087-.132-.003-.004-.003-.004-.088-.132-.003-.003-.002-.004-.09-.13-.003-.005-.003-.003-.091-.13-.003-.004-.002-.004-.093-.129-.003-.003-.003-.004-.094-.128-.003-.004-.003-.003-.095-.127-.003-.004-.003-.004-.097-.125-.003-.004-.003-.004-.09-.114-.06-.082-.003-.003-.002-.003-.069-.091-.002-.004-.002-.003-.07-.09-.003-.003-.002-.003-.07-.09-.003-.003-.002-.003-.071-.09-.002-.003-.003-.002-.072-.089-.002-.003-.002-.003-.073-.088-.002-.003-.002-.002-.074-.087-.002-.003-.002-.003-.074-.086-.003-.003-.002-.003-.074-.086-.003-.002-.002-.003-.075-.085-.003-.003-.002-.002-.076-.084-.002-.003-.003-.003-.076-.083-.002-.003-.003-.003-.077-.082-.002-.003-.003-.002-.077-.082-.003-.003-.003-.002-.078-.081-.002-.003-.003-.003-.078-.08-.003-.002-.003-.003-.079-.08-.002-.002-.003-.002-.08-.08-.002-.002-.003-.002-.08-.078-.003-.003-.003-.002-.08-.077-.003-.003-.003-.002-.082-.077-.002-.002-.003-.002-.082-.076-.003-.002-.002-.003-.083-.075-.003-.002-.002-.003-.084-.074-.002-.002-.003-.002-.084-.074-.003-.002-.002-.002-.085-.073-.002-.002-.003-.003-.085-.071-.003-.003-.002-.002-.086-.07-.003-.003-.002-.002-.086-.07-.003-.003-.003-.002-.086-.07-.003-.002-.003-.002-.087-.069-.002-.002-.003-.002-.088-.068-.002-.002-.003-.002-.088-.067-.003-.003-.003-.002-.088-.066-.003-.002-.003-.002-.089-.066-.003-.002-.003-.002-.057-.042-.14-.082-.15-.055-.16-.026-.16.004zM6.377 3.21l-.157.037-.148.066-.111.074-.007.006-.003.002-.003.002-.086.069-.003.002-.002.002-.086.07-.003.002-.002.002-.086.07-.002.003-.003.002-.085.071-.002.002-.003.003-.084.071-.003.003-.002.002-.084.072-.003.003-.002.002-.083.073-.003.003-.002.002-.083.074-.002.002-.003.003-.082.074-.003.003-.002.002-.081.076-.003.002-.003.002-.08.077-.003.002-.003.003-.08.076-.002.003-.003.002-.08.078-.002.002-.003.003-.079.078-.002.003-.003.002-.078.08-.003.002-.002.002-.078.08-.002.003-.003.002-.077.08-.003.004-.002.002-.077.081-.002.003-.003.003-.076.082-.002.002-.003.003-.075.082-.002.003-.003.003-.074.083-.003.003-.002.003-.074.084-.003.003-.002.002-.074.085-.002.003-.002.003-.073.085-.003.003-.002.003-.072.086-.002.003-.003.003-.071.087-.003.003-.002.002-.07.088-.003.003-.002.003-.07.088-.003.003-.002.003-.07.09-.002.002-.002.003-.069.09-.002.003-.003.003-.068.09-.002.003-.002.003-.067.092-.003.003-.002.003-.067.092-.002.003-.002.003-.066.092-.002.003-.002.004-.066.093-.002.003-.002.003-.065.094-.002.003-.002.004-.064.094-.002.003-.002.004-.063.095-.002.003-.002.003-.063.097-.002.003-.002.003-.046.073-.05.07-.003.002-.002.003-.067.093-.003.003-.002.003-.066.094-.002.003-.002.003-.066.094-.002.003-.002.003-.064.094-.002.004-.002.003-.064.094-.002.004-.002.003-.062.095-.002.003-.002.003-.062.096-.002.003-.002.003-.06.096-.003.003-.002.003-.06.096-.001.004-.002.003-.059.096-.002.004-.002.003-.058.097-.002.003-.001.003-.057.098-.002.003-.002.003-.056.098-.002.003-.002.003-.055.098-.002.004-.001.003-.055.098-.001.004-.002.003-.054.099-.001.003-.002.003-.052.1-.002.002-.002.004-.051.1-.002.002-.002.004-.05.1-.002.003-.002.003-.05.1v.003l-.002.004-.05.1v.003l-.002.004-.048.1-.002.004-.001.003-.047.101-.002.003-.001.004-.013.027-.052.152-.024.16.006.16.037.157.064.148.091.133.114.114.134.09.147.065.157.036.162.006.159-.024.152-.053.14-.08.122-.105.1-.126.066-.117.01-.023.044-.095.045-.095.002-.003.042-.087.048-.097.048-.095v-.001l.048-.092.001-.001.047-.09.05-.093.002-.002.049-.09.052-.092.001-.002.051-.089.001-.002.051-.087.053-.088.001-.002.055-.091.057-.091.057-.09.001-.002.057-.089.055-.083.001-.002.06-.09.06-.088.062-.089.001-.001.06-.084.063-.088.065-.089.017-.023.016-.025.06-.094.059-.09v-.002l.058-.086.057-.086.001-.001.062-.09.062-.088.001-.002.06-.085.002-.002.06-.082.063-.087.064-.084.002-.002.061-.08.065-.084.064-.08v-.001l.067-.083.067-.082.07-.083.069-.08.063-.074.074-.083.068-.077.002-.002.07-.076.07-.075.072-.077.001-.001.067-.07.076-.078.002-.002.07-.07.075-.075.002-.002.072-.07.075-.072.002-.002.073-.069.074-.068.001-.001.08-.073.076-.068.002-.002.072-.063v-.001l.078-.067.079-.068.002-.001.08-.068.002-.002.077-.063.082-.066.001-.001.075-.06.002-.002.006-.004.117-.111.094-.131.068-.146.04-.156.01-.161-.019-.16-.049-.154-.076-.141-.102-.125-.123-.105-.14-.079-.153-.052-.16-.023-.16.007zm24.596 11.088l-.156.04-.146.067-.131.094-.112.117-.087.135-.061.15-.033.157-.004.134.007.142.005.152.004.15.002.149v.153l.001.011v.015l.004.11.002.11v.002l.002.106v.321l-.003.102-.002.106-.004.107-.005.105-.006.106-.006.106-.008.106v.002l-.008.103v.002l-.01.1-.01.105-.01.105-.013.105-.012.099v.002l-.014.108-.014.1-.016.105-.016.103v.002l-.017.099-.018.104-.019.103v.002l-.019.097-.02.104-.022.103v.001l-.022.098-.023.103v.002l-.024.096-.025.103v.002l-.024.096-.027.102v.003l-.026.093v.001l-.029.103v.002l-.03.099-.028.097v.002l-.03.095-.03.096v.001l-.033.1-.031.095v.002l-.035.1v.003l-.034.094v.003l-.035.096v.001l-.034.09v.002l-.038.098-.036.093v.002l-.038.095-.079.194-.08.188-.085.189-.087.19-.09.184-.092.183-.095.184-.05.093-.064.148-.034.158-.005.16.026.16.054.151.082.14.106.12.127.1.143.075.154.046.16.017.161-.013.156-.042.144-.071.13-.096.109-.119.072-.112.053-.099.003-.005.003-.006.102-.195.003-.006.003-.006.098-.196.003-.006.003-.006.096-.197.002-.006.003-.006.093-.2.002-.006.003-.006.09-.2.002-.006.003-.007.086-.202.003-.006.002-.006.084-.203.002-.005.001-.005.04-.102.002-.003.001-.003.04-.103.001-.003.001-.003.04-.103v-.004l.001-.003.039-.103v-.003l.002-.003.037-.104.001-.003.001-.003.037-.104v-.004l.002-.003.035-.104.002-.003v-.004l.035-.104.002-.004v-.003l.034-.105.002-.003v-.003l.034-.105v-.004l.002-.003.032-.106.001-.003.001-.003.031-.106.001-.003.001-.004.031-.106.001-.003.001-.004.03-.106v-.003l.002-.004.028-.107.001-.003.001-.003.028-.107.001-.004.001-.003.027-.107.001-.004v-.003l.027-.108.001-.003v-.004l.026-.108.001-.003v-.004l.025-.108.001-.003v-.004l.025-.108v-.004l.001-.003.023-.109v-.003l.001-.004.022-.109v-.003l.002-.004.02-.109.001-.004v-.003l.02-.11.002-.003v-.004l.02-.11v-.007l.019-.11v-.003l.001-.004.017-.11v-.004l.001-.003.017-.11v-.008l.016-.11v-.004l.001-.004.015-.11v-.008l.015-.111v-.008l.013-.111v-.007l.013-.112v-.007l.011-.112v-.004l.001-.004.01-.112v-.007l.01-.112v-.008l.008-.112v-.008l.007-.113v-.007l.007-.113v-.008l.005-.113v-.007l.005-.114v-.007l.003-.114v-.007l.003-.114v-.129l.001-.114v-.13l-.003-.114v-.008l-.003-.115v-.007l-.003-.102v-.155l-.003-.158v-.01l-.004-.158v-.01l-.006-.158v-.01l-.007-.148-.023-.16-.051-.152-.08-.14-.103-.124-.125-.102-.142-.077-.153-.05-.16-.02-.161.01zm-30.213.66l-.157.034-.149.063-.134.09-.115.113-.092.132-.067.147-.037.156-.009.134.001.11V15.95l.006.22v.012l.01.22v.012l.012.22v.006l.001.006.015.22v.005l.001.006.018.22.001.006v.006l.022.219v.006l.001.006.024.219.001.006v.006l.028.218.001.006v.006l.031.218.001.006.001.006.033.218.001.006.001.005.037.218v.006l.002.005.04.217v.006l.001.006.043.216.001.006.001.006.046.216v.005l.002.006.048.215.002.006.001.006.051.214.002.006v.006l.055.214.002.005.001.006.057.213.002.006.001.005.06.213.002.005.001.006.063.212.002.005.001.006.066.21.002.006.002.006.068.21.002.005.002.005.07.21.003.005.002.005.074.208.002.006.002.005.077.207.002.006.002.005.08.206.002.005.002.006.082.204.002.006.002.005.086.204.002.005.002.006.088.202.002.005.003.006.09.2.003.006.002.005.094.2.002.006.003.005.096.199.002.005.003.005.03.062.086.137.11.118.128.097.145.07.156.043.16.013.16-.017.155-.047.143-.074.127-.1.106-.121.081-.14.055-.15.025-.16-.005-.161-.034-.158-.05-.124-.028-.055-.092-.19-.087-.188-.087-.192-.083-.19-.08-.193-.078-.194-.076-.196-.073-.195-.07-.197-.067-.198-.065-.199-.063-.2-.059-.2-.056-.2-.055-.204-.05-.201-.049-.202-.046-.205-.043-.206-.04-.203-.038-.207-.034-.204-.032-.207-.028-.205-.026-.207-.023-.208-.02-.207-.018-.207-.014-.208-.011-.207-.009-.208-.005-.207-.002-.104-.017-.16-.046-.155-.074-.143-.1-.126-.121-.107-.139-.081-.152-.055-.159-.025-.161.004zm24.585 11.83l-.156.039-.146.068-.11.076-.015.012-.163.129-.166.127-.168.125-.17.124-.17.12-.172.118-.173.115-.176.114-.177.111-.18.11-.178.105-.182.104-.182.101-.184.1-.184.095-.189.095-.186.09-.188.089-.19.086-.19.082-.193.081-.195.078-.191.074-.197.073-.195.07-.196.065-.198.064-.198.061-.2.058-.2.055-.2.052-.2.049-.151.035-.153.05-.141.078-.125.103-.103.124-.078.14-.05.154-.022.16.009.16.038.157.067.147.093.132.116.112.134.089.149.062.158.034.16.003.133-.02.158-.035.006-.002.006-.001.213-.052.006-.002.007-.001.212-.056.006-.001.006-.002.212-.058.006-.002.006-.002.211-.061.006-.002.006-.002.21-.064.006-.002.006-.002.21-.067.005-.002.006-.002.208-.07.006-.002.006-.003.207-.073.006-.002.006-.002.206-.077.006-.002.005-.002.206-.08.005-.001.006-.003.204-.082.006-.002.005-.002.203-.085.006-.003.005-.002.202-.088.006-.002.005-.003.2-.09.006-.003.006-.003.2-.093.005-.003.005-.002.198-.096.006-.003.005-.003.197-.099.005-.002.005-.003.196-.102.005-.002.005-.003.195-.105.005-.002.005-.003.193-.107.005-.003.005-.003.191-.11.005-.003.005-.003.19-.112.005-.003.005-.003.189-.115.005-.003.005-.003.187-.117.005-.003.004-.004.186-.12.005-.003.004-.003.184-.122.005-.003.005-.004.182-.125.004-.003.005-.003.18-.128.005-.003.005-.003.179-.13.004-.003.005-.004.177-.132.004-.004.005-.003.175-.135.005-.003.004-.004.173-.137.005-.003.004-.004.019-.015.115-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.052-.153-.079-.14-.103-.124-.125-.102-.142-.078-.153-.05-.16-.02-.16.01zm-19.17.054l-.153.051-.14.079-.124.103-.103.125-.077.141-.05.153-.02.16.009.161.04.156.067.147.093.131.095.094.047.04.005.004.005.004.17.14.005.004.005.004.172.137.004.004.005.003.086.067.003.002.003.002.087.067.003.002.003.002.088.066.002.003.003.002.089.065.002.002.003.002.09.065.002.002.003.002.09.064.002.002.003.002.09.063.003.002.003.002.09.063.003.002.003.002.092.062.002.002.003.002.092.061.003.002.003.002.092.06.003.003.003.001.093.06.003.002.003.002.093.06.003.001.003.002.094.058.003.002.003.002.095.058.003.001.003.002.095.057.003.002.003.002.095.056.003.002.003.002.096.055.004.002.003.001.096.055.003.002.003.002.098.053.003.002.003.002.097.053.004.002.003.001.098.053.003.001.003.002.099.052.003.001.003.002.1.05.003.002.003.002.1.05.003.002.003.001.1.05h.003l.004.003.1.048.004.001.003.002.101.048.003.001.004.002.101.046.004.002.003.001.102.046.004.002.003.001.103.045.003.002.003.001.103.045.004.001.003.002.104.043.003.001.004.002.104.042.003.002.004.001.104.042.004.001.003.002.105.04.004.002.003.001.106.04.003.002h.004l.106.04.004.001.003.002.107.038.003.001.004.001.107.038.003.001.004.001.107.037.004.001.004.001.108.036.003.001.004.001.108.035.004.001.003.001.11.034.003.001.004.001.109.033.004.002h.003l.11.033h.004l.003.002.11.031.004.001.004.001.084.023.081.028.004.001.003.001.109.037.003.001.004.001.109.036.003.001.004.001.109.035h.003l.004.002.11.033.003.001.003.001.11.033.003.001.004.001.109.031.004.002h.003l.11.031.003.001.004.001.11.03h.003l.003.001.11.029h.004l.003.002.11.027.003.001.004.001.11.027h.003l.004.001.004.001.16.022.16-.008.157-.038.147-.067.132-.092.112-.116.09-.134.062-.149.034-.157.004-.161-.025-.16-.055-.151-.082-.139-.107-.12-.127-.1-.143-.074-.124-.04h-.003l-.104-.025-.103-.026h-.002l-.095-.026h-.001l-.101-.027h-.002l-.1-.028h-.002l-.103-.03-.104-.032-.097-.03h-.002l-.103-.033-.102-.033-.101-.034-.106-.036-.027-.01-.027-.007-.107-.03-.104-.029-.104-.03h-.002l-.097-.03-.102-.032-.102-.032-.102-.034-.103-.035-.096-.034-.1-.036-.101-.037h-.002l-.094-.036-.096-.037-.097-.04h-.002l-.099-.04-.098-.042h-.002l-.092-.04-.097-.043-.095-.043-.097-.044h-.002l-.09-.043-.094-.045-.094-.046-.093-.047-.09-.046-.096-.05-.088-.047-.002-.001-.09-.049-.094-.052-.002-.002-.087-.049-.087-.05h-.002l-.088-.053h-.001l-.09-.055-.086-.052-.002-.001-.089-.055-.084-.054h-.002l-.09-.059h-.001l-.085-.056-.001-.001-.084-.056-.082-.056h-.001l-.086-.06-.082-.058H7.79l-.086-.062-.002-.002-.08-.058-.081-.06h-.001l-.085-.064-.002-.002-.076-.058-.002-.002-.082-.064-.161-.128-.162-.133-.04-.034-.132-.092-.147-.066-.157-.038-.16-.008-.16.022z",opacity:".98"})),SignalStartEventNonInterrupting:({styles:e={},...t})=>wE("svg",DG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16.007 8.82L9.21 21.022h13.596L16.007 8.82zm0 1.775l5.328 9.563H10.68l5.327-9.563zM16.14.386c-1.571.236-4.195-.284-4.9 1.381.619 1.703 2.745.069 4.085.365 1.421-.13 2.84.2 4.235.259C21.27.784 18.19.344 17 .413a20.456 20.456 0 00-.86-.027zM25 3.162c-2.19.694.401 2.26 1.181 3.094 1.083 1.152 1.954 2.484 2.715 3.864 1.48 1.005 1.845-1.26.81-2.03-1.158-1.897-2.613-3.704-4.513-4.89l-.192-.038zm-18.438.423c-1.793.712-2.909 2.548-4.01 4.061-.773.814-2.211 3.653.005 3.211 1.123-1.469 1.87-3.306 3.267-4.614.664-.7 2.73-2.013.738-2.658zm24.57 11.072c-1.659.435-.468 2.667-.99 3.895a13.427 13.427 0 01-1.497 4.435c-.23 1.659 1.991 1.165 2.018-.199a14.277 14.277 0 001.254-7.552.865.865 0 00-.785-.579zm-30.18.666c-1.677.386-.633 2.667-.608 3.876.371 1.623.792 3.35 1.79 4.696 2.382.321.571-2.338.292-3.492a15.92 15.92 0 01-.684-4.39.877.877 0 00-.79-.69zm24.558 11.81c-1.755.865-3.303 2.266-5.274 2.765-1.162-.016-3.074 1.271-1.331 2.102 2.66-.447 5.163-1.733 7.236-3.445.472-.506.06-1.432-.631-1.421zm-19.151.043c-2.004.786.416 2.405 1.43 2.913 1.608.904 3.379 1.636 5.208 1.877 1.77-.804-.228-2.094-1.357-2.073-1.75-.537-3.403-1.396-4.798-2.586l-.227-.104-.256-.027z"})),TimerStartEventNonInterrupting:({styles:e={},...t})=>wE("svg",BG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.991 8.7c-3.018-.042-5.92 1.925-7.03 4.725-1.138 2.695-.509 6.011 1.537 8.102 1.99 2.142 5.267 2.93 8.013 1.927 2.877-.98 4.99-3.826 5.067-6.87.153-2.956-1.624-5.88-4.299-7.135a7.551 7.551 0 00-3.288-.75zm0 1.383c2.758-.052 5.372 1.972 6.014 4.654.704 2.578-.482 5.516-2.79 6.867-2.358 1.48-5.682 1.085-7.617-.919-2.043-1.97-2.407-5.38-.84-7.743 1.11-1.764 3.149-2.88 5.233-2.86zm1.962 1.764l-2.074 3.762c-.64.068-.793 1.04-.202 1.3.39.27.696-.18 1.052-.165h3.17v-.865h-3.182l1.993-3.614-.757-.418zM16.12.358h-.232l-.22.004h-.012l-.221.006h-.012l-.22.01h-.012l-.22.013h-.012l-.22.016h-.012l-.22.019h-.005l-.006.001-.22.021h-.006l-.005.001-.22.025h-.011l-.22.028h-.005l-.006.002-.219.03h-.005l-.006.001-.218.033-.006.001-.006.001-.217.036-.006.001-.006.001-.217.039-.006.001-.006.001-.216.042-.006.001-.006.001-.215.045-.006.001-.006.002-.215.047-.006.002-.006.001-.214.05-.006.002-.006.002-.115.029-.152.053-.14.081-.122.106-.1.126-.075.143-.047.154-.018.16.012.16.042.156.07.145.095.13.118.11.137.086.15.059.158.03h.161l.132-.022.11-.028.202-.047.203-.046.208-.043.202-.039.206-.037.206-.034.205-.03.208-.03.205-.025.209-.023.208-.02.21-.017.209-.015.207-.011.21-.009.21-.006.207-.003h.21l.21.002.207.005.207.008.212.011.207.014.208.017.209.019.208.022.205.025.206.028.207.03.208.035.205.036.202.039.052.01.16.018.16-.012.156-.042.146-.07.13-.096.109-.119.085-.136.06-.15.03-.159v-.16l-.03-.16-.059-.15-.086-.136L19.823.9l-.13-.096-.145-.07-.128-.038-.057-.011-.006-.002h-.006L19.135.64l-.006-.001-.006-.001-.217-.039H18.9l-.006-.002-.217-.035-.006-.001-.006-.001-.218-.032-.006-.001-.006-.001-.218-.03h-.006l-.006-.001-.219-.027h-.011l-.22-.024-.005-.001h-.006l-.22-.021h-.006L17.512.42l-.22-.017-.005-.001h-.006l-.22-.015h-.012l-.22-.012h-.012l-.22-.01h-.012l-.22-.005h-.012l-.221-.003h-.012zm8.715 2.783l-.157.034-.149.063-.134.089-.116.112-.092.132-.067.147-.038.157-.008.16.021.16.051.153.079.141.103.124.102.087.052.038h.001l.087.064v.001l.082.061.002.001.076.059h.001l.084.065.082.066.002.001.079.063.002.002.077.063.081.067.002.002.077.065.076.065.001.002.08.07.078.07h.002l.075.068.077.072.002.001.073.069.077.073.072.07.002.001.077.076.07.07v.001l.075.076.07.073.002.001.074.079.002.002.069.074.069.075.074.082.07.08.002.001.068.079h.001l.067.079.068.082.065.078.001.002.068.083.067.084.063.081.001.002.067.087.002.002.063.084.001.001.064.087.008.01.008.01.095.12.093.121.09.119.087.119.088.122.086.123.084.12.081.122.001.002.084.126.08.126.08.127.077.126.079.131.074.127.075.131.073.131.07.13.07.133.069.133.045.09.086.137.109.119.13.096.144.07.156.042.16.013.16-.017.155-.047.143-.075.126-.1.106-.121.082-.14.054-.151.025-.16-.005-.16-.035-.158-.05-.124-.048-.095-.002-.004-.002-.004-.073-.14-.002-.005-.002-.004-.074-.14-.002-.004-.002-.004-.076-.14-.002-.003-.002-.004-.077-.139-.003-.004-.002-.004-.078-.138-.003-.004-.002-.003-.08-.137-.002-.004-.003-.004-.081-.136-.002-.004-.003-.004-.083-.136-.002-.003-.002-.004-.085-.135-.002-.004-.003-.003-.085-.134-.003-.004-.002-.004-.087-.132-.003-.004-.003-.004-.088-.132-.003-.003-.002-.004-.09-.13-.003-.005-.003-.003-.091-.13-.003-.004-.002-.004-.093-.129-.003-.003-.003-.004-.094-.128-.003-.004-.003-.003-.095-.127-.003-.004-.003-.004-.097-.125-.003-.004-.003-.004-.09-.114-.06-.082-.003-.003-.002-.003-.069-.091-.002-.004-.002-.003-.07-.09-.003-.003-.002-.003-.07-.09-.003-.003-.002-.003-.071-.09-.002-.003-.003-.002-.072-.089-.002-.003-.002-.003-.073-.088-.002-.003-.002-.002-.074-.087-.002-.003-.002-.003-.074-.086-.003-.003-.002-.003-.074-.086-.003-.002-.002-.003-.075-.085-.003-.003-.002-.002-.076-.084-.002-.003-.003-.003-.076-.083-.002-.003-.003-.003-.077-.082-.002-.003-.003-.002-.077-.082-.003-.003-.003-.002-.078-.081-.002-.003-.003-.003-.078-.08-.003-.002-.003-.003-.079-.08-.002-.002-.003-.002-.08-.08-.002-.002-.003-.002-.08-.078-.003-.003-.003-.002-.08-.077-.003-.003-.003-.002-.082-.077-.002-.002-.003-.002-.082-.076-.003-.002-.002-.003-.083-.075-.003-.002-.002-.003-.084-.074-.002-.002-.003-.002-.084-.074-.003-.002-.002-.002-.085-.073-.002-.002-.003-.003-.085-.071-.003-.003-.002-.002-.086-.07-.003-.003-.002-.002-.086-.07-.003-.003-.003-.002-.086-.07-.003-.002-.003-.002-.087-.069-.002-.002-.003-.002-.088-.068-.002-.002-.003-.002-.088-.067-.003-.003-.003-.002-.088-.066-.003-.002-.003-.002-.089-.066-.003-.002-.003-.002-.057-.042-.14-.082-.15-.055-.16-.026-.16.004zm-18.458.426l-.157.037-.148.066-.111.074-.007.006-.003.002-.003.002-.086.069-.003.002-.002.002-.086.07-.003.002-.002.002-.086.07-.002.003-.003.002-.085.071-.002.002-.003.003-.084.071-.003.003-.002.002-.084.072-.003.003-.002.002-.083.073-.003.003-.002.002-.083.074-.002.002-.003.003-.082.074-.003.003-.002.002-.081.076-.003.002-.003.002-.08.077-.003.002-.003.003-.08.076-.002.003-.003.002-.08.078-.002.002-.003.003-.079.078-.002.003-.003.002-.078.08-.003.002-.002.002-.078.08-.002.003-.003.002-.077.08-.003.004-.002.002-.077.081-.002.003-.003.003-.076.082-.002.002-.003.003-.075.082-.002.003-.003.003-.074.083-.003.003-.002.003-.074.084-.003.003-.002.002-.074.085-.002.003-.002.003-.073.085-.003.003-.002.003-.072.086-.002.003-.003.003-.071.087-.003.003-.002.002-.07.088-.003.003-.002.003-.07.088-.003.003-.002.003-.07.09-.002.002-.002.003-.069.09-.002.003-.003.003-.068.09-.002.003-.002.003-.067.092-.003.003-.002.003-.067.092-.002.003-.002.003-.066.092-.002.003-.002.004-.066.093-.002.003-.002.003-.065.094-.002.003-.002.004-.064.094-.002.003-.002.004-.063.095-.002.003-.002.003-.063.097-.002.003-.002.003-.046.073-.05.07-.003.002-.002.003-.067.093-.003.003-.002.003-.066.094-.002.003-.002.003-.066.094-.002.003-.002.003-.064.094-.002.004-.002.003-.064.094-.002.004-.002.003-.062.095-.002.003-.002.003-.062.096-.002.003-.002.003-.06.096-.003.003-.002.003-.06.096-.001.004-.002.003-.059.096-.002.004-.002.003-.058.097-.002.003-.001.003-.057.098-.002.003-.002.003-.056.098-.002.003-.002.003-.055.098-.002.004-.001.003-.055.098-.001.004-.002.003-.054.099-.001.003-.002.003-.052.1-.002.002-.002.004-.051.1-.002.002-.002.004-.05.1-.002.003-.002.003-.05.1v.003l-.002.004-.05.1V9.5l-.002.004-.048.1-.002.004-.001.003-.047.101-.002.003-.001.004-.013.027-.052.152-.024.16.006.16.037.157.064.148.091.133.114.114.134.09.147.065.157.036.162.006.159-.024.152-.053.14-.08.122-.105.1-.126.066-.117.01-.023.044-.095.045-.095.002-.003.042-.087.048-.097.048-.095v-.001l.048-.092.001-.001.047-.09.05-.093.002-.002.049-.09.052-.092.001-.002.051-.089.001-.002.051-.087.053-.088.001-.002.055-.091.057-.091.057-.09.001-.002.057-.089.055-.083.001-.002.06-.09.06-.088.062-.089.001-.001.06-.084.063-.088.065-.089.017-.023.016-.025.06-.094.059-.09v-.002l.058-.086.057-.086.001-.001.062-.09.062-.088.001-.002.06-.085.002-.002.06-.082.063-.087.064-.084.002-.002.061-.08.065-.084.064-.08v-.001l.067-.083.067-.082.07-.083.069-.08.063-.074.074-.083.068-.077.002-.002.07-.076.07-.075.072-.077.001-.001.067-.07.076-.078.002-.002.07-.07.075-.075.002-.002.072-.07.075-.072.002-.002.073-.069.074-.068.001-.001.08-.073.076-.068.002-.002.072-.063v-.001l.078-.067.079-.068.002-.001.08-.068.002-.002.077-.063.082-.066.001-.001.075-.06.002-.002.006-.004.117-.111.094-.131.068-.146.04-.156.01-.161-.019-.16-.049-.154-.076-.141-.102-.125-.123-.105-.14-.079-.153-.052-.16-.023-.16.007zm24.596 11.088l-.156.04-.146.067-.131.094-.112.117-.087.135-.061.15-.033.157-.004.134.007.142.005.152.004.15.002.149v.153l.001.011v.015l.004.11.002.11v.002l.002.106v.321l-.003.102-.002.106-.004.107-.005.105-.006.106-.006.106-.008.106v.002l-.008.103v.002l-.01.1-.01.105-.01.105-.013.105-.012.099v.002l-.014.108-.014.1-.016.105-.016.103v.002l-.017.099-.018.104-.019.103v.002l-.019.097-.02.104-.022.103v.001l-.022.098-.023.103v.002l-.024.096-.025.103v.002l-.024.096-.027.102v.003l-.026.093v.001l-.029.103v.002l-.03.099-.028.097v.002l-.03.095-.03.096v.001l-.033.1-.031.095v.002l-.035.1v.003l-.034.094v.003l-.035.096v.001l-.034.09v.002l-.038.098-.036.093v.002l-.038.095-.079.194-.08.188-.085.189-.087.19-.09.184-.092.183-.095.184-.05.093-.064.148-.034.158-.005.16.026.16.054.151.082.14.106.12.127.1.143.075.154.046.16.017.161-.013.156-.042.144-.071.13-.096.109-.119.072-.112.053-.099.003-.005.003-.006.102-.195.003-.006.003-.006.098-.196.003-.006.003-.006.096-.197.002-.006.003-.006.093-.2.002-.006.003-.006.09-.2.002-.006.003-.007.086-.202.003-.006.002-.006.084-.203.002-.005.001-.005.04-.102.002-.003.001-.003.04-.103.001-.003.001-.003.04-.103v-.004l.001-.003.039-.103v-.003l.002-.003.037-.104.001-.003.001-.003.037-.104v-.004l.002-.003.035-.104.002-.003v-.004l.035-.104.002-.004v-.003l.034-.105.002-.003v-.003l.034-.105v-.004l.002-.003.032-.106.001-.003.001-.003.031-.106.001-.003.001-.004.031-.106.001-.003.001-.004.03-.106v-.003l.002-.004.028-.107.001-.003.001-.003.028-.107.001-.004.001-.003.027-.107.001-.004v-.003l.027-.108.001-.003v-.004l.026-.108.001-.003v-.004l.025-.108.001-.003v-.004l.025-.108v-.004l.001-.003.023-.109v-.003l.001-.004.022-.109v-.003l.002-.004.02-.109.001-.004v-.003l.02-.11.002-.003v-.004l.02-.11v-.007l.019-.11v-.003l.001-.004.017-.11v-.004l.001-.003.017-.11v-.008l.016-.11v-.004l.001-.004.015-.11v-.008l.015-.111v-.008l.013-.111v-.007l.013-.112v-.007l.011-.112v-.004l.001-.004.01-.112v-.007l.01-.112v-.008l.008-.112v-.008l.007-.113v-.007l.007-.113v-.008l.005-.113v-.007l.005-.114v-.007l.003-.114v-.007l.003-.114v-.129l.001-.114v-.13l-.003-.114V16.5l-.003-.115v-.007l-.003-.102v-.155l-.003-.158v-.01l-.004-.158v-.01l-.006-.158v-.01l-.007-.148-.023-.16-.051-.152-.08-.14-.103-.124-.125-.102-.142-.077-.153-.05-.16-.02-.161.01zm-30.213.66l-.157.034-.149.063-.134.09-.115.113-.092.132-.067.147-.037.156-.009.134.001.11V16.308l.006.22v.012l.01.22v.012l.012.22v.006l.001.006.015.22v.005l.001.006.018.22.001.006v.006l.022.219v.006l.001.006.024.219.001.006v.006l.028.218.001.006v.006l.031.218.001.006.001.006.033.218.001.006.001.005.037.218v.006l.002.005.04.217v.006l.001.006.043.216.001.006.001.006.046.216v.005l.002.006.048.215.002.006.001.006.051.214.002.006v.006l.055.214.002.005.001.006.057.213.002.006.001.005.06.213.002.005.001.006.063.212.002.005.001.006.066.21.002.006.002.006.068.21.002.005.002.005.07.21.003.005.002.005.074.208.002.006.002.005.077.207.002.006.002.005.08.206.002.005.002.006.082.204.002.006.002.005.086.204.002.005.002.006.088.202.002.005.003.006.09.2.003.006.002.005.094.2.002.006.003.005.096.199.002.005.003.005.03.062.086.137.11.118.128.097.145.07.156.043.16.013.16-.017.155-.047.143-.074.127-.1.106-.121.081-.14.055-.15.025-.16-.005-.161-.034-.158-.05-.124-.028-.055-.092-.19-.087-.188-.087-.192-.083-.19-.08-.193-.078-.194-.076-.196-.073-.195-.07-.197-.067-.198-.065-.199-.063-.2-.059-.2-.056-.2-.055-.204-.05-.201-.049-.202-.046-.205-.043-.206-.04-.203-.038-.207-.034-.204-.032-.207-.028-.205-.026-.207-.023-.208-.02-.207-.018-.207-.014-.208-.011-.207-.009-.208-.005-.207-.002-.104-.017-.16-.046-.155-.074-.143-.1-.126-.121-.107-.139-.081-.152-.055-.159-.025-.161.004zm24.585 11.83l-.156.039-.146.068-.11.076-.015.012-.163.129-.166.127-.168.125-.17.124-.17.12-.172.118-.173.115-.176.114-.177.111-.18.11-.178.105-.182.104-.182.101-.184.1-.184.095-.189.095-.186.09-.188.089-.19.086-.19.082-.193.081-.195.078-.191.074-.197.073-.195.07-.196.065-.198.064-.198.061-.2.058-.2.055-.2.052-.2.049-.151.035-.153.05-.141.078-.125.103-.103.124-.078.14-.05.154-.022.16.009.16.038.157.067.147.093.132.116.112.134.089.149.062.158.034.16.003.133-.02.158-.035.006-.002.006-.001.213-.052.006-.002.007-.001.212-.056.006-.001.006-.002.212-.058.006-.002.006-.002.211-.061.006-.002.006-.002.21-.064.006-.002.006-.002.21-.067.005-.002.006-.002.208-.07.006-.002.006-.003.207-.073.006-.002.006-.002.206-.077.006-.002.005-.002.206-.08.005-.001.006-.003.204-.082.006-.002.005-.002.203-.085.006-.003.005-.002.202-.088.006-.002.005-.003.2-.09.006-.003.006-.003.2-.093.005-.003.005-.002.198-.096.006-.003.005-.003.197-.099.005-.002.005-.003.196-.102.005-.002.005-.003.195-.105.005-.002.005-.003.193-.107.005-.003.005-.003.191-.11.005-.003.005-.003.19-.112.005-.003.005-.003.189-.115.005-.003.005-.003.187-.117.005-.003.004-.004.186-.12.005-.003.004-.003.184-.122.005-.003.005-.004.182-.125.004-.003.005-.003.18-.128.005-.003.005-.003.179-.13.004-.003.005-.004.177-.132.004-.004.005-.003.175-.135.005-.003.004-.004.173-.137.005-.003.004-.004.019-.015.115-.113.092-.132.066-.147.038-.157.008-.16-.022-.16-.052-.153-.079-.14-.103-.124-.125-.102-.142-.078-.153-.05-.16-.02-.16.01zm-19.17.054l-.153.051-.14.079-.124.103-.103.125-.077.141-.05.153-.02.16.009.161.04.156.067.147.093.131.095.094.047.04.005.004.005.004.17.14.005.004.005.004.172.137.004.004.005.003.086.067.003.002.003.002.087.067.003.002.003.002.088.066.002.003.003.002.089.065.002.002.003.002.09.065.002.002.003.002.09.064.002.002.003.002.09.063.003.002.003.002.09.063.003.002.003.002.092.062.002.002.003.002.092.061.003.002.003.002.092.06.003.003.003.001.093.06.003.002.003.002.093.06.003.001.003.002.094.058.003.002.003.002.095.058.003.001.003.002.095.057.003.002.003.002.095.056.003.002.003.002.096.055.004.002.003.001.096.055.003.002.003.002.098.053.003.002.003.002.097.053.004.002.003.001.098.053.003.001.003.002.099.052.003.001.003.002.1.05.003.002.003.002.1.05.003.002.003.001.1.05h.003l.004.003.1.048.004.001.003.002.101.048.003.001.004.002.101.046.004.002.003.001.102.046.004.002.003.001.103.045.003.002.003.001.103.045.004.001.003.002.104.043.003.001.004.002.104.042.003.002.004.001.104.042.004.001.003.002.105.04.004.002.003.001.106.04.003.002h.004l.106.04.004.001.003.002.107.038.003.001.004.001.107.038.003.001.004.001.107.037.004.001.004.001.108.036.003.001.004.001.108.035.004.001.003.001.11.034.003.001.004.001.109.033.004.002h.003l.11.033h.004l.003.002.11.031.004.001.004.001.084.023.081.028.004.001.003.001.109.037.003.001.004.001.109.036.003.001.004.001.109.035h.003l.004.002.11.033.003.001.003.001.11.033.003.001.004.001.109.031.004.002h.003l.11.031.003.001.004.001.11.03h.003l.003.001.11.029h.004l.003.002.11.027.003.001.004.001.11.027h.003l.004.001.004.001.16.022.16-.008.157-.038.147-.067.132-.092.112-.116.09-.134.062-.149.034-.157.004-.161-.025-.16-.055-.151-.082-.139-.107-.12-.127-.1-.143-.074-.124-.04h-.003l-.104-.025-.103-.026h-.002l-.095-.026h-.001l-.101-.027h-.002l-.1-.028h-.002l-.103-.03-.104-.032-.097-.03h-.002l-.103-.033-.102-.033-.101-.034-.106-.036-.027-.01-.027-.007-.107-.03-.104-.029-.104-.03h-.002l-.097-.03-.102-.032-.102-.032-.102-.034-.103-.035-.096-.034-.1-.036-.101-.037h-.002l-.094-.036-.096-.037-.097-.04h-.002l-.099-.04-.098-.042h-.002l-.092-.04-.097-.043-.095-.043-.097-.044h-.002l-.09-.043-.094-.045-.094-.046-.093-.047-.09-.046-.096-.05-.088-.047-.002-.001-.09-.049-.094-.052-.002-.002-.087-.049-.087-.05h-.002l-.088-.053h-.001l-.09-.055-.086-.052-.002-.001-.089-.055-.084-.054h-.002l-.09-.059h-.001l-.085-.056-.001-.001-.084-.056-.082-.056h-.001l-.086-.06-.082-.058H7.79l-.086-.062-.002-.002-.08-.058-.081-.06h-.001l-.085-.064-.002-.002-.076-.058-.002-.002-.082-.064-.161-.128-.162-.133-.04-.034-.132-.092-.147-.066-.157-.038-.16-.008-.16.022z"})),CancelBoundaryEvent:kX,CompensateBoundaryEvent:CX,ConditionalBoundaryEvent:AX,ErrorBoundaryEvent:RX,EscalationBoundaryEvent:$X,LinkBoundaryEvent:BX,MessageBoundaryEvent:IX,MultipleBoundaryEvent:zX,BoundaryEvent:aG,ConditionalBoundaryEventNonInterrupting:VX,EscalationBoundaryEventNonInterrupting:qX,MessageBoundaryEventNonInterrupting:WX,MultipleBoundaryEventNonInterrupting:XX,ParallelBoundaryEventNonInterrupting:UX,SignalBoundaryEventNonInterrupting:KX,TimerBoundaryEventNonInterrupting:JX,ParallelMultipleBoundaryEvent:tG,SignalBoundaryEvent:iG,TimerBoundaryEvent:oG,StartEvent:({styles:e={},...t})=>wE("svg",LG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.847.004C9.61-.016 3.624 4.014 1.257 9.78-1.235 15.49.06 22.581 4.42 27.034c4.193 4.513 11.101 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.268.403-6.228-3.26-12.441-8.87-15.154A15.924 15.924 0 0015.846.004zm.439 1.729c6.105.033 11.856 4.45 13.435 10.359 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.625-4.814-3.84-6.538-10.94-4.067-16.57 2.14-5.206 7.515-8.775 13.147-8.71.097-.001.194-.002.29-.001z"})),ParallelMultipleStartEvent:({styles:e={},...t})=>wE("svg",IG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.847 0C9.61-.02 3.624 4.01 1.257 9.775-1.235 15.485.06 22.577 4.42 27.03c4.193 4.513 11.101 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.268.403-6.228-3.26-12.441-8.87-15.154A15.924 15.924 0 0015.846 0zm.439 1.729c6.105.033 11.856 4.45 13.435 10.359 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.625C2.101 23.17.377 16.07 2.848 10.44c2.134-5.2 7.522-8.78 13.147-8.71.097-.001.194-.002.29-.001zM13.504 9.08v4.427H9.077v4.98h4.427v4.427h4.98v-4.427h4.428v-4.98h-4.427V9.08h-4.98zm.83.83h3.32v4.427h4.428v3.32h-4.427v4.427h-3.32v-4.453H9.906v-3.294h4.427V9.91z"})),SignalStartEvent:({styles:e={},...t})=>wE("svg",NG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M15.995.005C9.705-.08 3.643 3.968 1.257 9.78-1.235 15.49.06 22.581 4.42 27.034c4.193 4.513 11.102 6.17 16.887 4.058 5.996-2.042 10.423-7.93 10.664-14.269.403-6.227-3.26-12.44-8.87-15.153A15.924 15.924 0 0015.994.005zm0 1.73c6.213-.108 12.122 4.355 13.726 10.357 1.678 5.653-.592 12.198-5.463 15.547-5.06 3.719-12.564 3.45-17.343-.626-4.814-3.838-6.538-10.939-4.067-16.57 2.14-5.205 7.515-8.774 13.147-8.708zm0 6.776L9.19 20.724H22.8L15.995 8.511zm0 1.777l5.332 9.572H10.662l5.333-9.572z"})),TimerStartEvent:({styles:e={},...t})=>wE("svg",zG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M16 0C7.174 0 0 7.174 0 16s7.174 16 16 16 16-7.174 16-16S24.826 0 16 0zm0 1.73c7.892 0 14.27 6.378 14.27 14.27 0 7.891-6.379 14.27-14.27 14.27S1.73 23.891 1.73 16C1.73 8.108 8.108 1.73 16 1.73zm-.143 6.676c-2.967.02-5.797 1.97-6.89 4.727-1.138 2.695-.51 6.012 1.537 8.102 1.99 2.142 5.268 2.932 8.014 1.928 2.878-.98 4.992-3.827 5.068-6.87.153-2.957-1.624-5.881-4.3-7.137a7.552 7.552 0 00-3.43-.75zm.27 1.383c2.71.012 5.254 2.015 5.886 4.656.704 2.577-.482 5.517-2.791 6.867-2.358 1.48-5.682 1.085-7.618-.918-2.043-1.971-2.407-5.381-.84-7.745 1.11-1.763 3.15-2.88 5.234-2.86h.13zm1.833 1.765l-2.074 3.763c-.64.068-.793 1.04-.202 1.3.39.27.696-.18 1.052-.165h3.17v-.865h-3.181l1.992-3.615-.757-.418z"})),CollapsedSubProcess:VG,CollapsedAdHocSubProcess:VG,ExpandedSubProcess:qG,ExpandedAdHocSubProcess:qG,Task:({styles:e={},...t})=>wE("svg",HG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M6.494 2.667C2.916 2.667 0 5.57 0 9.142v13.383C0 26.097 2.916 29 6.494 29h19.012C29.084 29 32 26.097 32 22.525V9.142c0-3.572-2.916-6.475-6.494-6.475H6.494zm0 2h19.012c2.509 0 4.494 1.98 4.494 4.475v13.383C30 25.02 28.015 27 25.506 27H6.494C3.985 27 2 25.02 2 22.525V9.142c0-2.495 1.985-4.475 4.494-4.475z"})),TextAnnotation:({styles:e={},...t})=>wE("svg",WG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M22.087 0v31.647H32v-1.788h-8.125V1.788H32V0h-9.913zm-2.924 13.999l-2.737 2.167 2.167 2.738 2.738-2.167-2.168-2.738zm-5.475 4.335L10.95 20.5l2.168 2.738 2.737-2.168-2.167-2.737zm-5.475 4.335l-2.738 2.167 2.168 2.738 2.737-2.168-2.167-2.737zm-5.476 4.335L0 29.17l2.167 2.738 2.738-2.168-2.168-2.737z"})),Transaction:({styles:e={},...t})=>wE("svg",QG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{d:"M5.422 3A5.424 5.424 0 000 8.422v15.822a5.424 5.424 0 005.422 5.423h21.156A5.424 5.424 0 0032 24.244V8.422A5.424 5.424 0 0026.578 3H5.422zm0 1.244h21.156a4.155 4.155 0 014.178 4.178v15.822a4.155 4.155 0 01-4.178 4.178H5.422a4.155 4.155 0 01-4.178-4.178V8.422a4.155 4.155 0 014.178-4.178zm1.056 1.778a3.373 3.373 0 00-3.367 3.366v13.89a3.373 3.373 0 003.367 3.366h19.044a3.373 3.373 0 003.367-3.366V9.388a3.373 3.373 0 00-3.367-3.366H6.478zm0 1.245h19.044c1.187 0 2.122.935 2.122 2.121v13.89a2.104 2.104 0 01-2.122 2.122H6.478a2.104 2.104 0 01-2.122-2.122V9.388c0-1.186.935-2.121 2.122-2.121z"})),UserTask:({styles:e={},...t})=>wE("svg",XG({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32"},t),wE("path",{fillRule:"evenodd",d:"M10.263 7.468c-1.698 0-2.912 1.305-2.915 2.791v.001c0 .45.121.924.311 1.352.138.309.308.593.516.82-1.235.423-2.683 1.119-3.414 2.49l-.04.075v4.44h11.083v-4.44l-.04-.074c-.72-1.352-2.136-2.047-3.36-2.471.597-.608.774-1.392.774-2.192-.004-1.487-1.218-2.792-2.915-2.792zm-1.16 1.583c.08 0 .165.003.26.008.757.045 1.012.181 1.207.31.196.13.334.252.851.268.404-.016.598-.087.737-.169.056-.033.103-.067.152-.1.128.275.197.578.198.893 0 .894-.154 1.52-.975 2.034l.08.604c.171.052.348.11.527.171.025.105.054.242.073.387.02.153.029.311.016.43a.422.422 0 01-.056.19c-.417.417-1.157.66-1.908.66-.75 0-1.49-.243-1.908-.66a.422.422 0 01-.056-.19 1.949 1.949 0 01.016-.43c.02-.146.049-.284.074-.388.177-.062.352-.118.521-.17l.048-.648a.616.616 0 00-.126-.118c-.183-.138-.405-.44-.562-.793-.157-.353-.254-.757-.254-1.08 0-.387.105-.758.297-1.079l.11-.04c.143-.046.339-.09.679-.09zm-1.448 4.304l-.002.014c-.025.185-.04.387-.018.589.021.202.074.42.248.593.595.594 1.494.857 2.382.857.889 0 1.788-.263 2.382-.857.174-.174.227-.391.249-.593a2.496 2.496 0 00-.018-.59l-.002-.01c.903.396 1.776.963 2.258 1.81v3.599H13.53v-2.538h-.67v2.538H7.651v-2.538h-.67v2.538H5.39v-3.599c.483-.849 1.359-1.416 2.264-1.813zM6.495 3C2.914 3 0 5.903 0 9.475v13.383c0 3.572 2.916 6.475 6.494 6.475h19.012c3.578 0 6.494-2.903 6.494-6.475V9.475C32 5.903 29.084 3 25.506 3H6.494zm0 2h19.01C28.016 5 30 6.98 30 9.475v13.383c0 2.495-1.985 4.475-4.494 4.475H6.494C3.985 27.333 2 25.353 2 22.858V9.475C2 6.98 3.985 5 6.494 5z"}))};function UG(e){const{type:t}=e;let n=KG(t);const i=function(e){const t=br(e),n=t.eventDefinitions;return n&&n[0]}(e);if(i)return n=`${function(e){const t=KG(e.$type);return t.replace("EventDefinition","")}(i)}${n}`,(vr(e,"bpmn:StartEvent")&&!jr(e)||vr(e,"bpmn:BoundaryEvent")&&!function(e){const t=br(e);return t&&!1!==t.cancelActivity}(e))&&(n=`${n}NonInterrupting`),n;if(vr(e,"bpmn:SubProcess")&&!vr(e,"bpmn:Transaction"))if(Vr(e))n=`Event${n}`;else{const t=Nr(e)&&!function(e){const t=e&&(e.di||br(e).di);return vr(t,"bpmndi:BPMNPlane")}(e);n=`${t?"Expanded":"Collapsed"}${n}`}return function(e){const t=br(e),n=br(e.source);if(!vr(e,"bpmn:SequenceFlow")||!n)return!1;return n.default&&n.default===t&&(vr(n,"bpmn:Gateway")||vr(n,"bpmn:Activity"))}(e)&&(n="DefaultFlow"),function(e){const t=br(e),n=br(e.source);if(!vr(e,"bpmn:SequenceFlow")||!n)return!1;return t.conditionExpression&&vr(n,"bpmn:Activity")}(e)&&(n="ConditionalFlow"),n}const YG=e=>(e||(e=e=>e),{getDocumentationRef:e=>{const t=ZG();if(t)return function(e,t){const n=JG(e,t);return n&&n.documentationRef}(e,t)},getElementLabel:e=>vr(e,"bpmn:Process")?br(e).name:Ur(e),getElementIcon:e=>{const t=UG(e),n=QQ("config.elementTemplateIconRenderer",!1),{iconProperty:i="zeebe:modelerTemplateIcon"}=n||{},r=br(e).get(i);return r?()=>_E("img",{class:"bio-properties-panel-header-template-icon",width:"32",height:"32",src:r,alt:""}):GG[t]},getTypeLabel:t=>{const n=ZG();if(n){const i=JG(t,n);if(i&&i.name)return e(i.name)}const i=UG(t);return e(i.replace(/(\B[A-Z])/g," $1").replace(/(\bNon Interrupting)/g,"($1)"))}});function KG(e){return e.split(":")[1]}function ZG(){return QQ("elementTemplates",!1)}function JG(e,t){return t.get(e)}function eU(){return eU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},eU.apply(null,arguments)}var tU=({styles:e={},...t})=>wE("svg",eU({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"64",height:"64"},t),wE("defs",null,wE("rect",{id:"a",width:"57",height:"47",x:"3",y:"8",rx:"7"}),wE("mask",{id:"b",width:"57",height:"47",x:"0",y:"0",fill:"#fff",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox"},wE("use",{xlinkHref:"#a"}))),wE("g",{fill:"none",fillRule:"evenodd"},wE("path",{fill:"#818798",d:"M52 11a5 5 0 015 5v31a5 5 0 01-5 5H11a5 5 0 01-5-5V16a5 5 0 015-5h41zm0 2H11a3 3 0 00-2.995 2.824L8 16v31a3 3 0 002.824 2.995L11 50h41a3 3 0 002.995-2.824L55 47V16a3 3 0 00-2.824-2.995L52 13z"}),wE("path",{fill:"#D5D7DD",d:"M16 24h31v6H16zM21 33h21v6H21z"}),wE("use",{stroke:"#B9BCC6",strokeDasharray:"5 2",strokeWidth:"2",mask:"url(#b)",xlinkHref:"#a"})));function nU(){return nU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},nU.apply(null,arguments)}var iU=({styles:e={},...t})=>wE("svg",nU({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"128",height:"64"},t),wE("defs",null,wE("path",{id:"a",d:"M9 9h110v47H9z"}),wE("mask",{id:"b",width:"110",height:"47",x:"0",y:"0",fill:"#fff",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox"},wE("use",{xlinkHref:"#a"}))),wE("g",{fill:"none",fillRule:"evenodd"},wE("path",{fill:"#818798",d:"M25 20.272L37.728 33 25 45.728 12.272 33 25 20.272zm0 2.829L15.1 33l9.9 9.9 9.9-9.9-9.9-9.9z"}),wE("path",{fill:"#D5D7DD",d:"M17 47h16v6H17z"}),wE("path",{fill:"#818798",d:"M35 32h27v2H35z"}),wE("path",{fill:"#818798",d:"M60 30v6l6-3z"}),wE("path",{fill:"#D5D7DD",d:"M80 34h21v6H80z"}),wE("g",null,wE("path",{fill:"#818798",d:"M111 12a5 5 0 015 5v31a5 5 0 01-5 5H70a5 5 0 01-5-5V17a5 5 0 015-5h41zm0 2H70a3 3 0 00-3 3v31a3 3 0 003 3h41a3 3 0 003-3V17a3 3 0 00-3-3z"}),wE("path",{fill:"#D5D7DD",d:"M75 25h31v6H75z"})),wE("use",{stroke:"#B9BCC6",strokeDasharray:"5 2",strokeWidth:"2",mask:"url(#b)",xlinkHref:"#a"})));const rU=e=>(e||(e=e=>e),{getEmpty:()=>({text:e("Select an element to edit its properties."),icon:tU}),getMultiple:()=>({text:e("Multiple elements are selected. Select a single element to edit its properties."),icon:iU})}),oU={parserDialect:"camunda"};function sU(e){const{element:t,injector:n,getProviders:i,layoutConfig:r,descriptionConfig:o,tooltipConfig:s,feelPopupContainer:a,getFeelPopupLinks:l,feelLanguageContext:c,headerParent:u}=e,p=n.get("eventBus"),h=n.get("translate"),f={selectedElement:t,injector:n,getService:(e,t)=>n.get(e,t)},m=i(t),g=B_(()=>k(m,function(e,n){if(d(t))return[];return n.getGroups(t)(e)},[]),[m,t]),v=L_(e=>{p.fire("propertiesPanel.layoutChanged",{layout:e})},[p]),y=!!u,b=y&&t&&!d(t),w=YG(h),x=B_(()=>({...oU,...c}),[c]);return _E(WQ.Provider,{value:f,children:_E(ZH.Provider,{value:x,children:[_E(MW,{element:t,headerProvider:y?null:w,placeholderProvider:rU(h),groups:g,layoutConfig:r,layoutChanged:v,descriptionConfig:o,descriptionLoaded:e=>{p.fire("propertiesPanel.descriptionLoaded",{description:e})},tooltipConfig:s,tooltipLoaded:e=>{p.fire("propertiesPanel.tooltipLoaded",{tooltip:e})},feelPopupContainer:a,getFeelPopupLinks:l,eventBus:p}),b?aE(_E(XH,{element:t,headerProvider:w}),u):null]})})}class aU{constructor(e,t,n){const{parent:i,layout:r,description:o,tooltip:s,feelPopupContainer:a,getFeelPopupLinks:l,feelLanguageContext:c}=e||{};this._eventBus=n,this._injector=t,this._layoutConfig=r,this._descriptionConfig=o,this._tooltipConfig=s,this._feelPopupContainer=a,this._getFeelPopupLinks=l,this._feelLanguageContext=c,this._container=Y('<div style="height: 100%" tabindex="-1" class="bio-properties-panel-container"></div>'),this._headerContainer=Y('<div style="flex: none; height: auto" class="bio-properties-panel bio-theme-parent bio-properties-panel-header-container"></div>'),this._separateHeader=!1,this._element=null,this._listeners=[],this._root=null,this._setRoot=e=>{this._root=e},this._getPanelProps=this._getPanelProps.bind(this);var u=t.get("commandStack",!1);u&&function(e,t,n){function i(e){e.preventDefault(),e.stopPropagation()}function r(e){return Hs(e)?(n.undo(),i(e)):Ws(e)?(n.redo(),i(e)):void 0}t.on("keyboard.bind",function(){ce.bind(e,"keydown",r)}),t.on("keyboard.unbind",function(){ce.unbind(e,"keydown",r)})}(this._container,n,u),n.on("diagram.init",()=>{i&&this.attachTo(i)}),n.on("diagram.destroy",()=>{this.detach()}),this._on("root.added",e=>{const{element:t}=e;this._render(this._element||t)}),this._on("selection.changed",e=>{const{newSelection:t=[]}=e;if(t.length>1)return this._update(t);const n=t[0],i=this._injector.get("canvas").getRootElement();cU(i)||this._update(n||i)}),this._on("elements.changed",e=>{const{elements:t}=e,n=this._injector.get("elementRegistry"),i=w(t,e=>e===this._element);i&&n.get(i.id)&&this._update(i)}),this._on("import.done",()=>{const e=this._injector.get("canvas").getRootElement();cU(e)||this._update(e)}),this._on(["propertiesPanel.providersChanged","elementTemplates.changed"],()=>{this._update(this._element)}),this._on("propertiesPanel.setLayout",e=>{const{layout:t}=e;this._layoutConfig=t,this._scheduleRender()})}attachTo(e,t){if(!e)throw new Error("container required");if(e=uU(e),t&&!(t=uU(t)))throw new Error("header container not found");const n=!!t,i=n!==this._separateHeader;this.detach(),e.appendChild(this._container),this._separateHeader=n,t&&t.appendChild(this._headerContainer),i&&this._rerender(),this._eventBus.fire("propertiesPanel.attach")}detach(){const e=this._container.parentNode;e&&(e.removeChild(this._container),this._eventBus.fire("propertiesPanel.detach"));const t=this._headerContainer.parentNode;t&&t.removeChild(this._headerContainer)}registerProvider(e,t){t||(t=e,e=1e3),"function"==typeof t.getGroups?(this._eventBus.on("propertiesPanel.getProviders",e,function(e){e.providers.push(t)}),this._eventBus.fire("propertiesPanel.providersChanged")):console.error("Properties provider does not implement #getGroups(element) API")}setLayout(e){this._eventBus.fire("propertiesPanel.setLayout",{layout:e})}setFeelLanguageContext(e){this._feelLanguageContext=e,this._rerender()}getEntryId(e,t){const n=this._getProviders().slice().reverse();for(const i of n){if("function"!=typeof i.getEntryId)continue;const n=i.getEntryId(e,t);if(n)return n}return null}_getProviders(){const e=this._eventBus.createEvent({type:"propertiesPanel.getProviders",providers:[]});return this._eventBus.fire(e),e.providers}_render(e=this._element){const t=this._injector.get("canvas");e||(e=t.getRootElement()),cU(e)||(this._element=e,d_(_E(lU,{ref:this._setRoot,getProps:this._getPanelProps}),this._container),this._eventBus.fire("propertiesPanel.rendered"))}_rerender(){const e=this._injector.get("canvas").getRootElement();e&&!cU(e)&&this._render()}_update(e){e&&("label"===e.type&&(e=e.labelTarget),this._element=e,this._scheduleRender(),this._eventBus.fire("propertiesPanel.updated",{element:e}))}_scheduleRender(){this._root&&this._root.forceUpdate()}_getPanelProps(){return{element:this._element,injector:this._injector,getProviders:this._getProviders.bind(this),layoutConfig:this._layoutConfig,descriptionConfig:this._descriptionConfig,tooltipConfig:this._tooltipConfig,feelPopupContainer:this._feelPopupContainer,getFeelPopupLinks:this._getFeelPopupLinks,feelLanguageContext:this._feelLanguageContext,headerParent:this._separateHeader?this._headerContainer:null}}_on(e,t){this._eventBus.on(e,t),this._listeners.push({events:e,callback:t})}_destroy(){this._listeners.forEach(({events:e,callback:t})=>{this._eventBus.off(e,t)}),this._listeners=[],this._element=null,this._container&&(d_(null,this._container),this._eventBus.fire("propertiesPanel.destroyed"))}}aU.$inject=["config.propertiesPanel","injector","eventBus"];class lU extends Qx{render(){const{getProps:e}=this.props;return _E(sU,{...e()})}}function cU(e){return e&&e.isImplicit}function uU(e){return e.get&&e.constructor.prototype.jquery?e.get(0):"string"==typeof e?de(e):e}class pU{constructor(e){this._commandStack=e}preExecute(e){const t=this._commandStack;E(e,function(e){t.execute(e.cmd,e.context)})}}pU.$inject=["commandStack"];const hU={"properties-panel.multi-command-executor":pU};function dU(e,t){e.on("diagram.init",function(){E(hU,function(e,n){t.registerHandler(n,e)})})}dU.$inject=["eventBus","commandStack"];var fU={__depends__:[{__init__:[dU]},_Q,HQ],__init__:["propertiesPanel"],propertiesPanel:["type",aU]};function mU(e,t,n,i){const r=i.create(e,t);return n&&(r.$parent=n),r}function gU(e){return new s([32,32,1]).nextPrefixed(e)}function vU(e){let t=e;for(;t.$parent;)t=t.$parent;return t}function yU(e,t){const n=vU(e);return i=n.get("rootElements"),r=t,(i||[]).filter(e=>vr(e,r));var i,r}function bU(e,t,n){return yU(e,t).find(e=>e.id===n)}function wU(e,t,n,i,r,o){return o.execute("element.updateModdleProperties",function(e,t,n,i,r){const o={};if(!i)return o[n]=void 0,{element:e,moddleElement:t,properties:o};const s=t.get(n);if(s)return{element:e,moddleElement:s,properties:{body:i}};return o[n]=mU("bpmn:FormalExpression",{body:i},t,r),{element:e,moddleElement:t,properties:o}}(e,t,n,i,r))}function xU(e){const{element:t}=e;return vr(t,"bpmn:AdHocSubProcess")?[{id:"completionCondition",component:_U,isEdited:bQ},{id:"cancelRemainingInstances",component:EU,isEdited:e=>e&&!e.checked}]:[]}function _U(e){const{element:t}=e,n=QQ("bpmnFactory"),i=QQ("debounceInput"),r=QQ("commandStack"),o=QQ("translate");return yQ({element:t,id:"completionCondition",label:o("Completion condition"),getValue:()=>{const e=br(t).get("completionCondition");return e&&e.get("body")},setValue:e=>wU(t,br(t),"completionCondition",e,n,r),debounce:i})}function EU(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=br(t);return XW({element:t,id:"cancelRemainingInstances",label:i("Cancel remaining instances"),getValue:()=>r.get("cancelRemainingInstances"),setValue:e=>{n.execute("element.updateModdleProperties",{element:t,moddleElement:r,properties:{cancelRemainingInstances:e}})}})}function SU(e){const{autoFocusEntry:t,element:n,getOptions:i}=e,r=i(n),o=_W(r);return M_(()=>{if(t&&o&&r.length>o.length){const e=de(`[data-entry-id="${t}"]`),n=de(".bio-properties-panel-input",e);n&&n.select()}},[r]),_E(uQ,{...e})}function kU(e){return CU(e,"bpmn:ErrorEventDefinition")}function OU(e){const t=kU(e);return t&&t.get("errorRef")}function CU(e,t){return w(br(e).get("eventDefinitions")||[],function(e){return vr(e,t)})}function PU(e){return vr(e,"bpmn:ReceiveTask")?br(e):CU(e,"bpmn:MessageEventDefinition")}function AU(e){const t=PU(e);return t&&t.get("messageRef")}function TU(e){return CU(e,"bpmn:LinkEventDefinition")}function RU(e){return CU(e,"bpmn:SignalEventDefinition")}function MU(e){const t=RU(e);return t&&t.get("signalRef")}function $U(e){return CU(e,"bpmn:EscalationEventDefinition")}function DU(e){const t=$U(e);return t&&t.get("escalationRef")}function BU(e){return CU(e,"bpmn:CompensateEventDefinition")}function LU(e){const{element:t}=e;return function(e){return yr(e,["bpmn:EndEvent","bpmn:IntermediateThrowEvent"])&&!!BU(e)}(t)?[{id:"waitForCompletion",component:IU,isEdited:GW},{id:"activityRef",component:NU,isEdited:pQ}]:[]}function IU(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=BU(t);return XW({element:t,id:"waitForCompletion",label:i("Wait for completion"),getValue:()=>r.get("waitForCompletion"),setValue:e=>{n.execute("element.updateModdleProperties",{element:t,moddleElement:r,properties:{waitForCompletion:e}})}})}function NU(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("elementRegistry"),r=QQ("translate"),o=BU(t);return SU({element:t,id:"activityRef",label:r("Activity reference"),getValue:()=>{const e=function(e){const t=BU(e);return t&&t.get("activityRef")}(t);return e&&e.get("id")},setValue:e=>{const r=e?br(i.get(e)):void 0;n.execute("element.updateModdleProperties",{element:t,moddleElement:o,properties:{activityRef:r}})},getOptions:()=>{let e=[{value:"",label:r("<none>")}];const n=function(e){const t=br(e);let n=t.$parent,i=VU(n);vr(n,"bpmn:SubProcess")&&n.triggeredByEvent&&(n=n.$parent,n&&(i=[...i,...VU(n)]));return i}(t);var i;return(i=n,B(i,e=>(e.name||"").toLowerCase())).forEach(function(t){e.push({value:t.id,label:FU(t)})}),e}})}function zU(e,t){const{flowElements:n}=e;return n.filter(function(e){return vr(e,t)})}function jU(e,t){return vr(e,"bpmn:CallActivity")||vr(e,"bpmn:SubProcess")&&!e.triggeredByEvent&&!e.isForCompensation||function(e,t){const{id:n}=e;return!!w(t,function(e){const{attachedToRef:t}=e,i=BU(e);return t&&i&&t.id===n})}(e,t)}function VU(e){const t=function(e){return zU(e,"bpmn:Activity")}(e),n=function(e){return zU(e,"bpmn:BoundaryEvent")}(e);return t.filter(function(e){return jU(e,n)})}function FU(e){const{id:t,name:n}=e;return`${n?n+" ":""}(id=${t})`}const qU="text/plain";function HU(e){const{element:t}=e,n=[{id:"documentation",component:WU,isEdited:mQ}];return function(e){return vr(e,"bpmn:Participant")&&e.businessObject.get("processRef")}(t)&&n.push({id:"processDocumentation",component:QU,isEdited:mQ}),n}function WU(e){const{element:t}=e,n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate"),o=QQ("debounceInput"),s=GU(br(t)),a=UU(t,br(t),n,i);return fQ({element:t,id:"documentation",label:r("Element documentation"),getValue:s,setValue:a,debounce:o})}function QU(e){const{element:t}=e,n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate"),o=QQ("debounceInput"),s=br(t).processRef,a=GU(s),l=UU(t,s,n,i);return fQ({element:t,id:"processDocumentation",label:r("Process documentation"),getValue:a,setValue:l,debounce:o})}function XU(e){return e.find(function(e){return(e.textFormat||qU)===qU})}function GU(e){return function(){const t=XU(e&&e.get("documentation"));return t&&t.text}}function UU(e,t,n,i){return function(r){let o=XU(t&&t.get("documentation"));return o?r?i.execute("element.updateModdleProperties",{element:e,moddleElement:o,properties:{text:r}}):i.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:{documentation:S(t.get("documentation"),o)}}):r?(o=n.create("bpmn:Documentation",{text:r}),i.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:{documentation:[...t.get("documentation"),o]}})):void 0}}const YU="create-new";function KU(e){const{element:t}=e;if(!function(e){return yr(e,["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:EndEvent"])&&!!kU(e)}(t))return[];let n=[{id:"errorRef",component:ZU,isEdited:pQ}];return OU(t)&&(n=[...n,{id:"errorName",component:JU,isEdited:bQ},{id:"errorCode",component:eY,isEdited:bQ}]),n}function ZU(e){const{element:t}=e,n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate"),o=kU(t);return SU({element:t,id:"errorRef",label:r("Global error reference"),autoFocusEntry:"errorName",getValue:()=>{const e=OU(t);return e?e.get("id"):""},setValue:e=>{const r=vU(o),s=[];let a;return e===YU&&(a=mU("bpmn:Error",{name:gU("Error_")},r,n),e=a.get("id"),s.push({cmd:"element.updateModdleProperties",context:{element:t,moddleElement:r,properties:{rootElements:[...r.get("rootElements"),a]}}})),a=a||bU(o,"bpmn:Error",e),s.push({cmd:"element.updateModdleProperties",context:{element:t,moddleElement:o,properties:{errorRef:a}}}),i.execute("properties-panel.multi-command-executor",s)},getOptions:()=>{let e=[{value:"",label:r("<none>")},{value:YU,label:r("Create new ...")}];const n=yU(br(t),"bpmn:Error");var i;return(i=n,B(i,e=>(e.name||"").toLowerCase())).forEach(t=>{e.push({value:t.get("id"),label:t.get("name")})}),e}})}function JU(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=QQ("debounceInput"),o=OU(t);return yQ({element:t,id:"errorName",label:i("Name"),getValue:()=>o.get("name"),setValue:e=>n.execute("element.updateModdleProperties",{element:t,moddleElement:o,properties:{name:e}}),debounce:r})}function eY(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=QQ("debounceInput"),o=OU(t);return yQ({element:t,id:"errorCode",label:i("Code"),getValue:()=>o.get("errorCode"),setValue:e=>n.execute("element.updateModdleProperties",{element:t,moddleElement:o,properties:{errorCode:e}}),debounce:r})}const tY="create-new";function nY(e){const{element:t}=e;if(!function(e){return vr(e,"bpmn:Event")&&!!$U(e)}(t))return[];let n=[{id:"escalationRef",component:iY,isEdited:pQ}];return DU(t)&&(n=[...n,{id:"escalationName",component:rY,isEdited:bQ},{id:"escalationCode",component:oY,isEdited:bQ}]),n}function iY(e){const{element:t}=e,n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate"),o=$U(t);return SU({element:t,id:"escalationRef",label:r("Global escalation reference"),autoFocusEntry:"escalationName",getValue:()=>{const e=DU(t);return e&&e.get("id")},setValue:e=>{const r=vU(o),s=[];let a;if(e===tY){const i=gU("Escalation_");a=mU("bpmn:Escalation",{id:i,name:i},r,n),e=a.get("id"),s.push({cmd:"element.updateModdleProperties",context:{element:t,moddleElement:r,properties:{rootElements:[...r.get("rootElements"),a]}}})}return a=a||bU(o,"bpmn:Escalation",e),s.push({cmd:"element.updateModdleProperties",context:{element:t,moddleElement:o,properties:{escalationRef:a}}}),i.execute("properties-panel.multi-command-executor",s)},getOptions:()=>{let e=[{value:"",label:r("<none>")},{value:tY,label:r("Create new ...")}];const n=yU(br(t),"bpmn:Escalation");var i;return(i=n,B(i,e=>(e.name||"").toLowerCase())).forEach(t=>{e.push({value:t.get("id"),label:t.get("name")})}),e}})}function rY(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=QQ("debounceInput"),o=DU(t);return yQ({element:t,id:"escalationName",label:i("Name"),getValue:()=>o.get("name"),setValue:e=>n.execute("element.updateModdleProperties",{element:t,moddleElement:o,properties:{name:e}}),debounce:r})}function oY(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=QQ("debounceInput"),o=DU(t);return yQ({element:t,id:"escalationCode",label:i("Code"),getValue:()=>o.get("escalationCode"),setValue:e=>n.execute("element.updateModdleProperties",{element:t,moddleElement:o,properties:{escalationCode:e}}),debounce:r})}function sY(e){const{element:t}=e;return vr(t,"bpmn:Process")||function(e){return vr(e,"bpmn:Participant")&&e.businessObject.get("processRef")}(t)?[{id:"isExecutable",component:aY,isEdited:GW}]:[]}function aY(e){const{element:t}=e,n=QQ("modeling"),i=QQ("commandStack"),r=QQ("translate");let o,s;if(s=e=>{n.updateProperties(t,{isExecutable:e})},o=e=>e.businessObject.isExecutable,vr(t,"bpmn:Participant")){const e=t.businessObject.get("processRef");s=n=>{i.execute("element.updateModdleProperties",{element:t,moddleElement:e,properties:{isExecutable:n}})},o=()=>e.get("isExecutable")}return XW({element:t,id:"isExecutable",label:r("Executable"),getValue:o,setValue:s})}const lY=/\s/,cY=/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i,uY=/^[a-z_][\w-.]*$/i;function pY(e,t,n){const i=e.$model.ids.assigned(t);return t?i&&i!==e?n("ID must be unique."):function(e,t){if(n=e,lY.test(n))return t("ID must not contain spaces.");var n;if(!uY.test(e))return cY.test(e)?t("ID must not contain prefix."):t("ID must be a valid QName.")}(t,n):n("ID must not be empty.")}function hY(e){const{element:t}=e,n=QQ("modeling"),i=QQ("debounceInput"),r=QQ("translate"),o=L_(e=>br(e).id,[t]),s=L_(e=>pY(br(t),e,r),[t,r]);return yQ({element:t,id:"id",label:r(vr(t,"bpmn:Participant")?"Participant ID":"ID"),getValue:o,setValue:(e,i)=>{i||n.updateProperties(t,{id:e})},debounce:i,validate:s})}function dY(e){const{element:t}=e;return function(e){return yr(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!TU(e)}(t)?[{id:"linkName",component:fY,isEdited:bQ}]:[]}function fY(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=QQ("debounceInput"),o=TU(t);return yQ({element:t,id:"linkName",label:i("Name"),getValue:()=>o.get("name"),setValue:e=>{n.execute("element.updateModdleProperties",{element:t,moddleElement:o,properties:{name:e}})},debounce:r})}const mY="create-new";function gY(e){const{element:t}=e;if(!function(e){return vr(e,"bpmn:ReceiveTask")||yr(e,["bpmn:StartEvent","bpmn:EndEvent","bpmn:IntermediateThrowEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"])&&!!PU(e)}(t))return[];let n=[{id:"messageRef",component:vY,isEdited:pQ}];return AU(t)&&(n=[...n,{id:"messageName",component:yY,isEdited:bQ}]),n}function vY(e){const{element:t}=e,n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate"),o=PU(t);return SU({element:t,id:"messageRef",label:r("Global message reference"),autoFocusEntry:"messageName",getValue:()=>{const e=AU(t);return e?e.get("id"):""},setValue:e=>{const r=vU(o),s=[];let a;if(e===mY){const i=gU("Message_");a=mU("bpmn:Message",{id:i,name:i},r,n),e=a.get("id"),s.push({cmd:"element.updateModdleProperties",context:{element:t,moddleElement:r,properties:{rootElements:[...r.get("rootElements"),a]}}})}return a=a||bU(o,"bpmn:Message",e),s.push({cmd:"element.updateModdleProperties",context:{element:t,moddleElement:o,properties:{messageRef:a}}}),i.execute("properties-panel.multi-command-executor",s)},getOptions:()=>{let e=[{value:"",label:r("<none>")},{value:mY,label:r("Create new ...")}];const n=yU(br(t),"bpmn:Message");var i;return(i=n,B(i,e=>(e.name||"").toLowerCase())).forEach(t=>{e.push({value:t.get("id"),label:t.get("name")})}),e}})}function yY(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=QQ("debounceInput"),o=AU(t);return yQ({element:t,id:"messageName",label:i("Name"),getValue:()=>o.get("name"),setValue:e=>n.execute("element.updateModdleProperties",{element:t,moddleElement:o,properties:{name:e}}),debounce:r})}function bY(e){const{element:t}=e;if(!function(e){const t=SY(e);return!!t&&vr(t,"bpmn:MultiInstanceLoopCharacteristics")}(t))return[];return[{id:"loopCardinality",component:wY,isEdited:bQ},{id:"completionCondition",component:xY,isEdited:bQ}]}function wY(e){const{element:t}=e,n=QQ("bpmnFactory"),i=QQ("debounceInput"),r=QQ("commandStack"),o=QQ("translate");return yQ({element:t,id:"loopCardinality",label:o("Loop cardinality"),getValue:()=>function(e){const t=function(e){return EY(e,"loopCardinality")}(e);return _Y(t)}(t),setValue:e=>wU(t,SY(t),"loopCardinality",e,n,r),debounce:i})}function xY(e){const{element:t}=e,n=QQ("bpmnFactory"),i=QQ("debounceInput"),r=QQ("commandStack"),o=QQ("translate");return yQ({element:t,id:"completionCondition",label:o("Completion condition"),getValue:()=>function(e){const t=function(e){return EY(e,"completionCondition")}(e);return _Y(t)}(t),setValue:e=>wU(t,SY(t),"completionCondition",e,n,r),debounce:i})}function _Y(e){return e&&e.get("body")}function EY(e,t){const n=SY(e);return n&&n.get(t)}function SY(e){return br(e).loopCharacteristics}function kY(e){const{element:t}=e;return yr(t,["bpmn:Collaboration","bpmn:DataAssociation","bpmn:Association"])?[]:[{id:"name",component:OY,isEdited:mQ}]}function OY(e){const{element:t}=e,n=QQ("modeling"),i=QQ("debounceInput"),r=QQ("canvas"),o=QQ("bpmnFactory"),s=QQ("translate");let a={element:t,id:"name",label:s("Name"),debounce:i,setValue:e=>{n.updateProperties(t,{name:e})},getValue:e=>e.businessObject.name,autoResize:!0};return vr(t,"bpmn:TextAnnotation")?a={...a,setValue:e=>{n.updateProperties(t,{text:e})},getValue:e=>e.businessObject.text}:vr(t,"bpmn:Group")?a={...a,setValue:e=>{const i=br(t);i.categoryValueRef||function(e,t,n){const i=function(e,t){const n=t.create("bpmn:CategoryValue"),i=t.create("bpmn:Category",{categoryValue:[n]});return wt(e.get("rootElements"),i),br(i).$parent=e,br(n).$parent=i,n}(br(t).$parent,n);e.categoryValueRef=i}(i,r.getRootElement(),o),n.updateLabel(t,e)},getValue:e=>{const t=br(e).categoryValueRef;return t&&t.value}}:vr(t,"bpmn:Participant")&&(a.label=s("Participant Name")),fQ(a)}function CY(e){const{element:t}=e;return function(e){return vr(e,"bpmn:Participant")&&e.businessObject.get("processRef")}(t)?[{id:"processId",component:AY,isEdited:bQ},{id:"processName",component:PY,isEdited:bQ}]:[]}function PY(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=QQ("debounceInput"),o=t.businessObject.get("processRef");return yQ({element:t,id:"processName",label:i("Process name"),getValue:()=>o.get("name"),setValue:e=>{n.execute("element.updateModdleProperties",{element:t,moddleElement:o,properties:{name:e}})},debounce:r})}function AY(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=QQ("debounceInput"),o=t.businessObject.get("processRef"),s=L_(e=>pY(o,e,i),[o,i]);return yQ({element:t,id:"processId",label:i("Process ID"),getValue:()=>o.get("id"),setValue:(e,i)=>{i||n.execute("element.updateModdleProperties",{element:t,moddleElement:o,properties:{id:e}})},debounce:r,validate:s})}const TY="create-new";function RY(e){const{element:t}=e;if(!function(e){return vr(e,"bpmn:Event")&&!!RU(e)}(t))return[];let n=[{id:"signalRef",component:MY,isEdited:pQ}];return MU(t)&&(n=[...n,{id:"signalName",component:$Y,isEdited:bQ}]),n}function MY(e){const{element:t}=e,n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate"),o=RU(t);return SU({element:t,id:"signalRef",label:r("Global signal reference"),autoFocusEntry:"signalName",getValue:()=>{const e=MU(t);return e?e.get("id"):""},setValue:e=>{const r=vU(o),s=[];let a;if(e===TY){const i=gU("Signal_");a=mU("bpmn:Signal",{id:i,name:i},r,n),e=a.get("id"),s.push({cmd:"element.updateModdleProperties",context:{element:t,moddleElement:r,properties:{rootElements:[...r.get("rootElements"),a]}}})}return a=a||bU(o,"bpmn:Signal",e),s.push({cmd:"element.updateModdleProperties",context:{element:t,moddleElement:o,properties:{signalRef:a}}}),i.execute("properties-panel.multi-command-executor",s)},getOptions:()=>{let e=[{value:"",label:r("<none>")},{value:TY,label:r("Create new ...")}];const n=yU(br(t),"bpmn:Signal");var i;return(i=n,B(i,e=>(e.name||"").toLowerCase())).forEach(t=>{e.push({value:t.get("id"),label:t.get("name")})}),e}})}function $Y(e){const{element:t}=e,n=QQ("commandStack"),i=QQ("translate"),r=QQ("debounceInput"),o=MU(t);return yQ({element:t,id:"signalName",label:i("Name"),getValue:()=>o.get("name"),setValue:e=>n.execute("element.updateModdleProperties",{element:t,moddleElement:o,properties:{name:e}}),debounce:r})}function DY(e){return function(e,t){const n=br(e);return w(n.get("eventDefinitions")||[],function(e){return vr(e,t)})}(e,"bpmn:TimerEventDefinition")}function BY(e){const{element:t,idPrefix:n}=e;let{timerEventDefinition:i}=e;if(!i){i=DY(br(t))}const r=function(e){if(!e)return;return void 0!==e.get("timeDate")?"timeDate":void 0!==e.get("timeCycle")?"timeCycle":void 0!==e.get("timeDuration")?"timeDuration":void 0}(i);if(!function(e){return yr(e,["bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:BoundaryEvent"])&&!!DY(e)}(t))return[];const o=[];return o.push({id:zY(n,"timerEventDefinitionType"),component:LY,isEdited:pQ,timerEventDefinition:i,timerEventDefinitionType:r}),r&&o.push({id:zY(n,"timerEventDefinitionValue"),component:IY,isEdited:bQ,timerEventDefinition:i,timerEventDefinitionType:r}),o}function LY(e){const{element:t,timerEventDefinition:n,timerEventDefinitionType:i}=e,r=QQ("commandStack"),o=QQ("bpmnFactory"),s=QQ("translate");return uQ({element:t,id:"timerEventDefinitionType",label:s("Type"),getValue:()=>i||"",setValue:e=>{if(e===i)return;const s=o.create("bpmn:FormalExpression",{body:void 0});s.$parent=n;const a={timeDuration:void 0,timeDate:void 0,timeCycle:void 0};""!==e&&(a[e]=s),r.execute("element.updateModdleProperties",{element:t,moddleElement:n,properties:a})},getOptions:e=>[{value:"",label:s("<none>")},{value:"timeDate",label:s("Date")},{value:"timeDuration",label:s("Duration")},{value:"timeCycle",label:s("Cycle")}]})}function IY(e){const{element:t,timerEventDefinition:n,timerEventDefinitionType:i}=e,r=QQ("commandStack"),o=QQ("translate"),s=QQ("debounceInput"),a=n.get(i);return yQ({element:t,id:"timerEventDefinitionValue",label:o("Value"),getValue:()=>a&&a.get("body"),setValue:e=>{r.execute("element.updateModdleProperties",{element:t,moddleElement:a,properties:{body:e}})},debounce:s,tooltip:NY(i,o)})}function NY(e,t){switch(e){case"timeDate":return _E("div",{children:[_E("p",{children:t("A specific point in time defined as ISO 8601 combined date and time representation.")}),_E("ul",{children:[_E("li",{children:[_E("code",{children:"2019-10-01T12:00:00Z"})," - ",t("UTC time")]}),_E("li",{children:[_E("code",{children:"2019-10-02T08:09:40+02:00"})," - ",t("UTC plus 2 hours zone offset")]})]}),_E("a",{href:"https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#time-date",target:"_blank",rel:"noopener noreferrer",children:t("Documentation: Timer events")})]});case"timeCycle":return _E("div",{children:[_E("p",{children:t("A cycle defined as ISO 8601 repeating intervals format.")}),_E("ul",{children:[_E("li",{children:[_E("code",{children:"R5/PT10S"})," - ",t("every 10 seconds, up to 5 times")]}),_E("li",{children:[_E("code",{children:"R/P1D"})," - ",t("every day, infinitely")]})]}),_E("a",{href:"https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#time-cycle",target:"_blank",rel:"noopener noreferrer",children:t("Documentation: Timer events")})]});case"timeDuration":return _E("div",{children:[_E("p",{children:t("A time duration defined as ISO 8601 durations format.")}),_E("ul",{children:[_E("li",{children:[_E("code",{children:"PT15S"})," - ",t("15 seconds")]}),_E("li",{children:[_E("code",{children:"PT1H30M"})," - ",t("1 hour and 30 minutes")]}),_E("li",{children:[_E("code",{children:"P14D"})," - ",t("14 days")]})]}),_E("a",{href:"https://docs.camunda.org/manual/latest/reference/bpmn20/events/timer-events/#time-duration",target:"_blank",rel:"noopener noreferrer",children:t("Documentation: Timer events")})]})}}function zY(e,t){return e?e+t:t}function jY(e,t){const n=t.get("translate"),i=[...kY({element:e}),{id:"id",component:hY,isEdited:bQ},...CY({element:e}),...sY({element:e})];return{id:"general",label:n("General"),entries:i,component:OW}}function VY(e,t){const n={label:t.get("translate")("Compensation"),id:"compensation",component:OW,entries:[...LU({element:e})]};return n.entries.length?n:null}function FY(e,t){const n=t.get("translate"),i=[...HU({element:e})];return{id:"documentation",label:n("Documentation"),entries:i,component:OW}}function qY(e,t){const n={id:"error",label:t.get("translate")("Error"),component:OW,entries:[...KU({element:e})]};return n.entries.length?n:null}function HY(e,t){const n={id:"message",label:t.get("translate")("Message"),component:OW,entries:[...gY({element:e})]};return n.entries.length?n:null}function WY(e,t){const n={id:"signal",label:t.get("translate")("Signal"),component:OW,entries:[...RY({element:e})]};return n.entries.length?n:null}function QY(e,t){const n={label:t.get("translate")("Link"),id:"link",component:OW,entries:[...dY({element:e})]};return n.entries.length?n:null}function XY(e,t){const n={id:"escalation",label:t.get("translate")("Escalation"),component:OW,entries:[...nY({element:e})]};return n.entries.length?n:null}function GY(e,t){const n={label:t.get("translate")("Timer"),id:"timer",component:OW,entries:[...BY({element:e})]};return n.entries.length?n:null}function UY(e,t){const n={label:t.get("translate")("Multi-instance"),id:"multiInstance",component:OW,entries:[...bY({element:e})]};return n.entries.length?n:null}function YY(e,t){const n={label:t.get("translate")("Completion"),id:"adHocCompletion",component:OW,entries:[...xU({element:e})]};return n.entries.length?n:null}class KY{constructor(e,t){e.registerProvider(this),this._injector=t}getGroups(e){return t=>(t=t.concat(function(e,t){return[jY(e,t),FY(e,t),VY(e,t),qY(e,t),QY(e,t),HY(e,t),UY(e,t),YY(e,t),WY(e,t),XY(e,t),GY(e,t)].filter(e=>null!==e)}(e,this._injector)),t)}getEntryId(e,t){return function(e,t){return e&&d(t)&&t.length&&"documentation"===t[t.length-1]?"documentation":null}(e,t)}}KY.$inject=["propertiesPanel","injector"];var ZY={__init__:["bpmnPropertiesProvider"],bpmnPropertiesProvider:["type",KY]};function JY(e,t){const n=e.get("extensionElements"),i=n&&n.get("values")||[];return t?i.filter(e=>vr(e,t)):i}function eK(e,t){return JY(e,t)[0]}function tK(e,t,n,i){const r=[];let o=t.get("extensionElements");return o||(o=i.create("bpmn:ExtensionElements",{values:[]}),o.$parent=t,r.push({cmd:"element.updateModdleProperties",context:{element:e,moddleElement:t,properties:{extensionElements:o}}})),n.$parent=o,r.push({cmd:"element.updateModdleProperties",context:{element:e,moddleElement:o,properties:{values:[...o.get("values"),n]}}}),r}function nK(e,t,n){const i=t.get("extensionElements");if(!i)return[];const r=i.get("values").filter(e=>!n.includes(e));return r.length?[{cmd:"element.updateModdleProperties",context:{element:e,moddleElement:i,properties:{values:r}}}]:[{cmd:"element.updateModdleProperties",context:{element:e,moddleElement:t,properties:{extensionElements:void 0}}}]}function iK({element:e,type:t,value:n,bpmnFactory:i,commandStack:r,businessObject:o}){const s=eK(o=o||e.businessObject,t);let a;a=null==n||""===n?s?nK(e,o,[s]):[]:s?[{cmd:"element.updateModdleProperties",context:{element:e,moddleElement:s,properties:{body:n}}}]:tK(e,o,i.create(t,{body:n}),i),a.length&&r.execute("properties-panel.multi-command-executor",a)}const rK=/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+(\.\d+)?S)?)?$/,oK=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;function sK(e){return/^\s*[$#]\{[\s\S]*\}\s*$/.test(e||"")}function aK(e,t){if(!e)return;let n=0;for(let t=0;t<e.length;t++){const i=e[t];0===n?"$"!==i&&"#"!==i||"{"!==e[t+1]||(n=1,t++):"{"===i?n++:"}"===i&&n--}return n>0?t("Close the expression with }."):void 0}function lK(e,t){if(!e||!e.trim())return t("Must not be empty.")}function cK(e,t){if(e&&!sK(e))return oK.test(e.trim())?void 0:t("Must be an ISO 8601 date, for example 2026-12-31T17:00:00, or an expression.")}function uK(...e){const t=e.filter(Boolean);return(e,n)=>{for(const i of t){const t=i(e,n);if(t)return t}}}const pK=/^R(\d+)?\/(.+)$/;function hK(e,t,n){return function({element:i,id:r}){const o=QQ("modeling"),s=QQ("translate");return _E(XW,{element:i,id:r,label:s(t),tooltip:n&&s(n),getValue:()=>!!i.businessObject.get(e),setValue:t=>o.updateProperties(i,{[e]:t||void 0})})}}const dK=hK("flowable:async","Asynchronous","Continue in a job before this element is executed."),fK=hK("flowable:exclusive","Exclusive","Run the job exclusively: jobs of the same process instance do not run at the same time."),mK=hK("flowable:asyncLeave","Asynchronous leave","Continue in a job after this element is executed."),gK=hK("flowable:asyncLeaveExclusive","Exclusive leave","Run the leave job exclusively.");function vK(e,t,n={}){return function({element:i,id:r}){const o=QQ("bpmnFactory"),s=QQ("commandStack"),a=QQ("debounceInput"),l=QQ("translate");return _E(yQ,{element:i,id:r,label:l(t),description:n.description&&l(n.description),debounce:a,validate:e=>uK(aK,n.validate)(e,l),getValue:()=>{const t=eK(i.businessObject,e);return t?t.get("body"):""},setValue:t=>iK({element:i,type:e,value:t,bpmnFactory:o,commandStack:s})})}}const yK=vK("flowable:FailedJobRetryTimeCycle","Retry time cycle",{description:"ISO 8601 repeat, for example R5/PT7M",validate:(e,t)=>{if(e&&!sK(e)&&!pK.test(e.trim()))return t("Must be an ISO 8601 repeating interval, for example R5/PT7M, or an expression.")}}),bK=vK("flowable:JobCategory","Job category",{description:"Text or expression; jobs can be executed per category"});function wK(e,t){const n=QQ("commandStack");return i=>n.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:i})}const xK=e=>e.businessObject;function _K(e,t,n={}){const{getTarget:i=xK,description:r,validate:o,area:s=!1}=n,a=uK(n.required&&lK,aK,o);return function(n){const{element:o,id:l}=n,c=QQ("debounceInput"),u=QQ("translate"),p=i(o,n),h=wK(o,p);return _E(s?fQ:yQ,{element:o,id:l,label:u(t),description:r&&u(r),debounce:c,rows:s?2:void 0,autoResize:s||void 0,validate:e=>a(e,u),getValue:()=>p.get(e)??"",setValue:t=>h({[e]:""===t?void 0:t})})}}function EK(e,t,n={}){const{getTarget:i=xK,tooltip:r,defaultValue:o=!1}=n;return function(n){const{element:s,id:a}=n,l=QQ("translate"),c=i(s,n),u=wK(s,c);return _E(XW,{element:s,id:a,label:l(t),tooltip:r&&l(r),getValue:()=>{const t=c.get(e);return void 0===t?o:!!t},setValue:t=>u({[e]:t===o?void 0:t})})}}function SK(e,t,n,i={}){const{getTarget:r=xK,tooltip:o}=i;return function(i){const{element:s,id:a}=i,l=QQ("translate"),c=r(s,i),u=wK(s,c);return _E(uQ,{element:s,id:a,label:l(t),tooltip:o&&l(o),getOptions:()=>n.map(e=>({value:e.value,label:l(e.label)})),getValue:()=>c.get(e)??"",setValue:t=>u({[e]:""===t?void 0:t})})}}const kK=(e,t)=>t.parameter,OK={source:_K("source","Source",{getTarget:kK}),sourceExpression:_K("sourceExpression","Source expression",{getTarget:kK}),sourceType:_K("sourceType","Source type",{getTarget:kK}),target:_K("target","Target",{getTarget:kK}),targetExpression:_K("targetExpression","Target expression",{getTarget:kK}),targetType:_K("targetType","Target type",{getTarget:kK}),transient:EK("transient","Transient",{getTarget:kK}),name:_K("name","Name",{getTarget:kK}),value:_K("value","Value",{getTarget:kK}),type:_K("type","Type",{getTarget:kK}),businessKey:_K("businessKey","Business key",{getTarget:kK}),local:EK("local","Local",{getTarget:kK})};function CK({element:e,injector:t,type:n,id:i,label:r,attributes:o,getLabel:s=PK,leadingEntries:a=()=>[],attrs:l={}}){const c=t.get("translate"),u=t.get("bpmnFactory"),p=t.get("commandStack"),h=e.businessObject,d=JY(h,n);return{id:i,label:c(r),component:jW,items:d.map((t,n)=>{const r=`${e.id}-${i}-${n}`,l="function"==typeof o?o(t):o;return{id:r,label:s(t,c),entries:[...a(r,t),...l.map(e=>({id:`${r}-${e}`,component:OK[e],parameter:t}))],autoFocusEntry:`${r}-${l[0]}`,remove:()=>p.execute("properties-panel.multi-command-executor",nK(e,h,[t]))}}),add:t=>{t.stopPropagation(),p.execute("properties-panel.multi-command-executor",tK(e,h,u.create(n,l),u))}}}function PK(e){return`${e.get("source")||e.get("sourceExpression")||"?"} → ${e.get("target")||e.get("targetExpression")||"?"}`}function AK({id:e,element:t,getFields:n,addField:i,removeField:r}){const o=QQ("bpmnFactory"),s=QQ("translate"),a=n();return _E(aQ,{id:e,element:t,label:s("Field injection"),items:a,component:TK,onAdd:()=>i(o.create("flowable:Field",{name:""})),onRemove:e=>r(e),autoFocusEntry:`[data-entry-id="${e}-field-${a.length-1}"] input`})}function TK({element:e,id:t,index:n,item:i,open:r}){const o=`${t}-field-${n}`;return _E(LW,{id:o,element:e,label:i.get("name")||"<empty>",open:r,entries:[{id:`${o}-name`,component:$K,field:i},{id:`${o}-type`,component:DK,field:i},{id:`${o}-value`,component:BK,field:i}]})}function RK(e){if(void 0!==e.get("stringValue"))return{type:"string",value:e.get("stringValue"),form:"stringValue"};if(void 0!==e.get("string"))return{type:"string",value:e.get("string"),form:"string"};if(void 0!==e.get("expression"))return{type:"expression",value:e.get("expression"),form:"expression"};const t=e.get("expressionElement");return t?{type:"expression",value:t.get("body")||"",form:"expressionElement"}:{type:"string",value:"",form:null}}function MK(e,t,n,i){const{type:r,form:o}=RK(e),s={stringValue:void 0,string:void 0,expression:void 0,expressionElement:void 0};return t!==r||"stringValue"!==o&&"expression"!==o?"expression"===t?s.expressionElement=i.create("flowable:Expression",{body:n}):s.string=n:s[o]=n,s}function $K({element:e,id:t,field:n}){const i=QQ("commandStack"),r=QQ("debounceInput"),o=QQ("translate");return _E(yQ,{element:e,id:t,label:o("Name"),debounce:r,validate:e=>lK(e,o),getValue:()=>n.get("name")||"",setValue:t=>i.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:{name:t||""}})})}function DK({element:e,id:t,field:n}){const i=QQ("bpmnFactory"),r=QQ("commandStack"),o=QQ("translate");return _E(uQ,{element:e,id:t,label:o("Type"),getOptions:()=>[{value:"string",label:o("String")},{value:"expression",label:o("Expression")}],getValue:()=>RK(n).type,setValue:t=>r.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:MK(n,t,RK(n).value,i)})})}function BK({element:e,id:t,field:n}){const i=QQ("bpmnFactory"),r=QQ("commandStack"),o=QQ("debounceInput"),s=QQ("translate");return _E(fQ,{element:e,id:t,label:s("Value"),debounce:o,rows:1,autoResize:!0,validate:e=>aK(e,s),getValue:()=>RK(n).value,setValue:t=>r.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:MK(n,RK(n).type,t||"",i)})})}const LK=/[$#]\{/;function IK(e){return JY(e,"flowable:Field")}function NK(e,t){return IK(e).find(e=>e.get("name")===t)}function zK(e,t){const n=NK(e,t);return n?RK(n).value:""}function jK(e,t){const n=QQ("bpmnFactory"),i=QQ("commandStack");return r=>{const o=function(e,t,n,i,r){const o=NK(t,n);if(null==i||""===i)return o?nK(e,t,[o]):[];const s=LK.test(i)?"expression":"string";if(o)return[{cmd:"element.updateModdleProperties",context:{element:e,moddleElement:o,properties:MK(o,s,i,r)}}];const a=r.create("flowable:Field",{name:n});return a.set("expression"===s?"expressionElement":"string","expression"===s?r.create("flowable:Expression",{body:i}):i),tK(e,t,a,r)}(e,e.businessObject,t,r,n);o.length&&i.execute("properties-panel.multi-command-executor",o)}}function VK(e){const{element:t,spec:n}=e,i=zK(t.businessObject,n.name);return"boolean"!==n.kind||""!==i&&"true"!==i&&"false"!==i?_E(FK,e):_E(qK,e)}function FK({element:e,id:t,spec:n}){const i=QQ("debounceInput"),r=QQ("translate"),o=jK(e,n.name),s="area"===n.kind;return _E(s?fQ:yQ,{element:e,id:t,label:r(n.label),description:n.description&&r(n.description),debounce:i,rows:s?2:void 0,autoResize:s||void 0,validate:e=>aK(e,r),getValue:()=>zK(e.businessObject,n.name),setValue:o})}function qK({element:e,id:t,spec:n}){const i=QQ("translate"),r=jK(e,n.name),o=!!n.defaultValue;return _E(XW,{element:e,id:t,label:i(n.label),getValue:()=>{const t=zK(e.businessObject,n.name);return""===t?o:"true"===t},setValue:e=>r(e===o?void 0:String(e))})}function HK(e,t,n){return function({element:i,id:r}){const o=QQ("bpmnFactory"),s=QQ("commandStack"),a=QQ("debounceInput"),l=QQ("translate");return _E(yQ,{element:i,id:r,label:l(t),description:n&&l(n),debounce:a,validate:e=>aK(e,l),getValue:()=>eK(i.businessObject,e)?.get("body")||"",setValue:t=>iK({element:i,type:e,value:t,bpmnFactory:o,commandStack:s})})}}const WK=["class","expression","delegateExpression"],QK=["mail","camel","dmn"],XK=[{value:"class",label:"Java class"},{value:"expression",label:"Expression"},{value:"delegateExpression",label:"Delegate expression"},{value:"mail",label:"Mail"},{value:"http",label:"HTTP"},{value:"shell",label:"Shell"},{value:"camel",label:"Camel"},{value:"dmn",label:"Decision (DMN)"},{value:"case",label:"Case"},{value:"send-event",label:"Send event"},{value:"external-worker",label:"External worker"}],GK={http:["parallelInSameTransaction"],case:["caseDefinitionKey","caseInstanceName","businessKey","inheritBusinessKey","inheritVariables","sameDeployment","fallbackToDefaultTenant","idVariableName"],"external-worker":["topic","doNotIncludeVariables"]},UK={http:["flowable:HttpRequestHandler","flowable:HttpResponseHandler"],"external-worker":["flowable:ExternalWorkerInParameter","flowable:ExternalWorkerOutParameter"],"send-event":["flowable:EventType","flowable:TriggerEventType","flowable:SendSynchronously","flowable:EventInParameter","flowable:EventOutParameter","flowable:TriggerEventCorrelationParameter","flowable:ChannelKey","flowable:SystemChannel"]},YK=(e,t,n=!1)=>({name:e,label:t,kind:"boolean",defaultValue:n}),KK=(e,t,n)=>({name:e,label:t,description:n}),ZK=(e,t,n)=>({name:e,label:t,kind:"area",description:n}),JK={mail:[KK("to","To"),KK("from","From"),KK("cc","Cc"),KK("bcc","Bcc"),KK("subject","Subject"),ZK("text","Text"),KK("textVar","Text variable"),ZK("html","HTML"),KK("htmlVar","HTML variable"),ZK("headers","Headers"),KK("charset","Charset"),KK("attachments","Attachments","Expression resolving to files or data sources"),YK("ignoreException","Ignore exceptions"),KK("exceptionVariableName","Exception variable")],http:[KK("requestMethod","Request method","GET, POST, PUT, PATCH or DELETE"),KK("requestUrl","Request URL"),ZK("requestHeaders","Request headers","One header per line, as Name: value"),ZK("requestSecureHeaders","Secure request headers","Headers whose values are masked in logs"),ZK("requestBody","Request body"),KK("requestBodyEncoding","Request body encoding"),KK("requestTimeout","Request timeout","Milliseconds"),YK("disallowRedirects","Disallow redirects"),KK("failStatusCodes","Fail status codes","For example 400, 5XX"),KK("handleStatusCodes","Handle status codes","Status codes thrown as BPMN errors"),YK("ignoreException","Ignore exceptions"),YK("saveRequestVariables","Save request variables"),YK("saveResponseParameters","Save response parameters"),YK("saveResponseParametersTransient","Save response parameters as transient"),YK("saveResponseVariableAsJson","Save response as JSON"),KK("responseVariableName","Response variable"),KK("resultVariablePrefix","Result variable prefix"),KK("httpActivityBehaviorClass","Behavior class")],shell:[KK("command","Command"),KK("arg1","Argument 1"),KK("arg2","Argument 2"),KK("arg3","Argument 3"),KK("arg4","Argument 4"),KK("arg5","Argument 5"),KK("directory","Working directory"),YK("wait","Wait for the command",!0),YK("redirectError","Redirect errors to the output"),YK("cleanEnv","Clean environment"),KK("outputVariable","Output variable"),KK("errorCodeVariable","Error code variable")],camel:[KK("camelContext","Camel context"),KK("camelBehaviorClass","Behavior class")],dmn:[KK("decisionTableReferenceKey","Decision table key"),YK("decisionTaskThrowErrorOnNoHits","Throw an error on no hits"),YK("fallbackToDefaultTenant","Fall back to the default tenant"),YK("sameDeployment","Decision from the same deployment")]},eZ={mail:"Mail",http:"HTTP",shell:"Shell",camel:"Camel",dmn:"Decision"};function tZ(e){const t=e.get("flowable:type");return t||!vr(e,"bpmn:ServiceTask")?t||"":WK.find(t=>void 0!==e.get(`flowable:${t}`))||""}function nZ({element:e,id:t}){const n=QQ("commandStack"),i=QQ("translate"),r=e.businessObject;return _E(uQ,{element:e,id:t,label:i("Type"),getOptions:()=>{const t=tZ(r),n=vr(e,"bpmn:SendTask")?XK.filter(({value:e})=>QK.includes(e)):XK,o=[{value:"",label:i("<none>")},...n.map(({value:e,label:t})=>({value:e,label:i(t)}))];return t&&!n.some(({value:e})=>e===t)&&o.push({value:t,label:t}),o},validate:e=>lK(e,i)&&i("Choose how the task is implemented."),getValue:()=>tZ(r),setValue:t=>n.execute("properties-panel.multi-command-executor",function(e,t){const n=e.businessObject,i=tZ(n),r=vr(e,"bpmn:ServiceTask")?{"flowable:class":void 0,"flowable:expression":void 0,"flowable:delegateExpression":void 0,"flowable:type":void 0}:{"flowable:type":void 0};for(const e of GK[i]||[])r[`flowable:${e}`]=void 0;WK.includes(t)?r[`flowable:${t}`]="":t&&(r["flowable:type"]=t);const o=[{cmd:"element.updateModdleProperties",context:{element:e,moddleElement:n,properties:r}}],s=(JK[i]||[]).map(e=>e.name),a=[...IK(n).filter(e=>s.includes(e.get("name"))),...(UK[i]||[]).flatMap(e=>JY(n,e))];a.length&&o.push(...nK(e,n,a));return o}(e,t))})}function iZ({element:e,id:t,implementation:n}){const i=QQ("commandStack"),r=QQ("debounceInput"),o=QQ("translate"),s=XK.find(({value:e})=>e===n).label;return _E(yQ,{element:e,id:t,label:o(s),debounce:r,validate:e=>uK(lK,aK)(e,o),getValue:()=>e.businessObject.get(`flowable:${n}`)||"",setValue:t=>i.execute("element.updateModdleProperties",{element:e,moddleElement:e.businessObject,properties:{[`flowable:${n}`]:t||""}})})}function rZ({element:e,id:t}){const n=QQ("commandStack"),i=QQ("debounceInput"),r=QQ("translate"),o=e.businessObject;return _E(yQ,{element:e,id:t,label:r("Result variable"),debounce:i,getValue:()=>o.get("flowable:resultVariableName")??o.get("flowable:resultVariable")??"",setValue:t=>n.execute("element.updateModdleProperties",{element:e,moddleElement:o,properties:{"flowable:resultVariableName":t||void 0,"flowable:resultVariable":void 0}})})}const oZ=EK("flowable:useLocalScopeForResultVariable","Result variable in local scope"),sZ=EK("flowable:storeResultVariableAsTransient","Result variable as transient"),aZ=EK("flowable:triggerable","Triggerable",{tooltip:"The task waits until it is triggered after its implementation ran."}),lZ=_K("flowable:skipExpression","Skip expression",{description:"Skips the task when true; needs the _FLOWABLE_SKIP_EXPRESSION_ENABLED variable"}),cZ=_K("flowable:extensionId","Extension ID"),uZ=EK("flowable:parallelInSameTransaction","Parallel in the same transaction",{tooltip:"Run the request in parallel with other HTTP tasks of the same transaction."});function pZ(e){const t=(JK[tZ(e)]||[]).map(e=>e.name);return IK(e).filter(e=>!t.includes(e.get("name")))}function hZ({element:e,id:t}){const n=QQ("bpmnFactory"),i=QQ("commandStack"),r=e.businessObject;return _E(AK,{id:t,element:e,getFields:()=>pZ(r),addField:t=>i.execute("properties-panel.multi-command-executor",tK(e,r,t,n)),removeField:t=>i.execute("properties-panel.multi-command-executor",nK(e,r,[t]))})}const dZ=[{value:"class",label:"Java class"},{value:"delegateExpression",label:"Delegate expression"},{value:"script",label:"Script"}];function fZ(e){return"script"===e.get("type")?"script":void 0!==e.get("delegateExpression")?"delegateExpression":"class"}function mZ({element:e,id:t,handlerType:n}){const i=QQ("bpmnFactory"),r=QQ("commandStack"),o=QQ("translate"),s=e.businessObject;return _E(uQ,{element:e,id:t,label:o("flowable:HttpRequestHandler"===n?"Request handler":"Response handler"),getOptions:()=>[{value:"",label:o("<none>")},...dZ.map(({value:e,label:t})=>({value:e,label:o(t)}))],getValue:()=>{const e=eK(s,n);return e?fZ(e):""},setValue:t=>{const o=eK(s,n);let a;if(t){const r="script"===t?{type:"script",script:i.create("flowable:Script",{language:"groovy",body:""}),fields:[]}:{[t]:""};a=o?[{cmd:"element.updateModdleProperties",context:{element:e,moddleElement:o,properties:{class:void 0,delegateExpression:void 0,type:void 0,script:void 0,...r}}}]:tK(e,s,i.create(n,r),i)}else a=o?nK(e,s,[o]):[];a.length&&r.execute("properties-panel.multi-command-executor",a)}})}function gZ(e,t){const n=QQ("commandStack");return i=>n.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:i})}function vZ({element:e,id:t,handler:n,implementation:i}){const r=QQ("debounceInput"),o=QQ("translate"),s=gZ(e,n);return _E(yQ,{element:e,id:t,label:o("class"===i?"Java class":"Delegate expression"),debounce:r,getValue:()=>n.get(i)||"",setValue:e=>s({[i]:e||""})})}function yZ({element:e,id:t,handler:n}){const i=QQ("debounceInput"),r=QQ("translate"),o=gZ(e,n.get("script"));return _E(yQ,{element:e,id:t,label:r("Script language"),debounce:i,getValue:()=>n.get("script").get("language")||"",setValue:e=>o({language:e||void 0})})}function bZ({element:e,id:t,handler:n}){const i=QQ("debounceInput"),r=QQ("translate"),o=gZ(e,n.get("script"));return _E(fQ,{element:e,id:t,label:r("Script"),debounce:i,rows:4,monospace:!0,getValue:()=>n.get("script").get("body")||"",setValue:e=>o({body:e||""})})}function wZ({element:e,id:t,handler:n}){const i=gZ(e,n);return _E(AK,{id:t,element:e,getFields:()=>n.get("fields"),addField:e=>{e.$parent=n,i({fields:[...n.get("fields"),e]})},removeField:e=>i({fields:n.get("fields").filter(t=>t!==e)})})}const xZ=_K("flowable:caseDefinitionKey","Case definition key"),_Z=_K("flowable:caseInstanceName","Case instance name"),EZ=_K("flowable:businessKey","Business key"),SZ=EK("flowable:inheritBusinessKey","Inherit business key"),kZ=EK("flowable:inheritVariables","Inherit variables"),OZ=EK("flowable:sameDeployment","Case from the same deployment"),CZ=EK("flowable:fallbackToDefaultTenant","Fall back to the default tenant"),PZ=_K("flowable:idVariableName","Case instance ID variable"),AZ=_K("flowable:topic","Topic"),TZ=EK("flowable:doNotIncludeVariables","Do not include variables",{tooltip:"Send only the mapped input to the worker, not all process variables."});function RZ(e){return vr(e,"bpmn:ServiceTask")&&"send-event"===tZ(e.businessObject)}const MZ=HK("flowable:EventType","Event key"),$Z=HK("flowable:TriggerEventType","Trigger event key","Event that continues the task"),DZ=HK("flowable:ChannelKey","Channel keys","Comma-separated");function BZ({element:e,id:t}){const n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate");return _E(XW,{element:e,id:t,label:r("Send synchronously"),getValue:()=>"true"===eK(e.businessObject,"flowable:SendSynchronously")?.get("body"),setValue:t=>iK({element:e,type:"flowable:SendSynchronously",value:t?"true":void 0,bpmnFactory:n,commandStack:i})})}function LZ({element:e,id:t}){const n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate"),o=e.businessObject;return _E(XW,{element:e,id:t,label:r("System channel"),getValue:()=>!!eK(o,"flowable:SystemChannel"),setValue:t=>{const r=eK(o,"flowable:SystemChannel"),s=t?r?[]:tK(e,o,n.create("flowable:SystemChannel"),n):r?nK(e,o,[r]):[];s.length&&i.execute("properties-panel.multi-command-executor",s)}})}const IZ=(e,t)=>t.mapping,NZ=_K("errorCode","Error code",{getTarget:IZ,required:!0}),zZ=_K("body","Exception class",{getTarget:IZ,description:"Empty maps every exception"}),jZ=EK("includeChildExceptions","Include subclasses",{getTarget:IZ}),VZ=_K("rootCause","Root cause class",{getTarget:IZ});const FZ=["bpmn:CallActivity","bpmn:StartEvent","bpmn:ScriptTask","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"],qZ=["bpmn:CallActivity","bpmn:EndEvent","bpmn:IntermediateThrowEvent"],HZ=["source","sourceExpression","sourceType","target","targetExpression","targetType","transient"];function WZ(e){return"all"===e.get("variables")?"all":void 0!==e.get("businessKey")?"businessKey":"variable"}function QZ(e,t,n,i,r){return CK({element:e,injector:t,type:n,id:i,label:r,attrs:{source:""},leadingEntries:(e,t)=>[{id:`${e}-kind`,component:XZ,parameter:t}],attributes:e=>({all:["local"],businessKey:["businessKey"],variable:HZ}[WZ(e)]),getLabel:(e,t)=>({all:t("All variables"),businessKey:t("Business key"),variable:PK(e)}[WZ(e)])})}function XZ({element:e,id:t,parameter:n}){const i=QQ("commandStack"),r=QQ("translate");return _E(uQ,{element:e,id:t,label:r("Maps"),getOptions:()=>[{value:"variable",label:r("A variable")},{value:"all",label:r("All variables")},...vr(n,"flowable:In")?[{value:"businessKey",label:r("The business key")}]:[]],getValue:()=>WZ(n),setValue:t=>{const r=Object.fromEntries([...HZ,"variables","local","businessKey"].filter(e=>n.$descriptor.propertiesByName[e]).map(e=>[e,void 0]));"all"===t?r.variables="all":"businessKey"===t?r.businessKey="":r.source="",i.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:r})}})}function GZ(e){return vr(e,"bpmn:ServiceTask")&&"case"===tZ(e.businessObject)}const UZ=_K("calledElement","Called element",{description:"Process definition key or ID, or an expression",required:!0}),YZ=SK("flowable:calledElementType","Called element type",[{value:"",label:"Key (default)"},{value:"key",label:"Key"},{value:"id",label:"ID"}]);function KZ({element:e,id:t}){const n=QQ("commandStack"),i=QQ("translate"),r=e.businessObject;return _E(XW,{element:e,id:t,label:i("Process from the same deployment"),getValue:()=>r.get("flowable:sameDeployment")??"deployment"===r.get("flowable:calledElementBinding"),setValue:t=>n.execute("element.updateModdleProperties",{element:e,moddleElement:r,properties:{"flowable:sameDeployment":t||void 0,"flowable:calledElementBinding":void 0}})})}const ZZ=EK("flowable:fallbackToDefaultTenant","Fall back to the default tenant"),JZ=_K("flowable:processInstanceName","Process instance name"),eJ=_K("flowable:businessKey","Business key"),tJ=EK("flowable:inheritBusinessKey","Inherit business key"),nJ=EK("flowable:inheritVariables","Inherit variables",{tooltip:"Pass all variables of this process to the child."}),iJ=EK("flowable:useLocalScopeForOutParameters","Out mappings in local scope"),rJ=EK("flowable:completeAsync","Complete asynchronously",{tooltip:"Continue this process in a new transaction when the child ends."}),oJ=_K("flowable:idVariableName","Process instance ID variable");function sJ(e){const t=e&&e.get("resourceAssignmentExpression");return t&&t.get("expression")||void 0}function aJ(e,t){const n=e.create("bpmn:FormalExpression",{body:t}),i=e.create("bpmn:ResourceAssignmentExpression",{expression:n});return n.$parent=i,i}function lJ(e,t,n,i){const r=sJ(t);if(r)return{cmd:"element.updateModdleProperties",context:{element:e,moddleElement:r,properties:{body:n}}};const o=aJ(i,n);return o.$parent=t,{cmd:"element.updateModdleProperties",context:{element:e,moddleElement:t,properties:{resourceAssignmentExpression:o}}}}const cJ=[{value:"",label:"Engine default"},{value:"none",label:"None"},{value:"activity",label:"Activity"},{value:"audit",label:"Audit"},{value:"full",label:"Full"},{value:"instance",label:"Instance"},{value:"task",label:"Task"}];const uJ=e=>wJ(e),pJ=_K("flowable:candidateStarterUsers","Candidate starter users",{getTarget:uJ,description:"Comma-separated user IDs"}),hJ=_K("flowable:candidateStarterGroups","Candidate starter groups",{getTarget:uJ,description:"Comma-separated group IDs"}),dJ=EK("flowable:isEagerExecutionFetching","Eager execution fetching",{getTarget:uJ,tooltip:"Fetch all executions of an instance at once, which helps processes with many parallel paths."});function fJ({element:e,id:t}){const n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate"),o=wJ(e);return _E(uQ,{element:e,id:t,label:r("History level"),tooltip:r("Overrides the history level of the engine for this process."),getOptions:()=>cJ.map(e=>({value:e.value,label:r(e.label)})),getValue:()=>eK(o,"flowable:HistoryLevel")?.get("body")||"",setValue:t=>iK({element:e,businessObject:o,type:"flowable:HistoryLevel",value:t,bpmnFactory:n,commandStack:i})})}function mJ({element:e,id:t}){const n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("debounceInput"),o=QQ("translate"),s=wJ(e);return _E(yQ,{element:e,id:t,label:o("Potential starters"),description:o("For example user(kermit), group(management)"),debounce:r,getValue:()=>sJ(eK(s,"flowable:PotentialStarter"))?.get("body")||"",setValue:t=>{const r=eK(s,"flowable:PotentialStarter");let o;if(t)if(r)o=[lJ(e,r,t,n)];else{const i=n.create("flowable:PotentialStarter",{resourceAssignmentExpression:aJ(n,t)});i.get("resourceAssignmentExpression").$parent=i,o=tK(e,s,i,n)}else o=r?nK(e,s,[r]):[];o.length&&i.execute("properties-panel.multi-command-executor",o)}})}const gJ=_K("flowable:initiator","Initiator",{description:"Variable that receives the ID of the user who starts the process"}),vJ=_K("flowable:formKey","Form key"),yJ=_K("flowable:formFieldValidation","Form field validation",{description:"true, false or an expression"}),bJ=EK("flowable:sameDeployment","Form from the same deployment",{defaultValue:!0,tooltip:"Look the form up in the deployment of this process first (Flowable default)."});function wJ(e){return vr(e,"bpmn:Process")?e.businessObject:vr(e,"bpmn:Participant")&&e.businessObject.get("processRef")||null}const xJ=["string","int","long","double","boolean","datetime","json"];function _J(e){return vr(e,"bpmn:DataObjectReference")&&e.businessObject.get("dataObjectRef")||null}function EJ({element:e,id:t}){const n=QQ("commandStack"),i=QQ("translate"),r=_J(e);return _E(uQ,{element:e,id:t,label:i("Type"),getOptions:()=>{const e=r.get("itemSubjectRef"),t=[{value:"",label:i("<none>")},...xJ.map(e=>({value:`xsd:${e}`,label:e}))];return e&&!t.some(({value:t})=>t===e)&&t.push({value:e,label:e}),t},getValue:()=>r.get("itemSubjectRef")||"",setValue:t=>n.execute("element.updateModdleProperties",{element:e,moddleElement:r,properties:{itemSubjectRef:t||void 0}})})}function SJ({element:e,id:t}){const n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("debounceInput"),o=QQ("translate"),s=_J(e);return _E(yQ,{element:e,id:t,label:o("Default value"),description:"xsd:datetime"===s.get("itemSubjectRef")?o("yyyy-MM-ddTHH:mm:ss"):void 0,debounce:r,validate:e=>("xsd:datetime"===s.get("itemSubjectRef")?cK:aK)(e,o),getValue:()=>eK(s,"flowable:Value")?.get("body")||"",setValue:t=>iK({element:e,businessObject:s,type:"flowable:Value",value:t,bpmnFactory:n,commandStack:i})})}const kJ=_K("flowable:skipExpression","Skip expression",{description:"Takes the flow without evaluating its condition when true; needs the _FLOWABLE_SKIP_EXPRESSION_ENABLED variable"});const OJ=(e,t)=>t.localization,CJ=_K("locale","Locale",{getTarget:OJ,description:"For example en, de or pt_BR",required:!0}),PJ=_K("name","Name",{getTarget:OJ});function AJ({element:e,id:t,localization:n}){const i=QQ("bpmnFactory"),r=QQ("commandStack"),o=QQ("debounceInput"),s=QQ("translate");return _E(fQ,{element:e,id:t,label:s("Documentation"),debounce:o,rows:2,autoResize:!0,getValue:()=>n.get("documentation")?.get("body")||"",setValue:t=>{const o=n.get("documentation");if(t&&o)return void r.execute("element.updateModdleProperties",{element:e,moddleElement:o,properties:{body:t}});let s;t&&(s=i.create("flowable:Documentation",{body:t}),s.$parent=n),r.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:{documentation:s}})}})}const TJ=["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"],RJ=["bpmn:IntermediateThrowEvent","bpmn:EndEvent"],MJ=[{value:"all",label:"All changes"},{value:"create",label:"Create"},{value:"update",label:"Update"},{value:"update-create",label:"Create or update"},{value:"delete",label:"Delete"}];function $J(e){const t=e.businessObject.get("eventDefinitions");return t&&t[0]||null}function DJ(e){return yr(e,TJ)&&!$J(e)&&!XJ(e)}const BJ=e=>$J(e),LJ=_K("flowable:businessCalendarName","Business calendar",{getTarget:BJ,description:"Calendar used to resolve the timer"}),IJ=_K("flowable:endDate","Cycle end date",{getTarget:e=>$J(e).get("timeCycle"),description:"ISO 8601 date after which the cycle stops",validate:cK}),NJ=_K("flowable:signalExpression","Signal expression",{getTarget:BJ,description:"Resolves the signal name at runtime, instead of the signal reference"}),zJ=EK("flowable:async","Throw asynchronously",{getTarget:BJ,tooltip:"Deliver the signal to the catching executions in separate jobs."}),jJ=SK("flowable:scope","Signal scope",[{value:"",label:"Global (default)"},{value:"global",label:"Global"},{value:"processInstance",label:"Process instance"}],{getTarget:e=>$J(e).get("signalRef"),tooltip:"Set on the signal, so it applies to every event that uses it."}),VJ=_K("flowable:messageExpression","Message expression",{getTarget:BJ,description:"Resolves the message name at runtime, instead of the message reference"}),FJ=_K("flowable:errorVariableName","Error variable",{getTarget:BJ,description:"Stores the caught error"}),qJ=EK("flowable:errorVariableTransient","Error variable as transient",{getTarget:BJ}),HJ=EK("flowable:errorVariableLocalScope","Error variable in local scope",{getTarget:BJ}),WJ=EK("flowable:terminateAll","Terminate all",{getTarget:BJ,tooltip:"Terminate the whole process instance, including parent processes."}),QJ=EK("flowable:terminateMultiInstance","Terminate multi-instance",{getTarget:BJ,tooltip:"Terminate all instances of the enclosing multi-instance activity."});function XJ(e){return eK(e.businessObject,"flowable:VariableListenerEventDefinition")}function GJ({element:e,id:t}){const n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate"),o=e.businessObject;return _E(XW,{element:e,id:t,label:r("Fire on variable changes"),getValue:()=>!!XJ(e),setValue:t=>{const r=XJ(e),s=t?r?[]:tK(e,o,n.create("flowable:VariableListenerEventDefinition",{variableName:""}),n):r?nK(e,o,[r]):[];s.length&&i.execute("properties-panel.multi-command-executor",s)}})}const UJ=_K("variableName","Variable name",{getTarget:e=>XJ(e),required:!0});function YJ({element:e,id:t}){const n=QQ("commandStack"),i=QQ("translate"),r=XJ(e);return _E(uQ,{element:e,id:t,label:i("Change type"),getOptions:()=>{const e=r.get("variableChangeType"),t=[{value:"",label:i("<default: all>")},...MJ.map(({value:e,label:t})=>({value:e,label:i(t)}))];return e&&!MJ.some(({value:t})=>t===e)&&t.push({value:e,label:e}),t},getValue:()=>r.get("variableChangeType")||"",setValue:t=>n.execute("element.updateModdleProperties",{element:e,moddleElement:r,properties:{variableChangeType:t||void 0}})})}const KJ=HK("flowable:EventType","Event key","Event registry event this element waits for"),ZJ=HK("flowable:EventName","Event name"),JJ=HK("flowable:StartEventCorrelationConfiguration","Correlation configuration","For example storeAsUniqueReferenceId, to start one instance per correlation"),e0=["string","long","double","boolean","date","enum"];function t0(e,t){const n=t.get("type");return[{id:`${e}-id`,component:i0,property:t},{id:`${e}-name`,component:r0,property:t},{id:`${e}-type`,component:d0,property:t},..."date"===n?[{id:`${e}-datePattern`,component:l0,property:t},{id:`${e}-lenientDateParsing`,component:c0,property:t}]:[],..."enum"===n?[{id:`${e}-values`,component:f0,property:t}]:[],{id:`${e}-variable`,component:o0,property:t},{id:`${e}-expression`,component:s0,property:t},{id:`${e}-default`,component:a0,property:t},{id:`${e}-readable`,component:u0,property:t},{id:`${e}-writable`,component:p0,property:t},{id:`${e}-required`,component:h0,property:t}]}const n0=(e,t)=>t.property,i0=_K("id","ID",{getTarget:n0,required:!0}),r0=_K("name","Name",{getTarget:n0}),o0=_K("variable","Variable",{getTarget:n0,description:"Process variable to store the value in; defaults to the ID"}),s0=_K("expression","Expression",{getTarget:n0,description:"Reads and writes the value through an expression"}),a0=_K("default","Default value",{getTarget:n0}),l0=_K("datePattern","Date pattern",{getTarget:n0,description:"For example dd-MM-yyyy"}),c0=EK("lenientDateParsing","Lenient date parsing",{getTarget:n0}),u0=EK("readable","Readable",{getTarget:n0,defaultValue:!0}),p0=EK("writable","Writable",{getTarget:n0,defaultValue:!0}),h0=EK("required","Required",{getTarget:n0});function d0({element:e,id:t,property:n}){const i=QQ("commandStack"),r=QQ("translate");return _E(uQ,{element:e,id:t,label:r("Type"),getOptions:()=>{const e=n.get("type"),t=e&&!e0.includes(e)?[...e0,e]:e0;return[{value:"",label:r("<none>")},...t.map(e=>({value:e,label:e}))]},getValue:()=>n.get("type")||"",setValue:t=>{const r={type:t||void 0};"date"!==t&&Object.assign(r,{datePattern:void 0,lenientDateParsing:void 0}),"enum"!==t&&(r.values=[]),i.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:r})}})}function f0({element:e,id:t,property:n}){const i=QQ("bpmnFactory"),r=QQ("commandStack"),o=QQ("translate"),s=n.get("values"),a=t=>r.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:{values:t}});return _E(aQ,{id:t,element:e,label:o("Values"),items:s,component:m0,onAdd:()=>{const e=i.create("flowable:Value",{id:"",name:""});e.$parent=n,a([...s,e])},onRemove:e=>a(s.filter(t=>t!==e)),autoFocusEntry:`[data-entry-id="${t}-value-${s.length-1}"] input`})}function m0({element:e,id:t,index:n,item:i,open:r}){const o=`${t}-value-${n}`;return _E(LW,{id:o,element:e,label:i.get("name")||i.get("id")||"<empty>",open:r,entries:[{id:`${o}-id`,component:g0,value:i,property:"id",label:"ID"},{id:`${o}-name`,component:g0,value:i,property:"name",label:"Name"}]})}function g0({element:e,id:t,value:n,property:i,label:r}){const o=QQ("commandStack"),s=QQ("debounceInput"),a=QQ("translate");return _E(yQ,{element:e,id:t,label:a(r),debounce:s,getValue:()=>n.get(i)||"",setValue:t=>o.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:{[i]:t||""}})})}function v0({element:e,id:t}){const n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("debounceInput"),o=QQ("translate");return _E(fQ,{element:e,id:t,label:o("Multi-line name"),description:o("Name with line breaks, shown by Flowable instead of the name"),debounce:r,rows:2,getValue:()=>{const t=eK(e.businessObject,"flowable:Element-name");return t?t.get("body"):""},setValue:t=>iK({element:e,type:"flowable:Element-name",value:t,bpmnFactory:n,commandStack:i})})}function y0({element:e,id:t}){const n=QQ("bpmnFactory"),i=QQ("commandStack"),r=QQ("translate");return _E(uQ,{element:e,id:t,label:r("History"),tooltip:r("Overrides the process history level for this element (<flowable:includeInHistory>)."),getOptions:()=>[{value:"",label:r("Default")},{value:"true",label:r("Include")},{value:"false",label:r("Exclude")}],getValue:()=>{const t=eK(e.businessObject,"flowable:IncludeInHistory");return t?t.get("body"):""},setValue:t=>iK({element:e,type:"flowable:IncludeInHistory",value:t,bpmnFactory:n,commandStack:i})})}const b0=["start","end"],w0=["take"],x0=["create","assignment","complete","delete","all"],_0=["class","expression","delegateExpression","script"],E0={class:"Java class",expression:"Expression",delegateExpression:"Delegate expression",script:"Script"},S0=["before-commit","committed","rolled-back"],k0={customPropertiesResolverClass:"Java class",customPropertiesResolverExpression:"Expression",customPropertiesResolverDelegateExpression:"Delegate expression"},O0={signal:"signalName",globalSignal:"signalName",message:"messageName",error:"errorCode"};function C0({element:e,injector:t,container:n,type:i,id:r,label:o,events:s}){const a=t.get("translate"),l=t.get("bpmnFactory"),c=t.get("commandStack"),u=JY(n,i);return{id:r,label:a(o),component:jW,items:u.map((t,i)=>{const o=`${e.id}-${r}-${i}`;return{id:o,label:`${t.get("event")||"?"}: ${a(E0[A0(t)])}`,entries:P0(o,e,t,s),autoFocusEntry:`${o}-value`,remove:()=>c.execute("properties-panel.multi-command-executor",nK(e,n,[t]))}}),add:t=>{t.stopPropagation();const r=l.create(i,{event:s[0],class:""});c.execute("properties-panel.multi-command-executor",tK(e,n,r,l))}}}function P0(e,t,n,i){const r=A0(n),o=[{id:`${e}-event`,component:M0,listener:n,events:i},{id:`${e}-implementation`,component:$0,listener:n}];return"script"===r?o.push({id:`${e}-scriptLanguage`,component:B0,listener:n},{id:`${e}-script`,component:L0,listener:n},{id:`${e}-scriptResultVariable`,component:I0,listener:n}):o.push({id:`${e}-value`,component:D0,listener:n,implementation:r}),o.push({id:`${e}-onTransaction`,component:N0,listener:n},{id:`${e}-resolverType`,component:z0,listener:n}),T0(n)&&o.push({id:`${e}-resolverValue`,component:j0,listener:n}),"script"!==r&&o.push({id:`${e}-fields`,component:V0,listener:n}),o}function A0(e){return"script"===e.get("type")?"script":_0.find(t=>"script"!==t&&void 0!==e.get(t))||"class"}function T0(e){return Object.keys(k0).find(t=>void 0!==e.get(t))}function R0(e,t){const n=QQ("commandStack");return i=>n.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:i})}function M0({element:e,id:t,listener:n,events:i}){const r=QQ("translate"),o=R0(e,n);return _E(uQ,{element:e,id:t,label:r("Event"),getOptions:()=>i.map(e=>({value:e,label:r(e)})),getValue:()=>n.get("event"),setValue:e=>o({event:e})})}function $0({element:e,id:t,listener:n}){const i=QQ("bpmnFactory"),r=QQ("translate"),o=R0(e,n);return _E(uQ,{element:e,id:t,label:r("Type"),getOptions:()=>_0.map(e=>({value:e,label:r(E0[e])})),getValue:()=>A0(n),setValue:e=>{const t={class:void 0,expression:void 0,delegateExpression:void 0,type:void 0,script:void 0};"script"===e?(t.type="script",t.script=i.create("flowable:Script",{language:"groovy",body:""}),t.fields=[]):t[e]="",o(t)}})}function D0({element:e,id:t,listener:n,implementation:i}){const r=QQ("debounceInput"),o=QQ("translate"),s=R0(e,n);return _E(yQ,{element:e,id:t,label:o(E0[i]),debounce:r,validate:e=>uK(lK,aK)(e,o),getValue:()=>n.get(i)||"",setValue:e=>s({[i]:e||""})})}function B0({element:e,id:t,listener:n}){const i=QQ("debounceInput"),r=QQ("translate"),o=R0(e,n.get("script"));return _E(yQ,{element:e,id:t,label:r("Script language"),debounce:i,getValue:()=>n.get("script").get("language")||"",setValue:e=>o({language:e||void 0})})}function L0({element:e,id:t,listener:n}){const i=QQ("debounceInput"),r=QQ("translate"),o=R0(e,n.get("script"));return _E(fQ,{element:e,id:t,label:r("Script"),debounce:i,rows:4,monospace:!0,getValue:()=>n.get("script").get("body")||"",setValue:e=>o({body:e||""})})}function I0({element:e,id:t,listener:n}){const i=QQ("debounceInput"),r=QQ("translate"),o=R0(e,n.get("script"));return _E(yQ,{element:e,id:t,label:r("Result variable"),debounce:i,getValue:()=>n.get("script").get("resultVariable")||"",setValue:e=>o({resultVariable:e||void 0})})}function N0({element:e,id:t,listener:n}){const i=QQ("translate"),r=R0(e,n);return _E(uQ,{element:e,id:t,label:i("Transaction phase"),getOptions:()=>[{value:"",label:i("<none>")},...S0.map(e=>({value:e,label:i(e)}))],getValue:()=>n.get("onTransaction")||"",setValue:e=>r({onTransaction:e||void 0})})}function z0({element:e,id:t,listener:n}){const i=QQ("translate"),r=R0(e,n);return _E(uQ,{element:e,id:t,label:i("Custom properties resolver"),getOptions:()=>[{value:"",label:i("<none>")},...Object.entries(k0).map(([e,t])=>({value:e,label:i(t)}))],getValue:()=>T0(n)||"",setValue:e=>{const t=T0(n),i=Object.fromEntries(Object.keys(k0).map(e=>[e,void 0]));e&&(i[e]=t?n.get(t):""),r(i)}})}function j0({element:e,id:t,listener:n}){const i=QQ("debounceInput"),r=QQ("translate"),o=R0(e,n),s=T0(n);return _E(yQ,{element:e,id:t,label:r("Resolver"),debounce:i,getValue:()=>n.get(s)||"",setValue:e=>o({[s]:e||""})})}function V0({element:e,id:t,listener:n}){const i=QQ("commandStack"),r=t=>i.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:{fields:t}});return _E(AK,{id:t,element:e,getFields:()=>n.get("fields"),addField:e=>{e.$parent=n,r([...n.get("fields"),e])},removeField:e=>r(n.get("fields").filter(t=>t!==e))})}function F0(e){const t=e.get("throwEvent");return t?`throw-${t}`:void 0!==e.get("delegateExpression")?"delegateExpression":"class"}function q0(e,t){const n=F0(t);return n.startsWith("throw-")?[{id:`${e}-throwValue`,component:G0,listener:t}]:[{id:`${e}-value`,component:X0,listener:t,implementation:n}]}function H0({element:e,id:t,listener:n}){const i=QQ("debounceInput"),r=QQ("translate"),o=R0(e,n);return _E(yQ,{element:e,id:t,label:r("Events"),description:r("Comma-separated engine event types, for example TASK_CREATED; empty for all"),debounce:i,getValue:()=>n.get("events")||"",setValue:e=>o({events:e||void 0})})}function W0({element:e,id:t,listener:n}){const i=QQ("debounceInput"),r=QQ("translate"),o=R0(e,n);return _E(yQ,{element:e,id:t,label:r("Entity type"),description:r("Only entity events of this type, for example task"),debounce:i,getValue:()=>n.get("entityType")||"",setValue:e=>o({entityType:e||void 0})})}function Q0({element:e,id:t,listener:n}){const i=QQ("translate"),r=R0(e,n),o=[{value:"class",label:i("Java class")},{value:"delegateExpression",label:i("Delegate expression")},{value:"throw-signal",label:i("Throw signal")},{value:"throw-globalSignal",label:i("Throw global signal")},{value:"throw-message",label:i("Throw message")},{value:"throw-error",label:i("Throw error")}];return _E(uQ,{element:e,id:t,label:i("Type"),getOptions:()=>o,getValue:()=>F0(n),setValue:e=>{const t={class:void 0,delegateExpression:void 0,throwEvent:void 0,signalName:void 0,messageName:void 0,errorCode:void 0};if(e.startsWith("throw-")){const n=e.slice(6);t.throwEvent=n,t[O0[n]]=""}else t[e]="";r(t)}})}function X0({element:e,id:t,listener:n,implementation:i}){const r=QQ("debounceInput"),o=QQ("translate"),s=R0(e,n);return _E(yQ,{element:e,id:t,label:o(E0[i]),debounce:r,validate:e=>uK(lK,aK)(e,o),getValue:()=>n.get(i)||"",setValue:e=>s({[i]:e||""})})}function G0({element:e,id:t,listener:n}){const i=QQ("debounceInput"),r=QQ("translate"),o=R0(e,n),s=O0[n.get("throwEvent")]||"signalName";return _E(yQ,{element:e,id:t,label:r({signalName:"Signal name",messageName:"Message name",errorCode:"Error code"}[s]),debounce:i,getValue:()=>n.get(s)||"",setValue:e=>o({[s]:e||""})})}function U0(e){const t=e.businessObject;return vr(e,"bpmn:Participant")?t.get("processRef")||null:t}function Y0(e){const t=e.businessObject.get("loopCharacteristics");return t&&vr(t,"bpmn:MultiInstanceLoopCharacteristics")?t:null}function K0(e){return eK(e,"flowable:Collection")?"handler":void 0!==e.get("flowable:collection")?"attribute":""}const Z0=e=>Y0(e),J0=e=>eK(Y0(e),"flowable:Collection");function e1({element:e,id:t}){const n=QQ("bpmnFactory"),i=QQ("translate"),r=function(){const e=QQ("commandStack");return t=>t.length&&e.execute("properties-panel.multi-command-executor",t)}(),o=Y0(e);return _E(uQ,{element:e,id:t,label:i("Collection"),getOptions:()=>[{value:"",label:i("<none>")},{value:"attribute",label:i("Variable or expression")},{value:"handler",label:i("Collection handler")}],getValue:()=>K0(o),setValue:t=>{const i=eK(o,"flowable:Collection"),s=[];s.push({cmd:"element.updateModdleProperties",context:{element:e,moddleElement:o,properties:{"flowable:collection":"attribute"===t?"":void 0}}}),i&&"handler"!==t&&s.push(...nK(e,o,[i])),i||"handler"!==t||s.push(...tK(e,o,n.create("flowable:Collection",{class:""}),n)),r(s)}})}const t1=_K("flowable:collection","Collection variable or expression",{getTarget:Z0,description:"A variable name, or an expression such as ${order.items}"});function n1(e){return void 0!==e.get("delegateExpression")?"delegateExpression":"class"}function i1({element:e,id:t}){const n=QQ("commandStack"),i=QQ("translate"),r=J0(e);return _E(uQ,{element:e,id:t,label:i("Handler type"),getOptions:()=>[{value:"class",label:i("Java class")},{value:"delegateExpression",label:i("Delegate expression")}],getValue:()=>n1(r),setValue:t=>n.execute("element.updateModdleProperties",{element:e,moddleElement:r,properties:{class:void 0,delegateExpression:void 0,[t]:r.get(n1(r))||""}})})}function r1({element:e,id:t}){const n=QQ("commandStack"),i=QQ("debounceInput"),r=QQ("translate"),o=J0(e),s=n1(o);return _E(yQ,{element:e,id:t,label:r("class"===s?"Handler class":"Handler delegate expression"),debounce:i,getValue:()=>o.get(s)||"",setValue:t=>n.execute("element.updateModdleProperties",{element:e,moddleElement:o,properties:{[s]:t||""}})})}function o1(e){return void 0!==e.get("expression")?"expression":"string"}function s1({element:e,id:t}){const n=QQ("commandStack"),i=QQ("translate"),r=J0(e);return _E(uQ,{element:e,id:t,label:i("Handler input type"),getOptions:()=>[{value:"string",label:i("String")},{value:"expression",label:i("Expression")}],getValue:()=>o1(r),setValue:t=>{const i=r.get(o1(r));n.execute("element.updateModdleProperties",{element:e,moddleElement:r,properties:{string:void 0,expression:void 0,[t]:i}})}})}function a1({element:e,id:t}){const n=QQ("commandStack"),i=QQ("debounceInput"),r=QQ("translate"),o=J0(e);return _E(yQ,{element:e,id:t,label:r("Handler input"),debounce:i,getValue:()=>o.get(o1(o))||"",setValue:t=>n.execute("element.updateModdleProperties",{element:e,moddleElement:o,properties:{[o1(o)]:t||void 0}})})}const l1=_K("flowable:elementVariable","Element variable",{getTarget:Z0,description:"Holds the collection element of each instance"}),c1=_K("flowable:elementIndexVariable","Element index variable",{getTarget:Z0}),u1=EK("flowable:noWaitStatesAsyncLeave","Async leave without wait states",{getTarget:Z0,tooltip:"Leave asynchronously even when the instances have no wait states."}),p1=(e,t)=>t.aggregation,h1=_K("target","Target variable",{getTarget:p1}),d1=_K("targetExpression","Target expression",{getTarget:p1}),f1=EK("storeAsTransientVariable","Store as transient variable",{getTarget:p1}),m1=EK("createOverviewVariable","Create overview variable",{getTarget:p1});function g1(e){return["class","delegateExpression"].find(t=>void 0!==e.get(t))||""}function v1({element:e,id:t,aggregation:n}){const i=QQ("commandStack"),r=QQ("translate");return _E(uQ,{element:e,id:t,label:r("Aggregator"),getOptions:()=>[{value:"",label:r("Default (JSON)")},{value:"class",label:r("Java class")},{value:"delegateExpression",label:r("Delegate expression")}],getValue:()=>g1(n),setValue:t=>i.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:{class:void 0,delegateExpression:void 0,...t?{[t]:""}:{}}})})}function y1({element:e,id:t,aggregation:n,implementation:i}){const r=QQ("commandStack"),o=QQ("debounceInput"),s=QQ("translate");return _E(yQ,{element:e,id:t,label:s("class"===i?"Aggregator class":"Aggregator delegate expression"),debounce:o,getValue:()=>n.get(i)||"",setValue:t=>r.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:{[i]:t||""}})})}function b1({element:e,id:t,aggregation:n}){const i=QQ("bpmnFactory"),r=QQ("commandStack"),o=QQ("translate"),s=n.get("bpmn:variable"),a=t=>r.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:{"bpmn:variable":t}});return _E(aQ,{id:t,element:e,label:o("Variables"),items:s,component:w1,onAdd:()=>{const e=i.create("flowable:Variable",{source:""});e.$parent=n,a([...s,e])},onRemove:e=>a(s.filter(t=>t!==e)),autoFocusEntry:`[data-entry-id="${t}-variable-${s.length-1}"] input`})}function w1({element:e,id:t,index:n,item:i,open:r}){const o=`${t}-variable-${n}`,s=i.get("source")||i.get("sourceExpression")||"?",a=i.get("target")||i.get("targetExpression")||s;return _E(LW,{id:o,element:e,label:`${s} → ${a}`,open:r,entries:["source","sourceExpression","target","targetExpression"].map(e=>({id:`${o}-${e}`,component:_1,variable:i,property:e}))})}const x1={source:"Source",sourceExpression:"Source expression",target:"Target",targetExpression:"Target expression"};function _1({element:e,id:t,variable:n,property:i}){const r=QQ("commandStack"),o=QQ("debounceInput"),s=QQ("translate");return _E(yQ,{element:e,id:t,label:s(x1[i]),debounce:o,getValue:()=>n.get(i)||"",setValue:t=>r.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:{[i]:t||void 0}})})}function E1({element:e,id:t}){const n=QQ("commandStack"),i=QQ("debounceInput"),r=QQ("translate"),o=e.businessObject;return _E(yQ,{element:e,id:t,label:r("Result variable"),debounce:i,getValue:()=>o.get("flowable:resultVariable")??o.get("flowable:resultVariableName")??"",setValue:t=>n.execute("element.updateModdleProperties",{element:e,moddleElement:o,properties:{"flowable:resultVariable":t||void 0,"flowable:resultVariableName":void 0}})})}const S1=EK("flowable:autoStoreVariables","Store script variables",{tooltip:"Store variables defined in the script as process variables (older engines)."}),k1=EK("flowable:doNotIncludeVariables","Do not include variables",{tooltip:"Do not expose all process variables to the script."}),O1=_K("flowable:skipExpression","Skip expression",{description:"Skips the task when true; needs the _FLOWABLE_SKIP_EXPRESSION_ENABLED variable"}),C1=_K("flowable:ruleVariablesInput","Input variables",{description:"Comma-separated variable names"}),P1=_K("flowable:rules","Rules",{description:"Comma-separated rule names; empty runs all rules"}),A1=EK("flowable:exclude","Exclude the listed rules"),T1=_K("flowable:resultVariable","Result variable"),R1=_K("flowable:class","Java class",{description:"Custom implementation instead of the rules engine"}),M1=HK("flowable:EventType","Event key","Event registry event that completes the task"),$1=HK("flowable:EventName","Event name");const D1=_K("flowable:assignee","Assignee",{description:"User ID or expression, for example ${initiator}"}),B1=_K("flowable:owner","Owner"),L1=_K("flowable:candidateUsers","Candidate users",{description:"Comma-separated user IDs or expressions"}),I1=_K("flowable:candidateGroups","Candidate groups",{description:"Comma-separated group IDs or expressions"});function N1({element:e,id:t,resource:n}){const i=QQ("commandStack"),r=QQ("debounceInput"),o=QQ("translate");return _E(yQ,{element:e,id:t,label:o("Link type"),description:o("For example businessAdministrator"),debounce:r,validate:e=>lK(e,o),getValue:()=>n.get("name")||"",setValue:t=>i.execute("element.updateModdleProperties",{element:e,moddleElement:n,properties:{name:t||""}})})}function z1({element:e,id:t,resource:n}){const i=QQ("bpmnFactory"),r=QQ("commandStack"),o=QQ("debounceInput"),s=QQ("translate");return _E(yQ,{element:e,id:t,label:s("Users and groups"),description:s("For example user(kermit), group(management)"),debounce:o,getValue:()=>sJ(n)?.get("body")||"",setValue:t=>r.execute("properties-panel.multi-command-executor",[lJ(e,n,t||"",i)])})}const j1=_K("flowable:dueDate","Due date",{description:"ISO 8601 date or duration (P2DT4H), or an expression",validate:function(e,t){if(!e||sK(e))return;const n=e.trim();return rK.test(n)||oK.test(n)?void 0:t("Must be an ISO 8601 date or duration, for example 2026-12-31T17:00:00 or P2DT4H, or an expression.")}}),V1=_K("flowable:businessCalendarName","Business calendar",{description:"Calendar used to compute the due date"}),F1=_K("flowable:priority","Priority",{description:"A number or an expression"}),q1=_K("flowable:category","Category"),H1=_K("flowable:skipExpression","Skip expression",{description:"Skips the task when true; needs the _FLOWABLE_SKIP_EXPRESSION_ENABLED variable"}),W1=_K("flowable:taskIdVariableName","Task ID variable",{description:"Variable that receives the ID of the created task"}),Q1=_K("flowable:taskCompleterVariableName","Completer variable",{description:"Variable that receives the ID of the user who completes the task"}),X1=_K("flowable:extensionId","Extension ID"),G1=[function(e,t){return vr(e,"bpmn:FlowElement")?{id:"flowable-general",label:t.get("translate")("Flowable"),component:OW,entries:[{id:"flowable-elementName",component:v0,isEdited:mQ},{id:"flowable-includeInHistory",component:y0,isEdited:pQ}]}:null},function(e,t){return _J(e)?{id:"flowable-dataObject",label:t.get("translate")("Data object"),component:OW,entries:[{id:"flowable-dataObjectType",component:EJ,isEdited:pQ},{id:"flowable-dataObjectValue",component:SJ,isEdited:bQ}]}:null},function(e,t){return vr(e,"bpmn:SequenceFlow")?{id:"flowable-sequenceFlow",label:t.get("translate")("Sequence flow"),component:OW,entries:[{id:"flowable-skipExpression",component:kJ,isEdited:bQ}]}:null},function(e,t){return wJ(e)?{id:"flowable-process",label:t.get("translate")("Process"),component:OW,entries:[{id:"flowable-candidateStarterUsers",component:pJ,isEdited:bQ},{id:"flowable-candidateStarterGroups",component:hJ,isEdited:bQ},{id:"flowable-potentialStarter",component:mJ,isEdited:bQ},{id:"flowable-historyLevel",component:fJ,isEdited:pQ},{id:"flowable-isEagerExecutionFetching",component:dJ,isEdited:GW}]}:null},function(e,t){return vr(e,"bpmn:StartEvent")?{id:"flowable-start",label:t.get("translate")("Start"),component:OW,entries:[{id:"flowable-initiator",component:gJ,isEdited:bQ},{id:"flowable-formKey",component:vJ,isEdited:bQ},{id:"flowable-formFieldValidation",component:yJ,isEdited:bQ},{id:"flowable-sameDeployment",component:bJ,isEdited:GW}]}:null},function(e,t){return vr(e,"bpmn:UserTask")?{id:"flowable-assignment",label:t.get("translate")("Assignment"),component:OW,entries:[{id:"flowable-assignee",component:D1,isEdited:bQ},{id:"flowable-owner",component:B1,isEdited:bQ},{id:"flowable-candidateUsers",component:L1,isEdited:bQ},{id:"flowable-candidateGroups",component:I1,isEdited:bQ}]}:null},function(e,t){if(!vr(e,"bpmn:UserTask"))return null;const n=t.get("translate"),i=t.get("bpmnFactory"),r=t.get("commandStack"),o=e.businessObject,s=JY(o,"flowable:CustomResource");return{id:"flowable-customResources",label:n("Custom resources"),component:jW,items:s.map((t,i)=>{const s=`${e.id}-flowable-customResource-${i}`;return{id:s,label:t.get("name")||n("<empty>"),entries:[{id:`${s}-name`,component:N1,resource:t},{id:`${s}-expression`,component:z1,resource:t}],autoFocusEntry:`${s}-name`,remove:()=>r.execute("properties-panel.multi-command-executor",nK(e,o,[t]))}}),add:t=>{t.stopPropagation();const n=i.create("flowable:CustomResource",{name:"",resourceAssignmentExpression:aJ(i,"")});n.get("resourceAssignmentExpression").$parent=n,r.execute("properties-panel.multi-command-executor",tK(e,o,n,i))}}},function(e,t){return vr(e,"bpmn:UserTask")?{id:"flowable-userTask",label:t.get("translate")("Task"),component:OW,entries:[{id:"flowable-dueDate",component:j1,isEdited:bQ},{id:"flowable-businessCalendarName",component:V1,isEdited:bQ},{id:"flowable-priority",component:F1,isEdited:bQ},{id:"flowable-category",component:q1,isEdited:bQ},{id:"flowable-skipExpression",component:H1,isEdited:bQ},{id:"flowable-taskIdVariableName",component:W1,isEdited:bQ},{id:"flowable-taskCompleterVariableName",component:Q1,isEdited:bQ},{id:"flowable-extensionId",component:X1,isEdited:bQ}]}:null},function(e,t){if(!vr(e,"bpmn:ServiceTask"))return null;const n=t.get("translate"),i=e.businessObject,r=tZ(i),o=[{id:"flowable-implementationType",component:nZ,isEdited:pQ}];return WK.includes(r)&&o.push({id:"flowable-implementationValue",component:iZ,implementation:r,isEdited:bQ}),("expression"===r||function(e){return["resultVariableName","resultVariable"].some(t=>void 0!==e.get(`flowable:${t}`))}(i))&&o.push({id:"flowable-resultVariableName",component:rZ,isEdited:bQ},{id:"flowable-useLocalScopeForResultVariable",component:oZ,isEdited:GW},{id:"flowable-storeResultVariableAsTransient",component:sZ,isEdited:GW}),(WK.includes(r)||"send-event"===r||i.get("flowable:triggerable"))&&o.push({id:"flowable-triggerable",component:aZ,isEdited:GW}),o.push({id:"flowable-skipExpression",component:lZ,isEdited:bQ},{id:"flowable-extensionId",component:cZ,isEdited:bQ}),{id:"flowable-implementation",label:n("Implementation"),component:OW,entries:o}},function(e,t){return vr(e,"bpmn:SendTask")?{id:"flowable-implementation",label:t.get("translate")("Implementation"),component:OW,entries:[{id:"flowable-implementationType",component:nZ,isEdited:pQ}]}:null},function(e,t){return vr(e,"bpmn:ScriptTask")?{id:"flowable-scriptTask",label:t.get("translate")("Script options"),component:OW,entries:[{id:"flowable-scriptResultVariable",component:E1,isEdited:bQ},{id:"flowable-autoStoreVariables",component:S1,isEdited:GW},{id:"flowable-doNotIncludeVariables",component:k1,isEdited:GW},{id:"flowable-skipExpression",component:O1,isEdited:bQ}]}:null},function(e,t){return vr(e,"bpmn:BusinessRuleTask")?{id:"flowable-businessRule",label:t.get("translate")("Business rule"),component:OW,entries:[{id:"flowable-ruleVariablesInput",component:C1,isEdited:bQ},{id:"flowable-rules",component:P1,isEdited:bQ},{id:"flowable-exclude",component:A1,isEdited:GW},{id:"flowable-ruleResultVariable",component:T1,isEdited:bQ},{id:"flowable-ruleClass",component:R1,isEdited:bQ}]}:null},function(e,t){return vr(e,"bpmn:ReceiveTask")?{id:"flowable-receiveTask",label:t.get("translate")("Receive"),component:OW,entries:[{id:"flowable-eventType",component:M1,isEdited:bQ},{id:"flowable-eventName",component:$1,isEdited:bQ},{id:"flowable-skipExpression",component:O1,isEdited:bQ}]}:null},function(e,t){if(!vr(e,"bpmn:Event"))return null;const n=$J(e);if(!n)return null;const i=t.get("translate");let r,o;if(vr(n,"bpmn:TimerEventDefinition"))r="Timer options",o=[{id:"flowable-businessCalendarName",component:LJ,isEdited:bQ}],n.get("timeCycle")&&o.push({id:"flowable-timeCycleEndDate",component:IJ,isEdited:bQ});else if(vr(n,"bpmn:SignalEventDefinition"))r="Signal options",o=[{id:"flowable-signalExpression",component:NJ,isEdited:bQ}],yr(e,RJ)&&o.push({id:"flowable-signalAsync",component:zJ,isEdited:GW}),n.get("signalRef")&&o.push({id:"flowable-signalScope",component:jJ,isEdited:pQ});else if(vr(n,"bpmn:MessageEventDefinition"))r="Message options",o=[{id:"flowable-messageExpression",component:VJ,isEdited:bQ}];else if(vr(n,"bpmn:ErrorEventDefinition")&&yr(e,TJ))r="Error options",o=[{id:"flowable-errorVariableName",component:FJ,isEdited:bQ},{id:"flowable-errorVariableTransient",component:qJ,isEdited:GW},{id:"flowable-errorVariableLocalScope",component:HJ,isEdited:GW}];else{if(!vr(n,"bpmn:TerminateEventDefinition"))return null;r="Terminate options",o=[{id:"flowable-terminateAll",component:WJ,isEdited:GW},{id:"flowable-terminateMultiInstance",component:QJ,isEdited:GW}]}return{id:"flowable-eventDefinition",label:i(r),component:OW,entries:o}},function(e,t){if(!yr(e,TJ)||$J(e)||eK(e.businessObject,"flowable:EventType"))return null;const n=t.get("translate"),i=!!XJ(e);return{id:"flowable-variableListener",label:n("Variable listener"),component:OW,entries:[{id:"flowable-variableListener",component:GJ,isEdited:GW},...i?[{id:"flowable-variableName",component:UJ,isEdited:bQ},{id:"flowable-variableChangeType",component:YJ,isEdited:pQ}]:[]]}},function(e,t){if(!DJ(e))return null;const n=t.get("translate"),i=[{id:"flowable-eventType",component:KJ,isEdited:bQ},{id:"flowable-eventName",component:ZJ,isEdited:bQ}];return vr(e,"bpmn:StartEvent")&&i.push({id:"flowable-startEventCorrelationConfiguration",component:JJ,isEdited:bQ}),{id:"flowable-eventRegistry",label:n("Event registry"),component:OW,entries:i}},function(e,t){return vr(e,"bpmn:ReceiveTask")||DJ(e)?CK({element:e,injector:t,type:"flowable:EventOutParameter",id:"flowable-eventOut",label:"Event output",attributes:["source","sourceType","target","transient"]}):null},function(e,t){return vr(e,"bpmn:ReceiveTask")||DJ(e)?CK({element:e,injector:t,type:"flowable:EventCorrelationParameter",id:"flowable-eventCorrelation",label:"Event correlation",attributes:["name","value","type"],getLabel:e=>e.get("name")||"<empty>"}):null},function(e,t){if(!yr(e,["bpmn:ServiceTask","bpmn:SendTask"]))return null;const n=tZ(e.businessObject),i=JK[n];if(!i)return null;const r=t.get("translate"),o=i.map(e=>({id:`flowable-field-${e.name}`,component:VK,spec:e,isEdited:"boolean"===e.kind?GW:bQ}));return"http"===n&&o.push({id:"flowable-parallelInSameTransaction",component:uZ,isEdited:GW}),{id:`flowable-${n}`,label:r(eZ[n]),component:OW,entries:o}},function(e,t){if(!vr(e,"bpmn:ServiceTask")||"http"!==tZ(e.businessObject))return null;const n=t.get("translate"),i=e.businessObject,r=[];for(const[e,t]of[["flowable:HttpRequestHandler","httpRequestHandler"],["flowable:HttpResponseHandler","httpResponseHandler"]]){const n=`flowable-${t}`,o=eK(i,e),s=o&&fZ(o);r.push({id:`${n}-type`,component:mZ,handlerType:e,isEdited:pQ}),"script"===s?r.push({id:`${n}-scriptLanguage`,component:yZ,handler:o},{id:`${n}-script`,component:bZ,handler:o}):s&&r.push({id:`${n}-value`,component:vZ,handler:o,implementation:s},{id:`${n}-fields`,component:wZ,handler:o})}return{id:"flowable-httpHandlers",label:n("HTTP handlers"),component:OW,entries:r}},function(e,t){return vr(e,"bpmn:ServiceTask")&&"case"===tZ(e.businessObject)?{id:"flowable-case",label:t.get("translate")("Case"),component:OW,entries:[{id:"flowable-caseDefinitionKey",component:xZ,isEdited:bQ},{id:"flowable-caseInstanceName",component:_Z,isEdited:bQ},{id:"flowable-businessKey",component:EZ,isEdited:bQ},{id:"flowable-inheritBusinessKey",component:SZ,isEdited:GW},{id:"flowable-inheritVariables",component:kZ,isEdited:GW},{id:"flowable-caseSameDeployment",component:OZ,isEdited:GW},{id:"flowable-fallbackToDefaultTenant",component:CZ,isEdited:GW},{id:"flowable-idVariableName",component:PZ,isEdited:bQ}]}:null},function(e,t){return vr(e,"bpmn:CallActivity")?{id:"flowable-callActivity",label:t.get("translate")("Called process"),component:OW,entries:[{id:"flowable-calledElement",component:UZ,isEdited:bQ},{id:"flowable-calledElementType",component:YZ,isEdited:pQ},{id:"flowable-sameDeployment",component:KZ,isEdited:GW},{id:"flowable-fallbackToDefaultTenant",component:ZZ,isEdited:GW},{id:"flowable-processInstanceName",component:JZ,isEdited:bQ},{id:"flowable-businessKey",component:eJ,isEdited:bQ},{id:"flowable-inheritBusinessKey",component:tJ,isEdited:GW},{id:"flowable-inheritVariables",component:nJ,isEdited:GW},{id:"flowable-useLocalScopeForOutParameters",component:iJ,isEdited:GW},{id:"flowable-completeAsync",component:rJ,isEdited:GW},{id:"flowable-idVariableName",component:oJ,isEdited:bQ}]}:null},function(e,t){return yr(e,FZ)||GZ(e)?QZ(e,t,"flowable:In","flowable-in","In mappings"):null},function(e,t){return yr(e,qZ)||GZ(e)?QZ(e,t,"flowable:Out","flowable-out","Out mappings"):null},function(e,t){return vr(e,"bpmn:ServiceTask")&&"external-worker"===tZ(e.businessObject)?{id:"flowable-externalWorker",label:t.get("translate")("External worker"),component:OW,entries:[{id:"flowable-topic",component:AZ,isEdited:bQ},{id:"flowable-doNotIncludeVariables",component:TZ,isEdited:GW}]}:null},function(e,t){return vr(e,"bpmn:ServiceTask")&&"external-worker"===tZ(e.businessObject)?CK({element:e,injector:t,type:"flowable:ExternalWorkerInParameter",id:"flowable-externalWorkerIn",label:"Worker input",attributes:["source","sourceExpression","target","transient"]}):null},function(e,t){return vr(e,"bpmn:ServiceTask")&&"external-worker"===tZ(e.businessObject)?CK({element:e,injector:t,type:"flowable:ExternalWorkerOutParameter",id:"flowable-externalWorkerOut",label:"Worker output",attributes:["source","sourceExpression","target","transient"]}):null},function(e,t){if(!RZ(e))return null;const n=t.get("translate"),i=[{id:"flowable-eventType",component:MZ,isEdited:bQ},{id:"flowable-channelKey",component:DZ,isEdited:bQ},{id:"flowable-systemChannel",component:LZ,isEdited:GW},{id:"flowable-sendSynchronously",component:BZ,isEdited:GW}];return e.businessObject.get("flowable:triggerable")&&i.push({id:"flowable-triggerEventType",component:$Z,isEdited:bQ}),{id:"flowable-sendEvent",label:n("Send event"),component:OW,entries:i}},function(e,t){return RZ(e)?CK({element:e,injector:t,type:"flowable:EventInParameter",id:"flowable-eventIn",label:"Event payload",attributes:["source","sourceExpression","target","targetType"]}):null},function(e,t){return RZ(e)&&e.businessObject.get("flowable:triggerable")?CK({element:e,injector:t,type:"flowable:EventOutParameter",id:"flowable-eventOut",label:"Trigger event output",attributes:["source","sourceType","target","transient"]}):null},function(e,t){return RZ(e)&&e.businessObject.get("flowable:triggerable")?CK({element:e,injector:t,type:"flowable:TriggerEventCorrelationParameter",id:"flowable-triggerCorrelation",label:"Trigger correlation",attributes:["name","value","type"],getLabel:e=>e.get("name")||"<empty>"}):null},function(e,t){if(!yr(e,["bpmn:ServiceTask","bpmn:SendTask"]))return null;const n=tZ(e.businessObject),i=pZ(e.businessObject);return vr(e,"bpmn:ServiceTask")&&["","class","delegateExpression"].includes(n)||i.length?{id:"flowable-fields",label:t.get("translate")(JK[n]?"Other fields":"Field injection"),component:OW,entries:[{id:`${e.id}-flowable-fields`,component:hZ}]}:null},function(e,t){if(!yr(e,["bpmn:ServiceTask","bpmn:CallActivity"]))return null;const n=t.get("translate"),i=t.get("bpmnFactory"),r=t.get("commandStack"),o=e.businessObject,s=JY(o,"flowable:MapException");return{id:"flowable-mapExceptions",label:n("Exception mapping"),component:jW,items:s.map((t,i)=>{const s=`${e.id}-flowable-mapException-${i}`;return{id:s,label:`${t.get("body")||n("All exceptions")} → ${t.get("errorCode")||"?"}`,entries:[{id:`${s}-errorCode`,component:NZ,mapping:t},{id:`${s}-class`,component:zZ,mapping:t},{id:`${s}-includeChildExceptions`,component:jZ,mapping:t},{id:`${s}-rootCause`,component:VZ,mapping:t}],autoFocusEntry:`${s}-errorCode`,remove:()=>r.execute("properties-panel.multi-command-executor",nK(e,o,[t]))}}),add:t=>{t.stopPropagation(),r.execute("properties-panel.multi-command-executor",tK(e,o,i.create("flowable:MapException",{errorCode:""}),i))}}},function(e,t){if(!yr(e,["bpmn:UserTask","bpmn:ServiceTask"]))return null;const n=t.get("translate"),i=[{id:"flowable-formKey",component:vJ,isEdited:bQ},{id:"flowable-formFieldValidation",component:yJ,isEdited:bQ}];return vr(e,"bpmn:UserTask")&&i.push({id:"flowable-sameDeployment",component:bJ,isEdited:GW}),{id:"flowable-form",label:n("Form"),component:OW,entries:i}},function(e,t){if(!yr(e,["bpmn:StartEvent","bpmn:UserTask"]))return null;const n=t.get("translate"),i=t.get("bpmnFactory"),r=t.get("commandStack"),o=e.businessObject,s=JY(o,"flowable:FormProperty");return{id:"flowable-formProperties",label:n("Form properties"),component:jW,items:s.map((t,i)=>{const s=`${e.id}-flowable-formProperty-${i}`;return{id:s,label:t.get("name")||t.get("id")||n("<empty>"),entries:t0(s,t),autoFocusEntry:`${s}-id`,remove:()=>r.execute("properties-panel.multi-command-executor",nK(e,o,[t]))}}),add:t=>{t.stopPropagation();const n=i.create("flowable:FormProperty",{id:""});r.execute("properties-panel.multi-command-executor",tK(e,o,n,i))}}},function(e,t){const n=Y0(e);if(!n)return null;const i=t.get("translate"),r=K0(n),o=[{id:"flowable-collectionSource",component:e1,isEdited:pQ}];return"attribute"===r&&o.push({id:"flowable-collection",component:t1,isEdited:bQ}),"handler"===r&&o.push({id:"flowable-collectionHandlerType",component:i1,isEdited:pQ},{id:"flowable-collectionHandler",component:r1,isEdited:bQ},{id:"flowable-collectionInputType",component:s1,isEdited:pQ},{id:"flowable-collectionInput",component:a1,isEdited:bQ}),o.push({id:"flowable-elementVariable",component:l1,isEdited:bQ},{id:"flowable-elementIndexVariable",component:c1,isEdited:bQ},{id:"flowable-noWaitStatesAsyncLeave",component:u1,isEdited:GW}),{id:"flowable-multiInstance",label:i("Multi-instance collection"),component:OW,entries:o}},function(e,t){const n=Y0(e);if(!n)return null;const i=t.get("translate"),r=t.get("bpmnFactory"),o=t.get("commandStack"),s=JY(n,"flowable:VariableAggregation");return{id:"flowable-variableAggregations",label:i("Variable aggregations"),component:jW,items:s.map((t,r)=>{const s=`${e.id}-flowable-variableAggregation-${r}`,a=g1(t);return{id:s,label:t.get("target")||t.get("targetExpression")||i("<empty>"),entries:[{id:`${s}-target`,component:h1,aggregation:t},{id:`${s}-targetExpression`,component:d1,aggregation:t},{id:`${s}-implementation`,component:v1,aggregation:t},...a?[{id:`${s}-value`,component:y1,aggregation:t,implementation:a}]:[],{id:`${s}-storeAsTransientVariable`,component:f1,aggregation:t},{id:`${s}-createOverviewVariable`,component:m1,aggregation:t},{id:`${s}-variables`,component:b1,aggregation:t}],autoFocusEntry:`${s}-target`,remove:()=>o.execute("properties-panel.multi-command-executor",nK(e,n,[t]))}}),add:t=>{t.stopPropagation(),o.execute("properties-panel.multi-command-executor",tK(e,n,r.create("flowable:VariableAggregation",{target:""}),r))}}},function(e,t){if(!vr(e,"bpmn:FlowNode"))return null;const n=t.get("translate"),i=e.businessObject,r=[{id:"flowable-async",component:dK,isEdited:GW}];return i.get("flowable:async")&&r.push({id:"flowable-exclusive",component:fK,isEdited:GW}),r.push({id:"flowable-asyncLeave",component:mK,isEdited:GW}),i.get("flowable:asyncLeave")&&r.push({id:"flowable-asyncLeaveExclusive",component:gK,isEdited:GW}),vr(e,"bpmn:Activity")&&r.push({id:"flowable-failedJobRetryTimeCycle",component:yK,isEdited:bQ}),r.push({id:"flowable-jobCategory",component:bK,isEdited:bQ}),{id:"flowable-async",label:n("Asynchronous execution"),component:OW,entries:r}},function(e,t){const n=U0(e);return n&&yr(e,["bpmn:Process","bpmn:Participant","bpmn:FlowNode","bpmn:SequenceFlow"])?C0({element:e,injector:t,container:n,type:"flowable:ExecutionListener",id:"flowable-executionListeners",label:"Execution listeners",events:vr(e,"bpmn:SequenceFlow")?w0:b0}):null},function(e,t){return vr(e,"bpmn:UserTask")?C0({element:e,injector:t,container:e.businessObject,type:"flowable:TaskListener",id:"flowable-taskListeners",label:"Task listeners",events:x0}):null},function(e,t){const n=U0(e);if(!n||!yr(e,["bpmn:Process","bpmn:Participant"]))return null;const i=t.get("translate"),r=t.get("bpmnFactory"),o=t.get("commandStack"),s=JY(n,"flowable:EventListener");return{id:"flowable-eventListeners",label:i("Event listeners"),component:jW,items:s.map((t,r)=>{const s=`${e.id}-flowable-eventListener-${r}`;return{id:s,label:t.get("events")||i("All events"),entries:[{id:`${s}-events`,component:H0,listener:t},{id:`${s}-entityType`,component:W0,listener:t},{id:`${s}-implementation`,component:Q0,listener:t},...q0(s,t),{id:`${s}-onTransaction`,component:N0,listener:t}],autoFocusEntry:`${s}-events`,remove:()=>o.execute("properties-panel.multi-command-executor",nK(e,n,[t]))}}),add:t=>{t.stopPropagation();const i=r.create("flowable:EventListener",{class:""});o.execute("properties-panel.multi-command-executor",tK(e,n,i,r))}}},function(e,t){const n=function(e){if(yr(e,["bpmn:Process","bpmn:Participant"]))return wJ(e);if(vr(e,"bpmn:DataObjectReference"))return _J(e);if(vr(e,"bpmn:FlowElement"))return e.businessObject;return null}(e);if(!n)return null;const i=t.get("translate"),r=t.get("bpmnFactory"),o=t.get("commandStack"),s=JY(n,"flowable:Localization");return{id:"flowable-localizations",label:i("Localization"),component:jW,items:s.map((t,i)=>{const r=`${e.id}-flowable-localization-${i}`;return{id:r,label:[t.get("locale")||"?",t.get("name")].filter(Boolean).join(": "),entries:[{id:`${r}-locale`,component:CJ,localization:t},{id:`${r}-name`,component:PJ,localization:t},{id:`${r}-documentation`,component:AJ,localization:t}],autoFocusEntry:`${r}-locale`,remove:()=>o.execute("properties-panel.multi-command-executor",nK(e,n,[t]))}}),add:t=>{t.stopPropagation(),o.execute("properties-panel.multi-command-executor",tK(e,n,r.create("flowable:Localization",{locale:""}),r))}}}];class U1{constructor(e,t){this._injector=t,e.registerProvider(500,this)}getGroups(e){return t=>{const n=G1.map(t=>t(e,this._injector)).filter(e=>e&&(e.items||e.entries.length));return[...t,...n]}}}U1.$inject=["propertiesPanel","injector"];var Y1={__init__:["flowablePropertiesProvider"],flowablePropertiesProvider:["type",U1]};class K1{constructor(e){e.on("moddleCopy.canCopyProperty",({parent:e,property:t})=>{if(!function(e,t){const n=function(e){if(!e||"object"!=typeof e||!e.$type||!e.$model)return null;const t=e.$model.getTypeDescriptor(e.$type);return t&&t.meta&&t.meta.allowedIn||null}(e);if(!n||n.includes("*"))return!0;const i=vr(t,"bpmn:ExtensionElements")?t.$parent:t;if(!i)return!0;return n.some(e=>vr(i,e))}(t,e))return!1})}}function Z1(e,t){const n=br(e).get("extensionElements"),i=n&&n.get("values")||[];return t?i.filter(e=>vr(e,t)):i}function J1(e,t,n,i){const r=t.get("extensionElements");if(!r)return;const o=(s=n,Array.isArray(s)?s:[s]);var s;i.execute("element.updateModdleProperties",{element:e,moddleElement:r,properties:{values:r.get("values").filter(e=>!o.includes(e))}})}K1.$inject=["eventBus"];const e2=["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"],t2=["bpmn:IntermediateThrowEvent","bpmn:EndEvent"],n2=["flowable:EventType","flowable:EventName","flowable:EventCorrelationParameter","flowable:EventOutParameter","flowable:StartEventCorrelationConfiguration","flowable:VariableListenerEventDefinition"],i2=["mail","camel","dmn"],r2=["flowable:errorVariableName","flowable:errorVariableTransient","flowable:errorVariableLocalScope"];class o2 extends Vo{constructor(e,t,n){super(e),this.postExecuted("shape.replace",e=>{const i=e.newShape,r=i.businessObject;vr(r,"bpmn:Event")&&function(e,t,n,i){const r=t.get("eventDefinitions")||[];if(!yr(t,e2)||r.length){const n=Z1(t).filter(e=>yr(e,n2));n.length&&J1(e,t,n,i)}r.forEach(i=>{vr(i,"bpmn:SignalEventDefinition")&&!yr(t,t2)&&s2(e,i,["flowable:async"],n),vr(i,"bpmn:ErrorEventDefinition")&&!yr(t,e2)&&s2(e,i,r2,n)})}(i,r,t,n),vr(r,"bpmn:SendTask")&&function(e,t,n,i){const r=t.get("flowable:type");if(!r||i2.includes(r))return;s2(e,t,["flowable:type"],n);const o=Z1(t,"flowable:Field");o.length&&J1(e,t,o,i)}(i,r,t,n)},!0)}}function s2(e,t,n,i){const r={};n.forEach(e=>{void 0!==t.get(e)&&(r[e]=void 0)}),Object.keys(r).length&&i.updateModdleProperties(e,t,r)}o2.$inject=["eventBus","modeling","commandStack"];class a2{constructor(e){e.on("moddleCopy.canCopyProperties",1500,({sourceElement:e,targetElement:t})=>{if(!e||!t||e.$type!==t.$type)return;const n=e.$attrs||{};Object.keys(n).forEach(e=>{e in t.$attrs||(t.$attrs[e]=n[e])})})}}a2.$inject=["eventBus"];const l2={"bpmn:errorRef":{type:"bpmn:Error",attribute:"errorCode",prefix:"Error"},"bpmn:messageRef":{type:"bpmn:Message",attribute:"name",prefix:"Message"},"bpmn:signalRef":{type:"bpmn:Signal",attribute:"name",prefix:"Signal"},"bpmn:escalationRef":{type:"bpmn:Escalation",attribute:"escalationCode",prefix:"Escalation"}},c2=/^unresolved reference </,u2=/^[a-z_][\w-.]*$/i;function p2(e,{warnings:t,elementsById:n={}}){if(!e||!t)return[];const i=e.$model,r=new Map,o=[];t.forEach(t=>{const s=l2[t.property];if(!s||!t.element||"string"!=typeof t.value||!c2.test(t.message||""))return;const a=`${s.type} ${t.value}`;let l=function(e,t,n,i){const r=/^([A-Za-z_][\w.-]*):([A-Za-z_][\w.-]*)$/.exec(n);if(!r)return null;const[,o,s]=r,a=e.$attrs&&e.$attrs[`xmlns:${o}`],l=i[s];if(!a||a!==e.get("targetNamespace")||!l||!l.$instanceOf(t.type))return null;return l}(e,s,t.value,n)||r.get(a)||function(e,t,n){return(e.get("rootElements")||[]).find(e=>e.$instanceOf(t.type)&&e.get(t.attribute)===n)}(e,s,t.value);l||(l=i.create(s.type,{id:h2(s,t.value,n),[s.attribute]:t.value}),function(e,t){const n=e.get("rootElements");let i=n.findIndex(e=>!Object.values(l2).some(t=>e.$instanceOf(t.type)));-1===i&&(i=n.length);n.splice(i,0,t),t.$parent=e}(e,l),n[l.get("id")]=l),r.set(a,l),t.element.set(t.property,l),o.push({warning:t,element:t.element,property:t.property,value:t.value,definition:l})});const s=t.filter(e=>!o.some(t=>t.warning===e));return t.splice(0,t.length,...s),o}function h2(e,t,n){if(u2.test(t)&&!n[t])return t;const i=`${e.prefix}_${t.replace(/[^\w-.]/g,"_").replace(/^_+|_+$/g,"")||"Ref"}`;let r=i;for(let e=2;n[r];e++)r=`${i}_${e}`;return r}class d2{constructor(e){e.on("import.parse.complete",1500,e=>{const{error:t,definitions:n,warnings:i,elementsById:r}=e;!t&&n&&p2(n,{warnings:i,elementsById:r})})}}d2.$inject=["eventBus"];const f2=["element.updateModdleProperties","element.updateProperties"];class m2 extends Vo{constructor(e,t){super(e),this.preExecute(f2,1500,e=>{const t=g2(e),{properties:n}=e;if(!n)return;vr(t,"bpmn:ExtensionElements")&&v2(n.values,t);const i=n.extensionElements;vr(i,"bpmn:ExtensionElements")&&(i.$parent||(i.$parent=t),v2(i.get("values"),i))},!0),this.postExecuted(f2,250,e=>{const{element:n}=e;(function(e){const t=g2(e),n=[];vr(t,"bpmn:ExtensionElements")&&n.push(t);if(e.properties&&"extensionElements"in e.properties){const e=t.get("extensionElements");vr(e,"bpmn:ExtensionElements")&&n.push(e)}return n})(e).forEach(e=>{const i=e.$parent;if(!i)return;const r=!(e.get("values")||[]).length,o=i.get("extensionElements");r&&o===e?t.updateModdleProperties(n,i,{extensionElements:void 0}):r||o||t.updateModdleProperties(n,i,{extensionElements:e})})},!0)}}function g2(e){return e.moddleElement||e.element.businessObject}function v2(e,t){(e||[]).forEach(e=>{e&&e.$type&&!e.$parent&&(e.$parent=t)})}m2.$inject=["eventBus","modeling"];class y2 extends Vo{constructor(e,t){super(e),this.preExecute("element.updateModdleProperties",e=>{const{moddleElement:n,properties:i}=e;if(!i||!("id"in i)||!function(e){const t=e&&e.$descriptor;return!(!t||!t.idProperty)}(n))return;const r=n.get("id"),o=i.id;if(r===o)return;const s=n.$model.ids;r&&s&&s.assigned(r)===n&&t.execute("id.updateClaim",{id:r,element:n,claiming:!1}),o&&t.execute("id.updateClaim",{id:o,element:n,claiming:!0})},!0)}}y2.$inject=["eventBus","commandStack"];var b2={__init__:["allowedExtensionElementsBehavior","cleanUpReplacedElementBehavior","copyUnknownAttributesBehavior","createMissingDefinitionsBehavior","tidyExtensionElementsBehavior","updateModdleIdBehavior"],allowedExtensionElementsBehavior:["type",K1],cleanUpReplacedElementBehavior:["type",o2],copyUnknownAttributesBehavior:["type",a2],createMissingDefinitionsBehavior:["type",d2],tidyExtensionElementsBehavior:["type",m2],updateModdleIdBehavior:["type",y2]},w2={name:"Flowable",uri:"http://flowable.org/bpmn",prefix:"flowable",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:FlowNode"],properties:[{name:"async",isAttr:!0,type:"Boolean"},{name:"exclusive",isAttr:!0,type:"Boolean"},{name:"asyncLeave",isAttr:!0,type:"Boolean"},{name:"asyncLeaveExclusive",isAttr:!0,type:"Boolean"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["bpmn:Activity"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Element-name",superClass:["Element"],meta:{allowedIn:["bpmn:FlowElement"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"JobCategory",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","bpmn:TimerEventDefinition"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"IncludeInHistory",superClass:["Element"],meta:{allowedIn:["bpmn:FlowElement"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Localization",superClass:["Element"],meta:{allowedIn:["bpmn:Process","bpmn:FlowElement","bpmn:DataObject"]},properties:[{name:"locale",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"documentation",type:"Documentation"}]},{name:"Documentation",superClass:["Element"],properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Listener",isAbstract:!0,superClass:["Element"],properties:[{name:"event",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"expression",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"onTransaction",isAttr:!0,type:"String"},{name:"customPropertiesResolverClass",isAttr:!0,type:"String"},{name:"customPropertiesResolverExpression",isAttr:!0,type:"String"},{name:"customPropertiesResolverDelegateExpression",isAttr:!0,type:"String"},{name:"fields",type:"Field",isMany:!0},{name:"script",type:"Script"}]},{name:"ExecutionListener",superClass:["Listener"],meta:{allowedIn:["bpmn:Process","bpmn:FlowNode","bpmn:SequenceFlow"]}},{name:"TaskListener",superClass:["Listener"],meta:{allowedIn:["bpmn:UserTask"]}},{name:"EventListener",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"events",isAttr:!0,type:"String"},{name:"entityType",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"throwEvent",isAttr:!0,type:"String"},{name:"signalName",isAttr:!0,type:"String"},{name:"messageName",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"},{name:"onTransaction",isAttr:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask","bpmn:SendTask","flowable:Listener","flowable:HttpHandler"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"expression",isAttr:!0,type:"String"},{name:"string",type:"String"},{name:"expressionElement",type:"Expression"}]},{name:"Expression",superClass:["Element"],properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Script",superClass:["Element"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"},{name:"body",isBody:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"isEagerExecutionFetching",isAttr:!0,type:"Boolean"}]},{name:"PotentialStarter",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"HistoryLevel",superClass:["Element"],meta:{allowedIn:["bpmn:Process"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask","bpmn:ServiceTask"],properties:[{name:"formKey",isAttr:!0,type:"String"},{name:"formFieldValidation",isAttr:!0,type:"String"},{name:"sameDeployment",isAttr:!0,type:"Boolean"}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"expression",isAttr:!0,type:"String"},{name:"variable",isAttr:!0,type:"String"},{name:"default",isAttr:!0,type:"String"},{name:"datePattern",isAttr:!0,type:"String"},{name:"lenientDateParsing",isAttr:!0,type:"Boolean"},{name:"readable",isAttr:!0,type:"Boolean"},{name:"writable",isAttr:!0,type:"Boolean"},{name:"required",isAttr:!0,type:"Boolean"},{name:"values",type:"Value",isMany:!0}]},{name:"Value",superClass:["Element"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"body",isBody:!0,type:"String"}]},{name:"ResourceAssignmentExpression",isAbstract:!0,extends:["bpmn:ResourceAssignmentExpression"],properties:[{name:"expression",type:"bpmn:Expression",replaces:"bpmn:ResourceAssignmentExpression#expression"}]},{name:"UserTask",isAbstract:!0,extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"owner",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"businessCalendarName",isAttr:!0,type:"String"},{name:"category",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"extensionId",isAttr:!0,type:"String"},{name:"skipExpression",isAttr:!0,type:"String"},{name:"taskIdVariableName",isAttr:!0,type:"String"},{name:"taskCompleterVariableName",isAttr:!0,type:"String"}]},{name:"CustomResource",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"ServiceTask",isAbstract:!0,extends:["bpmn:ServiceTask"],properties:[{name:"class",isAttr:!0,type:"String"},{name:"expression",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariableName",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"},{name:"useLocalScopeForResultVariable",isAttr:!0,type:"Boolean"},{name:"storeResultVariableAsTransient",isAttr:!0,type:"Boolean"},{name:"skipExpression",isAttr:!0,type:"String"},{name:"extensionId",isAttr:!0,type:"String"},{name:"triggerable",isAttr:!0,type:"Boolean"},{name:"type",isAttr:!0,type:"String"},{name:"parallelInSameTransaction",isAttr:!0,type:"Boolean"},{name:"caseDefinitionKey",isAttr:!0,type:"String"},{name:"caseInstanceName",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"inheritBusinessKey",isAttr:!0,type:"Boolean"},{name:"inheritVariables",isAttr:!0,type:"Boolean"},{name:"fallbackToDefaultTenant",isAttr:!0,type:"Boolean"},{name:"idVariableName",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"},{name:"doNotIncludeVariables",isAttr:!0,type:"Boolean"}]},{name:"MapException",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask","bpmn:CallActivity"]},properties:[{name:"errorCode",isAttr:!0,type:"String"},{name:"includeChildExceptions",isAttr:!0,type:"Boolean"},{name:"rootCause",isAttr:!0,type:"String"},{name:"body",isBody:!0,type:"String"}]},{name:"HttpHandler",isAbstract:!0,superClass:["Element"],properties:[{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"fields",type:"Field",isMany:!0},{name:"script",type:"Script"},{name:"extensionElements",type:"bpmn:ExtensionElements"}]},{name:"HttpRequestHandler",superClass:["HttpHandler"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"HttpResponseHandler",superClass:["HttpHandler"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"IOParameter",isAbstract:!0,superClass:["Element"],properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"targetExpression",isAttr:!0,type:"String"},{name:"sourceType",isAttr:!0,type:"String"},{name:"targetType",isAttr:!0,type:"String"},{name:"transient",isAttr:!0,type:"Boolean"}]},{name:"ExternalWorkerInParameter",superClass:["IOParameter"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"ExternalWorkerOutParameter",superClass:["IOParameter"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"EventInParameter",superClass:["IOParameter"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"EventOutParameter",superClass:["IOParameter"],meta:{allowedIn:["bpmn:ServiceTask","bpmn:Event","bpmn:ReceiveTask"]}},{name:"EventType",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask","bpmn:Event","bpmn:ReceiveTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"TriggerEventType",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"SendSynchronously",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"TriggerEventCorrelationParameter",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"}]},{name:"ChannelKey",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"SystemChannel",superClass:["Element"],meta:{allowedIn:["bpmn:ServiceTask"]}},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resultVariableName",isAttr:!0,type:"String"},{name:"autoStoreVariables",isAttr:!0,type:"Boolean"},{name:"doNotIncludeVariables",isAttr:!0,type:"Boolean"},{name:"skipExpression",isAttr:!0,type:"String"}]},{name:"BusinessRuleTask",isAbstract:!0,extends:["bpmn:BusinessRuleTask"],properties:[{name:"ruleVariablesInput",isAttr:!0,type:"String"},{name:"rules",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"exclude",isAttr:!0,type:"Boolean"}]},{name:"SendTask",isAbstract:!0,extends:["bpmn:SendTask"],properties:[{name:"type",isAttr:!0,type:"String"}]},{name:"ReceiveTask",isAbstract:!0,extends:["bpmn:ReceiveTask"],properties:[{name:"skipExpression",isAttr:!0,type:"String"}]},{name:"CallActivity",isAbstract:!0,extends:["bpmn:CallActivity"],properties:[{name:"calledElementType",isAttr:!0,type:"String"},{name:"processInstanceName",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"inheritBusinessKey",isAttr:!0,type:"Boolean"},{name:"inheritVariables",isAttr:!0,type:"Boolean"},{name:"sameDeployment",isAttr:!0,type:"Boolean"},{name:"calledElementBinding",isAttr:!0,type:"String"},{name:"useLocalScopeForOutParameters",isAttr:!0,type:"Boolean"},{name:"completeAsync",isAttr:!0,type:"Boolean"},{name:"fallbackToDefaultTenant",isAttr:!0,type:"Boolean"},{name:"idVariableName",isAttr:!0,type:"String"}]},{name:"In",superClass:["IOParameter"],meta:{allowedIn:["bpmn:CallActivity","bpmn:StartEvent","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"]},properties:[{name:"variables",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean"},{name:"businessKey",isAttr:!0,type:"String"}]},{name:"Out",superClass:["IOParameter"],meta:{allowedIn:["bpmn:CallActivity","bpmn:ServiceTask","bpmn:EndEvent","bpmn:IntermediateThrowEvent"]},properties:[{name:"variables",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean"}]},{name:"MultiInstanceLoopCharacteristics",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"},{name:"elementIndexVariable",isAttr:!0,type:"String"},{name:"noWaitStatesAsyncLeave",isAttr:!0,type:"Boolean"}]},{name:"Collection",superClass:["Element"],meta:{allowedIn:["bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"string",type:"String"},{name:"expression",type:"String"}]},{name:"VariableAggregation",superClass:["Element"],meta:{allowedIn:["bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"target",isAttr:!0,type:"String"},{name:"targetExpression",isAttr:!0,type:"String"},{name:"storeAsTransientVariable",isAttr:!0,type:"Boolean"},{name:"createOverviewVariable",isAttr:!0,type:"Boolean"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"bpmn:variable",type:"flowable:Variable",isMany:!0,xml:{serialize:"property"}}]},{name:"Variable",superClass:["Element"],properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"targetExpression",isAttr:!0,type:"String"}]},{name:"TimerEventDefinition",isAbstract:!0,extends:["bpmn:TimerEventDefinition"],properties:[{name:"businessCalendarName",isAttr:!0,type:"String"}]},{name:"TimeCycle",isAbstract:!0,extends:["bpmn:Expression"],properties:[{name:"endDate",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"signalExpression",isAttr:!0,type:"String"},{name:"async",isAttr:!0,type:"Boolean"}]},{name:"MessageEventDefinition",isAbstract:!0,extends:["bpmn:MessageEventDefinition"],properties:[{name:"messageExpression",isAttr:!0,type:"String"}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorVariableName",isAttr:!0,type:"String"},{name:"errorVariableTransient",isAttr:!0,type:"Boolean"},{name:"errorVariableLocalScope",isAttr:!0,type:"Boolean"}]},{name:"TerminateEventDefinition",isAbstract:!0,extends:["bpmn:TerminateEventDefinition"],properties:[{name:"terminateAll",isAttr:!0,type:"Boolean"},{name:"terminateMultiInstance",isAttr:!0,type:"Boolean"}]},{name:"VariableListenerEventDefinition",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent"]},properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableChangeType",isAttr:!0,type:"String"}]},{name:"EventName",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:ReceiveTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"EventCorrelationParameter",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:ReceiveTask"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"}]},{name:"StartEventCorrelationConfiguration",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Signal",isAbstract:!0,extends:["bpmn:Signal"],properties:[{name:"scope",isAttr:!0,type:"String"}]},{name:"SequenceFlow",isAbstract:!0,extends:["bpmn:SequenceFlow"],properties:[{name:"skipExpression",isAttr:!0,type:"String"}]},{name:"Work-form-field-validation",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Task-candidates-type",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Static-process-key",superClass:["Element"],meta:{allowedIn:["bpmn:CallActivity"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"Translation",superClass:["Element"],meta:{allowedIn:["bpmn:BaseElement"]},properties:[{name:"key",isAttr:!0,type:"String"},{name:"locale",isAttr:!0,type:"String"},{name:"body",isBody:!0,type:"String"}]},{name:"ItemAwareElement",isAbstract:!0,extends:["bpmn:ItemAwareElement"],properties:[{name:"bpmn:itemSubjectRef",isAttr:!0,type:"String",replaces:"bpmn:ItemAwareElement#itemSubjectRef"}]}],enumerations:[]};const x2="http://flowable.org/bpmn",_2=/(\sxmlns(?::[A-Za-z_][\w.-]*)?\s*=\s*)(["'])http:\/\/activiti\.org\/bpmn\2/g;function E2(e,t){const n=e.getPackage("flowable");if(!n)throw new Error("the Flowable descriptor is not registered with this moddle instance");const i=[];for(const r of function(e){const t=new Set,n=/\sxmlns:([A-Za-z_][\w.-]*)\s*=\s*(["'])([^"']*)\2/g;for(const i of e.matchAll(n))i[3]===x2&&t.add(i[1]);return t}(t)){const o=new RegExp(`<${k2(r)}:([A-Za-z_][\\w.-]*)`,"g");for(const r of t.matchAll(o)){const t=r[1].charAt(0).toUpperCase()+r[1].slice(1),o=`${n.prefix}:${t}`;i.includes(o)||S2(e,o)||(e.registry.registerType({name:t,superClass:["Element"],meta:{generic:!0},properties:[{name:"body",isBody:!0,type:"String"},{name:"children",type:"Element",isMany:!0}]},n),i.push(o))}}return i}function S2(e,t){try{return!!e.getType(t)}catch{return!1}}function k2(e){return e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&")}class O2{constructor(e,t){e.on("import.parse.start",({xml:e})=>{const n=function(e){return e.replace(_2,`$1$2${x2}$2`)}(e);return E2(t,n),n}),e.on("import.parse.complete",1500,({error:e,definitions:t,warnings:n,elementsById:i})=>{!e&&t&&p2(t,{warnings:n,elementsById:i})}),e.on("saveXML.start",({definitions:e})=>function(e){const t=e.$attrs||{};for(const e of Object.keys(t))e.startsWith("xmlns:")&&"xmlns:flowable"!==e&&t[e]===x2&&delete t[e];return t["xmlns:flowable"]&&t["xmlns:flowable"]!==x2&&delete t["xmlns:flowable"],e}(e))}}O2.$inject=["eventBus","moddle"];var C2={__init__:["flowableXML"],flowableXML:["type",O2]};const P2={defaultFillColor:"var(--flowable-shape-fill, white)",defaultStrokeColor:"var(--flowable-shape-stroke, hsl(225, 10%, 15%))",defaultLabelColor:"var(--flowable-label-color, var(--flowable-shape-stroke, hsl(225, 10%, 15%)))"};const A2=/^[A-Za-z_][\w.-]*$/;function T2(e={}){const t=e.processId||`Process_${R2()}`,n=e.processName;if(!A2.test(t))throw new Error(`invalid process id <${t}>: use letters, digits, _, - and ., starting with a letter or _`);const i=n?` name="${r=n,String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}"`:"";var r;return`<?xml version="1.0" encoding="UTF-8"?>\n<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"\n xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"\n xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"\n xmlns:di="http://www.omg.org/spec/DD/20100524/DI"\n xmlns:flowable="http://flowable.org/bpmn"\n xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n xmlns:xsd="http://www.w3.org/2001/XMLSchema"\n typeLanguage="http://www.w3.org/2001/XMLSchema"\n expressionLanguage="http://www.w3.org/1999/XPath"\n targetNamespace="http://www.flowable.org/processdef"\n id="Definitions_${R2()}">\n <process id="${t}"${i} isExecutable="true">\n <startEvent id="StartEvent_1" />\n </process>\n <bpmndi:BPMNDiagram id="BPMNDiagram_1">\n <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${t}">\n <bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">\n <dc:Bounds x="152" y="102" width="36" height="36" />\n </bpmndi:BPMNShape>\n </bpmndi:BPMNPlane>\n </bpmndi:BPMNDiagram>\n</definitions>\n`}function R2(){return Math.random().toString(36).slice(2,9)}const M2={mail:[["rect",{x:3,y:6,width:18,height:12,rx:1.5}],["path",{d:"M3.5 7 L12 13 L20.5 7"}]],http:[["circle",{cx:12,cy:12,r:8.5}],["path",{d:"M3.5 12 H20.5"}],["path",{d:"M12 3.5 C8.4 7 8.4 17 12 20.5 C15.6 17 15.6 7 12 3.5"}]],shell:[["rect",{x:3,y:5,width:18,height:14,rx:2}],["path",{d:"M7 9.5 L10 12 L7 14.5"}],["path",{d:"M12 15 H16.5"}]],camel:[["circle",{cx:6,cy:6.5,r:2.2}],["circle",{cx:18,cy:17.5,r:2.2}],["path",{d:"M8.2 6.5 H13 C16.2 6.5 16.2 12 12 12 C7.8 12 7.8 17.5 11 17.5 H15.8"}]],dmn:[["rect",{x:3.5,y:5,width:17,height:14,rx:1}],["path",{d:"M3.5 9.5 H20.5"}],["path",{d:"M3.5 14.25 H20.5"}],["path",{d:"M9.5 9.5 V19"}]],case:[["rect",{x:3.5,y:8,width:17,height:11,rx:1.5}],["path",{d:"M9 8 V6.2 C9 5.5 9.5 5 10.2 5 H13.8 C14.5 5 15 5.5 15 6.2 V8"}],["path",{d:"M3.5 12.5 H20.5"}]],"send-event":[["circle",{cx:12,cy:12,r:1.8}],["path",{d:"M8.6 8.6 C6.7 10.5 6.7 13.5 8.6 15.4"}],["path",{d:"M15.4 8.6 C17.3 10.5 17.3 13.5 15.4 15.4"}],["path",{d:"M5.6 5.6 C2.1 9.1 2.1 14.9 5.6 18.4"}],["path",{d:"M18.4 5.6 C21.9 9.1 21.9 14.9 18.4 18.4"}]],"external-worker":[["path",{d:"M14 4.5 H19.5 V10"}],["path",{d:"M19.5 4.5 L11 13"}],["path",{d:"M17 13.5 V18.5 C17 19.1 16.6 19.5 16 19.5 H5.5 C4.9 19.5 4.5 19.1 4.5 18.5 V8 C4.5 7.4 4.9 7 5.5 7 H10.5"}]]},$2={fill:"none","stroke-width":1.5,"stroke-linecap":"round","stroke-linejoin":"round"},D2=[{type:"mail",label:"Mail task"},{type:"http",label:"HTTP task",fields:{requestMethod:"GET"}},{type:"shell",label:"Shell task"},{type:"camel",label:"Camel task"},{type:"dmn",label:"Decision task"},{type:"case",label:"Case task"},{type:"send-event",label:"Send event task"},{type:"external-worker",label:"External worker task"}],B2=["flowable:type","flowable:class","flowable:expression","flowable:delegateExpression","flowable:resultVariableName","flowable:resultVariable","flowable:useLocalScopeForResultVariable","flowable:storeResultVariableAsTransient","flowable:triggerable","flowable:parallelInSameTransaction","flowable:caseDefinitionKey","flowable:caseInstanceName","flowable:businessKey","flowable:inheritBusinessKey","flowable:inheritVariables","flowable:fallbackToDefaultTenant","flowable:idVariableName","flowable:topic","flowable:doNotIncludeVariables"],L2=["flowable:Field","flowable:HttpRequestHandler","flowable:HttpResponseHandler","flowable:In","flowable:Out","flowable:ExternalWorkerInParameter","flowable:ExternalWorkerOutParameter","flowable:EventInParameter","flowable:EventOutParameter","flowable:EventType","flowable:TriggerEventType","flowable:SendSynchronously","flowable:TriggerEventCorrelationParameter","flowable:ChannelKey","flowable:SystemChannel"];function I2(e){const t=e&&e.businessObject;return vr(t,"bpmn:ServiceTask")?(n=t.get("flowable:type"),D2.find(e=>e.type===n)||null):null;var n}function N2(e,t){return Object.entries(t.fields||{}).map(([t,n])=>e.create("flowable:Field",{name:t,string:n}))}class z2 extends Ze{constructor(e,t,n){super(t,1500),this._bpmnRenderer=n,this._defaultStrokeColor=e&&e.defaultStrokeColor}canRender(e){return!e.labelTarget&&!!I2(e)}drawShape(e,t,n){const i=this._bpmnRenderer.handlers["bpmn:Task"](e,t,n);return this._drawIcon(e,t,n),i}getShapePath(e){return this._bpmnRenderer.getShapePath(e)}_drawIcon(e,t,n={}){const{type:i}=I2(t),r=Pe("g");xe(r).add("flowable-task-icon"),be(r,{"data-type":i,transform:"translate(5, 5) scale(0.75)",...$2,stroke:to(t,this._defaultStrokeColor,n.stroke)}),M2[i].forEach(([e,t])=>{const n=Pe(e);be(n,t),ge(r,n)}),ge(e,r)}}z2.$inject=["config.bpmnRenderer","eventBus","bpmnRenderer"];var j2={__init__:["typedTaskRenderer"],typedTaskRenderer:["type",z2]};class V2{constructor(e,t,n){this._bpmnReplace=e,this._modeling=t,this._bpmnFactory=n}preExecute(e){const{element:t,taskType:n}=e,i=vr(t,"bpmn:ServiceTask")?t:this._bpmnReplace.replaceElement(t,{type:"bpmn:ServiceTask"}),r=i.businessObject,{attributes:o,values:s}=function(e,t,n){const i={};B2.forEach(t=>{void 0!==e.get(t)&&(i[t]=void 0)}),t&&(i["flowable:type"]=t.type);const r=e.get("extensionElements"),o=r&&r.get("values")||[],s=o.filter(e=>!L2.some(t=>vr(e,t))),a=t?N2(n,t):[],l=s.length!==o.length||a.length?[...a,...s]:null;return{attributes:i,values:l}}(r,n,this._bpmnFactory);Object.keys(o).length&&this._modeling.updateModdleProperties(i,r,o),s&&this._setExtensionValues(i,r,s),e.newElement=i}_setExtensionValues(e,t,n){let i=t.get("extensionElements");i||(i=this._bpmnFactory.create("bpmn:ExtensionElements",{values:[]}),i.$parent=t),n.forEach(e=>{e.$parent=i}),this._modeling.updateModdleProperties(e,i,{values:n})}}V2.$inject=["bpmnReplace","modeling","bpmnFactory"];class F2{constructor(e,t,n,i,r){this._create=t,this._elementFactory=n,this._bpmnFactory=i,this._translate=r,e.registerProvider(this)}getPaletteEntries(){return e=>{const t={};return D2.forEach(e=>{const n=t=>this._create.start(t,this.createShape(e.type));var i;t[`create.flowable-${e.type}-task`]={group:"flowable-tasks",className:`flowable-icon flowable-icon-${e.type}`,title:this._translate(`Create ${i=e.label,/^[A-Z][A-Z]/.test(i)?i:i.charAt(0).toLowerCase()+i.slice(1)}`),action:{dragstart:n,click:n}}}),{...e,...t}}}createShape(e){const t=D2.find(t=>t.type===e);if(!t)throw new Error(`unknown task type <${e}>`);const n=this._bpmnFactory.create("bpmn:ServiceTask",{"flowable:type":e}),i=N2(this._bpmnFactory,t);if(i.length){const e=this._bpmnFactory.create("bpmn:ExtensionElements",{values:i});e.$parent=n,i.forEach(t=>{t.$parent=e}),n.set("extensionElements",e)}return this._elementFactory.createShape({type:"bpmn:ServiceTask",businessObject:n})}}F2.$inject=["palette","create","elementFactory","bpmnFactory","translate"];const q2="flowable-tasks",H2="Flowable tasks";class W2{constructor(e,t,n,i){this._commandStack=t,this._rules=n,this._translate=i,e.registerProvider("bpmn-replace",this)}getPopupMenuEntries(e){return t=>({...t,...this._getEntries(e)})}_getEntries(e){if(Array.isArray(e)||!yr(e,["bpmn:Task","bpmn:CallActivity"])||!this._rules.allowed("shape.replace",{element:e}))return{};const t=this._translate,n=I2(e),i={id:q2,name:t(H2)},r={};return n&&(r["replace-with-flowable-service-task"]={label:t("Service task"),className:"bpmn-icon-service",group:i,action:()=>this._replace(e,null)}),D2.filter(e=>e!==n).forEach(n=>{r[`replace-with-flowable-${n.type}-task`]={label:t(n.label),className:`flowable-icon flowable-icon-${n.type}`,group:i,action:()=>this._replace(e,n)}}),r}_replace(e,t){const n={element:e,taskType:t};return this._commandStack.execute("flowable.replaceWithTypedTask",n),n.newElement}}W2.$inject=["popupMenu","commandStack","rules","translate"];var Q2,X2,G2={__init__:["typedTaskPaletteProvider","typedTaskReplaceMenuProvider",["commandStack",e=>e.registerHandler("flowable.replaceWithTypedTask",V2)]],typedTaskPaletteProvider:["type",F2],typedTaskReplaceMenuProvider:["type",W2]};function U2(){if(X2)return Q2;return X2=1,Q2=function e(t,n){const i=n.enter,r=n.leave,o=i&&i(t),s=t.$descriptor;if(!1!==o&&!s.isGeneric){const i=s.properties.filter(e=>{return!e.isAttr&&!e.isReference&&(t=e.type,!["String","Boolean","Integer","Real"].includes(t));var t});i.forEach(i=>{if(i.name in t){const r=t[i.name];i.isMany?r.forEach(t=>{e(t,n)}):e(r,n)}})}r&&r(t)},Q2}var Y2,K2,Z2,J2,e3,t3,n3,i3,r3,o3,s3,a3,l3=SE(G);function c3(){if(K2)return Y2;K2=1;const e=U2(),{isArray:t,isObject:n,isFunction:i}=l3;class r{constructor({moddleRoot:e,rule:t}){this.rule=t,this.moddleRoot=e,this.messages=[],this.report=this.report.bind(this)}report(e,i,r){let o={id:e,message:i};r&&t(r)&&(o={...o,path:r}),r&&n(r)&&(o={...o,...r}),this.messages.push(o)}}return Y2=function({moddleRoot:t,rule:n}){const o=new r({rule:n,moddleRoot:t}),s=n.check||{},a="leave"in s?s.leave:void 0,l="enter"in s?s.enter:i(s)?s:void 0;if(!l&&!a)throw new Error("no check implemented");return e(t,{enter:l?e=>l(e,o):void 0,leave:a?e=>a(e,o):void 0}),o.messages},Y2}function u3(){if(t3)return e3;t3=1;const e=c3(),{normalizeProduct:t,escapeRegExp:n}=(J2||(J2=1,Z2={normalizeProduct:function(e){const{name:t,pluginPrefix:n=t+"-plugin-"}=e||{};if("string"!=typeof t||!t)throw new Error("must provide <product.name>");return{name:t,pluginPrefix:n}},escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}),Z2),i=(e,t)=>e,r={0:"off",1:"warn",2:"error",3:"info"};return e3={createLinter:function(o){const{name:s,pluginPrefix:a}=t(o),l=new RegExp("^(?:(?:plugin:(?:(@[^/]+)\\/)?([^@]{1}[^/]*)\\/)|"+n(s)+":)([^/]+)$");function c(e){const{config:t={},resolver:n,transformRule:r=i}=e||{};if(void 0===n)throw new Error("must provide <options.resolver>");this.config=t,this.resolver=n,this.transformRule=r,this.cachedRules={},this.cachedConfigs={}}function u(e){return e===s?s:e.startsWith(a)?e:`${a}${e}`}return c.prototype.applyRule=function(t,n){const{config:i,rule:r,category:o,name:s}=n;try{return e({moddleRoot:t,rule:r,config:i}).map(function(e){return{...e,meta:r.meta,category:o}})}catch(e){return console.error("rule <"+s+"> failed with error: ",e),[{message:e.message,category:"rule-error"}]}},c.prototype.resolveRule=function(e,t){const{pkg:n,ruleName:i}=this.parseRuleName(e),r=`${n}-${i}`,o=this.cachedRules[r];return o?Promise.resolve(o):Promise.resolve(this.resolver.resolveRule(n,i)).then(o=>{if(!o)throw new Error(`unknown rule <${e}>`);return this.cachedRules[r]=this.transformRule(o(t),{pkg:n,ruleName:i})})},c.prototype.resolveConfig=function(e){const{pkg:t,configName:n}=this.parseConfigName(e),i=`${t}-${n}`,r=this.cachedConfigs[i];return r?Promise.resolve(r):Promise.resolve(this.resolver.resolveConfig(t,n)).then(n=>{if(!n)throw new Error(`unknown config <${e}>`);return this.cachedConfigs[i]=this.normalizeConfig(n,t)})},c.prototype.resolveRules=function(e){return this.resolveConfiguredRules(e).then(e=>{const t=Object.entries(e).map(([e,t])=>{const{category:n,config:i}=this.parseRuleValue(t);return{name:e,category:n,config:i}}),n=t.filter(e=>"off"!==e.category).map(e=>{const{name:t,config:n}=e;return this.resolveRule(t,n).then(function(t){return{...e,rule:t}})});return Promise.all(n)})},c.prototype.resolveConfiguredRules=function(e){let t=e.extends;return"string"==typeof t&&(t=[t]),void 0===t&&(t=[]),Promise.all(t.map(e=>this.resolveConfig(e).then(e=>this.resolveConfiguredRules(e)))).then(t=>[...t,this.normalizeConfig(e,s).rules].reduce((e,t)=>({...e,...t}),{}))},c.prototype.lint=function(e,t){return t=t||this.config,this.resolveRules(t).then(t=>{const n={};return t.forEach(t=>{const{name:i}=t,r=this.applyRule(e,t);r.length&&(n[i]=r)}),n})},c.prototype.parseRuleValue=function(e){let t,n;return Array.isArray(e)?(t=e[0],n=e[1]):(t=e,n={}),"string"==typeof t&&(t=t.toLowerCase()),t=r[t]||t,{config:n,category:t}},c.prototype.parseRuleName=function(e,t=s){const n=/^(?:(?:(@[^/]+)\/)?([^@]{1}[^/]*)\/)?([^/]+)$/.exec(e);if(!n)throw new Error(`unparseable rule name <${e}>`);const[i,r,o,a]=n;if(!o)return{pkg:t,ruleName:a};return{pkg:`${r?r+"/":""}${u(o)}`,ruleName:a}},c.prototype.parseConfigName=function(e){const t=l.exec(e);if(!t)throw new Error(`unparseable config name <${e}>`);const[n,i,r,o]=t;if(!r)return{pkg:s,configName:o};return{pkg:`${i?i+"/":""}${u(r)}`,configName:o}},c.prototype.getSimplePackageName=function(e){const t=/^(?:(@[^/]+)\/)?([^/]+)$/.exec(e);if(!t)throw new Error(`unparseable package name <${e}>`);const[n,i,r]=t;return`${i?i+"/":""}${function(e){if(e.startsWith(a))return e.substring(a.length);return e}(r)}`},c.prototype.normalizeConfig=function(e,t){const n=e.rules||{},i=Object.keys(n).reduce((e,i)=>{const r=n[i],{pkg:o,ruleName:a}=this.parseRuleName(i,t);return e[o===s?a:`${this.getSimplePackageName(o)}/${a}`]=r,e},{});return{...e,rules:i}},c}},e3}function p3(){if(o3)return r3;o3=1;const{createLinter:e}=u3();return r3=e(i3?n3:(i3=1,n3={name:"bpmnlint"}))}var h3=function(){if(a3)return s3;a3=1;const e=p3();return s3={Linter:e}}();function d3(e,t){var n=e.get("editorActions",!1);n&&n.register({toggleLinting:function(){t.toggle()}})}d3.$inject=["injector","linting"];var f3='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n version="1.1"\n viewBox="0 0 512 512"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:svg="http://www.w3.org/2000/svg">\n <path\n d="M 339.07183,256.00001 463.66713,131.4047 c 15.28961,-15.2896 15.28961,-40.079175 0,-55.381227 l -27.6906,-27.690611 c -15.28961,-15.289602 -40.07917,-15.289602 -55.38123,0 L 256,172.92818 131.4047,48.332862 c -15.2896,-15.289602 -40.079177,-15.289602 -55.381228,0 L 48.332861,76.023473 c -15.2896,15.2896 -15.2896,40.079177 0,55.381227 L 172.92815,256.00001 48.332861,380.59531 c -15.2896,15.2896 -15.2896,40.07917 0,55.38123 l 27.690611,27.69061 c 15.289601,15.28959 40.091628,15.28959 55.381228,0 L 256,339.07184 380.5953,463.66715 c 15.2896,15.28959 40.09162,15.28959 55.38123,0 l 27.6906,-27.69061 c 15.28961,-15.2896 15.28961,-40.07918 0,-55.38123 z"\n fill="currentColor" />\n</svg>\n',m3='<svg version="1.1" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">\n <path d="m256 323.95c-45.518 0-82.419 34.576-82.419 77.229 0 42.652 36.9 77.229 82.419 77.229 45.518 0 82.419-34.577 82.419-77.23 0-42.652-36.9-77.229-82.419-77.229zm-80.561-271.8 11.61 204.35c.544 9.334 8.78 16.64 18.755 16.64h100.39c9.975 0 18.211-7.306 18.754-16.64l11.611-204.35c.587-10.082-7.98-18.56-18.754-18.56h-123.62c-10.775 0-19.34 8.478-18.753 18.56z" fill="currentColor"/>\n</svg>\n',g3='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n viewBox="0 0 512 512"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:svg="http://www.w3.org/2000/svg">\n <path\n fill="currentColor"\n d="m 173.898,439.40356 -166.4,-166.4 c -9.997,-9.997 -9.997,-26.206 0,-36.204 l 36.203,-36.204 c 9.997,-9.998 26.207,-9.998 36.204,0 L 192,312.68956 432.095,72.595562 c 9.997,-9.997 26.207,-9.997 36.204,0 l 36.203,36.203998 c 9.997,9.997 9.997,26.206 0,36.204 l -294.4,294.401 c -9.998,9.997 -26.207,9.997 -36.204,-10e-4 z" />\n</svg>\n',v3='<svg\n viewBox="3.5 3.5 9 9"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg">\n <path\n fill="currentColor" d="M6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path>\n</svg>',y3={resolver:{resolveRule:function(){return null}},config:{}},b3={error:f3,warning:m3,success:g3,info:v3,inactive:g3};function w3(e,t,n,i,r,o,s){this._bpmnjs=e,this._canvas=t,this._elementRegistry=i,this._eventBus=r,this._overlays=o,this._translate=s,this._issues={},this._active=n&&n.active||!1,this._linterConfig=y3,this._overlayIds={};var a=this;r.on(["import.done","elements.changed","linting.configChanged","linting.toggle"],500,function(e){a.update()}),r.on("linting.toggle",function(e){e.active||(a._clearIssues(),a._updateButton())}),r.on("diagram.clear",function(){a._clearIssues()});var l=n&&n.bpmnlint;l&&r.once("diagram.init",function(){if(a.getLinterConfig()===y3)try{a.setLinterConfig(l)}catch(e){console.error("[bpmn-js-bpmnlint] Invalid lint rules configured. Please doublecheck your linting.bpmnlint configuration, cf. https://github.com/bpmn-io/bpmn-js-bpmnlint#configure-lint-rules")}}),this._init()}w3.prototype.setLinterConfig=function(e){if(!e.config||!e.resolver)throw new Error("Expected linterConfig = { config, resolver }");this._linterConfig=e,this._eventBus.fire("linting.configChanged")},w3.prototype.getLinterConfig=function(){return this._linterConfig},w3.prototype._init=function(){this._createButton(),this._updateButton()},w3.prototype.isActive=function(){return this._active},w3.prototype._formatIssues=function(e){let t=this,n=k(e,function(e,t,n){return e.concat(t.map(function(e){return e.rule=n,e}))},[]);const i=t._elementRegistry.filter(e=>vr(e,"bpmn:Participant")).map(e=>e.businessObject);return n=P(n,function(e){if(!t._elementRegistry.get(e.id)){e.isChildIssue=!0,e.actualElementId=e.id;const n=i.filter(t=>t.processRef&&t.processRef.id&&t.processRef.id===e.id);n.length?e.id=n[0].id:e.id=t._canvas.getRootElement().id}return e}),n=M(n,function(e){return e.id}),n},w3.prototype.toggle=function(e){return e=void 0===e?!this.isActive():e,this._setActive(e),e},w3.prototype._setActive=function(e){this._active!==e&&(this._active=e,this._eventBus.fire("linting.toggle",{active:e}))},w3.prototype.update=function(){var e=this;if(this._bpmnjs.getDefinitions()){var t=this._lintStart=Math.random();this.lint().then(function(n){if(e._lintStart===t){n=e._formatIssues(n);var i={},r={},o={};for(var s in e._issues)n[s]||(i[s]=e._issues[s]);for(var a in n)e._issues[a]?n[a]!==e._issues[a]&&(r[a]=n[a]):o[a]=n[a];i=q(i,r),o=q(o,r),e._clearOverlays(),e.isActive()&&e._createIssues(o),e._issues=n,e._updateButton(),e._fireComplete(n)}})}},w3.prototype._fireComplete=function(e){this._eventBus.fire("linting.completed",{issues:e})},w3.prototype._createIssues=function(e){for(var t in e)this._createElementIssues(t,e[t])},w3.prototype._createElementIssues=function(e,t){var n=this._elementRegistry.get(e);if(n){var i,r,o=this._elementRegistry.get(e+"_plane");o&&this._createElementIssues(o.id,t);var s=!n.parent;s&&vr(n,"bpmn:Process")?(i="bottom-right",r={top:20,left:150}):s&&vr(n,"bpmn:SubProcess")?(i="bottom-right",r={top:50,left:150}):(i="top-right",r={top:-7,left:-7});var a=M(t,function(e){return(e.isChildIssue?"child":"")+e.category}),l=a.error,c=a.warn,u=a.info,p=a.childerror,h=a.childwarn,d=a.childinfo;if(u||l||c||p||h||d){var f=Y('<div class="bjsl-overlay bjsl-issues-'+i+'"></div>'),m=Y(l||p?'<div class="bjsl-icon bjsl-icon-error">'+f3+"</div>":c||h?'<div class="bjsl-icon bjsl-icon-warning">'+m3+"</div>":'<div class="bjsl-icon bjsl-icon-info">'+v3+"</div>"),g=Y('<div class="bjsl-dropdown"></div>'),v=Y('<div class="bjsl-dropdown-content"></div>'),y=Y('<div class="bjsl-issues"></div>'),b=Y('<div class="bjsl-current-element-issues"></div>'),w=Y("<ul></ul>");if(f.appendChild(m),f.appendChild(g),g.appendChild(v),v.appendChild(y),y.appendChild(b),b.appendChild(w),l&&this._addErrors(w,l),c&&this._addWarnings(w,c),u&&this._addInfos(w,u),p||h||d){var x=Y('<div class="bjsl-child-issues"></div>'),_=Y("<ul></ul>"),E=Y('<a class="bjsl-issue-heading">'+this._translate("Issues for child elements")+":</a>");if(p&&this._addErrors(_,p),h&&this._addWarnings(_,h),d&&this._addInfos(_,d),l||c){var S=Y("<hr/>");x.appendChild(S)}x.appendChild(E),x.appendChild(_),y.appendChild(x)}this._overlayIds[e]=this._overlays.add(n,"linting",{position:r,html:f,scale:{min:.7}})}}},w3.prototype._addErrors=function(e,t){var n=this;t.forEach(function(t){n._addEntry(e,"error",t)})},w3.prototype._addWarnings=function(e,t){var n=this;t.forEach(function(t){n._addEntry(e,"warning",t)})},w3.prototype._addInfos=function(e,t){var n=this;t.forEach(function(t){n._addEntry(e,"info",t)})},w3.prototype._addEntry=function(e,t,n){var i=n.rule,r=n.meta?.documentation.url,o=this._translate(n.message),s=n.actualElementId,a=b3[t],l=Y(`\n <li class="${t}" data-rule="${Xo(i)}">\n <span class="icon">${a}</span>\n <span class="message">${Xo(o)}</span>\n <span class="rule">(${r?`<a href="${Xo(r)}" target="_blank">${Xo(i)}</a>`:Xo(i)})</span>\n ${s?`<span class="bjsl-id-hint"><code>${Xo(s)}</code></span>`:""}\n </li>\n `);e.appendChild(l)},w3.prototype._clearOverlays=function(){this._overlays.remove({type:"linting"}),this._overlayIds={}},w3.prototype._clearIssues=function(){this._issues={},this._clearOverlays()},w3.prototype._setButtonState=function(e){var{errors:t,warnings:n,infos:i}=e,r=this._button,o=(t?"error":n&&"warning")||"success",s=`\n <span class="icon">${b3[o]}</span>\n <span>${this._translate(t||n?"{errors} Errors, {warnings} Warnings":"No Issues",{errors:String(t),warnings:String(n),infos:String(i)})}</span>`;o=this.isActive()?o:"inactive",["error","inactive","success","warning"].forEach(function(e){o===e?r.classList.add("bjsl-button-"+e):r.classList.remove("bjsl-button-"+e)}),r.innerHTML=s},w3.prototype._updateButton=function(){var e=0,t=0,n=0;for(var i in this._issues)this._issues[i].forEach(function(i){"error"===i.category?e++:"warn"===i.category?t++:"info"===i.category&&n++});this._setButtonState({errors:e,warnings:t,infos:n})},w3.prototype._createButton=function(){var e=this;this._button=Y('<button class="bjsl-button bjsl-button-inactive" title="'+this._translate("Toggle linting overlays")+'"></button>'),this._button.addEventListener("click",function(){e.toggle()}),this._canvas.getContainer().appendChild(this._button)},w3.prototype.lint=function(){var e=this._bpmnjs.getDefinitions();return new h3.Linter(this._linterConfig).lint(e)},w3.$inject=["bpmnjs","canvas","config.linting","elementRegistry","eventBus","overlays","translate"];var x3,_3,E3,S3,k3={__init__:["linting","lintingEditorActions"],linting:["type",w3],lintingEditorActions:["type",d3]};var O3=(S3||(S3=1,E3=function(){if(_3)return x3;function e(e){this.cache=e}return _3=1,x3=e,e.prototype.resolveRule=function(e,t){return this.resolve("rule",e,t)},e.prototype.resolveConfig=function(e,t){return this.resolve("config",e,t)},e.prototype.resolve=function(e,t,n){const i=`${t}/${n}`,r=this.cache[`${e}:${i}`];if(!r)throw new Error(`unknown ${e} <${i}>`);return r},x3}()),E3),C3=EE(O3);const P3=["flowable:class","flowable:expression","flowable:delegateExpression","flowable:type"],A3={http:[e=>M3(e,"requestUrl"),"HTTP task has no request URL"],shell:[e=>M3(e,"command"),"Shell task has no command"],dmn:[e=>M3(e,"decisionTableReferenceKey"),"Decision task has no decision table key"],case:[e=>e.get("flowable:caseDefinitionKey"),"Case task has no case definition key"],"send-event":[e=>function(e,t){const n=R3(e,t)[0];return n?n.get("body"):null}(e,"flowable:EventType"),"Send event task has no event key"],"external-worker":[e=>e.get("flowable:topic"),"External worker task has no topic"]};function T3(e){return"string"==typeof e?!!e.trim():!!e}function R3(e,t){const n=e.get("extensionElements");return(n&&n.get("values")||[]).filter(e=>e.$instanceOf(t))}function M3(e,t){const n=R3(e,"flowable:Field").find(e=>e.get("name")===t);if(!n)return null;const i=n.get("expressionElement");return n.get("string")||n.get("stringValue")||n.get("expression")||i&&i.get("body")||null}const $3=/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+(\.\d+)?S)?)?$/,D3=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/,B3=/^([0-9*?/,LW#A-Za-z-]+\s+){5,6}[0-9*?/,LW#A-Za-z-]+$/;function L3(e){return $3.test(e.trim())}function I3(e){return D3.test(e.trim())}function N3(e){const t=e.trim().split("/");if(!/^R\d*$/.test(t[0]))return!1;const n=t.slice(1);if(1===n.length)return L3(n[0]);if(2===n.length){const[e,t]=n;return I3(e)&&(L3(t)||I3(t))||L3(e)&&I3(t)}return!1}function z3(e){return B3.test(e.trim())}function j3(e){const t=e&&e.get("body");return"string"==typeof t?t:""}function V3(e,t,n,i,r,o=!1){n&&n.trim()?function(e){return/[$#]\{/.test(e||"")}(n)||i(n)||t.report(e.id,r):o&&t.report(e.id,r)}const F3="bpmnlint-plugin-flowable",q3={"called-element":function(){return{check:function(e,t){if(!e.$instanceOf("bpmn:CallActivity"))return;const n=e.get("calledElement");n&&n.trim()||t.report(e.id,"Call activity has no called element")}}},"service-task-implementation":function(){return{check:function(e,t){if(!e.$instanceOf("bpmn:ServiceTask"))return;const n=P3.some(t=>T3(e.get(t)))||"##WebService"===e.get("implementation")&&e.get("operationRef");if(!n)return void t.report(e.id,"Service task has no implementation: set a Java class, an expression, a delegate expression or a type");const i=A3[e.get("flowable:type")];i&&!T3(i[0](e))&&t.report(e.id,i[1])}}},"valid-durations":function(){return{check:function(e,t){e.$instanceOf("bpmn:UserTask")&&V3(e,t,e.get("flowable:dueDate"),e=>L3(e)||I3(e),"Due date must be an ISO 8601 date or duration, for example P2DT4H"),e.$instanceOf("bpmn:TimerEventDefinition")&&function(e,t){const n=e.$parent,i=n&&n.id;if(!i)return;const r=e.get("timeDate"),o=e.get("timeDuration"),s=e.get("timeCycle");if(!r&&!o&&!s)return void t.report(i,"Timer has no date, duration or cycle");r&&V3(n,t,j3(r),I3,"Timer date must be an ISO 8601 date, for example 2026-12-31T17:00:00",!0);o&&V3(n,t,j3(o),L3,"Timer duration must be an ISO 8601 duration, for example PT15M",!0);s&&(V3(n,t,j3(s),e=>N3(e)||z3(e),"Timer cycle must be an ISO 8601 repeating interval or a cron expression, for example R3/PT1H",!0),V3(n,t,s.get("flowable:endDate"),I3,"Timer cycle end date must be an ISO 8601 date, for example 2026-12-31T17:00:00"))}(e,t),e.$instanceOf("bpmn:Activity")&&function(e,t){const n=e.get("extensionElements"),i=n&&n.get("values")||[];return i.filter(e=>e.$instanceOf(t))}(e,"flowable:FailedJobRetryTimeCycle").forEach(n=>{V3(e,t,j3(n),e=>N3(e)||z3(e),"Retry time cycle must be an ISO 8601 repeating interval, for example R5/PT10M")})}}}},H3={rules:Object.fromEntries(Object.keys(q3).map(e=>[`flowable/${e}`,"error"]))};class W3{constructor(e,t,n){t.once("diagram.init",()=>{e&&e.bpmnlint||n.setLinterConfig(function(e=H3){const t={};return Object.entries(q3).forEach(([e,n])=>{t[`rule:${F3}/${e}`]=n}),t[`config:${F3}/recommended`]=H3,{config:e,resolver:new C3(t)}}()),e&&!1===e.active||n.toggle(!0)})}}W3.$inject=["config.linting","eventBus","linting"];var Q3={__depends__:[k3],__init__:["flowableLinting"],flowableLinting:["type",W3]};class X3 extends xx{constructor(e){super(function(e={}){return{...e,bpmnRenderer:{...P2,...e.bpmnRenderer}}}(e))}createDiagram(e){return this.importXML(T2(e))}}return X3.prototype._flowableModules=[C2,j2,b2,fU,ZY,Y1,G2,Q3],X3.prototype._modules=[...xx.prototype._modules,...X3.prototype._flowableModules],X3.prototype._moddleExtensions={flowable:w2},X3}();