9 lines
118 KiB
JavaScript
9 lines
118 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","react-dom"],e):e((t=t||self).ReactFlow={},t.React,t.PropTypes,t.ReactDOM)}(this,(function(t,e,n,r){"use strict";var o,i="default"in e?e.default:e;n=n&&n.hasOwnProperty("default")?n.default:n,r=r&&r.hasOwnProperty("default")?r.default:r;var a="undefined"!=typeof Symbol?Symbol("immer-nothing"):((o={})["immer-nothing"]=!0,o),s="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("immer-draftable"):"__$immer_draftable",u="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("immer-state"):"__$immer_state";function c(t){return!!t&&!!t[u]}function l(t){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t))return!0;var e=Object.getPrototypeOf(t);return!e||e===Object.prototype||(!!t[s]||!!t.constructor[s])}var f=Object.assign||function(t,e){for(var n in e)m(e,n)&&(t[n]=e[n]);return t},d="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function h(t,e){if(void 0===e&&(e=!1),Array.isArray(t))return t.slice();var n=Object.create(Object.getPrototypeOf(t));return d(t).forEach((function(r){if(r!==u){var o=Object.getOwnPropertyDescriptor(t,r),i=o.value;o.get&&e&&(i=o.get.call(t)),o.enumerable?n[r]=i:e&&Object.defineProperty(n,r,{value:i,writable:!0,configurable:!0})}})),n}function p(t,e){if(Array.isArray(t))for(var n=0;n<t.length;n++)e(n,t[n],t);else d(t).forEach((function(n){return e(n,t[n],t)}))}function g(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!!n&&n.enumerable}function m(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function y(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}var v=function(t){this.drafts=[],this.parent=t,this.canAutoFreeze=!0,this.patches=null};function w(t){t[u].revoke()}v.prototype.usePatches=function(t){t&&(this.patches=[],this.inversePatches=[],this.patchListener=t)},v.prototype.revoke=function(){this.leave(),this.drafts.forEach(w),this.drafts=null},v.prototype.leave=function(){this===v.current&&(v.current=this.parent)},v.current=null,v.enter=function(){return this.current=new v(this.current)};var b={};function _(t,e){var n=Array.isArray(t),r=N(t);p(r,(function(e){!function(t,e,n){var r=b[e];r?r.enumerable=n:b[e]=r={configurable:!0,enumerable:n,get:function(){return function(t,e){O(t);var n=S(E(t),e);if(t.finalizing)return n;if(n===S(t.base,e)&&l(n))return k(t),t.copy[e]=_(n,t);return n}(this[u],e)},set:function(t){!function(t,e,n){if(O(t),t.assigned[e]=!0,!t.modified){if(y(n,S(E(t),e)))return;P(t),k(t)}t.copy[e]=n}(this[u],e,t)}};Object.defineProperty(t,e,r)}(r,e,n||g(t,e))}));var o,i,a,s=e?e.scope:v.current;return o=r,i=u,a={scope:s,modified:!1,finalizing:!1,finalized:!1,assigned:{},parent:e,base:t,draft:r,copy:null,revoke:x,revoked:!1},Object.defineProperty(o,i,{value:a,enumerable:!1,writable:!0}),s.drafts.push(r),r}function x(){this.revoked=!0}function E(t){return t.copy||t.base}function S(t,e){var n=t[u];if(n&&!n.finalizing){n.finalizing=!0;var r=t[e];return n.finalizing=!1,r}return t[e]}function P(t){t.modified||(t.modified=!0,t.parent&&P(t.parent))}function k(t){t.copy||(t.copy=N(t.base))}function N(t){var e=t&&t[u];if(e){e.finalizing=!0;var n=h(e.draft,!0);return e.finalizing=!1,n}return h(t)}function O(t){if(!0===t.revoked)throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+JSON.stringify(E(t)))}function D(t){for(var e=t.length-1;e>=0;e--){var n=t[e][u];n.modified||(Array.isArray(n.base)?A(n)&&P(n):C(n)&&P(n))}}function C(t){for(var e=t.base,n=t.draft,r=Object.keys(n),o=r.length-1;o>=0;o--){var i=r[o],a=e[i];if(void 0===a&&!m(e,i))return!0;var s=n[i],c=s&&s[u];if(c?c.base!==a:!y(s,a))return!0}return r.length!==Object.keys(e).length}function A(t){var e=t.draft;if(e.length!==t.base.length)return!0;var n=Object.getOwnPropertyDescriptor(e,e.length-1);return!(!n||n.get)}var T=Object.freeze({willFinalize:function(t,e,n){t.drafts.forEach((function(t){t[u].finalizing=!0})),n?c(e)&&e[u].scope===t&&D(t.drafts):(t.patches&&function t(e){if(!e||"object"!=typeof e)return;var n=e[u];if(!n)return;var r=n.base;var o=n.draft;var i=n.assigned;if(Array.isArray(e)){if(A(n)){if(P(n),i.length=!0,o.length<r.length)for(var a=o.length;a<r.length;a++)i[a]=!1;else for(var s=r.length;s<o.length;s++)i[s]=!0;for(var c=0;c<o.length;c++)void 0===i[c]&&t(o[c])}}else Object.keys(o).forEach((function(e){void 0!==r[e]||m(r,e)?i[e]||t(o[e]):(i[e]=!0,P(n))})),Object.keys(r).forEach((function(t){void 0!==o[t]||m(o,t)||(i[t]=!1,P(n))}))}(t.drafts[0]),D(t.drafts))},createProxy:_});function M(t,e){var n=e?e.scope:v.current,r={scope:n,modified:!1,finalized:!1,assigned:{},parent:e,base:t,draft:null,drafts:{},copy:null,revoke:null},o=Array.isArray(t)?Proxy.revocable([r],z):Proxy.revocable(r,j),i=o.revoke,a=o.proxy;return r.draft=a,r.revoke=i,n.drafts.push(a),a}var j={get:function(t,e){if(e===u)return t;var n=t.drafts;if(!t.modified&&m(n,e))return n[e];var r=I(t)[e];if(t.finalized||!l(r))return r;if(t.modified){if(r!==R(t.base,e))return r;n=t.copy}return n[e]=M(r,t)},has:function(t,e){return e in I(t)},ownKeys:function(t){return Reflect.ownKeys(I(t))},set:function(t,e,n){if(!t.modified){var r=R(t.base,e);if(n?y(r,n)||n===t.drafts[e]:y(r,n)&&e in t.base)return!0;X(t)}return t.assigned[e]=!0,t.copy[e]=n,!0},deleteProperty:function(t,e){(void 0!==R(t.base,e)||e in t.base)&&(t.assigned[e]=!1,X(t));t.copy&&delete t.copy[e];return!0},getOwnPropertyDescriptor:function(t,e){var n=I(t),r=Reflect.getOwnPropertyDescriptor(n,e);r&&(r.writable=!0,r.configurable=!Array.isArray(n)||"length"!==e);return r},defineProperty:function(){throw new Error("Object.defineProperty() cannot be used on an Immer draft")},getPrototypeOf:function(t){return Object.getPrototypeOf(t.base)},setPrototypeOf:function(){throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft")}},z={};function I(t){return t.copy||t.base}function R(t,e){var n=t[u],r=Reflect.getOwnPropertyDescriptor(n?I(n):t,e);return r&&r.value}function X(t){t.modified||(t.modified=!0,t.copy=f(h(t.base),t.drafts),t.drafts=null,t.parent&&X(t.parent))}p(j,(function(t,e){z[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),z.deleteProperty=function(t,e){if(isNaN(parseInt(e)))throw new Error("Immer only supports deleting array indices");return j.deleteProperty.call(this,t[0],e)},z.set=function(t,e,n){if("length"!==e&&isNaN(parseInt(e)))throw new Error("Immer only supports setting array indices and the 'length' property");return j.set.call(this,t[0],e,n)};var L=Object.freeze({willFinalize:function(){},createProxy:M});function Y(t,e,n,r){Array.isArray(t.base)?function(t,e,n,r){var o,i,a=t.base,s=t.copy,u=t.assigned;s.length<a.length&&(a=(o=[s,a])[0],s=o[1],n=(i=[r,n])[0],r=i[1]);var c=s.length-a.length,l=0;for(;a[l]===s[l]&&l<a.length;)++l;var f=a.length;for(;f>l&&a[f-1]===s[f+c-1];)--f;for(var d=l;d<f;++d)if(u[d]&&s[d]!==a[d]){var h=e.concat([d]);n.push({op:"replace",path:h,value:s[d]}),r.push({op:"replace",path:h,value:a[d]})}for(var p=f!=a.length,g=n.length,m=f+c-1;m>=f;--m){var y=e.concat([m]);n[g+m-f]={op:"add",path:y,value:s[m]},p&&r.push({op:"remove",path:y})}p||r.push({op:"replace",path:e.concat(["length"]),value:a.length})}(t,e,n,r):function(t,e,n,r){var o=t.base,i=t.copy;p(t.assigned,(function(t,a){var s=o[t],u=i[t],c=a?t in o?"replace":"add":"remove";if(s!==u||"replace"!==c){var l=e.concat(t);n.push("remove"===c?{op:c,path:l}:{op:c,path:l,value:u}),r.push("add"===c?{op:"remove",path:l}:"remove"===c?{op:"add",path:l,value:s}:{op:"replace",path:l,value:s})}}))}(t,e,n,r)}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n],o=r.path;if(0===o.length&&"replace"===r.op)t=r.value;else{for(var i=t,a=0;a<o.length-1;a++)if(!(i=i[o[a]])||"object"!=typeof i)throw new Error("Cannot apply patch, path doesn't resolve: "+o.join("/"));var s=o[o.length-1];switch(r.op){case"replace":i[s]=r.value;break;case"add":Array.isArray(i)?i.splice(s,0,r.value):i[s]=r.value;break;case"remove":Array.isArray(i)?i.splice(s,1):delete i[s];break;default:throw new Error("Unsupported patch operation: "+r.op)}}}return t}var B={useProxies:"undefined"!=typeof Proxy&&"undefined"!=typeof Reflect,autoFreeze:"undefined"!=typeof process?"production"!==process.env.NODE_ENV:"verifyMinified"===function(){}.name,onAssign:null,onDelete:null,onCopy:null},H=function(t){f(this,B,t),this.setUseProxies(this.useProxies),this.produce=this.produce.bind(this)};H.prototype.produce=function(t,e,n){var r,o=this;if("function"==typeof t&&"function"!=typeof e){var i=e;e=t;var s=this;return function(t){var n=this;void 0===t&&(t=i);for(var r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return s.produce(t,(function(t){return e.call.apply(e,[n,t].concat(r))}))}}if("function"!=typeof e)throw new Error("The first or second argument to `produce` must be a function");if(void 0!==n&&"function"!=typeof n)throw new Error("The third argument to `produce` must be a function or undefined");if(l(t)){var u=v.enter(),c=this.createProxy(t),f=!0;try{r=e(c),f=!1}finally{f?u.revoke():u.leave()}return r instanceof Promise?r.then((function(t){return u.usePatches(n),o.processResult(t,u)}),(function(t){throw u.revoke(),t})):(u.usePatches(n),this.processResult(r,u))}return void 0===(r=e(t))?t:r!==a?r:void 0},H.prototype.createDraft=function(t){if(!l(t))throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object");var e=v.enter(),n=this.createProxy(t);return n[u].isManual=!0,e.leave(),n},H.prototype.finishDraft=function(t,e){var n=t&&t[u];if(!n||!n.isManual)throw new Error("First argument to `finishDraft` must be a draft returned by `createDraft`");if(n.finalized)throw new Error("The given draft is already finalized");var r=n.scope;return r.usePatches(e),this.processResult(void 0,r)},H.prototype.setAutoFreeze=function(t){this.autoFreeze=t},H.prototype.setUseProxies=function(t){this.useProxies=t,f(this,t?L:T)},H.prototype.applyPatches=function(t,e){return c(t)?V(t,e):this.produce(t,(function(t){return V(t,e)}))},H.prototype.processResult=function(t,e){var n=e.drafts[0],r=void 0!==t&&t!==n;if(this.willFinalize(e,t,r),r){if(n[u].modified)throw e.revoke(),new Error("An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.");l(t)&&(t=this.finalize(t,null,e)),e.patches&&(e.patches.push({op:"replace",path:[],value:t}),e.inversePatches.push({op:"replace",path:[],value:n[u].base}))}else t=this.finalize(n,[],e);return e.revoke(),e.patches&&e.patchListener(e.patches,e.inversePatches),t!==a?t:void 0},H.prototype.finalize=function(t,e,n){var r=this,o=t[u];if(!o)return Object.isFrozen(t)?t:this.finalizeTree(t,null,n);if(o.scope!==n)return t;if(!o.modified)return o.base;if(!o.finalized){if(o.finalized=!0,this.finalizeTree(o.draft,e,n),this.onDelete)if(this.useProxies){var i=o.assigned;for(var a in i)i[a]||this.onDelete(o,a)}else{var s=o.base,c=o.copy;p(s,(function(t){m(c,t)||r.onDelete(o,t)}))}this.onCopy&&this.onCopy(o),this.autoFreeze&&n.canAutoFreeze&&Object.freeze(o.copy),e&&n.patches&&Y(o,e,n.patches,n.inversePatches)}return o.copy},H.prototype.finalizeTree=function(t,e,n){var r=this,o=t[u];o&&(this.useProxies||(o.copy=h(o.draft,!0)),t=o.copy);var i=!!e&&!!n.patches,a=function(s,u,f){if(u===f)throw Error("Immer forbids circular references");var d=!!o&&f===t;if(c(u)){var h=d&&i&&!o.assigned[s]?e.concat(s):null;if(c(u=r.finalize(u,h,n))&&(n.canAutoFreeze=!1),Array.isArray(f)||g(f,s)?f[s]=u:Object.defineProperty(f,s,{value:u}),d&&u===o.base[s])return}else{if(d&&y(u,o.base[s]))return;l(u)&&!Object.isFrozen(u)&&p(u,a)}d&&r.onAssign&&r.onAssign(o,s,u)};return p(t,a),t};var U=new H,q=U.setAutoFreeze.bind(U),F=(U.setUseProxies.bind(U),U.applyPatches.bind(U),U.createDraft.bind(U)),$=U.finishDraft.bind(U);var G=function(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()),W=function(){return Math.random().toString(36).substring(7).split("").join(".")},K={INIT:"@@redux/INIT"+W(),REPLACE:"@@redux/REPLACE"+W(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+W()}};function Z(t,e,n){var r;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(Z)(t,e)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var o=t,i=e,a=[],s=a,u=!1;function c(){s===a&&(s=a.slice())}function l(){if(u)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function f(t){if("function"!=typeof t)throw new Error("Expected the listener to be a function.");if(u)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var e=!0;return c(),s.push(t),function(){if(e){if(u)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");e=!1,c();var n=s.indexOf(t);s.splice(n,1)}}}function d(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(u)throw new Error("Reducers may not dispatch actions.");try{u=!0,i=o(i,t)}finally{u=!1}for(var e=a=s,n=0;n<e.length;n++){(0,e[n])()}return t}return d({type:K.INIT}),(r={dispatch:d,subscribe:f,getState:l,replaceReducer:function(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");o=t,d({type:K.REPLACE})}})[G]=function(){var t,e=f;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new TypeError("Expected the observer to be an object.");function n(){t.next&&t.next(l())}return n(),{unsubscribe:e(n)}}})[G]=function(){return this},t},r}function J(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n}function tt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Q(n,!0).forEach((function(e){J(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function et(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function nt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),r=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return tt({},n,{dispatch:r=et.apply(void 0,i)(n.dispatch)})}}}function rt(){}function ot(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(o){return"function"==typeof o?o(n,r,t):e(o)}}}}"production"!==process.env.NODE_ENV&&"string"==typeof rt.name&&"isCrushed"!==rt.name&&function(t){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(t);try{throw new Error(t)}catch(t){}}('You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.');var it=ot();function at(){return this.list=[],this.lastItem=void 0,this.size=0,this}it.withExtraArgument=ot,at.prototype.get=function(t){var e;return this.lastItem&&this.isEqual(this.lastItem.key,t)?this.lastItem.val:(e=this.indexOf(t))>=0?(this.lastItem=this.list[e],this.list[e].val):void 0},at.prototype.set=function(t,e){var n;return this.lastItem&&this.isEqual(this.lastItem.key,t)?(this.lastItem.val=e,this):(n=this.indexOf(t))>=0?(this.lastItem=this.list[n],this.list[n].val=e,this):(this.lastItem={key:t,val:e},this.list.push(this.lastItem),this.size++,this)},at.prototype.delete=function(t){var e;if(this.lastItem&&this.isEqual(this.lastItem.key,t)&&(this.lastItem=void 0),(e=this.indexOf(t))>=0)return this.size--,this.list.splice(e,1)[0]},at.prototype.has=function(t){var e;return!(!this.lastItem||!this.isEqual(this.lastItem.key,t))||(e=this.indexOf(t))>=0&&(this.lastItem=this.list[e],!0)},at.prototype.forEach=function(t,e){var n;for(n=0;n<this.size;n++)t.call(e||this,this.list[n].val,this.list[n].key,this)},at.prototype.indexOf=function(t){var e;for(e=0;e<this.size;e++)if(this.isEqual(this.list[e].key,t))return e;return-1},at.prototype.isEqual=function(t,e){return t===e||t!=t&&e!=e};var st=at,ut=function(t){return"function"!=typeof Map||t?new st:new Map},ct=function(t){var e=new ut("true"===process.env.FORCE_SIMILAR_INSTEAD_OF_MAP),n=[];return function(r){var o=function(){var i,a,s,u=e,c=arguments.length-1,l=Array(c+1),f=!0;if((o.numArgs||0===o.numArgs)&&o.numArgs!==c+1)throw new Error("Memoizerific functions should always be called with the same number of arguments");for(s=0;s<c;s++)l[s]={cacheItem:u,arg:arguments[s]},u.has(arguments[s])?u=u.get(arguments[s]):(f=!1,i=new ut("true"===process.env.FORCE_SIMILAR_INSTEAD_OF_MAP),u.set(arguments[s],i),u=i);return f&&(u.has(arguments[c])?a=u.get(arguments[c]):f=!1),f||(a=r.apply(null,arguments),u.set(arguments[c],a)),t>0&&(l[c]={cacheItem:u,arg:arguments[c]},f?lt(n,l):n.push(l),n.length>t&&ft(n.shift())),o.wasMemoized=f,o.numArgs=c+1,a};return o.limit=t,o.wasMemoized=!1,o.cache=e,o.lru=n,o}};function lt(t,e){var n,r,o,i,a,s=t.length,u=e.length;for(r=0;r<s;r++){for(n=!0,o=0;o<u;o++)if(i=t[r][o].arg,a=e[o].arg,i!==a&&(i==i||a==a)){n=!1;break}if(n)break}t.push(t.splice(r,1)[0])}function ft(t){var e,n,r=t.length,o=t[r-1];for(o.cacheItem.delete(o.arg),n=r-2;n>=0&&(!(e=(o=t[n]).cacheItem.get(o.arg))||!e.size);n--)o.cacheItem.delete(o.arg)}var dt=e.createContext(),ht="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;var pt,gt=(pt=dt,function(t){var n=e.useContext(pt),r=e.useRef(t),o=e.useRef(),i=e.useRef(!0),a=e.useRef(),s=e.useReducer((function(t){return t+1}),0)[1];if(a.current||r.current!==t||void 0===o.current)try{o.current=t(n.getState())}catch(t){var u="An error occurred trying to map state in a useStoreState hook: "+t.message+".";throw a.current&&(u+="\nThis error may be related to the following error:\n"+a.current.stack+"\n\nOriginal stack trace:"),new Error(u)}return ht((function(){r.current=t,a.current=void 0})),ht((function(){var t=function(){try{var t=r.current(n.getState());if(t===o.current)return;o.current=t}catch(t){a.current=t}i.current&&s({})},e=n.subscribe(t);return t(),function(){i.current=!1,e()}}),[]),o.current});var mt=function(t){return function(n){return n(e.useContext(t).getActions())}}(dt);function yt(){return(yt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var vt="🙈action🙈",wt="🙈actionOn🙈",bt="🙈computedSymbol🙈",_t="🙈reducer🙈",xt="🙈thunkOn🙈",Et="🙈thunk🙈",St=function(t){return t[vt]={},t},Pt=function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object},kt=function(t,e){return t.reduce((function(t,e){return Pt(t)?t[e]:void 0}),e)},Nt=function(t,e,n){t.reduce((function(e,r,o){return o+1===t.length?e[r]=n:e[r]=e[r]||{},e[r]}),e)},Ot=function t(e,n,r){if(0===e.length)return r;var o=yt({},n),i=e[0];return 1===e.length?o[i]=r:o[i]=t(e.slice(1),o[i],r),o};function Dt(t){var e=t.disableImmer,n=t.initialState,r=t.injections,o=t.model,i=t.reducerEnhancer,a=t.references;function s(t,n,r){if(e){var o=kt(t,n),i=r(o);return o!==i?Ot(t,n,i):n}var a=F(n);return r(kt(t,a)),$(a)}var u=n,c={},l={},f={},d={},h=[],p=[],g={},m={},y=[],v={isInReducer:!1,currentState:u};!function t(e,o){return Object.keys(e).forEach((function(i){var s=e[i],m=[].concat(o,[i]),w={parent:o,path:m},b=function(){var t=kt(o,n);Nt(m,u,t&&i in t?t[i]:s)};if("function"==typeof s)if(s[vt]||s[wt]){var _=(s[vt]?"@action":"@actionOn")+"."+m.join("."),x=s[vt]||s[wt];x.actionName=i,x.type=_,x.parent=w.parent,x.path=w.path,f[_]=s;var E=function(t){var e={type:_,payload:t};return s[wt]&&x.resolvedTargets&&(t.resolvedTargets=[].concat(x.resolvedTargets)),a.dispatch(e)};E.type=_,c[_]=E,"easyPeasyReplaceState"!==i&&(s[wt]?(y.push(s),Nt(m,g,E)):Nt(m,l,E))}else if(s[Et]||s[xt]){var S=(s[Et]?"@thunk":"@thunkOn")+"."+m.join("."),P=s[Et]||s[xt];P.actionName=i,P.type=S,P.parent=w.parent,P.path=w.path;var k=function(t){var e={dispatch:a.dispatch,getState:function(){return kt(o,a.getState())},getStoreActions:function(){return l},getStoreState:a.getState,injections:r,meta:w};return s[xt]&&P.resolvedTargets&&(t.resolvedTargets=[].concat(P.resolvedTargets)),s(kt(o,l),t,e)};Nt(m,d,k);var N=S+"(start)",O=S+"(success)",D=S+"(fail)",C=function(t){var e=function(e){a.dispatch({type:D,payload:t,error:e}),a.dispatch({type:S,payload:t,error:e})},n=function(e){a.dispatch({type:O,payload:t,result:e}),a.dispatch({type:S,payload:t,result:e})};a.dispatch({type:N,payload:t});try{var r=a.dispatch((function(){return k(t)}));return"object"==typeof r&&"function"==typeof r.then?r.then((function(t){return n(t),t})).catch((function(t){throw e(t),t})):(n(r),r)}catch(t){throw e(t),t}};C.type=S,C.startType=N,C.successType=O,C.failType=D,c[S]=C,s[xt]?(y.push(s),Nt(m,g,C)):Nt(m,l,C)}else if(s[bt]){var A=kt(o,u),T=s[bt],M=ct(1)(s),j=function(t){Object.defineProperty(t,i,{configurable:!0,enumerable:!0,get:function(){var t;if(v.isInReducer)t=v.currentState;else{if(null==a.getState)return;try{t=a.getState()}catch(t){return void("production"!==process.env.NODE_ENV&&console.warn("Invalid access attempt to a computed property"))}}var e=kt(o,t),n=T.stateResolvers.map((function(n){return n(e,t)}));return M.apply(void 0,n)}})};j(A),h.push({key:i,parentPath:o,createComputedProperty:j})}else s[_t]?p.push({key:i,parentPath:o,reducer:s}):b();else if(Pt(s)){null==kt(m,u)&&Nt(m,u,{}),t(s,m)}else b()}))}(o,[]),y.forEach((function(t){var e=t[wt]||t[xt],n=e.targetResolver(kt(e.parent,l),l),r=(Array.isArray(n)?n:[n]).reduce((function(t,e){return"function"==typeof e&&e.type&&c[e.type]?t.push(e.type):"string"==typeof e&&t.push(e),t}),[]);e.resolvedTargets=r,r.forEach((function(t){var n=m[t]||[];n.push(c[e.type]),m[t]=n}))}));var w;return{actionCreatorDict:c,actionCreators:l,computedProperties:h,computedState:v,defaultState:u,listenerActionCreators:g,listenerActionMap:m,reducer:i((w=function(t,e){var n=f[e.type];return n?function(t,e,n,r){return s(r,t,(function(t){return n(t,e.payload)}))}(t,e,n,(n[vt]||n[wt]).parent):t},function(t,e){var n=w(t,e),r=p.length>0?function(t,e){return p.reduce((function(t,n){var r=n.parentPath,o=n.key,i=n.reducer;return s(r,t,(function(t){return t[o]=i(t[o],e),t}))}),t)}(n,e):n;return t!==r&&h.forEach((function(t){var e=t.parentPath;(0,t.createComputedProperty)(kt(e,r))})),r}))}}var Ct=function(t){var e=t.children,n=t.store;return i.createElement(dt.Provider,{value:n},e)};function At(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tt(){return(Tt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function Mt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function jt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mt(n,!0).forEach((function(e){At(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function zt(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function It(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Rt(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}q(!1);var Xt={value:function(){}};function Lt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new Yt(r)}function Yt(t){this._=t}function Vt(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Bt(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function Ht(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=Xt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Yt.prototype=Lt.prototype={constructor:Yt,on:function(t,e){var n,r=this._,o=Vt(t+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++i<a;)if(n=(t=o[i]).type)r[n]=Ht(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Ht(r[n],t.name,null);return this}for(;++i<a;)if((n=(t=o[i]).type)&&(n=Bt(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Yt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};var Ut="http://www.w3.org/1999/xhtml",qt={svg:"http://www.w3.org/2000/svg",xhtml:Ut,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ft(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),qt.hasOwnProperty(e)?{space:qt[e],local:t}:t}function $t(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ut&&e.documentElement.namespaceURI===Ut?e.createElement(t):e.createElementNS(n,t)}}function Gt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Wt(t){var e=Ft(t);return(e.local?Gt:$t)(e)}function Kt(){}function Zt(t){return null==t?Kt:function(){return this.querySelector(t)}}function Jt(){return[]}function Qt(t){return null==t?Jt:function(){return this.querySelectorAll(t)}}function te(t){return function(){return this.matches(t)}}function ee(t){return new Array(t.length)}function ne(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ne.prototype={constructor:ne,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var re="$";function oe(t,e,n,r,o,i){for(var a,s=0,u=e.length,c=i.length;s<c;++s)(a=e[s])?(a.__data__=i[s],r[s]=a):n[s]=new ne(t,i[s]);for(;s<u;++s)(a=e[s])&&(o[s]=a)}function ie(t,e,n,r,o,i,a){var s,u,c,l={},f=e.length,d=i.length,h=new Array(f);for(s=0;s<f;++s)(u=e[s])&&(h[s]=c=re+a.call(u,u.__data__,s,e),c in l?o[s]=u:l[c]=u);for(s=0;s<d;++s)(u=l[c=re+a.call(t,i[s],s,i)])?(r[s]=u,u.__data__=i[s],l[c]=null):n[s]=new ne(t,i[s]);for(s=0;s<f;++s)(u=e[s])&&l[h[s]]===u&&(o[s]=u)}function ae(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function se(t){return function(){this.removeAttribute(t)}}function ue(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ce(t,e){return function(){this.setAttribute(t,e)}}function le(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function fe(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function de(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function he(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function pe(t){return function(){this.style.removeProperty(t)}}function ge(t,e,n){return function(){this.style.setProperty(t,e,n)}}function me(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ye(t,e){return t.style.getPropertyValue(e)||he(t).getComputedStyle(t,null).getPropertyValue(e)}function ve(t){return function(){delete this[t]}}function we(t,e){return function(){this[t]=e}}function be(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function _e(t){return t.trim().split(/^|\s+/)}function xe(t){return t.classList||new Ee(t)}function Ee(t){this._node=t,this._names=_e(t.getAttribute("class")||"")}function Se(t,e){for(var n=xe(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function Pe(t,e){for(var n=xe(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function ke(t){return function(){Se(this,t)}}function Ne(t){return function(){Pe(this,t)}}function Oe(t,e){return function(){(e.apply(this,arguments)?Se:Pe)(this,t)}}function De(){this.textContent=""}function Ce(t){return function(){this.textContent=t}}function Ae(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Te(){this.innerHTML=""}function Me(t){return function(){this.innerHTML=t}}function je(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function ze(){this.nextSibling&&this.parentNode.appendChild(this)}function Ie(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Re(){return null}function Xe(){var t=this.parentNode;t&&t.removeChild(this)}function Le(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function Ye(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}Ee.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Ve={},Be=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(Ve={mouseenter:"mouseover",mouseleave:"mouseout"}));function He(t,e,n){return t=Ue(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function Ue(t,e,n){return function(r){var o=Be;Be=r;try{t.call(this,this.__data__,e,n)}finally{Be=o}}}function qe(t){return function(){var e=this.__on;if(e){for(var n,r=0,o=-1,i=e.length;r<i;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++o]=n:this.removeEventListener(n.type,n.listener,n.capture);++o?e.length=o:delete this.__on}}}function Fe(t,e,n){var r=Ve.hasOwnProperty(t.type)?He:Ue;return function(o,i,a){var s,u=this.__on,c=r(e,i,a);if(u)for(var l=0,f=u.length;l<f;++l)if((s=u[l]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=c,s.capture=n),void(s.value=e);this.addEventListener(t.type,c,n),s={type:t.type,name:t.name,value:e,listener:c,capture:n},u?u.push(s):this.__on=[s]}}function $e(t,e,n){var r=he(t),o=r.CustomEvent;"function"==typeof o?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function Ge(t,e){return function(){return $e(this,t,e)}}function We(t,e){return function(){return $e(this,t,e.apply(this,arguments))}}var Ke=[null];function Ze(t,e){this._groups=t,this._parents=e}function Je(){return new Ze([[document.documentElement]],Ke)}function Qe(t){return"string"==typeof t?new Ze([[document.querySelector(t)]],[document.documentElement]):new Ze([[t]],Ke)}function tn(){for(var t,e=Be;t=e.sourceEvent;)e=t;return e}function en(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}function nn(t){var e=tn();return e.changedTouches&&(e=e.changedTouches[0]),en(t,e)}function rn(t,e,n){arguments.length<3&&(n=e,e=tn().changedTouches);for(var r,o=0,i=e?e.length:0;o<i;++o)if((r=e[o]).identifier===n)return en(t,r);return null}function on(){Be.preventDefault(),Be.stopImmediatePropagation()}function an(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function sn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function un(){}Ze.prototype=Je.prototype={constructor:Ze,select:function(t){"function"!=typeof t&&(t=Zt(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a,s=e[o],u=s.length,c=r[o]=new Array(u),l=0;l<u;++l)(i=s[l])&&(a=t.call(i,i.__data__,l,s))&&("__data__"in i&&(a.__data__=i.__data__),c[l]=a);return new Ze(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=Qt(t));for(var e=this._groups,n=e.length,r=[],o=[],i=0;i<n;++i)for(var a,s=e[i],u=s.length,c=0;c<u;++c)(a=s[c])&&(r.push(t.call(a,a.__data__,c,s)),o.push(a));return new Ze(r,o)},filter:function(t){"function"!=typeof t&&(t=te(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],s=a.length,u=r[o]=[],c=0;c<s;++c)(i=a[c])&&t.call(i,i.__data__,c,a)&&u.push(i);return new Ze(r,this._parents)},data:function(t,e){if(!t)return p=new Array(this.size()),l=-1,this.each((function(t){p[++l]=t})),p;var n,r=e?ie:oe,o=this._parents,i=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=i.length,s=new Array(a),u=new Array(a),c=new Array(a),l=0;l<a;++l){var f=o[l],d=i[l],h=d.length,p=t.call(f,f&&f.__data__,l,o),g=p.length,m=u[l]=new Array(g),y=s[l]=new Array(g);r(f,d,m,y,c[l]=new Array(h),p,e);for(var v,w,b=0,_=0;b<g;++b)if(v=m[b]){for(b>=_&&(_=b+1);!(w=y[_])&&++_<g;);v._next=w||null}}return(s=new Ze(s,o))._enter=u,s._exit=c,s},enter:function(){return new Ze(this._enter||this._groups.map(ee),this._parents)},exit:function(){return new Ze(this._exit||this._groups.map(ee),this._parents)},join:function(t,e,n){var r=this.enter(),o=this,i=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(o=e(o)),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var u,c=e[s],l=n[s],f=c.length,d=a[s]=new Array(f),h=0;h<f;++h)(u=c[h]||l[h])&&(d[h]=u);for(;s<r;++s)a[s]=e[s];return new Ze(a,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,o=t[e],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ae);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,s=n[i],u=s.length,c=o[i]=new Array(u),l=0;l<u;++l)(a=s[l])&&(c[l]=a);c.sort(e)}return new Ze(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o,i=e[n],a=0,s=i.length;a<s;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this},attr:function(t,e){var n=Ft(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?ue:se:"function"==typeof e?n.local?de:fe:n.local?le:ce)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?pe:"function"==typeof e?me:ge)(t,e,null==n?"":n)):ye(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?ve:"function"==typeof e?be:we)(t,e)):this.node()[t]},classed:function(t,e){var n=_e(t+"");if(arguments.length<2){for(var r=xe(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?Oe:e?ke:Ne)(n,e))},text:function(t){return arguments.length?this.each(null==t?De:("function"==typeof t?Ae:Ce)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Te:("function"==typeof t?je:Me)(t)):this.node().innerHTML},raise:function(){return this.each(ze)},lower:function(){return this.each(Ie)},append:function(t){var e="function"==typeof t?t:Wt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:Wt(t),r=null==e?Re:"function"==typeof e?e:Zt(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Xe)},clone:function(t){return this.select(t?Ye:Le)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,o,i=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(s=e?Fe:qe,null==n&&(n=!1),r=0;r<a;++r)this.each(s(i[r],e,n));return this}var s=this.node().__on;if(s)for(var u,c=0,l=s.length;c<l;++c)for(r=0,u=s[c];r<a;++r)if((o=i[r]).type===u.type&&o.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?We:Ge)(t,e))}};var cn="\\s*([+-]?\\d+)\\s*",ln="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dn=/^#([0-9a-f]{3,8})$/,hn=new RegExp("^rgb\\("+[cn,cn,cn]+"\\)$"),pn=new RegExp("^rgb\\("+[fn,fn,fn]+"\\)$"),gn=new RegExp("^rgba\\("+[cn,cn,cn,ln]+"\\)$"),mn=new RegExp("^rgba\\("+[fn,fn,fn,ln]+"\\)$"),yn=new RegExp("^hsl\\("+[ln,fn,fn]+"\\)$"),vn=new RegExp("^hsla\\("+[ln,fn,fn,ln]+"\\)$"),wn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function bn(){return this.rgb().formatHex()}function _n(){return this.rgb().formatRgb()}function xn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=dn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?En(e):3===n?new kn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new kn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new kn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=hn.exec(t))?new kn(e[1],e[2],e[3],1):(e=pn.exec(t))?new kn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gn.exec(t))?Sn(e[1],e[2],e[3],e[4]):(e=mn.exec(t))?Sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=yn.exec(t))?Cn(e[1],e[2]/100,e[3]/100,1):(e=vn.exec(t))?Cn(e[1],e[2]/100,e[3]/100,e[4]):wn.hasOwnProperty(t)?En(wn[t]):"transparent"===t?new kn(NaN,NaN,NaN,0):null}function En(t){return new kn(t>>16&255,t>>8&255,255&t,1)}function Sn(t,e,n,r){return r<=0&&(t=e=n=NaN),new kn(t,e,n,r)}function Pn(t,e,n,r){return 1===arguments.length?((o=t)instanceof un||(o=xn(o)),o?new kn((o=o.rgb()).r,o.g,o.b,o.opacity):new kn):new kn(t,e,n,null==r?1:r);var o}function kn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Nn(){return"#"+Dn(this.r)+Dn(this.g)+Dn(this.b)}function On(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Dn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Cn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Tn(t,e,n,r)}function An(t){if(t instanceof Tn)return new Tn(t.h,t.s,t.l,t.opacity);if(t instanceof un||(t=xn(t)),!t)return new Tn;if(t instanceof Tn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,s=i-o,u=(i+o)/2;return s?(a=e===i?(n-r)/s+6*(n<r):n===i?(r-e)/s+2:(e-n)/s+4,s/=u<.5?i+o:2-i-o,a*=60):s=u>0&&u<1?0:a,new Tn(a,s,u,t.opacity)}function Tn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Mn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function jn(t){return function(){return t}}function zn(t){return 1==(t=+t)?In:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):jn(isNaN(e)?n:e)}}function In(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):jn(isNaN(t)?e:t)}an(un,xn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:bn,formatHex:bn,formatHsl:function(){return An(this).formatHsl()},formatRgb:_n,toString:_n}),an(kn,Pn,sn(un,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new kn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new kn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Nn,formatHex:Nn,formatRgb:On,toString:On})),an(Tn,(function(t,e,n,r){return 1===arguments.length?An(t):new Tn(t,e,n,null==r?1:r)}),sn(un,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Tn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Tn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new kn(Mn(t>=240?t-240:t+120,o,r),Mn(t,o,r),Mn(t<120?t+240:t-120,o,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Rn=function t(e){var n=zn(e);function r(t,e){var r=n((t=Pn(t)).r,(e=Pn(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=In(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Xn(t,e){return e-=t=+t,function(n){return t+e*n}}var Ln=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yn=new RegExp(Ln.source,"g");function Vn(t,e){var n,r,o,i=Ln.lastIndex=Yn.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=Ln.exec(t))&&(r=Yn.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Xn(n,r)})),i=Yn.lastIndex;return i<e.length&&(o=e.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})}var Bn,Hn,Un,qn,Fn=180/Math.PI,$n={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gn(t,e,n,r,o,i){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*Fn,skewX:Math.atan(u)*Fn,scaleX:a,scaleY:s}}function Wn(t,e,n,r){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var s=[],u=[];return i=t(i),a=t(a),function(t,r,o,i,a,s){if(t!==o||r!==i){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:Xn(t,o)},{i:u-2,x:Xn(r,i)})}else(o||i)&&a.push("translate("+o+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,u),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:Xn(t,e)})):e&&n.push(o(n)+"rotate("+e+r)}(i.rotate,a.rotate,s,u),function(t,e,n,i){t!==e?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:Xn(t,e)}):e&&n.push(o(n)+"skewX("+e+r)}(i.skewX,a.skewX,s,u),function(t,e,n,r,i,a){if(t!==n||e!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Xn(t,n)},{i:s-2,x:Xn(e,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,u),i=a=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var Kn=Wn((function(t){return"none"===t?$n:(Bn||(Bn=document.createElement("DIV"),Hn=document.documentElement,Un=document.defaultView),Bn.style.transform=t,t=Un.getComputedStyle(Hn.appendChild(Bn),null).getPropertyValue("transform"),Hn.removeChild(Bn),Gn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Zn=Wn((function(t){return null==t?$n:(qn||(qn=document.createElementNS("http://www.w3.org/2000/svg","g")),qn.setAttribute("transform",t),(t=qn.transform.baseVal.consolidate())?Gn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):$n)}),", ",")",")"),Jn=Math.SQRT2,Qn=2,tr=4,er=1e-12;function nr(t){return((t=Math.exp(t))+1/t)/2}function rr(t,e){var n,r,o=t[0],i=t[1],a=t[2],s=e[0],u=e[1],c=e[2],l=s-o,f=u-i,d=l*l+f*f;if(d<er)r=Math.log(c/a)/Jn,n=function(t){return[o+t*l,i+t*f,a*Math.exp(Jn*t*r)]};else{var h=Math.sqrt(d),p=(c*c-a*a+tr*d)/(2*a*Qn*h),g=(c*c-a*a-tr*d)/(2*c*Qn*h),m=Math.log(Math.sqrt(p*p+1)-p),y=Math.log(Math.sqrt(g*g+1)-g);r=(y-m)/Jn,n=function(t){var e,n=t*r,s=nr(m),u=a/(Qn*h)*(s*(e=Jn*n+m,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[o+u*l,i+u*f,a*s/nr(Jn*n+m)]}}return n.duration=1e3*r,n}var or,ir,ar=0,sr=0,ur=0,cr=1e3,lr=0,fr=0,dr=0,hr="object"==typeof performance&&performance.now?performance:Date,pr="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function gr(){return fr||(pr(mr),fr=hr.now()+dr)}function mr(){fr=0}function yr(){this._call=this._time=this._next=null}function vr(t,e,n){var r=new yr;return r.restart(t,e,n),r}function wr(){fr=(lr=hr.now())+dr,ar=sr=0;try{!function(){gr(),++ar;for(var t,e=or;e;)(t=fr-e._time)>=0&&e._call.call(null,t),e=e._next;--ar}()}finally{ar=0,function(){var t,e,n=or,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:or=e);ir=t,_r(r)}(),fr=0}}function br(){var t=hr.now(),e=t-lr;e>cr&&(dr-=e,lr=t)}function _r(t){ar||(sr&&(sr=clearTimeout(sr)),t-fr>24?(t<1/0&&(sr=setTimeout(wr,t-hr.now()-dr)),ur&&(ur=clearInterval(ur))):(ur||(lr=hr.now(),ur=setInterval(br,cr)),ar=1,pr(wr)))}function xr(t,e,n){var r=new yr;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r}yr.prototype=vr.prototype={constructor:yr,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?gr():+n)+(null==e?0:+e),this._next||ir===this||(ir?ir._next=this:or=this,ir=this),this._call=t,this._time=n,_r()},stop:function(){this._call&&(this._call=null,this._time=1/0,_r())}};var Er=Lt("start","end","cancel","interrupt"),Sr=[],Pr=0,kr=1,Nr=2,Or=3,Dr=4,Cr=5,Ar=6;function Tr(t,e,n,r,o,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,o=t.__transition;function i(u){var c,l,f,d;if(n.state!==kr)return s();for(c in o)if((d=o[c]).name===n.name){if(d.state===Or)return xr(i);d.state===Dr?(d.state=Ar,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete o[c]):+c<e&&(d.state=Ar,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete o[c])}if(xr((function(){n.state===Or&&(n.state=Dr,n.timer.restart(a,n.delay,n.time),a(u))})),n.state=Nr,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Nr){for(n.state=Or,r=new Array(f=n.tween.length),c=0,l=-1;c<f;++c)(d=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++l]=d);r.length=l+1}}function a(e){for(var o=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=Cr,1),i=-1,a=r.length;++i<a;)r[i].call(t,o);n.state===Cr&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){for(var r in n.state=Ar,n.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=n,n.timer=vr((function(t){n.state=kr,n.timer.restart(i,n.delay,n.time),n.delay<=t&&i(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:o,on:Er,tween:Sr,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Pr})}function Mr(t,e){var n=zr(t,e);if(n.state>Pr)throw new Error("too late; already scheduled");return n}function jr(t,e){var n=zr(t,e);if(n.state>Or)throw new Error("too late; already running");return n}function zr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ir(t,e){var n,r,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(n=i[o]).name===e?(r=n.state>Nr&&n.state<Cr,n.state=Ar,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete t.__transition}}function Rr(t,e){var n,r;return function(){var o=jr(this,t),i=o.tween;if(i!==n)for(var a=0,s=(r=n=i).length;a<s;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}o.tween=r}}function Xr(t,e,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=jr(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:e,value:n},u=0,c=o.length;u<c;++u)if(o[u].name===e){o[u]=s;break}u===c&&o.push(s)}i.tween=o}}function Lr(t,e,n){var r=t._id;return t.each((function(){var t=jr(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return zr(t,r).value[e]}}function Yr(t,e){var n;return("number"==typeof e?Xn:e instanceof xn?Rn:(n=xn(e))?(e=n,Rn):Vn)(t,e)}function Vr(t){return function(){this.removeAttribute(t)}}function Br(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Hr(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function Ur(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function qr(t,e,n){var r,o,i;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===r&&s===o?i:(o=s,i=e(r=a,u));this.removeAttribute(t)}}function Fr(t,e,n){var r,o,i;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===r&&s===o?i:(o=s,i=e(r=a,u));this.removeAttributeNS(t.space,t.local)}}function $r(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e(n))}}(t,o)),n}return o._value=e,o}function Gr(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t,e){return function(n){this.setAttribute(t,e(n))}}(t,o)),n}return o._value=e,o}function Wr(t,e){return function(){Mr(this,t).delay=+e.apply(this,arguments)}}function Kr(t,e){return e=+e,function(){Mr(this,t).delay=e}}function Zr(t,e){return function(){jr(this,t).duration=+e.apply(this,arguments)}}function Jr(t,e){return e=+e,function(){jr(this,t).duration=e}}var Qr=Je.prototype.constructor;function to(t){return function(){this.style.removeProperty(t)}}var eo=0;function no(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function ro(){return++eo}var oo=Je.prototype;no.prototype=function(t){return Je().transition(t)}.prototype={constructor:no,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Zt(t));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s,u,c=r[a],l=c.length,f=i[a]=new Array(l),d=0;d<l;++d)(s=c[d])&&(u=t.call(s,s.__data__,d,c))&&("__data__"in s&&(u.__data__=s.__data__),f[d]=u,Tr(f[d],e,n,d,f,zr(s,n)));return new no(i,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Qt(t));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var u,c=r[s],l=c.length,f=0;f<l;++f)if(u=c[f]){for(var d,h=t.call(u,u.__data__,f,c),p=zr(u,n),g=0,m=h.length;g<m;++g)(d=h[g])&&Tr(d,e,n,g,h,p);i.push(h),a.push(u)}return new no(i,a,e,n)},filter:function(t){"function"!=typeof t&&(t=te(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],s=a.length,u=r[o]=[],c=0;c<s;++c)(i=a[c])&&t.call(i,i.__data__,c,a)&&u.push(i);return new no(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var u,c=e[s],l=n[s],f=c.length,d=a[s]=new Array(f),h=0;h<f;++h)(u=c[h]||l[h])&&(d[h]=u);for(;s<r;++s)a[s]=e[s];return new no(a,this._parents,this._name,this._id)},selection:function(){return new Qr(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=ro(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],u=s.length,c=0;c<u;++c)if(a=s[c]){var l=zr(a,e);Tr(a,t,n,c,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new no(r,this._parents,t,n)},call:oo.call,nodes:oo.nodes,node:oo.node,size:oo.size,empty:oo.empty,each:oo.each,on:function(t,e){var n=this._id;return arguments.length<2?zr(this.node(),n).on.on(t):this.each(function(t,e,n){var r,o,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Mr:jr;return function(){var a=i(this,t),s=a.on;s!==r&&(o=(r=s).copy()).on(e,n),a.on=o}}(n,t,e))},attr:function(t,e){var n=Ft(t),r="transform"===n?Zn:Yr;return this.attrTween(t,"function"==typeof e?(n.local?Fr:qr)(n,r,Lr(this,"attr."+t,e)):null==e?(n.local?Br:Vr)(n):(n.local?Ur:Hr)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=Ft(t);return this.tween(n,(r.local?$r:Gr)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Kn:Yr;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var i=ye(this,t),a=(this.style.removeProperty(t),ye(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}(t,r)).on("end.style."+t,to(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,i;return function(){var a=ye(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=ye(this,t)),a===u?null:a===r&&u===o?i:(o=u,i=e(r=a,s))}}(t,r,Lr(this,"style."+t,e))).each(function(t,e){var n,r,o,i,a="style."+e,s="end."+a;return function(){var u=jr(this,t),c=u.on,l=null==u.value[a]?i||(i=to(e)):void 0;c===n&&o===l||(r=(n=c).copy()).on(s,o=l),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,i=n+"";return function(){var a=ye(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&function(t,e,n){return function(r){this.style.setProperty(t,e(r),n)}}(t,i,n)),r}return i._value=e,i}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Lr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,o=zr(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===t)return r.value;return null}return this.each((null==e?Rr:Xr)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Wr:Kr)(e,t)):zr(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Zr:Jr)(e,t)):zr(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){jr(this,t).ease=e}}(e,t)):zr(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var s={value:a},u={value:function(){0==--o&&i()}};n.each((function(){var n=jr(this,r),o=n.on;o!==t&&((e=(t=o).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e}))}))}};var io={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function ao(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return io.time=gr(),io;return n}function so(t){return function(){return t}}function uo(t,e,n){this.target=t,this.type=e,this.transform=n}function co(t,e,n){this.k=t,this.x=e,this.y=n}Je.prototype.interrupt=function(t){return this.each((function(){Ir(this,t)}))},Je.prototype.transition=function(t){var e,n;t instanceof no?(e=t._id,t=t._name):(e=ro(),(n=io).time=gr(),t=null==t?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],u=s.length,c=0;c<u;++c)(a=s[c])&&Tr(a,t,e,c,s,n||ao(a,e));return new no(r,this._parents,t,e)},co.prototype={constructor:co,scale:function(t){return 1===t?this:new co(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new co(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var lo=new co(1,0,0);function fo(){Be.stopImmediatePropagation()}function ho(){Be.preventDefault(),Be.stopImmediatePropagation()}function po(){return!Be.ctrlKey&&!Be.button}function go(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function mo(){return this.__zoom||lo}function yo(){return-Be.deltaY*(1===Be.deltaMode?.05:Be.deltaMode?1:.002)}function vo(){return navigator.maxTouchPoints||"ontouchstart"in this}function wo(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}var bo=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(o=r;0!=o--;)if(!t(e[o],n[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(i=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var a=i[o];if(!t(e[a],n[a]))return!1}return!0}return e!=e&&n!=n},_o={setOnConnect:St((function(t,e){t.onConnect=e})),setNodes:St((function(t,e){t.nodes=e})),setEdges:St((function(t,e){t.edges=e})),updateNodeData:St((function(t,e){var n=e.id,r=zt(e,["id"]);t.nodes.forEach((function(t){t.id===n&&(t.__rg=jt({},t.__rg,{},r))}))})),updateNodePos:St((function(t,e){var n=e.id,r=e.pos;t.nodes.forEach((function(t){t.id===n&&(t.__rg=jt({},t.__rg,{position:r}))}))})),setSelection:St((function(t,e){t.selectionActive=e})),setNodesSelection:St((function(t,e){var n=e.isActive,r=e.selection;if(!n)return t.nodesSelectionActive=!1,void(t.selectedElements=[]);var o=Ao(t.nodes,r,t.transform),i=Co(o);t.selection=r,t.nodesSelectionActive=!0,t.selectedNodesBbox=i,t.nodesSelectionActive=!0})),setSelectedElements:St((function(t,e){var n=Array.isArray(e)?e:[e],r=!bo(n,t.selectedElements)?n:t.selectedElements;t.selectedElements=r})),updateSelection:St((function(t,e){var n=Ao(t.nodes,e,t.transform),r=To(n,t.edges),o=[].concat(Rt(n),Rt(r)),i=!bo(o,t.selectedElements);t.selection=e,t.selectedElements=i?o:t.selectedElements})),updateTransform:St((function(t,e){t.transform=[e.x,e.y,e.k]})),updateSize:St((function(t,e){t.width=e.width,t.height=e.height})),initD3:St((function(t,e){var n=e.zoom,r=e.selection;t.d3Zoom=n,t.d3Selection=r,t.d3Initialised=!0})),setConnectionPosition:St((function(t,e){t.connectionPosition=e})),setConnectionSourceId:St((function(t,e){t.connectionSourceId=e}))},xo=function(t,e){void 0===e&&(e={});var n=e,r=n.compose,o=n.devTools,i=void 0===o||o,a=n.disableImmer,s=void 0!==a&&a,u=n.enhancers,c=void 0===u?[]:u,l=n.initialState,f=void 0===l?{}:l,d=n.injections,h=n.middleware,p=void 0===h?[]:h,g=n.mockActions,m=void 0!==g&&g,y=n.name,v=void 0===y?"EasyPeasyStore":y,w=n.reducerEnhancer,b=void 0===w?function(t){return t}:w,_=function(t){return yt({},t,{easyPeasyReplaceState:St((function(t,e){return e}))})},x=_(t),E=[],S={},P=function(t){void 0===t&&(t={}),S.internals=Dt({disableImmer:s,initialState:t,injections:d,model:x,reducerEnhancer:b,references:S})};P(f);var k=[function(t){return function(e){return function(n){return S.internals.computedState.currentState=t.getState(),S.internals.computedState.isInReducer=!0,e(n)}}},it].concat(p,[function(){return function(t){return function(e){var n=t(e);if(e&&S.internals.listenerActionMap[e.type]&&S.internals.listenerActionMap[e.type].length>0){var r=S.internals.actionCreatorDict[e.type];S.internals.listenerActionMap[e.type].forEach((function(t){t({type:r?r.type:e.type,payload:e.payload,error:e.error,result:e.result})}))}return n}}}]);m&&k.push((function(){return function(){return function(t){null!=t&&E.push(t)}}}));var N=r||(i&&"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:v}):et),O=Z(S.internals.reducer,S.internals.defaultState,N.apply(void 0,[nt.apply(void 0,k)].concat(c)));O.subscribe((function(){S.internals.computedState.isInReducer=!1})),S.dispatch=O.dispatch,S.getState=O.getState;var D=function(){Object.keys(O.dispatch).forEach((function(t){delete O.dispatch[t]})),Object.keys(S.internals.actionCreators).forEach((function(t){O.dispatch[t]=S.internals.actionCreators[t]}))};D();var C=function(t){var e=O.getState();t&&delete e[t],P(O.getState()),O.replaceReducer(S.internals.reducer),S.internals.actionCreatorDict["@action.easyPeasyReplaceState"](S.internals.defaultState),D()};return Object.assign(O,{addModel:function(t,e){x[t]&&"production"!==process.env.NODE_ENV&&(console.warn('easy-peasy: The store model already contains a model definition for "'+t+'"'),O.removeModel(t)),x[t]=e,C()},clearMockedActions:function(){E=[]},getActions:function(){return S.internals.actionCreators},getListeners:function(){return S.internals.listenerActionCreators},getMockedActions:function(){return[].concat(E)},reconfigure:function(t){x=_(t),C()},removeModel:function(t){x[t]?(delete x[t],C(t)):"production"!==process.env.NODE_ENV&&console.warn('easy-peasy: The store model does not contain a model definition for "'+t+'"')}})}(jt({width:0,height:0,transform:[0,0,1],nodes:[],edges:[],selectedElements:[],selectedNodesBbox:{x:0,y:0,width:0,height:0},d3Zoom:null,d3Selection:null,d3Initialised:!1,nodesSelectionActive:!1,selectionActive:!1,selection:{},connectionSourceId:null,connectionPosition:{x:0,y:0},onConnect:function(){}},_o)),Eo=function(t){return void 0!==t},So=function(t){return t&&t.target&&["INPUT","SELECT","TEXTAREA"].includes(t.target.nodeName)},Po=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{width:t.offsetWidth,height:t.offsetHeight}},ko=function(t){return t.source&&t.target},No=function(t){return!t.source&&!t.target};var Oo=function(t,e){var n=t.x,r=t.y;return{x:(n-e[0])*(1/[e[2]]),y:(r-e[1])*(1/[e[2]])}},Do=function(t,e){if(!t.id)throw new Error("All elements (nodes and edges) need to have an id.");return ko(t)?jt({},t,{id:t.id.toString(),type:t.type||"default"}):jt({},t,{id:t.id.toString(),type:t.type||"default",__rg:{position:Oo(t.position,e),width:null,height:null,handleBounds:{}}})},Co=function(t){var e=t.reduce((function(t,e){var n=e.__rg.position,r=n.x+e.__rg.width,o=n.y+e.__rg.height;return n.x<t.minX&&(t.minX=n.x),r>t.maxX&&(t.maxX=r),n.y<t.minY&&(t.minY=n.y),o>t.maxY&&(t.maxY=o),t}),{minX:Number.MAX_VALUE,minY:Number.MAX_VALUE,maxX:0,maxY:0});return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}},Ao=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,1],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.filter((function(t){var o=(e.x-n[0])*(1/n[2]),i=(e.y-n[1])*(1/n[2]),a=e.width*(1/n[2]),s=e.height*(1/n[2]),u=t.__rg,c=u.position,l=u.width,f=u.height,d=r?-l:l,h=r?0:f,p=r?l:0,g=r?f:0;return c.x+p>o&&c.x+d<o+a&&c.y+g>i&&c.y+h<i+s}))},To=function(t,e){var n=t.map((function(t){return t.id}));return e.filter((function(t){var e=t.source.includes("__"),r=t.target.includes("__"),o=e?t.source.split("__")[0]:t.source,i=r?t.target.split("__")[0]:t.target;return n.includes(o)||n.includes(i)}))},Mo=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.padding,n=void 0===e?0:e,r=xo.getState(),o=Co(r.nodes),i=Math.max(o.width,o.height),a=Math.min(r.width,r.height)/(i+i*n),s=o.x+o.width/2,u=o.y+o.height/2,c=[r.width/2-s*a,r.height/2-u*a],l=lo.translate(c[0],c[1]).scale(a);r.d3Selection.call(r.d3Zoom.transform,l)},jo=function(){var t=xo.getState();t.d3Zoom.scaleTo(t.d3Selection,t.transform[2]+.2)},zo=function(){var t=xo.getState();t.d3Zoom.scaleTo(t.d3Selection,t.transform[2]-.2)};var Io=e.memo((function(t){var e=gt((function(t){return{nodes:t.nodes,transform:t.transform,selectedElements:t.selectedElements}})),n=e.transform,r=e.nodes,o={transform:"translate(".concat(n[0],"px,").concat(n[1],"px) scale(").concat(n[2],")")};return i.createElement("div",{className:"react-flow__nodes",style:o},r.map((function(n){return function(t,e,n){var r=t.type||"default";e.nodeTypes[r]||console.warn('No node type found for type "'.concat(r,'". Using fallback type "default".'));var o=e.nodeTypes[r]||e.nodeTypes.default,a=n.selectedElements.filter(No).map((function(t){return t.id})).includes(t.id);return i.createElement(o,{key:t.id,id:t.id,type:t.type,data:t.data,xPos:t.__rg.position.x,yPos:t.__rg.position.y,onClick:e.onElementClick,onNodeDragStop:e.onNodeDragStop,transform:n.transform,selected:a,style:t.style})}(n,t,e)})))}));function Ro(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Xo(t,e){return t(e={exports:{}},e.exports),e.exports}Io.displayName="NodeRenderer",Io.whyDidYouRender=!1;var Lo=Xo((function(t){
|
|
/*!
|
|
Copyright (c) 2017 Jed Watson.
|
|
Licensed under the MIT License (MIT), see
|
|
http://jedwatson.github.io/classnames
|
|
*/
|
|
!function(){var e={}.hasOwnProperty;function n(){for(var t=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)t.push(o);else if(Array.isArray(o)&&o.length){var a=n.apply(null,o);a&&t.push(a)}else if("object"===i)for(var s in o)e.call(o,s)&&o[s]&&t.push(s)}}return t.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n}()})),Yo=function(t){var n=It(e.useState(null),2),r=n[0],o=n[1],a=t.connectionSourceId.includes("__"),s=t.connectionSourceId.split("__"),u=s[0],c=a?s[1]:null;if(e.useEffect((function(){o(t.nodes.find((function(t){return t.id===u})))}),[]),!r)return null;var l=t.connectionLineStyle||{},f=Lo("react-flow__edge","connection",t.className),d=c?r.__rg.handleBounds.source.find((function(t){return t.id===c})):r.__rg.handleBounds.source[0],h=d?d.x+d.width/2:r.__rg.width/2,p=d?d.y+d.height/2:r.__rg.height,g=r.__rg.position.x+h,m=r.__rg.position.y+p,y=(t.connectionPositionX-t.transform[0])*(1/t.transform[2]),v=(t.connectionPositionY-t.transform[1])*(1/t.transform[2]),w="";if("bezier"===t.connectionLineType){var b=Math.abs(v-m)/2,_=v<m?v+b:v-b;w="M".concat(g,",").concat(m," C").concat(g,",").concat(_," ").concat(y,",").concat(_," ").concat(y,",").concat(v)}else w="M".concat(g,",").concat(m," ").concat(y,",").concat(v);return i.createElement("g",{className:f},i.createElement("path",Tt({d:w},l)))};function Vo(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!n)switch(t){case"top":return{x:e.__rg.width/2,y:0};case"right":return{x:e.__rg.width,y:e.__rg.height/2};case"bottom":return{x:e.__rg.width/2,y:e.__rg.height};case"left":return{x:0,y:e.__rg.height/2}}switch(t){case"top":return{x:n.x+n.width/2,y:n.y};case"right":return{x:n.x+n.width,y:n.y+n.height/2};case"bottom":return{x:n.x+n.width/2,y:n.y+n.height};case"left":return{x:n.x,y:n.y+n.height/2}}}function Bo(t,e){var n=null;return t?(1!==t.length&&e?e&&(n=t.find((function(t){return t.id===e}))):n=t[0],n):null}function Ho(t,e,n){var r=t.type||"default",o=t.source.includes("__"),a=t.target.includes("__"),s=o?t.source.split("__")[0]:t.source,u=a?t.target.split("__")[0]:t.target,c=o?t.source.split("__")[1]:null,l=a?t.target.split("__")[1]:null,f=n.nodes.find((function(t){return t.id===s})),d=n.nodes.find((function(t){return t.id===u}));if(!f)throw new Error("couldn't create edge for source id: ".concat(s));if(!d)throw new Error("couldn't create edge for target id: ".concat(u));var h=e.edgeTypes[r]||e.edgeTypes.default,p=Bo(f.__rg.handleBounds.source,c),g=Bo(d.__rg.handleBounds.target,l),m=p?p.position:"bottom",y=g?g.position:"top",v=function(t){var e=t.sourceNode,n=t.sourceHandle,r=t.sourcePosition,o=t.targetNode,i=t.targetHandle,a=t.targetPosition,s=Vo(r,e,n),u=e.__rg.position.x+s.x,c=e.__rg.position.y+s.y,l=Vo(a,o,i);return{sourceX:u,sourceY:c,targetX:o.__rg.position.x+l.x,targetY:o.__rg.position.y+l.y}}({sourceNode:f,sourceHandle:p,sourcePosition:m,targetNode:d,targetHandle:g,targetPosition:y}),w=v.sourceX,b=v.sourceY,_=v.targetX,x=v.targetY,E=n.selectedElements.filter(ko).find((function(t){return t.source===s&&t.target===u}));return i.createElement(h,{key:t.id,id:t.id,type:t.type,onClick:e.onElementClick,selected:E,animated:t.animated,style:t.style,source:s,target:u,sourceHandleId:c,targetHandleId:l,sourceX:w,sourceY:b,targetX:_,targetY:x,sourcePosition:m,targetPosition:y})}var Uo=e.memo((function(t){var e=gt((function(t){return{nodes:t.nodes,edges:t.edges,transform:t.transform,selectedElements:t.selectedElements,connectionSourceId:t.connectionSourceId,position:t.connectionPosition}})),n=t.width,r=t.height,o=t.connectionLineStyle,a=t.connectionLineType;if(!n)return null;var s=e.transform,u=e.edges,c=e.nodes,l=e.connectionSourceId,f=e.position,d="translate(".concat(s[0],",").concat(s[1],") scale(").concat(s[2],")");return i.createElement("svg",{width:n,height:r,className:"react-flow__edges"},i.createElement("g",{transform:d},u.map((function(n){return Ho(n,t,e)})),l&&i.createElement(Yo,{nodes:c,connectionSourceId:l,connectionPositionX:f.x,connectionPositionY:f.y,transform:s,connectionLineStyle:o,connectionLineType:a})))}));Uo.displayName="EdgeRenderer";var qo={position:"absolute",top:0,left:0},Fo=e.memo((function(t){var e=t.gap,n=t.strokeColor,r=t.strokeWidth,o=t.style,a=t.className,s=gt((function(t){return t})),u=s.width,c=s.height,l=It(s.transform,3),f=l[0],d=l[1],h=l[2],p=Lo("react-flow__grid",a),g=e*h,m=f%g,y=d%g,v=Math.ceil(u/g)+1,w=Math.ceil(c/g)+1,b=Array.from({length:v},(function(t,e){return"M".concat(e*g+m," 0 V").concat(c)})),_=Array.from({length:w},(function(t,e){return"M0 ".concat(e*g+y," H").concat(u)})),x=[].concat(Rt(b),Rt(_)).join(" ");return i.createElement("svg",{width:u,height:c,style:jt({},qo,{},o),className:p},i.createElement("path",{fill:"none",stroke:n,strokeWidth:r,d:x}))}));Fo.displayName="Grid",Fo.propTypes={gap:n.number,strokeColor:n.string,strokeWidth:n.number,style:n.object,className:n.string},Fo.defaultProps={gap:24,strokeColor:"#999",strokeWidth:.1,style:{},className:null};var $o={grid:Fo},Go=e.memo((function(t){var e=t.backgroundType,n=zt(t,["backgroundType"]),r=$o[e];return i.createElement(r,n)}));Go.displayName="BackgroundRenderer",Go.propTypes={backgroundType:n.oneOf(["grid"])},Go.defaultProps={backgroundType:"grid"};var Wo={startX:0,startY:0,x:0,y:0,width:0,height:0,draw:!1};function Ko(t){var e=document.querySelector(".react-flow").getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}var Zo=e.memo((function(){var t=e.useRef(null),n=It(e.useState(Wo),2),r=n[0],o=n[1],a=mt((function(t){return t.setSelection})),s=mt((function(t){return t.updateSelection})),u=mt((function(t){return t.setNodesSelection}));return e.useEffect((function(){function e(t){var e=Ko(t);o((function(t){return jt({},t,{startX:e.x,startY:e.y,x:e.x,y:e.y,draw:!0})})),a(!0)}function n(t){o((function(e){if(!e.draw)return e;var n=Ko(t),r=n.x<e.startX,o=n.y<e.startY,i=jt({},e,{x:r?n.x:e.x,y:o?n.y:e.y,width:r?e.startX-n.x:n.x-e.startX,height:o?e.startY-n.y:n.y-e.startY});return s(i),i}))}function r(){o((function(t){return u({isActive:!0,selection:t}),a(!1),jt({},t,{draw:!1})}))}return t.current.addEventListener("mousedown",e),t.current.addEventListener("mousemove",n),t.current.addEventListener("mouseup",r),function(){t.current.removeEventListener("mousedown",e),t.current.removeEventListener("mousemove",n),t.current.removeEventListener("mouseup",r)}}),[]),i.createElement("div",{className:"react-flow__selectionpane",ref:t},(r.draw||r.fixed)&&i.createElement("div",{className:"react-flow__selection",style:{width:r.width,height:r.height,transform:"translate(".concat(r.x,"px, ").concat(r.y,"px)")}}))})),Jo=Xo((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.findInArray=function(t,e){for(let n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]},e.isFunction=function(t){return"function"==typeof t||"[object Function]"===Object.prototype.toString.call(t)},e.isNum=function(t){return"number"==typeof t&&!isNaN(t)},e.int=function(t){return parseInt(t,10)},e.dontSetMe=function(t,e,n){if(t[e])return new Error(`Invalid prop ${e} passed to ${n} - do not set this, set it on the child.`)}}));Ro(Jo);Jo.findInArray,Jo.isFunction,Jo.isNum,Jo.dontSetMe;var Qo=Xo((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getPrefix=r,e.browserPrefixToKey=o,e.browserPrefixToStyle=function(t,e){return e?`-${e.toLowerCase()}-${t}`:t},e.default=void 0;const n=["Moz","Webkit","O","ms"];function r(t="transform"){if("undefined"==typeof window||void 0===window.document)return"";const e=window.document.documentElement.style;if(t in e)return"";for(let r=0;r<n.length;r++)if(o(t,n[r])in e)return n[r];return""}function o(t,e){return e?`${e}${function(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):"-"===t[r]?n=!0:e+=t[r];return e}(t)}`:t}var i=r();e.default=i}));Ro(Qo);Qo.getPrefix,Qo.browserPrefixToKey,Qo.browserPrefixToStyle;var ti=Xo((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.matchesSelector=o,e.matchesSelectorAndParentsTo=function(t,e,n){let r=t;do{if(o(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},e.addEvent=function(t,e,n){if(!t)return;t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener?t.addEventListener(e,n,!0):t["on"+e]=n},e.removeEvent=function(t,e,n){if(!t)return;t.detachEvent?t.detachEvent("on"+e,n):t.removeEventListener?t.removeEventListener(e,n,!0):t["on"+e]=null},e.outerHeight=function(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,Jo.int)(n.borderTopWidth),e+=(0,Jo.int)(n.borderBottomWidth)},e.outerWidth=function(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,Jo.int)(n.borderLeftWidth),e+=(0,Jo.int)(n.borderRightWidth)},e.innerHeight=function(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,Jo.int)(n.paddingTop),e-=(0,Jo.int)(n.paddingBottom)},e.innerWidth=function(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,Jo.int)(n.paddingLeft),e-=(0,Jo.int)(n.paddingRight)},e.offsetXYFromParent=function(t,e){const n=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),r=t.clientX+e.scrollLeft-n.left,o=t.clientY+e.scrollTop-n.top;return{x:r,y:o}},e.createCSSTransform=function(t,e){const r=i(t,e,"px");return{[(0,n.browserPrefixToKey)("transform",n.default)]:r}},e.createSVGTransform=function(t,e){return i(t,e,"")},e.getTranslation=i,e.getTouch=function(t,e){return t.targetTouches&&(0,Jo.findInArray)(t.targetTouches,t=>e===t.identifier)||t.changedTouches&&(0,Jo.findInArray)(t.changedTouches,t=>e===t.identifier)},e.getTouchIdentifier=function(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier},e.addUserSelectStyles=function(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||((e=t.createElement("style")).type="text/css",e.id="react-draggable-style-el",e.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",e.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",t.getElementsByTagName("head")[0].appendChild(e));t.body&&a(t.body,"react-draggable-transparent-selection")},e.removeUserSelectStyles=function(t){try{t&&t.body&&s(t.body,"react-draggable-transparent-selection"),t.selection?t.selection.empty():window.getSelection().removeAllRanges()}catch(t){}},e.styleHacks=function(t={}){return{touchAction:"none",...t}},e.addClassName=a,e.removeClassName=s;var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(t,n):{};r.get||r.set?Object.defineProperty(e,n,r):e[n]=t[n]}return e.default=t,e}(Qo);let r="";function o(t,e){return r||(r=(0,Jo.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(e){return(0,Jo.isFunction)(t[e])}))),!!(0,Jo.isFunction)(t[r])&&t[r](e)}function i({x:t,y:e},n,r){let o=`translate(${t}${r},${e}${r})`;if(n){o=`translate(${`${"string"==typeof n.x?n.x:n.x+r}`}, ${`${"string"==typeof n.y?n.y:n.y+r}`})`+o}return o}function a(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp(`(?:^|\\s)${e}(?!\\S)`))||(t.className+=` ${e}`)}function s(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp(`(?:^|\\s)${e}(?!\\S)`,"g"),"")}}));Ro(ti);ti.matchesSelector,ti.matchesSelectorAndParentsTo,ti.addEvent,ti.removeEvent,ti.outerHeight,ti.outerWidth,ti.innerHeight,ti.innerWidth,ti.offsetXYFromParent,ti.createCSSTransform,ti.createSVGTransform,ti.getTranslation,ti.getTouch,ti.getTouchIdentifier,ti.addUserSelectStyles,ti.removeUserSelectStyles,ti.styleHacks,ti.addClassName,ti.removeClassName;var ei=Xo((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getBoundPosition=function(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r="string"==typeof r?r:function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}(r);const i=o(t);if("string"==typeof r){const{ownerDocument:t}=i,e=t.defaultView;let n;if(!((n="parent"===r?i.parentNode:t.querySelector(r))instanceof e.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const o=e.getComputedStyle(i),a=e.getComputedStyle(n);r={left:-i.offsetLeft+(0,Jo.int)(a.paddingLeft)+(0,Jo.int)(o.marginLeft),top:-i.offsetTop+(0,Jo.int)(a.paddingTop)+(0,Jo.int)(o.marginTop),right:(0,ti.innerWidth)(n)-(0,ti.outerWidth)(i)-i.offsetLeft+(0,Jo.int)(a.paddingRight)-(0,Jo.int)(o.marginRight),bottom:(0,ti.innerHeight)(n)-(0,ti.outerHeight)(i)-i.offsetTop+(0,Jo.int)(a.paddingBottom)-(0,Jo.int)(o.marginBottom)}}(0,Jo.isNum)(r.right)&&(e=Math.min(e,r.right));(0,Jo.isNum)(r.bottom)&&(n=Math.min(n,r.bottom));(0,Jo.isNum)(r.left)&&(e=Math.max(e,r.left));(0,Jo.isNum)(r.top)&&(n=Math.max(n,r.top));return[e,n]},e.snapToGrid=function(t,e,n){const r=Math.round(e/t[0])*t[0],o=Math.round(n/t[1])*t[1];return[r,o]},e.canDragX=function(t){return"both"===t.props.axis||"x"===t.props.axis},e.canDragY=function(t){return"both"===t.props.axis||"y"===t.props.axis},e.getControlPosition=function(t,e,n){const r="number"==typeof e?(0,ti.getTouch)(t,e):null;if("number"==typeof e&&!r)return null;const i=o(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,ti.offsetXYFromParent)(r||t,a)},e.createCoreData=function(t,e,n){const r=t.state,i=!(0,Jo.isNum)(r.lastX),a=o(t);return i?{node:a,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:a,deltaX:e-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:e,y:n}},e.createDraggableData=function(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}};var n=function(t){return t&&t.__esModule?t:{default:t}}(r);function o(t){const e=n.default.findDOMNode(t);if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}}));Ro(ei);ei.getBoundPosition,ei.snapToGrid,ei.canDragX,ei.canDragY,ei.getControlPosition,ei.createCoreData,ei.createDraggableData;var ni=Xo((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(...t){process.env.DRAGGABLE_DEBUG&&console.log(...t)}}));Ro(ni);var ri=Xo((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=c(i),a=c(n),s=c(r),u=c(ni);function c(t){return t&&t.__esModule?t:{default:t}}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const f={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let d=f.mouse;class h extends o.default.Component{constructor(...t){super(...t),l(this,"state",{dragging:!1,lastX:NaN,lastY:NaN,touchIdentifier:null}),l(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&"number"==typeof t.button&&0!==t.button)return!1;const e=s.default.findDOMNode(this);if(!e||!e.ownerDocument||!e.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=e;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!(0,ti.matchesSelectorAndParentsTo)(t.target,this.props.handle,e)||this.props.cancel&&(0,ti.matchesSelectorAndParentsTo)(t.target,this.props.cancel,e))return;const r=(0,ti.getTouchIdentifier)(t);this.setState({touchIdentifier:r});const o=(0,ei.getControlPosition)(t,r,this);if(null==o)return;const{x:i,y:a}=o,c=(0,ei.createCoreData)(this,i,a);(0,u.default)("DraggableCore: handleDragStart: %j",c),(0,u.default)("calling",this.props.onStart),!1!==this.props.onStart(t,c)&&(this.props.enableUserSelectHack&&(0,ti.addUserSelectStyles)(n),this.setState({dragging:!0,lastX:i,lastY:a}),(0,ti.addEvent)(n,d.move,this.handleDrag),(0,ti.addEvent)(n,d.stop,this.handleDragStop))}),l(this,"handleDrag",t=>{"touchmove"===t.type&&t.preventDefault();const e=(0,ei.getControlPosition)(t,this.state.touchIdentifier,this);if(null==e)return;let{x:n,y:r}=e;if(Array.isArray(this.props.grid)){let t=n-this.state.lastX,e=r-this.state.lastY;if([t,e]=(0,ei.snapToGrid)(this.props.grid,t,e),!t&&!e)return;n=this.state.lastX+t,r=this.state.lastY+e}const o=(0,ei.createCoreData)(this,n,r);if((0,u.default)("DraggableCore: handleDrag: %j",o),!1!==this.props.onDrag(t,o))this.setState({lastX:n,lastY:r});else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(t){const e=document.createEvent("MouseEvents");e.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}}),l(this,"handleDragStop",t=>{if(!this.state.dragging)return;const e=(0,ei.getControlPosition)(t,this.state.touchIdentifier,this);if(null==e)return;const{x:n,y:r}=e,o=(0,ei.createCoreData)(this,n,r),i=s.default.findDOMNode(this);i&&this.props.enableUserSelectHack&&(0,ti.removeUserSelectStyles)(i.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",o),this.setState({dragging:!1,lastX:NaN,lastY:NaN}),this.props.onStop(t,o),i&&((0,u.default)("DraggableCore: Removing handlers"),(0,ti.removeEvent)(i.ownerDocument,d.move,this.handleDrag),(0,ti.removeEvent)(i.ownerDocument,d.stop,this.handleDragStop))}),l(this,"onMouseDown",t=>(d=f.mouse,this.handleDragStart(t))),l(this,"onMouseUp",t=>(d=f.mouse,this.handleDragStop(t))),l(this,"onTouchStart",t=>(d=f.touch,this.handleDragStart(t))),l(this,"onTouchEnd",t=>(d=f.touch,this.handleDragStop(t)))}componentWillUnmount(){const t=s.default.findDOMNode(this);if(t){const{ownerDocument:e}=t;(0,ti.removeEvent)(e,f.mouse.move,this.handleDrag),(0,ti.removeEvent)(e,f.touch.move,this.handleDrag),(0,ti.removeEvent)(e,f.mouse.stop,this.handleDragStop),(0,ti.removeEvent)(e,f.touch.stop,this.handleDragStop),this.props.enableUserSelectHack&&(0,ti.removeUserSelectStyles)(e)}}render(){return o.default.cloneElement(o.default.Children.only(this.props.children),{style:(0,ti.styleHacks)(this.props.children.props.style),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}e.default=h,l(h,"displayName","DraggableCore"),l(h,"propTypes",{allowAnyClick:a.default.bool,disabled:a.default.bool,enableUserSelectHack:a.default.bool,offsetParent:function(t,e){if(t[e]&&1!==t[e].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:a.default.arrayOf(a.default.number),handle:a.default.string,cancel:a.default.string,onStart:a.default.func,onDrag:a.default.func,onStop:a.default.func,onMouseDown:a.default.func,className:Jo.dontSetMe,style:Jo.dontSetMe,transform:Jo.dontSetMe}),l(h,"defaultProps",{allowAnyClick:!1,cancel:null,disabled:!1,enableUserSelectHack:!0,offsetParent:null,handle:null,grid:null,transform:null,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){}})}));Ro(ri);var oi=Xo((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=f(i),a=f(n),s=f(r),u=f(Lo),c=f(ri),l=f(ni);function f(t){return t&&t.__esModule?t:{default:t}}function d(){return(d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class p extends o.default.Component{static getDerivedStateFromProps({position:t},{prevPropsPosition:e}){return!t||e&&t.x===e.x&&t.y===e.y?null:((0,l.default)("Draggable: getDerivedStateFromProps %j",{position:t,prevPropsPosition:e}),{x:t.x,y:t.y,prevPropsPosition:{...t}})}constructor(t){super(t),h(this,"onDragStart",(t,e)=>{if((0,l.default)("Draggable: onDragStart: %j",e),!1===this.props.onStart(t,(0,ei.createDraggableData)(this,e)))return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(t,e)=>{if(!this.state.dragging)return!1;(0,l.default)("Draggable: onDrag: %j",e);const n=(0,ei.createDraggableData)(this,e),r={x:n.x,y:n.y};if(this.props.bounds){const{x:t,y:e}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[o,i]=(0,ei.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=i,r.slackX=this.state.slackX+(t-r.x),r.slackY=this.state.slackY+(e-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(t,n))return!1;this.setState(r)}),h(this,"onDragStop",(t,e)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(t,(0,ei.createDraggableData)(this,e)))return!1;(0,l.default)("Draggable: onDragStop: %j",e);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:t,y:e}=this.props.position;n.x=t,n.y=e}this.setState(n)}),this.state={dragging:!1,dragged:!1,x:t.position?t.position.x:t.defaultPosition.x,y:t.position?t.position.y:t.defaultPosition.y,prevPropsPosition:{...t.position},slackX:0,slackY:0,isElementSVG:!1},!t.position||t.onDrag||t.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&s.default.findDOMNode(this)instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}render(){const{axis:t,bounds:e,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:s,position:l,positionOffset:f,scale:h,...p}=this.props;let g={},m=null;const y=!Boolean(l)||this.state.dragging,v=l||r,w={x:(0,ei.canDragX)(this)&&y?this.state.x:v.x,y:(0,ei.canDragY)(this)&&y?this.state.y:v.y};this.state.isElementSVG?m=(0,ti.createSVGTransform)(w,f):g=(0,ti.createCSSTransform)(w,f);const b=(0,u.default)(n.props.className||"",i,{[a]:this.state.dragging,[s]:this.state.dragged});return o.default.createElement(c.default,d({},p,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),o.default.cloneElement(o.default.Children.only(n),{className:b,style:{...n.props.style,...g},transform:m}))}}e.default=p,h(p,"displayName","Draggable"),h(p,"propTypes",{...c.default.propTypes,axis:a.default.oneOf(["both","x","y","none"]),bounds:a.default.oneOfType([a.default.shape({left:a.default.number,right:a.default.number,top:a.default.number,bottom:a.default.number}),a.default.string,a.default.oneOf([!1])]),defaultClassName:a.default.string,defaultClassNameDragging:a.default.string,defaultClassNameDragged:a.default.string,defaultPosition:a.default.shape({x:a.default.number,y:a.default.number}),positionOffset:a.default.shape({x:a.default.oneOfType([a.default.number,a.default.string]),y:a.default.oneOfType([a.default.number,a.default.string])}),position:a.default.shape({x:a.default.number,y:a.default.number}),className:Jo.dontSetMe,style:Jo.dontSetMe,transform:Jo.dontSetMe}),h(p,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},position:null,scale:1})}));Ro(oi);var ii=oi.default,ai=ii,si=ii,ui=ri.default;ai.default=si,ai.DraggableCore=ui;var ci=e.memo((function(){var t=It(e.useState({x:0,y:0}),2),n=t[0],r=t[1],o=It(e.useState({}),2),a=o[0],s=o[1],u=gt((function(t){return{transform:t.transform,selectedNodesBbox:t.selectedNodesBbox,selectedElements:t.selectedElements}})),c=mt((function(t){return t.updateNodePos})),l=It(u.transform,3),f=l[0],d=l[1],h=l[2],p=u.selectedNodesBbox;return i.createElement("div",{className:"react-flow__nodesselection",style:{transform:"translate(".concat(f,"px,").concat(d,"px) scale(").concat(h,")")}},i.createElement(ai,{scale:h,onStart:function(t){var e=t.clientX*(1/h),n=t.clientY*(1/h),o=e-p.x-f,i=n-p.y-d,a=u.selectedElements.filter(No).reduce((function(t,e){var n={x:e.__rg.position.x||e.position.x,y:e.__rg.position.y||e.position.x};return t[e.id]=n,t}),{});r({x:o,y:i}),s(a)},onDrag:function(t){var e=t.clientX*(1/h),r=t.clientY*(1/h);u.selectedElements.filter(No).forEach((function(t){c({id:t.id,pos:{x:a[t.id].x+e-p.x-n.x-f,y:a[t.id].y+r-p.y-n.y-d}})}))}},i.createElement("div",{className:"react-flow__nodesselection-rect",style:{width:u.selectedNodesBbox.width,height:u.selectedNodesBbox.height,top:u.selectedNodesBbox.y,left:u.selectedNodesBbox.x}})))}));function li(t){var n=It(e.useState(!1),2),r=n[0],o=n[1];function i(e){e.keyCode!==t||So(e.target)||o(!0)}var a=function(e){e.keyCode!==t||So(e.target)||o(!1)};return e.useEffect((function(){return window.addEventListener("keydown",i),window.addEventListener("keyup",a),function(){window.removeEventListener("keydown",i),window.removeEventListener("keyup",a)}}),[]),r}var fi=function(){var t,e,n=po,r=go,o=wo,i=yo,a=vo,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,l=rr,f=Lt("start","zoom","end"),d=500,h=150,p=0;function g(t){t.property("__zoom",mo).on("wheel.zoom",x).on("mousedown.zoom",E).on("dblclick.zoom",S).filter(a).on("touchstart.zoom",P).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new co(e,t.x,t.y)}function y(t,e,n){var r=e[0]-n[0]*t.k,o=e[1]-n[1]*t.k;return r===t.x&&o===t.y?t:new co(t.k,r,o)}function v(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n){t.on("start.zoom",(function(){b(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).end()})).tween("zoom",(function(){var t=this,o=arguments,i=b(t,o),a=r.apply(t,o),s=null==n?v(a):"function"==typeof n?n.apply(t,o):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),c=t.__zoom,f="function"==typeof e?e.apply(t,o):e,d=l(c.invert(s).concat(u/c.k),f.invert(s).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=d(t),n=u/e[2];t=new co(n,s[0]-e[0]*n,s[1]-e[1]*n)}i.zoom(null,t)}}))}function b(t,e,n){return!n&&t.__zooming||new _(t,e)}function _(t,e){this.that=t,this.args=e,this.active=0,this.extent=r.apply(t,e),this.taps=0}function x(){if(n.apply(this,arguments)){var t=b(this,arguments),e=this.__zoom,r=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,i.apply(this,arguments)))),a=nn(this);if(t.wheel)t.mouse[0][0]===a[0]&&t.mouse[0][1]===a[1]||(t.mouse[1]=e.invert(t.mouse[0]=a)),clearTimeout(t.wheel);else{if(e.k===r)return;t.mouse=[a,e.invert(a)],Ir(this),t.start()}ho(),t.wheel=setTimeout((function(){t.wheel=null,t.end()}),h),t.zoom("mouse",o(y(m(e,r),t.mouse[0],t.mouse[1]),t.extent,u))}}function E(){if(!e&&n.apply(this,arguments)){var t=b(this,arguments,!0),r=Qe(Be.view).on("mousemove.zoom",(function(){if(ho(),!t.moved){var e=Be.clientX-a,n=Be.clientY-s;t.moved=e*e+n*n>p}t.zoom("mouse",o(y(t.that.__zoom,t.mouse[0]=nn(t.that),t.mouse[1]),t.extent,u))}),!0).on("mouseup.zoom",(function(){r.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,r=Qe(t).on("dragstart.drag",null);e&&(r.on("click.drag",on,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(Be.view,t.moved),ho(),t.end()}),!0),i=nn(this),a=Be.clientX,s=Be.clientY;!function(t){var e=t.document.documentElement,n=Qe(t).on("dragstart.drag",on,!0);"onselectstart"in e?n.on("selectstart.drag",on,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(Be.view),fo(),t.mouse=[i,this.__zoom.invert(i)],Ir(this),t.start()}}function S(){if(n.apply(this,arguments)){var t=this.__zoom,e=nn(this),i=t.invert(e),a=t.k*(Be.shiftKey?.5:2),s=o(y(m(t,a),e,i),r.apply(this,arguments),u);ho(),c>0?Qe(this).transition().duration(c).call(w,s,e):Qe(this).call(g.transform,s)}}function P(){if(n.apply(this,arguments)){var e,r,o,i,a=Be.touches,s=a.length,u=b(this,arguments,Be.changedTouches.length===s);for(fo(),r=0;r<s;++r)i=[i=rn(this,a,(o=a[r]).identifier),this.__zoom.invert(i),o.identifier],u.touch0?u.touch1||u.touch0[2]===i[2]||(u.touch1=i,u.taps=0):(u.touch0=i,e=!0,u.taps=1+!!t);t&&(t=clearTimeout(t)),e&&(u.taps<2&&(t=setTimeout((function(){t=null}),d)),Ir(this),u.start())}}function k(){if(this.__zooming){var e,n,r,i,a=b(this,arguments),s=Be.changedTouches,c=s.length;for(ho(),t&&(t=clearTimeout(t)),a.taps=0,e=0;e<c;++e)r=rn(this,s,(n=s[e]).identifier),a.touch0&&a.touch0[2]===n.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===n.identifier&&(a.touch1[0]=r);if(n=a.that.__zoom,a.touch1){var l=a.touch0[0],f=a.touch0[1],d=a.touch1[0],h=a.touch1[1],p=(p=d[0]-l[0])*p+(p=d[1]-l[1])*p,g=(g=h[0]-f[0])*g+(g=h[1]-f[1])*g;n=m(n,Math.sqrt(p/g)),r=[(l[0]+d[0])/2,(l[1]+d[1])/2],i=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],i=a.touch0[1]}a.zoom("touch",o(y(n,r,i),a.extent,u))}}function N(){if(this.__zooming){var t,n,r=b(this,arguments),o=Be.changedTouches,i=o.length;for(fo(),e&&clearTimeout(e),e=setTimeout((function(){e=null}),d),t=0;t<i;++t)n=o[t],r.touch0&&r.touch0[2]===n.identifier?delete r.touch0:r.touch1&&r.touch1[2]===n.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var a=Qe(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return g.transform=function(t,e,n){var r=t.selection?t.selection():t;r.property("__zoom",mo),t!==r?w(t,e,n):r.interrupt().each((function(){b(this,arguments).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},g.scaleBy=function(t,e,n){g.scaleTo(t,(function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n}),n)},g.scaleTo=function(t,e,n){g.transform(t,(function(){var t=r.apply(this,arguments),i=this.__zoom,a=null==n?v(t):"function"==typeof n?n.apply(this,arguments):n,s=i.invert(a),c="function"==typeof e?e.apply(this,arguments):e;return o(y(m(i,c),a,s),t,u)}),n)},g.translateBy=function(t,e,n){g.transform(t,(function(){return o(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),u)}))},g.translateTo=function(t,e,n,i){g.transform(t,(function(){var t=r.apply(this,arguments),a=this.__zoom,s=null==i?v(t):"function"==typeof i?i.apply(this,arguments):i;return o(lo.translate(s[0],s[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,u)}),i)},_.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){!function(t,e,n,r){var o=Be;t.sourceEvent=Be,Be=t;try{e.apply(n,r)}finally{Be=o}}(new uo(g,t,this.that.__zoom),f.apply,f,[t,this.that,this.args])}},g.wheelDelta=function(t){return arguments.length?(i="function"==typeof t?t:so(+t),g):i},g.filter=function(t){return arguments.length?(n="function"==typeof t?t:so(!!t),g):n},g.touchable=function(t){return arguments.length?(a="function"==typeof t?t:so(!!t),g):a},g.extent=function(t){return arguments.length?(r="function"==typeof t?t:so([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):r},g.scaleExtent=function(t){return arguments.length?(s[0]=+t[0],s[1]=+t[1],g):[s[0],s[1]]},g.translateExtent=function(t){return arguments.length?(u[0][0]=+t[0][0],u[1][0]=+t[1][0],u[0][1]=+t[0][1],u[1][1]=+t[1][1],g):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},g.constrain=function(t){return arguments.length?(o=t,g):o},g.duration=function(t){return arguments.length?(c=+t,g):c},g.interpolate=function(t){return arguments.length?(l=t,g):l},g.on=function(){var t=f.on.apply(f,arguments);return t===f?g:t},g.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,g):Math.sqrt(p)},g}().scaleExtent([.5,2]).filter((function(){return!Be.button}));var di=e.memo((function(t){var n=t.nodeTypes,r=t.edgeTypes,o=t.onMove,a=t.onLoad,s=t.onElementClick,u=t.onNodeDragStop,c=t.connectionLineType,l=t.connectionLineStyle,f=t.selectionKeyCode,d=t.onElementsRemove,h=t.deleteKeyCode,p=t.elements,g=t.showBackground,m=t.backgroundGap,y=t.backgroundColor,v=t.backgroundType,w=t.onConnect,b=e.useRef(),_=e.useRef(),x=gt((function(t){return{width:t.width,height:t.height,nodes:t.nodes,edges:t.edges,d3Initialised:t.d3Initialised,nodesSelectionActive:t.nodesSelectionActive}})),E=mt((function(t){return t.updateSize})),S=mt((function(t){return t.setNodesSelection})),P=mt((function(t){return t.setOnConnect})),k=li(f),N=function(){var t=Po(_.current);E(t)};return e.useEffect((function(){return N(),P(w),window.onresize=N,function(){window.onresize=null}}),[]),function(t,n,r){var o=gt((function(t){return{transform:t.transform,d3Selection:t.d3Selection,d3Zoom:t.d3Zoom,edges:t.edged,d3Initialised:t.d3Initialised,nodesSelectionActive:t.nodesSelectionActive}})),i=mt((function(t){return t.initD3})),a=mt((function(t){return t.updateTransform}));e.useEffect((function(){var e=Qe(t.current).call(fi);i({zoom:fi,selection:e})}),[]),e.useEffect((function(){if(r)fi.on("zoom",null);else if(fi.on("zoom",(function(){if(Be.sourceEvent&&Be.sourceEvent.target!==t.current)return!1;a(Be.transform),n()})),o.d3Selection){var e=lo.translate(o.transform[0],o.transform[1]).scale(o.transform[2]);o.d3Selection.call(o.d3Zoom.transform,e)}return function(){fi.on("zoom",null)}}),[r])}(b,o,k),e.useEffect((function(){x.d3Initialised&&a({fitView:Mo,zoomIn:jo,zoomOut:zo})}),[x.d3Initialised]),function(t){var n=t.deleteKeyCode,r=t.onElementsRemove,o=gt((function(t){return{selectedElements:t.selectedElements,edges:t.edges}})),i=mt((function(t){return t.setNodesSelection})),a=li(n);e.useEffect((function(){if(a&&o.selectedElements.length){var t=o.selectedElements;if(1===o.selectedElements.length&&!ko(o.selectedElements[0])){var e=To(o.selectedElements,o.edges);t=[].concat(Rt(o.selectedElements),Rt(e))}r(t),i({isActive:!1})}}),[a])}({onElementsRemove:d,deleteKeyCode:h}),function(t){var n=t.elements,r=gt((function(t){return{nodes:t.nodes,edges:t.edges,transform:t.transform}})),o=mt((function(t){return t.setNodes})),i=mt((function(t){return t.setEdges}));e.useEffect((function(){var t=n.filter(No),e=n.filter(ko).map(Do),a=t.map((function(t){var e=r.nodes.find((function(e){return e.id===t.id}));if(e){var n=bo(e.data,t.data)?e.data:jt({},e.data,{},t.data);return jt({},e,{data:n})}return Do(t,r.transform)})),s=!bo(r.nodes,a),u=!bo(r.edges,e);s&&o(a),u&&i(e)}))}({elements:p}),i.createElement("div",{className:"react-flow__renderer",ref:_},g&&i.createElement(Go,{gap:m,strokeColor:y,backgroundType:v}),i.createElement(Io,{nodeTypes:n,onElementClick:s,onNodeDragStop:u}),i.createElement(Uo,{width:x.width,height:x.height,edgeTypes:r,onElementClick:s,connectionLineType:c,connectionLineStyle:l}),k&&i.createElement(Zo,null),x.nodesSelectionActive&&i.createElement(ci,null),i.createElement("div",{className:"react-flow__zoompane",onClick:function(){return S({isActive:!1})},ref:b}))}));di.displayName="GraphView";var hi=e.memo((function(t){var e=t.type,n=t.nodeId,r=t.onConnect,o=t.position,a=t.setSourceId,s=t.setPosition,u=t.className,c=t.id,l=void 0!==c&&c,f=t.isValidConnection,d=zt(t,["type","nodeId","onConnect","position","setSourceId","setPosition","className","id","isValidConnection"]),h="target"===e,p=Lo("react-flow__handle",u,o,{source:!h,target:h}),g=l?"".concat(n,"__").concat(l):n;return i.createElement("div",Tt({"data-nodeid":g,"data-handlepos":o,className:p,onMouseDown:function(t){return function(t,e){var n=e.nodeId,r=e.setSourceId,o=e.setPosition,i=e.onConnect,a=e.isTarget,s=e.isValidConnection,u=document.querySelector(".react-flow").getBoundingClientRect(),c=null;function l(){c&&(c.classList.remove("valid"),c.classList.remove("connecting"))}function f(t){var e=document.elementFromPoint(t.clientX,t.clientY),r={elementBelow:e,isValid:!1,connection:null,isHoveringHandle:!1};if(e&&(e.classList.contains("target")||e.classList.contains("source"))){var o=null;if(a){o={source:e.getAttribute("data-nodeid"),target:n}}else{var i=e.getAttribute("data-nodeid");o={source:n,target:i}}var u=s(o);r.connection=o,r.isValid=u,r.isHoveringHandle=!0}return r}function d(t){o({x:t.clientX-u.x,y:t.clientY-u.y});var e=f(t),n=e.connection,r=e.elementBelow,i=e.isValid;if(!e.isHoveringHandle)return l();n.source===n.target||(c=r,r.classList.add("connecting"),r.classList.toggle("valid",i))}o({x:t.clientX-u.x,y:t.clientY-u.y}),r(n),document.addEventListener("mousemove",d),document.addEventListener("mouseup",(function t(e){var n=f(e),o=n.connection;n.isValid&&i(o),l(),r(null),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",t)}))}(t,{nodeId:g,setSourceId:a,setPosition:s,onConnect:r,isTarget:h,isValidConnection:f})}},d))}));hi.displayName="BaseHandle",hi.whyDidYouRender=!1;var pi=e.createContext(null),gi=pi.Provider;pi.Consumer;gi.displayName="NodeIdProvider";var mi=e.memo((function(t){var n=t.onConnect,r=zt(t,["onConnect"]),o=e.useContext(pi),a=mt((function(t){return{setPosition:t.setConnectionPosition,setSourceId:t.setConnectionSourceId}})),s=a.setPosition,u=a.setSourceId,c=gt((function(t){return t.onConnect}));return i.createElement(hi,Tt({nodeId:o,setPosition:s,setSourceId:u,onConnect:function(t){c(t),n(t)}},r))}));mi.displayName="Handle",mi.propTypes={type:n.oneOf(["source","target"]),position:n.oneOf(["top","right","bottom","left"]),onConnect:n.func,isValidConnection:n.func},mi.defaultProps={type:"source",position:"top",onConnect:function(){},isValidConnection:function(){return!0}};var yi={background:"#ff6060",padding:10,borderRadius:5,width:150},vi=function(t){var e=t.data,n=t.style;return i.createElement("div",{style:jt({},yi,{},n)},i.createElement(mi,{type:"target",position:"top"}),e.label,i.createElement(mi,{type:"source",position:"bottom"}))},wi={background:"#9999ff",padding:10,borderRadius:5,width:150},bi=function(t){var e=t.data,n=t.style;return i.createElement("div",{style:jt({},wi,{},n)},e.label,i.createElement(mi,{type:"source",position:"bottom"}))},_i={background:"#55dd99",padding:10,borderRadius:5,width:150},xi=function(t){var e=t.data,n=t.style;return i.createElement("div",{style:jt({},_i,{},n)},i.createElement(mi,{type:"target",position:"top"}),e.label)},Ei=!!window.ResizeObserver,Si=function(t,e,n,r){var o=e.querySelectorAll(t);return o&&o.length?[].map.call(o,(function(t){var e=t.getBoundingClientRect(),o=Po(t),i=t.getAttribute("data-nodeid"),a=t.getAttribute("data-handlepos"),s=i.split("__"),u=null;return s&&(u=s.length?s[1]:s),jt({id:u,position:a,x:(e.x-n.x)*(1/r),y:(e.y-n.y)*(1/r)},o)})):null},Pi=function(t){var n=e.memo((function(n){var r=e.useRef(null),o=It(e.useState({x:0,y:0}),2),a=o[0],s=o[1],u=It(e.useState(!1),2),c=u[0],l=u[1],f=n.id,d=n.type,h=n.data,p=n.transform,g=n.xPos,m=n.yPos,y=n.selected,v=n.onClick,w=n.onNodeDragStop,b=n.style,_={x:g,y:m},x=Lo("react-flow__node",{selected:y}),E={zIndex:y?10:3,transform:"translate(".concat(g,"px,").concat(m,"px)")},S=function(){var t=xo.getState(),e=r.current.getBoundingClientRect(),n=Po(r.current),o={source:Si(".source",r.current,e,t.transform[2]),target:Si(".target",r.current,e,t.transform[2])};xo.dispatch.updateNodeData(jt({id:f},n,{handleBounds:o}))};return e.useEffect((function(){S();var t=null;return Ei&&(t=new ResizeObserver((function(t){var e=!0,n=!1,r=void 0;try{for(var o,i=t[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){o.value;S()}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}}))).observe(r.current),function(){Ei&&t&&t.unobserve(r.current)}}),[]),i.createElement(ai.DraggableCore,{onStart:function(t){return function(t,e){var n,r=e.setOffset,o=e.onClick,i=e.id,a=e.type,s=e.data,u=e.position,c=e.transform;if(So(t)||(n=t).target.className&&n.target.className.includes&&(n.target.className.includes("source")||n.target.className.includes("target")))return!1;var l=t.clientX*(1/[c[2]]),f=t.clientY*(1/[c[2]]),d=l-u.x-c[0],h=f-u.y-c[1],p={id:i,type:a,position:u,data:s};xo.dispatch.setSelectedElements({id:i,type:a}),r({x:d,y:h}),o(p)}(t,{onClick:v,id:f,type:d,data:h,setOffset:s,transform:p,position:_})},onDrag:function(t){return function(t,e){var n=e.setDragging,r=e.id,o=e.offset,i=e.transform,a=t.clientX*(1/i[2]),s=t.clientY*(1/i[2]);n(!0),xo.dispatch.updateNodePos({id:r,pos:{x:a-i[0]-o.x,y:s-i[1]-o.y}})}(t,{setDragging:l,id:f,offset:a,transform:p})},onStop:function(){return function(t){var e=t.onNodeDragStop,n=t.setDragging,r=t.isDragging,o=t.id,i=t.type,a=t.position,s=t.data;if(!r)return!1;n(!1),e({id:o,type:i,position:a,data:s})}({onNodeDragStop:w,isDragging:c,setDragging:l,id:f,type:d,position:_,data:h})},scale:p[2]},i.createElement("div",{className:x,ref:r,style:E},i.createElement(gi,{value:f},i.createElement(t,{id:f,data:h,type:d,style:b,selected:y}))))}));return n.displayName="NodeWrapper",n.whyDidYouRender=!1,n};var ki=e.memo((function(t){var e=t.sourceX,n=t.sourceY,r=t.targetX,o=t.targetY,a=t.sourcePosition,s=t.targetPosition,u=t.style,c=void 0===u?{}:u,l=Math.abs(o-n)/2,f=o<n?o+l:o-l,d="M".concat(e,",").concat(n," C").concat(e,",").concat(f," ").concat(r,",").concat(f," ").concat(r,",").concat(o);if(["left","right"].includes(a)&&["left","right"].includes(s)){var h=Math.abs(r-e)/2,p=r<e?r+h:r-h;d="M".concat(e,",").concat(n," C").concat(p,",").concat(n," ").concat(p,",").concat(o," ").concat(r,",").concat(o)}else(["left","right"].includes(a)||["left","right"].includes(s))&&(d="M".concat(e,",").concat(n," C").concat(e,",").concat(o," ").concat(e,",").concat(o," ").concat(r,",").concat(o));return i.createElement("path",Tt({},c,{d:d}))})),Ni=e.memo((function(t){var e=t.sourceX,n=t.sourceY,r=t.targetX,o=t.targetY,a=t.style,s=void 0===a?{}:a;return i.createElement("path",Tt({},s,{d:"M ".concat(e,",").concat(n,"L ").concat(r,",").concat(o)}))})),Oi=e.memo((function(t){var e=t.sourceX,n=t.sourceY,r=t.targetX,o=t.targetY,a=t.style,s=void 0===a?{}:a,u=Math.abs(o-n)/2,c=o<n?o+u:o-u;return i.createElement("path",Tt({},s,{d:"M ".concat(e,",").concat(n,"L ").concat(e,",").concat(c,"L ").concat(r,",").concat(c,"L ").concat(r,",").concat(o)}))})),Di=function(t){var n=e.memo((function(e){var n=e.id,r=e.source,o=e.target,a=e.type,s=e.animated,u=e.selected,c=e.onClick,l=Lo("react-flow__edge",{selected:u,animated:s});return i.createElement("g",{className:l,onClick:function(t){if(So(t))return!1;xo.dispatch.setSelectedElements({id:n,source:r,target:o}),c({id:n,source:r,target:o,type:a})}},i.createElement(t,e))}));return n.displayName="EdgeWrapper",n.whyDidYouRender=!1,n};"production"!==process.env.NODE_ENV&&require("@welldone-software/why-did-you-render")(i);var Ci=function(t){var n=t.style,r=t.onElementClick,o=t.elements,a=t.children,s=t.nodeTypes,u=t.edgeTypes,c=t.onLoad,l=t.onMove,f=t.onElementsRemove,d=t.onConnect,h=t.onNodeDragStop,p=t.connectionLineType,g=t.connectionLineStyle,m=t.deleteKeyCode,y=t.selectionKeyCode,v=t.showBackground,w=t.backgroundGap,b=t.backgroundType,_=t.backgroundColor,x=e.useMemo((function(){return function(t){return jt({},{input:Pi(t.input||bi),default:Pi(t.default||vi),output:Pi(t.output||xi)},{},Object.keys(t).filter((function(t){return!["input","default","output"].includes(t)})).reduce((function(e,n){return e[n]=Pi(t[n]||vi),e}),{}))}(s)}),[]),E=e.useMemo((function(){return function(t){return jt({},{default:Di(t.default||ki),straight:Di(t.bezier||Ni)},{},Object.keys(t).filter((function(t){return!["default","bezier"].includes(t)})).reduce((function(e,n){return e[n]=Di(t[n]||ki),e}),{}))}(u)}),[]);return i.createElement("div",{style:n,className:"react-flow"},i.createElement(Ct,{store:xo},i.createElement(di,{onLoad:c,onMove:l,onElementClick:r,onNodeDragStop:h,nodeTypes:x,edgeTypes:E,connectionLineType:p,connectionLineStyle:g,selectionKeyCode:y,onElementsRemove:f,deleteKeyCode:m,elements:o,onConnect:d,backgroundColor:_,backgroundGap:w,showBackground:v,backgroundType:b}),a))};Ci.displayName="ReactFlow",Ci.propTypes={onElementClick:n.func,onElementsRemove:n.func,onNodeDragStop:n.func,onConnect:n.func,onLoad:n.func,onMove:n.func,nodeTypes:n.object,edgeTypes:n.object,connectionLineType:n.string,connectionLineStyle:n.object,deleteKeyCode:n.number,selectionKeyCode:n.number,gridColor:n.string,gridGap:n.number,showBackground:n.bool,backgroundType:n.oneOf(["grid"])},Ci.defaultProps={onElementClick:function(){},onElementsRemove:function(){},onNodeDragStop:function(){},onConnect:function(){},onLoad:function(){},onMove:function(){},nodeTypes:{input:bi,default:vi,output:xi},edgeTypes:{default:ki,straight:Ni,step:Oi},connectionLineType:"bezier",connectionLineStyle:{},deleteKeyCode:8,selectionKeyCode:16,backgroundColor:"#999",backgroundGap:24,showBackground:!0,backgroundType:"grid"};var Ai={position:"absolute",zIndex:5,bottom:10,right:10,width:200},Ti={position:"absolute",zIndex:5,bottom:10,left:10};t.Controls=function(t){var e=t.style,n=t.className,r=Lo("react-flow__controls",n);return i.createElement("div",{className:r,style:jt({},Ti,{},e)},i.createElement("div",{className:"react-flow__controls-button react-flow__controls-zoomin",onClick:jo},i.createElement("img",{src:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M416 277.333H277.333V416h-42.666V277.333H96v-42.666h138.667V96h42.666v138.667H416v42.666z"/></svg>'})),i.createElement("div",{className:"react-flow__controls-button react-flow__controls-zoomout",onClick:zo},i.createElement("img",{src:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M96 235h320v42H96z"/></svg>'})),i.createElement("div",{className:"react-flow__controls-button react-flow__controls-fitview",onClick:Mo},i.createElement("img",{src:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M96 124.2c0-6.9 5.2-12.2 12.2-12.2H176V64h-66.8C75.7 64 48 90.7 48 124.2V192h48v-67.8zM403.6 64H336v48h67.2c6.9 0 12.8 5.2 12.8 12.2V192h48v-67.8c0-33.5-27-60.2-60.4-60.2zM416 386.8c0 6.9-5.2 12.2-12.2 12.2H336v49h67.8c33.5 0 60.2-27.7 60.2-61.2V320h-48v66.8zM108.2 399c-6.9 0-12.2-5.2-12.2-12.2V320H48v66.8c0 33.5 27.7 61.2 61.2 61.2H176v-49h-67.8z"/></svg>'})))},t.Handle=mi,t.MiniMap=function(t){var n=t.style,r=void 0===n?{}:n,o=t.className,a=t.bgColor,s=void 0===a?"#f8f8f8":a,u=t.nodeColor,c=void 0===u?"#ddd":u,l=e.useRef(null),f=gt((function(t){return{width:t.width,height:t.height,nodes:t.nodes,transform:t.transform}})),d=Lo("react-flow__minimap",o),h=f.nodes.map((function(t){return t.__rg.position})),p=r.width||Ai.width,g=f.height/(f.width||1)*p,m={x:0,y:0,width:f.width,height:f.height},y=p/f.width,v=function(t){return!!(t&&t.constructor&&t.call&&t.apply)}(c)?c:function(){return c};return e.useEffect((function(){if(l){var t=l.current.getContext("2d"),e=Ao(f.nodes,m,f.transform,!0);t.fillStyle=s,t.fillRect(0,0,p,g),e.forEach((function(e){var n=e.__rg.position,r=f.transform[0],o=f.transform[1],i=n.x*f.transform[2]+r,a=n.y*f.transform[2]+o;t.fillStyle=v(e),t.fillRect(i*y,a*y,e.__rg.width*y*f.transform[2],e.__rg.height*y*f.transform[2])}))}}),[h,f.transform,g]),i.createElement("canvas",{style:jt({},Ai,{},r,{height:g}),width:p,height:g,className:d,ref:l})},t.addEdge=function(t,e){if(!t.source||!t.target)throw new Error("Can not create edge. An edge needs a source and a target");return e.concat(jt({},t,{id:Eo(t.id)?t.id:(n=t,"reactflow__edge-".concat(n.source,"-").concat(n.target))}));var n},t.default=Ci,t.getOutgoers=function(t,e){if(!No(t))return[];var n=e.filter((function(e){return e.source===t.id})).map((function(t){return t.target}));return e.filter((function(t){return n.includes(t.id)}))},t.isEdge=ko,t.isNode=No,t.removeElements=function(t,e){var n=t.map((function(t){return t.id}));return e.filter((function(t){return!n.includes(t.id)&&!n.includes(t.target)&&!n.includes(t.source)}))},Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
//# sourceMappingURL=ReactFlow.min.js.map
|