reflet-sdk 0.5.1 → 0.6.0

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +24 -4
  3. package/dist/{client-BWEBWk1k.js → client-DAdWdIFY.js} +17 -13
  4. package/dist/client-DAdWdIFY.js.map +1 -0
  5. package/dist/{client-w4Rkl10y.d.ts → client-DF1fdsSC.d.ts} +3 -1
  6. package/dist/{client-w4Rkl10y.d.ts.map → client-DF1fdsSC.d.ts.map} +1 -1
  7. package/dist/{devtools-layer-EyK7n9w3.js → devtools-layer-D_0UL_Wd.js} +2879 -2717
  8. package/dist/devtools-layer-D_0UL_Wd.js.map +1 -0
  9. package/dist/devtools-next.d.ts +1 -1
  10. package/dist/devtools-next.d.ts.map +1 -1
  11. package/dist/devtools-next.js +1 -1
  12. package/dist/devtools-vite.d.ts +1 -1
  13. package/dist/devtools-vite.d.ts.map +1 -1
  14. package/dist/devtools-vite.js +7 -3
  15. package/dist/devtools-vite.js.map +1 -1
  16. package/dist/feedback.d.ts.map +1 -1
  17. package/dist/feedback.js +51 -34
  18. package/dist/feedback.js.map +1 -1
  19. package/dist/{handler-CHP0m7KF.js → handler-C9tdKcl0.js} +335 -46
  20. package/dist/handler-C9tdKcl0.js.map +1 -0
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/{options-7KtQZJj8.d.ts → options-CIBazDPp.d.ts} +3 -1
  24. package/dist/options-CIBazDPp.d.ts.map +1 -0
  25. package/dist/{picker-DFfC1uIY.js → picker-C7TkZcBE.js} +60 -44
  26. package/dist/picker-C7TkZcBE.js.map +1 -0
  27. package/dist/{protocol-Bn6Bg_0r.js → protocol-ClqTFzwR.js} +4 -1
  28. package/dist/protocol-ClqTFzwR.js.map +1 -0
  29. package/dist/react.d.ts +1 -1
  30. package/dist/react.d.ts.map +1 -1
  31. package/dist/react.js +43 -49
  32. package/dist/react.js.map +1 -1
  33. package/dist/{z-index-CKxBgZTG.js → z-index-BL0SGZEP.js} +7 -7
  34. package/dist/z-index-BL0SGZEP.js.map +1 -0
  35. package/package.json +3 -2
  36. package/dist/client-BWEBWk1k.js.map +0 -1
  37. package/dist/devtools-layer-EyK7n9w3.js.map +0 -1
  38. package/dist/handler-CHP0m7KF.js.map +0 -1
  39. package/dist/options-7KtQZJj8.d.ts.map +0 -1
  40. package/dist/picker-DFfC1uIY.js.map +0 -1
  41. package/dist/protocol-Bn6Bg_0r.js.map +0 -1
  42. package/dist/z-index-CKxBgZTG.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"feedback.js","names":[],"sources":["../src/feedback/ui/annotation/color-value.ts","../src/feedback/ui/annotation/text/text-editor.tsx","../src/feedback/ui/annotation/text/use-text-annotation.ts","../src/feedback/ui/floating/use-details-popover.ts","../src/feedback/ui/annotation/color-picker.tsx","../src/feedback/ui/annotation/tool-menu.tsx","../src/feedback/ui/annotation/toolbar.tsx","../src/feedback/ui/annotation/use-annotation-canvas.ts","../src/feedback/ui/annotation/use-image-morph.ts","../src/feedback/ui/annotator.tsx","../src/feedback/ui/devtools-owner.ts","../src/feedback/ui/launcher.tsx","../src/feedback/ui/composer/capture-slot.tsx","../src/feedback/core/element-capture.ts","../src/feedback/ui/annotation/screenshot-preview.tsx","../src/feedback/ui/composer/screenshot-card.tsx","../src/feedback/ui/composer/attachments.tsx","../src/feedback/ui/composer/email-prompt.tsx","../src/feedback/ui/composer/options.tsx","../src/feedback/ui/composer/message-input.tsx","../src/feedback/ui/panel.tsx","../src/feedback/core/console-recorder.ts","../src/feedback/ui/state/use-feedback-submission.ts","../src/feedback/ui/state/use-screenshot-drafts.ts","../src/feedback/ui/state/use-widget-config.ts","../src/feedback/ui/use-capture-sync.ts","../src/feedback/ui/use-widget-state.ts","../src/feedback/ui/floating/floating-widget.tsx","../src/feedback/ui/annotation/styles.ts","../src/feedback/ui/composer/styles.ts","../src/feedback/ui/floating/picker-styles.ts","../src/feedback/ui/styles.ts","../src/feedback/ui/shadow-portal.tsx","../src/feedback/widget.tsx"],"sourcesContent":["export interface AnnotationColor {\n baseColor: string;\n strengthPercent: number;\n}\n\nexport const DEFAULT_ANNOTATION_COLOR: AnnotationColor = {\n baseColor: \"#ef4444\",\n strengthPercent: 100,\n};\n\nexport function annotationColorHex({\n baseColor,\n strengthPercent,\n}: AnnotationColor): string {\n const channels = [1, 3, 5].map((offset) => {\n const channel = Number.parseInt(baseColor.slice(offset, offset + 2), 16);\n return Math.round(255 + ((channel - 255) * strengthPercent) / 100)\n .toString(16)\n .padStart(2, \"0\");\n });\n return `#${channels.join(\"\")}`;\n}\n","import { useEffect, useId, useRef, useState } from \"react\";\nimport type { Annotation, Point } from \"../../../types\";\nimport { CheckIcon, CloseIcon } from \"../../icons\";\n\nexport interface TextDraft {\n annotation: Annotation;\n fontSize: number;\n position: Point;\n}\n\nexport function TextAnnotationEditor({\n draft,\n onCommit,\n onCancel,\n}: {\n draft: TextDraft;\n onCommit: (text: string) => void;\n onCancel: () => void;\n}) {\n const [text, setText] = useState(draft.annotation.text ?? \"\");\n const inputRef = useRef<HTMLTextAreaElement>(null);\n const id = useId().replaceAll(\":\", \"\");\n useEffect(() => {\n inputRef.current?.focus();\n }, []);\n return (\n <form\n className=\"glass text-annotation-editor\"\n id={id}\n onSubmit={(event) => {\n event.preventDefault();\n onCommit(text);\n }}\n >\n <style>{`[id=\"${id}\"] { left: clamp(12px, ${draft.position.x}px, calc(100vw - 252px)); top: clamp(12px, ${draft.position.y}px, calc(100dvh - 148px)); }`}</style>\n <textarea\n aria-label=\"Text annotation\"\n maxLength={280}\n onBlur={(event) => {\n if (!event.currentTarget.form?.contains(event.relatedTarget)) {\n onCommit(text);\n }\n }}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n onCancel();\n }\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n onCommit(text);\n }\n }}\n placeholder=\"Type a note…\"\n ref={inputRef}\n rows={2}\n value={text}\n />\n <div className=\"text-annotation-actions\">\n <button\n aria-label=\"Cancel text\"\n className=\"tool\"\n onClick={onCancel}\n type=\"button\"\n >\n <CloseIcon />\n </button>\n <button aria-label=\"Apply text\" className=\"done-btn\" type=\"submit\">\n <CheckIcon size={16} />\n </button>\n </div>\n </form>\n );\n}\n","import { useState } from \"react\";\nimport { normalizeRect } from \"../../../core/annotations\";\nimport type { Annotation, Point } from \"../../../types\";\nimport type { TextDraft } from \"./text-editor\";\n\nfunction containsPoint(annotation: Annotation, point: Point) {\n const bounds = normalizeRect(annotation.start, annotation.end);\n return (\n point.x >= bounds.x &&\n point.x <= bounds.x + bounds.width &&\n point.y >= bounds.y &&\n point.y <= bounds.y + bounds.height\n );\n}\n\nexport function useTextAnnotation(options: {\n annotations: Annotation[];\n color: string;\n onChange: (annotations: Annotation[]) => void;\n}) {\n const [textDraft, setTextDraft] = useState<TextDraft | null>(null);\n\n const beginText = (canvas: HTMLCanvasElement, point: Point) => {\n const bounds = canvas.getBoundingClientRect();\n const existing = [...options.annotations]\n .reverse()\n .find((item) => item.tool === \"text\" && containsPoint(item, point));\n const annotation =\n existing ??\n ({\n color: options.color,\n end: point,\n id: crypto.randomUUID(),\n start: point,\n tool: \"text\",\n } satisfies Annotation);\n const fontSize = existing\n ? (existing.end.y - existing.start.y) /\n (existing.text?.split(\"\\n\").length ?? 1) /\n 1.4\n : (18 * canvas.width) / bounds.width;\n setTextDraft({\n annotation,\n fontSize,\n position: {\n x: bounds.x + (annotation.start.x / canvas.width) * bounds.width,\n y: bounds.y + (annotation.start.y / canvas.height) * bounds.height,\n },\n });\n };\n\n const commitText = (canvas: HTMLCanvasElement, text: string) => {\n const context = canvas.getContext(\"2d\");\n if (!(textDraft && context)) {\n return;\n }\n const value = text.trim();\n const remaining = options.annotations.filter(\n ({ id }) => id !== textDraft.annotation.id\n );\n if (value) {\n context.font = `${textDraft.fontSize}px ui-sans-serif, system-ui, sans-serif`;\n const lines = value.split(\"\\n\");\n remaining.push({\n ...textDraft.annotation,\n end: {\n x:\n textDraft.annotation.start.x +\n Math.max(...lines.map((line) => context.measureText(line).width)),\n y:\n textDraft.annotation.start.y +\n lines.length * textDraft.fontSize * 1.4,\n },\n text: value,\n });\n }\n options.onChange(remaining);\n setTextDraft(null);\n };\n\n return {\n beginText,\n cancelText: () => setTextDraft(null),\n commitText,\n textDraft,\n };\n}\n","import { type MouseEvent, useEffect, useRef, useState } from \"react\";\nimport { listenToKeydown } from \"../widget-keys\";\n\nexport function useDetailsPopover() {\n const [open, setOpen] = useState(false);\n const [placement, setPlacement] = useState(\"above\");\n const [anchorLeft, setAnchorLeft] = useState(0);\n const detailsRef = useRef<HTMLDetailsElement>(null);\n const summaryRef = useRef<HTMLElement>(null);\n\n useEffect(() => {\n const reposition = () => {\n const bounds = summaryRef.current?.getBoundingClientRect();\n if (bounds && detailsRef.current?.open) {\n setAnchorLeft(bounds.left);\n setPlacement(\n bounds.bottom < window.innerHeight / 2 ? \"below\" : \"above\"\n );\n }\n };\n const dismissOutside = (event: globalThis.PointerEvent) => {\n const details = detailsRef.current;\n if (details?.open && !event.composedPath().includes(details)) {\n setOpen(false);\n }\n };\n const dismissWithEscape = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || !detailsRef.current?.open) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n setOpen(false);\n summaryRef.current?.focus();\n };\n document.addEventListener(\"pointerdown\", dismissOutside);\n const stopListeningToKeys = listenToKeydown(\n detailsRef.current,\n dismissWithEscape,\n true\n );\n window.addEventListener(\"resize\", reposition);\n return () => {\n document.removeEventListener(\"pointerdown\", dismissOutside);\n stopListeningToKeys();\n window.removeEventListener(\"resize\", reposition);\n };\n }, []);\n\n const show = () => {\n const bounds = summaryRef.current?.getBoundingClientRect();\n if (bounds) {\n setAnchorLeft(bounds.left);\n setPlacement(bounds.bottom < window.innerHeight / 2 ? \"below\" : \"above\");\n }\n setOpen(true);\n };\n return {\n anchorLeft,\n detailsProps: { \"data-placement\": placement, open, ref: detailsRef },\n hide: () => {\n setOpen(false);\n summaryRef.current?.focus();\n },\n show,\n summaryProps: {\n onClick: (event: MouseEvent<HTMLElement>) => {\n event.preventDefault();\n if (open) {\n setOpen(false);\n } else {\n show();\n }\n },\n ref: summaryRef,\n },\n };\n}\n","import { Slider } from \"@base-ui/react/slider\";\nimport { useId, useRef } from \"react\";\nimport { useDetailsPopover } from \"../floating/use-details-popover\";\nimport { type AnnotationColor, annotationColorHex } from \"./color-value\";\n\ninterface ColorPickerProps {\n onChange: (color: AnnotationColor) => void;\n selection: AnnotationColor;\n}\n\nfunction ColorSpectrum({ selection, onChange }: ColorPickerProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n return (\n <div className=\"color-spectrum\">\n <button\n aria-label=\"Custom color\"\n onClick={() => inputRef.current?.click()}\n title=\"Custom color\"\n type=\"button\"\n />\n <input\n aria-hidden=\"true\"\n onChange={(event) =>\n onChange({ baseColor: event.target.value, strengthPercent: 100 })\n }\n ref={inputRef}\n tabIndex={-1}\n type=\"color\"\n value={selection.baseColor}\n />\n </div>\n );\n}\n\nfunction ColorControls({ selection, onChange }: ColorPickerProps) {\n return (\n <div className=\"color-popover glass\">\n <Slider.Root\n className=\"color-slider\"\n onValueChange={(strengthPercent) =>\n onChange({ ...selection, strengthPercent })\n }\n value={selection.strengthPercent}\n >\n <Slider.Control className=\"color-slider-control\">\n <Slider.Track className=\"color-slider-track\">\n <Slider.Thumb\n aria-label=\"Color strength\"\n className=\"color-slider-thumb\"\n getAriaValueText={(_, value) => `${value}% color`}\n />\n </Slider.Track>\n </Slider.Control>\n </Slider.Root>\n <ColorSpectrum onChange={onChange} selection={selection} />\n </div>\n );\n}\n\nexport function ColorPicker({ selection, onChange }: ColorPickerProps) {\n const popover = useDetailsPopover();\n const id = useId().replaceAll(\":\", \"\");\n return (\n <details className=\"color-picker\" id={id} {...popover.detailsProps}>\n <style>{`[id=\"${id}\"] { --rf-color-anchor: ${popover.anchorLeft}px; --annotation-color: ${annotationColorHex(selection)}; --annotation-base-color: ${selection.baseColor}; }`}</style>\n <summary\n aria-label=\"Annotation color\"\n className=\"tool\"\n {...popover.summaryProps}\n title=\"Annotation color\"\n >\n <span className=\"color-preview\" />\n </summary>\n <ColorControls onChange={onChange} selection={selection} />\n </details>\n );\n}\n","import type { AnnotationTool, FeedbackWidgetLabels } from \"../../types\";\nimport { useDetailsPopover } from \"../floating/use-details-popover\";\nimport {\n BlurIcon,\n CameraIcon,\n ChevronDownIcon,\n HighlightIcon,\n PencilIcon,\n SpotlightIcon,\n TrashIcon,\n} from \"../icons\";\nimport type { AnnotationEditor } from \"./toolbar\";\n\nconst EXTRA_TOOLS = [\n { Icon: SpotlightIcon, id: \"spotlight\", label: \"Spotlight\" },\n { Icon: PencilIcon, id: \"pen\", label: \"Draw\" },\n { Icon: HighlightIcon, id: \"highlight\", label: \"Highlight\" },\n { Icon: BlurIcon, id: \"blur\", label: \"Hide\" },\n] as const;\n\nexport function DrawingToolMenu({\n drawing,\n editor,\n labels,\n}: {\n drawing: { tool: AnnotationTool; setTool: (tool: AnnotationTool) => void };\n editor: AnnotationEditor;\n labels: FeedbackWidgetLabels;\n}) {\n const popover = useDetailsPopover();\n return (\n <details className=\"drawing-menu\" {...popover.detailsProps}>\n <summary\n aria-label=\"More drawing tools\"\n className=\"tool\"\n data-selected={EXTRA_TOOLS.some(({ id }) => id === drawing.tool)}\n title=\"More drawing tools\"\n {...popover.summaryProps}\n >\n <ChevronDownIcon />\n </summary>\n <div className=\"drawing-popover glass\">\n {EXTRA_TOOLS.map(({ id, label, Icon }) => (\n <button\n aria-pressed={drawing.tool === id}\n className=\"drawing-option\"\n key={id}\n onClick={() => {\n drawing.setTool(id);\n popover.hide();\n }}\n type=\"button\"\n >\n <Icon />\n {label}\n </button>\n ))}\n <div className=\"drawing-divider\" />\n <button\n className=\"drawing-option\"\n disabled={editor.annotations.length === 0}\n onClick={() => {\n editor.onChange([]);\n popover.hide();\n }}\n type=\"button\"\n >\n <TrashIcon />\n {labels.clearAnnotations}\n </button>\n {editor.onRetake && (\n <button\n className=\"drawing-option\"\n onClick={editor.onRetake}\n type=\"button\"\n >\n <CameraIcon />\n {labels.recapture}\n </button>\n )}\n </div>\n </details>\n );\n}\n","import type {\n Annotation,\n AnnotationTool,\n FeedbackWidgetLabels,\n} from \"../../types\";\nimport { ArrowIcon, CheckIcon, SquareIcon, TextIcon, UndoIcon } from \"../icons\";\nimport { ColorPicker } from \"./color-picker\";\nimport type { AnnotationColor } from \"./color-value\";\nimport { DrawingToolMenu } from \"./tool-menu\";\n\nconst QUICK_TOOLS = [\n { Icon: SquareIcon, id: \"rectangle\", label: \"Rectangle\" },\n { Icon: ArrowIcon, id: \"arrow\", label: \"Arrow\" },\n { Icon: TextIcon, id: \"text\", label: \"Text\" },\n] as const;\n\nexport interface AnnotationEditor {\n annotations: Annotation[];\n onChange: (annotations: Annotation[]) => void;\n onDone: () => void;\n onRetake?: () => void;\n}\n\nexport function AnnotationToolbar({\n editor,\n labels,\n drawing,\n}: {\n editor: AnnotationEditor;\n labels: FeedbackWidgetLabels;\n drawing: {\n color: AnnotationColor;\n setColor: (color: AnnotationColor) => void;\n tool: AnnotationTool;\n setTool: (tool: AnnotationTool) => void;\n };\n}) {\n return (\n <div className=\"toolbar\">\n <div className=\"group glass\">\n {QUICK_TOOLS.map(({ id, label, Icon }) => (\n <button\n aria-label={label}\n aria-pressed={drawing.tool === id}\n className=\"tool\"\n key={id}\n onClick={() => drawing.setTool(id)}\n title={label}\n type=\"button\"\n >\n <Icon />\n </button>\n ))}\n <DrawingToolMenu drawing={drawing} editor={editor} labels={labels} />\n </div>\n <div className=\"group glass\">\n <ColorPicker onChange={drawing.setColor} selection={drawing.color} />\n <button\n aria-label={labels.undo}\n className=\"tool\"\n disabled={editor.annotations.length === 0}\n onClick={() => editor.onChange(editor.annotations.slice(0, -1))}\n title={labels.undo}\n type=\"button\"\n >\n <UndoIcon />\n </button>\n <button\n aria-label={labels.done}\n className=\"done-btn\"\n onClick={editor.onDone}\n title={labels.done}\n type=\"button\"\n >\n <CheckIcon size={18} />\n </button>\n </div>\n </div>\n );\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport { drawAnnotations } from \"../../core/annotation-renderer\";\nimport type { Annotation, CapturedImage } from \"../../types\";\n\nexport function useAnnotationCanvas(\n capture: CapturedImage,\n annotations: Annotation[]\n) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [bitmap, setBitmap] = useState<HTMLImageElement | null>(null);\n const [failedUrl, setFailedUrl] = useState<string | null>(null);\n\n useEffect(() => {\n const image = new Image();\n image.onload = () => setBitmap(image);\n image.onerror = () => setFailedUrl(capture.objectUrl);\n image.src = capture.objectUrl;\n return () => {\n image.onload = null;\n image.onerror = null;\n };\n }, [capture.objectUrl]);\n\n const isDecoded = bitmap?.src === capture.objectUrl;\n useEffect(() => {\n const canvas = canvasRef.current;\n const context = canvas?.getContext(\"2d\");\n if (!(canvas && context && bitmap && isDecoded)) {\n return;\n }\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.drawImage(bitmap, 0, 0, canvas.width, canvas.height);\n drawAnnotations(context, annotations);\n }, [annotations, bitmap, isDecoded]);\n\n return { canvasRef, hasError: failedUrl === capture.objectUrl, isDecoded };\n}\n","import { useLayoutEffect, useRef, useState } from \"react\";\n\nfunction prefersReducedMotion() {\n return window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;\n}\n\nfunction thumbnailFrame(frame: HTMLElement, trigger: HTMLElement) {\n const destination = frame.getBoundingClientRect();\n const thumbnail = trigger.getBoundingClientRect();\n const scale = Math.max(\n thumbnail.width / destination.width,\n thumbnail.height / destination.height\n );\n const insetX = (destination.width - thumbnail.width / scale) / 2;\n const insetBottom = destination.height - thumbnail.height / scale;\n const radius =\n Number.parseFloat(getComputedStyle(trigger).borderRadius) / scale;\n return {\n clipPath: `inset(0px ${insetX}px ${insetBottom}px ${insetX}px round ${radius}px)`,\n transform: `translate(${thumbnail.x - destination.x - insetX * scale}px, ${thumbnail.y - destination.y}px) scale(${scale})`,\n };\n}\n\nfunction expandedFrame(visual: HTMLElement) {\n return {\n clipPath: `inset(0px 0px 0px 0px round ${getComputedStyle(visual).borderRadius})`,\n transform: \"none\",\n };\n}\n\nconst TIMING = { duration: 340, easing: \"cubic-bezier(0.22, 1, 0.36, 1)\" };\n\nexport function useImageMorph(\n trigger: HTMLElement | null | undefined,\n onDone: () => void\n) {\n const frameRef = useRef<HTMLDivElement>(null);\n const visualRef = useRef<HTMLDivElement>(null);\n const entrance = useRef<Animation | null>(null);\n const exit = useRef<Animation | null>(null);\n const [isOpening, setIsOpening] = useState(false);\n const [isClosing, setIsClosing] = useState(false);\n\n useLayoutEffect(() => {\n const frame = frameRef.current;\n const visual = visualRef.current;\n if (frame && visual?.animate && trigger && !prefersReducedMotion()) {\n setIsOpening(true);\n entrance.current = visual.animate(\n [thumbnailFrame(frame, trigger), expandedFrame(visual)],\n TIMING\n );\n entrance.current.finished.then(\n () => setIsOpening(false),\n () => undefined\n );\n }\n return () => {\n entrance.current?.cancel();\n exit.current?.cancel();\n };\n }, [trigger]);\n\n const close = (action = onDone) => {\n if (exit.current) {\n return;\n }\n const frame = frameRef.current;\n const visual = visualRef.current;\n if (!(frame && visual?.animate && trigger) || prefersReducedMotion()) {\n action();\n return;\n }\n const current =\n entrance.current?.playState === \"running\"\n ? {\n clipPath: getComputedStyle(visual).clipPath,\n transform: getComputedStyle(visual).transform,\n }\n : expandedFrame(visual);\n entrance.current?.cancel();\n setIsClosing(true);\n const animation = visual.animate(\n [current, thumbnailFrame(frame, trigger)],\n { ...TIMING, duration: 260, fill: \"forwards\" }\n );\n exit.current = animation;\n animation.finished.then(action, () => undefined);\n };\n\n return { close, frameRef, isClosing, isOpening, visualRef };\n}\n","import {\n type PointerEvent as ReactPointerEvent,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { isDegenerate } from \"../core/annotations\";\nimport { MAX_SELECTION_COMMENT_LENGTH } from \"../core/element-selector\";\nimport type {\n Annotation,\n AnnotationTool,\n CapturedImage,\n FeedbackWidgetLabels,\n Point,\n} from \"../types\";\nimport {\n annotationColorHex,\n DEFAULT_ANNOTATION_COLOR,\n} from \"./annotation/color-value\";\nimport { TextAnnotationEditor } from \"./annotation/text/text-editor\";\nimport { useTextAnnotation } from \"./annotation/text/use-text-annotation\";\nimport { type AnnotationEditor, AnnotationToolbar } from \"./annotation/toolbar\";\nimport { useAnnotationCanvas } from \"./annotation/use-annotation-canvas\";\nimport { useImageMorph } from \"./annotation/use-image-morph\";\nimport { TargetIcon } from \"./icons\";\n\nfunction toImagePoint(\n canvas: HTMLCanvasElement,\n clientX: number,\n clientY: number\n): Point {\n const bounds = canvas.getBoundingClientRect();\n return {\n x: Math.max(\n 0,\n Math.min(\n canvas.width,\n ((clientX - bounds.left) / bounds.width) * canvas.width\n )\n ),\n y: Math.max(\n 0,\n Math.min(\n canvas.height,\n ((clientY - bounds.top) / bounds.height) * canvas.height\n )\n ),\n };\n}\n\nexport function Annotator({\n capture,\n labels,\n editor,\n note,\n}: {\n capture: CapturedImage;\n labels: FeedbackWidgetLabels;\n editor: AnnotationEditor & { trigger?: HTMLElement | null };\n note?: { comment: string; onChange: (comment: string) => void };\n}) {\n const { annotations, onChange, onDone, onRetake } = editor;\n const morph = useImageMorph(editor.trigger, onDone);\n const dialogRef = useRef<HTMLDialogElement>(null);\n const [tool, setTool] = useState<AnnotationTool>(\"rectangle\");\n const [colorSelection, setColorSelection] = useState(\n DEFAULT_ANNOTATION_COLOR\n );\n const color = annotationColorHex(colorSelection);\n const [draft, setDraft] = useState<Annotation | null>(null);\n const { canvasRef, hasError, isDecoded } = useAnnotationCanvas(\n capture,\n draft ? [...annotations, draft] : annotations\n );\n const text = useTextAnnotation({ annotations, color, onChange });\n useEffect(() => {\n const dialog = dialogRef.current;\n dialog?.showModal();\n return () => dialog?.close();\n }, []);\n\n const onPointerDown = (event: ReactPointerEvent<HTMLCanvasElement>) => {\n const canvas = canvasRef.current;\n if (!(canvas && isDecoded) || event.button !== 0) {\n return;\n }\n\n const point = toImagePoint(canvas, event.clientX, event.clientY);\n if (tool === \"text\") {\n event.preventDefault();\n text.beginText(canvas, point);\n return;\n }\n canvas.setPointerCapture(event.pointerId);\n\n setDraft({\n color,\n end: point,\n id: crypto.randomUUID(),\n points: tool === \"pen\" ? [point] : undefined,\n start: point,\n tool,\n });\n };\n\n const onPointerMove = (event: ReactPointerEvent<HTMLCanvasElement>) => {\n const canvas = canvasRef.current;\n if (!(canvas && draft)) {\n return;\n }\n\n const point = toImagePoint(canvas, event.clientX, event.clientY);\n setDraft(\n draft.tool === \"pen\"\n ? { ...draft, end: point, points: [...(draft.points ?? []), point] }\n : { ...draft, end: point }\n );\n };\n\n const onPointerUp = () => {\n if (!draft) {\n return;\n }\n if (!isDegenerate(draft)) {\n onChange([...annotations, draft]);\n }\n setDraft(null);\n };\n\n return (\n <dialog\n aria-label={labels.annotateHint}\n className=\"overlay\"\n data-closing={morph.isClosing}\n data-opening={morph.isOpening}\n onCancel={(event) => {\n event.preventDefault();\n morph.close();\n }}\n ref={dialogRef}\n >\n {hasError && (\n <p className=\"error\" role=\"alert\">\n {labels.captureFailed}\n </p>\n )}\n <style>{`.editor-image { --rf-capture-ratio: ${capture.width / capture.height}; }`}</style>\n <div className=\"editor\">\n <div className=\"editor-image\" ref={morph.frameRef}>\n <div className=\"editor-visual\" ref={morph.visualRef}>\n <img\n alt=\"\"\n height={capture.height}\n src={capture.objectUrl}\n width={capture.width}\n />\n <canvas\n data-tool={tool}\n height={capture.height}\n onPointerCancel={() => setDraft(null)}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n ref={canvasRef}\n width={capture.width}\n />\n </div>\n </div>\n </div>\n\n {text.textDraft && (\n <TextAnnotationEditor\n draft={text.textDraft}\n key={text.textDraft.annotation.id}\n onCancel={text.cancelText}\n onCommit={(value) => {\n if (canvasRef.current) {\n text.commitText(canvasRef.current, value);\n }\n }}\n />\n )}\n <AnnotationToolbar\n drawing={{\n color: colorSelection,\n setColor: setColorSelection,\n setTool,\n tool,\n }}\n editor={{\n annotations,\n onChange,\n onDone: () => morph.close(),\n onRetake: onRetake ? () => morph.close(onRetake) : undefined,\n }}\n labels={labels}\n />\n {note && (\n <div className=\"element-note glass\">\n <TargetIcon />\n <textarea\n aria-label={labels.elementNote}\n maxLength={MAX_SELECTION_COMMENT_LENGTH}\n onChange={(event) => note.onChange(event.target.value)}\n placeholder={labels.elementNotePlaceholder}\n value={note.comment}\n />\n </div>\n )}\n </dialog>\n );\n}\n","import { useEffect, useState, useSyncExternalStore } from \"react\";\n\nconst claims = new Map<symbol, { hasWidget: boolean }>();\nconst listeners = new Set<() => void>();\n\nfunction notify() {\n for (const listener of listeners) {\n listener();\n }\n}\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n}\n\nfunction currentOwner(): symbol | undefined {\n for (const [token, claim] of claims) {\n if (claim.hasWidget) {\n return token;\n }\n }\n return claims.keys().next().value;\n}\n\n/**\n * One devtools bar per page, however many RefletFeedback instances mount:\n * the one with a visible widget wins, so its bar can step aside for its panel.\n */\nexport function useOwnsDevtools(wantsDevtools: boolean, hasWidget: boolean) {\n const [token] = useState(() => Symbol(\"reflet-devtools\"));\n\n useEffect(() => {\n if (!wantsDevtools) {\n return;\n }\n claims.set(token, { hasWidget });\n notify();\n return () => {\n claims.delete(token);\n notify();\n };\n }, [hasWidget, token, wantsDevtools]);\n\n return useSyncExternalStore(\n subscribe,\n () => currentOwner() === token,\n () => false\n );\n}\n","import type { Ref } from \"react\";\nimport { ChatIcon, CloseIcon } from \"./icons\";\n\nexport function Launcher({\n isOpen,\n label,\n onClick,\n buttonRef,\n}: {\n isOpen: boolean;\n label: string;\n onClick: () => void;\n buttonRef?: Ref<HTMLButtonElement>;\n}) {\n return (\n <button\n aria-expanded={isOpen}\n className=\"launcher glass\"\n data-open={isOpen}\n onClick={onClick}\n ref={buttonRef}\n type=\"button\"\n >\n <span className=\"launcher-icon\">\n <ChatIcon className=\"on-open\" />\n <CloseIcon className=\"on-close\" />\n </span>\n {label}\n </button>\n );\n}\n","import type { FeedbackWidgetLabels } from \"../../types\";\nimport { CameraIcon, TargetIcon } from \"../icons\";\nimport type { WidgetState } from \"../use-widget-state\";\n\nexport function CaptureSlot({\n labels,\n state,\n}: {\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const disabled = state.isCapturing || state.isEditingDisabled;\n return (\n <div className=\"capture-slot glass\">\n <button\n aria-label={labels.attachScreenshot}\n className=\"capture-action\"\n disabled={disabled}\n onClick={state.takeCapture}\n title={labels.attachScreenshot}\n type=\"button\"\n >\n <CameraIcon />\n </button>\n <button\n aria-label={labels.pickElement}\n className=\"capture-action\"\n disabled={disabled}\n onClick={() => state.setStep(\"picking\")}\n title={labels.pickElement}\n type=\"button\"\n >\n <TargetIcon />\n </button>\n </div>\n );\n}\n","import type { ElementSelection } from \"../../types\";\nimport type { Annotation, CapturedImage } from \"../types\";\n\nconst SELECTION_COLOR = \"#4f46e5\";\nconst SELECTION_ANNOTATION_PREFIX = \"selection-\";\n\nexport function isSelectionAnnotation({ id }: Annotation): boolean {\n return id.startsWith(SELECTION_ANNOTATION_PREFIX);\n}\n\nexport function highlightFor(\n selection: ElementSelection,\n capture: CapturedImage\n): Annotation {\n const scale = capture.width / window.innerWidth;\n const { rect } = selection;\n\n return {\n color: SELECTION_COLOR,\n end: {\n x: (rect.x + rect.width) * scale,\n y: (rect.y + rect.height) * scale,\n },\n id: `${SELECTION_ANNOTATION_PREFIX}${rect.x}-${rect.y}`,\n start: { x: rect.x * scale, y: rect.y * scale },\n tool: \"rectangle\",\n };\n}\n","import type { Annotation, CapturedImage } from \"../../types\";\nimport { useAnnotationCanvas } from \"./use-annotation-canvas\";\n\nexport function ScreenshotPreview({\n annotations,\n capture,\n}: {\n annotations: Annotation[];\n capture: CapturedImage;\n}) {\n const { canvasRef } = useAnnotationCanvas(capture, annotations);\n return (\n <>\n <img\n alt=\"\"\n draggable={false}\n height={capture.height}\n src={capture.objectUrl}\n width={capture.width}\n />\n {annotations.length > 0 && (\n <canvas height={capture.height} ref={canvasRef} width={capture.width} />\n )}\n </>\n );\n}\n","import { useRef } from \"react\";\nimport { isSelectionAnnotation } from \"../../core/element-capture\";\nimport type { FeedbackWidgetLabels, ScreenshotDraft } from \"../../types\";\nimport { ScreenshotPreview } from \"../annotation/screenshot-preview\";\nimport { PencilIcon, TargetIcon, TrashIcon } from \"../icons\";\nimport type { WidgetState } from \"../use-widget-state\";\n\nexport function ScreenshotCard({\n item,\n labels,\n state,\n}: {\n item: { draft: ScreenshotDraft; number: number };\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const { draft, number } = item;\n const previewRef = useRef<HTMLDivElement>(null);\n const isCapturing = state.pendingCapture?.id === draft.id;\n const disabled = state.isEditingDisabled || state.isCapturing;\n const drawings = draft.annotations.filter(\n (annotation) => !isSelectionAnnotation(annotation)\n );\n return (\n <fieldset\n aria-label={`${labels.screenshot} ${number}`}\n className=\"screenshot-attachment\"\n >\n <div className=\"screenshot-preview glass\" ref={previewRef}>\n <ScreenshotPreview\n annotations={draft.annotations}\n capture={draft.image}\n />\n </div>\n {draft.selection && (\n <span\n className=\"selection-badge glass\"\n title={draft.selection.comment ?? draft.selection.label}\n >\n <TargetIcon />\n </span>\n )}\n {drawings.length > 0 && (\n <span className=\"annotation-count glass\">{drawings.length}</span>\n )}\n {isCapturing ? (\n <div className=\"capture-progress glass\" role=\"status\">\n <span className=\"spinner\" />\n {labels.capturing}\n </div>\n ) : (\n <div className=\"attachment-actions glass\">\n <button\n aria-label={labels.annotateHint}\n className=\"icon-btn annotate-action\"\n disabled={disabled}\n onClick={(event) => {\n if (previewRef.current) {\n state.annotateScreenshot(draft.id, {\n button: event.currentTarget,\n thumbnail: previewRef.current,\n });\n }\n }}\n title={labels.annotateHint}\n type=\"button\"\n >\n <PencilIcon />\n </button>\n <button\n aria-label={labels.removeScreenshot}\n className=\"icon-btn\"\n disabled={disabled}\n onClick={() => state.removeCapture(draft.id)}\n title={labels.removeScreenshot}\n type=\"button\"\n >\n <TrashIcon />\n </button>\n </div>\n )}\n </fieldset>\n );\n}\n","import { ScrollArea } from \"@base-ui/react/scroll-area\";\nimport { useEffect, useRef } from \"react\";\nimport type { FeedbackWidgetLabels } from \"../../types\";\nimport { CameraIcon } from \"../icons\";\nimport type { WidgetState } from \"../use-widget-state\";\nimport { CaptureSlot } from \"./capture-slot\";\nimport { ScreenshotCard } from \"./screenshot-card\";\n\nexport function Attachments({\n labels,\n state,\n}: {\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const stripRef = useRef<HTMLDivElement>(null);\n const count = state.screenshots.length;\n useEffect(() => {\n const strip = stripRef.current;\n if (strip && count > 0) {\n strip.scrollTo?.({ left: strip.scrollWidth });\n }\n }, [count]);\n const isAdding =\n state.pendingCapture &&\n !state.screenshots.some(({ id }) => id === state.pendingCapture?.id);\n return (\n <div className=\"attachments\">\n <div className=\"attachment-row\">\n <CaptureSlot labels={labels} state={state} />\n <ScrollArea.Root className=\"screenshot-scroll-area\">\n <ScrollArea.Viewport\n aria-label={labels.screenshot}\n className=\"screenshot-strip\"\n ref={stripRef}\n role=\"region\"\n >\n <ScrollArea.Content className=\"screenshot-strip-content\">\n {state.screenshots.map((draft, index) => (\n <ScreenshotCard\n item={{ draft, number: index + 1 }}\n key={draft.id}\n labels={labels}\n state={state}\n />\n ))}\n {isAdding && (\n <div\n aria-label={labels.capturing}\n className=\"attachment-skeleton glass\"\n role=\"status\"\n >\n <CameraIcon />\n <span>{labels.capturing}</span>\n </div>\n )}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar\n className=\"screenshot-scrollbar\"\n orientation=\"horizontal\"\n >\n <ScrollArea.Thumb className=\"screenshot-scroll-thumb\" />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n </div>\n </div>\n );\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport type { FeedbackWidgetLabels } from \"../../types\";\nimport type { WidgetState } from \"../use-widget-state\";\n\nexport function EmailPrompt({\n labels,\n state,\n}: {\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [invalid, setInvalid] = useState(false);\n useEffect(() => {\n inputRef.current?.focus();\n }, []);\n return (\n <form\n className=\"email-prompt glass\"\n onSubmit={(event) => {\n event.preventDefault();\n state.submit();\n }}\n >\n <h2>{labels.emailPromptTitle}</h2>\n <p>{labels.emailPromptBody}</p>\n <div className=\"email-field\">\n <input\n aria-invalid={invalid}\n aria-label={labels.emailLabel}\n autoComplete=\"email\"\n onChange={(event) => {\n setInvalid(false);\n state.setEmail(event.target.value);\n }}\n onInvalid={(event) => {\n event.preventDefault();\n setInvalid(true);\n }}\n placeholder={labels.emailPlaceholder}\n ref={inputRef}\n type=\"email\"\n value={state.email}\n />\n {invalid && <span role=\"alert\">{labels.emailInvalid}</span>}\n </div>\n <div className=\"email-prompt-actions\">\n <button\n className=\"ghost-btn\"\n onClick={() => {\n state.setEmail(\"\");\n state.submit();\n }}\n type=\"button\"\n >\n {labels.sendWithoutEmail}\n </button>\n <button className=\"primary-btn\" type=\"submit\">\n {labels.submit}\n </button>\n </div>\n </form>\n );\n}\n","import { useState } from \"react\";\nimport type { FeedbackWidgetLabels } from \"../../types\";\nimport { SDK_VERSION } from \"../../types\";\nimport { useDetailsPopover } from \"../floating/use-details-popover\";\nimport { CloseIcon, MoreIcon } from \"../icons\";\nimport type { WidgetState } from \"../use-widget-state\";\n\nexport function ComposerOptions({\n labels,\n state,\n}: {\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const popover = useDetailsPopover();\n const [emailInvalid, setEmailInvalid] = useState(false);\n return (\n <details className=\"composer-options\" {...popover.detailsProps}>\n <summary\n aria-label={labels.moreOptions}\n className=\"icon-btn\"\n {...popover.summaryProps}\n title={labels.moreOptions}\n >\n <MoreIcon />\n </summary>\n <div className=\"options-popover glass\">\n {state.isAnonymous && (\n <label className=\"email-field\">\n {labels.emailLabel}\n <input\n aria-invalid={emailInvalid}\n aria-label={labels.emailLabel}\n autoComplete=\"email\"\n disabled={state.isEditingDisabled}\n onChange={(event) => {\n setEmailInvalid(false);\n state.setEmail(event.target.value);\n }}\n onInvalid={(event) => {\n event.preventDefault();\n setEmailInvalid(true);\n popover.show();\n const input = event.currentTarget;\n requestAnimationFrame(() => input.focus());\n }}\n placeholder={labels.emailPlaceholder}\n type=\"email\"\n value={state.email}\n />\n {emailInvalid && <span role=\"alert\">{labels.emailInvalid}</span>}\n </label>\n )}\n <button\n className=\"ghost-btn\"\n disabled={state.isSubmitting}\n onClick={state.close}\n type=\"button\"\n >\n <CloseIcon />\n {labels.cancel}\n </button>\n {state.canDismiss && (\n <button\n className=\"dismiss-btn\"\n disabled={state.isSubmitting}\n onClick={state.dismiss}\n type=\"button\"\n >\n {labels.dismissForDays.replace(\n \"{days}\",\n String(state.dismissForDays)\n )}\n </button>\n )}\n <a\n className=\"version-info\"\n href=\"https://reflet.app\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n Reflet SDK {SDK_VERSION}\n </a>\n </div>\n </details>\n );\n}\n","import type { ReactNode } from \"react\";\nimport type { FeedbackWidgetLabels } from \"../../types\";\nimport { ArrowIcon } from \"../icons\";\nimport type { WidgetState } from \"../use-widget-state\";\nimport { ComposerOptions } from \"./options\";\n\nexport function MessageInput({\n floatingControls,\n labels,\n state,\n}: {\n floatingControls: ReactNode;\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const submitLabel = state.hasPendingAttachments\n ? labels.retryAttachments\n : labels.submit;\n return (\n <div className=\"message-row glass\">\n <textarea\n aria-label={labels.descriptionPlaceholder}\n disabled={state.isEditingDisabled}\n maxLength={4000}\n onChange={(event) => state.setMessage(event.target.value)}\n placeholder={labels.descriptionPlaceholder}\n rows={3}\n value={state.message}\n />\n <div className=\"message-actions\">\n {floatingControls}\n <ComposerOptions labels={labels} state={state} />\n <button\n aria-busy={state.isSubmitting}\n aria-label={submitLabel}\n className=\"submit\"\n disabled={state.isSubmitting || state.isCapturing || !state.canSubmit}\n title={submitLabel}\n type=\"submit\"\n >\n {state.isSubmitting ? <span className=\"spinner\" /> : <ArrowIcon />}\n </button>\n </div>\n </div>\n );\n}\n","import { type ReactNode, useEffect, useRef } from \"react\";\nimport type { FeedbackWidgetLabels } from \"../types\";\nimport { Attachments } from \"./composer/attachments\";\nimport { EmailPrompt } from \"./composer/email-prompt\";\nimport { MessageInput } from \"./composer/message-input\";\nimport { CheckIcon } from \"./icons\";\nimport type { WidgetState } from \"./use-widget-state\";\n\nexport function FeedbackPanel({\n floatingControls,\n labels,\n state,\n}: {\n floatingControls: ReactNode;\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const panelRef = useRef<HTMLElement>(null);\n useEffect(() => {\n panelRef.current?.focus();\n }, []);\n\n if (state.step === \"success\") {\n return (\n <section aria-live=\"polite\" className=\"panel\">\n <div className=\"done success-panel glass\">\n <CheckIcon />\n <h2>{labels.successTitle}</h2>\n <p>{labels.successMessage}</p>\n </div>\n <div className=\"composer-toolbar\">{floatingControls}</div>\n </section>\n );\n }\n\n if (state.step === \"email\") {\n return (\n <section aria-label={labels.emailPromptTitle} className=\"panel\">\n <button\n aria-label={labels.back}\n className=\"email-scrim\"\n onClick={() => state.setStep(\"compose\")}\n type=\"button\"\n />\n <EmailPrompt labels={labels} state={state} />\n <div className=\"composer-toolbar\">{floatingControls}</div>\n </section>\n );\n }\n\n return (\n <section\n aria-label={labels.title}\n className=\"panel\"\n ref={panelRef}\n tabIndex={-1}\n >\n <Attachments labels={labels} state={state} />\n <form\n className=\"composer\"\n onSubmit={(event) => {\n event.preventDefault();\n state.requestSubmit();\n }}\n >\n <MessageInput\n floatingControls={floatingControls}\n labels={labels}\n state={state}\n />\n <div aria-hidden=\"true\" className=\"hp\">\n <input\n autoComplete=\"off\"\n name=\"company-website\"\n onChange={(event) => state.setHoneypot(event.target.value)}\n tabIndex={-1}\n value={state.honeypot}\n />\n </div>\n {state.error && (\n <p className=\"error glass\" role=\"alert\">\n {state.error}\n </p>\n )}\n </form>\n </section>\n );\n}\n","import type { ConsoleEvent } from \"../../types\";\n\nconst DEFAULT_LIMIT = 30;\nconst MAX_MESSAGE_LENGTH = 1000;\nconst RECORDED_METHODS = [\"error\", \"warn\"] as const;\n\ntype RecordedMethod = (typeof RECORDED_METHODS)[number];\n\nexport interface ConsoleRecorder {\n events: () => ConsoleEvent[];\n stop: () => void;\n}\n\nfunction serializeArgument(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n if (value instanceof Error) {\n return `${value.name}: ${value.message}`;\n }\n if (value === null || value === undefined) {\n return String(value);\n }\n if (typeof value === \"object\") {\n try {\n return JSON.stringify(value) ?? \"[unserializable]\";\n } catch {\n return \"[unserializable]\";\n }\n }\n if (typeof value === \"function\") {\n return \"[function]\";\n }\n return String(value);\n}\n\nfunction formatMessage(args: unknown[]): string {\n const message = args.map(serializeArgument).join(\" \");\n return message.length > MAX_MESSAGE_LENGTH\n ? `${message.slice(0, MAX_MESSAGE_LENGTH - 1)}…`\n : message;\n}\n\n/**\n * Buffers the console noise a user saw right before reporting a bug.\n * Wrappers delegate to the previous implementation, so nothing is swallowed.\n */\nexport function startConsoleRecorder(options?: {\n limit?: number;\n}): ConsoleRecorder {\n const limit = options?.limit ?? DEFAULT_LIMIT;\n const buffer: ConsoleEvent[] = [];\n let active = true;\n\n const push = (level: ConsoleEvent[\"level\"], message: string) => {\n if (!(active && message)) {\n return;\n }\n buffer.push({ level, message, timestamp: Date.now() });\n if (buffer.length > limit) {\n buffer.splice(0, buffer.length - limit);\n }\n };\n\n const originals = new Map<RecordedMethod, (...args: unknown[]) => void>();\n const wrappers = new Map<RecordedMethod, (...args: unknown[]) => void>();\n\n for (const method of RECORDED_METHODS) {\n const original = console[method];\n const wrapper = (...args: unknown[]) => {\n push(method, formatMessage(args));\n Reflect.apply(original, console, args);\n };\n originals.set(method, original);\n wrappers.set(method, wrapper);\n console[method] = wrapper;\n }\n\n const onError = (event: ErrorEvent) => {\n const where = event.filename\n ? ` (${event.filename}:${event.lineno}:${event.colno})`\n : \"\";\n push(\"error\", `${event.message}${where}`);\n };\n\n const onRejection = (event: PromiseRejectionEvent) => {\n push(\"error\", `Unhandled rejection: ${serializeArgument(event.reason)}`);\n };\n\n window.addEventListener(\"error\", onError);\n window.addEventListener(\"unhandledrejection\", onRejection);\n\n return {\n events: () => buffer.slice(),\n stop: () => {\n if (!active) {\n return;\n }\n active = false;\n buffer.length = 0;\n\n for (const method of RECORDED_METHODS) {\n const original = originals.get(method);\n // Another recorder wrapped ours — leave its chain intact.\n if (original && console[method] === wrappers.get(method)) {\n console[method] = original;\n }\n }\n\n window.removeEventListener(\"error\", onError);\n window.removeEventListener(\"unhandledrejection\", onRejection);\n },\n };\n}\n","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { Reflet } from \"../../../client\";\nimport {\n attachPreparedScreenshots,\n createFeedbackTransport,\n type SubmitResult,\n submitWidgetFeedback,\n type WidgetSubmission,\n} from \"../../core/submit\";\n\nexport function useFeedbackSubmission(options: {\n client: Reflet | null;\n onError: (message: string | null) => void;\n onSubmitted: (feedbackId: string) => void;\n partialUploadMessage: string;\n}) {\n const [activeRequest, setActiveRequest] = useState<object | null>(null);\n const [pendingReport, setPendingReport] = useState<SubmitResult | null>(null);\n const requestRef = useRef<object | null>(null);\n useEffect(\n () => () => {\n requestRef.current = null;\n },\n []\n );\n\n const resetSubmission = useCallback(() => {\n requestRef.current = null;\n setPendingReport(null);\n setActiveRequest(null);\n }, []);\n\n const finishSubmission = (result: SubmitResult) => {\n if (result.pendingScreenshots.length > 0) {\n setPendingReport(result);\n options.onError(options.partialUploadMessage);\n return;\n }\n setPendingReport(null);\n options.onSubmitted(result.feedbackId);\n };\n\n const submit = async (draft: WidgetSubmission) => {\n if (requestRef.current) {\n return;\n }\n if (!options.client) {\n options.onError(\n \"Reflet is missing a publicKey. Pass one to RefletFeedback or RefletProvider.\"\n );\n return;\n }\n const request = {};\n requestRef.current = request;\n setActiveRequest(request);\n options.onError(null);\n try {\n const transport = createFeedbackTransport(options.client);\n const result = pendingReport\n ? await attachPreparedScreenshots(transport, pendingReport)\n : await submitWidgetFeedback(transport, draft);\n if (requestRef.current === request) {\n finishSubmission(result);\n }\n } catch (error) {\n if (requestRef.current === request) {\n options.onError(\n error instanceof Error\n ? error.message\n : \"Something went wrong. Please try again.\"\n );\n }\n } finally {\n if (requestRef.current === request) {\n requestRef.current = null;\n setActiveRequest(null);\n }\n }\n };\n\n return {\n hasPendingAttachments: pendingReport !== null,\n isEditingDisabled: activeRequest !== null || pendingReport !== null,\n isSubmitting: activeRequest !== null,\n resetSubmission,\n submit,\n };\n}\n","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { captureViewport, releaseCapture } from \"../../core/capture\";\nimport { collectPageContext } from \"../../core/page-context\";\nimport {\n type Annotation,\n type ScreenshotDraft,\n SDK_VERSION,\n} from \"../../types\";\n\nexport interface CaptureRequest {\n id: string;\n source: ScreenshotDraft[\"source\"];\n}\n\nfunction releaseDraft(draft: ScreenshotDraft | undefined): void {\n releaseCapture(draft?.image);\n}\n\nexport function useScreenshotDrafts(\n captureFailed: string,\n onError: (error: string | null) => void\n) {\n const [screenshots, setScreenshots] = useState<ScreenshotDraft[]>([]);\n const [activeId, setActiveId] = useState<string | null>(null);\n const [pendingCapture, setPendingCapture] = useState<CaptureRequest | null>(\n null\n );\n const ownedDrafts = useRef(new Map<string, ScreenshotDraft>());\n const captureRequest = useRef<CaptureRequest | null>(null);\n\n useEffect(() => {\n const drafts = ownedDrafts.current;\n return () => {\n captureRequest.current = null;\n for (const draft of drafts.values()) {\n releaseDraft(draft);\n }\n drafts.clear();\n };\n }, []);\n\n const storeScreenshot = useCallback((screenshot: ScreenshotDraft) => {\n releaseDraft(ownedDrafts.current.get(screenshot.id));\n ownedDrafts.current.set(screenshot.id, screenshot);\n setScreenshots((previous) => {\n const replacing = previous.some(({ id }) => id === screenshot.id);\n return replacing\n ? previous.map((item) =>\n item.id === screenshot.id ? screenshot : item\n )\n : [...previous, screenshot];\n });\n setActiveId(screenshot.id);\n }, []);\n\n const cancelPendingCapture = useCallback(() => {\n captureRequest.current = null;\n setPendingCapture(null);\n }, []);\n\n const takeScreenshot = useCallback(\n async (request: CaptureRequest) => {\n captureRequest.current = request;\n setPendingCapture(request);\n onError(null);\n const context = collectPageContext({ sdkVersion: SDK_VERSION });\n const image = await captureViewport().catch(() => null);\n if (captureRequest.current !== request) {\n releaseCapture(image);\n return;\n }\n cancelPendingCapture();\n if (!image) {\n onError(captureFailed);\n return;\n }\n storeScreenshot({ ...request, annotations: [], context, image });\n },\n [cancelPendingCapture, captureFailed, onError, storeScreenshot]\n );\n\n const takeCapture = useCallback(() => {\n if (!captureRequest.current) {\n takeScreenshot({ id: crypto.randomUUID(), source: \"manual\" });\n }\n }, [takeScreenshot]);\n\n const refreshAutomatic = useCallback(() => {\n takeScreenshot({\n id:\n ownedDrafts.current.keys().next().value ??\n captureRequest.current?.id ??\n crypto.randomUUID(),\n source: \"automatic\",\n });\n }, [takeScreenshot]);\n\n const retakeCapture = useCallback(\n (id: string) => {\n if (!captureRequest.current && ownedDrafts.current.has(id)) {\n takeScreenshot({ id, source: \"manual\" });\n }\n },\n [takeScreenshot]\n );\n\n const removeCapture = useCallback(\n (id: string) => {\n if (captureRequest.current?.id === id) {\n cancelPendingCapture();\n }\n releaseDraft(ownedDrafts.current.get(id));\n ownedDrafts.current.delete(id);\n setScreenshots((previous) => previous.filter((item) => item.id !== id));\n setActiveId((current) => (current === id ? null : current));\n },\n [cancelPendingCapture]\n );\n\n const resetScreenshots = useCallback(() => {\n cancelPendingCapture();\n for (const draft of ownedDrafts.current.values()) {\n releaseDraft(draft);\n }\n ownedDrafts.current.clear();\n setScreenshots([]);\n setActiveId(null);\n }, [cancelPendingCapture]);\n\n const setAnnotations = useCallback(\n (annotations: Annotation[]) => {\n setScreenshots((previous) =>\n previous.map((item) =>\n item.id === activeId ? { ...item, annotations } : item\n )\n );\n },\n [activeId]\n );\n\n const setSelectionComment = useCallback((id: string, comment: string) => {\n setScreenshots((previous) =>\n previous.map((item) =>\n item.id === id && item.selection\n ? { ...item, selection: { ...item.selection, comment } }\n : item\n )\n );\n }, []);\n\n const activeScreenshot =\n screenshots.find(({ id }) => id === activeId) ?? screenshots.at(-1) ?? null;\n const firstCapture = pendingCapture ?? screenshots[0];\n const canRefreshAutomatically =\n screenshots.length <= 1 &&\n firstCapture?.source === \"automatic\" &&\n (activeScreenshot?.annotations.length ?? 0) === 0 &&\n !screenshots.some((draft) => draft.selection);\n\n return {\n activeScreenshot,\n cancelPendingCapture,\n canRefreshAutomatically,\n pendingCapture,\n refreshAutomatic,\n removeCapture,\n resetScreenshots,\n retakeCapture,\n screenshots,\n selectScreenshot: setActiveId,\n setAnnotations,\n setSelectionComment,\n storeScreenshot,\n takeCapture,\n };\n}\n","import { useContext, useMemo } from \"react\";\nimport { Reflet } from \"../../../client\";\nimport { RefletContext } from \"../../../react-context\";\nimport type { RefletFeedbackProps } from \"../../types\";\n\nfunction dismissalDuration(days: number | undefined) {\n return days !== undefined && Number.isFinite(days) && days > 0 ? days : null;\n}\n\nexport function useWidgetConfig(props: RefletFeedbackProps) {\n const context = useContext(RefletContext);\n const publicKey = props.publicKey ?? context?.publicKey;\n const baseUrl = props.baseUrl ?? context?.baseUrl;\n const user = props.user ?? context?.user;\n const userToken = props.userToken ?? context?.userToken;\n const client = useMemo(\n () =>\n publicKey ? new Reflet({ baseUrl, publicKey, user, userToken }) : null,\n [baseUrl, publicKey, user, userToken]\n );\n return {\n client,\n dismissalKey: `reflet-feedback-dismissed:${publicKey ?? \"default\"}:${user?.id ?? \"anonymous\"}`,\n dismissForDays: dismissalDuration(props.dismissForDays),\n isAnonymous: !(user || userToken),\n };\n}\n","import { useEffect } from \"react\";\n\nconst RESIZE_DEBOUNCE = 400;\n\n/**\n * Calls `refresh` whenever the page the reporter is looking at changes shape:\n * SPA routes (which never fire popstate on push/replace — history methods must\n * be patched) and window resizes, debounced. Keeps the frozen screenshot and\n * page context describing what the reporter currently sees.\n */\nexport function useCaptureSync(enabled: boolean, refresh: () => void): void {\n useEffect(() => {\n if (!enabled) {\n return;\n }\n\n const history = window.history;\n const originalPush = history.pushState;\n const originalReplace = history.replaceState;\n const hadOwnPush = Object.hasOwn(history, \"pushState\");\n const hadOwnReplace = Object.hasOwn(history, \"replaceState\");\n\n history.pushState = function pushState(data, unused, url) {\n const result = originalPush.call(history, data, unused, url);\n refresh();\n return result;\n };\n history.replaceState = function replaceState(data, unused, url) {\n const result = originalReplace.call(history, data, unused, url);\n refresh();\n return result;\n };\n window.addEventListener(\"popstate\", refresh);\n\n let resizeTimer: number | undefined;\n const onResize = () => {\n window.clearTimeout(resizeTimer);\n resizeTimer = window.setTimeout(refresh, RESIZE_DEBOUNCE);\n };\n window.addEventListener(\"resize\", onResize);\n\n return () => {\n if (hadOwnPush) {\n history.pushState = originalPush;\n } else {\n Reflect.deleteProperty(history, \"pushState\");\n }\n if (hadOwnReplace) {\n history.replaceState = originalReplace;\n } else {\n Reflect.deleteProperty(history, \"replaceState\");\n }\n window.removeEventListener(\"popstate\", refresh);\n window.clearTimeout(resizeTimer);\n window.removeEventListener(\"resize\", onResize);\n };\n }, [enabled, refresh]);\n}\n","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ElementSelection } from \"../../types\";\nimport { captureViewport, releaseCapture } from \"../core/capture\";\nimport {\n type ConsoleRecorder,\n startConsoleRecorder,\n} from \"../core/console-recorder\";\nimport { highlightFor } from \"../core/element-capture\";\nimport {\n buildElementSelection,\n MAX_SELECTION_COMMENT_LENGTH,\n} from \"../core/element-selector\";\nimport { collectPageContext } from \"../core/page-context\";\nimport {\n DEFAULT_WIDGET_LABELS,\n type RefletFeedbackProps,\n SDK_VERSION,\n type WidgetStep,\n} from \"../types\";\nimport { useFeedbackSubmission } from \"./state/use-feedback-submission\";\nimport { useScreenshotDrafts } from \"./state/use-screenshot-drafts\";\nimport { useWidgetConfig } from \"./state/use-widget-config\";\nimport { useCaptureSync } from \"./use-capture-sync\";\n\nconst SUCCESS_CLOSE_DELAY = 2400;\nconst IS_APPLE = /Mac|iPhone|iPad/;\nconst MILLISECONDS_PER_DAY = 86_400_000;\n\nfunction readDismissedUntil(key: string): number {\n if (typeof window === \"undefined\") {\n return 0;\n }\n\n try {\n const value = Number.parseInt(window.localStorage.getItem(key) ?? \"\", 10);\n if (Number.isFinite(value) && value > Date.now()) {\n return value;\n }\n window.localStorage.removeItem(key);\n } catch {\n return 0;\n }\n\n return 0;\n}\n\nfunction writeDismissedUntil(key: string, until: number): void {\n try {\n window.localStorage.setItem(key, String(until));\n } catch {\n // storage blocked (private mode, quota) — dismissal just does not persist\n }\n}\n\nexport function matchesHotkey(\n event: Pick<\n KeyboardEvent,\n \"altKey\" | \"ctrlKey\" | \"key\" | \"metaKey\" | \"shiftKey\"\n >,\n hotkey: string,\n platform = typeof navigator === \"undefined\" ? \"\" : navigator.platform\n): boolean {\n const parts = hotkey\n .toLowerCase()\n .split(\"+\")\n .map((part) => part.trim());\n const key = parts.at(-1);\n if (!key || event.key.toLowerCase() !== key) {\n return false;\n }\n\n const isApple = IS_APPLE.test(platform);\n const wantsMod = parts.includes(\"mod\");\n const expected = {\n alt: parts.includes(\"alt\") || parts.includes(\"option\"),\n ctrl: parts.includes(\"ctrl\") || (wantsMod && !isApple),\n meta:\n parts.includes(\"meta\") || parts.includes(\"cmd\") || (wantsMod && isApple),\n shift: parts.includes(\"shift\"),\n };\n\n return (\n event.altKey === expected.alt &&\n event.ctrlKey === expected.ctrl &&\n event.metaKey === expected.meta &&\n event.shiftKey === expected.shift\n );\n}\n\nexport interface AnnotationTrigger {\n button: HTMLButtonElement;\n thumbnail: HTMLElement;\n}\n\nexport function useWidgetState(props: RefletFeedbackProps) {\n const { client, dismissalKey, dismissForDays, isAnonymous } =\n useWidgetConfig(props);\n\n const [isOpen, setIsOpen] = useState(false);\n const [annotationTrigger, setAnnotationTrigger] =\n useState<AnnotationTrigger | null>(null);\n const [step, setStep] = useState<WidgetStep>(\"compose\");\n const [message, setMessage] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [honeypot, setHoneypot] = useState(\"\");\n const [isElementCapturing, setIsElementCapturing] = useState(false);\n const successTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [dismissedUntil, setDismissedUntil] = useState(() =>\n readDismissedUntil(dismissalKey)\n );\n\n const pickRef = useRef(0);\n useEffect(\n () => () => {\n pickRef.current++;\n if (successTimer.current) {\n clearTimeout(successTimer.current);\n }\n },\n []\n );\n const consoleRef = useRef<ConsoleRecorder | null>(null);\n\n useEffect(() => {\n setDismissedUntil(readDismissedUntil(dismissalKey));\n }, [dismissalKey]);\n\n useEffect(() => {\n if (props.captureConsole === false) {\n return;\n }\n const recorder = startConsoleRecorder();\n consoleRef.current = recorder;\n return () => {\n consoleRef.current = null;\n recorder.stop();\n };\n }, [props.captureConsole]);\n\n const captureFailed =\n props.labels?.captureFailed ?? DEFAULT_WIDGET_LABELS.captureFailed;\n const gallery = useScreenshotDrafts(captureFailed, setError);\n const {\n activeScreenshot,\n cancelPendingCapture,\n refreshAutomatic,\n resetScreenshots,\n storeScreenshot,\n } = gallery;\n const capture = activeScreenshot?.image ?? null;\n const annotations = activeScreenshot?.annotations ?? [];\n const isCapturing = gallery.pendingCapture !== null || isElementCapturing;\n const submission = useFeedbackSubmission({\n client,\n onError: setError,\n onSubmitted: (feedbackId) => {\n setStep(\"success\");\n props.onSubmit?.({ feedbackId });\n successTimer.current = setTimeout(close, SUCCESS_CLOSE_DELAY);\n },\n partialUploadMessage:\n props.labels?.attachmentUploadFailed ??\n DEFAULT_WIDGET_LABELS.attachmentUploadFailed,\n });\n const { resetSubmission } = submission;\n useCaptureSync(\n isOpen &&\n !submission.isEditingDisabled &&\n step === \"compose\" &&\n gallery.canRefreshAutomatically &&\n props.captureOnOpen !== false,\n refreshAutomatic\n );\n\n const reset = useCallback(() => {\n if (successTimer.current) {\n clearTimeout(successTimer.current);\n }\n setAnnotationTrigger(null);\n resetSubmission();\n pickRef.current++;\n setIsElementCapturing(false);\n resetScreenshots();\n setMessage(\"\");\n setEmail(\"\");\n setHoneypot(\"\");\n setError(null);\n setStep(\"compose\");\n }, [resetSubmission, resetScreenshots]);\n\n const close = useCallback(() => {\n setIsOpen(false);\n reset();\n props.onClose?.();\n }, [reset, props.onClose]);\n const dismiss = useCallback(() => {\n if (dismissForDays === null) {\n return;\n }\n\n const until = Date.now() + dismissForDays * MILLISECONDS_PER_DAY;\n writeDismissedUntil(dismissalKey, until);\n setIsOpen(false);\n reset();\n setDismissedUntil(until);\n props.onDismiss?.({ until });\n }, [dismissForDays, dismissalKey, props.onDismiss, reset]);\n\n const open = useCallback(() => {\n setIsOpen(true);\n setStep(\"compose\");\n props.onOpen?.();\n if (props.captureOnOpen !== false) {\n refreshAutomatic();\n }\n }, [props.captureOnOpen, props.onOpen, refreshAutomatic]);\n\n const selectElement = useCallback(\n async (element: Element, note = \"\") => {\n cancelPendingCapture();\n setIsElementCapturing(true);\n const picked: ElementSelection = note\n ? {\n ...buildElementSelection(element),\n comment: note.slice(0, MAX_SELECTION_COMMENT_LENGTH),\n }\n : buildElementSelection(element);\n setStep(\"compose\");\n\n const pick = ++pickRef.current;\n const context = collectPageContext({ sdkVersion: SDK_VERSION });\n const fresh = await captureViewport().catch(() => null);\n\n if (pickRef.current !== pick) {\n releaseCapture(fresh);\n return;\n }\n\n setIsElementCapturing(false);\n if (!fresh) {\n setError(captureFailed);\n return;\n }\n storeScreenshot({\n annotations: [highlightFor(picked, fresh)],\n context,\n id: crypto.randomUUID(),\n image: fresh,\n selectedNode: element,\n selection: picked,\n source: \"manual\",\n });\n },\n [cancelPendingCapture, captureFailed, storeScreenshot]\n );\n\n const selections = gallery.screenshots.flatMap(({ selection }) =>\n selection ? [selection] : []\n );\n const firstElementNote = selections.find(({ comment }) => comment)?.comment;\n const reportedMessage = message.trim() || firstElementNote || \"\";\n const submit = () => {\n if (honeypot) {\n setStep(\"success\");\n return;\n }\n setStep(\"compose\");\n return submission.submit({\n context: {\n ...(activeScreenshot?.context ??\n collectPageContext({ sdkVersion: SDK_VERSION })),\n consoleEvents: consoleRef.current?.events(),\n metadata: props.metadata,\n selections,\n },\n email,\n isAnonymous,\n message: reportedMessage,\n screenshots: gallery.screenshots,\n });\n };\n const requestSubmit = () => {\n const needsEmail =\n isAnonymous && email.length === 0 && !submission.hasPendingAttachments;\n if (needsEmail && !honeypot) {\n setStep(\"email\");\n return;\n }\n return submit();\n };\n\n return {\n activeScreenshot,\n annotateScreenshot: (id: string, trigger: AnnotationTrigger) => {\n setAnnotationTrigger(trigger);\n gallery.selectScreenshot(id);\n setStep(\"annotate\");\n },\n annotations,\n annotationTrigger,\n canDismiss: dismissForDays !== null,\n canSubmit: reportedMessage.length > 0,\n capture,\n close,\n dismiss,\n dismissForDays,\n email,\n error,\n hasPendingAttachments: submission.hasPendingAttachments,\n honeypot,\n isAnonymous,\n isCapturing,\n isDismissed: dismissedUntil > Date.now(),\n isEditingDisabled: submission.isEditingDisabled,\n isOpen,\n isSubmitting: submission.isSubmitting,\n message,\n open,\n pendingCapture: gallery.pendingCapture,\n removeCapture: gallery.removeCapture,\n requestSubmit,\n retakeCapture: gallery.retakeCapture,\n screenshots: gallery.screenshots,\n selectElement,\n selections,\n setAnnotations: gallery.setAnnotations,\n setEmail,\n setHoneypot,\n setMessage,\n setSelectionComment: gallery.setSelectionComment,\n setStep,\n step,\n submit,\n takeCapture: gallery.takeCapture,\n };\n}\n\nexport type WidgetState = ReturnType<typeof useWidgetState>;\n","import { useEffect, useRef, useState } from \"react\";\nimport type { FeedbackWidgetLabels, RefletFeedbackProps } from \"../../types\";\nimport { CloseIcon, GripIcon } from \"../icons\";\nimport { Launcher } from \"../launcher\";\nimport { FeedbackPanel } from \"../panel\";\nimport { SelectionOutline } from \"../selection-outline\";\nimport { matchesHotkey, type WidgetState } from \"../use-widget-state\";\nimport { listenToKeydown } from \"../widget-keys\";\nimport { useFloatingPosition } from \"./use-floating-position\";\n\nexport function FloatingWidget({\n hotkey,\n labels,\n position,\n state,\n}: {\n hotkey: string | null;\n labels: FeedbackWidgetLabels;\n position: RefletFeedbackProps[\"position\"];\n state: WidgetState;\n}) {\n const [minimized, setMinimized] = useState(false);\n const launcherRef = useRef<HTMLButtonElement>(null);\n const showPanel = state.isOpen && !minimized;\n const floating = useFloatingPosition(position, showPanel);\n const minimize = () => {\n setMinimized(true);\n requestAnimationFrame(() => launcherRef.current?.focus());\n };\n\n useEffect(() => {\n if (state.step === \"compose\") {\n state.annotationTrigger?.button.focus({ preventScroll: true });\n }\n }, [state.step, state.annotationTrigger]);\n\n useEffect(() => {\n if (!showPanel || state.step !== \"compose\") {\n return;\n }\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && !event.defaultPrevented) {\n setMinimized(true);\n requestAnimationFrame(() => launcherRef.current?.focus());\n }\n };\n return listenToKeydown(floating.rootRef.current, onKeyDown);\n }, [floating.rootRef, showPanel, state.step]);\n\n const { close, isOpen, open } = state;\n useEffect(() => {\n if (!hotkey) {\n return;\n }\n const toggleOnHotkey = (event: KeyboardEvent) => {\n if (matchesHotkey(event, hotkey)) {\n event.preventDefault();\n if (isOpen) {\n close();\n } else {\n open();\n }\n }\n };\n return listenToKeydown(floating.rootRef.current, toggleOnHotkey, true);\n }, [close, floating.rootRef, hotkey, isOpen, open]);\n\n return (\n <div\n className=\"root\"\n data-editing={\n state.isOpen && (state.step === \"picking\" || state.step === \"annotate\")\n }\n data-moved={Boolean(floating.position)}\n data-position={position}\n ref={floating.rootRef}\n >\n <style>{floating.styles}</style>\n {showPanel &&\n state.step === \"compose\" &&\n state.screenshots.map(({ id, selectedNode }) =>\n selectedNode ? (\n <SelectionOutline key={id} node={selectedNode} />\n ) : null\n )}\n {showPanel ? (\n <FeedbackPanel\n floatingControls={\n <div className=\"floating-controls\">\n <button\n aria-label={labels.moveFeedback}\n className=\"icon-btn drag-handle\"\n title={labels.moveFeedback}\n type=\"button\"\n {...floating.handleProps}\n >\n <GripIcon />\n </button>\n <button\n aria-label={labels.minimize}\n className=\"icon-btn\"\n onClick={minimize}\n title={labels.minimize}\n type=\"button\"\n >\n <CloseIcon />\n </button>\n </div>\n }\n labels={labels}\n state={state}\n />\n ) : (\n <Launcher\n buttonRef={launcherRef}\n isOpen={false}\n label={state.isOpen ? labels.resume : labels.trigger}\n onClick={() => {\n setMinimized(false);\n if (!state.isOpen) {\n state.open();\n }\n }}\n />\n )}\n </div>\n );\n}\n","import { REFLET_Z_INDEX } from \"../../../z-index\";\n\nexport const ANNOTATOR_STYLES = `\n.overlay { margin: 0; border: 0; padding: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; position: fixed; inset: 0; z-index: ${REFLET_Z_INDEX.annotatorOverlay}; display: flex; flex-direction: column; background: transparent; color: var(--rf-text); font: 13px/1.45 ui-sans-serif, system-ui, sans-serif; }\n.overlay::before { content: \"\"; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: color-mix(in srgb, var(--rf-bg) 94%, transparent); animation: rf-editor-in 260ms var(--rf-ease); transition: opacity 260ms var(--rf-ease); }\n.overlay::backdrop { background: transparent; }\n@keyframes rf-editor-in { from { opacity: 0; } }\n.editor { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 20px; min-height: 0; container-type: size; }\n.editor-image { width: min(100cqw, calc(100cqh * var(--rf-capture-ratio))); aspect-ratio: var(--rf-capture-ratio); flex: none; position: relative; }\n.editor-visual { position: absolute; inset: 0; border-radius: var(--rf-radius); box-shadow: var(--rf-shadow); transform-origin: top left; overflow: hidden; }\n.editor-visual img, .editor-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; object-position: top center; outline: 1px solid var(--rf-hairline); outline-offset: -1px; }\n.editor-visual canvas { cursor: crosshair; touch-action: none; }\n.overlay[data-opening=\"true\"] .editor { pointer-events: none; }\n.overlay[data-closing=\"true\"] { pointer-events: none; }\n.overlay[data-closing=\"true\"]::before { opacity: 0; }\n.overlay[data-closing=\"true\"] .toolbar, .overlay[data-closing=\"true\"] .element-note { opacity: 0; transform: translateY(8px); }\n\n.element-note { order: 1; display: flex; align-items: flex-start; gap: 10px; width: min(560px, calc(100vw - 32px)); margin: 0 auto 10px; padding: 10px 14px; border-radius: var(--rf-radius); transition: opacity 180ms var(--rf-ease), transform 180ms var(--rf-ease); }\n.element-note svg { flex: none; margin-top: 4px; opacity: 0.7; }\n.element-note textarea { flex: 1; min-width: 0; height: 42px; max-height: 96px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; resize: none; }\n.element-note textarea:focus { outline: none; }\n.element-note:focus-within { outline: 2px solid var(--rf-accent); outline-offset: 2px; }\n\n.toolbar { order: 2; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; transition: opacity 180ms var(--rf-ease), transform 180ms var(--rf-ease); padding: 4px 12px max(16px, env(safe-area-inset-bottom)); }\n.toolbar .group { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: var(--rf-pill); }\n.tool[aria-pressed=\"true\"], .tool[data-selected=\"true\"] { background: var(--rf-primary); color: var(--rf-primary-text); }\n.color-picker { position: relative; }\n.color-picker summary { display: flex; justify-content: center; align-items: center; }\n.color-preview { width: 18px; height: 18px; border-radius: 50%; background: var(--annotation-color); box-shadow: inset 0 0 0 1px var(--rf-border); }\n.color-popover { --rf-color-width: 200px; position: absolute; bottom: calc(100% + 14px); left: clamp(calc(12px - var(--rf-color-anchor)), 0px, calc(100vw - var(--rf-color-anchor) - var(--rf-color-width) - 12px)); display: flex; align-items: center; gap: 6px; width: var(--rf-color-width); padding: 4px 4px 4px 14px; border-radius: var(--rf-pill); animation: rf-in 180ms var(--rf-ease); }\n.color-picker[data-placement=\"below\"] .color-popover { top: calc(100% + 14px); bottom: auto; }\n.color-slider { flex: 1; min-width: 0; }\n.color-slider-control { display: flex; align-items: center; height: 40px; width: 100%; touch-action: none; user-select: none; cursor: pointer; }\n.color-slider-track { height: 12px; width: 100%; border-radius: var(--rf-pill); background: linear-gradient(to right, var(--rf-swatch-base), var(--annotation-base-color)); box-shadow: inset 0 0 0 1px var(--rf-border); }\n.color-slider-thumb { width: 16px; height: 16px; border: 2px solid var(--rf-swatch-base); border-radius: 50%; background: var(--annotation-color); box-shadow: var(--rf-shadow-low); transition: scale 160ms var(--rf-ease); }\n.color-slider-thumb[data-dragging] { scale: 1.12; }\n.color-slider-thumb:has(:focus-visible) { outline: 2px solid var(--rf-accent); outline-offset: 3px; }\n.color-spectrum { position: relative; display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }\n.color-spectrum::before { content: \"\"; width: 16px; height: 16px; border-radius: 50%; background: var(--rf-spectrum); box-shadow: inset 0 0 0 1px var(--rf-glass-highlight); }\n.color-spectrum:hover { background: var(--rf-bg-hover); }\n.color-spectrum button { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; }\n.color-spectrum button:focus-visible { outline: 2px solid var(--rf-accent); outline-offset: 3px; }\n.color-spectrum input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }\n.done-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: var(--rf-pill); color: var(--rf-primary-text); background: var(--rf-primary); }\n.drawing-menu { position: relative; }\n.drawing-popover { position: absolute; z-index: 2; right: 0; bottom: calc(100% + 12px); width: 200px; max-height: calc(50dvh - 68px); overflow-y: auto; padding: 6px; border-radius: var(--rf-radius); }\n.drawing-menu[data-placement=\"below\"] .drawing-popover { top: calc(100% + 12px); bottom: auto; }\n.drawing-option { display: flex; align-items: center; width: 100%; min-height: 40px; gap: 10px; padding: 0 10px; border-radius: 12px; text-align: left; }\n.drawing-option:hover, .drawing-option[aria-pressed=\"true\"] { background: var(--rf-bg-hover); }\n.drawing-divider { height: 1px; margin: 5px; background: var(--rf-border); }\n.editor canvas[data-tool=\"text\"] { cursor: text; }\n.text-annotation-editor { position: fixed; z-index: 3; width: 240px; padding: 8px; border-radius: var(--rf-radius); }\n.text-annotation-editor:focus-within { outline: 2px solid var(--rf-accent); outline-offset: 2px; }\n.text-annotation-editor textarea { display: block; width: 100%; min-height: 64px; max-height: 112px; padding: 6px; border: 0; background: transparent; resize: vertical; font-size: 16px; line-height: 24px; }\n.text-annotation-editor textarea:focus { outline: none; }\n.text-annotation-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }\n@media (pointer: coarse) {\n .drawing-option { min-height: 44px; }\n .done-btn { width: 44px; height: 44px; }\n .color-popover { --rf-color-width: 232px; padding-left: 16px; }\n .color-slider-control, .color-spectrum { height: 44px; }\n .color-spectrum { width: 44px; }\n .color-slider-thumb, .color-spectrum::before { width: 18px; height: 18px; }\n .editor { padding: 8px; }\n .toolbar { gap: 6px; }\n .toolbar .group { padding: 3px; gap: 0; }\n}\n@media (pointer: coarse) and (max-width: 360px) {\n .toolbar { gap: 4px; padding-inline: 2px; }\n .toolbar .group { padding: 0; }\n}\n`;\n","export const COMPOSER_STYLES = `\n.panel { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; outline: none; animation: rf-in 240ms var(--rf-ease); }\n.success-panel { border-radius: var(--rf-radius); }\n.composer { position: relative; display: flex; flex-direction: column; gap: 8px; }\n.message-row { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 26px; }\n.message-row textarea {\n width: 100%; height: 76px; max-height: min(140px, 30dvh);\n margin: 0; padding: 6px 6px 0 8px; border: 0; resize: none;\n background: transparent; line-height: 20px;\n}\n.message-actions { display: flex; align-items: center; gap: 2px; }\n.message-row textarea::placeholder { color: var(--rf-text-muted); }\n.message-row textarea:focus { outline: none; }\n.message-row:has(textarea:focus-visible) { border-color: color-mix(in srgb, var(--rf-accent) 40%, var(--rf-glass-stroke)); }\n.submit { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: var(--rf-pill); background: var(--rf-primary); color: var(--rf-primary-text); transition: opacity 160ms var(--rf-ease), transform 160ms var(--rf-ease); }\n.submit svg { transform: rotate(-45deg); }\n.submit:hover:enabled { transform: scale(1.05); }\n.submit:disabled { background: var(--rf-bg-hover); color: var(--rf-text-muted); opacity: .65; }\n.composer-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }\n.composer-options { position: relative; }\nsummary { cursor: pointer; list-style: none; }\nsummary::-webkit-details-marker { display: none; }\n.options-popover { position: absolute; z-index: 2; right: 0; bottom: calc(100% + 12px); width: min(240px, calc(100vw - 40px)); max-height: calc(50dvh - 68px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--rf-radius); animation: rf-in 160ms var(--rf-ease); }\n.composer-options[data-placement=\"below\"] .options-popover { top: calc(100% + 12px); bottom: auto; }\n.email-field { display: flex; flex-direction: column; gap: 6px; color: var(--rf-text-muted); font-size: 12px; }\n.email-field [role=\"alert\"] { color: var(--rf-danger); }\n.email-field input { width: 100%; padding: 9px; border: 1px solid var(--rf-border); border-radius: var(--rf-radius-sm); background: var(--rf-bg-subtle); color: var(--rf-text); }\n.dismiss-btn { min-height: 40px; text-align: left; padding: 0 8px; border-radius: var(--rf-radius-sm); color: var(--rf-text-muted); }\n.dismiss-btn:hover { background: var(--rf-bg-hover); }\n.version-info { font-size: 10px; color: var(--rf-text-muted); padding: 4px 8px 0; border-top: 1px solid var(--rf-border); text-decoration: none; }\n.version-info:hover { color: var(--rf-text); }\n.email-scrim { display: none; }\n.email-prompt { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 22px; animation: rf-in 240ms var(--rf-ease); }\n.email-prompt h2 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; }\n.email-prompt p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--rf-text-muted); }\n.email-prompt .email-field input { min-height: 40px; border-radius: 14px; padding: 0 12px; }\n.email-prompt-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }\n.email-prompt-actions .ghost-btn { padding: 0 12px; color: var(--rf-text-muted); }\n.primary-btn { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: var(--rf-pill); background: var(--rf-primary); color: var(--rf-primary-text); font-weight: 500; }\n.primary-btn:hover { opacity: .9; }\n.attachments { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }\n.attachment-row { display: flex; align-items: flex-end; gap: 8px; min-width: 0; max-width: 100%; }\n.screenshot-scroll-area { position: relative; min-width: 0; margin: -14px -10px -20px; }\n.screenshot-strip { width: 100%; padding: 14px 10px 20px; overscroll-behavior-x: contain; --rf-fade-start: 0px; --rf-fade-end: 0px; mask-image: linear-gradient(to right, transparent, black var(--rf-fade-start), black calc(100% - var(--rf-fade-end)), transparent); mask-repeat: no-repeat; }\n.screenshot-strip[data-overflow-x-start] { --rf-fade-start: calc(10px + min(24px, var(--scroll-area-overflow-x-start))); }\n.screenshot-strip[data-overflow-x-end] { --rf-fade-end: calc(10px + min(24px, var(--scroll-area-overflow-x-end))); }\n.screenshot-strip-content { display: flex; align-items: flex-end; gap: 8px; }\n.screenshot-scroll-area:has(.screenshot-strip-content:empty) { display: none; }\n.capture-slot { display: flex; flex-direction: column; gap: 2px; flex: none; width: 56px; height: var(--rf-attachment-height); padding: 3px; border: 1px dashed var(--rf-border); border-radius: var(--rf-radius); box-shadow: none; }\n.capture-action { display: flex; flex: 1; min-height: 0; align-items: center; justify-content: center; border-radius: 5px; color: var(--rf-text-muted); transition: background 160ms var(--rf-ease), color 160ms var(--rf-ease); }\n.capture-action:first-child { border-radius: 16px 16px 5px 5px; }\n.capture-action:last-child { border-radius: 5px 5px 16px 16px; }\n.capture-action:hover:enabled { background: var(--rf-bg-hover); color: var(--rf-text); }\n.screenshot-scrollbar { height: 4px; margin: 0 8px 2px; opacity: 0; transition: opacity 150ms var(--rf-ease); }\n.screenshot-scrollbar[data-hovering], .screenshot-scrollbar[data-scrolling] { opacity: 1; }\n.screenshot-scroll-thumb { border-radius: var(--rf-pill); background: var(--rf-border); }\n.capture-progress { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; border-radius: inherit; color: var(--rf-text-muted); font-size: 10px; }\n.attachments:empty { display: none; }\n.screenshot-attachment, .attachment-skeleton { position: relative; flex: none; margin: 0; min-width: 0; width: 128px; height: var(--rf-attachment-height); padding: 0; border-radius: 16px; animation: rf-in 260ms var(--rf-ease); }\n.screenshot-attachment { border: 0; }\n.screenshot-preview { display: block; position: relative; width: 100%; height: 100%; padding: 0; border-radius: inherit; overflow: hidden; }\n.screenshot-preview img, .screenshot-preview canvas { width: 100%; height: 100%; display: block; object-fit: cover; object-position: top center; }\n.screenshot-preview canvas { position: absolute; inset: 0; pointer-events: none; }\n.annotation-count { position: absolute; left: 5px; bottom: 5px; min-width: 20px; padding: 2px 6px; border-radius: var(--rf-pill); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; color: var(--rf-text); }\n.attachment-actions { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 1px; padding: 1px; border-radius: var(--rf-pill); }\n.attachment-actions .icon-btn { width: 28px; height: 28px; }\n.attachment-actions svg { width: 14px; height: 14px; }\n.attachment-skeleton { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--rf-text-muted); font-size: 11px; }\n.attachment-skeleton::after { content: \"\"; position: absolute; inset: 0; border-radius: inherit; background: var(--rf-bg-subtle); animation: rf-fade 800ms alternate infinite; }\n.selection-badge { position: absolute; left: 5px; top: 5px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--rf-pill); color: var(--rf-accent); }\n.selection-badge svg { width: 12px; height: 12px; }\n@media (pointer: coarse) {\n .message-row { border-radius: 28px; }\n .capture-slot { width: 64px; }\n .message-row textarea { font-size: 16px; }\n .submit { width: 44px; height: 44px; }\n :host { --rf-attachment-height: 96px; }\n .attachment-actions { right: 5px; bottom: 5px; }\n .attachment-actions .icon-btn { width: 34px; height: 34px; }\n .selection-badge { width: 24px; height: 24px; }\n .email-field input { font-size: 16px; }\n .dismiss-btn { min-height: 44px; }\n}\n@media (max-width: 480px) {\n .email-scrim { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / 40%); animation: rf-fade 200ms var(--rf-ease); }\n .email-prompt { position: fixed; left: 0; right: 0; bottom: 0; gap: 14px; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; animation: rf-drawer-in 280ms var(--rf-ease); }\n .email-prompt h2 { font-size: 17px; }\n .email-prompt p { font-size: 13px; }\n .email-prompt-actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; }\n .email-prompt-actions .ghost-btn, .email-prompt-actions .primary-btn { justify-content: center; min-height: 48px; }\n}\n@keyframes rf-drawer-in { from { transform: translateY(100%); } }\n`;\n","import { REFLET_Z_INDEX } from \"../../../z-index\";\n\nexport const PICKER_STYLES = `\n.picker-box {\n position: fixed;\n top: 0;\n left: 0;\n pointer-events: none;\n border-radius: 5px;\n background: color-mix(in srgb, var(--rf-accent) 10%, transparent);\n box-shadow: 0 0 0 2px var(--rf-accent), 0 0 0 5px color-mix(in srgb, var(--rf-accent) 18%, transparent);\n will-change: translate;\n transition: translate 130ms var(--rf-ease);\n}\n.picker-box[data-pinned=\"true\"] { transition: none; }\n.picker-label {\n position: fixed;\n top: 0;\n left: 0;\n pointer-events: none;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n max-width: min(420px, 90vw);\n height: 24px;\n padding: 0 8px;\n font-size: 11.5px;\n font-weight: 500;\n color: var(--rf-accent-text);\n background: var(--rf-accent);\n border-radius: 6px;\n box-shadow: var(--rf-shadow-float);\n white-space: nowrap;\n overflow: hidden;\n will-change: translate;\n transition: translate 130ms var(--rf-ease);\n}\n.picker-label strong { flex: none; font-weight: 600; }\n.picker-label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; opacity: 0.75; }\n.selection-outline {\n position: fixed;\n top: 0;\n left: 0;\n pointer-events: none;\n border-radius: 5px;\n background: color-mix(in srgb, var(--rf-accent) 7%, transparent);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--rf-accent) 70%, transparent), 0 0 0 5px color-mix(in srgb, var(--rf-accent) 14%, transparent);\n transition: opacity 160ms var(--rf-ease);\n}\n.picker-hint {\n position: fixed;\n left: 50%;\n bottom: calc(24px + env(safe-area-inset-bottom));\n transform: translateX(-50%);\n display: flex;\n align-items: center;\n gap: 6px;\n max-width: calc(100vw - 24px);\n padding: 5px 6px 5px 12px;\n font-size: 12.5px;\n color: var(--rf-text);\n background: var(--rf-bg);\n border-radius: var(--rf-pill);\n box-shadow: var(--rf-ring), var(--rf-shadow);\n animation: rf-fade 240ms var(--rf-ease);\n}\n.picker-instruction { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.picker-hint kbd {\n padding: 1px 5px;\n font: inherit;\n font-size: 11px;\n color: var(--rf-text-muted);\n border-radius: 4px;\n background: var(--rf-bg-subtle);\n box-shadow: var(--rf-shadow-inset);\n}\n.picker-cancel {\n display: inline-flex;\n align-items: center;\n height: 40px;\n padding: 0 14px;\n border-radius: var(--rf-pill);\n font-size: 12.5px;\n font-weight: 500;\n white-space: nowrap;\n color: var(--rf-text-muted);\n}\n.picker-cancel:hover { background: var(--rf-bg-hover); color: var(--rf-text); }\n.picker-note {\n position: fixed;\n z-index: ${REFLET_Z_INDEX.annotatorOverlay};\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: 300px;\n max-width: calc(100vw - 24px);\n padding: 6px 6px 6px 8px;\n border-radius: 18px;\n animation: rf-in 180ms var(--rf-ease);\n}\n.picker-note:focus-within { outline: 2px solid var(--rf-accent); outline-offset: 2px; }\n.picker-note-target {\n display: flex;\n align-items: center;\n gap: 6px;\n margin: 0;\n padding: 2px 4px 0;\n font-size: 11px;\n color: var(--rf-text-muted);\n white-space: nowrap;\n}\n.picker-note-target strong { flex: none; font-weight: 600; color: var(--rf-accent); }\n.picker-note-target span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }\n.picker-note textarea {\n width: 100%;\n min-height: 46px;\n max-height: min(160px, 30dvh);\n margin: 0;\n padding: 7px 6px 0;\n border: 0;\n resize: none;\n background: transparent;\n color: var(--rf-text);\n font-size: 13px;\n line-height: 19px;\n}\n.picker-note textarea:focus { outline: none; }\n.picker-note textarea::placeholder { color: var(--rf-text-muted); }\n.picker-note-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }\n@media (pointer: coarse) {\n .picker-hint { padding: 6px 8px 6px 14px; }\n .picker-hint kbd { display: none; }\n .picker-cancel { height: 44px; padding: 0 18px; font-size: 14px; }\n .picker-note textarea { font-size: 16px; min-height: 56px; }\n}\n\n`;\n","import { REFLET_Z_INDEX } from \"../../z-index\";\nimport { DEFAULT_WIDGET_OFFSET } from \"../types\";\nimport { ANNOTATOR_STYLES } from \"./annotation/styles\";\nimport { COMPOSER_STYLES } from \"./composer/styles\";\nimport { PICKER_STYLES } from \"./floating/picker-styles\";\n\nexport const WIDGET_STYLES = `\n:host {\n --rf-offset: ${DEFAULT_WIDGET_OFFSET}px;\n --rf-bg: #ffffff;\n --rf-bg-subtle: rgb(55 53 47 / 4%);\n --rf-bg-hover: rgb(55 53 47 / 7%);\n --rf-border: rgb(55 53 47 / 9%);\n --rf-hairline: rgb(15 15 15 / 10%);\n --rf-text: #37352f;\n --rf-text-muted: rgb(55 53 47 / 68%);\n --rf-primary: #37352f;\n --rf-primary-text: #ffffff;\n --rf-accent: #2383e2;\n --rf-accent-text: #ffffff;\n --rf-danger: #d44c47;\n --rf-success: #448361;\n --rf-swatch-base: #ffffff;\n --rf-spectrum: conic-gradient(#ff5757, #ffde59, #6bdb78, #4ac9fa, #8b5cf6, #ef73dc, #ff5757);\n --rf-radius: 20px;\n --rf-pill: 999px;\n --rf-attachment-height: 78px;\n --rf-width: 360px;\n --rf-glass: rgb(255 255 255 / 72%);\n --rf-glass-highlight: rgb(255 255 255 / 90%);\n --rf-glass-stroke: rgb(255 255 255 / 70%);\n --rf-radius-sm: 8px;\n --rf-shadow-inset: inset 0 0 0 1px var(--rf-border);\n --rf-ring: 0 0 0 1px rgb(15 15 15 / 4%);\n --rf-shadow-low: 0 1px 2px rgb(15 15 15 / 6%), 0 4px 10px -4px rgb(15 15 15 / 10%);\n --rf-shadow: 0 2px 5px -1px rgb(15 15 15 / 7%), 0 12px 32px -8px rgb(15 15 15 / 16%);\n --rf-shadow-float: 0 4px 12px -3px rgb(15 15 15 / 35%);\n --rf-ease: cubic-bezier(0.16, 1, 0.3, 1);\n color-scheme: light;\n all: initial;\n font-family: var(--rf-font, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif);\n}\n\n:host([data-theme=\"dark\"]) {\n --rf-bg: #202020;\n --rf-bg-subtle: rgb(255 255 255 / 5%);\n --rf-bg-hover: rgb(255 255 255 / 9%);\n --rf-border: rgb(255 255 255 / 9%);\n --rf-hairline: rgb(255 255 255 / 12%);\n --rf-text: #ebeae8;\n --rf-text-muted: rgb(255 255 255 / 68%);\n --rf-glass: rgb(32 32 32 / 78%);\n --rf-glass-highlight: rgb(255 255 255 / 14%);\n --rf-glass-stroke: rgb(255 255 255 / 12%);\n --rf-primary: #f1efec;\n --rf-primary-text: #1c1c1b;\n --rf-accent: #529cca;\n --rf-danger: #eb5757;\n --rf-success: #4dab74;\n --rf-ring: 0 0 0 1px rgb(255 255 255 / 7%);\n --rf-shadow-low: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 10px -4px rgb(0 0 0 / 40%);\n --rf-shadow: 0 2px 5px -1px rgb(0 0 0 / 35%), 0 14px 36px -10px rgb(0 0 0 / 55%);\n --rf-shadow-float: 0 4px 14px -3px rgb(0 0 0 / 55%);\n color-scheme: dark;\n}\n\n*, *::before, *::after { box-sizing: border-box; }\n\n\n.root {\n position: fixed;\n z-index: ${REFLET_Z_INDEX.widgetRoot};\n display: flex;\n align-items: flex-end;\n gap: 8px;\n font: 13px/1.45 var(--rf-font, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif);\n color: var(--rf-text);\n}\n.root:has(.panel) { width: min(var(--rf-width), calc(var(--rf-viewport-width, 100vw) - 24px)); }\n.root[data-position$=\"right\"] { right: calc(var(--rf-viewport-right, 0px) + max(12px, min(var(--rf-offset), calc((var(--rf-viewport-width, 100vw) - var(--rf-width)) / 2)))); }\n.root[data-position$=\"left\"] { left: calc(var(--rf-viewport-left, 0px) + max(12px, min(var(--rf-offset), calc((var(--rf-viewport-width, 100vw) - var(--rf-width)) / 2)))); }\n.root[data-position^=\"bottom\"] { bottom: calc(var(--rf-viewport-bottom, 0px) + max(var(--rf-offset), env(safe-area-inset-bottom))); }\n.root[data-position^=\"top\"] { top: calc(var(--rf-viewport-top, 0px) + max(var(--rf-offset), env(safe-area-inset-top))); align-items: flex-start; }\n.root[data-position=\"bottom-right\"] .panel { transform-origin: bottom right; }\n.root[data-position=\"bottom-left\"] .panel { transform-origin: bottom left; }\n.root[data-position^=\"top\"] .panel { transform-origin: top center; }\n.root[data-editing=\"true\"] { visibility: hidden; pointer-events: none; }\nbutton, select, input, textarea { font: inherit; color: inherit; }\nbutton { margin: 0; cursor: pointer; border: 0; background: none; transition: scale 120ms var(--rf-ease); }\nbutton:disabled { cursor: not-allowed; opacity: .4; }\nbutton:active:not(:disabled) { scale: .97; }\nsvg { flex-shrink: 0; }\n:focus-visible { outline: 2px solid var(--rf-accent); outline-offset: 3px; }\n.icon-btn, .tool {\n display: inline-flex; align-items: center; justify-content: center;\n width: 40px; height: 40px; flex: none; border-radius: var(--rf-pill); color: var(--rf-text-muted);\n transition: background 160ms var(--rf-ease), color 160ms var(--rf-ease), scale 120ms var(--rf-ease);\n}\n.icon-btn:hover, .tool:hover { background: var(--rf-bg-hover); color: var(--rf-text); }\n.launcher {\n display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px;\n border-radius: var(--rf-pill); color: var(--rf-text);\n font-weight: 500;\n transition: transform 200ms var(--rf-ease), box-shadow 200ms var(--rf-ease), scale 120ms var(--rf-ease);\n}\n.launcher:hover { transform: translateY(-2px); box-shadow: var(--rf-shadow); }\n.launcher-icon { display: flex; width: 15px; height: 15px; }\n.launcher-icon .on-close { display: none; }\n.floating-controls {\n display: flex; align-items: center; flex: none;\n margin-right: auto; padding-left: 3px;\n animation: rf-in 220ms var(--rf-ease);\n}\n.drag-handle { touch-action: none; cursor: grab; }\n.drag-handle:active { cursor: grabbing; }\n.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ghost-btn { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px; border-radius: var(--rf-radius-sm); }\n.ghost-btn:hover { background: var(--rf-bg-hover); }\n.error { margin: 0; padding: 10px 14px; border-radius: var(--rf-radius); font-size: 12px; color: var(--rf-danger); }\n.done { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; text-align: center; }\n.done svg { color: var(--rf-success); }\n.done h2 { margin: 0; font-size: 14px; font-weight: 600; }\n.done p { margin: 0; font-size: 12px; color: var(--rf-text-muted); }\n.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rf-spin 700ms linear infinite; }\n.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n@keyframes rf-spin { to { transform: rotate(360deg); } }\n@keyframes rf-in { from { opacity: 0; transform: translateY(5px) scale(.98); } }\n@keyframes rf-fade { from { opacity: 0; } }\n@media (pointer: coarse) {\n .icon-btn, .tool { width: 44px; height: 44px; }\n .launcher, .ghost-btn { min-height: 44px; }\n}\n.glass {\n position: relative;\n isolation: isolate;\n border: 1px solid var(--rf-glass-stroke);\n box-shadow: inset 0 1px 0 var(--rf-glass-highlight), var(--rf-shadow);\n}\n.glass::before {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: -1;\n border-radius: inherit;\n background: var(--rf-bg);\n pointer-events: none;\n}\n@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {\n .glass::before {\n background: var(--rf-glass);\n -webkit-backdrop-filter: blur(20px) saturate(1.6);\n backdrop-filter: blur(20px) saturate(1.6);\n }\n}\n@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {\n .glass::before { background: var(--rf-bg); backdrop-filter: none; -webkit-backdrop-filter: none; }\n}\n.capture-halo { position: fixed; inset: 0; z-index: ${REFLET_Z_INDEX.captureHalo}; pointer-events: none; opacity: 0; transition: opacity 500ms var(--rf-ease); }\n.capture-halo[data-active=\"true\"] { opacity: 1; transition-duration: 140ms; }\n.capture-halo::before { content: \"\"; position: absolute; inset: 0; border-radius: 20px; box-shadow: inset 14px 0 36px -16px var(--rf-accent), inset -14px 0 36px -16px var(--rf-accent), inset 0 0 4px 1px color-mix(in srgb, var(--rf-accent) 35%, transparent); }\n.capture-halo::after { content: \"\"; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--rf-accent) 20%, transparent), transparent 5%, transparent 95%, color-mix(in srgb, var(--rf-accent) 20%, transparent)); }\n${COMPOSER_STYLES}\n${ANNOTATOR_STYLES}\n${PICKER_STYLES}\n@media (prefers-reduced-motion: reduce) {\n *, *::before, *::after { animation: none !important; transition: none !important; }\n button:active:not(:disabled) { scale: 1; }\n}\n`;\n","import { type ReactNode, useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { WIDGET_MARKER } from \"../core/capture\";\nimport { WIDGET_STYLES } from \"./styles\";\n\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nexport type WidgetTheme = \"auto\" | \"dark\" | \"light\";\n\nfunction useResolvedTheme(theme: WidgetTheme): \"dark\" | \"light\" {\n const [systemDark, setSystemDark] = useState(false);\n\n useEffect(() => {\n if (theme !== \"auto\" || typeof window.matchMedia !== \"function\") {\n return;\n }\n\n const query = window.matchMedia(DARK_QUERY);\n setSystemDark(query.matches);\n\n const onChange = (event: MediaQueryListEvent) =>\n setSystemDark(event.matches);\n query.addEventListener(\"change\", onChange);\n return () => query.removeEventListener(\"change\", onChange);\n }, [theme]);\n\n if (theme === \"auto\") {\n return systemDark ? \"dark\" : \"light\";\n }\n return theme;\n}\n\n/**\n * Hosts the widget in a shadow root: the app's CSS cannot reach the panel and\n * the panel's CSS cannot reach the app. Direct DOM work is unavoidable here —\n * React has no declarative way to create a shadow root.\n */\nexport function ShadowPortal({\n children,\n offset,\n primaryColor,\n theme,\n}: {\n children: ReactNode;\n offset: number;\n primaryColor?: string;\n theme: WidgetTheme;\n}) {\n const [shadowRoot, setShadowRoot] = useState<ShadowRoot | null>(null);\n const resolvedTheme = useResolvedTheme(theme);\n\n useEffect(() => {\n const host = document.createElement(\"div\");\n host.setAttribute(WIDGET_MARKER, \"\");\n const root = host.attachShadow({ mode: \"open\" });\n\n const style = document.createElement(\"style\");\n style.textContent = WIDGET_STYLES;\n root.append(style);\n document.body.append(host);\n setShadowRoot(root);\n\n return () => host.remove();\n }, []);\n\n useEffect(() => {\n const host = shadowRoot?.host;\n if (!(host instanceof HTMLElement)) {\n return;\n }\n\n host.setAttribute(\"data-theme\", resolvedTheme);\n host.style.setProperty(\"--rf-offset\", `${offset}px`);\n if (primaryColor) {\n host.style.setProperty(\"--rf-primary\", primaryColor);\n }\n }, [shadowRoot, resolvedTheme, primaryColor, offset]);\n\n if (!shadowRoot) {\n return null;\n }\n\n return createPortal(children, shadowRoot);\n}\n","import { lazy, Suspense } from \"react\";\nimport {\n DEFAULT_WIDGET_LABELS,\n DEFAULT_WIDGET_OFFSET,\n type RefletFeedbackProps,\n} from \"./types\";\nimport { Annotator } from \"./ui/annotator\";\nimport { useOwnsDevtools } from \"./ui/devtools-owner\";\nimport { FloatingWidget } from \"./ui/floating/floating-widget\";\nimport { ElementPicker } from \"./ui/picker\";\nimport { ShadowPortal } from \"./ui/shadow-portal\";\nimport { useWidgetState } from \"./ui/use-widget-state\";\n\n// Bundlers inline NODE_ENV, so production builds drop the branch and never ship the devtools chunk.\n// No `typeof process` guard: Vite replaces only this exact expression and has no `process` in the browser.\nconst DevtoolsLayer =\n process.env.NODE_ENV === \"development\"\n ? lazy(() =>\n import(\"../devtools/client/devtools-layer\").then((module) => ({\n default: module.DevtoolsLayer,\n }))\n )\n : null;\n\nexport function RefletFeedback(props: RefletFeedbackProps) {\n const {\n devtools = true,\n enabled = true,\n hotkey = null,\n offset = DEFAULT_WIDGET_OFFSET,\n position = \"bottom-right\",\n theme = \"auto\",\n } = props;\n\n const labels = { ...DEFAULT_WIDGET_LABELS, ...props.labels };\n const state = useWidgetState(props);\n const { isOpen } = state;\n const showsWidget = enabled && !state.isDismissed;\n const ownsDevtools = useOwnsDevtools(\n devtools && DevtoolsLayer !== null,\n showsWidget\n );\n const showsDevtools = ownsDevtools && DevtoolsLayer !== null;\n\n if (!(showsWidget || showsDevtools)) {\n return null;\n }\n\n return (\n <ShadowPortal\n offset={offset}\n primaryColor={props.primaryColor}\n theme={theme}\n >\n {showsWidget && (\n <>\n <div\n aria-hidden=\"true\"\n className=\"capture-halo\"\n data-active={state.isCapturing}\n />\n <FloatingWidget\n hotkey={hotkey}\n labels={labels}\n position={position}\n state={state}\n />\n\n {isOpen && state.step === \"annotate\" && state.activeScreenshot && (\n <Annotator\n capture={state.activeScreenshot.image}\n editor={{\n annotations: state.annotations,\n onChange: state.setAnnotations,\n onDone: () => state.setStep(\"compose\"),\n onRetake: state.activeScreenshot.selection\n ? undefined\n : () => {\n state.setStep(\"compose\");\n if (state.activeScreenshot) {\n state.retakeCapture(state.activeScreenshot.id);\n }\n },\n trigger: state.annotationTrigger?.thumbnail,\n }}\n labels={labels}\n note={\n state.activeScreenshot.selection && {\n comment: state.activeScreenshot.selection.comment ?? \"\",\n onChange: (comment) => {\n if (state.activeScreenshot) {\n state.setSelectionComment(\n state.activeScreenshot.id,\n comment\n );\n }\n },\n }\n }\n />\n )}\n\n {isOpen && state.step === \"picking\" && (\n <ElementPicker\n labels={labels}\n onCancel={() => state.setStep(\"compose\")}\n onPick={state.selectElement}\n />\n )}\n </>\n )}\n {showsDevtools && (\n <Suspense fallback={null}>\n <DevtoolsLayer\n isWidgetOpen={showsWidget && isOpen}\n position={position}\n />\n </Suspense>\n )}\n </ShadowPortal>\n );\n}\n"],"mappings":";;;;;;;;;;AAKA,MAAa,2BAA4C;CACvD,WAAW;CACX,iBAAiB;AACnB;AAEA,SAAgB,mBAAmB,EACjC,WACA,mBAC0B;CAO1B,OAAO,IANU;EAAC;EAAG;EAAG;CAAC,CAAC,CAAC,KAAK,WAAW;EACzC,MAAM,UAAU,OAAO,SAAS,UAAU,MAAM,QAAQ,SAAS,CAAC,GAAG,EAAE;EACvE,OAAO,KAAK,MAAM,OAAQ,UAAU,OAAO,kBAAmB,GAAG,CAAC,CAC/D,SAAS,EAAE,CAAC,CACZ,SAAS,GAAG,GAAG;CACpB,CACkB,CAAC,CAAC,KAAK,EAAE;AAC7B;;;ACXA,SAAgB,qBAAqB,EACnC,OACA,UACA,YAKC;CACD,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM,WAAW,QAAQ,EAAE;CAC5D,MAAM,WAAW,OAA4B,IAAI;CACjD,MAAM,KAAK,MAAM,CAAC,CAAC,WAAW,KAAK,EAAE;CACrC,gBAAgB;EACd,SAAS,SAAS,MAAM;CAC1B,GAAG,CAAC,CAAC;CACL,OACE,qBAAC,QAAD;EACE,WAAU;EACN;EACJ,WAAW,UAAU;GACnB,MAAM,eAAe;GACrB,SAAS,IAAI;EACf;EANF,UAAA;GAQE,oBAAC,SAAD,EAAA,UAAQ,QAAQ,GAAG,yBAAyB,MAAM,SAAS,EAAE,6CAA6C,MAAM,SAAS,EAAE,8BAAqC,CAAA;GAChK,oBAAC,YAAD;IACE,cAAW;IACX,WAAW;IACX,SAAS,U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AEA;;AAElB"}
