@react-spot/core 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["sortComparator","normalizePath","resolveUri","reactUseEffectEvent","IS_MAC","Component","Button","Button","Select","Tooltip","ToolbarButton","SettingsIcon","Popover","PanelHeader","IconButton","XIcon","Fragment","Separator","IS_MAC","ChevronRightIcon","ChevronLeftIcon","Tooltip","ToolbarButton","Logo","Provider"],"sources":["../../../node_modules/.pnpm/jotai@2.18.0_@babel+core@7.29.0_@babel+template@7.28.6_@types+react@19.2.14_react@19.2.4/node_modules/jotai/esm/index.mjs","../../../node_modules/.pnpm/jotai-family@1.0.1_jotai@2.18.0_@babel+core@7.29.0_@babel+template@7.28.6_@types+react@19.2.14_react@19.2.4_/node_modules/jotai-family/dist/atomFamily.js","../src/store.ts","../../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../../../node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs","../../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs","../src/utils/path.ts","../src/utils/fiber.ts","../src/hooks/useEffectEvent.ts","../src/hooks/useInspectorBehavior.ts","../src/hooks/useLongPressHotkey.ts","../src/components/Overlay.tsx","../src/components/ErrorBoundary.tsx","../src/hooks.ts","../src/components/SettingsMenu.tsx","../src/components/Toolbar.tsx","../src/components/Trace.tsx"],"sourcesContent":["export * from 'jotai/vanilla';\nexport * from 'jotai/react';\n","export function atomFamily(initializeAtom, areEqual) {\n let shouldRemove = null;\n const atoms = new Map();\n const listeners = new Set();\n function createAtom(param) {\n let item;\n if (areEqual === undefined) {\n item = atoms.get(param);\n }\n else {\n // Custom comparator, iterate over all elements\n for (const [key, value] of atoms) {\n if (areEqual(key, param)) {\n item = value;\n break;\n }\n }\n }\n if (item !== undefined) {\n if (shouldRemove?.(item[1], param)) {\n createAtom.remove(param);\n }\n else {\n return item[0];\n }\n }\n const newAtom = initializeAtom(param);\n atoms.set(param, [newAtom, Date.now()]);\n notifyListeners('CREATE', param, newAtom);\n return newAtom;\n }\n function notifyListeners(type, param, atom) {\n for (const listener of listeners) {\n listener({ type, param, atom });\n }\n }\n createAtom.unstable_listen = (callback) => {\n listeners.add(callback);\n return () => {\n listeners.delete(callback);\n };\n };\n createAtom.getParams = () => atoms.keys();\n createAtom.remove = (param) => {\n if (areEqual === undefined) {\n if (!atoms.has(param))\n return;\n const [atom] = atoms.get(param);\n atoms.delete(param);\n notifyListeners('REMOVE', param, atom);\n }\n else {\n for (const [key, [atom]] of atoms) {\n if (areEqual(key, param)) {\n atoms.delete(key);\n notifyListeners('REMOVE', key, atom);\n break;\n }\n }\n }\n };\n createAtom.setShouldRemove = (fn) => {\n shouldRemove = fn;\n if (!shouldRemove)\n return;\n for (const [key, [atom, createdAt]] of atoms) {\n if (shouldRemove(createdAt, key)) {\n atoms.delete(key);\n notifyListeners('REMOVE', key, atom);\n }\n }\n };\n return createAtom;\n}\n//# sourceMappingURL=atomFamily.js.map","import { atom, createStore } from 'jotai'\nimport type { WritableAtom } from 'jotai'\nimport { atomFamily } from 'jotai-family'\nimport { atomWithStorage, createJSONStorage } from 'jotai/utils'\n\nimport type { ComponentContext, EditorPreset, TraceSettings } from './types'\n\n/**\n * The scoped Jotai store used by the Trace widget.\n * Created once per `<Trace />` mount via the Provider in Trace.tsx.\n * Plugins import atoms from this module and read them through the hooks in\n * `./hooks.ts`, which are scoped to the nearest Provider.\n */\n\n/**\n * Absolute path to the project root.\n */\nexport const projectRootAtom = atom<string>('')\n\n/**\n * Settings atom per project root, persisted in localStorage.\n */\nconst settingsAtom = atomFamily((root: string) =>\n atomWithStorage<TraceSettings>(\n `react-trace:settings:${root}`,\n { core: { position: 'bottom-right', minimized: false } },\n createJSONStorage<TraceSettings>(() => localStorage),\n { getOnInit: typeof window !== 'undefined' },\n ),\n)\n\nconst currentSettingsAtom = atom(\n (get) => get(settingsAtom(get(projectRootAtom))),\n (get, set, value: TraceSettings) => {\n const root = get(projectRootAtom)\n set(settingsAtom(root), value)\n },\n)\n\nconst settingsPluginFamily = atomFamily((pluginKey: keyof TraceSettings) =>\n atom(\n (get) => get(currentSettingsAtom)[pluginKey],\n (get, set, value: TraceSettings[keyof TraceSettings]) => {\n const prev = get(currentSettingsAtom)\n set(currentSettingsAtom, { ...prev, [pluginKey]: value })\n },\n ),\n)\n\n/**\n * Atom family for plugin-specific settings.\n * @param pluginKey\n * @returns\n */\nexport function settingsPluginAtom<K extends keyof TraceSettings>(\n pluginKey: K,\n) {\n // wrapper function to narrow down the type of the atom family\n return settingsPluginFamily(pluginKey) as WritableAtom<\n TraceSettings[K],\n [TraceSettings[K]],\n void\n >\n}\n\nexport const coreSettingsAtom = settingsPluginFamily('core')\n\n/**\n * The portal container element that the widget renders into. Plugins can read\n * this to mount their own portals inside the same container.\n */\nexport const portalContainerAtom = atom(() => {\n const existing = document.querySelector('[data-react-trace]')\n if (existing) return existing as HTMLDivElement\n\n const container = document.createElement('div')\n container.setAttribute('data-react-trace', '')\n container.style.cssText =\n 'position:fixed;inset:0;pointer-events:none;z-index:999997;'\n document.body.appendChild(container)\n return container\n})\n\n/**\n * Inspector active state.\n */\nexport const inspectorActiveAtom = atom(false)\n\n/**\n * Editor to open files in when clicking a component.\n */\nexport const editorAtom = atom<EditorPreset>('vscode')\n\n/**\n * The component context that is currently selected in the inspector.\n */\nexport const selectedContextAtom = atom<ComponentContext | null>(null)\n\n/**\n * The source of the currently selected file.\n */\nexport const selectedSourceAtom =\n atom<ComponentContext['all'][number]['source']>(null)\n\n/**\n * Creates a new Jotai store instance for Trace widget.\n */\nexport const createWidgetStore = () => createStore()\n","// src/vlq.ts\nvar comma = \",\".charCodeAt(0);\nvar semicolon = \";\".charCodeAt(0);\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nvar intToChar = new Uint8Array(64);\nvar charToInt = new Uint8Array(128);\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\nfunction decodeInteger(reader, relative) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = reader.next();\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n const shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = -2147483648 | -value;\n }\n return relative + value;\n}\nfunction encodeInteger(builder, num, relative) {\n let delta = num - relative;\n delta = delta < 0 ? -delta << 1 | 1 : delta << 1;\n do {\n let clamped = delta & 31;\n delta >>>= 5;\n if (delta > 0) clamped |= 32;\n builder.write(intToChar[clamped]);\n } while (delta > 0);\n return num;\n}\nfunction hasMoreVlq(reader, max) {\n if (reader.pos >= max) return false;\n return reader.peek() !== comma;\n}\n\n// src/strings.ts\nvar bufLength = 1024 * 16;\nvar td = typeof TextDecoder !== \"undefined\" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== \"undefined\" ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n }\n} : {\n decode(buf) {\n let out = \"\";\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n }\n};\nvar StringWriter = class {\n constructor() {\n this.pos = 0;\n this.out = \"\";\n this.buffer = new Uint8Array(bufLength);\n }\n write(v) {\n const { buffer } = this;\n buffer[this.pos++] = v;\n if (this.pos === bufLength) {\n this.out += td.decode(buffer);\n this.pos = 0;\n }\n }\n flush() {\n const { buffer, out, pos } = this;\n return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;\n }\n};\nvar StringReader = class {\n constructor(buffer) {\n this.pos = 0;\n this.buffer = buffer;\n }\n next() {\n return this.buffer.charCodeAt(this.pos++);\n }\n peek() {\n return this.buffer.charCodeAt(this.pos);\n }\n indexOf(char) {\n const { buffer, pos } = this;\n const idx = buffer.indexOf(char, pos);\n return idx === -1 ? buffer.length : idx;\n }\n};\n\n// src/scopes.ts\nvar EMPTY = [];\nfunction decodeOriginalScopes(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const scopes = [];\n const stack = [];\n let line = 0;\n for (; reader.pos < length; reader.pos++) {\n line = decodeInteger(reader, line);\n const column = decodeInteger(reader, 0);\n if (!hasMoreVlq(reader, length)) {\n const last = stack.pop();\n last[2] = line;\n last[3] = column;\n continue;\n }\n const kind = decodeInteger(reader, 0);\n const fields = decodeInteger(reader, 0);\n const hasName = fields & 1;\n const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind];\n let vars = EMPTY;\n if (hasMoreVlq(reader, length)) {\n vars = [];\n do {\n const varsIndex = decodeInteger(reader, 0);\n vars.push(varsIndex);\n } while (hasMoreVlq(reader, length));\n }\n scope.vars = vars;\n scopes.push(scope);\n stack.push(scope);\n }\n return scopes;\n}\nfunction encodeOriginalScopes(scopes) {\n const writer = new StringWriter();\n for (let i = 0; i < scopes.length; ) {\n i = _encodeOriginalScopes(scopes, i, writer, [0]);\n }\n return writer.flush();\n}\nfunction _encodeOriginalScopes(scopes, index, writer, state) {\n const scope = scopes[index];\n const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;\n if (index > 0) writer.write(comma);\n state[0] = encodeInteger(writer, startLine, state[0]);\n encodeInteger(writer, startColumn, 0);\n encodeInteger(writer, kind, 0);\n const fields = scope.length === 6 ? 1 : 0;\n encodeInteger(writer, fields, 0);\n if (scope.length === 6) encodeInteger(writer, scope[5], 0);\n for (const v of vars) {\n encodeInteger(writer, v, 0);\n }\n for (index++; index < scopes.length; ) {\n const next = scopes[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeOriginalScopes(scopes, index, writer, state);\n }\n writer.write(comma);\n state[0] = encodeInteger(writer, endLine, state[0]);\n encodeInteger(writer, endColumn, 0);\n return index;\n}\nfunction decodeGeneratedRanges(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const ranges = [];\n const stack = [];\n let genLine = 0;\n let definitionSourcesIndex = 0;\n let definitionScopeIndex = 0;\n let callsiteSourcesIndex = 0;\n let callsiteLine = 0;\n let callsiteColumn = 0;\n let bindingLine = 0;\n let bindingColumn = 0;\n do {\n const semi = reader.indexOf(\";\");\n let genColumn = 0;\n for (; reader.pos < semi; reader.pos++) {\n genColumn = decodeInteger(reader, genColumn);\n if (!hasMoreVlq(reader, semi)) {\n const last = stack.pop();\n last[2] = genLine;\n last[3] = genColumn;\n continue;\n }\n const fields = decodeInteger(reader, 0);\n const hasDefinition = fields & 1;\n const hasCallsite = fields & 2;\n const hasScope = fields & 4;\n let callsite = null;\n let bindings = EMPTY;\n let range;\n if (hasDefinition) {\n const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex);\n definitionScopeIndex = decodeInteger(\n reader,\n definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0\n );\n definitionSourcesIndex = defSourcesIndex;\n range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];\n } else {\n range = [genLine, genColumn, 0, 0];\n }\n range.isScope = !!hasScope;\n if (hasCallsite) {\n const prevCsi = callsiteSourcesIndex;\n const prevLine = callsiteLine;\n callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex);\n const sameSource = prevCsi === callsiteSourcesIndex;\n callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0);\n callsiteColumn = decodeInteger(\n reader,\n sameSource && prevLine === callsiteLine ? callsiteColumn : 0\n );\n callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];\n }\n range.callsite = callsite;\n if (hasMoreVlq(reader, semi)) {\n bindings = [];\n do {\n bindingLine = genLine;\n bindingColumn = genColumn;\n const expressionsCount = decodeInteger(reader, 0);\n let expressionRanges;\n if (expressionsCount < -1) {\n expressionRanges = [[decodeInteger(reader, 0)]];\n for (let i = -1; i > expressionsCount; i--) {\n const prevBl = bindingLine;\n bindingLine = decodeInteger(reader, bindingLine);\n bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0);\n const expression = decodeInteger(reader, 0);\n expressionRanges.push([expression, bindingLine, bindingColumn]);\n }\n } else {\n expressionRanges = [[expressionsCount]];\n }\n bindings.push(expressionRanges);\n } while (hasMoreVlq(reader, semi));\n }\n range.bindings = bindings;\n ranges.push(range);\n stack.push(range);\n }\n genLine++;\n reader.pos = semi + 1;\n } while (reader.pos < length);\n return ranges;\n}\nfunction encodeGeneratedRanges(ranges) {\n if (ranges.length === 0) return \"\";\n const writer = new StringWriter();\n for (let i = 0; i < ranges.length; ) {\n i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);\n }\n return writer.flush();\n}\nfunction _encodeGeneratedRanges(ranges, index, writer, state) {\n const range = ranges[index];\n const {\n 0: startLine,\n 1: startColumn,\n 2: endLine,\n 3: endColumn,\n isScope,\n callsite,\n bindings\n } = range;\n if (state[0] < startLine) {\n catchupLine(writer, state[0], startLine);\n state[0] = startLine;\n state[1] = 0;\n } else if (index > 0) {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, range[1], state[1]);\n const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);\n encodeInteger(writer, fields, 0);\n if (range.length === 6) {\n const { 4: sourcesIndex, 5: scopesIndex } = range;\n if (sourcesIndex !== state[2]) {\n state[3] = 0;\n }\n state[2] = encodeInteger(writer, sourcesIndex, state[2]);\n state[3] = encodeInteger(writer, scopesIndex, state[3]);\n }\n if (callsite) {\n const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;\n if (sourcesIndex !== state[4]) {\n state[5] = 0;\n state[6] = 0;\n } else if (callLine !== state[5]) {\n state[6] = 0;\n }\n state[4] = encodeInteger(writer, sourcesIndex, state[4]);\n state[5] = encodeInteger(writer, callLine, state[5]);\n state[6] = encodeInteger(writer, callColumn, state[6]);\n }\n if (bindings) {\n for (const binding of bindings) {\n if (binding.length > 1) encodeInteger(writer, -binding.length, 0);\n const expression = binding[0][0];\n encodeInteger(writer, expression, 0);\n let bindingStartLine = startLine;\n let bindingStartColumn = startColumn;\n for (let i = 1; i < binding.length; i++) {\n const expRange = binding[i];\n bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine);\n bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn);\n encodeInteger(writer, expRange[0], 0);\n }\n }\n }\n for (index++; index < ranges.length; ) {\n const next = ranges[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeGeneratedRanges(ranges, index, writer, state);\n }\n if (state[0] < endLine) {\n catchupLine(writer, state[0], endLine);\n state[0] = endLine;\n state[1] = 0;\n } else {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, endColumn, state[1]);\n return index;\n}\nfunction catchupLine(writer, lastLine, line) {\n do {\n writer.write(semicolon);\n } while (++lastLine < line);\n}\n\n// src/sourcemap-codec.ts\nfunction decode(mappings) {\n const { length } = mappings;\n const reader = new StringReader(mappings);\n const decoded = [];\n let genColumn = 0;\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n do {\n const semi = reader.indexOf(\";\");\n const line = [];\n let sorted = true;\n let lastCol = 0;\n genColumn = 0;\n while (reader.pos < semi) {\n let seg;\n genColumn = decodeInteger(reader, genColumn);\n if (genColumn < lastCol) sorted = false;\n lastCol = genColumn;\n if (hasMoreVlq(reader, semi)) {\n sourcesIndex = decodeInteger(reader, sourcesIndex);\n sourceLine = decodeInteger(reader, sourceLine);\n sourceColumn = decodeInteger(reader, sourceColumn);\n if (hasMoreVlq(reader, semi)) {\n namesIndex = decodeInteger(reader, namesIndex);\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];\n } else {\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];\n }\n } else {\n seg = [genColumn];\n }\n line.push(seg);\n reader.pos++;\n }\n if (!sorted) sort(line);\n decoded.push(line);\n reader.pos = semi + 1;\n } while (reader.pos <= length);\n return decoded;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const writer = new StringWriter();\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) writer.write(semicolon);\n if (line.length === 0) continue;\n let genColumn = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n if (j > 0) writer.write(comma);\n genColumn = encodeInteger(writer, segment[0], genColumn);\n if (segment.length === 1) continue;\n sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);\n sourceLine = encodeInteger(writer, segment[2], sourceLine);\n sourceColumn = encodeInteger(writer, segment[3], sourceColumn);\n if (segment.length === 4) continue;\n namesIndex = encodeInteger(writer, segment[4], namesIndex);\n }\n }\n return writer.flush();\n}\nexport {\n decode,\n decodeGeneratedRanges,\n decodeOriginalScopes,\n encode,\n encodeGeneratedRanges,\n encodeOriginalScopes\n};\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\nfunction isAbsoluteUrl(input) {\n return schemeRegex.test(input);\n}\nfunction isSchemeRelativeUrl(input) {\n return input.startsWith('//');\n}\nfunction isAbsolutePath(input) {\n return input.startsWith('/');\n}\nfunction isFileUrl(input) {\n return input.startsWith('file:');\n}\nfunction isRelative(input) {\n return /^[.?#]/.test(input);\n}\nfunction parseAbsoluteUrl(input) {\n const match = urlRegex.exec(input);\n return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');\n}\nfunction parseFileUrl(input) {\n const match = fileRegex.exec(input);\n const path = match[2];\n return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');\n}\nfunction makeUrl(scheme, user, host, port, path, query, hash) {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: 7 /* Absolute */,\n };\n}\nfunction parseUrl(input) {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = 6 /* SchemeRelative */;\n return url;\n }\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = 5 /* AbsolutePath */;\n return url;\n }\n if (isFileUrl(input))\n return parseFileUrl(input);\n if (isAbsoluteUrl(input))\n return parseAbsoluteUrl(input);\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? 3 /* Query */\n : input.startsWith('#')\n ? 2 /* Hash */\n : 4 /* RelativePath */\n : 1 /* Empty */;\n return url;\n}\nfunction stripPathFilename(path) {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..'))\n return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\nfunction mergePaths(url, base) {\n normalizePath(base, base.type);\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n }\n else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url, type) {\n const rel = type <= 4 /* RelativePath */;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nfunction resolve(input, base) {\n if (!input && !base)\n return '';\n const url = parseUrl(input);\n let inputType = url.type;\n if (base && inputType !== 7 /* Absolute */) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n switch (inputType) {\n case 1 /* Empty */:\n url.hash = baseUrl.hash;\n // fall through\n case 2 /* Hash */:\n url.query = baseUrl.query;\n // fall through\n case 3 /* Query */:\n case 4 /* RelativePath */:\n mergePaths(url, baseUrl);\n // fall through\n case 5 /* AbsolutePath */:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n case 6 /* SchemeRelative */:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType)\n inputType = baseType;\n }\n normalizePath(url, inputType);\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n case 2 /* Hash */:\n case 3 /* Query */:\n return queryHash;\n case 4 /* RelativePath */: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n if (!path)\n return queryHash || '.';\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n return path + queryHash;\n }\n case 5 /* AbsolutePath */:\n return url.path + queryHash;\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n\nexport { resolve as default };\n//# sourceMappingURL=resolve-uri.mjs.map\n","// src/trace-mapping.ts\nimport { encode, decode } from \"@jridgewell/sourcemap-codec\";\n\n// src/resolve.ts\nimport resolveUri from \"@jridgewell/resolve-uri\";\n\n// src/strip-filename.ts\nfunction stripFilename(path) {\n if (!path) return \"\";\n const index = path.lastIndexOf(\"/\");\n return path.slice(0, index + 1);\n}\n\n// src/resolve.ts\nfunction resolver(mapUrl, sourceRoot) {\n const from = stripFilename(mapUrl);\n const prefix = sourceRoot ? sourceRoot + \"/\" : \"\";\n return (source) => resolveUri(prefix + (source || \"\"), from);\n}\n\n// src/sourcemap-segment.ts\nvar COLUMN = 0;\nvar SOURCES_INDEX = 1;\nvar SOURCE_LINE = 2;\nvar SOURCE_COLUMN = 3;\nvar NAMES_INDEX = 4;\nvar REV_GENERATED_LINE = 1;\nvar REV_GENERATED_COLUMN = 2;\n\n// src/sort.ts\nfunction maybeSort(mappings, owned) {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n if (!owned) mappings = mappings.slice();\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\nfunction nextUnsortedSegmentLine(mappings, start) {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\nfunction isSorted(line) {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\nfunction sortSegments(line, owned) {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[COLUMN] - b[COLUMN];\n}\n\n// src/by-source.ts\nfunction buildBySources(decoded, memos) {\n const sources = memos.map(() => []);\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n const sourceIndex2 = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const source = sources[sourceIndex2];\n const segs = source[sourceLine] || (source[sourceLine] = []);\n segs.push([sourceColumn, i, seg[COLUMN]]);\n }\n }\n for (let i = 0; i < sources.length; i++) {\n const source = sources[i];\n for (let j = 0; j < source.length; j++) {\n const line = source[j];\n if (line) line.sort(sortComparator);\n }\n }\n return sources;\n}\n\n// src/binary-search.ts\nvar found = false;\nfunction binarySearch(haystack, needle, low, high) {\n while (low <= high) {\n const mid = low + (high - low >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n if (cmp === 0) {\n found = true;\n return mid;\n }\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n found = false;\n return low - 1;\n}\nfunction upperBound(haystack, needle, index) {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\nfunction lowerBound(haystack, needle, index) {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\nfunction memoizedState() {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1\n };\n}\nfunction memoizedBinarySearch(haystack, needle, state, key) {\n const { lastKey, lastNeedle, lastIndex } = state;\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n if (needle >= lastNeedle) {\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n return state.lastIndex = binarySearch(haystack, needle, low, high);\n}\n\n// src/types.ts\nfunction parse(map) {\n return typeof map === \"string\" ? JSON.parse(map) : map;\n}\n\n// src/flatten-map.ts\nvar FlattenMap = function(map, mapUrl) {\n const parsed = parse(map);\n if (!(\"sections\" in parsed)) {\n return new TraceMap(parsed, mapUrl);\n }\n const mappings = [];\n const sources = [];\n const sourcesContent = [];\n const names = [];\n const ignoreList = [];\n recurse(\n parsed,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n ignoreList,\n 0,\n 0,\n Infinity,\n Infinity\n );\n const joined = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n ignoreList\n };\n return presortedDecodedMap(joined);\n};\nfunction recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n ignoreList,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc\n );\n }\n}\nfunction addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) {\n const parsed = parse(input);\n if (\"sections\" in parsed) return recurse(...arguments);\n const map = new TraceMap(parsed, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map;\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset);\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n if (lineI > stopLine) return;\n const out = getLine(mappings, lineI);\n const cOffset = i === 0 ? columnOffset : 0;\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n if (lineI === stopLine && column >= stopColumn) return;\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]\n );\n }\n }\n}\nfunction append(arr, other) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\nfunction getLine(arr, index) {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n\n// src/trace-mapping.ts\nvar LINE_GTR_ZERO = \"`line` must be greater than 0 (lines start at line 1)\";\nvar COL_GTR_EQ_ZERO = \"`column` must be greater than or equal to 0 (columns start at column 0)\";\nvar LEAST_UPPER_BOUND = -1;\nvar GREATEST_LOWER_BOUND = 1;\nvar TraceMap = class {\n constructor(map, mapUrl) {\n const isString = typeof map === \"string\";\n if (!isString && map._decodedMemo) return map;\n const parsed = parse(map);\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names || [];\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;\n const resolve = resolver(mapUrl, sourceRoot);\n this.resolvedSources = sources.map(resolve);\n const { mappings } = parsed;\n if (typeof mappings === \"string\") {\n this._encoded = mappings;\n this._decoded = void 0;\n } else if (Array.isArray(mappings)) {\n this._encoded = void 0;\n this._decoded = maybeSort(mappings, isString);\n } else if (parsed.sections) {\n throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);\n } else {\n throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);\n }\n this._decodedMemo = memoizedState();\n this._bySources = void 0;\n this._bySourceMemos = void 0;\n }\n};\nfunction cast(map) {\n return map;\n}\nfunction encodedMappings(map) {\n var _a, _b;\n return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = encode(cast(map)._decoded);\n}\nfunction decodedMappings(map) {\n var _a;\n return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));\n}\nfunction traceSegment(map, line, column) {\n const decoded = decodedMappings(map);\n if (line >= decoded.length) return null;\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n cast(map)._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND\n );\n return index === -1 ? null : segments[index];\n}\nfunction originalPositionFor(map, needle) {\n let { line, column, bias } = needle;\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n const decoded = decodedMappings(map);\n if (line >= decoded.length) return OMapping(null, null, null, null);\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n cast(map)._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND\n );\n if (index === -1) return OMapping(null, null, null, null);\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null\n );\n}\nfunction generatedPositionFor(map, needle) {\n const { source, line, column, bias } = needle;\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n}\nfunction allGeneratedPositionsFor(map, needle) {\n const { source, line, column, bias } = needle;\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n}\nfunction eachMapping(map, cb) {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name\n });\n }\n }\n}\nfunction sourceIndex(map, source) {\n const { sources, resolvedSources } = map;\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n return index;\n}\nfunction sourceContentFor(map, source) {\n const { sourcesContent } = map;\n if (sourcesContent == null) return null;\n const index = sourceIndex(map, source);\n return index === -1 ? null : sourcesContent[index];\n}\nfunction isIgnored(map, source) {\n const { ignoreList } = map;\n if (ignoreList == null) return false;\n const index = sourceIndex(map, source);\n return index === -1 ? false : ignoreList.includes(index);\n}\nfunction presortedDecodedMap(map, mapUrl) {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n cast(tracer)._decoded = map.mappings;\n return tracer;\n}\nfunction decodedMap(map) {\n return clone(map, decodedMappings(map));\n}\nfunction encodedMap(map) {\n return clone(map, encodedMappings(map));\n}\nfunction clone(map, mappings) {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n ignoreList: map.ignoreList || map.x_google_ignoreList\n };\n}\nfunction OMapping(source, line, column, name) {\n return { source, line, column, name };\n}\nfunction GMapping(line, column) {\n return { line, column };\n}\nfunction traceSegmentInternal(segments, memo, line, column, bias) {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (found) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\nfunction sliceGeneratedPositions(segments, memo, line, column, bias) {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n if (!found && bias === LEAST_UPPER_BOUND) min++;\n if (min === -1 || min === segments.length) return [];\n const matchedColumn = found ? column : segments[min][COLUMN];\n if (!found) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n const result = [];\n for (; min <= max; min++) {\n const segment = segments[min];\n result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));\n }\n return result;\n}\nfunction generatedPosition(map, source, line, column, bias, all) {\n var _a, _b;\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n const { sources, resolvedSources } = map;\n let sourceIndex2 = sources.indexOf(source);\n if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source);\n if (sourceIndex2 === -1) return all ? [] : GMapping(null, null);\n const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState));\n const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos));\n const segments = generated[sourceIndex2][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n const memo = bySourceMemos[sourceIndex2];\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n}\nexport {\n FlattenMap as AnyMap,\n FlattenMap,\n GREATEST_LOWER_BOUND,\n LEAST_UPPER_BOUND,\n TraceMap,\n allGeneratedPositionsFor,\n decodedMap,\n decodedMappings,\n eachMapping,\n encodedMap,\n encodedMappings,\n generatedPositionFor,\n isIgnored,\n originalPositionFor,\n presortedDecodedMap,\n sourceContentFor,\n traceSegment\n};\n//# sourceMappingURL=trace-mapping.mjs.map\n","/**\n * Shared path utilities for converting development source identifiers and\n * absolute filesystem paths into relative or absolute forms needed by plugins.\n *\n * Handles the fileName conventions react-trace encounters:\n * - Vite dev URL http://localhost:5173/src/App.tsx\n * - Vite /@fs/ URL http://localhost:5173/@fs/abs/path/src/App.tsx\n * - Next webpack URL webpack-internal:///(app-pages-browser)/./app/page.tsx\n * - Turbopack URL turbopack:///[project]/app/page.tsx\n * - Absolute path / URL /Users/you/project/src/App.tsx\n */\n\nconst NEXT_SOURCE_GROUP_RE = /^\\((?:app|pages)-[^/]+\\)\\//\nconst TURBOPACK_PROJECT_PREFIX_RE = /^\\[project\\]\\//\n\nfunction stripQueryAndHash(fileName: string): string {\n return fileName.split(/[?#]/)[0] ?? fileName\n}\n\nfunction normalizeRoot(root?: string): string | null {\n if (!root) return null\n return root.replace(/\\\\/g, '/').replace(/\\/$/, '')\n}\n\nfunction normalizePath(path: string): string {\n return decodeURIComponent(path).replace(/\\\\/g, '/')\n}\n\nfunction stripRoot(path: string, root?: string): string {\n const normalizedRoot = normalizeRoot(root)\n if (normalizedRoot && path.startsWith(normalizedRoot + '/')) {\n return path.slice(normalizedRoot.length + 1)\n }\n return path\n}\n\nfunction stripWebpackRelativePrefix(path: string): string {\n return path.replace(/^\\/+/, '').replace(/^\\.\\/+/, '')\n}\n\nfunction stripVirtualProjectPrefix(path: string): string {\n const relativePath = stripWebpackRelativePrefix(path)\n if (TURBOPACK_PROJECT_PREFIX_RE.test(relativePath)) {\n return relativePath.replace(TURBOPACK_PROJECT_PREFIX_RE, '')\n }\n return path\n}\n\nfunction stripRootSuffixPrefix(relativePath: string, root?: string): string {\n const normalizedRoot = normalizeRoot(root)\n if (!normalizedRoot) return relativePath\n\n const rootParts = normalizedRoot.split('/').filter(Boolean)\n const pathParts = relativePath.split('/').filter(Boolean)\n const maxParts = Math.min(rootParts.length, pathParts.length)\n\n for (let count = maxParts; count > 0; count--) {\n const rootSuffix = rootParts.slice(-count).join('/')\n const pathPrefix = pathParts.slice(0, count).join('/')\n if (rootSuffix === pathPrefix) return pathParts.slice(count).join('/')\n }\n\n return relativePath\n}\n\n/**\n * Normalizes virtual module identifiers emitted by webpack/Turbopack source\n * maps and React component stacks back to project-relative paths.\n */\nfunction toVirtualProjectPath(url: URL): string | null {\n if (url.protocol === 'webpack:' || url.protocol === 'webpack-internal:') {\n const path = stripWebpackRelativePrefix(normalizePath(url.pathname))\n return path.replace(NEXT_SOURCE_GROUP_RE, '')\n }\n\n if (url.protocol === 'turbopack:') {\n return stripVirtualProjectPrefix(normalizePath(url.pathname))\n }\n\n return null\n}\n\nfunction joinRoot(\n root: string | undefined,\n relativePath: string,\n): string | null {\n const normalizedRoot = normalizeRoot(root)\n if (!normalizedRoot) return null\n return `${normalizedRoot}/${relativePath.replace(/^\\/+/, '')}`\n}\n\n/**\n * Converts a source fileName to a path relative to the project root.\n *\n * Vite URL http://localhost:5173/src/App.tsx → src/App.tsx\n * /@fs/ URL http://localhost:5173/@fs/abs/root/src/… → src/App.tsx (root required)\n * Abs URL http://localhost:5173//abs/root/src/… → src/App.tsx (root required)\n * Abs path /Users/you/project/src/App.tsx → src/App.tsx (root required)\n */\nexport function toRelativePath(fileName: string, root?: string): string {\n const clean = stripQueryAndHash(fileName).trim()\n\n try {\n const url = new URL(clean)\n const virtualPath = toVirtualProjectPath(url)\n if (virtualPath) return stripRootSuffixPrefix(virtualPath, root)\n\n const pathname = normalizePath(url.pathname)\n if (url.protocol === 'file:') return stripRoot(pathname, root)\n if (pathname.startsWith('/@fs/') || pathname.startsWith('/Users/')) {\n const absPath = pathname.startsWith('/@fs/')\n ? pathname.slice('/@fs'.length)\n : pathname\n return stripRoot(absPath, root)\n }\n const rootRelativePath = stripRoot(pathname, root)\n if (rootRelativePath !== pathname) return rootRelativePath\n\n // Regular dev-server URL — pathname is already relative to the project root\n return pathname.replace(/^\\//, '')\n } catch {\n // Absolute filesystem path from _debugSource (React 18)\n const normalizedPath = normalizePath(clean)\n const virtualPath = stripVirtualProjectPrefix(normalizedPath)\n if (virtualPath !== normalizedPath) {\n return stripRootSuffixPrefix(virtualPath, root)\n }\n return stripRoot(normalizedPath, root)\n }\n}\n\n/**\n * Converts a source fileName to an absolute filesystem path.\n * Used by plugins that build editor URL schemes (vscode://, cursor://, etc.)\n *\n * Vite /@fs/ URL → strip /@fs prefix → /abs/path/src/App.tsx\n * Vite URL → prepend root if provided → /project/src/App.tsx\n * Abs URL → strip host → /abs/root/src/App.tsx\n * Abs path → used as-is\n *\n * Returns null if the path is empty or cannot be resolved.\n */\nexport function toAbsolutePath(fileName: string, root?: string): string | null {\n const clean = stripQueryAndHash(fileName).trim()\n if (!clean) return null\n\n try {\n const url = new URL(clean)\n const virtualPath = toVirtualProjectPath(url)\n if (virtualPath) {\n const rootRelativePath = stripRootSuffixPrefix(virtualPath, root)\n return joinRoot(root, rootRelativePath) ?? rootRelativePath\n }\n\n const pathname = normalizePath(url.pathname)\n if (url.protocol === 'file:') return pathname\n if (pathname.startsWith('/Users/')) return pathname\n if (stripRoot(pathname, root) !== pathname) return pathname\n // Vite embeds the absolute path after /@fs/\n if (pathname.startsWith('/@fs/')) return pathname.slice('/@fs'.length)\n // Standard dev-server URL — resolve against root if provided\n return joinRoot(root, pathname) ?? pathname\n } catch {\n // Not a URL — already an absolute filesystem path (React 18)\n const normalizedPath = normalizePath(clean)\n const virtualPath = stripVirtualProjectPrefix(normalizedPath)\n if (virtualPath !== normalizedPath) {\n const rootRelativePath = stripRootSuffixPrefix(virtualPath, root)\n return joinRoot(root, rootRelativePath) ?? rootRelativePath\n }\n return normalizedPath\n }\n}\n","import { TraceMap, originalPositionFor } from '@jridgewell/trace-mapping'\nimport type { EncodedSourceMap } from '@jridgewell/trace-mapping'\n\nimport type { ComponentContext, ComponentSource } from '../types'\nimport { toAbsolutePath, toRelativePath } from './path'\n\n/**\n * Raw source location extracted from React fibers before path enrichment.\n * Missing the `relativePath` and `absolutePath` fields that are computed\n * in `getComponentContext` once the project root is known.\n */\ntype RawSource = Omit<ComponentSource, 'relativePath' | 'absolutePath'>\n\n// ---------------------------------------------------------------------------\n// Source map resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Per-URL cache of TraceMap promises.\n * Each file is fetched at most once per page load — subsequent calls are instant\n * cache hits. The cache is intentionally not invalidated on HMR because the\n * compiled line numbers in the new _debugStack will also change, so the next\n * hover naturally uses fresh positions against the new source map.\n */\nconst traceMapCache = new Map<string, Promise<TraceMap | null>>()\n\nfunction loadTraceMap(fileUrl: string): Promise<TraceMap | null> {\n const cached = traceMapCache.get(fileUrl)\n if (cached !== undefined) return cached\n\n const promise = (async (): Promise<TraceMap | null> => {\n try {\n const res = await fetch(fileUrl)\n if (!res.ok) return null\n\n // Turbopack (and some other bundlers) advertise source maps via HTTP\n // headers instead of embedding a //# sourceMappingURL comment in the JS.\n const sourceMapHeader =\n res.headers.get('SourceMap') ?? res.headers.get('X-SourceMap')\n if (sourceMapHeader) {\n const mapUrl = new URL(sourceMapHeader, fileUrl).href\n const mapRes = await fetch(mapUrl)\n if (mapRes.ok) {\n return new TraceMap((await mapRes.json()) as EncodedSourceMap, mapUrl)\n }\n }\n\n const code = await res.text()\n\n // Inline source map directive: sourceMappingURL=data:application/json;base64,...\n const inlineMatch = code.match(\n /\\/\\/# sourceMappingURL=data:application\\/json;(?:charset=[^;]+;)?base64,([A-Za-z0-9+/=]+)/,\n )\n if (inlineMatch) {\n const json = JSON.parse(atob(inlineMatch[1]!)) as EncodedSourceMap\n return new TraceMap(json, fileUrl)\n }\n\n // External source map directive: sourceMappingURL=App.tsx.map\n const externalMatch = code.match(/\\/\\/# sourceMappingURL=([^\\s]+)/)\n if (externalMatch && !externalMatch[1]!.startsWith('data:')) {\n const mapUrl = new URL(externalMatch[1]!, fileUrl).href\n const mapRes = await fetch(mapUrl)\n if (!mapRes.ok) return null\n return new TraceMap((await mapRes.json()) as EncodedSourceMap, mapUrl)\n }\n\n return null\n } catch {\n return null\n }\n })()\n\n traceMapCache.set(fileUrl, promise)\n return promise\n}\n\n/**\n * Detects Turbopack chunk file paths that can't be shown to the user as-is.\n * These are generated files like `[project]/.next/static/chunks/_1rlvw7y._.js`\n * or URL-form equivalents that still point at `/_next/static/chunks/`.\n */\nfunction isChunkPath(fileName: string): boolean {\n return (\n fileName.includes('.next/static/chunks/') ||\n fileName.includes('_next/static/chunks/')\n )\n}\n\n/**\n * For Turbopack virtual paths like `[project]/.next/static/chunks/foo.js`,\n * constructs the full dev-server URL so we can fetch the source map.\n * Returns null if the path doesn't look like a servable chunk.\n */\nfunction tryConstructChunkUrl(fileName: string): string | null {\n if (typeof globalThis.location === 'undefined') return null\n\n const stripped = fileName.replace(/^\\[project\\]\\//, '')\n if (!stripped.includes('.next/static/chunks/')) return null\n\n // .next/static/chunks/foo.js → /_next/static/chunks/foo.js\n const urlPath = stripped.replace(/^\\.next\\//, '_next/')\n return `${globalThis.location.origin}/${urlPath}`\n}\n\n/**\n * Resolves compiled positions (post-Babel/esbuild) back to original TypeScript\n * source positions by fetching and applying the inline source map.\n *\n * - Only runs for URL-form fileNames (Vite dev mode serves files as URLs)\n * - For Turbopack chunk paths, constructs the dev-server URL to fetch source maps\n * - Results are cached per file URL — each file is fetched at most once\n * - Returns the original source unchanged on any error\n *\n * Designed to be called *after* the synchronous context is already rendered,\n * so the UI updates the line number once the source map resolves (usually <50ms\n * after the first hover on a given file, instant on subsequent hovers).\n */\nasync function resolveSource(source: RawSource): Promise<RawSource | null> {\n let fileUrl: string | null = null\n\n try {\n fileUrl = new URL(source.fileName).href\n } catch {\n // Not a URL — try to construct one for Turbopack chunk paths\n const chunkUrl = tryConstructChunkUrl(source.fileName)\n if (chunkUrl) {\n fileUrl = chunkUrl\n } else if (isChunkPath(source.fileName)) {\n // Chunk path we can't resolve — filter out rather than showing raw chunk names\n return null\n } else {\n return source\n }\n }\n\n const traceMap = await loadTraceMap(fileUrl)\n if (!traceMap) {\n // If this is a chunk file URL we couldn't get a source map for,\n // return null so it's filtered out instead of showing a meaningless path\n if (isChunkPath(source.fileName) || isChunkPath(fileUrl)) return null\n return source\n }\n\n // trace-mapping: line is 1-based, column is 0-based\n const original = originalPositionFor(traceMap, {\n line: source.lineNumber,\n column: source.columnNumber - 1,\n })\n\n if (original.source == null || original.line == null) return null\n\n return {\n fileName: original.source,\n lineNumber: original.line,\n columnNumber: original.column != null ? original.column + 1 : 1,\n }\n}\n\nconst FiberTags = {\n FunctionComponent: 0,\n ClassComponent: 1,\n IndeterminateComponent: 2,\n HostRoot: 3,\n HostPortal: 4,\n HostComponent: 5,\n HostText: 6,\n Fragment: 7,\n Mode: 8,\n ContextConsumer: 9,\n ContextProvider: 10,\n ForwardRef: 11,\n Profiler: 12,\n SuspenseComponent: 13,\n MemoComponent: 14,\n SimpleMemoComponent: 15,\n LazyComponent: 16,\n IncompleteClassComponent: 17,\n DehydratedFragment: 18,\n SuspenseListComponent: 19,\n ScopeComponent: 21,\n OffscreenComponent: 22,\n LegacyHiddenComponent: 23,\n CacheComponent: 24,\n TracingMarkerComponent: 25,\n} as const\n\ntype FiberTag = (typeof FiberTags)[keyof typeof FiberTags]\n\n// Uncomment for debugging purposes\n// const FiberTagNames = Object.fromEntries(\n// Object.entries(FiberTags).map(([k, v]) => [v, k]),\n// ) as Record<FiberTag, keyof typeof FiberTags>\n\n// Fiber tags for React component types (React 19)\nconst COMPONENT_TAGS = [\n FiberTags.FunctionComponent,\n FiberTags.ClassComponent,\n FiberTags.IndeterminateComponent,\n FiberTags.SuspenseComponent,\n FiberTags.ForwardRef,\n FiberTags.MemoComponent,\n FiberTags.SimpleMemoComponent,\n FiberTags.LazyComponent,\n]\n\ninterface ReactFiber {\n tag: FiberTag\n type: ComponentType\n memoizedProps: Record<string, unknown>\n /** React 19: Error object captured at JSX creation time, stack may contain compiled frames */\n _debugStack: Error | null\n /** Structured source object injected by JSX dev transforms */\n _debugSource: RawSource | null\n _debugOwner: ReactFiber | null\n return: ReactFiber | null\n stateNode?: HTMLElement | null\n child: ReactFiber | null\n sibling: ReactFiber | null\n}\n\ntype ComponentType =\n | string\n | null\n | {\n displayName?: string\n name?: string\n render?: { name?: string }\n }\n\n/**\n * Finds the React fiber attached to a DOM element.\n * React attaches it as __reactFiber$<randomKey> in development mode.\n */\nfunction findFiber(element: Element): ReactFiber | null {\n const key = Object.keys(element).find((k) => k.startsWith('__reactFiber$'))\n return key\n ? ((element as unknown as Record<string, unknown>)[key] as ReactFiber)\n : null\n}\n\nfunction getDisplayName(type: ComponentType): string {\n if (!type || typeof type === 'string') return 'Unknown'\n return (\n (type as { displayName?: string }).displayName ??\n (type as { name?: string }).name ??\n (type as { render?: { name?: string } }).render?.name ??\n 'Anonymous'\n )\n}\n\nfunction parseStackFrameLocation(frame: string): RawSource | null {\n const parenMatch = frame.match(/\\((.+):(\\d+):(\\d+)\\)$/)\n const bareMatch = frame.match(/^at\\s+(.+):(\\d+):(\\d+)$/)\n const match = parenMatch ?? bareMatch\n if (!match) return null\n\n return {\n fileName: match[1]!,\n lineNumber: parseInt(match[2]!, 10),\n columnNumber: parseInt(match[3]!, 10),\n }\n}\n\nfunction parseSourceLocation(value: string | null): RawSource | null {\n const match = value?.match(/^(.+):(\\d+):(\\d+)$/)\n if (!match) return null\n\n return {\n fileName: match[1]!,\n lineNumber: parseInt(match[2]!, 10),\n columnNumber: parseInt(match[3]!, 10),\n }\n}\n\nfunction getElementSource(element: HTMLElement): RawSource | null {\n return parseSourceLocation(element.getAttribute('data-locatorjs'))\n}\n\n/**\n * Parses the component definition source location from a React fiber's _debugStack.\n *\n * In React 19, _debugStack is an Error object captured at JSX creation time.\n * For a DOM fiber (e.g. <button> inside Button.tsx), the stack contains\n * Button.tsx as the first non-React frame — which is the component's definition file.\n *\n * The fileName may be a full URL in Vite dev mode (e.g. \"http://localhost:5173/src/Button.tsx\").\n * URL → absolute path normalization is deferred to the FileSystemService.\n *\n * When the stack only contains Turbopack chunk frames (common for RSC-rendered\n * parent fibers), returns the first chunk frame so resolveSource can attempt\n * source-map resolution on it.\n */\nfunction parseComponentSource(debugStack: Error | null): RawSource | null {\n if (!debugStack?.stack) return null\n\n let stack = debugStack.stack\n\n // Strip React's sentinel prefix (\"Error: react-stack-top-frame\\n...\")\n if (stack.startsWith('Error: react-stack-top-frame\\n')) {\n stack = stack.slice(stack.indexOf('\\n') + 1)\n } else if (stack.startsWith('Error\\n')) {\n stack = stack.slice('Error\\n'.length)\n }\n\n let firstChunkSource: RawSource | null = null\n\n for (const line of stack.split('\\n')) {\n const trimmed = line.trim()\n if (!trimmed || !trimmed.startsWith('at ')) continue\n\n // Skip React internals and anything from node_modules\n if (\n trimmed.includes('node_modules') ||\n trimmed.includes('react-jsx') ||\n trimmed.includes('react-dom') ||\n trimmed.includes('react-stack-bottom-frame') ||\n trimmed.includes('(@fs') // Vite internal prefix\n )\n continue\n\n // Handles both:\n // at ComponentName (http://localhost:5173/src/Button.tsx:10:5)\n // at webpack-internal:///(app-pages-browser)/./app/page.tsx:10:5\n const source = parseStackFrameLocation(trimmed)\n if (!source) continue\n\n // Prefer non-chunk frames (actual source files) over chunk frames\n if (isChunkPath(source.fileName)) {\n firstChunkSource ??= source\n continue\n }\n\n return source\n }\n\n // All frames were chunk files — return the first one for source-map resolution\n return firstChunkSource\n}\n\n/**\n * Extracts source location from a fiber, supporting both React versions and\n * bundler source strategies.\n *\n * Prefer _debugSource when available because it is the structured JSX source\n * object. In Turbopack builds, _debugStack often points at generated chunk\n * files, while _debugSource still carries the original [project]/... module\n * path emitted by jsxDEV.\n *\n * React 18 paths are absolute filesystem paths (/abs/path/to/File.tsx) so\n * resolveSource() will no-op on them — they're already at original positions.\n */\nfunction getSource(fiber: ReactFiber | null): RawSource | null {\n if (!fiber) return null\n if (fiber._debugSource) return fiber._debugSource\n if (fiber._debugStack) return parseComponentSource(fiber._debugStack)\n return null\n}\n\n/**\n * Given a DOM element, returns the ComponentContext describing the nearest\n * React component that rendered it — including display name, breadcrumb path,\n * source location (definition file), and current props.\n *\n * Pass `point` (mouse coordinates) to enable text-node detection: when the\n * cursor is over a bare text node, `caretPositionFromPoint` gives its direct\n * parent element, which is more specific than the DOM event target that bubbles\n * up to the nearest element ancestor.\n *\n * Note on text source accuracy: React's HostText fibers (tag=6) have\n * _debugStack = null — source location is only stored on element fibers.\n * So the location shown is always where the *containing element* was written\n * (e.g. Card.tsx:11 for `<h3>{title}</h3>`), not where the text value was\n * defined. Resolving the value's origin (prop, const, literal) requires\n * AST-level analysis and is handled by the inline-editing plugin, not here.\n *\n * Returns null if:\n * - React is not present / not in dev mode\n * - The element is not part of a React tree\n * - No component fiber is found in the ancestor chain\n */\nexport async function getComponentContext(\n element: HTMLElement,\n root: string,\n): Promise<ComponentContext | null> {\n const domFiber = findFiber(element)\n if (!domFiber) return null\n\n // Walk up the fiber return chain, collecting host tag names along the way.\n // Stop at (and include) the first React component fiber.\n // e.g. hovering <code> inside <p> inside <Card>:\n // raw → ['code', 'p', 'Card']\n // display → ['Card', 'p', 'code']\n let fiber: ReactFiber | null = domFiber\n const parts: Array<{ source: RawSource | null; names: string[] }> = [\n { source: getElementSource(element) ?? getSource(fiber), names: [] },\n ]\n let i = 0\n\n while (fiber) {\n if (fiber.tag === 5 && typeof fiber.type === 'string') {\n // Host element (div, p, code, …)\n parts[i]!.names.push(fiber.type)\n } else if (\n COMPONENT_TAGS.includes(fiber.tag as (typeof COMPONENT_TAGS)[number])\n ) {\n const name = getDisplayName(fiber.type)\n if (name !== 'Unknown' && name !== 'Anonymous') {\n parts[i]!.names.push(name)\n }\n parts[++i] = { source: getSource(fiber), names: [name] }\n }\n fiber = fiber.return\n }\n\n const sources = await Promise.all(\n parts.map((part) => (part.source ? resolveSource(part.source) : null)),\n )\n\n /** Enrich a raw source with computed relative and absolute paths. */\n function enrichSource(raw: RawSource): ComponentSource {\n return {\n ...raw,\n relativePath: toRelativePath(raw.fileName, root),\n absolutePath: toAbsolutePath(raw.fileName, root) ?? raw.fileName,\n }\n }\n\n // parts: [hovered, …ancestors, Component] — reverse for display order\n const all = parts.map((part, idx) => {\n const resolved = sources[idx]\n return {\n source: resolved ? enrichSource(resolved) : null,\n names: part.names.reverse(),\n }\n })\n\n // remove files without a source and deduplicate same files\n const files = all.reduce<typeof all>((acc, part) => {\n if (!part.source) return acc\n const file = part.source.fileName\n if (!acc.some((p) => p.source?.fileName === file)) acc.push(part)\n return acc\n }, [])\n\n // If there are too many intermediate nodes, keep the component name (first)\n // and the MAX_BREADCRUMB-1 items closest to the hovered element (last).\n const breadcrumb = parts[0]!.names\n\n const displayName = breadcrumb[0] ?? 'Unknown'\n\n return {\n element,\n displayName,\n breadcrumb,\n all: files,\n props: domFiber.memoizedProps ?? {},\n }\n}\n","import {\n useEffectEvent as reactUseEffectEvent,\n useCallback,\n useRef,\n} from 'react'\n\nexport const useEffectEvent =\n reactUseEffectEvent ??\n function useEffectEventShim<T extends (...args: any[]) => any>(fn: T): T {\n const ref = useRef<T>(fn)\n ref.current = fn\n return useCallback(((...args) => ref.current(...args)) as T, [])\n }\n","import { useAtomValue, useSetAtom } from 'jotai'\nimport { useEffect, useRef, useState } from 'react'\n\nimport {\n editorAtom,\n inspectorActiveAtom,\n portalContainerAtom,\n projectRootAtom,\n} from '../store'\nimport type { ComponentContext, ComponentSource, EditorPreset } from '../types'\nimport { getComponentContext } from '../utils/fiber'\nimport { useEffectEvent } from './useEffectEvent'\n\nfunction isTraceUiTarget(\n target: EventTarget | null,\n portalContainer: HTMLElement,\n): boolean {\n if (!(target instanceof Node)) return false\n return portalContainer.contains(target)\n}\n\nfunction buildEditorUrl(\n editor: EditorPreset,\n path: string,\n line: number,\n col: number,\n): string {\n if (editor === 'webstorm') {\n return `webstorm://open?file=${encodeURIComponent(path)}&line=${line}`\n }\n if (editor === 'intellij') {\n return `idea://open?file=${encodeURIComponent(path)}&line=${line}`\n }\n return `${editor}://file/${path}:${line}:${col}`\n}\n\nfunction findFirstProjectSource(\n all: ComponentContext['all'],\n root: string,\n): ComponentSource | null {\n for (const entry of all) {\n if (\n entry.source &&\n entry.source.absolutePath.startsWith(root) &&\n !entry.source.relativePath.startsWith('node_modules/')\n ) {\n return entry.source\n }\n }\n return null\n}\n\n/**\n * LocatorJS-style inspector behavior:\n *\n * - Tracks hovered component context via mousemove + fiber tree walking\n * - Click to open the nearest project source file directly in the editor\n * - Escape to deactivate inspector\n */\nexport function useInspectorBehavior() {\n const portalContainer = useAtomValue(portalContainerAtom)\n const inspectorActive = useAtomValue(inspectorActiveAtom)\n const root = useAtomValue(projectRootAtom)\n const editor = useAtomValue(editorAtom)\n const setInspectorActive = useSetAtom(inspectorActiveAtom)\n const [hoveredContext, setHoveredContext] = useState<ComponentContext | null>(\n null,\n )\n\n const hoveredContextRef = useRef(hoveredContext)\n hoveredContextRef.current = hoveredContext\n\n const openSourceInEditor = useEffectEvent((ctx: ComponentContext) => {\n const source = findFirstProjectSource(ctx.all, root)\n if (!source) return\n\n const url = buildEditorUrl(\n editor,\n source.absolutePath,\n source.lineNumber,\n source.columnNumber,\n )\n window.open(url)\n setInspectorActive(false)\n })\n\n const onEscapeKeyDown = useEffectEvent((e: KeyboardEvent) => {\n if (e.key !== 'Escape') return\n setInspectorActive(false)\n setHoveredContext(null)\n })\n\n useEffect(() => {\n if (!inspectorActive) return\n\n let lastHoveredElement: HTMLElement | null = null\n\n async function onMouseMove(e: MouseEvent) {\n const target = e.target as HTMLElement | null\n if (!target || target === lastHoveredElement) return\n if (isTraceUiTarget(target, portalContainer)) return\n\n lastHoveredElement = target\n\n try {\n const ctx = await getComponentContext(target, root)\n if (lastHoveredElement !== target) return\n setHoveredContext(ctx)\n } catch {}\n }\n\n function onClick(e: MouseEvent) {\n const target = e.target as HTMLElement | null\n if (isTraceUiTarget(target, portalContainer)) return\n\n e.stopPropagation()\n e.preventDefault()\n\n const ctx = hoveredContextRef.current\n if (ctx) openSourceInEditor(ctx)\n }\n\n document.addEventListener('mousemove', onMouseMove, { passive: true })\n document.addEventListener('click', onClick, true)\n document.addEventListener('keydown', onEscapeKeyDown)\n\n return () => {\n document.removeEventListener('mousemove', onMouseMove)\n document.removeEventListener('click', onClick, true)\n document.removeEventListener('keydown', onEscapeKeyDown)\n }\n }, [inspectorActive, portalContainer, root])\n\n // Clear hover when inspector is turned off\n useEffect(() => {\n if (!inspectorActive) {\n setHoveredContext(null)\n }\n }, [inspectorActive])\n\n return { hoveredContext }\n}\n","import { useAtom, useAtomValue, useSetAtom } from 'jotai'\nimport { useEffect, useRef } from 'react'\n\nimport { coreSettingsAtom, inspectorActiveAtom } from '../store'\nimport { IS_MAC } from '../utils/platform'\n\nconst MODIFIER_INSPECT_DELAY_MS = 250\nconst LEGACY_SHORTCUT_DELAY_MS = 600\n\n/**\n * Activates inspect mode when the user holds Option/Alt. Releasing before the\n * timer fires cancels activation; releasing after activation exits inspect mode.\n *\n * Also keeps the legacy Cmd+X (Mac) / Ctrl+X shortcut working.\n */\nexport function useLongPressHotkey() {\n const inspectorActive = useAtomValue(inspectorActiveAtom)\n const setInspectorActive = useSetAtom(inspectorActiveAtom)\n const [coreSettings, setCoreSettings] = useAtom(coreSettingsAtom)\n const settingsRef = useRef(coreSettings)\n const inspectorActiveRef = useRef(inspectorActive)\n settingsRef.current = coreSettings\n inspectorActiveRef.current = inspectorActive\n\n useEffect(() => {\n let modifierTimer: ReturnType<typeof setTimeout> | null = null\n let legacyTimer: ReturnType<typeof setTimeout> | null = null\n let modifierActivated = false\n let modifierStartedWithInspector = false\n\n function activateInspector() {\n setInspectorActive(true)\n if (settingsRef.current.minimized) {\n setCoreSettings({ ...settingsRef.current, minimized: false })\n }\n }\n\n function clearModifierTimer() {\n if (modifierTimer !== null) {\n clearTimeout(modifierTimer)\n modifierTimer = null\n }\n }\n\n function clearLegacyTimer() {\n if (legacyTimer !== null) {\n clearTimeout(legacyTimer)\n legacyTimer = null\n }\n }\n\n function onKeyDown(e: KeyboardEvent) {\n if (\n e.key === 'Alt' &&\n !e.repeat &&\n modifierTimer === null &&\n !modifierActivated\n ) {\n modifierStartedWithInspector = inspectorActiveRef.current\n modifierTimer = setTimeout(() => {\n modifierTimer = null\n modifierActivated = !modifierStartedWithInspector\n activateInspector()\n }, MODIFIER_INSPECT_DELAY_MS)\n }\n\n const modifierHeld = IS_MAC ? e.metaKey : e.ctrlKey\n if (e.key === 'x' && modifierHeld && !e.repeat && legacyTimer === null) {\n e.preventDefault()\n legacyTimer = setTimeout(() => {\n legacyTimer = null\n activateInspector()\n }, LEGACY_SHORTCUT_DELAY_MS)\n }\n }\n\n function onKeyUp(e: KeyboardEvent) {\n if (e.key === 'Alt') {\n clearModifierTimer()\n if (modifierActivated) {\n modifierActivated = false\n setInspectorActive(false)\n }\n }\n\n if (e.key === 'x' || e.key === 'Meta' || e.key === 'Control') {\n clearLegacyTimer()\n }\n }\n\n function onWindowBlur() {\n clearModifierTimer()\n clearLegacyTimer()\n if (modifierActivated) {\n modifierActivated = false\n setInspectorActive(false)\n }\n }\n\n document.addEventListener('keydown', onKeyDown)\n document.addEventListener('keyup', onKeyUp)\n window.addEventListener('blur', onWindowBlur)\n return () => {\n document.removeEventListener('keydown', onKeyDown)\n document.removeEventListener('keyup', onKeyUp)\n window.removeEventListener('blur', onWindowBlur)\n clearModifierTimer()\n clearLegacyTimer()\n }\n }, [])\n}\n","import { useEffect, useState } from 'react'\n\nimport type { ComponentContext } from '../types'\n\ninterface OverlayProps {\n hoveredContext: ComponentContext | null\n}\n\ninterface Rect {\n top: number\n left: number\n width: number\n height: number\n}\n\nfunction toRect(el: HTMLElement): Rect {\n const r = el.getBoundingClientRect()\n return { top: r.top, left: r.left, width: r.width, height: r.height }\n}\n\nfunction HighlightRect({\n rect,\n label,\n}: {\n rect: Rect\n label: string\n}) {\n return (\n <>\n <div\n style={{\n position: 'fixed',\n top: rect.top,\n left: rect.left,\n width: rect.width,\n height: rect.height,\n background: 'rgba(59,130,246,0.07)',\n border: '2px dashed rgba(59,130,246,0.7)',\n borderRadius: 2,\n pointerEvents: 'none',\n boxSizing: 'border-box',\n }}\n />\n <div\n style={{\n position: 'fixed',\n top: Math.max(0, rect.top - 24),\n left: rect.left,\n background: 'rgba(59,130,246,0.85)',\n color: '#fff',\n fontSize: 11,\n fontFamily: 'ui-monospace, monospace',\n fontWeight: 600,\n padding: '2px 6px',\n borderRadius: 4,\n whiteSpace: 'nowrap',\n pointerEvents: 'none',\n lineHeight: '18px',\n }}\n >\n {label}\n </div>\n </>\n )\n}\n\nexport function Overlay({ hoveredContext }: OverlayProps) {\n const [mouse, setMouse] = useState<{ x: number; y: number } | null>(null)\n\n useEffect(() => {\n function onMove(e: MouseEvent) {\n setMouse({ x: e.clientX, y: e.clientY })\n }\n document.addEventListener('mousemove', onMove, { passive: true })\n return () => {\n document.removeEventListener('mousemove', onMove)\n }\n }, [])\n\n const [hoveredRect, setHoveredRect] = useState<Rect | null>(null)\n\n useEffect(() => {\n setHoveredRect(hoveredContext ? toRect(hoveredContext.element) : null)\n }, [hoveredContext])\n\n useEffect(() => {\n document.body.style.cursor = 'crosshair'\n return () => {\n document.body.style.cursor = ''\n }\n }, [])\n\n useEffect(() => {\n if (!hoveredContext) return\n\n function update() {\n if (hoveredContext) setHoveredRect(toRect(hoveredContext.element))\n }\n\n window.addEventListener('scroll', update, { passive: true, capture: true })\n window.addEventListener('resize', update, { passive: true })\n return () => {\n window.removeEventListener('scroll', update, { capture: true })\n window.removeEventListener('resize', update)\n }\n }, [hoveredContext])\n\n return (\n <div\n style={{\n position: 'fixed',\n inset: 0,\n pointerEvents: 'none',\n zIndex: 999998,\n }}\n >\n {mouse && (\n <>\n <div\n style={{\n position: 'fixed',\n top: 0,\n left: mouse.x,\n width: 1,\n height: '100dvh',\n background: 'rgba(59,130,246,0.5)',\n pointerEvents: 'none',\n }}\n />\n <div\n style={{\n position: 'fixed',\n left: 0,\n top: mouse.y,\n height: 1,\n width: '100dvw',\n background: 'rgba(59,130,246,0.5)',\n pointerEvents: 'none',\n }}\n />\n </>\n )}\n {hoveredRect && hoveredContext && (\n <HighlightRect\n rect={hoveredRect}\n label={hoveredContext.breadcrumb.join(' › ')}\n />\n )}\n </div>\n )\n}\n","import { Button } from '@react-spot/ui-components'\nimport type { ErrorInfo, PropsWithChildren } from 'react'\nimport { Component } from 'react'\n\nexport class ErrorBoundary extends Component<\n PropsWithChildren,\n { hasError: boolean; error?: Error }\n> {\n constructor(props: PropsWithChildren) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError(error: Error) {\n // Update state so the next render will show the fallback UI.\n return { hasError: true, error }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n // You can also log the error to an error reporting service\n console.error(error, errorInfo)\n }\n\n render() {\n if (this.state.hasError) {\n // You can render any custom fallback UI\n return (\n <h1>\n Something went wrong.{' '}\n <Button\n variant=\"primary\"\n onClick={() => this.setState({ hasError: false })}\n >\n Try Again\n </Button>\n </h1>\n )\n }\n\n return this.props.children\n }\n}\n","import { useAtomValue, useSetAtom } from 'jotai'\nimport { useCallback } from 'react'\n\nimport {\n inspectorActiveAtom,\n portalContainerAtom,\n projectRootAtom,\n selectedContextAtom,\n selectedSourceAtom,\n} from './store'\n\nexport function useProjectRoot() {\n return useAtomValue(projectRootAtom)\n}\n\nexport function useInspectorActive() {\n return useAtomValue(inspectorActiveAtom)\n}\n\nexport function useDeactivateInspector() {\n const setInspectorActive = useSetAtom(inspectorActiveAtom)\n return useCallback(() => setInspectorActive(false), [setInspectorActive])\n}\n\nexport function useSelectedContext() {\n return useAtomValue(selectedContextAtom)\n}\n\nexport function useClearSelectedContext() {\n const setSelectedContext = useSetAtom(selectedContextAtom)\n return useCallback(() => setSelectedContext(null), [setSelectedContext])\n}\n\nexport function useSelectedSource() {\n return useAtomValue(selectedSourceAtom)\n}\n\nexport function useWidgetPortalContainer() {\n return useAtomValue(portalContainerAtom)\n}\n","import {\n Button,\n IconButton,\n PanelHeader,\n Popover,\n Select,\n Separator,\n SettingsIcon,\n ToolbarButton,\n Tooltip,\n XIcon,\n} from '@react-spot/ui-components'\nimport { useAtom } from 'jotai'\nimport type { CSSProperties } from 'react'\nimport { Fragment, useRef, useState } from 'react'\n\nimport { useDeactivateInspector, useWidgetPortalContainer } from '../hooks'\nimport { coreSettingsAtom, projectRootAtom } from '../store'\nimport type { TracePlugin, TraceSettings } from '../types'\n\nconst SECTION_TITLE_STYLE: CSSProperties = {\n fontSize: 11,\n fontWeight: 600,\n color: '#71717a',\n fontFamily: 'system-ui, sans-serif',\n letterSpacing: '0.04em',\n textTransform: 'uppercase',\n}\n\nconst LABEL_STYLE: CSSProperties = {\n fontSize: 12,\n color: '#d4d4d8',\n fontFamily: 'system-ui, sans-serif',\n}\n\nconst INPUT_STYLE: CSSProperties = {\n width: '100%',\n minWidth: 0,\n background: '#0f0f11',\n border: '1px solid #3f3f46',\n borderRadius: 5,\n color: '#fafafa',\n fontSize: 12,\n fontFamily: 'system-ui, sans-serif',\n padding: '6px 8px',\n boxSizing: 'border-box',\n}\n\nconst POSITION_OPTIONS: Array<{\n value: TraceSettings['core']['position']\n label: string\n}> = [\n { value: 'bottom-right', label: 'Bottom right' },\n { value: 'bottom-left', label: 'Bottom left' },\n { value: 'top-right', label: 'Top right' },\n { value: 'top-left', label: 'Top left' },\n]\n\nfunction CoreSettingsSection() {\n const portalContainer = useWidgetPortalContainer()\n const [root, setRoot] = useAtom(projectRootAtom)\n const [coreSettings, setCoreSettings] = useAtom(coreSettingsAtom)\n\n const [draftRoot, setDraftRoot] = useState(root)\n\n const trimmedRoot = draftRoot.trim()\n const canApplyRoot = trimmedRoot.length > 0 && trimmedRoot !== root\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>\n <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>\n <label style={LABEL_STYLE}>Project root</label>\n <div style={{ display: 'flex', gap: 8 }}>\n <input\n value={draftRoot}\n onChange={(e) => setDraftRoot(e.target.value)}\n onKeyDown={(e) => {\n e.stopPropagation()\n\n if (e.key === 'Enter' && canApplyRoot) {\n e.preventDefault()\n setRoot(trimmedRoot)\n }\n }}\n style={INPUT_STYLE}\n />\n <Button\n variant=\"secondary\"\n disabled={!canApplyRoot}\n onClick={() => setRoot(trimmedRoot)}\n >\n Apply\n </Button>\n </div>\n </div>\n\n <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>\n <label style={LABEL_STYLE}>Toolbar position</label>\n <Select.Root\n value={coreSettings.position}\n items={POSITION_OPTIONS}\n onValueChange={(value) => {\n if (value) {\n setCoreSettings({ ...coreSettings, position: value })\n }\n }}\n >\n <Select.Trigger onClick={(e) => e.stopPropagation()}>\n <Select.Value />\n </Select.Trigger>\n\n <Select.Portal container={portalContainer}>\n <Select.Positioner\n style={{ zIndex: 100000000, pointerEvents: 'auto' }}\n >\n <Select.Popup>\n <Select.List>\n {POSITION_OPTIONS.map((option) => (\n <Select.Item\n key={option.value}\n value={option.value}\n onClick={(e) => e.stopPropagation()}\n >\n <Select.ItemText>{option.label}</Select.ItemText>\n </Select.Item>\n ))}\n </Select.List>\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n </div>\n </div>\n )\n}\n\nexport function SettingsMenu({ plugins }: { plugins: TracePlugin[] }) {\n const portalContainer = useWidgetPortalContainer()\n const deactivateInspector = useDeactivateInspector()\n\n const [isOpen, setIsOpen] = useState(false)\n const buttonRef = useRef<HTMLButtonElement>(null)\n\n const settingsPlugins = plugins.filter(\n (\n plugin,\n ): plugin is TracePlugin & {\n settings: NonNullable<TracePlugin['settings']>\n } => Boolean(plugin.settings),\n )\n\n return (\n <>\n <Tooltip\n label=\"Settings\"\n container={portalContainer}\n render={<ToolbarButton ref={buttonRef} />}\n aria-label=\"Settings\"\n onClick={() => {\n deactivateInspector()\n setIsOpen((open) => !open)\n }}\n >\n <SettingsIcon />\n </Tooltip>\n\n <Popover.Root open={isOpen} onOpenChange={setIsOpen}>\n <Popover.Portal container={portalContainer}>\n <Popover.Positioner\n anchor={buttonRef.current}\n side=\"top\"\n align=\"end\"\n sideOffset={8}\n collisionPadding={8}\n positionMethod=\"fixed\"\n style={{ zIndex: 99999999, pointerEvents: 'auto' }}\n >\n <Popover.Popup style={{ width: 320 }}>\n <PanelHeader\n title=\"Settings\"\n actionsRender={\n <IconButton onClick={() => setIsOpen(false)} title=\"Close\">\n <XIcon />\n </IconButton>\n }\n />\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: 12,\n padding: 12,\n }}\n >\n <div\n style={{ display: 'flex', flexDirection: 'column', gap: 10 }}\n >\n <div style={SECTION_TITLE_STYLE}>Core</div>\n <CoreSettingsSection />\n </div>\n {settingsPlugins.map((plugin) => {\n const SettingsContent = plugin.settings\n return (\n <Fragment key={`settings:${plugin.name}`}>\n <Separator />\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: 10,\n }}\n >\n <div style={SECTION_TITLE_STYLE}>{plugin.name}</div>\n <SettingsContent />\n </div>\n </Fragment>\n )\n })}\n </div>\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n </>\n )\n}\n","import {\n ChevronLeftIcon,\n ChevronRightIcon,\n ToolbarButton,\n Tooltip,\n} from '@react-spot/ui-components'\nimport { Logo } from '@react-spot/ui-components'\nimport { useAtom, useAtomValue } from 'jotai'\nimport type { CSSProperties } from 'react'\n\nimport {\n coreSettingsAtom,\n inspectorActiveAtom,\n portalContainerAtom,\n} from '../store'\nimport type { TracePlugin, TraceProps } from '../types'\nimport { IS_MAC } from '../utils/platform'\nimport { ErrorBoundary } from './ErrorBoundary'\nimport { SettingsMenu } from './SettingsMenu'\n\ninterface ToolbarProps {\n plugins: TracePlugin[]\n}\n\nconst DEFAULT_SPACING = 32\n\nconst POSITION_STYLES: Record<\n NonNullable<TraceProps['position']>,\n CSSProperties\n> = {\n 'bottom-right': { bottom: DEFAULT_SPACING, right: DEFAULT_SPACING },\n 'bottom-left': { bottom: DEFAULT_SPACING, left: DEFAULT_SPACING },\n 'top-right': { top: DEFAULT_SPACING, right: DEFAULT_SPACING },\n 'top-left': { top: DEFAULT_SPACING, left: DEFAULT_SPACING },\n}\n\nconst MINIMIZED_POSITION_STYLES: Record<\n NonNullable<TraceProps['position']>,\n CSSProperties\n> = {\n 'bottom-right': { bottom: DEFAULT_SPACING, right: 0 },\n 'bottom-left': { bottom: DEFAULT_SPACING, left: 0 },\n 'top-right': { top: DEFAULT_SPACING, right: 0 },\n 'top-left': { top: DEFAULT_SPACING, left: 0 },\n}\n\nconst TOGGLE_SHORTCUT = IS_MAC ? 'Hold Option' : 'Hold Alt'\n\nconst contentGridStyle: CSSProperties = {\n display: 'grid',\n transition: 'grid-template-columns 0.3s ease',\n}\n\nconst contentInnerStyle: CSSProperties = {\n overflow: 'hidden',\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n}\n\nexport function Toolbar({ plugins }: ToolbarProps) {\n const [isInspectorActive, setInspectorActive] = useAtom(inspectorActiveAtom)\n const portalContainer = useAtomValue(portalContainerAtom)\n const [coreSettings, setCoreSettings] = useAtom(coreSettingsAtom)\n\n const minimized = coreSettings.minimized ?? false\n const isRightAligned = coreSettings.position.includes('right')\n\n const toggleMinimized = () => {\n setCoreSettings({ ...coreSettings, minimized: !minimized })\n }\n\n const CollapseArrow = isRightAligned ? ChevronRightIcon : ChevronLeftIcon\n const ExpandArrow = isRightAligned ? ChevronLeftIcon : ChevronRightIcon\n\n const toggleButton = (\n <Tooltip\n label={minimized ? 'Expand toolbar' : 'Collapse toolbar'}\n container={portalContainer}\n render={<ToolbarButton style={{ width: 16, color: '#71717a' }} />}\n aria-label={minimized ? 'Expand toolbar' : 'Collapse toolbar'}\n onClick={toggleMinimized}\n >\n {minimized ? <ExpandArrow /> : <CollapseArrow />}\n </Tooltip>\n )\n\n const toolbarContent = (\n <div\n style={{\n ...contentGridStyle,\n gridTemplateColumns: minimized ? '0fr' : '1fr',\n }}\n >\n <div style={contentInnerStyle}>\n <Tooltip\n label=\"Inspector\"\n shortcut={isInspectorActive ? 'Esc to exit' : TOGGLE_SHORTCUT}\n container={portalContainer}\n render={<ToolbarButton />}\n aria-label=\"Inspector\"\n onClick={() => setInspectorActive((prev) => !prev)}\n >\n <Logo />\n </Tooltip>\n {plugins\n .filter((plugin) => plugin.toolbar)\n .map((plugin) => {\n const ToolbarContent = plugin.toolbar!\n return (\n <ErrorBoundary key={plugin.name}>\n <ToolbarContent />\n </ErrorBoundary>\n )\n })}\n <SettingsMenu plugins={plugins} />\n </div>\n </div>\n )\n\n return (\n <Tooltip.Provider delay={300}>\n <div\n style={{\n position: 'fixed',\n ...(minimized\n ? MINIMIZED_POSITION_STYLES[coreSettings.position]\n : POSITION_STYLES[coreSettings.position]),\n display: 'flex',\n alignItems: 'center',\n overflow: 'hidden',\n background: '#18181b',\n borderRadius: minimized\n ? isRightAligned\n ? '10px 0 0 10px'\n : '0 10px 10px 0'\n : 10,\n boxShadow: '0 4px 16px rgba(0,0,0,0.5)',\n outline: isInspectorActive\n ? '2px solid #3b82f6'\n : '2px solid transparent',\n transition:\n 'right 0.3s ease, left 0.3s ease, border-radius 0.3s ease',\n userSelect: 'none',\n height: 32,\n boxSizing: 'border-box',\n zIndex: 999999,\n }}\n >\n {!isRightAligned && toggleButton}\n {toolbarContent}\n {isRightAligned && toggleButton}\n </div>\n </Tooltip.Provider>\n )\n}\n","import { Provider, useAtomValue } from 'jotai'\nimport { useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useInspectorBehavior } from '../hooks/useInspectorBehavior'\nimport { useLongPressHotkey } from '../hooks/useLongPressHotkey'\nimport {\n coreSettingsAtom,\n createWidgetStore,\n editorAtom,\n inspectorActiveAtom,\n portalContainerAtom,\n projectRootAtom,\n} from '../store'\nimport type { TraceProps } from '../types'\nimport { Overlay } from './Overlay'\nimport { Toolbar } from './Toolbar'\n\nexport function Trace({\n root,\n editor = 'vscode',\n plugins = [],\n position = 'bottom-right',\n minimized = false,\n}: TraceProps) {\n const [jotaiStore] = useState(() => {\n const store = createWidgetStore()\n store.set(projectRootAtom, root)\n store.set(editorAtom, editor)\n if (!store.get(coreSettingsAtom)) {\n store.set(coreSettingsAtom, { position, minimized })\n }\n return store\n })\n\n return (\n <Provider store={jotaiStore}>\n <TraceRoot plugins={plugins} />\n </Provider>\n )\n}\n\ntype TraceRootProps = {\n plugins: NonNullable<TraceProps['plugins']>\n}\nfunction TraceRoot({ plugins }: TraceRootProps) {\n const portalContainer = useAtomValue(portalContainerAtom)\n const inspectorActive = useAtomValue(inspectorActiveAtom)\n\n const { hoveredContext } = useInspectorBehavior()\n\n useLongPressHotkey()\n\n return createPortal(\n <>\n <div style={{ pointerEvents: 'auto' }}>\n <Toolbar plugins={plugins} />\n </div>\n\n {inspectorActive && <Overlay hoveredContext={hoveredContext} />}\n </>,\n portalContainer,\n )\n}\n"],"x_google_ignoreList":[0,1,3,4,5],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,SAAgB,WAAW,gBAAgB,UAAU;CACjD,IAAI,eAAe;CACnB,MAAM,wBAAQ,IAAI,KAAK;CACvB,MAAM,4BAAY,IAAI,KAAK;CAC3B,SAAS,WAAW,OAAO;EACvB,IAAI;AACJ,MAAI,aAAa,OACb,QAAO,MAAM,IAAI,MAAM;MAIvB,MAAK,MAAM,CAAC,KAAK,UAAU,MACvB,KAAI,SAAS,KAAK,MAAM,EAAE;AACtB,UAAO;AACP;;AAIZ,MAAI,SAAS,OACT,KAAI,eAAe,KAAK,IAAI,MAAM,CAC9B,YAAW,OAAO,MAAM;MAGxB,QAAO,KAAK;EAGpB,MAAM,UAAU,eAAe,MAAM;AACrC,QAAM,IAAI,OAAO,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC;AACvC,kBAAgB,UAAU,OAAO,QAAQ;AACzC,SAAO;;CAEX,SAAS,gBAAgB,MAAM,OAAO,MAAM;AACxC,OAAK,MAAM,YAAY,UACnB,UAAS;GAAE;GAAM;GAAO;GAAM,CAAC;;AAGvC,YAAW,mBAAmB,aAAa;AACvC,YAAU,IAAI,SAAS;AACvB,eAAa;AACT,aAAU,OAAO,SAAS;;;AAGlC,YAAW,kBAAkB,MAAM,MAAM;AACzC,YAAW,UAAU,UAAU;AAC3B,MAAI,aAAa,QAAW;AACxB,OAAI,CAAC,MAAM,IAAI,MAAM,CACjB;GACJ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AU;IACV,YAAY;IACZ,cAAc,YACV,iBACE,kBACA,kBACF;IACJ,WAAW;IACX,SAAS,oBACL,sBACA;IACJ,YACE;IACF,YAAY;IACZ,QAAQ;IACR,WAAW;IACX,QAAQ;IACT;aAzBH;IA2BG,CAAC,kBAAkB;IACnB;IACA,kBAAkB;IACf;;EACW;;;;;ACvIvB,SAAgB,MAAM,EACpB,MACA,SAAS,UACT,UAAU,EAAE,EACZ,WAAW,gBACX,YAAY,SACC;CACb,MAAM,CAAC,wCAA6B;EAClC,MAAM,QAAQ,mBAAmB;AACjC,QAAM,IAAI,iBAAiB,KAAK;AAChC,QAAM,IAAI,YAAY,OAAO;AAC7B,MAAI,CAAC,MAAM,IAAI,iBAAiB,CAC9B,OAAM,IAAI,kBAAkB;GAAE;GAAU;GAAW,CAAC;AAEtD,SAAO;GACP;AAEF,QACE,2CAACG,sBAAD;EAAU,OAAO;YACf,2CAAC,WAAD,EAAoB,SAAW;EACtB;;AAOf,SAAS,UAAU,EAAE,WAA2B;CAC9C,MAAM,gDAA+B,oBAAoB;CACzD,MAAM,gDAA+B,oBAAoB;CAEzD,MAAM,EAAE,mBAAmB,sBAAsB;AAEjD,qBAAoB;AAEpB,oCACE,qFACE,2CAAC,OAAD;EAAK,OAAO,EAAE,eAAe,QAAQ;YACnC,2CAAC,SAAD,EAAkB,SAAW;EACzB,GAEL,mBAAmB,2CAAC,SAAD,EAAyB,gBAAkB,EAC9D,KACH,gBACD"}
@@ -0,0 +1,31 @@
1
+ import { a as ComponentSource, c as TraceProps, i as ComponentContext, l as TraceSettings, n as IS_MAC, o as EditorPreset, r as MOD_KEY, s as TracePlugin, t as index_d_exports } from "./index-ujwIx3_4.cjs";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/components/Trace.d.ts
5
+ declare function Trace({
6
+ root,
7
+ editor,
8
+ plugins,
9
+ position,
10
+ minimized
11
+ }: TraceProps): react_jsx_runtime0.JSX.Element;
12
+ //#endregion
13
+ //#region src/hooks.d.ts
14
+ declare function useProjectRoot(): string;
15
+ declare function useInspectorActive(): boolean;
16
+ declare function useDeactivateInspector(): () => void;
17
+ declare function useSelectedContext(): ComponentContext | null;
18
+ declare function useClearSelectedContext(): () => void;
19
+ declare function useSelectedSource(): ComponentSource | null;
20
+ declare function useWidgetPortalContainer(): HTMLDivElement;
21
+ //#endregion
22
+ //#region src/store.d.ts
23
+ /**
24
+ * Atom family for plugin-specific settings.
25
+ * @param pluginKey
26
+ * @returns
27
+ */
28
+ declare function settingsPluginAtom<K extends keyof TraceSettings>(pluginKey: K): index_d_exports.WritableAtom<TraceSettings[K], [TraceSettings[K]], void>;
29
+ //#endregion
30
+ export { type ComponentContext, type ComponentSource, type EditorPreset, IS_MAC, MOD_KEY, Trace, type TracePlugin, type TraceProps, type TraceSettings, settingsPluginAtom, useClearSelectedContext, useDeactivateInspector, useInspectorActive, useProjectRoot, useSelectedContext, useSelectedSource, useWidgetPortalContainer };
31
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/components/Trace.tsx","../src/hooks.ts","../src/store.ts"],"mappings":";;;;iBAkBgB,KAAA,CAAA;EACd,IAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA;AAAA,GACC,UAAA,GAAU,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCbG,cAAA,CAAA;AAAA,iBAIA,kBAAA,CAAA;AAAA,iBAIA,sBAAA,CAAA;AAAA,iBAKA,kBAAA,CAAA,GAAkB,gBAAA;AAAA,iBAIlB,uBAAA,CAAA;AAAA,iBAKA,iBAAA,CAAA,GAAiB,eAAA;AAAA,iBAIjB,wBAAA,CAAA,GAAwB,cAAA;;;;;;;;iBCiBxB,kBAAA,iBAAmC,aAAA,CAAA,CACjD,SAAA,EAAW,CAAA,GAG+B,eAAA,CAAA,YAAA,CACxC,aAAA,CAAc,CAAA,IACb,aAAA,CAAc,CAAA"}
@@ -0,0 +1,31 @@
1
+ import { a as ComponentSource, c as TraceProps, i as ComponentContext, l as TraceSettings, n as IS_MAC, o as EditorPreset, r as MOD_KEY, s as TracePlugin, t as index_d_exports } from "./index-CyjjTUAd.js";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/components/Trace.d.ts
5
+ declare function Trace({
6
+ root,
7
+ editor,
8
+ plugins,
9
+ position,
10
+ minimized
11
+ }: TraceProps): react_jsx_runtime0.JSX.Element;
12
+ //#endregion
13
+ //#region src/hooks.d.ts
14
+ declare function useProjectRoot(): string;
15
+ declare function useInspectorActive(): boolean;
16
+ declare function useDeactivateInspector(): () => void;
17
+ declare function useSelectedContext(): ComponentContext | null;
18
+ declare function useClearSelectedContext(): () => void;
19
+ declare function useSelectedSource(): ComponentSource | null;
20
+ declare function useWidgetPortalContainer(): HTMLDivElement;
21
+ //#endregion
22
+ //#region src/store.d.ts
23
+ /**
24
+ * Atom family for plugin-specific settings.
25
+ * @param pluginKey
26
+ * @returns
27
+ */
28
+ declare function settingsPluginAtom<K extends keyof TraceSettings>(pluginKey: K): index_d_exports.WritableAtom<TraceSettings[K], [TraceSettings[K]], void>;
29
+ //#endregion
30
+ export { type ComponentContext, type ComponentSource, type EditorPreset, IS_MAC, MOD_KEY, Trace, type TracePlugin, type TraceProps, type TraceSettings, settingsPluginAtom, useClearSelectedContext, useDeactivateInspector, useInspectorActive, useProjectRoot, useSelectedContext, useSelectedSource, useWidgetPortalContainer };
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/Trace.tsx","../src/hooks.ts","../src/store.ts"],"mappings":";;;;iBAkBgB,KAAA,CAAA;EACd,IAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA;AAAA,GACC,UAAA,GAAU,kBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCbG,cAAA,CAAA;AAAA,iBAIA,kBAAA,CAAA;AAAA,iBAIA,sBAAA,CAAA;AAAA,iBAKA,kBAAA,CAAA,GAAkB,gBAAA;AAAA,iBAIlB,uBAAA,CAAA;AAAA,iBAKA,iBAAA,CAAA,GAAiB,eAAA;AAAA,iBAIjB,wBAAA,CAAA,GAAwB,cAAA;;;;;;;;iBCiBxB,kBAAA,iBAAmC,aAAA,CAAA,CACjD,SAAA,EAAW,CAAA,GAG+B,eAAA,CAAA,YAAA,CACxC,aAAA,CAAc,CAAA,IACb,aAAA,CAAc,CAAA"}