{"version":3,"sources":["jsdelivr-header.js","/npm/flowappplatform-appbuilder-graphs@1.4.11/node_modules/tslib/tslib.es6.js","/npm/flowappplatform-appbuilder-graphs@1.4.11/src/definitions.ts","/npm/flowappplatform-appbuilder-graphs@1.4.11/src/Port.tsx","/npm/flowappplatform-appbuilder-graphs@1.4.11/src/Connector.tsx","/npm/flowappplatform-appbuilder-graphs@1.4.11/src/utilities.ts","/npm/flowappplatform-appbuilder-graphs@1.4.11/src/Component.tsx","/npm/flowappplatform-appbuilder-graphs@1.4.11/src/Connection.tsx","/npm/flowappplatform-appbuilder-graphs@1.4.11/src/index.tsx"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,iICUI,cAAgB,SAAS,EAAG,GAI5B,OAHA,cAAgB,OAAO,gBAClB,CAAE,UAAW,cAAgB,OAAS,SAAU,EAAG,GAAK,EAAE,UAAY,CAAE,GACzE,SAAU,EAAG,GAAK,IAAK,IAAI,KAAK,EAAO,EAAE,eAAe,KAAI,EAAE,GAAK,EAAE,GAAG,EACrE,cAAc,EAAG,E,EAG5B,SAAgB,UAAU,EAAG,GAEzB,SAAS,IAAO,KAAK,YAAc,CAAE,CADrC,cAAc,EAAG,GAEjB,EAAE,UAAkB,OAAN,EAAa,OAAO,OAAO,IAAM,EAAG,UAAY,EAAE,UAAW,IAAI,E,CAGnF,IAAW,SAAW,WAQlB,OAPA,SAAW,OAAO,QAAU,SAAkB,GAC1C,IAAK,IAAI,EAAG,EAAI,EAAG,EAAI,UAAU,OAAQ,EAAI,EAAG,IAE5C,IAAK,IAAI,KADT,EAAI,UAAU,GACO,OAAO,UAAU,eAAe,KAAK,EAAG,KAAI,EAAE,GAAK,EAAE,IAE9E,OAAO,C,EAEJ,SAAS,MAAM,KAAM,U,ECnC1B,MAAQ,QAAQ,wCAChB,IAAM,QAAQ,iCACd,WAAa,QAAQ,wCACrB,QAAU,QAAQ,qCAClB,KAAO,QAAQ,kCACf,OAAS,QAAQ,oCACjB,KAAO,Q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AAmB,EAAK,kBACxB,sBAAuB,EAAK,sBAC5B,qBAAsB,EAAK,qBAC3B,oBAAqB,GACrB,K,EAYZ,EAAA,UAAA,8BAAA,SACE,EACA,GAFF,IAAA,EAAA,KAIE,OAAO,EAAe,QAAO,SAAA,GAAK,OAE9B,EAAE,kBAAoB,EAAW,iBACjC,EAAE,gBAAkB,EAAW,eAG/B,EAAE,kBAAoB,EAAW,eACjC,EAAE,gBAAkB,EAAW,eAChC,IACA,KAAI,SAAA,GACL,IAAM,EAAiB,EAAK,MAAM,MAAM,WAAW,MACjD,SAAA,GAAK,OAAA,EAAE,KAAO,EAAW,eAAe,IAGpC,EADa,iBAAiB,EAAU,kBACtB,MAAM,MAAK,SAAC,GAAc,OAAA,EAAK,KAAO,EAAW,UAAU,IACnF,OAAA,SAAA,GAAY,EAAU,CAAE,KAAI,G,KAQhC,EAAA,UAAA,wBAAA,SAAwB,GACtB,IAAM,EAA+B,GAcrC,OAbA,EAAY,SAAQ,SAAA,GAClB,IAAM,EAA8B,EAAY,QAC9C,SAAA,GAAK,OAAA,EAAE,gBAAkB,EAAW,aAAa,IAE/C,EAAiB,MACnB,SAAC,GAAe,OAAA,EAAM,gBAAkB,EAAW,aAAa,KAE7D,EAAiB,KAAK,CACzB,cAAe,EAAW,cAC1B,YAAa,G,IAIV,C,EAGX,C,CApUA,CAAwC,iB","file":"/npm/flowappplatform-appbuilder-graphs@1.4.11/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/flowappplatform-appbuilder-graphs@1.4.11/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n    extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n    return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n    extendStatics(d, b);\r\n    function __() { this.constructor = d; }\r\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n    __assign = Object.assign || function __assign(t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    }\r\n    return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n            t[p[i]] = s[p[i]];\r\n    return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n    return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n    function verb(n) { return function (v) { return step([n, v]); }; }\r\n    function step(op) {\r\n        if (f) throw new TypeError(\"Generator is already executing.\");\r\n        while (_) try {\r\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n            if (y = 0, t) op = [op[0] & 2, t.value];\r\n            switch (op[0]) {\r\n                case 0: case 1: t = op; break;\r\n                case 4: _.label++; return { value: op[1], done: false };\r\n                case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                default:\r\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                    if (t[2]) _.ops.pop();\r\n                    _.trys.pop(); continue;\r\n            }\r\n            op = body.call(thisArg, _);\r\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n    }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n    if (m) return m.call(o);\r\n    return {\r\n        next: function () {\r\n            if (o && i >= o.length) o = void 0;\r\n            return { value: o && o[i++], done: !o };\r\n        }\r\n    };\r\n}\r\n\r\nexport function __read(o, n) {\r\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n    if (!m) return o;\r\n    var i = m.call(o), r, ar = [], e;\r\n    try {\r\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n    }\r\n    catch (error) { e = { error: error }; }\r\n    finally {\r\n        try {\r\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n        }\r\n        finally { if (e) throw e.error; }\r\n    }\r\n    return ar;\r\n}\r\n\r\nexport function __spread() {\r\n    for (var ar = [], i = 0; i < arguments.length; i++)\r\n        ar = ar.concat(__read(arguments[i]));\r\n    return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n    return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n    return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n    function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n    function fulfill(value) { resume(\"next\", value); }\r\n    function reject(value) { resume(\"throw\", value); }\r\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n    var i, p;\r\n    return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var m = o[Symbol.asyncIterator], i;\r\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n    if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n    return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n    if (mod && mod.__esModule) return mod;\r\n    var result = {};\r\n    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n    result.default = mod;\r\n    return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n    return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import { IComponentDefintion } from \"./interfaces/ComponentDefinition\";\n\nconst start = require('flow-start-component/components.json');\nconst api = require('flow-api-component/components');\nconst cloudboost = require('flow-cloudboost-component/components');\nconst if_else = require('flow-if-else-component/components');\nconst json = require('flow-json-component/components');\nconst stripe = require('flow-stripe-component/components');\nconst text = require('flow-text-component/components');\nconst twilio = require('flow-twilio-component/components');\nconst mailjet = require('flow-mailjet-component/components');\nconst insert_object = require('flow-insert-object-component/components');\n\nconst { keyBy } = require(\"lodash\");\n\nlet componentDefinition: IComponentDefintion[] = [\n  {\n    graphComponentId: \"smart-segment\",\n    title: \"Smart Segment Trigger\",\n    category: \"Trigger\",\n    imgSrc: \"/assets/images/icons/smart-segment.svg\",\n    type: \"graphComponent\",\n    metadata: { \"icon-color\": \"#7ab260\" },\n    ports: [\n      {\n        id: \"smart-segment-a\",\n        title: \"Smart Segment Trigger A\",\n        description: \"Simple description\",\n        color: \"blue\",\n        arcColor: \"blue\"\n      },\n      {\n        id: \"smart-segment-b\",\n        title: \"Smart Segment Trigger B\",\n        description: \"Simple description\",\n        color: \"yellow\"\n      },\n      {\n        id: \"smart-segment-c\",\n        title: \"Smart Segment Trigger C\",\n        description: \"Simple description\",\n        color: \"green\"\n      },\n      {\n        id: \"smart-segment-d\",\n        title: \"Smart Segment Trigger D\",\n        description: \"Simple description\",\n        color: \"lightblue\"\n      },\n      {\n        id: \"smart-segment-e\",\n        title: \"Smart Segment Trigger E\",\n        description: \"Simple description\",\n        color: \"#7ab260\"\n      }\n    ],\n    properties: [\n      {\n        categoryName: \"General\",\n        categoryDescription: \"Basic settings about this app.\",\n        properties: [\n          {\n            id: \"title\",\n            name: \"App Name\",\n            type: \"text\",\n            options: {},\n            data: null\n          },\n          {\n            id: \"description\",\n            name: \"App Description\",\n            type: \"description\",\n            options: {},\n            data: null\n          }\n        ]\n      },\n      {\n        categoryName: \"Style and Branding\",\n        categoryDescription: \"Change style and branding of your app\",\n        properties: [\n          {\n            id: \"square-logo\",\n            name: \"Square Logo\",\n            type: \"image\",\n            options: { sizeRequirement: \"square\" },\n            data: null\n          }\n        ]\n      }\n    ],\n    showOnComponentsPanel: false,\n    isDeletable: false\n  },\n  {\n    graphComponentId: \"livechat-tag\",\n    title: \"LiveChat Tag\",\n    category: \"Trigger\",\n    imgSrc: \"/assets/images/icons/liveChat.svg\",\n    type: \"graphComponent\",\n    metadata: { \"icon-color\": \"#d1683a\" },\n    ports: [\n      {\n        id: \"livechat-tag-a\",\n        title: \"Live Chat A\",\n        description: \"Simple description\",\n        color: \"rgba(0, 0, 255, 0.5)\",\n        arcColor: \"rgba(0, 0, 255)\"\n      },\n      {\n        id: \"livechat-tag-b\",\n        title: \"Live Chat B\",\n        description: \"Simple description\",\n        color: \"yellow\"\n      },\n      {\n        id: \"livechat-tag-c\",\n        title: \"Live Chat C\",\n        description: \"Simple description\",\n        color: \"#279B04\",\n        arcColor: \"#145104\"\n      },\n      {\n        id: \"livechat-tag-d\",\n        title: \"Live Chat D\",\n        description: \"Simple description\",\n        color: \"#7ab260\"\n      },\n      {\n        id: \"livechat-tag-e\",\n        title: \"Live Chat E\",\n        description: \"Simple description\",\n        color: \"#d1683a\"\n      }\n    ],\n    properties: [\n      {\n        categoryName: \"General\",\n        categoryDescription: \"Basic settings about this app.\",\n        properties: [\n          {\n            id: \"title\",\n            name: \"App Name\",\n            type: \"text\",\n            options: {},\n            data: null\n          },\n          {\n            id: \"description\",\n            name: \"App Description\",\n            type: \"description\",\n            options: {},\n            data: null\n          }\n        ]\n      },\n      {\n        categoryName: \"Style and Branding\",\n        categoryDescription: \"Change style and branding of your app\",\n        properties: [\n          {\n            id: \"square-logo\",\n            name: \"Square Logo\",\n            type: \"image\",\n            options: { sizeRequirement: \"square\" },\n            data: null\n          }\n        ]\n      }\n    ],\n    showOnComponentsPanel: true,\n    isDeletable: true\n  },\n  {\n    graphComponentId: \"lead-ad-submitted\",\n    title: \"Lead Ad Submitted\",\n    category: \"Trigger\",\n    imgSrc: \"/assets/images/icons/fb_lead_ads.svg\",\n    type: \"graphComponent\",\n    metadata: { \"icon-color\": \"#4460a0\" },\n    ports: [\n      {\n        id: \"lead-ad-submitted-a\",\n        title: \"Lead Ad Submitted Trigger A\",\n        description: \"Simple description\",\n        color: \"blue\"\n      },\n      {\n        id: \"lead-ad-submitted-b\",\n        title: \"Lead Ad Submitted Trigger B\",\n        description: \"Simple description\",\n        color: \"yellow\"\n      },\n      {\n        id: \"lead-ad-submitted-c\",\n        title: \"Lead Ad Submitted Trigger C\",\n        description: \"Simple description\",\n        color: \"green\"\n      }\n    ],\n    properties: [\n      {\n        categoryName: \"General\",\n        categoryDescription: \"Basic settings about this app.\",\n        properties: [\n          {\n            id: \"title\",\n            name: \"App Name\",\n            type: \"text\",\n            options: {},\n            data: null\n          },\n          {\n            id: \"description\",\n            name: \"App Description\",\n            type: \"description\",\n            options: {},\n            data: null\n          }\n        ]\n      },\n      {\n        categoryName: \"Style and Branding\",\n        categoryDescription: \"Change style and branding of your app\",\n        properties: [\n          {\n            id: \"square-logo\",\n            name: \"Square Logo\",\n            type: \"image\",\n            options: { sizeRequirement: \"square\" },\n            data: null\n          }\n        ]\n      }\n    ],\n    showOnComponentsPanel: true,\n    isDeletable: true\n  },\n  {\n    graphComponentId: \"delay\",\n    title: \"Add Delay\",\n    category: \"Actions\",\n    imgSrc: \"/assets/images/icons/trigger-timer.svg\",\n    type: \"graphComponent\",\n    metadata: { \"icon-color\": \"#fb7138\" },\n    ports: [\n      {\n        id: \"delay-a\",\n        title: \"Add Delay A\",\n        description: \"Simple description\",\n        color: \"#00D4AB\"\n      }\n    ],\n    properties: [\n      {\n        categoryName: \"General\",\n        categoryDescription: \"Basic settings about this app.\",\n        properties: [\n          {\n            id: \"title\",\n            name: \"App Name\",\n            type: \"text\",\n            options: {},\n            data: null\n          },\n          {\n            id: \"description\",\n            name: \"App Description\",\n            type: \"description\",\n            options: {},\n            data: null\n          }\n        ]\n      },\n      {\n        categoryName: \"Style and Branding\",\n        categoryDescription: \"Change style and branding of your app\",\n        properties: [\n          {\n            id: \"square-logo\",\n            name: \"Square Logo\",\n            type: \"image\",\n            options: { sizeRequirement: \"square\" },\n            data: null\n          }\n        ]\n      }\n    ],\n    showOnComponentsPanel: true,\n    isDeletable: true\n  },\n  {\n    graphComponentId: \"send-mail\",\n    title: \"Send Email\",\n    category: \"Actions\",\n    imgSrc: \"/assets/images/icons/email.svg\",\n    type: \"graphComponent\",\n    metadata: { \"icon-color\": \"#f0b029\" },\n    ports: [\n      {\n        id: \"send-mail-a\",\n        title: \"Send Email A\",\n        description: \"Simple description\",\n        color: \"blue\"\n      },\n      {\n        id: \"send-mail-b\",\n        title: \"Send Email B\",\n        description: \"Simple description\",\n        color: \"#f0b029\"\n      },\n      {\n        id: \"send-mail-c\",\n        title: \"Send Email C\",\n        description: \"Simple description\",\n        color: \"green\"\n      },\n      {\n        id: \"send-mail-d\",\n        title: \"Send Email D\",\n        description: \"Simple description\",\n        color: \"lightblue\"\n      }\n    ],\n    properties: [\n      {\n        categoryName: \"General\",\n        categoryDescription: \"Basic settings about this app.\",\n        properties: [\n          {\n            id: \"title\",\n            name: \"App Name\",\n            type: \"text\",\n            options: {},\n            data: null\n          },\n          {\n            id: \"description\",\n            name: \"App Description\",\n            type: \"description\",\n            options: {},\n            data: null\n          }\n        ]\n      },\n      {\n        categoryName: \"Style and Branding for Email Component\",\n        categoryDescription: \"Change style and branding of your app\",\n        properties: [\n          {\n            id: \"square-logo\",\n            name: \"Square Logo\",\n            type: \"image\",\n            options: { sizeRequirement: \"square\" },\n            data: null\n          }\n        ]\n      }\n    ],\n    showOnComponentsPanel: true,\n    isDeletable: true\n  },\n  {\n    graphComponentId: \"send-sms\",\n    title: \"Send SMS\",\n    category: \"Actions\",\n    imgSrc: \"/assets/images/icons/twilio.svg\",\n    type: \"graphComponent\",\n    metadata: { \"icon-color\": \"#f22f46\" },\n    ports: [\n      {\n        id: \"send-sms-a\",\n        title: \"Send Sms A\",\n        description: \"Simple description\",\n        color: \"red\"\n      },\n      {\n        id: \"send-sms-b\",\n        title: \"Send Sms B\",\n        description: \"Simple description\",\n        color: \"blue\"\n      },\n      {\n        id: \"send-sms-c\",\n        title: \"Send Sms C\",\n        description: \"Simple description\",\n        color: \"pink\"\n      }\n    ],\n    properties: [\n      {\n        categoryName: \"General\",\n        categoryDescription: \"Basic settings about this app.\",\n        properties: [\n          {\n            id: \"title\",\n            name: \"App Name\",\n            type: \"text\",\n            options: {},\n            data: null\n          },\n          {\n            id: \"description\",\n            name: \"App Description\",\n            type: \"description\",\n            options: {},\n            data: null\n          }\n        ]\n      },\n      {\n        categoryName: \"Style and Branding\",\n        categoryDescription: \"Change style and branding of your app\",\n        properties: [\n          {\n            id: \"square-logo\",\n            name: \"Square Logo\",\n            type: \"image\",\n            options: { sizeRequirement: \"square\" },\n            data: null\n          }\n        ]\n      }\n    ],\n    showOnComponentsPanel: true,\n    isDeletable: true\n  },\n  {\n    graphComponentId: \"has-submitted-typeform\",\n    title: \"Has Submitted Typeform\",\n    category: \"Conditions\",\n    imgSrc: \"/assets/images/icons/typeform.svg\",\n    type: \"graphComponent\",\n    metadata: { \"icon-color\": \"#262627\" },\n    ports: [\n      {\n        id: \"has-submitted-typeform-a\",\n        title: \"Has Submitted Typeform A\",\n        description: \"Simple description\",\n        color: \"#262627\"\n      },\n      {\n        id: \"has-submitted-typeform-b\",\n        title: \"Has Submitted Typeform B\",\n        description: \"Simple description\",\n        color: \"yellow\"\n      },\n      {\n        id: \"has-submitted-typeform-c\",\n        title: \"Has Submitted Typeform C\",\n        description: \"Simple description\",\n        color: \"green\"\n      }\n    ],\n    properties: [\n      {\n        categoryName: \"General\",\n        categoryDescription: \"Basic settings about this app.\",\n        properties: [\n          {\n            id: \"title\",\n            name: \"App Name\",\n            type: \"text\",\n            options: {},\n            data: null\n          },\n          {\n            id: \"description\",\n            name: \"App Description\",\n            type: \"description\",\n            options: {},\n            data: null\n          }\n        ]\n      },\n      {\n        categoryName: \"Style and Branding\",\n        categoryDescription: \"Change style and branding of your app\",\n        properties: [\n          {\n            id: \"square-logo\",\n            name: \"Square Logo\",\n            type: \"image\",\n            options: { sizeRequirement: \"square\" },\n            data: null\n          }\n        ]\n      }\n    ],\n    showOnComponentsPanel: true,\n    isDeletable: true\n  },\n  {\n    graphComponentId: \"check-deal-stage\",\n    title: \"Check Deal Stage\",\n    category: \"Conditions\",\n    imgSrc: \"/assets/images/icons/pipedrive.svg\",\n    type: \"graphComponent\",\n    metadata: { \"icon-color\": \"#26292a\" },\n    ports: [\n      {\n        id: \"check-deal-stage-a\",\n        title: \"Check Deal Stage A\",\n        description: \"Simple description\",\n        color: \"#26292a\"\n      },\n      {\n        id: \"check-deal-stage-b\",\n        title: \"Check Deal Stage B\",\n        description: \"Simple description\",\n        color: \"yellow\"\n      },\n      {\n        id: \"check-deal-stage-c\",\n        title: \"Check Deal Stage C\",\n        description: \"Simple description\",\n        color: \"green\"\n      },\n      {\n        id: \"check-deal-stage-d\",\n        title: \"Check Deal Stage D\",\n        description: \"Simple description\",\n        color: \"lightblue\"\n      }\n    ],\n    properties: [\n      {\n        categoryName: \"General\",\n        categoryDescription: \"Basic settings about this app.\",\n        properties: [\n          {\n            id: \"title\",\n            name: \"App Name\",\n            type: \"text\",\n            options: {},\n            data: null\n          },\n          {\n            id: \"description\",\n            name: \"App Description\",\n            type: \"description\",\n            options: {},\n            data: null\n          }\n        ]\n      },\n      {\n        categoryName: \"Style and Branding\",\n        categoryDescription: \"Change style and branding of your app\",\n        properties: [\n          {\n            id: \"square-logo\",\n            name: \"Square Logo\",\n            type: \"image\",\n            options: { sizeRequirement: \"square\" },\n            data: null\n          }\n        ]\n      }\n    ],\n    showOnComponentsPanel: true,\n    isDeletable: true\n  },\n  {\n    graphComponentId: \"check-headsup-status\",\n    title: \"Check Headsup Status\",\n    category: \"Conditions\",\n    imgSrc: \"/assets/images/icons/headsup.svg\",\n    type: \"graphComponent\",\n    metadata: { \"icon-color\": \"#ee336d\" },\n    ports: [\n      {\n        id: \"check-headsup-a\",\n        title: \"Check Headsup Status A\",\n        description: \"Simple description\",\n        color: \"#26292a\"\n      },\n      {\n        id: \"check-headsup-b\",\n        title: \"Check Headsup Status B\",\n        description: \"Simple description\",\n        color: \"yellow\"\n      },\n      {\n        id: \"check-headsup-c\",\n        title: \"Check Headsup Status C\",\n        description: \"Simple description\",\n        color: \"#ee336d\"\n      },\n      {\n        id: \"check-headsup-d\",\n        title: \"Check Headsup Status D\",\n        description: \"Simple description\",\n        color: \"lightblue\"\n      }\n    ],\n    properties: [\n      {\n        categoryName: \"General\",\n        categoryDescription: \"Basic settings about this app.\",\n        properties: [\n          {\n            id: \"title\",\n            name: \"App Name\",\n            type: \"text\",\n            options: {},\n            data: null\n          },\n          {\n            id: \"description\",\n            name: \"App Description\",\n            type: \"description\",\n            options: {},\n            data: null\n          }\n        ]\n      },\n      {\n        categoryName: \"Style and Branding\",\n        categoryDescription: \"Change style and branding of your app\",\n        properties: [\n          {\n            id: \"square-logo\",\n            name: \"Square Logo\",\n            type: \"image\",\n            options: { sizeRequirement: \"square\" },\n            data: null\n          }\n        ]\n      }\n    ],\n    showOnComponentsPanel: true,\n    isDeletable: true\n  }\n];\n\nexport const components = componentDefinition.concat(\n  Object.values(\n    Object.assign(\n      {},\n      start,\n      api,\n      cloudboost,\n      json,\n      if_else,\n      insert_object,\n      mailjet,\n      start,\n      stripe,\n      text,\n      twilio,\n    ),\n  )\n);\n\nexport const componentsByType: {\n  [componentType: string]: IComponentDefintion;\n} = keyBy(components, \"graphComponentId\");\n","/**\n * @class Port\n */\n\nimport * as React from \"react\";\nimport { IPort } from \"./interfaces/ComponentDefinition\";\nimport { Wedge, Text } from \"react-konva\";\nimport { Text as KonvaText } from \"konva\";\n\nexport type Props = {\n  port: IPort;\n  angle: number;\n  idx: number;\n  onHover(port: IPort): void;\n  visible: boolean;\n};\n\ntype State = {\n  hovering: boolean;\n};\n\nexport default class Port extends React.Component<Props, State> {\n  text: any;\n  state = {\n    hovering: false\n  };\n\n  onHoverChange = (hovering: boolean) => {\n    this.setState({ hovering });\n  };\n\n  onText = (text: any) => {\n    if (!this.text) {\n      this.text = text;\n      const height = (this.text as KonvaText).getHeight();\n      (this.text as KonvaText).offsetY(height / 2);\n      (this.text as KonvaText).moveToTop();\n    }\n  };\n  render() {\n    const { port, angle, idx, onHover, visible } = this.props;\n    const rotation = -90 + angle * idx;\n    const radius = 38;\n\n    return (\n      <React.Fragment>\n        <Wedge\n          angle={angle}\n          radius={radius}\n          fill={port.color}\n          rotation={rotation}\n          visible={visible}\n          onMouseOver={ev => {\n            this.onHoverChange(true);\n            ev.cancelBubble = true;\n            onHover(port);\n          }}\n          onMouseOut={() => this.onHoverChange(false)}\n          onDragMove={ev => {\n            ev.cancelBubble = true;\n          }}\n          onDragStart={ev => {\n            ev.cancelBubble = true;\n          }}\n        />\n      </React.Fragment>\n    );\n  }\n}\n","/**\n * @class Connector\n */\n\nimport * as React from \"react\";\nimport { IComponent } from \"./interfaces/Component\";\nimport { components } from \"./definitions\";\nimport { Group, Circle, Image as ReactKonvaImage } from \"react-konva\";\n\nimport Port from \"./Port\";\nimport { IPort } from \"./interfaces/ComponentDefinition\";\n\nexport type Props = {\n  component: IComponent;\n  selectedComponentId: string | null;\n  x: number;\n  y: number;\n  mouseIsOver: boolean;\n  newConnectionInProgress: boolean;\n  onPortHovered(port: IPort): void;\n};\n\ntype State = {\n  hovering: boolean;\n  connectorCentreClicked: boolean;\n  connectorImageLoaded: boolean;\n};\n\nconst Options = {\n  iconWidth: 20,\n  iconHeight: 20\n};\n\nexport default class Connector extends React.Component<Props, State> {\n  state = {\n    hovering: false,\n    connectorCentreClicked: false,\n    connectorImageLoaded: false\n  };\n\n  connectorImage: HTMLImageElement;\n\n  componentDidMount() {\n    this.connectorImage = new Image(Options.iconWidth);\n    this.connectorImage.onload = () => {\n      this.setState({ connectorImageLoaded: true });\n    };\n    this.connectorImage.src = `/assets/images/arrow-right-white.svg`;\n  }\n\n  onHoverChange = (hovering: boolean) => {\n    this.setState({ hovering });\n  };\n\n  handleMouseDown = () => {\n    const { onPortHovered, component } = this.props;\n    const definition = components.find(\n      c => component.graphComponentId === c.graphComponentId\n    );\n    const length = definition && definition.ports.length;\n    if (length && length <= 1) {\n      if (definition && length === 1) {\n        const portSel = definition.ports[0];\n        setTimeout(() => {\n          onPortHovered(portSel);\n          this.setState({ connectorCentreClicked: false });\n        }, 50)\n      }\n    } else if (length && length > 1) {\n      this.setState({ connectorCentreClicked: true });\n    }\n  }\n\n  render() {\n    const { component, x, y, onPortHovered, mouseIsOver, newConnectionInProgress, selectedComponentId } = this.props;\n    const definition = components.find(\n      c => component.graphComponentId === c.graphComponentId\n    );\n    if (!definition) {\n      return null;\n    }\n    const angle = 180 / definition.ports.length;\n\n    const selected = selectedComponentId === component.id;\n    let showCircle = this.props.mouseIsOver;\n    if (newConnectionInProgress) {\n      showCircle = selected;\n    };\n\n    return (\n      <Group x={x} y={y}>\n        <Group visible={mouseIsOver || newConnectionInProgress}>\n          {definition.ports.map((port, idx) => (\n            <Port\n              port={port}\n              angle={angle}\n              idx={idx}\n              key={`port-${component.id}-${port.title}`}\n              {...(\n                this.state.connectorCentreClicked ? {\n                  onHover: e => {\n                    onPortHovered(e);\n                    this.setState({ connectorCentreClicked: false });\n                  }\n                } : {\n                  onHover: () => {}\n                }\n              )}\n              visible={this.state.connectorCentreClicked || (selected && newConnectionInProgress)}\n            />\n          ))}\n          <Group\n            visible={showCircle}\n            onMouseDown={this.handleMouseDown}\n          >\n            <Circle radius={18} fill=\"skyblue\" stroke=\"white\" strokeWidth={2} />\n            {this.state.connectorImageLoaded && (\n              <ReactKonvaImage\n                image={this.connectorImage}\n                offsetX={18}\n                offsetY={10}\n                width={Options.iconWidth}\n                height={Options.iconHeight}\n              />\n            )}\n          </Group>\n        </Group>\n      </Group>\n    );\n  }\n}\n","export const startComponentId = 'start';\nexport const componentWidth: number = 140;\nexport const componentHeight: number = 140;\n\nexport const computeXAngle = (\n  fromX: number,\n  fromY: number,\n  toX: number,\n  toY: number\n) => {\n  const height = toY - fromY;\n  const width = toX - fromX;\n  const hypotenuse = Math.sqrt(height*height + width*width);\n  return Math.acos(width / hypotenuse) * 180 / Math.PI;\n}\n\nexport const objectsEqual = function (object1: object, object2: object) {\n  // Loop through properties in object 1\n  for (var p in object1) {\n    // Check property exists on both objects\n    if (object1.hasOwnProperty(p) !== object2.hasOwnProperty(p)) return false;\n    switch (typeof (object1[p])) {\n      // Deep compare objects\n      case 'object':\n        if (!objectsEqual(object1[p], object2[p])) return false;\n        break;\n      // Compare function code\n      case 'function':\n        if (typeof (object2[p]) == 'undefined' || (p != 'compare' && object1[p].toString() != object2[p].toString())) return false;\n        break;\n      // Compare values\n      default:\n        if (object1[p] != object2[p]) return false;\n    }\n  }\n  // Check object 2 for any extra properties\n  for (var p in object2) {\n    if (typeof (object1[p]) == 'undefined') return false;\n  }\n  return true;\n}","/**\n * @class Component\n */\n\nimport * as React from \"react\";\nimport { IComponent } from \"./interfaces/Component\";\nimport { components } from \"./definitions\";\nimport {\n  Rect,\n  Text,\n  Group,\n  Image as ReactKonvaImage,\n  Circle\n} from \"react-konva\";\nimport { KonvaEventObject, Text as KonvaText, Group as KonvaGroup } from \"konva\";\nimport Connector from \"./Connector\";\nimport { IPort, IComponentDefintion } from \"./interfaces/ComponentDefinition\";\nimport { componentWidth, componentHeight, startComponentId } from \"./utilities\";\n\nexport type Props = {\n  component: IComponent;\n  selectedComponentId: string | null;\n  newConnectionInProgress: boolean;\n  onComponentMousedOver(component: IComponent, x: number, y: number): void;\n  onComponentMousedOut(component: IComponent): void;\n  onComponentMoved(component: IComponent, x: number, y: number): void;\n  onComponentMoveFinished(component: IComponent): void;\n  onConnectionStart(component: IComponent, port: IPort): void;\n  onComponentDeleted(component: IComponent): void;\n  onComponentSelected(component: IComponent | null): void;\n};\n\nexport type State = {\n  imageLoaded: boolean;\n  closeImageLoaded: boolean;\n  infoImageLoaded: boolean;\n  mouseIsOver: boolean;\n};\n\nconst Options = {\n  componentWidth: componentWidth,\n  componentHeight: componentHeight,\n  iconWidth: 35,\n  iconHeight: 25\n};\n\nexport default class Component extends React.Component<Props, State> {\n  text: any;\n  image: HTMLImageElement;\n  closeImage: HTMLImageElement;\n  infoImage: HTMLImageElement;\n  definition: IComponentDefintion | undefined;\n  state = {\n    imageLoaded: false,\n    closeImageLoaded: false,\n    infoImageLoaded: false,\n    mouseIsOver: false\n  };\n  componentMoved = (ev: KonvaEventObject<DragEvent>) => {\n    const x = ev.target.getAttr(\"x\");\n    const y = ev.target.getAttr(\"y\");\n    this.props.onComponentMoved(this.props.component, x, y);\n  };\n  componentMoveFinished = (ev: KonvaEventObject<DragEvent>) => {\n    this.props.onComponentMoveFinished(this.props.component);\n  };\n  onPortHovered = (port: IPort) => {\n    this.props.onConnectionStart(this.props.component, port);\n  };\n  onText = (text: any) => {\n    if (!this.text) {\n      this.text = text;\n    }\n    if (text) {\n      const width = (this.text as KonvaText).getWidth();\n      /* (this.text as KonvaText).offsetX(width / 2);\n      (this.text as KonvaText).moveToTop(); */\n      const padding = Math.abs((text.height() - (componentHeight / 2)) / 2);\n      text.y(this.props.component.y + padding);\n      // text.x(this.props.component.x);\n      // console.info('onText', text.text(), text.height(), this.props.component, padding);\n    }\n  };\n\n  componentDidMount() {\n    // definition\n    const { component } = this.props;\n    this.definition = components.find(\n      (c: IComponentDefintion) => component.graphComponentId === c.graphComponentId\n    );\n    this.closeImage = new Image(Options.iconWidth);\n    this.closeImage.onload = () => {\n      this.setState({ closeImageLoaded: true });\n    };\n    this.closeImage.src = `/assets/images/close-white.svg`;\n\n    this.infoImage = new Image(Options.iconWidth);\n    this.infoImage.onload = () => {\n      this.setState({ infoImageLoaded: true });\n    };\n    this.infoImage.src = `/assets/images/info-white.svg`;\n\n    // image loading\n    if (this.definition) {\n      this.image = new Image(Options.iconWidth);\n      this.image.onload = () => {\n        this.setState({ imageLoaded: true });\n      };\n      this.image.src = this.definition.imgSrc;\n    }\n  }\n\n  componentDeleted = () => {\n    this.props.onComponentDeleted(this.props.component);\n  };\n\n  componentMousedOver = (event: any) => {\n    event.cancelBubble = true;\n    this.setState({ mouseIsOver: true });\n    this.props.onComponentMousedOver(this.props.component, 0, 0);\n  };\n\n  componentMousedOut = (event: any) => {\n    event.cancelBubble = true;\n    this.setState({ mouseIsOver: false });\n    this.props.onComponentMousedOut(this.props.component);\n  };\n\n  render() {\n    const { component, newConnectionInProgress, selectedComponentId } = this.props;\n    const { definition } = this;\n    if (!definition) {\n      return null;\n    }\n    const width = Options.componentWidth;\n    const height = Options.componentHeight;\n    const connectorX = component.x + width / 2;\n    const connectorY = component.y;\n    const selected = selectedComponentId === this.props.component.id;\n    \n    let showPeripherals = this.state.mouseIsOver;\n    if (newConnectionInProgress) {\n      showPeripherals = false; // selected && this.state.mouseIsOver;\n    };\n    \n    return (\n      <React.Fragment>\n        <Group\n          name={component.id}\n          onDragMove={this.componentMoved}\n          onDragEnd={this.componentMoveFinished}\n          onMouseOver={this.componentMousedOver}\n          onMouseOut={this.componentMousedOut}\n          ref={(node: KonvaGroup) => {\n            // deal with cursors\n            // node.container().style.cursor = '';\n          }}\n        >\n          <Rect\n            draggable\n            cornerRadius={5}\n            name={component.id}\n            x={component.x}\n            y={component.y}\n            height={height}\n            width={width}\n            fill={definition.metadata[\"icon-color\"]}\n            offsetX={width / 2}\n            offsetY={height / 2}\n            shadowBlur={20}\n            shadowOpacity={0.4}\n          />\n          {this.state.imageLoaded && (\n            <ReactKonvaImage\n              image={this.image}\n              x={component.x}\n              y={component.y - 45}\n              width={45}\n              height={45}\n              offsetX={23}\n              listening={false}\n              opacity={1}\n            />\n          )}\n          <Text\n            width={componentWidth - 14}\n            align=\"center\"\n            fontSize={14}\n            lineHeight={1.3}\n            fill=\"white\"\n            x={component.x}\n            offsetX={componentWidth / 2 - 7}\n            ref={(text: KonvaText) => {\n              if (text === null) return;\n              const padding = Math.abs((text.height() - (componentHeight / 2)) / 2);\n              text.y(this.props.component.y + padding);\n            }}\n            text={definition.title}\n            listening={false}\n          />\n          <Group\n            onClick={this.componentDeleted}\n            x={component.x - Options.componentWidth / 2}\n            y={component.y - Options.componentHeight / 2}\n            visible={showPeripherals && component.id !== startComponentId}\n          >\n            <Circle\n              fill=\"red\"\n              radius={12}\n              shadowBlur={10}\n              shadowOpacity={0.5}\n              stroke=\"white\"\n              strokeWidth={1}\n            />\n            {this.state.closeImageLoaded && (\n              <ReactKonvaImage\n                image={this.closeImage}\n                offsetX={5}\n                offsetY={5}\n                width={10}\n                height={10}\n              />\n            )}\n          </Group>\n          <Group\n            onClick={() => this.props.onComponentSelected(component)}\n            x={component.x + Options.componentWidth / 2}\n            y={component.y - Options.componentHeight / 2}\n          >\n            <Circle\n              fill=\"orange\"\n              radius={12}\n              shadowBlur={10}\n              shadowOpacity={0.5}\n              stroke=\"white\"\n              strokeWidth={1}\n            />\n            {this.state.infoImageLoaded && (\n              <ReactKonvaImage\n                image={this.infoImage}\n                offsetX={6}\n                offsetY={6}\n                width={12}\n                height={12}\n              />\n            )}\n          </Group>\n          <Connector\n            x={connectorX}\n            y={connectorY}\n            component={component}\n            selectedComponentId={selectedComponentId}\n            mouseIsOver={this.state.mouseIsOver}\n            newConnectionInProgress={newConnectionInProgress}\n            onPortHovered={this.onPortHovered}\n          />\n        </Group>\n      </React.Fragment>\n    );\n  }\n}\n","/**\n * @class Connection\n */\n\nimport * as React from \"react\";\nimport { IComponent, IConnection } from \"./interfaces/Component\";\nimport { Text, Arrow, Group, Circle, Image as ReactKonvaImage } from \"react-konva\";\nimport {\n  Line as KonvaLine,\n  Text as KonvaText,\n} from \"konva\";\nimport { componentWidth, componentHeight, computeXAngle } from \"./utilities\";\nimport { IPort } from \"./interfaces/ComponentDefinition\";\n\nexport type ConnectionProps = {\n  newConnection: false;\n  fromComponent: IComponent;\n  toComponent: IComponent | undefined;\n  connection: IConnection;\n  onClick(component: IComponent, connection: IConnection): void;\n  index: number;\n  connectionsSharingDirection: Array<IConnection | any>;\n  connectionsSharingPath: Array<IConnection | any>;\n};\n\nexport type NewConnectionProps = {\n  newConnection: true;\n  fromComponent: IComponent;\n  fromPort: IPort;\n  mousePosition: {\n    x: number;\n    y: number;\n  };\n  componentMousedOver: IComponent | null;\n};\n\nexport type Props = ConnectionProps | NewConnectionProps;\n\nexport type State = {\n  hovering: boolean;\n  mouseX: number;\n  mouseY: number;\n  closeImageLoaded: boolean;\n};\n\nconst Options = {\n  componentWidth: componentWidth,\n  componentHeight: componentHeight,\n  iconWidth: 35,\n  iconHeight: 25\n};\n\nexport default class Connection extends React.Component<Props, State> {\n  node: any;\n  text: any;\n  closeImage: HTMLImageElement;\n  state = {\n    hovering: false,\n    mouseX: 0,\n    mouseY: 0,\n    closeImageLoaded: false\n  };\n  \n  componentDidMount() {\n    try {\n      const linePosition = this.getScaledPointerPosition();\n      if (linePosition) {\n        this.setState({\n          mouseX: linePosition.x,\n          mouseY: linePosition.y\n        });\n      }\n    } catch(e) {/* ignore */}\n    this.closeImage = new Image(Options.iconWidth);\n    this.closeImage.onload = () => {\n      this.setState({ closeImageLoaded: true });\n    };\n    this.closeImage.src = `/assets/images/close-white.svg`;\n  }\n\n  onNode = (node: any) => {\n    if (!this.node) {\n      this.node = node;\n    }\n    if (this.node) {\n      (this.node as KonvaLine).moveToBottom();\n    }\n  };\n\n  onHoverChange = (hovering: boolean) => {\n    if (hovering) {\n      try {\n        const { x: mouseX, y: mouseY } = this.getScaledPointerPosition();\n        this.setState({ hovering, mouseX, mouseY });\n      } catch(e) {/* ignore */}\n    } else {\n      setTimeout(() => {\n        this.setState({\n          hovering\n        });\n      }, 200);\n    }\n  };\n\n  getScaledPointerPosition = () => {\n    const stage = (this.node as KonvaLine).getStage();\n    const pointerPosition = stage.getPointerPosition();\n    const stageX = stage.getAttr(\"x\");\n    const stageY = stage.getAttr(\"y\");\n    const stageScaleX = stage.getAttr(\"scaleX\");\n    const stageScaleY = stage.getAttr(\"scaleY\");\n    const x = (pointerPosition.x - stageX) / stageScaleX;\n    const y = (pointerPosition.y - stageY) / stageScaleY;\n    return { x, y };\n  };\n\n  onText = (text: KonvaText, i: number) => {\n    const props = this.props;\n    if (props.newConnection) return;\n    if (text) {\n      const spacing = 5; // spacing between labels\n      const tCount = props.connectionsSharingPath.length;\n      const tHWidth = (text as KonvaText).getWidth() / 2;\n      let offsetX = tHWidth;\n      if (tCount > 2) {\n        let indexEven = (1 + i) % 2 === 0;\n        offsetX = tCount % 2 === 0\n          ? tHWidth - (i * (spacing + tHWidth)) + ((spacing + tHWidth) * (\n            indexEven ? tCount / 2 : (tCount / 2) - 1\n          ))\n          : tHWidth - (i * (spacing + tHWidth)) + (tHWidth * tCount / 2);\n      }\n      (text as KonvaText).offsetX(offsetX);\n    }\n  };\n\n  render() {\n    const props: any = this.props;\n\n    if (props.fromComponent === undefined) return null;\n\n    // const definition = componentsByType[props.fromComponent.graphComponentId];\n    // const { ports } = definition;\n  \n    const fromX = props.fromComponent.x;\n    const fromY = props.fromComponent.y;\n\n    let toX = fromX;\n    let toY = fromY;\n\n    if (props.newConnection) {\n\n      if (props.componentMousedOver === null) {\n        toX = props.mousePosition.x !== -1 ? props.mousePosition.x : props.fromComponent.x;\n        toY = props.mousePosition.y !== -1 ? props.mousePosition.y : props.fromComponent.y;\n      } else {\n        toX = props.componentMousedOver.x;\n        toY = props.componentMousedOver.y;\n      }\n\n    } else if (props.toComponent) {\n      toX = props.toComponent.x\n      toY = props.toComponent.y;\n    } else return null\n\n    const height = toY - fromY;\n    const width = toX - fromX;\n    \n    const connectionAngle = computeXAngle(fromX, fromY, toX, toY);\n    let connectionAngleX = connectionAngle;\n    let connectionAngleY = connectionAngle;\n    \n    let connectionAngleForText = connectionAngle;\n\n    if (toX < fromX) {\n      connectionAngleForText = connectionAngleForText - 180;\n      connectionAngleY = Math.abs(connectionAngleY - 180);\n    }\n    if (toY < fromY) {\n      connectionAngleForText = -connectionAngleForText;\n      connectionAngleY = -connectionAngleY;\n    }\n\n    let connectorDotOffsetY =\n      Math.tan(connectionAngleY * Math.PI / 180) * componentWidth / 2;\n\n    connectorDotOffsetY =\n      connectorDotOffsetY < 0\n        ? Math.max(connectorDotOffsetY, -componentHeight / 2)\n        : Math.min(connectorDotOffsetY, componentHeight / 2);\n\n    let connectorDotOffsetX =\n      componentHeight / 2 / Math.tan(connectionAngleX * Math.PI / 180);\n  \n    connectorDotOffsetX =\n      connectorDotOffsetX < 0\n        ? Math.max(connectorDotOffsetX, -componentWidth / 2)\n        : Math.min(connectorDotOffsetX, componentWidth / 2);\n\n    const connectorDotX = fromX + connectorDotOffsetX;\n    const connectorDotY = fromY + connectorDotOffsetY;\n\n    /*\n     * All connections are rendered with this component\n     * indexToRender helps determine which connections are made visible,\n     * avoiding blurriness and conflicts when they share a path\n     * \n     */\n    let indexToRender = 0;\n\n    if (props.newConnection === false) {\n      toX = toX - connectorDotOffsetX * 1.2;\n      toY = toY - connectorDotOffsetY * 1.2;\n      indexToRender = props.connectionsSharingDirection.length - 1;\n    } else if (\n      props.componentMousedOver !== null &&\n      props.componentMousedOver.id !== props.fromComponent.id\n    ) {\n      toX = props.componentMousedOver.x - connectorDotOffsetX * 1.2;\n      toY = props.componentMousedOver.y - connectorDotOffsetY * 1.2;\n    }\n\n    const existingConnection = (props: any) => (\n      <React.Fragment>\n        <Group\n          onMouseOver={e => {\n            /* this.onHoverChange(true); */\n            this.setState({ hovering: true });\n            e.cancelBubble = true;\n          }}\n          onMouseOut={e => {\n            /* this.onHoverChange(false); */\n            this.setState({ hovering: false });\n            e.cancelBubble = true;\n          }}\n        >\n          {(\n            <Arrow\n              stroke=\"grey\"\n              strokeWidth={3}\n              points={[fromX, fromY, toX, toY]}\n              tension={0.4}\n              visible={props.index === indexToRender}\n            />\n          )}\n          {(\n            (props.connectionsSharingPath).map((c: any, i: number) => {\n              const index = i + 1;\n              const extension = this.getTextExtension(index);\n              return (\n                <Text\n                  key={`${c.fromPortId}-${c.toComponentId}-${i}`}\n                  ref={(text: KonvaText) => this.onText(text, i)}\n                  x={fromX + width/2}\n                  y={fromY + height/2}\n                  offsetY={index % 2 === 1 ? 20 : -10}\n                  text={`${c.port.title.toUpperCase()}${extension}`}\n                  rotation={connectionAngleForText}\n                  fill=\"grey\"\n                  visible={\n                    props.index === indexToRender &&\n                    /* this.state.hovering === false && */\n                    (Math.abs(width) > componentWidth * 1.7 || Math.abs(height) > componentWidth * 1.7) &&\n                    // The following check avoids conflicts when we have connections ...\n                    // sharing a path but face opposite directions\n                    props.fromComponent.id === props.connectionsSharingPath[\n                      props.connectionsSharingPath.length - 1\n                    ].fromComponentId\n                  }\n                />\n              );\n            })\n          )}\n          <Group\n            onClick={() =>\n              props.onClick(props.connection)\n            }\n            x={fromX + width/2}\n            y={fromY + height/2}\n            visible={\n              props.index === indexToRender &&\n              this.state.hovering &&\n              // The following check avoids conflicts when we have connections ...\n              // sharing a path but face opposite directions\n              props.fromComponent.id === props.connectionsSharingPath[\n                props.connectionsSharingPath.length - 1\n              ].fromComponentId\n            }\n          >\n            <Circle\n              fill=\"red\"\n              radius={12}\n              shadowBlur={10}\n              shadowOpacity={0.5}\n              stroke=\"white\"\n              strokeWidth={1}\n            />\n            {this.state.closeImageLoaded && (\n              <ReactKonvaImage\n                image={this.closeImage}\n                offsetX={5}\n                offsetY={5}\n                width={10}\n                height={10}\n              />\n            )}\n          </Group>\n        </Group>\n        {\n          <Group x={connectorDotX} y={connectorDotY} visible={props.index === indexToRender}>\n            {/* controls spacing between connections and their fromX, fill color is same as Stage container background */}\n            <Circle radius={14} fill=\"#f7f7f7\" />\n            {/* connector dot */}\n            <Circle radius={7} fill=\"skyblue\" />\n          </Group>\n        }\n      </React.Fragment>\n    );\n\n    const newConnection = () => (\n      <React.Fragment>\n        <Arrow\n          stroke=\"grey\"\n          strokeWidth={3}\n          points={[fromX, fromY, toX, toY]}\n          tension={0.4}\n          ref={this.onNode}\n          lineCap=\"round\"\n        />\n      </React.Fragment>\n    )\n    \n    return (\n      props.newConnection ? newConnection() : existingConnection(props)\n    );\n  }\n\n  getTextExtension(index: number) {\n    let similarConnectionsExist: boolean = false;\n    const props: any = this.props;\n\n    props.connectionsSharingDirection.forEach((connection: IConnection) => {\n      if (similarConnectionsExist === false) {\n        if (props.connectionsSharingDirection.filter((c: IConnection) =>\n          c.fromPortId === connection.fromPortId\n        ).length > 1) {\n          similarConnectionsExist = true;\n        }\n      }\n    });\n    \n    return similarConnectionsExist\n      ? `-${index}`\n      : ``;\n  }\n}\n","/**\n * @class KonvaGraph\n */\n\nimport * as React from \"react\";\nimport { IGraph } from \"./interfaces/Graph\";\nimport { IComponent, IConnection } from \"./interfaces/Component\";\nimport Component from \"./Component\";\nimport { Stage, Layer, FastLayer } from \"react-konva\";\nimport { KonvaEventObject, Stage as KonvaStage } from \"konva\";\nimport Connection from \"./Connection\";\nimport { IPort } from \"./interfaces/ComponentDefinition\";\n\nimport { componentsByType } from \"./definitions\";\n\nexport type Props = {\n  graph: IGraph;\n  onComponentMoved(component: IComponent, x: number, y: number): void;\n  onComponentMoveFinished(component: IComponent): void;\n  onConnectionCreated(connection: IConnection): void;\n  onConnectionRemoved(connection: IConnection): void;\n  onConnectionClicked(component: IComponent, connection: IConnection): void;\n  onComponentSelected(component: IComponent | null): void;\n  onComponentDeleted(component: IComponent): void;\n};\n\ntype State = {\n  addingConnection: boolean;\n  mouseX: number;\n  mouseY: number;\n  selectedComponentId: string | null;\n  componentMousedOver: IComponent | null;\n};\n\nexport default class KonvaGraph extends React.Component<Props, State> {\n  connectionFromComponent: IComponent;\n  connectionFromPort: IPort;\n  needRAF: boolean = false;\n  state = {\n    addingConnection: false,\n    mouseX: -1,\n    mouseY: -1,\n    selectedComponentId: null,\n    componentMousedOver: null,\n  };\n  stage: any;\n  connections: any\n\n  componentDidMount() {\n    window.addEventListener(\"keydown\", this.keyDown);\n    this.showConnections();\n  }\n\n  componentWillUnmount() {\n    window.removeEventListener(\"keydown\", this.keyDown);\n  }\n\n  componentWillReceiveProps(newProps: any) {\n    if (this.props.graph.id === newProps.graph.id) return;\n    this.hideConnections();\n  }\n\n  componentDidUpdate() {\n    this.showConnections();\n  }\n  \n  showConnections() {\n    setTimeout(() => {\n      this.connections.show();\n      this.stage.batchDraw();\n    }, 50);\n  }\n\n  hideConnections() {\n    this.connections.hide();\n    this.stage.batchDraw();\n  }\n\n  keyDown = (ev: KeyboardEvent) => {\n    if (ev.key === \"Esc\" || ev.key === \"Escape\" || ev.keyCode === 27) {\n      if (this.state.addingConnection) {\n        this.setState({\n          addingConnection: false\n        });\n      } else {\n        if (this.state.selectedComponentId) {\n          this.props.onComponentSelected(null);\n          this.setState({\n            selectedComponentId: null\n          });\n        }\n      }\n    }\n  };\n\n  // handle zoom with wheel\n  onWheel = (ev: KonvaEventObject<WheelEvent>) => {\n    ev.evt.preventDefault();\n    const scaleBy = 1.05;\n    const stage = this.stage as KonvaStage;\n    const oldScale = this.stage.scaleX();\n\n    const mousePointTo = {\n      x: stage.getPointerPosition().x / oldScale - stage.x() / oldScale,\n      y: stage.getPointerPosition().y / oldScale - stage.y() / oldScale\n    };\n\n    const newScale =\n      ev.evt.deltaY > 0 ? oldScale * scaleBy : oldScale / scaleBy;\n    stage.scale({ x: newScale, y: newScale });\n\n    const newPos = {\n      x: -(mousePointTo.x - stage.getPointerPosition().x / newScale) * newScale,\n      y: -(mousePointTo.y - stage.getPointerPosition().y / newScale) * newScale\n    };\n    stage.position(newPos);\n    stage.batchDraw();\n  };\n\n  getScaledPointerPosition = () => {\n    const pointerPosition = (this.stage as KonvaStage).getPointerPosition();\n    const stageX = (this.stage as KonvaStage).getAttr(\"x\");\n    const stageY = (this.stage as KonvaStage).getAttr(\"y\");\n    const stageScaleX = (this.stage as KonvaStage).getAttr(\"scaleX\");\n    const stageScaleY = (this.stage as KonvaStage).getAttr(\"scaleY\");\n\n    const x = (pointerPosition.x - stageX) / stageScaleX;\n    const y = (pointerPosition.y - stageY) / stageScaleY;\n    return { x, y };\n  };\n\n  onMouseMove = (ev: KonvaEventObject<MouseEvent>) => {\n    if (!this.stage || this.needRAF) {\n      return;\n    }\n    this.needRAF = true;\n    const position = this.getScaledPointerPosition();\n    requestAnimationFrame(() => {\n      this.setState(\n        {\n          // decrease 10 for the arrow to be a little behind the pointer\n          mouseX: position.x - 10,\n          mouseY: position.y\n        },\n        () => {\n          this.needRAF = false;\n        }\n      );\n    });\n  };\n\n  onMouseDown = (ev: KonvaEventObject<MouseEvent>) => {\n    // add connection if drop target is a Rect\n    let toComponent, toComponentId: string | any;\n    if (ev.target.getType() === \"Shape\") {\n      toComponentId = ev.target.name();\n      toComponent = this.props.graph.components.find((c: IComponent) => c.id === toComponentId)\n    }\n    if (toComponent && toComponentId) {\n      if (this.state.addingConnection) {\n        this.setState({\n          addingConnection: false\n        });\n        // create connection\n        this.props.onConnectionCreated({\n          fromPortId: this.connectionFromPort.id,\n          toComponentId: toComponentId,\n          fromComponentId: this.connectionFromComponent.id\n        });\n        return;\n      }\n      this.setState({\n        selectedComponentId: toComponentId\n      });\n      this.props.onComponentSelected(toComponent);\n      return;\n    } else {\n      this.setState({\n        addingConnection: false,\n        mouseX: -1,\n        mouseY: -1,\n      });\n    }\n  };\n\n  onConnectionStart = (component: IComponent, port: IPort) => {\n    this.connectionFromComponent = component;\n    this.connectionFromPort = port;\n    this.setState({\n      addingConnection: true,\n      selectedComponentId: component.id\n    });\n  };\n\n  onConnectionClicked = (component: IComponent, connection: IConnection) => {\n    this.props.onConnectionClicked(component, connection);\n  };\n\n  onComponentDeleted = (component: IComponent) => {\n    if (!component) {\n      return;\n    }\n    this.props.onComponentDeleted(component);\n  };\n\n  onComponentMousedOver = (component: IComponent, x: number, y: number) => {\n    this.setState({ componentMousedOver: component });\n  }\n\n  onComponentMousedOut = (component: IComponent) => {\n    this.setState({ componentMousedOver: null });\n  }\n\n  /*\n   * The module renders components of a graph with their connections\n   * \n   * */\n  render() {\n    const { graph, onComponentMoved, onComponentMoveFinished, onComponentSelected } = this.props;\n    const { height = 800, width = 800 } = graph;\n    const newConnectionInProgress =\n      this.state.addingConnection &&\n      this.connectionFromComponent &&\n      this.connectionFromPort;\n\n    // All connections that are rendered\n    const allConnections = graph.components.reduce(\n      (a: Array<IConnection>, component: IComponent) => {\n        return a.concat(component.connections || []);\n      },\n      []\n    )\n\n    return (\n      <Stage\n        onWheel={this.onWheel}\n        ref={stage => (this.stage = stage)}\n        onMouseDown={this.onMouseDown}\n        height={height}\n        width={width}\n        draggable\n        {...(this.state.addingConnection\n          ? { onMouseMove: this.onMouseMove }\n          : {})}\n      >\n        <Layer ref={layer => (this.connections = layer)} visible={false}>\n          {graph.components.map((component: IComponent) => {\n            // Group connections using their toComponentId\n            // Connections sharing a toComponentId are rendered as one\n            const connectionGroups =\n              this.computeConnectionGroups(component.connections);\n            \n            return connectionGroups.map(\n              (group: any) => group.connections.map((connection: IConnection, index: number) => {\n                const connectionsSharingPath =\n                  this.computeConnectionsSharingPath(connection, allConnections);\n                return (\n                  <Connection\n                    newConnection={false}\n                    key={`${component.id}-${connection.toComponentId}-${\n                      connection.fromPortId\n                    }-${index}`}\n                    index={index}\n                    fromComponent={component}\n                    toComponent={graph.components.find((c: IComponent) => c.id === connection.toComponentId)}\n                    connection={connection}\n                    connectionsSharingDirection={group.connections}\n                    connectionsSharingPath={connectionsSharingPath}\n                    onClick={this.onConnectionClicked}\n                  />\n                );\n              })\n            ) \n          }\n        )}\n        </Layer>\n        <FastLayer>\n          {newConnectionInProgress && (\n            <Connection\n              newConnection\n              fromComponent={this.connectionFromComponent}\n              fromPort={this.connectionFromPort}\n              mousePosition={{ x: this.state.mouseX, y: this.state.mouseY }}\n              componentMousedOver={this.state.componentMousedOver}\n            />\n          )}\n        </FastLayer>\n        <Layer>\n          {graph.components.map(component => (\n            <Component\n              key={component.id}\n              component={component}\n              newConnectionInProgress={Boolean(newConnectionInProgress)}\n              selectedComponentId={this.state.selectedComponentId}\n              onComponentMoved={onComponentMoved}\n              onComponentMoveFinished={onComponentMoveFinished}\n              onComponentDeleted={this.onComponentDeleted}\n              onConnectionStart={this.onConnectionStart}\n              onComponentMousedOver={this.onComponentMousedOver}\n              onComponentMousedOut={this.onComponentMousedOut}\n              onComponentSelected={onComponentSelected}\n            />\n          ))}\n        </Layer>\n      </Stage>\n    );\n  }\n\n  /*\n  * Returns, from an array of connections,\n  * those that share a path (or end components) with a given connection\n  *\n  */\n  computeConnectionsSharingPath(\n    connection: IConnection,\n    allConnections: Array<IConnection>\n  ) {\n    return allConnections.filter(c => (\n      (\n        c.fromComponentId === connection.fromComponentId &&\n        c.toComponentId === connection.toComponentId\n      ) ||\n      (\n        c.fromComponentId === connection.toComponentId &&\n        c.toComponentId === connection.fromComponentId\n      )\n    )).map(connection => {\n      const component: any = this.props.graph.components.find(\n        c => c.id === connection.fromComponentId\n      );\n      const definition = componentsByType[component.graphComponentId];\n      const port = definition.ports.find((port: any) => port.id === connection.fromPortId);;\n      return { ...connection, port }\n    })\n  }\n\n  /*\n  * Returns connections grouped using their toComponentId\n  *\n  */\n  computeConnectionGroups(connections: Array<IConnection>) {\n    const connectionGroups: Array<any> = [];\n    connections.forEach(connection => {\n      const connectionsSharingDirection = connections.filter(\n        c => c.toComponentId === connection.toComponentId\n      );\n      if (connectionGroups.find(\n        (group: any) => group.toComponentId === connection.toComponentId\n      )) {}\n      else connectionGroups.push({\n        toComponentId: connection.toComponentId,\n        connections: connectionsSharingDirection\n      });\n    });\n\n    return connectionGroups;\n  }\n\n}\n"]}