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KC,QAErB,GAAIA,EAAQ4F,cAAe,CACzB,MAAM,IACJrF,GACEP,EAAQ4F,cACZ,MAAO,CACLzF,SAAUI,EAAIsF,KACdnF,WAAYH,EAAII,KAAO,EACvBL,aAAcC,EAAIE,OAAS,EAE/B,CAEA,OAAO,IACT,CAEAG,eACE,OAAO,IACT,EASF,MAAMkF,EAAgB,CACpB5E,eAvDK,SAAwBpC,GAC7B,GAAIA,EAAM8G,cAAe,CACvB,MAAM,IACJrF,GACEzB,EAAM8G,cACV,MAAO,CACLhE,YAAa,CACXC,IAAK/C,EAAMK,wBACX4B,MAAOjC,EAAMiH,SAASC,cACtBlE,KAAM,CACJrB,OAAQF,EAAIE,OAAS,EACrBE,KAAMJ,EAAII,KAAO,EACjBP,SAAUG,EAAIsF,KACdxF,YAAa,KAGjB0B,YAAajD,EACbkD,eAAgB,GAChBC,aAAcnD,EAAMK,wBACpB+C,iBAAkB,GAEtB,CAEA,OAAO,IACT,EAgCEC,QAPF,SAAiBnC,GACf,MAAMoC,EAAe,IAAIuD,EAAsB3F,GAC/C,OAAO,OAAcoC,EACvB,GAMA,M,uEC3DO,SAAS6D,EAA2BC,GACzC,IAAIlC,EAAe,KAuBnB,OArBIkC,GAAYC,SAASC,UAAYF,GAAYC,SAASC,oBAAoBnD,OAC5EiD,GAAYC,SAASC,SAASnC,SAAQT,IACpC,MAAM3B,EAqBL,SAA6BwE,GAClC,GAAIA,EAAMC,cAAc/G,YACtB,OAAO8G,EAAMC,GAAGnH,wBAGlB,GAAIkH,EAAMxF,UACR,OAAOoF,EAA2BI,EAAMxF,WAG1C,OAAO,IACT,CA/BkB0F,CAAoB/C,GAE3B3B,IAIDA,EAAIqC,OAAS,GAAKrC,EAAIsC,QAAU,IAMlCH,EADEA,GACa,OAAWA,EAAcnC,GAEzBA,GACjB,IAIGmC,CACT,C","sources":["webpack:///../node_modules/@locator/runtime/dist/adapters/goUpByTheTree.js","webpack:///../node_modules/@locator/runtime/dist/adapters/jsx/getExpressionData.js","webpack:///../node_modules/@locator/runtime/dist/adapters/jsx/getJSXComponentBoundingBox.js","webpack:///../node_modules/@locator/runtime/dist/adapters/jsx/jsxAdapter.js","webpack:///../node_modules/@locator/runtime/dist/adapters/react/findDebugSource.js","webpack:///../node_modules/@locator/runtime/dist/adapters/react/findFiberByHtmlElement.js","webpack:///../node_modules/@locator/runtime/dist/adapters/react/getFiberLabel.js","webpack:///../node_modules/@locator/runtime/dist/adapters/react/getAllFiberChildren.js","webpack:///../node_modules/@locator/runtime/dist/adapters/react/getFiberOwnBoundingBox.js","webpack:///../node_modules/@locator/runtime/dist/adapters/react/getFiberComponentBoundingBox.js","webpack:///../node_modules/@locator/runtime/dist/adapters/react/isStyled.js","webpack:///../node_modules/@locator/runtime/dist/adapters/react/reactAdapter.js","webpack:///../node_modules/@locator/runtime/dist/adapters/react/getAllParentsElementsAndRootComponent.js","webpack:///../node_modules/@locator/runtime/dist/adapters/react/getAllWrappingParents.js","webpack:///../node_modules/@locator/runtime/dist/adapters/svelte/svelteAdapter.js","webpack:///../node_modules/@locator/runtime/dist/adapters/vue/getVNodeBoundingBox.js"],"sourcesContent":["export function goUpByTheTree(originalNode) {\n let root = originalNode;\n const expandedIds = new Set();\n let current = root;\n const highlightedId = root.uniqueId;\n expandedIds.add(current.uniqueId);\n let limit = 2;\n\n while (current && limit > 0) {\n limit--;\n current = current.getParent();\n\n if (current) {\n expandedIds.add(current.uniqueId);\n root = current;\n }\n }\n\n return {\n expandedIds,\n highlightedId,\n root,\n originalNode\n };\n}","import { parseDataId } from \"../../functions/parseDataId\";\nexport function getExpressionData(target, fileData) {\n if (target.dataset.locatorjsId) {\n const [, id] = parseDataId(target.dataset.locatorjsId);\n const expData = fileData.expressions[Number(id)];\n\n if (expData) {\n return expData;\n }\n }\n\n return null;\n}","import { parseDataId } from \"../../functions/parseDataId\";\nimport { mergeRects } from \"../../functions/mergeRects\";\nimport { getExpressionData } from \"./getExpressionData\";\nexport function getJSXComponentBoundingBox(found, locatorData, componentFolder, componentId) {\n let composedBox = found.getBoundingClientRect(); // Currently it works well only for components with one root element, but for components with multiple root elements we would need to track instance ids.\n\n function goParent(current) {\n const parent = current.parentNode;\n\n if (!parent) {\n return;\n }\n\n if (parent instanceof HTMLElement) {\n if (parent.dataset.locatorjsId) {\n const [fileFullPath] = parseDataId(parent.dataset.locatorjsId);\n const fileData = locatorData[fileFullPath];\n\n if (fileData) {\n const expData = getExpressionData(parent, fileData);\n\n if (expData) {\n if (expData.wrappingComponentId === componentId && componentFolder === fileFullPath) {\n composedBox = mergeRects(composedBox, parent.getBoundingClientRect());\n goParent(parent);\n }\n\n expData.wrappingComponentId;\n }\n }\n } else {\n // If there is no locatorjs-id, we should go to the parent, because it can be some library element\n goParent(parent);\n }\n }\n }\n\n goParent(found);\n return composedBox;\n}","import { parseDataId } from \"../../functions/parseDataId\";\nimport { getExpressionData } from \"./getExpressionData\";\nimport { getJSXComponentBoundingBox } from \"./getJSXComponentBoundingBox\";\nimport { goUpByTheTree } from \"../goUpByTheTree\";\nimport { HtmlElementTreeNode } from \"../HtmlElementTreeNode\";\nexport function getElementInfo(target) {\n const found = target.closest(\"[data-locatorjs-id]\");\n\n if (found && found instanceof HTMLElement && found.dataset && (found.dataset.locatorjsId || found.dataset.locatorjsStyled)) {\n const dataId = found.dataset.locatorjsId;\n const styledDataId = found.dataset.locatorjsStyled;\n\n if (!dataId) {\n return null;\n }\n\n const [fileFullPath] = parseDataId(dataId);\n const [styledFileFullPath, styledId] = styledDataId ? parseDataId(styledDataId) : [null, null];\n const locatorData = window.__LOCATOR_DATA__;\n\n if (!locatorData) {\n return null;\n }\n\n const fileData = locatorData[fileFullPath];\n\n if (!fileData) {\n return null;\n }\n\n const styledFileData = styledFileFullPath && locatorData[styledFileFullPath];\n const expData = getExpressionData(found, fileData);\n\n if (!expData) {\n return null;\n }\n\n const styledExpData = styledFileData && styledFileData.styledDefinitions[Number(styledId)]; // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n const styledLink = styledExpData && {\n filePath: styledFileData.filePath,\n projectPath: styledFileData.projectPath,\n column: (styledExpData.loc?.start.column || 0) + 1,\n line: styledExpData.loc?.start.line || 0\n }; // TODO move styled to separate data\n // const styled = found.dataset.locatorjsStyled\n // ? getDataForDataId(found.dataset.locatorjsStyled)\n // : null;\n\n const wrappingComponent = expData.wrappingComponentId !== null ? fileData.components[Number(expData.wrappingComponentId)] : null;\n return {\n thisElement: {\n box: found.getBoundingClientRect(),\n label: expData.name,\n link: {\n filePath: fileData.filePath,\n projectPath: fileData.projectPath,\n column: (expData.loc.start.column || 0) + 1,\n line: expData.loc.start.line || 0\n }\n },\n htmlElement: found,\n parentElements: [],\n componentBox: getJSXComponentBoundingBox(found, locatorData, fileFullPath, Number(expData.wrappingComponentId)),\n componentsLabels: wrappingComponent ? [{\n label: wrappingComponent.name || \"component\",\n link: {\n filePath: fileData.filePath,\n projectPath: fileData.projectPath,\n column: (wrappingComponent.loc?.start.column || 0) + 1,\n line: wrappingComponent.loc?.start.line || 0\n }\n }] : []\n };\n } // return deduplicateLabels(labels);\n\n\n return null;\n}\nexport class JSXTreeNodeElement extends HtmlElementTreeNode {\n getSource() {\n const dataId = this.element.dataset.locatorjsId;\n const locatorData = window.__LOCATOR_DATA__;\n\n if (dataId && locatorData) {\n const [fileFullPath] = parseDataId(dataId);\n const fileData = locatorData[fileFullPath];\n\n if (fileData) {\n const expData = getExpressionData(this.element, fileData);\n\n if (expData) {\n return {\n fileName: fileData.filePath,\n projectPath: fileData.projectPath,\n columnNumber: (expData.loc.start.column || 0) + 1,\n lineNumber: expData.loc.start.line || 0\n };\n }\n }\n }\n\n return null;\n }\n\n getComponent() {\n const dataId = this.element.dataset.locatorjsId;\n const locatorData = window.__LOCATOR_DATA__;\n\n if (dataId && locatorData) {\n const [fileFullPath] = parseDataId(dataId);\n const fileData = locatorData[fileFullPath];\n\n if (fileData) {\n const expData = getExpressionData(this.element, fileData);\n\n if (expData && expData.wrappingComponentId !== null) {\n const component = fileData.components[expData.wrappingComponentId];\n\n if (component) {\n return {\n label: component.name || \"component\",\n definitionLink: {\n fileName: fileData.filePath,\n projectPath: fileData.projectPath,\n columnNumber: (component.loc?.start.column || 0) + 1,\n lineNumber: component.loc?.start.line || 0\n }\n };\n }\n }\n }\n }\n\n return null;\n }\n\n}\n\nfunction getTree(element) {\n const originalRoot = new JSXTreeNodeElement(element);\n return goUpByTheTree(originalRoot);\n}\n\nconst jsxAdapter = {\n getElementInfo,\n getTree\n};\nexport default jsxAdapter;","export function findDebugSource(fiber) {\n let current = fiber;\n\n while (current) {\n if (current._debugSource) {\n return {\n fiber: current,\n source: current._debugSource\n };\n }\n\n current = current._debugOwner || null;\n }\n\n return null;\n}","import { findDebugSource } from \"./findDebugSource\";\nexport function findFiberByHtmlElement(target, shouldHaveDebugSource) {\n const renderers = window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.renderers; // console.log(\"RENDERERS: \", renderers);\n\n const renderersValues = renderers?.values();\n\n if (renderersValues) {\n for (const renderer of Array.from(renderersValues)) {\n if (renderer.findFiberByHostInstance) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const found = renderer.findFiberByHostInstance(target);\n\n if (found) {\n if (shouldHaveDebugSource) {\n return findDebugSource(found)?.fiber || null;\n } else {\n return found;\n }\n }\n }\n }\n }\n\n return null;\n}","import { getUsableName } from \"../../functions/getUsableName\";\nexport function getFiberLabel(fiber, source) {\n const name = getUsableName(fiber);\n const label = {\n label: name,\n link: source ? {\n filePath: source.fileName,\n projectPath: \"\",\n line: source.lineNumber,\n column: source.columnNumber || 0\n } : null\n };\n return label;\n}","export function getAllFiberChildren(fiber) {\n const allChildren = [];\n let child = fiber.child;\n\n while (child) {\n allChildren.push(child);\n child = child.sibling;\n }\n\n return allChildren;\n}","export function getFiberOwnBoundingBox(fiber) {\n if (fiber.stateNode && fiber.stateNode.getBoundingClientRect) {\n return fiber.stateNode.getBoundingClientRect();\n }\n\n return null;\n}","import { getFiberOwnBoundingBox } from \"./getFiberOwnBoundingBox\";\nimport { getAllFiberChildren } from \"./getAllFiberChildren\";\nimport { mergeRects } from \"../../functions/mergeRects\";\nconst MAX_LEVEL = 6;\nexport function getFiberComponentBoundingBox(fiber, level = 0) {\n const children = getAllFiberChildren(fiber);\n let composedRect;\n children.forEach(child => {\n let box = getFiberOwnBoundingBox(child);\n\n if (!box && level < MAX_LEVEL) {\n box = getFiberComponentBoundingBox(child, level + 1) || null;\n }\n\n if (!box) {\n return;\n }\n\n if (box.width <= 0 || box.height <= 0) {\n // ignore zero-sized rects\n return;\n }\n\n if (composedRect) {\n composedRect = mergeRects(composedRect, box);\n } else {\n composedRect = box;\n }\n });\n return composedRect;\n}","export function isStyledElement(fiber) {\n return !!fiber._debugOwner?.elementType?.styledComponentId;\n}","import { findDebugSource } from \"./findDebugSource\";\nimport { findFiberByHtmlElement } from \"./findFiberByHtmlElement\";\nimport { getFiberLabel } from \"./getFiberLabel\";\nimport { getAllWrappingParents } from \"./getAllWrappingParents\";\nimport { deduplicateLabels } from \"../../functions/deduplicateLabels\";\nimport { getFiberOwnBoundingBox } from \"./getFiberOwnBoundingBox\";\nimport { getAllParentsElementsAndRootComponent } from \"./getAllParentsElementsAndRootComponent\";\nimport { isStyledElement } from \"./isStyled\";\nimport { goUpByTheTree } from \"../goUpByTheTree\";\nimport { HtmlElementTreeNode } from \"../HtmlElementTreeNode\";\nexport function getElementInfo(found) {\n // Instead of labels, return this element, parent elements leading to closest component, its component labels, all wrapping components labels.\n const labels = [];\n const fiber = findFiberByHtmlElement(found, false);\n\n if (fiber) {\n const {\n component,\n componentBox,\n parentElements\n } = getAllParentsElementsAndRootComponent(fiber);\n const allPotentialComponentFibers = getAllWrappingParents(component); // This handles a common case when the component root is basically the comopnent itself, so I want to go to usage of the component\n // TODO: whaat? why? currently I see that it adds the original styled components which is not necessary.\n // if (fiber.return && fiber.return === fiber._debugOwner) {\n // allPotentialComponentFibers.unshift(fiber.return);\n // }\n\n allPotentialComponentFibers.forEach(fiber => {\n const fiberWithSource = findDebugSource(fiber);\n\n if (fiberWithSource) {\n const label = getFiberLabel(fiberWithSource.fiber, fiberWithSource.source);\n labels.push(label);\n }\n });\n const thisLabel = getFiberLabel(fiber, findDebugSource(fiber)?.source);\n\n if (isStyledElement(fiber)) {\n thisLabel.label = `${thisLabel.label} (styled)`;\n }\n\n return {\n thisElement: {\n box: getFiberOwnBoundingBox(fiber) || found.getBoundingClientRect(),\n ...thisLabel\n },\n htmlElement: found,\n parentElements: parentElements,\n componentBox,\n componentsLabels: deduplicateLabels(labels)\n };\n }\n\n return null;\n}\nexport class ReactTreeNodeElement extends HtmlElementTreeNode {\n getSource() {\n const fiber = findFiberByHtmlElement(this.element, false);\n\n if (fiber && fiber._debugSource) {\n return {\n fileName: fiber._debugSource.fileName,\n lineNumber: fiber._debugSource.lineNumber,\n columnNumber: fiber._debugSource.columnNumber\n };\n }\n\n return null;\n }\n\n getComponent() {\n const fiber = findFiberByHtmlElement(this.element, false);\n const componentFiber = fiber?._debugOwner;\n\n if (componentFiber) {\n const fiberLabel = getFiberLabel(componentFiber, findDebugSource(componentFiber)?.source);\n return {\n label: fiberLabel.label,\n callLink: fiberLabel.link && {\n fileName: fiberLabel.link.filePath,\n lineNumber: fiberLabel.link.line,\n columnNumber: fiberLabel.link.column,\n projectPath: fiberLabel.link.projectPath\n } || undefined\n };\n }\n\n return null;\n }\n\n}\n\nfunction getTree(element) {\n const originalRoot = new ReactTreeNodeElement(element);\n return goUpByTheTree(originalRoot);\n}\n\nconst reactAdapter = {\n getElementInfo,\n getTree\n};\nexport default reactAdapter;","import { getUsableName } from \"../../functions/getUsableName\";\nimport { mergeRects } from \"../../functions/mergeRects\";\nimport { getFiberComponentBoundingBox } from \"./getFiberComponentBoundingBox\";\nimport { isStyledElement } from \"./isStyled\";\nexport function getAllParentsElementsAndRootComponent(fiber) {\n const parentElements = [];\n const deepestElement = fiber.stateNode;\n\n if (!deepestElement || !(deepestElement instanceof HTMLElement)) {\n throw new Error(\"This functions works only for Fibres with HTMLElement stateNode\");\n }\n\n let componentBox = deepestElement.getBoundingClientRect(); // For styled-components we rather use parent element\n\n let currentFiber = isStyledElement(fiber) && fiber._debugOwner ? fiber._debugOwner : fiber;\n\n while (currentFiber._debugOwner || currentFiber.return) {\n currentFiber = currentFiber._debugOwner || currentFiber.return;\n const currentElement = currentFiber.stateNode;\n\n if (!currentElement || !(currentElement instanceof HTMLElement)) {\n return {\n component: currentFiber,\n parentElements,\n componentBox: getFiberComponentBoundingBox(currentFiber) || componentBox\n };\n }\n\n const usableName = getUsableName(currentFiber);\n componentBox = mergeRects(componentBox, currentElement.getBoundingClientRect());\n parentElements.push({\n box: currentElement.getBoundingClientRect(),\n label: usableName,\n link: null\n });\n }\n\n throw new Error(\"Could not find root component\");\n}","import { getAllFiberChildren } from \"./getAllFiberChildren\";\nexport function getAllWrappingParents(fiber) {\n const parents = [fiber];\n let currentFiber = fiber;\n\n while (currentFiber.return) {\n currentFiber = currentFiber.return;\n\n if (currentFiber.stateNode && currentFiber.stateNode instanceof HTMLElement) {\n return parents;\n } // if there is multiple children, it means the parent is not just wrapping this one\n\n\n const children = getAllFiberChildren(currentFiber);\n\n if (children.length > 1) {\n return parents;\n }\n\n parents.push(currentFiber);\n }\n\n return parents;\n}","import { goUpByTheTree } from \"../goUpByTheTree\";\nimport { HtmlElementTreeNode } from \"../HtmlElementTreeNode\";\nexport function getElementInfo(found) {\n if (found.__svelte_meta) {\n const {\n loc\n } = found.__svelte_meta;\n return {\n thisElement: {\n box: found.getBoundingClientRect(),\n label: found.nodeName.toLowerCase(),\n link: {\n column: loc.column + 1,\n line: loc.line + 1,\n filePath: loc.file,\n projectPath: \"\"\n }\n },\n htmlElement: found,\n parentElements: [],\n componentBox: found.getBoundingClientRect(),\n componentsLabels: []\n };\n }\n\n return null;\n}\nexport class SvelteTreeNodeElement extends HtmlElementTreeNode {\n getSource() {\n const element = this.element;\n\n if (element.__svelte_meta) {\n const {\n loc\n } = element.__svelte_meta;\n return {\n fileName: loc.file,\n lineNumber: loc.line + 1,\n columnNumber: loc.column + 1\n };\n }\n\n return null;\n }\n\n getComponent() {\n return null;\n }\n\n}\n\nfunction getTree(element) {\n const originalRoot = new SvelteTreeNodeElement(element);\n return goUpByTheTree(originalRoot);\n}\n\nconst svelteAdapter = {\n getElementInfo,\n getTree\n};\nexport default svelteAdapter;","import { mergeRects } from \"../../functions/mergeRects\";\nexport function getVueComponentBoundingBox(vcomponent) {\n let composedRect = null;\n\n if (vcomponent?.subTree?.children && vcomponent?.subTree?.children instanceof Array) {\n vcomponent?.subTree?.children.forEach(child => {\n const box = getVNodeBoundingBox(child);\n\n if (!box) {\n return;\n }\n\n if (box.width <= 0 || box.height <= 0) {\n // ignore zero-sized rects\n return;\n }\n\n if (composedRect) {\n composedRect = mergeRects(composedRect, box);\n } else {\n composedRect = box;\n }\n });\n }\n\n return composedRect;\n}\nexport function getVNodeBoundingBox(vnode) {\n if (vnode.el instanceof HTMLElement) {\n return vnode.el.getBoundingClientRect();\n }\n\n if (vnode.component) {\n return getVueComponentBoundingBox(vnode.component);\n }\n\n return null;\n}"],"names":["goUpByTheTree","originalNode","root","expandedIds","Set","current","highlightedId","uniqueId","add","limit","getParent","getExpressionData","target","fileData","dataset","locatorjsId","id","parseDataId","expData","expressions","Number","getJSXComponentBoundingBox","found","locatorData","componentFolder","componentId","composedBox","getBoundingClientRect","goParent","parent","parentNode","HTMLElement","fileFullPath","wrappingComponentId","mergeRects","JSXTreeNodeElement","HtmlElementTreeNode","getSource","dataId","this","element","window","__LOCATOR_DATA__","fileName","filePath","projectPath","columnNumber","loc","start","column","lineNumber","line","getComponent","component","components","label","name","definitionLink","getElementInfo","closest","locatorjsStyled","styledDataId","styledFileFullPath","styledId","styledFileData","styledExpData","styledDefinitions","wrappingComponent","thisElement","box","link","htmlElement","parentElements","componentBox","componentsLabels","getTree","originalRoot","findDebugSource","fiber","_debugSource","source","_debugOwner","findFiberByHtmlElement","shouldHaveDebugSource","renderers","__REACT_DEVTOOLS_GLOBAL_HOOK__","renderersValues","values","renderer","Array","from","findFiberByHostInstance","getFiberLabel","getUsableName","getAllFiberChildren","allChildren","child","push","sibling","getFiberOwnBoundingBox","stateNode","MAX_LEVEL","getFiberComponentBoundingBox","level","composedRect","forEach","width","height","isStyledElement","elementType","styledComponentId","ReactTreeNodeElement","componentFiber","fiberLabel","callLink","undefined","labels","deepestElement","Error","currentFiber","return","currentElement","usableName","getAllParentsElementsAndRootComponent","allPotentialComponentFibers","parents","length","getAllWrappingParents","fiberWithSource","thisLabel","deduplicateLabels","SvelteTreeNodeElement","__svelte_meta","file","svelteAdapter","nodeName","toLowerCase","getVueComponentBoundingBox","vcomponent","subTree","children","vnode","el","getVNodeBoundingBox"],"sourceRoot":""}