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PG,QAAS,EACTyO,WAAYX,EAAMY,YAAYC,OAAO,CAAC,oBAAqB,CACzDC,SAAU,OAETd,EAAMO,YAAY,OAAQ,CAC3BlO,gBAAiB,aAGtB,G","sources":["Components/GenerativeAI/libs/MindmapGenerator.js","Components/GenerativeAI/libs/Node.js","Components/GenerativeAI/utils/index.js","Components/Input/CommonSwitch.jsx","Components/Input/TwoWaySwitch.jsx"],"sourcesContent":["import { MarkerType } from \"reactflow\";\r\nimport { getId } from \"../../../CommanFunctions/commanFunctions\";\r\nimport { Algorithm } from \"../../DrawBoard/Edges/EditableEdge/constants\";\r\nimport { createTreeLayout } from \"../../../Utils/hooks/d3-hierarchy\";\r\nimport { color } from \"../../../Utils/style/color/color\";\r\nimport { treeViewNodeDesignData } from \"../../mind-map/sidebarComponents/MindMapPopup\";\r\n\r\nexport default class MindmapGenerator {\r\n constructor(\r\n designType = \"first\",\r\n direction = \"right\",\r\n boundingClient = { x: 0, y: 0, width: 0, height: 0 }\r\n ) {\r\n this.direction = direction;\r\n this.handleMapping = {\r\n top: \"aaa\",\r\n bottom: \"ddd\",\r\n left: \"bbb\",\r\n right: \"ccc\",\r\n };\r\n this.colors = [color.primaryColor, \"#9D69FF\", \"#14A9A4\"];\r\n this.boundingClient = boundingClient;\r\n this.designType = designType;\r\n this.childrenOrderKeys = [\r\n \"topChildrenOrder\",\r\n \"bottomChildrenOrder\",\r\n \"leftChildrenOrder\",\r\n \"rightChildrenOrder\",\r\n \"childrenOrder\",\r\n ];\r\n this.mindMapFlowDirection = {\r\n top: {\r\n sourceHandle: this.handleMapping[\"top\"],\r\n targetHandle: this.handleMapping[\"bottom\"],\r\n childKey: \"topChildrenOrder\",\r\n addition: \"vertical\",\r\n },\r\n bottom: {\r\n sourceHandle: this.handleMapping[\"bottom\"],\r\n targetHandle: this.handleMapping[\"top\"],\r\n childKey: \"bottomChildrenOrder\",\r\n addition: \"vertical\",\r\n },\r\n right: {\r\n sourceHandle: this.handleMapping[\"right\"],\r\n targetHandle: this.handleMapping[\"left\"],\r\n childKey: \"rightChildrenOrder\",\r\n addition: \"horizontal\",\r\n },\r\n left: {\r\n sourceHandle: this.handleMapping[\"left\"],\r\n targetHandle: this.handleMapping[\"right\"],\r\n childKey: \"leftChildrenOrder\",\r\n addition: \"horizontal\",\r\n },\r\n };\r\n this.designTypeSettings = {\r\n first: {\r\n edgeType: \"treeNodeEdgeType1\",\r\n algorithm: Algorithm.Linear,\r\n isColored: true,\r\n addition: this.mindMapFlowDirection[this.direction].addition,\r\n directionSettings: this.mindMapFlowDirection[this.direction],\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n borderColor: \"#9D69FF\",\r\n opacity: 1,\r\n radius: 25,\r\n },\r\n nodeStyle: {\r\n backgroundColor: \"transparent\",\r\n borderType: \"four\",\r\n },\r\n placeHolderColor: \"dark\",\r\n },\r\n second: {\r\n edgeType: \"treeNodeEdgeType2\",\r\n algorithm: Algorithm.BezierCatmullRom,\r\n isColored: false,\r\n addition: this.mindMapFlowDirection[this.direction].addition,\r\n edgeColor: \"rgb(25, 112, 242)\",\r\n directionSettings: this.mindMapFlowDirection[this.direction],\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n borderColor: \"rgb(25, 111, 242)\",\r\n opacity: 1,\r\n radius: 25,\r\n },\r\n nodeStyle: {\r\n backgroundColor: color?.primaryColor,\r\n borderType: \"four\",\r\n },\r\n placeHolderColor: \"light\",\r\n },\r\n third: {\r\n edgeType: \"treeNodeEdgeType3\",\r\n algorithm: Algorithm.BezierCatmullRom,\r\n isColored: false,\r\n addition: this.mindMapFlowDirection[this.direction].addition,\r\n edgeColor: \"rgb(126, 127, 130)\",\r\n directionSettings: this.mindMapFlowDirection[this.direction],\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n borderColor: \"#000\",\r\n opacity: 1,\r\n radius: 25,\r\n },\r\n nodeStyle: {\r\n backgroundColor: \"#9863FD\",\r\n borderType: \"four\",\r\n },\r\n placeHolderColor: \"light\",\r\n },\r\n four: {\r\n edgeType: \"step-edge\",\r\n algorithm: Algorithm.BezierCatmullRom,\r\n isColored: false,\r\n addition: this.mindMapFlowDirection[this.direction].addition,\r\n edgeColor: \"rgb(94, 108, 135)\",\r\n directionSettings: this.mindMapFlowDirection[this.direction],\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n borderColor: \"rgb(94, 108, 135)\",\r\n opacity: 1,\r\n radius: 10,\r\n },\r\n nodeStyle: {\r\n backgroundColor: \"#0884EC\",\r\n borderType: \"third\",\r\n },\r\n placeHolderColor: \"light\",\r\n },\r\n five: {\r\n edgeType: \"treeNodeEdgeType5\",\r\n algorithm: Algorithm.Linear,\r\n isColored: true,\r\n addition: this.mindMapFlowDirection[this.direction].addition,\r\n directionSettings: this.mindMapFlowDirection[this.direction],\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n borderColor: \"#FFF\",\r\n opacity: 1,\r\n radius: 10,\r\n },\r\n nodeStyle: {\r\n backgroundColor: \"#FFF\",\r\n borderType: \"third\",\r\n },\r\n placeHolderColor: \"dark\",\r\n },\r\n six: {\r\n edgeType: \"treeNodeEdgeType3\",\r\n algorithm: Algorithm.BezierCatmullRom,\r\n isColored: true,\r\n addition: this.mindMapFlowDirection[this.direction].addition,\r\n directionSettings: this.mindMapFlowDirection[this.direction],\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n borderColor: \"#555CFD\",\r\n opacity: 1,\r\n radius: 10,\r\n },\r\n nodeStyle: {\r\n backgroundColor: \"#555CFD\",\r\n borderType: \"third\",\r\n },\r\n placeHolderColor: \"light\",\r\n },\r\n seven: {\r\n edgeType: \"editable-edge\",\r\n algorithm: Algorithm.BezierCatmullRom,\r\n isColored: true,\r\n addition: this.mindMapFlowDirection[this.direction].addition,\r\n directionSettings: this.mindMapFlowDirection[this.direction],\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n borderColor: \"#555CFD\",\r\n opacity: 1,\r\n radius: 25,\r\n },\r\n nodeStyle: {\r\n backgroundColor: \"#FFF\",\r\n borderType: \"four\",\r\n },\r\n placeHolderColor: \"dark\",\r\n },\r\n eight: {\r\n edgeType: \"treeNodeEdgeType8\",\r\n algorithm: Algorithm.Linear,\r\n isColored: true,\r\n addition: this.mindMapFlowDirection[this.direction].addition,\r\n directionSettings: this.mindMapFlowDirection[this.direction],\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n borderColor: \"#5E6C87\",\r\n opacity: 1,\r\n radius: 10,\r\n },\r\n nodeStyle: {\r\n backgroundColor: \"#FFF\",\r\n borderType: \"third\",\r\n },\r\n placeHolderColor: \"dark\",\r\n },\r\n nine: {\r\n edgeType: \"editable-edge\",\r\n algorithm: Algorithm.BezierCatmullRom,\r\n isColored: true,\r\n addition: this.mindMapFlowDirection[this.direction].addition,\r\n directionSettings: this.mindMapFlowDirection[this.direction],\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n borderColor: color?.primaryColor,\r\n opacity: 1,\r\n radius: 25,\r\n },\r\n nodeStyle: {\r\n backgroundColor: color?.primaryColor,\r\n borderType: \"four\",\r\n },\r\n placeHolderColor: \"light\",\r\n },\r\n ten: {\r\n edgeType: \"step-edge\",\r\n algorithm: Algorithm.BezierCatmullRom,\r\n isColored: true,\r\n addition: this.mindMapFlowDirection[this.direction].addition,\r\n directionSettings: this.mindMapFlowDirection[this.direction],\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n borderColor: \"#9D69FF\",\r\n opacity: 1,\r\n radius: 10,\r\n },\r\n nodeStyle: {\r\n backgroundColor: \"#9D69FF\",\r\n borderType: \"third\",\r\n },\r\n placeHolderColor: \"light\",\r\n },\r\n };\r\n }\r\n\r\n getInitialPosition() {\r\n return {\r\n x: this.boundingClient.x + this.boundingClient.width + 500,\r\n y: 0,\r\n };\r\n }\r\n\r\n maxNodesInSingleLine(nodes) {\r\n let maxNodes = 0; // Store the maximum number of nodes in a line\r\n // Helper function to traverse the tree and count nodes on the left side\r\n function traverse(node, count) {\r\n // Increment count only if the node has side set to \"left\"\r\n if (node.data.side === \"left\") count++;\r\n\r\n // If the node has children, recursively traverse each child\r\n const children = node.data.leftChildrenOrder || [];\r\n children.forEach((child) => {\r\n traverse(child, count);\r\n });\r\n\r\n // Track the maximum number of nodes found in a line\r\n if (count > maxNodes) maxNodes = count;\r\n }\r\n\r\n nodes.forEach((node) => traverse(node, 0));\r\n\r\n return maxNodes;\r\n }\r\n\r\n generateMindmap(payload) {\r\n const { nodes, edges } = this.parseResponse(payload);\r\n\r\n const nodesHierarchy = this.generateHierarchy(nodes, edges);\r\n const updatedEdges = this.generateUpdatedEdges(edges, nodesHierarchy);\r\n const { nodes: treeLayoutNodes } = createTreeLayout(\r\n nodesHierarchy,\r\n nodesHierarchy[0]?.data?.rootParentId,\r\n nodesHierarchy[0]?.data?.addition\r\n );\r\n\r\n return {\r\n nodes: treeLayoutNodes,\r\n edges: updatedEdges,\r\n };\r\n }\r\n\r\n parseResponse(response) {\r\n const nodeRegex = /(\\d+):([A-Za-z\\s\\-]+(?=,| edges))/g;\r\n const edgeRegex = /(\\d+)-(\\d+)/g;\r\n const nodes = [];\r\n const edges = [];\r\n let match;\r\n\r\n while ((match = nodeRegex.exec(response)) !== null) {\r\n nodes.push({ id: match[1], label: match[2].trim() });\r\n }\r\n\r\n while ((match = edgeRegex.exec(response)) !== null) {\r\n edges.push({ from: match[1], to: match[2] });\r\n }\r\n\r\n return { nodes, edges };\r\n }\r\n\r\n processNodeMap(nodeMap) {\r\n // Helper function to get a new node structure\r\n const createNode = (node, parentNode, rootNodeId) => {\r\n const position = { x: 0, y: 0 };\r\n const {\r\n addition,\r\n isColored,\r\n edgeType,\r\n algorithm,\r\n border = null,\r\n placeHolderColor,\r\n nodeStyle,\r\n } = this.designTypeSettings[this.designType];\r\n const fontSize = node.id === rootNodeId ? 16 : 12;\r\n\r\n const canvas = document.createElement(\"canvas\");\r\n const context = canvas.getContext(\"2d\");\r\n context.font = `${fontSize}px DM Sans`;\r\n const offset = node.id === rootNodeId ? 45 : 25;\r\n const width = context.measureText(node.label).width + offset;\r\n\r\n const height = 44;\r\n return {\r\n id: node.id,\r\n type: \"TreeView\",\r\n data: {\r\n rootParentId: rootNodeId,\r\n isAiGenerated: true,\r\n isGeneratedThroughAI: true,\r\n childrenOrder: [],\r\n label: node.label,\r\n applyEdgeColor: true,\r\n addition: addition,\r\n childNodeType: \"TreeView\",\r\n designType: this.designType,\r\n edgeAlgorithm: algorithm,\r\n autoLayout: true,\r\n edgeColor: this.getEdgeStrokeColor(isColored),\r\n edgeType: edgeType,\r\n type: node.id === rootNodeId ? \"parent\" : \"child\",\r\n border: border,\r\n showBorder: true,\r\n nodeStyle: {\r\n ...nodeStyle,\r\n backgroundColor:\r\n node.id === rootNodeId\r\n ? nodeStyle.backgroundColor\r\n : \"transparent\",\r\n },\r\n placeHolderColor: placeHolderColor,\r\n },\r\n position: position,\r\n positionAbsolute: position,\r\n draggable: true,\r\n width: width,\r\n height: height,\r\n selected: false,\r\n parentNode: parentNode,\r\n };\r\n };\r\n\r\n const rootId = Object.keys(nodeMap)[0];\r\n const rootNode = nodeMap[rootId];\r\n\r\n // Initialize stack for iterative processing\r\n const stack = [\r\n { node: rootNode, parentNode: null, rootNodeId: rootNode.id },\r\n ];\r\n const nodesMap = {}; // Track processed nodes for nesting\r\n\r\n // Ensure the root node is initialized\r\n nodesMap[rootNode.id] = createNode(rootNode, null, rootNode.id);\r\n\r\n // Iterate while the stack has nodes to process\r\n while (stack.length > 0) {\r\n const { node, parentNode, rootNodeId } = stack.pop();\r\n const newNode = createNode(node, parentNode, rootNodeId);\r\n\r\n // Initialize the parent node's children array if needed\r\n if (parentNode) {\r\n if (!nodesMap[parentNode]) {\r\n nodesMap[parentNode] = createNode(\r\n { id: parentNode },\r\n null,\r\n rootNodeId\r\n );\r\n }\r\n if (!nodesMap[parentNode].data.children) {\r\n nodesMap[parentNode].data.children = [];\r\n }\r\n\r\n nodesMap[parentNode].data.children.push(newNode);\r\n }\r\n\r\n // Add children to the stack for further processing\r\n if (node.children && node.children.length > 0) {\r\n node.children.forEach((child) => {\r\n stack.push({\r\n node: child,\r\n parentNode: newNode.id,\r\n rootNodeId,\r\n });\r\n });\r\n }\r\n\r\n // Add the new node to nodesMap if not already present\r\n nodesMap[newNode.id] = newNode;\r\n }\r\n\r\n // Get the final root node from the map\r\n const mindMapRoot = {\r\n ...nodesMap[rootNode.id],\r\n isRootNode: true,\r\n };\r\n\r\n return mindMapRoot;\r\n }\r\n\r\n splitChildren(children) {\r\n const half = Math.ceil(children.length / 2);\r\n return {\r\n leftChildrenOrder: children.slice(half),\r\n rightChildrenOrder: children.slice(0, half),\r\n };\r\n }\r\n\r\n renameChildrenKey(node, key = \"rightChildrenOrder\") {\r\n let side = \"right\";\r\n if (key === \"leftChildrenOrder\") {\r\n side = \"left\";\r\n }\r\n let n = {\r\n ...node,\r\n data: {\r\n ...node.data,\r\n [key]: node.data.children || [],\r\n side: side,\r\n },\r\n };\r\n delete n.data.children;\r\n\r\n n.data[key] = n.data[key].map((child) =>\r\n this.renameChildrenKey(child, key)\r\n );\r\n return n;\r\n }\r\n\r\n flattenChildren(node) {\r\n const leftChildrenOrder = node.data?.leftChildrenOrder;\r\n const rightChildrenOrder = node.data?.rightChildrenOrder;\r\n\r\n return [\r\n ...(leftChildrenOrder || []),\r\n ...(rightChildrenOrder || []),\r\n ...(leftChildrenOrder?.flatMap((child) => this.flattenChildren(child)) ||\r\n []),\r\n ...(rightChildrenOrder?.flatMap((child) => this.flattenChildren(child)) ||\r\n []),\r\n ];\r\n }\r\n\r\n generateHierarchy(nodes, edges) {\r\n const idMap = this.generateUniqueIds(nodes);\r\n this.updateEdgesWithNewIds(edges, idMap);\r\n const nodeMap = this.createNodeMap(nodes);\r\n this.populateChildren(edges, nodeMap);\r\n let rootNode = this.processNodeMap(nodeMap);\r\n\r\n const { leftChildrenOrder, rightChildrenOrder } = this.splitChildren(\r\n rootNode.data.children\r\n );\r\n\r\n rootNode = {\r\n ...rootNode,\r\n data: {\r\n ...rootNode.data,\r\n leftChildrenOrder: leftChildrenOrder.map((child) =>\r\n this.renameChildrenKey(child, \"leftChildrenOrder\")\r\n ),\r\n rightChildrenOrder: rightChildrenOrder.map((child) =>\r\n this.renameChildrenKey(child, \"rightChildrenOrder\")\r\n ),\r\n // side: 'left',\r\n },\r\n };\r\n delete rootNode.data.children;\r\n delete rootNode.parentNode;\r\n delete rootNode.isRootNode;\r\n\r\n const flatData = this.flattenChildren(rootNode);\r\n\r\n const initialPosition = this.getInitialPosition();\r\n const maxLeftNodes = this.maxNodesInSingleLine(flatData);\r\n\r\n const rootNodeInitialPosition = {\r\n x:\r\n this.boundingClient.x +\r\n this.boundingClient.width +\r\n maxLeftNodes * 300 +\r\n 500,\r\n y: initialPosition.y,\r\n };\r\n\r\n rootNode = {\r\n ...rootNode,\r\n position: rootNodeInitialPosition,\r\n positionAbsolute: rootNodeInitialPosition,\r\n };\r\n\r\n const nodesHierarchy = [rootNode, ...flatData];\r\n\r\n return nodesHierarchy;\r\n }\r\n\r\n generateUniqueIds(nodes) {\r\n const idMap = {};\r\n nodes.forEach((node) => {\r\n const newId = getId();\r\n idMap[node.id] = newId;\r\n node.id = newId;\r\n });\r\n return idMap;\r\n }\r\n\r\n updateEdgesWithNewIds(edges, idMap) {\r\n edges.forEach((edge) => {\r\n edge.from = idMap[edge.from];\r\n edge.to = idMap[edge.to];\r\n });\r\n }\r\n\r\n createNodeMap(nodes) {\r\n return nodes.reduce((acc, node) => {\r\n acc[node.id] = { ...node, children: [] };\r\n return acc;\r\n }, {});\r\n }\r\n\r\n populateChildren(edges, nodeMap) {\r\n edges.forEach((edge) => {\r\n if (nodeMap[edge.from] && nodeMap[edge.to]) {\r\n nodeMap[edge.from].children.push(nodeMap[edge.to]);\r\n }\r\n });\r\n }\r\n\r\n getEdgeStrokeColor(isColored = false) {\r\n return isColored\r\n ? this.colors[Math.floor(Math.random() * this.colors.length)]\r\n : this.designTypeSettings[this.designType].edgeColor;\r\n }\r\n\r\n generateUpdatedEdges(edges, nodes) {\r\n return edges.map((edge) => {\r\n const { isColored, edgeType, algorithm } =\r\n this.designTypeSettings[this.designType];\r\n const direction =\r\n nodes.find((node) => node.id === edge.to)?.data?.side ?? \"right\";\r\n const fromRoot =\r\n nodes.find((node) => node.id === edge.from)?.data.type === \"parent\"\r\n ? true\r\n : false;\r\n const { sourceHandle, targetHandle } =\r\n this.mindMapFlowDirection[direction];\r\n const edgeStrokeColor = this.getEdgeStrokeColor(isColored);\r\n return {\r\n id: getId(),\r\n type: edgeType,\r\n markerStart: {\r\n color: edgeStrokeColor,\r\n },\r\n markerEnd: {\r\n type: MarkerType.ArrowClosed,\r\n color: edgeStrokeColor,\r\n },\r\n selected: false,\r\n data: {\r\n animate: false,\r\n isTreeView: true,\r\n animationDirection: \"ltr\",\r\n algorithm: algorithm,\r\n isDashed: false,\r\n points: [],\r\n fromRoot: fromRoot,\r\n side: sourceHandle === this.handleMapping[\"left\"] ? \"left\" : \"right\",\r\n rootParentId: nodes[0]?.data?.rootParentId,\r\n },\r\n style: {\r\n stroke: edgeStrokeColor,\r\n strokeWidth: 1.5,\r\n strokeLinecap: \"butt\",\r\n },\r\n sourceHandle: sourceHandle,\r\n targetHandle: targetHandle,\r\n source: edge.from,\r\n target: edge.to,\r\n };\r\n });\r\n }\r\n\r\n calculateCenterPosition(boundingClient) {\r\n return {\r\n x: boundingClient.x + boundingClient.width + 400,\r\n y: boundingClient.y,\r\n };\r\n }\r\n\r\n updateEdgesDesignType(edges) {\r\n return edges.map((edge) => {\r\n if (edge.data.isTreeView && edge.selected) {\r\n const { edgeType, algorithm, isColored } =\r\n this.designTypeSettings[this.designType];\r\n const edgeStrokeColor = this.getEdgeStrokeColor(isColored);\r\n return {\r\n ...edge,\r\n type: edgeType,\r\n markerStart: {\r\n ...edge.markerStart,\r\n color: edgeStrokeColor,\r\n },\r\n markerEnd: {\r\n ...edge.markerEnd,\r\n color: edgeStrokeColor,\r\n },\r\n data: {\r\n ...edge.data,\r\n algorithm: algorithm,\r\n },\r\n style: {\r\n ...edge.style,\r\n stroke: edgeStrokeColor,\r\n },\r\n };\r\n }\r\n return edge;\r\n });\r\n }\r\n\r\n updateNodesDesignType(nodes) {\r\n const createFormattedNode = (node, idx) => {\r\n if (node.selected && node.type === \"TreeView\") {\r\n const { addition, algorithm, isColored, edgeType } =\r\n this.designTypeSettings[this.designType];\r\n\r\n const bgColor =\r\n this.designType === \"second\"\r\n ? [\"rgb(25, 111, 242)\"]\r\n : this.designType === \"third\"\r\n ? [\"rgb(126, 127, 130)\"]\r\n : this.designType === \"first\" ||\r\n this.designType === \"four\" ||\r\n this.designType === \"five\" ||\r\n this.designType === \"seven\" ||\r\n this.designType === \"eight\" ||\r\n this.designType === \"ten\"\r\n ? [\"transparent\"]\r\n : // : this.designType === \"eight\"\r\n // ? [\"rgb(0, 122, 255)\"]\r\n [\"#9D69FF\", \"#00A3FF\", \"#14A9A4\"];\r\n\r\n const color =\r\n this.designType === \"second\"\r\n ? [\"rgb(25, 111, 242)\"]\r\n : this.designType === \"third\"\r\n ? [\"rgb(126, 127, 130)\"]\r\n : this.designType === \"four\"\r\n ? [\"rgb(94, 108, 135)\"]\r\n : this.designType === \"eight\"\r\n ? [\"rgb(0, 122, 255)\"]\r\n : [\"#9D69FF\", \"#00A3FF\", \"#14A9A4\"];\r\n\r\n const borderStyle =\r\n // this.designType === \"first\" ||\r\n this.designType === \"second\" ||\r\n this.designType === \"four\" ||\r\n this.designType === \"seven\" ||\r\n this.designType === \"ten\"\r\n ? \"solid\"\r\n : \"none\";\r\n\r\n const borderRadius =\r\n this.designType === \"first\" ||\r\n this.designType === \"second\" ||\r\n this.designType === \"third\" ||\r\n this.designType === \"seven\" ||\r\n this.designType === \"nine\"\r\n ? \"25px\"\r\n : this.designType === \"four\" ||\r\n this.designType === \"six\" ||\r\n this.designType === \"ten\"\r\n ? \"10px\"\r\n : \"0px\";\r\n\r\n const borderType =\r\n this.designType === \"first\" ||\r\n this.designType === \"second\" ||\r\n this.designType === \"third\" ||\r\n this.designType === \"seven\" ||\r\n this.designType === \"nine\"\r\n ? \"four\"\r\n : this.designType === \"four\" ||\r\n this.designType === \"six\" ||\r\n this.designType === \"ten\"\r\n ? \"third\"\r\n : this.designType === \"eight\"\r\n ? \"second\"\r\n : \"first\";\r\n\r\n const placeHolderColor =\r\n this.designType === \"six\" || this.designType === \"nine\"\r\n ? \"light\"\r\n : this.designType === \"second\"\r\n ? \"blue\"\r\n : \"dark\";\r\n\r\n const n = {\r\n ...node,\r\n data: {\r\n ...node.data,\r\n addition: addition,\r\n designType: this.designType,\r\n edgeAlgorithm: algorithm,\r\n edgeType: edgeType,\r\n ...node.data.rootParentId === node.id ? treeViewNodeDesignData[this.designType] : {\r\n showBorder: borderStyle !== 'none',\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n radius: borderRadius,\r\n borderColor: color[idx % color.length],\r\n opacity: 1,\r\n },\r\n nodeStyle: {\r\n backgroundColor: bgColor[idx % bgColor.length],\r\n borderType: borderType,\r\n },\r\n edgeColor: color[idx % color.length],\r\n placeHolderColor: placeHolderColor,\r\n }\r\n },\r\n };\r\n\r\n const childrenKeysExistsInNodeData = this.childrenOrderKeys.filter(\r\n (key) => node.data[key]\r\n );\r\n\r\n if (childrenKeysExistsInNodeData.length) {\r\n childrenKeysExistsInNodeData.forEach((key, idx) => {\r\n if (n.data[key].length)\r\n n.data[key] = node.data[key]?.map((child) =>\r\n createFormattedNode(child, idx)\r\n );\r\n });\r\n }\r\n return n;\r\n }\r\n return node;\r\n };\r\n\r\n return nodes.map((node, idx) => createFormattedNode(node, idx));\r\n }\r\n\r\n static generate(\r\n payload,\r\n { boundingClient, designType = \"seven\", direction = \"right\" } = {}\r\n ) {\r\n const generator = new MindmapGenerator(\r\n designType,\r\n direction,\r\n boundingClient\r\n );\r\n return generator.generateMindmap(payload);\r\n }\r\n\r\n static updateDesignType(designType, nodes, edges) {\r\n const generator = new MindmapGenerator(designType);\r\n const updatedNodes = generator.updateNodesDesignType(nodes);\r\n const updatedEdges = generator.updateEdgesDesignType(edges);\r\n\r\n return {\r\n nodes: updatedNodes,\r\n edges: updatedEdges,\r\n };\r\n }\r\n\r\n expandNodes(payload, currentNode, rootParentId, parentNodeId, addition) {\r\n const regex = /\\d+\\.\\s+([^\\n]+)/g;\r\n let match;\r\n const labelsArray = [];\r\n\r\n // Parse the string\r\n while ((match = regex.exec(payload)) !== null) {\r\n labelsArray.push(match[1].trim());\r\n }\r\n\r\n const { isColored, edgeType, algorithm, border } =\r\n this.designTypeSettings[this.designType];\r\n\r\n const mid = Math.floor(labelsArray.length / 2);\r\n\r\n const nodes = labelsArray.map((label, idx) => {\r\n let positionAbsolute;\r\n\r\n positionAbsolute = {\r\n x: 0,\r\n y: 0,\r\n };\r\n\r\n const fontSize = 12;\r\n const canvas = document.createElement(\"canvas\");\r\n const context = canvas.getContext(\"2d\");\r\n context.font = `${fontSize}px DM Sans`;\r\n const measure = context.measureText(label).width;\r\n\r\n const width = measure;\r\n const height = 44;\r\n\r\n const getExpandeNodeSide = () => {\r\n if (parentNodeId === rootParentId) {\r\n let side = addition === \"horizontal\" ? \"left\" : \"top\";\r\n if (idx >= mid) {\r\n side = addition === \"horizontal\" ? \"right\" : \"bottom\";\r\n }\r\n return side;\r\n }\r\n return this.direction;\r\n };\r\n\r\n const bgColor =\r\n this.designType === \"second\"\r\n ? [\"rgb(25, 111, 242)\"]\r\n : this.designType === \"third\"\r\n ? [\"rgb(126, 127, 130)\"]\r\n : this.designType === \"first\" ||\r\n this.designType === \"four\" ||\r\n this.designType === \"five\" ||\r\n this.designType === \"seven\" ||\r\n this.designType === \"eight\" ||\r\n this.designType === \"ten\"\r\n ? [\"transparent\"]\r\n : // : this.designType === \"eight\"\r\n // ? [\"rgb(0, 122, 255)\"]\r\n [\"#9D69FF\", \"#00A3FF\", \"#14A9A4\"];\r\n\r\n const color =\r\n this.designType === \"second\"\r\n ? [\"rgb(25, 111, 242)\"]\r\n : this.designType === \"third\"\r\n ? [\"rgb(126, 127, 130)\"]\r\n : this.designType === \"four\"\r\n ? [\"rgb(94, 108, 135)\"]\r\n : this.designType === \"eight\"\r\n ? [\"rgb(0, 122, 255)\"]\r\n : [\"#9D69FF\", \"#00A3FF\", \"#14A9A4\"];\r\n\r\n const borderStyle =\r\n // this.designType === \"first\" ||\r\n this.designType === \"second\" ||\r\n this.designType === \"four\" ||\r\n this.designType === \"seven\" ||\r\n this.designType === \"ten\"\r\n ? \"solid\"\r\n : \"none\";\r\n\r\n const borderRadius =\r\n this.designType === \"first\" ||\r\n this.designType === \"second\" ||\r\n this.designType === \"third\" ||\r\n this.designType === \"seven\" ||\r\n this.designType === \"nine\"\r\n ? \"25px\"\r\n : this.designType === \"four\" ||\r\n this.designType === \"six\" ||\r\n this.designType === \"ten\"\r\n ? \"10px\"\r\n : \"0px\";\r\n\r\n const borderType =\r\n this.designType === \"first\" ||\r\n this.designType === \"second\" ||\r\n this.designType === \"third\" ||\r\n this.designType === \"seven\" ||\r\n this.designType === \"nine\"\r\n ? \"four\"\r\n : this.designType === \"four\" ||\r\n this.designType === \"six\" ||\r\n this.designType === \"ten\"\r\n ? \"third\"\r\n : this.designType === \"eight\"\r\n ? \"second\"\r\n : \"first\";\r\n\r\n const placeHolderColor =\r\n this.designType === \"six\" || this.designType === \"nine\"\r\n ? \"light\"\r\n : this.designType === \"second\"\r\n ? \"blue\"\r\n : \"dark\";\r\n\r\n return {\r\n id: getId(),\r\n type: \"TreeView\",\r\n data: {\r\n rootParentId: rootParentId,\r\n isAiGenerated: true,\r\n isGeneratedThroughAI: true,\r\n childrenOrder: [],\r\n label: label,\r\n applyEdgeColor: true,\r\n addition: addition,\r\n childNodeType: \"TreeView\",\r\n designType: this.designType,\r\n autoLayout: currentNode?.data?.autoLayout,\r\n edgeAlgorithm: algorithm,\r\n edgeType: edgeType,\r\n type: \"child\",\r\n side: getExpandeNodeSide(),\r\n showBorder: borderStyle !== 'none',\r\n border: {\r\n width: 2,\r\n type: \"solid\",\r\n radius: borderRadius,\r\n borderColor: color[idx % color.length],\r\n opacity: 1,\r\n },\r\n nodeStyle: {\r\n backgroundColor: bgColor[idx % bgColor.length],\r\n borderType: borderType,\r\n },\r\n edgeColor: color[idx % color.length],\r\n placeHolderColor: placeHolderColor,\r\n },\r\n position: positionAbsolute,\r\n positionAbsolute: positionAbsolute,\r\n draggable: true,\r\n width,\r\n height,\r\n selected: false,\r\n parentNode: parentNodeId,\r\n };\r\n });\r\n\r\n const edges = nodes.map((node) => {\r\n const { isColored, edgeType, algorithm } =\r\n this.designTypeSettings[this.designType];\r\n const fromRoot =\r\n nodes.find((node) => node.id === currentNode.id)?.data.type === \"parent\"\r\n ? true\r\n : false;\r\n let { sourceHandle, targetHandle } =\r\n this.mindMapFlowDirection[this.direction];\r\n const edgeStrokeColor = this.getEdgeStrokeColor(isColored);\r\n\r\n if (\r\n node.parentNode === currentNode.id &&\r\n currentNode.id === rootParentId\r\n ) {\r\n if (addition === \"horizontal\") {\r\n sourceHandle = this.handleMapping[node.data.side];\r\n targetHandle =\r\n this.handleMapping[node.data.side === \"left\" ? \"right\" : \"left\"];\r\n }\r\n if (addition === \"vertical\") {\r\n sourceHandle =\r\n this.handleMapping[node.data.side === \"top\" ? \"top\" : \"bottom\"];\r\n targetHandle =\r\n this.handleMapping[node.data.side === \"top\" ? \"bottom\" : \"top\"];\r\n }\r\n }\r\n\r\n return {\r\n id: getId(),\r\n type: edgeType,\r\n markerStart: {\r\n color: edgeStrokeColor,\r\n },\r\n markerEnd: {\r\n type: MarkerType.ArrowClosed,\r\n color: edgeStrokeColor,\r\n },\r\n selected: false,\r\n data: {\r\n animate: false,\r\n isTreeView: true,\r\n animationDirection: \"ltr\",\r\n algorithm: algorithm,\r\n isDashed: false,\r\n points: [],\r\n fromRoot: currentNode.id === rootParentId ? true : false,\r\n rootParentId: nodes[0]?.data?.rootParentId,\r\n side: node.data.side,\r\n // side: sourceHandle === this.handleMapping[\"left\"] ? \"left\" : \"right\",\r\n },\r\n style: {\r\n stroke: edgeStrokeColor,\r\n strokeWidth: 1.5,\r\n strokeLinecap: \"butt\",\r\n },\r\n sourceHandle: sourceHandle,\r\n targetHandle: targetHandle,\r\n source: currentNode.id,\r\n target: node.id,\r\n };\r\n });\r\n\r\n return { nodes: nodes, edges: edges };\r\n }\r\n\r\n static expand({\r\n payload,\r\n rootParentId,\r\n parentNodeId,\r\n designType,\r\n direction,\r\n currentNode,\r\n addition,\r\n }) {\r\n const generator = new MindmapGenerator(designType, direction);\r\n return generator.expandNodes(\r\n payload,\r\n currentNode,\r\n rootParentId,\r\n parentNodeId,\r\n addition\r\n );\r\n }\r\n}\r\n","export class Node {\r\n\r\n /**\r\n * @param {Object} options\r\n * @param {number} options.height - Node height\r\n * @param {number} options.width - Node width\r\n * @param {string} options.backgroundColor - Node background color\r\n * @param {string} options.nodeType - type of node\r\n * @param {string} options.uid - Unique identifier\r\n * @param {string} options.id - Unique identifier\r\n * @param {string} options.key - Unique identifier\r\n * @param {string} options.label - Node text\r\n * @param {string} [options.type='resizable'] - Node type\r\n * @param {number} [options.fontSize=null] - Node font size\r\n * @param {string} [options.iconStyle='3D'] - Node icon style\r\n * @param {string} [options.iconType='THIRD_DIMENSION'] - Node icon type\r\n * @param {string} [options.provider='shapes'] - Node provider\r\n * @param {string} [options.category='flowcharts_and_containers_shapes'] - Node category\r\n * @param {string} [options.textAlignment='center'] - Text Alignment\r\n * @returns {Object} Node object\r\n */\r\n constructor({ height, width, backgroundColor, nodeType, uid, id, key, label, type = 'resizable', fontSize = null, iconStyle = '3D', iconType = 'THIRD_DIMENSION', provider = \"shapes\", category = \"flowcharts_and_containers_shapes\", textAlignment = 'center' }) {\r\n this.backgroundColor = backgroundColor;\r\n this.key = key;\r\n this.label = label;\r\n this.height = height;\r\n this.width = width;\r\n this.fontSize = fontSize;\r\n this.iconStyle = iconStyle;\r\n this.iconType = iconType;\r\n this.category = category;\r\n this.provider = provider;\r\n this.textAlignment = textAlignment;\r\n this.occupiedHandles = {};\r\n\r\n return {\r\n nodeType: nodeType,\r\n uid: uid,\r\n id: id,\r\n key: key,\r\n data: this.NodeData,\r\n name: label,\r\n type: type,\r\n style: {\r\n height: height,\r\n width: width,\r\n zIndex: 1000,\r\n padding: 0,\r\n background: \"transparent\",\r\n borderWidth: 0,\r\n fontSize: fontSize\r\n },\r\n width: width,\r\n height: height,\r\n fields: {},\r\n dragging: false,\r\n position: this.Positions,\r\n selected: false,\r\n lastModified: Date.now(),\r\n teraFormData: {},\r\n positionAbsolute: this.Positions,\r\n\r\n }\r\n }\r\n\r\n /**\r\n * Returns an object containing the data for the node in a flowchart.\r\n *\r\n * @return {Object} An object with the following properties:\r\n * - key: The unique identifier for the node.\r\n * - name: The name of the node.\r\n * - color: The color of the node.\r\n * - style: The style object for the node.\r\n * - height: The height of the node.\r\n * - width: The width of the node.\r\n * - catagory: The category of the node.\r\n * - provider: The provider of the node.\r\n * - editorHTML: The HTML content for the node's editor.\r\n * - isAutoFont: Whether the font size is automatically set.\r\n * - editorState: The state of the node's editor.\r\n * - maxPosition: The maximum position of the node.\r\n * - lastFontSize: The last font size used for the node.\r\n */\r\n get NodeData() {\r\n let html = `
${this.label}
`\r\n return {\r\n key: this.key,\r\n name: this.label,\r\n color: \"#18181B\",\r\n style: this.Styles,\r\n height: this.height,\r\n width: this.width,\r\n catagory: this.category,\r\n provider: this.provider,\r\n editorHTML: html,\r\n isAutoFont: true,\r\n isAiGenerated: true,\r\n isGeneratedThroughAI: true,\r\n maxPosition: this.Positions,\r\n iconStyle: this.iconStyle,\r\n iconType: this.iconType\r\n }\r\n }\r\n\r\n /**\r\n * Returns an object containing the styles for the component.\r\n *\r\n * @return {Object} An object with the following properties:\r\n * - color: The color of the text.\r\n * - padding: The padding of the component.\r\n * - boxShadow: The box shadow of the component.\r\n * - iconBg: The background color of the icon.\r\n * - fontStyle: The font style of the text.\r\n * - textAlign: The text alignment of the component.\r\n * - background: The background color of the component.\r\n * - fontWeight: The font weight of the text.\r\n * - lineHeight: The line height of the text.\r\n * - textDecoration: The text decoration of the component.\r\n */\r\n get Styles() {\r\n return {\r\n color: \"#18181B\",\r\n padding: \"6px 8px\",\r\n boxShadow: \"0px 4px 4px 0px #0000001F\",\r\n // iconBg: this.backgroundColor,\r\n fontStyle: \"normal\",\r\n textAlign: \"start\",\r\n background: this.backgroundColor,\r\n fontWeight: 500,\r\n lineHeight: \"14px !important\",\r\n textDecoration: \"none\",\r\n fontSize: this.fontSize\r\n }\r\n }\r\n\r\n /**\r\n * Returns an object containing the initial position of the component.\r\n *\r\n * @return {Object} An object with the following properties:\r\n * - x: The initial x-coordinate of the component.\r\n * - y: The initial y-coordinate of the component.\r\n */\r\n get Positions() {\r\n return { x: 0, y: 0 }\r\n }\r\n}","export function getNodesBoundingClient(nodes = []) {\r\n if (nodes.length)\r\n return nodes.reduce(\r\n (acc, node) => {\r\n const { x, y } = node.position;\r\n const { width, height } = node;\r\n\r\n // Calculate the min and max boundaries for x and y\r\n const minX = Math.min(acc.x, x);\r\n const minY = Math.min(acc.y, y);\r\n const maxX = Math.max(acc.x + acc.width, x + width);\r\n const maxY = Math.max(acc.y + acc.height, y + height);\r\n\r\n return {\r\n x: minX || 0,\r\n y: minY || 0,\r\n width: maxX - minX || 0,\r\n height: maxY - minY || 0,\r\n };\r\n },\r\n {\r\n x: nodes[0].position.x,\r\n y: nodes[0].position.y,\r\n width: nodes[0].width,\r\n height: nodes[0].height,\r\n }\r\n );\r\n else\r\n return {\r\n x: 0,\r\n y: 0,\r\n height: 0,\r\n width: 0\r\n }\r\n}","import { Switch, styled } from \"@mui/material\";\r\nimport { color } from \"../../Utils/style/color/color\";\r\n\r\nconst CommonSwitch = styled((props) => (\r\n