1
+ {"version":3,"file":"feedback.js","names":[],"sources":["../src/feedback/ui/annotation/color-value.ts","../src/feedback/ui/annotation/text/text-editor.tsx","../src/feedback/ui/annotation/text/use-text-annotation.ts","../src/feedback/ui/floating/use-details-popover.ts","../src/feedback/ui/annotation/color-picker.tsx","../src/feedback/ui/annotation/tool-menu.tsx","../src/feedback/ui/annotation/toolbar.tsx","../src/feedback/ui/annotation/use-annotation-canvas.ts","../src/feedback/ui/annotation/use-image-morph.ts","../src/feedback/ui/annotator.tsx","../src/feedback/ui/devtools-owner.ts","../src/feedback/ui/launcher.tsx","../src/feedback/ui/composer/capture-slot.tsx","../src/feedback/core/element-capture.ts","../src/feedback/ui/annotation/screenshot-preview.tsx","../src/feedback/ui/composer/screenshot-card.tsx","../src/feedback/ui/composer/attachments.tsx","../src/feedback/ui/composer/email-prompt.tsx","../src/feedback/ui/composer/options.tsx","../src/feedback/ui/composer/message-input.tsx","../src/feedback/ui/panel.tsx","../src/feedback/core/console-recorder.ts","../src/feedback/ui/state/use-feedback-submission.ts","../src/feedback/ui/state/use-screenshot-drafts.ts","../src/feedback/ui/state/use-widget-config.ts","../src/feedback/ui/use-capture-sync.ts","../src/feedback/ui/use-widget-state.ts","../src/feedback/ui/floating/floating-widget.tsx","../src/feedback/ui/annotation/styles.ts","../src/feedback/ui/composer/styles.ts","../src/feedback/ui/floating/picker-styles.ts","../src/feedback/ui/styles.ts","../src/feedback/ui/shadow-portal.tsx","../src/feedback/widget.tsx"],"sourcesContent":["export interface AnnotationColor {\n baseColor: string;\n strengthPercent: number;\n}\n\nexport const DEFAULT_ANNOTATION_COLOR: AnnotationColor = {\n baseColor: \"#ef4444\",\n strengthPercent: 100,\n};\n\nexport function annotationColorHex({\n baseColor,\n strengthPercent,\n}: AnnotationColor): string {\n const channels = [1, 3, 5].map((offset) => {\n const channel = Number.parseInt(baseColor.slice(offset, offset + 2), 16);\n return Math.round(255 + ((channel - 255) * strengthPercent) / 100)\n .toString(16)\n .padStart(2, \"0\");\n });\n return `#${channels.join(\"\")}`;\n}\n","import { useEffect, useId, useRef, useState } from \"react\";\nimport type { Annotation, Point } from \"../../../types\";\nimport { CheckIcon, CloseIcon } from \"../../icons\";\n\nexport interface TextDraft {\n annotation: Annotation;\n fontSize: number;\n position: Point;\n}\n\nexport function TextAnnotationEditor({\n draft,\n onCommit,\n onCancel,\n}: {\n draft: TextDraft;\n onCommit: (text: string) => void;\n onCancel: () => void;\n}) {\n const [text, setText] = useState(draft.annotation.text ?? \"\");\n const inputRef = useRef<HTMLTextAreaElement>(null);\n const id = useId().replaceAll(\":\", \"\");\n useEffect(() => {\n inputRef.current?.focus();\n }, []);\n return (\n <form\n className=\"glass text-annotation-editor\"\n id={id}\n onSubmit={(event) => {\n event.preventDefault();\n onCommit(text);\n }}\n >\n <style>{`[id=\"${id}\"] { left: clamp(12px, ${draft.position.x}px, calc(100vw - 252px)); top: clamp(12px, ${draft.position.y}px, calc(100dvh - 148px)); }`}</style>\n <textarea\n aria-label=\"Text annotation\"\n maxLength={280}\n onBlur={(event) => {\n if (!event.currentTarget.form?.contains(event.relatedTarget)) {\n onCommit(text);\n }\n }}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n onCancel();\n }\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n onCommit(text);\n }\n }}\n placeholder=\"Type a note…\"\n ref={inputRef}\n rows={2}\n value={text}\n />\n <div className=\"text-annotation-actions\">\n <button\n aria-label=\"Cancel text\"\n className=\"tool\"\n onClick={onCancel}\n type=\"button\"\n >\n <CloseIcon />\n </button>\n <button aria-label=\"Apply text\" className=\"done-btn\" type=\"submit\">\n <CheckIcon size={16} />\n </button>\n </div>\n </form>\n );\n}\n","import { useState } from \"react\";\nimport { normalizeRect } from \"../../../core/annotations\";\nimport type { Annotation, Point } from \"../../../types\";\nimport type { TextDraft } from \"./text-editor\";\n\nfunction containsPoint(annotation: Annotation, point: Point) {\n const bounds = normalizeRect(annotation.start, annotation.end);\n return (\n point.x >= bounds.x &&\n point.x <= bounds.x + bounds.width &&\n point.y >= bounds.y &&\n point.y <= bounds.y + bounds.height\n );\n}\n\nexport function useTextAnnotation(options: {\n annotations: Annotation[];\n color: string;\n onChange: (annotations: Annotation[]) => void;\n}) {\n const [textDraft, setTextDraft] = useState<TextDraft | null>(null);\n\n const beginText = (canvas: HTMLCanvasElement, point: Point) => {\n const bounds = canvas.getBoundingClientRect();\n const existing = [...options.annotations]\n .reverse()\n .find((item) => item.tool === \"text\" && containsPoint(item, point));\n const annotation =\n existing ??\n ({\n color: options.color,\n end: point,\n id: crypto.randomUUID(),\n start: point,\n tool: \"text\",\n } satisfies Annotation);\n const fontSize = existing\n ? (existing.end.y - existing.start.y) /\n (existing.text?.split(\"\\n\").length ?? 1) /\n 1.4\n : (18 * canvas.width) / bounds.width;\n setTextDraft({\n annotation,\n fontSize,\n position: {\n x: bounds.x + (annotation.start.x / canvas.width) * bounds.width,\n y: bounds.y + (annotation.start.y / canvas.height) * bounds.height,\n },\n });\n };\n\n const commitText = (canvas: HTMLCanvasElement, text: string) => {\n const context = canvas.getContext(\"2d\");\n if (!(textDraft && context)) {\n return;\n }\n const value = text.trim();\n const remaining = options.annotations.filter(\n ({ id }) => id !== textDraft.annotation.id\n );\n if (value) {\n context.font = `${textDraft.fontSize}px ui-sans-serif, system-ui, sans-serif`;\n const lines = value.split(\"\\n\");\n remaining.push({\n ...textDraft.annotation,\n end: {\n x:\n textDraft.annotation.start.x +\n Math.max(...lines.map((line) => context.measureText(line).width)),\n y:\n textDraft.annotation.start.y +\n lines.length * textDraft.fontSize * 1.4,\n },\n text: value,\n });\n }\n options.onChange(remaining);\n setTextDraft(null);\n };\n\n return {\n beginText,\n cancelText: () => setTextDraft(null),\n commitText,\n textDraft,\n };\n}\n","import { type MouseEvent, useEffect, useRef, useState } from \"react\";\nimport { listenOnPageAndWidget, listenToKeydown } from \"../widget-events\";\n\nexport function useDetailsPopover() {\n const [open, setOpen] = useState(false);\n const [placement, setPlacement] = useState(\"above\");\n const [anchorLeft, setAnchorLeft] = useState(0);\n const detailsRef = useRef<HTMLDetailsElement>(null);\n const summaryRef = useRef<HTMLElement>(null);\n\n useEffect(() => {\n const reposition = () => {\n const bounds = summaryRef.current?.getBoundingClientRect();\n if (bounds && detailsRef.current?.open) {\n setAnchorLeft(bounds.left);\n setPlacement(\n bounds.bottom < window.innerHeight / 2 ? \"below\" : \"above\"\n );\n }\n };\n const dismissOutside = (event: Event) => {\n const details = detailsRef.current;\n if (details?.open && !event.composedPath().includes(details)) {\n setOpen(false);\n }\n };\n const dismissWithEscape = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || !detailsRef.current?.open) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n setOpen(false);\n summaryRef.current?.focus();\n };\n const stopOutsidePress = listenOnPageAndWidget(\n detailsRef.current,\n \"pointerdown\",\n dismissOutside\n );\n const stopListeningToKeys = listenToKeydown(\n detailsRef.current,\n dismissWithEscape,\n true\n );\n window.addEventListener(\"resize\", reposition);\n return () => {\n stopOutsidePress();\n stopListeningToKeys();\n window.removeEventListener(\"resize\", reposition);\n };\n }, []);\n\n const show = () => {\n const bounds = summaryRef.current?.getBoundingClientRect();\n if (bounds) {\n setAnchorLeft(bounds.left);\n setPlacement(bounds.bottom < window.innerHeight / 2 ? \"below\" : \"above\");\n }\n setOpen(true);\n };\n return {\n anchorLeft,\n detailsProps: { \"data-placement\": placement, open, ref: detailsRef },\n hide: () => {\n setOpen(false);\n summaryRef.current?.focus();\n },\n show,\n summaryProps: {\n onClick: (event: MouseEvent<HTMLElement>) => {\n event.preventDefault();\n if (open) {\n setOpen(false);\n } else {\n show();\n }\n },\n ref: summaryRef,\n },\n };\n}\n","import { Slider } from \"@base-ui/react/slider\";\nimport { useId, useRef } from \"react\";\nimport { useDetailsPopover } from \"../floating/use-details-popover\";\nimport { type AnnotationColor, annotationColorHex } from \"./color-value\";\n\ninterface ColorPickerProps {\n onChange: (color: AnnotationColor) => void;\n selection: AnnotationColor;\n}\n\nfunction ColorSpectrum({ selection, onChange }: ColorPickerProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n return (\n <div className=\"color-spectrum\">\n <button\n aria-label=\"Custom color\"\n onClick={() => inputRef.current?.click()}\n title=\"Custom color\"\n type=\"button\"\n />\n <input\n aria-hidden=\"true\"\n onChange={(event) =>\n onChange({ baseColor: event.target.value, strengthPercent: 100 })\n }\n ref={inputRef}\n tabIndex={-1}\n type=\"color\"\n value={selection.baseColor}\n />\n </div>\n );\n}\n\nfunction ColorControls({ selection, onChange }: ColorPickerProps) {\n return (\n <div className=\"color-popover glass\">\n <Slider.Root\n className=\"color-slider\"\n onValueChange={(strengthPercent) =>\n onChange({ ...selection, strengthPercent })\n }\n value={selection.strengthPercent}\n >\n <Slider.Control className=\"color-slider-control\">\n <Slider.Track className=\"color-slider-track\">\n <Slider.Thumb\n aria-label=\"Color strength\"\n className=\"color-slider-thumb\"\n getAriaValueText={(_, value) => `${value}% color`}\n />\n </Slider.Track>\n </Slider.Control>\n </Slider.Root>\n <ColorSpectrum onChange={onChange} selection={selection} />\n </div>\n );\n}\n\nexport function ColorPicker({ selection, onChange }: ColorPickerProps) {\n const popover = useDetailsPopover();\n const id = useId().replaceAll(\":\", \"\");\n return (\n <details className=\"color-picker\" id={id} {...popover.detailsProps}>\n <style>{`[id=\"${id}\"] { --rf-color-anchor: ${popover.anchorLeft}px; --annotation-color: ${annotationColorHex(selection)}; --annotation-base-color: ${selection.baseColor}; }`}</style>\n <summary\n aria-label=\"Annotation color\"\n className=\"tool\"\n {...popover.summaryProps}\n title=\"Annotation color\"\n >\n <span className=\"color-preview\" />\n </summary>\n <ColorControls onChange={onChange} selection={selection} />\n </details>\n );\n}\n","import type { AnnotationTool, FeedbackWidgetLabels } from \"../../types\";\nimport { useDetailsPopover } from \"../floating/use-details-popover\";\nimport {\n BlurIcon,\n CameraIcon,\n ChevronDownIcon,\n HighlightIcon,\n PencilIcon,\n SpotlightIcon,\n TrashIcon,\n} from \"../icons\";\nimport type { AnnotationEditor } from \"./toolbar\";\n\nconst EXTRA_TOOLS = [\n { Icon: SpotlightIcon, id: \"spotlight\", label: \"Spotlight\" },\n { Icon: PencilIcon, id: \"pen\", label: \"Draw\" },\n { Icon: HighlightIcon, id: \"highlight\", label: \"Highlight\" },\n { Icon: BlurIcon, id: \"blur\", label: \"Hide\" },\n] as const;\n\nexport function DrawingToolMenu({\n drawing,\n editor,\n labels,\n}: {\n drawing: { tool: AnnotationTool; setTool: (tool: AnnotationTool) => void };\n editor: AnnotationEditor;\n labels: FeedbackWidgetLabels;\n}) {\n const popover = useDetailsPopover();\n return (\n <details className=\"drawing-menu\" {...popover.detailsProps}>\n <summary\n aria-label=\"More drawing tools\"\n className=\"tool\"\n data-selected={EXTRA_TOOLS.some(({ id }) => id === drawing.tool)}\n title=\"More drawing tools\"\n {...popover.summaryProps}\n >\n <ChevronDownIcon />\n </summary>\n <div className=\"drawing-popover glass\">\n {EXTRA_TOOLS.map(({ id, label, Icon }) => (\n <button\n aria-pressed={drawing.tool === id}\n className=\"drawing-option\"\n key={id}\n onClick={() => {\n drawing.setTool(id);\n popover.hide();\n }}\n type=\"button\"\n >\n <Icon />\n {label}\n </button>\n ))}\n <div className=\"drawing-divider\" />\n <button\n className=\"drawing-option\"\n disabled={editor.annotations.length === 0}\n onClick={() => {\n editor.onChange([]);\n popover.hide();\n }}\n type=\"button\"\n >\n <TrashIcon />\n {labels.clearAnnotations}\n </button>\n {editor.onRetake && (\n <button\n className=\"drawing-option\"\n onClick={editor.onRetake}\n type=\"button\"\n >\n <CameraIcon />\n {labels.recapture}\n </button>\n )}\n </div>\n </details>\n );\n}\n","import type {\n Annotation,\n AnnotationTool,\n FeedbackWidgetLabels,\n} from \"../../types\";\nimport { ArrowIcon, CheckIcon, SquareIcon, TextIcon, UndoIcon } from \"../icons\";\nimport { ColorPicker } from \"./color-picker\";\nimport type { AnnotationColor } from \"./color-value\";\nimport { DrawingToolMenu } from \"./tool-menu\";\n\nconst QUICK_TOOLS = [\n { Icon: SquareIcon, id: \"rectangle\", label: \"Rectangle\" },\n { Icon: ArrowIcon, id: \"arrow\", label: \"Arrow\" },\n { Icon: TextIcon, id: \"text\", label: \"Text\" },\n] as const;\n\nexport interface AnnotationEditor {\n annotations: Annotation[];\n onChange: (annotations: Annotation[]) => void;\n onDone: () => void;\n onRetake?: () => void;\n}\n\nexport function AnnotationToolbar({\n editor,\n labels,\n drawing,\n}: {\n editor: AnnotationEditor;\n labels: FeedbackWidgetLabels;\n drawing: {\n color: AnnotationColor;\n setColor: (color: AnnotationColor) => void;\n tool: AnnotationTool;\n setTool: (tool: AnnotationTool) => void;\n };\n}) {\n return (\n <div className=\"toolbar\">\n <div className=\"group glass\">\n {QUICK_TOOLS.map(({ id, label, Icon }) => (\n <button\n aria-label={label}\n aria-pressed={drawing.tool === id}\n className=\"tool\"\n key={id}\n onClick={() => drawing.setTool(id)}\n title={label}\n type=\"button\"\n >\n <Icon />\n </button>\n ))}\n <DrawingToolMenu drawing={drawing} editor={editor} labels={labels} />\n </div>\n <div className=\"group glass\">\n <ColorPicker onChange={drawing.setColor} selection={drawing.color} />\n <button\n aria-label={labels.undo}\n className=\"tool\"\n disabled={editor.annotations.length === 0}\n onClick={() => editor.onChange(editor.annotations.slice(0, -1))}\n title={labels.undo}\n type=\"button\"\n >\n <UndoIcon />\n </button>\n <button\n aria-label={labels.done}\n className=\"done-btn\"\n onClick={editor.onDone}\n title={labels.done}\n type=\"button\"\n >\n <CheckIcon size={18} />\n </button>\n </div>\n </div>\n );\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport { drawAnnotations } from \"../../core/annotation-renderer\";\nimport type { Annotation, CapturedImage } from \"../../types\";\n\nexport function useAnnotationCanvas(\n capture: CapturedImage,\n annotations: Annotation[]\n) {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [bitmap, setBitmap] = useState<HTMLImageElement | null>(null);\n const [failedUrl, setFailedUrl] = useState<string | null>(null);\n\n useEffect(() => {\n const image = new Image();\n image.onload = () => setBitmap(image);\n image.onerror = () => setFailedUrl(capture.objectUrl);\n image.src = capture.objectUrl;\n return () => {\n image.onload = null;\n image.onerror = null;\n };\n }, [capture.objectUrl]);\n\n const isDecoded = bitmap?.src === capture.objectUrl;\n useEffect(() => {\n const canvas = canvasRef.current;\n const context = canvas?.getContext(\"2d\");\n if (!(canvas && context && bitmap && isDecoded)) {\n return;\n }\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.drawImage(bitmap, 0, 0, canvas.width, canvas.height);\n drawAnnotations(context, annotations);\n }, [annotations, bitmap, isDecoded]);\n\n return { canvasRef, hasError: failedUrl === capture.objectUrl, isDecoded };\n}\n","import { useLayoutEffect, useRef, useState } from \"react\";\n\nfunction prefersReducedMotion() {\n return window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;\n}\n\nfunction thumbnailFrame(frame: HTMLElement, trigger: HTMLElement) {\n const destination = frame.getBoundingClientRect();\n const thumbnail = trigger.getBoundingClientRect();\n const scale = Math.max(\n thumbnail.width / destination.width,\n thumbnail.height / destination.height\n );\n const insetX = (destination.width - thumbnail.width / scale) / 2;\n const insetBottom = destination.height - thumbnail.height / scale;\n const radius =\n Number.parseFloat(getComputedStyle(trigger).borderRadius) / scale;\n return {\n clipPath: `inset(0px ${insetX}px ${insetBottom}px ${insetX}px round ${radius}px)`,\n transform: `translate(${thumbnail.x - destination.x - insetX * scale}px, ${thumbnail.y - destination.y}px) scale(${scale})`,\n };\n}\n\nfunction expandedFrame(visual: HTMLElement) {\n return {\n clipPath: `inset(0px 0px 0px 0px round ${getComputedStyle(visual).borderRadius})`,\n transform: \"none\",\n };\n}\n\nconst TIMING = { duration: 340, easing: \"cubic-bezier(0.22, 1, 0.36, 1)\" };\n\nexport function useImageMorph(\n trigger: HTMLElement | null | undefined,\n onDone: () => void\n) {\n const frameRef = useRef<HTMLDivElement>(null);\n const visualRef = useRef<HTMLDivElement>(null);\n const entrance = useRef<Animation | null>(null);\n const exit = useRef<Animation | null>(null);\n const [isOpening, setIsOpening] = useState(false);\n const [isClosing, setIsClosing] = useState(false);\n\n useLayoutEffect(() => {\n const frame = frameRef.current;\n const visual = visualRef.current;\n if (frame && visual?.animate && trigger && !prefersReducedMotion()) {\n setIsOpening(true);\n entrance.current = visual.animate(\n [thumbnailFrame(frame, trigger), expandedFrame(visual)],\n TIMING\n );\n entrance.current.finished.then(\n () => setIsOpening(false),\n () => undefined\n );\n }\n return () => {\n entrance.current?.cancel();\n exit.current?.cancel();\n };\n }, [trigger]);\n\n const close = (action = onDone) => {\n if (exit.current) {\n return;\n }\n const frame = frameRef.current;\n const visual = visualRef.current;\n if (!(frame && visual?.animate && trigger) || prefersReducedMotion()) {\n action();\n return;\n }\n const current =\n entrance.current?.playState === \"running\"\n ? {\n clipPath: getComputedStyle(visual).clipPath,\n transform: getComputedStyle(visual).transform,\n }\n : expandedFrame(visual);\n entrance.current?.cancel();\n setIsClosing(true);\n const animation = visual.animate(\n [current, thumbnailFrame(frame, trigger)],\n { ...TIMING, duration: 260, fill: \"forwards\" }\n );\n exit.current = animation;\n animation.finished.then(action, () => undefined);\n };\n\n return { close, frameRef, isClosing, isOpening, visualRef };\n}\n","import {\n type PointerEvent as ReactPointerEvent,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { isDegenerate } from \"../core/annotations\";\nimport { MAX_SELECTION_COMMENT_LENGTH } from \"../core/element-selector\";\nimport type {\n Annotation,\n AnnotationTool,\n CapturedImage,\n FeedbackWidgetLabels,\n Point,\n} from \"../types\";\nimport {\n annotationColorHex,\n DEFAULT_ANNOTATION_COLOR,\n} from \"./annotation/color-value\";\nimport { TextAnnotationEditor } from \"./annotation/text/text-editor\";\nimport { useTextAnnotation } from \"./annotation/text/use-text-annotation\";\nimport { type AnnotationEditor, AnnotationToolbar } from \"./annotation/toolbar\";\nimport { useAnnotationCanvas } from \"./annotation/use-annotation-canvas\";\nimport { useImageMorph } from \"./annotation/use-image-morph\";\nimport { TargetIcon } from \"./icons\";\n\nfunction toImagePoint(\n canvas: HTMLCanvasElement,\n clientX: number,\n clientY: number\n): Point {\n const bounds = canvas.getBoundingClientRect();\n return {\n x: Math.max(\n 0,\n Math.min(\n canvas.width,\n ((clientX - bounds.left) / bounds.width) * canvas.width\n )\n ),\n y: Math.max(\n 0,\n Math.min(\n canvas.height,\n ((clientY - bounds.top) / bounds.height) * canvas.height\n )\n ),\n };\n}\n\nexport function Annotator({\n capture,\n labels,\n editor,\n note,\n}: {\n capture: CapturedImage;\n labels: FeedbackWidgetLabels;\n editor: AnnotationEditor & { trigger?: HTMLElement | null };\n note?: { comment: string; onChange: (comment: string) => void };\n}) {\n const { annotations, onChange, onDone, onRetake } = editor;\n const morph = useImageMorph(editor.trigger, onDone);\n const dialogRef = useRef<HTMLDialogElement>(null);\n const [tool, setTool] = useState<AnnotationTool>(\"rectangle\");\n const [colorSelection, setColorSelection] = useState(\n DEFAULT_ANNOTATION_COLOR\n );\n const color = annotationColorHex(colorSelection);\n const [draft, setDraft] = useState<Annotation | null>(null);\n const { canvasRef, hasError, isDecoded } = useAnnotationCanvas(\n capture,\n draft ? [...annotations, draft] : annotations\n );\n const text = useTextAnnotation({ annotations, color, onChange });\n useEffect(() => {\n const dialog = dialogRef.current;\n dialog?.showModal();\n return () => dialog?.close();\n }, []);\n\n const onPointerDown = (event: ReactPointerEvent<HTMLCanvasElement>) => {\n const canvas = canvasRef.current;\n if (!(canvas && isDecoded) || event.button !== 0) {\n return;\n }\n\n const point = toImagePoint(canvas, event.clientX, event.clientY);\n if (tool === \"text\") {\n event.preventDefault();\n text.beginText(canvas, point);\n return;\n }\n canvas.setPointerCapture(event.pointerId);\n\n setDraft({\n color,\n end: point,\n id: crypto.randomUUID(),\n points: tool === \"pen\" ? [point] : undefined,\n start: point,\n tool,\n });\n };\n\n const onPointerMove = (event: ReactPointerEvent<HTMLCanvasElement>) => {\n const canvas = canvasRef.current;\n if (!(canvas && draft)) {\n return;\n }\n\n const point = toImagePoint(canvas, event.clientX, event.clientY);\n setDraft(\n draft.tool === \"pen\"\n ? { ...draft, end: point, points: [...(draft.points ?? []), point] }\n : { ...draft, end: point }\n );\n };\n\n const onPointerUp = () => {\n if (!draft) {\n return;\n }\n if (!isDegenerate(draft)) {\n onChange([...annotations, draft]);\n }\n setDraft(null);\n };\n\n return (\n <dialog\n aria-label={labels.annotateHint}\n className=\"overlay\"\n data-closing={morph.isClosing}\n data-opening={morph.isOpening}\n onCancel={(event) => {\n event.preventDefault();\n morph.close();\n }}\n ref={dialogRef}\n >\n {hasError && (\n <p className=\"error\" role=\"alert\">\n {labels.captureFailed}\n </p>\n )}\n <style>{`.editor-image { --rf-capture-ratio: ${capture.width / capture.height}; }`}</style>\n <div className=\"editor\">\n <div className=\"editor-image\" ref={morph.frameRef}>\n <div className=\"editor-visual\" ref={morph.visualRef}>\n <img\n alt=\"\"\n height={capture.height}\n src={capture.objectUrl}\n width={capture.width}\n />\n <canvas\n data-tool={tool}\n height={capture.height}\n onPointerCancel={() => setDraft(null)}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n ref={canvasRef}\n width={capture.width}\n />\n </div>\n </div>\n </div>\n\n {text.textDraft && (\n <TextAnnotationEditor\n draft={text.textDraft}\n key={text.textDraft.annotation.id}\n onCancel={text.cancelText}\n onCommit={(value) => {\n if (canvasRef.current) {\n text.commitText(canvasRef.current, value);\n }\n }}\n />\n )}\n <AnnotationToolbar\n drawing={{\n color: colorSelection,\n setColor: setColorSelection,\n setTool,\n tool,\n }}\n editor={{\n annotations,\n onChange,\n onDone: () => morph.close(),\n onRetake: onRetake ? () => morph.close(onRetake) : undefined,\n }}\n labels={labels}\n />\n {note && (\n <div className=\"element-note glass\">\n <TargetIcon />\n <textarea\n aria-label={labels.elementNote}\n maxLength={MAX_SELECTION_COMMENT_LENGTH}\n onChange={(event) => note.onChange(event.target.value)}\n placeholder={labels.elementNotePlaceholder}\n value={note.comment}\n />\n </div>\n )}\n </dialog>\n );\n}\n","import { useEffect, useState, useSyncExternalStore } from \"react\";\n\nconst claims = new Map<symbol, { hasWidget: boolean }>();\nconst listeners = new Set<() => void>();\n\nfunction notify() {\n for (const listener of listeners) {\n listener();\n }\n}\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n}\n\nfunction currentOwner(): symbol | undefined {\n for (const [token, claim] of claims) {\n if (claim.hasWidget) {\n return token;\n }\n }\n return claims.keys().next().value;\n}\n\n/**\n * One devtools bar per page, however many RefletFeedback instances mount:\n * the one with a visible widget wins, so its bar can step aside for its panel.\n */\nexport function useOwnsDevtools(wantsDevtools: boolean, hasWidget: boolean) {\n const [token] = useState(() => Symbol(\"reflet-devtools\"));\n\n useEffect(() => {\n if (!wantsDevtools) {\n return;\n }\n claims.set(token, { hasWidget });\n notify();\n return () => {\n claims.delete(token);\n notify();\n };\n }, [hasWidget, token, wantsDevtools]);\n\n return useSyncExternalStore(\n subscribe,\n () => currentOwner() === token,\n () => false\n );\n}\n","import type { Ref } from \"react\";\nimport { ChatIcon, CloseIcon } from \"./icons\";\n\nexport function Launcher({\n isOpen,\n label,\n onClick,\n buttonRef,\n}: {\n isOpen: boolean;\n label: string;\n onClick: () => void;\n buttonRef?: Ref<HTMLButtonElement>;\n}) {\n return (\n <button\n aria-expanded={isOpen}\n className=\"launcher glass\"\n data-open={isOpen}\n onClick={onClick}\n ref={buttonRef}\n type=\"button\"\n >\n <span className=\"launcher-icon\">\n <ChatIcon className=\"on-open\" />\n <CloseIcon className=\"on-close\" />\n </span>\n {label}\n </button>\n );\n}\n","import type { FeedbackWidgetLabels } from \"../../types\";\nimport { CameraIcon, TargetIcon } from \"../icons\";\nimport type { WidgetState } from \"../use-widget-state\";\n\nexport function CaptureSlot({\n labels,\n state,\n}: {\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const disabled = state.isCapturing || state.isEditingDisabled;\n return (\n <div className=\"capture-slot glass\">\n <button\n aria-label={labels.attachScreenshot}\n className=\"capture-action\"\n disabled={disabled}\n onClick={state.takeCapture}\n title={labels.attachScreenshot}\n type=\"button\"\n >\n <CameraIcon />\n </button>\n <button\n aria-label={labels.pickElement}\n className=\"capture-action\"\n disabled={disabled}\n onClick={() => state.setStep(\"picking\")}\n title={labels.pickElement}\n type=\"button\"\n >\n <TargetIcon />\n </button>\n </div>\n );\n}\n","import type { ElementSelection } from \"../../types\";\nimport type { Annotation, CapturedImage } from \"../types\";\n\nconst SELECTION_COLOR = \"#4f46e5\";\nconst SELECTION_ANNOTATION_PREFIX = \"selection-\";\n\nexport function isSelectionAnnotation({ id }: Annotation): boolean {\n return id.startsWith(SELECTION_ANNOTATION_PREFIX);\n}\n\nexport function highlightFor(\n selection: ElementSelection,\n capture: CapturedImage\n): Annotation {\n const scale = capture.width / window.innerWidth;\n const { rect } = selection;\n\n return {\n color: SELECTION_COLOR,\n end: {\n x: (rect.x + rect.width) * scale,\n y: (rect.y + rect.height) * scale,\n },\n id: `${SELECTION_ANNOTATION_PREFIX}${rect.x}-${rect.y}`,\n start: { x: rect.x * scale, y: rect.y * scale },\n tool: \"rectangle\",\n };\n}\n","import type { Annotation, CapturedImage } from \"../../types\";\nimport { useAnnotationCanvas } from \"./use-annotation-canvas\";\n\nexport function ScreenshotPreview({\n annotations,\n capture,\n}: {\n annotations: Annotation[];\n capture: CapturedImage;\n}) {\n const { canvasRef } = useAnnotationCanvas(capture, annotations);\n return (\n <>\n <img\n alt=\"\"\n draggable={false}\n height={capture.height}\n src={capture.objectUrl}\n width={capture.width}\n />\n {annotations.length > 0 && (\n <canvas height={capture.height} ref={canvasRef} width={capture.width} />\n )}\n </>\n );\n}\n","import { useRef } from \"react\";\nimport { isSelectionAnnotation } from \"../../core/element-capture\";\nimport type { FeedbackWidgetLabels, ScreenshotDraft } from \"../../types\";\nimport { ScreenshotPreview } from \"../annotation/screenshot-preview\";\nimport { PencilIcon, TargetIcon, TrashIcon } from \"../icons\";\nimport type { WidgetState } from \"../use-widget-state\";\n\nexport function ScreenshotCard({\n item,\n labels,\n state,\n}: {\n item: { draft: ScreenshotDraft; number: number };\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const { draft, number } = item;\n const previewRef = useRef<HTMLDivElement>(null);\n const isCapturing = state.pendingCapture?.id === draft.id;\n const disabled = state.isEditingDisabled || state.isCapturing;\n const drawings = draft.annotations.filter(\n (annotation) => !isSelectionAnnotation(annotation)\n );\n return (\n <fieldset\n aria-label={`${labels.screenshot} ${number}`}\n className=\"screenshot-attachment\"\n >\n <div className=\"screenshot-preview glass\" ref={previewRef}>\n <ScreenshotPreview\n annotations={draft.annotations}\n capture={draft.image}\n />\n </div>\n {draft.selection && (\n <span\n className=\"selection-badge glass\"\n title={draft.selection.comment ?? draft.selection.label}\n >\n <TargetIcon />\n </span>\n )}\n {drawings.length > 0 && (\n <span className=\"annotation-count glass\">{drawings.length}</span>\n )}\n {isCapturing ? (\n <div className=\"capture-progress glass\" role=\"status\">\n <span className=\"spinner\" />\n {labels.capturing}\n </div>\n ) : (\n <div className=\"attachment-actions glass\">\n <button\n aria-label={labels.annotateHint}\n className=\"icon-btn annotate-action\"\n disabled={disabled}\n onClick={(event) => {\n if (previewRef.current) {\n state.annotateScreenshot(draft.id, {\n button: event.currentTarget,\n thumbnail: previewRef.current,\n });\n }\n }}\n title={labels.annotateHint}\n type=\"button\"\n >\n <PencilIcon />\n </button>\n <button\n aria-label={labels.removeScreenshot}\n className=\"icon-btn\"\n disabled={disabled}\n onClick={() => state.removeCapture(draft.id)}\n title={labels.removeScreenshot}\n type=\"button\"\n >\n <TrashIcon />\n </button>\n </div>\n )}\n </fieldset>\n );\n}\n","import { ScrollArea } from \"@base-ui/react/scroll-area\";\nimport { useEffect, useRef } from \"react\";\nimport type { FeedbackWidgetLabels } from \"../../types\";\nimport { CameraIcon } from \"../icons\";\nimport type { WidgetState } from \"../use-widget-state\";\nimport { CaptureSlot } from \"./capture-slot\";\nimport { ScreenshotCard } from \"./screenshot-card\";\n\nexport function Attachments({\n labels,\n state,\n}: {\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const stripRef = useRef<HTMLDivElement>(null);\n const count = state.screenshots.length;\n useEffect(() => {\n const strip = stripRef.current;\n if (strip && count > 0) {\n strip.scrollTo?.({ left: strip.scrollWidth });\n }\n }, [count]);\n const isAdding =\n state.pendingCapture &&\n !state.screenshots.some(({ id }) => id === state.pendingCapture?.id);\n return (\n <div className=\"attachments\">\n <div className=\"attachment-row\">\n <CaptureSlot labels={labels} state={state} />\n <ScrollArea.Root className=\"screenshot-scroll-area\">\n <ScrollArea.Viewport\n aria-label={labels.screenshot}\n className=\"screenshot-strip\"\n ref={stripRef}\n role=\"region\"\n >\n <ScrollArea.Content className=\"screenshot-strip-content\">\n {state.screenshots.map((draft, index) => (\n <ScreenshotCard\n item={{ draft, number: index + 1 }}\n key={draft.id}\n labels={labels}\n state={state}\n />\n ))}\n {isAdding && (\n <div\n aria-label={labels.capturing}\n className=\"attachment-skeleton glass\"\n role=\"status\"\n >\n <CameraIcon />\n <span>{labels.capturing}</span>\n </div>\n )}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar\n className=\"screenshot-scrollbar\"\n orientation=\"horizontal\"\n >\n <ScrollArea.Thumb className=\"screenshot-scroll-thumb\" />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n </div>\n </div>\n );\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport type { FeedbackWidgetLabels } from \"../../types\";\nimport type { WidgetState } from \"../use-widget-state\";\n\nexport function EmailPrompt({\n labels,\n state,\n}: {\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [invalid, setInvalid] = useState(false);\n useEffect(() => {\n inputRef.current?.focus();\n }, []);\n return (\n <form\n className=\"email-prompt glass\"\n onSubmit={(event) => {\n event.preventDefault();\n state.submit();\n }}\n >\n <h2>{labels.emailPromptTitle}</h2>\n <p>{labels.emailPromptBody}</p>\n <div className=\"email-field\">\n <input\n aria-invalid={invalid}\n aria-label={labels.emailLabel}\n autoComplete=\"email\"\n onChange={(event) => {\n setInvalid(false);\n state.setEmail(event.target.value);\n }}\n onInvalid={(event) => {\n event.preventDefault();\n setInvalid(true);\n }}\n placeholder={labels.emailPlaceholder}\n ref={inputRef}\n type=\"email\"\n value={state.email}\n />\n {invalid && <span role=\"alert\">{labels.emailInvalid}</span>}\n </div>\n <div className=\"email-prompt-actions\">\n <button\n className=\"ghost-btn\"\n onClick={() => {\n state.setEmail(\"\");\n state.submit();\n }}\n type=\"button\"\n >\n {labels.sendWithoutEmail}\n </button>\n <button className=\"primary-btn\" type=\"submit\">\n {labels.submit}\n </button>\n </div>\n </form>\n );\n}\n","import { useState } from \"react\";\nimport type { FeedbackWidgetLabels } from \"../../types\";\nimport { SDK_VERSION } from \"../../types\";\nimport { useDetailsPopover } from \"../floating/use-details-popover\";\nimport { CloseIcon, MoreIcon } from \"../icons\";\nimport type { WidgetState } from \"../use-widget-state\";\n\nexport function ComposerOptions({\n labels,\n state,\n}: {\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const popover = useDetailsPopover();\n const [emailInvalid, setEmailInvalid] = useState(false);\n return (\n <details className=\"composer-options\" {...popover.detailsProps}>\n <summary\n aria-label={labels.moreOptions}\n className=\"icon-btn\"\n {...popover.summaryProps}\n title={labels.moreOptions}\n >\n <MoreIcon />\n </summary>\n <div className=\"options-popover glass\">\n {state.isAnonymous && (\n <label className=\"email-field\">\n {labels.emailLabel}\n <input\n aria-invalid={emailInvalid}\n aria-label={labels.emailLabel}\n autoComplete=\"email\"\n disabled={state.isEditingDisabled}\n onChange={(event) => {\n setEmailInvalid(false);\n state.setEmail(event.target.value);\n }}\n onInvalid={(event) => {\n event.preventDefault();\n setEmailInvalid(true);\n popover.show();\n const input = event.currentTarget;\n requestAnimationFrame(() => input.focus());\n }}\n placeholder={labels.emailPlaceholder}\n type=\"email\"\n value={state.email}\n />\n {emailInvalid && <span role=\"alert\">{labels.emailInvalid}</span>}\n </label>\n )}\n <button\n className=\"ghost-btn\"\n disabled={state.isSubmitting}\n onClick={state.close}\n type=\"button\"\n >\n <CloseIcon />\n {labels.cancel}\n </button>\n {state.canDismiss && (\n <button\n className=\"dismiss-btn\"\n disabled={state.isSubmitting}\n onClick={state.dismiss}\n type=\"button\"\n >\n {labels.dismissForDays.replace(\n \"{days}\",\n String(state.dismissForDays)\n )}\n </button>\n )}\n <a\n className=\"version-info\"\n href=\"https://reflet.app\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n Reflet SDK {SDK_VERSION}\n </a>\n </div>\n </details>\n );\n}\n","import type { ReactNode } from \"react\";\nimport type { FeedbackWidgetLabels } from \"../../types\";\nimport { ArrowIcon } from \"../icons\";\nimport type { WidgetState } from \"../use-widget-state\";\nimport { ComposerOptions } from \"./options\";\n\nexport function MessageInput({\n floatingControls,\n labels,\n state,\n}: {\n floatingControls: ReactNode;\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const submitLabel = state.hasPendingAttachments\n ? labels.retryAttachments\n : labels.submit;\n return (\n <div className=\"message-row glass\">\n <textarea\n aria-label={labels.descriptionPlaceholder}\n disabled={state.isEditingDisabled}\n maxLength={4000}\n onChange={(event) => state.setMessage(event.target.value)}\n placeholder={labels.descriptionPlaceholder}\n rows={3}\n value={state.message}\n />\n <div className=\"message-actions\">\n {floatingControls}\n <ComposerOptions labels={labels} state={state} />\n <button\n aria-busy={state.isSubmitting}\n aria-label={submitLabel}\n className=\"submit\"\n disabled={state.isSubmitting || state.isCapturing || !state.canSubmit}\n title={submitLabel}\n type=\"submit\"\n >\n {state.isSubmitting ? <span className=\"spinner\" /> : <ArrowIcon />}\n </button>\n </div>\n </div>\n );\n}\n","import { type ReactNode, useEffect, useRef } from \"react\";\nimport type { FeedbackWidgetLabels } from \"../types\";\nimport { Attachments } from \"./composer/attachments\";\nimport { EmailPrompt } from \"./composer/email-prompt\";\nimport { MessageInput } from \"./composer/message-input\";\nimport { CheckIcon } from \"./icons\";\nimport type { WidgetState } from \"./use-widget-state\";\n\nexport function FeedbackPanel({\n floatingControls,\n labels,\n state,\n}: {\n floatingControls: ReactNode;\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const panelRef = useRef<HTMLElement>(null);\n useEffect(() => {\n panelRef.current?.focus();\n }, []);\n\n if (state.step === \"success\") {\n return (\n <section aria-live=\"polite\" className=\"panel\">\n <div className=\"done success-panel glass\">\n <CheckIcon />\n <h2>{labels.successTitle}</h2>\n <p>{labels.successMessage}</p>\n </div>\n <div className=\"composer-toolbar\">{floatingControls}</div>\n </section>\n );\n }\n\n if (state.step === \"email\") {\n return (\n <section aria-label={labels.emailPromptTitle} className=\"panel\">\n <button\n aria-label={labels.back}\n className=\"email-scrim\"\n onClick={() => state.setStep(\"compose\")}\n type=\"button\"\n />\n <EmailPrompt labels={labels} state={state} />\n <div className=\"composer-toolbar\">{floatingControls}</div>\n </section>\n );\n }\n\n return (\n <section\n aria-label={labels.title}\n className=\"panel\"\n ref={panelRef}\n tabIndex={-1}\n >\n <Attachments labels={labels} state={state} />\n <form\n className=\"composer\"\n onSubmit={(event) => {\n event.preventDefault();\n state.requestSubmit();\n }}\n >\n <MessageInput\n floatingControls={floatingControls}\n labels={labels}\n state={state}\n />\n <div aria-hidden=\"true\" className=\"hp\">\n <input\n autoComplete=\"off\"\n name=\"company-website\"\n onChange={(event) => state.setHoneypot(event.target.value)}\n tabIndex={-1}\n value={state.honeypot}\n />\n </div>\n {state.error && (\n <p className=\"error glass\" role=\"alert\">\n {state.error}\n </p>\n )}\n </form>\n </section>\n );\n}\n","import type { ConsoleEvent } from \"../../types\";\n\nconst DEFAULT_LIMIT = 30;\nconst MAX_MESSAGE_LENGTH = 1000;\nconst RECORDED_METHODS = [\"error\", \"warn\"] as const;\n\ntype RecordedMethod = (typeof RECORDED_METHODS)[number];\n\nexport interface ConsoleRecorder {\n events: () => ConsoleEvent[];\n stop: () => void;\n}\n\nfunction serializeArgument(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n if (value instanceof Error) {\n return `${value.name}: ${value.message}`;\n }\n if (value === null || value === undefined) {\n return String(value);\n }\n if (typeof value === \"object\") {\n try {\n return JSON.stringify(value) ?? \"[unserializable]\";\n } catch {\n return \"[unserializable]\";\n }\n }\n if (typeof value === \"function\") {\n return \"[function]\";\n }\n return String(value);\n}\n\nfunction formatMessage(args: unknown[]): string {\n const message = args.map(serializeArgument).join(\" \");\n return message.length > MAX_MESSAGE_LENGTH\n ? `${message.slice(0, MAX_MESSAGE_LENGTH - 1)}…`\n : message;\n}\n\n/**\n * Buffers the console noise a user saw right before reporting a bug.\n * Wrappers delegate to the previous implementation, so nothing is swallowed.\n */\nexport function startConsoleRecorder(options?: {\n limit?: number;\n}): ConsoleRecorder {\n const limit = options?.limit ?? DEFAULT_LIMIT;\n const buffer: ConsoleEvent[] = [];\n let active = true;\n\n const push = (level: ConsoleEvent[\"level\"], message: string) => {\n if (!(active && message)) {\n return;\n }\n buffer.push({ level, message, timestamp: Date.now() });\n if (buffer.length > limit) {\n buffer.splice(0, buffer.length - limit);\n }\n };\n\n const originals = new Map<RecordedMethod, (...args: unknown[]) => void>();\n const wrappers = new Map<RecordedMethod, (...args: unknown[]) => void>();\n\n for (const method of RECORDED_METHODS) {\n const original = console[method];\n const wrapper = (...args: unknown[]) => {\n push(method, formatMessage(args));\n Reflect.apply(original, console, args);\n };\n originals.set(method, original);\n wrappers.set(method, wrapper);\n console[method] = wrapper;\n }\n\n const onError = (event: ErrorEvent) => {\n const where = event.filename\n ? ` (${event.filename}:${event.lineno}:${event.colno})`\n : \"\";\n push(\"error\", `${event.message}${where}`);\n };\n\n const onRejection = (event: PromiseRejectionEvent) => {\n push(\"error\", `Unhandled rejection: ${serializeArgument(event.reason)}`);\n };\n\n window.addEventListener(\"error\", onError);\n window.addEventListener(\"unhandledrejection\", onRejection);\n\n return {\n events: () => buffer.slice(),\n stop: () => {\n if (!active) {\n return;\n }\n active = false;\n buffer.length = 0;\n\n for (const method of RECORDED_METHODS) {\n const original = originals.get(method);\n // Another recorder wrapped ours — leave its chain intact.\n if (original && console[method] === wrappers.get(method)) {\n console[method] = original;\n }\n }\n\n window.removeEventListener(\"error\", onError);\n window.removeEventListener(\"unhandledrejection\", onRejection);\n },\n };\n}\n","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { Reflet } from \"../../../client\";\nimport {\n attachPreparedScreenshots,\n createFeedbackTransport,\n type SubmitResult,\n submitWidgetFeedback,\n type WidgetSubmission,\n} from \"../../core/submit\";\n\nexport function useFeedbackSubmission(options: {\n client: Reflet | null;\n onError: (message: string | null) => void;\n onSubmitted: (feedbackId: string) => void;\n partialUploadMessage: string;\n}) {\n const [activeRequest, setActiveRequest] = useState<object | null>(null);\n const [pendingReport, setPendingReport] = useState<SubmitResult | null>(null);\n const requestRef = useRef<object | null>(null);\n useEffect(\n () => () => {\n requestRef.current = null;\n },\n []\n );\n\n const resetSubmission = useCallback(() => {\n requestRef.current = null;\n setPendingReport(null);\n setActiveRequest(null);\n }, []);\n\n const finishSubmission = (result: SubmitResult) => {\n if (result.pendingScreenshots.length > 0) {\n setPendingReport(result);\n options.onError(options.partialUploadMessage);\n return;\n }\n setPendingReport(null);\n options.onSubmitted(result.feedbackId);\n };\n\n const submit = async (draft: WidgetSubmission) => {\n if (requestRef.current) {\n return;\n }\n if (!options.client) {\n options.onError(\n \"Reflet is missing a publicKey. Pass one to RefletFeedback or RefletProvider.\"\n );\n return;\n }\n const request = {};\n requestRef.current = request;\n setActiveRequest(request);\n options.onError(null);\n try {\n const transport = createFeedbackTransport(options.client);\n const result = pendingReport\n ? await attachPreparedScreenshots(transport, pendingReport)\n : await submitWidgetFeedback(transport, draft);\n if (requestRef.current === request) {\n finishSubmission(result);\n }\n } catch (error) {\n if (requestRef.current === request) {\n options.onError(\n error instanceof Error\n ? error.message\n : \"Something went wrong. Please try again.\"\n );\n }\n } finally {\n if (requestRef.current === request) {\n requestRef.current = null;\n setActiveRequest(null);\n }\n }\n };\n\n return {\n hasPendingAttachments: pendingReport !== null,\n isEditingDisabled: activeRequest !== null || pendingReport !== null,\n isSubmitting: activeRequest !== null,\n resetSubmission,\n submit,\n };\n}\n","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { captureViewport, releaseCapture } from \"../../core/capture\";\nimport { collectPageContext } from \"../../core/page-context\";\nimport {\n type Annotation,\n type ScreenshotDraft,\n SDK_VERSION,\n} from \"../../types\";\n\nexport interface CaptureRequest {\n id: string;\n source: ScreenshotDraft[\"source\"];\n}\n\nfunction releaseDraft(draft: ScreenshotDraft | undefined): void {\n releaseCapture(draft?.image);\n}\n\nexport function useScreenshotDrafts(\n captureFailed: string,\n onError: (error: string | null) => void\n) {\n const [screenshots, setScreenshots] = useState<ScreenshotDraft[]>([]);\n const [activeId, setActiveId] = useState<string | null>(null);\n const [pendingCapture, setPendingCapture] = useState<CaptureRequest | null>(\n null\n );\n const ownedDrafts = useRef(new Map<string, ScreenshotDraft>());\n const captureRequest = useRef<CaptureRequest | null>(null);\n\n useEffect(() => {\n const drafts = ownedDrafts.current;\n return () => {\n captureRequest.current = null;\n for (const draft of drafts.values()) {\n releaseDraft(draft);\n }\n drafts.clear();\n };\n }, []);\n\n const storeScreenshot = useCallback((screenshot: ScreenshotDraft) => {\n releaseDraft(ownedDrafts.current.get(screenshot.id));\n ownedDrafts.current.set(screenshot.id, screenshot);\n setScreenshots((previous) => {\n const replacing = previous.some(({ id }) => id === screenshot.id);\n return replacing\n ? previous.map((item) =>\n item.id === screenshot.id ? screenshot : item\n )\n : [...previous, screenshot];\n });\n setActiveId(screenshot.id);\n }, []);\n\n const cancelPendingCapture = useCallback(() => {\n captureRequest.current = null;\n setPendingCapture(null);\n }, []);\n\n const takeScreenshot = useCallback(\n async (request: CaptureRequest) => {\n captureRequest.current = request;\n setPendingCapture(request);\n onError(null);\n const context = collectPageContext({ sdkVersion: SDK_VERSION });\n const image = await captureViewport().catch(() => null);\n if (captureRequest.current !== request) {\n releaseCapture(image);\n return;\n }\n cancelPendingCapture();\n if (!image) {\n onError(captureFailed);\n return;\n }\n storeScreenshot({ ...request, annotations: [], context, image });\n },\n [cancelPendingCapture, captureFailed, onError, storeScreenshot]\n );\n\n const takeCapture = useCallback(() => {\n if (!captureRequest.current) {\n takeScreenshot({ id: crypto.randomUUID(), source: \"manual\" });\n }\n }, [takeScreenshot]);\n\n const refreshAutomatic = useCallback(() => {\n takeScreenshot({\n id:\n ownedDrafts.current.keys().next().value ??\n captureRequest.current?.id ??\n crypto.randomUUID(),\n source: \"automatic\",\n });\n }, [takeScreenshot]);\n\n const retakeCapture = useCallback(\n (id: string) => {\n if (!captureRequest.current && ownedDrafts.current.has(id)) {\n takeScreenshot({ id, source: \"manual\" });\n }\n },\n [takeScreenshot]\n );\n\n const removeCapture = useCallback(\n (id: string) => {\n if (captureRequest.current?.id === id) {\n cancelPendingCapture();\n }\n releaseDraft(ownedDrafts.current.get(id));\n ownedDrafts.current.delete(id);\n setScreenshots((previous) => previous.filter((item) => item.id !== id));\n setActiveId((current) => (current === id ? null : current));\n },\n [cancelPendingCapture]\n );\n\n const resetScreenshots = useCallback(() => {\n cancelPendingCapture();\n for (const draft of ownedDrafts.current.values()) {\n releaseDraft(draft);\n }\n ownedDrafts.current.clear();\n setScreenshots([]);\n setActiveId(null);\n }, [cancelPendingCapture]);\n\n const setAnnotations = useCallback(\n (annotations: Annotation[]) => {\n setScreenshots((previous) =>\n previous.map((item) =>\n item.id === activeId ? { ...item, annotations } : item\n )\n );\n },\n [activeId]\n );\n\n const setSelectionComment = useCallback((id: string, comment: string) => {\n setScreenshots((previous) =>\n previous.map((item) =>\n item.id === id && item.selection\n ? { ...item, selection: { ...item.selection, comment } }\n : item\n )\n );\n }, []);\n\n const activeScreenshot =\n screenshots.find(({ id }) => id === activeId) ?? screenshots.at(-1) ?? null;\n const firstCapture = pendingCapture ?? screenshots[0];\n const canRefreshAutomatically =\n screenshots.length <= 1 &&\n firstCapture?.source === \"automatic\" &&\n (activeScreenshot?.annotations.length ?? 0) === 0 &&\n !screenshots.some((draft) => draft.selection);\n\n return {\n activeScreenshot,\n cancelPendingCapture,\n canRefreshAutomatically,\n pendingCapture,\n refreshAutomatic,\n removeCapture,\n resetScreenshots,\n retakeCapture,\n screenshots,\n selectScreenshot: setActiveId,\n setAnnotations,\n setSelectionComment,\n storeScreenshot,\n takeCapture,\n };\n}\n","import { useContext, useMemo } from \"react\";\nimport { Reflet } from \"../../../client\";\nimport { RefletContext } from \"../../../react-context\";\nimport type { RefletFeedbackProps } from \"../../types\";\n\nfunction dismissalDuration(days: number | undefined) {\n return days !== undefined && Number.isFinite(days) && days > 0 ? days : null;\n}\n\nexport function useWidgetConfig(props: RefletFeedbackProps) {\n const context = useContext(RefletContext);\n const publicKey = props.publicKey ?? context?.publicKey;\n const baseUrl = props.baseUrl ?? context?.baseUrl;\n const user = props.user ?? context?.user;\n const userToken = props.userToken ?? context?.userToken;\n const client = useMemo(\n () =>\n publicKey ? new Reflet({ baseUrl, publicKey, user, userToken }) : null,\n [baseUrl, publicKey, user, userToken]\n );\n return {\n client,\n dismissalKey: `reflet-feedback-dismissed:${publicKey ?? \"default\"}:${user?.id ?? \"anonymous\"}`,\n dismissForDays: dismissalDuration(props.dismissForDays),\n isAnonymous: !(user || userToken),\n publicKey: publicKey ?? null,\n };\n}\n","import { useEffect, useRef } from \"react\";\n\nconst RESIZE_DEBOUNCE = 400;\n\n/**\n * Calls `refresh` whenever the page the reporter is looking at changes shape:\n * SPA routes (which never fire popstate on push/replace — history methods must\n * be patched) and window resizes, debounced. Keeps the frozen screenshot and\n * page context describing what the reporter currently sees.\n */\nexport function useCaptureSync(enabled: boolean, refresh: () => void): void {\n const refreshRef = useRef(refresh);\n\n useEffect(() => {\n refreshRef.current = refresh;\n });\n\n useEffect(() => {\n if (!enabled) {\n return;\n }\n\n const runRefresh = () => refreshRef.current();\n\n const history = window.history;\n const originalPush = history.pushState;\n const originalReplace = history.replaceState;\n const hadOwnPush = Object.hasOwn(history, \"pushState\");\n const hadOwnReplace = Object.hasOwn(history, \"replaceState\");\n\n history.pushState = function pushState(data, unused, url) {\n const result = originalPush.call(history, data, unused, url);\n runRefresh();\n return result;\n };\n history.replaceState = function replaceState(data, unused, url) {\n const result = originalReplace.call(history, data, unused, url);\n runRefresh();\n return result;\n };\n window.addEventListener(\"popstate\", runRefresh);\n\n let resizeTimer: number | undefined;\n const onResize = () => {\n window.clearTimeout(resizeTimer);\n resizeTimer = window.setTimeout(runRefresh, RESIZE_DEBOUNCE);\n };\n window.addEventListener(\"resize\", onResize);\n\n return () => {\n if (hadOwnPush) {\n history.pushState = originalPush;\n } else {\n Reflect.deleteProperty(history, \"pushState\");\n }\n if (hadOwnReplace) {\n history.replaceState = originalReplace;\n } else {\n Reflect.deleteProperty(history, \"replaceState\");\n }\n window.removeEventListener(\"popstate\", runRefresh);\n window.clearTimeout(resizeTimer);\n window.removeEventListener(\"resize\", onResize);\n };\n }, [enabled]);\n}\n","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ElementSelection } from \"../../types\";\nimport { captureViewport, releaseCapture } from \"../core/capture\";\nimport {\n type ConsoleRecorder,\n startConsoleRecorder,\n} from \"../core/console-recorder\";\nimport { highlightFor } from \"../core/element-capture\";\nimport {\n buildElementSelection,\n MAX_SELECTION_COMMENT_LENGTH,\n} from \"../core/element-selector\";\nimport { collectPageContext } from \"../core/page-context\";\nimport {\n DEFAULT_WIDGET_LABELS,\n type RefletFeedbackProps,\n SDK_VERSION,\n type WidgetStep,\n} from \"../types\";\nimport { useFeedbackSubmission } from \"./state/use-feedback-submission\";\nimport { useScreenshotDrafts } from \"./state/use-screenshot-drafts\";\nimport { useWidgetConfig } from \"./state/use-widget-config\";\nimport { useCaptureSync } from \"./use-capture-sync\";\n\nconst SUCCESS_CLOSE_DELAY = 2400;\nconst IS_APPLE = /Mac|iPhone|iPad/;\nconst MILLISECONDS_PER_DAY = 86_400_000;\n\nfunction readDismissedUntil(key: string): number {\n if (typeof window === \"undefined\") {\n return 0;\n }\n\n try {\n const value = Number.parseInt(window.localStorage.getItem(key) ?? \"\", 10);\n if (Number.isFinite(value) && value > Date.now()) {\n return value;\n }\n window.localStorage.removeItem(key);\n } catch {\n return 0;\n }\n\n return 0;\n}\n\nfunction writeDismissedUntil(key: string, until: number): void {\n try {\n window.localStorage.setItem(key, String(until));\n } catch {\n // storage blocked (private mode, quota) — dismissal just does not persist\n }\n}\n\nexport function matchesHotkey(\n event: Pick<\n KeyboardEvent,\n \"altKey\" | \"ctrlKey\" | \"key\" | \"metaKey\" | \"shiftKey\"\n >,\n hotkey: string,\n platform = typeof navigator === \"undefined\" ? \"\" : navigator.platform\n): boolean {\n const parts = hotkey\n .toLowerCase()\n .split(\"+\")\n .map((part) => part.trim());\n const key = parts.at(-1);\n if (!key || event.key.toLowerCase() !== key) {\n return false;\n }\n\n const isApple = IS_APPLE.test(platform);\n const wantsMod = parts.includes(\"mod\");\n const expected = {\n alt: parts.includes(\"alt\") || parts.includes(\"option\"),\n ctrl: parts.includes(\"ctrl\") || (wantsMod && !isApple),\n meta:\n parts.includes(\"meta\") || parts.includes(\"cmd\") || (wantsMod && isApple),\n shift: parts.includes(\"shift\"),\n };\n\n return (\n event.altKey === expected.alt &&\n event.ctrlKey === expected.ctrl &&\n event.metaKey === expected.meta &&\n event.shiftKey === expected.shift\n );\n}\n\nexport interface AnnotationTrigger {\n button: HTMLButtonElement;\n thumbnail: HTMLElement;\n}\n\nexport function useWidgetState(props: RefletFeedbackProps) {\n const { client, dismissalKey, dismissForDays, isAnonymous, publicKey } =\n useWidgetConfig(props);\n\n const [isOpen, setIsOpen] = useState(false);\n const [annotationTrigger, setAnnotationTrigger] =\n useState<AnnotationTrigger | null>(null);\n const [step, setStep] = useState<WidgetStep>(\"compose\");\n const [message, setMessage] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [honeypot, setHoneypot] = useState(\"\");\n const [isElementCapturing, setIsElementCapturing] = useState(false);\n const successTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [dismissedUntil, setDismissedUntil] = useState(() =>\n readDismissedUntil(dismissalKey)\n );\n\n const pickRef = useRef(0);\n useEffect(\n () => () => {\n pickRef.current++;\n if (successTimer.current) {\n clearTimeout(successTimer.current);\n }\n },\n []\n );\n const consoleRef = useRef<ConsoleRecorder | null>(null);\n\n useEffect(() => {\n setDismissedUntil(readDismissedUntil(dismissalKey));\n }, [dismissalKey]);\n\n useEffect(() => {\n if (props.captureConsole === false) {\n return;\n }\n const recorder = startConsoleRecorder();\n consoleRef.current = recorder;\n return () => {\n consoleRef.current = null;\n recorder.stop();\n };\n }, [props.captureConsole]);\n\n const captureFailed =\n props.labels?.captureFailed ?? DEFAULT_WIDGET_LABELS.captureFailed;\n const gallery = useScreenshotDrafts(captureFailed, setError);\n const {\n activeScreenshot,\n cancelPendingCapture,\n refreshAutomatic,\n resetScreenshots,\n storeScreenshot,\n } = gallery;\n const capture = activeScreenshot?.image ?? null;\n const annotations = activeScreenshot?.annotations ?? [];\n const isCapturing = gallery.pendingCapture !== null || isElementCapturing;\n const submission = useFeedbackSubmission({\n client,\n onError: setError,\n onSubmitted: (feedbackId) => {\n setStep(\"success\");\n props.onSubmit?.({ feedbackId });\n successTimer.current = setTimeout(close, SUCCESS_CLOSE_DELAY);\n },\n partialUploadMessage:\n props.labels?.attachmentUploadFailed ??\n DEFAULT_WIDGET_LABELS.attachmentUploadFailed,\n });\n const { resetSubmission } = submission;\n useCaptureSync(\n isOpen &&\n !submission.isEditingDisabled &&\n step === \"compose\" &&\n gallery.canRefreshAutomatically &&\n props.captureOnOpen !== false,\n refreshAutomatic\n );\n\n const reset = useCallback(() => {\n if (successTimer.current) {\n clearTimeout(successTimer.current);\n }\n setAnnotationTrigger(null);\n resetSubmission();\n pickRef.current++;\n setIsElementCapturing(false);\n resetScreenshots();\n setMessage(\"\");\n setEmail(\"\");\n setHoneypot(\"\");\n setError(null);\n setStep(\"compose\");\n }, [resetSubmission, resetScreenshots]);\n\n const close = useCallback(() => {\n setIsOpen(false);\n reset();\n props.onClose?.();\n }, [reset, props.onClose]);\n const dismiss = useCallback(() => {\n if (dismissForDays === null) {\n return;\n }\n\n const until = Date.now() + dismissForDays * MILLISECONDS_PER_DAY;\n writeDismissedUntil(dismissalKey, until);\n setIsOpen(false);\n reset();\n setDismissedUntil(until);\n props.onDismiss?.({ until });\n }, [dismissForDays, dismissalKey, props.onDismiss, reset]);\n\n const open = useCallback(() => {\n setIsOpen(true);\n setStep(\"compose\");\n props.onOpen?.();\n if (props.captureOnOpen !== false) {\n refreshAutomatic();\n }\n }, [props.captureOnOpen, props.onOpen, refreshAutomatic]);\n\n const selectElement = useCallback(\n async (element: Element, note = \"\") => {\n cancelPendingCapture();\n setIsElementCapturing(true);\n const picked: ElementSelection = note\n ? {\n ...buildElementSelection(element),\n comment: note.slice(0, MAX_SELECTION_COMMENT_LENGTH),\n }\n : buildElementSelection(element);\n setStep(\"compose\");\n\n const pick = ++pickRef.current;\n const context = collectPageContext({ sdkVersion: SDK_VERSION });\n const fresh = await captureViewport().catch(() => null);\n\n if (pickRef.current !== pick) {\n releaseCapture(fresh);\n return;\n }\n\n setIsElementCapturing(false);\n if (!fresh) {\n setError(captureFailed);\n return;\n }\n storeScreenshot({\n annotations: [highlightFor(picked, fresh)],\n context,\n id: crypto.randomUUID(),\n image: fresh,\n selectedNode: element,\n selection: picked,\n source: \"manual\",\n });\n },\n [cancelPendingCapture, captureFailed, storeScreenshot]\n );\n\n const selections = gallery.screenshots.flatMap(({ selection }) =>\n selection ? [selection] : []\n );\n const firstElementNote = selections.find(({ comment }) => comment)?.comment;\n const reportedMessage = message.trim() || firstElementNote || \"\";\n const submit = () => {\n if (honeypot) {\n setStep(\"success\");\n return;\n }\n setStep(\"compose\");\n return submission.submit({\n context: {\n ...(activeScreenshot?.context ??\n collectPageContext({ sdkVersion: SDK_VERSION })),\n consoleEvents: consoleRef.current?.events(),\n metadata: props.metadata,\n selections,\n },\n email,\n isAnonymous,\n message: reportedMessage,\n screenshots: gallery.screenshots,\n });\n };\n const requestSubmit = () => {\n const needsEmail =\n isAnonymous && email.length === 0 && !submission.hasPendingAttachments;\n if (needsEmail && !honeypot) {\n setStep(\"email\");\n return;\n }\n return submit();\n };\n\n return {\n activeScreenshot,\n annotateScreenshot: (id: string, trigger: AnnotationTrigger) => {\n setAnnotationTrigger(trigger);\n gallery.selectScreenshot(id);\n setStep(\"annotate\");\n },\n annotations,\n annotationTrigger,\n canDismiss: dismissForDays !== null,\n canSubmit: reportedMessage.length > 0,\n capture,\n close,\n dismiss,\n dismissForDays,\n email,\n error,\n hasPendingAttachments: submission.hasPendingAttachments,\n honeypot,\n isAnonymous,\n isCapturing,\n isDismissed: dismissedUntil > Date.now(),\n isEditingDisabled: submission.isEditingDisabled,\n isOpen,\n isSubmitting: submission.isSubmitting,\n message,\n open,\n pendingCapture: gallery.pendingCapture,\n publicKey,\n removeCapture: gallery.removeCapture,\n requestSubmit,\n retakeCapture: gallery.retakeCapture,\n screenshots: gallery.screenshots,\n selectElement,\n selections,\n setAnnotations: gallery.setAnnotations,\n setEmail,\n setHoneypot,\n setMessage,\n setSelectionComment: gallery.setSelectionComment,\n setStep,\n step,\n submit,\n takeCapture: gallery.takeCapture,\n };\n}\n\nexport type WidgetState = ReturnType<typeof useWidgetState>;\n","import { useEffect, useRef, useState } from \"react\";\nimport type { FeedbackWidgetLabels, RefletFeedbackProps } from \"../../types\";\nimport { CloseIcon, GripIcon } from \"../icons\";\nimport { Launcher } from \"../launcher\";\nimport { FeedbackPanel } from \"../panel\";\nimport { SelectionOutline } from \"../selection-outline\";\nimport { matchesHotkey, type WidgetState } from \"../use-widget-state\";\nimport { listenToKeydown } from \"../widget-events\";\nimport { useFloatingPosition } from \"./use-floating-position\";\n\nexport function FloatingWidget({\n hotkey,\n labels,\n position,\n state,\n}: {\n hotkey: string | null;\n labels: FeedbackWidgetLabels;\n position: RefletFeedbackProps[\"position\"];\n state: WidgetState;\n}) {\n const [minimized, setMinimized] = useState(false);\n const launcherRef = useRef<HTMLButtonElement>(null);\n const showPanel = state.isOpen && !minimized;\n const floating = useFloatingPosition(position, showPanel);\n const minimize = () => {\n setMinimized(true);\n requestAnimationFrame(() => launcherRef.current?.focus());\n };\n\n useEffect(() => {\n if (state.step === \"compose\") {\n state.annotationTrigger?.button.focus({ preventScroll: true });\n }\n }, [state.step, state.annotationTrigger]);\n\n useEffect(() => {\n if (!showPanel || state.step !== \"compose\") {\n return;\n }\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && !event.defaultPrevented) {\n setMinimized(true);\n requestAnimationFrame(() => launcherRef.current?.focus());\n }\n };\n return listenToKeydown(floating.rootRef.current, onKeyDown);\n }, [floating.rootRef, showPanel, state.step]);\n\n const { close, isOpen, open } = state;\n useEffect(() => {\n if (!hotkey) {\n return;\n }\n const toggleOnHotkey = (event: KeyboardEvent) => {\n if (matchesHotkey(event, hotkey)) {\n event.preventDefault();\n if (isOpen) {\n close();\n } else {\n open();\n }\n }\n };\n return listenToKeydown(floating.rootRef.current, toggleOnHotkey, true);\n }, [close, floating.rootRef, hotkey, isOpen, open]);\n\n return (\n <div\n className=\"root\"\n data-editing={\n state.isOpen && (state.step === \"picking\" || state.step === \"annotate\")\n }\n data-moved={Boolean(floating.position)}\n data-position={position}\n ref={floating.rootRef}\n >\n <style>{floating.styles}</style>\n {showPanel &&\n state.step === \"compose\" &&\n state.screenshots.map(({ id, selectedNode }) =>\n selectedNode ? (\n <SelectionOutline key={id} node={selectedNode} />\n ) : null\n )}\n {showPanel ? (\n <FeedbackPanel\n floatingControls={\n <div className=\"floating-controls\">\n <button\n aria-label={labels.moveFeedback}\n className=\"icon-btn drag-handle\"\n title={labels.moveFeedback}\n type=\"button\"\n {...floating.handleProps}\n >\n <GripIcon />\n </button>\n <button\n aria-label={labels.minimize}\n className=\"icon-btn\"\n onClick={minimize}\n title={labels.minimize}\n type=\"button\"\n >\n <CloseIcon />\n </button>\n </div>\n }\n labels={labels}\n state={state}\n />\n ) : (\n <Launcher\n buttonRef={launcherRef}\n isOpen={false}\n label={state.isOpen ? labels.resume : labels.trigger}\n onClick={() => {\n setMinimized(false);\n if (!state.isOpen) {\n state.open();\n }\n }}\n />\n )}\n </div>\n );\n}\n","import { REFLET_Z_INDEX } from \"../../../z-index\";\n\nexport const ANNOTATOR_STYLES = `\n.overlay { margin: 0; border: 0; padding: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; position: fixed; inset: 0; z-index: ${REFLET_Z_INDEX.annotatorOverlay}; display: flex; flex-direction: column; background: transparent; color: var(--rf-text); font: 13px/1.45 ui-sans-serif, system-ui, sans-serif; }\n.overlay::before { content: \"\"; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: color-mix(in srgb, var(--rf-bg) 94%, transparent); animation: rf-editor-in 260ms var(--rf-ease); transition: opacity 260ms var(--rf-ease); }\n.overlay::backdrop { background: transparent; }\n@keyframes rf-editor-in { from { opacity: 0; } }\n.editor { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 20px; min-height: 0; container-type: size; }\n.editor-image { width: min(100cqw, calc(100cqh * var(--rf-capture-ratio))); aspect-ratio: var(--rf-capture-ratio); flex: none; position: relative; }\n.editor-visual { position: absolute; inset: 0; border-radius: var(--rf-radius); box-shadow: var(--rf-shadow); transform-origin: top left; overflow: hidden; }\n.editor-visual img, .editor-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; object-position: top center; outline: 1px solid var(--rf-hairline); outline-offset: -1px; }\n.editor-visual canvas { cursor: crosshair; touch-action: none; }\n.overlay[data-opening=\"true\"] .editor { pointer-events: none; }\n.overlay[data-closing=\"true\"] { pointer-events: none; }\n.overlay[data-closing=\"true\"]::before { opacity: 0; }\n.overlay[data-closing=\"true\"] .toolbar, .overlay[data-closing=\"true\"] .element-note { opacity: 0; transform: translateY(8px); }\n\n.element-note { order: 1; display: flex; align-items: flex-start; gap: 10px; width: min(560px, calc(100vw - 32px)); margin: 0 auto 10px; padding: 10px 14px; border-radius: var(--rf-radius); transition: opacity 180ms var(--rf-ease), transform 180ms var(--rf-ease); }\n.element-note svg { flex: none; margin-top: 4px; opacity: 0.7; }\n.element-note textarea { flex: 1; min-width: 0; height: 42px; max-height: 96px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; resize: none; }\n.element-note textarea:focus { outline: none; }\n.element-note:focus-within { outline: 2px solid var(--rf-accent); outline-offset: 2px; }\n\n.toolbar { order: 2; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; transition: opacity 180ms var(--rf-ease), transform 180ms var(--rf-ease); padding: 4px 12px max(16px, env(safe-area-inset-bottom)); }\n.toolbar .group { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: var(--rf-pill); }\n.tool[aria-pressed=\"true\"], .tool[data-selected=\"true\"] { background: var(--rf-primary); color: var(--rf-primary-text); }\n.color-picker { position: relative; }\n.color-picker summary { display: flex; justify-content: center; align-items: center; }\n.color-preview { width: 18px; height: 18px; border-radius: 50%; background: var(--annotation-color); box-shadow: inset 0 0 0 1px var(--rf-border); }\n.color-popover { --rf-color-width: 200px; position: absolute; bottom: calc(100% + 14px); left: clamp(calc(12px - var(--rf-color-anchor)), 0px, calc(100vw - var(--rf-color-anchor) - var(--rf-color-width) - 12px)); display: flex; align-items: center; gap: 6px; width: var(--rf-color-width); padding: 4px 4px 4px 14px; border-radius: var(--rf-pill); animation: rf-in 180ms var(--rf-ease); }\n.color-picker[data-placement=\"below\"] .color-popover { top: calc(100% + 14px); bottom: auto; }\n.color-slider { flex: 1; min-width: 0; }\n.color-slider-control { display: flex; align-items: center; height: 40px; width: 100%; touch-action: none; user-select: none; cursor: pointer; }\n.color-slider-track { height: 12px; width: 100%; border-radius: var(--rf-pill); background: linear-gradient(to right, var(--rf-swatch-base), var(--annotation-base-color)); box-shadow: inset 0 0 0 1px var(--rf-border); }\n.color-slider-thumb { width: 16px; height: 16px; border: 2px solid var(--rf-swatch-base); border-radius: 50%; background: var(--annotation-color); box-shadow: var(--rf-shadow-low); transition: scale 160ms var(--rf-ease); }\n.color-slider-thumb[data-dragging] { scale: 1.12; }\n.color-slider-thumb:has(:focus-visible) { outline: 2px solid var(--rf-accent); outline-offset: 3px; }\n.color-spectrum { position: relative; display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }\n.color-spectrum::before { content: \"\"; width: 16px; height: 16px; border-radius: 50%; background: var(--rf-spectrum); box-shadow: inset 0 0 0 1px var(--rf-glass-highlight); }\n.color-spectrum:hover { background: var(--rf-bg-hover); }\n.color-spectrum button { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; }\n.color-spectrum button:focus-visible { outline: 2px solid var(--rf-accent); outline-offset: 3px; }\n.color-spectrum input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }\n.done-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: var(--rf-pill); color: var(--rf-primary-text); background: var(--rf-primary); }\n.drawing-menu { position: relative; }\n.drawing-popover { position: absolute; z-index: 2; right: 0; bottom: calc(100% + 12px); width: 200px; max-height: calc(50dvh - 68px); overflow-y: auto; padding: 6px; border-radius: var(--rf-radius); }\n.drawing-menu[data-placement=\"below\"] .drawing-popover { top: calc(100% + 12px); bottom: auto; }\n.drawing-option { display: flex; align-items: center; width: 100%; min-height: 40px; gap: 10px; padding: 0 10px; border-radius: 12px; text-align: left; }\n.drawing-option:hover, .drawing-option[aria-pressed=\"true\"] { background: var(--rf-bg-hover); }\n.drawing-divider { height: 1px; margin: 5px; background: var(--rf-border); }\n.editor canvas[data-tool=\"text\"] { cursor: text; }\n.text-annotation-editor { position: fixed; z-index: 3; width: 240px; padding: 8px; border-radius: var(--rf-radius); }\n.text-annotation-editor:focus-within { outline: 2px solid var(--rf-accent); outline-offset: 2px; }\n.text-annotation-editor textarea { display: block; width: 100%; min-height: 64px; max-height: 112px; padding: 6px; border: 0; background: transparent; resize: vertical; font-size: 16px; line-height: 24px; }\n.text-annotation-editor textarea:focus { outline: none; }\n.text-annotation-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }\n@media (pointer: coarse) {\n .drawing-option { min-height: 44px; }\n .done-btn { width: 44px; height: 44px; }\n .color-popover { --rf-color-width: 232px; padding-left: 16px; }\n .color-slider-control, .color-spectrum { height: 44px; }\n .color-spectrum { width: 44px; }\n .color-slider-thumb, .color-spectrum::before { width: 18px; height: 18px; }\n .editor { padding: 8px; }\n .toolbar { gap: 6px; }\n .toolbar .group { padding: 3px; gap: 0; }\n}\n@media (pointer: coarse) and (max-width: 360px) {\n .toolbar { gap: 4px; padding-inline: 2px; }\n .toolbar .group { padding: 0; }\n}\n`;\n","export const COMPOSER_STYLES = `\n.panel { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; outline: none; animation: rf-in 240ms var(--rf-ease); }\n.success-panel { border-radius: var(--rf-radius); }\n.composer { position: relative; display: flex; flex-direction: column; gap: 8px; }\n.message-row { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 26px; }\n.message-row textarea {\n width: 100%; height: 76px; max-height: min(140px, 30dvh);\n margin: 0; padding: 6px 6px 0 8px; border: 0; resize: none;\n background: transparent; line-height: 20px;\n}\n.message-actions { display: flex; align-items: center; gap: 2px; }\n.message-row textarea::placeholder { color: var(--rf-text-muted); }\n.message-row textarea:focus { outline: none; }\n.message-row:has(textarea:focus-visible) { border-color: color-mix(in srgb, var(--rf-accent) 40%, var(--rf-glass-stroke)); }\n.submit { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: var(--rf-pill); background: var(--rf-primary); color: var(--rf-primary-text); transition: opacity 160ms var(--rf-ease), transform 160ms var(--rf-ease); }\n.submit svg { transform: rotate(-45deg); }\n.submit:hover:enabled { transform: scale(1.05); }\n.submit:disabled { background: var(--rf-bg-hover); color: var(--rf-text-muted); opacity: .65; }\n.composer-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }\n.composer-options { position: relative; }\nsummary { cursor: pointer; list-style: none; }\nsummary::-webkit-details-marker { display: none; }\n.options-popover { position: absolute; z-index: 2; right: 0; bottom: calc(100% + 12px); width: min(240px, calc(100vw - 40px)); max-height: calc(50dvh - 68px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--rf-radius); animation: rf-in 160ms var(--rf-ease); }\n.composer-options[data-placement=\"below\"] .options-popover { top: calc(100% + 12px); bottom: auto; }\n.email-field { display: flex; flex-direction: column; gap: 6px; color: var(--rf-text-muted); font-size: 12px; }\n.email-field [role=\"alert\"] { color: var(--rf-danger); }\n.email-field input { width: 100%; padding: 9px; border: 1px solid var(--rf-border); border-radius: var(--rf-radius-sm); background: var(--rf-bg-subtle); color: var(--rf-text); }\n.dismiss-btn { min-height: 40px; text-align: left; padding: 0 8px; border-radius: var(--rf-radius-sm); color: var(--rf-text-muted); }\n.dismiss-btn:hover { background: var(--rf-bg-hover); }\n.version-info { font-size: 10px; color: var(--rf-text-muted); padding: 4px 8px 0; border-top: 1px solid var(--rf-border); text-decoration: none; }\n.version-info:hover { color: var(--rf-text); }\n.email-scrim { display: none; }\n.email-prompt { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 22px; animation: rf-in 240ms var(--rf-ease); }\n.email-prompt h2 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; }\n.email-prompt p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--rf-text-muted); }\n.email-prompt .email-field input { min-height: 40px; border-radius: 14px; padding: 0 12px; }\n.email-prompt-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }\n.email-prompt-actions .ghost-btn { padding: 0 12px; color: var(--rf-text-muted); }\n.primary-btn { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: var(--rf-pill); background: var(--rf-primary); color: var(--rf-primary-text); font-weight: 500; }\n.primary-btn:hover { opacity: .9; }\n.attachments { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }\n.attachment-row { display: flex; align-items: flex-end; gap: 8px; min-width: 0; max-width: 100%; }\n.screenshot-scroll-area { position: relative; min-width: 0; margin: -14px -10px -20px; }\n.screenshot-strip { width: 100%; padding: 14px 10px 20px; overscroll-behavior-x: contain; --rf-fade-start: 0px; --rf-fade-end: 0px; mask-image: linear-gradient(to right, transparent, black var(--rf-fade-start), black calc(100% - var(--rf-fade-end)), transparent); mask-repeat: no-repeat; }\n.screenshot-strip[data-overflow-x-start] { --rf-fade-start: calc(10px + min(24px, var(--scroll-area-overflow-x-start))); }\n.screenshot-strip[data-overflow-x-end] { --rf-fade-end: calc(10px + min(24px, var(--scroll-area-overflow-x-end))); }\n.screenshot-strip-content { display: flex; align-items: flex-end; gap: 8px; }\n.screenshot-scroll-area:has(.screenshot-strip-content:empty) { display: none; }\n.capture-slot { display: flex; flex-direction: column; gap: 2px; flex: none; width: 56px; height: var(--rf-attachment-height); padding: 3px; border: 1px dashed var(--rf-border); border-radius: var(--rf-radius); box-shadow: none; }\n.capture-action { display: flex; flex: 1; min-height: 0; align-items: center; justify-content: center; border-radius: 5px; color: var(--rf-text-muted); transition: background 160ms var(--rf-ease), color 160ms var(--rf-ease); }\n.capture-action:first-child { border-radius: 16px 16px 5px 5px; }\n.capture-action:last-child { border-radius: 5px 5px 16px 16px; }\n.capture-action:hover:enabled { background: var(--rf-bg-hover); color: var(--rf-text); }\n.screenshot-scrollbar { height: 4px; margin: 0 8px 2px; opacity: 0; transition: opacity 150ms var(--rf-ease); }\n.screenshot-scrollbar[data-hovering], .screenshot-scrollbar[data-scrolling] { opacity: 1; }\n.screenshot-scroll-thumb { border-radius: var(--rf-pill); background: var(--rf-border); }\n.capture-progress { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; border-radius: inherit; color: var(--rf-text-muted); font-size: 10px; }\n.attachments:empty { display: none; }\n.screenshot-attachment, .attachment-skeleton { position: relative; flex: none; margin: 0; min-width: 0; width: 128px; height: var(--rf-attachment-height); padding: 0; border-radius: 16px; animation: rf-in 260ms var(--rf-ease); }\n.screenshot-attachment { border: 0; }\n.screenshot-preview { display: block; position: relative; width: 100%; height: 100%; padding: 0; border-radius: inherit; overflow: hidden; }\n.screenshot-preview img, .screenshot-preview canvas { width: 100%; height: 100%; display: block; object-fit: cover; object-position: top center; }\n.screenshot-preview canvas { position: absolute; inset: 0; pointer-events: none; }\n.annotation-count { position: absolute; left: 5px; bottom: 5px; min-width: 20px; padding: 2px 6px; border-radius: var(--rf-pill); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; color: var(--rf-text); }\n.attachment-actions { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 1px; padding: 1px; border-radius: var(--rf-pill); }\n.attachment-actions .icon-btn { width: 28px; height: 28px; }\n.attachment-actions svg { width: 14px; height: 14px; }\n.attachment-skeleton { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--rf-text-muted); font-size: 11px; }\n.attachment-skeleton::after { content: \"\"; position: absolute; inset: 0; border-radius: inherit; background: var(--rf-bg-subtle); animation: rf-fade 800ms alternate infinite; }\n.selection-badge { position: absolute; left: 5px; top: 5px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--rf-pill); color: var(--rf-accent); }\n.selection-badge svg { width: 12px; height: 12px; }\n@media (pointer: coarse) {\n .message-row { border-radius: 28px; }\n .capture-slot { width: 64px; }\n .message-row textarea { font-size: 16px; }\n .submit { width: 44px; height: 44px; }\n :host { --rf-attachment-height: 96px; }\n .attachment-actions { right: 5px; bottom: 5px; }\n .attachment-actions .icon-btn { width: 34px; height: 34px; }\n .selection-badge { width: 24px; height: 24px; }\n .email-field input { font-size: 16px; }\n .dismiss-btn { min-height: 44px; }\n}\n@media (max-width: 480px) {\n .email-scrim { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / 40%); animation: rf-fade 200ms var(--rf-ease); }\n .email-prompt { position: fixed; left: 0; right: 0; bottom: 0; gap: 14px; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; animation: rf-drawer-in 280ms var(--rf-ease); }\n .email-prompt h2 { font-size: 17px; }\n .email-prompt p { font-size: 13px; }\n .email-prompt-actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; }\n .email-prompt-actions .ghost-btn, .email-prompt-actions .primary-btn { justify-content: center; min-height: 48px; }\n}\n@keyframes rf-drawer-in { from { transform: translateY(100%); } }\n`;\n","import { REFLET_Z_INDEX } from \"../../../z-index\";\n\nexport const PICKER_STYLES = `\n.picker-box {\n position: fixed;\n top: 0;\n left: 0;\n pointer-events: none;\n border-radius: 5px;\n background: color-mix(in srgb, var(--rf-accent) 10%, transparent);\n box-shadow: 0 0 0 2px var(--rf-accent), 0 0 0 5px color-mix(in srgb, var(--rf-accent) 18%, transparent);\n will-change: translate;\n transition: translate 130ms var(--rf-ease);\n}\n.picker-box[data-pinned=\"true\"] { transition: none; }\n.picker-label {\n position: fixed;\n top: 0;\n left: 0;\n pointer-events: none;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n max-width: min(420px, 90vw);\n height: 24px;\n padding: 0 8px;\n font-size: 11.5px;\n font-weight: 500;\n color: var(--rf-accent-text);\n background: var(--rf-accent);\n border-radius: 6px;\n box-shadow: var(--rf-shadow-float);\n white-space: nowrap;\n overflow: hidden;\n will-change: translate;\n transition: translate 130ms var(--rf-ease);\n}\n.picker-label strong { flex: none; font-weight: 600; }\n.picker-label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; opacity: 0.75; }\n.selection-outline {\n position: fixed;\n top: 0;\n left: 0;\n pointer-events: none;\n border-radius: 5px;\n background: color-mix(in srgb, var(--rf-accent) 7%, transparent);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--rf-accent) 70%, transparent), 0 0 0 5px color-mix(in srgb, var(--rf-accent) 14%, transparent);\n transition: opacity 160ms var(--rf-ease);\n}\n.picker-hint {\n position: fixed;\n left: 50%;\n bottom: calc(24px + env(safe-area-inset-bottom));\n transform: translateX(-50%);\n display: flex;\n align-items: center;\n gap: 6px;\n max-width: calc(100vw - 24px);\n padding: 5px 6px 5px 12px;\n font-size: 12.5px;\n color: var(--rf-text);\n background: var(--rf-bg);\n border-radius: var(--rf-pill);\n box-shadow: var(--rf-ring), var(--rf-shadow);\n animation: rf-fade 240ms var(--rf-ease);\n}\n.picker-instruction { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.picker-hint kbd {\n padding: 1px 5px;\n font: inherit;\n font-size: 11px;\n color: var(--rf-text-muted);\n border-radius: 4px;\n background: var(--rf-bg-subtle);\n box-shadow: var(--rf-shadow-inset);\n}\n.picker-cancel {\n display: inline-flex;\n align-items: center;\n height: 40px;\n padding: 0 14px;\n border-radius: var(--rf-pill);\n font-size: 12.5px;\n font-weight: 500;\n white-space: nowrap;\n color: var(--rf-text-muted);\n}\n.picker-cancel:hover { background: var(--rf-bg-hover); color: var(--rf-text); }\n.picker-note {\n position: fixed;\n z-index: ${REFLET_Z_INDEX.annotatorOverlay};\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: 300px;\n max-width: calc(100vw - 24px);\n padding: 6px 6px 6px 8px;\n border-radius: 18px;\n animation: rf-in 180ms var(--rf-ease);\n}\n.picker-note:focus-within { outline: 2px solid var(--rf-accent); outline-offset: 2px; }\n.picker-note-target {\n display: flex;\n align-items: center;\n gap: 6px;\n margin: 0;\n padding: 2px 4px 0;\n font-size: 11px;\n color: var(--rf-text-muted);\n white-space: nowrap;\n}\n.picker-note-target strong { flex: none; font-weight: 600; color: var(--rf-accent); }\n.picker-note-target span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }\n.picker-note textarea {\n width: 100%;\n min-height: 46px;\n max-height: min(160px, 30dvh);\n margin: 0;\n padding: 7px 6px 0;\n border: 0;\n resize: none;\n background: transparent;\n color: var(--rf-text);\n font-size: 13px;\n line-height: 19px;\n}\n.picker-note textarea:focus { outline: none; }\n.picker-note textarea::placeholder { color: var(--rf-text-muted); }\n.picker-note-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }\n@media (pointer: coarse) {\n .picker-hint { padding: 6px 8px 6px 14px; }\n .picker-hint kbd { display: none; }\n .picker-cancel { height: 44px; padding: 0 18px; font-size: 14px; }\n .picker-note textarea { font-size: 16px; min-height: 56px; }\n}\n\n`;\n","import { REFLET_Z_INDEX } from \"../../z-index\";\nimport { DEFAULT_WIDGET_OFFSET } from \"../types\";\nimport { ANNOTATOR_STYLES } from \"./annotation/styles\";\nimport { COMPOSER_STYLES } from \"./composer/styles\";\nimport { PICKER_STYLES } from \"./floating/picker-styles\";\n\nexport const WIDGET_STYLES = `\n:host {\n pointer-events: auto;\n --rf-offset: ${DEFAULT_WIDGET_OFFSET}px;\n --rf-bg: #ffffff;\n --rf-bg-subtle: rgb(55 53 47 / 4%);\n --rf-bg-hover: rgb(55 53 47 / 7%);\n --rf-border: rgb(55 53 47 / 9%);\n --rf-hairline: rgb(15 15 15 / 10%);\n --rf-text: #37352f;\n --rf-text-muted: rgb(55 53 47 / 68%);\n --rf-primary: #37352f;\n --rf-primary-text: #ffffff;\n --rf-accent: #2383e2;\n --rf-accent-text: #ffffff;\n --rf-danger: #d44c47;\n --rf-success: #448361;\n --rf-swatch-base: #ffffff;\n --rf-spectrum: conic-gradient(#ff5757, #ffde59, #6bdb78, #4ac9fa, #8b5cf6, #ef73dc, #ff5757);\n --rf-radius: 20px;\n --rf-pill: 999px;\n --rf-attachment-height: 78px;\n --rf-width: 360px;\n --rf-glass: rgb(255 255 255 / 72%);\n --rf-glass-highlight: rgb(255 255 255 / 90%);\n --rf-glass-stroke: rgb(255 255 255 / 70%);\n --rf-radius-sm: 8px;\n --rf-shadow-inset: inset 0 0 0 1px var(--rf-border);\n --rf-ring: 0 0 0 1px rgb(15 15 15 / 4%);\n --rf-shadow-low: 0 1px 2px rgb(15 15 15 / 6%), 0 4px 10px -4px rgb(15 15 15 / 10%);\n --rf-shadow: 0 2px 5px -1px rgb(15 15 15 / 7%), 0 12px 32px -8px rgb(15 15 15 / 16%);\n --rf-shadow-float: 0 4px 12px -3px rgb(15 15 15 / 35%);\n --rf-ease: cubic-bezier(0.16, 1, 0.3, 1);\n color-scheme: light;\n all: initial;\n font-family: var(--rf-font, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif);\n}\n\n:host([data-theme=\"dark\"]) {\n --rf-bg: #202020;\n --rf-bg-subtle: rgb(255 255 255 / 5%);\n --rf-bg-hover: rgb(255 255 255 / 9%);\n --rf-border: rgb(255 255 255 / 9%);\n --rf-hairline: rgb(255 255 255 / 12%);\n --rf-text: #ebeae8;\n --rf-text-muted: rgb(255 255 255 / 68%);\n --rf-glass: rgb(32 32 32 / 78%);\n --rf-glass-highlight: rgb(255 255 255 / 14%);\n --rf-glass-stroke: rgb(255 255 255 / 12%);\n --rf-primary: #f1efec;\n --rf-primary-text: #1c1c1b;\n --rf-accent: #529cca;\n --rf-danger: #eb5757;\n --rf-success: #4dab74;\n --rf-ring: 0 0 0 1px rgb(255 255 255 / 7%);\n --rf-shadow-low: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 10px -4px rgb(0 0 0 / 40%);\n --rf-shadow: 0 2px 5px -1px rgb(0 0 0 / 35%), 0 14px 36px -10px rgb(0 0 0 / 55%);\n --rf-shadow-float: 0 4px 14px -3px rgb(0 0 0 / 55%);\n color-scheme: dark;\n}\n\n*, *::before, *::after { box-sizing: border-box; }\n\n\n.root {\n position: fixed;\n z-index: ${REFLET_Z_INDEX.widgetRoot};\n display: flex;\n align-items: flex-end;\n gap: 8px;\n font: 13px/1.45 var(--rf-font, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif);\n color: var(--rf-text);\n}\n.root:has(.panel) { width: min(var(--rf-width), calc(var(--rf-viewport-width, 100vw) - 24px)); }\n.root[data-position$=\"right\"] { right: calc(var(--rf-viewport-right, 0px) + max(12px, min(var(--rf-offset), calc((var(--rf-viewport-width, 100vw) - var(--rf-width)) / 2)))); }\n.root[data-position$=\"left\"] { left: calc(var(--rf-viewport-left, 0px) + max(12px, min(var(--rf-offset), calc((var(--rf-viewport-width, 100vw) - var(--rf-width)) / 2)))); }\n.root[data-position^=\"bottom\"] { bottom: calc(var(--rf-viewport-bottom, 0px) + max(var(--rf-offset), env(safe-area-inset-bottom))); }\n.root[data-position^=\"top\"] { top: calc(var(--rf-viewport-top, 0px) + max(var(--rf-offset), env(safe-area-inset-top))); align-items: flex-start; }\n.root[data-position=\"bottom-right\"] .panel { transform-origin: bottom right; }\n.root[data-position=\"bottom-left\"] .panel { transform-origin: bottom left; }\n.root[data-position^=\"top\"] .panel { transform-origin: top center; }\n.root[data-editing=\"true\"] { visibility: hidden; pointer-events: none; }\nbutton, select, input, textarea { font: inherit; color: inherit; }\nbutton { margin: 0; cursor: pointer; border: 0; background: none; transition: scale 120ms var(--rf-ease); }\nbutton:disabled { cursor: not-allowed; opacity: .4; }\nbutton:active:not(:disabled) { scale: .97; }\nsvg { flex-shrink: 0; }\n:focus-visible { outline: 2px solid var(--rf-accent); outline-offset: 3px; }\n.icon-btn, .tool {\n display: inline-flex; align-items: center; justify-content: center;\n width: 40px; height: 40px; flex: none; border-radius: var(--rf-pill); color: var(--rf-text-muted);\n transition: background 160ms var(--rf-ease), color 160ms var(--rf-ease), scale 120ms var(--rf-ease);\n}\n.icon-btn:hover, .tool:hover { background: var(--rf-bg-hover); color: var(--rf-text); }\n.launcher {\n display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px;\n border-radius: var(--rf-pill); color: var(--rf-text);\n font-weight: 500;\n transition: transform 200ms var(--rf-ease), box-shadow 200ms var(--rf-ease), scale 120ms var(--rf-ease);\n}\n.launcher:hover { transform: translateY(-2px); box-shadow: var(--rf-shadow); }\n.launcher-icon { display: flex; width: 15px; height: 15px; }\n.launcher-icon .on-close { display: none; }\n.floating-controls {\n display: flex; align-items: center; flex: none;\n margin-right: auto; padding-left: 3px;\n animation: rf-in 220ms var(--rf-ease);\n}\n.drag-handle { touch-action: none; cursor: grab; }\n.drag-handle:active { cursor: grabbing; }\n.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ghost-btn { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px; border-radius: var(--rf-radius-sm); }\n.ghost-btn:hover { background: var(--rf-bg-hover); }\n.error { margin: 0; padding: 10px 14px; border-radius: var(--rf-radius); font-size: 12px; color: var(--rf-danger); }\n.done { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; text-align: center; }\n.done svg { color: var(--rf-success); }\n.done h2 { margin: 0; font-size: 14px; font-weight: 600; }\n.done p { margin: 0; font-size: 12px; color: var(--rf-text-muted); }\n.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rf-spin 700ms linear infinite; }\n.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n@keyframes rf-spin { to { transform: rotate(360deg); } }\n@keyframes rf-in { from { opacity: 0; transform: translateY(5px) scale(.98); } }\n@keyframes rf-fade { from { opacity: 0; } }\n@media (pointer: coarse) {\n .icon-btn, .tool { width: 44px; height: 44px; }\n .launcher, .ghost-btn { min-height: 44px; }\n}\n.glass {\n position: relative;\n isolation: isolate;\n border: 1px solid var(--rf-glass-stroke);\n box-shadow: inset 0 1px 0 var(--rf-glass-highlight), var(--rf-shadow);\n}\n.glass::before {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: -1;\n border-radius: inherit;\n background: var(--rf-bg);\n pointer-events: none;\n}\n@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {\n .glass::before {\n background: var(--rf-glass);\n -webkit-backdrop-filter: blur(20px) saturate(1.6);\n backdrop-filter: blur(20px) saturate(1.6);\n }\n}\n@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {\n .glass::before { background: var(--rf-bg); backdrop-filter: none; -webkit-backdrop-filter: none; }\n}\n.capture-halo { position: fixed; inset: 0; z-index: ${REFLET_Z_INDEX.captureHalo}; pointer-events: none; opacity: 0; transition: opacity 500ms var(--rf-ease); }\n.capture-halo[data-active=\"true\"] { opacity: 1; transition-duration: 140ms; }\n.capture-halo::before { content: \"\"; position: absolute; inset: 0; border-radius: 20px; box-shadow: inset 14px 0 36px -16px var(--rf-accent), inset -14px 0 36px -16px var(--rf-accent), inset 0 0 4px 1px color-mix(in srgb, var(--rf-accent) 35%, transparent); }\n.capture-halo::after { content: \"\"; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--rf-accent) 20%, transparent), transparent 5%, transparent 95%, color-mix(in srgb, var(--rf-accent) 20%, transparent)); }\n${COMPOSER_STYLES}\n${ANNOTATOR_STYLES}\n${PICKER_STYLES}\n@media (prefers-reduced-motion: reduce) {\n *, *::before, *::after { animation: none !important; transition: none !important; }\n button:active:not(:disabled) { scale: 1; }\n}\n`;\n","import { type ReactNode, useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { WIDGET_MARKER } from \"../core/capture\";\nimport { WIDGET_STYLES } from \"./styles\";\nimport { stopClicksAtHost } from \"./widget-events\";\n\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nexport type WidgetTheme = \"auto\" | \"dark\" | \"light\";\n\nfunction useResolvedTheme(theme: WidgetTheme): \"dark\" | \"light\" {\n const [systemDark, setSystemDark] = useState(false);\n\n useEffect(() => {\n if (theme !== \"auto\" || typeof window.matchMedia !== \"function\") {\n return;\n }\n\n const query = window.matchMedia(DARK_QUERY);\n setSystemDark(query.matches);\n\n const onChange = (event: MediaQueryListEvent) =>\n setSystemDark(event.matches);\n query.addEventListener(\"change\", onChange);\n return () => query.removeEventListener(\"change\", onChange);\n }, [theme]);\n\n if (theme === \"auto\") {\n return systemDark ? \"dark\" : \"light\";\n }\n return theme;\n}\n\n/**\n * Hosts the widget in a shadow root: the app's CSS cannot reach the panel and\n * the panel's CSS cannot reach the app. Direct DOM work is unavoidable here —\n * React has no declarative way to create a shadow root.\n */\nexport function ShadowPortal({\n children,\n offset,\n primaryColor,\n theme,\n}: {\n children: ReactNode;\n offset: number;\n primaryColor?: string;\n theme: WidgetTheme;\n}) {\n const [shadowRoot, setShadowRoot] = useState<ShadowRoot | null>(null);\n const resolvedTheme = useResolvedTheme(theme);\n\n useEffect(() => {\n const host = document.createElement(\"div\");\n host.setAttribute(WIDGET_MARKER, \"\");\n stopClicksAtHost(host);\n const root = host.attachShadow({ mode: \"open\" });\n\n const style = document.createElement(\"style\");\n style.textContent = WIDGET_STYLES;\n root.append(style);\n document.body.append(host);\n setShadowRoot(root);\n\n return () => host.remove();\n }, []);\n\n useEffect(() => {\n const host = shadowRoot?.host;\n if (!(host instanceof HTMLElement)) {\n return;\n }\n\n host.setAttribute(\"data-theme\", resolvedTheme);\n host.style.setProperty(\"--rf-offset\", `${offset}px`);\n if (primaryColor) {\n host.style.setProperty(\"--rf-primary\", primaryColor);\n }\n }, [shadowRoot, resolvedTheme, primaryColor, offset]);\n\n if (!shadowRoot) {\n return null;\n }\n\n return createPortal(children, shadowRoot);\n}\n","import { lazy, Suspense } from \"react\";\nimport {\n DEFAULT_WIDGET_LABELS,\n DEFAULT_WIDGET_OFFSET,\n type FeedbackWidgetLabels,\n type RefletFeedbackProps,\n} from \"./types\";\nimport { Annotator } from \"./ui/annotator\";\nimport { useOwnsDevtools } from \"./ui/devtools-owner\";\nimport { FloatingWidget } from \"./ui/floating/floating-widget\";\nimport { ElementPicker } from \"./ui/picker\";\nimport { ShadowPortal } from \"./ui/shadow-portal\";\nimport { useWidgetState, type WidgetState } from \"./ui/use-widget-state\";\n\n// Bundlers inline NODE_ENV, so production builds drop the branch and never ship the devtools chunk.\n// No `typeof process` guard: Vite replaces only this exact expression and has no `process` in the browser.\nconst DevtoolsLayer =\n process.env.NODE_ENV === \"development\"\n ? lazy(() =>\n import(\"../devtools/client/devtools-layer\").then((module) => ({\n default: module.DevtoolsLayer,\n }))\n )\n : null;\n\nexport function RefletFeedback(props: RefletFeedbackProps) {\n const {\n devtools = true,\n enabled = true,\n hotkey = null,\n offset = DEFAULT_WIDGET_OFFSET,\n position = \"bottom-right\",\n theme = \"auto\",\n } = props;\n\n const labels = { ...DEFAULT_WIDGET_LABELS, ...props.labels };\n const state = useWidgetState(props);\n const { isOpen } = state;\n const showsWidget = enabled && !state.isDismissed;\n const ownsDevtools = useOwnsDevtools(\n devtools && DevtoolsLayer !== null,\n showsWidget\n );\n const showsDevtools = ownsDevtools && DevtoolsLayer !== null;\n\n if (!(showsWidget || showsDevtools)) {\n return null;\n }\n\n return (\n <ShadowPortal\n offset={offset}\n primaryColor={props.primaryColor}\n theme={theme}\n >\n {showsWidget && (\n <>\n <div\n aria-hidden=\"true\"\n className=\"capture-halo\"\n data-active={state.isCapturing}\n />\n <FloatingWidget\n hotkey={hotkey}\n labels={labels}\n position={position}\n state={state}\n />\n\n <WidgetAnnotation labels={labels} state={state} />\n\n {isOpen && state.step === \"picking\" && (\n <ElementPicker\n labels={labels}\n onCancel={() => state.setStep(\"compose\")}\n onPick={state.selectElement}\n />\n )}\n </>\n )}\n {showsDevtools && (\n <Suspense fallback={null}>\n <DevtoolsLayer\n isWidgetOpen={showsWidget && isOpen}\n position={position}\n publicKey={state.publicKey}\n />\n </Suspense>\n )}\n </ShadowPortal>\n );\n}\n\nfunction WidgetAnnotation({\n labels,\n state,\n}: {\n labels: FeedbackWidgetLabels;\n state: WidgetState;\n}) {\n const screenshot = state.activeScreenshot;\n const annotating =\n state.isOpen && state.step === \"annotate\" && screenshot !== null;\n if (!(annotating && screenshot)) {\n return null;\n }\n const retake = () => {\n state.setStep(\"compose\");\n state.retakeCapture(screenshot.id);\n };\n return (\n <Annotator\n capture={screenshot.image}\n editor={{\n annotations: state.annotations,\n onChange: state.setAnnotations,\n onDone: () => state.setStep(\"compose\"),\n onRetake: screenshot.selection ? undefined : retake,\n trigger: state.annotationTrigger?.thumbnail,\n }}\n labels={labels}\n note={\n screenshot.selection && {\n comment: screenshot.selection.comment ?? \"\",\n onChange: (comment) =>\n state.setSelectionComment(screenshot.id, comment),\n }\n }\n />\n );\n}\n"],"mappings":";;;;;;;;;;AAKA,MAAa,2BAA4C;CACvD,WAAW;CACX,iBAAiB;AACnB;AAEA,SAAgB,mBAAmB,EACjC,WACA,mBAC0B;CAO1B,OAAO,IANU;EAAC;EAAG;EAAG;CAAC,CAAC,CAAC,KAAK,WAAW;EACzC,MAAM,UAAU,OAAO,SAAS,UAAU,MAAM,QAAQ,SAAS,CAAC,GAAG,EAAE;EACvE,OAAO,KAAK,MAAM,OAAQ,UAAU,OAAO,kBAAmB,GAAG,CAAC,CAC/D,SAAS,EAAE,CAAC,CACZ,SAAS,GAAG,GAAG;CACpB,CACkB,CAAC,CAAC,KAAK,EAAE;AAC7B;;;ACXA,SAAgB,qBAAqB,EACnC,OACA,UACA,YAKC;CACD,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM,WAAW,QAAQ,EAAE;CAC5D,MAAM,WAAW,OAA4B,IAAI;CACjD,MAAM,KAAK,MAAM,CAAC,CAAC,WAAW,KAAK,EAAE;CACrC,gBAAgB;EACd,SAAS,SAAS,MAAM;CAC1B,GAAG,CAAC,CAAC;CACL,OACE,qBAAC,QAAD;EACE,WAAU;EACN;EACJ,WAAW,UAAU;GACnB,MAAM,eAAe;GACrB,SAAS,IAAI;EACf;EANF,UAAA;GAQE,oBAAC,SAAD,EAAA,UAAQ,QAAQ,GAAG,yBAAyB,MAAM,SAAS,EAAE,6CAA6C,MAAM,SAAS,EAAE,8BAAqC,CAAA;GAChK,oBAAC,YAAD;IACE,cAAW;IACX,WAAW;IACX,SAAS,UAAU;KACjB,IAAI,CAAC,MAAM,cAAc,MAA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