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A,GAAA,CACjC8K,QAAS,IACNR,EAAMU,YAAY,OAAQ,CAC3BF,QAAS,OAIf,sCAAuC,CACrCpI,MAAO,WAET,mCAAiC1C,EAAAA,EAAAA,GAAA,CAC/B0C,MAAO4H,EAAMW,QAAQC,KAAK,MACvBZ,EAAMU,YAAY,OAAQ,CAC3BtI,MAAO4H,EAAMW,QAAQC,KAAK,QAG9B,qCAAmClL,EAAAA,EAAAA,GAAA,CACjC8K,QAAS,IACNR,EAAMU,YAAY,OAAQ,CAC3BF,QAAS,OAIf,qBAAsB,CACpBK,UAAW,aACXpR,MAAO,GACPC,OAAQ,GACR0I,MAAO,SAET,sBAAoB1C,EAAAA,EAAAA,GAAA,CAClBoL,aAAc,GACdlE,gBAAsB,OAALxE,EAAAA,QAAK,IAALA,EAAAA,OAAK,EAALA,EAAAA,EAAO6J,UACxBxB,OAAO,OACPD,QAAS,EACTO,WAAYf,EAAMgB,YAAYC,OAAO,CAAC,oBAAqB,CACzDC,SAAU,OAETlB,EAAMU,YAAY,OAAQ,CAC3B9D,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\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 = [\"#00A3FF\", \"#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 },\r\n second: {\r\n edgeType: \"editable-edge\",\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 },\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 { addition, isColored, edgeType, algorithm } =\r\n this.designTypeSettings[this.designType];\r\n const fontSize = 16;\r\n const width = fontSize * node.label.length * 0.65;\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 edgeColor: this.getEdgeStrokeColor(isColored),\r\n edgeType: edgeType,\r\n type: node.id === rootNodeId ? \"parent\" : \"child\",\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) => {\r\n if (node.selected && node.type === \"TreeView\") {\r\n const { addition, algorithm, isColored, edgeType } =\r\n this.designTypeSettings[this.designType];\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 edgeColor: this.getEdgeStrokeColor(isColored),\r\n edgeType: edgeType,\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) => {\r\n if (n.data[key].length)\r\n n.data[key] = node.data[key]?.map((child) =>\r\n createFormattedNode(child)\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) => createFormattedNode(node));\r\n }\r\n\r\n static generate(\r\n payload,\r\n { boundingClient, designType = \"first\", 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) {\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 { addition, isColored, edgeType, algorithm } =\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 const additionalYOffset = idx < mid ? -(75 * idx) : 75 * idx;\r\n\r\n positionAbsolute = {\r\n x: currentNode.position.x + 250,\r\n y: currentNode.position.y + additionalYOffset,\r\n };\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 edgeAlgorithm: algorithm,\r\n edgeColor: this.getEdgeStrokeColor(isColored),\r\n edgeType: edgeType,\r\n type: \"child\",\r\n side: this.direction,\r\n },\r\n position: positionAbsolute,\r\n positionAbsolute: positionAbsolute,\r\n draggable: true,\r\n width: 0,\r\n height: 0,\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 const { sourceHandle, targetHandle } =\r\n this.mindMapFlowDirection[this.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 rootParentId: nodes[0]?.data?.rootParentId,\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 }) {\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 );\r\n }\r\n}\r\n","class EditorState {\r\n constructor() {\r\n return {\r\n _immutable: {\r\n treeMap: {\r\n key1: [\r\n {\r\n end: 0,\r\n start: 0,\r\n leaves: [\r\n {\r\n end: 0,\r\n start: 0,\r\n },\r\n ],\r\n decoratorKey: null,\r\n },\r\n ],\r\n },\r\n allowUndo: true,\r\n decorator: null,\r\n redoStack: [],\r\n selection: {\r\n focusKey: \"key1\",\r\n hasFocus: false,\r\n anchorKey: \"key1\",\r\n isBackward: false,\r\n focusOffset: 0,\r\n anchorOffset: 0,\r\n },\r\n undoStack: [],\r\n directionMap: {\r\n key1: \"LTR\",\r\n },\r\n currentContent: {\r\n blockMap: {\r\n key1: {\r\n key: \"key1\",\r\n data: {},\r\n text: \"\",\r\n type: \"unstyled\",\r\n depth: 0,\r\n characterList: [],\r\n },\r\n },\r\n entityMap: {},\r\n selectionAfter: {\r\n focusKey: \"key1\",\r\n hasFocus: false,\r\n anchorKey: \"key1\",\r\n isBackward: false,\r\n focusOffset: 0,\r\n anchorOffset: 0,\r\n },\r\n selectionBefore: {\r\n focusKey: \"key1\",\r\n hasFocus: false,\r\n anchorKey: \"key1\",\r\n isBackward: false,\r\n focusOffset: 0,\r\n anchorOffset: 0,\r\n },\r\n },\r\n forceSelection: false,\r\n lastChangeType: null,\r\n inCompositionMode: false,\r\n inlineStyleOverride: null,\r\n nativelyRenderedContent: null,\r\n },\r\n }\r\n }\r\n}\r\n\r\nexport 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 },\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 = \"\"\r\n if (this.fontSize) {\r\n html = `

${this.label}

`\r\n } else {\r\n html = `

${this.label}

`\r\n }\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 editorState: new EditorState(),\r\n maxPosition: this.Positions,\r\n lastFontSize: \"15px\",\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 }\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 \r\n))(({ theme, ...props }) => ({\r\n width: props?.isSmall ? 38 : 42,\r\n height: props?.isSmall ? 20 : 26,\r\n padding: 0,\r\n \"& .MuiSwitch-switchBase\": {\r\n padding: 0,\r\n margin: 2,\r\n transitionDuration: \"300ms\",\r\n \"&.Mui-checked\": {\r\n transform: props?.isSmall ? \"translateX(18px)\" : \"translateX(16px)\",\r\n color: \"#fff\",\r\n \"& + .MuiSwitch-track\": {\r\n backgroundColor: color.primaryColor,\r\n opacity: 1,\r\n border: 0,\r\n ...theme.applyStyles(\"dark\", {\r\n backgroundColor: \"#2ECA45\",\r\n }),\r\n },\r\n \"&.Mui-disabled + .MuiSwitch-track\": {\r\n opacity: 0.5,\r\n },\r\n },\r\n \"&.Mui-focusVisible .MuiSwitch-thumb\": {\r\n color: \"#33cf4d\",\r\n border: \"6px solid #fff\",\r\n },\r\n \"&.Mui-disabled .MuiSwitch-thumb\": {\r\n color: theme.palette.grey[100],\r\n ...theme.applyStyles(\"dark\", {\r\n color: theme.palette.grey[600],\r\n }),\r\n },\r\n \"&.Mui-disabled + .MuiSwitch-track\": {\r\n opacity: 0.7,\r\n ...theme.applyStyles(\"dark\", {\r\n opacity: 0.3,\r\n }),\r\n },\r\n },\r\n \"& .MuiSwitch-thumb\": {\r\n boxSizing: \"border-box\",\r\n width: props?.isSmall ? 16 : 22,\r\n height: props?.isSmall ? 16 : 22,\r\n },\r\n \"& .MuiSwitch-track\": {\r\n borderRadius: 26 / 2,\r\n backgroundColor: \"#E9E9EA\",\r\n opacity: 1,\r\n transition: theme.transitions.create([\"background-color\"], {\r\n duration: 500,\r\n }),\r\n ...theme.applyStyles(\"dark\", {\r\n backgroundColor: \"#39393D\",\r\n }),\r\n },\r\n}));\r\n\r\nexport default CommonSwitch;\r\n","import React from \"react\";\r\n\r\nimport { Box, FormLabel, Switch, styled } from \"@mui/material\";\r\nimport { color } from \"../../Utils/style/color/color\";\r\n\r\nconst TwoWaySwitch = styled((props) => (\r\n \r\n \r\n {props.label1}\r\n \r\n {\r\n if (e.target.checked) {\r\n props.onChange(props.label2);\r\n } else {\r\n props.onChange(props.label1);\r\n }\r\n }}\r\n />\r\n \r\n {props.label2}\r\n \r\n \r\n))(({ theme }) => ({\r\n width: 42,\r\n height: 25,\r\n padding: 0,\r\n \"& .MuiSwitch-switchBase\": {\r\n padding: \"1px\",\r\n margin: 2,\r\n transitionDuration: \"300ms\",\r\n\r\n \"&.Mui-checked\": {\r\n transform: \"translateX(16px)\",\r\n color: color?.primaryColor,\r\n \"& + .MuiSwitch-track\": {\r\n backgroundColor: color?.primaryColor,\r\n opacity: 1,\r\n ...theme.applyStyles(\"dark\", {\r\n backgroundColor: \"#2ECA45\",\r\n }),\r\n },\r\n \"& .MuiButtonBase-root-MuiSwitch-switchBase\": {\r\n color: color?.primaryColor,\r\n },\r\n \"&.Mui-disabled + .MuiSwitch-track\": {\r\n opacity: 0.7,\r\n ...theme.applyStyles(\"dark\", {\r\n opacity: 0.3,\r\n }),\r\n },\r\n },\r\n \"&.Mui-focusVisible .MuiSwitch-thumb\": {\r\n color: \"#33cf4d\",\r\n },\r\n \"&.Mui-disabled .MuiSwitch-thumb\": {\r\n color: theme.palette.grey[100],\r\n ...theme.applyStyles(\"dark\", {\r\n color: theme.palette.grey[600],\r\n }),\r\n },\r\n \"&.Mui-disabled + .MuiSwitch-track\": {\r\n opacity: 0.7,\r\n ...theme.applyStyles(\"dark\", {\r\n opacity: 0.3,\r\n }),\r\n },\r\n },\r\n \"& .MuiSwitch-thumb\": {\r\n boxSizing: \"border-box\",\r\n width: 19,\r\n height: 19,\r\n color: \"white\",\r\n },\r\n \"& .MuiSwitch-track\": {\r\n borderRadius: 26 / 2,\r\n backgroundColor: color?.grayColor,\r\n border: `none`,\r\n opacity: 1,\r\n transition: theme.transitions.create([\"background-color\"], {\r\n duration: 500,\r\n }),\r\n ...theme.applyStyles(\"dark\", {\r\n backgroundColor: \"#39393D\",\r\n }),\r\n },\r\n}));\r\n\r\nexport default TwoWaySwitch;\r\n"],"names":["MindmapGenerator","constructor","designType","arguments","length","undefined","direction","boundingClient","x","y","width","height","this","handleMapping","top","bottom","left","right","colors","childrenOrderKeys","mindMapFlowDirection","sourceHandle","targetHandle","childKey","addition","designTypeSettings","first","edgeType","algorithm","Algorithm","Linear","isColored","directionSettings","second","BezierCatmullRom","edgeColor","third","four","five","six","seven","eight","nine","ten","getInitialPosition","maxNodesInSingleLine","nodes","maxNodes","traverse","node","count","data","side","leftChildrenOrder","forEach","child","generateMindmap","payload","_nodesHierarchy$","_nodesHierarchy$$data","_nodesHierarchy$2","_nodesHierarchy$2$dat","edges","parseResponse","nodesHierarchy","generateHierarchy","updatedEdges","generateUpdatedEdges","treeLayoutNodes","createTreeLayout","rootParentId","response","nodeRegex","edgeRegex","match","exec","push","id","label","trim","from","to","processNodeMap","nodeMap","createNode","parentNode","rootNodeId","position","type","isAiGenerated","isGeneratedThroughAI","childrenOrder","applyEdgeColor","childNodeType","edgeAlgorithm","getEdgeStrokeColor","positionAbsolute","draggable","selected","rootNode","Object","keys","stack","nodesMap","pop","newNode","children","_objectSpread","isRootNode","splitChildren","half","Math","ceil","slice","rightChildrenOrder","renameChildrenKey","key","n","map","flattenChildren","_node$data","_node$data2","flatMap","idMap","generateUniqueIds","updateEdgesWithNewIds","createNodeMap","populateChildren","flatData","initialPosition","maxLeftNodes","rootNodeInitialPosition","newId","getId","edge","reduce","acc","floor","random","_nodes$find$data$side","_nodes$find","_nodes$find$data","_nodes$find2","_nodes$","_nodes$$data","find","fromRoot","edgeStrokeColor","markerStart","color","markerEnd","MarkerType","ArrowClosed","animate","isTreeView","animationDirection","isDashed","points","style","stroke","strokeWidth","strokeLinecap","source","target","calculateCenterPosition","updateEdgesDesignType","updateNodesDesignType","createFormattedNode","childrenKeysExistsInNodeData","filter","_node$data$key","generate","updateDesignType","generator","expandNodes","currentNode","parentNodeId","regex","labelsArray","mid","idx","additionalYOffset","_nodes$find3","_nodes$2","_nodes$2$data","expand","_ref","EditorState","_immutable","treeMap","key1","end","start","leaves","decoratorKey","allowUndo","decorator","redoStack","selection","focusKey","hasFocus","anchorKey","isBackward","focusOffset","anchorOffset","undoStack","directionMap","currentContent","blockMap","text","depth","characterList","entityMap","selectionAfter","selectionBefore","forceSelection","lastChangeType","inCompositionMode","inlineStyleOverride","nativelyRenderedContent","Node","backgroundColor","nodeType","uid","fontSize","iconStyle","iconType","provider","category","textAlignment","occupiedHandles","NodeData","name","zIndex","padding","background","borderWidth","fields","dragging","Positions","lastModified","Date","now","teraFormData","html","concat","Styles","catagory","editorHTML","isAutoFont","editorState","maxPosition","lastFontSize","boxShadow","fontStyle","textAlign","fontWeight","lineHeight","textDecoration","getNodesBoundingClient","minX","min","minY","max","styled","props","_jsx","Switch","focusVisibleClassName","disableRipple","checked","value","disabled","theme","_objectWithoutProperties","_excluded","isSmall","margin","transitionDuration","transform","primaryColor","opacity","border","applyStyles","palette","grey","boxSizing","borderRadius","transition","transitions","create","duration","_jsxs","Box","display","alignItems","gap","FormLabel","sx","label1","toLowerCase","includes","activeLabel","onChange","e","label2","grayColor"],"sourceRoot":""}