@sunspirytus/xflow-extension 1.0.52-2 → 1.0.52-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -31,7 +31,7 @@
31
31
  Copyright (c) 2018 Jed Watson.
32
32
  Licensed under the MIT License (MIT), see
33
33
  http://jedwatson.github.io/classnames
34
- */!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,r(n)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var r="";for(var i in e)t.call(e,i)&&e[i]&&(r=o(r,i));return r}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(yr);var br,xr=yr.exports;let wr;var _r,Er;!function(e){function t(e){return{dispose:e}}e.is=function(e){return!!e&&"object"==typeof e&&"dispose"in e&&"function"==typeof e.dispose},e.create=t,e.NONE=t(()=>{})}(br||(br={})),function(e){e.None=()=>br.NONE,e.map=function(e,t){return(n,r)=>e(e=>n.call(r,t(e)),void 0)}}(_r||(_r={})),wr=Symbol.iterator;class Sr{constructor(e=!1){this.mono=void 0,this._callbacks=void 0,this.mono=e}get callbacks(){return this._callbacks||(this._callbacks=[]),this._callbacks}get length(){return this.callbacks.length}add(e,t=void 0){this.callbacks.push([e,t])}remove(e,t=void 0){if(this.isEmpty())return;let n=!1;for(let r=0;r<this.length;r+=1)if(this.callbacks[r][0]===e){if(this.callbacks[r][1]===t)return void this.callbacks.splice(r,1);n=!0}if(n)throw new Error("You should remove it with the same context you add it")}[wr](){if(this.isEmpty())return[][Symbol.iterator]();return this.callbacks.slice(0).map(e=>(...t)=>e[0].apply(e[1],t))[Symbol.iterator]()}invoke(...e){const t=[];for(const n of this)try{t.push(n(...e))}catch(e){console.error(e)}return t}isEmpty(){return 0===this.callbacks.length}dispose(){this._callbacks=void 0}}class Cr{constructor(e={}){this.options=void 0,this._event=void 0,this._callbacks=void 0,this.disposed=!1,this.options=e}get callbacks(){return this._callbacks||(this._callbacks=new Sr),this._callbacks}get event(){return this._event||(this._event=(e,t)=>{this.options.onFirstListenerAdd&&this.callbacks.isEmpty()&&this.options.onFirstListenerAdd(this),this.callbacks.add(e,t);const n={dispose:()=>{n.dispose=Cr.noop,this.disposed||(this.callbacks.remove(e,t),n.dispose=Cr.noop,this.options.onLastListenerRemove&&this.callbacks.isEmpty()&&this.options.onLastListenerRemove(this))}};return n}),this._event}fire(e){this._callbacks&&this.callbacks.invoke(e)}async sequence(e){for(const t of this.callbacks){if(!await e(t))break}}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0),this.disposed=!0}}Cr.noop=()=>{},function(e){function t(e){return{dispose:e}}e.is=function(e){return!!e&&"object"==typeof e&&"dispose"in e&&"function"==typeof e.dispose},e.create=t,e.NULL=t(()=>{})}(Er||(Er={}));class Or{constructor(...e){this.disposables=[],this.onDisposeEmitter=new Cr,this.disposingElements=!1,e.forEach(e=>this.push(e))}get onDispose(){return this.onDisposeEmitter.event}checkDisposed(){this.disposed&&!this.disposingElements&&(this.onDisposeEmitter.fire(void 0),this.onDisposeEmitter.dispose())}get disposed(){return 0===this.disposables.length}dispose(){return x(this,void 0,void 0,function*(){if(!this.disposed&&!this.disposingElements){for(this.disposingElements=!0;!this.disposed;)try{const e=this.disposables.pop();yield e.dispose()}catch(e){console.error(e)}this.disposingElements=!1,this.checkDisposed()}})}push(e){const{disposables:t}=this;t.push(e);const n=e.dispose.bind(e),r=Er.create(()=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1),this.checkDisposed()});return e.dispose=()=>{r.dispose(),n()},r}pushAll(e){return e.map(e=>this.push(e))}}class kr{constructor(){this.isResolved=!1,this.isRejected=!1,this.promise=new Promise((e,t)=>{this.resolve=(...t)=>{this.isResolved=!0,e(...t)},this.reject=(...e)=>{this.isRejected=!0,t(...e)}})}}const Mr="X6_NODE_PORTAL_NODE_VIEW",Nr="XFLOW_DEFAULT_NODE",Ar="XFLOW_DEFAULT_EDGE",Tr="XFLOW_COPY_ITEMS",Pr={width:180,height:36};function Dr(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})}var jr=t.createContext({});function Ir(e){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ir(e)}function Rr(e){var t=function(e,t){if("object"!=Ir(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ir(t)?t:t+""}function Lr(e,t,n){return(t=Rr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fr(Object(n),!0).forEach(function(t){Lr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Hr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,d=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){d=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ur(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)?Ur(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Br(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function zr(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function Vr(e){return e<=1?"".concat(100*Number(e),"%"):e}function Yr(e){return 1===e.length?"0"+e:String(e)}function Wr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function $r(e){return Kr(e)/255}function Kr(e){return parseInt(e,16)}var Xr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function qr(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,i=null,a=!1,s=!1;return"string"==typeof e&&(e=function(e){if(e=e.trim().toLowerCase(),0===e.length)return!1;var t=!1;if(Xr[e])e=Xr[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=eo.rgb.exec(e);if(n)return{r:n[1],g:n[2],b:n[3]};if(n=eo.rgba.exec(e),n)return{r:n[1],g:n[2],b:n[3],a:n[4]};if(n=eo.hsl.exec(e),n)return{h:n[1],s:n[2],l:n[3]};if(n=eo.hsla.exec(e),n)return{h:n[1],s:n[2],l:n[3],a:n[4]};if(n=eo.hsv.exec(e),n)return{h:n[1],s:n[2],v:n[3]};if(n=eo.hsva.exec(e),n)return{h:n[1],s:n[2],v:n[3],a:n[4]};if(n=eo.hex8.exec(e),n)return{r:Kr(n[1]),g:Kr(n[2]),b:Kr(n[3]),a:$r(n[4]),format:t?"name":"hex8"};if(n=eo.hex6.exec(e),n)return{r:Kr(n[1]),g:Kr(n[2]),b:Kr(n[3]),format:t?"name":"hex"};if(n=eo.hex4.exec(e),n)return{r:Kr(n[1]+n[1]),g:Kr(n[2]+n[2]),b:Kr(n[3]+n[3]),a:$r(n[4]+n[4]),format:t?"name":"hex8"};if(n=eo.hex3.exec(e),n)return{r:Kr(n[1]+n[1]),g:Kr(n[2]+n[2]),b:Kr(n[3]+n[3]),format:t?"name":"hex"};return!1}(e)),"object"==typeof e&&(to(e.r)&&to(e.g)&&to(e.b)?(t=function(e,t,n){return{r:255*zr(e,255),g:255*zr(t,255),b:255*zr(n,255)}}(e.r,e.g,e.b),a=!0,s="%"===String(e.r).substr(-1)?"prgb":"rgb"):to(e.h)&&to(e.s)&&to(e.v)?(r=Vr(e.s),o=Vr(e.v),t=function(e,t,n){e=6*zr(e,360),t=zr(t,100),n=zr(n,100);var r=Math.floor(e),o=e-r,i=n*(1-t),a=n*(1-o*t),s=n*(1-(1-o)*t),l=r%6;return{r:255*[n,a,i,i,s,n][l],g:255*[s,n,n,a,i,i][l],b:255*[i,i,s,n,n,a][l]}}(e.h,r,o),a=!0,s="hsv"):to(e.h)&&to(e.s)&&to(e.l)&&(r=Vr(e.s),i=Vr(e.l),t=function(e,t,n){var r,o,i;if(e=zr(e,360),t=zr(t,100),n=zr(n,100),0===t)o=n,i=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Wr(s,a,e+1/3),o=Wr(s,a,e),i=Wr(s,a,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,r,i),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Zr="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),Jr="[\\s|\\(]+(".concat(Zr,")[,|\\s]+(").concat(Zr,")[,|\\s]+(").concat(Zr,")\\s*\\)?"),Qr="[\\s|\\(]+(".concat(Zr,")[,|\\s]+(").concat(Zr,")[,|\\s]+(").concat(Zr,")[,|\\s]+(").concat(Zr,")\\s*\\)?"),eo={CSS_UNIT:new RegExp(Zr),rgb:new RegExp("rgb"+Jr),rgba:new RegExp("rgba"+Qr),hsl:new RegExp("hsl"+Jr),hsla:new RegExp("hsla"+Qr),hsv:new RegExp("hsv"+Jr),hsva:new RegExp("hsva"+Qr),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function to(e){return Boolean(eo.CSS_UNIT.exec(String(e)))}var no=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function ro(e){var t=function(e,t,n){e=zr(e,255),t=zr(t,255),n=zr(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=r,s=r-o,l=0===r?0:s/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/s+(t<n?6:0);break;case t:i=(n-e)/s+2;break;case n:i=(e-t)/s+4}i/=6}return{h:i,s:l,v:a}}(e.r,e.g,e.b);return{h:360*t.h,s:t.s,v:t.v}}function oo(e){var t=e.r,n=e.g,r=e.b;return"#".concat(function(e,t,n,r){var o=[Yr(Math.round(e).toString(16)),Yr(Math.round(t).toString(16)),Yr(Math.round(n).toString(16))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}(t,n,r,!1))}function io(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function ao(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function so(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function lo(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=qr(e),o=5;o>0;o-=1){var i=ro(r),a=oo(qr({h:io(i,o,!0),s:ao(i,o,!0),v:so(i,o,!0)}));n.push(a)}n.push(oo(r));for(var s=1;s<=4;s+=1){var l=ro(r),d=oo(qr({h:io(l,s),s:ao(l,s),v:so(l,s)}));n.push(d)}return"dark"===t.theme?no.map(function(e){var r=e.index,o=e.opacity,i=oo(function(e,t,n){var r=n/100;return{r:(t.r-e.r)*r+e.r,g:(t.g-e.g)*r+e.g,b:(t.b-e.b)*r+e.b}}(qr(t.backgroundColor||"#141414"),qr(n[r]),100*o));return i}):n}var co={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},uo={},fo={};Object.keys(co).forEach(function(e){uo[e]=lo(co[e]),uo[e].primary=uo[e][5],fo[e]=lo(co[e],{theme:"dark",backgroundColor:"#141414"}),fo[e].primary=fo[e][5]});var ho={};function po(e,t){}function go(e,t){}function vo(e,t,n){t||ho[n]||(e(!1,n),ho[n]=!0)}function mo(e,t){vo(po,e,t)}mo.preMessage=function(e){},mo.resetWarned=function(){ho={}},mo.noteOnce=function(e,t){vo(go,e,t)};var yo="data-rc-order",bo="data-rc-priority",xo=new Map;function wo(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mark;return e?e.startsWith("data-")?e:"data-".concat(e):"rc-util-key"}function _o(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Eo(e){return Array.from((xo.get(e)||e).children).filter(function(e){return"STYLE"===e.tagName})}function So(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"==typeof window||!window.document||!window.document.createElement)return null;var n=t.csp,r=t.prepend,o=t.priority,i=void 0===o?0:o,a=function(e){return"queue"===e?"prependQueue":e?"prepend":"append"}(r),s="prependQueue"===a,l=document.createElement("style");l.setAttribute(yo,a),s&&i&&l.setAttribute(bo,"".concat(i)),null!=n&&n.nonce&&(l.nonce=null==n?void 0:n.nonce),l.innerHTML=e;var d=_o(t),c=d.firstChild;if(r){if(s){var u=(t.styles||Eo(d)).filter(function(e){if(!["prepend","prependQueue"].includes(e.getAttribute(yo)))return!1;var t=Number(e.getAttribute(bo)||0);return i>=t});if(u.length)return d.insertBefore(l,u[u.length-1].nextSibling),l}d.insertBefore(l,c)}else d.appendChild(l);return l}function Co(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=_o(n),o=Eo(r),i=Gr(Gr({},n),{},{styles:o});!function(e,t){var n=xo.get(e);if(!n||!function(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}(document,n)){var r=So("",t),o=r.parentNode;xo.set(e,o),e.removeChild(r)}}(r,i);var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=_o(t);return(t.styles||Eo(n)).find(function(n){return n.getAttribute(wo(t))===e})}(t,i);if(a){var s,l,d;if(null!==(s=i.csp)&&void 0!==s&&s.nonce&&a.nonce!==(null===(l=i.csp)||void 0===l?void 0:l.nonce))a.nonce=null===(d=i.csp)||void 0===d?void 0:d.nonce;return a.innerHTML!==e&&(a.innerHTML=e),a}var c=So(e,i);return c.setAttribute(wo(i),t),c}var Oo="object"==typeof _&&_&&_.Object===Object&&_,ko=Oo,Mo="object"==typeof self&&self&&self.Object===Object&&self,No=ko||Mo||Function("return this")(),Ao=No.Symbol;var To=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o},Po=Array.isArray,Do=Ao,jo=Object.prototype,Io=jo.hasOwnProperty,Ro=jo.toString,Lo=Do?Do.toStringTag:void 0;var Fo=function(e){var t=Io.call(e,Lo),n=e[Lo];try{e[Lo]=void 0;var r=!0}catch(e){}var o=Ro.call(e);return r&&(t?e[Lo]=n:delete e[Lo]),o},Go=Object.prototype.toString;var Uo=Fo,Ho=function(e){return Go.call(e)},Bo=Ao?Ao.toStringTag:void 0;var zo=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Bo&&Bo in Object(e)?Uo(e):Ho(e)};var Vo=function(e){return null!=e&&"object"==typeof e},Yo=zo,Wo=Vo;var $o=function(e){return"symbol"==typeof e||Wo(e)&&"[object Symbol]"==Yo(e)},Ko=To,Xo=Po,qo=$o,Zo=Ao?Ao.prototype:void 0,Jo=Zo?Zo.toString:void 0;var Qo=function e(t){if("string"==typeof t)return t;if(Xo(t))return Ko(t,e)+"";if(qo(t))return Jo?Jo.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},ei=Qo;var ti=function(e){return null==e?"":ei(e)};var ni=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i};var ri=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:ni(e,t,n)},oi=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var ii=function(e){return oi.test(e)};var ai=function(e){return e.split("")},si="\\ud800-\\udfff",li="["+si+"]",di="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ci="\\ud83c[\\udffb-\\udfff]",ui="[^"+si+"]",fi="(?:\\ud83c[\\udde6-\\uddff]){2}",hi="[\\ud800-\\udbff][\\udc00-\\udfff]",pi="(?:"+di+"|"+ci+")"+"?",gi="[\\ufe0e\\ufe0f]?",vi=gi+pi+("(?:\\u200d(?:"+[ui,fi,hi].join("|")+")"+gi+pi+")*"),mi="(?:"+[ui+di+"?",di,fi,hi,li].join("|")+")",yi=RegExp(ci+"(?="+ci+")|"+mi+vi,"g");var bi=ai,xi=ii,wi=function(e){return e.match(yi)||[]};var _i=ri,Ei=ii,Si=function(e){return xi(e)?wi(e):bi(e)},Ci=ti;var Oi=function(e){return function(t){t=Ci(t);var n=Ei(t)?Si(t):void 0,r=n?n[0]:t.charAt(0),o=n?_i(n,1).join(""):t.slice(1);return r[e]()+o}}("toUpperCase"),ki=ti,Mi=Oi;var Ni=function(e){return Mi(ki(e).toLowerCase())};var Ai=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n};var Ti=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Pi=ti,Di=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ji=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Ii=function(e){return(e=Pi(e))&&e.replace(Di,Ti).replace(ji,"")},Ri=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Li=function(e){return e.match(Ri)||[]},Fi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Gi=function(e){return Fi.test(e)},Ui="\\ud800-\\udfff",Hi="\\u2700-\\u27bf",Bi="a-z\\xdf-\\xf6\\xf8-\\xff",zi="A-Z\\xc0-\\xd6\\xd8-\\xde",Vi="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Yi="["+Vi+"]",Wi="\\d+",$i="["+Hi+"]",Ki="["+Bi+"]",Xi="[^"+Ui+Vi+Wi+Hi+Bi+zi+"]",qi="(?:\\ud83c[\\udde6-\\uddff]){2}",Zi="[\\ud800-\\udbff][\\udc00-\\udfff]",Ji="["+zi+"]",Qi="(?:"+Ki+"|"+Xi+")",ea="(?:"+Ji+"|"+Xi+")",ta="(?:['’](?:d|ll|m|re|s|t|ve))?",na="(?:['’](?:D|LL|M|RE|S|T|VE))?",ra="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",oa="[\\ufe0e\\ufe0f]?",ia=oa+ra+("(?:\\u200d(?:"+["[^"+Ui+"]",qi,Zi].join("|")+")"+oa+ra+")*"),aa="(?:"+[$i,qi,Zi].join("|")+")"+ia,sa=RegExp([Ji+"?"+Ki+"+"+ta+"(?="+[Yi,Ji,"$"].join("|")+")",ea+"+"+na+"(?="+[Yi,Ji+Qi,"$"].join("|")+")",Ji+"?"+Qi+"+"+ta,Ji+"+"+na,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Wi,aa].join("|"),"g");var la=Li,da=Gi,ca=ti,ua=function(e){return e.match(sa)||[]};var fa=Ai,ha=Ii,pa=function(e,t,n){return e=ca(e),void 0===(t=n?void 0:t)?da(e)?ua(e):la(e):e.match(t)||[]},ga=RegExp("['’]","g");var va=Ni,ma=function(e){return function(t){return fa(pa(ha(t).replace(ga,"")),e,"")}}(function(e,t,n){return t=t.toLowerCase(),e+(n?va(t):t)});function ya(e){return"object"===Ir(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===Ir(e.icon)||"function"==typeof e.icon)}function ba(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];if("class"===n)t.className=r,delete t.class;else delete t[n],t[ma(n)]=r;return t},{})}function xa(e,t,n){return n?u.default.createElement(e.tag,Gr(Gr({key:t},ba(e.attrs)),n),(e.children||[]).map(function(n,r){return xa(n,"".concat(t,"-").concat(e.tag,"-").concat(r))})):u.default.createElement(e.tag,Gr({key:t},ba(e.attrs)),(e.children||[]).map(function(n,r){return xa(n,"".concat(t,"-").concat(e.tag,"-").concat(r))}))}function wa(e){return lo(e)[0]}function _a(e){return e?Array.isArray(e)?e:[e]:[]}var Ea=["icon","className","onClick","style","primaryColor","secondaryColor"],Sa={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var Ca=function(e){var n,r,o=e.icon,i=e.className,a=e.onClick,s=e.style,l=e.primaryColor,d=e.secondaryColor,c=Br(e,Ea),u=Sa;if(l&&(u={primaryColor:l,secondaryColor:d||wa(l)}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"\n.anticon {\n display: inline-flex;\n alignItems: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",n=t.useContext(jr).csp;t.useEffect(function(){Co(e,"@ant-design-icons",{prepend:!0,csp:n})},[])}(),n=ya(o),r="icon should be icon definiton, but got ".concat(o),mo(n,"[@ant-design/icons] ".concat(r)),!ya(o))return null;var f=o;return f&&"function"==typeof f.icon&&(f=Gr(Gr({},f),{},{icon:f.icon(u.primaryColor,u.secondaryColor)})),xa(f.icon,"svg-".concat(f.name),Gr({className:i,onClick:a,style:s,"data-icon":f.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},c))};Ca.displayName="IconReact",Ca.getTwoToneColors=function(){return Gr({},Sa)},Ca.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;Sa.primaryColor=t,Sa.secondaryColor=n||wa(t),Sa.calculated=!!n};var Oa=Ca;function ka(e){var t=Hr(_a(e),2),n=t[0],r=t[1];return Oa.setTwoToneColors({primaryColor:n,secondaryColor:r})}var Ma=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];ka("#1890ff");var Na=f.forwardRef(function(e,t){var n=e.className,r=e.icon,o=e.spin,i=e.rotate,a=e.tabIndex,s=e.onClick,l=e.twoToneColor,d=Br(e,Ma),c=f.useContext(jr),u=c.prefixCls,h=void 0===u?"anticon":u,p=c.rootClassName,g=xr(p,h,Lr(Lr({},"".concat(h,"-").concat(r.name),!!r.name),"".concat(h,"-spin"),!!o||"loading"===r.name),n),v=a;void 0===v&&s&&(v=-1);var m=i?{msTransform:"rotate(".concat(i,"deg)"),transform:"rotate(".concat(i,"deg)")}:void 0,y=Hr(_a(l),2),b=y[0],x=y[1];return f.createElement("span",Gr(Gr({role:"img","aria-label":r.name},d),{},{ref:t,tabIndex:v,onClick:s,className:g}),f.createElement(Oa,{icon:r,primaryColor:b,secondaryColor:x,style:m}))});Na.displayName="AntdIcon",Na.getTwoToneColor=function(){var e=Oa.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},Na.setTwoToneColor=ka;var Aa=Na,Ta={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M689 165.1L308.2 493.5c-10.9 9.4-10.9 27.5 0 37L689 858.9c14.2 12.2 35 1.2 35-18.5V183.6c0-19.7-20.8-30.7-35-18.5z"}}]},name:"caret-left",theme:"outlined"},Pa=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ta}))},Da=f.forwardRef(Pa),ja={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"},Ia=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:ja}))},Ra=f.forwardRef(Ia),La={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},Fa=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:La}))},Ga=f.forwardRef(Fa),Ua={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"},Ha=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ua}))},Ba=f.forwardRef(Ha),za={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},Va=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:za}))},Ya=f.forwardRef(Va),Wa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M326 664H104c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h174v176c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V696c0-17.7-14.3-32-32-32zm16-576h-48c-8.8 0-16 7.2-16 16v176H104c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h222c17.7 0 32-14.3 32-32V104c0-8.8-7.2-16-16-16zm578 576H698c-17.7 0-32 14.3-32 32v224c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V744h174c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16zm0-384H746V104c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16v224c0 17.7 14.3 32 32 32h222c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16z"}}]},name:"compress",theme:"outlined"},$a=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Wa}))},Ka=f.forwardRef($a),Xa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},qa=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Xa}))},Za=f.forwardRef(qa),Ja={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},Qa=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ja}))},es=f.forwardRef(Qa),ts={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},ns=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:ts}))},rs=f.forwardRef(ns),os={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},is=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:os}))},as=f.forwardRef(is),ss={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},ls=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:ss}))},ds=f.forwardRef(ls),cs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},us=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:cs}))},fs=f.forwardRef(us),hs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32z"}}]},name:"folder",theme:"filled"},ps=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:hs}))},gs=f.forwardRef(ps),vs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zm-180 0H238c-13 0-24.8 7.9-29.7 20L136 643.2V256h188.5l119.6 114.4H748V444z"}}]},name:"folder-open",theme:"filled"},ms=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:vs}))},ys=f.forwardRef(ms),bs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"},xs=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:bs}))},ws=f.forwardRef(xs),_s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"},Es=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:_s}))},Ss=f.forwardRef(Es),Cs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},Os=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Cs}))},ks=f.forwardRef(Os),Ms={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M316 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8zm196-50c22.1 0 40-17.9 40-39 0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39zm0-140c22.1 0 40-17.9 40-39 0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}},{tag:"path",attrs:{d:"M648 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8z"}}]},name:"one-to-one",theme:"outlined"},Ns=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ms}))},As=f.forwardRef(Ns),Ts={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},Ps=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ts}))},Ds=f.forwardRef(Ps),js={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},Is=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:js}))},Rs=f.forwardRef(Is),Ls={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"},Fs=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ls}))},Gs=f.forwardRef(Fs),Us={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},Hs=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Us}))},Bs=f.forwardRef(Hs),zs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-in",theme:"outlined"},Vs=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:zs}))},Ys=f.forwardRef(Vs),Ws={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-out",theme:"outlined"},$s=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ws}))},Ks=f.forwardRef($s);const Xs=u.default.createContext(null);Xs.displayName="XFlowAppContext";const qs=()=>{const e=u.default.useContext(Xs);return e&&e.getApp?e.getApp():null};var Zs,Js,Qs,el,tl;!function(e){const t="节点操作";e.ADD_NODE={id:"xflow:add-node",label:"添加节点",category:t},e.DEL_NODE={id:"xflow:del-node",label:"删除节点",category:t},e.UPDATE_NODE_PORT={id:"xflow:update-node-port",label:"删除连接桩",category:t},e.UPDATE_NODE={id:"xflow:update-node",label:"更新节点",category:t},e.HIGHLIGHT_NODE={id:"xflow:highlight-node",label:"高亮节点",category:t},e.SELECT_NODE={id:"xflow:select-node",label:"选中节点",category:t},e.MOVE_NODE={id:"xflow:move-node",label:"Move Node",category:t},e.CENTER_NODE={id:"xflow:center-node",label:"居中节点",category:t},e.FRONT_NODE={id:"xflow:front-node",label:"前置节点",category:t},e.BACK_NODE={id:"xflow:back-node",label:"后置节点",category:t}}(Zs||(Zs={})),function(e){const t="边操作";e.ADD_EDGE={id:"xflow:add-edge",label:"添加边",category:t},e.DEL_EDGE={id:"xflow:del-edge",label:"删除边",category:t},e.UPDATE_EDGE={id:"xflow:update-edge",label:"更新边",category:t},e.HIGHLIGHT_EDGE={id:"xflow:highlight-edge",label:"高亮边",category:t},e.FRONT_EDGE={id:"xflow:front-edge",label:"前置变",category:t},e.BACK_EDGE={id:"xflow:back-edge",label:"后置边",category:t}}(Js||(Js={})),function(e){const t="画布操作";e.LOAD_META={id:"xflow:load-meta",label:"获取元数据",category:t},e.LOAD_DATA={id:"xflow:load-data",label:"获取图数据",category:t},e.SAVE_GRAPH_DATA={id:"xflow:save-graph-data",label:"保存",category:t},e.GRAPH_LAYOUT={id:"xflow:layout",label:"计算布局",category:t},e.GRAPH_RENDER={id:"xflow:graph-render",label:"渲染画布",category:t},e.UNDO_CMD={id:"xflow:undo-cmd",label:"撤销",category:t},e.REDO_CMD={id:"xflow:redo-cmd",label:"重做",category:t},e.GRAPH_INSTANCE_COMMAND={id:"xflow:graph-instacne-cmd",label:"Graph通用Command",category:t},e.GRAPH_ZOOM={id:"xflow:graph-zoom",label:"缩放画布",category:t},e.GRAPH_FULLSCREEN={id:"xflow:graph-fullscreen",label:"全屏",category:t},e.GRAPH_RESIZE={id:"xflow:graph-resize",label:"调整窗口大小",category:t},e.GRAPH_COPY={id:"xflow:graph-copy-selection",label:"复制",category:t},e.GRAPH_PASTE={id:"xflow:graph-paste-selection",label:"粘贴",category:t},e.GRAPH_TOGGLE_MULTI_SELECT={id:"xflow:graph-toggle-multi-select",label:"启用框选",category:t},e.GRAPH_ADD_TOOL={id:"xflow:add-tool",label:"添加工具",category:t},e.GRAPH_DEL_TOOL={id:"xflow:del-tool",label:"删除工具",category:t},e.GRAPH_HISTORY_UNDO={id:"xflow:history-undo",label:"history undo",category:t},e.GRAPH_HISTORY_REDO={id:"xflow:history-redo",label:"history redo",category:t},e.GRAPH_HISTORY_RESET={id:"xflow:history-reset",label:"history reset",category:t},e.GRAPH_HISTORY_TOGGLE={id:"xflow:history-toggle",label:"history toggle",category:t}}(Qs||(Qs={})),function(e){e.UPDATE_MODEL={id:"xflow:update-model",label:"设置状态值",category:"状态操作"}}(el||(el={})),function(e){const t="群组操作";e.INIT_GROUP={id:"xflow:init-group",label:"初始化群组",category:t},e.ADD_GROUP={id:"xflow:add-group",label:"新建群组",category:t},e.DEL_GROUP={id:"xflow:del-group",label:"解散群组",category:t},e.COLLAPSE_GROUP={id:"xflow:collapse-group",label:"折叠群组",category:t}}(tl||(tl={}));const nl=e=>{const{cell:t}=e,n=qs(),r=e.data.isCollapsed||!1;return u.default.createElement("div",{className:"xflow-default-group-node"},u.default.createElement("div",{className:"xflow-group-header"},u.default.createElement("div",{className:"header-left"},e.data.label),u.default.createElement("div",{className:"header-right"},r&&u.default.createElement(Ds,{onClick:e=>{e.preventDefault(),n.executeCommand(tl.COLLAPSE_GROUP.id,{nodeId:t.id,isCollapsed:!1})}}),!r&&u.default.createElement(ks,{onClick:e=>{e.preventDefault(),n.executeCommand(tl.COLLAPSE_GROUP.id,{nodeId:t.id,isCollapsed:!0,gap:3})}}))))};nl.displayName="XFlowDefaultGroupNode";const rl={fontSize:"16px",color:"#3057e3"};var ol;!function(e){e.SUCCEEDED="SUCCEEDED",e.RUNNING="RUNNING",e.FAILED="FAILED",e.PENDING="PENDING",e.CREATING="CREATING",e.MANUAL_TERMINATE="MANUAL_TERMINATE",e.CACHED="CACHED",e.QUEUEING="QUEUEING",e.PULLING_IMAGE="PULLING_IMAGE",e.UNKNOWN="UNKNOWN"}(ol||(ol={}));const il=e=>{if(e.hide)return null;switch(e.status){case ol.RUNNING:return u.default.createElement(Gs,{spin:!0,style:{color:"#c1cdf7",fontSize:"16px"}});case ol.FAILED:return u.default.createElement(Ba,{style:{color:"#ff4d4f",fontSize:"16px"}});case ol.SUCCEEDED:return u.default.createElement(Ga,{style:{color:"#39ca74cc",fontSize:"16px"}});case ol.PENDING:return u.default.createElement(fs,{style:{color:"#faad14",fontSize:"16px"}});case ol.CREATING:return u.default.createElement(ds,{style:{color:"#faad14",fontSize:"16px"}});case ol.MANUAL_TERMINATE:return u.default.createElement(Bs,{style:{color:"#faad14",fontSize:"16px"}});case ol.CACHED:return u.default.createElement(Ya,{style:{color:"#faad14",fontSize:"16px"}});case ol.QUEUEING:return u.default.createElement(fs,{style:{color:"#faad14",fontSize:"16px"}});case ol.PULLING_IMAGE:return u.default.createElement(as,{style:{color:"#faad14",fontSize:"16px"}});case ol.UNKNOWN:return u.default.createElement(Rs,{style:{color:"#d9d9d9",fontSize:"16px"}});default:return null}},al=e=>{const t=u.default.isValidElement(e.data.icon)?e.data.icon:u.default.createElement(Za,{style:rl});return u.default.createElement("div",{className:"xflow-default-node "+(e.isNodeTreePanel?"panel-node":"")},u.default.createElement("span",{className:"icon"},t),u.default.createElement("span",{className:"label"},e.data.label),u.default.createElement("span",{className:"status"},u.default.createElement(il,{status:e.data&&e.data.status,hide:e.isNodeTreePanel})))};var sl;al.displayName="XFlowDefaultNode",function(e){e.CONFIG_TYPE="GraphConfig",e.defaultNodeTypeParser=e=>e.renderKey,e.defaultEdgeTypeParser=e=>e.renderKey,e.defaultNodeMapValue=[[Nr,al],["XFLOW_DEFAULT_GROUP_NODE",nl]]}(sl||(sl={}));class ll{constructor(){this.CONFIG_TYPE=sl.CONFIG_TYPE,this.x6Options=new kr,this.rootContainer=new kr,this.graphContainer=new kr,this.nodeRender=new Map(sl.defaultNodeMapValue),this.edgeRender=new Map,this.nodeTypeParser=sl.defaultNodeTypeParser,this.edgeTypeParser=sl.defaultEdgeTypeParser,this.events=[],this.mergeX6Config=e=>x(this,void 0,void 0,function*(){const t=yield this.getX6Config();return Object.assign(t,e)}),this.getX6Config=()=>x(this,void 0,void 0,function*(){return yield this.x6Options.promise}),this.setX6Config=e=>{var t;const n=this.getDefaultGraphOptions();null===(t=this.x6Options)||void 0===t||t.resolve(Object.assign(Object.assign({},n),e))},this.setAppContainer=e=>{this.appContainer=e},this.setRootContainer=e=>{e&&(null==this||this.rootContainer.resolve(e))},this.setGraphContainer=e=>{var t;e&&(null===(t=this.graphContainer)||void 0===t||t.resolve(e))},this.setEvents=e=>{this.events=e},this.setDefaultNodeRender=e=>{this.nodeRender.set(Nr,e)},this.setDefaultEdgeRender=e=>{this.edgeRender.set(Ar,e)},this.setNodeRender=(e,t)=>{this.nodeRender.set(e,t)},this.setEdgeRender=(e,t)=>{this.edgeRender.set(e,t)},this.setNodeTypeParser=e=>{this.nodeTypeParser=e},this.setEdgeTypeParser=e=>{this.edgeTypeParser=e},this.getConfig=()=>x(this,void 0,void 0,function*(){const[e,t,n]=yield Promise.all([this.rootContainer.promise,this.graphContainer.promise,this.x6Options.promise]);return{xflowInstanceId:this.xflowInstanceId,graphId:this.graphId,nodeViewId:this.graphId,appContainer:this.appContainer,rootContainer:e,graphContainer:t,x6Options:n,events:this.events,nodeRender:this.nodeRender,edgeRender:this.edgeRender,nodeTypeParser:this.nodeTypeParser,edgeTypeParser:this.edgeTypeParser}}),this.getDefaultGraphOptions=()=>({rotating:!1,resizing:!1,connecting:{snap:!0,dangling:!1,highlight:!1,connectionPoint:"rect",router:{name:"er"},connector:{name:"rounded",args:{radius:15}}},background:{},grid:{visible:!0},selecting:{strict:!0,enabled:!0,multiple:!0,selectCellOnMoved:!0,showNodeSelectionBox:!1,rubberEdge:!0,rubberNode:!0,movable:!0},snapline:{enabled:!1},history:{enabled:!1},clipboard:{enabled:!0,useLocalStorage:!0},scroller:{enabled:!1},mousewheel:{enabled:!0,minScale:.01,maxScale:1.5,factor:1.1,modifiers:["ctrl","meta"]},panning:{enabled:!0},scaling:{min:.01,max:1.5},keyboard:{enabled:!0},interacting:{nodeMovable:!0,edgeLabelMovable:!1},async:!1}),this.dispose=()=>{this.rootContainer=new kr,this.graphContainer=new kr,this.x6Options=new kr},this.graphId=Dr()}}const dl=Symbol("IGraphOptionProvider");function cl(e){return"function"==typeof e}var ul=!1,fl={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;ul=e},get useDeprecatedSynchronousErrorHandling(){return ul}};function hl(e){setTimeout(function(){throw e},0)}var pl={closed:!0,next:function(e){},error:function(e){if(fl.useDeprecatedSynchronousErrorHandling)throw e;hl(e)},complete:function(){}},gl=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function vl(e){return null!==e&&"object"==typeof e}var ml=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),yl=ml,bl=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this,r=n._parentOrParents,o=n._ctorUnsubscribe,i=n._unsubscribe,a=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var s=0;s<r.length;++s){r[s].remove(this)}if(cl(i)){o&&(this._unsubscribe=void 0);try{i.call(this)}catch(e){t=e instanceof yl?xl(e.errors):[e]}}if(gl(a)){s=-1;for(var l=a.length;++s<l;){var d=a[s];if(vl(d))try{d.unsubscribe()}catch(e){t=t||[],e instanceof yl?t=t.concat(xl(e.errors)):t.push(e)}}}if(t)throw new yl(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof e){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function xl(e){return e.reduce(function(e,t){return e.concat(t instanceof yl?t.errors:t)},[])}var wl=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),_l=function(e){function t(n,r,o){var i=e.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=pl;break;case 1:if(!n){i.destination=pl;break}if("object"==typeof n){n instanceof t?(i.syncErrorThrowable=n.syncErrorThrowable,i.destination=n,n.add(i)):(i.syncErrorThrowable=!0,i.destination=new El(i,n));break}default:i.syncErrorThrowable=!0,i.destination=new El(i,n,r,o)}return i}return v(t,e),t.prototype[wl]=function(){return this},t.create=function(e,n,r){var o=new t(e,n,r);return o.syncErrorThrowable=!1,o},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(bl),El=function(e){function t(t,n,r,o){var i,a=e.call(this)||this;a._parentSubscriber=t;var s=a;return cl(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==pl&&(cl((s=Object.create(n)).unsubscribe)&&a.add(s.unsubscribe.bind(s)),s.unsubscribe=a.unsubscribe.bind(a))),a._context=s,a._next=i,a._error=r,a._complete=o,a}return v(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;fl.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=fl.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):hl(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;hl(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};fl.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),fl.useDeprecatedSynchronousErrorHandling)throw e;hl(e)}},t.prototype.__tryOrSetError=function(e,t,n){if(!fl.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return fl.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(hl(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(_l);var Sl=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Cl(e){return e}var Ol=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,o=function(e,t,n){if(e){if(e instanceof _l)return e;if(e[wl])return e[wl]()}return e||t||n?new _l(e,t,n):new _l(pl)}(e,t,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||fl.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),fl.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){fl.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),!function(e){for(;e;){var t=e,n=t.closed,r=t.destination,o=t.isStopped;if(n||o)return!1;e=r&&r instanceof _l?r:null}return!0}(e)?console.warn(t):e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=kl(t))(function(t,r){var o;o=n.subscribe(function(t){try{e(t)}catch(e){r(e),o&&o.unsubscribe()}},r,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[Sl]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 0===t.length?this:(0===(e=t).length?Cl:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=kl(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function kl(e){if(e||(e=Promise),!e)throw new Error("no Promise impl found");return e}var Ml=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),Nl=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return v(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(bl),Al=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return v(t,e),t}(_l),Tl=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return v(t,e),t.prototype[wl]=function(){return new Al(this)},t.prototype.lift=function(e){var t=new Pl(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new Ml;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].next(e)},t.prototype.error=function(e){if(this.closed)throw new Ml;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new Ml;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new Ml;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new Ml;return this.hasError?(e.error(this.thrownError),bl.EMPTY):this.isStopped?(e.complete(),bl.EMPTY):(this.observers.push(e),new Nl(this,e))},t.prototype.asObservable=function(){var e=new Ol;return e.source=this,e},t.create=function(e,t){return new Pl(e,t)},t}(Ol),Pl=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return v(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):bl.EMPTY},t}(Tl),Dl=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return v(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Ml;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Tl),jl=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return v(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(e){n=!0,r=!!e&&e||new Error(e)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(function(e){function t(t,n){return e.call(this)||this}return v(t,e),t.prototype.schedule=function(e,t){return this},t}(bl)),Il=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}(),Rl=function(e){function t(n,r){void 0===r&&(r=Il.now);var o=e.call(this,n,function(){return t.delegate&&t.delegate!==o?t.delegate.now():r()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return v(t,e),t.prototype.schedule=function(n,r,o){return void 0===r&&(r=0),t.delegate&&t.delegate!==this?t.delegate.schedule(n,r,o):e.prototype.schedule.call(this,n,r,o)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Il),Ll=new Rl(jl),Fl=Ll;var Gl=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Ul(e,this.predicate,this.thisArg))},e}(),Ul=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.predicate=n,o.thisArg=r,o.count=0,o}return v(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(_l);var Hl=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new Bl(e,this.compare,this.keySelector))},e}(),Bl=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.keySelector=r,o.hasKey=!1,"function"==typeof n&&(o.compare=n),o}return v(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t;try{var n=this.keySelector;t=n?n(e):e}catch(e){return this.destination.error(e)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;r||(this.key=t,this.destination.next(e))},t}(_l),zl={leading:!0,trailing:!1};var Vl=function(){function e(e,t,n,r){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new Yl(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),Yl=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.duration=n,a.scheduler=r,a.leading=o,a.trailing=i,a._hasTrailingValue=!1,a._trailingValue=null,a}return v(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Wl,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(_l);function Wl(e){e.subscriber.clearThrottle()}function $l(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(e){return"'"+e+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Kl(e){return!!e&&!!e[Dd]}function Xl(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Id}(e)||Array.isArray(e)||!!e[Pd]||!!(null===(t=e.constructor)||void 0===t?void 0:t[Pd])||ed(e)||td(e))}function ql(e,t,n){void 0===n&&(n=!1),0===Zl(e)?(n?Object.keys:Rd)(e).forEach(function(r){n&&"symbol"==typeof r||t(r,e[r],e)}):e.forEach(function(n,r){return t(r,n,e)})}function Zl(e){var t=e[Dd];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:ed(e)?2:td(e)?3:0}function Jl(e,t){return 2===Zl(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ql(e,t,n){var r=Zl(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function ed(e){return Md&&e instanceof Map}function td(e){return Nd&&e instanceof Set}function nd(e){return e.o||e.t}function rd(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Ld(e);delete t[Dd];for(var n=Rd(t),r=0;r<n.length;r++){var o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function od(e,t){return void 0===t&&(t=!1),ad(e)||Kl(e)||!Xl(e)||(Zl(e)>1&&(e.set=e.add=e.clear=e.delete=id),Object.freeze(e),t&&ql(e,function(e,t){return od(t,!0)},!0)),e}function id(){$l(2)}function ad(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function sd(e){var t=Fd[e];return t||$l(18,e),t}function ld(){return Od}function dd(e,t){t&&(sd("Patches"),e.u=[],e.s=[],e.v=t)}function cd(e){ud(e),e.p.forEach(hd),e.p=null}function ud(e){e===Od&&(Od=e.l)}function fd(e){return Od={p:[],l:Od,h:e,m:!0,_:0}}function hd(e){var t=e[Dd];0===t.i||1===t.i?t.j():t.g=!0}function pd(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||sd("ES5").S(t,e,r),r?(n[Dd].P&&(cd(t),$l(4)),Xl(e)&&(e=gd(t,e),t.l||md(t,e)),t.u&&sd("Patches").M(n[Dd].t,e,t.u,t.s)):e=gd(t,n,[]),cd(t),t.u&&t.v(t.u,t.s),e!==Td?e:void 0}function gd(e,t,n){if(ad(t))return t;var r=t[Dd];if(!r)return ql(t,function(o,i){return vd(e,r,t,o,i,n)},!0),t;if(r.A!==e)return t;if(!r.P)return md(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=rd(r.k):r.o,i=o,a=!1;3===r.i&&(i=new Set(o),o.clear(),a=!0),ql(i,function(t,i){return vd(e,r,o,t,i,n,a)}),md(e,o,!1),n&&e.u&&sd("Patches").N(r,n,e.u,e.s)}return r.o}function vd(e,t,n,r,o,i,a){if(Kl(o)){var s=gd(e,o,i&&t&&3!==t.i&&!Jl(t.R,r)?i.concat(r):void 0);if(Ql(n,r,s),!Kl(s))return;e.m=!1}else a&&n.add(o);if(Xl(o)&&!ad(o)){if(!e.h.D&&e._<1)return;gd(e,o),t&&t.A.l||md(e,o)}}function md(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&od(t,n)}function yd(e,t){var n=e[Dd];return(n?nd(n):e)[t]}function bd(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function xd(e){e.P||(e.P=!0,e.l&&xd(e.l))}function wd(e){e.o||(e.o=rd(e.t))}function _d(e,t,n){var r=ed(t)?sd("MapSet").F(t,n):td(t)?sd("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:ld(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=Gd;n&&(o=[r],i=Ud);var a=Proxy.revocable(o,i),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):sd("ES5").J(t,n);return(n?n.A:ld()).p.push(r),r}function Ed(e){return Kl(e)||$l(22,e),function e(t){if(!Xl(t))return t;var n,r=t[Dd],o=Zl(t);if(r){if(!r.P&&(r.i<4||!sd("ES5").K(r)))return r.t;r.I=!0,n=Sd(t,o),r.I=!1}else n=Sd(t,o);return ql(n,function(t,o){r&&function(e,t){return 2===Zl(e)?e.get(t):e[t]}(r.t,t)===o||Ql(n,t,e(o))}),3===o?new Set(n):n}(e)}function Sd(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return rd(e)}var Cd,Od,kd="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Md="undefined"!=typeof Map,Nd="undefined"!=typeof Set,Ad="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Td=kd?Symbol.for("immer-nothing"):((Cd={})["immer-nothing"]=!0,Cd),Pd=kd?Symbol.for("immer-draftable"):"__$immer_draftable",Dd=kd?Symbol.for("immer-state"):"__$immer_state",jd="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Id=""+Object.prototype.constructor,Rd="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Ld=Object.getOwnPropertyDescriptors||function(e){var t={};return Rd(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},Fd={},Gd={get:function(e,t){if(t===Dd)return e;var n=nd(e);if(!Jl(n,t))return function(e,t,n){var r,o=bd(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!Xl(r)?r:r===yd(e.t,t)?(wd(e),e.o[t]=_d(e.A.h,r,e)):r},has:function(e,t){return t in nd(e)},ownKeys:function(e){return Reflect.ownKeys(nd(e))},set:function(e,t,n){var r=bd(nd(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=yd(nd(e),t),i=null==o?void 0:o[Dd];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,o)&&(void 0!==n||Jl(e.t,t)))return!0;wd(e),xd(e)}return e.o[t]===n&&(void 0!==n||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==yd(e.t,t)||t in e.t?(e.R[t]=!1,wd(e),xd(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=nd(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){$l(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){$l(12)}},Ud={};ql(Gd,function(e,t){Ud[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Ud.deleteProperty=function(e,t){return Ud.set.call(this,e,t,void 0)},Ud.set=function(e,t,n){return Gd.set.call(this,e[0],t,n,e[0])};var Hd=function(){function e(e){var t=this;this.O=Ad,this.D=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,a=Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return i.produce(e,function(e){var r;return(r=n).call.apply(r,[t,e].concat(a))})}}var a;if("function"!=typeof n&&$l(6),void 0!==r&&"function"!=typeof r&&$l(7),Xl(e)){var s=fd(t),l=_d(t,e,void 0),d=!0;try{a=n(l),d=!1}finally{d?cd(s):ud(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then(function(e){return dd(s,r),pd(e,s)},function(e){throw cd(s),e}):(dd(s,r),pd(a,s))}if(!e||"object"!=typeof e){if(void 0===(a=n(e))&&(a=e),a===Td&&(a=void 0),t.D&&od(a,!0),r){var c=[],u=[];sd("Patches").M(e,a,c,u),r(c,u)}return a}$l(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.produceWithPatches(n,function(t){return e.apply(void 0,[t].concat(o))})};var r,o,i=t.produce(e,n,function(e,t){r=e,o=t});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(function(e){return[e,r,o]}):[i,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Xl(e)||$l(8),Kl(e)&&(e=Ed(e));var t=fd(this),n=_d(this,e,void 0);return n[Dd].C=!0,ud(t),n},t.finishDraft=function(e,t){var n=(e&&e[Dd]).A;return dd(n,t),pd(void 0,n)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!Ad&&$l(20),this.O=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=sd("Patches").$;return Kl(e)?o(e,t):this.produce(e,function(e){return o(e,t)})},e}(),Bd=new Hd,zd=Bd.produce;Bd.produceWithPatches.bind(Bd);var Vd=Bd.setAutoFreeze.bind(Bd);Bd.setUseProxies.bind(Bd),Bd.applyPatches.bind(Bd);var Yd,Wd=Bd.createDraft.bind(Bd),$d=Bd.finishDraft.bind(Bd);!function(){function e(e,t){function n(){this.constructor=e}o(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.o||(e.R=new Map,e.o=new Map(e.t))}function n(e){e.o||(e.o=new Set,e.t.forEach(function(t){if(Xl(t)){var n=_d(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)}))}function r(e){e.g&&$l(3,JSON.stringify(nd(e)))}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},i=function(){function n(e,t){return this[Dd]={i:2,l:t,A:t?t.A:ld(),P:!1,I:!1,o:void 0,R:void 0,t:e,k:this,C:!1,g:!1},this}e(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return nd(this[Dd]).size}}),o.has=function(e){return nd(this[Dd]).has(e)},o.set=function(e,n){var o=this[Dd];return r(o),nd(o).has(e)&&nd(o).get(e)===n||(t(o),xd(o),o.R.set(e,!0),o.o.set(e,n),o.R.set(e,!0)),this},o.delete=function(e){if(!this.has(e))return!1;var n=this[Dd];return r(n),t(n),xd(n),n.t.has(e)?n.R.set(e,!1):n.R.delete(e),n.o.delete(e),!0},o.clear=function(){var e=this[Dd];r(e),nd(e).size&&(t(e),xd(e),e.R=new Map,ql(e.t,function(t){e.R.set(t,!1)}),e.o.clear())},o.forEach=function(e,t){var n=this;nd(this[Dd]).forEach(function(r,o){e.call(t,n.get(o),o,n)})},o.get=function(e){var n=this[Dd];r(n);var o=nd(n).get(e);if(n.I||!Xl(o))return o;if(o!==n.t.get(e))return o;var i=_d(n.A.h,o,n);return t(n),n.o.set(e,i),i},o.keys=function(){return nd(this[Dd]).keys()},o.values=function(){var e,t=this,n=this.keys();return(e={})[jd]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},o.entries=function(){var e,t=this,n=this.keys();return(e={})[jd]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},o[jd]=function(){return this.entries()},n}(),a=function(){function t(e,t){return this[Dd]={i:3,l:t,A:t?t.A:ld(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,g:!1,C:!1},this}e(t,Set);var o=t.prototype;return Object.defineProperty(o,"size",{get:function(){return nd(this[Dd]).size}}),o.has=function(e){var t=this[Dd];return r(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},o.add=function(e){var t=this[Dd];return r(t),this.has(e)||(n(t),xd(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[Dd];return r(t),n(t),xd(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[Dd];r(e),nd(e).size&&(n(e),xd(e),e.o.clear())},o.values=function(){var e=this[Dd];return r(e),n(e),e.o.values()},o.entries=function(){var e=this[Dd];return r(e),n(e),e.o.entries()},o.keys=function(){return this.values()},o[jd]=function(){return this.values()},o.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();!function(e,t){Fd[e]||(Fd[e]=t)}("MapSet",{F:function(e,t){return new i(e,t)},T:function(e,t){return new a(e,t)}})}(),Vd(!1),function(e){function t(t){return t!==e.EMPTY_VALUE}e.EMPTY_VALUE=Symbol("EMPTY_MODEL_VALUE"),e.isValidValue=t,e.defaultPipeFunction=function(e){return e.pipe(function(e){return e.lift(new Hl(o,i))},(n=e=>t(e),function(e){return e.lift(new Gl(n,r))}),function(e,t,n){return void 0===t&&(t=Fl),void 0===n&&(n=zl),function(r){return r.lift(new Vl(e,t,n.leading,n.trailing))}}(17,Ll,{leading:!1,trailing:!0}));var n,r,o,i}}(Yd||(Yd={}));class Kd{constructor(e=Yd.EMPTY_VALUE,t=30){this.toDispose=new Or,this.watch=(e,t=Yd.defaultPipeFunction)=>{this.subject$.observers.length+1>this.maxSubscription&&console.warn(`${this.subject$} reach maxSubscription limitation, please check`);const n=(t?t(this.subject$):this.subject$).subscribe(e);return Er.create(()=>{n.unsubscribe()})},this.getValue=()=>this.subject$.getValue(),this.setValue=e=>{if(this.subject$){if("function"==typeof e){const t=this.subject$.getValue(),n=zd(t,t=>{e(t)});return void(Yd.isValidValue(n)&&this.setValue(n))}this.subject$.next(e)}},this.hasValidValue=()=>{const e=this.getValue();return Yd.isValidValue(e)},this.getValidValue=()=>x(this,void 0,void 0,function*(){const e=new kr;if(this.hasValidValue())return this.getValue();const t=this.watch(n=>{Yd.isValidValue(n)&&(e.resolve(n),t.dispose())});return e.promise}),this.dispose=()=>{this.toDispose.dispose()},this.subject$=new Dl(e||Yd.EMPTY_VALUE),this.maxSubscription=t,this.toDispose.push(Er.create(()=>{this.subject$.complete(),this.subject$.unsubscribe(),this.subject$=null}))}}const Xd=Rn.defineToken("IFrontendApplicationContribution"),qd=Symbol("IGraphCommandService"),Zd=Rn.defineToken("ICommandHandler"),Jd=Symbol("ICommandContextProvider"),Qd=Symbol("IGraphCommandFactory"),ec=Rn.defineToken("IGraphCommandContribution");var tc;!function(e){e.is=function(e){return!!e&&e===Object(e)&&"id"in e},e.compareCommands=function(e,t){if(e.label&&t.label){const n=(e.category?`${e.category}: ${e.label}`:e.label).toLowerCase(),r=(t.category?`${t.category}: ${t.label}`:t.label).toLowerCase();return n.localeCompare(r)}return 0},e.equals=function(e,t){return e.id===t.id&&e.label===t.label&&e.iconName===t.iconName&&e.category===t.category}}(tc||(tc={}));let nc=class{get watchChange(){return this.cmdChangeEvent.watch}constructor(e){this.contributionProvider=e,this.redoStack=[],this.undoStack=[],this.commands=new Map,this.factories=new Map,this.disposables=new Map,this.cmdChangeEvent=new Kd(null),this.Globals=new Kd(new Map),this.setGlobal=(e,t)=>{this.Globals.setValue(n=>{n.set(e,t)})},this.getGlobal=e=>this.Globals.getValue().get(e),this.undoCommand=()=>x(this,void 0,void 0,function*(){const e=this.undoStack.pop();e?(yield e.undo(),this.redoStack.push(e),this.cmdChangeEvent.setValue(null)):console.error("empty undo stack")}),this.redoCommand=()=>x(this,void 0,void 0,function*(){const e=this.redoStack.pop();e?(yield e.redo(),this.undoStack.push(e),this.cmdChangeEvent.setValue(null)):console.error("empty undo stack")}),this.registerDisposableCommand=e=>{const t=new Or;return e({registerCommand:(e,n)=>{const r=this.registerCommand(e,n);return t.push(r),r}}),t}}onStart(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerGraphCommands(this)}executeCommandPipeline(e){return x(this,void 0,void 0,function*(){let t=null;for(const n of e){const e=null==t?void 0:t.contextProvider(),{args:r,hooks:o}=yield null==n?void 0:n.getCommandOption(e);t=yield this.executeCommand(null==n?void 0:n.commandId,r,o)}return this.cmdChangeEvent.setValue(null),t})}executeCommand(e,t,n=[]){return x(this,void 0,void 0,function*(){const r=this.getFactory(e);if(r){const o=yield r.createCommand(e,t,n);return yield o.execute(),o.isUndoable()&&this.undoStack.push(o),this.cmdChangeEvent.setValue(null),o}throw Object.assign(new Error(`The command '${e}' cannot be executed. There are no active handlers available for the command.`),{code:"NO_ACTIVE_HANDLER"})})}executeUndoCommand(e,t,n=[]){return x(this,void 0,void 0,function*(){const r=this.getFactory(e);if(r){const o=yield r.createCommand(e,t,n);return yield o.execute(),o}throw Object.assign(new Error(`The command '${e}' cannot be executed. There are no active handlers available for the command.`),{code:"NO_ACTIVE_HANDLER"})})}createCommand(e,t,n=[]){return x(this,void 0,void 0,function*(){const r=this.getFactory(e);if(r){return yield r.createCommand(e,t,n)}throw Object.assign(new Error(`The command '${e}' cannot be executed. There are no active handlers available for the command.`),{code:"NO_ACTIVE_HANDLER"})})}get isUndoable(){return this.undoStack.length>0}get isRedoable(){return this.redoStack.length>0}hasCommand(e){return this.commands.has(e)}getCommand(e){return this.commands.get(e)}registerCommand(e,t){if(this.factories.has(e.id))return console.warn(`A command ${e.id} is already registered.`),Er.NULL;const n=new Or(this.doRegisterCommand(e),this.registerFactory(e.id,t),Er.create(()=>this.disposables.delete(e.id)));return this.disposables.set(e.id,n),n}doRegisterCommand(e){return this.commands.set(e.id,e),Er.create(()=>this.disposables.delete(e.id))}unregisterCommand(e){const t=tc.is(e)?e.id:e,n=this.disposables.get(t);n&&n.dispose()}hasFactory(e){return!!this.factories.get(e)}getFactory(e){return this.factories.get(e)}registerFactory(e,t,n=!1){return this.hasFactory(e)&&!1===n&&console.error("cannot register command:",e),this.factories.set(e,t),Er.create(()=>{this.factories.delete(e)})}getAllFactories(){return Array.from(this.factories.entries())}};var rc,oc;nc=y([tr({contrib:[Xd,qd]}),(rc=0,oc=gr(ec),function(e,t){oc(e,t,rc)}),b("design:paramtypes",[Object])],nc),hr(e=>{pr.register(e,ec),e(nc)});const ic=Rn.defineToken("IModelService"),ac=Rn.defineToken("IModelContribution"),sc=Symbol("IModelOptionProvider");var lc;!function(e){e.ASYNC_SRRIES="ASYNC_SRRIES",e.ASYNC_PARALLEL="ASYNC_PARALLEL"}(lc||(lc={}));var dc={exports:{}};function cc(e,t){var n=e.length,r=new Array(n),o={},i=n,a=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var o=e[n];t.has(o[0])||t.set(o[0],new Set),t.has(o[1])||t.set(o[1],new Set),t.get(o[0]).add(o[1])}return t}(t),s=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach(function(e){if(!s.has(e[0])||!s.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)o[i]||l(e[i],i,new Set);return r;function l(e,t,i){if(i.has(e)){var d;try{d=", node was:"+JSON.stringify(e)}catch(e){d=""}throw new Error("Cyclic dependency"+d)}if(!s.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!o[t]){o[t]=!0;var c=a.get(e)||new Set;if(t=(c=Array.from(c)).length){i.add(e);do{var u=c[--t];l(u,s.get(u),i)}while(t);i.delete(e)}r[--n]=e}}}dc.exports=function(e){return cc(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var o=e[n];t.add(o[0]),t.add(o[1])}return Array.from(t)}(e),e)},dc.exports.array=cc;var uc,fc,hc=dc.exports;!function(e){let t;!function(e){e.INVALID_HOOK_BEFORE="INVALID_HOOK_BEFORE",e.INVALID_HOOK_AFTER="INVALID_HOOK_AFTER",e.INVALID_HOOK_ARGS_LENGTH="INVALID_HOOK_ARGS_LENGTH"}(t=e.ErrorEnum||(e.ErrorEnum={}));class n extends Error{constructor(e,t,...r){Array.isArray(t)&&(t=t.filter(function(e){return!!e}).join(" ")),super(`${e}: ${t}`),Error.captureStackTrace&&Error.captureStackTrace(this,n),this.code=e,this.contexts={},r.forEach(e=>{"object"==typeof e&&Object.entries(e).forEach(e=>{const[t,n]=e;"key"!==t&&n&&(this.contexts[t]=JSON.parse(JSON.stringify(n)))})})}toString(){return`${this.code}: ${this.message}`}}e.HookError=n;const r=(e,t,...r)=>new n(e,t,...r);e.HookBeforeError=()=>r(t.INVALID_HOOK_BEFORE,["hook require a before dependency but not exist in hookmap"]),e.HookAfterError=()=>r(t.INVALID_HOOK_AFTER,["hook require a after dependency but not exist in hookmap"]),e.InvalidHookArguments=e=>r(t.INVALID_HOOK_ARGS_LENGTH,["hook handlers must have 0 to 2 arguments",`but got ${e.handler.length}`])}(uc||(uc={})),function(e){e.normalize=(e=[],t)=>{const n=Array.isArray(e)?e:[e],r=[];return t.forEach(e=>{r.push(e)}),[...r,...n].filter(e=>e&&!!e.handler)},e.sort=(e=[],t)=>{const n=[];e.forEach(e=>{if(e.before){if(!t.has(e.before))throw uc.HookBeforeError();const r=[e,t.get(e.before)];n.push(r)}if(e.after){if(!t.has(e.after))throw uc.HookBeforeError();const r=[t.get(e.after),e];n.push(r)}});return hc.array(e,n)}}(fc||(fc={}));class pc{constructor(){this.isResolved=!1,this.isRejected=!1,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.isResolved=!0,e(t)},this.reject=e=>{this.isRejected=!0,t(e)}})}}class gc{constructor(e){this.scheduleType=lc.ASYNC_SRRIES,this.hasHook=e=>this.hookMap.has(e),this.getHooks=(e=[],t=!0)=>{const n=fc.normalize(e,this.hookMap);return t?fc.sort(n,this.hookMap):n},this.registerHook=e=>(this.hookMap.has(e.name)&&console.error(`${e.name} is duplicated in hookmap`),this.hookMap.set(e.name,e),{dispose:()=>{this.hookMap.delete(e.name)}}),this.call=(e,t=e=>x(this,void 0,void 0,function*(){return e}),n=[])=>x(this,void 0,void 0,function*(){const r=this.getHooks(n,!0);return(0,this.schedulers[this.scheduleType])(e,t,r)}),this.schedulers={[lc.ASYNC_SRRIES]:(e,t,n=[])=>x(this,void 0,void 0,function*(){let r=t;for(const t of n){if([0,1].includes(t.handler.length)){yield t.handler.call(this,e);continue}if([2].includes(t.handler.length)&&null!==r){const n=yield t.handler.call(this,e,r);if(null===n){r=null;break}if("function"==typeof n){r=n;continue}}throw uc.InvalidHookArguments(t)}if(r)return yield r.call(this,e)}),[lc.ASYNC_PARALLEL]:(e,t,n=[])=>x(this,void 0,void 0,function*(){const r=n.map(n=>{if([0,1].includes(n.handler.length))return n.handler.call(this,e);if([2].includes(n.handler.length))return n.handler.call(this,e,t);throw uc.InvalidHookArguments(n)}),o=new pc;if(Promise.all(r).then(e=>o.resolve(e)),t)return yield t.call(this,o)})},this.hookMap=new Map,e&&e.type&&(this.scheduleType=e.type)}}const vc=Rn.defineToken("IHookService"),mc=Rn.defineToken("IHookContribution"),yc=()=>({dispose:()=>{}});var bc;!function(e){e.CONFIG_TYPE="XFlowHook"}(bc||(bc={}));class xc{constructor(){this.CONFIG_TYPE=bc.CONFIG_TYPE,this.time=Date.now(),this.setRegisterHook=e=>{this.hookRegisterFunc=e},this.setRegisterHookhub=e=>{this.hookhubRegisterFn=e},this.getConfig=()=>x(this,void 0,void 0,function*(){return{CONFIG_TYPE:this.CONFIG_TYPE,hookRegisterFn:this.hookRegisterFunc||yc,hookhubRegisterFn:this.hookhubRegisterFn||yc}}),this.dispose=()=>{}}}let wc=class{constructor(){this.toDispose=new Or,this.hookProvider=()=>this.hooks,this.registerHook=e=>e(this.hooks),this.registerHookHub=(e,t)=>(this.hooks[e]=t,{dispose:()=>{delete this.hooks[e]}}),this.onStart=()=>x(this,void 0,void 0,function*(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerHookHub(this);for(const t of e)t.registerHook(this.hooks)}),this.hooks={graphOptions:new gc,reactNodeRender:new gc,reactEdgeLabelRender:new gc,afterGraphInit:new gc,beforeGraphDestroy:new gc,x6Events:new gc}}onStop(){this.toDispose.dispose()}};var _c;y([gr(mc),b("design:type",Object)],wc.prototype,"contributionProvider",void 0),wc=y([tr({contrib:[Xd,vc]}),b("design:paramtypes",[])],wc),function(e){e.pluginId="GraphEventPlugin"}(_c||(_c={}));let Ec=class{constructor(){this.toDispose=new Or,this.registerHook=e=>x(this,void 0,void 0,function*(){const{hookRegisterFn:t}=yield this.hookConfig.getConfig(),n=t(e);return Er.create(()=>{n.dispose()})}),this.registerHookHub=e=>x(this,void 0,void 0,function*(){const{hookhubRegisterFn:t}=yield this.hookConfig.getConfig(),n=t(e);return Er.create(()=>{n.dispose()})})}};y([nr(xc),b("design:type",xc)],Ec.prototype,"hookConfig",void 0),Ec=y([tr({contrib:mc})],Ec);const Sc={dispose:()=>null};const Cc=e=>{const t=document.createElement("style");return t.setAttribute("type","text/css"),document.head.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),t};function Oc(e){return function(e){return"function"==typeof e&&!!e.prototype.isReactComponent}(e)||function(e){return"function"==typeof e&&String(e).includes("return React.createElement")}(e)}var kc;!function(e){e.pluginId="base-graph-events"}(kc||(kc={}));let Mc=class{constructor(){this.toDispose=new Or,this.registerHookHub=()=>x(this,void 0,void 0,function*(){return Er.create(()=>{})}),this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,n=[e.x6Events.registerHook({name:kc.pluginId,handler:e=>x(this,void 0,void 0,function*(){const{events:t}=yield this.graphOptions.getOptions();t.forEach(t=>{e.push(t)})})}),e.afterGraphInit.registerHook({name:kc.pluginId,handler:n=>x(this,void 0,void 0,function*(){const{commandService:r,modelService:o,graph:i}=n,a=yield e.x6Events.call([],e=>x(this,void 0,void 0,function*(){return e.map(e=>{const t=t=>{e.callback(t,r,o,i)};return i.on(e.eventName,t),{dispose:()=>{i.off(e.eventName,t)}}})}));t.pushAll(a)})}),e.afterGraphInit.registerHook({name:"add auto resize event",handler:e=>x(this,void 0,void 0,function*(){const{commandService:n,options:r,graph:o}=e,i=function(e){let t;return()=>{t||(t=requestAnimationFrame(()=>{t=null,e()}))}}(()=>{n.executeCommand(Qs.GRAPH_RESIZE.id,{})});window.addEventListener("resize",i);const{rootContainer:a}=r,s=new ResizeObserver(()=>o.resize(a.clientWidth));a&&s.observe(a),t.push(Er.create(()=>{window.removeEventListener("resize",i)}))})}),e.beforeGraphDestroy.registerHook({name:kc.pluginId,handler:()=>x(this,void 0,void 0,function*(){t.dispose()})})];return t.pushAll(n),t})}};y([nr(dl),b("design:type",Object)],Mc.prototype,"graphOptions",void 0),Mc=y([tr({contrib:mc})],Mc);const Nc=u.default.createContext({}),Ac=()=>u.default.useContext(Nc),Tc=u.default.createContext({cell:null,x6Graph:null,commands:null,modelService:null});function Pc(e,t,n){return function(r){const o=this,i=null==r?void 0:r.getData(),a=null==r?void 0:r.getSize(),s=null==r?void 0:r.getPosition();return u.default.createElement(()=>u.default.createElement(Tc.Provider,{value:{cell:r,x6Graph:o,commands:t,modelService:n}},u.default.createElement(e,{cell:r,data:i,size:a,position:s})),null)}}const Dc=Symbol("IGraphProvider"),jc=Symbol("ICommandServiceProvider"),Ic=Symbol("IModelServiceProvider");let Rc=class{constructor(){this.toDispose=new Or,this.graphMap=new Map,this.getGraph=e=>x(this,void 0,void 0,function*(){let t=this.graphMap.get(e);if(!t){t=new kr,this.graphMap.set(e,t);const r=yield this.optionProvider.getOptions(),o=this.hookService.hookProvider(),i=yield o.graphOptions.call(r.x6Options),{graphContainer:a,edgeRender:s,nodeRender:l,edgeTypeParser:d}=r,c=yield o.reactEdgeLabelRender.call(s);yield o.reactNodeRender.call(l);const{clientHeight:u,clientWidth:f}=a,h=yield this.commandServiceProvider.getCommandService(),p=yield this.modelServiceProvider.getModelService(),g=new n.Graph(Object.assign(Object.assign({container:a,width:f,height:u},i),{onEdgeLabelRendered:e=>{const{edge:t,container:n}=e;this.renderEdgeReactLabel({edge:t,container:n,edgeRenderMap:c,edgeTypeParser:d,modelService:p,commandService:h})}}));yield o.afterGraphInit.call({graph:g,commandService:h,modelService:p,options:r}),t.resolve(g),g.on("node:moved",({node:e})=>{const t=e.getData(),n=e.position();e.setData(Object.assign(Object.assign({},t),{x:null==n?void 0:n.x,y:null==n?void 0:n.y}))}),g.on("node:resized",({node:e})=>{const t=e.getData(),n=e.size();e.setData(Object.assign(Object.assign({},t),{width:null==n?void 0:n.width,height:null==n?void 0:n.height}))}),this.toDispose.push(Er.create(()=>x(this,void 0,void 0,function*(){yield o.beforeGraphDestroy.call({graph:g,commandService:h,modelService:p,options:r}),this.graphMap.delete(e),g.dispose()})))}return t.promise}),this.renderEdgeReactLabel=e=>x(this,void 0,void 0,function*(){const{container:t,edgeTypeParser:n,edge:r,edgeRenderMap:o,commandService:i,modelService:a}=e,s=n(null==r?void 0:r.data)||Ar,l=o.get(s);if(l&&r&&(null==r?void 0:r.data)&&l){const e=this.edgeAppendForeignObject(r,t),n=function(e,t,n){return function(r){const o=this,i=null==r?void 0:r.getData();return u.default.createElement(()=>u.default.createElement(Tc.Provider,{value:{cell:r,x6Graph:o,commands:t,modelService:n}},u.default.createElement(e,{data:i,cell:r})),null)}}(l,i,a)(r);h.default.render(n,e)}})}edgeAppendForeignObject(e,t){const r=n.Dom.createSvgElement("foreignObject"),o=n.Dom.createElementNS("body",n.Dom.ns.xhtml),i=n.Dom.createElementNS("div",n.Dom.ns.xhtml),a=null==e?void 0:e.data,s=(null==a?void 0:a.edgeContentWidth)||100,l=(null==a?void 0:a.edgeContentHeight)||30;return r.setAttribute("width",`${s}`),r.setAttribute("height",`${l}`),r.setAttribute("x",""+-1*s/2),r.setAttribute("y",""+-1*l/2),o.setAttribute("xhtmls",n.Dom.ns.xhtml),o.style.width="100%",o.style.height="100%",o.style.padding="0",o.style.margin="0",o.style.background="unset",o.style.overflow="visible",o.className="xflow-edge-label-body",i.style.width="100%",i.style.height="100%",o.appendChild(i),r.appendChild(o),t.appendChild(r),i}dispose(){this.toDispose.dispose()}};y([nr(dl),b("design:type",Object)],Rc.prototype,"optionProvider",void 0),y([nr(vc),b("design:type",Object)],Rc.prototype,"hookService",void 0),y([nr(jc),b("design:type",Object)],Rc.prototype,"commandServiceProvider",void 0),y([nr(Ic),b("design:type",Object)],Rc.prototype,"modelServiceProvider",void 0),Rc=y([tr()],Rc);var Lc;!function(e){e.CONFIG_TYPE="MODEL_SERVICE_CONFIG"}(Lc||(Lc={}));let Fc=class{constructor(){this.toDispose=new Or,this.deferredModelMap=new Map,this.registerModel=e=>{const{id:t,getInitialValue:n,modelFactory:r}=e,o=new Or,i=this.ensureModel(t);if(i.isResolved)return void console.error(e,"model has been registerd");const a=n?n():Yd.EMPTY_VALUE,s=r?r():new Kd(a);return Yd.isValidValue(a)&&i.resolve(s),e.watchChange&&e.watchChange(s,this).then(e=>{i.isResolved||i.resolve(s),this.toDispose.pushAll([e,o]),o.push(e)}),o},this.findDeferredModel=e=>this.deferredModelMap.get(e),this.awaitModel=e=>this.ensureModel(e).promise,this.registerRuntimeModel=()=>x(this,void 0,void 0,function*(){const{modelRegisterFunc:e}=yield this.modelOptionProvider.getOption(),t=yield this.graphProvider.getGraphInstance();e&&e(this,t)}),this.ensureModel=e=>{const t=this.deferredModelMap.get(e);if(t)return t;const n=new kr;return this.deferredModelMap.set(e,n),this.toDispose.push(Er.create(()=>this.deferredModelMap.delete(e))),n}}onStart(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerModel(this);this.registerRuntimeModel()}onStop(){this.toDispose.dispose()}};y([gr(ac),b("design:type",Object)],Fc.prototype,"contributionProvider",void 0),y([nr(sc),b("design:type",Object)],Fc.prototype,"modelOptionProvider",void 0),y([nr(Dc),b("design:type",Object)],Fc.prototype,"graphProvider",void 0),Fc=y([tr({contrib:[Xd,ic]})],Fc);const Gc=e=>t=>x(void 0,void 0,void 0,function*(){return yield t.awaitModel(e)}),Uc=e=>t=>x(void 0,void 0,void 0,function*(){return(yield t.awaitModel(e)).getValidValue()});var Hc,Bc,zc,Vc,Yc,Wc,$c,Kc,Xc,qc,Zc,Jc,Qc,eu,tu,nu,ru,ou,iu,au,su;!function(e){e.id="GRAPH_ENABLE_MULTI_SELECT",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Hc||(Hc={})),function(e){e.id="GRAPH_FULLSCREEN",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Bc||(Bc={})),function(e){e.id="IS_NODE_SELECTED",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(zc||(zc={})),function(e){e.id="IS_GROUP_SELECTED",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Vc||(Vc={})),function(e){e.id="IS_NORMAL_NODES_SELECTED",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Yc||(Yc={})),function(e){e.id="LAST_SELECTED_CELL",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Wc||(Wc={})),function(e){e.id="SELECTED_CELLS",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}($c||($c={})),function(e){e.id="LAST_SELECTED_NODE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Kc||(Kc={})),function(e){e.id="SELECTED_NODES",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Xc||(Xc={})),function(e){e.id="SELECTED_EDGES",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(qc||(qc={})),function(e){e.id="SELECTED_GROUPS",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Zc||(Zc={})),function(e){e.id="CONTEXTMENU_NODE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Jc||(Jc={})),function(e){e.id="CONTEXTMENU_EDGE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Qc||(Qc={})),function(e){e.id="CONTEXTMENU_TARGET",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(eu||(eu={})),function(e){e.id="GRAPH_META",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(tu||(tu={})),function(e){e.id="GRAPH_SCALE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(nu||(nu={})),function(e){e.id="COMMAND_REDOABLE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(ru||(ru={})),function(e){e.id="COMMAND_UNDOABLE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(ou||(ou={})),function(e){e.id="COMMAND_GLOBALS",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(iu||(iu={})),function(e){e.id="HISTORY_UNDOABLE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(au||(au={})),function(e){e.id="HISTORY_REDOABLE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(su||(su={}));let lu=class{registerModel(e){e.registerModel({id:ru.id,getInitialValue:()=>this.commands.isRedoable,watchChange:e=>x(this,void 0,void 0,function*(){return this.commands.watchChange(()=>{e.setValue(this.commands.isRedoable)})})}),e.registerModel({id:ou.id,getInitialValue:()=>this.commands.isUndoable,watchChange:e=>x(this,void 0,void 0,function*(){return this.commands.watchChange(()=>{e.setValue(this.commands.isUndoable)})})}),e.registerModel({id:iu.id,modelFactory:()=>this.commands.Globals})}};y([nr(qd),b("design:type",Object)],lu.prototype,"commands",void 0),lu=y([tr({contrib:ac})],lu);const du=(e,t,n)=>(e.on(t,n),Er.create(()=>{e.off(t,n)}));let cu=class{constructor(){this.getGraphInstance=()=>x(this,void 0,void 0,function*(){return{graph:yield this.graphProvider.getGraphInstance(),config:yield this.graphProvider.getGraphOptions()}})}registerModel(e){e.registerModel({id:tu.id,getInitialValue:()=>({flowId:"-1"}),watchChange:e=>x(this,void 0,void 0,function*(){return Er.create(()=>{e.setValue({flowId:"-1"})})})}),e.registerModel({id:Hc.id,getInitialValue:()=>({isEnable:!1}),watchChange:e=>x(this,void 0,void 0,function*(){return Er.create(()=>{e.setValue({isEnable:!1})})})}),e.registerModel({id:Bc.id,getInitialValue:()=>!1,watchChange:(e,t)=>x(this,void 0,void 0,function*(){const n=()=>x(this,void 0,void 0,function*(){const e=!!document.fullscreenElement;(yield Bc.getModel(t)).setValue(e)});return document.addEventListener("fullscreenchange",n,!1),Er.create(()=>{document.removeEventListener("fullscreenchange",n),e.setValue(!1)})})}),e.registerModel({id:$c.id,getInitialValue:()=>[],watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t}=yield this.getGraphInstance(),n=t=>{const{selected:n}=t;e.setValue(n)};return t.on("selection:changed",n),Er.create(()=>t.off("selection:changed",n))})}),e.registerModel({id:Wc.id,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield $c.getModel(t)).watch((t=[])=>{e.setValue([...t].pop()||null)})})}),e.registerModel({id:Xc.id,getInitialValue:()=>[],watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield $c.getModel(t)).watch((t=[])=>{const n=t.filter(e=>e.isNode());e.setValue(n)})})}),e.registerModel({id:Kc.id,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield Xc.getModel(t)).watch(t=>{e.setValue([...t].pop()||null)})})}),e.registerModel({id:zc.id,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield Xc.getModel(t)).watch(t=>{e.setValue(t.length>0)})})}),e.registerModel({id:Vc.id,getInitialValue:()=>!1,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield $c.getModel(t)).watch(t=>{const n=t.every(e=>e&&!0===e.getProp("isGroup"));e.setValue(n)})})}),e.registerModel({id:Zc.id,getInitialValue:()=>[],watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield Xc.getModel(t)).watch(t=>{const n=t.filter(e=>e&&!0===e.getProp("isGroup"));e.setValue(n)})})}),e.registerModel({id:Yc.id,getInitialValue:()=>!1,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield $c.getModel(t)).watch(t=>{const n=t.every(e=>{const t=!(e&&e.getProp("isGroup")),n=!(e&&e.getProp("group"));return t&&n}),r=t.length>0&&n;e.setValue(r)})})}),e.registerModel({id:nu.id,getInitialValue:()=>({zoomFactor:-1}),watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t}=yield this.getGraphInstance(),n=n=>{const r=t.zoom();e.setValue(Object.assign(Object.assign({},n),{zoomFactor:r}))};return t.on("scale",n),Er.create(()=>t.off("scale",n))})}),e.registerModel({id:eu.id,watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t,config:n}=yield this.getGraphInstance(),r=r=>o=>{const{x:i,y:a}=o,s=t.localToClient({x:i,y:a}),l=n.rootContainer.getBoundingClientRect(),d={x:s.x-((null==l?void 0:l.x)||0),y:s.y-((null==l?void 0:l.y)||0)};e.setValue({type:r,anchor:d,data:o,cell:o.cell})},o=new Or;return o.pushAll([du(t,"node:contextmenu",r("node")),du(t,"edge:contextmenu",r("edge")),du(t,"blank:contextmenu",r("blank"))]),o})}),e.registerModel({id:su.id,getInitialValue:()=>!1,watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t}=yield this.getGraphInstance(),n=()=>{const n=t.history.canRedo();e.setValue(n)};return t.history&&t.history.on("change",n),Er.create(()=>t.history.off("change",n))})}),e.registerModel({id:au.id,getInitialValue:()=>!1,watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t}=yield this.getGraphInstance(),n=()=>{const n=t.history.canUndo();e.setValue(n)};return t.history&&t.history.on("change",n),Er.create(()=>t.history.off("change",n))})})}};y([nr(Dc),b("design:type",Object)],cu.prototype,"graphProvider",void 0),cu=y([tr({contrib:ac})],cu),hr(e=>{pr.register(e,ac),e(Fc),e(cu),e(lu)});const uu=e=>{const t=[],n=[],r=e=>{e.isNode()&&t.push((e=>{const t=e.getChildren(),n=e.getSize(),r=e.getData()||{},o=e.getPosition(),i=e.getParentId(),{isCollapsed:a}=r,s=r.groupCollapsedSize||(a?n:null);return Object.assign(Object.assign({},r),{id:e.id,width:n.width,height:n.height,x:o.x,y:o.y,group:i,groupChildren:t?t.map(e=>e.id):null,groupCollapsedSize:s})})(e)),e.isEdge()&&n.push((e=>{const t=e.getData()||{};return Object.assign({id:e.id},t)})(e))};return e.map(e=>r(e)),{nodes:t,edges:n}};let fu=class{constructor(){this.getGraphInstance=()=>this.graphProvider.getGraphInstance(),this.getGraphConfig=()=>this.graphProvider.getGraphOptions(),this.getGraphData=()=>x(this,void 0,void 0,function*(){const e=(yield this.graphProvider.getGraphInstance()).getCells();return uu(e)}),this.getAllNodes=()=>x(this,void 0,void 0,function*(){return(yield this.graphProvider.getGraphInstance()).getNodes()}),this.getNodeById=e=>x(this,void 0,void 0,function*(){return(yield this.graphProvider.getGraphInstance()).getCellById(e)}),this.getAllEdges=()=>x(this,void 0,void 0,function*(){return(yield this.graphProvider.getGraphInstance()).getEdges()}),this.getEdgeById=e=>x(this,void 0,void 0,function*(){return(yield this.graphProvider.getGraphInstance()).getCellById(e)}),this.updateNodeAttrs=(e,t)=>x(this,void 0,void 0,function*(){if(e instanceof n.Node)e.setAttrs(t);else{(yield this.getNodeById(e)).setAttrs(t)}}),this.updateEdgeAttrs=(e,t)=>x(this,void 0,void 0,function*(){if(e instanceof n.Edge)e.setAttrs(t);else{(yield this.getEdgeById(e)).setAttrs(t)}}),this.translateGraph=(e,t)=>x(this,void 0,void 0,function*(){const n=yield this.graphProvider.getGraphInstance(),r=n.translate();n.translate(r.tx+e,r.ty+t)})}start(){return x(this,void 0,void 0,function*(){yield this.startContributions(),this.registerEventListeners()})}executeCommand(e,t,n=[]){return this.commandService.executeCommand(e,t,n)}executeCommandPipeline(e){return this.commandService.executeCommandPipeline(e)}registerEventListeners(){window.addEventListener("unload",()=>{this.stopContributions()})}startContributions(){return x(this,void 0,void 0,function*(){for(const e of this.contributions.getContributions())if(e.onStart)try{yield this.measure(`${e.constructor.name}.onStart`,()=>e.onStart(this))}catch(e){console.error("Could not start contribution",e)}})}stopContributions(){console.info(">>> Stopping frontend contributions...");for(const e of this.contributions.getContributions())if(e.onStop)try{e.onStop(this)}catch(e){console.error("Could not stop contribution",e)}console.info("<<< All frontend contributions have been stopped.")}measure(e,t){return x(this,void 0,void 0,function*(){const n=`${e}-start`,r=`${e}-end`;performance.mark(n);const o=yield t();performance.mark(r),performance.measure(e,n,r);for(const t of performance.getEntriesByName(e)){const e=`Frontend ${t.name}`;t.duration>100?console.warn(`${e} is slow, took: ${t.duration.toFixed(1)} ms`):console.debug(`${e} took: ${t.duration.toFixed(1)} ms`)}return performance.clearMeasures(e),o})}};y([gr(Xd),b("design:type",Object)],fu.prototype,"contributions",void 0),y([nr(Dc),b("design:type",Object)],fu.prototype,"graphProvider",void 0),y([nr(qd),b("design:type",Object)],fu.prototype,"commandService",void 0),y([nr(ic),b("design:type",Object)],fu.prototype,"modelService",void 0),fu=y([tr()],fu),hr(e=>{pr.register(e,Xd),e(fu)});const hu=u.default.createContext({configProvider:null}),pu=e=>{const t=u.default.useContext(hu);return u.default.useMemo(()=>t.configProvider?t.configProvider.getXflowPrefixCls(e):`xflow-${e}`,[e])};function gu(e){const{createModule:t,children:n}=e,r=Ac(),o=u.default.useMemo(()=>e.config||{CONFIG_TYPE:"",getConfig:()=>x(this,void 0,void 0,function*(){return{}})},[]);return u.default.useEffect(()=>{const e=r.addExtension({config:o,createModule:t});return()=>{e.dispose()}},[]),Array.isArray(n)||u.default.isValidElement(n)?u.default.createElement(u.default.Fragment,null," ",n," "):null}const vu=(e={})=>t.useMemo(()=>{const t=Object.entries(e),n=t.length>0?{position:"absolute"}:{};return t.forEach(([e,t=0])=>{n[e]=`${t}px`}),n},[e]),mu=e=>hr(t=>{(e=>{e(Rc),e(Dc,{lifecycle:Rn.Lifecycle.singleton,useDynamic:e=>({getGraphInstance:()=>x(void 0,void 0,void 0,function*(){const t=e.container.get(Rc),n=e.container.get(dl),r=yield null==n?void 0:n.getOptions();return yield null==t?void 0:t.getGraph(r.graphId)}),getGraphOptions:()=>x(void 0,void 0,void 0,function*(){const t=e.container.get(dl);return null==t?void 0:t.getOptions()})})}),e(jc,{lifecycle:Rn.Lifecycle.singleton,useDynamic:e=>({getCommandService:()=>x(void 0,void 0,void 0,function*(){return e.container.get(qd)})})}),e(Ic,{lifecycle:Rn.Lifecycle.singleton,useDynamic:e=>({getModelService:()=>x(void 0,void 0,void 0,function*(){return e.container.get(ic)})})})})(t),((e,t)=>{e(dl,{lifecycle:Rn.Lifecycle.singleton,useDynamic:()=>({getOptions:()=>x(void 0,void 0,void 0,function*(){return t.getConfig()})})})})(t,e)}),yu=e=>{const t=qs(),n=u.default.useRef(null),r=u.default.useRef(null),o=Ac(),a=u.default.useMemo(()=>{const t=e.config?e.config:new ll;return t.setX6Config(),t},[]),[s,l]=i.usePortal(a.graphId);u.default.useEffect(()=>{t&&t.getGraphInstance().then(e=>{l(e)})},[t,l]),u.default.useEffect(()=>{a.setRootContainer(n.current),a.setGraphContainer(r.current),a.xflowInstanceId=o.getInstanceId(),o.addCoreModule({config:a,createModule:mu});return()=>{x(void 0,void 0,void 0,function*(){a.dispose()})}},[]);const d=vu(e.position),c=pu("canvas-root"),f=pu("x6-canvas");return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{ref:n,className:c,style:d,id:a.graphId,tabIndex:0},u.default.createElement("div",{ref:r,className:f}),e.children),u.default.createElement(s,null))};yu.defaultProps={isXFlowCanvas:!0};let bu=class{constructor(){this.toDispose=new Or,this.runtimeHooks=[],this.getX6Graph=()=>x(this,void 0,void 0,function*(){if(this.graph)return this.graph;const e=yield this.graphProvider.getGraphInstance();return this.graph=e,e}),this.getGraphConfig=()=>x(this,void 0,void 0,function*(){return this.graphProvider.getGraphOptions()}),this.getGraphMeta=()=>x(this,void 0,void 0,function*(){const e=this.getModelService();return this.graphMeta||(yield tu.useValue(e))}),this.setArgs=(e,t=[])=>(this.args=e,this.runtimeHooks=t,{args:e,hooks:t}),this.getArgs=()=>({args:Object.assign(Object.assign({},this.args),{modelService:this.getModelService(),commandService:this.getCommands(),getGraphMeta:this.getGraphMeta,getX6Graph:this.getX6Graph,getGraphConfig:this.getGraphConfig}),hooks:this.runtimeHooks}),this.setResult=e=>(this.result=e,this.result),this.getResult=()=>this.result,this.getHooks=()=>this.hookService.hookProvider(),this.getCommands=()=>this.commandService,this.getModelService=()=>this.modelService,this.addUndo=e=>{if(!Array.isArray(e))return this.addUndo([e]);this.toDispose.pushAll(e)},this.undo=()=>x(this,void 0,void 0,function*(){yield this.toDispose.dispose()}),this.isUndoable=()=>!this.toDispose.disposed,this.getDisposables=()=>this.toDispose,this.setGlobal=(e,t)=>{this.commandService.setGlobal(e,t)},this.getGlobal=e=>this.commandService.getGlobal(e)}init(){this.getGraphMeta().then(e=>{this.graphMeta=e})}};y([nr(Dc),b("design:type",Object)],bu.prototype,"graphProvider",void 0),y([nr(vc),b("design:type",Object)],bu.prototype,"hookService",void 0),y([nr(qd),b("design:type",Object)],bu.prototype,"commandService",void 0),y([nr(ic),b("design:type",Object)],bu.prototype,"modelService",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],bu.prototype,"init",null),bu=y([er()],bu);const xu=()=>[];class wu{constructor(){this.setCommandContributions=e=>{this.getContributions=e},this.getCommandContributions=()=>this.getContributions(),this.registerHook=e=>x(this,void 0,void 0,function*(){return this.registerHookFn?this.registerHookFn(e):Sc}),this.registerHookHub=e=>x(this,void 0,void 0,function*(){return this.registerHookHubFn?this.registerHookHubFn(e):Sc}),this.CONFIG_TYPE="CommandConfig",this.setRegisterHookFn=e=>{this.registerHookFn=e},this.setRegisterHookHubFn=e=>{this.registerHookHubFn=e},this.getConfig=()=>x(this,void 0,void 0,function*(){return{registerHookFn:this.registerHookFn,getContributions:this.getContributions,CONFIG_TYPE:this.CONFIG_TYPE}}),this.getContributions=xu}}var _u;!function(e){e.command=Zs.ADD_NODE,e.hookKey="addNode"}(_u||(_u={}));let Eu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.addNode.call(t,t=>x(this,void 0,void 0,function*(){const{createNodeService:n,cellFactory:r,commandService:o,options:i}=t,a=yield e.getX6Graph();let s=t.nodeConfig;if(n){const e=yield n(t);if("boolean"==typeof e)return{err:"createNodeService rejected"};s=e}const l=yield this.processNodeConfig(s);let d;const c=Object.assign(Object.assign({},i),{isCommand:!0});if(r){const e=yield r(l,this);d=a.addNode(e,c)}else d=a.addNode(l,c);return e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){const e=Object.assign({id:d.id},d.getData());o.executeCommand(Zs.DEL_NODE.id,{nodeConfig:e})}))),{nodeConfig:l,nodeCell:d}}),n);return e.setResult(o),this}),this.processNodeConfig=e=>x(this,void 0,void 0,function*(){const t=this.contextProvider();if(e.data=Object.assign({},e),e.shape)return e;if(!e.view){const n=yield t.getGraphConfig();e.view=n.graphId}if(!e.component){const n=yield this.getNodeReactComponent(e),r=t.getCommands(),o=t.getModelService();e.shape="react-shape",e.component=Pc(n,r,o)}return e}),this.getNodeReactComponent=e=>x(this,void 0,void 0,function*(){const t=this.contextProvider(),n=t.getHooks(),r=yield t.getGraphConfig(),o=yield n.reactNodeRender.call(r.nodeRender),i=r.nodeTypeParser(e)||Nr,a=o.get(i);return a||console.error("react node component is missing:",r.nodeRender,i,a),a}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Su;y([nr(Jd),b("design:type",Object)],Eu.prototype,"contextProvider",void 0),Eu=y([er({token:{token:Zd,named:_u.command.id}})],Eu),function(e){e.command=Zs.DEL_NODE,e.hookKey="delNode",e.createHook=()=>new gc}(Su||(Su={}));let Cu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.delNode.call(t,t=>x(this,void 0,void 0,function*(){const{commandService:n,deleteNodeService:r,options:o}=t,i=yield e.getX6Graph();if(r){if(!(yield r(t)))return{err:" service rejected"}}const a=(t.x6Node||t.nodeConfig).id,s=i.getCellById(a);if(s&&s.isNode()){const t=[...i.getIncomingEdges(s)||[],...i.getOutgoingEdges(s)||[]];yield Promise.all(t.map(e=>n.executeCommand(Js.DEL_EDGE.id,{x6Edge:e})));const r=s.getData();return s.remove(Object.assign(Object.assign({},o),{isCommand:!0})),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){yield n.executeCommand(Zs.ADD_NODE.id,{nodeConfig:r})}))),{err:null,nodeConfig:r}}return{err:"node is not exist"}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){if(this.isUndoable()){this.contextProvider().undo()}return this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Ou;y([nr(Jd),b("design:type",Object)],Cu.prototype,"contextProvider",void 0),Cu=y([er({token:{token:Zd,named:Su.command.id}})],Cu),function(e){e.command=Zs.SELECT_NODE,e.hookKey="selectNode"}(Ou||(Ou={}));let ku=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.selectNode.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),n=t.getSelectedCells().map(e=>e.id),{nodeIds:r,resetSelection:o,commandService:i}=e;return o?t.resetSelection(r):t.select(r),this.ctx.addUndo({dispose:()=>{i.executeUndoCommand(Zs.SELECT_NODE.id,{nodeIds:n,resetSelection:!0})}}),{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Mu;y([nr(Jd),b("design:type",Object)],ku.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],ku.prototype,"init",null),ku=y([er({token:{token:Zd,named:Ou.command.id}})],ku),function(e){e.command=Zs.MOVE_NODE,e.hookKey="moveNode",e.createHook=()=>new gc}(Mu||(Mu={}));let Nu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.moveNode.call(t,t=>x(this,void 0,void 0,function*(){const{nodePositionService:n}=t;if(n){if(!(yield n(t)))return{err:"service rejected"}}const{dx:r=0,dy:o=0,x:i,y:a,duration:s=150}=t.position,l=(yield e.getX6Graph()).getCellById(t.id);if(l){let t=i,n=a;const{x:d,y:c}=l.position();let u=()=>{l.position(d,c,{silent:!1})};return r||o?(t=r+d,n=o+c,l.translate(r,o,{transition:{duration:s}}),u=()=>l.translate(-r,-o,{transition:{duration:s}})):l.position(t,n,{silent:!1}),e.addUndo(Er.create(()=>{u()})),{err:null,nextX:t,nextY:n}}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};y([nr(Jd),b("design:type",Object)],Nu.prototype,"contextProvider",void 0),Nu=y([er({token:{token:Zd,named:Mu.command.id}})],Nu);var Au=zo,Tu=Vo;var Pu,Du=function(e){return!0===e||!1===e||Tu(e)&&"[object Boolean]"==Au(e)};!function(e){e.command=Zs.UPDATE_NODE,e.hookKey="updateNode",e.XFlowNodeSetOptions={overwrite:!0},e.NODE_WIDTH=200,e.NODE_HEIGHT=40}(Pu||(Pu={}));let ju=class{constructor(){this.setNodeConfig=(e,t,n)=>{e.setData(t,n),e.setPosition((null==t?void 0:t.x)||0,(null==t?void 0:t.y)||0),e.setSize((null==t?void 0:t.width)||Pu.NODE_WIDTH,(null==t?void 0:t.height)||Pu.NODE_HEIGHT),e.angle((null==t?void 0:t.angle)||0,{absolute:!0}),Du(null==t?void 0:t.visible)&&e.setVisible(null==t?void 0:t.visible),e instanceof i.ReactShape||!e.getAttrByPath("text/text")||e.setAttrByPath("text/text",t.label),t.attrs&&e.setAttrs(t.attrs),Array.isArray(t.ports)&&e.setPropByPath("ports/items",t.ports,Object.assign({rewrite:!0},n))},this.getNodeConfig=e=>{const t=e.getData(),n=e.getPosition(),r=e.getSize();return Object.assign(Object.assign(Object.assign({},t),n),r)},this.getNodeCell=(e,t)=>{const{nodeConfig:r,setNodeConfig:o}=t;let i="";return o&&o.node&&"string"==typeof o.node?i=o.node:r&&r.id&&"string"==typeof r.id&&(i=r.id),i?null==e?void 0:e.getCellById(i):o&&o.node instanceof n.Node?o.node:void 0},this.getNextNodeConfig=(e,t)=>x(this,void 0,void 0,function*(){if(e&&e.setNodeConfig&&e.setNodeConfig.callback){const n=this.getNodeConfig(t);return e.setNodeConfig.callback(n)}return e.nodeConfig}),this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.updateNode.call(e,e=>x(this,void 0,void 0,function*(){const{options:t=Pu.XFlowNodeSetOptions}=e,n=yield this.ctx.getX6Graph(),r=this.getNodeCell(n,e),o=yield this.getNextNodeConfig(e,r);return this.setNodeConfig(r,o,t),{nodeConfig:o,nodeCell:r}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Iu;y([nr(Jd),b("design:type",Object)],ju.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],ju.prototype,"init",null),ju=y([er({token:{token:Zd,named:Pu.command.id}})],ju),function(e){e.command=Zs.CENTER_NODE,e.hookKey="centerNode"}(Iu||(Iu={}));let Ru=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.centerNode.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{nodeConfig:n}=e,r=null==t?void 0:t.getCellById(null==n?void 0:n.id);return null==t||t.centerCell(r),{x6Node:r}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Lu;y([nr(Jd),b("design:type",Object)],Ru.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Ru.prototype,"init",null),Ru=y([er({token:{token:Zd,named:Iu.command.id}})],Ru),function(e){e.command=Zs.FRONT_NODE,e.hookKey="frontNode"}(Lu||(Lu={}));let Fu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.frontNode.call(t,t=>x(this,void 0,void 0,function*(){const n=yield this.ctx.getX6Graph(),{nodeId:r}=t,o=null==n?void 0:n.getCellById(r);return o?(o.toFront(),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){t.commandService.executeCommand(Zs.BACK_NODE.id,{nodeId:r})})))):console.error(r,"this nodeId is not exist"),{}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Gu;y([nr(Jd),b("design:type",Object)],Fu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Fu.prototype,"init",null),Fu=y([er({token:{token:Zd,named:Lu.command.id}})],Fu),function(e){e.command=Zs.BACK_NODE,e.hookKey="backNode"}(Gu||(Gu={}));let Uu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.backNode.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{nodeId:n}=e,r=null==t?void 0:t.getCellById(n);return r?(r.toBack(),this.ctx.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){e.commandService.executeCommand(Zs.FRONT_NODE.id,{nodeId:n})})))):console.error(n,"this nodeId is not exist"),{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Hu;y([nr(Jd),b("design:type",Object)],Uu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Uu.prototype,"init",null),Uu=y([er({token:{token:Zd,named:Gu.command.id}})],Uu),function(e){e.command=Zs.HIGHLIGHT_NODE,e.hookKey="highlightNode"}(Hu||(Hu={}));let Bu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.highlightNode.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{nodeId:n,stroke:r,strokeWidth:o}=e,i=null==t?void 0:t.getCellById(n);if(!i)return console.error(n,"this nodeId is not exist"),{err:"this nodeId is not exist"};if(null==i||i.setAttrs({body:{stroke:r||"#7c68fc",strokeWidth:o||2}}),null==e?void 0:e.isHighlightRelatedLines){const{edgeStroke:n,edgeStrokeWidth:r}=e;(null==t?void 0:t.getEdges()).forEach(t=>{const o=null==t?void 0:t.getData();null==e||e.commandService.executeCommand(Js.HIGHLIGHT_EDGE.id,{edgeId:null==o?void 0:o.id,strokeColor:n,strokeWidth:r})})}return{err:null}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var zu;y([nr(Jd),b("design:type",Object)],Bu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Bu.prototype,"init",null),Bu=y([er({token:{token:Zd,named:Hu.command.id}})],Bu),function(e){e.command=Zs.UPDATE_NODE_PORT,e.hookKey="updateNodePort"}(zu||(zu={}));let Vu=class{constructor(){this.getCell=(e,t)=>"string"==typeof t?e.getCellById(t):t,this.getNodeConfig=e=>{const t=e.getData(),n=e.getPosition(),r=e.getSize();return Object.assign(Object.assign(Object.assign({},t),n),r)},this.updatePortsOfNodeConfig=(e,t,n)=>{const r=this.getNodeConfig(e);this.isNodeAnchors(r.ports)&&(r.ports=[...t]),this.isPortMetaData(r.ports)&&(r.ports.items=[...t]),e.setData(r,n)},this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield e.getX6Graph(),i=yield r.updateNodePort.call(t,t=>x(this,void 0,void 0,function*(){const{node:n,updatePorts:r,options:i,commandService:a}=t,s=this.getCell(o,n);if(!s||s.isEdge())return console.error("node_is _not_exsit",n),{err:"node_is _not_exsit"};const l=s.getPorts(),d=yield r([...l],s,o);return!1===d?{err:"service rejected"}:(s.setPropByPath("ports/items",d,Object.assign({rewrite:!0},i)),this.updatePortsOfNodeConfig(s,d,i),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){a.executeCommand(Zs.UPDATE_NODE_PORT.id,{node:n,updatePorts:()=>x(this,void 0,void 0,function*(){return l})})}))),{ports:d})}),n);return e.setResult(i),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isNodeAnchors(e){return Array.isArray(e)}isPortMetaData(e){return e.items&&Array.isArray(e.items)}isUndoable(){return this.contextProvider().isUndoable()}};y([nr(Jd),b("design:type",Object)],Vu.prototype,"contextProvider",void 0),Vu=y([er({token:{token:Zd,named:zu.command.id}})],Vu);const Yu=[_u,Su,Ou,Mu,Pu,Iu,Lu,Gu,Hu,zu];var Wu;!function(e){e.command=Qs.LOAD_META,e.hookKey="graphMeta"}(Wu||(Wu={}));let $u=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.graphMeta.call(e,e=>x(this,void 0,void 0,function*(){const{graphMetaService:t}=e,n=t?yield t(e):Object.assign({},null==e?void 0:e.meta);return Object.assign({flowId:null==n?void 0:n.flowId},n)}),t),o=this.ctx.getModelService();return(yield tu.getModel(o)).setValue(r),this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Ku;y([nr(Jd),b("design:type",Object)],$u.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],$u.prototype,"init",null),$u=y([er({token:{token:Zd,named:Wu.command.id}})],$u),function(e){e.command=Qs.SAVE_GRAPH_DATA,e.hookKey="saveGraphData"}(Ku||(Ku={}));let Xu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.ctx,t=e.getArgs(),n=e.getHooks();return yield n.saveGraphData.call(t.args,t=>x(this,void 0,void 0,function*(){const{saveGraphDataService:n,includeAttrs:r}=t,o=yield e.getX6Graph(),i=o.getNodes(),a=o.getEdges(),s={nodes:i.map(e=>{const t=e.getData(),n=e.position(),o=e.size(),i=Object.assign(Object.assign(Object.assign({id:e.id},t),n),o);return r&&(i.attrs=e.getAttrs()),i}),edges:a.map(e=>{const t=e.getData(),n=Object.assign({id:e.id},t);return r&&(n.attrs=e.getAttrs()),n})},l=yield this.ctx.getGraphMeta();if(n){const e=yield n(l,s);e&&this.ctx.setResult(e)}return{}}),t.hooks),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var qu;y([nr(Jd),b("design:type",Object)],Xu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Xu.prototype,"init",null),Xu=y([er({token:{token:Zd,named:Ku.command.id}})],Xu),function(e){e.command=Qs.LOAD_DATA,e.hookKey="loadData",e.createHook=()=>new gc}(qu||(qu={}));let Zu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.loadData.call(e,e=>x(this,void 0,void 0,function*(){const{loadDataService:t}=e,n=yield this.ctx.getGraphMeta();return{graphData:yield t(n)}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Ju;y([nr(Jd),b("design:type",Object)],Zu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Zu.prototype,"init",null),Zu=y([er({token:{token:Zd,named:qu.command.id}})],Zu),function(e){e.command=Qs.GRAPH_LAYOUT,e.hookKey="graphLayout"}(Ju||(Ju={}));let Qu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.graphLayout.call(e,e=>x(this,void 0,void 0,function*(){const{layoutType:t,layoutOptions:n,customLayout:r}=e,o=r||(e=>new(0,p.Layouts[t])(Object.assign({},n)).layout(e));return yield o(e.graphData),{graphData:e.graphData}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var ef,tf;y([nr(Jd),b("design:type",Object)],Qu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Qu.prototype,"init",null),Qu=y([er({token:{token:Zd,named:Ju.command.id}})],Qu),function(e){e.isNodeEqual=function(e,t){return o.isEqual(e,t)},e.isEdgeEqual=function(e,t){return o.isEqual(e,t)}}(ef||(ef={})),function(e){e.command=Qs.GRAPH_RENDER,e.hookKey="graphRender"}(tf||(tf={}));let nf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.graphRender.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),n=yield this.ctx.getGraphMeta(),{beforeRender:r,graphData:o,isNodeEqual:i,isEdgeEqual:a,afterRender:s}=e;return r&&r(n),yield this.doLoadGraph(t,o,i,a),s&&s(o,n),{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this}),this.doLoadGraph=(e,t,n,r)=>x(this,void 0,void 0,function*(){(null==e?void 0:e.isFrozen())||null==e||e.freeze();const o=this.ctx.getCommands(),{addNodeConfigs:i,addEdgeConfigs:a,removeNodes:s,removeEdges:l,updateNodes:d,updateEdges:c}=this.graphDataDiff(e,t,n,r);for(const e of d){const t=null==e?void 0:e.getData();yield o.executeCommand(Zs.UPDATE_NODE.id,{nodeConfig:t})}for(const e of c){const t=null==e?void 0:e.getData();yield o.executeCommand(Js.UPDATE_EDGE.id,{edgeConfig:t})}for(const e of i)yield o.executeCommand(Zs.ADD_NODE.id,{nodeConfig:e,options:{isRenderGraph:!0}},{name:"remove servcie",handler:e=>x(this,void 0,void 0,function*(){delete e.createNodeService})});yield o.executeCommand(tl.INIT_GROUP.id,{graphData:{nodes:i,edges:[]}});for(const e of a)yield o.executeCommand(Js.ADD_EDGE.id,{edgeConfig:e,options:{isRenderGraph:!0}},{name:"remove servcie",handler:e=>x(this,void 0,void 0,function*(){delete e.createEdgeService})});for(const e of s){const t=null==e?void 0:e.getData();t.isGroup?yield o.executeCommand(tl.DEL_GROUP.id,{nodeConfig:t}):yield o.executeCommand(Zs.DEL_NODE.id,{nodeConfig:t})}for(const e of l){const t=null==e?void 0:e.getData();yield o.executeCommand(Js.DEL_EDGE.id,{edgeConfig:t})}(null==e?void 0:e.isFrozen())&&(null==e||e.unfreeze())})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}graphDataDiff(e,t,n,r){const{nodes:o,edges:i}=t,a=[];o.forEach(t=>{e.getCellById(null==t?void 0:t.id)||a.push(t)});const s=[],l=[],d=[];e.getNodes().forEach(e=>{const t=o.find(t=>(null==t?void 0:t.id)===(null==e?void 0:e.id));if(t){let r=!0;n?r=n(null==e?void 0:e.data,t):(null==e?void 0:e.data)&&t&&(r=ef.isNodeEqual(null==e?void 0:e.data,t)),r||e.setData(t,{deep:!1}),!0===r?s.push(e):l.push(e)}else d.push(e)});const c=[];i.forEach(t=>{e.getCellById(null==t?void 0:t.id)||c.push(t)});const u=[],f=[],h=[];return e.getEdges().forEach(e=>{const t=i.find(t=>(null==t?void 0:t.id)===(null==e?void 0:e.id));if(t){let n=!0;r?n=r(null==e?void 0:e.data,t):(null==e?void 0:e.data)&&t&&(n=ef.isEdgeEqual(null==e?void 0:e.data,t)),n||e.setData(t,{deep:!1}),!0===n?u.push(e):f.push(e)}else h.push(e)}),{addNodeConfigs:a,addEdgeConfigs:c,retainNodes:s,retainEdges:u,removeNodes:d,removeEdges:h,updateNodes:l,updateEdges:f}}};var rf;y([nr(Jd),b("design:type",Object)],nf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],nf.prototype,"init",null),nf=y([er({token:{token:Zd,named:tf.command.id}})],nf),function(e){e.command=Qs.GRAPH_RESIZE,e.hookKey="graphResize"}(rf||(rf={}));let of=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield this.ctx.getGraphConfig(),o=r.rootContainer.clientHeight,i=r.rootContainer.clientWidth,a=yield n.graphResize.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{width:n=i,height:r=o}=e;return null==t||t.resize(n,r),{}}),t);return this.ctx.setResult(a),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var af;y([nr(Jd),b("design:type",Object)],of.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],of.prototype,"init",null),of=y([er({token:{token:Zd,named:rf.command.id}})],of),function(e){e.command=Qs.GRAPH_FULLSCREEN,e.hookKey="graphFullscreen"}(af||(af={}));let sf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield this.ctx.getGraphConfig(),{appContainer:o}=r;if(!o)return;const i=yield n.graphFullscreen.call(e,()=>x(this,void 0,void 0,function*(){var e,t;let n=!1;return document.fullscreenElement?null===(t=document.exitFullscreen)||void 0===t||t.call(document):(null===(e=o.requestFullscreen)||void 0===e||e.call(o),n=!0),{fulllscreen:n}}),t);return this.ctx.setResult(i),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var lf;y([nr(Jd),b("design:type",Object)],sf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],sf.prototype,"init",null),sf=y([er({token:{token:Zd,named:af.command.id}})],sf),function(e){e.command=Qs.GRAPH_ZOOM,e.MAX_SCALE=1.5,e.MIN_SCALE=.05,e.defaultZoomOptions={maxScale:e.MAX_SCALE,minScale:e.MIN_SCALE},e.hookKey="graphZoom"}(lf||(lf={}));let df=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.graphZoom.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{factor:n,zoomFitPadding:r=12,zoomOptions:o=lf.defaultZoomOptions}=e;return"number"==typeof n?null==t||t.zoom(n,o||{}):"fit"===n?null==t||t.zoomToFit(Object.assign(Object.assign({},o),{padding:r})):"real"===n&&(null==t||t.scale(1),null==t||t.centerContent()),{factor:n,zoomFitPadding:r,zoomOptions:o}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var cf;y([nr(Jd),b("design:type",Object)],df.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],df.prototype,"init",null),df=y([er({token:{token:Zd,named:lf.command.id}})],df),function(e){e.command=Qs.GRAPH_COPY,e.hookKey="graphCopySelection"}(cf||(cf={}));let uf=class{constructor(){this.parseCells=e=>{e.forEach(t=>{const n=t.getData();if(t.isNode()&&n.isGroup){t.getChildren().forEach(t=>{e.push(t)})}});const t=e.filter(e=>e.isNode()).map(e=>e.id),n=e.reduce((e,n)=>{if(n.isEdge()){const r=n.getSourceCellId(),o=n.getTargetCellId();r&&o&&t.includes(r)&&t.includes(o)&&e.set(n.id,n)}else e.set(n.id,n);return e},new Map),r=Array.from(n.values());return uu(r)},this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.graphCopySelection.call(t,()=>x(this,void 0,void 0,function*(){const t=(yield e.getX6Graph()).getSelectedCells(),n=this.parseCells(t),r=window.localStorage.getItem(Tr);return window.localStorage.setItem(Tr,JSON.stringify(n)),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){window.localStorage.setItem(Tr,r)}))),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};y([nr(Jd),b("design:type",Object)],uf.prototype,"contextProvider",void 0),uf=y([er({token:{token:Zd,named:cf.command.id}})],uf);let ff=class{constructor(){this.groupNodeMap=new Map,this.nodeMap=new Map,this.nodeMappingRecord=new Map,this.portMap=new Map,this.portMappingRecord=new Map,this.edgeMap=new Map,this.edgeMappingRecord=new Map,this.getNodesByType=e=>e.reduce((e,t)=>(t.isGroup?e.groupNodes.push(t):e.normalNodes.push(t),e),{normalNodes:[],groupNodes:[]}),this.getNodePorts=e=>Array.isArray(e.ports)?e.ports:e.ports&&Array.isArray(e.ports.items)?e.ports.items:[],this.addNodes=e=>{e.forEach(e=>{if(e.isGroup)this.groupNodeMap.set(e.id,e);else{const t=this.getNodePorts(e);this.nodeMap.set(e.id,e),t.forEach(e=>{this.portMap.set(e.id,e)})}})},this.addEdge=e=>{e.forEach(e=>{this.edgeMap.set(e.id,e)})},this.buildNodeMapping=(e,t)=>{const n=e.id||e.originId,r=t.id;this.nodeMappingRecord.set(n,r);this.getNodePorts(e).forEach((e,n)=>{const r=t.ports[n];r&&(this.portMap.set(r.id,r),this.portMappingRecord.set(e.id,r.id))})},this.createEdgeBetweenNodes=e=>{const{source:t,sourcePortId:n,target:r,targetPortId:o}=e;return Object.assign(Object.assign({},e),{source:this.nodeMappingRecord.get(t),target:this.nodeMappingRecord.get(r),sourcePortId:this.portMappingRecord.get(n),targetPortId:this.portMappingRecord.get(o),sourcePort:this.portMappingRecord.get(n),targetPort:this.portMappingRecord.get(o)})},this.buildGroupRelations=e=>{const{groupChildren:t}=e,n=t.map(e=>this.nodeMappingRecord.get(e));return Object.assign(Object.assign({},e),{groupChildren:n})}}};var hf,pf;function gf(e,t=0){return Math.floor(Math.random()*(e-t)+t)}ff=y([er()],ff),function(e){e.command=Qs.GRAPH_PASTE,e.hookKey="graphPasteSelection"}(pf||(pf={}));let vf=hf=class{constructor(){this.updateNodeCopiedProps=(e,t)=>{let n=gf(100),r=gf(100);return e&&(n=t.x-e.x+gf(30),r=t.y-e.y+gf(30)),t.x+=n,t.y+=r,t.originId=t.id,delete t.id,t.label=`${t.label}_copied`,t.isCollapsed=!1,t},this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks();if(hf.doing)return this;hf.doing=!0;const o=yield r.graphPasteSelection.call(t,t=>x(this,void 0,void 0,function*(){const{commandService:n,position:r}=t,o=function(e,t=null){try{return JSON.parse(e)||t}catch(e){return console.error(e),t}}(window.localStorage.getItem(Tr),{nodes:[],edges:[]}),{nodes:i=[],edges:a=[]}=o,{normalNodes:s,groupNodes:l}=this.mappingHelper.getNodesByType(i);return this.mappingHelper.addNodes(i),yield Promise.all(s.map(e=>x(this,void 0,void 0,function*(){const t=(yield n.executeCommand(Zs.ADD_NODE.id,{nodeConfig:this.updateNodeCopiedProps(r,e)})).contextProvider().getResult();this.mappingHelper.buildNodeMapping(e,t.nodeConfig)}))),yield Promise.all(l.map(e=>x(this,void 0,void 0,function*(){const t=this.mappingHelper.buildGroupRelations(e);yield n.executeCommand(tl.ADD_GROUP.id,{nodeConfig:this.updateNodeCopiedProps(r,t)})}))),yield Promise.all(a.map(e=>{const t=this.mappingHelper.createEdgeBetweenNodes(e);return n.executeCommand(Js.ADD_EDGE.id,{edgeConfig:t})})),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){window.localStorage.setItem(Tr,null)}))),{err:null}}),n);return e.setResult(o),hf.doing=!1,this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var mf;vf.doing=!1,y([nr(Jd),b("design:type",Object)],vf.prototype,"contextProvider",void 0),y([nr(ff),b("design:type",ff)],vf.prototype,"mappingHelper",void 0),vf=hf=y([er({token:{token:Zd,named:pf.command.id}})],vf),function(e){e.command=Qs.GRAPH_TOGGLE_MULTI_SELECT,e.hookKey="toggleMultiSelect"}(mf||(mf={}));let yf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.toggleMultiSelect.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),n=yield this.ctx.getGraphConfig(),{isEnable:r,modelService:o}=e,i=yield Hc.getModel(o),a="boolean"==typeof r?r:!t.isRubberbandEnabled();return a?(t.enableRubberband(),t.scroller&&t.scroller.widget?t.scroller.disablePanning():t.disablePanning(),n.graphContainer.style.cursor="crosshair"):(t.disableRubberband(),t.scroller&&t.scroller.widget?t.scroller.enablePanning():t.enablePanning(),n.graphContainer.style.cursor="grab"),i.setValue({isEnable:a}),{isEnable:a}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var bf;y([nr(Jd),b("design:type",Object)],yf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],yf.prototype,"init",null),yf=y([er({token:{token:Zd,named:mf.command.id}})],yf),function(e){e.command=Qs.GRAPH_HISTORY_UNDO,e.hookKey="historyUndo"}(bf||(bf={}));let xf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.historyUndo.call(t,t=>x(this,void 0,void 0,function*(){const n=yield e.getX6Graph();return!1===n.isHistoryEnabled()?{err:"history is disabled"}:(n.undo(),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){const{commandService:e}=t;e.executeCommand(Qs.GRAPH_HISTORY_REDO.id,{})}))),{err:null})}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var wf;y([nr(Jd),b("design:type",Object)],xf.prototype,"contextProvider",void 0),xf=y([er({token:{token:Zd,named:bf.command.id}})],xf),function(e){e.command=Qs.GRAPH_HISTORY_REDO,e.hookKey="historyRedo"}(wf||(wf={}));let _f=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.historyRedo.call(t,t=>x(this,void 0,void 0,function*(){const n=yield e.getX6Graph();return!1===n.isHistoryEnabled()?{err:"history is disabled"}:(n.redo(),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){const{commandService:e}=t;e.executeCommand(Qs.GRAPH_HISTORY_UNDO.id,{})}))),{err:null})}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Ef;y([nr(Jd),b("design:type",Object)],_f.prototype,"contextProvider",void 0),_f=y([er({token:{token:Zd,named:wf.command.id}})],_f),function(e){e.command=Qs.GRAPH_HISTORY_TOGGLE,e.hookKey="historyToggle"}(Ef||(Ef={}));let Sf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.historyToggle.call(t,t=>x(this,void 0,void 0,function*(){const n=yield e.getX6Graph();if(!1===n.isHistoryEnabled())return{err:"history is disabled"};const r=n.isHistoryEnabled(),{enabled:o}=t;return n.toggleHistory(o),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){const{commandService:e}=t;e.executeCommand(Qs.GRAPH_HISTORY_TOGGLE.id,{enabled:r})}))),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Cf;y([nr(Jd),b("design:type",Object)],Sf.prototype,"contextProvider",void 0),Sf=y([er({token:{token:Zd,named:Ef.command.id}})],Sf),function(e){e.command=Qs.GRAPH_HISTORY_RESET,e.hookKey="historyReset"}(Cf||(Cf={}));let Of=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.historyReset.call(t,()=>x(this,void 0,void 0,function*(){return(yield e.getX6Graph()).cleanHistory(),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var kf;y([nr(Jd),b("design:type",Object)],Of.prototype,"contextProvider",void 0),Of=y([er({token:{token:Zd,named:Cf.command.id}})],Of),function(e){e.command=Qs.GRAPH_ADD_TOOL,e.hookKey="addTool"}(kf||(kf={}));let Mf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.addTool.call(t,t=>x(this,void 0,void 0,function*(){const{cellId:n,toolConfig:r,commandService:o}=t,i=(yield e.getX6Graph()).getCellById(n);return i&&(i.addTools(r.items,r.options),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){Array.isArray(r.items)&&r.items.forEach(e=>{o.executeCommand(Qs.GRAPH_DEL_TOOL.id,{cellId:n,toolname:e})})})))),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Nf;y([nr(Jd),b("design:type",Object)],Mf.prototype,"contextProvider",void 0),Mf=y([er({token:{token:Zd,named:kf.command.id}})],Mf),function(e){e.command=Qs.GRAPH_DEL_TOOL,e.hookKey="delTool"}(Nf||(Nf={}));let Af=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.delTool.call(t,t=>x(this,void 0,void 0,function*(){const{cellId:n,toolName:r,toolConfig:o}=t,i=(yield e.getX6Graph()).getCellById(n);return i&&("*"===r?i.removeTools(o):i.removeTool(r,o)),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Tf;y([nr(Jd),b("design:type",Object)],Af.prototype,"contextProvider",void 0),Af=y([er({token:{token:Zd,named:Nf.command.id}})],Af),function(e){e.command=Qs.REDO_CMD,e.hookKey="redoCommand"}(Tf||(Tf={}));let Pf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.ctx,{args:t,hooks:n}=e.getArgs(),r=e.getHooks();return yield r.redoCommand.call(t,()=>x(this,void 0,void 0,function*(){const t=e.getCommands();return t.isRedoable&&t.redoCommand(),this.ctx.addUndo(Er.create(()=>{t.redoCommand()})),{}}),n),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Df;y([nr(Jd),b("design:type",Object)],Pf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Pf.prototype,"init",null),Pf=y([er({token:{token:Zd,named:Tf.command.id}})],Pf),function(e){e.command=Qs.UNDO_CMD,e.hookKey="undoCommand"}(Df||(Df={}));let jf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.ctx,{args:t,hooks:n}=e.getArgs(),r=e.getHooks();return yield r.undoCommand.call(t,()=>x(this,void 0,void 0,function*(){const t=e.getCommands();return t.isUndoable&&t.undoCommand(),this.ctx.addUndo(Er.create(()=>{t.redoCommand()})),{}}),n),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};y([nr(Jd),b("design:type",Object)],jf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],jf.prototype,"init",null),jf=y([er({token:{token:Zd,named:Df.command.id}})],jf);const If=[Wu,Ku,qu,bf,wf,Cf,Ef,Ju,tf,rf,af,Tf,Df,lf,mf,cf,pf,kf,Nf];var Rf;!function(e){function t(e){return e.source&&e.source.cell&&n.StringExt.isString(e.source.cell)}function r(e){return e.sourceCell&&n.StringExt.isString(e.sourceCell)}e.command=Js.ADD_EDGE,e.hookKey="addEdge",e.createEdgeId=e=>{if(n.StringExt.isString(e.source))return`${e.source}:${e.sourcePortId}-${e.target}:${e.targetPortId}`;if(t(e)){const t=e;return`${t.source.cell}:${t.source.port}-${t.target.cell}:${t.target.port}`}if(r(e)){const t=e;return`${t.sourceCell}:${t.sourcePort}-${t.targetCell}:${t.targetPort}`}},e.isX6EdgeConfig=t,e.isX6EdgePlainConfig=r}(Rf||(Rf={}));let Lf=class{constructor(){this.processEdgeConfig=(e,t)=>x(this,void 0,void 0,function*(){if(!t.id){const{createIdService:n=Rf.createEdgeId}=e;t.id=yield n(t)}return t.sourcePortId&&!t.sourcePort&&(t.sourcePort=t.sourcePortId,t.targetPort=t.targetPortId),t}),this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.addEdge.call(e,e=>x(this,void 0,void 0,function*(){const{cellFactory:t,createEdgeService:n,commandService:r,options:o}=e,i=yield this.ctx.getX6Graph();let a=e.edgeConfig;if(n){const t=yield n(e);if("boolean"==typeof t)return{err:"createEdgeService rejected"};a=t}const s=yield this.processEdgeConfig(e,a);let l;const d=Object.assign(Object.assign({},o),{isCommand:!0});if(t){const e=yield t(s,this);l=i.addEdge(e,d)}else l=i.addEdge(Object.assign(Object.assign({},s),{label:(null==s?void 0:s.label)||s,data:Object.assign({},s)}),d);const c=Er.create(()=>{r.executeCommand(Js.DEL_EDGE.id,{x6Edge:l})});return this.ctx.addUndo(c),{edgeConfig:s,edgeCell:l}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Ff;y([nr(Jd),b("design:type",Object)],Lf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Lf.prototype,"init",null),Lf=y([er({token:{token:Zd,named:Rf.command.id}})],Lf),function(e){var t;e.command=Js.DEL_EDGE,e.hookKey="delEdge",(t=e.ErrEnum||(e.ErrEnum={})).EDGE_NOT_EXIST="edge is not exist",t.EDGE_INVALID_CELL="this is not a valid cell",t.X6_DELETE_FAILED="x6 throw err when call delete edge",t.SERVICE_REJECT="service reject to delete"}(Ff||(Ff={}));let Gf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.delEdge.call(e,e=>x(this,void 0,void 0,function*(){const{edgeConfig:t,x6Edge:n,deleteEdgeService:r,commandService:o,options:i}=e;let a=n;if(!a&&(a=yield this.findEdgeById(t),!a))return console.error(Ff.ErrEnum.EDGE_NOT_EXIST,t),{err:Ff.ErrEnum.EDGE_NOT_EXIST};if(!(a&&a.isEdge()))return console.error(Ff.ErrEnum.EDGE_NOT_EXIST,a),{err:Ff.ErrEnum.EDGE_NOT_EXIST};if(r){if(!(yield r(e)))return{err:Ff.ErrEnum.SERVICE_REJECT}}try{const e=a.getTargetCell(),t=a.getSourceCell(),n=a.getSourcePortId(),r=a.getTargetPortId(),s=t?t.id:t.source,l=e?e.id:e.target;a.remove(Object.assign(Object.assign({},i),{isCommand:!0}));const d=Er.create(()=>{o.executeCommand(Js.ADD_EDGE.id,{edgeConfig:{source:s,target:l,sourcePortId:n,targetPortId:r}})});return this.ctx.addUndo(d),{err:null,edgeConfig:{source:s,target:l,sourcePortId:n,targetPortId:r},targetCell:e,sourceCell:t,sourcePortId:n,targetPortId:r}}catch(e){return console.error(Ff.ErrEnum.X6_DELETE_FAILED,e),{err:Ff.ErrEnum.X6_DELETE_FAILED}}}),t);return this.ctx.setResult(r),this}),this.findEdgeById=e=>x(this,void 0,void 0,function*(){return(yield this.ctx.getX6Graph()).getCellById(e.id)}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};y([nr(Jd),b("design:type",Object)],Gf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Gf.prototype,"init",null),Gf=y([er({token:{token:Zd,named:Ff.command.id}})],Gf);var Uf,Hf=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};!function(e){e.command=Js.UPDATE_EDGE,e.hookKey="updateEdge",e.XFlowEdgeSetOptions={overwrite:!0},e.XFlowUpdateLabelService=(t,n,r=e.XFlowEdgeSetOptions)=>x(this,void 0,void 0,function*(){null==t||t.setLabelAt(0,(null==n?void 0:n.label)||n,r)})}(Uf||(Uf={}));let Bf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.updateEdge.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{updateEdgeService:n,updateEdgeLabelService:r=Uf.XFlowUpdateLabelService,options:o=Uf.XFlowEdgeSetOptions}=e,i=n?yield n(e):null==e?void 0:e.edgeConfig,a=null==t?void 0:t.getCellById(null==i?void 0:i.id);return null==a||a.setData(i,o),(null==i?void 0:i.hasOwnProperty("label"))&&(yield r(a,i,o)),Du(null==i?void 0:i.visible)&&a.setVisible(null==i?void 0:i.visible),i.attrs&&a.setAttrs(i.attrs),i.vertices&&a.setVertices(i.vertices),i.router&&a.setRouter(i.router),i.connector&&a.setConnector(i.connector),Hf(i.source)&&a.setSource(i.source),Hf(i.target)&&a.setTarget(i.target),{edgeConfig:i,edgeCell:a}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var zf;y([nr(Jd),b("design:type",Object)],Bf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Bf.prototype,"init",null),Bf=y([er({token:{token:Zd,named:Uf.command.id}})],Bf),function(e){e.command=Js.HIGHLIGHT_EDGE,e.hookKey="highlightEdge"}(zf||(zf={}));let Vf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.highlightEdge.call(e,e=>x(this,void 0,void 0,function*(){var t,n;const r=yield this.ctx.getX6Graph(),{edgeId:o,strokeColor:i,strokeWidth:a}=e,s=r.getEdges(),l=s.find(e=>e.id===o),d=s.filter(e=>e.id!==o);if(l){const r=l.getAttrs();(null===(t=null==r?void 0:r.line)||void 0===t?void 0:t.stroke)===i&&(null===(n=null==r?void 0:r.line)||void 0===n?void 0:n.strokeWidth)===a||(null==l||l.setAttrs({line:{stroke:i,strokeWidth:a||2}}),d.forEach(e=>{e.setAttrs({line:null==r?void 0:r.line})}),e.commandService.executeCommand(Js.FRONT_EDGE.id,{edgeId:o}))}else console.error(o,"this edgeId is not exist");return{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Yf;y([nr(Jd),b("design:type",Object)],Vf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Vf.prototype,"init",null),Vf=y([er({token:{token:Zd,named:zf.command.id}})],Vf),function(e){e.command=Js.FRONT_EDGE,e.hookKey="frontEdge"}(Yf||(Yf={}));let Wf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.frontEdge.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{edgeId:n}=e,r=null==t?void 0:t.getCellById(n);return r?(r.toFront(),this.ctx.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){e.commandService.executeCommand(Js.BACK_EDGE.id,{edgeId:n})})))):console.error(n,"this edgeId is not exist"),{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var $f;y([nr(Jd),b("design:type",Object)],Wf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Wf.prototype,"init",null),Wf=y([er({token:{token:Zd,named:Yf.command.id}})],Wf),function(e){e.command=Js.BACK_EDGE,e.hookKey="frontEdge"}($f||($f={}));let Kf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.frontEdge.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{edgeId:n}=e,r=null==t?void 0:t.getCellById(n);return r?(r.toBack(),this.ctx.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){e.commandService.executeCommand(Js.FRONT_EDGE.id,{edgeId:n})})))):console.error(n,"this edgeId is not exist"),{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};y([nr(Jd),b("design:type",Object)],Kf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Kf.prototype,"init",null),Kf=y([er({token:{token:Zd,named:$f.command.id}})],Kf);const Xf=[Rf,Ff,Uf,zf,Yf,$f];var qf;!function(e){e.command=tl.ADD_GROUP,e.hookKey="addGroup",e.GROUP_PADDING=12,e.GROUP_HEADER_HEIGHT=40}(qf||(qf={}));let Zf=class{constructor(){this.getBBox=(e,t,n)=>{const{groupHeaderHeight:r=qf.GROUP_HEADER_HEIGHT,groupPadding:o=qf.GROUP_PADDING}=t,i=n.getCellsBBox(e.children);return i.moveAndExpand({x:-o,y:-(o+r),width:2*o,height:2*o+r}),i},this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.addGroup.call(t,t=>x(this,void 0,void 0,function*(){const{nodeConfig:n,createService:r,cellFactory:o,commandService:i}=t,a=yield e.getX6Graph(),s=yield i.executeCommand(Zs.ADD_NODE.id,{cellFactory:o,createNodeService:r,nodeConfig:n}),{nodeCell:l}=s.contextProvider().getResult(),{id:d}=l,{groupChildren:c}=n;if(c.length){c.forEach(e=>{const t=a.getCellById(e);t&&(t.setData(Object.assign(Object.assign({},t.getData()),{group:d,isCollapsed:!1})),t.prop("group",d),l.addChild(t),a.unselect(t))});const e=this.getBBox(l,n,a);l.position(e.x,e.y),l.size(e.width,e.height),l.setZIndex(0),l.prop("isGroup",!0),l.setData(Object.assign(Object.assign({},l.getData()),{width:e.width,height:e.height,groupChildrenSize:{width:e.width,height:e.height},x:e.x,y:e.y,isGroup:!0})),a.select(l)}return n.isCollapsed&&(yield i.executeCommand(tl.COLLAPSE_GROUP.id,{nodeId:n.id,isCollapsed:n.isCollapsed})),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){i.executeCommand(tl.DEL_GROUP.id,{nodeConfig:n})}))),{nodeConfig:n,nodeCell:l}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Jf;y([nr(Jd),b("design:type",Object)],Zf.prototype,"contextProvider",void 0),Zf=y([er({token:{token:Zd,named:qf.command.id}})],Zf),function(e){e.command=tl.DEL_GROUP,e.hookKey="delGroup"}(Jf||(Jf={}));let Qf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.delGroup.call(t,t=>x(this,void 0,void 0,function*(){const n=yield e.getX6Graph(),{nodeConfig:r,commandService:o,deleteService:i}=t,{id:a}=r,s=n.getCellById(a);if(i){if(!(yield i(t)))return{err:"service rejected"}}if(!s)return{err:"target node is not exist"};if(!0!==s.getProp("isGroup"))return{err:"target node is not group"};const{isCollapsed:l}=s.getData();l&&(yield o.executeCommand(tl.COLLAPSE_GROUP.id,{nodeId:s.id,isCollapsed:!1,collapsedSize:{width:0,height:0}}));const d=s.getChildren();return d&&d.forEach(e=>{s.unembed(e),e.prop("group",""),e.setData(Object.assign(Object.assign({},e.getData()),{group:""}))}),yield o.executeCommand(Zs.DEL_NODE.id,{nodeConfig:r}),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){o.executeCommand(tl.ADD_GROUP.id,{nodeConfig:r})}))),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var eh;y([nr(Jd),b("design:type",Object)],Qf.prototype,"contextProvider",void 0),Qf=y([er({token:{token:Zd,named:Jf.command.id}})],Qf),function(e){e.command=tl.INIT_GROUP,e.hookKey="initGroup"}(eh||(eh={}));let th=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.initGroup.call(t,t=>x(this,void 0,void 0,function*(){const{graphData:n,commandService:r}=t,o=yield e.getX6Graph(),{nodes:i}=n,a={};return i.forEach(e=>{const{id:t,group:n}=e;n&&(a[n]?a[n].push(t):a[n]=[t])}),Object.keys(a).forEach(e=>x(this,void 0,void 0,function*(){const n=o.getCellById(e),i=n.getData(),s=a[e]||[];n.prop("isGroup",!0),n.setData(Object.assign(Object.assign({},i),{isGroup:!0,groupChildren:s})),s.forEach(e=>{const t=o.getCellById(e);n.embed(t)}),n.toBack();const{isCollapsed:l,groupCollapsedSize:d}=i;if(l){const e=t.collapsedSize||d||Pr;yield r.executeCommand(tl.COLLAPSE_GROUP.id,{collapsedSize:e,isCollapsed:!0,nodeId:n.id})}})),{}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var nh;y([nr(Jd),b("design:type",Object)],th.prototype,"contextProvider",void 0),th=y([er({token:{token:Zd,named:eh.command.id}})],th),function(e){e.command=tl.COLLAPSE_GROUP,e.hookKey="collapseGroup"}(nh||(nh={}));let rh=class{constructor(){this.toggleVisible=(e,t,n)=>{e.forEach(e=>{n.findViewByCell(e).container.style.visibility=t?"visible":"hidden"})},this.toggleCollapse=(e,t,n)=>{const r=e.getChildren().filter(e=>e.isNode()),o=e.getData(),{isCollapsed:i,gap:a=0}=n;if(i){const t=n.collapsedSize||o.groupCollapsedSize||Pr;e.prop("previousSize",e.size()),e.size(t)}else e.size(e.prop("previousSize"));r&&r.forEach(n=>{const o=e.position(),s=t.getConnectedEdges(n).filter(e=>{const t=e.getSourceNode(),n=e.getTargetNode();return r.includes(t)&&r.includes(n)});if(i){this.toggleVisible([n,...s],!1,t),n.prop("previousSize",n.size()),n.prop("previousRelativePosition",n.position({relative:!0})),n.position(o.x+a,o.y+a);const r=e.size();n.size({width:r.width-2*a,height:r.height-2*a})}else{this.toggleVisible([n,...s],!0,t);const e=n.prop("previousRelativePosition"),r=n.prop("previousSize");n.position(e.x,e.y,{relative:!0}),n.size(r)}}),e.prop("isCollapsed",i),e.setData(Object.assign(Object.assign({},e.getData()),{isCollapsed:i}))},this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.collapseGroup.call(e,t=>x(this,void 0,void 0,function*(){const n=yield this.ctx.getX6Graph(),r=n.getCellById(e.nodeId),{toggleService:o}=t;if(o){if(!(yield o(t)))return{err:"service rejected"}}return r&&(this.toggleCollapse(r,n,e),this.ctx.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){r&&this.toggleCollapse(r,n,Object.assign(e,{isCollapsed:!e.isCollapsed}))})))),{err:null}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};y([nr(Jd),b("design:type",Object)],rh.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],rh.prototype,"init",null),rh=y([er({token:{token:Zd,named:nh.command.id}})],rh);const oh=[qf,Jf,eh,nh];var ih;!function(e){e.command=el.UPDATE_MODEL,e.hookKey="updateModel"}(ih||(ih={}));let ah=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.updateModel.call(t,t=>x(this,void 0,void 0,function*(){const{updateModel:n,getModel:r,modelService:o}=t,i=yield r(o),a=i.getValue(),s=Wd(a);yield n(s);const l=$d(s);return i.setValue(l),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){i.setValue(l)}))),{model:i,value:l}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};y([nr(Jd),b("design:type",Object)],ah.prototype,"contextProvider",void 0),ah=y([er({token:{token:Zd,named:ih.command.id}})],ah);const sh=[...Yu,...Xf,...oh,...If,...[ih]],lh=()=>new gc;let dh=class{constructor(){this.registerHook=e=>x(this,void 0,void 0,function*(){const t=e.x6Events.registerHook({name:"bind group node move event",handler:e=>x(this,void 0,void 0,function*(){const t={eventName:"node:moving",callback:({node:e})=>x(this,void 0,void 0,function*(){if(e.prop("isGroup"))return void e.prop("originPosition",e.getPosition());const t=e.model.graph,{group:n}=e.getData(),r=t.getNodes().find(e=>e.id===n);if(!r)return;const o=r.getProp("isCollapsed");let i=r.getProp("originSize"),a=!1;null==i&&(i=r.size(),r.prop("originSize",i));let s=r.prop("originPosition");null==s&&(s=r.getPosition(),r.prop("originPosition",s));let l=s.x,d=s.y,c=s.x+i.width,u=s.y+i.height;const f=r.getChildren();if(f&&f.forEach(e=>{const t=e.getBBox().inflate(12),n=t.getCorner();t.x<l&&(l=t.x,a=!0),t.y<d&&(d=t.y,a=!0),n.x>c&&(c=n.x,a=!0),n.y>u&&(u=n.y,a=!0)}),a){r.prop({position:{x:l,y:d},size:{width:c-l,height:u-d}});const e=Object.assign(Object.assign({},r.getData()),{x:l,y:d,width:c-l,height:u-d});!0!==o&&(e.groupChildrenSize={width:c-l,height:u-d}),r.setData(e)}})};e.push(t)})});return Er.create(()=>{t.dispose()})}),this.registerHookHub=e=>x(this,void 0,void 0,function*(){const t=new Or;return sh.forEach(({hookKey:n,createHook:r=lh})=>{const o=e.registerHookHub(n,r());t.push(o)}),this.commandConfig.getConfig().then(({getContributions:n})=>{n().forEach(({hookKey:n,createHook:r=lh})=>{const o=e.registerHookHub(n,r());t.push(o)})}),t})}registerGraphCommands(e){sh.forEach(({command:t})=>{e.registerCommand(t,{createCommand:this.commandFactory})}),this.commandConfig.getConfig().then(({getContributions:t})=>{t().forEach(t=>{e.registerCommand(t.command,{createCommand:this.commandFactory})})})}};y([nr(Qd),b("design:type",Function)],dh.prototype,"commandFactory",void 0),y([nr(wu),b("design:type",wu)],dh.prototype,"commandConfig",void 0),dh=y([tr({contrib:[ec,mc]})],dh);const ch=Symbol("IToolbarService"),uh=Rn.defineToken("IToolbarContribution");var fh=No,hh=/\s/;var ph=function(e){for(var t=e.length;t--&&hh.test(e.charAt(t)););return t},gh=/^\s+/;var vh=function(e){return e?e.slice(0,ph(e)+1).replace(gh,""):e},mh=Hf,yh=$o,bh=/^[-+]0x[0-9a-f]+$/i,xh=/^0b[01]+$/i,wh=/^0o[0-7]+$/i,_h=parseInt;var Eh=Hf,Sh=function(){return fh.Date.now()},Ch=function(e){if("number"==typeof e)return e;if(yh(e))return NaN;if(mh(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=mh(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=vh(e);var n=xh.test(e);return n||wh.test(e)?_h(e.slice(2),n?2:8):bh.test(e)?NaN:+e},Oh=Math.max,kh=Math.min;var Mh=function(e,t,n){var r,o,i,a,s,l,d=0,c=!1,u=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,i=o;return r=o=void 0,d=t,a=e.apply(i,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-d>=i}function g(){var e=Sh();if(p(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return u?kh(n,i-(e-d)):n}(e))}function v(e){return s=void 0,f&&r?h(e):(r=o=void 0,a)}function m(){var e=Sh(),n=p(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return d=e,s=setTimeout(g,t),c?h(e):a}(l);if(u)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=Ch(t)||0,Eh(n)&&(c=!!n.leading,i=(u="maxWait"in n)?Oh(Ch(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f),m.cancel=function(){void 0!==s&&clearTimeout(s),d=0,r=l=o=s=void 0},m.flush=function(){return void 0===s?a:v(Sh())},m};var Nh=function(){this.__data__=[],this.size=0};var Ah=function(e,t){return e===t||e!=e&&t!=t},Th=Ah;var Ph=function(e,t){for(var n=e.length;n--;)if(Th(e[n][0],t))return n;return-1},Dh=Ph,jh=Array.prototype.splice;var Ih=Ph;var Rh=Ph;var Lh=Ph;var Fh=Nh,Gh=function(e){var t=this.__data__,n=Dh(t,e);return!(n<0)&&(n==t.length-1?t.pop():jh.call(t,n,1),--this.size,!0)},Uh=function(e){var t=this.__data__,n=Ih(t,e);return n<0?void 0:t[n][1]},Hh=function(e){return Rh(this.__data__,e)>-1},Bh=function(e,t){var n=this.__data__,r=Lh(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function zh(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zh.prototype.clear=Fh,zh.prototype.delete=Gh,zh.prototype.get=Uh,zh.prototype.has=Hh,zh.prototype.set=Bh;var Vh=zh,Yh=Vh;var Wh=function(){this.__data__=new Yh,this.size=0};var $h=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Kh=function(e){return this.__data__.get(e)};var Xh=function(e){return this.__data__.has(e)},qh=zo,Zh=Hf;var Jh,Qh=function(e){if(!Zh(e))return!1;var t=qh(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ep=No["__core-js_shared__"],tp=(Jh=/[^.]+$/.exec(ep&&ep.keys&&ep.keys.IE_PROTO||""))?"Symbol(src)_1."+Jh:"";var np=function(e){return!!tp&&tp in e},rp=Function.prototype.toString;var op=function(e){if(null!=e){try{return rp.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ip=Qh,ap=np,sp=Hf,lp=op,dp=/^\[object .+?Constructor\]$/,cp=Function.prototype,up=Object.prototype,fp=cp.toString,hp=up.hasOwnProperty,pp=RegExp("^"+fp.call(hp).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var gp=function(e){return!(!sp(e)||ap(e))&&(ip(e)?pp:dp).test(lp(e))},vp=function(e,t){return null==e?void 0:e[t]};var mp=function(e,t){var n=vp(e,t);return gp(n)?n:void 0},yp=mp(No,"Map"),bp=mp(Object,"create"),xp=bp;var wp=function(){this.__data__=xp?xp(null):{},this.size=0};var _p=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ep=bp,Sp=Object.prototype.hasOwnProperty;var Cp=function(e){var t=this.__data__;if(Ep){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Sp.call(t,e)?t[e]:void 0},Op=bp,kp=Object.prototype.hasOwnProperty;var Mp=bp;var Np=wp,Ap=_p,Tp=Cp,Pp=function(e){var t=this.__data__;return Op?void 0!==t[e]:kp.call(t,e)},Dp=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Mp&&void 0===t?"__lodash_hash_undefined__":t,this};function jp(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jp.prototype.clear=Np,jp.prototype.delete=Ap,jp.prototype.get=Tp,jp.prototype.has=Pp,jp.prototype.set=Dp;var Ip=jp,Rp=Vh,Lp=yp;var Fp=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Gp=function(e,t){var n=e.__data__;return Fp(t)?n["string"==typeof t?"string":"hash"]:n.map},Up=Gp;var Hp=Gp;var Bp=Gp;var zp=Gp;var Vp=function(){this.size=0,this.__data__={hash:new Ip,map:new(Lp||Rp),string:new Ip}},Yp=function(e){var t=Up(this,e).delete(e);return this.size-=t?1:0,t},Wp=function(e){return Hp(this,e).get(e)},$p=function(e){return Bp(this,e).has(e)},Kp=function(e,t){var n=zp(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Xp(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xp.prototype.clear=Vp,Xp.prototype.delete=Yp,Xp.prototype.get=Wp,Xp.prototype.has=$p,Xp.prototype.set=Kp;var qp=Xp,Zp=Vh,Jp=yp,Qp=qp;var eg=Vh,tg=Wh,ng=$h,rg=Kh,og=Xh,ig=function(e,t){var n=this.__data__;if(n instanceof Zp){var r=n.__data__;if(!Jp||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Qp(r)}return n.set(e,t),this.size=n.size,this};function ag(e){var t=this.__data__=new eg(e);this.size=t.size}ag.prototype.clear=tg,ag.prototype.delete=ng,ag.prototype.get=rg,ag.prototype.has=og,ag.prototype.set=ig;var sg=ag;var lg=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},dg=mp,cg=function(){try{var e=dg(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ug=cg;var fg=function(e,t,n){"__proto__"==t&&ug?ug(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},hg=fg,pg=Ah,gg=Object.prototype.hasOwnProperty;var vg=function(e,t,n){var r=e[t];gg.call(e,t)&&pg(r,n)&&(void 0!==n||t in e)||hg(e,t,n)},mg=vg,yg=fg;var bg=function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),o?yg(n,s,l):mg(n,s,l)}return n};var xg=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},wg=zo,_g=Vo;var Eg=function(e){return _g(e)&&"[object Arguments]"==wg(e)},Sg=Vo,Cg=Object.prototype,Og=Cg.hasOwnProperty,kg=Cg.propertyIsEnumerable,Mg=Eg(function(){return arguments}())?Eg:function(e){return Sg(e)&&Og.call(e,"callee")&&!kg.call(e,"callee")},Ng=Mg,Ag={exports:{}};var Tg=function(){return!1};!function(e,t){var n=No,r=Tg,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;e.exports=s}(Ag,Ag.exports);var Pg=/^(?:0|[1-9]\d*)$/;var Dg=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Pg.test(e))&&e>-1&&e%1==0&&e<t};var jg=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ig=zo,Rg=jg,Lg=Vo,Fg={};Fg["[object Float32Array]"]=Fg["[object Float64Array]"]=Fg["[object Int8Array]"]=Fg["[object Int16Array]"]=Fg["[object Int32Array]"]=Fg["[object Uint8Array]"]=Fg["[object Uint8ClampedArray]"]=Fg["[object Uint16Array]"]=Fg["[object Uint32Array]"]=!0,Fg["[object Arguments]"]=Fg["[object Array]"]=Fg["[object ArrayBuffer]"]=Fg["[object Boolean]"]=Fg["[object DataView]"]=Fg["[object Date]"]=Fg["[object Error]"]=Fg["[object Function]"]=Fg["[object Map]"]=Fg["[object Number]"]=Fg["[object Object]"]=Fg["[object RegExp]"]=Fg["[object Set]"]=Fg["[object String]"]=Fg["[object WeakMap]"]=!1;var Gg=function(e){return Lg(e)&&Rg(e.length)&&!!Fg[Ig(e)]};var Ug=function(e){return function(t){return e(t)}},Hg={exports:{}};!function(e,t){var n=Oo,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}(Hg,Hg.exports);var Bg=Gg,zg=Ug,Vg=Hg.exports,Yg=Vg&&Vg.isTypedArray,Wg=Yg?zg(Yg):Bg,$g=xg,Kg=Ng,Xg=Po,qg=Ag.exports,Zg=Dg,Jg=Wg,Qg=Object.prototype.hasOwnProperty;var ev=function(e,t){var n=Xg(e),r=!n&&Kg(e),o=!n&&!r&&qg(e),i=!n&&!r&&!o&&Jg(e),a=n||r||o||i,s=a?$g(e.length,String):[],l=s.length;for(var d in e)!t&&!Qg.call(e,d)||a&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Zg(d,l))||s.push(d);return s},tv=Object.prototype;var nv=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||tv)};var rv=function(e,t){return function(n){return e(t(n))}},ov=rv(Object.keys,Object),iv=nv,av=ov,sv=Object.prototype.hasOwnProperty;var lv=Qh,dv=jg;var cv=function(e){return null!=e&&dv(e.length)&&!lv(e)},uv=ev,fv=function(e){if(!iv(e))return av(e);var t=[];for(var n in Object(e))sv.call(e,n)&&"constructor"!=n&&t.push(n);return t},hv=cv;var pv=function(e){return hv(e)?uv(e):fv(e)},gv=bg,vv=pv;var mv=function(e,t){return e&&gv(t,vv(t),e)};var yv=Hf,bv=nv,xv=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},wv=Object.prototype.hasOwnProperty;var _v=ev,Ev=function(e){if(!yv(e))return xv(e);var t=bv(e),n=[];for(var r in e)("constructor"!=r||!t&&wv.call(e,r))&&n.push(r);return n},Sv=cv;var Cv=function(e){return Sv(e)?_v(e,!0):Ev(e)},Ov=bg,kv=Cv;var Mv=function(e,t){return e&&Ov(t,kv(t),e)},Nv={exports:{}};!function(e,t){var n=No,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(Nv,Nv.exports);var Av=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Tv=function(){return[]},Pv=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i},Dv=Tv,jv=Object.prototype.propertyIsEnumerable,Iv=Object.getOwnPropertySymbols,Rv=Iv?function(e){return null==e?[]:(e=Object(e),Pv(Iv(e),function(t){return jv.call(e,t)}))}:Dv,Lv=bg,Fv=Rv;var Gv=function(e,t){return Lv(e,Fv(e),t)};var Uv=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},Hv=rv(Object.getPrototypeOf,Object),Bv=Uv,zv=Hv,Vv=Rv,Yv=Tv,Wv=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Bv(t,Vv(e)),e=zv(e);return t}:Yv,$v=bg,Kv=Wv;var Xv=function(e,t){return $v(e,Kv(e),t)},qv=Uv,Zv=Po;var Jv=function(e,t,n){var r=t(e);return Zv(e)?r:qv(r,n(e))},Qv=Jv,em=Rv,tm=pv;var nm=function(e){return Qv(e,tm,em)},rm=Jv,om=Wv,im=Cv;var am=function(e){return rm(e,im,om)},sm=mp(No,"DataView"),lm=mp(No,"Promise"),dm=mp(No,"Set"),cm=sm,um=yp,fm=lm,hm=dm,pm=mp(No,"WeakMap"),gm=zo,vm=op,mm="[object Map]",ym="[object Promise]",bm="[object Set]",xm="[object WeakMap]",wm="[object DataView]",_m=vm(cm),Em=vm(um),Sm=vm(fm),Cm=vm(hm),Om=vm(pm),km=gm;(cm&&km(new cm(new ArrayBuffer(1)))!=wm||um&&km(new um)!=mm||fm&&km(fm.resolve())!=ym||hm&&km(new hm)!=bm||pm&&km(new pm)!=xm)&&(km=function(e){var t=gm(e),n="[object Object]"==t?e.constructor:void 0,r=n?vm(n):"";if(r)switch(r){case _m:return wm;case Em:return mm;case Sm:return ym;case Cm:return bm;case Om:return xm}return t});var Mm=km,Nm=Object.prototype.hasOwnProperty;var Am=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Nm.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Tm=No.Uint8Array,Pm=Tm;var Dm=function(e){var t=new e.constructor(e.byteLength);return new Pm(t).set(new Pm(e)),t},jm=Dm;var Im=function(e,t){var n=t?jm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Rm=/\w*$/;var Lm=function(e){var t=new e.constructor(e.source,Rm.exec(e));return t.lastIndex=e.lastIndex,t},Fm=Ao?Ao.prototype:void 0,Gm=Fm?Fm.valueOf:void 0;var Um=Dm;var Hm=function(e,t){var n=t?Um(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},Bm=Dm,zm=Im,Vm=Lm,Ym=function(e){return Gm?Object(Gm.call(e)):{}},Wm=Hm;var $m=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Bm(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return zm(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Wm(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Vm(e);case"[object Symbol]":return Ym(e)}},Km=Hf,Xm=Object.create,qm=function(){function e(){}return function(t){if(!Km(t))return{};if(Xm)return Xm(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Zm=Hv,Jm=nv;var Qm=function(e){return"function"!=typeof e.constructor||Jm(e)?{}:qm(Zm(e))},ey=Mm,ty=Vo;var ny=function(e){return ty(e)&&"[object Map]"==ey(e)},ry=Ug,oy=Hg.exports,iy=oy&&oy.isMap,ay=iy?ry(iy):ny,sy=Mm,ly=Vo;var dy=function(e){return ly(e)&&"[object Set]"==sy(e)},cy=Ug,uy=Hg.exports,fy=uy&&uy.isSet,hy=fy?cy(fy):dy,py=sg,gy=lg,vy=vg,my=mv,yy=Mv,by=Nv.exports,xy=Av,wy=Gv,_y=Xv,Ey=nm,Sy=am,Cy=Mm,Oy=Am,ky=$m,My=Qm,Ny=Po,Ay=Ag.exports,Ty=ay,Py=Hf,Dy=hy,jy=pv,Iy=Cv,Ry="[object Arguments]",Ly="[object Function]",Fy="[object Object]",Gy={};Gy[Ry]=Gy["[object Array]"]=Gy["[object ArrayBuffer]"]=Gy["[object DataView]"]=Gy["[object Boolean]"]=Gy["[object Date]"]=Gy["[object Float32Array]"]=Gy["[object Float64Array]"]=Gy["[object Int8Array]"]=Gy["[object Int16Array]"]=Gy["[object Int32Array]"]=Gy["[object Map]"]=Gy["[object Number]"]=Gy[Fy]=Gy["[object RegExp]"]=Gy["[object Set]"]=Gy["[object String]"]=Gy["[object Symbol]"]=Gy["[object Uint8Array]"]=Gy["[object Uint8ClampedArray]"]=Gy["[object Uint16Array]"]=Gy["[object Uint32Array]"]=!0,Gy["[object Error]"]=Gy[Ly]=Gy["[object WeakMap]"]=!1;var Uy=function e(t,n,r,o,i,a){var s,l=1&n,d=2&n,c=4&n;if(r&&(s=i?r(t,o,i,a):r(t)),void 0!==s)return s;if(!Py(t))return t;var u=Ny(t);if(u){if(s=Oy(t),!l)return xy(t,s)}else{var f=Cy(t),h=f==Ly||"[object GeneratorFunction]"==f;if(Ay(t))return by(t,l);if(f==Fy||f==Ry||h&&!i){if(s=d||h?{}:My(t),!l)return d?_y(t,yy(s,t)):wy(t,my(s,t))}else{if(!Gy[f])return i?t:{};s=ky(t,f,l)}}a||(a=new py);var p=a.get(t);if(p)return p;a.set(t,s),Dy(t)?t.forEach(function(o){s.add(e(o,n,r,o,t,a))}):Ty(t)&&t.forEach(function(o,i){s.set(i,e(o,n,r,i,t,a))});var g=u?void 0:(c?d?Sy:Ey:d?Iy:jy)(t);return gy(g||t,function(o,i){g&&(o=t[i=o]),vy(s,i,e(o,n,r,i,t,a))}),s},Hy=Uy;var By=function(e){return Hy(e,5)};let zy=class{constructor(){this.toDispose=new Or,this.toolbarItems=new Map,this.onDidChangeEvent=new Kd(null),this.onDidChange=this.onDidChangeEvent.watch,this.fireOnDidChange=Mh(()=>this.onDidChangeEvent.setValue(void 0),16),this.registerDisposableToolbar=e=>{const t=new Or,n={registerToolbarItem:e=>{const n=this.registerItem(e);return t.push(n),n}};return e(n),this.toDispose.push(t),t},this.getToolbarModel=e=>{const{layout:t,mainGroups:n=[],extraGroups:r=[]}=e;return new Kd({layout:t,mainGroups:this.createToolbarGroupModel(n),extraGroups:this.createToolbarGroupModel(r)})},this.createToolbarGroupModel=e=>{const t=e.map(e=>{const{items:t=[]}=e;return Object.assign(Object.assign({},e),{items:t.map(e=>this.createToolbarModel({id:e.id})).filter(e=>!!e)})});return t}}onStart(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerToolbarItems(this)}onStop(){this.toDispose.dispose()}registerItem(e){this.toolbarItems.has(e.id)&&console.warn(`ToolbarRegistry ${e.id} is duplicated, in`,e),this.toolbarItems.set(e.id,e),this.fireOnDidChange();return new Or(Er.create(()=>this.fireOnDidChange()),Er.create(()=>this.toolbarItems.delete(e.id)))}createToolbarModel(e){const t=By(this.toolbarItems.get(e.id)),n=!Du(t.isEnabled)||t.isEnabled,r=!Du(t.isVisible)||t.isVisible;return Object.assign(Object.assign({},t),{isEnabled:n,isVisible:r,iconName:t.iconName,text:t.text})}};y([nr(qd),b("design:type",Object)],zy.prototype,"commandService",void 0),y([nr(ic),b("design:type",Object)],zy.prototype,"modelService",void 0),y([gr(uh),b("design:type",Object)],zy.prototype,"contributionProvider",void 0),zy=y([tr({contrib:[Xd,ch]})],zy);const Vy=Symbol("IMenuService"),Yy=Rn.defineToken("IMenuContribution");var Wy;!function(e){e.Separator="separator",e.Submenu="submenu",e.Root="root",e.Leaf="leaf"}(Wy||(Wy={}));let $y=class{constructor(){this.toDispose=new Or,this.menuMap=new Map,this.getMenu=e=>this.menuMap.get(e),this.registerDisposableMenu=e=>{const t=new Or,n={registerMenu:e=>{const n=this.registerMenu(e);return t.push(n),n}};return e(n),this.toDispose.push(t),t}}onStart(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerMenu(this)}onStop(){this.toDispose.dispose()}registerMenu(e){return this.menuMap.set(e.id,e),Er.create(()=>this.menuMap.delete(e.id))}};y([gr(Yy),b("design:type",Object)],$y.prototype,"contributionProvider",void 0),$y=y([tr({contrib:[Xd,Vy]})],$y);const Ky=()=>{const e=u.default.useRef(!0);return u.default.useEffect(()=>()=>{e.current=!1},[]),e},Xy=e=>{const t=Ky(),[n,r]=u.default.useState(e.getValue());u.default.useEffect(()=>{const n=e.watch(e=>{(e=>e&&e.current)(t)&&r(e)});return()=>{n.dispose()}},[r]);const o=n,i=Yd.isValidValue(o);return[o,u.default.useCallback(t=>e.setValue(t),[e]),i]},qy=e=>{const t=u.default.useMemo(()=>new Kd(e),[]),[n,r,o]=Xy(t);return u.default.useEffect(()=>()=>{t.dispose()},[t]),[n,r,t,o]},Zy=Symbol("IKeyBindingService"),Jy=Rn.defineToken("IKeyBindingContribution"),Qy=Symbol("IKeyBindingOptionProvider");let eb=class{constructor(){this.toDispose=new Or,this.keyBindingMap=new Map,this.enabledKeyBindingMap=new Map,this.registerExternalKeybindings=()=>x(this,void 0,void 0,function*(){const{registerKeybindingFunc:e}=yield this.optionProvider.getOption();return e(this)}),this.registerKeybinding=(e=[])=>{const t=new Or;return e.forEach(e=>{this.keyBindingMap.set(e.id,e),this.enableKeyBindings(e.id).then(n=>{t.push(Er.create(()=>{n.dispose(),this.keyBindingMap.delete(e.id)}))})}),this.toDispose.push(t),t},this.enableKeyBindings=e=>x(this,void 0,void 0,function*(){this.disableKeyBindings([e]);const t=this.keyBindingMap.get(e),n=yield this.getX6Graph(),r=this.runCommand(t);n.bindKey(t.keybinding,r);const o=Er.create(()=>{n.unbindKey(t.keybinding),this.enabledKeyBindingMap.delete(t.id)});return this.enabledKeyBindingMap.set(t.id,o),o}),this.disableKeyBindings=e=>{e.forEach(e=>{const t=this.enabledKeyBindingMap.get(e);t&&t.dispose()})},this.runCommand=e=>t=>x(this,void 0,void 0,function*(){yield e.callback(e,this.modelService,this.commandService,t)}),this.getX6Graph=()=>x(this,void 0,void 0,function*(){return yield this.graphProvider.getGraphInstance()})}onStart(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerKeybinding(this);this.registerExternalKeybindings()}onStop(){this.toDispose.dispose()}};var tb;y([nr(Qy),b("design:type",Object)],eb.prototype,"optionProvider",void 0),y([nr(qd),b("design:type",Object)],eb.prototype,"commandService",void 0),y([nr(ic),b("design:type",Object)],eb.prototype,"modelService",void 0),y([gr(Jy),b("design:type",Object)],eb.prototype,"contributionProvider",void 0),y([nr(Dc),b("design:type",Object)],eb.prototype,"graphProvider",void 0),eb=y([tr({contrib:[Xd,Zy]})],eb),function(e){e.CONFIG_TYPE="CONTEXT_CONFIG"}(tb||(tb={}));const nb=new class{constructor(){this.map=new Map([["default",Rs],["QuestionCircleOutlined",Rs]]),this.map.set("default",Rs),this.map.set("QuestionCircleOutlined",Rs)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t)}has(e){return this.map.has(e)}};let rb=class{constructor(){this.toDispose=new Or,this.registerHookHub=()=>x(this,void 0,void 0,function*(){return Er.create(()=>{})}),this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,n=[e.graphOptions.registerHook({name:"add snapline options",handler:e=>x(this,void 0,void 0,function*(){e.snapline={enabled:!0,className:"xflow-snapline",clean:5e3}})})];return t.pushAll(n),Er.create(()=>{})})}};rb=y([tr({contrib:mc})],rb);const ob=()=>hr(e=>{e(rb)}),ib="#faad14";var ab,sb;!function(e){e.MOUSE_ENTER="node-port:mouseenter",e.MOUSE_LEAVE="node-port:mouseleave"}(ab||(ab={})),function(e){e.id="ACTIVE_NODE_PORT",e.useModel=t=>x(this,void 0,void 0,function*(){const n=yield t.awaitModel(e.id);return{data:yield n.getValidValue(),model:n}})}(sb||(sb={}));let lb=class{constructor(){this.toDispose=new Or,this.getGraphInstance=()=>x(this,void 0,void 0,function*(){return{graph:yield this.graphProvider.getGraphInstance(),config:yield this.graphProvider.getGraphOptions()}}),this.getPortRenderConfig=()=>{const e={onPortRendered(e){const t=this,{port:n,node:r}=e,{contentSelectors:o}=e,i=o&&o["xflow-port-group"];i instanceof Element&&(i.setAttribute("class",xr("xflow-port-group",{connected:n.connected&&"out"!==n.group,groupPort:(null==r?void 0:r.isGroup)&&(null==r?void 0:r.isGroup())})),i.addEventListener("mouseenter",e=>{const o={e:e,portId:n.id,nodeId:r.id,portData:n,nodeData:r.getData(),tooltip:n.tooltip,placement:n.group};t.trigger(ab.MOUSE_ENTER,o)}),i.addEventListener("mouseleave",e=>{const o={e:e,portId:n.id,nodeId:r.id,portData:n,nodeData:r.getData(),tooltip:n.tooltip,placement:n.group};t.trigger(ab.MOUSE_LEAVE,o)}))}};return e},this.registerHookHub=()=>x(this,void 0,void 0,function*(){return Er.create(()=>{})}),this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,n=[e.graphOptions.registerHook({name:"add onPortRendered options ",handler:e=>x(this,void 0,void 0,function*(){Object.assign(e,this.getPortRenderConfig())})})];return t.pushAll(n),Er.create(()=>{})})}registerModel(e){e.registerModel({id:sb.id,watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t,config:n}=yield this.getGraphInstance(),r=e=>{const{x:t,y:r,width:o,height:i}=e.target.getBoundingClientRect(),a=n.rootContainer.getBoundingClientRect();return{x:t-((null==a?void 0:a.x)||0)+o/2,y:r-((null==a?void 0:a.y)||0)+i/2}},o=t=>{e.setValue(Object.assign(Object.assign({},t),{position:r(t.e)}))},i=()=>{e.setValue(null)};return t.on(ab.MOUSE_ENTER,o),t.on(ab.MOUSE_LEAVE,i),t.on("cell:mouseleave",i),Er.create(()=>{t.off(ab.MOUSE_ENTER,o),t.off(ab.MOUSE_LEAVE,i)})})})}};y([nr(Dc),b("design:type",Object)],lb.prototype,"graphProvider",void 0),lb=y([tr({contrib:[mc,ac]})],lb);const db=()=>hr(e=>{e(lb)}),cb=e=>{const t=qs(),[n,,r]=qy(null);u.default.useEffect(()=>{if(!t)return;const e=x(void 0,void 0,void 0,function*(){const{model:e}=yield sb.useModel(t.modelService);return e.watch(e=>{r.setValue(e)})});return()=>{e.then(e=>{e.dispose()})}},[r,t]);const o=!!(n&&n.position&&n.position.x);if(!o)return null;const i=e.getTooltip?e.getTooltip(n):n.tooltip;return u.default.createElement(s.Tooltip,{visible:o,title:i,placement:n.placement||"top"},u.default.createElement("span",{className:"canvas-node-port-tooltip",style:{position:"absolute",left:n.position.x,top:n.position.y}}))};var ub,fb;!function(e){e.CONFIG_TYPE="ContextMenuConfig"}(ub||(ub={}));class hb{constructor(e){this.CONFIG_TYPE=ub.CONFIG_TYPE,this.setMenuModelService=e=>{this.menuModelService=e},this.setCustomMenuRender=e=>{this.menuCustomRender=e},this.getConfig=()=>x(this,void 0,void 0,function*(){return{CONFIG_TYPE:this.CONFIG_TYPE,menuCustomRender:this.menuCustomRender,menuModelService:this.menuModelService}}),this.moduleId=e||Dr()}dispose(){}}!function(e){e.id="CONTEXT_MENU_MODEL",e.useValue=Uc(e.id),e.getModel=Gc(e.id)}(fb||(fb={}));const{inject:pb,singleton:gb}=mr;let vb=class{constructor(){this.toDispose=new Or,this.getMenuModelValue=e=>x(this,void 0,void 0,function*(){const t=yield this.menuConfig.getConfig(),{anchor:n,type:r,cell:o}=e,i=new Or;this.toDispose.push(i);const a=o?o.getData():null,s=new Kd({id:"menuroot",type:Wy.Root,submenu:[]});i.push(Er.create(()=>{s.dispose()}));const l={toDispose:i,anchor:n,target:{data:a,type:r},customRender:null,menuModel:s};return t.menuCustomRender&&(l.customRender=yield t.menuCustomRender(e,this.modelService)),t.menuModelService&&(yield t.menuModelService(e,l.menuModel,this.modelService,i)),l})}registerModel(e){const t=[e.registerModel({id:fb.id,getInitialValue:()=>null,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield eu.getModel(t)).watch(t=>x(this,void 0,void 0,function*(){const n=yield this.getMenuModelValue(t);e.setValue(n)}))})})];this.toDispose.pushAll(t)}};y([pb(hb),b("design:type",hb)],vb.prototype,"menuConfig",void 0),y([pb(ic),b("design:type",Object)],vb.prototype,"modelService",void 0),vb=y([gb({contrib:[ac]})],vb);const mb=e=>hr(t=>{t(vb),t(hb,{useValue:e})}),yb=e=>{const{idx:t,menuOptions:n,target:r,modelService:o,commandService:i,onHide:a}=e,{id:s,label:d,isEnabled:c=!0,isVisible:f=!0,iconName:h,submenu:p=[],active:g,hotkey:v,render:m,onClick:y}=n;if(!f)return null;if("separator"===n.type)return u.default.createElement(l.Menu.Divider,{key:String(n.id)+t});if("root"===n.type)return u.default.createElement(l.Menu,{hasIcon:!0},p.map((e,t)=>yb({idx:t,target:r,commandService:i,modelService:o,menuOptions:e,onHide:a})));if(n.submenu&&Array.isArray(n.submenu)){const e=nb.get(h),t=!c;return u.default.createElement(l.Menu.SubMenu,{key:String(s),text:d,disabled:t||0===p.length,icon:e?u.default.createElement(e,null):null,active:g,hotkey:v},p.map((e,t)=>yb({idx:t,target:r,commandService:i,modelService:o,menuOptions:e,onHide:a})))}const b=nb.get(h);return m?u.default.createElement(m,{menuItem:n,target:r,commandService:i,modelService:o,onHide:a},[u.default.createElement(l.Menu.Item,{key:String(s),text:d,disabled:!c,icon:b?u.default.createElement(b,null):null,active:g,hotkey:v})]):u.default.createElement(l.Menu.Item,{key:String(s),text:d,disabled:!c,icon:b?u.default.createElement(b,null):null,active:g,hotkey:v,onClick:()=>x(void 0,void 0,void 0,function*(){yield y({menuItem:n,target:r,commandService:i,modelService:o}),a&&a()})})},bb=e=>{const{menuModel:t,target:n,onHide:r}=e,{modelService:o,commandService:i}=qs(),[a]=Xy(t);return yb({idx:-1,target:n,commandService:i,modelService:o,menuOptions:a,onHide:r})},xb=({toDispose:e})=>(u.default.useEffect(()=>()=>{e.dispose()},[e]),null),wb=()=>{const e=u.default.useRef(),t=qs(),[n,,r]=(e=>{const{getModel:t,initialState:n}=e,r=Ky(),o=u.default.useRef(),[i,a]=u.default.useState(n);return u.default.useEffect(()=>{let e;return t().then(t=>x(void 0,void 0,void 0,function*(){o.current=t;const n=yield t.getValidValue();r.current&&(a(n),e=t.watch(e=>{r.current&&a(e)}))})),()=>{e&&e.dispose&&e.dispose()}},[]),[i,a,o.current]})({getModel:()=>x(void 0,void 0,void 0,function*(){return yield fb.getModel(t.modelService)}),initialState:{anchor:null,menuModel:null,target:null,customRender:null,toDispose:null}}),{target:o,anchor:i,menuModel:a,customRender:s,toDispose:d}=n;if(!o||!i||!a)return null;const c=()=>{r.setValue({anchor:null,menuModel:null,target:null,customRender:null,toDispose:null})},f=s?u.default.createElement(s,{target:o,modelService:t.modelService,onHide:c}):u.default.createElement(bb,{target:o,menuModel:a,onHide:c});return u.default.createElement("div",{className:"xflow-menu-mask",ref:e,onClick:c,onContextMenu:e=>{e.preventDefault(),e.stopPropagation()}},u.default.createElement(xb,{toDispose:d}),u.default.createElement(l.Dropdown,{visible:!0,getPopupContainer:()=>e.current,overlay:f},u.default.createElement("div",{className:"xflow-context-menu-anchor",style:{top:i.y,left:i.x}})))},_b="CanvasToolbar";class Eb{constructor(){this.CONFIG_TYPE=_b,this.setToolbarName=e=>{this.moduleId=_b+"__"+e},this.setToolbarModelService=e=>{this.toolbarModelService=e},this.setCustomToolbarRender=e=>{this.customRenderService=e},this.getConfig=()=>({CONFIG_TYPE:this.CONFIG_TYPE,toolbarCustomRender:this.customRenderService,toolbarModelService:this.toolbarModelService}),this.moduleId=_b+"__"+Dr()}dispose(){}}const Sb=e=>{const t=qs(),{item:n,layout:r}=e,o=xr({"xflow-toolbar-item":!0}),i="vertical"===r?"":n.text;let a;if(n.icon)a=n.icon;else if(n.iconName){const e=nb.get(n.iconName);a=u.default.createElement(e,null)}const s=n.render,{isEnabled:d=!0}=n,{commandService:c,modelService:f}=t,h=()=>{n.onClick&&n.onClick({toolbarItem:n,commandService:c,modelService:f})};return s?u.default.createElement(s,Object.assign({},n,{onClick:h}),u.default.createElement(l.Toolbar.Item,Object.assign({},n,{icon:a,text:i,className:o,disabled:!d,tooltip:n.tooltip||n.text,tooltipProps:Object.assign({placement:"vertical"===r?"left":"bottom"},n.tooltipProps),onClick:()=>{}}))):u.default.createElement(l.Toolbar.Item,Object.assign({},n,{icon:a,text:i,className:o,hidden:!n,disabled:!d,tooltip:n.tooltip||n.text,onClick:h,tooltipProps:Object.assign(Object.assign({},n.tooltipProps),{placement:"vertical"===r?"left":"bottom"})}))},Cb=e=>{const{group:t,layout:n}=e,r=u.default.useMemo(()=>t.name||Dr(),[t.name]),{items:o=[]}=t;if(0===o.length)return null;const i=xr({"xflow-toolbar-group":!0});return u.default.createElement(l.Toolbar.Group,{className:i,key:r},o.map(e=>u.default.createElement(Sb,{item:e,layout:n,key:e.id})))},Ob=e=>{const{idx:t,groups:n,layout:r,toolbarOptions:o}=e,{hoverEffect:i=!0}=o;return u.default.createElement(l.Toolbar,{hoverEffect:i},n.map((e,n)=>{const o=t+n;return u.default.createElement(Cb,{key:o,group:e,layout:r})}))},kb=u.default.memo(e=>{const{isModelReady:t,state:n}=(e=>{const{config:t}=e,n=t.moduleId,r=qs(),[o,i,a,s]=qy({name:n,layout:e.layout,mainGroups:[],extraGroups:[],customRender:null});return u.default.useEffect(()=>{const e=new Or;if(!r.modelService.findDeferredModel(n)){const{toolbarCustomRender:o,toolbarModelService:i}=t.getConfig(),s=r.modelService.registerModel({id:n,modelFactory:()=>a,watchChange:t=>x(void 0,void 0,void 0,function*(){if(i&&(yield i(t,r.modelService,e)),o){const e=e=>{t.setValue(t=>t.customRender=e)};yield o(r.modelService,e)}return e})});e.push(s)}return()=>{e.dispose()}},[]),{isModelReady:s,state:o,setState:i,toolbarModel:a}})(e),r=vu(e.position),{mainGroups:o=[],extraGroups:i=[],layout:a,customRender:l}=n,d=xr(e.className,a,"xflow-toolbar"),c=xr({[a]:!0,"xflow-toolbar-root":!0});return t?l?u.default.createElement("div",{className:d,style:Object.assign(Object.assign({},r),e.style)},u.default.createElement(l,{config:n})):u.default.createElement("div",{className:d,style:Object.assign(Object.assign({},r),e.style)},u.default.createElement("div",{className:c},o.length>0&&u.default.createElement(Ob,{idx:"mainGroups",groups:o,layout:a,toolbarOptions:n}),i.length>0&&u.default.createElement(Ob,{idx:"extraGroups",groups:i,layout:a,toolbarOptions:n}))):u.default.createElement("div",{className:d,style:Object.assign(Object.assign({},r),e.style)},u.default.createElement(s.Spin,{spinning:!0,size:"small"}))}),Mb=e=>{const t=!!qs(),n=u.default.useMemo(()=>e.config?e.config:new Eb,[e.config]);return t?u.default.createElement(kb,Object.assign({},e,{config:n})):null},Nb=e=>t=>{const n=u.default.useMemo(()=>({getValue:()=>({})}),[]);n.getValue=()=>t;const r=u.default.useMemo(()=>{const t=new Eb;return e(t,n),t},[n]);return r};var Ab;e.CANVAS_SCALE_TOOLBAR_CONFIG=void 0,Ab=e.CANVAS_SCALE_TOOLBAR_CONFIG||(e.CANVAS_SCALE_TOOLBAR_CONFIG={}),nb.set("ZoomInOutlined",Ys),nb.set("ZoomOutOutlined",Ks),nb.set("OneToOneOutlined",As),nb.set("CompressOutlined",Ka),nb.set("FullscreenOutlined",Ss),nb.set("FullscreenExitOutlined",ws),Ab.ZOOM_IN=Qs.GRAPH_ZOOM.id+"-zoom-in",Ab.ZOOM_OUT=Qs.GRAPH_ZOOM.id+"-zoom-out",Ab.SCALE_TO_ONE=Qs.GRAPH_ZOOM.id+"-scale-to-one",Ab.SCALE_TO_FIT=Qs.GRAPH_ZOOM.id+"-scale-to-fit",Ab.FULLSCREEN=Qs.GRAPH_ZOOM.id+"-fullscreen",Ab.MAX_SCALE=1.5,Ab.MIN_SCALE=.05,Ab.zoomOptions={maxScale:Ab.MAX_SCALE,minScale:Ab.MIN_SCALE},Ab.getToolbarConfig=({zoomFactor:e,fullscreen:t})=>[{name:"main",items:[{id:Ab.ZOOM_IN,tooltip:"放大",iconName:"ZoomInOutlined",onClick:({commandService:e})=>{e.executeCommand(Qs.GRAPH_ZOOM.id,{factor:.1,zoomOptions:Ab.zoomOptions})}},{id:Ab.ZOOM_OUT,tooltip:"缩小",iconName:"ZoomOutOutlined",onClick:({commandService:e})=>{e.executeCommand(Qs.GRAPH_ZOOM.id,{factor:-.1,zoomOptions:Ab.zoomOptions})}},{id:Ab.SCALE_TO_ONE,iconName:"OneToOneOutlined",tooltip:"缩放到1:1",isEnabled:1!==e,onClick:({commandService:e})=>{e.executeCommand(Qs.GRAPH_ZOOM.id,{factor:"real",zoomOptions:Ab.zoomOptions})}},{id:Ab.SCALE_TO_FIT,tooltip:"缩放到适应屏幕",iconName:"CompressOutlined",onClick:({commandService:e})=>{e.executeCommand(Qs.GRAPH_ZOOM.id,{factor:"fit",zoomOptions:Ab.zoomOptions})}},{id:Ab.FULLSCREEN,tooltip:t?"退出全屏":"全屏",iconName:t?"FullscreenExitOutlined":"FullscreenOutlined",onClick:({commandService:e})=>{e.executeCommand(Qs.GRAPH_FULLSCREEN.id,{})}}]}];const Tb=Nb(t=>{t.setToolbarModelService((t,n)=>x(void 0,void 0,void 0,function*(){const r=yield nu.useValue(n);t.setValue(t=>{t.mainGroups=e.CANVAS_SCALE_TOOLBAR_CONFIG.getToolbarConfig({zoomFactor:r.zoomFactor,fullscreen:!1})});const o=yield Bc.getModel(n);o.setValue(!1),o.watch(n=>{t.setValue(t=>{t.mainGroups=e.CANVAS_SCALE_TOOLBAR_CONFIG.getToolbarConfig({zoomFactor:r.zoomFactor,fullscreen:n})})});(yield nu.getModel(n)).watch(({zoomFactor:r})=>x(void 0,void 0,void 0,function*(){const o=yield Bc.useValue(n);t.setValue(t=>{t.mainGroups=e.CANVAS_SCALE_TOOLBAR_CONFIG.getToolbarConfig({zoomFactor:r,fullscreen:o})})}))}))});const Pb=Symbol("IMinimapConfigProvider");let Db=class{constructor(){this.toDispose=new Or,this.registerHookHub=()=>x(this,void 0,void 0,function*(){return Er.create(()=>{})}),this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,n=[e.graphOptions.registerHook({name:"add minimap options",handler:e=>x(this,void 0,void 0,function*(){const t=yield this.minimapConfig.getConfig();e.minimap=Object.assign({},t)})})];return t.pushAll(n),Er.create(()=>{})})}};y([nr(Pb),b("design:type",Object)],Db.prototype,"minimapConfig",void 0),Db=y([tr({contrib:mc})],Db);const jb=e=>hr(t=>{t(Pb,{useDynamic:()=>e}),t(Db)});class Ib extends n.NodeView{renderMarkup(){return this.renderJSONMarkup({tagName:"rect",selector:"body"})}update(){super.update({body:{refWidth:"100%",refHeight:"100%",fill:Ib.nodeFillColor}})}}Ib.nodeFillColor="#31d0c6",Ib.setNodeFillColor=e=>{Ib.nodeFillColor=e};class Rb{constructor(){this.getValue=()=>({})}dispose(){this.getValue=()=>null}}const Lb=u.default.createContext({propsProxy:null,commandService:null,modelService:null}),Fb=()=>u.default.useContext(Lb),Gb=e=>{const{className:t,position:n,style:r,children:o}=e,i=qs(),a=vu(n),s=u.default.useMemo(()=>new Rb,[]);if(u.default.useEffect(()=>()=>{s.dispose()},[s]),!i||!i.modelService)return null;s.getValue=()=>e;const l=xr({[t]:!!t,"xflow-workspace-panel":!0}),{commandService:d,modelService:c}=i;return u.default.createElement(Lb.Provider,{value:{propsProxy:s,commandService:d,modelService:c}},u.default.createElement("div",{className:l,style:Object.assign(Object.assign({},a),r)},o))},Ub="xflow-node-horizontal-edge",Hb="xflow-node-vertical-edge",Bb="xflow-group-vertical-edge",zb="xflow-edge",Vb="XFLOW_NODE_SHAPE",Yb="processing";var Wb;let $b;e.GRAPH_STATUS_INFO=void 0,(Wb=e.GRAPH_STATUS_INFO||(e.GRAPH_STATUS_INFO={})).id="GRAPH_STATUS_INFO",function(e){e.SUCCEEDED="SUCCEEDED",e.RUNNING="RUNNING",e.FAILED="FAILED",e.PENDING="PENDING",e.CREATING="CREATING",e.MANUAL_TERMINATE="MANUAL_TERMINATE",e.CACHED="CACHED",e.QUEUEING="QUEUEING",e.PULLING_IMAGE="PULLING_IMAGE",e.UNKNOWN="UNKNOWN"}(Wb.StatusEnum||(Wb.StatusEnum={})),Wb.getModel=Gc(Wb.id),Wb.useValue=Uc(Wb.id),e.XFlowDagCommands=void 0,(e.XFlowDagCommands||(e.XFlowDagCommands={})).QUERY_GRAPH_STATUS={id:"xflow:query-graph-status",label:"查询画布节点状态"};const{AnchorGroup:Kb}=vr;$b=n.Node.registry.exist(Vb)?n.Node.registry.get(Vb):i.ReactShape.define({width:160,height:32,shape:Vb,view:Mr,ports:{groups:{top:{zIndex:2,position:{name:Kb.TOP}},bottom:{zIndex:2,position:{name:Kb.BOTTOM}},right:{zIndex:2,position:{name:Kb.RIGHT}},left:{zIndex:2,position:{name:Kb.LEFT}}}},attrs:{body:{magnet:!1,fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%",zIndex:1}},portMarkup:[{tagName:"g",selector:"xflow-port-group",className:"xflow-port-group",attrs:{width:8,height:8,x:-4,y:-4,zIndex:10,magnet:"true"},children:[{tagName:"circle",selector:"xflow-port",className:"xflow-port",attrs:{r:4,fill:"#fff",stroke:"#d9d9d9",zIndex:12}},{tagName:"polygon",selector:"xflow-port-arrow",className:"xflow-port-arrow",attrs:{points:"0,0 8,0 4,4 ",fill:"#d9d9d9",stroke:"#d9d9d9",zIndex:13,transform:"translate(-4,0)"}}]}]});const{DirectoryTree:Xb,TreeNode:qb}=s.Tree,Zb=({expanded:e})=>e?u.default.createElement(ys,null):u.default.createElement(gs,null),Jb=e=>new $b(e),Qb=e=>{const{nodeConfig:t,onMouseDown:n,graphConfig:r,modelService:o,commandService:i}=e;if(!r)return u.default.createElement("div",null);if(t.renderComponent)return u.default.createElement("div",{onMouseDown:n},u.default.createElement(t.renderComponent,{data:t,isNodeTreePanel:!0}));const a=r.nodeTypeParser(t)||Nr,s=r.nodeRender.get(a);return u.default.createElement("div",{onMouseDown:n},u.default.createElement(s,{commandService:i,modelService:o,data:t,isNodeTreePanel:!0}))},ex=e=>{const[n,r]=t.useState(!1),[o,i]=t.useState(),{getGraphConfig:a}=qs();u.default.useEffect(()=>{a().then(e=>{i(e.appContainer)})});const{prefixClz:l,graphConfig:d,commandService:c,modelService:f,popoverContent:h,onMouseDown:p,item:g}=e;return u.default.createElement(u.default.Fragment,null,h&&u.default.createElement(s.Popover,{placement:"right",destroyTooltipOnHide:!0,content:h,visible:n,onVisibleChange:e=>{r(e)},getPopupContainer:()=>o||document.body},u.default.createElement("div",{className:`${l}-node-wrapper`,onMouseEnter:()=>{r(!0)}},Qb({graphConfig:d,commandService:c,onMouseDown:p,modelService:f,nodeConfig:g}))),!h&&u.default.createElement("div",{className:`${l}-node-wrapper`,onMouseEnter:()=>{r(!0)}},Qb({graphConfig:d,commandService:c,onMouseDown:p,modelService:f,nodeConfig:g})))},tx=e=>{const{x6NodeFactory:t,dndOptions:r,onNodeDrop:o,state:i,onFolderExpand:a,prefixClz:l}=e,{graphProvider:d,modelService:c,commandService:f}=qs(),[h,p]=u.default.useState(),[g,v]=u.default.useState(),[m,y]=u.default.useState();u.default.useEffect(()=>{d.getGraphInstance().then(e=>{y(e)})}),u.default.useEffect(()=>{if(d.getGraphOptions().then(e=>{p(e)}),!m)return;const e=new n.Addon.Dnd(Object.assign(Object.assign({scaled:!1,animation:!1},r),{target:m,validateNode:e=>x(void 0,void 0,void 0,function*(){const t=Object.assign(Object.assign({},e.getData()),e.getPosition());return o?yield o(t,f,c):console.error("onNodeDrop method is required in NodeTree Panel"),!1})}));v(e)},[f,r,m,d,c,o]);const b=u.default.useCallback(e=>n=>{if(!m||!g||!h)return;const r=h.nodeTypeParser(e),o=Pc(e.renderComponent?e.renderComponent:h.nodeRender.get(r),f,c),i={data:e,width:e.width||180,height:e.height||40,view:h.graphId,component:o},a=t?t(i):Jb(i);g.start(a,n.nativeEvent)},[f,g,m,h,c,t]),w=u.default.useCallback((e=[])=>e.map(e=>{const{isDirectory:t,children:n,popoverContent:r}=e;return t?u.default.createElement(qb,{icon:Zb,key:e.id,title:e.label,className:`${l}-tree-folder`},w(n)):u.default.createElement(qb,{isLeaf:!0,key:e.id,className:`${l}-tree-leaf`,icon:u.default.createElement("span",null),title:u.default.createElement(ex,{item:e,onMouseDown:b(e),popoverContent:r,prefixClz:l,modelService:c,commandService:f,graphConfig:h})})}),[f,h,c,b,l]);return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${l}-body`,style:e.style},!i.keyword&&u.default.createElement(Xb,{showIcon:!0,selectable:!1,autoExpandParent:!1,onExpand:a,expandedKeys:i.expandedKeys,className:`${l}-tree`},w(i.treeData)),i.searchList.length>0&&u.default.createElement("ul",{className:`${l}-body-list`},i.searchList.map(e=>u.default.createElement("li",{key:e.id,className:`${l}-body-list-item`},u.default.createElement(ex,{item:e,onMouseDown:b(e),popoverContent:e.popoverContent,prefixClz:l,modelService:c,commandService:f,graphConfig:h})))),i.keyword&&0===i.searchList.length&&u.default.createElement(s.Empty,{style:{marginTop:"48px"}})))},nx=e=>{const{prefixClz:t,onKeywordChange:n}=e,{propsProxy:r}=Fb(),o=r.getValue();return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-header`,style:e.style},o.header&&u.default.isValidElement(o.header)&&o.header,o.searchService&&u.default.createElement("div",{className:`${t}-header-search`},u.default.createElement(s.Input,{placeholder:"搜索组件",allowClear:!0,onChange:e=>n(e.target.value),style:{width:"100%",border:0}}))))},rx=e=>{const{prefixClz:t}=e,{propsProxy:n}=Fb(),r=n.getValue();return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-footer`,style:e.style},r.footer&&u.default.isValidElement(r.footer)&&r.footer))},ox="XFLOW_TREE_PANEL_ROOT_ID",ix=e=>{const t=e&&e.headerPosition&&e.headerPosition.height||40,n=e.footerPosition&&e.footerPosition.height||40;return{headerStyle:vu(Object.assign({height:t,lineHeight:t,top:0,left:0,right:0},e.headerPosition)),bodyStyle:vu(Object.assign({left:0,right:0,top:t,bottom:n},e.bodyPosition)),footerStyle:vu(Object.assign({left:0,right:0,lineHeight:n,height:n,bottom:0},e.footerPosition))}};var ax=qp,sx=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},lx=function(e){return this.__data__.has(e)};function dx(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ax;++t<n;)this.add(e[t])}dx.prototype.add=dx.prototype.push=sx,dx.prototype.has=lx;var cx=dx;var ux=function(e,t){return e.has(t)},fx=cx,hx=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},px=ux;var gx=function(e,t,n,r,o,i){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var d=i.get(e),c=i.get(t);if(d&&c)return d==t&&c==e;var u=-1,f=!0,h=2&n?new fx:void 0;for(i.set(e,t),i.set(t,e);++u<s;){var p=e[u],g=t[u];if(r)var v=a?r(g,p,u,t,e,i):r(p,g,u,e,t,i);if(void 0!==v){if(v)continue;f=!1;break}if(h){if(!hx(t,function(e,t){if(!px(h,t)&&(p===e||o(p,e,n,r,i)))return h.push(t)})){f=!1;break}}else if(p!==g&&!o(p,g,n,r,i)){f=!1;break}}return i.delete(e),i.delete(t),f};var vx=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n};var mx=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},yx=Tm,bx=Ah,xx=gx,wx=vx,_x=mx,Ex=Ao?Ao.prototype:void 0,Sx=Ex?Ex.valueOf:void 0;var Cx=function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new yx(e),new yx(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return bx(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=wx;case"[object Set]":var l=1&r;if(s||(s=_x),e.size!=t.size&&!l)return!1;var d=a.get(e);if(d)return d==t;r|=2,a.set(e,t);var c=xx(s(e),s(t),r,o,i,a);return a.delete(e),c;case"[object Symbol]":if(Sx)return Sx.call(e)==Sx.call(t)}return!1},Ox=nm,kx=Object.prototype.hasOwnProperty;var Mx=sg,Nx=gx,Ax=Cx,Tx=function(e,t,n,r,o,i){var a=1&n,s=Ox(e),l=s.length;if(l!=Ox(t).length&&!a)return!1;for(var d=l;d--;){var c=s[d];if(!(a?c in t:kx.call(t,c)))return!1}var u=i.get(e),f=i.get(t);if(u&&f)return u==t&&f==e;var h=!0;i.set(e,t),i.set(t,e);for(var p=a;++d<l;){var g=e[c=s[d]],v=t[c];if(r)var m=a?r(v,g,c,t,e,i):r(g,v,c,e,t,i);if(!(void 0===m?g===v||o(g,v,n,r,i):m)){h=!1;break}p||(p="constructor"==c)}if(h&&!p){var y=e.constructor,b=t.constructor;y==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(h=!1)}return i.delete(e),i.delete(t),h},Px=Mm,Dx=Po,jx=Ag.exports,Ix=Wg,Rx="[object Arguments]",Lx="[object Array]",Fx="[object Object]",Gx=Object.prototype.hasOwnProperty;var Ux=function(e,t,n,r,o,i){var a=Dx(e),s=Dx(t),l=a?Lx:Px(e),d=s?Lx:Px(t),c=(l=l==Rx?Fx:l)==Fx,u=(d=d==Rx?Fx:d)==Fx,f=l==d;if(f&&jx(e)){if(!jx(t))return!1;a=!0,c=!1}if(f&&!c)return i||(i=new Mx),a||Ix(e)?Nx(e,t,n,r,o,i):Ax(e,t,l,n,r,o,i);if(!(1&n)){var h=c&&Gx.call(e,"__wrapped__"),p=u&&Gx.call(t,"__wrapped__");if(h||p){var g=h?e.value():e,v=p?t.value():t;return i||(i=new Mx),o(g,v,n,r,i)}}return!!f&&(i||(i=new Mx),Tx(e,t,n,r,o,i))},Hx=Vo;var Bx=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Hx(t)&&!Hx(n)?t!=t&&n!=n:Ux(t,n,r,o,e,i))},zx=sg,Vx=Bx;var Yx=Hf;var Wx=function(e){return e==e&&!Yx(e)},$x=Wx,Kx=pv;var Xx=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},qx=function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var s=n[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var l=(s=n[o])[0],d=e[l],c=s[1];if(a&&s[2]){if(void 0===d&&!(l in e))return!1}else{var u=new zx;if(r)var f=r(d,c,l,e,t,u);if(!(void 0===f?Vx(c,d,3,r,u):f))return!1}}return!0},Zx=function(e){for(var t=Kx(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,$x(o)]}return t},Jx=Xx;var Qx=function(e){var t=Zx(e);return 1==t.length&&t[0][2]?Jx(t[0][0],t[0][1]):function(n){return n===e||qx(n,e,t)}},ew=Po,tw=$o,nw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rw=/^\w*$/;var ow=function(e,t){if(ew(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!tw(e))||(rw.test(e)||!nw.test(e)||null!=t&&e in Object(t))},iw=qp;function aw(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(aw.Cache||iw),n}aw.Cache=iw;var sw=aw;var lw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dw=/\\(\\)?/g,cw=function(e){var t=sw(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(lw,function(e,n,r,o){t.push(r?o.replace(dw,"$1"):n||e)}),t}),uw=Po,fw=ow,hw=cw,pw=ti;var gw=function(e,t){return uw(e)?e:fw(e,t)?[e]:hw(pw(e))},vw=$o;var mw=function(e){if("string"==typeof e||vw(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},yw=gw,bw=mw;var xw=function(e,t){for(var n=0,r=(t=yw(t,e)).length;null!=e&&n<r;)e=e[bw(t[n++])];return n&&n==r?e:void 0},ww=xw;var _w=function(e,t,n){var r=null==e?void 0:ww(e,t);return void 0===r?n:r};var Ew=gw,Sw=Ng,Cw=Po,Ow=Dg,kw=jg,Mw=mw;var Nw=function(e,t){return null!=e&&t in Object(e)},Aw=function(e,t,n){for(var r=-1,o=(t=Ew(t,e)).length,i=!1;++r<o;){var a=Mw(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&kw(o)&&Ow(a,o)&&(Cw(e)||Sw(e))};var Tw=Bx,Pw=_w,Dw=function(e,t){return null!=e&&Aw(e,t,Nw)},jw=ow,Iw=Wx,Rw=Xx,Lw=mw;var Fw=function(e){return e};var Gw=xw;var Uw=function(e){return function(t){return null==t?void 0:t[e]}},Hw=function(e){return function(t){return Gw(t,e)}},Bw=ow,zw=mw;var Vw=Qx,Yw=function(e,t){return jw(e)&&Iw(t)?Rw(Lw(e),t):function(n){var r=Pw(n,e);return void 0===r&&r===t?Dw(n,e):Tw(t,r,3)}},Ww=Fw,$w=Po,Kw=function(e){return Bw(e)?Uw(zw(e)):Hw(e)};var Xw=function(e){return"function"==typeof e?e:null==e?Ww:"object"==typeof e?$w(e)?Yw(e[0],e[1]):Vw(e):Kw(e)};var qw=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1},Zw=function(e){return e!=e},Jw=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1};var Qw=function(e,t,n){return t==t?Jw(e,t,n):qw(e,Zw,n)};var e_=function(e,t){return!!(null==e?0:e.length)&&Qw(e,t,0)>-1};var t_=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1};var n_=dm,r_=function(){},o_=n_&&1/mx(new n_([,-0]))[1]==1/0?function(e){return new n_(e)}:r_,i_=cx,a_=e_,s_=t_,l_=ux,d_=o_,c_=mx;var u_=Xw,f_=function(e,t,n){var r=-1,o=a_,i=e.length,a=!0,s=[],l=s;if(n)a=!1,o=s_;else if(i>=200){var d=t?null:d_(e);if(d)return c_(d);a=!1,o=l_,l=new i_}else l=t?[]:s;e:for(;++r<i;){var c=e[r],u=t?t(c):c;if(c=n||0!==c?c:0,a&&u==u){for(var f=l.length;f--;)if(l[f]===u)continue e;t&&l.push(u),s.push(c)}else o(l,u,n)||(l!==s&&l.push(u),s.push(c))}return s};var h_=function(e,t){return e&&e.length?f_(e,u_(t)):[]};e.NsNodeTreePanelModel=void 0,function(e){e.id="TREE_PANEL_MODEL",e.useModel=t=>x(this,void 0,void 0,function*(){return t.awaitModel(e.id)})}(e.NsNodeTreePanelModel||(e.NsNodeTreePanelModel={}));const p_=t=>{const{treeDataService:n,searchService:r}=t,{modelService:o}=qs(),[i,a,s]=qy({treeData:[],searchList:[],treeNodeList:[],expandedKeys:[],defaultExpandAll:!1,keyword:""});u.default.useEffect(()=>{o.findDeferredModel(e.NsNodeTreePanelModel.id)||o.registerModel({id:e.NsNodeTreePanelModel.id,modelFactory:()=>s,watchChange:e=>x(void 0,void 0,void 0,function*(){const t=yield tu.getModel(o),r=t=>x(void 0,void 0,void 0,function*(){const r=yield n(t,o),{treeData:i,rootNodes:a}=function(e=[]){const t=e=>{const t=h_(e,"id").reduce((e,t)=>{const n=t.parentId||ox;e.has(n)||e.set(n,[]);return e.get(n).push(t),e},new Map);return t},n=t(By(e));function r(e,t){return e.map(e=>{if(t.has(e.id)){const n=t.get(e.id);e.key=e.id,e.isDirectory=!0,e.children=r(n,t)||[]}else e.isLeaf=!0;return e})}const o=n.get(ox)||[],i=r(o,n);return{treeData:i,rootNodes:o}}(r),s=yield e.getValidValue(),l=s.expandedKeys.length>0?s.expandedKeys:a.map(e=>e.id);return{listData:r,treeData:i,expandedKeys:l}}),i=t.watch(t=>x(void 0,void 0,void 0,function*(){const n=yield r(t);e.setValue({treeNodeList:n.listData,treeData:n.treeData,expandedKeys:n.expandedKeys,defaultExpandAll:!1,keyword:"",searchList:[]})}));return Er.create(()=>{i.dispose()})})})},[]);const l=u.default.useCallback(e=>{a(t=>{t.expandedKeys=e})},[a]),d=u.default.useCallback(e=>x(void 0,void 0,void 0,function*(){if(!r)return console.warn("searchService is not defined");if(e){const t=yield r(i.treeNodeList,e);a(n=>{n.keyword=e,n.searchList=t})}else a(e=>{e.keyword="",e.searchList=[]})}),[r,i.treeNodeList]);return{state:i,setState:a,onKeywordChange:d,onFolderExpand:l}};var g_;!function(e){e.id="TREE_PANEL_DATA"}(g_||(g_={}));var v_=Object.freeze({__proto__:null,get NsTreePanelData(){return g_}});const m_=e=>{const{headerStyle:t,bodyStyle:n,footerStyle:r}=ix(e),{state:o,onFolderExpand:i,onKeywordChange:a}=p_(e);return u.default.createElement(u.default.Fragment,null,u.default.createElement(nx,Object.assign({},e,{state:o,style:t,onKeywordChange:a})),u.default.createElement(tx,Object.assign({},e,{state:o,style:n,onFolderExpand:i})),u.default.createElement(rx,Object.assign({},e,{state:o,style:r})))},y_=e=>{const{x6NodeFactory:t,dndOptions:r,onNodeDrop:o}=e,{graphProvider:i,modelService:a,commandService:s}=qs(),[l,d]=u.default.useState(),[c,f]=u.default.useState(),[h,p]=u.default.useState();u.default.useEffect(()=>{i.getGraphInstance().then(e=>{p(e)}),i.getGraphOptions().then(e=>{d(e)})},[i,p,d]),u.default.useEffect(()=>{if(!h)return;const e=new n.Addon.Dnd(Object.assign(Object.assign({scaled:!1,animation:!1},r),{target:h,validateNode:e=>x(void 0,void 0,void 0,function*(){const t=Object.assign(Object.assign({},e.getData()),e.getPosition());return o?yield o(t,s,a):console.error("onNodeDrop method is required in NodeTree Panel"),!1})}));return f(e),()=>{e.dispose()}},[s,a,r,h,o]);const g=u.default.useCallback(e=>n=>{if(!h||!c||!l)return;if(e.isDisabled)return;const r=l.nodeTypeParser(e),o=Pc(e.renderComponent?e.renderComponent:l.nodeRender.get(r),s,a),i={data:e,width:e.width||180,height:e.height||40,view:l.graphId,component:o},d=t?t(i):new $b(i);c.start(d,n.nativeEvent)},[s,c,h,l,a,t]);return{graphConfig:l,onMouseDown:g,modelService:a,commandService:s}},b_=e=>{const{nodeConfig:t,onMouseDown:n,graphConfig:r,modelService:o,commandService:i}=e;if(!r)return u.default.createElement("div",null);if(t.renderComponent)return u.default.createElement("div",{onMouseDown:n},u.default.createElement(t.renderComponent,{data:t,isNodePanel:!0}));const a=r.nodeTypeParser(t)||Nr,s=r.nodeRender.get(a);return u.default.createElement("div",{onMouseDown:n},u.default.createElement(s,{commandService:i,modelService:o,data:t,isNodeTreePanel:!0}))},x_=e=>{const[t,n]=u.default.useState(!1),{prefixClz:r,graphConfig:o,commandService:i,modelService:a,popoverContent:l,onMouseDown:d,item:c}=e;return u.default.createElement(u.default.Fragment,null,l?u.default.createElement(s.Popover,{placement:"right",destroyTooltipOnHide:!0,content:l,visible:t,onVisibleChange:e=>{n(e)}},u.default.createElement("div",{className:`${r}-node-wrapper`,onMouseEnter:()=>{n(!0)}},b_({graphConfig:o,commandService:i,onMouseDown:d,modelService:a,nodeConfig:c}))):u.default.createElement("div",{className:`${r}-node-wrapper`},b_({graphConfig:o,commandService:i,onMouseDown:d,modelService:a,nodeConfig:c})))},w_=e=>{const{searchResult:t,prefixClz:n,onMouseDown:r,modelService:o,commandService:i,graphConfig:a}=e;return 0===t.length?u.default.createElement(s.Empty,{style:{marginTop:"24px"}}):u.default.createElement("ul",{className:"xflow-collapse-search-list"},t.map(e=>u.default.createElement("li",{className:"xflow-collapse-search-list-item "+(e.isDisabled?"disabled":""),key:e.id},u.default.createElement(x_,{item:e,onMouseDown:r(e),popoverContent:e.popoverContent,prefixClz:n,modelService:o,commandService:i,graphConfig:a}))))},__=e=>{const{onActiveKeyChange:t,collapseData:n,prefixClz:r,onMouseDown:o,modelService:i,commandService:a,graphConfig:l}=e;return u.default.createElement("ul",{className:"xflow-collapse-list"},0===n.length&&u.default.createElement(s.Empty,{style:{marginTop:"24px"}}),n.map(e=>{const{children:n=[],isCollapsed:s,render:d}=e,c=s?"close":"open";return u.default.createElement("li",{className:`xflow-collapse-list-item ${c}`,key:e.id},(e=>{const{header:n,extra:r,icon:o,isCollapsed:i}=e;return u.default.createElement("div",{className:"xflow-collapse-header",onClick:n=>{n.preventDefault(),t(e.id)}},u.default.createElement("div",{className:"xflow-collapse-header-icon"},Oc(o)?u.default.createElement(o,{isCollapsed:i}):u.default.createElement(Ra,{rotate:i?0:90,style:{fontSize:"12px"}})),u.default.createElement("div",{className:"xflow-collapse-header-label"},Oc(n)?u.default.createElement(n,e):n),u.default.createElement("div",{className:"xflow-collapse-header-extra"},Oc(r)?u.default.createElement(r,e):r))})(e),Oc(d)?u.default.createElement(d,e):(e=>u.default.createElement("div",{className:"xflow-collapse-content"},e.map(e=>u.default.createElement("div",{className:"xflow-collapse-content-item "+(e.isDisabled?"disabled":""),key:e.id},u.default.createElement(x_,{item:e,onMouseDown:o(e),popoverContent:e.popoverContent,prefixClz:r,modelService:i,commandService:a,graphConfig:l})))))(n))}))},E_=e=>{const{state:t,bodyLoading:n,prefixClz:r,onActiveKeyChange:o}=e,{graphConfig:i,onMouseDown:a,modelService:l,commandService:d}=y_(e),{searchResult:c,collapseData:f,keyword:h}=t;return u.default.createElement("div",{className:`${r}-body`,style:e.style},u.default.createElement(s.Spin,{spinning:!0===n},0===h.length&&u.default.createElement(__,{onActiveKeyChange:o,collapseData:f,onMouseDown:a,modelService:l,commandService:d,graphConfig:i,prefixClz:r}),h.length>0&&u.default.createElement(w_,{searchResult:c,onMouseDown:a,modelService:l,commandService:d,graphConfig:i,prefixClz:r})))},S_=e=>{const{prefixClz:t,onKeywordChange:n,state:r}=e,{propsProxy:o}=Fb(),i=o.getValue();return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-header`,style:e.style},i.header&&u.default.isValidElement(i.header)&&i.header,i.searchService&&u.default.createElement("div",{className:`${t}-header-search`},u.default.createElement(s.Input,{placeholder:"搜索组件",allowClear:!0,onChange:e=>(e=>{const t=r.collapseData.reduce((e,t)=>(t.children&&e.push(...t.children),e),[]);n(e.target.value,t)})(e),style:{width:"100%",border:0}}))))},C_=e=>{const{prefixClz:t}=e,{propsProxy:n}=Fb(),r=n.getValue();return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-footer`,style:e.style},r.footer&&u.default.isValidElement(r.footer)&&r.footer))},O_=e=>{const{prefixClz:t,onCollapseBtnClick:n,isCollapsed:r,collapseButtonStyle:o,style:i}=e;return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-header`,style:Object.assign(Object.assign({},i),o),onClick:n},u.default.createElement(Da,{rotate:r?180:0})))};e.NsCollapsePanelModel=void 0,function(e){e.id="COLLAPSE_PANEL_DATA",e.useModel=t=>x(this,void 0,void 0,function*(){return t.awaitModel(e.id)})}(e.NsCollapsePanelModel||(e.NsCollapsePanelModel={}));var k_=Object.freeze({__proto__:null,get NsCollapsePanelModel(){return e.NsCollapsePanelModel}});const M_=t=>{const{collapsible:n,nodeDataService:r,searchService:o,onCollapseChange:i}=t,{modelService:a}=qs(),[s,l,d]=qy({keyword:"",collapseData:[],searchResult:[]});u.default.useEffect(()=>{a.findDeferredModel(e.NsCollapsePanelModel.id)||a.registerModel({id:e.NsCollapsePanelModel.id,modelFactory:()=>d,watchChange:e=>x(void 0,void 0,void 0,function*(){const t=yield tu.getModel(a),n=t.watch(t=>x(void 0,void 0,void 0,function*(){const{collapseData:n}=yield(e=>x(void 0,void 0,void 0,function*(){return{collapseData:yield r(e,a)}}))(t);e.setValue(e=>{e.keyword="",e.collapseData=n,e.searchResult=[]})}));return Er.create(()=>{n.dispose()})})})},[]);const c=u.default.useCallback(e=>{l(t=>{t.collapseData.forEach(t=>{t.id===e&&!1!==t.collapsible&&(t.isCollapsed=!t.isCollapsed)})})},[l]),f=u.default.useCallback((e,t)=>x(void 0,void 0,void 0,function*(){if(!o)return console.warn("searchService is not defined");if(e){const n=yield o(t,e);l(t=>{t.keyword=e,t.searchResult=n})}else l(e=>{e.keyword="",e.searchResult=[]})}),[o]);return{state:s,collapsible:n,setState:l,onKeywordChange:f,onActiveKeyChange:c,onCollapseChange:i}},N_=e=>{const{headerStyle:t,bodyStyle:n,footerStyle:r}=(e=>{const t=e&&e.headerPosition&&e.headerPosition.height||40,n=e.footerPosition&&e.footerPosition.height||40;return{headerStyle:vu(Object.assign({height:t,lineHeight:t,top:0,left:0,right:0},e.headerPosition)),bodyStyle:vu(Object.assign({left:0,right:0,top:t,bottom:n},e.bodyPosition)),footerStyle:vu(Object.assign({left:0,right:0,lineHeight:n,height:n,bottom:0},e.footerPosition))}})(e),{state:o,onActiveKeyChange:i,onKeywordChange:a}=M_(e);return u.default.createElement(u.default.Fragment,null,u.default.createElement(S_,Object.assign({},e,{state:o,style:t,onKeywordChange:a})),u.default.createElement(E_,Object.assign({},e,{state:o,style:n,onActiveKeyChange:i})),u.default.createElement(C_,Object.assign({},e,{state:o,style:r})))},A_=e=>{const{state:t}=e,{propsProxy:n}=Fb(),r=n.getValue(),o=qs(),i=r.footer&&"function"==typeof r.footer;return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${e.prefixClz}-footer`,style:e.style},i&&u.default.createElement(r.footer,Object.assign(Object.assign({},e),{headerStyle:{},bodyStyle:{},footerStyle:e.style,targetData:t.targetData,targetType:t.targetType,modelService:o.modelService,commandService:o.commandService})),!r.footer&&u.default.createElement("div",{className:`${e.prefixClz}-footer-title`},r.footerText)))},T_=e=>{const{prefixClz:t,hasSchema:n,state:r}=e,{propsProxy:o}=Fb(),i=o.getValue(),a=qs();if(n)return null;const s=i.header&&"function"==typeof i.header;return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-header`,style:e.style},s&&u.default.createElement(i.header,Object.assign(Object.assign({},e),{headerStyle:e.style,bodyStyle:{},footerStyle:{},targetData:r.targetData,targetType:r.targetType,modelService:a.modelService,commandService:a.commandService})),!i.header&&u.default.createElement("div",{className:`${t}-header-title`},i.headerText||"Panel")))},P_=e=>{const{text:t}=e,n=m(e,["text"]);return t?u.default.createElement(s.Tooltip,Object.assign({placement:"left",title:t},n),u.default.createElement("div",{className:"text-truncate"},t)):null};function D_(e){if(e)return u.default.createElement(P_,{text:e})}const j_=e=>{const{schema:n,children:r}=e,[o,i]=t.useState(),{dependencies:a,value:l,defaultValue:d,hidden:c,disabled:f}=n,h=t.useMemo(()=>(null==a?void 0:a.length)?function(e,t){return(n,r)=>e.some(e=>"function"==typeof(null==e?void 0:e.condition))?("function"==typeof t&&t(void 0),!0):e.some(e=>{const{name:o}=e;return o?!(_w(n,o)===_w(r,o)||("function"==typeof t&&t(o),0)):(console.error("[Schema form]: A dependent name must be provided in the updater when the dependency condition is not a function."),!1)})}(a,i):void 0,[a]);if("function"!=typeof r)throw new Error("[Schema Form]: chilren of FormItemWrapper should be a render prop.");const p=""===(g=l)||void 0===g?d:l;var g;return h?u.default.createElement(s.Form.Item,{noStyle:!0,shouldUpdate:h},e=>{const{hidden:t,disabled:i}=function(e,t,n){const{getFieldValue:r,getFieldsValue:o}=e,{dependencies:i,hidden:a,disabled:s}=t;let l=a,d=s;return null==i||i.forEach(e=>{const{name:t,condition:i,hidden:a,disabled:s}=e;if("function"!=typeof i&&n&&t!==n)return;let c=!1;if("function"==typeof i)c=!!i(o());else{if(!t)return void console.error("[Schema form]: A dependent name must be provided in the props genarator when the dependency condition is not a function.");c=r(t)===i}c&&(void 0!==a&&(l=a),void 0!==s&&(d=s))}),{hidden:l,disabled:d}}(e,n,o);return r({hidden:t,disabled:i,initialValue:p})}):r({hidden:c,disabled:f,initialValue:p})},I_=e=>{const{controlSchema:t}=e,{required:n,tooltip:r,extra:o,name:i,label:a,placeholder:l,rules:d}=t;return u.default.createElement(j_,{schema:t},({disabled:e,hidden:t,initialValue:c})=>u.default.createElement(s.Form.Item,{name:i,label:a,initialValue:c,tooltip:r,extra:D_(o),required:n,hidden:t,rules:d},u.default.createElement(s.Input,{className:"xflow-form-input",allowClear:!0,placeholder:l,disabled:e})))};var R_={exports:{}};!function(e){e.exports=function(){var t,n;function r(){return t.apply(null,arguments)}function o(e){t=e}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function d(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[],o=e.length;for(n=0;n<o;++n)r.push(t(e[n],n));return r}function h(e,t){for(var n in t)s(t,n)&&(e[n]=t[n]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Xn(e,t,n,r,!0).utc()}function g(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function v(e){return null==e._pf&&(e._pf=g()),e._pf}function m(e){var t=null,r=!1,o=e._d&&!isNaN(e._d.getTime());return o&&(t=v(e),r=n.call(t.parsedDateParts,function(e){return null!=e}),o=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r),e._strict&&(o=o&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?o:(e._isValid=o,e._isValid)}function y(e){var t=p(NaN);return null!=e?h(v(t),e):v(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),r=n.length>>>0;for(t=0;t<r;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var b=r.momentProperties=[],x=!1;function w(e,t){var n,r,o,i=b.length;if(d(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),d(t._i)||(e._i=t._i),d(t._f)||(e._f=t._f),d(t._l)||(e._l=t._l),d(t._strict)||(e._strict=t._strict),d(t._tzm)||(e._tzm=t._tzm),d(t._isUTC)||(e._isUTC=t._isUTC),d(t._offset)||(e._offset=t._offset),d(t._pf)||(e._pf=v(t)),d(t._locale)||(e._locale=t._locale),i>0)for(n=0;n<i;n++)d(o=t[r=b[n]])||(e[r]=o);return e}function _(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===x&&(x=!0,r.updateOffset(this),x=!1)}function S(e){return e instanceof _||null!=e&&null!=e._isAMomentObject}function C(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function O(e,t){var n=!0;return h(function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var o,i,a,l=[],d=arguments.length;for(i=0;i<d;i++){if(o="","object"==typeof arguments[i]){for(a in o+="\n["+i+"] ",arguments[0])s(arguments[0],a)&&(o+=a+": "+arguments[0][a]+", ");o=o.slice(0,-2)}else o=arguments[i];l.push(o)}C(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)},t)}var k,M={};function N(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),M[e]||(C(t),M[e]=!0)}function A(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function T(e){var t,n;for(n in e)s(e,n)&&(A(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function P(e,t){var n,r=h({},e);for(n in t)s(t,n)&&(a(e[n])&&a(t[n])?(r[n]={},h(r[n],e[n]),h(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)s(e,n)&&!s(t,n)&&a(e[n])&&(r[n]=h({},r[n]));return r}function D(e){null!=e&&this.set(e)}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,k=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var j={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function I(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return A(r)?r.call(t,n):r}function R(e,t,n){var r=""+Math.abs(e),o=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}var L=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,G={},U={};function H(e,t,n,r){var o=r;"string"==typeof r&&(o=function(){return this[r]()}),e&&(U[e]=o),t&&(U[t[0]]=function(){return R(o.apply(this,arguments),t[1],t[2])}),n&&(U[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function B(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function z(e){var t,n,r=e.match(L);for(t=0,n=r.length;t<n;t++)U[r[t]]?r[t]=U[r[t]]:r[t]=B(r[t]);return function(t){var o,i="";for(o=0;o<n;o++)i+=A(r[o])?r[o].call(t,e):r[o];return i}}function V(e,t){return e.isValid()?(t=Y(t,e.localeData()),G[t]=G[t]||z(t),G[t](e)):e.localeData().invalidDate()}function Y(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(F.lastIndex=0;n>=0&&F.test(e);)e=e.replace(F,r),F.lastIndex=0,n-=1;return e}var W={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function $(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(L).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])}var K="Invalid date";function X(){return this._invalidDate}var q="%d",Z=/\d{1,2}/;function J(e){return this._ordinal.replace("%d",e)}var Q={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ee(e,t,n,r){var o=this._relativeTime[n];return A(o)?o(e,t,n,r):o.replace(/%d/i,e)}function te(e,t){var n=this._relativeTime[e>0?"future":"past"];return A(n)?n(t):n.replace(/%s/i,t)}var ne={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function re(e){return"string"==typeof e?ne[e]||ne[e.toLowerCase()]:void 0}function oe(e){var t,n,r={};for(n in e)s(e,n)&&(t=re(n))&&(r[t]=e[n]);return r}var ie={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function ae(e){var t,n=[];for(t in e)s(e,t)&&n.push({unit:t,priority:ie[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}var se,le=/\d/,de=/\d\d/,ce=/\d{3}/,ue=/\d{4}/,fe=/[+-]?\d{6}/,he=/\d\d?/,pe=/\d\d\d\d?/,ge=/\d\d\d\d\d\d?/,ve=/\d{1,3}/,me=/\d{1,4}/,ye=/[+-]?\d{1,6}/,be=/\d+/,xe=/[+-]?\d+/,we=/Z|[+-]\d\d:?\d\d/gi,_e=/Z|[+-]\d\d(?::?\d\d)?/gi,Ee=/[+-]?\d+(\.\d{1,3})?/,Se=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ce=/^[1-9]\d?/,Oe=/^([1-9]\d|\d)/;function ke(e,t,n){se[e]=A(t)?t:function(e,r){return e&&n?n:t}}function Me(e,t){return s(se,e)?se[e](t._strict,t._locale):new RegExp(Ne(e))}function Ne(e){return Ae(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,o){return t||n||r||o}))}function Ae(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Te(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Pe(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=Te(t)),n}se={};var De={};function je(e,t){var n,r,o=t;for("string"==typeof e&&(e=[e]),c(t)&&(o=function(e,n){n[t]=Pe(e)}),r=e.length,n=0;n<r;n++)De[e[n]]=o}function Ie(e,t){je(e,function(e,n,r,o){r._w=r._w||{},t(e,r._w,r,o)})}function Re(e,t,n){null!=t&&s(De,e)&&De[e](t,n._a,n,e)}function Le(e){return e%4==0&&e%100!=0||e%400==0}var Fe=0,Ge=1,Ue=2,He=3,Be=4,ze=5,Ve=6,Ye=7,We=8;function $e(e){return Le(e)?366:365}H("Y",0,0,function(){var e=this.year();return e<=9999?R(e,4):"+"+e}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),ke("Y",xe),ke("YY",he,de),ke("YYYY",me,ue),ke("YYYYY",ye,fe),ke("YYYYYY",ye,fe),je(["YYYYY","YYYYYY"],Fe),je("YYYY",function(e,t){t[Fe]=2===e.length?r.parseTwoDigitYear(e):Pe(e)}),je("YY",function(e,t){t[Fe]=r.parseTwoDigitYear(e)}),je("Y",function(e,t){t[Fe]=parseInt(e,10)}),r.parseTwoDigitYear=function(e){return Pe(e)+(Pe(e)>68?1900:2e3)};var Ke,Xe=Ze("FullYear",!0);function qe(){return Le(this.year())}function Ze(e,t){return function(n){return null!=n?(Qe(this,e,n),r.updateOffset(this,t),this):Je(this,e)}}function Je(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Qe(e,t,n){var r,o,i,a,s;if(e.isValid()&&!isNaN(n)){switch(r=e._d,o=e._isUTC,t){case"Milliseconds":return void(o?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(o?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(o?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(o?r.setUTCHours(n):r.setHours(n));case"Date":return void(o?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}i=n,a=e.month(),s=29!==(s=e.date())||1!==a||Le(i)?s:28,o?r.setUTCFullYear(i,a,s):r.setFullYear(i,a,s)}}function et(e){return A(this[e=re(e)])?this[e]():this}function tt(e,t){if("object"==typeof e){var n,r=ae(e=oe(e)),o=r.length;for(n=0;n<o;n++)this[r[n].unit](e[r[n].unit])}else if(A(this[e=re(e)]))return this[e](t);return this}function nt(e,t){return(e%t+t)%t}function rt(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=nt(t,12);return e+=(t-n)/12,1===n?Le(e)?29:28:31-n%7%2}Ke=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),H("MMMM",0,0,function(e){return this.localeData().months(this,e)}),ke("M",he,Ce),ke("MM",he,de),ke("MMM",function(e,t){return t.monthsShortRegex(e)}),ke("MMMM",function(e,t){return t.monthsRegex(e)}),je(["M","MM"],function(e,t){t[Ge]=Pe(e)-1}),je(["MMM","MMMM"],function(e,t,n,r){var o=n._locale.monthsParse(e,r,n._strict);null!=o?t[Ge]=o:v(n).invalidMonth=e});var ot="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),it="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),at=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,st=Se,lt=Se;function dt(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||at).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone}function ct(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[at.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ut(e,t,n){var r,o,i,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(o=Ke.call(this._shortMonthsParse,a))?o:null:-1!==(o=Ke.call(this._longMonthsParse,a))?o:null:"MMM"===t?-1!==(o=Ke.call(this._shortMonthsParse,a))||-1!==(o=Ke.call(this._longMonthsParse,a))?o:null:-1!==(o=Ke.call(this._longMonthsParse,a))||-1!==(o=Ke.call(this._shortMonthsParse,a))?o:null}function ft(e,t,n){var r,o,i;if(this._monthsParseExact)return ut.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(o=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(i="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function ht(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=Pe(t);else if(!c(t=e.localeData().monthsParse(t)))return e;var n=t,r=e.date();return r=r<29?r:Math.min(r,rt(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function pt(e){return null!=e?(ht(this,e),r.updateOffset(this,!0),this):Je(this,"Month")}function gt(){return rt(this.year(),this.month())}function vt(e){return this._monthsParseExact?(s(this,"_monthsRegex")||yt.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=st),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function mt(e){return this._monthsParseExact?(s(this,"_monthsRegex")||yt.call(this),e?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=lt),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function yt(){function e(e,t){return t.length-e.length}var t,n,r,o,i=[],a=[],s=[];for(t=0;t<12;t++)n=p([2e3,t]),r=Ae(this.monthsShort(n,"")),o=Ae(this.months(n,"")),i.push(r),a.push(o),s.push(o),s.push(r);i.sort(e),a.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function bt(e,t,n,r,o,i,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,o,i,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,o,i,a),s}function xt(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function wt(e,t,n){var r=7+t-n;return-(7+xt(e,0,r).getUTCDay()-t)%7+r-1}function _t(e,t,n,r,o){var i,a,s=1+7*(t-1)+(7+n-r)%7+wt(e,r,o);return s<=0?a=$e(i=e-1)+s:s>$e(e)?(i=e+1,a=s-$e(e)):(i=e,a=s),{year:i,dayOfYear:a}}function Et(e,t,n){var r,o,i=wt(e.year(),t,n),a=Math.floor((e.dayOfYear()-i-1)/7)+1;return a<1?r=a+St(o=e.year()-1,t,n):a>St(e.year(),t,n)?(r=a-St(e.year(),t,n),o=e.year()+1):(o=e.year(),r=a),{week:r,year:o}}function St(e,t,n){var r=wt(e,t,n),o=wt(e+1,t,n);return($e(e)-r+o)/7}function Ct(e){return Et(e,this._week.dow,this._week.doy).week}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),ke("w",he,Ce),ke("ww",he,de),ke("W",he,Ce),ke("WW",he,de),Ie(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=Pe(e)});var Ot={dow:0,doy:6};function kt(){return this._week.dow}function Mt(){return this._week.doy}function Nt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function At(e){var t=Et(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Tt(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Pt(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Dt(e,t){return e.slice(t,7).concat(e.slice(0,t))}H("d",0,"do","day"),H("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),H("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),H("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),ke("d",he),ke("e",he),ke("E",he),ke("dd",function(e,t){return t.weekdaysMinRegex(e)}),ke("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ke("dddd",function(e,t){return t.weekdaysRegex(e)}),Ie(["dd","ddd","dddd"],function(e,t,n,r){var o=n._locale.weekdaysParse(e,r,n._strict);null!=o?t.d=o:v(n).invalidWeekday=e}),Ie(["d","e","E"],function(e,t,n,r){t[r]=Pe(e)});var jt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),It="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Lt=Se,Ft=Se,Gt=Se;function Ut(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Dt(n,this._week.dow):e?n[e.day()]:n}function Ht(e){return!0===e?Dt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Bt(e){return!0===e?Dt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function zt(e,t,n){var r,o,i,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(o=Ke.call(this._weekdaysParse,a))?o:null:"ddd"===t?-1!==(o=Ke.call(this._shortWeekdaysParse,a))?o:null:-1!==(o=Ke.call(this._minWeekdaysParse,a))?o:null:"dddd"===t?-1!==(o=Ke.call(this._weekdaysParse,a))||-1!==(o=Ke.call(this._shortWeekdaysParse,a))||-1!==(o=Ke.call(this._minWeekdaysParse,a))?o:null:"ddd"===t?-1!==(o=Ke.call(this._shortWeekdaysParse,a))||-1!==(o=Ke.call(this._weekdaysParse,a))||-1!==(o=Ke.call(this._minWeekdaysParse,a))?o:null:-1!==(o=Ke.call(this._minWeekdaysParse,a))||-1!==(o=Ke.call(this._weekdaysParse,a))||-1!==(o=Ke.call(this._shortWeekdaysParse,a))?o:null}function Vt(e,t,n){var r,o,i;if(this._weekdaysParseExact)return zt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function Yt(e){if(!this.isValid())return null!=e?this:NaN;var t=Je(this,"Day");return null!=e?(e=Tt(e,this.localeData()),this.add(e-t,"d")):t}function Wt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function $t(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Pt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Kt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Zt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Lt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Xt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Zt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ft),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function qt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Zt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Gt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Zt(){function e(e,t){return t.length-e.length}var t,n,r,o,i,a=[],s=[],l=[],d=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=Ae(this.weekdaysMin(n,"")),o=Ae(this.weekdaysShort(n,"")),i=Ae(this.weekdays(n,"")),a.push(r),s.push(o),l.push(i),d.push(r),d.push(o),d.push(i);a.sort(e),s.sort(e),l.sort(e),d.sort(e),this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Jt(){return this.hours()%12||12}function Qt(){return this.hours()||24}function en(e,t){H(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function tn(e,t){return t._meridiemParse}function nn(e){return"p"===(e+"").toLowerCase().charAt(0)}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Jt),H("k",["kk",2],0,Qt),H("hmm",0,0,function(){return""+Jt.apply(this)+R(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Jt.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+R(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)}),en("a",!0),en("A",!1),ke("a",tn),ke("A",tn),ke("H",he,Oe),ke("h",he,Ce),ke("k",he,Ce),ke("HH",he,de),ke("hh",he,de),ke("kk",he,de),ke("hmm",pe),ke("hmmss",ge),ke("Hmm",pe),ke("Hmmss",ge),je(["H","HH"],He),je(["k","kk"],function(e,t,n){var r=Pe(e);t[He]=24===r?0:r}),je(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),je(["h","hh"],function(e,t,n){t[He]=Pe(e),v(n).bigHour=!0}),je("hmm",function(e,t,n){var r=e.length-2;t[He]=Pe(e.substr(0,r)),t[Be]=Pe(e.substr(r)),v(n).bigHour=!0}),je("hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[He]=Pe(e.substr(0,r)),t[Be]=Pe(e.substr(r,2)),t[ze]=Pe(e.substr(o)),v(n).bigHour=!0}),je("Hmm",function(e,t,n){var r=e.length-2;t[He]=Pe(e.substr(0,r)),t[Be]=Pe(e.substr(r))}),je("Hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[He]=Pe(e.substr(0,r)),t[Be]=Pe(e.substr(r,2)),t[ze]=Pe(e.substr(o))});var rn=/[ap]\.?m?\.?/i,on=Ze("Hours",!0);function an(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var sn,ln={calendar:j,longDateFormat:W,invalidDate:K,ordinal:q,dayOfMonthOrdinalParse:Z,relativeTime:Q,months:ot,monthsShort:it,week:Ot,weekdays:jt,weekdaysMin:Rt,weekdaysShort:It,meridiemParse:rn},dn={},cn={};function un(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function fn(e){return e?e.toLowerCase().replace("_","-"):e}function hn(e){for(var t,n,r,o,i=0;i<e.length;){for(t=(o=fn(e[i]).split("-")).length,n=(n=fn(e[i+1]))?n.split("-"):null;t>0;){if(r=gn(o.slice(0,t).join("-")))return r;if(n&&n.length>=t&&un(o,n)>=t-1)break;t--}i++}return sn}function pn(e){return!(!e||!e.match("^[^/\\\\]*$"))}function gn(t){var n=null;if(void 0===dn[t]&&e&&e.exports&&pn(t))try{n=sn._abbr,E("./locale/"+t),vn(n)}catch(e){dn[t]=null}return dn[t]}function vn(e,t){var n;return e&&((n=d(t)?bn(e):mn(e,t))?sn=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),sn._abbr}function mn(e,t){if(null!==t){var n,r=ln;if(t.abbr=e,null!=dn[e])N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=dn[e]._config;else if(null!=t.parentLocale)if(null!=dn[t.parentLocale])r=dn[t.parentLocale]._config;else{if(null==(n=gn(t.parentLocale)))return cn[t.parentLocale]||(cn[t.parentLocale]=[]),cn[t.parentLocale].push({name:e,config:t}),null;r=n._config}return dn[e]=new D(P(r,t)),cn[e]&&cn[e].forEach(function(e){mn(e.name,e.config)}),vn(e),dn[e]}return delete dn[e],null}function yn(e,t){if(null!=t){var n,r,o=ln;null!=dn[e]&&null!=dn[e].parentLocale?dn[e].set(P(dn[e]._config,t)):(null!=(r=gn(e))&&(o=r._config),t=P(o,t),null==r&&(t.abbr=e),(n=new D(t)).parentLocale=dn[e],dn[e]=n),vn(e)}else null!=dn[e]&&(null!=dn[e].parentLocale?(dn[e]=dn[e].parentLocale,e===vn()&&vn(e)):null!=dn[e]&&delete dn[e]);return dn[e]}function bn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return sn;if(!i(e)){if(t=gn(e))return t;e=[e]}return hn(e)}function xn(){return k(dn)}function wn(e){var t,n=e._a;return n&&-2===v(e).overflow&&(t=n[Ge]<0||n[Ge]>11?Ge:n[Ue]<1||n[Ue]>rt(n[Fe],n[Ge])?Ue:n[He]<0||n[He]>24||24===n[He]&&(0!==n[Be]||0!==n[ze]||0!==n[Ve])?He:n[Be]<0||n[Be]>59?Be:n[ze]<0||n[ze]>59?ze:n[Ve]<0||n[Ve]>999?Ve:-1,v(e)._overflowDayOfYear&&(t<Fe||t>Ue)&&(t=Ue),v(e)._overflowWeeks&&-1===t&&(t=Ye),v(e)._overflowWeekday&&-1===t&&(t=We),v(e).overflow=t),e}var _n=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,En=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sn=/Z|[+-]\d\d(?::?\d\d)?/,Cn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],On=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],kn=/^\/?Date\((-?\d+)/i,Mn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Nn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function An(e){var t,n,r,o,i,a,s=e._i,l=_n.exec(s)||En.exec(s),d=Cn.length,c=On.length;if(l){for(v(e).iso=!0,t=0,n=d;t<n;t++)if(Cn[t][1].exec(l[1])){o=Cn[t][0],r=!1!==Cn[t][2];break}if(null==o)return void(e._isValid=!1);if(l[3]){for(t=0,n=c;t<n;t++)if(On[t][1].exec(l[3])){i=(l[2]||" ")+On[t][0];break}if(null==i)return void(e._isValid=!1)}if(!r&&null!=i)return void(e._isValid=!1);if(l[4]){if(!Sn.exec(l[4]))return void(e._isValid=!1);a="Z"}e._f=o+(i||"")+(a||""),Bn(e)}else e._isValid=!1}function Tn(e,t,n,r,o,i){var a=[Pn(e),it.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(o,10)];return i&&a.push(parseInt(i,10)),a}function Pn(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Dn(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function jn(e,t,n){return!e||It.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(v(n).weekdayMismatch=!0,n._isValid=!1,!1)}function In(e,t,n){if(e)return Nn[e];if(t)return 0;var r=parseInt(n,10),o=r%100;return(r-o)/100*60+o}function Rn(e){var t,n=Mn.exec(Dn(e._i));if(n){if(t=Tn(n[4],n[3],n[2],n[5],n[6],n[7]),!jn(n[1],t,e))return;e._a=t,e._tzm=In(n[8],n[9],n[10]),e._d=xt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),v(e).rfc2822=!0}else e._isValid=!1}function Ln(e){var t=kn.exec(e._i);null===t?(An(e),!1===e._isValid&&(delete e._isValid,Rn(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}function Fn(e,t,n){return null!=e?e:null!=t?t:n}function Gn(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Un(e){var t,n,r,o,i,a=[];if(!e._d){for(r=Gn(e),e._w&&null==e._a[Ue]&&null==e._a[Ge]&&Hn(e),null!=e._dayOfYear&&(i=Fn(e._a[Fe],r[Fe]),(e._dayOfYear>$e(i)||0===e._dayOfYear)&&(v(e)._overflowDayOfYear=!0),n=xt(i,0,e._dayOfYear),e._a[Ge]=n.getUTCMonth(),e._a[Ue]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=r[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[He]&&0===e._a[Be]&&0===e._a[ze]&&0===e._a[Ve]&&(e._nextDay=!0,e._a[He]=0),e._d=(e._useUTC?xt:bt).apply(null,a),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[He]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(v(e).weekdayMismatch=!0)}}function Hn(e){var t,n,r,o,i,a,s,l,d;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,a=4,n=Fn(t.GG,e._a[Fe],Et(qn(),1,4).year),r=Fn(t.W,1),((o=Fn(t.E,1))<1||o>7)&&(l=!0)):(i=e._locale._week.dow,a=e._locale._week.doy,d=Et(qn(),i,a),n=Fn(t.gg,e._a[Fe],d.year),r=Fn(t.w,d.week),null!=t.d?((o=t.d)<0||o>6)&&(l=!0):null!=t.e?(o=t.e+i,(t.e<0||t.e>6)&&(l=!0)):o=i),r<1||r>St(n,i,a)?v(e)._overflowWeeks=!0:null!=l?v(e)._overflowWeekday=!0:(s=_t(n,r,o,i,a),e._a[Fe]=s.year,e._dayOfYear=s.dayOfYear)}function Bn(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],v(e).empty=!0;var t,n,o,i,a,s,l,d=""+e._i,c=d.length,u=0;for(l=(o=Y(e._f,e._locale).match(L)||[]).length,t=0;t<l;t++)i=o[t],(n=(d.match(Me(i,e))||[])[0])&&((a=d.substr(0,d.indexOf(n))).length>0&&v(e).unusedInput.push(a),d=d.slice(d.indexOf(n)+n.length),u+=n.length),U[i]?(n?v(e).empty=!1:v(e).unusedTokens.push(i),Re(i,n,e)):e._strict&&!n&&v(e).unusedTokens.push(i);v(e).charsLeftOver=c-u,d.length>0&&v(e).unusedInput.push(d),e._a[He]<=12&&!0===v(e).bigHour&&e._a[He]>0&&(v(e).bigHour=void 0),v(e).parsedDateParts=e._a.slice(0),v(e).meridiem=e._meridiem,e._a[He]=zn(e._locale,e._a[He],e._meridiem),null!==(s=v(e).era)&&(e._a[Fe]=e._locale.erasConvertYear(s,e._a[Fe])),Un(e),wn(e)}else Rn(e);else An(e)}function zn(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function Vn(e){var t,n,r,o,i,a,s=!1,l=e._f.length;if(0===l)return v(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;o<l;o++)i=0,a=!1,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[o],Bn(t),m(t)&&(a=!0),i+=v(t).charsLeftOver,i+=10*v(t).unusedTokens.length,v(t).score=i,s?i<r&&(r=i,n=t):(null==r||i<r||a)&&(r=i,n=t,a&&(s=!0));h(e,n||t)}function Yn(e){if(!e._d){var t=oe(e._i),n=void 0===t.day?t.date:t.day;e._a=f([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Un(e)}}function Wn(e){var t=new _(wn($n(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function $n(e){var t=e._i,n=e._f;return e._locale=e._locale||bn(e._l),null===t||void 0===n&&""===t?y({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),S(t)?new _(wn(t)):(u(t)?e._d=t:i(n)?Vn(e):n?Bn(e):Kn(e),m(e)||(e._d=null),e))}function Kn(e){var t=e._i;d(t)?e._d=new Date(r.now()):u(t)?e._d=new Date(t.valueOf()):"string"==typeof t?Ln(e):i(t)?(e._a=f(t.slice(0),function(e){return parseInt(e,10)}),Un(e)):a(t)?Yn(e):c(t)?e._d=new Date(t):r.createFromInputFallback(e)}function Xn(e,t,n,r,o){var s={};return!0!==t&&!1!==t||(r=t,t=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(a(e)&&l(e)||i(e)&&0===e.length)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=o,s._l=n,s._i=e,s._f=t,s._strict=r,Wn(s)}function qn(e,t,n,r){return Xn(e,t,n,r,!1)}r.createFromInputFallback=O("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),r.ISO_8601=function(){},r.RFC_2822=function(){};var Zn=O("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=qn.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:y()}),Jn=O("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=qn.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:y()});function Qn(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return qn();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}function er(){return Qn("isBefore",[].slice.call(arguments,0))}function tr(){return Qn("isAfter",[].slice.call(arguments,0))}var nr=function(){return Date.now?Date.now():+new Date},rr=["year","quarter","month","week","day","hour","minute","second","millisecond"];function or(e){var t,n,r=!1,o=rr.length;for(t in e)if(s(e,t)&&(-1===Ke.call(rr,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<o;++n)if(e[rr[n]]){if(r)return!1;parseFloat(e[rr[n]])!==Pe(e[rr[n]])&&(r=!0)}return!0}function ir(){return this._isValid}function ar(){return Nr(NaN)}function sr(e){var t=oe(e),n=t.year||0,r=t.quarter||0,o=t.month||0,i=t.week||t.isoWeek||0,a=t.day||0,s=t.hour||0,l=t.minute||0,d=t.second||0,c=t.millisecond||0;this._isValid=or(t),this._milliseconds=+c+1e3*d+6e4*l+1e3*s*60*60,this._days=+a+7*i,this._months=+o+3*r+12*n,this._data={},this._locale=bn(),this._bubble()}function lr(e){return e instanceof sr}function dr(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function cr(e,t,n){var r,o=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0;for(r=0;r<o;r++)(n&&e[r]!==t[r]||!n&&Pe(e[r])!==Pe(t[r]))&&a++;return a+i}function ur(e,t){H(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+R(~~(e/60),2)+t+R(~~e%60,2)})}ur("Z",":"),ur("ZZ",""),ke("Z",_e),ke("ZZ",_e),je(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=hr(_e,e)});var fr=/([\+\-]|\d\d)/gi;function hr(e,t){var n,r,o=(t||"").match(e);return null===o?null:0===(r=60*(n=((o[o.length-1]||[])+"").match(fr)||["-",0,0])[1]+Pe(n[2]))?0:"+"===n[0]?r:-r}function pr(e,t){var n,o;return t._isUTC?(n=t.clone(),o=(S(e)||u(e)?e.valueOf():qn(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+o),r.updateOffset(n,!1),n):qn(e).local()}function gr(e){return-Math.round(e._d.getTimezoneOffset())}function vr(e,t,n){var o,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=hr(_e,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(o=gr(this)),this._offset=e,this._isUTC=!0,null!=o&&this.add(o,"m"),i!==e&&(!t||this._changeInProgress?jr(this,Nr(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:gr(this)}function mr(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function yr(e){return this.utcOffset(0,e)}function br(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(gr(this),"m")),this}function xr(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=hr(we,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function wr(e){return!!this.isValid()&&(e=e?qn(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function _r(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Er(){if(!d(this._isDSTShifted))return this._isDSTShifted;var e,t={};return w(t,this),(t=$n(t))._a?(e=t._isUTC?p(t._a):qn(t._a),this._isDSTShifted=this.isValid()&&cr(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Sr(){return!!this.isValid()&&!this._isUTC}function Cr(){return!!this.isValid()&&this._isUTC}function Or(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var kr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Mr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Nr(e,t){var n,r,o,i=e,a=null;return lr(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(i={},t?i[t]=+e:i.milliseconds=+e):(a=kr.exec(e))?(n="-"===a[1]?-1:1,i={y:0,d:Pe(a[Ue])*n,h:Pe(a[He])*n,m:Pe(a[Be])*n,s:Pe(a[ze])*n,ms:Pe(dr(1e3*a[Ve]))*n}):(a=Mr.exec(e))?(n="-"===a[1]?-1:1,i={y:Ar(a[2],n),M:Ar(a[3],n),w:Ar(a[4],n),d:Ar(a[5],n),h:Ar(a[6],n),m:Ar(a[7],n),s:Ar(a[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(o=Pr(qn(i.from),qn(i.to)),(i={}).ms=o.milliseconds,i.M=o.months),r=new sr(i),lr(e)&&s(e,"_locale")&&(r._locale=e._locale),lr(e)&&s(e,"_isValid")&&(r._isValid=e._isValid),r}function Ar(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Tr(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Pr(e,t){var n;return e.isValid()&&t.isValid()?(t=pr(t,e),e.isBefore(t)?n=Tr(e,t):((n=Tr(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Dr(e,t){return function(n,r){var o;return null===r||isNaN(+r)||(N(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),jr(this,Nr(n,r),e),this}}function jr(e,t,n,o){var i=t._milliseconds,a=dr(t._days),s=dr(t._months);e.isValid()&&(o=null==o||o,s&&ht(e,Je(e,"Month")+s*n),a&&Qe(e,"Date",Je(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),o&&r.updateOffset(e,a||s))}Nr.fn=sr.prototype,Nr.invalid=ar;var Ir=Dr(1,"add"),Rr=Dr(-1,"subtract");function Lr(e){return"string"==typeof e||e instanceof String}function Fr(e){return S(e)||u(e)||Lr(e)||c(e)||Ur(e)||Gr(e)||null==e}function Gr(e){var t,n,r=a(e)&&!l(e),o=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],d=i.length;for(t=0;t<d;t+=1)n=i[t],o=o||s(e,n);return r&&o}function Ur(e){var t=i(e),n=!1;return t&&(n=0===e.filter(function(t){return!c(t)&&Lr(e)}).length),t&&n}function Hr(e){var t,n,r=a(e)&&!l(e),o=!1,i=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<i.length;t+=1)n=i[t],o=o||s(e,n);return r&&o}function Br(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function zr(e,t){1===arguments.length&&(arguments[0]?Fr(arguments[0])?(e=arguments[0],t=void 0):Hr(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||qn(),o=pr(n,this).startOf("day"),i=r.calendarFormat(this,o)||"sameElse",a=t&&(A(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,qn(n)))}function Vr(){return new _(this)}function Yr(e,t){var n=S(e)?e:qn(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function Wr(e,t){var n=S(e)?e:qn(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function $r(e,t,n,r){var o=S(e)?e:qn(e),i=S(t)?t:qn(t);return!!(this.isValid()&&o.isValid()&&i.isValid())&&("("===(r=r||"()")[0]?this.isAfter(o,n):!this.isBefore(o,n))&&(")"===r[1]?this.isBefore(i,n):!this.isAfter(i,n))}function Kr(e,t){var n,r=S(e)?e:qn(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function Xr(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function qr(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Zr(e,t,n){var r,o,i;if(!this.isValid())return NaN;if(!(r=pr(e,this)).isValid())return NaN;switch(o=6e4*(r.utcOffset()-this.utcOffset()),t=re(t)){case"year":i=Jr(this,r)/12;break;case"month":i=Jr(this,r);break;case"quarter":i=Jr(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-o)/864e5;break;case"week":i=(this-r-o)/6048e5;break;default:i=this-r}return n?i:Te(i)}function Jr(e,t){if(e.date()<t.date())return-Jr(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function Qr(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function eo(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?V(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(n,"Z")):V(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function to(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r,o="moment",i="";return this.isLocal()||(o=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+o+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=i+'[")]',this.format(e+t+n+r)}function no(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=V(this,e);return this.localeData().postformat(t)}function ro(e,t){return this.isValid()&&(S(e)&&e.isValid()||qn(e).isValid())?Nr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function oo(e){return this.from(qn(),e)}function io(e,t){return this.isValid()&&(S(e)&&e.isValid()||qn(e).isValid())?Nr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ao(e){return this.to(qn(),e)}function so(e){var t;return void 0===e?this._locale._abbr:(null!=(t=bn(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var lo=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function co(){return this._locale}var uo=1e3,fo=60*uo,ho=60*fo,po=3506328*ho;function go(e,t){return(e%t+t)%t}function vo(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-po:new Date(e,t,n).valueOf()}function mo(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-po:Date.UTC(e,t,n)}function yo(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?mo:vo,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=go(t+(this._isUTC?0:this.utcOffset()*fo),ho);break;case"minute":t=this._d.valueOf(),t-=go(t,fo);break;case"second":t=this._d.valueOf(),t-=go(t,uo)}return this._d.setTime(t),r.updateOffset(this,!0),this}function bo(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?mo:vo,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ho-go(t+(this._isUTC?0:this.utcOffset()*fo),ho)-1;break;case"minute":t=this._d.valueOf(),t+=fo-go(t,fo)-1;break;case"second":t=this._d.valueOf(),t+=uo-go(t,uo)-1}return this._d.setTime(t),r.updateOffset(this,!0),this}function xo(){return this._d.valueOf()-6e4*(this._offset||0)}function wo(){return Math.floor(this.valueOf()/1e3)}function _o(){return new Date(this.valueOf())}function Eo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function So(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Co(){return this.isValid()?this.toISOString():null}function Oo(){return m(this)}function ko(){return h({},v(this))}function Mo(){return v(this).overflow}function No(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ao(e,t){var n,o,i,a=this._eras||bn("en")._eras;for(n=0,o=a.length;n<o;++n)switch("string"==typeof a[n].since&&(i=r(a[n].since).startOf("day"),a[n].since=i.valueOf()),typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":i=r(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf()}return a}function To(e,t,n){var r,o,i,a,s,l=this.eras();for(e=e.toUpperCase(),r=0,o=l.length;r<o;++r)if(i=l[r].name.toUpperCase(),a=l[r].abbr.toUpperCase(),s=l[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return l[r];break;case"NNNN":if(i===e)return l[r];break;case"NNNNN":if(s===e)return l[r]}else if([i,a,s].indexOf(e)>=0)return l[r]}function Po(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n}function Do(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].name;if(r[e].until<=n&&n<=r[e].since)return r[e].name}return""}function jo(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].narrow;if(r[e].until<=n&&n<=r[e].since)return r[e].narrow}return""}function Io(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].abbr;if(r[e].until<=n&&n<=r[e].since)return r[e].abbr}return""}function Ro(){var e,t,n,o,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,o=this.clone().startOf("day").valueOf(),i[e].since<=o&&o<=i[e].until||i[e].until<=o&&o<=i[e].since)return(this.year()-r(i[e].since).year())*n+i[e].offset;return this.year()}function Lo(e){return s(this,"_erasNameRegex")||Vo.call(this),e?this._erasNameRegex:this._erasRegex}function Fo(e){return s(this,"_erasAbbrRegex")||Vo.call(this),e?this._erasAbbrRegex:this._erasRegex}function Go(e){return s(this,"_erasNarrowRegex")||Vo.call(this),e?this._erasNarrowRegex:this._erasRegex}function Uo(e,t){return t.erasAbbrRegex(e)}function Ho(e,t){return t.erasNameRegex(e)}function Bo(e,t){return t.erasNarrowRegex(e)}function zo(e,t){return t._eraYearOrdinalRegex||be}function Vo(){var e,t,n,r,o,i=[],a=[],s=[],l=[],d=this.eras();for(e=0,t=d.length;e<t;++e)n=Ae(d[e].name),r=Ae(d[e].abbr),o=Ae(d[e].narrow),a.push(n),i.push(r),s.push(o),l.push(n),l.push(r),l.push(o);this._erasRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+a.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+s.join("|")+")","i")}function Yo(e,t){H(0,[e,e.length],0,t)}function Wo(e){return Jo.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function $o(e){return Jo.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Ko(){return St(this.year(),1,4)}function Xo(){return St(this.isoWeekYear(),1,4)}function qo(){var e=this.localeData()._week;return St(this.year(),e.dow,e.doy)}function Zo(){var e=this.localeData()._week;return St(this.weekYear(),e.dow,e.doy)}function Jo(e,t,n,r,o){var i;return null==e?Et(this,r,o).year:(t>(i=St(e,r,o))&&(t=i),Qo.call(this,e,t,n,r,o))}function Qo(e,t,n,r,o){var i=_t(e,t,n,r,o),a=xt(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function ei(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),ke("N",Uo),ke("NN",Uo),ke("NNN",Uo),ke("NNNN",Ho),ke("NNNNN",Bo),je(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var o=n._locale.erasParse(e,r,n._strict);o?v(n).era=o:v(n).invalidEra=e}),ke("y",be),ke("yy",be),ke("yyy",be),ke("yyyy",be),ke("yo",zo),je(["y","yy","yyy","yyyy"],Fe),je(["yo"],function(e,t,n,r){var o;n._locale._eraYearOrdinalRegex&&(o=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Fe]=n._locale.eraYearOrdinalParse(e,o):t[Fe]=parseInt(e,10)}),H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Yo("gggg","weekYear"),Yo("ggggg","weekYear"),Yo("GGGG","isoWeekYear"),Yo("GGGGG","isoWeekYear"),ke("G",xe),ke("g",xe),ke("GG",he,de),ke("gg",he,de),ke("GGGG",me,ue),ke("gggg",me,ue),ke("GGGGG",ye,fe),ke("ggggg",ye,fe),Ie(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=Pe(e)}),Ie(["gg","GG"],function(e,t,n,o){t[o]=r.parseTwoDigitYear(e)}),H("Q",0,"Qo","quarter"),ke("Q",le),je("Q",function(e,t){t[Ge]=3*(Pe(e)-1)}),H("D",["DD",2],"Do","date"),ke("D",he,Ce),ke("DD",he,de),ke("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),je(["D","DD"],Ue),je("Do",function(e,t){t[Ue]=Pe(e.match(he)[0])});var ti=Ze("Date",!0);function ni(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}H("DDD",["DDDD",3],"DDDo","dayOfYear"),ke("DDD",ve),ke("DDDD",ce),je(["DDD","DDDD"],function(e,t,n){n._dayOfYear=Pe(e)}),H("m",["mm",2],0,"minute"),ke("m",he,Oe),ke("mm",he,de),je(["m","mm"],Be);var ri=Ze("Minutes",!1);H("s",["ss",2],0,"second"),ke("s",he,Oe),ke("ss",he,de),je(["s","ss"],ze);var oi,ii,ai=Ze("Seconds",!1);for(H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),ke("S",ve,le),ke("SS",ve,de),ke("SSS",ve,ce),oi="SSSS";oi.length<=9;oi+="S")ke(oi,be);function si(e,t){t[Ve]=Pe(1e3*("0."+e))}for(oi="S";oi.length<=9;oi+="S")je(oi,si);function li(){return this._isUTC?"UTC":""}function di(){return this._isUTC?"Coordinated Universal Time":""}ii=Ze("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var ci=_.prototype;function ui(e){return qn(1e3*e)}function fi(){return qn.apply(null,arguments).parseZone()}function hi(e){return e}ci.add=Ir,ci.calendar=zr,ci.clone=Vr,ci.diff=Zr,ci.endOf=bo,ci.format=no,ci.from=ro,ci.fromNow=oo,ci.to=io,ci.toNow=ao,ci.get=et,ci.invalidAt=Mo,ci.isAfter=Yr,ci.isBefore=Wr,ci.isBetween=$r,ci.isSame=Kr,ci.isSameOrAfter=Xr,ci.isSameOrBefore=qr,ci.isValid=Oo,ci.lang=lo,ci.locale=so,ci.localeData=co,ci.max=Jn,ci.min=Zn,ci.parsingFlags=ko,ci.set=tt,ci.startOf=yo,ci.subtract=Rr,ci.toArray=Eo,ci.toObject=So,ci.toDate=_o,ci.toISOString=eo,ci.inspect=to,"undefined"!=typeof Symbol&&null!=Symbol.for&&(ci[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ci.toJSON=Co,ci.toString=Qr,ci.unix=wo,ci.valueOf=xo,ci.creationData=No,ci.eraName=Do,ci.eraNarrow=jo,ci.eraAbbr=Io,ci.eraYear=Ro,ci.year=Xe,ci.isLeapYear=qe,ci.weekYear=Wo,ci.isoWeekYear=$o,ci.quarter=ci.quarters=ei,ci.month=pt,ci.daysInMonth=gt,ci.week=ci.weeks=Nt,ci.isoWeek=ci.isoWeeks=At,ci.weeksInYear=qo,ci.weeksInWeekYear=Zo,ci.isoWeeksInYear=Ko,ci.isoWeeksInISOWeekYear=Xo,ci.date=ti,ci.day=ci.days=Yt,ci.weekday=Wt,ci.isoWeekday=$t,ci.dayOfYear=ni,ci.hour=ci.hours=on,ci.minute=ci.minutes=ri,ci.second=ci.seconds=ai,ci.millisecond=ci.milliseconds=ii,ci.utcOffset=vr,ci.utc=yr,ci.local=br,ci.parseZone=xr,ci.hasAlignedHourOffset=wr,ci.isDST=_r,ci.isLocal=Sr,ci.isUtcOffset=Cr,ci.isUtc=Or,ci.isUTC=Or,ci.zoneAbbr=li,ci.zoneName=di,ci.dates=O("dates accessor is deprecated. Use date instead.",ti),ci.months=O("months accessor is deprecated. Use month instead",pt),ci.years=O("years accessor is deprecated. Use year instead",Xe),ci.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mr),ci.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Er);var pi=D.prototype;function gi(e,t,n,r){var o=bn(),i=p().set(r,t);return o[n](i,e)}function vi(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return gi(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=gi(e,r,n,"month");return o}function mi(e,t,n,r){"boolean"==typeof e?(c(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,c(t)&&(n=t,t=void 0),t=t||"");var o,i=bn(),a=e?i._week.dow:0,s=[];if(null!=n)return gi(t,(n+a)%7,r,"day");for(o=0;o<7;o++)s[o]=gi(t,(o+a)%7,r,"day");return s}function yi(e,t){return vi(e,t,"months")}function bi(e,t){return vi(e,t,"monthsShort")}function xi(e,t,n){return mi(e,t,n,"weekdays")}function wi(e,t,n){return mi(e,t,n,"weekdaysShort")}function _i(e,t,n){return mi(e,t,n,"weekdaysMin")}pi.calendar=I,pi.longDateFormat=$,pi.invalidDate=X,pi.ordinal=J,pi.preparse=hi,pi.postformat=hi,pi.relativeTime=ee,pi.pastFuture=te,pi.set=T,pi.eras=Ao,pi.erasParse=To,pi.erasConvertYear=Po,pi.erasAbbrRegex=Fo,pi.erasNameRegex=Lo,pi.erasNarrowRegex=Go,pi.months=dt,pi.monthsShort=ct,pi.monthsParse=ft,pi.monthsRegex=mt,pi.monthsShortRegex=vt,pi.week=Ct,pi.firstDayOfYear=Mt,pi.firstDayOfWeek=kt,pi.weekdays=Ut,pi.weekdaysMin=Bt,pi.weekdaysShort=Ht,pi.weekdaysParse=Vt,pi.weekdaysRegex=Kt,pi.weekdaysShortRegex=Xt,pi.weekdaysMinRegex=qt,pi.isPM=nn,pi.meridiem=an,vn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Pe(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=O("moment.lang is deprecated. Use moment.locale instead.",vn),r.langData=O("moment.langData is deprecated. Use moment.localeData instead.",bn);var Ei=Math.abs;function Si(){var e=this._data;return this._milliseconds=Ei(this._milliseconds),this._days=Ei(this._days),this._months=Ei(this._months),e.milliseconds=Ei(e.milliseconds),e.seconds=Ei(e.seconds),e.minutes=Ei(e.minutes),e.hours=Ei(e.hours),e.months=Ei(e.months),e.years=Ei(e.years),this}function Ci(e,t,n,r){var o=Nr(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function Oi(e,t){return Ci(this,e,t,1)}function ki(e,t){return Ci(this,e,t,-1)}function Mi(e){return e<0?Math.floor(e):Math.ceil(e)}function Ni(){var e,t,n,r,o,i=this._milliseconds,a=this._days,s=this._months,l=this._data;return i>=0&&a>=0&&s>=0||i<=0&&a<=0&&s<=0||(i+=864e5*Mi(Ti(s)+a),a=0,s=0),l.milliseconds=i%1e3,e=Te(i/1e3),l.seconds=e%60,t=Te(e/60),l.minutes=t%60,n=Te(t/60),l.hours=n%24,a+=Te(n/24),s+=o=Te(Ai(a)),a-=Mi(Ti(o)),r=Te(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function Ai(e){return 4800*e/146097}function Ti(e){return 146097*e/4800}function Pi(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=re(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Ai(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Ti(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function Di(e){return function(){return this.as(e)}}var ji=Di("ms"),Ii=Di("s"),Ri=Di("m"),Li=Di("h"),Fi=Di("d"),Gi=Di("w"),Ui=Di("M"),Hi=Di("Q"),Bi=Di("y"),zi=ji;function Vi(){return Nr(this)}function Yi(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function Wi(e){return function(){return this.isValid()?this._data[e]:NaN}}var $i=Wi("milliseconds"),Ki=Wi("seconds"),Xi=Wi("minutes"),qi=Wi("hours"),Zi=Wi("days"),Ji=Wi("months"),Qi=Wi("years");function ea(){return Te(this.days()/7)}var ta=Math.round,na={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ra(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}function oa(e,t,n,r){var o=Nr(e).abs(),i=ta(o.as("s")),a=ta(o.as("m")),s=ta(o.as("h")),l=ta(o.as("d")),d=ta(o.as("M")),c=ta(o.as("w")),u=ta(o.as("y")),f=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||a<=1&&["m"]||a<n.m&&["mm",a]||s<=1&&["h"]||s<n.h&&["hh",s]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(f=f||c<=1&&["w"]||c<n.w&&["ww",c]),(f=f||d<=1&&["M"]||d<n.M&&["MM",d]||u<=1&&["y"]||["yy",u])[2]=t,f[3]=+e>0,f[4]=r,ra.apply(null,f)}function ia(e){return void 0===e?ta:"function"==typeof e&&(ta=e,!0)}function aa(e,t){return void 0!==na[e]&&(void 0===t?na[e]:(na[e]=t,"s"===e&&(na.ss=t-1),!0))}function sa(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,o=!1,i=na;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(o=e),"object"==typeof t&&(i=Object.assign({},na,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),r=oa(this,!o,i,n=this.localeData()),o&&(r=n.pastFuture(+this,r)),n.postformat(r)}var la=Math.abs;function da(e){return(e>0)-(e<0)||+e}function ca(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,o,i,a,s,l=la(this._milliseconds)/1e3,d=la(this._days),c=la(this._months),u=this.asSeconds();return u?(e=Te(l/60),t=Te(e/60),l%=60,e%=60,n=Te(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",o=u<0?"-":"",i=da(this._months)!==da(u)?"-":"",a=da(this._days)!==da(u)?"-":"",s=da(this._milliseconds)!==da(u)?"-":"",o+"P"+(n?i+n+"Y":"")+(c?i+c+"M":"")+(d?a+d+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+r+"S":"")):"P0D"}var ua=sr.prototype;return ua.isValid=ir,ua.abs=Si,ua.add=Oi,ua.subtract=ki,ua.as=Pi,ua.asMilliseconds=ji,ua.asSeconds=Ii,ua.asMinutes=Ri,ua.asHours=Li,ua.asDays=Fi,ua.asWeeks=Gi,ua.asMonths=Ui,ua.asQuarters=Hi,ua.asYears=Bi,ua.valueOf=zi,ua._bubble=Ni,ua.clone=Vi,ua.get=Yi,ua.milliseconds=$i,ua.seconds=Ki,ua.minutes=Xi,ua.hours=qi,ua.days=Zi,ua.weeks=ea,ua.months=Ji,ua.years=Qi,ua.humanize=sa,ua.toISOString=ca,ua.toString=ca,ua.toJSON=ca,ua.locale=so,ua.localeData=co,ua.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ca),ua.lang=lo,H("X",0,0,"unix"),H("x",0,0,"valueOf"),ke("x",xe),ke("X",Ee),je("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),je("x",function(e,t,n){n._d=new Date(Pe(e))}),
34
+ */!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,r(n)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var r="";for(var i in e)t.call(e,i)&&e[i]&&(r=o(r,i));return r}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(yr);var br,xr=yr.exports;let wr;var _r,Er;!function(e){function t(e){return{dispose:e}}e.is=function(e){return!!e&&"object"==typeof e&&"dispose"in e&&"function"==typeof e.dispose},e.create=t,e.NONE=t(()=>{})}(br||(br={})),function(e){e.None=()=>br.NONE,e.map=function(e,t){return(n,r)=>e(e=>n.call(r,t(e)),void 0)}}(_r||(_r={})),wr=Symbol.iterator;class Sr{constructor(e=!1){this.mono=void 0,this._callbacks=void 0,this.mono=e}get callbacks(){return this._callbacks||(this._callbacks=[]),this._callbacks}get length(){return this.callbacks.length}add(e,t=void 0){this.callbacks.push([e,t])}remove(e,t=void 0){if(this.isEmpty())return;let n=!1;for(let r=0;r<this.length;r+=1)if(this.callbacks[r][0]===e){if(this.callbacks[r][1]===t)return void this.callbacks.splice(r,1);n=!0}if(n)throw new Error("You should remove it with the same context you add it")}[wr](){if(this.isEmpty())return[][Symbol.iterator]();return this.callbacks.slice(0).map(e=>(...t)=>e[0].apply(e[1],t))[Symbol.iterator]()}invoke(...e){const t=[];for(const n of this)try{t.push(n(...e))}catch(e){console.error(e)}return t}isEmpty(){return 0===this.callbacks.length}dispose(){this._callbacks=void 0}}class Cr{constructor(e={}){this.options=void 0,this._event=void 0,this._callbacks=void 0,this.disposed=!1,this.options=e}get callbacks(){return this._callbacks||(this._callbacks=new Sr),this._callbacks}get event(){return this._event||(this._event=(e,t)=>{this.options.onFirstListenerAdd&&this.callbacks.isEmpty()&&this.options.onFirstListenerAdd(this),this.callbacks.add(e,t);const n={dispose:()=>{n.dispose=Cr.noop,this.disposed||(this.callbacks.remove(e,t),n.dispose=Cr.noop,this.options.onLastListenerRemove&&this.callbacks.isEmpty()&&this.options.onLastListenerRemove(this))}};return n}),this._event}fire(e){this._callbacks&&this.callbacks.invoke(e)}async sequence(e){for(const t of this.callbacks){if(!await e(t))break}}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0),this.disposed=!0}}Cr.noop=()=>{},function(e){function t(e){return{dispose:e}}e.is=function(e){return!!e&&"object"==typeof e&&"dispose"in e&&"function"==typeof e.dispose},e.create=t,e.NULL=t(()=>{})}(Er||(Er={}));class Or{constructor(...e){this.disposables=[],this.onDisposeEmitter=new Cr,this.disposingElements=!1,e.forEach(e=>this.push(e))}get onDispose(){return this.onDisposeEmitter.event}checkDisposed(){this.disposed&&!this.disposingElements&&(this.onDisposeEmitter.fire(void 0),this.onDisposeEmitter.dispose())}get disposed(){return 0===this.disposables.length}dispose(){return x(this,void 0,void 0,function*(){if(!this.disposed&&!this.disposingElements){for(this.disposingElements=!0;!this.disposed;)try{const e=this.disposables.pop();yield e.dispose()}catch(e){console.error(e)}this.disposingElements=!1,this.checkDisposed()}})}push(e){const{disposables:t}=this;t.push(e);const n=e.dispose.bind(e),r=Er.create(()=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1),this.checkDisposed()});return e.dispose=()=>{r.dispose(),n()},r}pushAll(e){return e.map(e=>this.push(e))}}class kr{constructor(){this.isResolved=!1,this.isRejected=!1,this.promise=new Promise((e,t)=>{this.resolve=(...t)=>{this.isResolved=!0,e(...t)},this.reject=(...e)=>{this.isRejected=!0,t(...e)}})}}const Mr="X6_NODE_PORTAL_NODE_VIEW",Nr="XFLOW_DEFAULT_NODE",Ar="XFLOW_DEFAULT_EDGE",Tr="XFLOW_COPY_ITEMS",Pr={width:180,height:36};function Dr(){const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)});return"uuidv4_"+e.replace(/-/g,"_")}var jr=t.createContext({});function Ir(e){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ir(e)}function Rr(e){var t=function(e,t){if("object"!=Ir(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ir(t)?t:t+""}function Lr(e,t,n){return(t=Rr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fr(Object(n),!0).forEach(function(t){Lr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Hr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,d=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){d=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(d)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ur(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)?Ur(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Br(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function zr(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function Vr(e){return e<=1?"".concat(100*Number(e),"%"):e}function Yr(e){return 1===e.length?"0"+e:String(e)}function Wr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function $r(e){return Kr(e)/255}function Kr(e){return parseInt(e,16)}var Xr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function qr(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,i=null,a=!1,s=!1;return"string"==typeof e&&(e=function(e){if(e=e.trim().toLowerCase(),0===e.length)return!1;var t=!1;if(Xr[e])e=Xr[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=eo.rgb.exec(e);if(n)return{r:n[1],g:n[2],b:n[3]};if(n=eo.rgba.exec(e),n)return{r:n[1],g:n[2],b:n[3],a:n[4]};if(n=eo.hsl.exec(e),n)return{h:n[1],s:n[2],l:n[3]};if(n=eo.hsla.exec(e),n)return{h:n[1],s:n[2],l:n[3],a:n[4]};if(n=eo.hsv.exec(e),n)return{h:n[1],s:n[2],v:n[3]};if(n=eo.hsva.exec(e),n)return{h:n[1],s:n[2],v:n[3],a:n[4]};if(n=eo.hex8.exec(e),n)return{r:Kr(n[1]),g:Kr(n[2]),b:Kr(n[3]),a:$r(n[4]),format:t?"name":"hex8"};if(n=eo.hex6.exec(e),n)return{r:Kr(n[1]),g:Kr(n[2]),b:Kr(n[3]),format:t?"name":"hex"};if(n=eo.hex4.exec(e),n)return{r:Kr(n[1]+n[1]),g:Kr(n[2]+n[2]),b:Kr(n[3]+n[3]),a:$r(n[4]+n[4]),format:t?"name":"hex8"};if(n=eo.hex3.exec(e),n)return{r:Kr(n[1]+n[1]),g:Kr(n[2]+n[2]),b:Kr(n[3]+n[3]),format:t?"name":"hex"};return!1}(e)),"object"==typeof e&&(to(e.r)&&to(e.g)&&to(e.b)?(t=function(e,t,n){return{r:255*zr(e,255),g:255*zr(t,255),b:255*zr(n,255)}}(e.r,e.g,e.b),a=!0,s="%"===String(e.r).substr(-1)?"prgb":"rgb"):to(e.h)&&to(e.s)&&to(e.v)?(r=Vr(e.s),o=Vr(e.v),t=function(e,t,n){e=6*zr(e,360),t=zr(t,100),n=zr(n,100);var r=Math.floor(e),o=e-r,i=n*(1-t),a=n*(1-o*t),s=n*(1-(1-o)*t),l=r%6;return{r:255*[n,a,i,i,s,n][l],g:255*[s,n,n,a,i,i][l],b:255*[i,i,s,n,n,a][l]}}(e.h,r,o),a=!0,s="hsv"):to(e.h)&&to(e.s)&&to(e.l)&&(r=Vr(e.s),i=Vr(e.l),t=function(e,t,n){var r,o,i;if(e=zr(e,360),t=zr(t,100),n=zr(n,100),0===t)o=n,i=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Wr(s,a,e+1/3),o=Wr(s,a,e),i=Wr(s,a,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,r,i),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Zr="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),Jr="[\\s|\\(]+(".concat(Zr,")[,|\\s]+(").concat(Zr,")[,|\\s]+(").concat(Zr,")\\s*\\)?"),Qr="[\\s|\\(]+(".concat(Zr,")[,|\\s]+(").concat(Zr,")[,|\\s]+(").concat(Zr,")[,|\\s]+(").concat(Zr,")\\s*\\)?"),eo={CSS_UNIT:new RegExp(Zr),rgb:new RegExp("rgb"+Jr),rgba:new RegExp("rgba"+Qr),hsl:new RegExp("hsl"+Jr),hsla:new RegExp("hsla"+Qr),hsv:new RegExp("hsv"+Jr),hsva:new RegExp("hsva"+Qr),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function to(e){return Boolean(eo.CSS_UNIT.exec(String(e)))}var no=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function ro(e){var t=function(e,t,n){e=zr(e,255),t=zr(t,255),n=zr(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=r,s=r-o,l=0===r?0:s/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/s+(t<n?6:0);break;case t:i=(n-e)/s+2;break;case n:i=(e-t)/s+4}i/=6}return{h:i,s:l,v:a}}(e.r,e.g,e.b);return{h:360*t.h,s:t.s,v:t.v}}function oo(e){var t=e.r,n=e.g,r=e.b;return"#".concat(function(e,t,n,r){var o=[Yr(Math.round(e).toString(16)),Yr(Math.round(t).toString(16)),Yr(Math.round(n).toString(16))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}(t,n,r,!1))}function io(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function ao(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function so(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function lo(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=qr(e),o=5;o>0;o-=1){var i=ro(r),a=oo(qr({h:io(i,o,!0),s:ao(i,o,!0),v:so(i,o,!0)}));n.push(a)}n.push(oo(r));for(var s=1;s<=4;s+=1){var l=ro(r),d=oo(qr({h:io(l,s),s:ao(l,s),v:so(l,s)}));n.push(d)}return"dark"===t.theme?no.map(function(e){var r=e.index,o=e.opacity,i=oo(function(e,t,n){var r=n/100;return{r:(t.r-e.r)*r+e.r,g:(t.g-e.g)*r+e.g,b:(t.b-e.b)*r+e.b}}(qr(t.backgroundColor||"#141414"),qr(n[r]),100*o));return i}):n}var co={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},uo={},fo={};Object.keys(co).forEach(function(e){uo[e]=lo(co[e]),uo[e].primary=uo[e][5],fo[e]=lo(co[e],{theme:"dark",backgroundColor:"#141414"}),fo[e].primary=fo[e][5]});var ho={};function po(e,t){}function go(e,t){}function vo(e,t,n){t||ho[n]||(e(!1,n),ho[n]=!0)}function mo(e,t){vo(po,e,t)}mo.preMessage=function(e){},mo.resetWarned=function(){ho={}},mo.noteOnce=function(e,t){vo(go,e,t)};var yo="data-rc-order",bo="data-rc-priority",xo=new Map;function wo(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mark;return e?e.startsWith("data-")?e:"data-".concat(e):"rc-util-key"}function _o(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Eo(e){return Array.from((xo.get(e)||e).children).filter(function(e){return"STYLE"===e.tagName})}function So(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"==typeof window||!window.document||!window.document.createElement)return null;var n=t.csp,r=t.prepend,o=t.priority,i=void 0===o?0:o,a=function(e){return"queue"===e?"prependQueue":e?"prepend":"append"}(r),s="prependQueue"===a,l=document.createElement("style");l.setAttribute(yo,a),s&&i&&l.setAttribute(bo,"".concat(i)),null!=n&&n.nonce&&(l.nonce=null==n?void 0:n.nonce),l.innerHTML=e;var d=_o(t),c=d.firstChild;if(r){if(s){var u=(t.styles||Eo(d)).filter(function(e){if(!["prepend","prependQueue"].includes(e.getAttribute(yo)))return!1;var t=Number(e.getAttribute(bo)||0);return i>=t});if(u.length)return d.insertBefore(l,u[u.length-1].nextSibling),l}d.insertBefore(l,c)}else d.appendChild(l);return l}function Co(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=_o(n),o=Eo(r),i=Gr(Gr({},n),{},{styles:o});!function(e,t){var n=xo.get(e);if(!n||!function(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}(document,n)){var r=So("",t),o=r.parentNode;xo.set(e,o),e.removeChild(r)}}(r,i);var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=_o(t);return(t.styles||Eo(n)).find(function(n){return n.getAttribute(wo(t))===e})}(t,i);if(a){var s,l,d;if(null!==(s=i.csp)&&void 0!==s&&s.nonce&&a.nonce!==(null===(l=i.csp)||void 0===l?void 0:l.nonce))a.nonce=null===(d=i.csp)||void 0===d?void 0:d.nonce;return a.innerHTML!==e&&(a.innerHTML=e),a}var c=So(e,i);return c.setAttribute(wo(i),t),c}var Oo="object"==typeof _&&_&&_.Object===Object&&_,ko=Oo,Mo="object"==typeof self&&self&&self.Object===Object&&self,No=ko||Mo||Function("return this")(),Ao=No.Symbol;var To=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o},Po=Array.isArray,Do=Ao,jo=Object.prototype,Io=jo.hasOwnProperty,Ro=jo.toString,Lo=Do?Do.toStringTag:void 0;var Fo=function(e){var t=Io.call(e,Lo),n=e[Lo];try{e[Lo]=void 0;var r=!0}catch(e){}var o=Ro.call(e);return r&&(t?e[Lo]=n:delete e[Lo]),o},Go=Object.prototype.toString;var Uo=Fo,Ho=function(e){return Go.call(e)},Bo=Ao?Ao.toStringTag:void 0;var zo=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Bo&&Bo in Object(e)?Uo(e):Ho(e)};var Vo=function(e){return null!=e&&"object"==typeof e},Yo=zo,Wo=Vo;var $o=function(e){return"symbol"==typeof e||Wo(e)&&"[object Symbol]"==Yo(e)},Ko=To,Xo=Po,qo=$o,Zo=Ao?Ao.prototype:void 0,Jo=Zo?Zo.toString:void 0;var Qo=function e(t){if("string"==typeof t)return t;if(Xo(t))return Ko(t,e)+"";if(qo(t))return Jo?Jo.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},ei=Qo;var ti=function(e){return null==e?"":ei(e)};var ni=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i};var ri=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:ni(e,t,n)},oi=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var ii=function(e){return oi.test(e)};var ai=function(e){return e.split("")},si="\\ud800-\\udfff",li="["+si+"]",di="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ci="\\ud83c[\\udffb-\\udfff]",ui="[^"+si+"]",fi="(?:\\ud83c[\\udde6-\\uddff]){2}",hi="[\\ud800-\\udbff][\\udc00-\\udfff]",pi="(?:"+di+"|"+ci+")"+"?",gi="[\\ufe0e\\ufe0f]?",vi=gi+pi+("(?:\\u200d(?:"+[ui,fi,hi].join("|")+")"+gi+pi+")*"),mi="(?:"+[ui+di+"?",di,fi,hi,li].join("|")+")",yi=RegExp(ci+"(?="+ci+")|"+mi+vi,"g");var bi=ai,xi=ii,wi=function(e){return e.match(yi)||[]};var _i=ri,Ei=ii,Si=function(e){return xi(e)?wi(e):bi(e)},Ci=ti;var Oi=function(e){return function(t){t=Ci(t);var n=Ei(t)?Si(t):void 0,r=n?n[0]:t.charAt(0),o=n?_i(n,1).join(""):t.slice(1);return r[e]()+o}}("toUpperCase"),ki=ti,Mi=Oi;var Ni=function(e){return Mi(ki(e).toLowerCase())};var Ai=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n};var Ti=function(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Pi=ti,Di=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ji=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Ii=function(e){return(e=Pi(e))&&e.replace(Di,Ti).replace(ji,"")},Ri=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Li=function(e){return e.match(Ri)||[]},Fi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Gi=function(e){return Fi.test(e)},Ui="\\ud800-\\udfff",Hi="\\u2700-\\u27bf",Bi="a-z\\xdf-\\xf6\\xf8-\\xff",zi="A-Z\\xc0-\\xd6\\xd8-\\xde",Vi="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Yi="["+Vi+"]",Wi="\\d+",$i="["+Hi+"]",Ki="["+Bi+"]",Xi="[^"+Ui+Vi+Wi+Hi+Bi+zi+"]",qi="(?:\\ud83c[\\udde6-\\uddff]){2}",Zi="[\\ud800-\\udbff][\\udc00-\\udfff]",Ji="["+zi+"]",Qi="(?:"+Ki+"|"+Xi+")",ea="(?:"+Ji+"|"+Xi+")",ta="(?:['’](?:d|ll|m|re|s|t|ve))?",na="(?:['’](?:D|LL|M|RE|S|T|VE))?",ra="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",oa="[\\ufe0e\\ufe0f]?",ia=oa+ra+("(?:\\u200d(?:"+["[^"+Ui+"]",qi,Zi].join("|")+")"+oa+ra+")*"),aa="(?:"+[$i,qi,Zi].join("|")+")"+ia,sa=RegExp([Ji+"?"+Ki+"+"+ta+"(?="+[Yi,Ji,"$"].join("|")+")",ea+"+"+na+"(?="+[Yi,Ji+Qi,"$"].join("|")+")",Ji+"?"+Qi+"+"+ta,Ji+"+"+na,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Wi,aa].join("|"),"g");var la=Li,da=Gi,ca=ti,ua=function(e){return e.match(sa)||[]};var fa=Ai,ha=Ii,pa=function(e,t,n){return e=ca(e),void 0===(t=n?void 0:t)?da(e)?ua(e):la(e):e.match(t)||[]},ga=RegExp("['’]","g");var va=Ni,ma=function(e){return function(t){return fa(pa(ha(t).replace(ga,"")),e,"")}}(function(e,t,n){return t=t.toLowerCase(),e+(n?va(t):t)});function ya(e){return"object"===Ir(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===Ir(e.icon)||"function"==typeof e.icon)}function ba(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];if("class"===n)t.className=r,delete t.class;else delete t[n],t[ma(n)]=r;return t},{})}function xa(e,t,n){return n?u.default.createElement(e.tag,Gr(Gr({key:t},ba(e.attrs)),n),(e.children||[]).map(function(n,r){return xa(n,"".concat(t,"-").concat(e.tag,"-").concat(r))})):u.default.createElement(e.tag,Gr({key:t},ba(e.attrs)),(e.children||[]).map(function(n,r){return xa(n,"".concat(t,"-").concat(e.tag,"-").concat(r))}))}function wa(e){return lo(e)[0]}function _a(e){return e?Array.isArray(e)?e:[e]:[]}var Ea=["icon","className","onClick","style","primaryColor","secondaryColor"],Sa={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var Ca=function(e){var n,r,o=e.icon,i=e.className,a=e.onClick,s=e.style,l=e.primaryColor,d=e.secondaryColor,c=Br(e,Ea),u=Sa;if(l&&(u={primaryColor:l,secondaryColor:d||wa(l)}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"\n.anticon {\n display: inline-flex;\n alignItems: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",n=t.useContext(jr).csp;t.useEffect(function(){Co(e,"@ant-design-icons",{prepend:!0,csp:n})},[])}(),n=ya(o),r="icon should be icon definiton, but got ".concat(o),mo(n,"[@ant-design/icons] ".concat(r)),!ya(o))return null;var f=o;return f&&"function"==typeof f.icon&&(f=Gr(Gr({},f),{},{icon:f.icon(u.primaryColor,u.secondaryColor)})),xa(f.icon,"svg-".concat(f.name),Gr({className:i,onClick:a,style:s,"data-icon":f.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},c))};Ca.displayName="IconReact",Ca.getTwoToneColors=function(){return Gr({},Sa)},Ca.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;Sa.primaryColor=t,Sa.secondaryColor=n||wa(t),Sa.calculated=!!n};var Oa=Ca;function ka(e){var t=Hr(_a(e),2),n=t[0],r=t[1];return Oa.setTwoToneColors({primaryColor:n,secondaryColor:r})}var Ma=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];ka("#1890ff");var Na=f.forwardRef(function(e,t){var n=e.className,r=e.icon,o=e.spin,i=e.rotate,a=e.tabIndex,s=e.onClick,l=e.twoToneColor,d=Br(e,Ma),c=f.useContext(jr),u=c.prefixCls,h=void 0===u?"anticon":u,p=c.rootClassName,g=xr(p,h,Lr(Lr({},"".concat(h,"-").concat(r.name),!!r.name),"".concat(h,"-spin"),!!o||"loading"===r.name),n),v=a;void 0===v&&s&&(v=-1);var m=i?{msTransform:"rotate(".concat(i,"deg)"),transform:"rotate(".concat(i,"deg)")}:void 0,y=Hr(_a(l),2),b=y[0],x=y[1];return f.createElement("span",Gr(Gr({role:"img","aria-label":r.name},d),{},{ref:t,tabIndex:v,onClick:s,className:g}),f.createElement(Oa,{icon:r,primaryColor:b,secondaryColor:x,style:m}))});Na.displayName="AntdIcon",Na.getTwoToneColor=function(){var e=Oa.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},Na.setTwoToneColor=ka;var Aa=Na,Ta={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M689 165.1L308.2 493.5c-10.9 9.4-10.9 27.5 0 37L689 858.9c14.2 12.2 35 1.2 35-18.5V183.6c0-19.7-20.8-30.7-35-18.5z"}}]},name:"caret-left",theme:"outlined"},Pa=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ta}))},Da=f.forwardRef(Pa),ja={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"},Ia=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:ja}))},Ra=f.forwardRef(Ia),La={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},Fa=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:La}))},Ga=f.forwardRef(Fa),Ua={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"},Ha=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ua}))},Ba=f.forwardRef(Ha),za={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},Va=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:za}))},Ya=f.forwardRef(Va),Wa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M326 664H104c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h174v176c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V696c0-17.7-14.3-32-32-32zm16-576h-48c-8.8 0-16 7.2-16 16v176H104c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h222c17.7 0 32-14.3 32-32V104c0-8.8-7.2-16-16-16zm578 576H698c-17.7 0-32 14.3-32 32v224c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V744h174c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16zm0-384H746V104c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16v224c0 17.7 14.3 32 32 32h222c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16z"}}]},name:"compress",theme:"outlined"},$a=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Wa}))},Ka=f.forwardRef($a),Xa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},qa=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Xa}))},Za=f.forwardRef(qa),Ja={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},Qa=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ja}))},es=f.forwardRef(Qa),ts={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},ns=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:ts}))},rs=f.forwardRef(ns),os={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},is=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:os}))},as=f.forwardRef(is),ss={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},ls=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:ss}))},ds=f.forwardRef(ls),cs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},us=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:cs}))},fs=f.forwardRef(us),hs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32z"}}]},name:"folder",theme:"filled"},ps=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:hs}))},gs=f.forwardRef(ps),vs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zm-180 0H238c-13 0-24.8 7.9-29.7 20L136 643.2V256h188.5l119.6 114.4H748V444z"}}]},name:"folder-open",theme:"filled"},ms=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:vs}))},ys=f.forwardRef(ms),bs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"},xs=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:bs}))},ws=f.forwardRef(xs),_s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"},Es=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:_s}))},Ss=f.forwardRef(Es),Cs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},Os=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Cs}))},ks=f.forwardRef(Os),Ms={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M316 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8zm196-50c22.1 0 40-17.9 40-39 0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39zm0-140c22.1 0 40-17.9 40-39 0-23.1-17.9-41-40-41s-40 17.9-40 41c0 21.1 17.9 39 40 39z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}},{tag:"path",attrs:{d:"M648 672h60c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8z"}}]},name:"one-to-one",theme:"outlined"},Ns=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ms}))},As=f.forwardRef(Ns),Ts={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},Ps=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ts}))},Ds=f.forwardRef(Ps),js={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},Is=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:js}))},Rs=f.forwardRef(Is),Ls={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"},Fs=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ls}))},Gs=f.forwardRef(Fs),Us={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},Hs=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Us}))},Bs=f.forwardRef(Hs),zs={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-in",theme:"outlined"},Vs=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:zs}))},Ys=f.forwardRef(Vs),Ws={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-out",theme:"outlined"},$s=function(e,t){return f.createElement(Aa,Gr(Gr({},e),{},{ref:t,icon:Ws}))},Ks=f.forwardRef($s);const Xs=u.default.createContext(null);Xs.displayName="XFlowAppContext";const qs=()=>{const e=u.default.useContext(Xs);return e&&e.getApp?e.getApp():null};var Zs,Js,Qs,el,tl;!function(e){const t="节点操作";e.ADD_NODE={id:"xflow:add-node",label:"添加节点",category:t},e.DEL_NODE={id:"xflow:del-node",label:"删除节点",category:t},e.UPDATE_NODE_PORT={id:"xflow:update-node-port",label:"删除连接桩",category:t},e.UPDATE_NODE={id:"xflow:update-node",label:"更新节点",category:t},e.HIGHLIGHT_NODE={id:"xflow:highlight-node",label:"高亮节点",category:t},e.SELECT_NODE={id:"xflow:select-node",label:"选中节点",category:t},e.MOVE_NODE={id:"xflow:move-node",label:"Move Node",category:t},e.CENTER_NODE={id:"xflow:center-node",label:"居中节点",category:t},e.FRONT_NODE={id:"xflow:front-node",label:"前置节点",category:t},e.BACK_NODE={id:"xflow:back-node",label:"后置节点",category:t}}(Zs||(Zs={})),function(e){const t="边操作";e.ADD_EDGE={id:"xflow:add-edge",label:"添加边",category:t},e.DEL_EDGE={id:"xflow:del-edge",label:"删除边",category:t},e.UPDATE_EDGE={id:"xflow:update-edge",label:"更新边",category:t},e.HIGHLIGHT_EDGE={id:"xflow:highlight-edge",label:"高亮边",category:t},e.FRONT_EDGE={id:"xflow:front-edge",label:"前置变",category:t},e.BACK_EDGE={id:"xflow:back-edge",label:"后置边",category:t}}(Js||(Js={})),function(e){const t="画布操作";e.LOAD_META={id:"xflow:load-meta",label:"获取元数据",category:t},e.LOAD_DATA={id:"xflow:load-data",label:"获取图数据",category:t},e.SAVE_GRAPH_DATA={id:"xflow:save-graph-data",label:"保存",category:t},e.GRAPH_LAYOUT={id:"xflow:layout",label:"计算布局",category:t},e.GRAPH_RENDER={id:"xflow:graph-render",label:"渲染画布",category:t},e.UNDO_CMD={id:"xflow:undo-cmd",label:"撤销",category:t},e.REDO_CMD={id:"xflow:redo-cmd",label:"重做",category:t},e.GRAPH_INSTANCE_COMMAND={id:"xflow:graph-instacne-cmd",label:"Graph通用Command",category:t},e.GRAPH_ZOOM={id:"xflow:graph-zoom",label:"缩放画布",category:t},e.GRAPH_FULLSCREEN={id:"xflow:graph-fullscreen",label:"全屏",category:t},e.GRAPH_RESIZE={id:"xflow:graph-resize",label:"调整窗口大小",category:t},e.GRAPH_COPY={id:"xflow:graph-copy-selection",label:"复制",category:t},e.GRAPH_PASTE={id:"xflow:graph-paste-selection",label:"粘贴",category:t},e.GRAPH_TOGGLE_MULTI_SELECT={id:"xflow:graph-toggle-multi-select",label:"启用框选",category:t},e.GRAPH_ADD_TOOL={id:"xflow:add-tool",label:"添加工具",category:t},e.GRAPH_DEL_TOOL={id:"xflow:del-tool",label:"删除工具",category:t},e.GRAPH_HISTORY_UNDO={id:"xflow:history-undo",label:"history undo",category:t},e.GRAPH_HISTORY_REDO={id:"xflow:history-redo",label:"history redo",category:t},e.GRAPH_HISTORY_RESET={id:"xflow:history-reset",label:"history reset",category:t},e.GRAPH_HISTORY_TOGGLE={id:"xflow:history-toggle",label:"history toggle",category:t}}(Qs||(Qs={})),function(e){e.UPDATE_MODEL={id:"xflow:update-model",label:"设置状态值",category:"状态操作"}}(el||(el={})),function(e){const t="群组操作";e.INIT_GROUP={id:"xflow:init-group",label:"初始化群组",category:t},e.ADD_GROUP={id:"xflow:add-group",label:"新建群组",category:t},e.DEL_GROUP={id:"xflow:del-group",label:"解散群组",category:t},e.COLLAPSE_GROUP={id:"xflow:collapse-group",label:"折叠群组",category:t}}(tl||(tl={}));const nl=e=>{const{cell:t}=e,n=qs(),r=e.data.isCollapsed||!1;return u.default.createElement("div",{className:"xflow-default-group-node"},u.default.createElement("div",{className:"xflow-group-header"},u.default.createElement("div",{className:"header-left"},e.data.label),u.default.createElement("div",{className:"header-right"},r&&u.default.createElement(Ds,{onClick:e=>{e.preventDefault(),n.executeCommand(tl.COLLAPSE_GROUP.id,{nodeId:t.id,isCollapsed:!1})}}),!r&&u.default.createElement(ks,{onClick:e=>{e.preventDefault(),n.executeCommand(tl.COLLAPSE_GROUP.id,{nodeId:t.id,isCollapsed:!0,gap:3})}}))))};nl.displayName="XFlowDefaultGroupNode";const rl={fontSize:"16px",color:"#3057e3"};var ol;!function(e){e.SUCCEEDED="SUCCEEDED",e.RUNNING="RUNNING",e.FAILED="FAILED",e.PENDING="PENDING",e.CREATING="CREATING",e.MANUAL_TERMINATE="MANUAL_TERMINATE",e.CACHED="CACHED",e.QUEUEING="QUEUEING",e.PULLING_IMAGE="PULLING_IMAGE",e.UNKNOWN="UNKNOWN"}(ol||(ol={}));const il=e=>{if(e.hide)return null;switch(e.status){case ol.RUNNING:return u.default.createElement(Gs,{spin:!0,style:{color:"#c1cdf7",fontSize:"16px"}});case ol.FAILED:return u.default.createElement(Ba,{style:{color:"#ff4d4f",fontSize:"16px"}});case ol.SUCCEEDED:return u.default.createElement(Ga,{style:{color:"#39ca74cc",fontSize:"16px"}});case ol.PENDING:return u.default.createElement(fs,{style:{color:"#faad14",fontSize:"16px"}});case ol.CREATING:return u.default.createElement(ds,{style:{color:"#faad14",fontSize:"16px"}});case ol.MANUAL_TERMINATE:return u.default.createElement(Bs,{style:{color:"#faad14",fontSize:"16px"}});case ol.CACHED:return u.default.createElement(Ya,{style:{color:"#faad14",fontSize:"16px"}});case ol.QUEUEING:return u.default.createElement(fs,{style:{color:"#faad14",fontSize:"16px"}});case ol.PULLING_IMAGE:return u.default.createElement(as,{style:{color:"#faad14",fontSize:"16px"}});case ol.UNKNOWN:return u.default.createElement(Rs,{style:{color:"#d9d9d9",fontSize:"16px"}});default:return null}},al=e=>{const t=u.default.isValidElement(e.data.icon)?e.data.icon:u.default.createElement(Za,{style:rl});return u.default.createElement("div",{className:"xflow-default-node "+(e.isNodeTreePanel?"panel-node":"")},u.default.createElement("span",{className:"icon"},t),u.default.createElement("span",{className:"label"},e.data.label),u.default.createElement("span",{className:"status"},u.default.createElement(il,{status:e.data&&e.data.status,hide:e.isNodeTreePanel})))};var sl;al.displayName="XFlowDefaultNode",function(e){e.CONFIG_TYPE="GraphConfig",e.defaultNodeTypeParser=e=>e.renderKey,e.defaultEdgeTypeParser=e=>e.renderKey,e.defaultNodeMapValue=[[Nr,al],["XFLOW_DEFAULT_GROUP_NODE",nl]]}(sl||(sl={}));class ll{constructor(){this.CONFIG_TYPE=sl.CONFIG_TYPE,this.x6Options=new kr,this.rootContainer=new kr,this.graphContainer=new kr,this.nodeRender=new Map(sl.defaultNodeMapValue),this.edgeRender=new Map,this.nodeTypeParser=sl.defaultNodeTypeParser,this.edgeTypeParser=sl.defaultEdgeTypeParser,this.events=[],this.mergeX6Config=e=>x(this,void 0,void 0,function*(){const t=yield this.getX6Config();return Object.assign(t,e)}),this.getX6Config=()=>x(this,void 0,void 0,function*(){return yield this.x6Options.promise}),this.setX6Config=e=>{var t;const n=this.getDefaultGraphOptions();null===(t=this.x6Options)||void 0===t||t.resolve(Object.assign(Object.assign({},n),e))},this.setAppContainer=e=>{this.appContainer=e},this.setRootContainer=e=>{e&&(null==this||this.rootContainer.resolve(e))},this.setGraphContainer=e=>{var t;e&&(null===(t=this.graphContainer)||void 0===t||t.resolve(e))},this.setEvents=e=>{this.events=e},this.setDefaultNodeRender=e=>{this.nodeRender.set(Nr,e)},this.setDefaultEdgeRender=e=>{this.edgeRender.set(Ar,e)},this.setNodeRender=(e,t)=>{this.nodeRender.set(e,t)},this.setEdgeRender=(e,t)=>{this.edgeRender.set(e,t)},this.setNodeTypeParser=e=>{this.nodeTypeParser=e},this.setEdgeTypeParser=e=>{this.edgeTypeParser=e},this.getConfig=()=>x(this,void 0,void 0,function*(){const[e,t,n]=yield Promise.all([this.rootContainer.promise,this.graphContainer.promise,this.x6Options.promise]);return{xflowInstanceId:this.xflowInstanceId,graphId:this.graphId,nodeViewId:this.graphId,appContainer:this.appContainer,rootContainer:e,graphContainer:t,x6Options:n,events:this.events,nodeRender:this.nodeRender,edgeRender:this.edgeRender,nodeTypeParser:this.nodeTypeParser,edgeTypeParser:this.edgeTypeParser}}),this.getDefaultGraphOptions=()=>({rotating:!1,resizing:!1,connecting:{snap:!0,dangling:!1,highlight:!1,connectionPoint:"rect",router:{name:"er"},connector:{name:"rounded",args:{radius:15}}},background:{},grid:{visible:!0},selecting:{strict:!0,enabled:!0,multiple:!0,selectCellOnMoved:!0,showNodeSelectionBox:!1,rubberEdge:!0,rubberNode:!0,movable:!0},snapline:{enabled:!1},history:{enabled:!1},clipboard:{enabled:!0,useLocalStorage:!0},scroller:{enabled:!1},mousewheel:{enabled:!0,minScale:.01,maxScale:1.5,factor:1.1,modifiers:["ctrl","meta"]},panning:{enabled:!0},scaling:{min:.01,max:1.5},keyboard:{enabled:!0},interacting:{nodeMovable:!0,edgeLabelMovable:!1},async:!1}),this.dispose=()=>{this.rootContainer=new kr,this.graphContainer=new kr,this.x6Options=new kr},this.graphId=Dr()}}const dl=Symbol("IGraphOptionProvider");function cl(e){return"function"==typeof e}var ul=!1,fl={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;ul=e},get useDeprecatedSynchronousErrorHandling(){return ul}};function hl(e){setTimeout(function(){throw e},0)}var pl={closed:!0,next:function(e){},error:function(e){if(fl.useDeprecatedSynchronousErrorHandling)throw e;hl(e)},complete:function(){}},gl=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function vl(e){return null!==e&&"object"==typeof e}var ml=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),yl=ml,bl=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this,r=n._parentOrParents,o=n._ctorUnsubscribe,i=n._unsubscribe,a=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof e)r.remove(this);else if(null!==r)for(var s=0;s<r.length;++s){r[s].remove(this)}if(cl(i)){o&&(this._unsubscribe=void 0);try{i.call(this)}catch(e){t=e instanceof yl?xl(e.errors):[e]}}if(gl(a)){s=-1;for(var l=a.length;++s<l;){var d=a[s];if(vl(d))try{d.unsubscribe()}catch(e){t=t||[],e instanceof yl?t=t.concat(xl(e.errors)):t.push(e)}}}if(t)throw new yl(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof e){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function xl(e){return e.reduce(function(e,t){return e.concat(t instanceof yl?t.errors:t)},[])}var wl=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),_l=function(e){function t(n,r,o){var i=e.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=pl;break;case 1:if(!n){i.destination=pl;break}if("object"==typeof n){n instanceof t?(i.syncErrorThrowable=n.syncErrorThrowable,i.destination=n,n.add(i)):(i.syncErrorThrowable=!0,i.destination=new El(i,n));break}default:i.syncErrorThrowable=!0,i.destination=new El(i,n,r,o)}return i}return v(t,e),t.prototype[wl]=function(){return this},t.create=function(e,n,r){var o=new t(e,n,r);return o.syncErrorThrowable=!1,o},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(bl),El=function(e){function t(t,n,r,o){var i,a=e.call(this)||this;a._parentSubscriber=t;var s=a;return cl(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==pl&&(cl((s=Object.create(n)).unsubscribe)&&a.add(s.unsubscribe.bind(s)),s.unsubscribe=a.unsubscribe.bind(a))),a._context=s,a._next=i,a._error=r,a._complete=o,a}return v(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;fl.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=fl.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):hl(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;hl(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};fl.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),fl.useDeprecatedSynchronousErrorHandling)throw e;hl(e)}},t.prototype.__tryOrSetError=function(e,t,n){if(!fl.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return fl.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(hl(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(_l);var Sl=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Cl(e){return e}var Ol=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,o=function(e,t,n){if(e){if(e instanceof _l)return e;if(e[wl])return e[wl]()}return e||t||n?new _l(e,t,n):new _l(pl)}(e,t,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||fl.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),fl.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){fl.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),!function(e){for(;e;){var t=e,n=t.closed,r=t.destination,o=t.isStopped;if(n||o)return!1;e=r&&r instanceof _l?r:null}return!0}(e)?console.warn(t):e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=kl(t))(function(t,r){var o;o=n.subscribe(function(t){try{e(t)}catch(e){r(e),o&&o.unsubscribe()}},r,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[Sl]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 0===t.length?this:(0===(e=t).length?Cl:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=kl(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function kl(e){if(e||(e=Promise),!e)throw new Error("no Promise impl found");return e}var Ml=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),Nl=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return v(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(bl),Al=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return v(t,e),t}(_l),Tl=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return v(t,e),t.prototype[wl]=function(){return new Al(this)},t.prototype.lift=function(e){var t=new Pl(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new Ml;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].next(e)},t.prototype.error=function(e){if(this.closed)throw new Ml;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new Ml;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new Ml;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new Ml;return this.hasError?(e.error(this.thrownError),bl.EMPTY):this.isStopped?(e.complete(),bl.EMPTY):(this.observers.push(e),new Nl(this,e))},t.prototype.asObservable=function(){var e=new Ol;return e.source=this,e},t.create=function(e,t){return new Pl(e,t)},t}(Ol),Pl=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return v(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):bl.EMPTY},t}(Tl),Dl=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return v(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Ml;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Tl),jl=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return v(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(e){n=!0,r=!!e&&e||new Error(e)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(function(e){function t(t,n){return e.call(this)||this}return v(t,e),t.prototype.schedule=function(e,t){return this},t}(bl)),Il=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}(),Rl=function(e){function t(n,r){void 0===r&&(r=Il.now);var o=e.call(this,n,function(){return t.delegate&&t.delegate!==o?t.delegate.now():r()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return v(t,e),t.prototype.schedule=function(n,r,o){return void 0===r&&(r=0),t.delegate&&t.delegate!==this?t.delegate.schedule(n,r,o):e.prototype.schedule.call(this,n,r,o)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Il),Ll=new Rl(jl),Fl=Ll;var Gl=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Ul(e,this.predicate,this.thisArg))},e}(),Ul=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.predicate=n,o.thisArg=r,o.count=0,o}return v(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(_l);var Hl=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new Bl(e,this.compare,this.keySelector))},e}(),Bl=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.keySelector=r,o.hasKey=!1,"function"==typeof n&&(o.compare=n),o}return v(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t;try{var n=this.keySelector;t=n?n(e):e}catch(e){return this.destination.error(e)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;r||(this.key=t,this.destination.next(e))},t}(_l),zl={leading:!0,trailing:!1};var Vl=function(){function e(e,t,n,r){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new Yl(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),Yl=function(e){function t(t,n,r,o,i){var a=e.call(this,t)||this;return a.duration=n,a.scheduler=r,a.leading=o,a.trailing=i,a._hasTrailingValue=!1,a._trailingValue=null,a}return v(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Wl,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(_l);function Wl(e){e.subscriber.clearThrottle()}function $l(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(e){return"'"+e+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Kl(e){return!!e&&!!e[Dd]}function Xl(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Id}(e)||Array.isArray(e)||!!e[Pd]||!!(null===(t=e.constructor)||void 0===t?void 0:t[Pd])||ed(e)||td(e))}function ql(e,t,n){void 0===n&&(n=!1),0===Zl(e)?(n?Object.keys:Rd)(e).forEach(function(r){n&&"symbol"==typeof r||t(r,e[r],e)}):e.forEach(function(n,r){return t(r,n,e)})}function Zl(e){var t=e[Dd];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:ed(e)?2:td(e)?3:0}function Jl(e,t){return 2===Zl(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ql(e,t,n){var r=Zl(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function ed(e){return Md&&e instanceof Map}function td(e){return Nd&&e instanceof Set}function nd(e){return e.o||e.t}function rd(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Ld(e);delete t[Dd];for(var n=Rd(t),r=0;r<n.length;r++){var o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function od(e,t){return void 0===t&&(t=!1),ad(e)||Kl(e)||!Xl(e)||(Zl(e)>1&&(e.set=e.add=e.clear=e.delete=id),Object.freeze(e),t&&ql(e,function(e,t){return od(t,!0)},!0)),e}function id(){$l(2)}function ad(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function sd(e){var t=Fd[e];return t||$l(18,e),t}function ld(){return Od}function dd(e,t){t&&(sd("Patches"),e.u=[],e.s=[],e.v=t)}function cd(e){ud(e),e.p.forEach(hd),e.p=null}function ud(e){e===Od&&(Od=e.l)}function fd(e){return Od={p:[],l:Od,h:e,m:!0,_:0}}function hd(e){var t=e[Dd];0===t.i||1===t.i?t.j():t.g=!0}function pd(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||sd("ES5").S(t,e,r),r?(n[Dd].P&&(cd(t),$l(4)),Xl(e)&&(e=gd(t,e),t.l||md(t,e)),t.u&&sd("Patches").M(n[Dd].t,e,t.u,t.s)):e=gd(t,n,[]),cd(t),t.u&&t.v(t.u,t.s),e!==Td?e:void 0}function gd(e,t,n){if(ad(t))return t;var r=t[Dd];if(!r)return ql(t,function(o,i){return vd(e,r,t,o,i,n)},!0),t;if(r.A!==e)return t;if(!r.P)return md(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=rd(r.k):r.o,i=o,a=!1;3===r.i&&(i=new Set(o),o.clear(),a=!0),ql(i,function(t,i){return vd(e,r,o,t,i,n,a)}),md(e,o,!1),n&&e.u&&sd("Patches").N(r,n,e.u,e.s)}return r.o}function vd(e,t,n,r,o,i,a){if(Kl(o)){var s=gd(e,o,i&&t&&3!==t.i&&!Jl(t.R,r)?i.concat(r):void 0);if(Ql(n,r,s),!Kl(s))return;e.m=!1}else a&&n.add(o);if(Xl(o)&&!ad(o)){if(!e.h.D&&e._<1)return;gd(e,o),t&&t.A.l||md(e,o)}}function md(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&od(t,n)}function yd(e,t){var n=e[Dd];return(n?nd(n):e)[t]}function bd(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function xd(e){e.P||(e.P=!0,e.l&&xd(e.l))}function wd(e){e.o||(e.o=rd(e.t))}function _d(e,t,n){var r=ed(t)?sd("MapSet").F(t,n):td(t)?sd("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:ld(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=Gd;n&&(o=[r],i=Ud);var a=Proxy.revocable(o,i),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):sd("ES5").J(t,n);return(n?n.A:ld()).p.push(r),r}function Ed(e){return Kl(e)||$l(22,e),function e(t){if(!Xl(t))return t;var n,r=t[Dd],o=Zl(t);if(r){if(!r.P&&(r.i<4||!sd("ES5").K(r)))return r.t;r.I=!0,n=Sd(t,o),r.I=!1}else n=Sd(t,o);return ql(n,function(t,o){r&&function(e,t){return 2===Zl(e)?e.get(t):e[t]}(r.t,t)===o||Ql(n,t,e(o))}),3===o?new Set(n):n}(e)}function Sd(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return rd(e)}var Cd,Od,kd="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Md="undefined"!=typeof Map,Nd="undefined"!=typeof Set,Ad="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Td=kd?Symbol.for("immer-nothing"):((Cd={})["immer-nothing"]=!0,Cd),Pd=kd?Symbol.for("immer-draftable"):"__$immer_draftable",Dd=kd?Symbol.for("immer-state"):"__$immer_state",jd="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Id=""+Object.prototype.constructor,Rd="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Ld=Object.getOwnPropertyDescriptors||function(e){var t={};return Rd(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},Fd={},Gd={get:function(e,t){if(t===Dd)return e;var n=nd(e);if(!Jl(n,t))return function(e,t,n){var r,o=bd(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!Xl(r)?r:r===yd(e.t,t)?(wd(e),e.o[t]=_d(e.A.h,r,e)):r},has:function(e,t){return t in nd(e)},ownKeys:function(e){return Reflect.ownKeys(nd(e))},set:function(e,t,n){var r=bd(nd(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=yd(nd(e),t),i=null==o?void 0:o[Dd];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,o)&&(void 0!==n||Jl(e.t,t)))return!0;wd(e),xd(e)}return e.o[t]===n&&(void 0!==n||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==yd(e.t,t)||t in e.t?(e.R[t]=!1,wd(e),xd(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=nd(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){$l(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){$l(12)}},Ud={};ql(Gd,function(e,t){Ud[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Ud.deleteProperty=function(e,t){return Ud.set.call(this,e,t,void 0)},Ud.set=function(e,t,n){return Gd.set.call(this,e[0],t,n,e[0])};var Hd=function(){function e(e){var t=this;this.O=Ad,this.D=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,a=Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];return i.produce(e,function(e){var r;return(r=n).call.apply(r,[t,e].concat(a))})}}var a;if("function"!=typeof n&&$l(6),void 0!==r&&"function"!=typeof r&&$l(7),Xl(e)){var s=fd(t),l=_d(t,e,void 0),d=!0;try{a=n(l),d=!1}finally{d?cd(s):ud(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then(function(e){return dd(s,r),pd(e,s)},function(e){throw cd(s),e}):(dd(s,r),pd(a,s))}if(!e||"object"!=typeof e){if(void 0===(a=n(e))&&(a=e),a===Td&&(a=void 0),t.D&&od(a,!0),r){var c=[],u=[];sd("Patches").M(e,a,c,u),r(c,u)}return a}$l(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.produceWithPatches(n,function(t){return e.apply(void 0,[t].concat(o))})};var r,o,i=t.produce(e,n,function(e,t){r=e,o=t});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(function(e){return[e,r,o]}):[i,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){Xl(e)||$l(8),Kl(e)&&(e=Ed(e));var t=fd(this),n=_d(this,e,void 0);return n[Dd].C=!0,ud(t),n},t.finishDraft=function(e,t){var n=(e&&e[Dd]).A;return dd(n,t),pd(void 0,n)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!Ad&&$l(20),this.O=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=sd("Patches").$;return Kl(e)?o(e,t):this.produce(e,function(e){return o(e,t)})},e}(),Bd=new Hd,zd=Bd.produce;Bd.produceWithPatches.bind(Bd);var Vd=Bd.setAutoFreeze.bind(Bd);Bd.setUseProxies.bind(Bd),Bd.applyPatches.bind(Bd);var Yd,Wd=Bd.createDraft.bind(Bd),$d=Bd.finishDraft.bind(Bd);!function(){function e(e,t){function n(){this.constructor=e}o(e,t),e.prototype=(n.prototype=t.prototype,new n)}function t(e){e.o||(e.R=new Map,e.o=new Map(e.t))}function n(e){e.o||(e.o=new Set,e.t.forEach(function(t){if(Xl(t)){var n=_d(e.A.h,t,e);e.p.set(t,n),e.o.add(n)}else e.o.add(t)}))}function r(e){e.g&&$l(3,JSON.stringify(nd(e)))}var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},i=function(){function n(e,t){return this[Dd]={i:2,l:t,A:t?t.A:ld(),P:!1,I:!1,o:void 0,R:void 0,t:e,k:this,C:!1,g:!1},this}e(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return nd(this[Dd]).size}}),o.has=function(e){return nd(this[Dd]).has(e)},o.set=function(e,n){var o=this[Dd];return r(o),nd(o).has(e)&&nd(o).get(e)===n||(t(o),xd(o),o.R.set(e,!0),o.o.set(e,n),o.R.set(e,!0)),this},o.delete=function(e){if(!this.has(e))return!1;var n=this[Dd];return r(n),t(n),xd(n),n.t.has(e)?n.R.set(e,!1):n.R.delete(e),n.o.delete(e),!0},o.clear=function(){var e=this[Dd];r(e),nd(e).size&&(t(e),xd(e),e.R=new Map,ql(e.t,function(t){e.R.set(t,!1)}),e.o.clear())},o.forEach=function(e,t){var n=this;nd(this[Dd]).forEach(function(r,o){e.call(t,n.get(o),o,n)})},o.get=function(e){var n=this[Dd];r(n);var o=nd(n).get(e);if(n.I||!Xl(o))return o;if(o!==n.t.get(e))return o;var i=_d(n.A.h,o,n);return t(n),n.o.set(e,i),i},o.keys=function(){return nd(this[Dd]).keys()},o.values=function(){var e,t=this,n=this.keys();return(e={})[jd]=function(){return t.values()},e.next=function(){var e=n.next();return e.done?e:{done:!1,value:t.get(e.value)}},e},o.entries=function(){var e,t=this,n=this.keys();return(e={})[jd]=function(){return t.entries()},e.next=function(){var e=n.next();if(e.done)return e;var r=t.get(e.value);return{done:!1,value:[e.value,r]}},e},o[jd]=function(){return this.entries()},n}(),a=function(){function t(e,t){return this[Dd]={i:3,l:t,A:t?t.A:ld(),P:!1,I:!1,o:void 0,t:e,k:this,p:new Map,g:!1,C:!1},this}e(t,Set);var o=t.prototype;return Object.defineProperty(o,"size",{get:function(){return nd(this[Dd]).size}}),o.has=function(e){var t=this[Dd];return r(t),t.o?!!t.o.has(e)||!(!t.p.has(e)||!t.o.has(t.p.get(e))):t.t.has(e)},o.add=function(e){var t=this[Dd];return r(t),this.has(e)||(n(t),xd(t),t.o.add(e)),this},o.delete=function(e){if(!this.has(e))return!1;var t=this[Dd];return r(t),n(t),xd(t),t.o.delete(e)||!!t.p.has(e)&&t.o.delete(t.p.get(e))},o.clear=function(){var e=this[Dd];r(e),nd(e).size&&(n(e),xd(e),e.o.clear())},o.values=function(){var e=this[Dd];return r(e),n(e),e.o.values()},o.entries=function(){var e=this[Dd];return r(e),n(e),e.o.entries()},o.keys=function(){return this.values()},o[jd]=function(){return this.values()},o.forEach=function(e,t){for(var n=this.values(),r=n.next();!r.done;)e.call(t,r.value,r.value,this),r=n.next()},t}();!function(e,t){Fd[e]||(Fd[e]=t)}("MapSet",{F:function(e,t){return new i(e,t)},T:function(e,t){return new a(e,t)}})}(),Vd(!1),function(e){function t(t){return t!==e.EMPTY_VALUE}e.EMPTY_VALUE=Symbol("EMPTY_MODEL_VALUE"),e.isValidValue=t,e.defaultPipeFunction=function(e){return e.pipe(function(e){return e.lift(new Hl(o,i))},(n=e=>t(e),function(e){return e.lift(new Gl(n,r))}),function(e,t,n){return void 0===t&&(t=Fl),void 0===n&&(n=zl),function(r){return r.lift(new Vl(e,t,n.leading,n.trailing))}}(17,Ll,{leading:!1,trailing:!0}));var n,r,o,i}}(Yd||(Yd={}));class Kd{constructor(e=Yd.EMPTY_VALUE,t=30){this.toDispose=new Or,this.watch=(e,t=Yd.defaultPipeFunction)=>{this.subject$.observers.length+1>this.maxSubscription&&console.warn(`${this.subject$} reach maxSubscription limitation, please check`);const n=(t?t(this.subject$):this.subject$).subscribe(e);return Er.create(()=>{n.unsubscribe()})},this.getValue=()=>this.subject$.getValue(),this.setValue=e=>{if(this.subject$){if("function"==typeof e){const t=this.subject$.getValue(),n=zd(t,t=>{e(t)});return void(Yd.isValidValue(n)&&this.setValue(n))}this.subject$.next(e)}},this.hasValidValue=()=>{const e=this.getValue();return Yd.isValidValue(e)},this.getValidValue=()=>x(this,void 0,void 0,function*(){const e=new kr;if(this.hasValidValue())return this.getValue();const t=this.watch(n=>{Yd.isValidValue(n)&&(e.resolve(n),t.dispose())});return e.promise}),this.dispose=()=>{this.toDispose.dispose()},this.subject$=new Dl(e||Yd.EMPTY_VALUE),this.maxSubscription=t,this.toDispose.push(Er.create(()=>{this.subject$.complete(),this.subject$.unsubscribe(),this.subject$=null}))}}const Xd=Rn.defineToken("IFrontendApplicationContribution"),qd=Symbol("IGraphCommandService"),Zd=Rn.defineToken("ICommandHandler"),Jd=Symbol("ICommandContextProvider"),Qd=Symbol("IGraphCommandFactory"),ec=Rn.defineToken("IGraphCommandContribution");var tc;!function(e){e.is=function(e){return!!e&&e===Object(e)&&"id"in e},e.compareCommands=function(e,t){if(e.label&&t.label){const n=(e.category?`${e.category}: ${e.label}`:e.label).toLowerCase(),r=(t.category?`${t.category}: ${t.label}`:t.label).toLowerCase();return n.localeCompare(r)}return 0},e.equals=function(e,t){return e.id===t.id&&e.label===t.label&&e.iconName===t.iconName&&e.category===t.category}}(tc||(tc={}));let nc=class{get watchChange(){return this.cmdChangeEvent.watch}constructor(e){this.contributionProvider=e,this.redoStack=[],this.undoStack=[],this.commands=new Map,this.factories=new Map,this.disposables=new Map,this.cmdChangeEvent=new Kd(null),this.Globals=new Kd(new Map),this.setGlobal=(e,t)=>{this.Globals.setValue(n=>{n.set(e,t)})},this.getGlobal=e=>this.Globals.getValue().get(e),this.undoCommand=()=>x(this,void 0,void 0,function*(){const e=this.undoStack.pop();e?(yield e.undo(),this.redoStack.push(e),this.cmdChangeEvent.setValue(null)):console.error("empty undo stack")}),this.redoCommand=()=>x(this,void 0,void 0,function*(){const e=this.redoStack.pop();e?(yield e.redo(),this.undoStack.push(e),this.cmdChangeEvent.setValue(null)):console.error("empty undo stack")}),this.registerDisposableCommand=e=>{const t=new Or;return e({registerCommand:(e,n)=>{const r=this.registerCommand(e,n);return t.push(r),r}}),t}}onStart(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerGraphCommands(this)}executeCommandPipeline(e){return x(this,void 0,void 0,function*(){let t=null;for(const n of e){const e=null==t?void 0:t.contextProvider(),{args:r,hooks:o}=yield null==n?void 0:n.getCommandOption(e);t=yield this.executeCommand(null==n?void 0:n.commandId,r,o)}return this.cmdChangeEvent.setValue(null),t})}executeCommand(e,t,n=[]){return x(this,void 0,void 0,function*(){const r=this.getFactory(e);if(r){const o=yield r.createCommand(e,t,n);return yield o.execute(),o.isUndoable()&&this.undoStack.push(o),this.cmdChangeEvent.setValue(null),o}throw Object.assign(new Error(`The command '${e}' cannot be executed. There are no active handlers available for the command.`),{code:"NO_ACTIVE_HANDLER"})})}executeUndoCommand(e,t,n=[]){return x(this,void 0,void 0,function*(){const r=this.getFactory(e);if(r){const o=yield r.createCommand(e,t,n);return yield o.execute(),o}throw Object.assign(new Error(`The command '${e}' cannot be executed. There are no active handlers available for the command.`),{code:"NO_ACTIVE_HANDLER"})})}createCommand(e,t,n=[]){return x(this,void 0,void 0,function*(){const r=this.getFactory(e);if(r){return yield r.createCommand(e,t,n)}throw Object.assign(new Error(`The command '${e}' cannot be executed. There are no active handlers available for the command.`),{code:"NO_ACTIVE_HANDLER"})})}get isUndoable(){return this.undoStack.length>0}get isRedoable(){return this.redoStack.length>0}hasCommand(e){return this.commands.has(e)}getCommand(e){return this.commands.get(e)}registerCommand(e,t){if(this.factories.has(e.id))return console.warn(`A command ${e.id} is already registered.`),Er.NULL;const n=new Or(this.doRegisterCommand(e),this.registerFactory(e.id,t),Er.create(()=>this.disposables.delete(e.id)));return this.disposables.set(e.id,n),n}doRegisterCommand(e){return this.commands.set(e.id,e),Er.create(()=>this.disposables.delete(e.id))}unregisterCommand(e){const t=tc.is(e)?e.id:e,n=this.disposables.get(t);n&&n.dispose()}hasFactory(e){return!!this.factories.get(e)}getFactory(e){return this.factories.get(e)}registerFactory(e,t,n=!1){return this.hasFactory(e)&&!1===n&&console.error("cannot register command:",e),this.factories.set(e,t),Er.create(()=>{this.factories.delete(e)})}getAllFactories(){return Array.from(this.factories.entries())}};var rc,oc;nc=y([tr({contrib:[Xd,qd]}),(rc=0,oc=gr(ec),function(e,t){oc(e,t,rc)}),b("design:paramtypes",[Object])],nc),hr(e=>{pr.register(e,ec),e(nc)});const ic=Rn.defineToken("IModelService"),ac=Rn.defineToken("IModelContribution"),sc=Symbol("IModelOptionProvider");var lc;!function(e){e.ASYNC_SRRIES="ASYNC_SRRIES",e.ASYNC_PARALLEL="ASYNC_PARALLEL"}(lc||(lc={}));var dc={exports:{}};function cc(e,t){var n=e.length,r=new Array(n),o={},i=n,a=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var o=e[n];t.has(o[0])||t.set(o[0],new Set),t.has(o[1])||t.set(o[1],new Set),t.get(o[0]).add(o[1])}return t}(t),s=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach(function(e){if(!s.has(e[0])||!s.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)o[i]||l(e[i],i,new Set);return r;function l(e,t,i){if(i.has(e)){var d;try{d=", node was:"+JSON.stringify(e)}catch(e){d=""}throw new Error("Cyclic dependency"+d)}if(!s.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!o[t]){o[t]=!0;var c=a.get(e)||new Set;if(t=(c=Array.from(c)).length){i.add(e);do{var u=c[--t];l(u,s.get(u),i)}while(t);i.delete(e)}r[--n]=e}}}dc.exports=function(e){return cc(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var o=e[n];t.add(o[0]),t.add(o[1])}return Array.from(t)}(e),e)},dc.exports.array=cc;var uc,fc,hc=dc.exports;!function(e){let t;!function(e){e.INVALID_HOOK_BEFORE="INVALID_HOOK_BEFORE",e.INVALID_HOOK_AFTER="INVALID_HOOK_AFTER",e.INVALID_HOOK_ARGS_LENGTH="INVALID_HOOK_ARGS_LENGTH"}(t=e.ErrorEnum||(e.ErrorEnum={}));class n extends Error{constructor(e,t,...r){Array.isArray(t)&&(t=t.filter(function(e){return!!e}).join(" ")),super(`${e}: ${t}`),Error.captureStackTrace&&Error.captureStackTrace(this,n),this.code=e,this.contexts={},r.forEach(e=>{"object"==typeof e&&Object.entries(e).forEach(e=>{const[t,n]=e;"key"!==t&&n&&(this.contexts[t]=JSON.parse(JSON.stringify(n)))})})}toString(){return`${this.code}: ${this.message}`}}e.HookError=n;const r=(e,t,...r)=>new n(e,t,...r);e.HookBeforeError=()=>r(t.INVALID_HOOK_BEFORE,["hook require a before dependency but not exist in hookmap"]),e.HookAfterError=()=>r(t.INVALID_HOOK_AFTER,["hook require a after dependency but not exist in hookmap"]),e.InvalidHookArguments=e=>r(t.INVALID_HOOK_ARGS_LENGTH,["hook handlers must have 0 to 2 arguments",`but got ${e.handler.length}`])}(uc||(uc={})),function(e){e.normalize=(e=[],t)=>{const n=Array.isArray(e)?e:[e],r=[];return t.forEach(e=>{r.push(e)}),[...r,...n].filter(e=>e&&!!e.handler)},e.sort=(e=[],t)=>{const n=[];e.forEach(e=>{if(e.before){if(!t.has(e.before))throw uc.HookBeforeError();const r=[e,t.get(e.before)];n.push(r)}if(e.after){if(!t.has(e.after))throw uc.HookBeforeError();const r=[t.get(e.after),e];n.push(r)}});return hc.array(e,n)}}(fc||(fc={}));class pc{constructor(){this.isResolved=!1,this.isRejected=!1,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.isResolved=!0,e(t)},this.reject=e=>{this.isRejected=!0,t(e)}})}}class gc{constructor(e){this.scheduleType=lc.ASYNC_SRRIES,this.hasHook=e=>this.hookMap.has(e),this.getHooks=(e=[],t=!0)=>{const n=fc.normalize(e,this.hookMap);return t?fc.sort(n,this.hookMap):n},this.registerHook=e=>(this.hookMap.has(e.name)&&console.error(`${e.name} is duplicated in hookmap`),this.hookMap.set(e.name,e),{dispose:()=>{this.hookMap.delete(e.name)}}),this.call=(e,t=e=>x(this,void 0,void 0,function*(){return e}),n=[])=>x(this,void 0,void 0,function*(){const r=this.getHooks(n,!0);return(0,this.schedulers[this.scheduleType])(e,t,r)}),this.schedulers={[lc.ASYNC_SRRIES]:(e,t,n=[])=>x(this,void 0,void 0,function*(){let r=t;for(const t of n){if([0,1].includes(t.handler.length)){yield t.handler.call(this,e);continue}if([2].includes(t.handler.length)&&null!==r){const n=yield t.handler.call(this,e,r);if(null===n){r=null;break}if("function"==typeof n){r=n;continue}}throw uc.InvalidHookArguments(t)}if(r)return yield r.call(this,e)}),[lc.ASYNC_PARALLEL]:(e,t,n=[])=>x(this,void 0,void 0,function*(){const r=n.map(n=>{if([0,1].includes(n.handler.length))return n.handler.call(this,e);if([2].includes(n.handler.length))return n.handler.call(this,e,t);throw uc.InvalidHookArguments(n)}),o=new pc;if(Promise.all(r).then(e=>o.resolve(e)),t)return yield t.call(this,o)})},this.hookMap=new Map,e&&e.type&&(this.scheduleType=e.type)}}const vc=Rn.defineToken("IHookService"),mc=Rn.defineToken("IHookContribution"),yc=()=>({dispose:()=>{}});var bc;!function(e){e.CONFIG_TYPE="XFlowHook"}(bc||(bc={}));class xc{constructor(){this.CONFIG_TYPE=bc.CONFIG_TYPE,this.time=Date.now(),this.setRegisterHook=e=>{this.hookRegisterFunc=e},this.setRegisterHookhub=e=>{this.hookhubRegisterFn=e},this.getConfig=()=>x(this,void 0,void 0,function*(){return{CONFIG_TYPE:this.CONFIG_TYPE,hookRegisterFn:this.hookRegisterFunc||yc,hookhubRegisterFn:this.hookhubRegisterFn||yc}}),this.dispose=()=>{}}}let wc=class{constructor(){this.toDispose=new Or,this.hookProvider=()=>this.hooks,this.registerHook=e=>e(this.hooks),this.registerHookHub=(e,t)=>(this.hooks[e]=t,{dispose:()=>{delete this.hooks[e]}}),this.onStart=()=>x(this,void 0,void 0,function*(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerHookHub(this);for(const t of e)t.registerHook(this.hooks)}),this.hooks={graphOptions:new gc,reactNodeRender:new gc,reactEdgeLabelRender:new gc,afterGraphInit:new gc,beforeGraphDestroy:new gc,x6Events:new gc}}onStop(){this.toDispose.dispose()}};var _c;y([gr(mc),b("design:type",Object)],wc.prototype,"contributionProvider",void 0),wc=y([tr({contrib:[Xd,vc]}),b("design:paramtypes",[])],wc),function(e){e.pluginId="GraphEventPlugin"}(_c||(_c={}));let Ec=class{constructor(){this.toDispose=new Or,this.registerHook=e=>x(this,void 0,void 0,function*(){const{hookRegisterFn:t}=yield this.hookConfig.getConfig(),n=t(e);return Er.create(()=>{n.dispose()})}),this.registerHookHub=e=>x(this,void 0,void 0,function*(){const{hookhubRegisterFn:t}=yield this.hookConfig.getConfig(),n=t(e);return Er.create(()=>{n.dispose()})})}};y([nr(xc),b("design:type",xc)],Ec.prototype,"hookConfig",void 0),Ec=y([tr({contrib:mc})],Ec);const Sc={dispose:()=>null};const Cc=e=>{const t=document.createElement("style");return t.setAttribute("type","text/css"),document.head.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),t};function Oc(e){return function(e){return"function"==typeof e&&!!e.prototype.isReactComponent}(e)||function(e){return"function"==typeof e&&String(e).includes("return React.createElement")}(e)}var kc;!function(e){e.pluginId="base-graph-events"}(kc||(kc={}));let Mc=class{constructor(){this.toDispose=new Or,this.registerHookHub=()=>x(this,void 0,void 0,function*(){return Er.create(()=>{})}),this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,n=[e.x6Events.registerHook({name:kc.pluginId,handler:e=>x(this,void 0,void 0,function*(){const{events:t}=yield this.graphOptions.getOptions();t.forEach(t=>{e.push(t)})})}),e.afterGraphInit.registerHook({name:kc.pluginId,handler:n=>x(this,void 0,void 0,function*(){const{commandService:r,modelService:o,graph:i}=n,a=yield e.x6Events.call([],e=>x(this,void 0,void 0,function*(){return e.map(e=>{const t=t=>{e.callback(t,r,o,i)};return i.on(e.eventName,t),{dispose:()=>{i.off(e.eventName,t)}}})}));t.pushAll(a)})}),e.afterGraphInit.registerHook({name:"add auto resize event",handler:e=>x(this,void 0,void 0,function*(){const{commandService:n,options:r,graph:o}=e,i=function(e){let t;return()=>{t||(t=requestAnimationFrame(()=>{t=null,e()}))}}(()=>{n.executeCommand(Qs.GRAPH_RESIZE.id,{})});window.addEventListener("resize",i);const{rootContainer:a}=r,s=new ResizeObserver(()=>o.resize(a.clientWidth));a&&s.observe(a),t.push(Er.create(()=>{window.removeEventListener("resize",i)}))})}),e.beforeGraphDestroy.registerHook({name:kc.pluginId,handler:()=>x(this,void 0,void 0,function*(){t.dispose()})})];return t.pushAll(n),t})}};y([nr(dl),b("design:type",Object)],Mc.prototype,"graphOptions",void 0),Mc=y([tr({contrib:mc})],Mc);const Nc=u.default.createContext({}),Ac=()=>u.default.useContext(Nc),Tc=u.default.createContext({cell:null,x6Graph:null,commands:null,modelService:null});function Pc(e,t,n){return function(r){const o=this,i=null==r?void 0:r.getData(),a=null==r?void 0:r.getSize(),s=null==r?void 0:r.getPosition();return u.default.createElement(()=>u.default.createElement(Tc.Provider,{value:{cell:r,x6Graph:o,commands:t,modelService:n}},u.default.createElement(e,{cell:r,data:i,size:a,position:s})),null)}}const Dc=Symbol("IGraphProvider"),jc=Symbol("ICommandServiceProvider"),Ic=Symbol("IModelServiceProvider");let Rc=class{constructor(){this.toDispose=new Or,this.graphMap=new Map,this.getGraph=e=>x(this,void 0,void 0,function*(){let t=this.graphMap.get(e);if(!t){t=new kr,this.graphMap.set(e,t);const r=yield this.optionProvider.getOptions(),o=this.hookService.hookProvider(),i=yield o.graphOptions.call(r.x6Options),{graphContainer:a,edgeRender:s,nodeRender:l,edgeTypeParser:d}=r,c=yield o.reactEdgeLabelRender.call(s);yield o.reactNodeRender.call(l);const{clientHeight:u,clientWidth:f}=a,h=yield this.commandServiceProvider.getCommandService(),p=yield this.modelServiceProvider.getModelService(),g=new n.Graph(Object.assign(Object.assign({container:a,width:f,height:u},i),{onEdgeLabelRendered:e=>{const{edge:t,container:n}=e;this.renderEdgeReactLabel({edge:t,container:n,edgeRenderMap:c,edgeTypeParser:d,modelService:p,commandService:h})}}));yield o.afterGraphInit.call({graph:g,commandService:h,modelService:p,options:r}),t.resolve(g),g.on("node:moved",({node:e})=>{const t=e.getData(),n=e.position();e.setData(Object.assign(Object.assign({},t),{x:null==n?void 0:n.x,y:null==n?void 0:n.y}))}),g.on("node:resized",({node:e})=>{const t=e.getData(),n=e.size();e.setData(Object.assign(Object.assign({},t),{width:null==n?void 0:n.width,height:null==n?void 0:n.height}))}),this.toDispose.push(Er.create(()=>x(this,void 0,void 0,function*(){yield o.beforeGraphDestroy.call({graph:g,commandService:h,modelService:p,options:r}),this.graphMap.delete(e),g.dispose()})))}return t.promise}),this.renderEdgeReactLabel=e=>x(this,void 0,void 0,function*(){const{container:t,edgeTypeParser:n,edge:r,edgeRenderMap:o,commandService:i,modelService:a}=e,s=n(null==r?void 0:r.data)||Ar,l=o.get(s);if(l&&r&&(null==r?void 0:r.data)&&l){const e=this.edgeAppendForeignObject(r,t),n=function(e,t,n){return function(r){const o=this,i=null==r?void 0:r.getData();return u.default.createElement(()=>u.default.createElement(Tc.Provider,{value:{cell:r,x6Graph:o,commands:t,modelService:n}},u.default.createElement(e,{data:i,cell:r})),null)}}(l,i,a)(r);h.default.render(n,e)}})}edgeAppendForeignObject(e,t){const r=n.Dom.createSvgElement("foreignObject"),o=n.Dom.createElementNS("body",n.Dom.ns.xhtml),i=n.Dom.createElementNS("div",n.Dom.ns.xhtml),a=null==e?void 0:e.data,s=(null==a?void 0:a.edgeContentWidth)||100,l=(null==a?void 0:a.edgeContentHeight)||30;return r.setAttribute("width",`${s}`),r.setAttribute("height",`${l}`),r.setAttribute("x",""+-1*s/2),r.setAttribute("y",""+-1*l/2),o.setAttribute("xhtmls",n.Dom.ns.xhtml),o.style.width="100%",o.style.height="100%",o.style.padding="0",o.style.margin="0",o.style.background="unset",o.style.overflow="visible",o.className="xflow-edge-label-body",i.style.width="100%",i.style.height="100%",o.appendChild(i),r.appendChild(o),t.appendChild(r),i}dispose(){this.toDispose.dispose()}};y([nr(dl),b("design:type",Object)],Rc.prototype,"optionProvider",void 0),y([nr(vc),b("design:type",Object)],Rc.prototype,"hookService",void 0),y([nr(jc),b("design:type",Object)],Rc.prototype,"commandServiceProvider",void 0),y([nr(Ic),b("design:type",Object)],Rc.prototype,"modelServiceProvider",void 0),Rc=y([tr()],Rc);var Lc;!function(e){e.CONFIG_TYPE="MODEL_SERVICE_CONFIG"}(Lc||(Lc={}));let Fc=class{constructor(){this.toDispose=new Or,this.deferredModelMap=new Map,this.registerModel=e=>{const{id:t,getInitialValue:n,modelFactory:r}=e,o=new Or,i=this.ensureModel(t);if(i.isResolved)return void console.error(e,"model has been registerd");const a=n?n():Yd.EMPTY_VALUE,s=r?r():new Kd(a);return Yd.isValidValue(a)&&i.resolve(s),e.watchChange&&e.watchChange(s,this).then(e=>{i.isResolved||i.resolve(s),this.toDispose.pushAll([e,o]),o.push(e)}),o},this.findDeferredModel=e=>this.deferredModelMap.get(e),this.awaitModel=e=>this.ensureModel(e).promise,this.registerRuntimeModel=()=>x(this,void 0,void 0,function*(){const{modelRegisterFunc:e}=yield this.modelOptionProvider.getOption(),t=yield this.graphProvider.getGraphInstance();e&&e(this,t)}),this.ensureModel=e=>{const t=this.deferredModelMap.get(e);if(t)return t;const n=new kr;return this.deferredModelMap.set(e,n),this.toDispose.push(Er.create(()=>this.deferredModelMap.delete(e))),n}}onStart(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerModel(this);this.registerRuntimeModel()}onStop(){this.toDispose.dispose()}};y([gr(ac),b("design:type",Object)],Fc.prototype,"contributionProvider",void 0),y([nr(sc),b("design:type",Object)],Fc.prototype,"modelOptionProvider",void 0),y([nr(Dc),b("design:type",Object)],Fc.prototype,"graphProvider",void 0),Fc=y([tr({contrib:[Xd,ic]})],Fc);const Gc=e=>t=>x(void 0,void 0,void 0,function*(){return yield t.awaitModel(e)}),Uc=e=>t=>x(void 0,void 0,void 0,function*(){return(yield t.awaitModel(e)).getValidValue()});var Hc,Bc,zc,Vc,Yc,Wc,$c,Kc,Xc,qc,Zc,Jc,Qc,eu,tu,nu,ru,ou,iu,au,su;!function(e){e.id="GRAPH_ENABLE_MULTI_SELECT",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Hc||(Hc={})),function(e){e.id="GRAPH_FULLSCREEN",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Bc||(Bc={})),function(e){e.id="IS_NODE_SELECTED",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(zc||(zc={})),function(e){e.id="IS_GROUP_SELECTED",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Vc||(Vc={})),function(e){e.id="IS_NORMAL_NODES_SELECTED",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Yc||(Yc={})),function(e){e.id="LAST_SELECTED_CELL",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Wc||(Wc={})),function(e){e.id="SELECTED_CELLS",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}($c||($c={})),function(e){e.id="LAST_SELECTED_NODE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Kc||(Kc={})),function(e){e.id="SELECTED_NODES",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Xc||(Xc={})),function(e){e.id="SELECTED_EDGES",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(qc||(qc={})),function(e){e.id="SELECTED_GROUPS",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Zc||(Zc={})),function(e){e.id="CONTEXTMENU_NODE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Jc||(Jc={})),function(e){e.id="CONTEXTMENU_EDGE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(Qc||(Qc={})),function(e){e.id="CONTEXTMENU_TARGET",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(eu||(eu={})),function(e){e.id="GRAPH_META",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(tu||(tu={})),function(e){e.id="GRAPH_SCALE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(nu||(nu={})),function(e){e.id="COMMAND_REDOABLE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(ru||(ru={})),function(e){e.id="COMMAND_UNDOABLE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(ou||(ou={})),function(e){e.id="COMMAND_GLOBALS",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(iu||(iu={})),function(e){e.id="HISTORY_UNDOABLE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(au||(au={})),function(e){e.id="HISTORY_REDOABLE",e.getModel=Gc(e.id),e.useValue=Uc(e.id)}(su||(su={}));let lu=class{registerModel(e){e.registerModel({id:ru.id,getInitialValue:()=>this.commands.isRedoable,watchChange:e=>x(this,void 0,void 0,function*(){return this.commands.watchChange(()=>{e.setValue(this.commands.isRedoable)})})}),e.registerModel({id:ou.id,getInitialValue:()=>this.commands.isUndoable,watchChange:e=>x(this,void 0,void 0,function*(){return this.commands.watchChange(()=>{e.setValue(this.commands.isUndoable)})})}),e.registerModel({id:iu.id,modelFactory:()=>this.commands.Globals})}};y([nr(qd),b("design:type",Object)],lu.prototype,"commands",void 0),lu=y([tr({contrib:ac})],lu);const du=(e,t,n)=>(e.on(t,n),Er.create(()=>{e.off(t,n)}));let cu=class{constructor(){this.getGraphInstance=()=>x(this,void 0,void 0,function*(){return{graph:yield this.graphProvider.getGraphInstance(),config:yield this.graphProvider.getGraphOptions()}})}registerModel(e){e.registerModel({id:tu.id,getInitialValue:()=>({flowId:"-1"}),watchChange:e=>x(this,void 0,void 0,function*(){return Er.create(()=>{e.setValue({flowId:"-1"})})})}),e.registerModel({id:Hc.id,getInitialValue:()=>({isEnable:!1}),watchChange:e=>x(this,void 0,void 0,function*(){return Er.create(()=>{e.setValue({isEnable:!1})})})}),e.registerModel({id:Bc.id,getInitialValue:()=>!1,watchChange:(e,t)=>x(this,void 0,void 0,function*(){const n=()=>x(this,void 0,void 0,function*(){const e=!!document.fullscreenElement;(yield Bc.getModel(t)).setValue(e)});return document.addEventListener("fullscreenchange",n,!1),Er.create(()=>{document.removeEventListener("fullscreenchange",n),e.setValue(!1)})})}),e.registerModel({id:$c.id,getInitialValue:()=>[],watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t}=yield this.getGraphInstance(),n=t=>{const{selected:n}=t;e.setValue(n)};return t.on("selection:changed",n),Er.create(()=>t.off("selection:changed",n))})}),e.registerModel({id:Wc.id,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield $c.getModel(t)).watch((t=[])=>{e.setValue([...t].pop()||null)})})}),e.registerModel({id:Xc.id,getInitialValue:()=>[],watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield $c.getModel(t)).watch((t=[])=>{const n=t.filter(e=>e.isNode());e.setValue(n)})})}),e.registerModel({id:Kc.id,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield Xc.getModel(t)).watch(t=>{e.setValue([...t].pop()||null)})})}),e.registerModel({id:zc.id,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield Xc.getModel(t)).watch(t=>{e.setValue(t.length>0)})})}),e.registerModel({id:Vc.id,getInitialValue:()=>!1,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield $c.getModel(t)).watch(t=>{const n=t.every(e=>e&&!0===e.getProp("isGroup"));e.setValue(n)})})}),e.registerModel({id:Zc.id,getInitialValue:()=>[],watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield Xc.getModel(t)).watch(t=>{const n=t.filter(e=>e&&!0===e.getProp("isGroup"));e.setValue(n)})})}),e.registerModel({id:Yc.id,getInitialValue:()=>!1,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield $c.getModel(t)).watch(t=>{const n=t.every(e=>{const t=!(e&&e.getProp("isGroup")),n=!(e&&e.getProp("group"));return t&&n}),r=t.length>0&&n;e.setValue(r)})})}),e.registerModel({id:nu.id,getInitialValue:()=>({zoomFactor:-1}),watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t}=yield this.getGraphInstance(),n=n=>{const r=t.zoom();e.setValue(Object.assign(Object.assign({},n),{zoomFactor:r}))};return t.on("scale",n),Er.create(()=>t.off("scale",n))})}),e.registerModel({id:eu.id,watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t,config:n}=yield this.getGraphInstance(),r=r=>o=>{const{x:i,y:a}=o,s=t.localToClient({x:i,y:a}),l=n.rootContainer.getBoundingClientRect(),d={x:s.x-((null==l?void 0:l.x)||0),y:s.y-((null==l?void 0:l.y)||0)};e.setValue({type:r,anchor:d,data:o,cell:o.cell})},o=new Or;return o.pushAll([du(t,"node:contextmenu",r("node")),du(t,"edge:contextmenu",r("edge")),du(t,"blank:contextmenu",r("blank"))]),o})}),e.registerModel({id:su.id,getInitialValue:()=>!1,watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t}=yield this.getGraphInstance(),n=()=>{const n=t.history.canRedo();e.setValue(n)};return t.history&&t.history.on("change",n),Er.create(()=>t.history.off("change",n))})}),e.registerModel({id:au.id,getInitialValue:()=>!1,watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t}=yield this.getGraphInstance(),n=()=>{const n=t.history.canUndo();e.setValue(n)};return t.history&&t.history.on("change",n),Er.create(()=>t.history.off("change",n))})})}};y([nr(Dc),b("design:type",Object)],cu.prototype,"graphProvider",void 0),cu=y([tr({contrib:ac})],cu),hr(e=>{pr.register(e,ac),e(Fc),e(cu),e(lu)});const uu=e=>{const t=[],n=[],r=e=>{e.isNode()&&t.push((e=>{const t=e.getChildren(),n=e.getSize(),r=e.getData()||{},o=e.getPosition(),i=e.getParentId(),{isCollapsed:a}=r,s=r.groupCollapsedSize||(a?n:null);return Object.assign(Object.assign({},r),{id:e.id,width:n.width,height:n.height,x:o.x,y:o.y,group:i,groupChildren:t?t.map(e=>e.id):null,groupCollapsedSize:s})})(e)),e.isEdge()&&n.push((e=>{const t=e.getData()||{};return Object.assign({id:e.id},t)})(e))};return e.map(e=>r(e)),{nodes:t,edges:n}};let fu=class{constructor(){this.getGraphInstance=()=>this.graphProvider.getGraphInstance(),this.getGraphConfig=()=>this.graphProvider.getGraphOptions(),this.getGraphData=()=>x(this,void 0,void 0,function*(){const e=(yield this.graphProvider.getGraphInstance()).getCells();return uu(e)}),this.getAllNodes=()=>x(this,void 0,void 0,function*(){return(yield this.graphProvider.getGraphInstance()).getNodes()}),this.getNodeById=e=>x(this,void 0,void 0,function*(){return(yield this.graphProvider.getGraphInstance()).getCellById(e)}),this.getAllEdges=()=>x(this,void 0,void 0,function*(){return(yield this.graphProvider.getGraphInstance()).getEdges()}),this.getEdgeById=e=>x(this,void 0,void 0,function*(){return(yield this.graphProvider.getGraphInstance()).getCellById(e)}),this.updateNodeAttrs=(e,t)=>x(this,void 0,void 0,function*(){if(e instanceof n.Node)e.setAttrs(t);else{(yield this.getNodeById(e)).setAttrs(t)}}),this.updateEdgeAttrs=(e,t)=>x(this,void 0,void 0,function*(){if(e instanceof n.Edge)e.setAttrs(t);else{(yield this.getEdgeById(e)).setAttrs(t)}}),this.translateGraph=(e,t)=>x(this,void 0,void 0,function*(){const n=yield this.graphProvider.getGraphInstance(),r=n.translate();n.translate(r.tx+e,r.ty+t)})}start(){return x(this,void 0,void 0,function*(){yield this.startContributions(),this.registerEventListeners()})}executeCommand(e,t,n=[]){return this.commandService.executeCommand(e,t,n)}executeCommandPipeline(e){return this.commandService.executeCommandPipeline(e)}registerEventListeners(){window.addEventListener("unload",()=>{this.stopContributions()})}startContributions(){return x(this,void 0,void 0,function*(){for(const e of this.contributions.getContributions())if(e.onStart)try{yield this.measure(`${e.constructor.name}.onStart`,()=>e.onStart(this))}catch(e){console.error("Could not start contribution",e)}})}stopContributions(){console.info(">>> Stopping frontend contributions...");for(const e of this.contributions.getContributions())if(e.onStop)try{e.onStop(this)}catch(e){console.error("Could not stop contribution",e)}console.info("<<< All frontend contributions have been stopped.")}measure(e,t){return x(this,void 0,void 0,function*(){const n=`${e}-start`,r=`${e}-end`;performance.mark(n);const o=yield t();performance.mark(r),performance.measure(e,n,r);for(const t of performance.getEntriesByName(e)){const e=`Frontend ${t.name}`;t.duration>100?console.warn(`${e} is slow, took: ${t.duration.toFixed(1)} ms`):console.debug(`${e} took: ${t.duration.toFixed(1)} ms`)}return performance.clearMeasures(e),o})}};y([gr(Xd),b("design:type",Object)],fu.prototype,"contributions",void 0),y([nr(Dc),b("design:type",Object)],fu.prototype,"graphProvider",void 0),y([nr(qd),b("design:type",Object)],fu.prototype,"commandService",void 0),y([nr(ic),b("design:type",Object)],fu.prototype,"modelService",void 0),fu=y([tr()],fu),hr(e=>{pr.register(e,Xd),e(fu)});const hu=u.default.createContext({configProvider:null}),pu=e=>{const t=u.default.useContext(hu);return u.default.useMemo(()=>t.configProvider?t.configProvider.getXflowPrefixCls(e):`xflow-${e}`,[e])};function gu(e){const{createModule:t,children:n}=e,r=Ac(),o=u.default.useMemo(()=>e.config||{CONFIG_TYPE:"",getConfig:()=>x(this,void 0,void 0,function*(){return{}})},[]);return u.default.useEffect(()=>{const e=r.addExtension({config:o,createModule:t});return()=>{e.dispose()}},[]),Array.isArray(n)||u.default.isValidElement(n)?u.default.createElement(u.default.Fragment,null," ",n," "):null}const vu=(e={})=>t.useMemo(()=>{const t=Object.entries(e),n=t.length>0?{position:"absolute"}:{};return t.forEach(([e,t=0])=>{n[e]=`${t}px`}),n},[e]),mu=e=>hr(t=>{(e=>{e(Rc),e(Dc,{lifecycle:Rn.Lifecycle.singleton,useDynamic:e=>({getGraphInstance:()=>x(void 0,void 0,void 0,function*(){const t=e.container.get(Rc),n=e.container.get(dl),r=yield null==n?void 0:n.getOptions();return yield null==t?void 0:t.getGraph(r.graphId)}),getGraphOptions:()=>x(void 0,void 0,void 0,function*(){const t=e.container.get(dl);return null==t?void 0:t.getOptions()})})}),e(jc,{lifecycle:Rn.Lifecycle.singleton,useDynamic:e=>({getCommandService:()=>x(void 0,void 0,void 0,function*(){return e.container.get(qd)})})}),e(Ic,{lifecycle:Rn.Lifecycle.singleton,useDynamic:e=>({getModelService:()=>x(void 0,void 0,void 0,function*(){return e.container.get(ic)})})})})(t),((e,t)=>{e(dl,{lifecycle:Rn.Lifecycle.singleton,useDynamic:()=>({getOptions:()=>x(void 0,void 0,void 0,function*(){return t.getConfig()})})})})(t,e)}),yu=e=>{const t=qs(),n=u.default.useRef(null),r=u.default.useRef(null),o=Ac(),a=u.default.useMemo(()=>{const t=e.config?e.config:new ll;return t.setX6Config(),t},[]),[s,l]=i.usePortal(a.graphId);u.default.useEffect(()=>{t&&t.getGraphInstance().then(e=>{l(e)})},[t,l]),u.default.useEffect(()=>{a.setRootContainer(n.current),a.setGraphContainer(r.current),a.xflowInstanceId=o.getInstanceId(),o.addCoreModule({config:a,createModule:mu});return()=>{x(void 0,void 0,void 0,function*(){a.dispose()})}},[]);const d=vu(e.position),c=pu("canvas-root"),f=pu("x6-canvas");return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{ref:n,className:c,style:d,id:a.graphId,tabIndex:0},u.default.createElement("div",{ref:r,className:f}),e.children),u.default.createElement(s,null))};yu.defaultProps={isXFlowCanvas:!0};let bu=class{constructor(){this.toDispose=new Or,this.runtimeHooks=[],this.getX6Graph=()=>x(this,void 0,void 0,function*(){if(this.graph)return this.graph;const e=yield this.graphProvider.getGraphInstance();return this.graph=e,e}),this.getGraphConfig=()=>x(this,void 0,void 0,function*(){return this.graphProvider.getGraphOptions()}),this.getGraphMeta=()=>x(this,void 0,void 0,function*(){const e=this.getModelService();return this.graphMeta||(yield tu.useValue(e))}),this.setArgs=(e,t=[])=>(this.args=e,this.runtimeHooks=t,{args:e,hooks:t}),this.getArgs=()=>({args:Object.assign(Object.assign({},this.args),{modelService:this.getModelService(),commandService:this.getCommands(),getGraphMeta:this.getGraphMeta,getX6Graph:this.getX6Graph,getGraphConfig:this.getGraphConfig}),hooks:this.runtimeHooks}),this.setResult=e=>(this.result=e,this.result),this.getResult=()=>this.result,this.getHooks=()=>this.hookService.hookProvider(),this.getCommands=()=>this.commandService,this.getModelService=()=>this.modelService,this.addUndo=e=>{if(!Array.isArray(e))return this.addUndo([e]);this.toDispose.pushAll(e)},this.undo=()=>x(this,void 0,void 0,function*(){yield this.toDispose.dispose()}),this.isUndoable=()=>!this.toDispose.disposed,this.getDisposables=()=>this.toDispose,this.setGlobal=(e,t)=>{this.commandService.setGlobal(e,t)},this.getGlobal=e=>this.commandService.getGlobal(e)}init(){this.getGraphMeta().then(e=>{this.graphMeta=e})}};y([nr(Dc),b("design:type",Object)],bu.prototype,"graphProvider",void 0),y([nr(vc),b("design:type",Object)],bu.prototype,"hookService",void 0),y([nr(qd),b("design:type",Object)],bu.prototype,"commandService",void 0),y([nr(ic),b("design:type",Object)],bu.prototype,"modelService",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],bu.prototype,"init",null),bu=y([er()],bu);const xu=()=>[];class wu{constructor(){this.setCommandContributions=e=>{this.getContributions=e},this.getCommandContributions=()=>this.getContributions(),this.registerHook=e=>x(this,void 0,void 0,function*(){return this.registerHookFn?this.registerHookFn(e):Sc}),this.registerHookHub=e=>x(this,void 0,void 0,function*(){return this.registerHookHubFn?this.registerHookHubFn(e):Sc}),this.CONFIG_TYPE="CommandConfig",this.setRegisterHookFn=e=>{this.registerHookFn=e},this.setRegisterHookHubFn=e=>{this.registerHookHubFn=e},this.getConfig=()=>x(this,void 0,void 0,function*(){return{registerHookFn:this.registerHookFn,getContributions:this.getContributions,CONFIG_TYPE:this.CONFIG_TYPE}}),this.getContributions=xu}}var _u;!function(e){e.command=Zs.ADD_NODE,e.hookKey="addNode"}(_u||(_u={}));let Eu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.addNode.call(t,t=>x(this,void 0,void 0,function*(){const{createNodeService:n,cellFactory:r,commandService:o,options:i}=t,a=yield e.getX6Graph();let s=t.nodeConfig;if(n){const e=yield n(t);if("boolean"==typeof e)return{err:"createNodeService rejected"};s=e}const l=yield this.processNodeConfig(s);let d;const c=Object.assign(Object.assign({},i),{isCommand:!0});if(r){const e=yield r(l,this);d=a.addNode(e,c)}else d=a.addNode(l,c);return e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){const e=Object.assign({id:d.id},d.getData());o.executeCommand(Zs.DEL_NODE.id,{nodeConfig:e})}))),{nodeConfig:l,nodeCell:d}}),n);return e.setResult(o),this}),this.processNodeConfig=e=>x(this,void 0,void 0,function*(){const t=this.contextProvider();if(e.data=Object.assign({},e),e.shape)return e;if(!e.view){const n=yield t.getGraphConfig();e.view=n.graphId}if(!e.component){const n=yield this.getNodeReactComponent(e),r=t.getCommands(),o=t.getModelService();e.shape="react-shape",e.component=Pc(n,r,o)}return e}),this.getNodeReactComponent=e=>x(this,void 0,void 0,function*(){const t=this.contextProvider(),n=t.getHooks(),r=yield t.getGraphConfig(),o=yield n.reactNodeRender.call(r.nodeRender),i=r.nodeTypeParser(e)||Nr,a=o.get(i);return a||console.error("react node component is missing:",r.nodeRender,i,a),a}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Su;y([nr(Jd),b("design:type",Object)],Eu.prototype,"contextProvider",void 0),Eu=y([er({token:{token:Zd,named:_u.command.id}})],Eu),function(e){e.command=Zs.DEL_NODE,e.hookKey="delNode",e.createHook=()=>new gc}(Su||(Su={}));let Cu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.delNode.call(t,t=>x(this,void 0,void 0,function*(){const{commandService:n,deleteNodeService:r,options:o}=t,i=yield e.getX6Graph();if(r){if(!(yield r(t)))return{err:" service rejected"}}const a=(t.x6Node||t.nodeConfig).id,s=i.getCellById(a);if(s&&s.isNode()){const t=[...i.getIncomingEdges(s)||[],...i.getOutgoingEdges(s)||[]];yield Promise.all(t.map(e=>n.executeCommand(Js.DEL_EDGE.id,{x6Edge:e})));const r=s.getData();return s.remove(Object.assign(Object.assign({},o),{isCommand:!0})),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){yield n.executeCommand(Zs.ADD_NODE.id,{nodeConfig:r})}))),{err:null,nodeConfig:r}}return{err:"node is not exist"}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){if(this.isUndoable()){this.contextProvider().undo()}return this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Ou;y([nr(Jd),b("design:type",Object)],Cu.prototype,"contextProvider",void 0),Cu=y([er({token:{token:Zd,named:Su.command.id}})],Cu),function(e){e.command=Zs.SELECT_NODE,e.hookKey="selectNode"}(Ou||(Ou={}));let ku=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.selectNode.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),n=t.getSelectedCells().map(e=>e.id),{nodeIds:r,resetSelection:o,commandService:i}=e;return o?t.resetSelection(r):t.select(r),this.ctx.addUndo({dispose:()=>{i.executeUndoCommand(Zs.SELECT_NODE.id,{nodeIds:n,resetSelection:!0})}}),{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Mu;y([nr(Jd),b("design:type",Object)],ku.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],ku.prototype,"init",null),ku=y([er({token:{token:Zd,named:Ou.command.id}})],ku),function(e){e.command=Zs.MOVE_NODE,e.hookKey="moveNode",e.createHook=()=>new gc}(Mu||(Mu={}));let Nu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.moveNode.call(t,t=>x(this,void 0,void 0,function*(){const{nodePositionService:n}=t;if(n){if(!(yield n(t)))return{err:"service rejected"}}const{dx:r=0,dy:o=0,x:i,y:a,duration:s=150}=t.position,l=(yield e.getX6Graph()).getCellById(t.id);if(l){let t=i,n=a;const{x:d,y:c}=l.position();let u=()=>{l.position(d,c,{silent:!1})};return r||o?(t=r+d,n=o+c,l.translate(r,o,{transition:{duration:s}}),u=()=>l.translate(-r,-o,{transition:{duration:s}})):l.position(t,n,{silent:!1}),e.addUndo(Er.create(()=>{u()})),{err:null,nextX:t,nextY:n}}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};y([nr(Jd),b("design:type",Object)],Nu.prototype,"contextProvider",void 0),Nu=y([er({token:{token:Zd,named:Mu.command.id}})],Nu);var Au=zo,Tu=Vo;var Pu,Du=function(e){return!0===e||!1===e||Tu(e)&&"[object Boolean]"==Au(e)};!function(e){e.command=Zs.UPDATE_NODE,e.hookKey="updateNode",e.XFlowNodeSetOptions={overwrite:!0},e.NODE_WIDTH=200,e.NODE_HEIGHT=40}(Pu||(Pu={}));let ju=class{constructor(){this.setNodeConfig=(e,t,n)=>{e.setData(t,n),e.setPosition((null==t?void 0:t.x)||0,(null==t?void 0:t.y)||0),e.setSize((null==t?void 0:t.width)||Pu.NODE_WIDTH,(null==t?void 0:t.height)||Pu.NODE_HEIGHT),e.angle((null==t?void 0:t.angle)||0,{absolute:!0}),Du(null==t?void 0:t.visible)&&e.setVisible(null==t?void 0:t.visible),e instanceof i.ReactShape||!e.getAttrByPath("text/text")||e.setAttrByPath("text/text",t.label),t.attrs&&e.setAttrs(t.attrs),Array.isArray(t.ports)&&e.setPropByPath("ports/items",t.ports,Object.assign({rewrite:!0},n))},this.getNodeConfig=e=>{const t=e.getData(),n=e.getPosition(),r=e.getSize();return Object.assign(Object.assign(Object.assign({},t),n),r)},this.getNodeCell=(e,t)=>{const{nodeConfig:r,setNodeConfig:o}=t;let i="";return o&&o.node&&"string"==typeof o.node?i=o.node:r&&r.id&&"string"==typeof r.id&&(i=r.id),i?null==e?void 0:e.getCellById(i):o&&o.node instanceof n.Node?o.node:void 0},this.getNextNodeConfig=(e,t)=>x(this,void 0,void 0,function*(){if(e&&e.setNodeConfig&&e.setNodeConfig.callback){const n=this.getNodeConfig(t);return e.setNodeConfig.callback(n)}return e.nodeConfig}),this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.updateNode.call(e,e=>x(this,void 0,void 0,function*(){const{options:t=Pu.XFlowNodeSetOptions}=e,n=yield this.ctx.getX6Graph(),r=this.getNodeCell(n,e),o=yield this.getNextNodeConfig(e,r);return this.setNodeConfig(r,o,t),{nodeConfig:o,nodeCell:r}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Iu;y([nr(Jd),b("design:type",Object)],ju.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],ju.prototype,"init",null),ju=y([er({token:{token:Zd,named:Pu.command.id}})],ju),function(e){e.command=Zs.CENTER_NODE,e.hookKey="centerNode"}(Iu||(Iu={}));let Ru=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.centerNode.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{nodeConfig:n}=e,r=null==t?void 0:t.getCellById(null==n?void 0:n.id);return null==t||t.centerCell(r),{x6Node:r}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Lu;y([nr(Jd),b("design:type",Object)],Ru.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Ru.prototype,"init",null),Ru=y([er({token:{token:Zd,named:Iu.command.id}})],Ru),function(e){e.command=Zs.FRONT_NODE,e.hookKey="frontNode"}(Lu||(Lu={}));let Fu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.frontNode.call(t,t=>x(this,void 0,void 0,function*(){const n=yield this.ctx.getX6Graph(),{nodeId:r}=t,o=null==n?void 0:n.getCellById(r);return o?(o.toFront(),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){t.commandService.executeCommand(Zs.BACK_NODE.id,{nodeId:r})})))):console.error(r,"this nodeId is not exist"),{}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Gu;y([nr(Jd),b("design:type",Object)],Fu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Fu.prototype,"init",null),Fu=y([er({token:{token:Zd,named:Lu.command.id}})],Fu),function(e){e.command=Zs.BACK_NODE,e.hookKey="backNode"}(Gu||(Gu={}));let Uu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.backNode.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{nodeId:n}=e,r=null==t?void 0:t.getCellById(n);return r?(r.toBack(),this.ctx.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){e.commandService.executeCommand(Zs.FRONT_NODE.id,{nodeId:n})})))):console.error(n,"this nodeId is not exist"),{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Hu;y([nr(Jd),b("design:type",Object)],Uu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Uu.prototype,"init",null),Uu=y([er({token:{token:Zd,named:Gu.command.id}})],Uu),function(e){e.command=Zs.HIGHLIGHT_NODE,e.hookKey="highlightNode"}(Hu||(Hu={}));let Bu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.highlightNode.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{nodeId:n,stroke:r,strokeWidth:o}=e,i=null==t?void 0:t.getCellById(n);if(!i)return console.error(n,"this nodeId is not exist"),{err:"this nodeId is not exist"};if(null==i||i.setAttrs({body:{stroke:r||"#7c68fc",strokeWidth:o||2}}),null==e?void 0:e.isHighlightRelatedLines){const{edgeStroke:n,edgeStrokeWidth:r}=e;(null==t?void 0:t.getEdges()).forEach(t=>{const o=null==t?void 0:t.getData();null==e||e.commandService.executeCommand(Js.HIGHLIGHT_EDGE.id,{edgeId:null==o?void 0:o.id,strokeColor:n,strokeWidth:r})})}return{err:null}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var zu;y([nr(Jd),b("design:type",Object)],Bu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Bu.prototype,"init",null),Bu=y([er({token:{token:Zd,named:Hu.command.id}})],Bu),function(e){e.command=Zs.UPDATE_NODE_PORT,e.hookKey="updateNodePort"}(zu||(zu={}));let Vu=class{constructor(){this.getCell=(e,t)=>"string"==typeof t?e.getCellById(t):t,this.getNodeConfig=e=>{const t=e.getData(),n=e.getPosition(),r=e.getSize();return Object.assign(Object.assign(Object.assign({},t),n),r)},this.updatePortsOfNodeConfig=(e,t,n)=>{const r=this.getNodeConfig(e);this.isNodeAnchors(r.ports)&&(r.ports=[...t]),this.isPortMetaData(r.ports)&&(r.ports.items=[...t]),e.setData(r,n)},this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield e.getX6Graph(),i=yield r.updateNodePort.call(t,t=>x(this,void 0,void 0,function*(){const{node:n,updatePorts:r,options:i,commandService:a}=t,s=this.getCell(o,n);if(!s||s.isEdge())return console.error("node_is _not_exsit",n),{err:"node_is _not_exsit"};const l=s.getPorts(),d=yield r([...l],s,o);return!1===d?{err:"service rejected"}:(s.setPropByPath("ports/items",d,Object.assign({rewrite:!0},i)),this.updatePortsOfNodeConfig(s,d,i),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){a.executeCommand(Zs.UPDATE_NODE_PORT.id,{node:n,updatePorts:()=>x(this,void 0,void 0,function*(){return l})})}))),{ports:d})}),n);return e.setResult(i),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isNodeAnchors(e){return Array.isArray(e)}isPortMetaData(e){return e.items&&Array.isArray(e.items)}isUndoable(){return this.contextProvider().isUndoable()}};y([nr(Jd),b("design:type",Object)],Vu.prototype,"contextProvider",void 0),Vu=y([er({token:{token:Zd,named:zu.command.id}})],Vu);const Yu=[_u,Su,Ou,Mu,Pu,Iu,Lu,Gu,Hu,zu];var Wu;!function(e){e.command=Qs.LOAD_META,e.hookKey="graphMeta"}(Wu||(Wu={}));let $u=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.graphMeta.call(e,e=>x(this,void 0,void 0,function*(){const{graphMetaService:t}=e,n=t?yield t(e):Object.assign({},null==e?void 0:e.meta);return Object.assign({flowId:null==n?void 0:n.flowId},n)}),t),o=this.ctx.getModelService();return(yield tu.getModel(o)).setValue(r),this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Ku;y([nr(Jd),b("design:type",Object)],$u.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],$u.prototype,"init",null),$u=y([er({token:{token:Zd,named:Wu.command.id}})],$u),function(e){e.command=Qs.SAVE_GRAPH_DATA,e.hookKey="saveGraphData"}(Ku||(Ku={}));let Xu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.ctx,t=e.getArgs(),n=e.getHooks();return yield n.saveGraphData.call(t.args,t=>x(this,void 0,void 0,function*(){const{saveGraphDataService:n,includeAttrs:r}=t,o=yield e.getX6Graph(),i=o.getNodes(),a=o.getEdges(),s={nodes:i.map(e=>{const t=e.getData(),n=e.position(),o=e.size(),i=Object.assign(Object.assign(Object.assign({id:e.id},t),n),o);return r&&(i.attrs=e.getAttrs()),i}),edges:a.map(e=>{const t=e.getData(),n=Object.assign({id:e.id},t);return r&&(n.attrs=e.getAttrs()),n})},l=yield this.ctx.getGraphMeta();if(n){const e=yield n(l,s);e&&this.ctx.setResult(e)}return{}}),t.hooks),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var qu;y([nr(Jd),b("design:type",Object)],Xu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Xu.prototype,"init",null),Xu=y([er({token:{token:Zd,named:Ku.command.id}})],Xu),function(e){e.command=Qs.LOAD_DATA,e.hookKey="loadData",e.createHook=()=>new gc}(qu||(qu={}));let Zu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.loadData.call(e,e=>x(this,void 0,void 0,function*(){const{loadDataService:t}=e,n=yield this.ctx.getGraphMeta();return{graphData:yield t(n)}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Ju;y([nr(Jd),b("design:type",Object)],Zu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Zu.prototype,"init",null),Zu=y([er({token:{token:Zd,named:qu.command.id}})],Zu),function(e){e.command=Qs.GRAPH_LAYOUT,e.hookKey="graphLayout"}(Ju||(Ju={}));let Qu=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.graphLayout.call(e,e=>x(this,void 0,void 0,function*(){const{layoutType:t,layoutOptions:n,customLayout:r}=e,o=r||(e=>new(0,p.Layouts[t])(Object.assign({},n)).layout(e));return yield o(e.graphData),{graphData:e.graphData}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var ef,tf;y([nr(Jd),b("design:type",Object)],Qu.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Qu.prototype,"init",null),Qu=y([er({token:{token:Zd,named:Ju.command.id}})],Qu),function(e){e.isNodeEqual=function(e,t){return o.isEqual(e,t)},e.isEdgeEqual=function(e,t){return o.isEqual(e,t)}}(ef||(ef={})),function(e){e.command=Qs.GRAPH_RENDER,e.hookKey="graphRender"}(tf||(tf={}));let nf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.graphRender.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),n=yield this.ctx.getGraphMeta(),{beforeRender:r,graphData:o,isNodeEqual:i,isEdgeEqual:a,afterRender:s}=e;return r&&r(n),yield this.doLoadGraph(t,o,i,a),s&&s(o,n),{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this}),this.doLoadGraph=(e,t,n,r)=>x(this,void 0,void 0,function*(){(null==e?void 0:e.isFrozen())||null==e||e.freeze();const o=this.ctx.getCommands(),{addNodeConfigs:i,addEdgeConfigs:a,removeNodes:s,removeEdges:l,updateNodes:d,updateEdges:c}=this.graphDataDiff(e,t,n,r);for(const e of d){const t=null==e?void 0:e.getData();yield o.executeCommand(Zs.UPDATE_NODE.id,{nodeConfig:t})}for(const e of c){const t=null==e?void 0:e.getData();yield o.executeCommand(Js.UPDATE_EDGE.id,{edgeConfig:t})}for(const e of i)yield o.executeCommand(Zs.ADD_NODE.id,{nodeConfig:e,options:{isRenderGraph:!0}},{name:"remove servcie",handler:e=>x(this,void 0,void 0,function*(){delete e.createNodeService})});yield o.executeCommand(tl.INIT_GROUP.id,{graphData:{nodes:i,edges:[]}});for(const e of a)yield o.executeCommand(Js.ADD_EDGE.id,{edgeConfig:e,options:{isRenderGraph:!0}},{name:"remove servcie",handler:e=>x(this,void 0,void 0,function*(){delete e.createEdgeService})});for(const e of s){const t=null==e?void 0:e.getData();t.isGroup?yield o.executeCommand(tl.DEL_GROUP.id,{nodeConfig:t}):yield o.executeCommand(Zs.DEL_NODE.id,{nodeConfig:t})}for(const e of l){const t=null==e?void 0:e.getData();yield o.executeCommand(Js.DEL_EDGE.id,{edgeConfig:t})}(null==e?void 0:e.isFrozen())&&(null==e||e.unfreeze())})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}graphDataDiff(e,t,n,r){const{nodes:o,edges:i}=t,a=[];o.forEach(t=>{e.getCellById(null==t?void 0:t.id)||a.push(t)});const s=[],l=[],d=[];e.getNodes().forEach(e=>{const t=o.find(t=>(null==t?void 0:t.id)===(null==e?void 0:e.id));if(t){let r=!0;n?r=n(null==e?void 0:e.data,t):(null==e?void 0:e.data)&&t&&(r=ef.isNodeEqual(null==e?void 0:e.data,t)),r||e.setData(t,{deep:!1}),!0===r?s.push(e):l.push(e)}else d.push(e)});const c=[];i.forEach(t=>{e.getCellById(null==t?void 0:t.id)||c.push(t)});const u=[],f=[],h=[];return e.getEdges().forEach(e=>{const t=i.find(t=>(null==t?void 0:t.id)===(null==e?void 0:e.id));if(t){let n=!0;r?n=r(null==e?void 0:e.data,t):(null==e?void 0:e.data)&&t&&(n=ef.isEdgeEqual(null==e?void 0:e.data,t)),n||e.setData(t,{deep:!1}),!0===n?u.push(e):f.push(e)}else h.push(e)}),{addNodeConfigs:a,addEdgeConfigs:c,retainNodes:s,retainEdges:u,removeNodes:d,removeEdges:h,updateNodes:l,updateEdges:f}}};var rf;y([nr(Jd),b("design:type",Object)],nf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],nf.prototype,"init",null),nf=y([er({token:{token:Zd,named:tf.command.id}})],nf),function(e){e.command=Qs.GRAPH_RESIZE,e.hookKey="graphResize"}(rf||(rf={}));let of=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield this.ctx.getGraphConfig(),o=r.rootContainer.clientHeight,i=r.rootContainer.clientWidth,a=yield n.graphResize.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{width:n=i,height:r=o}=e;return null==t||t.resize(n,r),{}}),t);return this.ctx.setResult(a),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var af;y([nr(Jd),b("design:type",Object)],of.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],of.prototype,"init",null),of=y([er({token:{token:Zd,named:rf.command.id}})],of),function(e){e.command=Qs.GRAPH_FULLSCREEN,e.hookKey="graphFullscreen"}(af||(af={}));let sf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield this.ctx.getGraphConfig(),{appContainer:o}=r;if(!o)return;const i=yield n.graphFullscreen.call(e,()=>x(this,void 0,void 0,function*(){var e,t;let n=!1;return document.fullscreenElement?null===(t=document.exitFullscreen)||void 0===t||t.call(document):(null===(e=o.requestFullscreen)||void 0===e||e.call(o),n=!0),{fulllscreen:n}}),t);return this.ctx.setResult(i),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var lf;y([nr(Jd),b("design:type",Object)],sf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],sf.prototype,"init",null),sf=y([er({token:{token:Zd,named:af.command.id}})],sf),function(e){e.command=Qs.GRAPH_ZOOM,e.MAX_SCALE=1.5,e.MIN_SCALE=.05,e.defaultZoomOptions={maxScale:e.MAX_SCALE,minScale:e.MIN_SCALE},e.hookKey="graphZoom"}(lf||(lf={}));let df=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.graphZoom.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{factor:n,zoomFitPadding:r=12,zoomOptions:o=lf.defaultZoomOptions}=e;return"number"==typeof n?null==t||t.zoom(n,o||{}):"fit"===n?null==t||t.zoomToFit(Object.assign(Object.assign({},o),{padding:r})):"real"===n&&(null==t||t.scale(1),null==t||t.centerContent()),{factor:n,zoomFitPadding:r,zoomOptions:o}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var cf;y([nr(Jd),b("design:type",Object)],df.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],df.prototype,"init",null),df=y([er({token:{token:Zd,named:lf.command.id}})],df),function(e){e.command=Qs.GRAPH_COPY,e.hookKey="graphCopySelection"}(cf||(cf={}));let uf=class{constructor(){this.parseCells=e=>{e.forEach(t=>{const n=t.getData();if(t.isNode()&&n.isGroup){t.getChildren().forEach(t=>{e.push(t)})}});const t=e.filter(e=>e.isNode()).map(e=>e.id),n=e.reduce((e,n)=>{if(n.isEdge()){const r=n.getSourceCellId(),o=n.getTargetCellId();r&&o&&t.includes(r)&&t.includes(o)&&e.set(n.id,n)}else e.set(n.id,n);return e},new Map),r=Array.from(n.values());return uu(r)},this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.graphCopySelection.call(t,()=>x(this,void 0,void 0,function*(){const t=(yield e.getX6Graph()).getSelectedCells(),n=this.parseCells(t),r=window.localStorage.getItem(Tr);return window.localStorage.setItem(Tr,JSON.stringify(n)),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){window.localStorage.setItem(Tr,r)}))),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};y([nr(Jd),b("design:type",Object)],uf.prototype,"contextProvider",void 0),uf=y([er({token:{token:Zd,named:cf.command.id}})],uf);let ff=class{constructor(){this.groupNodeMap=new Map,this.nodeMap=new Map,this.nodeMappingRecord=new Map,this.portMap=new Map,this.portMappingRecord=new Map,this.edgeMap=new Map,this.edgeMappingRecord=new Map,this.getNodesByType=e=>e.reduce((e,t)=>(t.isGroup?e.groupNodes.push(t):e.normalNodes.push(t),e),{normalNodes:[],groupNodes:[]}),this.getNodePorts=e=>Array.isArray(e.ports)?e.ports:e.ports&&Array.isArray(e.ports.items)?e.ports.items:[],this.addNodes=e=>{e.forEach(e=>{if(e.isGroup)this.groupNodeMap.set(e.id,e);else{const t=this.getNodePorts(e);this.nodeMap.set(e.id,e),t.forEach(e=>{this.portMap.set(e.id,e)})}})},this.addEdge=e=>{e.forEach(e=>{this.edgeMap.set(e.id,e)})},this.buildNodeMapping=(e,t)=>{const n=e.id||e.originId,r=t.id;this.nodeMappingRecord.set(n,r);this.getNodePorts(e).forEach((e,n)=>{const r=t.ports[n];r&&(this.portMap.set(r.id,r),this.portMappingRecord.set(e.id,r.id))})},this.createEdgeBetweenNodes=e=>{const{source:t,sourcePortId:n,target:r,targetPortId:o}=e;return Object.assign(Object.assign({},e),{source:this.nodeMappingRecord.get(t),target:this.nodeMappingRecord.get(r),sourcePortId:this.portMappingRecord.get(n),targetPortId:this.portMappingRecord.get(o),sourcePort:this.portMappingRecord.get(n),targetPort:this.portMappingRecord.get(o)})},this.buildGroupRelations=e=>{const{groupChildren:t}=e,n=t.map(e=>this.nodeMappingRecord.get(e));return Object.assign(Object.assign({},e),{groupChildren:n})}}};var hf,pf;function gf(e,t=0){return Math.floor(Math.random()*(e-t)+t)}ff=y([er()],ff),function(e){e.command=Qs.GRAPH_PASTE,e.hookKey="graphPasteSelection"}(pf||(pf={}));let vf=hf=class{constructor(){this.updateNodeCopiedProps=(e,t)=>{let n=gf(100),r=gf(100);return e&&(n=t.x-e.x+gf(30),r=t.y-e.y+gf(30)),t.x+=n,t.y+=r,t.originId=t.id,delete t.id,t.label=`${t.label}_copied`,t.isCollapsed=!1,t},this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks();if(hf.doing)return this;hf.doing=!0;const o=yield r.graphPasteSelection.call(t,t=>x(this,void 0,void 0,function*(){const{commandService:n,position:r}=t,o=function(e,t=null){try{return JSON.parse(e)||t}catch(e){return console.error(e),t}}(window.localStorage.getItem(Tr),{nodes:[],edges:[]}),{nodes:i=[],edges:a=[]}=o,{normalNodes:s,groupNodes:l}=this.mappingHelper.getNodesByType(i);return this.mappingHelper.addNodes(i),yield Promise.all(s.map(e=>x(this,void 0,void 0,function*(){const t=(yield n.executeCommand(Zs.ADD_NODE.id,{nodeConfig:this.updateNodeCopiedProps(r,e)})).contextProvider().getResult();this.mappingHelper.buildNodeMapping(e,t.nodeConfig)}))),yield Promise.all(l.map(e=>x(this,void 0,void 0,function*(){const t=this.mappingHelper.buildGroupRelations(e);yield n.executeCommand(tl.ADD_GROUP.id,{nodeConfig:this.updateNodeCopiedProps(r,t)})}))),yield Promise.all(a.map(e=>{const t=this.mappingHelper.createEdgeBetweenNodes(e);return n.executeCommand(Js.ADD_EDGE.id,{edgeConfig:t})})),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){window.localStorage.setItem(Tr,null)}))),{err:null}}),n);return e.setResult(o),hf.doing=!1,this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var mf;vf.doing=!1,y([nr(Jd),b("design:type",Object)],vf.prototype,"contextProvider",void 0),y([nr(ff),b("design:type",ff)],vf.prototype,"mappingHelper",void 0),vf=hf=y([er({token:{token:Zd,named:pf.command.id}})],vf),function(e){e.command=Qs.GRAPH_TOGGLE_MULTI_SELECT,e.hookKey="toggleMultiSelect"}(mf||(mf={}));let yf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.toggleMultiSelect.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),n=yield this.ctx.getGraphConfig(),{isEnable:r,modelService:o}=e,i=yield Hc.getModel(o),a="boolean"==typeof r?r:!t.isRubberbandEnabled();return a?(t.enableRubberband(),t.scroller&&t.scroller.widget?t.scroller.disablePanning():t.disablePanning(),n.graphContainer.style.cursor="crosshair"):(t.disableRubberband(),t.scroller&&t.scroller.widget?t.scroller.enablePanning():t.enablePanning(),n.graphContainer.style.cursor="grab"),i.setValue({isEnable:a}),{isEnable:a}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var bf;y([nr(Jd),b("design:type",Object)],yf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],yf.prototype,"init",null),yf=y([er({token:{token:Zd,named:mf.command.id}})],yf),function(e){e.command=Qs.GRAPH_HISTORY_UNDO,e.hookKey="historyUndo"}(bf||(bf={}));let xf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.historyUndo.call(t,t=>x(this,void 0,void 0,function*(){const n=yield e.getX6Graph();return!1===n.isHistoryEnabled()?{err:"history is disabled"}:(n.undo(),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){const{commandService:e}=t;e.executeCommand(Qs.GRAPH_HISTORY_REDO.id,{})}))),{err:null})}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var wf;y([nr(Jd),b("design:type",Object)],xf.prototype,"contextProvider",void 0),xf=y([er({token:{token:Zd,named:bf.command.id}})],xf),function(e){e.command=Qs.GRAPH_HISTORY_REDO,e.hookKey="historyRedo"}(wf||(wf={}));let _f=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.historyRedo.call(t,t=>x(this,void 0,void 0,function*(){const n=yield e.getX6Graph();return!1===n.isHistoryEnabled()?{err:"history is disabled"}:(n.redo(),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){const{commandService:e}=t;e.executeCommand(Qs.GRAPH_HISTORY_UNDO.id,{})}))),{err:null})}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Ef;y([nr(Jd),b("design:type",Object)],_f.prototype,"contextProvider",void 0),_f=y([er({token:{token:Zd,named:wf.command.id}})],_f),function(e){e.command=Qs.GRAPH_HISTORY_TOGGLE,e.hookKey="historyToggle"}(Ef||(Ef={}));let Sf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.historyToggle.call(t,t=>x(this,void 0,void 0,function*(){const n=yield e.getX6Graph();if(!1===n.isHistoryEnabled())return{err:"history is disabled"};const r=n.isHistoryEnabled(),{enabled:o}=t;return n.toggleHistory(o),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){const{commandService:e}=t;e.executeCommand(Qs.GRAPH_HISTORY_TOGGLE.id,{enabled:r})}))),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Cf;y([nr(Jd),b("design:type",Object)],Sf.prototype,"contextProvider",void 0),Sf=y([er({token:{token:Zd,named:Ef.command.id}})],Sf),function(e){e.command=Qs.GRAPH_HISTORY_RESET,e.hookKey="historyReset"}(Cf||(Cf={}));let Of=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.historyReset.call(t,()=>x(this,void 0,void 0,function*(){return(yield e.getX6Graph()).cleanHistory(),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var kf;y([nr(Jd),b("design:type",Object)],Of.prototype,"contextProvider",void 0),Of=y([er({token:{token:Zd,named:Cf.command.id}})],Of),function(e){e.command=Qs.GRAPH_ADD_TOOL,e.hookKey="addTool"}(kf||(kf={}));let Mf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.addTool.call(t,t=>x(this,void 0,void 0,function*(){const{cellId:n,toolConfig:r,commandService:o}=t,i=(yield e.getX6Graph()).getCellById(n);return i&&(i.addTools(r.items,r.options),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){Array.isArray(r.items)&&r.items.forEach(e=>{o.executeCommand(Qs.GRAPH_DEL_TOOL.id,{cellId:n,toolname:e})})})))),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Nf;y([nr(Jd),b("design:type",Object)],Mf.prototype,"contextProvider",void 0),Mf=y([er({token:{token:Zd,named:kf.command.id}})],Mf),function(e){e.command=Qs.GRAPH_DEL_TOOL,e.hookKey="delTool"}(Nf||(Nf={}));let Af=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.delTool.call(t,t=>x(this,void 0,void 0,function*(){const{cellId:n,toolName:r,toolConfig:o}=t,i=(yield e.getX6Graph()).getCellById(n);return i&&("*"===r?i.removeTools(o):i.removeTool(r,o)),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Tf;y([nr(Jd),b("design:type",Object)],Af.prototype,"contextProvider",void 0),Af=y([er({token:{token:Zd,named:Nf.command.id}})],Af),function(e){e.command=Qs.REDO_CMD,e.hookKey="redoCommand"}(Tf||(Tf={}));let Pf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.ctx,{args:t,hooks:n}=e.getArgs(),r=e.getHooks();return yield r.redoCommand.call(t,()=>x(this,void 0,void 0,function*(){const t=e.getCommands();return t.isRedoable&&t.redoCommand(),this.ctx.addUndo(Er.create(()=>{t.redoCommand()})),{}}),n),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Df;y([nr(Jd),b("design:type",Object)],Pf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Pf.prototype,"init",null),Pf=y([er({token:{token:Zd,named:Tf.command.id}})],Pf),function(e){e.command=Qs.UNDO_CMD,e.hookKey="undoCommand"}(Df||(Df={}));let jf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.ctx,{args:t,hooks:n}=e.getArgs(),r=e.getHooks();return yield r.undoCommand.call(t,()=>x(this,void 0,void 0,function*(){const t=e.getCommands();return t.isUndoable&&t.undoCommand(),this.ctx.addUndo(Er.create(()=>{t.redoCommand()})),{}}),n),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};y([nr(Jd),b("design:type",Object)],jf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],jf.prototype,"init",null),jf=y([er({token:{token:Zd,named:Df.command.id}})],jf);const If=[Wu,Ku,qu,bf,wf,Cf,Ef,Ju,tf,rf,af,Tf,Df,lf,mf,cf,pf,kf,Nf];var Rf;!function(e){function t(e){return e.source&&e.source.cell&&n.StringExt.isString(e.source.cell)}function r(e){return e.sourceCell&&n.StringExt.isString(e.sourceCell)}e.command=Js.ADD_EDGE,e.hookKey="addEdge",e.createEdgeId=e=>{if(n.StringExt.isString(e.source))return`${e.source}:${e.sourcePortId}-${e.target}:${e.targetPortId}`;if(t(e)){const t=e;return`${t.source.cell}:${t.source.port}-${t.target.cell}:${t.target.port}`}if(r(e)){const t=e;return`${t.sourceCell}:${t.sourcePort}-${t.targetCell}:${t.targetPort}`}},e.isX6EdgeConfig=t,e.isX6EdgePlainConfig=r}(Rf||(Rf={}));let Lf=class{constructor(){this.processEdgeConfig=(e,t)=>x(this,void 0,void 0,function*(){if(!t.id){const{createIdService:n=Rf.createEdgeId}=e;t.id=yield n(t)}return t.sourcePortId&&!t.sourcePort&&(t.sourcePort=t.sourcePortId,t.targetPort=t.targetPortId),t}),this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.addEdge.call(e,e=>x(this,void 0,void 0,function*(){const{cellFactory:t,createEdgeService:n,commandService:r,options:o}=e,i=yield this.ctx.getX6Graph();let a=e.edgeConfig;if(n){const t=yield n(e);if("boolean"==typeof t)return{err:"createEdgeService rejected"};a=t}const s=yield this.processEdgeConfig(e,a);let l;const d=Object.assign(Object.assign({},o),{isCommand:!0});if(t){const e=yield t(s,this);l=i.addEdge(e,d)}else l=i.addEdge(Object.assign(Object.assign({},s),{label:(null==s?void 0:s.label)||s,data:Object.assign({},s)}),d);const c=Er.create(()=>{r.executeCommand(Js.DEL_EDGE.id,{x6Edge:l})});return this.ctx.addUndo(c),{edgeConfig:s,edgeCell:l}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Ff;y([nr(Jd),b("design:type",Object)],Lf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Lf.prototype,"init",null),Lf=y([er({token:{token:Zd,named:Rf.command.id}})],Lf),function(e){var t;e.command=Js.DEL_EDGE,e.hookKey="delEdge",(t=e.ErrEnum||(e.ErrEnum={})).EDGE_NOT_EXIST="edge is not exist",t.EDGE_INVALID_CELL="this is not a valid cell",t.X6_DELETE_FAILED="x6 throw err when call delete edge",t.SERVICE_REJECT="service reject to delete"}(Ff||(Ff={}));let Gf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.delEdge.call(e,e=>x(this,void 0,void 0,function*(){const{edgeConfig:t,x6Edge:n,deleteEdgeService:r,commandService:o,options:i}=e;let a=n;if(!a&&(a=yield this.findEdgeById(t),!a))return console.error(Ff.ErrEnum.EDGE_NOT_EXIST,t),{err:Ff.ErrEnum.EDGE_NOT_EXIST};if(!(a&&a.isEdge()))return console.error(Ff.ErrEnum.EDGE_NOT_EXIST,a),{err:Ff.ErrEnum.EDGE_NOT_EXIST};if(r){if(!(yield r(e)))return{err:Ff.ErrEnum.SERVICE_REJECT}}try{const e=a.getTargetCell(),t=a.getSourceCell(),n=a.getSourcePortId(),r=a.getTargetPortId(),s=t?t.id:t.source,l=e?e.id:e.target;a.remove(Object.assign(Object.assign({},i),{isCommand:!0}));const d=Er.create(()=>{o.executeCommand(Js.ADD_EDGE.id,{edgeConfig:{source:s,target:l,sourcePortId:n,targetPortId:r}})});return this.ctx.addUndo(d),{err:null,edgeConfig:{source:s,target:l,sourcePortId:n,targetPortId:r},targetCell:e,sourceCell:t,sourcePortId:n,targetPortId:r}}catch(e){return console.error(Ff.ErrEnum.X6_DELETE_FAILED,e),{err:Ff.ErrEnum.X6_DELETE_FAILED}}}),t);return this.ctx.setResult(r),this}),this.findEdgeById=e=>x(this,void 0,void 0,function*(){return(yield this.ctx.getX6Graph()).getCellById(e.id)}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};y([nr(Jd),b("design:type",Object)],Gf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Gf.prototype,"init",null),Gf=y([er({token:{token:Zd,named:Ff.command.id}})],Gf);var Uf,Hf=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};!function(e){e.command=Js.UPDATE_EDGE,e.hookKey="updateEdge",e.XFlowEdgeSetOptions={overwrite:!0},e.XFlowUpdateLabelService=(t,n,r=e.XFlowEdgeSetOptions)=>x(this,void 0,void 0,function*(){null==t||t.setLabelAt(0,(null==n?void 0:n.label)||n,r)})}(Uf||(Uf={}));let Bf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.updateEdge.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{updateEdgeService:n,updateEdgeLabelService:r=Uf.XFlowUpdateLabelService,options:o=Uf.XFlowEdgeSetOptions}=e,i=n?yield n(e):null==e?void 0:e.edgeConfig,a=null==t?void 0:t.getCellById(null==i?void 0:i.id);return null==a||a.setData(i,o),(null==i?void 0:i.hasOwnProperty("label"))&&(yield r(a,i,o)),Du(null==i?void 0:i.visible)&&a.setVisible(null==i?void 0:i.visible),i.attrs&&a.setAttrs(i.attrs),i.vertices&&a.setVertices(i.vertices),i.router&&a.setRouter(i.router),i.connector&&a.setConnector(i.connector),Hf(i.source)&&a.setSource(i.source),Hf(i.target)&&a.setTarget(i.target),{edgeConfig:i,edgeCell:a}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var zf;y([nr(Jd),b("design:type",Object)],Bf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Bf.prototype,"init",null),Bf=y([er({token:{token:Zd,named:Uf.command.id}})],Bf),function(e){e.command=Js.HIGHLIGHT_EDGE,e.hookKey="highlightEdge"}(zf||(zf={}));let Vf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.highlightEdge.call(e,e=>x(this,void 0,void 0,function*(){var t,n;const r=yield this.ctx.getX6Graph(),{edgeId:o,strokeColor:i,strokeWidth:a}=e,s=r.getEdges(),l=s.find(e=>e.id===o),d=s.filter(e=>e.id!==o);if(l){const r=l.getAttrs();(null===(t=null==r?void 0:r.line)||void 0===t?void 0:t.stroke)===i&&(null===(n=null==r?void 0:r.line)||void 0===n?void 0:n.strokeWidth)===a||(null==l||l.setAttrs({line:{stroke:i,strokeWidth:a||2}}),d.forEach(e=>{e.setAttrs({line:null==r?void 0:r.line})}),e.commandService.executeCommand(Js.FRONT_EDGE.id,{edgeId:o}))}else console.error(o,"this edgeId is not exist");return{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var Yf;y([nr(Jd),b("design:type",Object)],Vf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Vf.prototype,"init",null),Vf=y([er({token:{token:Zd,named:zf.command.id}})],Vf),function(e){e.command=Js.FRONT_EDGE,e.hookKey="frontEdge"}(Yf||(Yf={}));let Wf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.frontEdge.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{edgeId:n}=e,r=null==t?void 0:t.getCellById(n);return r?(r.toFront(),this.ctx.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){e.commandService.executeCommand(Js.BACK_EDGE.id,{edgeId:n})})))):console.error(n,"this edgeId is not exist"),{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};var $f;y([nr(Jd),b("design:type",Object)],Wf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Wf.prototype,"init",null),Wf=y([er({token:{token:Zd,named:Yf.command.id}})],Wf),function(e){e.command=Js.BACK_EDGE,e.hookKey="frontEdge"}($f||($f={}));let Kf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.frontEdge.call(e,e=>x(this,void 0,void 0,function*(){const t=yield this.ctx.getX6Graph(),{edgeId:n}=e,r=null==t?void 0:t.getCellById(n);return r?(r.toBack(),this.ctx.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){e.commandService.executeCommand(Js.FRONT_EDGE.id,{edgeId:n})})))):console.error(n,"this edgeId is not exist"),{}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};y([nr(Jd),b("design:type",Object)],Kf.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],Kf.prototype,"init",null),Kf=y([er({token:{token:Zd,named:$f.command.id}})],Kf);const Xf=[Rf,Ff,Uf,zf,Yf,$f];var qf;!function(e){e.command=tl.ADD_GROUP,e.hookKey="addGroup",e.GROUP_PADDING=12,e.GROUP_HEADER_HEIGHT=40}(qf||(qf={}));let Zf=class{constructor(){this.getBBox=(e,t,n)=>{const{groupHeaderHeight:r=qf.GROUP_HEADER_HEIGHT,groupPadding:o=qf.GROUP_PADDING}=t,i=n.getCellsBBox(e.children);return i.moveAndExpand({x:-o,y:-(o+r),width:2*o,height:2*o+r}),i},this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.addGroup.call(t,t=>x(this,void 0,void 0,function*(){const{nodeConfig:n,createService:r,cellFactory:o,commandService:i}=t,a=yield e.getX6Graph(),s=yield i.executeCommand(Zs.ADD_NODE.id,{cellFactory:o,createNodeService:r,nodeConfig:n}),{nodeCell:l}=s.contextProvider().getResult(),{id:d}=l,{groupChildren:c}=n;if(c.length){c.forEach(e=>{const t=a.getCellById(e);t&&(t.setData(Object.assign(Object.assign({},t.getData()),{group:d,isCollapsed:!1})),t.prop("group",d),l.addChild(t),a.unselect(t))});const e=this.getBBox(l,n,a);l.position(e.x,e.y),l.size(e.width,e.height),l.setZIndex(0),l.prop("isGroup",!0),l.setData(Object.assign(Object.assign({},l.getData()),{width:e.width,height:e.height,groupChildrenSize:{width:e.width,height:e.height},x:e.x,y:e.y,isGroup:!0})),a.select(l)}return n.isCollapsed&&(yield i.executeCommand(tl.COLLAPSE_GROUP.id,{nodeId:n.id,isCollapsed:n.isCollapsed})),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){i.executeCommand(tl.DEL_GROUP.id,{nodeConfig:n})}))),{nodeConfig:n,nodeCell:l}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Jf;y([nr(Jd),b("design:type",Object)],Zf.prototype,"contextProvider",void 0),Zf=y([er({token:{token:Zd,named:qf.command.id}})],Zf),function(e){e.command=tl.DEL_GROUP,e.hookKey="delGroup"}(Jf||(Jf={}));let Qf=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.delGroup.call(t,t=>x(this,void 0,void 0,function*(){const n=yield e.getX6Graph(),{nodeConfig:r,commandService:o,deleteService:i}=t,{id:a}=r,s=n.getCellById(a);if(i){if(!(yield i(t)))return{err:"service rejected"}}if(!s)return{err:"target node is not exist"};if(!0!==s.getProp("isGroup"))return{err:"target node is not group"};const{isCollapsed:l}=s.getData();l&&(yield o.executeCommand(tl.COLLAPSE_GROUP.id,{nodeId:s.id,isCollapsed:!1,collapsedSize:{width:0,height:0}}));const d=s.getChildren();return d&&d.forEach(e=>{s.unembed(e),e.prop("group",""),e.setData(Object.assign(Object.assign({},e.getData()),{group:""}))}),yield o.executeCommand(Zs.DEL_NODE.id,{nodeConfig:r}),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){o.executeCommand(tl.ADD_GROUP.id,{nodeConfig:r})}))),{err:null}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var eh;y([nr(Jd),b("design:type",Object)],Qf.prototype,"contextProvider",void 0),Qf=y([er({token:{token:Zd,named:Jf.command.id}})],Qf),function(e){e.command=tl.INIT_GROUP,e.hookKey="initGroup"}(eh||(eh={}));let th=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.initGroup.call(t,t=>x(this,void 0,void 0,function*(){const{graphData:n,commandService:r}=t,o=yield e.getX6Graph(),{nodes:i}=n,a={};return i.forEach(e=>{const{id:t,group:n}=e;n&&(a[n]?a[n].push(t):a[n]=[t])}),Object.keys(a).forEach(e=>x(this,void 0,void 0,function*(){const n=o.getCellById(e),i=n.getData(),s=a[e]||[];n.prop("isGroup",!0),n.setData(Object.assign(Object.assign({},i),{isGroup:!0,groupChildren:s})),s.forEach(e=>{const t=o.getCellById(e);n.embed(t)}),n.toBack();const{isCollapsed:l,groupCollapsedSize:d}=i;if(l){const e=t.collapsedSize||d||Pr;yield r.executeCommand(tl.COLLAPSE_GROUP.id,{collapsedSize:e,isCollapsed:!0,nodeId:n.id})}})),{}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var nh;y([nr(Jd),b("design:type",Object)],th.prototype,"contextProvider",void 0),th=y([er({token:{token:Zd,named:eh.command.id}})],th),function(e){e.command=tl.COLLAPSE_GROUP,e.hookKey="collapseGroup"}(nh||(nh={}));let rh=class{constructor(){this.toggleVisible=(e,t,n)=>{e.forEach(e=>{n.findViewByCell(e).container.style.visibility=t?"visible":"hidden"})},this.toggleCollapse=(e,t,n)=>{const r=e.getChildren().filter(e=>e.isNode()),o=e.getData(),{isCollapsed:i,gap:a=0}=n;if(i){const t=n.collapsedSize||o.groupCollapsedSize||Pr;e.prop("previousSize",e.size()),e.size(t)}else e.size(e.prop("previousSize"));r&&r.forEach(n=>{const o=e.position(),s=t.getConnectedEdges(n).filter(e=>{const t=e.getSourceNode(),n=e.getTargetNode();return r.includes(t)&&r.includes(n)});if(i){this.toggleVisible([n,...s],!1,t),n.prop("previousSize",n.size()),n.prop("previousRelativePosition",n.position({relative:!0})),n.position(o.x+a,o.y+a);const r=e.size();n.size({width:r.width-2*a,height:r.height-2*a})}else{this.toggleVisible([n,...s],!0,t);const e=n.prop("previousRelativePosition"),r=n.prop("previousSize");n.position(e.x,e.y,{relative:!0}),n.size(r)}}),e.prop("isCollapsed",i),e.setData(Object.assign(Object.assign({},e.getData()),{isCollapsed:i}))},this.execute=()=>x(this,void 0,void 0,function*(){const{args:e,hooks:t}=this.ctx.getArgs(),n=this.ctx.getHooks(),r=yield n.collapseGroup.call(e,t=>x(this,void 0,void 0,function*(){const n=yield this.ctx.getX6Graph(),r=n.getCellById(e.nodeId),{toggleService:o}=t;if(o){if(!(yield o(t)))return{err:"service rejected"}}return r&&(this.toggleCollapse(r,n,e),this.ctx.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){r&&this.toggleCollapse(r,n,Object.assign(e,{isCollapsed:!e.isCollapsed}))})))),{err:null}}),t);return this.ctx.setResult(r),this}),this.undo=()=>x(this,void 0,void 0,function*(){return this.ctx.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.ctx.isUndoable||(yield this.execute()),this})}init(){this.ctx=this.contextProvider()}isUndoable(){return this.ctx.isUndoable()}};y([nr(Jd),b("design:type",Object)],rh.prototype,"contextProvider",void 0),y([S.postConstruct(),b("design:type",Function),b("design:paramtypes",[]),b("design:returntype",void 0)],rh.prototype,"init",null),rh=y([er({token:{token:Zd,named:nh.command.id}})],rh);const oh=[qf,Jf,eh,nh];var ih;!function(e){e.command=el.UPDATE_MODEL,e.hookKey="updateModel"}(ih||(ih={}));let ah=class{constructor(){this.execute=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider(),{args:t,hooks:n}=e.getArgs(),r=e.getHooks(),o=yield r.updateModel.call(t,t=>x(this,void 0,void 0,function*(){const{updateModel:n,getModel:r,modelService:o}=t,i=yield r(o),a=i.getValue(),s=Wd(a);yield n(s);const l=$d(s);return i.setValue(l),e.addUndo(Er.create(()=>x(this,void 0,void 0,function*(){i.setValue(l)}))),{model:i,value:l}}),n);return e.setResult(o),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};y([nr(Jd),b("design:type",Object)],ah.prototype,"contextProvider",void 0),ah=y([er({token:{token:Zd,named:ih.command.id}})],ah);const sh=[...Yu,...Xf,...oh,...If,...[ih]],lh=()=>new gc;let dh=class{constructor(){this.registerHook=e=>x(this,void 0,void 0,function*(){const t=e.x6Events.registerHook({name:"bind group node move event",handler:e=>x(this,void 0,void 0,function*(){const t={eventName:"node:moving",callback:({node:e})=>x(this,void 0,void 0,function*(){if(e.prop("isGroup"))return void e.prop("originPosition",e.getPosition());const t=e.model.graph,{group:n}=e.getData(),r=t.getNodes().find(e=>e.id===n);if(!r)return;const o=r.getProp("isCollapsed");let i=r.getProp("originSize"),a=!1;null==i&&(i=r.size(),r.prop("originSize",i));let s=r.prop("originPosition");null==s&&(s=r.getPosition(),r.prop("originPosition",s));let l=s.x,d=s.y,c=s.x+i.width,u=s.y+i.height;const f=r.getChildren();if(f&&f.forEach(e=>{const t=e.getBBox().inflate(12),n=t.getCorner();t.x<l&&(l=t.x,a=!0),t.y<d&&(d=t.y,a=!0),n.x>c&&(c=n.x,a=!0),n.y>u&&(u=n.y,a=!0)}),a){r.prop({position:{x:l,y:d},size:{width:c-l,height:u-d}});const e=Object.assign(Object.assign({},r.getData()),{x:l,y:d,width:c-l,height:u-d});!0!==o&&(e.groupChildrenSize={width:c-l,height:u-d}),r.setData(e)}})};e.push(t)})});return Er.create(()=>{t.dispose()})}),this.registerHookHub=e=>x(this,void 0,void 0,function*(){const t=new Or;return sh.forEach(({hookKey:n,createHook:r=lh})=>{const o=e.registerHookHub(n,r());t.push(o)}),this.commandConfig.getConfig().then(({getContributions:n})=>{n().forEach(({hookKey:n,createHook:r=lh})=>{const o=e.registerHookHub(n,r());t.push(o)})}),t})}registerGraphCommands(e){sh.forEach(({command:t})=>{e.registerCommand(t,{createCommand:this.commandFactory})}),this.commandConfig.getConfig().then(({getContributions:t})=>{t().forEach(t=>{e.registerCommand(t.command,{createCommand:this.commandFactory})})})}};y([nr(Qd),b("design:type",Function)],dh.prototype,"commandFactory",void 0),y([nr(wu),b("design:type",wu)],dh.prototype,"commandConfig",void 0),dh=y([tr({contrib:[ec,mc]})],dh);const ch=Symbol("IToolbarService"),uh=Rn.defineToken("IToolbarContribution");var fh=No,hh=/\s/;var ph=function(e){for(var t=e.length;t--&&hh.test(e.charAt(t)););return t},gh=/^\s+/;var vh=function(e){return e?e.slice(0,ph(e)+1).replace(gh,""):e},mh=Hf,yh=$o,bh=/^[-+]0x[0-9a-f]+$/i,xh=/^0b[01]+$/i,wh=/^0o[0-7]+$/i,_h=parseInt;var Eh=Hf,Sh=function(){return fh.Date.now()},Ch=function(e){if("number"==typeof e)return e;if(yh(e))return NaN;if(mh(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=mh(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=vh(e);var n=xh.test(e);return n||wh.test(e)?_h(e.slice(2),n?2:8):bh.test(e)?NaN:+e},Oh=Math.max,kh=Math.min;var Mh=function(e,t,n){var r,o,i,a,s,l,d=0,c=!1,u=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,i=o;return r=o=void 0,d=t,a=e.apply(i,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-d>=i}function g(){var e=Sh();if(p(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return u?kh(n,i-(e-d)):n}(e))}function v(e){return s=void 0,f&&r?h(e):(r=o=void 0,a)}function m(){var e=Sh(),n=p(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return d=e,s=setTimeout(g,t),c?h(e):a}(l);if(u)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=Ch(t)||0,Eh(n)&&(c=!!n.leading,i=(u="maxWait"in n)?Oh(Ch(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f),m.cancel=function(){void 0!==s&&clearTimeout(s),d=0,r=l=o=s=void 0},m.flush=function(){return void 0===s?a:v(Sh())},m};var Nh=function(){this.__data__=[],this.size=0};var Ah=function(e,t){return e===t||e!=e&&t!=t},Th=Ah;var Ph=function(e,t){for(var n=e.length;n--;)if(Th(e[n][0],t))return n;return-1},Dh=Ph,jh=Array.prototype.splice;var Ih=Ph;var Rh=Ph;var Lh=Ph;var Fh=Nh,Gh=function(e){var t=this.__data__,n=Dh(t,e);return!(n<0)&&(n==t.length-1?t.pop():jh.call(t,n,1),--this.size,!0)},Uh=function(e){var t=this.__data__,n=Ih(t,e);return n<0?void 0:t[n][1]},Hh=function(e){return Rh(this.__data__,e)>-1},Bh=function(e,t){var n=this.__data__,r=Lh(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function zh(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zh.prototype.clear=Fh,zh.prototype.delete=Gh,zh.prototype.get=Uh,zh.prototype.has=Hh,zh.prototype.set=Bh;var Vh=zh,Yh=Vh;var Wh=function(){this.__data__=new Yh,this.size=0};var $h=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Kh=function(e){return this.__data__.get(e)};var Xh=function(e){return this.__data__.has(e)},qh=zo,Zh=Hf;var Jh,Qh=function(e){if(!Zh(e))return!1;var t=qh(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ep=No["__core-js_shared__"],tp=(Jh=/[^.]+$/.exec(ep&&ep.keys&&ep.keys.IE_PROTO||""))?"Symbol(src)_1."+Jh:"";var np=function(e){return!!tp&&tp in e},rp=Function.prototype.toString;var op=function(e){if(null!=e){try{return rp.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ip=Qh,ap=np,sp=Hf,lp=op,dp=/^\[object .+?Constructor\]$/,cp=Function.prototype,up=Object.prototype,fp=cp.toString,hp=up.hasOwnProperty,pp=RegExp("^"+fp.call(hp).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var gp=function(e){return!(!sp(e)||ap(e))&&(ip(e)?pp:dp).test(lp(e))},vp=function(e,t){return null==e?void 0:e[t]};var mp=function(e,t){var n=vp(e,t);return gp(n)?n:void 0},yp=mp(No,"Map"),bp=mp(Object,"create"),xp=bp;var wp=function(){this.__data__=xp?xp(null):{},this.size=0};var _p=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ep=bp,Sp=Object.prototype.hasOwnProperty;var Cp=function(e){var t=this.__data__;if(Ep){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Sp.call(t,e)?t[e]:void 0},Op=bp,kp=Object.prototype.hasOwnProperty;var Mp=bp;var Np=wp,Ap=_p,Tp=Cp,Pp=function(e){var t=this.__data__;return Op?void 0!==t[e]:kp.call(t,e)},Dp=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Mp&&void 0===t?"__lodash_hash_undefined__":t,this};function jp(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jp.prototype.clear=Np,jp.prototype.delete=Ap,jp.prototype.get=Tp,jp.prototype.has=Pp,jp.prototype.set=Dp;var Ip=jp,Rp=Vh,Lp=yp;var Fp=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Gp=function(e,t){var n=e.__data__;return Fp(t)?n["string"==typeof t?"string":"hash"]:n.map},Up=Gp;var Hp=Gp;var Bp=Gp;var zp=Gp;var Vp=function(){this.size=0,this.__data__={hash:new Ip,map:new(Lp||Rp),string:new Ip}},Yp=function(e){var t=Up(this,e).delete(e);return this.size-=t?1:0,t},Wp=function(e){return Hp(this,e).get(e)},$p=function(e){return Bp(this,e).has(e)},Kp=function(e,t){var n=zp(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Xp(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xp.prototype.clear=Vp,Xp.prototype.delete=Yp,Xp.prototype.get=Wp,Xp.prototype.has=$p,Xp.prototype.set=Kp;var qp=Xp,Zp=Vh,Jp=yp,Qp=qp;var eg=Vh,tg=Wh,ng=$h,rg=Kh,og=Xh,ig=function(e,t){var n=this.__data__;if(n instanceof Zp){var r=n.__data__;if(!Jp||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Qp(r)}return n.set(e,t),this.size=n.size,this};function ag(e){var t=this.__data__=new eg(e);this.size=t.size}ag.prototype.clear=tg,ag.prototype.delete=ng,ag.prototype.get=rg,ag.prototype.has=og,ag.prototype.set=ig;var sg=ag;var lg=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},dg=mp,cg=function(){try{var e=dg(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ug=cg;var fg=function(e,t,n){"__proto__"==t&&ug?ug(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},hg=fg,pg=Ah,gg=Object.prototype.hasOwnProperty;var vg=function(e,t,n){var r=e[t];gg.call(e,t)&&pg(r,n)&&(void 0!==n||t in e)||hg(e,t,n)},mg=vg,yg=fg;var bg=function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),o?yg(n,s,l):mg(n,s,l)}return n};var xg=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},wg=zo,_g=Vo;var Eg=function(e){return _g(e)&&"[object Arguments]"==wg(e)},Sg=Vo,Cg=Object.prototype,Og=Cg.hasOwnProperty,kg=Cg.propertyIsEnumerable,Mg=Eg(function(){return arguments}())?Eg:function(e){return Sg(e)&&Og.call(e,"callee")&&!kg.call(e,"callee")},Ng=Mg,Ag={exports:{}};var Tg=function(){return!1};!function(e,t){var n=No,r=Tg,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;e.exports=s}(Ag,Ag.exports);var Pg=/^(?:0|[1-9]\d*)$/;var Dg=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Pg.test(e))&&e>-1&&e%1==0&&e<t};var jg=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ig=zo,Rg=jg,Lg=Vo,Fg={};Fg["[object Float32Array]"]=Fg["[object Float64Array]"]=Fg["[object Int8Array]"]=Fg["[object Int16Array]"]=Fg["[object Int32Array]"]=Fg["[object Uint8Array]"]=Fg["[object Uint8ClampedArray]"]=Fg["[object Uint16Array]"]=Fg["[object Uint32Array]"]=!0,Fg["[object Arguments]"]=Fg["[object Array]"]=Fg["[object ArrayBuffer]"]=Fg["[object Boolean]"]=Fg["[object DataView]"]=Fg["[object Date]"]=Fg["[object Error]"]=Fg["[object Function]"]=Fg["[object Map]"]=Fg["[object Number]"]=Fg["[object Object]"]=Fg["[object RegExp]"]=Fg["[object Set]"]=Fg["[object String]"]=Fg["[object WeakMap]"]=!1;var Gg=function(e){return Lg(e)&&Rg(e.length)&&!!Fg[Ig(e)]};var Ug=function(e){return function(t){return e(t)}},Hg={exports:{}};!function(e,t){var n=Oo,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}(Hg,Hg.exports);var Bg=Gg,zg=Ug,Vg=Hg.exports,Yg=Vg&&Vg.isTypedArray,Wg=Yg?zg(Yg):Bg,$g=xg,Kg=Ng,Xg=Po,qg=Ag.exports,Zg=Dg,Jg=Wg,Qg=Object.prototype.hasOwnProperty;var ev=function(e,t){var n=Xg(e),r=!n&&Kg(e),o=!n&&!r&&qg(e),i=!n&&!r&&!o&&Jg(e),a=n||r||o||i,s=a?$g(e.length,String):[],l=s.length;for(var d in e)!t&&!Qg.call(e,d)||a&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Zg(d,l))||s.push(d);return s},tv=Object.prototype;var nv=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||tv)};var rv=function(e,t){return function(n){return e(t(n))}},ov=rv(Object.keys,Object),iv=nv,av=ov,sv=Object.prototype.hasOwnProperty;var lv=Qh,dv=jg;var cv=function(e){return null!=e&&dv(e.length)&&!lv(e)},uv=ev,fv=function(e){if(!iv(e))return av(e);var t=[];for(var n in Object(e))sv.call(e,n)&&"constructor"!=n&&t.push(n);return t},hv=cv;var pv=function(e){return hv(e)?uv(e):fv(e)},gv=bg,vv=pv;var mv=function(e,t){return e&&gv(t,vv(t),e)};var yv=Hf,bv=nv,xv=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},wv=Object.prototype.hasOwnProperty;var _v=ev,Ev=function(e){if(!yv(e))return xv(e);var t=bv(e),n=[];for(var r in e)("constructor"!=r||!t&&wv.call(e,r))&&n.push(r);return n},Sv=cv;var Cv=function(e){return Sv(e)?_v(e,!0):Ev(e)},Ov=bg,kv=Cv;var Mv=function(e,t){return e&&Ov(t,kv(t),e)},Nv={exports:{}};!function(e,t){var n=No,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(Nv,Nv.exports);var Av=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Tv=function(){return[]},Pv=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i},Dv=Tv,jv=Object.prototype.propertyIsEnumerable,Iv=Object.getOwnPropertySymbols,Rv=Iv?function(e){return null==e?[]:(e=Object(e),Pv(Iv(e),function(t){return jv.call(e,t)}))}:Dv,Lv=bg,Fv=Rv;var Gv=function(e,t){return Lv(e,Fv(e),t)};var Uv=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},Hv=rv(Object.getPrototypeOf,Object),Bv=Uv,zv=Hv,Vv=Rv,Yv=Tv,Wv=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Bv(t,Vv(e)),e=zv(e);return t}:Yv,$v=bg,Kv=Wv;var Xv=function(e,t){return $v(e,Kv(e),t)},qv=Uv,Zv=Po;var Jv=function(e,t,n){var r=t(e);return Zv(e)?r:qv(r,n(e))},Qv=Jv,em=Rv,tm=pv;var nm=function(e){return Qv(e,tm,em)},rm=Jv,om=Wv,im=Cv;var am=function(e){return rm(e,im,om)},sm=mp(No,"DataView"),lm=mp(No,"Promise"),dm=mp(No,"Set"),cm=sm,um=yp,fm=lm,hm=dm,pm=mp(No,"WeakMap"),gm=zo,vm=op,mm="[object Map]",ym="[object Promise]",bm="[object Set]",xm="[object WeakMap]",wm="[object DataView]",_m=vm(cm),Em=vm(um),Sm=vm(fm),Cm=vm(hm),Om=vm(pm),km=gm;(cm&&km(new cm(new ArrayBuffer(1)))!=wm||um&&km(new um)!=mm||fm&&km(fm.resolve())!=ym||hm&&km(new hm)!=bm||pm&&km(new pm)!=xm)&&(km=function(e){var t=gm(e),n="[object Object]"==t?e.constructor:void 0,r=n?vm(n):"";if(r)switch(r){case _m:return wm;case Em:return mm;case Sm:return ym;case Cm:return bm;case Om:return xm}return t});var Mm=km,Nm=Object.prototype.hasOwnProperty;var Am=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Nm.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Tm=No.Uint8Array,Pm=Tm;var Dm=function(e){var t=new e.constructor(e.byteLength);return new Pm(t).set(new Pm(e)),t},jm=Dm;var Im=function(e,t){var n=t?jm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Rm=/\w*$/;var Lm=function(e){var t=new e.constructor(e.source,Rm.exec(e));return t.lastIndex=e.lastIndex,t},Fm=Ao?Ao.prototype:void 0,Gm=Fm?Fm.valueOf:void 0;var Um=Dm;var Hm=function(e,t){var n=t?Um(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},Bm=Dm,zm=Im,Vm=Lm,Ym=function(e){return Gm?Object(Gm.call(e)):{}},Wm=Hm;var $m=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Bm(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return zm(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Wm(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Vm(e);case"[object Symbol]":return Ym(e)}},Km=Hf,Xm=Object.create,qm=function(){function e(){}return function(t){if(!Km(t))return{};if(Xm)return Xm(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Zm=Hv,Jm=nv;var Qm=function(e){return"function"!=typeof e.constructor||Jm(e)?{}:qm(Zm(e))},ey=Mm,ty=Vo;var ny=function(e){return ty(e)&&"[object Map]"==ey(e)},ry=Ug,oy=Hg.exports,iy=oy&&oy.isMap,ay=iy?ry(iy):ny,sy=Mm,ly=Vo;var dy=function(e){return ly(e)&&"[object Set]"==sy(e)},cy=Ug,uy=Hg.exports,fy=uy&&uy.isSet,hy=fy?cy(fy):dy,py=sg,gy=lg,vy=vg,my=mv,yy=Mv,by=Nv.exports,xy=Av,wy=Gv,_y=Xv,Ey=nm,Sy=am,Cy=Mm,Oy=Am,ky=$m,My=Qm,Ny=Po,Ay=Ag.exports,Ty=ay,Py=Hf,Dy=hy,jy=pv,Iy=Cv,Ry="[object Arguments]",Ly="[object Function]",Fy="[object Object]",Gy={};Gy[Ry]=Gy["[object Array]"]=Gy["[object ArrayBuffer]"]=Gy["[object DataView]"]=Gy["[object Boolean]"]=Gy["[object Date]"]=Gy["[object Float32Array]"]=Gy["[object Float64Array]"]=Gy["[object Int8Array]"]=Gy["[object Int16Array]"]=Gy["[object Int32Array]"]=Gy["[object Map]"]=Gy["[object Number]"]=Gy[Fy]=Gy["[object RegExp]"]=Gy["[object Set]"]=Gy["[object String]"]=Gy["[object Symbol]"]=Gy["[object Uint8Array]"]=Gy["[object Uint8ClampedArray]"]=Gy["[object Uint16Array]"]=Gy["[object Uint32Array]"]=!0,Gy["[object Error]"]=Gy[Ly]=Gy["[object WeakMap]"]=!1;var Uy=function e(t,n,r,o,i,a){var s,l=1&n,d=2&n,c=4&n;if(r&&(s=i?r(t,o,i,a):r(t)),void 0!==s)return s;if(!Py(t))return t;var u=Ny(t);if(u){if(s=Oy(t),!l)return xy(t,s)}else{var f=Cy(t),h=f==Ly||"[object GeneratorFunction]"==f;if(Ay(t))return by(t,l);if(f==Fy||f==Ry||h&&!i){if(s=d||h?{}:My(t),!l)return d?_y(t,yy(s,t)):wy(t,my(s,t))}else{if(!Gy[f])return i?t:{};s=ky(t,f,l)}}a||(a=new py);var p=a.get(t);if(p)return p;a.set(t,s),Dy(t)?t.forEach(function(o){s.add(e(o,n,r,o,t,a))}):Ty(t)&&t.forEach(function(o,i){s.set(i,e(o,n,r,i,t,a))});var g=u?void 0:(c?d?Sy:Ey:d?Iy:jy)(t);return gy(g||t,function(o,i){g&&(o=t[i=o]),vy(s,i,e(o,n,r,i,t,a))}),s},Hy=Uy;var By=function(e){return Hy(e,5)};let zy=class{constructor(){this.toDispose=new Or,this.toolbarItems=new Map,this.onDidChangeEvent=new Kd(null),this.onDidChange=this.onDidChangeEvent.watch,this.fireOnDidChange=Mh(()=>this.onDidChangeEvent.setValue(void 0),16),this.registerDisposableToolbar=e=>{const t=new Or,n={registerToolbarItem:e=>{const n=this.registerItem(e);return t.push(n),n}};return e(n),this.toDispose.push(t),t},this.getToolbarModel=e=>{const{layout:t,mainGroups:n=[],extraGroups:r=[]}=e;return new Kd({layout:t,mainGroups:this.createToolbarGroupModel(n),extraGroups:this.createToolbarGroupModel(r)})},this.createToolbarGroupModel=e=>{const t=e.map(e=>{const{items:t=[]}=e;return Object.assign(Object.assign({},e),{items:t.map(e=>this.createToolbarModel({id:e.id})).filter(e=>!!e)})});return t}}onStart(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerToolbarItems(this)}onStop(){this.toDispose.dispose()}registerItem(e){this.toolbarItems.has(e.id)&&console.warn(`ToolbarRegistry ${e.id} is duplicated, in`,e),this.toolbarItems.set(e.id,e),this.fireOnDidChange();return new Or(Er.create(()=>this.fireOnDidChange()),Er.create(()=>this.toolbarItems.delete(e.id)))}createToolbarModel(e){const t=By(this.toolbarItems.get(e.id)),n=!Du(t.isEnabled)||t.isEnabled,r=!Du(t.isVisible)||t.isVisible;return Object.assign(Object.assign({},t),{isEnabled:n,isVisible:r,iconName:t.iconName,text:t.text})}};y([nr(qd),b("design:type",Object)],zy.prototype,"commandService",void 0),y([nr(ic),b("design:type",Object)],zy.prototype,"modelService",void 0),y([gr(uh),b("design:type",Object)],zy.prototype,"contributionProvider",void 0),zy=y([tr({contrib:[Xd,ch]})],zy);const Vy=Symbol("IMenuService"),Yy=Rn.defineToken("IMenuContribution");var Wy;!function(e){e.Separator="separator",e.Submenu="submenu",e.Root="root",e.Leaf="leaf"}(Wy||(Wy={}));let $y=class{constructor(){this.toDispose=new Or,this.menuMap=new Map,this.getMenu=e=>this.menuMap.get(e),this.registerDisposableMenu=e=>{const t=new Or,n={registerMenu:e=>{const n=this.registerMenu(e);return t.push(n),n}};return e(n),this.toDispose.push(t),t}}onStart(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerMenu(this)}onStop(){this.toDispose.dispose()}registerMenu(e){return this.menuMap.set(e.id,e),Er.create(()=>this.menuMap.delete(e.id))}};y([gr(Yy),b("design:type",Object)],$y.prototype,"contributionProvider",void 0),$y=y([tr({contrib:[Xd,Vy]})],$y);const Ky=()=>{const e=u.default.useRef(!0);return u.default.useEffect(()=>()=>{e.current=!1},[]),e},Xy=e=>{const t=Ky(),[n,r]=u.default.useState(e.getValue());u.default.useEffect(()=>{const n=e.watch(e=>{(e=>e&&e.current)(t)&&r(e)});return()=>{n.dispose()}},[r]);const o=n,i=Yd.isValidValue(o);return[o,u.default.useCallback(t=>e.setValue(t),[e]),i]},qy=e=>{const t=u.default.useMemo(()=>new Kd(e),[]),[n,r,o]=Xy(t);return u.default.useEffect(()=>()=>{t.dispose()},[t]),[n,r,t,o]},Zy=Symbol("IKeyBindingService"),Jy=Rn.defineToken("IKeyBindingContribution"),Qy=Symbol("IKeyBindingOptionProvider");let eb=class{constructor(){this.toDispose=new Or,this.keyBindingMap=new Map,this.enabledKeyBindingMap=new Map,this.registerExternalKeybindings=()=>x(this,void 0,void 0,function*(){const{registerKeybindingFunc:e}=yield this.optionProvider.getOption();return e(this)}),this.registerKeybinding=(e=[])=>{const t=new Or;return e.forEach(e=>{this.keyBindingMap.set(e.id,e),this.enableKeyBindings(e.id).then(n=>{t.push(Er.create(()=>{n.dispose(),this.keyBindingMap.delete(e.id)}))})}),this.toDispose.push(t),t},this.enableKeyBindings=e=>x(this,void 0,void 0,function*(){this.disableKeyBindings([e]);const t=this.keyBindingMap.get(e),n=yield this.getX6Graph(),r=this.runCommand(t);n.bindKey(t.keybinding,r);const o=Er.create(()=>{n.unbindKey(t.keybinding),this.enabledKeyBindingMap.delete(t.id)});return this.enabledKeyBindingMap.set(t.id,o),o}),this.disableKeyBindings=e=>{e.forEach(e=>{const t=this.enabledKeyBindingMap.get(e);t&&t.dispose()})},this.runCommand=e=>t=>x(this,void 0,void 0,function*(){yield e.callback(e,this.modelService,this.commandService,t)}),this.getX6Graph=()=>x(this,void 0,void 0,function*(){return yield this.graphProvider.getGraphInstance()})}onStart(){const e=this.contributionProvider.getContributions();for(const t of e)t.registerKeybinding(this);this.registerExternalKeybindings()}onStop(){this.toDispose.dispose()}};var tb;y([nr(Qy),b("design:type",Object)],eb.prototype,"optionProvider",void 0),y([nr(qd),b("design:type",Object)],eb.prototype,"commandService",void 0),y([nr(ic),b("design:type",Object)],eb.prototype,"modelService",void 0),y([gr(Jy),b("design:type",Object)],eb.prototype,"contributionProvider",void 0),y([nr(Dc),b("design:type",Object)],eb.prototype,"graphProvider",void 0),eb=y([tr({contrib:[Xd,Zy]})],eb),function(e){e.CONFIG_TYPE="CONTEXT_CONFIG"}(tb||(tb={}));const nb=new class{constructor(){this.map=new Map([["default",Rs],["QuestionCircleOutlined",Rs]]),this.map.set("default",Rs),this.map.set("QuestionCircleOutlined",Rs)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t)}has(e){return this.map.has(e)}};let rb=class{constructor(){this.toDispose=new Or,this.registerHookHub=()=>x(this,void 0,void 0,function*(){return Er.create(()=>{})}),this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,n=[e.graphOptions.registerHook({name:"add snapline options",handler:e=>x(this,void 0,void 0,function*(){e.snapline={enabled:!0,className:"xflow-snapline",clean:5e3}})})];return t.pushAll(n),Er.create(()=>{})})}};rb=y([tr({contrib:mc})],rb);const ob=()=>hr(e=>{e(rb)}),ib="#faad14";var ab,sb;!function(e){e.MOUSE_ENTER="node-port:mouseenter",e.MOUSE_LEAVE="node-port:mouseleave"}(ab||(ab={})),function(e){e.id="ACTIVE_NODE_PORT",e.useModel=t=>x(this,void 0,void 0,function*(){const n=yield t.awaitModel(e.id);return{data:yield n.getValidValue(),model:n}})}(sb||(sb={}));let lb=class{constructor(){this.toDispose=new Or,this.getGraphInstance=()=>x(this,void 0,void 0,function*(){return{graph:yield this.graphProvider.getGraphInstance(),config:yield this.graphProvider.getGraphOptions()}}),this.getPortRenderConfig=()=>{const e={onPortRendered(e){const t=this,{port:n,node:r}=e,{contentSelectors:o}=e,i=o&&o["xflow-port-group"];i instanceof Element&&(i.setAttribute("class",xr("xflow-port-group",{connected:n.connected&&"out"!==n.group,groupPort:(null==r?void 0:r.isGroup)&&(null==r?void 0:r.isGroup())})),i.addEventListener("mouseenter",e=>{const o={e:e,portId:n.id,nodeId:r.id,portData:n,nodeData:r.getData(),tooltip:n.tooltip,placement:n.group};t.trigger(ab.MOUSE_ENTER,o)}),i.addEventListener("mouseleave",e=>{const o={e:e,portId:n.id,nodeId:r.id,portData:n,nodeData:r.getData(),tooltip:n.tooltip,placement:n.group};t.trigger(ab.MOUSE_LEAVE,o)}))}};return e},this.registerHookHub=()=>x(this,void 0,void 0,function*(){return Er.create(()=>{})}),this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,n=[e.graphOptions.registerHook({name:"add onPortRendered options ",handler:e=>x(this,void 0,void 0,function*(){Object.assign(e,this.getPortRenderConfig())})})];return t.pushAll(n),Er.create(()=>{})})}registerModel(e){e.registerModel({id:sb.id,watchChange:e=>x(this,void 0,void 0,function*(){const{graph:t,config:n}=yield this.getGraphInstance(),r=e=>{const{x:t,y:r,width:o,height:i}=e.target.getBoundingClientRect(),a=n.rootContainer.getBoundingClientRect();return{x:t-((null==a?void 0:a.x)||0)+o/2,y:r-((null==a?void 0:a.y)||0)+i/2}},o=t=>{e.setValue(Object.assign(Object.assign({},t),{position:r(t.e)}))},i=()=>{e.setValue(null)};return t.on(ab.MOUSE_ENTER,o),t.on(ab.MOUSE_LEAVE,i),t.on("cell:mouseleave",i),Er.create(()=>{t.off(ab.MOUSE_ENTER,o),t.off(ab.MOUSE_LEAVE,i)})})})}};y([nr(Dc),b("design:type",Object)],lb.prototype,"graphProvider",void 0),lb=y([tr({contrib:[mc,ac]})],lb);const db=()=>hr(e=>{e(lb)}),cb=e=>{const t=qs(),[n,,r]=qy(null);u.default.useEffect(()=>{if(!t)return;const e=x(void 0,void 0,void 0,function*(){const{model:e}=yield sb.useModel(t.modelService);return e.watch(e=>{r.setValue(e)})});return()=>{e.then(e=>{e.dispose()})}},[r,t]);const o=!!(n&&n.position&&n.position.x);if(!o)return null;const i=e.getTooltip?e.getTooltip(n):n.tooltip;return u.default.createElement(s.Tooltip,{visible:o,title:i,placement:n.placement||"top"},u.default.createElement("span",{className:"canvas-node-port-tooltip",style:{position:"absolute",left:n.position.x,top:n.position.y}}))};var ub,fb;!function(e){e.CONFIG_TYPE="ContextMenuConfig"}(ub||(ub={}));class hb{constructor(e){this.CONFIG_TYPE=ub.CONFIG_TYPE,this.setMenuModelService=e=>{this.menuModelService=e},this.setCustomMenuRender=e=>{this.menuCustomRender=e},this.getConfig=()=>x(this,void 0,void 0,function*(){return{CONFIG_TYPE:this.CONFIG_TYPE,menuCustomRender:this.menuCustomRender,menuModelService:this.menuModelService}}),this.moduleId=e||Dr()}dispose(){}}!function(e){e.id="CONTEXT_MENU_MODEL",e.useValue=Uc(e.id),e.getModel=Gc(e.id)}(fb||(fb={}));const{inject:pb,singleton:gb}=mr;let vb=class{constructor(){this.toDispose=new Or,this.getMenuModelValue=e=>x(this,void 0,void 0,function*(){const t=yield this.menuConfig.getConfig(),{anchor:n,type:r,cell:o}=e,i=new Or;this.toDispose.push(i);const a=o?o.getData():null,s=new Kd({id:"menuroot",type:Wy.Root,submenu:[]});i.push(Er.create(()=>{s.dispose()}));const l={toDispose:i,anchor:n,target:{data:a,type:r},customRender:null,menuModel:s};return t.menuCustomRender&&(l.customRender=yield t.menuCustomRender(e,this.modelService)),t.menuModelService&&(yield t.menuModelService(e,l.menuModel,this.modelService,i)),l})}registerModel(e){const t=[e.registerModel({id:fb.id,getInitialValue:()=>null,watchChange:(e,t)=>x(this,void 0,void 0,function*(){return(yield eu.getModel(t)).watch(t=>x(this,void 0,void 0,function*(){const n=yield this.getMenuModelValue(t);e.setValue(n)}))})})];this.toDispose.pushAll(t)}};y([pb(hb),b("design:type",hb)],vb.prototype,"menuConfig",void 0),y([pb(ic),b("design:type",Object)],vb.prototype,"modelService",void 0),vb=y([gb({contrib:[ac]})],vb);const mb=e=>hr(t=>{t(vb),t(hb,{useValue:e})}),yb=e=>{const{idx:t,menuOptions:n,target:r,modelService:o,commandService:i,onHide:a}=e,{id:s,label:d,isEnabled:c=!0,isVisible:f=!0,iconName:h,submenu:p=[],active:g,hotkey:v,render:m,onClick:y}=n;if(!f)return null;if("separator"===n.type)return u.default.createElement(l.Menu.Divider,{key:String(n.id)+t});if("root"===n.type)return u.default.createElement(l.Menu,{hasIcon:!0},p.map((e,t)=>yb({idx:t,target:r,commandService:i,modelService:o,menuOptions:e,onHide:a})));if(n.submenu&&Array.isArray(n.submenu)){const e=nb.get(h),t=!c;return u.default.createElement(l.Menu.SubMenu,{key:String(s),text:d,disabled:t||0===p.length,icon:e?u.default.createElement(e,null):null,active:g,hotkey:v},p.map((e,t)=>yb({idx:t,target:r,commandService:i,modelService:o,menuOptions:e,onHide:a})))}const b=nb.get(h);return m?u.default.createElement(m,{menuItem:n,target:r,commandService:i,modelService:o,onHide:a},[u.default.createElement(l.Menu.Item,{key:String(s),text:d,disabled:!c,icon:b?u.default.createElement(b,null):null,active:g,hotkey:v})]):u.default.createElement(l.Menu.Item,{key:String(s),text:d,disabled:!c,icon:b?u.default.createElement(b,null):null,active:g,hotkey:v,onClick:()=>x(void 0,void 0,void 0,function*(){yield y({menuItem:n,target:r,commandService:i,modelService:o}),a&&a()})})},bb=e=>{const{menuModel:t,target:n,onHide:r}=e,{modelService:o,commandService:i}=qs(),[a]=Xy(t);return yb({idx:-1,target:n,commandService:i,modelService:o,menuOptions:a,onHide:r})},xb=({toDispose:e})=>(u.default.useEffect(()=>()=>{e.dispose()},[e]),null),wb=()=>{const e=u.default.useRef(),t=qs(),[n,,r]=(e=>{const{getModel:t,initialState:n}=e,r=Ky(),o=u.default.useRef(),[i,a]=u.default.useState(n);return u.default.useEffect(()=>{let e;return t().then(t=>x(void 0,void 0,void 0,function*(){o.current=t;const n=yield t.getValidValue();r.current&&(a(n),e=t.watch(e=>{r.current&&a(e)}))})),()=>{e&&e.dispose&&e.dispose()}},[]),[i,a,o.current]})({getModel:()=>x(void 0,void 0,void 0,function*(){return yield fb.getModel(t.modelService)}),initialState:{anchor:null,menuModel:null,target:null,customRender:null,toDispose:null}}),{target:o,anchor:i,menuModel:a,customRender:s,toDispose:d}=n;if(!o||!i||!a)return null;const c=()=>{r.setValue({anchor:null,menuModel:null,target:null,customRender:null,toDispose:null})},f=s?u.default.createElement(s,{target:o,modelService:t.modelService,onHide:c}):u.default.createElement(bb,{target:o,menuModel:a,onHide:c});return u.default.createElement("div",{className:"xflow-menu-mask",ref:e,onClick:c,onContextMenu:e=>{e.preventDefault(),e.stopPropagation()}},u.default.createElement(xb,{toDispose:d}),u.default.createElement(l.Dropdown,{visible:!0,getPopupContainer:()=>e.current,overlay:f},u.default.createElement("div",{className:"xflow-context-menu-anchor",style:{top:i.y,left:i.x}})))},_b="CanvasToolbar";class Eb{constructor(){this.CONFIG_TYPE=_b,this.setToolbarName=e=>{this.moduleId=_b+"__"+e},this.setToolbarModelService=e=>{this.toolbarModelService=e},this.setCustomToolbarRender=e=>{this.customRenderService=e},this.getConfig=()=>({CONFIG_TYPE:this.CONFIG_TYPE,toolbarCustomRender:this.customRenderService,toolbarModelService:this.toolbarModelService}),this.moduleId=_b+"__"+Dr()}dispose(){}}const Sb=e=>{const t=qs(),{item:n,layout:r}=e,o=xr({"xflow-toolbar-item":!0}),i="vertical"===r?"":n.text;let a;if(n.icon)a=n.icon;else if(n.iconName){const e=nb.get(n.iconName);a=u.default.createElement(e,null)}const s=n.render,{isEnabled:d=!0}=n,{commandService:c,modelService:f}=t,h=()=>{n.onClick&&n.onClick({toolbarItem:n,commandService:c,modelService:f})};return s?u.default.createElement(s,Object.assign({},n,{onClick:h}),u.default.createElement(l.Toolbar.Item,Object.assign({},n,{icon:a,text:i,className:o,disabled:!d,tooltip:n.tooltip||n.text,tooltipProps:Object.assign({placement:"vertical"===r?"left":"bottom"},n.tooltipProps),onClick:()=>{}}))):u.default.createElement(l.Toolbar.Item,Object.assign({},n,{icon:a,text:i,className:o,hidden:!n,disabled:!d,tooltip:n.tooltip||n.text,onClick:h,tooltipProps:Object.assign(Object.assign({},n.tooltipProps),{placement:"vertical"===r?"left":"bottom"})}))},Cb=e=>{const{group:t,layout:n}=e,r=u.default.useMemo(()=>t.name||Dr(),[t.name]),{items:o=[]}=t;if(0===o.length)return null;const i=xr({"xflow-toolbar-group":!0});return u.default.createElement(l.Toolbar.Group,{className:i,key:r},o.map(e=>u.default.createElement(Sb,{item:e,layout:n,key:e.id})))},Ob=e=>{const{idx:t,groups:n,layout:r,toolbarOptions:o}=e,{hoverEffect:i=!0}=o;return u.default.createElement(l.Toolbar,{hoverEffect:i},n.map((e,n)=>{const o=t+n;return u.default.createElement(Cb,{key:o,group:e,layout:r})}))},kb=u.default.memo(e=>{const{isModelReady:t,state:n}=(e=>{const{config:t}=e,n=t.moduleId,r=qs(),[o,i,a,s]=qy({name:n,layout:e.layout,mainGroups:[],extraGroups:[],customRender:null});return u.default.useEffect(()=>{const e=new Or;if(!r.modelService.findDeferredModel(n)){const{toolbarCustomRender:o,toolbarModelService:i}=t.getConfig(),s=r.modelService.registerModel({id:n,modelFactory:()=>a,watchChange:t=>x(void 0,void 0,void 0,function*(){if(i&&(yield i(t,r.modelService,e)),o){const e=e=>{t.setValue(t=>t.customRender=e)};yield o(r.modelService,e)}return e})});e.push(s)}return()=>{e.dispose()}},[]),{isModelReady:s,state:o,setState:i,toolbarModel:a}})(e),r=vu(e.position),{mainGroups:o=[],extraGroups:i=[],layout:a,customRender:l}=n,d=xr(e.className,a,"xflow-toolbar"),c=xr({[a]:!0,"xflow-toolbar-root":!0});return t?l?u.default.createElement("div",{className:d,style:Object.assign(Object.assign({},r),e.style)},u.default.createElement(l,{config:n})):u.default.createElement("div",{className:d,style:Object.assign(Object.assign({},r),e.style)},u.default.createElement("div",{className:c},o.length>0&&u.default.createElement(Ob,{idx:"mainGroups",groups:o,layout:a,toolbarOptions:n}),i.length>0&&u.default.createElement(Ob,{idx:"extraGroups",groups:i,layout:a,toolbarOptions:n}))):u.default.createElement("div",{className:d,style:Object.assign(Object.assign({},r),e.style)},u.default.createElement(s.Spin,{spinning:!0,size:"small"}))}),Mb=e=>{const t=!!qs(),n=u.default.useMemo(()=>e.config?e.config:new Eb,[e.config]);return t?u.default.createElement(kb,Object.assign({},e,{config:n})):null},Nb=e=>t=>{const n=u.default.useMemo(()=>({getValue:()=>({})}),[]);n.getValue=()=>t;const r=u.default.useMemo(()=>{const t=new Eb;return e(t,n),t},[n]);return r};var Ab;e.CANVAS_SCALE_TOOLBAR_CONFIG=void 0,Ab=e.CANVAS_SCALE_TOOLBAR_CONFIG||(e.CANVAS_SCALE_TOOLBAR_CONFIG={}),nb.set("ZoomInOutlined",Ys),nb.set("ZoomOutOutlined",Ks),nb.set("OneToOneOutlined",As),nb.set("CompressOutlined",Ka),nb.set("FullscreenOutlined",Ss),nb.set("FullscreenExitOutlined",ws),Ab.ZOOM_IN=Qs.GRAPH_ZOOM.id+"-zoom-in",Ab.ZOOM_OUT=Qs.GRAPH_ZOOM.id+"-zoom-out",Ab.SCALE_TO_ONE=Qs.GRAPH_ZOOM.id+"-scale-to-one",Ab.SCALE_TO_FIT=Qs.GRAPH_ZOOM.id+"-scale-to-fit",Ab.FULLSCREEN=Qs.GRAPH_ZOOM.id+"-fullscreen",Ab.MAX_SCALE=1.5,Ab.MIN_SCALE=.05,Ab.zoomOptions={maxScale:Ab.MAX_SCALE,minScale:Ab.MIN_SCALE},Ab.getToolbarConfig=({zoomFactor:e,fullscreen:t})=>[{name:"main",items:[{id:Ab.ZOOM_IN,tooltip:"放大",iconName:"ZoomInOutlined",onClick:({commandService:e})=>{e.executeCommand(Qs.GRAPH_ZOOM.id,{factor:.1,zoomOptions:Ab.zoomOptions})}},{id:Ab.ZOOM_OUT,tooltip:"缩小",iconName:"ZoomOutOutlined",onClick:({commandService:e})=>{e.executeCommand(Qs.GRAPH_ZOOM.id,{factor:-.1,zoomOptions:Ab.zoomOptions})}},{id:Ab.SCALE_TO_ONE,iconName:"OneToOneOutlined",tooltip:"缩放到1:1",isEnabled:1!==e,onClick:({commandService:e})=>{e.executeCommand(Qs.GRAPH_ZOOM.id,{factor:"real",zoomOptions:Ab.zoomOptions})}},{id:Ab.SCALE_TO_FIT,tooltip:"缩放到适应屏幕",iconName:"CompressOutlined",onClick:({commandService:e})=>{e.executeCommand(Qs.GRAPH_ZOOM.id,{factor:"fit",zoomOptions:Ab.zoomOptions})}},{id:Ab.FULLSCREEN,tooltip:t?"退出全屏":"全屏",iconName:t?"FullscreenExitOutlined":"FullscreenOutlined",onClick:({commandService:e})=>{e.executeCommand(Qs.GRAPH_FULLSCREEN.id,{})}}]}];const Tb=Nb(t=>{t.setToolbarModelService((t,n)=>x(void 0,void 0,void 0,function*(){const r=yield nu.useValue(n);t.setValue(t=>{t.mainGroups=e.CANVAS_SCALE_TOOLBAR_CONFIG.getToolbarConfig({zoomFactor:r.zoomFactor,fullscreen:!1})});const o=yield Bc.getModel(n);o.setValue(!1),o.watch(n=>{t.setValue(t=>{t.mainGroups=e.CANVAS_SCALE_TOOLBAR_CONFIG.getToolbarConfig({zoomFactor:r.zoomFactor,fullscreen:n})})});(yield nu.getModel(n)).watch(({zoomFactor:r})=>x(void 0,void 0,void 0,function*(){const o=yield Bc.useValue(n);t.setValue(t=>{t.mainGroups=e.CANVAS_SCALE_TOOLBAR_CONFIG.getToolbarConfig({zoomFactor:r,fullscreen:o})})}))}))});const Pb=Symbol("IMinimapConfigProvider");let Db=class{constructor(){this.toDispose=new Or,this.registerHookHub=()=>x(this,void 0,void 0,function*(){return Er.create(()=>{})}),this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,n=[e.graphOptions.registerHook({name:"add minimap options",handler:e=>x(this,void 0,void 0,function*(){const t=yield this.minimapConfig.getConfig();e.minimap=Object.assign({},t)})})];return t.pushAll(n),Er.create(()=>{})})}};y([nr(Pb),b("design:type",Object)],Db.prototype,"minimapConfig",void 0),Db=y([tr({contrib:mc})],Db);const jb=e=>hr(t=>{t(Pb,{useDynamic:()=>e}),t(Db)});class Ib extends n.NodeView{renderMarkup(){return this.renderJSONMarkup({tagName:"rect",selector:"body"})}update(){super.update({body:{refWidth:"100%",refHeight:"100%",fill:Ib.nodeFillColor}})}}Ib.nodeFillColor="#31d0c6",Ib.setNodeFillColor=e=>{Ib.nodeFillColor=e};class Rb{constructor(){this.getValue=()=>({})}dispose(){this.getValue=()=>null}}const Lb=u.default.createContext({propsProxy:null,commandService:null,modelService:null}),Fb=()=>u.default.useContext(Lb),Gb=e=>{const{className:t,position:n,style:r,children:o}=e,i=qs(),a=vu(n),s=u.default.useMemo(()=>new Rb,[]);if(u.default.useEffect(()=>()=>{s.dispose()},[s]),!i||!i.modelService)return null;s.getValue=()=>e;const l=xr({[t]:!!t,"xflow-workspace-panel":!0}),{commandService:d,modelService:c}=i;return u.default.createElement(Lb.Provider,{value:{propsProxy:s,commandService:d,modelService:c}},u.default.createElement("div",{className:l,style:Object.assign(Object.assign({},a),r)},o))},Ub="xflow-node-horizontal-edge",Hb="xflow-node-vertical-edge",Bb="xflow-group-vertical-edge",zb="xflow-edge",Vb="XFLOW_NODE_SHAPE",Yb="processing";var Wb;let $b;e.GRAPH_STATUS_INFO=void 0,(Wb=e.GRAPH_STATUS_INFO||(e.GRAPH_STATUS_INFO={})).id="GRAPH_STATUS_INFO",function(e){e.SUCCEEDED="SUCCEEDED",e.RUNNING="RUNNING",e.FAILED="FAILED",e.PENDING="PENDING",e.CREATING="CREATING",e.MANUAL_TERMINATE="MANUAL_TERMINATE",e.CACHED="CACHED",e.QUEUEING="QUEUEING",e.PULLING_IMAGE="PULLING_IMAGE",e.UNKNOWN="UNKNOWN"}(Wb.StatusEnum||(Wb.StatusEnum={})),Wb.getModel=Gc(Wb.id),Wb.useValue=Uc(Wb.id),e.XFlowDagCommands=void 0,(e.XFlowDagCommands||(e.XFlowDagCommands={})).QUERY_GRAPH_STATUS={id:"xflow:query-graph-status",label:"查询画布节点状态"};const{AnchorGroup:Kb}=vr;$b=n.Node.registry.exist(Vb)?n.Node.registry.get(Vb):i.ReactShape.define({width:160,height:32,shape:Vb,view:Mr,ports:{groups:{top:{zIndex:2,position:{name:Kb.TOP}},bottom:{zIndex:2,position:{name:Kb.BOTTOM}},right:{zIndex:2,position:{name:Kb.RIGHT}},left:{zIndex:2,position:{name:Kb.LEFT}}}},attrs:{body:{magnet:!1,fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%",zIndex:1}},portMarkup:[{tagName:"g",selector:"xflow-port-group",className:"xflow-port-group",attrs:{width:8,height:8,x:-4,y:-4,zIndex:10,magnet:"true"},children:[{tagName:"circle",selector:"xflow-port",className:"xflow-port",attrs:{r:4,fill:"#fff",stroke:"#d9d9d9",zIndex:12}},{tagName:"polygon",selector:"xflow-port-arrow",className:"xflow-port-arrow",attrs:{points:"0,0 8,0 4,4 ",fill:"#d9d9d9",stroke:"#d9d9d9",zIndex:13,transform:"translate(-4,0)"}}]}]});const{DirectoryTree:Xb,TreeNode:qb}=s.Tree,Zb=({expanded:e})=>e?u.default.createElement(ys,null):u.default.createElement(gs,null),Jb=e=>new $b(e),Qb=e=>{const{nodeConfig:t,onMouseDown:n,graphConfig:r,modelService:o,commandService:i}=e;if(!r)return u.default.createElement("div",null);if(t.renderComponent)return u.default.createElement("div",{onMouseDown:n},u.default.createElement(t.renderComponent,{data:t,isNodeTreePanel:!0}));const a=r.nodeTypeParser(t)||Nr,s=r.nodeRender.get(a);return u.default.createElement("div",{onMouseDown:n},u.default.createElement(s,{commandService:i,modelService:o,data:t,isNodeTreePanel:!0}))},ex=e=>{const[n,r]=t.useState(!1),[o,i]=t.useState(),{getGraphConfig:a}=qs();u.default.useEffect(()=>{a().then(e=>{i(e.appContainer)})});const{prefixClz:l,graphConfig:d,commandService:c,modelService:f,popoverContent:h,onMouseDown:p,item:g}=e;return u.default.createElement(u.default.Fragment,null,h&&u.default.createElement(s.Popover,{placement:"right",destroyTooltipOnHide:!0,content:h,visible:n,onVisibleChange:e=>{r(e)},getPopupContainer:()=>o||document.body},u.default.createElement("div",{className:`${l}-node-wrapper`,onMouseEnter:()=>{r(!0)}},Qb({graphConfig:d,commandService:c,onMouseDown:p,modelService:f,nodeConfig:g}))),!h&&u.default.createElement("div",{className:`${l}-node-wrapper`,onMouseEnter:()=>{r(!0)}},Qb({graphConfig:d,commandService:c,onMouseDown:p,modelService:f,nodeConfig:g})))},tx=e=>{const{x6NodeFactory:t,dndOptions:r,onNodeDrop:o,state:i,onFolderExpand:a,prefixClz:l}=e,{graphProvider:d,modelService:c,commandService:f}=qs(),[h,p]=u.default.useState(),[g,v]=u.default.useState(),[m,y]=u.default.useState();u.default.useEffect(()=>{d.getGraphInstance().then(e=>{y(e)})}),u.default.useEffect(()=>{if(d.getGraphOptions().then(e=>{p(e)}),!m)return;const e=new n.Addon.Dnd(Object.assign(Object.assign({scaled:!1,animation:!1},r),{target:m,validateNode:e=>x(void 0,void 0,void 0,function*(){const t=Object.assign(Object.assign({},e.getData()),e.getPosition());return o?yield o(t,f,c):console.error("onNodeDrop method is required in NodeTree Panel"),!1})}));v(e)},[f,r,m,d,c,o]);const b=u.default.useCallback(e=>n=>{if(!m||!g||!h)return;const r=h.nodeTypeParser(e),o=Pc(e.renderComponent?e.renderComponent:h.nodeRender.get(r),f,c),i={data:e,width:e.width||180,height:e.height||40,view:h.graphId,component:o},a=t?t(i):Jb(i);g.start(a,n.nativeEvent)},[f,g,m,h,c,t]),w=u.default.useCallback((e=[])=>e.map(e=>{const{isDirectory:t,children:n,popoverContent:r}=e;return t?u.default.createElement(qb,{icon:Zb,key:e.id,title:e.label,className:`${l}-tree-folder`},w(n)):u.default.createElement(qb,{isLeaf:!0,key:e.id,className:`${l}-tree-leaf`,icon:u.default.createElement("span",null),title:u.default.createElement(ex,{item:e,onMouseDown:b(e),popoverContent:r,prefixClz:l,modelService:c,commandService:f,graphConfig:h})})}),[f,h,c,b,l]);return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${l}-body`,style:e.style},!i.keyword&&u.default.createElement(Xb,{showIcon:!0,selectable:!1,autoExpandParent:!1,onExpand:a,expandedKeys:i.expandedKeys,className:`${l}-tree`},w(i.treeData)),i.searchList.length>0&&u.default.createElement("ul",{className:`${l}-body-list`},i.searchList.map(e=>u.default.createElement("li",{key:e.id,className:`${l}-body-list-item`},u.default.createElement(ex,{item:e,onMouseDown:b(e),popoverContent:e.popoverContent,prefixClz:l,modelService:c,commandService:f,graphConfig:h})))),i.keyword&&0===i.searchList.length&&u.default.createElement(s.Empty,{style:{marginTop:"48px"}})))},nx=e=>{const{prefixClz:t,onKeywordChange:n}=e,{propsProxy:r}=Fb(),o=r.getValue();return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-header`,style:e.style},o.header&&u.default.isValidElement(o.header)&&o.header,o.searchService&&u.default.createElement("div",{className:`${t}-header-search`},u.default.createElement(s.Input,{placeholder:"搜索组件",allowClear:!0,onChange:e=>n(e.target.value),style:{width:"100%",border:0}}))))},rx=e=>{const{prefixClz:t}=e,{propsProxy:n}=Fb(),r=n.getValue();return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-footer`,style:e.style},r.footer&&u.default.isValidElement(r.footer)&&r.footer))},ox="XFLOW_TREE_PANEL_ROOT_ID",ix=e=>{const t=e&&e.headerPosition&&e.headerPosition.height||40,n=e.footerPosition&&e.footerPosition.height||40;return{headerStyle:vu(Object.assign({height:t,lineHeight:t,top:0,left:0,right:0},e.headerPosition)),bodyStyle:vu(Object.assign({left:0,right:0,top:t,bottom:n},e.bodyPosition)),footerStyle:vu(Object.assign({left:0,right:0,lineHeight:n,height:n,bottom:0},e.footerPosition))}};var ax=qp,sx=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},lx=function(e){return this.__data__.has(e)};function dx(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ax;++t<n;)this.add(e[t])}dx.prototype.add=dx.prototype.push=sx,dx.prototype.has=lx;var cx=dx;var ux=function(e,t){return e.has(t)},fx=cx,hx=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},px=ux;var gx=function(e,t,n,r,o,i){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var d=i.get(e),c=i.get(t);if(d&&c)return d==t&&c==e;var u=-1,f=!0,h=2&n?new fx:void 0;for(i.set(e,t),i.set(t,e);++u<s;){var p=e[u],g=t[u];if(r)var v=a?r(g,p,u,t,e,i):r(p,g,u,e,t,i);if(void 0!==v){if(v)continue;f=!1;break}if(h){if(!hx(t,function(e,t){if(!px(h,t)&&(p===e||o(p,e,n,r,i)))return h.push(t)})){f=!1;break}}else if(p!==g&&!o(p,g,n,r,i)){f=!1;break}}return i.delete(e),i.delete(t),f};var vx=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n};var mx=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},yx=Tm,bx=Ah,xx=gx,wx=vx,_x=mx,Ex=Ao?Ao.prototype:void 0,Sx=Ex?Ex.valueOf:void 0;var Cx=function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new yx(e),new yx(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return bx(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=wx;case"[object Set]":var l=1&r;if(s||(s=_x),e.size!=t.size&&!l)return!1;var d=a.get(e);if(d)return d==t;r|=2,a.set(e,t);var c=xx(s(e),s(t),r,o,i,a);return a.delete(e),c;case"[object Symbol]":if(Sx)return Sx.call(e)==Sx.call(t)}return!1},Ox=nm,kx=Object.prototype.hasOwnProperty;var Mx=sg,Nx=gx,Ax=Cx,Tx=function(e,t,n,r,o,i){var a=1&n,s=Ox(e),l=s.length;if(l!=Ox(t).length&&!a)return!1;for(var d=l;d--;){var c=s[d];if(!(a?c in t:kx.call(t,c)))return!1}var u=i.get(e),f=i.get(t);if(u&&f)return u==t&&f==e;var h=!0;i.set(e,t),i.set(t,e);for(var p=a;++d<l;){var g=e[c=s[d]],v=t[c];if(r)var m=a?r(v,g,c,t,e,i):r(g,v,c,e,t,i);if(!(void 0===m?g===v||o(g,v,n,r,i):m)){h=!1;break}p||(p="constructor"==c)}if(h&&!p){var y=e.constructor,b=t.constructor;y==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(h=!1)}return i.delete(e),i.delete(t),h},Px=Mm,Dx=Po,jx=Ag.exports,Ix=Wg,Rx="[object Arguments]",Lx="[object Array]",Fx="[object Object]",Gx=Object.prototype.hasOwnProperty;var Ux=function(e,t,n,r,o,i){var a=Dx(e),s=Dx(t),l=a?Lx:Px(e),d=s?Lx:Px(t),c=(l=l==Rx?Fx:l)==Fx,u=(d=d==Rx?Fx:d)==Fx,f=l==d;if(f&&jx(e)){if(!jx(t))return!1;a=!0,c=!1}if(f&&!c)return i||(i=new Mx),a||Ix(e)?Nx(e,t,n,r,o,i):Ax(e,t,l,n,r,o,i);if(!(1&n)){var h=c&&Gx.call(e,"__wrapped__"),p=u&&Gx.call(t,"__wrapped__");if(h||p){var g=h?e.value():e,v=p?t.value():t;return i||(i=new Mx),o(g,v,n,r,i)}}return!!f&&(i||(i=new Mx),Tx(e,t,n,r,o,i))},Hx=Vo;var Bx=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Hx(t)&&!Hx(n)?t!=t&&n!=n:Ux(t,n,r,o,e,i))},zx=sg,Vx=Bx;var Yx=Hf;var Wx=function(e){return e==e&&!Yx(e)},$x=Wx,Kx=pv;var Xx=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},qx=function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var s=n[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var l=(s=n[o])[0],d=e[l],c=s[1];if(a&&s[2]){if(void 0===d&&!(l in e))return!1}else{var u=new zx;if(r)var f=r(d,c,l,e,t,u);if(!(void 0===f?Vx(c,d,3,r,u):f))return!1}}return!0},Zx=function(e){for(var t=Kx(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,$x(o)]}return t},Jx=Xx;var Qx=function(e){var t=Zx(e);return 1==t.length&&t[0][2]?Jx(t[0][0],t[0][1]):function(n){return n===e||qx(n,e,t)}},ew=Po,tw=$o,nw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rw=/^\w*$/;var ow=function(e,t){if(ew(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!tw(e))||(rw.test(e)||!nw.test(e)||null!=t&&e in Object(t))},iw=qp;function aw(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(aw.Cache||iw),n}aw.Cache=iw;var sw=aw;var lw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dw=/\\(\\)?/g,cw=function(e){var t=sw(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(lw,function(e,n,r,o){t.push(r?o.replace(dw,"$1"):n||e)}),t}),uw=Po,fw=ow,hw=cw,pw=ti;var gw=function(e,t){return uw(e)?e:fw(e,t)?[e]:hw(pw(e))},vw=$o;var mw=function(e){if("string"==typeof e||vw(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},yw=gw,bw=mw;var xw=function(e,t){for(var n=0,r=(t=yw(t,e)).length;null!=e&&n<r;)e=e[bw(t[n++])];return n&&n==r?e:void 0},ww=xw;var _w=function(e,t,n){var r=null==e?void 0:ww(e,t);return void 0===r?n:r};var Ew=gw,Sw=Ng,Cw=Po,Ow=Dg,kw=jg,Mw=mw;var Nw=function(e,t){return null!=e&&t in Object(e)},Aw=function(e,t,n){for(var r=-1,o=(t=Ew(t,e)).length,i=!1;++r<o;){var a=Mw(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&kw(o)&&Ow(a,o)&&(Cw(e)||Sw(e))};var Tw=Bx,Pw=_w,Dw=function(e,t){return null!=e&&Aw(e,t,Nw)},jw=ow,Iw=Wx,Rw=Xx,Lw=mw;var Fw=function(e){return e};var Gw=xw;var Uw=function(e){return function(t){return null==t?void 0:t[e]}},Hw=function(e){return function(t){return Gw(t,e)}},Bw=ow,zw=mw;var Vw=Qx,Yw=function(e,t){return jw(e)&&Iw(t)?Rw(Lw(e),t):function(n){var r=Pw(n,e);return void 0===r&&r===t?Dw(n,e):Tw(t,r,3)}},Ww=Fw,$w=Po,Kw=function(e){return Bw(e)?Uw(zw(e)):Hw(e)};var Xw=function(e){return"function"==typeof e?e:null==e?Ww:"object"==typeof e?$w(e)?Yw(e[0],e[1]):Vw(e):Kw(e)};var qw=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1},Zw=function(e){return e!=e},Jw=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1};var Qw=function(e,t,n){return t==t?Jw(e,t,n):qw(e,Zw,n)};var e_=function(e,t){return!!(null==e?0:e.length)&&Qw(e,t,0)>-1};var t_=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1};var n_=dm,r_=function(){},o_=n_&&1/mx(new n_([,-0]))[1]==1/0?function(e){return new n_(e)}:r_,i_=cx,a_=e_,s_=t_,l_=ux,d_=o_,c_=mx;var u_=Xw,f_=function(e,t,n){var r=-1,o=a_,i=e.length,a=!0,s=[],l=s;if(n)a=!1,o=s_;else if(i>=200){var d=t?null:d_(e);if(d)return c_(d);a=!1,o=l_,l=new i_}else l=t?[]:s;e:for(;++r<i;){var c=e[r],u=t?t(c):c;if(c=n||0!==c?c:0,a&&u==u){for(var f=l.length;f--;)if(l[f]===u)continue e;t&&l.push(u),s.push(c)}else o(l,u,n)||(l!==s&&l.push(u),s.push(c))}return s};var h_=function(e,t){return e&&e.length?f_(e,u_(t)):[]};e.NsNodeTreePanelModel=void 0,function(e){e.id="TREE_PANEL_MODEL",e.useModel=t=>x(this,void 0,void 0,function*(){return t.awaitModel(e.id)})}(e.NsNodeTreePanelModel||(e.NsNodeTreePanelModel={}));const p_=t=>{const{treeDataService:n,searchService:r}=t,{modelService:o}=qs(),[i,a,s]=qy({treeData:[],searchList:[],treeNodeList:[],expandedKeys:[],defaultExpandAll:!1,keyword:""});u.default.useEffect(()=>{o.findDeferredModel(e.NsNodeTreePanelModel.id)||o.registerModel({id:e.NsNodeTreePanelModel.id,modelFactory:()=>s,watchChange:e=>x(void 0,void 0,void 0,function*(){const t=yield tu.getModel(o),r=t=>x(void 0,void 0,void 0,function*(){const r=yield n(t,o),{treeData:i,rootNodes:a}=function(e=[]){const t=e=>{const t=h_(e,"id").reduce((e,t)=>{const n=t.parentId||ox;e.has(n)||e.set(n,[]);return e.get(n).push(t),e},new Map);return t},n=t(By(e));function r(e,t){return e.map(e=>{if(t.has(e.id)){const n=t.get(e.id);e.key=e.id,e.isDirectory=!0,e.children=r(n,t)||[]}else e.isLeaf=!0;return e})}const o=n.get(ox)||[],i=r(o,n);return{treeData:i,rootNodes:o}}(r),s=yield e.getValidValue(),l=s.expandedKeys.length>0?s.expandedKeys:a.map(e=>e.id);return{listData:r,treeData:i,expandedKeys:l}}),i=t.watch(t=>x(void 0,void 0,void 0,function*(){const n=yield r(t);e.setValue({treeNodeList:n.listData,treeData:n.treeData,expandedKeys:n.expandedKeys,defaultExpandAll:!1,keyword:"",searchList:[]})}));return Er.create(()=>{i.dispose()})})})},[]);const l=u.default.useCallback(e=>{a(t=>{t.expandedKeys=e})},[a]),d=u.default.useCallback(e=>x(void 0,void 0,void 0,function*(){if(!r)return console.warn("searchService is not defined");if(e){const t=yield r(i.treeNodeList,e);a(n=>{n.keyword=e,n.searchList=t})}else a(e=>{e.keyword="",e.searchList=[]})}),[r,i.treeNodeList]);return{state:i,setState:a,onKeywordChange:d,onFolderExpand:l}};var g_;!function(e){e.id="TREE_PANEL_DATA"}(g_||(g_={}));var v_=Object.freeze({__proto__:null,get NsTreePanelData(){return g_}});const m_=e=>{const{headerStyle:t,bodyStyle:n,footerStyle:r}=ix(e),{state:o,onFolderExpand:i,onKeywordChange:a}=p_(e);return u.default.createElement(u.default.Fragment,null,u.default.createElement(nx,Object.assign({},e,{state:o,style:t,onKeywordChange:a})),u.default.createElement(tx,Object.assign({},e,{state:o,style:n,onFolderExpand:i})),u.default.createElement(rx,Object.assign({},e,{state:o,style:r})))},y_=e=>{const{x6NodeFactory:t,dndOptions:r,onNodeDrop:o}=e,{graphProvider:i,modelService:a,commandService:s}=qs(),[l,d]=u.default.useState(),[c,f]=u.default.useState(),[h,p]=u.default.useState();u.default.useEffect(()=>{i.getGraphInstance().then(e=>{p(e)}),i.getGraphOptions().then(e=>{d(e)})},[i,p,d]),u.default.useEffect(()=>{if(!h)return;const e=new n.Addon.Dnd(Object.assign(Object.assign({scaled:!1,animation:!1},r),{target:h,validateNode:e=>x(void 0,void 0,void 0,function*(){const t=Object.assign(Object.assign({},e.getData()),e.getPosition());return o?yield o(t,s,a):console.error("onNodeDrop method is required in NodeTree Panel"),!1})}));return f(e),()=>{e.dispose()}},[s,a,r,h,o]);const g=u.default.useCallback(e=>n=>{if(!h||!c||!l)return;if(e.isDisabled)return;const r=l.nodeTypeParser(e),o=Pc(e.renderComponent?e.renderComponent:l.nodeRender.get(r),s,a),i={data:e,width:e.width||180,height:e.height||40,view:l.graphId,component:o},d=t?t(i):new $b(i);c.start(d,n.nativeEvent)},[s,c,h,l,a,t]);return{graphConfig:l,onMouseDown:g,modelService:a,commandService:s}},b_=e=>{const{nodeConfig:t,onMouseDown:n,graphConfig:r,modelService:o,commandService:i}=e;if(!r)return u.default.createElement("div",null);if(t.renderComponent)return u.default.createElement("div",{onMouseDown:n},u.default.createElement(t.renderComponent,{data:t,isNodePanel:!0}));const a=r.nodeTypeParser(t)||Nr,s=r.nodeRender.get(a);return u.default.createElement("div",{onMouseDown:n},u.default.createElement(s,{commandService:i,modelService:o,data:t,isNodeTreePanel:!0}))},x_=e=>{const[t,n]=u.default.useState(!1),{prefixClz:r,graphConfig:o,commandService:i,modelService:a,popoverContent:l,onMouseDown:d,item:c}=e;return u.default.createElement(u.default.Fragment,null,l?u.default.createElement(s.Popover,{placement:"right",destroyTooltipOnHide:!0,content:l,visible:t,onVisibleChange:e=>{n(e)}},u.default.createElement("div",{className:`${r}-node-wrapper`,onMouseEnter:()=>{n(!0)}},b_({graphConfig:o,commandService:i,onMouseDown:d,modelService:a,nodeConfig:c}))):u.default.createElement("div",{className:`${r}-node-wrapper`},b_({graphConfig:o,commandService:i,onMouseDown:d,modelService:a,nodeConfig:c})))},w_=e=>{const{searchResult:t,prefixClz:n,onMouseDown:r,modelService:o,commandService:i,graphConfig:a}=e;return 0===t.length?u.default.createElement(s.Empty,{style:{marginTop:"24px"}}):u.default.createElement("ul",{className:"xflow-collapse-search-list"},t.map(e=>u.default.createElement("li",{className:"xflow-collapse-search-list-item "+(e.isDisabled?"disabled":""),key:e.id},u.default.createElement(x_,{item:e,onMouseDown:r(e),popoverContent:e.popoverContent,prefixClz:n,modelService:o,commandService:i,graphConfig:a}))))},__=e=>{const{onActiveKeyChange:t,collapseData:n,prefixClz:r,onMouseDown:o,modelService:i,commandService:a,graphConfig:l}=e;return u.default.createElement("ul",{className:"xflow-collapse-list"},0===n.length&&u.default.createElement(s.Empty,{style:{marginTop:"24px"}}),n.map(e=>{const{children:n=[],isCollapsed:s,render:d}=e,c=s?"close":"open";return u.default.createElement("li",{className:`xflow-collapse-list-item ${c}`,key:e.id},(e=>{const{header:n,extra:r,icon:o,isCollapsed:i}=e;return u.default.createElement("div",{className:"xflow-collapse-header",onClick:n=>{n.preventDefault(),t(e.id)}},u.default.createElement("div",{className:"xflow-collapse-header-icon"},Oc(o)?u.default.createElement(o,{isCollapsed:i}):u.default.createElement(Ra,{rotate:i?0:90,style:{fontSize:"12px"}})),u.default.createElement("div",{className:"xflow-collapse-header-label"},Oc(n)?u.default.createElement(n,e):n),u.default.createElement("div",{className:"xflow-collapse-header-extra"},Oc(r)?u.default.createElement(r,e):r))})(e),Oc(d)?u.default.createElement(d,e):(e=>u.default.createElement("div",{className:"xflow-collapse-content"},e.map(e=>u.default.createElement("div",{className:"xflow-collapse-content-item "+(e.isDisabled?"disabled":""),key:e.id},u.default.createElement(x_,{item:e,onMouseDown:o(e),popoverContent:e.popoverContent,prefixClz:r,modelService:i,commandService:a,graphConfig:l})))))(n))}))},E_=e=>{const{state:t,bodyLoading:n,prefixClz:r,onActiveKeyChange:o}=e,{graphConfig:i,onMouseDown:a,modelService:l,commandService:d}=y_(e),{searchResult:c,collapseData:f,keyword:h}=t;return u.default.createElement("div",{className:`${r}-body`,style:e.style},u.default.createElement(s.Spin,{spinning:!0===n},0===h.length&&u.default.createElement(__,{onActiveKeyChange:o,collapseData:f,onMouseDown:a,modelService:l,commandService:d,graphConfig:i,prefixClz:r}),h.length>0&&u.default.createElement(w_,{searchResult:c,onMouseDown:a,modelService:l,commandService:d,graphConfig:i,prefixClz:r})))},S_=e=>{const{prefixClz:t,onKeywordChange:n,state:r}=e,{propsProxy:o}=Fb(),i=o.getValue();return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-header`,style:e.style},i.header&&u.default.isValidElement(i.header)&&i.header,i.searchService&&u.default.createElement("div",{className:`${t}-header-search`},u.default.createElement(s.Input,{placeholder:"搜索组件",allowClear:!0,onChange:e=>(e=>{const t=r.collapseData.reduce((e,t)=>(t.children&&e.push(...t.children),e),[]);n(e.target.value,t)})(e),style:{width:"100%",border:0}}))))},C_=e=>{const{prefixClz:t}=e,{propsProxy:n}=Fb(),r=n.getValue();return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-footer`,style:e.style},r.footer&&u.default.isValidElement(r.footer)&&r.footer))},O_=e=>{const{prefixClz:t,onCollapseBtnClick:n,isCollapsed:r,collapseButtonStyle:o,style:i}=e;return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-header`,style:Object.assign(Object.assign({},i),o),onClick:n},u.default.createElement(Da,{rotate:r?180:0})))};e.NsCollapsePanelModel=void 0,function(e){e.id="COLLAPSE_PANEL_DATA",e.useModel=t=>x(this,void 0,void 0,function*(){return t.awaitModel(e.id)})}(e.NsCollapsePanelModel||(e.NsCollapsePanelModel={}));var k_=Object.freeze({__proto__:null,get NsCollapsePanelModel(){return e.NsCollapsePanelModel}});const M_=t=>{const{collapsible:n,nodeDataService:r,searchService:o,onCollapseChange:i}=t,{modelService:a}=qs(),[s,l,d]=qy({keyword:"",collapseData:[],searchResult:[]});u.default.useEffect(()=>{a.findDeferredModel(e.NsCollapsePanelModel.id)||a.registerModel({id:e.NsCollapsePanelModel.id,modelFactory:()=>d,watchChange:e=>x(void 0,void 0,void 0,function*(){const t=yield tu.getModel(a),n=t.watch(t=>x(void 0,void 0,void 0,function*(){const{collapseData:n}=yield(e=>x(void 0,void 0,void 0,function*(){return{collapseData:yield r(e,a)}}))(t);e.setValue(e=>{e.keyword="",e.collapseData=n,e.searchResult=[]})}));return Er.create(()=>{n.dispose()})})})},[]);const c=u.default.useCallback(e=>{l(t=>{t.collapseData.forEach(t=>{t.id===e&&!1!==t.collapsible&&(t.isCollapsed=!t.isCollapsed)})})},[l]),f=u.default.useCallback((e,t)=>x(void 0,void 0,void 0,function*(){if(!o)return console.warn("searchService is not defined");if(e){const n=yield o(t,e);l(t=>{t.keyword=e,t.searchResult=n})}else l(e=>{e.keyword="",e.searchResult=[]})}),[o]);return{state:s,collapsible:n,setState:l,onKeywordChange:f,onActiveKeyChange:c,onCollapseChange:i}},N_=e=>{const{headerStyle:t,bodyStyle:n,footerStyle:r}=(e=>{const t=e&&e.headerPosition&&e.headerPosition.height||40,n=e.footerPosition&&e.footerPosition.height||40;return{headerStyle:vu(Object.assign({height:t,lineHeight:t,top:0,left:0,right:0},e.headerPosition)),bodyStyle:vu(Object.assign({left:0,right:0,top:t,bottom:n},e.bodyPosition)),footerStyle:vu(Object.assign({left:0,right:0,lineHeight:n,height:n,bottom:0},e.footerPosition))}})(e),{state:o,onActiveKeyChange:i,onKeywordChange:a}=M_(e);return u.default.createElement(u.default.Fragment,null,u.default.createElement(S_,Object.assign({},e,{state:o,style:t,onKeywordChange:a})),u.default.createElement(E_,Object.assign({},e,{state:o,style:n,onActiveKeyChange:i})),u.default.createElement(C_,Object.assign({},e,{state:o,style:r})))},A_=e=>{const{state:t}=e,{propsProxy:n}=Fb(),r=n.getValue(),o=qs(),i=r.footer&&"function"==typeof r.footer;return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${e.prefixClz}-footer`,style:e.style},i&&u.default.createElement(r.footer,Object.assign(Object.assign({},e),{headerStyle:{},bodyStyle:{},footerStyle:e.style,targetData:t.targetData,targetType:t.targetType,modelService:o.modelService,commandService:o.commandService})),!r.footer&&u.default.createElement("div",{className:`${e.prefixClz}-footer-title`},r.footerText)))},T_=e=>{const{prefixClz:t,hasSchema:n,state:r}=e,{propsProxy:o}=Fb(),i=o.getValue(),a=qs();if(n)return null;const s=i.header&&"function"==typeof i.header;return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-header`,style:e.style},s&&u.default.createElement(i.header,Object.assign(Object.assign({},e),{headerStyle:e.style,bodyStyle:{},footerStyle:{},targetData:r.targetData,targetType:r.targetType,modelService:a.modelService,commandService:a.commandService})),!i.header&&u.default.createElement("div",{className:`${t}-header-title`},i.headerText||"Panel")))},P_=e=>{const{text:t}=e,n=m(e,["text"]);return t?u.default.createElement(s.Tooltip,Object.assign({placement:"left",title:t},n),u.default.createElement("div",{className:"text-truncate"},t)):null};function D_(e){if(e)return u.default.createElement(P_,{text:e})}const j_=e=>{const{schema:n,children:r}=e,[o,i]=t.useState(),{dependencies:a,value:l,defaultValue:d,hidden:c,disabled:f}=n,h=t.useMemo(()=>(null==a?void 0:a.length)?function(e,t){return(n,r)=>e.some(e=>"function"==typeof(null==e?void 0:e.condition))?("function"==typeof t&&t(void 0),!0):e.some(e=>{const{name:o}=e;return o?!(_w(n,o)===_w(r,o)||("function"==typeof t&&t(o),0)):(console.error("[Schema form]: A dependent name must be provided in the updater when the dependency condition is not a function."),!1)})}(a,i):void 0,[a]);if("function"!=typeof r)throw new Error("[Schema Form]: chilren of FormItemWrapper should be a render prop.");const p=""===(g=l)||void 0===g?d:l;var g;return h?u.default.createElement(s.Form.Item,{noStyle:!0,shouldUpdate:h},e=>{const{hidden:t,disabled:i}=function(e,t,n){const{getFieldValue:r,getFieldsValue:o}=e,{dependencies:i,hidden:a,disabled:s}=t;let l=a,d=s;return null==i||i.forEach(e=>{const{name:t,condition:i,hidden:a,disabled:s}=e;if("function"!=typeof i&&n&&t!==n)return;let c=!1;if("function"==typeof i)c=!!i(o());else{if(!t)return void console.error("[Schema form]: A dependent name must be provided in the props genarator when the dependency condition is not a function.");c=r(t)===i}c&&(void 0!==a&&(l=a),void 0!==s&&(d=s))}),{hidden:l,disabled:d}}(e,n,o);return r({hidden:t,disabled:i,initialValue:p})}):r({hidden:c,disabled:f,initialValue:p})},I_=e=>{const{controlSchema:t}=e,{required:n,tooltip:r,extra:o,name:i,label:a,placeholder:l,rules:d}=t;return u.default.createElement(j_,{schema:t},({disabled:e,hidden:t,initialValue:c})=>u.default.createElement(s.Form.Item,{name:i,label:a,initialValue:c,tooltip:r,extra:D_(o),required:n,hidden:t,rules:d},u.default.createElement(s.Input,{className:"xflow-form-input",allowClear:!0,placeholder:l,disabled:e})))};var R_={exports:{}};!function(e){e.exports=function(){var t,n;function r(){return t.apply(null,arguments)}function o(e){t=e}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function d(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[],o=e.length;for(n=0;n<o;++n)r.push(t(e[n],n));return r}function h(e,t){for(var n in t)s(t,n)&&(e[n]=t[n]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Xn(e,t,n,r,!0).utc()}function g(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function v(e){return null==e._pf&&(e._pf=g()),e._pf}function m(e){var t=null,r=!1,o=e._d&&!isNaN(e._d.getTime());return o&&(t=v(e),r=n.call(t.parsedDateParts,function(e){return null!=e}),o=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r),e._strict&&(o=o&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?o:(e._isValid=o,e._isValid)}function y(e){var t=p(NaN);return null!=e?h(v(t),e):v(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),r=n.length>>>0;for(t=0;t<r;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var b=r.momentProperties=[],x=!1;function w(e,t){var n,r,o,i=b.length;if(d(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),d(t._i)||(e._i=t._i),d(t._f)||(e._f=t._f),d(t._l)||(e._l=t._l),d(t._strict)||(e._strict=t._strict),d(t._tzm)||(e._tzm=t._tzm),d(t._isUTC)||(e._isUTC=t._isUTC),d(t._offset)||(e._offset=t._offset),d(t._pf)||(e._pf=v(t)),d(t._locale)||(e._locale=t._locale),i>0)for(n=0;n<i;n++)d(o=t[r=b[n]])||(e[r]=o);return e}function _(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===x&&(x=!0,r.updateOffset(this),x=!1)}function S(e){return e instanceof _||null!=e&&null!=e._isAMomentObject}function C(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function O(e,t){var n=!0;return h(function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var o,i,a,l=[],d=arguments.length;for(i=0;i<d;i++){if(o="","object"==typeof arguments[i]){for(a in o+="\n["+i+"] ",arguments[0])s(arguments[0],a)&&(o+=a+": "+arguments[0][a]+", ");o=o.slice(0,-2)}else o=arguments[i];l.push(o)}C(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)},t)}var k,M={};function N(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),M[e]||(C(t),M[e]=!0)}function A(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function T(e){var t,n;for(n in e)s(e,n)&&(A(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function P(e,t){var n,r=h({},e);for(n in t)s(t,n)&&(a(e[n])&&a(t[n])?(r[n]={},h(r[n],e[n]),h(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)s(e,n)&&!s(t,n)&&a(e[n])&&(r[n]=h({},r[n]));return r}function D(e){null!=e&&this.set(e)}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,k=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var j={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function I(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return A(r)?r.call(t,n):r}function R(e,t,n){var r=""+Math.abs(e),o=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}var L=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,G={},U={};function H(e,t,n,r){var o=r;"string"==typeof r&&(o=function(){return this[r]()}),e&&(U[e]=o),t&&(U[t[0]]=function(){return R(o.apply(this,arguments),t[1],t[2])}),n&&(U[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function B(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function z(e){var t,n,r=e.match(L);for(t=0,n=r.length;t<n;t++)U[r[t]]?r[t]=U[r[t]]:r[t]=B(r[t]);return function(t){var o,i="";for(o=0;o<n;o++)i+=A(r[o])?r[o].call(t,e):r[o];return i}}function V(e,t){return e.isValid()?(t=Y(t,e.localeData()),G[t]=G[t]||z(t),G[t](e)):e.localeData().invalidDate()}function Y(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(F.lastIndex=0;n>=0&&F.test(e);)e=e.replace(F,r),F.lastIndex=0,n-=1;return e}var W={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function $(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(L).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])}var K="Invalid date";function X(){return this._invalidDate}var q="%d",Z=/\d{1,2}/;function J(e){return this._ordinal.replace("%d",e)}var Q={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ee(e,t,n,r){var o=this._relativeTime[n];return A(o)?o(e,t,n,r):o.replace(/%d/i,e)}function te(e,t){var n=this._relativeTime[e>0?"future":"past"];return A(n)?n(t):n.replace(/%s/i,t)}var ne={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function re(e){return"string"==typeof e?ne[e]||ne[e.toLowerCase()]:void 0}function oe(e){var t,n,r={};for(n in e)s(e,n)&&(t=re(n))&&(r[t]=e[n]);return r}var ie={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function ae(e){var t,n=[];for(t in e)s(e,t)&&n.push({unit:t,priority:ie[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}var se,le=/\d/,de=/\d\d/,ce=/\d{3}/,ue=/\d{4}/,fe=/[+-]?\d{6}/,he=/\d\d?/,pe=/\d\d\d\d?/,ge=/\d\d\d\d\d\d?/,ve=/\d{1,3}/,me=/\d{1,4}/,ye=/[+-]?\d{1,6}/,be=/\d+/,xe=/[+-]?\d+/,we=/Z|[+-]\d\d:?\d\d/gi,_e=/Z|[+-]\d\d(?::?\d\d)?/gi,Ee=/[+-]?\d+(\.\d{1,3})?/,Se=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ce=/^[1-9]\d?/,Oe=/^([1-9]\d|\d)/;function ke(e,t,n){se[e]=A(t)?t:function(e,r){return e&&n?n:t}}function Me(e,t){return s(se,e)?se[e](t._strict,t._locale):new RegExp(Ne(e))}function Ne(e){return Ae(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,o){return t||n||r||o}))}function Ae(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Te(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Pe(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=Te(t)),n}se={};var De={};function je(e,t){var n,r,o=t;for("string"==typeof e&&(e=[e]),c(t)&&(o=function(e,n){n[t]=Pe(e)}),r=e.length,n=0;n<r;n++)De[e[n]]=o}function Ie(e,t){je(e,function(e,n,r,o){r._w=r._w||{},t(e,r._w,r,o)})}function Re(e,t,n){null!=t&&s(De,e)&&De[e](t,n._a,n,e)}function Le(e){return e%4==0&&e%100!=0||e%400==0}var Fe=0,Ge=1,Ue=2,He=3,Be=4,ze=5,Ve=6,Ye=7,We=8;function $e(e){return Le(e)?366:365}H("Y",0,0,function(){var e=this.year();return e<=9999?R(e,4):"+"+e}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),ke("Y",xe),ke("YY",he,de),ke("YYYY",me,ue),ke("YYYYY",ye,fe),ke("YYYYYY",ye,fe),je(["YYYYY","YYYYYY"],Fe),je("YYYY",function(e,t){t[Fe]=2===e.length?r.parseTwoDigitYear(e):Pe(e)}),je("YY",function(e,t){t[Fe]=r.parseTwoDigitYear(e)}),je("Y",function(e,t){t[Fe]=parseInt(e,10)}),r.parseTwoDigitYear=function(e){return Pe(e)+(Pe(e)>68?1900:2e3)};var Ke,Xe=Ze("FullYear",!0);function qe(){return Le(this.year())}function Ze(e,t){return function(n){return null!=n?(Qe(this,e,n),r.updateOffset(this,t),this):Je(this,e)}}function Je(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Qe(e,t,n){var r,o,i,a,s;if(e.isValid()&&!isNaN(n)){switch(r=e._d,o=e._isUTC,t){case"Milliseconds":return void(o?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(o?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(o?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(o?r.setUTCHours(n):r.setHours(n));case"Date":return void(o?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}i=n,a=e.month(),s=29!==(s=e.date())||1!==a||Le(i)?s:28,o?r.setUTCFullYear(i,a,s):r.setFullYear(i,a,s)}}function et(e){return A(this[e=re(e)])?this[e]():this}function tt(e,t){if("object"==typeof e){var n,r=ae(e=oe(e)),o=r.length;for(n=0;n<o;n++)this[r[n].unit](e[r[n].unit])}else if(A(this[e=re(e)]))return this[e](t);return this}function nt(e,t){return(e%t+t)%t}function rt(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=nt(t,12);return e+=(t-n)/12,1===n?Le(e)?29:28:31-n%7%2}Ke=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),H("MMMM",0,0,function(e){return this.localeData().months(this,e)}),ke("M",he,Ce),ke("MM",he,de),ke("MMM",function(e,t){return t.monthsShortRegex(e)}),ke("MMMM",function(e,t){return t.monthsRegex(e)}),je(["M","MM"],function(e,t){t[Ge]=Pe(e)-1}),je(["MMM","MMMM"],function(e,t,n,r){var o=n._locale.monthsParse(e,r,n._strict);null!=o?t[Ge]=o:v(n).invalidMonth=e});var ot="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),it="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),at=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,st=Se,lt=Se;function dt(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||at).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone}function ct(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[at.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ut(e,t,n){var r,o,i,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(o=Ke.call(this._shortMonthsParse,a))?o:null:-1!==(o=Ke.call(this._longMonthsParse,a))?o:null:"MMM"===t?-1!==(o=Ke.call(this._shortMonthsParse,a))||-1!==(o=Ke.call(this._longMonthsParse,a))?o:null:-1!==(o=Ke.call(this._longMonthsParse,a))||-1!==(o=Ke.call(this._shortMonthsParse,a))?o:null}function ft(e,t,n){var r,o,i;if(this._monthsParseExact)return ut.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(o=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(i="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function ht(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=Pe(t);else if(!c(t=e.localeData().monthsParse(t)))return e;var n=t,r=e.date();return r=r<29?r:Math.min(r,rt(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function pt(e){return null!=e?(ht(this,e),r.updateOffset(this,!0),this):Je(this,"Month")}function gt(){return rt(this.year(),this.month())}function vt(e){return this._monthsParseExact?(s(this,"_monthsRegex")||yt.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=st),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function mt(e){return this._monthsParseExact?(s(this,"_monthsRegex")||yt.call(this),e?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=lt),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function yt(){function e(e,t){return t.length-e.length}var t,n,r,o,i=[],a=[],s=[];for(t=0;t<12;t++)n=p([2e3,t]),r=Ae(this.monthsShort(n,"")),o=Ae(this.months(n,"")),i.push(r),a.push(o),s.push(o),s.push(r);i.sort(e),a.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function bt(e,t,n,r,o,i,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,o,i,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,o,i,a),s}function xt(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function wt(e,t,n){var r=7+t-n;return-(7+xt(e,0,r).getUTCDay()-t)%7+r-1}function _t(e,t,n,r,o){var i,a,s=1+7*(t-1)+(7+n-r)%7+wt(e,r,o);return s<=0?a=$e(i=e-1)+s:s>$e(e)?(i=e+1,a=s-$e(e)):(i=e,a=s),{year:i,dayOfYear:a}}function Et(e,t,n){var r,o,i=wt(e.year(),t,n),a=Math.floor((e.dayOfYear()-i-1)/7)+1;return a<1?r=a+St(o=e.year()-1,t,n):a>St(e.year(),t,n)?(r=a-St(e.year(),t,n),o=e.year()+1):(o=e.year(),r=a),{week:r,year:o}}function St(e,t,n){var r=wt(e,t,n),o=wt(e+1,t,n);return($e(e)-r+o)/7}function Ct(e){return Et(e,this._week.dow,this._week.doy).week}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),ke("w",he,Ce),ke("ww",he,de),ke("W",he,Ce),ke("WW",he,de),Ie(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=Pe(e)});var Ot={dow:0,doy:6};function kt(){return this._week.dow}function Mt(){return this._week.doy}function Nt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function At(e){var t=Et(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Tt(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Pt(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Dt(e,t){return e.slice(t,7).concat(e.slice(0,t))}H("d",0,"do","day"),H("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),H("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),H("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),ke("d",he),ke("e",he),ke("E",he),ke("dd",function(e,t){return t.weekdaysMinRegex(e)}),ke("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ke("dddd",function(e,t){return t.weekdaysRegex(e)}),Ie(["dd","ddd","dddd"],function(e,t,n,r){var o=n._locale.weekdaysParse(e,r,n._strict);null!=o?t.d=o:v(n).invalidWeekday=e}),Ie(["d","e","E"],function(e,t,n,r){t[r]=Pe(e)});var jt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),It="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Lt=Se,Ft=Se,Gt=Se;function Ut(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Dt(n,this._week.dow):e?n[e.day()]:n}function Ht(e){return!0===e?Dt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Bt(e){return!0===e?Dt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function zt(e,t,n){var r,o,i,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(o=Ke.call(this._weekdaysParse,a))?o:null:"ddd"===t?-1!==(o=Ke.call(this._shortWeekdaysParse,a))?o:null:-1!==(o=Ke.call(this._minWeekdaysParse,a))?o:null:"dddd"===t?-1!==(o=Ke.call(this._weekdaysParse,a))||-1!==(o=Ke.call(this._shortWeekdaysParse,a))||-1!==(o=Ke.call(this._minWeekdaysParse,a))?o:null:"ddd"===t?-1!==(o=Ke.call(this._shortWeekdaysParse,a))||-1!==(o=Ke.call(this._weekdaysParse,a))||-1!==(o=Ke.call(this._minWeekdaysParse,a))?o:null:-1!==(o=Ke.call(this._minWeekdaysParse,a))||-1!==(o=Ke.call(this._weekdaysParse,a))||-1!==(o=Ke.call(this._shortWeekdaysParse,a))?o:null}function Vt(e,t,n){var r,o,i;if(this._weekdaysParseExact)return zt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function Yt(e){if(!this.isValid())return null!=e?this:NaN;var t=Je(this,"Day");return null!=e?(e=Tt(e,this.localeData()),this.add(e-t,"d")):t}function Wt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function $t(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Pt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Kt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Zt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Lt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Xt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Zt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ft),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function qt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Zt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Gt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Zt(){function e(e,t){return t.length-e.length}var t,n,r,o,i,a=[],s=[],l=[],d=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=Ae(this.weekdaysMin(n,"")),o=Ae(this.weekdaysShort(n,"")),i=Ae(this.weekdays(n,"")),a.push(r),s.push(o),l.push(i),d.push(r),d.push(o),d.push(i);a.sort(e),s.sort(e),l.sort(e),d.sort(e),this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Jt(){return this.hours()%12||12}function Qt(){return this.hours()||24}function en(e,t){H(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function tn(e,t){return t._meridiemParse}function nn(e){return"p"===(e+"").toLowerCase().charAt(0)}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Jt),H("k",["kk",2],0,Qt),H("hmm",0,0,function(){return""+Jt.apply(this)+R(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Jt.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+R(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)}),en("a",!0),en("A",!1),ke("a",tn),ke("A",tn),ke("H",he,Oe),ke("h",he,Ce),ke("k",he,Ce),ke("HH",he,de),ke("hh",he,de),ke("kk",he,de),ke("hmm",pe),ke("hmmss",ge),ke("Hmm",pe),ke("Hmmss",ge),je(["H","HH"],He),je(["k","kk"],function(e,t,n){var r=Pe(e);t[He]=24===r?0:r}),je(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),je(["h","hh"],function(e,t,n){t[He]=Pe(e),v(n).bigHour=!0}),je("hmm",function(e,t,n){var r=e.length-2;t[He]=Pe(e.substr(0,r)),t[Be]=Pe(e.substr(r)),v(n).bigHour=!0}),je("hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[He]=Pe(e.substr(0,r)),t[Be]=Pe(e.substr(r,2)),t[ze]=Pe(e.substr(o)),v(n).bigHour=!0}),je("Hmm",function(e,t,n){var r=e.length-2;t[He]=Pe(e.substr(0,r)),t[Be]=Pe(e.substr(r))}),je("Hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[He]=Pe(e.substr(0,r)),t[Be]=Pe(e.substr(r,2)),t[ze]=Pe(e.substr(o))});var rn=/[ap]\.?m?\.?/i,on=Ze("Hours",!0);function an(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var sn,ln={calendar:j,longDateFormat:W,invalidDate:K,ordinal:q,dayOfMonthOrdinalParse:Z,relativeTime:Q,months:ot,monthsShort:it,week:Ot,weekdays:jt,weekdaysMin:Rt,weekdaysShort:It,meridiemParse:rn},dn={},cn={};function un(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function fn(e){return e?e.toLowerCase().replace("_","-"):e}function hn(e){for(var t,n,r,o,i=0;i<e.length;){for(t=(o=fn(e[i]).split("-")).length,n=(n=fn(e[i+1]))?n.split("-"):null;t>0;){if(r=gn(o.slice(0,t).join("-")))return r;if(n&&n.length>=t&&un(o,n)>=t-1)break;t--}i++}return sn}function pn(e){return!(!e||!e.match("^[^/\\\\]*$"))}function gn(t){var n=null;if(void 0===dn[t]&&e&&e.exports&&pn(t))try{n=sn._abbr,E("./locale/"+t),vn(n)}catch(e){dn[t]=null}return dn[t]}function vn(e,t){var n;return e&&((n=d(t)?bn(e):mn(e,t))?sn=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),sn._abbr}function mn(e,t){if(null!==t){var n,r=ln;if(t.abbr=e,null!=dn[e])N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=dn[e]._config;else if(null!=t.parentLocale)if(null!=dn[t.parentLocale])r=dn[t.parentLocale]._config;else{if(null==(n=gn(t.parentLocale)))return cn[t.parentLocale]||(cn[t.parentLocale]=[]),cn[t.parentLocale].push({name:e,config:t}),null;r=n._config}return dn[e]=new D(P(r,t)),cn[e]&&cn[e].forEach(function(e){mn(e.name,e.config)}),vn(e),dn[e]}return delete dn[e],null}function yn(e,t){if(null!=t){var n,r,o=ln;null!=dn[e]&&null!=dn[e].parentLocale?dn[e].set(P(dn[e]._config,t)):(null!=(r=gn(e))&&(o=r._config),t=P(o,t),null==r&&(t.abbr=e),(n=new D(t)).parentLocale=dn[e],dn[e]=n),vn(e)}else null!=dn[e]&&(null!=dn[e].parentLocale?(dn[e]=dn[e].parentLocale,e===vn()&&vn(e)):null!=dn[e]&&delete dn[e]);return dn[e]}function bn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return sn;if(!i(e)){if(t=gn(e))return t;e=[e]}return hn(e)}function xn(){return k(dn)}function wn(e){var t,n=e._a;return n&&-2===v(e).overflow&&(t=n[Ge]<0||n[Ge]>11?Ge:n[Ue]<1||n[Ue]>rt(n[Fe],n[Ge])?Ue:n[He]<0||n[He]>24||24===n[He]&&(0!==n[Be]||0!==n[ze]||0!==n[Ve])?He:n[Be]<0||n[Be]>59?Be:n[ze]<0||n[ze]>59?ze:n[Ve]<0||n[Ve]>999?Ve:-1,v(e)._overflowDayOfYear&&(t<Fe||t>Ue)&&(t=Ue),v(e)._overflowWeeks&&-1===t&&(t=Ye),v(e)._overflowWeekday&&-1===t&&(t=We),v(e).overflow=t),e}var _n=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,En=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sn=/Z|[+-]\d\d(?::?\d\d)?/,Cn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],On=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],kn=/^\/?Date\((-?\d+)/i,Mn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Nn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function An(e){var t,n,r,o,i,a,s=e._i,l=_n.exec(s)||En.exec(s),d=Cn.length,c=On.length;if(l){for(v(e).iso=!0,t=0,n=d;t<n;t++)if(Cn[t][1].exec(l[1])){o=Cn[t][0],r=!1!==Cn[t][2];break}if(null==o)return void(e._isValid=!1);if(l[3]){for(t=0,n=c;t<n;t++)if(On[t][1].exec(l[3])){i=(l[2]||" ")+On[t][0];break}if(null==i)return void(e._isValid=!1)}if(!r&&null!=i)return void(e._isValid=!1);if(l[4]){if(!Sn.exec(l[4]))return void(e._isValid=!1);a="Z"}e._f=o+(i||"")+(a||""),Bn(e)}else e._isValid=!1}function Tn(e,t,n,r,o,i){var a=[Pn(e),it.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(o,10)];return i&&a.push(parseInt(i,10)),a}function Pn(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Dn(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function jn(e,t,n){return!e||It.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(v(n).weekdayMismatch=!0,n._isValid=!1,!1)}function In(e,t,n){if(e)return Nn[e];if(t)return 0;var r=parseInt(n,10),o=r%100;return(r-o)/100*60+o}function Rn(e){var t,n=Mn.exec(Dn(e._i));if(n){if(t=Tn(n[4],n[3],n[2],n[5],n[6],n[7]),!jn(n[1],t,e))return;e._a=t,e._tzm=In(n[8],n[9],n[10]),e._d=xt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),v(e).rfc2822=!0}else e._isValid=!1}function Ln(e){var t=kn.exec(e._i);null===t?(An(e),!1===e._isValid&&(delete e._isValid,Rn(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}function Fn(e,t,n){return null!=e?e:null!=t?t:n}function Gn(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Un(e){var t,n,r,o,i,a=[];if(!e._d){for(r=Gn(e),e._w&&null==e._a[Ue]&&null==e._a[Ge]&&Hn(e),null!=e._dayOfYear&&(i=Fn(e._a[Fe],r[Fe]),(e._dayOfYear>$e(i)||0===e._dayOfYear)&&(v(e)._overflowDayOfYear=!0),n=xt(i,0,e._dayOfYear),e._a[Ge]=n.getUTCMonth(),e._a[Ue]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=r[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[He]&&0===e._a[Be]&&0===e._a[ze]&&0===e._a[Ve]&&(e._nextDay=!0,e._a[He]=0),e._d=(e._useUTC?xt:bt).apply(null,a),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[He]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(v(e).weekdayMismatch=!0)}}function Hn(e){var t,n,r,o,i,a,s,l,d;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,a=4,n=Fn(t.GG,e._a[Fe],Et(qn(),1,4).year),r=Fn(t.W,1),((o=Fn(t.E,1))<1||o>7)&&(l=!0)):(i=e._locale._week.dow,a=e._locale._week.doy,d=Et(qn(),i,a),n=Fn(t.gg,e._a[Fe],d.year),r=Fn(t.w,d.week),null!=t.d?((o=t.d)<0||o>6)&&(l=!0):null!=t.e?(o=t.e+i,(t.e<0||t.e>6)&&(l=!0)):o=i),r<1||r>St(n,i,a)?v(e)._overflowWeeks=!0:null!=l?v(e)._overflowWeekday=!0:(s=_t(n,r,o,i,a),e._a[Fe]=s.year,e._dayOfYear=s.dayOfYear)}function Bn(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],v(e).empty=!0;var t,n,o,i,a,s,l,d=""+e._i,c=d.length,u=0;for(l=(o=Y(e._f,e._locale).match(L)||[]).length,t=0;t<l;t++)i=o[t],(n=(d.match(Me(i,e))||[])[0])&&((a=d.substr(0,d.indexOf(n))).length>0&&v(e).unusedInput.push(a),d=d.slice(d.indexOf(n)+n.length),u+=n.length),U[i]?(n?v(e).empty=!1:v(e).unusedTokens.push(i),Re(i,n,e)):e._strict&&!n&&v(e).unusedTokens.push(i);v(e).charsLeftOver=c-u,d.length>0&&v(e).unusedInput.push(d),e._a[He]<=12&&!0===v(e).bigHour&&e._a[He]>0&&(v(e).bigHour=void 0),v(e).parsedDateParts=e._a.slice(0),v(e).meridiem=e._meridiem,e._a[He]=zn(e._locale,e._a[He],e._meridiem),null!==(s=v(e).era)&&(e._a[Fe]=e._locale.erasConvertYear(s,e._a[Fe])),Un(e),wn(e)}else Rn(e);else An(e)}function zn(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function Vn(e){var t,n,r,o,i,a,s=!1,l=e._f.length;if(0===l)return v(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;o<l;o++)i=0,a=!1,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[o],Bn(t),m(t)&&(a=!0),i+=v(t).charsLeftOver,i+=10*v(t).unusedTokens.length,v(t).score=i,s?i<r&&(r=i,n=t):(null==r||i<r||a)&&(r=i,n=t,a&&(s=!0));h(e,n||t)}function Yn(e){if(!e._d){var t=oe(e._i),n=void 0===t.day?t.date:t.day;e._a=f([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Un(e)}}function Wn(e){var t=new _(wn($n(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function $n(e){var t=e._i,n=e._f;return e._locale=e._locale||bn(e._l),null===t||void 0===n&&""===t?y({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),S(t)?new _(wn(t)):(u(t)?e._d=t:i(n)?Vn(e):n?Bn(e):Kn(e),m(e)||(e._d=null),e))}function Kn(e){var t=e._i;d(t)?e._d=new Date(r.now()):u(t)?e._d=new Date(t.valueOf()):"string"==typeof t?Ln(e):i(t)?(e._a=f(t.slice(0),function(e){return parseInt(e,10)}),Un(e)):a(t)?Yn(e):c(t)?e._d=new Date(t):r.createFromInputFallback(e)}function Xn(e,t,n,r,o){var s={};return!0!==t&&!1!==t||(r=t,t=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(a(e)&&l(e)||i(e)&&0===e.length)&&(e=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=o,s._l=n,s._i=e,s._f=t,s._strict=r,Wn(s)}function qn(e,t,n,r){return Xn(e,t,n,r,!1)}r.createFromInputFallback=O("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),r.ISO_8601=function(){},r.RFC_2822=function(){};var Zn=O("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=qn.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:y()}),Jn=O("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=qn.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:y()});function Qn(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return qn();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}function er(){return Qn("isBefore",[].slice.call(arguments,0))}function tr(){return Qn("isAfter",[].slice.call(arguments,0))}var nr=function(){return Date.now?Date.now():+new Date},rr=["year","quarter","month","week","day","hour","minute","second","millisecond"];function or(e){var t,n,r=!1,o=rr.length;for(t in e)if(s(e,t)&&(-1===Ke.call(rr,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<o;++n)if(e[rr[n]]){if(r)return!1;parseFloat(e[rr[n]])!==Pe(e[rr[n]])&&(r=!0)}return!0}function ir(){return this._isValid}function ar(){return Nr(NaN)}function sr(e){var t=oe(e),n=t.year||0,r=t.quarter||0,o=t.month||0,i=t.week||t.isoWeek||0,a=t.day||0,s=t.hour||0,l=t.minute||0,d=t.second||0,c=t.millisecond||0;this._isValid=or(t),this._milliseconds=+c+1e3*d+6e4*l+1e3*s*60*60,this._days=+a+7*i,this._months=+o+3*r+12*n,this._data={},this._locale=bn(),this._bubble()}function lr(e){return e instanceof sr}function dr(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function cr(e,t,n){var r,o=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0;for(r=0;r<o;r++)(n&&e[r]!==t[r]||!n&&Pe(e[r])!==Pe(t[r]))&&a++;return a+i}function ur(e,t){H(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+R(~~(e/60),2)+t+R(~~e%60,2)})}ur("Z",":"),ur("ZZ",""),ke("Z",_e),ke("ZZ",_e),je(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=hr(_e,e)});var fr=/([\+\-]|\d\d)/gi;function hr(e,t){var n,r,o=(t||"").match(e);return null===o?null:0===(r=60*(n=((o[o.length-1]||[])+"").match(fr)||["-",0,0])[1]+Pe(n[2]))?0:"+"===n[0]?r:-r}function pr(e,t){var n,o;return t._isUTC?(n=t.clone(),o=(S(e)||u(e)?e.valueOf():qn(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+o),r.updateOffset(n,!1),n):qn(e).local()}function gr(e){return-Math.round(e._d.getTimezoneOffset())}function vr(e,t,n){var o,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=hr(_e,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(o=gr(this)),this._offset=e,this._isUTC=!0,null!=o&&this.add(o,"m"),i!==e&&(!t||this._changeInProgress?jr(this,Nr(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:gr(this)}function mr(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function yr(e){return this.utcOffset(0,e)}function br(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(gr(this),"m")),this}function xr(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=hr(we,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function wr(e){return!!this.isValid()&&(e=e?qn(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function _r(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Er(){if(!d(this._isDSTShifted))return this._isDSTShifted;var e,t={};return w(t,this),(t=$n(t))._a?(e=t._isUTC?p(t._a):qn(t._a),this._isDSTShifted=this.isValid()&&cr(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Sr(){return!!this.isValid()&&!this._isUTC}function Cr(){return!!this.isValid()&&this._isUTC}function Or(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var kr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Mr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Nr(e,t){var n,r,o,i=e,a=null;return lr(e)?i={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(i={},t?i[t]=+e:i.milliseconds=+e):(a=kr.exec(e))?(n="-"===a[1]?-1:1,i={y:0,d:Pe(a[Ue])*n,h:Pe(a[He])*n,m:Pe(a[Be])*n,s:Pe(a[ze])*n,ms:Pe(dr(1e3*a[Ve]))*n}):(a=Mr.exec(e))?(n="-"===a[1]?-1:1,i={y:Ar(a[2],n),M:Ar(a[3],n),w:Ar(a[4],n),d:Ar(a[5],n),h:Ar(a[6],n),m:Ar(a[7],n),s:Ar(a[8],n)}):null==i?i={}:"object"==typeof i&&("from"in i||"to"in i)&&(o=Pr(qn(i.from),qn(i.to)),(i={}).ms=o.milliseconds,i.M=o.months),r=new sr(i),lr(e)&&s(e,"_locale")&&(r._locale=e._locale),lr(e)&&s(e,"_isValid")&&(r._isValid=e._isValid),r}function Ar(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Tr(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Pr(e,t){var n;return e.isValid()&&t.isValid()?(t=pr(t,e),e.isBefore(t)?n=Tr(e,t):((n=Tr(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Dr(e,t){return function(n,r){var o;return null===r||isNaN(+r)||(N(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),jr(this,Nr(n,r),e),this}}function jr(e,t,n,o){var i=t._milliseconds,a=dr(t._days),s=dr(t._months);e.isValid()&&(o=null==o||o,s&&ht(e,Je(e,"Month")+s*n),a&&Qe(e,"Date",Je(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),o&&r.updateOffset(e,a||s))}Nr.fn=sr.prototype,Nr.invalid=ar;var Ir=Dr(1,"add"),Rr=Dr(-1,"subtract");function Lr(e){return"string"==typeof e||e instanceof String}function Fr(e){return S(e)||u(e)||Lr(e)||c(e)||Ur(e)||Gr(e)||null==e}function Gr(e){var t,n,r=a(e)&&!l(e),o=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],d=i.length;for(t=0;t<d;t+=1)n=i[t],o=o||s(e,n);return r&&o}function Ur(e){var t=i(e),n=!1;return t&&(n=0===e.filter(function(t){return!c(t)&&Lr(e)}).length),t&&n}function Hr(e){var t,n,r=a(e)&&!l(e),o=!1,i=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<i.length;t+=1)n=i[t],o=o||s(e,n);return r&&o}function Br(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function zr(e,t){1===arguments.length&&(arguments[0]?Fr(arguments[0])?(e=arguments[0],t=void 0):Hr(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||qn(),o=pr(n,this).startOf("day"),i=r.calendarFormat(this,o)||"sameElse",a=t&&(A(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,qn(n)))}function Vr(){return new _(this)}function Yr(e,t){var n=S(e)?e:qn(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function Wr(e,t){var n=S(e)?e:qn(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function $r(e,t,n,r){var o=S(e)?e:qn(e),i=S(t)?t:qn(t);return!!(this.isValid()&&o.isValid()&&i.isValid())&&("("===(r=r||"()")[0]?this.isAfter(o,n):!this.isBefore(o,n))&&(")"===r[1]?this.isBefore(i,n):!this.isAfter(i,n))}function Kr(e,t){var n,r=S(e)?e:qn(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=re(t)||"millisecond")?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function Xr(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function qr(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Zr(e,t,n){var r,o,i;if(!this.isValid())return NaN;if(!(r=pr(e,this)).isValid())return NaN;switch(o=6e4*(r.utcOffset()-this.utcOffset()),t=re(t)){case"year":i=Jr(this,r)/12;break;case"month":i=Jr(this,r);break;case"quarter":i=Jr(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-o)/864e5;break;case"week":i=(this-r-o)/6048e5;break;default:i=this-r}return n?i:Te(i)}function Jr(e,t){if(e.date()<t.date())return-Jr(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function Qr(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function eo(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?V(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(n,"Z")):V(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function to(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r,o="moment",i="";return this.isLocal()||(o=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+o+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=i+'[")]',this.format(e+t+n+r)}function no(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=V(this,e);return this.localeData().postformat(t)}function ro(e,t){return this.isValid()&&(S(e)&&e.isValid()||qn(e).isValid())?Nr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function oo(e){return this.from(qn(),e)}function io(e,t){return this.isValid()&&(S(e)&&e.isValid()||qn(e).isValid())?Nr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ao(e){return this.to(qn(),e)}function so(e){var t;return void 0===e?this._locale._abbr:(null!=(t=bn(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var lo=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function co(){return this._locale}var uo=1e3,fo=60*uo,ho=60*fo,po=3506328*ho;function go(e,t){return(e%t+t)%t}function vo(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-po:new Date(e,t,n).valueOf()}function mo(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-po:Date.UTC(e,t,n)}function yo(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?mo:vo,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=go(t+(this._isUTC?0:this.utcOffset()*fo),ho);break;case"minute":t=this._d.valueOf(),t-=go(t,fo);break;case"second":t=this._d.valueOf(),t-=go(t,uo)}return this._d.setTime(t),r.updateOffset(this,!0),this}function bo(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?mo:vo,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ho-go(t+(this._isUTC?0:this.utcOffset()*fo),ho)-1;break;case"minute":t=this._d.valueOf(),t+=fo-go(t,fo)-1;break;case"second":t=this._d.valueOf(),t+=uo-go(t,uo)-1}return this._d.setTime(t),r.updateOffset(this,!0),this}function xo(){return this._d.valueOf()-6e4*(this._offset||0)}function wo(){return Math.floor(this.valueOf()/1e3)}function _o(){return new Date(this.valueOf())}function Eo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function So(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Co(){return this.isValid()?this.toISOString():null}function Oo(){return m(this)}function ko(){return h({},v(this))}function Mo(){return v(this).overflow}function No(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ao(e,t){var n,o,i,a=this._eras||bn("en")._eras;for(n=0,o=a.length;n<o;++n)switch("string"==typeof a[n].since&&(i=r(a[n].since).startOf("day"),a[n].since=i.valueOf()),typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":i=r(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf()}return a}function To(e,t,n){var r,o,i,a,s,l=this.eras();for(e=e.toUpperCase(),r=0,o=l.length;r<o;++r)if(i=l[r].name.toUpperCase(),a=l[r].abbr.toUpperCase(),s=l[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return l[r];break;case"NNNN":if(i===e)return l[r];break;case"NNNNN":if(s===e)return l[r]}else if([i,a,s].indexOf(e)>=0)return l[r]}function Po(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n}function Do(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].name;if(r[e].until<=n&&n<=r[e].since)return r[e].name}return""}function jo(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].narrow;if(r[e].until<=n&&n<=r[e].since)return r[e].narrow}return""}function Io(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].abbr;if(r[e].until<=n&&n<=r[e].since)return r[e].abbr}return""}function Ro(){var e,t,n,o,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,o=this.clone().startOf("day").valueOf(),i[e].since<=o&&o<=i[e].until||i[e].until<=o&&o<=i[e].since)return(this.year()-r(i[e].since).year())*n+i[e].offset;return this.year()}function Lo(e){return s(this,"_erasNameRegex")||Vo.call(this),e?this._erasNameRegex:this._erasRegex}function Fo(e){return s(this,"_erasAbbrRegex")||Vo.call(this),e?this._erasAbbrRegex:this._erasRegex}function Go(e){return s(this,"_erasNarrowRegex")||Vo.call(this),e?this._erasNarrowRegex:this._erasRegex}function Uo(e,t){return t.erasAbbrRegex(e)}function Ho(e,t){return t.erasNameRegex(e)}function Bo(e,t){return t.erasNarrowRegex(e)}function zo(e,t){return t._eraYearOrdinalRegex||be}function Vo(){var e,t,n,r,o,i=[],a=[],s=[],l=[],d=this.eras();for(e=0,t=d.length;e<t;++e)n=Ae(d[e].name),r=Ae(d[e].abbr),o=Ae(d[e].narrow),a.push(n),i.push(r),s.push(o),l.push(n),l.push(r),l.push(o);this._erasRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+a.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+s.join("|")+")","i")}function Yo(e,t){H(0,[e,e.length],0,t)}function Wo(e){return Jo.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function $o(e){return Jo.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Ko(){return St(this.year(),1,4)}function Xo(){return St(this.isoWeekYear(),1,4)}function qo(){var e=this.localeData()._week;return St(this.year(),e.dow,e.doy)}function Zo(){var e=this.localeData()._week;return St(this.weekYear(),e.dow,e.doy)}function Jo(e,t,n,r,o){var i;return null==e?Et(this,r,o).year:(t>(i=St(e,r,o))&&(t=i),Qo.call(this,e,t,n,r,o))}function Qo(e,t,n,r,o){var i=_t(e,t,n,r,o),a=xt(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function ei(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),ke("N",Uo),ke("NN",Uo),ke("NNN",Uo),ke("NNNN",Ho),ke("NNNNN",Bo),je(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var o=n._locale.erasParse(e,r,n._strict);o?v(n).era=o:v(n).invalidEra=e}),ke("y",be),ke("yy",be),ke("yyy",be),ke("yyyy",be),ke("yo",zo),je(["y","yy","yyy","yyyy"],Fe),je(["yo"],function(e,t,n,r){var o;n._locale._eraYearOrdinalRegex&&(o=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Fe]=n._locale.eraYearOrdinalParse(e,o):t[Fe]=parseInt(e,10)}),H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Yo("gggg","weekYear"),Yo("ggggg","weekYear"),Yo("GGGG","isoWeekYear"),Yo("GGGGG","isoWeekYear"),ke("G",xe),ke("g",xe),ke("GG",he,de),ke("gg",he,de),ke("GGGG",me,ue),ke("gggg",me,ue),ke("GGGGG",ye,fe),ke("ggggg",ye,fe),Ie(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=Pe(e)}),Ie(["gg","GG"],function(e,t,n,o){t[o]=r.parseTwoDigitYear(e)}),H("Q",0,"Qo","quarter"),ke("Q",le),je("Q",function(e,t){t[Ge]=3*(Pe(e)-1)}),H("D",["DD",2],"Do","date"),ke("D",he,Ce),ke("DD",he,de),ke("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),je(["D","DD"],Ue),je("Do",function(e,t){t[Ue]=Pe(e.match(he)[0])});var ti=Ze("Date",!0);function ni(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}H("DDD",["DDDD",3],"DDDo","dayOfYear"),ke("DDD",ve),ke("DDDD",ce),je(["DDD","DDDD"],function(e,t,n){n._dayOfYear=Pe(e)}),H("m",["mm",2],0,"minute"),ke("m",he,Oe),ke("mm",he,de),je(["m","mm"],Be);var ri=Ze("Minutes",!1);H("s",["ss",2],0,"second"),ke("s",he,Oe),ke("ss",he,de),je(["s","ss"],ze);var oi,ii,ai=Ze("Seconds",!1);for(H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),ke("S",ve,le),ke("SS",ve,de),ke("SSS",ve,ce),oi="SSSS";oi.length<=9;oi+="S")ke(oi,be);function si(e,t){t[Ve]=Pe(1e3*("0."+e))}for(oi="S";oi.length<=9;oi+="S")je(oi,si);function li(){return this._isUTC?"UTC":""}function di(){return this._isUTC?"Coordinated Universal Time":""}ii=Ze("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var ci=_.prototype;function ui(e){return qn(1e3*e)}function fi(){return qn.apply(null,arguments).parseZone()}function hi(e){return e}ci.add=Ir,ci.calendar=zr,ci.clone=Vr,ci.diff=Zr,ci.endOf=bo,ci.format=no,ci.from=ro,ci.fromNow=oo,ci.to=io,ci.toNow=ao,ci.get=et,ci.invalidAt=Mo,ci.isAfter=Yr,ci.isBefore=Wr,ci.isBetween=$r,ci.isSame=Kr,ci.isSameOrAfter=Xr,ci.isSameOrBefore=qr,ci.isValid=Oo,ci.lang=lo,ci.locale=so,ci.localeData=co,ci.max=Jn,ci.min=Zn,ci.parsingFlags=ko,ci.set=tt,ci.startOf=yo,ci.subtract=Rr,ci.toArray=Eo,ci.toObject=So,ci.toDate=_o,ci.toISOString=eo,ci.inspect=to,"undefined"!=typeof Symbol&&null!=Symbol.for&&(ci[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ci.toJSON=Co,ci.toString=Qr,ci.unix=wo,ci.valueOf=xo,ci.creationData=No,ci.eraName=Do,ci.eraNarrow=jo,ci.eraAbbr=Io,ci.eraYear=Ro,ci.year=Xe,ci.isLeapYear=qe,ci.weekYear=Wo,ci.isoWeekYear=$o,ci.quarter=ci.quarters=ei,ci.month=pt,ci.daysInMonth=gt,ci.week=ci.weeks=Nt,ci.isoWeek=ci.isoWeeks=At,ci.weeksInYear=qo,ci.weeksInWeekYear=Zo,ci.isoWeeksInYear=Ko,ci.isoWeeksInISOWeekYear=Xo,ci.date=ti,ci.day=ci.days=Yt,ci.weekday=Wt,ci.isoWeekday=$t,ci.dayOfYear=ni,ci.hour=ci.hours=on,ci.minute=ci.minutes=ri,ci.second=ci.seconds=ai,ci.millisecond=ci.milliseconds=ii,ci.utcOffset=vr,ci.utc=yr,ci.local=br,ci.parseZone=xr,ci.hasAlignedHourOffset=wr,ci.isDST=_r,ci.isLocal=Sr,ci.isUtcOffset=Cr,ci.isUtc=Or,ci.isUTC=Or,ci.zoneAbbr=li,ci.zoneName=di,ci.dates=O("dates accessor is deprecated. Use date instead.",ti),ci.months=O("months accessor is deprecated. Use month instead",pt),ci.years=O("years accessor is deprecated. Use year instead",Xe),ci.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mr),ci.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Er);var pi=D.prototype;function gi(e,t,n,r){var o=bn(),i=p().set(r,t);return o[n](i,e)}function vi(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return gi(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=gi(e,r,n,"month");return o}function mi(e,t,n,r){"boolean"==typeof e?(c(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,c(t)&&(n=t,t=void 0),t=t||"");var o,i=bn(),a=e?i._week.dow:0,s=[];if(null!=n)return gi(t,(n+a)%7,r,"day");for(o=0;o<7;o++)s[o]=gi(t,(o+a)%7,r,"day");return s}function yi(e,t){return vi(e,t,"months")}function bi(e,t){return vi(e,t,"monthsShort")}function xi(e,t,n){return mi(e,t,n,"weekdays")}function wi(e,t,n){return mi(e,t,n,"weekdaysShort")}function _i(e,t,n){return mi(e,t,n,"weekdaysMin")}pi.calendar=I,pi.longDateFormat=$,pi.invalidDate=X,pi.ordinal=J,pi.preparse=hi,pi.postformat=hi,pi.relativeTime=ee,pi.pastFuture=te,pi.set=T,pi.eras=Ao,pi.erasParse=To,pi.erasConvertYear=Po,pi.erasAbbrRegex=Fo,pi.erasNameRegex=Lo,pi.erasNarrowRegex=Go,pi.months=dt,pi.monthsShort=ct,pi.monthsParse=ft,pi.monthsRegex=mt,pi.monthsShortRegex=vt,pi.week=Ct,pi.firstDayOfYear=Mt,pi.firstDayOfWeek=kt,pi.weekdays=Ut,pi.weekdaysMin=Bt,pi.weekdaysShort=Ht,pi.weekdaysParse=Vt,pi.weekdaysRegex=Kt,pi.weekdaysShortRegex=Xt,pi.weekdaysMinRegex=qt,pi.isPM=nn,pi.meridiem=an,vn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Pe(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=O("moment.lang is deprecated. Use moment.locale instead.",vn),r.langData=O("moment.langData is deprecated. Use moment.localeData instead.",bn);var Ei=Math.abs;function Si(){var e=this._data;return this._milliseconds=Ei(this._milliseconds),this._days=Ei(this._days),this._months=Ei(this._months),e.milliseconds=Ei(e.milliseconds),e.seconds=Ei(e.seconds),e.minutes=Ei(e.minutes),e.hours=Ei(e.hours),e.months=Ei(e.months),e.years=Ei(e.years),this}function Ci(e,t,n,r){var o=Nr(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function Oi(e,t){return Ci(this,e,t,1)}function ki(e,t){return Ci(this,e,t,-1)}function Mi(e){return e<0?Math.floor(e):Math.ceil(e)}function Ni(){var e,t,n,r,o,i=this._milliseconds,a=this._days,s=this._months,l=this._data;return i>=0&&a>=0&&s>=0||i<=0&&a<=0&&s<=0||(i+=864e5*Mi(Ti(s)+a),a=0,s=0),l.milliseconds=i%1e3,e=Te(i/1e3),l.seconds=e%60,t=Te(e/60),l.minutes=t%60,n=Te(t/60),l.hours=n%24,a+=Te(n/24),s+=o=Te(Ai(a)),a-=Mi(Ti(o)),r=Te(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function Ai(e){return 4800*e/146097}function Ti(e){return 146097*e/4800}function Pi(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=re(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Ai(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Ti(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function Di(e){return function(){return this.as(e)}}var ji=Di("ms"),Ii=Di("s"),Ri=Di("m"),Li=Di("h"),Fi=Di("d"),Gi=Di("w"),Ui=Di("M"),Hi=Di("Q"),Bi=Di("y"),zi=ji;function Vi(){return Nr(this)}function Yi(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function Wi(e){return function(){return this.isValid()?this._data[e]:NaN}}var $i=Wi("milliseconds"),Ki=Wi("seconds"),Xi=Wi("minutes"),qi=Wi("hours"),Zi=Wi("days"),Ji=Wi("months"),Qi=Wi("years");function ea(){return Te(this.days()/7)}var ta=Math.round,na={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ra(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}function oa(e,t,n,r){var o=Nr(e).abs(),i=ta(o.as("s")),a=ta(o.as("m")),s=ta(o.as("h")),l=ta(o.as("d")),d=ta(o.as("M")),c=ta(o.as("w")),u=ta(o.as("y")),f=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||a<=1&&["m"]||a<n.m&&["mm",a]||s<=1&&["h"]||s<n.h&&["hh",s]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(f=f||c<=1&&["w"]||c<n.w&&["ww",c]),(f=f||d<=1&&["M"]||d<n.M&&["MM",d]||u<=1&&["y"]||["yy",u])[2]=t,f[3]=+e>0,f[4]=r,ra.apply(null,f)}function ia(e){return void 0===e?ta:"function"==typeof e&&(ta=e,!0)}function aa(e,t){return void 0!==na[e]&&(void 0===t?na[e]:(na[e]=t,"s"===e&&(na.ss=t-1),!0))}function sa(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,o=!1,i=na;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(o=e),"object"==typeof t&&(i=Object.assign({},na,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),r=oa(this,!o,i,n=this.localeData()),o&&(r=n.pastFuture(+this,r)),n.postformat(r)}var la=Math.abs;function da(e){return(e>0)-(e<0)||+e}function ca(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,o,i,a,s,l=la(this._milliseconds)/1e3,d=la(this._days),c=la(this._months),u=this.asSeconds();return u?(e=Te(l/60),t=Te(e/60),l%=60,e%=60,n=Te(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",o=u<0?"-":"",i=da(this._months)!==da(u)?"-":"",a=da(this._days)!==da(u)?"-":"",s=da(this._milliseconds)!==da(u)?"-":"",o+"P"+(n?i+n+"Y":"")+(c?i+c+"M":"")+(d?a+d+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+r+"S":"")):"P0D"}var ua=sr.prototype;return ua.isValid=ir,ua.abs=Si,ua.add=Oi,ua.subtract=ki,ua.as=Pi,ua.asMilliseconds=ji,ua.asSeconds=Ii,ua.asMinutes=Ri,ua.asHours=Li,ua.asDays=Fi,ua.asWeeks=Gi,ua.asMonths=Ui,ua.asQuarters=Hi,ua.asYears=Bi,ua.valueOf=zi,ua._bubble=Ni,ua.clone=Vi,ua.get=Yi,ua.milliseconds=$i,ua.seconds=Ki,ua.minutes=Xi,ua.hours=qi,ua.days=Zi,ua.weeks=ea,ua.months=Ji,ua.years=Qi,ua.humanize=sa,ua.toISOString=ca,ua.toString=ca,ua.toJSON=ca,ua.locale=so,ua.localeData=co,ua.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ca),ua.lang=lo,H("X",0,0,"unix"),H("x",0,0,"valueOf"),ke("x",xe),ke("X",Ee),je("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),je("x",function(e,t,n){n._d=new Date(Pe(e))}),
35
35
  //! moment.js
36
36
  r.version="2.30.1",o(qn),r.fn=ci,r.min=er,r.max=tr,r.now=nr,r.utc=p,r.unix=ui,r.months=yi,r.isDate=u,r.locale=vn,r.invalid=y,r.duration=Nr,r.isMoment=S,r.weekdays=xi,r.parseZone=fi,r.localeData=bn,r.isDuration=lr,r.monthsShort=bi,r.weekdaysMin=_i,r.defineLocale=mn,r.updateLocale=yn,r.locales=xn,r.weekdaysShort=wi,r.normalizeUnits=re,r.relativeTimeRounding=ia,r.relativeTimeThreshold=aa,r.calendarFormat=Br,r.prototype=ci,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()}(R_);var L_=R_.exports;const F_=e=>{const{className:n,style:r,disabled:o,value:i,onChange:a}=e,[l,d]=t.useState(i?L_(i):void 0),c=t.useRef(!1);t.useEffect(()=>{if(!c.current)return void(c.current=!0);const e=L_(i);e.isValid()&&d(e)},[i]);const f=t.useCallback((e,t)=>{const n=L_(t);d(n.isValid()?n:void 0),"function"==typeof a&&a(n.isValid()?n.format("YYYY-MM-DD HH:mm:ss"):"")},[a]);return u.default.createElement(s.DatePicker,{showTime:!0,allowClear:!0,className:n,style:r,disabled:o,value:l,onChange:f})};function G_(e){const t=Number(e);return Number.isNaN(t)?void 0:t}const U_=e=>{const{disabled:n,placeholder:r,value:o,onChange:i}=e,[a,l]=t.useState(G_(o)),d=t.useRef(!1);t.useEffect(()=>{d.current||(d.current=!0),l(G_(o))},[o]);const c=t.useCallback(e=>{l(e),"function"==typeof i&&(void 0===e?i(""):"number"==typeof G_(e)&&i(G_(e)))},[i]);return u.default.createElement(s.InputNumber,{style:{width:"100%"},size:"small",placeholder:r,value:a,onChange:c,disabled:n})};var H_;!function(e){e.INPUT="input",e.CHECKBOX="checkbox",e.TEXTAREA="textArea",e.SELECT="select",e.DATETIME="datetime",e.FLOAT="float"}(H_||(H_={}));var B_=Object.freeze({__proto__:null,get ControlShape(){return H_}});const z_=[[H_.INPUT,I_],[H_.CHECKBOX,e=>{const{controlSchema:t}=e,{required:n,tooltip:r,extra:o,name:i,label:a,rules:l}=t;return u.default.createElement(j_,{schema:t},({hidden:e,disabled:t,initialValue:d})=>u.default.createElement(s.Form.Item,{className:"xflow-form-checkbox",name:i,rules:l,initialValue:d,tooltip:r,extra:D_(o),required:n,hidden:e,valuePropName:"checked",getValueProps:e=>({checked:!!{true:!0,false:!1}[e]})},u.default.createElement(s.Checkbox,{disabled:t},a)))}],[H_.TEXTAREA,e=>{const{controlSchema:t}=e,{required:n,tooltip:r,extra:o,name:i,label:a,placeholder:l,rules:d}=t;return u.default.createElement(j_,{schema:t},({hidden:e,disabled:t,initialValue:c})=>u.default.createElement(s.Form.Item,{name:i,label:a,initialValue:c,tooltip:r,extra:D_(o),required:n,hidden:e,rules:d},u.default.createElement(s.Input.TextArea,{allowClear:!0,placeholder:l,rows:3,disabled:t})))}],[H_.DATETIME,e=>{const{controlSchema:t}=e,{required:n,tooltip:r,extra:o,name:i,label:a,rules:l}=t;return u.default.createElement(j_,{schema:t},({disabled:e,hidden:t,initialValue:d})=>u.default.createElement(s.Form.Item,{name:i,label:a,initialValue:d,tooltip:r,extra:D_(o),required:n,hidden:t,rules:l},u.default.createElement(F_,{style:{width:"100%"},disabled:e})))}],[H_.SELECT,e=>{const{controlSchema:t}=e,{required:n,tooltip:r,extra:o,name:i,label:a,placeholder:l,options:d=[],rules:c}=t;return u.default.createElement(j_,{schema:t},({hidden:e,disabled:t,initialValue:f})=>u.default.createElement(s.Form.Item,{name:i,label:a,initialValue:f,tooltip:r,extra:D_(o),required:n,hidden:e,rules:c},u.default.createElement(s.Select,{disabled:t,placeholder:l,options:d.map(e=>({label:e.title,value:e.value}))})))}],[H_.FLOAT,e=>{const{controlSchema:t}=e,{required:n,tooltip:r,extra:o,name:i,label:a,placeholder:l,rules:d}=t;return u.default.createElement(j_,{schema:t},({disabled:e,hidden:t,initialValue:c})=>u.default.createElement(s.Form.Item,{name:i,label:a,initialValue:c,tooltip:r,extra:D_(o),required:n,hidden:t,rules:d},u.default.createElement(U_,{placeholder:l,disabled:e})))}]],V_=e=>{const t=new Map;return e.forEach(e=>{const[n,r]=e,o=n.toLowerCase();t.has(o)&&console.error(`${n} is duplicated in controlMap:`,t),t.set(o,r)}),t},{TabPane:Y_}=s.Tabs,W_=e=>{var n;const{schema:r,form:o,className:i,triggerUpdate:a,defaultControlRender:l,afterUpdatingCb:d,controlMap:c}=e,f=m(e,["schema","form","className","triggerUpdate","defaultControlRender","afterUpdatingCb","controlMap"]),{tabs:h}=r,[p]=s.Form.useForm(o),g=u.default.useMemo(()=>e.controlMap?e.controlMap:V_(z_),[e.controlMap]),v=t.useCallback(e=>{"function"==typeof a&&a(p,e)},[p,a]);t.useEffect(()=>{p.setFieldsValue({})},[p]);const y=t.useCallback(()=>{requestAnimationFrame(()=>{p.setFieldsValue({})})},[p]);return u.default.createElement(s.Form,Object.assign({size:"small",form:p,layout:"vertical",className:xr("xflow-json-form",i)},f),u.default.createElement(s.Tabs,{type:"card",defaultActiveKey:null===(n=h[0])||void 0===n?void 0:n.name,className:xr({tabs:!0,xTab:!0,singleTab:1===(null==h?void 0:h.length),coupleTab:2===(null==h?void 0:h.length),ternateTab:3===(null==h?void 0:h.length)}),onTabClick:y},h.map(e=>{const{name:t,groups:n}=e;return u.default.createElement(Y_,{key:t,tab:t},0===n.length&&u.default.createElement(s.Empty,{style:{padding:"24px 0"}}),n.length>0&&n.map(e=>{const{controls:t=[]}=e;return 0===t.length?u.default.createElement(s.Empty,{style:{padding:"24px 0"}}):t.map(e=>{const{shape:t,name:n}=e,r=((e,t,n=I_)=>{if(t.has(e))return t.get(e);const r=e.toLowerCase();return t.has(r)?t.get(r):(console.warn(`${e} is not exist in controlmap, fallback to defaultControl`),n)})(t,g,l);return r?u.default.createElement(r,{key:n,form:p,controlSchema:e,triggerUpdate:v,afterUpdatingCb:d}):(console.error("未找到对应的控件:",t),null)})}))})))},$_=e=>{const{schema:t={tabs:[]},triggerUpdate:n,onFieldsChange:r,afterUpdatingCb:o,defaultControlRender:i,loading:a,controlMapService:l,defaultControls:d=[]}=e,c=u.default.useMemo(()=>{const e=V_([...z_,...d]);return l&&l(e),e},[l,d]);return a?u.default.createElement("div",{className:`${e.prefixClz}-body`,style:Object.assign(Object.assign({},e.style),{display:"flex",justifyContent:"center",alignItems:"center"})},u.default.createElement(s.Spin,{spinning:!0})):u.default.createElement("div",{className:`${e.prefixClz}-body`,style:e.style},t.tabs.length>0&&u.default.createElement(W_,{schema:t,onFieldsChange:r,controlMap:c,defaultControlRender:i,afterUpdatingCb:o,triggerUpdate:n}),0===t.tabs.length&&u.default.createElement(s.Empty,{style:{paddingTop:"64px"}}))};e.NsJsonSchemaFormModel=void 0,function(e){e.id="XFLOW_JSON_SCHEMA_FORM",e.useModel=t=>x(this,void 0,void 0,function*(){return t.awaitModel(e.id)})}(e.NsJsonSchemaFormModel||(e.NsJsonSchemaFormModel={}));const K_=t=>{const n=qs(),{commandService:r,modelService:o,getGraphInstance:i}=n,{formSchemaService:a}=t,[s,l,d,c]=qy({schema:{tabs:[]},targetType:null,targetData:null,targetCell:null,loading:!1});return u.default.useEffect(()=>{if(!n||!n.modelService)return;const s=new Or;if(!n.modelService.findDeferredModel(e.NsJsonSchemaFormModel.id)){const l=n.modelService.registerModel({id:e.NsJsonSchemaFormModel.id,modelFactory:()=>d,watchChange:(e,n)=>x(void 0,void 0,void 0,function*(){const l=(yield Wc.getModel(n)).watch(n=>x(void 0,void 0,void 0,function*(){const s=(l=n)?l.isNode&&l.isNode()&&l.getProp("isGroup")?"group":l.isNode&&l.isNode()?"node":l.isEdge&&l.isEdge()?"edge":"canvas":"canvas";var l;(t.targetType||["node","canvas"]).includes(s)&&(yield((t,n)=>x(void 0,void 0,void 0,function*(){e.setValue(e=>{e.loading=!0,e.schema={tabs:[]},e.targetType=null,e.targetData=null,e.targetCell=null});const s=t?t.getData():null;if(!a)return;const l=yield i(),d=yield a({commandService:r,modelService:o,targetData:s,cell:t,targetType:n,graph:l});e.setValue({loading:!1,schema:d,targetType:n,targetCell:t,targetData:s})}))(n,s))}));return Er.create(()=>{l.dispose(),s.push(l)})})});s.push(l)}return()=>{s.dispose()}},[]),{commandService:r,modelService:o,state:s,setState:l,model:d,isModelReady:c}},X_=e=>{const{prefixClz:t}=e,{getCustomRenderComponent:n,afterUpdatingCb:r,formValueUpdateService:o=()=>{}}=e,{state:i,commandService:a,modelService:s}=K_(e),l=u.default.useCallback((e,t={})=>x(void 0,void 0,void 0,function*(){e.setFieldsValue(t);const n=Object.entries(t).map(([e,t])=>({name:e,value:t})),l=Object.entries(i.targetData).map(([e,t])=>({name:e,value:t})),d=yield o({allFields:l,values:n,modelService:s,commandService:a,targetData:i.targetData,targetType:i.targetType});r&&r(d)}),[r,a,o,s,i.targetData,i.targetType]),d=u.default.useCallback((e,t)=>x(void 0,void 0,void 0,function*(){const n=yield o({values:e,allFields:t,modelService:s,commandService:a,targetData:i.targetData,targetType:i.targetType});r&&r(n)}),[r,a,o,s,i.targetData,i.targetType]),c=u.default.useMemo(()=>{try{return 0===i.schema.tabs.length||!i.schema}catch(e){return!0}},[i.schema]),{headerStyle:f,bodyStyle:h,footerStyle:p}=((e,t)=>{const n=e&&e.headerPosition&&e.headerPosition.height||40,r=e.footerPosition&&e.footerPosition.height||40;return{headerStyle:vu(Object.assign(Object.assign({height:0,top:0,left:0,right:0},t?{height:n,lineHeight:n}:{}),e.headerPosition)),bodyStyle:vu(Object.assign(Object.assign({left:0,right:0,top:0},t?{top:n,bottom:r}:{bottom:r}),e.bodyPosition)),footerStyle:vu(Object.assign(Object.assign({left:0,right:0,lineHeight:r,height:r,bottom:0},t?{lineHeight:r,height:r}:{bottom:0}),e.footerPosition))}})(e,c);if(n){const t=n(i.targetType,i.targetData,s,a);if(t)return u.default.createElement(t,Object.assign(Object.assign({},e),{headerStyle:f,bodyStyle:h,footerStyle:p,targetData:i.targetData,targetType:i.targetType,modelService:s,commandService:a}))}return u.default.createElement("div",{className:t},u.default.createElement(T_,Object.assign({hasSchema:!c},e,{state:i,style:f,prefixClz:e.prefixClz})),u.default.createElement($_,Object.assign({},e,{key:i.targetData&&i.targetData.id,style:h,prefixClz:e.prefixClz,loading:i.loading,schema:i.schema,triggerUpdate:l,onFieldsChange:d})),u.default.createElement(A_,Object.assign({},e,{state:i,style:p})))},q_=e=>{const t=pu("json-schema-form");return u.default.createElement(Gb,Object.assign({},e,{className:t}),u.default.createElement(X_,Object.assign({},e,{prefixClz:t})))};n.Registry.Connector.registry.exist(Hb)||n.Graph.registerConnector(Hb,(e,t)=>{const r=Math.abs(t.y-e.y),o=Math.floor(r/3*2),i=e.x,a=e.y+16+o,s=t.x,l=t.y-16-o;return n.Path.normalize(`M ${e.x} ${e.y}\n L ${e.x} ${e.y+16}\n C ${i} ${a} ${s} ${l} ${t.x} ${t.y-16}\n L ${t.x} ${t.y}\n `)},!0),n.Registry.Connector.registry.exist(Bb)||n.Graph.registerConnector(Bb,(e,t)=>{const r=Math.abs(t.y-e.y),o=e.x,i=e.y+4+r,a=t.x,s=t.y-4-r;return n.Path.normalize(`M ${e.x} ${e.y}\n L ${e.x} ${e.y+4}\n C ${o} ${i} ${a} ${s} ${t.x} ${t.y-4}\n L ${t.x} ${t.y}\n `)},!0),n.Registry.Connector.registry.exist(Ub)||n.Graph.registerConnector(Ub,(e,t)=>{const r=Math.abs(t.y-e.y),o=Math.floor(r/3*2),i=e.x,a=e.y+4+o,s=t.x,l=t.y-4-o;return n.Path.normalize(`M ${e.x} ${e.y}\n L ${e.x} ${e.y+4}\n C ${i} ${a} ${s} ${l} ${t.x} ${t.y-4}\n L ${t.x} ${t.y}\n `)},!0);let Z_=n.Shape.Edge.registry.get(zb);n.Shape.Edge.registry.exist(zb)||(Z_=n.Shape.Edge.registry.register(zb,n.Shape.Edge.define({zIndex:1,highlight:!1,shape:zb}),!0)),e.NsGraphStatusCommand=void 0,function(t){let n;t.MODEL=e.GRAPH_STATUS_INFO,t.command=e.XFlowDagCommands.QUERY_GRAPH_STATUS,t.hookKey="queryGraphStatus",function(e){e.SUCCEEDED="SUCCEEDED",e.RUNNING="RUNNING",e.FAILED="FAILED",e.PENDING="PENDING",e.CREATING="CREATING",e.MANUAL_TERMINATE="MANUAL_TERMINATE",e.CACHED="CACHED",e.QUEUEING="QUEUEING",e.PULLING_IMAGE="PULLING_IMAGE",e.UNKNOWN="UNKNOWN"}(n=t.StatusEnum||(t.StatusEnum={})),t.initStatusMap=()=>({[t.StatusEnum.SUCCEEDED]:[],[t.StatusEnum.RUNNING]:[],[t.StatusEnum.FAILED]:[],[t.StatusEnum.PENDING]:[],[t.StatusEnum.CREATING]:[],[t.StatusEnum.MANUAL_TERMINATE]:[],[t.StatusEnum.CACHED]:[],[t.StatusEnum.QUEUEING]:[],[t.StatusEnum.PULLING_IMAGE]:[],[t.StatusEnum.UNKNOWN]:[]}),t.groupByStatus=e=>{const n=t.initStatusMap();return Object.entries(e).reduce((e,[t,n])=>(e[n.status].push(t),e),n)},t.statusDiff=(e,t)=>{const n=new Set([...e,...t]),r={current:[],add:[],remove:[]};return n.forEach(n=>{t.includes(n)&&!e.includes(n)&&r.add.push(n),!t.includes(n)&&e.includes(n)&&r.remove.push(n)}),r},t.shouldStop=e=>x(this,void 0,void 0,function*(){return[n.FAILED,n.SUCCEEDED,n.MANUAL_TERMINATE].includes(e.graphStatus)})}(e.NsGraphStatusCommand||(e.NsGraphStatusCommand={}));let J_=class{constructor(){this.statusInfo=e.NsGraphStatusCommand.initStatusMap(),this.getStatusModel=()=>x(this,void 0,void 0,function*(){const t=this.contextProvider().getModelService();return yield e.GRAPH_STATUS_INFO.getModel(t)}),this.updateModelValue=e=>x(this,void 0,void 0,function*(){(yield this.getStatusModel()).setValue(e)}),this.stopCurrentStatusLooping=()=>x(this,void 0,void 0,function*(){const e=yield this.getStatusModel(),{subscription:t}=yield e.getValidValue();t.dispose()}),this.addStopDispose=()=>x(this,void 0,void 0,function*(){const t=yield this.getStatusModel(),{subscription:n}=yield t.getValidValue();n.push({dispose:()=>{this.updateEdges(this.statusInfo,e.NsGraphStatusCommand.initStatusMap()),this.isLooping=!1}})}),this.updateGraph=(e,t,n)=>{this.updateNodes(e,t,n),this.updateEdges(e,t)},this.updateNodeData=(e,t)=>{const n=this.x6Graph.getCellById(e);n&&n.setData(Object.assign(Object.assign(Object.assign(Object.assign({},n.getData()),n.getSize()),n.getPosition()),t))},this.updateNodes=(t,n,r)=>{Object.keys(t).forEach(o=>{const i=e.NsGraphStatusCommand.statusDiff(t[o],n[o]);i.add.forEach(e=>{this.updateNodeData(e,r[e])}),i.remove.forEach(e=>{this.updateNodeData(e,r[e])})})},this.updateEdges=(t,n)=>{const r=e.NsGraphStatusCommand.statusDiff(t.RUNNING,n.RUNNING);this.x6Graph.getEdges().forEach(e=>{var t;const n=null===(t=this.x6Graph)||void 0===t?void 0:t.findViewByCell(e.id),o=e.getTargetCellId();if(!o)return;const i=o.toString();return n?r.add.includes(i)?n.addClass(Yb):r.remove.includes(i)?n.removeClass(Yb):void 0:void 0})},this.execute=()=>x(this,void 0,void 0,function*(){const t=this.contextProvider(),{args:n,hooks:r}=t.getArgs(),o=t.getHooks();this.x6Graph=yield t.getX6Graph();const i=yield o.queryGraphStatus.call(n,t=>x(this,void 0,void 0,function*(){const{graphStatusService:n,shouldStop:r=e.NsGraphStatusCommand.shouldStop,doOnce:o}=t;yield this.stopCurrentStatusLooping();const i=(n,o=1e4)=>x(this,void 0,void 0,function*(){const a=yield n(t);this.updateModelValue(e=>{Object.entries(a.statusMap).forEach(([t,n])=>{e.statusMap.set(t,n)}),e.graphStatus=a.graphStatus});const s=e.NsGraphStatusCommand.groupByStatus(a.statusMap);var l;if(this.updateGraph(this.statusInfo,s,a.statusMap),this.statusInfo=s,yield(l=o,new Promise(e=>setTimeout(()=>e(!0),l))),this.isLooping){if(r){if(yield r(a,t))return}yield i(n,o)}});return this.isLooping=void 0===t.loop||t.loop,yield this.addStopDispose(),o&&(yield o(t)),i(n,t.loopInterval),{}}),r);return t.setResult(i),this}),this.undo=()=>x(this,void 0,void 0,function*(){const e=this.contextProvider();return this.isUndoable()&&e.undo(),this}),this.redo=()=>x(this,void 0,void 0,function*(){return this.isUndoable()||(yield this.execute()),this})}isUndoable(){return this.contextProvider().isUndoable()}};var Q_;y([nr(Jd),b("design:type",Object)],J_.prototype,"contextProvider",void 0),J_=y([er({token:{token:Zd,named:e.NsGraphStatusCommand.command.id}})],J_),function(e){e.TOP_BOTTOM="TB",e.LEFT_RIGHT="LR"}(Q_||(Q_={}));const eE=Rn.defineToken("DAG_EXTENSION_CONFIG");var tE,nE;!function(e){e.EVENT_NAME="ADD_EDGE_CMD_EVENT"}(tE||(tE={})),function(e){e.router={name:"manhattan"},e.connector={name:"rounded",args:{radius:15}}}(nE||(nE={}));const rE=e=>{const{layout:t,router:n=nE.router,connector:r=nE.connector}=e;return{grid:!1,keyboard:{enabled:!0},selecting:{enabled:!0,multiple:!0,selectCellOnMoved:!0,showNodeSelectionBox:!1,rubberEdge:!0,rubberNode:!0,movable:!0},connecting:{sourceAnchor:t?t===Q_.TOP_BOTTOM?"bottom":"right":"center",targetAnchor:t?t===Q_.TOP_BOTTOM?"center":"left":"center",connectionPoint:"anchor",snap:{radius:20},router:n,connector:r,highlight:!0,dangling:!1,createEdge(){const e=this,t=new Z_({attrs:{line:{strokeDasharray:"5 5",stroke:"#888",strokeWidth:1,targetMarker:{name:"block",args:{size:"6"}}}}});return e.once("edge:connected",n=>{const{isNew:r}=n,o=n.edge;if(r&&o.isEdge()&&o===t){const n=o.getTargetPortId(),r=o.getTargetCell();if(r&&r.isNode()){r.setPortProp(n,"connected",!1),o.attr({line:{strokeDasharray:"",targetMarker:"",stroke:"#d5d5d5"}});const i=o.getTargetPortId(),a=o.getSourcePortId(),s=o.getSourceCellId(),l=o.getTargetCellId();e.trigger(tE.EVENT_NAME,{targetPortId:i,sourcePortId:a,source:s,target:l,edge:t})}}}),t},validateEdge:e=>{var t;const{edge:n}=e;return!!(null===(t=null==n?void 0:n.target)||void 0===t?void 0:t.port)},validateMagnet({magnet:e,cell:t}){const n=t.getData().ports.filter(e=>e.type===vr.AnchorType.INPUT);return n.length>0&&e.getAttribute("port-group")!==n[0].group},validateConnection({sourceView:e,targetView:n,sourceMagnet:r,targetMagnet:o}){if(e===n)return!1;if(!r||!o)return!1;if(t){const e=t===Q_.TOP_BOTTOM?vr.AnchorGroup.TOP:vr.AnchorGroup.LEFT;if(r.getAttribute("port-group")===e)return!1;if(o.getAttribute("port-group")!==e)return!1}const i=e.cell,a=r.getAttribute("port");if(!a)return!1;if(i.getPort(a).type!==vr.AnchorType.OUTPUT)return!1;const s=n.cell,l=o.getAttribute("port");if(!l)return!1;const d=s.getPort(l);return d.type===vr.AnchorType.INPUT&&!(d&&d.connected)}},highlighting:{nodeAvailable:{name:"className",args:{className:"available"}},magnetAvailable:{name:"className",args:{className:"available"}},magnetAdsorbed:{name:"className",args:{className:"adsorbed"}}},scaling:{max:1.05,min:.01}}};let oE=class{constructor(){this.registerGraphCommands=t=>{t.registerCommand(e.NsGraphStatusCommand.command,{createCommand:this.commandFactory})},this.toDispose=new Or,this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,n=[e.addNode.registerHook({name:"dag-add-node",handler:e=>x(this,void 0,void 0,function*(){e.cellFactory=e=>x(this,void 0,void 0,function*(){return new $b(Object.assign({},e))})})}),e.addEdge.registerHook({name:"dag-add-edge",handler:e=>x(this,void 0,void 0,function*(){const{layout:t=Q_.TOP_BOTTOM}=yield this.propConfig.getConfig();e.cellFactory=e=>x(this,void 0,void 0,function*(){return new Z_(Object.assign(Object.assign({},e),{id:e.id,source:{cell:e.source,port:e.sourcePortId,anchor:{name:t===Q_.TOP_BOTTOM?"bottom":"right"}},target:{cell:e.target,port:e.targetPortId,anchor:{name:t===Q_.TOP_BOTTOM?"center":"right"}},attrs:{line:{strokeDasharray:"",targetMarker:"",stroke:"#d5d5d5",strokeWidth:1}},data:Object.assign({},e)}))})})}),e.addEdge.registerHook({name:"after add edge, set target port props",handler:(e,t)=>x(this,void 0,void 0,function*(){return e=>x(this,void 0,void 0,function*(){const n=yield t(e);if(n&&n.edgeCell){const e=n.edgeCell.getTargetCell(),t=n.edgeCell.getTargetPortId();e.setPortProp(t,"connected",!0)}return n})})}),e.delEdge.registerHook({name:"afetr del edge, reset target node port props",handler:(e,t)=>x(this,void 0,void 0,function*(){return e=>x(this,void 0,void 0,function*(){const n=yield t(e),{targetCell:r,targetPortId:o}=n;return r&&r.isNode()&&o&&r.setPortProp(o,"connected",!1),n})})}),e.afterGraphInit.registerHook({name:"call add edge to replace temp edge",handler:e=>x(this,void 0,void 0,function*(){const{commandService:t,graph:n}=e;n.on(tE.EVENT_NAME,e=>{t.executeCommand(Js.ADD_EDGE.id,{edgeConfig:e}),e.edge.remove()})})}),e.graphOptions.registerHook({name:"dag-extension-x6-options",handler:e=>x(this,void 0,void 0,function*(){const t=yield this.propConfig.getConfig(),n=rE(t);Object.assign(e,n)})})];return t.pushAll(n),Er.create(()=>{})}),this.registerHookHub=t=>x(this,void 0,void 0,function*(){return t.registerHookHub(e.NsGraphStatusCommand.hookKey,new gc)})}registerModel(t){t.registerModel({id:e.GRAPH_STATUS_INFO.id,getInitialValue:()=>({statusMap:new Map,subscription:new Or,graphStatus:e.GRAPH_STATUS_INFO.StatusEnum.UNKNOWN}),watchChange:e=>x(this,void 0,void 0,function*(){const{subscription:t}=yield e.getValidValue();return t})})}};y([nr(Qd),b("design:type",Function)],oE.prototype,"commandFactory",void 0),y([nr(eE),b("design:type",Object)],oE.prototype,"propConfig",void 0),oE=y([tr({contrib:[mc,ac,ec]})],oE);const iE=e=>hr(t=>{t(oE),t(J_),t(eE,{useValue:e})}),aE="XFLOW_FLOW_NODE_SHAPE";let sE;const{AnchorGroup:lE}=vr,dE={circle:{r:4,magnet:!0,stroke:"#5F95FF",strokeWidth:1,fill:"#fff",style:{visibility:"hidden"}}};sE=n.Node.registry.exist(aE)?n.Node.registry.get(aE):i.ReactShape.define({width:150,height:60,shape:aE,view:Mr,ports:{groups:{top:{position:lE.TOP,attrs:dE},bottom:{position:lE.BOTTOM,attrs:dE},right:{position:lE.RIGHT,attrs:dE},left:{position:lE.LEFT,attrs:dE}}},attrs:{body:{magnet:!1,fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"}}});const cE={grid:!0,mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:"ctrl",minScale:.5,maxScale:3},connecting:{router:"manhattan",connector:{name:"rounded",args:{radius:8}},anchor:"center",connectionPoint:"anchor",allowBlank:!1,snap:{radius:20},createEdge:()=>new n.Shape.Edge({attrs:{line:{stroke:"#A2B1C3",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},zIndex:0}),validateConnection:({targetMagnet:e})=>!!e},highlighting:{magnetAdsorbed:{name:"stroke",args:{attrs:{fill:"#5F95FF",stroke:"#5F95FF"}}}},resizing:!0,rotating:!0,selecting:{enabled:!0,rubberband:!0,showNodeSelectionBox:!0,modifiers:"shift"},snapline:!0,keyboard:!0,clipboard:!0};let uE=class{constructor(){this.toDispose=new Or,this.registerHookHub=()=>x(this,void 0,void 0,function*(){return Er.create(()=>{})}),this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,r=[e.addNode.registerHook({name:"flow-add-node",handler:e=>x(this,void 0,void 0,function*(){e.cellFactory=e=>x(this,void 0,void 0,function*(){return new sE(Object.assign({},e))})})}),e.addEdge.registerHook({name:"flow-add-edge",handler:e=>x(this,void 0,void 0,function*(){e.cellFactory=e=>x(this,void 0,void 0,function*(){delete e.id;return new n.Shape.Edge({source:{cell:e.source,port:e.sourcePortId},target:{cell:e.target,port:e.targetPortId},attrs:{line:{stroke:"#A2B1C3",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},zIndex:-1,data:Object.assign({},e)})})})}),e.graphOptions.registerHook({name:"assign options ",handler:e=>x(this,void 0,void 0,function*(){Object.assign(e,cE)})})];return t.pushAll(r),Er.create(()=>{})})}};uE=y([tr({contrib:mc})],uE);const fE=()=>hr(e=>{e(uE)});var hE=fg,pE=Ah;var gE=function(e,t,n){(void 0!==n&&!pE(e[t],n)||void 0===n&&!(t in e))&&hE(e,t,n)};var vE=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++o];if(!1===n(i[l],l,i))break}return t}}(),mE=cv,yE=Vo;var bE=function(e){return yE(e)&&mE(e)},xE=zo,wE=Hv,_E=Vo,EE=Function.prototype,SE=Object.prototype,CE=EE.toString,OE=SE.hasOwnProperty,kE=CE.call(Object);var ME=function(e){if(!_E(e)||"[object Object]"!=xE(e))return!1;var t=wE(e);if(null===t)return!0;var n=OE.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&CE.call(n)==kE};var NE=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},AE=bg,TE=Cv;var PE=gE,DE=Nv.exports,jE=Hm,IE=Av,RE=Qm,LE=Ng,FE=Po,GE=bE,UE=Ag.exports,HE=Qh,BE=Hf,zE=ME,VE=Wg,YE=NE,WE=function(e){return AE(e,TE(e))};var $E=sg,KE=gE,XE=vE,qE=function(e,t,n,r,o,i,a){var s=YE(e,n),l=YE(t,n),d=a.get(l);if(d)PE(e,n,d);else{var c=i?i(s,l,n+"",e,t,a):void 0,u=void 0===c;if(u){var f=FE(l),h=!f&&UE(l),p=!f&&!h&&VE(l);c=l,f||h||p?FE(s)?c=s:GE(s)?c=IE(s):h?(u=!1,c=DE(l,!0)):p?(u=!1,c=jE(l,!0)):c=[]:zE(l)||LE(l)?(c=s,LE(s)?c=WE(s):BE(s)&&!HE(s)||(c=RE(l))):u=!1}u&&(a.set(l,c),o(c,l,r,i,a),a.delete(l)),PE(e,n,c)}},ZE=Hf,JE=Cv,QE=NE;var eS=function e(t,n,r,o,i){t!==n&&XE(n,function(a,s){if(i||(i=new $E),ZE(a))qE(t,n,s,r,e,o,i);else{var l=o?o(QE(t,s),a,s+"",t,n,i):void 0;void 0===l&&(l=a),KE(t,s,l)}},JE)};var tS=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},nS=Math.max;var rS=function(e,t,n){return t=nS(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=nS(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),tS(e,this,s)}};var oS=function(e){return function(){return e}},iS=cg,aS=iS?function(e,t){return iS(e,"toString",{configurable:!0,enumerable:!1,value:oS(t),writable:!0})}:Fw,sS=Date.now;var lS=function(e){var t=0,n=0;return function(){var r=sS(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},dS=lS(aS),cS=Fw,uS=rS,fS=dS;var hS=Ah,pS=cv,gS=Dg,vS=Hf;var mS=function(e,t){return fS(uS(e,t,cS),e+"")},yS=function(e,t,n){if(!vS(n))return!1;var r=typeof t;return!!("number"==r?pS(n)&&gS(t,n.length):"string"==r&&t in n)&&hS(n[t],e)};var bS=eS,xS=function(e){return mS(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&yS(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var s=n[r];s&&e(t,s,r,i)}return t})}(function(e,t,n){bS(e,t,n)});const wS={config:{}},_S=e=>{wS.config=Object.assign({},wS.config,e)},ES=e=>{var t;return null===(t=wS.config)||void 0===t?void 0:t[e]},SS=new Map,CS=new Map,OS=()=>SS.get("x6graph"),kS=()=>x(void 0,void 0,void 0,function*(){return CS.get("app").getGraphData()}),MS=o.debounce(e=>{const t=ES("onConfigChange");if(t&&"function"==typeof t)return t(Object.assign({data:kS()},e))},300,{trailing:!0}),NS=(e,t)=>{const n=e.getAttribute("transform").split(",");n[0]="matrix("+Number(n[0].split("(")[1])*t,n[3]=Number(n[3])*t,e.setAttribute("transform",n.join(","))},AS=(e,t,n)=>{var r;e||(()=>{const e=document.getElementsByClassName("x6-port");e&&Array.from(e).forEach(e=>{const t=e.getAttribute("data-scale");t&&(NS(e,1/Number(t)),e.removeAttribute("data-scale"))})})();const o=(e=>{var t;let n=null===(t=null==e?void 0:e.e)||void 0===t?void 0:t.currentTarget;if(!n)return document.getElementsByClassName("xflow-canvas-root");let r=null;for(;!r;){const e=n.getElementsByClassName("xflow-canvas-root");(null==e?void 0:e.length)>0&&(r=e),n=n.parentNode}return r})(t),i=null===(r=OS().getSelectedCells())||void 0===r?void 0:r[0];(null==i?void 0:i.isNode())&&n&&(e=>{if(!(null==e?void 0:e.length))return;e.forEach(e=>{e.getAttribute("data-scale")||(NS(e,2),e.setAttribute("data-scale","2"))})})((e=>{const t=document.getElementsByClassName("x6-node-selected");if(!t)return;let n=t[0];return Array.from(t).forEach(t=>{t.getAttribute("data-cell-id")===e&&(n=t)}),n.getElementsByClassName("x6-port")})(i.id)),Array.from(o).forEach(t=>{const r=t.querySelectorAll(".x6-port-body"),o=null==i?void 0:i.isNode();for(let t=0,i=r.length;t<i;t+=1)r[t].style.visibility=o&&!n||!e?"hidden":"visible"})},TS="xflow-node-panel-collpase",PS=60,DS=40,jS={stroke:"#A2B1C3",fill:"#FFFFFF",fontFill:"#000",fontSize:12,label:""},IS=[{name:"Terminal"},{name:"Process"},{name:"Decision"},{name:"Multi Document"},{name:"Connector",width:DS,height:DS},{name:"DataIO",ports:["top","bottom"]},{name:"Database"},{name:"Hard Disk"},{name:"Stroed Data"},{name:"Document"},{name:"Predefined Process"},{name:"Extract"},{name:"Merge"},{name:"Or",width:DS,height:DS},{name:"Manual Input"},{name:"Preparation"},{name:"Delay"},{name:"Manual Operation"},{name:"Display"},{name:"Off Page Link"},{name:"Note Left",label:"≣"},{name:"Note Right",label:"≣"},{name:"Internal Storage"},{name:"Text",label:"text"}],RS=["Connector","Or"];var LS=Object.freeze({__proto__:null,ProcessNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=[["M",1,1],["L",l-2,1],["L",l-2,d-2],["L",1,d-2],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(c),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},DecisionNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=[["M",l/2,1],["L",l-2,d/2],["L",l/2,d-2],["L",1,d/2],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(c),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},ConnectorNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=d-2;return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:`M 1,${d/2} a ${c/2} ${c/2} 0 1 1 0 1 z`,fill:i,stroke:r}),u.default.createElement("text",{x:d/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},DataIONode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=d/2,f=[["M",c-1,1],["L",l-2,1],["L",l-c,d-2],["L",1,d-2],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(f),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},TerminalNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=Math.min(d,l)/2,f=[["M",c,1],["L",l-c,1],["C",l-2,1,l-2,d/2],["",l-2,d/2],["C",l-2,d/2,l-2,d-2],["",l-c,d-2],["L",c,d-2],["C",1,d-2,1,d/2],["",1,d/2],["C",1,d/2,1,1],["",c,1]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(f),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},DatabaseNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=l/4,f=Math.min(d/10,12),h=[["M",1,1+f],["C",1+c,1,1+l-c,1],["",l-2,1+f],["L",l-2,d-2-f],["C",l-2-c,d-2,1+c,d-2],["",1,d-2-f],["Z"]],p=[["M",1,1+f],["C",1+c,1+2*f,1+l-c,1+2*f],["",l-2,1+f]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(h),fill:i,stroke:r}),u.default.createElement("path",{d:BS(p),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},HardDiskNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=Math.min(l/10,d/4),f=Math.min(d/4,l/4),h=[["M",1+c,1],["L",l-2-c,1],["C",l-2,1+f,l-2,d-2-f],["",l-2-c,d-2],["L",1+c,d-2],["C",1,d-2-f,1,1+f],["",1+c,1]],p=[["M",l-2-c,1],["C",l-2-2*c,1+f,l-2-2*c,d-2-f],["",l-2-c,d-2]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(h),fill:i,stroke:r}),u.default.createElement("path",{d:BS(p),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},StroedDataNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=Math.min(l/10,d/4),f=Math.min(d/4,l/4),h=[["M",1+c,1],["L",l-2-c,1],["C",l-2-2*c,1+f,l-2-2*c,d-2-f],["",l-2-c,d-2],["L",1+c,d-2],["C",1,d-2-f,1,1+f],["",1+c,1]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(h),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},DocumentNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=l/8,f=d/8,h=[["M",1,1],["L",l-2,1],["L",l-2,d-2-f],["C",l-2-c,d-2-2*f,l/2+c,d-2-2*f],["",l/2,d-2-f],["S",l/4,d-2,1,d-2-2*f],["L",1,1]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(h),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},MultiDocumentNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n;let{width:l,height:d}=t;l+=6,d+=6;const c=l/8,f=d/8,h=[["M",4,1],["L",l-2,1],["L",l-2,d-2-f],["C",l-2-c,d-2-2*f,l/2+c,d-2-2*f],["",l/2,d-2-f],["S",l/4,d-2,4,d-2-2*f],["L",4,1]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(h),fill:i,stroke:r}),u.default.createElement("path",{d:BS(h,-3,3),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},PredefinedProcessNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=l/8,f=[["M",1,1],["L",l-2,1],["L",l-2,d-2],["L",1,d-2],["Z"]],h=[["M",c,1],["L",c,d-2]],p=[["M",l-c,1],["L",l-c,d-2]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(f),fill:i,stroke:r}),u.default.createElement("path",{d:BS(h),stroke:r}),u.default.createElement("path",{d:BS(p),stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},ExtractNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=[["M",l/2,1],["L",l-2,d-2],["L",1,d-2],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(c),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},MergeNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=[["M",1,1],["L",l-2,1],["L",l/2,d-2],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(c),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},OrNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=[["M",d/2,1],["L",d/2,d-2]],f=[["M",1,d/2],["L",d-2,d/2]],h=d-2;return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:`M 1,${d/2} a ${h/2} ${h/2} 0 1 1 0 1 z`,fill:i,stroke:r}),u.default.createElement("path",{d:BS(c),stroke:r}),u.default.createElement("path",{d:BS(f),stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},ManualInputNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=[["M",1,d/5],["L",l-2,1],["L",l-2,d-2],["L",1,d-2],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(c),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},PreparationNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=Math.tan(Math.PI/6)*(d/2),f=[["M",c,1],["L",l-c,1],["L",l-2,d/2],["L",l-c,d-2],["L",c,d-2],["L",1,d/2],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(f),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},DelayNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=Math.min(d,l)/2,f=[["M",1,1],["L",l-c,1],["C",l-2,1,l-2,d/2],["",l-2,d/2],["C",l-2,d/2,l-2,d-2],["",l-c,d-2],["L",1,d-2],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(f),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},ManualOperationNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=Math.min(Math.tan(Math.PI/6)*d,l/2),f=[["M",1,1],["L",l-2,1],["L",l-c,d-2],["L",c,d-2],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(f),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},DisplayNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=Math.min(d,l)/3,f=Math.min(Math.tan(Math.PI/6)*(d/2),l/3),h=[["M",f,1],["L",l-c,1],["C",l-2,1,l-2,d/2],["",l-2,d/2],["C",l-2,d/2,l-2,d-2],["",l-c,d-2],["L",f,d-2],["L",1,d/2],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(h),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},OffPageLinkNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=Math.min(Math.tan(Math.PI/6)*(l/2),d/4),f=[["M",1,1],["L",l-2,1],["L",l-2,d-c],["L",l/2,d-2],["L",1,d-c],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(f),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},NoteLeftNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i="transparent",fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=l-2,f=[["M",c,1],["C",c-6,1,c-6,6],["",c-6,(d-6)/2],["L",c-12,d/2],["L",c-6,(d+6)/2],["L",c-6,d-2-6],["C",c-6,d-2,c,d-2],["",c,d-2]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(f),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},NoteRightNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i="transparent",fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=[["M",1,1],["C",6,1,6,6],["",6,(d-6)/2],["L",12,d/2],["L",6,(d+6)/2],["L",6,d-2-6],["C",6,d-2,1,d-2],["",1,d-2]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(c),fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},InternalStorageNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{stroke:r=jS.stroke,label:o=jS.label,fill:i=jS.fill,fontFill:a=jS.fontFill,fontSize:s=jS.fontSize}=n,{width:l,height:d}=t,c=l-2,f=d-2,h=[["M",1,1],["L",c-6,1],["C",c,1,c,6],["",c,d/2],["L",c,f-6],["C",c,f,c-6,f],["",c-6,f],["L",6,f],["C",1,f,1,f-6],["",1,f-6],["Z"]];return u.default.createElement("svg",{viewBox:`0 0 ${l} ${d}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("path",{d:BS(h),fill:i,stroke:r}),u.default.createElement("path",{d:`M 1,6 L ${c-1} 6 `,fill:i,stroke:r}),u.default.createElement("path",{d:`M 6,1 L 6 ${f} `,fill:i,stroke:r}),u.default.createElement("text",{x:l/2,y:d/2,fill:a,textAnchor:"middle",alignmentBaseline:"middle",fontSize:s},o),"Sorry, your browser does not support inline SVG.")},TextNode:e=>{const{size:t={width:PS,height:DS},data:n={}}=e,{label:r=jS.label,fontFill:o=jS.fontFill,fontSize:i=jS.fontSize}=n,{width:a,height:s}=t;return u.default.createElement("svg",{viewBox:`0 0 ${a/2} ${s/2}`,xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},u.default.createElement("text",{x:a/4,y:s/4,fill:o,textAnchor:"middle",alignmentBaseline:"middle",fontSize:i},r),"Sorry, your browser does not support inline SVG.")}});const FS=e=>({position:{name:e},attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff",style:{visibility:"hidden"}}},zIndex:10}),GS=(e=["top","right","bottom","left"])=>({items:e.map(e=>({group:e,id:Dr()})),groups:{top:FS("top"),right:FS("right"),bottom:FS("bottom"),left:FS("left")}}),US=e=>x(void 0,void 0,void 0,function*(){const t=(e=>(e||[]).map(e=>{const{name:t,popover:n,label:r="",width:o=DS,height:i=DS,ports:a,parentKey:s}=e;return{id:Dr(),renderKey:t,name:t,label:r,popoverContent:n,width:o,height:i,ports:a||GS(),originData:Object.assign({},e),isCustom:!0,parentKey:s}}))(e);return[...t,...IS.map(({name:e,ports:t,width:n=PS,height:r=DS,label:o=""})=>({id:Dr(),renderKey:e,name:e,label:o,popoverContent:()=>e,width:n,height:r,ports:GS(t)}))]}),HS=e=>{const t=e?o.isArray(e)?e:[e]:[];let n=[];t.forEach(e=>{n=n.concat(e.nodes.map(t=>Object.assign(Object.assign({},t),{parentKey:e.key})))}),n.length&&_S({registerNode:n});const r=ES("graphConfig"),i=ES("registerNode");r&&(null==i?void 0:i.length)&&i.forEach(e=>{const{name:t,component:n}=e;r.setNodeRender(t,n)})},BS=(e,t=0,n=0)=>{if(!e.length)return null;let r="";return e.forEach(e=>{const[i,a,s,l,d]=e;r+=o.isNumber(s)?` ${i} ${a+t} ${s+n}`:` ${i}`,d&&(r+=` ${l+t} ${d+n}`)}),r},{Panel:zS}=s.Collapse,VS=e=>{const{x6NodeFactory:r,dndOptions:i,state:a,prefixClz:l,defaultActiveKey:d=["official"],showOfficial:c=!0}=e,f=e.registerNode?o.isArray(e.registerNode)?e.registerNode:[e.registerNode]:[],{graphProvider:h,modelService:p,commandService:g}=qs(),[v,m]=u.default.useState(),[y,b]=u.default.useState();let w;u.default.useEffect(()=>{h.getGraphInstance().then(e=>{b(e)})}),h.getGraphOptions().then(e=>{w=e});const _=t.useCallback(e=>x(void 0,void 0,void 0,function*(){var t;const{ports:n}=e,r=Object.assign(Object.assign({},e),{id:`node-${Dr()}`,zIndex:10,ports:Object.assign(Object.assign({},n),{items:null===(t=n.items)||void 0===t?void 0:t.map(e=>Object.assign(Object.assign({},e),{id:Dr()}))})}),o={nodeConfig:r};yield g.executeCommand(Zs.ADD_NODE.id,o);const i=ES("onAddNode");"function"==typeof i&&i(r)}),[g]);u.default.useEffect(()=>{if(!y)return;const e=new n.Addon.Dnd(Object.assign(Object.assign({scaled:!1,animation:!1},i),{target:y,validateNode:e=>x(void 0,void 0,void 0,function*(){const t=Object.assign(Object.assign({},e.getData()),e.getPosition());return yield _(t),!1})}));m(e)},[g,i,y,p,_]);const E=u.default.useCallback(e=>t=>{if(!y||!v||!w)return;const n=w.nodeTypeParser(e),{width:o=180,height:i=40}=e,a=Pc(w.nodeRender.get(n),g,p),s={data:e,width:o,height:i,view:w.graphId,component:a},l=r?r(s):Jb(s);v.start(l,t.nativeEvent)},[g,v,y,w,p,r]),S=u.default.useCallback((e=[])=>e.map(e=>{const{popoverContent:t}=e;return u.default.createElement(ex,{item:e,onMouseDown:E(e),popoverContent:t,prefixClz:l,modelService:p,commandService:g,graphConfig:w})}),[g,w,p,E,l]),C=a.nodeList.filter(e=>!e.isCustom),O=a.searchList.filter(e=>!e.isCustom);return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${l}-body`},u.default.createElement(s.Collapse,{defaultActiveKey:d,style:{border:"none"}},c&&u.default.createElement(zS,{header:"通用节点",key:"official",style:{border:"none"}},!a.keyword&&u.default.createElement("div",{className:`${l}-official`},S(C)),a.searchList.length>0&&u.default.createElement("div",{className:`${l}-official`},S(O))),(null==f?void 0:f.length)>0&&f.map(e=>{return!e.hidden&&e.nodes.length>0&&u.default.createElement(zS,{header:e.title,key:e.key,style:{border:"none"}},!a.keyword&&u.default.createElement("div",{className:`${l}-custom`},S((t=e.key,a.nodeList.filter(e=>e.isCustom&&e.parentKey===t)))),a.searchList.length>0&&u.default.createElement("div",{className:`${l}-custom`},S((e=>a.searchList.filter(t=>t.isCustom&&t.parentKey===e))(e.key))));var t})),a.keyword&&0===a.searchList.length&&u.default.createElement(s.Empty,{style:{marginTop:"48px"}})))},YS=e=>{const{prefixClz:t,onKeywordChange:n}=e,{propsProxy:r}=Fb(),o=r.getValue();return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:`${t}-header`,style:Object.assign({zIndex:1},e.style)},o.header&&u.default.isValidElement(o.header)&&o.header,u.default.createElement("div",{className:`${t}-header-search`},u.default.createElement(s.Input,{placeholder:"搜索组件",allowClear:!0,onChange:e=>n(e.target.value),style:{width:"100%",border:0}}))))};var WS;!function(e){e.id="NODE_PANEL_DATA"}(WS||(WS={}));const $S=(e=[],t)=>x(void 0,void 0,void 0,function*(){const n=e.filter(e=>{var n,r;return e.isDirectory||(null===(n=e.label)||void 0===n?void 0:n.includes(t))||(null===(r=e.name)||void 0===r?void 0:r.includes(t))});return n}),KS=e=>{const{searchService:t=$S}=e,n=e.registerNode?o.isArray(e.registerNode)?e.registerNode:[e.registerNode]:[];let r=[];n.forEach(e=>{r=r.concat(e.nodes.map(t=>Object.assign(Object.assign({},t),{parentKey:e.key})))});const{modelService:i}=qs(),[a,s,l]=qy({searchList:[],nodeList:[],defaultExpandAll:!1,keyword:""});u.default.useEffect(()=>{i.findDeferredModel(WS.id)||i.registerModel({id:WS.id,modelFactory:()=>l,watchChange:e=>x(void 0,void 0,void 0,function*(){const t=yield tu.getModel(i),n=t.watch(()=>x(void 0,void 0,void 0,function*(){const t=yield x(void 0,void 0,void 0,function*(){return{listData:yield US(r)}});e.setValue({nodeList:t.listData,defaultExpandAll:!1,keyword:"",searchList:[]})}));return Er.create(()=>{n.dispose()})})})},[]);const d=u.default.useCallback(e=>x(void 0,void 0,void 0,function*(){if(t)if(e){const n=yield t(a.nodeList,e);s(t=>{t.keyword=e,t.searchList=n})}else s(e=>{e.keyword="",e.searchList=[]})}),[t,a.nodeList,s]);return{state:a,setState:s,onKeywordChange:d}},XS=e=>{const{cell:t,data:{label:n,stroke:r,fill:o,fontSize:i,fontFill:a,width:s=200,isCollapsed:l=!1}}=e,d=qs();return u.default.createElement("div",{className:"xflow-group-node",style:{borderColor:r,backgroundColor:o,fontSize:i,color:a}},u.default.createElement("div",{className:"xflow-group-header"},u.default.createElement("div",{className:"header-left"},n),u.default.createElement("div",{className:"header-right"},l&&u.default.createElement(Ds,{onClick:()=>{d.executeCommand(tl.COLLAPSE_GROUP.id,{nodeId:t.id,isCollapsed:!1,collapsedSize:{width:s,height:40}})}}),!l&&u.default.createElement(ks,{onClick:()=>{d.executeCommand(tl.COLLAPSE_GROUP.id,{nodeId:t.id,isCollapsed:!0,collapsedSize:{width:s,height:40},gap:3})}}))))};var qS;!function(e){e.id="FLOWCHART_PANEL_DATA"}(qS||(qS={}));const ZS=e=>{const{prefixClz:t,position:n={width:240,top:0,bottom:0,left:0},showHeader:r=!0}=e,o=m(e,["prefixClz","position","showHeader"]),{width:i=200}=n,{headerStyle:a,bodyStyle:s}=ix(e),{state:l,onKeywordChange:d}=KS(e);return u.default.createElement(u.default.Fragment,null,r&&u.default.createElement(Gb,Object.assign({},o,{position:{top:0,left:0,height:40,width:i}}),u.default.createElement(YS,Object.assign({},e,{state:l,style:a,onKeywordChange:d}))),u.default.createElement(Gb,Object.assign({className:`${TS}-nodes`},o,{position:Object.assign(Object.assign({},n),{top:r?40:0})}),u.default.createElement(VS,Object.assign({},e,{state:l,style:s}))))};var JS;!function(e){e.EVENT_NAME="ADD_FLOWCHART_EDGE_CMD_EVENT"}(JS||(JS={}));const QS={attrs:{line:{stroke:"#A2B1C3",targetMarker:{name:"block",width:12,height:8},strokeDasharray:"5 5",strokeWidth:1}}},eC=n.Shape.Edge.registry.register("xflow",n.Shape.Edge.define({zIndex:1,highlight:!0,name:"flowchart-connecting-edge",label:"",anchor:{name:"midSide",args:{dx:10}},attrs:QS.attrs,data:{label:""}}),!0),tC=(nC=(e,t)=>{const{config:n={},useConfig:r,mode:i="edit",showPortsOnNodeSelected:a=!1,edgeConfig:l={}}=t.getValue();var d;e.setEdgeTypeParser(e=>null==e?void 0:e.renderKey),_S(Object.assign(Object.assign({},t.getValue()),{graphConfig:e})),d=e,HS(),d.nodeRender.get("Terminal")||IS.forEach(e=>{d.setNodeRender(e.name,LS[`${e.name.replace(/\s+/g,"")}Node`])}),(e=>{e.setNodeRender("GROUP_NODE_RENDER_ID",XS)})(e),e.setX6Config(xS({grid:!0,history:!0,resizing:{enabled:!0,minWidth:DS,minHeight:DS,preserveAspectRatio:e=>{const{data:t}=e;return RS.includes(t.name)}},snapline:{enabled:!0},connecting:{router:"manhattan",connector:{name:"rounded",args:{radius:8}},anchor:"center",connectionPoint:"anchor",allowBlank:!1,snap:{radius:20},createEdge(){const e=new eC({});return this.once("edge:connected",t=>{const{edge:n,isNew:r}=t;if(r&&n&&n.isEdge()&&e===n){const t=n.getTargetCell();if(t&&t.isNode()){const t=n.getTargetPortId(),r=n.getSourcePortId(),o=n.getSourceCellId(),i=n.getTargetCellId(),a="function"==typeof l?l(n):l;this.trigger(JS.EVENT_NAME,Object.assign({targetPortId:t,sourcePortId:r,source:o,target:i,edge:n,tempEdgeId:e.id},xS(QS,a)))}}}),e},validateEdge:e=>{var t;const{edge:n}=e;return!!(null===(t=null==n?void 0:n.target)||void 0===t?void 0:t.port)},validateMagnet:()=>!0,validateConnection({sourceView:e,targetView:t,targetMagnet:n}){if(e===t)return!1;const r=t.cell;if(n){const e=n.getAttribute("port"),t=r.getPort(e);return!(t&&t.connected)}}},highlighting:{nodeAvailable:{name:"className",args:{className:"available"}},magnetAvailable:{name:"className",args:{className:"available"}},magnetAdsorbed:{name:"className",args:{className:"adsorbed"}}},onPortRendered(e){const{port:t}=e,{contentSelectors:n}=e,r=n&&n.content,o=t.group,i=xr("xflow-port",{connected:t.connected});r&&h.default.render(u.default.createElement(s.ConfigProvider,{prefixCls:"ant"},u.default.createElement(s.Tooltip,{title:t.tooltip,placement:o},u.default.createElement("span",{className:i}))),r)}},n)),e.setEvents([{eventName:"node:selected",callback:()=>{"edit"===i&&AS(!1)}},{eventName:"edge:dblclick",callback:e=>{(e=>{x(void 0,void 0,void 0,function*(){const{edge:t}=e;t&&t.addTools("vertices","ondbclick")})})(e)}},{eventName:"edge:mouseleave",callback:(e,t)=>{((e,t)=>{x(void 0,void 0,void 0,function*(){const{edge:n}=e;n&&n.hasTools("ondbclick")&&(t.executeCommand(Js.UPDATE_EDGE.id,{edgeConfig:Object.assign(Object.assign({},o.get(n,"data")),{vertices:n.getVertices()})}),n.removeTools())})})(e,t)}},{eventName:"node:mouseenter",callback:e=>{"edit"===i&&AS(!0,e,a)}},{eventName:"node:mouseleave",callback:e=>{AS(!1,e)}},{eventName:"node:moved",callback:(e,t)=>{((e,t)=>{x(void 0,void 0,void 0,function*(){const{node:n}=e;if(!n)return;const{data:r}=n;if(null==r?void 0:r.groupChildren){const e=OS();null==r||r.groupChildren.forEach(n=>x(void 0,void 0,void 0,function*(){var r,o;const i=e.getCellById(n);i&&i.isNode()&&(yield t.executeCommand(Zs.UPDATE_NODE.id,{nodeConfig:Object.assign(Object.assign(Object.assign({},i.data),null===(r=i.getSize)||void 0===r?void 0:r.call(i)),null===(o=i.getPosition)||void 0===o?void 0:o.call(i))}))}))}const o=Object.assign(Object.assign(Object.assign({},n.data),n.getPosition()),n.getSize());yield t.executeCommand(Zs.UPDATE_NODE.id,{nodeConfig:o}),MS({type:"move:node",config:o})})})(e,t)}},{eventName:"node:resized",callback:(e,t)=>{((e,t)=>{x(void 0,void 0,void 0,function*(){const{node:n}=e;if(!n)return;const r=Object.assign(Object.assign(Object.assign({},n.data),n.getPosition()),n.size());yield t.executeCommand(Zs.UPDATE_NODE.id,{nodeConfig:r}),MS({type:"resize:node",config:r})})})(e,t)}}]),"function"==typeof r&&r(e)},e=>{const t=u.default.useMemo(()=>({getValue:()=>({})}),[]);t.getValue=()=>e;const n=u.default.useMemo(()=>{const e=new ll;return nC(e,t),e},[t]);return n});var nC;let rC=class{constructor(){this.toDispose=new Or,this.registerHookHub=()=>x(this,void 0,void 0,function*(){return Er.create(()=>{})}),this.registerHook=e=>x(this,void 0,void 0,function*(){const t=new Or,n=[e.afterGraphInit.registerHook({name:"call add edge to replace temp edge",handler:e=>x(this,void 0,void 0,function*(){const{commandService:t,graph:n}=e;n.on(JS.EVENT_NAME,e=>x(this,void 0,void 0,function*(){const r=m(e,["edge"]),{tempEdgeId:o}=r,i=m(r,["tempEdgeId"]),a={edgeConfig:Object.assign(Object.assign({},i),{source:{cell:r.source,port:r.sourcePortId},target:{cell:r.target,port:r.targetPortId},zIndex:1,data:Object.assign({},i)})};yield t.executeCommand(Js.ADD_EDGE.id,a),yield t.executeCommand(Js.DEL_EDGE.id,{edgeConfig:{id:o}});const s=n.getCellById(r.source),l=n.getCellById(r.target);yield t.executeCommand(Zs.UPDATE_NODE.id,{nodeConfig:Object.assign(Object.assign({},s.data),{incomingEdges:n.getIncomingEdges(s),outgoingEdges:n.getOutgoingEdges(s)})}),yield t.executeCommand(Zs.UPDATE_NODE.id,{nodeConfig:Object.assign(Object.assign({},l.data),{incomingEdges:n.getIncomingEdges(l),outgoingEdges:n.getOutgoingEdges(l)})});const d=ES("onAddEdge");"function"==typeof d&&d(a.edgeConfig),e.edge.remove()}))})})];return t.pushAll(n),Er.create(()=>{})})}};rC=y([tr({contrib:mc})],rC);const oC=()=>hr(e=>{e(rC)}),iC=e=>{const{position:n={top:40,left:240,right:240,bottom:0}}=e,r=tC(e),o=qs();return t.useEffect(()=>{o&&(e=>{x(void 0,void 0,void 0,function*(){const t=yield e.getGraphInstance();SS.set("x6graph",t),CS.set("app",e)})})(o)},[o]),u.default.createElement(yu,Object.assign({},e,{config:r,position:n}),e.children)};iC.defaultProps={isXFlowCanvas:!0};const aC=e=>x(void 0,void 0,void 0,function*(){var t;const{targetType:n}=e;return(null===(t=e.targetData)||void 0===t?void 0:t.isGroup)?{tabs:[{name:"设置",groups:[{name:"groupName",controls:[{label:"分组名",name:"group-service",shape:"group-service",placeholder:"分组名称"}]}]}]}:"node"===n?{tabs:[{name:"设置",groups:[{name:"groupName",controls:[{label:"节点名",name:"node-service",shape:"node-service",placeholder:"节点名称"}]}]}]}:"edge"===n?{tabs:[{name:"设置",groups:[{name:"groupName",controls:[{label:"边",name:"edge-service",shape:"edge-service",placeholder:"边名称"}]}]}]}:{tabs:[{name:"设置",groups:[{name:"groupName",controls:[{label:"",name:"canvas-service",shape:"canvas-service"}]}]}]}});const sC=e=>{const{controlSchema:n,children:r,type:o="node"}=e,{commandService:i,modelService:a}=Fb(),s=t.useCallback(()=>x(void 0,void 0,void 0,function*(){const{data:e}=yield Kc.useValue(a);return e}),[a]),l=t.useCallback(()=>x(void 0,void 0,void 0,function*(){const e=yield Wc.useValue(a),t=e.getData();return Object.assign({id:e.id},t)}),[a]),{data:d,loading:c}=function(e){const[n,r]=t.useState({loading:!0}),o=t.useCallback(()=>{e().then(e=>{r({loading:!1,data:e})},e=>{r({loading:!1}),console.error(e)})},[e]);return t.useEffect(()=>{o()},[o]),n}("edge"===o?l:s);u.default.useEffect(()=>{i.executeCommand(Qs.SAVE_GRAPH_DATA.id,{saveGraphDataService:(e,t)=>x(void 0,void 0,void 0,function*(){return{err:null,data:t,meta:e}})})},[i]);const f=e=>x(void 0,void 0,void 0,function*(){const t=yield s(),n=Object.assign(Object.assign({},t),e);yield i.executeCommand(Zs.UPDATE_NODE.id,{nodeConfig:n}),MS({type:"update:node",config:n})}),h=(e,t="line",n)=>x(void 0,void 0,void 0,function*(){var r;const o=yield l(),a=Object.assign(Object.assign(Object.assign({},o),n?e[n]:e),{attrs:Object.assign(Object.assign({},o.attrs),{[t]:Object.assign(Object.assign({},null===(r=o.attrs)||void 0===r?void 0:r[t]),n?e[n]:e)})});yield i.executeCommand(Js.UPDATE_EDGE.id,{edgeConfig:a}),MS({type:"update:edge",config:a})}),p=e=>x(void 0,void 0,void 0,function*(){const t=yield s(),n=Object.assign(Object.assign({},t),e);yield i.executeCommand(Zs.UPDATE_NODE.id,{nodeConfig:n}),MS({type:"update:group",config:n})});return c?null:u.default.createElement(j_,{schema:n},()=>r(Object.assign({},d),{updateNode:f,updateEdge:h,updateGroup:p}))},lC="flowchart-editor",dC={attrs:{line:{stroke:"#A2B1C3",strokeWidth:1},text:{fill:"#000",fontSize:12,textAnchor:"middle",textVerticalAnchor:"middle"}}},cC={width:12,height:8,name:"block"},uC={width:0,height:0,name:""},fC={target:{sourceMarker:uC,targetMarker:cC},source:{sourceMarker:cC,targetMarker:uC},all:{sourceMarker:cC,targetMarker:cC},none:{sourceMarker:uC,targetMarker:uC}},hC={solid:[0,0],dash:[5,5]},pC=e=>{const{label:t="标签",value:n,onChange:r}=e;return u.default.createElement("div",{className:"group"},u.default.createElement("label",null,t),u.default.createElement(s.Input,{value:n,style:{height:24},onChange:e=>{null==r||r(e.target.value)}}))};var gC={},vC={},mC={},yC={},bC=zo,xC=Po,wC=Vo;var _C=function(e){return"string"==typeof e||!xC(e)&&wC(e)&&"[object String]"==bC(e)},EC=vE,SC=pv;var CC=function(e,t){return e&&EC(e,t,SC)},OC=Fw;var kC=function(e){return"function"==typeof e?e:OC},MC=CC,NC=kC;var AC=function(e,t){return e&&MC(e,NC(t))},TC=cv;var PC=function(e,t){return function(n,r){if(null==n)return n;if(!TC(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Object(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}(CC),DC=PC,jC=cv;var IC=To,RC=Xw,LC=function(e,t){var n=-1,r=jC(e)?Array(e.length):[];return DC(e,function(e,o,i){r[++n]=t(e,o,i)}),r},FC=Po;var GC=function(e,t){return(FC(e)?IC:LC)(e,RC(t))};Object.defineProperty(yC,"__esModule",{value:!0}),yC.flattenNames=void 0;var UC=VC(_C),HC=VC(AC),BC=VC(ME),zC=VC(GC);function VC(e){return e&&e.__esModule?e:{default:e}}var YC=yC.flattenNames=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[];return(0,zC.default)(t,function(t){Array.isArray(t)?e(t).map(function(e){return n.push(e)}):(0,BC.default)(t)?(0,HC.default)(t,function(e,t){!0===e&&n.push(t),n.push(t+"-"+e)}):(0,UC.default)(t)&&n.push(t)}),n};yC.default=YC;var WC={};Object.defineProperty(WC,"__esModule",{value:!0}),WC.mergeClasses=void 0;var $C=qC(AC),KC=qC(By),XC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function qC(e){return e&&e.__esModule?e:{default:e}}var ZC=WC.mergeClasses=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.default&&(0,KC.default)(e.default)||{};return t.map(function(t){var r=e[t];return r&&(0,$C.default)(r,function(e,t){n[t]||(n[t]={}),n[t]=XC({},n[t],r[t])}),t}),n};WC.default=ZC;var JC={};Object.defineProperty(JC,"__esModule",{value:!0}),JC.autoprefix=void 0;var QC,eO=(QC=AC)&&QC.__esModule?QC:{default:QC},tO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var nO={borderRadius:function(e){return{msBorderRadius:e,MozBorderRadius:e,OBorderRadius:e,WebkitBorderRadius:e,borderRadius:e}},boxShadow:function(e){return{msBoxShadow:e,MozBoxShadow:e,OBoxShadow:e,WebkitBoxShadow:e,boxShadow:e}},userSelect:function(e){return{WebkitTouchCallout:e,KhtmlUserSelect:e,MozUserSelect:e,msUserSelect:e,WebkitUserSelect:e,userSelect:e}},flex:function(e){return{WebkitBoxFlex:e,MozBoxFlex:e,WebkitFlex:e,msFlex:e,flex:e}},flexBasis:function(e){return{WebkitFlexBasis:e,flexBasis:e}},justifyContent:function(e){return{WebkitJustifyContent:e,justifyContent:e}},transition:function(e){return{msTransition:e,MozTransition:e,OTransition:e,WebkitTransition:e,transition:e}},transform:function(e){return{msTransform:e,MozTransform:e,OTransform:e,WebkitTransform:e,transform:e}},absolute:function(e){var t=e&&e.split(" ");return{position:"absolute",top:t&&t[0],right:t&&t[1],bottom:t&&t[2],left:t&&t[3]}},extend:function(e,t){var n=t[e];return n||{extend:e}}},rO=JC.autoprefix=function(e){var t={};return(0,eO.default)(e,function(e,n){var r={};(0,eO.default)(e,function(e,t){var n=nO[t];n?r=tO({},r,n(e)):r[t]=e}),t[n]=r}),t};JC.default=rO;var oO={};Object.defineProperty(oO,"__esModule",{value:!0}),oO.hover=void 0;var iO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aO=function(e){return e&&e.__esModule?e:{default:e}}(u.default);function sO(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var lO=oO.hover=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var n,o,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);for(var a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return o=i=sO(this,(n=r.__proto__||Object.getPrototypeOf(r)).call.apply(n,[this].concat(s))),i.state={hover:!1},i.handleMouseOver=function(){return i.setState({hover:!0})},i.handleMouseOut=function(){return i.setState({hover:!1})},i.render=function(){return aO.default.createElement(t,{onMouseOver:i.handleMouseOver,onMouseOut:i.handleMouseOut},aO.default.createElement(e,iO({},i.props,i.state)))},sO(i,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,n),r}(aO.default.Component)};oO.default=lO;var dO={};Object.defineProperty(dO,"__esModule",{value:!0}),dO.active=void 0;var cO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uO=function(e){return e&&e.__esModule?e:{default:e}}(u.default);function fO(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var hO=dO.active=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var n,o,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);for(var a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return o=i=fO(this,(n=r.__proto__||Object.getPrototypeOf(r)).call.apply(n,[this].concat(s))),i.state={active:!1},i.handleMouseDown=function(){return i.setState({active:!0})},i.handleMouseUp=function(){return i.setState({active:!1})},i.render=function(){return uO.default.createElement(t,{onMouseDown:i.handleMouseDown,onMouseUp:i.handleMouseUp},uO.default.createElement(e,cO({},i.props,i.state)))},fO(i,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,n),r}(uO.default.Component)};dO.default=hO;var pO={};Object.defineProperty(pO,"__esModule",{value:!0});pO.default=function(e,t){var n={},r=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n[e]=t};return 0===e&&r("first-child"),e===t-1&&r("last-child"),(0===e||e%2==0)&&r("even"),1===Math.abs(e%2)&&r("odd"),r("nth-child",e),n},Object.defineProperty(mC,"__esModule",{value:!0}),mC.ReactCSS=mC.loop=mC.handleActive=mC.handleHover=mC.hover=void 0;var gO=wO(yC),vO=wO(WC),mO=wO(JC),yO=wO(oO),bO=wO(dO),xO=wO(pO);function wO(e){return e&&e.__esModule?e:{default:e}}mC.hover=yO.default,mC.handleHover=yO.default,mC.handleActive=bO.default,mC.loop=xO.default;var _O=mC.ReactCSS=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=(0,gO.default)(n),i=(0,vO.default)(e,o);return(0,mO.default)(i)};mC.default=_O;var EO={},SO={},CO={};Object.defineProperty(CO,"__esModule",{value:!0}),CO.calculateChange=function(e,t,n,r,o){e.preventDefault();var i=o.clientWidth,a=o.clientHeight,s="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,d=s-(o.getBoundingClientRect().left+window.pageXOffset),c=l-(o.getBoundingClientRect().top+window.pageYOffset);if("vertical"===n){var u=void 0;if(u=c<0?0:c>a?1:Math.round(100*c/a)/100,t.a!==u)return{h:t.h,s:t.s,l:t.l,a:u,source:"rgb"}}else{var f=void 0;if(r!==(f=d<0?0:d>i?1:Math.round(100*d/i)/100))return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null};var OO={},kO={};Object.defineProperty(kO,"__esModule",{value:!0});var MO={},NO=kO.render=function(e,t,n,r){if("undefined"==typeof document&&!r)return null;var o=r?new r:document.createElement("canvas");o.width=2*n,o.height=2*n;var i=o.getContext("2d");return i?(i.fillStyle=e,i.fillRect(0,0,o.width,o.height),i.fillStyle=t,i.fillRect(0,0,n,n),i.translate(n,n),i.fillRect(0,0,n,n),o.toDataURL()):null};kO.get=function(e,t,n,r){var o=e+"-"+t+"-"+n+(r?"-server":"");if(MO[o])return MO[o];var i=NO(e,t,n,r);return MO[o]=i,i},Object.defineProperty(OO,"__esModule",{value:!0}),OO.Checkboard=void 0;var AO=DO(u.default),TO=DO(mC),PO=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(kO);function DO(e){return e&&e.__esModule?e:{default:e}}var jO=OO.Checkboard=function(e){var t=e.white,n=e.grey,r=e.size,o=e.renderers,i=e.borderRadius,a=e.boxShadow,s=(0,TO.default)({default:{grid:{borderRadius:i,boxShadow:a,absolute:"0px 0px 0px 0px",background:"url("+PO.get(t,n,r,o.canvas)+") center left"}}});return AO.default.createElement("div",{style:s.grid})};jO.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}},OO.default=jO,Object.defineProperty(SO,"__esModule",{value:!0}),SO.Alpha=void 0;var IO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RO=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),LO=u.default,FO=BO(LO),GO=BO(mC),UO=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(CO),HO=BO(OO);function BO(e){return e&&e.__esModule?e:{default:e}}function zO(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var VO=SO.Alpha=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=zO(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.handleChange=function(e){var t=UO.calculateChange(e,r.props.hsl,r.props.direction,r.props.a,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleChange),window.removeEventListener("mouseup",r.handleMouseUp)},zO(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),RO(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var e=this,t=this.props.rgb,n=(0,GO.default)({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:100*t.a+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)"},pointer:{left:0,top:100*t.a+"%"}},overwrite:IO({},this.props.style)},{vertical:"vertical"===this.props.direction,overwrite:!0});return FO.default.createElement("div",{style:n.alpha},FO.default.createElement("div",{style:n.checkboard},FO.default.createElement(HO.default,{renderers:this.props.renderers})),FO.default.createElement("div",{style:n.gradient}),FO.default.createElement("div",{style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},FO.default.createElement("div",{style:n.pointer},this.props.pointer?FO.default.createElement(this.props.pointer,this.props):FO.default.createElement("div",{style:n.slider}))))}}]),t}(LO.PureComponent||LO.Component);SO.default=VO;var YO={};Object.defineProperty(YO,"__esModule",{value:!0}),YO.EditableInput=void 0;var WO=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),$O=u.default,KO=qO($O),XO=qO(mC);function qO(e){return e&&e.__esModule?e:{default:e}}var ZO=[38,40],JO=YO.EditableInput=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(e){n.setUpdatedValue(e.target.value,e)},n.handleKeyDown=function(e){var t,r=function(e){return Number(String(e).replace(/%/g,""))}(e.target.value);if(!isNaN(r)&&(t=e.keyCode,ZO.indexOf(t)>-1)){var o=n.getArrowOffset(),i=38===e.keyCode?r+o:r-o;n.setUpdatedValue(i,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),WO(t,[{key:"componentWillReceiveProps",value:function(e){var t=this.input;e.value!==this.state.value&&(t===document.activeElement?this.setState({blurValue:String(e.value).toUpperCase()}):this.setState({value:String(e.value).toUpperCase(),blurValue:!this.state.blurValue&&String(e.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){return function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},this.props.label,e)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var n=null!==this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t);var r,o=function(e){return String(e).indexOf("%")>-1}(t.target.value);this.setState({value:o?(r=e,r+"%"):e})}},{key:"render",value:function(){var e=this,t=(0,XO.default)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return KO.default.createElement("div",{style:t.wrap},KO.default.createElement("input",{style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?KO.default.createElement("span",{style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}($O.PureComponent||$O.Component);YO.default=JO;var QO={},ek={};Object.defineProperty(ek,"__esModule",{value:!0}),ek.calculateChange=function(e,t,n,r){e.preventDefault();var o=r.clientWidth,i=r.clientHeight,a="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,s="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=a-(r.getBoundingClientRect().left+window.pageXOffset),d=s-(r.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){var c=void 0;if(d<0)c=359;else if(d>i)c=0;else{c=360*(-100*d/i+100)/100}if(n.h!==c)return{h:c,s:n.s,l:n.l,a:n.a,source:"rgb"}}else{var u=void 0;if(l<0)u=0;else if(l>o)u=359;else{u=360*(100*l/o)/100}if(n.h!==u)return{h:u,s:n.s,l:n.l,a:n.a,source:"rgb"}}return null},Object.defineProperty(QO,"__esModule",{value:!0}),QO.Hue=void 0;var tk=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),nk=u.default,rk=ak(nk),ok=ak(mC),ik=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(ek);function ak(e){return e&&e.__esModule?e:{default:e}}function sk(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var lk=QO.Hue=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=sk(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.handleChange=function(e){var t=ik.calculateChange(e,r.props.direction,r.props.hsl,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},sk(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),tk(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.direction,n=void 0===t?"horizontal":t,r=(0,ok.default)({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:100*this.props.hsl.h/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-100*this.props.hsl.h/360+100+"%"}}},{vertical:"vertical"===n});return rk.default.createElement("div",{style:r.hue},rk.default.createElement("div",{className:"hue-"+n,style:r.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},rk.default.createElement("style",null,"\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n "),rk.default.createElement("div",{style:r.pointer},this.props.pointer?rk.default.createElement(this.props.pointer,this.props):rk.default.createElement("div",{style:r.slider}))))}}]),t}(nk.PureComponent||nk.Component);QO.default=lk;var dk={},ck={exports:{}},uk={},fk="function"==typeof Symbol&&Symbol.for,hk=fk?Symbol.for("react.element"):60103,pk=fk?Symbol.for("react.portal"):60106,gk=fk?Symbol.for("react.fragment"):60107,vk=fk?Symbol.for("react.strict_mode"):60108,mk=fk?Symbol.for("react.profiler"):60114,yk=fk?Symbol.for("react.provider"):60109,bk=fk?Symbol.for("react.context"):60110,xk=fk?Symbol.for("react.async_mode"):60111,wk=fk?Symbol.for("react.concurrent_mode"):60111,_k=fk?Symbol.for("react.forward_ref"):60112,Ek=fk?Symbol.for("react.suspense"):60113,Sk=fk?Symbol.for("react.suspense_list"):60120,Ck=fk?Symbol.for("react.memo"):60115,Ok=fk?Symbol.for("react.lazy"):60116,kk=fk?Symbol.for("react.block"):60121,Mk=fk?Symbol.for("react.fundamental"):60117,Nk=fk?Symbol.for("react.responder"):60118,Ak=fk?Symbol.for("react.scope"):60119;function Tk(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case hk:switch(e=e.type){case xk:case wk:case gk:case mk:case vk:case Ek:return e;default:switch(e=e&&e.$$typeof){case bk:case _k:case Ok:case Ck:case yk:return e;default:return t}}case pk:return t}}}function Pk(e){return Tk(e)===wk}uk.AsyncMode=xk,uk.ConcurrentMode=wk,uk.ContextConsumer=bk,uk.ContextProvider=yk,uk.Element=hk,uk.ForwardRef=_k,uk.Fragment=gk,uk.Lazy=Ok,uk.Memo=Ck,uk.Portal=pk,uk.Profiler=mk,uk.StrictMode=vk,uk.Suspense=Ek,uk.isAsyncMode=function(e){return Pk(e)||Tk(e)===xk},uk.isConcurrentMode=Pk,uk.isContextConsumer=function(e){return Tk(e)===bk},uk.isContextProvider=function(e){return Tk(e)===yk},uk.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===hk},uk.isForwardRef=function(e){return Tk(e)===_k},uk.isFragment=function(e){return Tk(e)===gk},uk.isLazy=function(e){return Tk(e)===Ok},uk.isMemo=function(e){return Tk(e)===Ck},uk.isPortal=function(e){return Tk(e)===pk},uk.isProfiler=function(e){return Tk(e)===mk},uk.isStrictMode=function(e){return Tk(e)===vk},uk.isSuspense=function(e){return Tk(e)===Ek},uk.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===gk||e===wk||e===mk||e===vk||e===Ek||e===Sk||"object"==typeof e&&null!==e&&(e.$$typeof===Ok||e.$$typeof===Ck||e.$$typeof===yk||e.$$typeof===bk||e.$$typeof===_k||e.$$typeof===Mk||e.$$typeof===Nk||e.$$typeof===Ak||e.$$typeof===kk)},uk.typeOf=Tk;
37
37
  /*