{
  "version": 3,
  "sources": ["../../../../src/lib/tools/selection-logic/updateHoveredOverlayId.ts"],
  "sourcesContent": ["import { Editor } from '@tldraw/editor'\n\n/**\n * Update the hovered overlay id. This should be called BEFORE updateHoveredShapeId\n * so that overlays take priority over shapes for hover state.\n *\n * @returns true if an overlay is hovered (meaning shape hover should be skipped)\n * @internal\n */\nexport function updateHoveredOverlayId(editor: Editor): boolean {\n\tif (editor.isDisposed) return false\n\n\tconst currentPagePoint = editor.inputs.getCurrentPagePoint()\n\tconst margin = editor.options.hitTestMargin / editor.getZoomLevel()\n\tconst overlay = editor.overlays.getOverlayAtPoint(currentPagePoint, margin)\n\n\tconst previousOverlayId = editor.overlays.getHoveredOverlayId()\n\n\tif (overlay) {\n\t\teditor.overlays.setHoveredOverlay(overlay.id)\n\t\t// Clear shape hover when over an overlay\n\t\teditor.setHoveredShape(null)\n\n\t\t// Update cursor based on the hovered overlay\n\t\tconst util = editor.overlays.getOverlayUtil(overlay)\n\t\tconst cursor = util.getCursor(overlay)\n\t\tif (cursor) {\n\t\t\teditor.setCursor({ type: cursor, rotation: editor.getSelectionRotation() })\n\t\t}\n\n\t\treturn true\n\t}\n\n\t// Reset cursor when leaving an overlay\n\tif (previousOverlayId) {\n\t\teditor.setCursor({ type: 'default', rotation: 0 })\n\t}\n\n\teditor.overlays.setHoveredOverlay(null)\n\treturn false\n}\n"],
  "mappings": "AASO,SAAS,uBAAuB,QAAyB;AAC/D,MAAI,OAAO,WAAY,QAAO;AAE9B,QAAM,mBAAmB,OAAO,OAAO,oBAAoB;AAC3D,QAAM,SAAS,OAAO,QAAQ,gBAAgB,OAAO,aAAa;AAClE,QAAM,UAAU,OAAO,SAAS,kBAAkB,kBAAkB,MAAM;AAE1E,QAAM,oBAAoB,OAAO,SAAS,oBAAoB;AAE9D,MAAI,SAAS;AACZ,WAAO,SAAS,kBAAkB,QAAQ,EAAE;AAE5C,WAAO,gBAAgB,IAAI;AAG3B,UAAM,OAAO,OAAO,SAAS,eAAe,OAAO;AACnD,UAAM,SAAS,KAAK,UAAU,OAAO;AACrC,QAAI,QAAQ;AACX,aAAO,UAAU,EAAE,MAAM,QAAQ,UAAU,OAAO,qBAAqB,EAAE,CAAC;AAAA,IAC3E;AAEA,WAAO;AAAA,EACR;AAGA,MAAI,mBAAmB;AACtB,WAAO,UAAU,EAAE,MAAM,WAAW,UAAU,EAAE,CAAC;AAAA,EAClD;AAEA,SAAO,SAAS,kBAAkB,IAAI;AACtC,SAAO;AACR;",
  "names": []
}
