{
  "version": 3,
  "sources": ["../../../src/lib/overlays/SelectionForegroundOverlayUtil.ts"],
  "sourcesContent": ["import {\n\tBox,\n\tCircle2d,\n\tEdge2d,\n\tGeometry2d,\n\tHALF_PI,\n\tMat,\n\tOverlayUtil,\n\tPolygon2d,\n\tRotateCorner,\n\tSelectionCorner,\n\tSelectionEdge,\n\tTLCursorType,\n\tTLOverlay,\n\tTLSelectionHandle,\n\tTLShape,\n\tVec,\n} from '@tldraw/editor'\n\nconst SQUARE_ROOT_PI = Math.sqrt(Math.PI)\n\nconst ROTATE_CURSORS: Partial<Record<RotateCorner, TLCursorType>> = {\n\ttop_left_rotate: 'nwse-rotate',\n\ttop_right_rotate: 'nesw-rotate',\n\tbottom_left_rotate: 'swne-rotate',\n\tbottom_right_rotate: 'senw-rotate',\n}\n\nconst RESIZE_CURSORS: Partial<Record<TLSelectionHandle, TLCursorType>> = {\n\ttop_left: 'nwse-resize',\n\ttop_right: 'nesw-resize',\n\tbottom_right: 'nwse-resize',\n\tbottom_left: 'nesw-resize',\n\ttop: 'ns-resize',\n\tbottom: 'ns-resize',\n\tleft: 'ew-resize',\n\tright: 'ew-resize',\n}\n\n/** @public */\nexport interface TLSelectionForegroundOverlay extends TLOverlay {\n\tprops: {\n\t\toverlayType: 'resize_handle' | 'rotate_handle' | 'mobile_rotate'\n\t\thandle: TLSelectionHandle | RotateCorner\n\t}\n}\n\ninterface SelectionState {\n\tbounds: Box\n\tonlyShape: TLShape | null\n\tisCoarsePointer: boolean\n\tzoom: number\n\trotation: number\n\twidth: number\n\theight: number\n\tsize: number\n\ttargetSize: number\n\ttargetSizeX: number\n\ttargetSizeY: number\n\texpandDx: number\n\texpandDy: number\n\tisSmallX: boolean\n\tshouldDisplayControls: boolean\n\tshouldDisplayBox: boolean\n\tshowCropHandles: boolean\n\tshowResizeHandles: boolean\n\tshowCornerRotateHandles: boolean\n\tshowMobileRotateHandle: boolean\n\tshowHandles: boolean\n\thideAlternateCornerHandles: boolean\n\thideAlternateCropHandles: boolean\n\tshowOnlyOneHandle: boolean\n}\n\ninterface SelectionForegroundColors {\n\tstrokeColor: string\n\tbgColor: string\n}\n\n/**\n * Overlay util for selection foreground handles (resize corners/edges, rotate corners, mobile rotate).\n * Each interactive element of the selection foreground becomes its own overlay instance.\n *\n * @public\n */\nexport class SelectionForegroundOverlayUtil extends OverlayUtil<TLSelectionForegroundOverlay> {\n\tstatic override type = 'selection_foreground'\n\toverride options = { zIndex: 100, lineWidth: 1.5 }\n\n\toverride isActive(): boolean {\n\t\tif (!this.editor.getSelectionRotatedPageBounds()) return false\n\n\t\treturn this.editor.isInAny(\n\t\t\t'select.idle',\n\t\t\t'select.brushing',\n\t\t\t'select.scribble_brushing',\n\t\t\t'select.pointing_canvas',\n\t\t\t'select.pointing_selection',\n\t\t\t'select.pointing_shape',\n\t\t\t'select.pointing_resize_handle',\n\t\t\t'select.resizing',\n\t\t\t'select.crop.idle',\n\t\t\t'select.crop.pointing_crop',\n\t\t\t'select.crop.pointing_crop_handle'\n\t\t)\n\t}\n\n\toverride getOverlays(): TLSelectionForegroundOverlay[] {\n\t\tconst state = this._computeSelectionState()\n\t\tif (!state) return []\n\n\t\tconst overlays: TLSelectionForegroundOverlay[] = []\n\t\tthis._collectResizeCornerOverlays(state, overlays)\n\t\tthis._collectResizeEdgeOverlays(state, overlays)\n\t\tthis._collectRotateOverlays(state, overlays)\n\t\treturn overlays\n\t}\n\n\toverride getGeometry(overlay: TLSelectionForegroundOverlay): Geometry2d | null {\n\t\tconst state = this._computeSelectionState()\n\t\tif (!state) return null\n\n\t\tconst transform = Mat.Compose(\n\t\t\tMat.Translate(state.bounds.x, state.bounds.y),\n\t\t\tMat.Rotate(state.rotation),\n\t\t\tMat.Translate(state.expandDx, state.expandDy)\n\t\t)\n\n\t\tconst { overlayType, handle } = overlay.props\n\n\t\tswitch (overlayType) {\n\t\t\tcase 'resize_handle':\n\t\t\t\treturn this._getResizeHandleGeometry(handle as TLSelectionHandle, state, transform)\n\t\t\tcase 'rotate_handle':\n\t\t\t\treturn this._getRotateHandleGeometry(handle as RotateCorner, state, transform)\n\t\t\tcase 'mobile_rotate':\n\t\t\t\treturn this._getMobileRotateGeometry(state, transform)\n\t\t\tdefault:\n\t\t\t\treturn null\n\t\t}\n\t}\n\n\toverride render(ctx: CanvasRenderingContext2D, _overlays: TLSelectionForegroundOverlay[]): void {\n\t\tconst state = this._computeSelectionState()\n\t\tif (!state) return\n\n\t\t// Transform to local selection space; each render helper assumes this is active.\n\t\tctx.save()\n\t\tctx.translate(state.bounds.x, state.bounds.y)\n\t\tctx.rotate(state.rotation)\n\t\tctx.translate(state.expandDx, state.expandDy)\n\n\t\tconst colors = this._getThemeColors()\n\t\tthis._renderSelectionBox(ctx, state, colors)\n\t\tthis._renderResizeCorners(ctx, state, colors)\n\t\tthis._renderCropHandles(ctx, state, colors)\n\t\tthis._renderMobileRotateHandle(ctx, state, colors)\n\t\tthis._renderTextResizeHandles(ctx, state, colors)\n\n\t\tctx.restore()\n\t}\n\n\toverride getCursor(overlay: TLSelectionForegroundOverlay): TLCursorType | undefined {\n\t\tconst { overlayType, handle } = overlay.props\n\t\tswitch (overlayType) {\n\t\t\tcase 'rotate_handle':\n\t\t\t\treturn ROTATE_CURSORS[handle as RotateCorner]\n\t\t\tcase 'mobile_rotate':\n\t\t\t\treturn 'grab'\n\t\t\tcase 'resize_handle':\n\t\t\t\treturn RESIZE_CURSORS[handle as TLSelectionHandle]\n\t\t\tdefault:\n\t\t\t\treturn undefined\n\t\t}\n\t}\n\n\t// --- Overlay collection ---\n\n\tprivate _collectResizeCornerOverlays(\n\t\tstate: SelectionState,\n\t\toverlays: TLSelectionForegroundOverlay[]\n\t) {\n\t\tif (!state.showHandles) return\n\n\t\toverlays.push(this._makeOverlay('resize_handle', 'top_left'))\n\t\tif (!state.hideAlternateCornerHandles) {\n\t\t\toverlays.push(this._makeOverlay('resize_handle', 'top_right'))\n\t\t\toverlays.push(this._makeOverlay('resize_handle', 'bottom_left'))\n\t\t}\n\t\tif (!state.showOnlyOneHandle || state.showCropHandles) {\n\t\t\toverlays.push(this._makeOverlay('resize_handle', 'bottom_right'))\n\t\t}\n\t}\n\n\tprivate _collectResizeEdgeOverlays(\n\t\tstate: SelectionState,\n\t\toverlays: TLSelectionForegroundOverlay[]\n\t) {\n\t\tif (!state.showHandles) return\n\n\t\tconst {\n\t\t\tshowCropHandles,\n\t\t\thideAlternateCropHandles,\n\t\t\thideAlternateCornerHandles,\n\t\t\tshowOnlyOneHandle,\n\t\t\tisCoarsePointer,\n\t\t\tonlyShape,\n\t\t} = state\n\n\t\tconst hideVerticalEdgeTargets = showCropHandles\n\t\t\t? hideAlternateCropHandles\n\t\t\t: hideAlternateCornerHandles || showOnlyOneHandle || isCoarsePointer\n\t\tconst isMobileAndTextShape = isCoarsePointer && !!onlyShape && onlyShape.type === 'text'\n\t\tconst hideHorizontalEdgeTargets = showCropHandles\n\t\t\t? hideAlternateCropHandles\n\t\t\t: hideVerticalEdgeTargets && !isMobileAndTextShape\n\n\t\tif (!hideVerticalEdgeTargets) {\n\t\t\toverlays.push(this._makeOverlay('resize_handle', 'top'))\n\t\t\toverlays.push(this._makeOverlay('resize_handle', 'bottom'))\n\t\t}\n\t\tif (!hideHorizontalEdgeTargets) {\n\t\t\toverlays.push(this._makeOverlay('resize_handle', 'right'))\n\t\t\toverlays.push(this._makeOverlay('resize_handle', 'left'))\n\t\t}\n\t}\n\n\tprivate _collectRotateOverlays(state: SelectionState, overlays: TLSelectionForegroundOverlay[]) {\n\t\tif (state.showCornerRotateHandles) {\n\t\t\toverlays.push(this._makeOverlay('rotate_handle', 'top_left_rotate'))\n\t\t\toverlays.push(this._makeOverlay('rotate_handle', 'top_right_rotate'))\n\t\t\toverlays.push(this._makeOverlay('rotate_handle', 'bottom_left_rotate'))\n\t\t\toverlays.push(this._makeOverlay('rotate_handle', 'bottom_right_rotate'))\n\t\t}\n\t\tif (state.showMobileRotateHandle) {\n\t\t\toverlays.push(this._makeOverlay('mobile_rotate', 'mobile_rotate'))\n\t\t}\n\t}\n\n\t// --- Geometry builders ---\n\n\tprivate _getResizeHandleGeometry(\n\t\thandle: TLSelectionHandle,\n\t\tstate: SelectionState,\n\t\ttransform: Mat\n\t): Geometry2d {\n\t\tif (handle === 'top' || handle === 'bottom' || handle === 'left' || handle === 'right') {\n\t\t\tconst edge = this._getEdgeLocalPoints(handle, state.width, state.height)\n\t\t\treturn new Edge2d({\n\t\t\t\tstart: Mat.applyToPoint(transform, edge.start),\n\t\t\t\tend: Mat.applyToPoint(transform, edge.end),\n\t\t\t})\n\t\t}\n\n\t\tconst cp = this._getCornerLocalPoint(handle as SelectionCorner, state.width, state.height)\n\t\tconst s = Math.max(state.targetSizeX, state.targetSizeY) * 1.5\n\t\treturn new Polygon2d({\n\t\t\tpoints: this._localRectToPoints(cp.x - s, cp.y - s, s * 2, s * 2).map((p) =>\n\t\t\t\tMat.applyToPoint(transform, p)\n\t\t\t),\n\t\t\tisFilled: true,\n\t\t})\n\t}\n\n\tprivate _getRotateHandleGeometry(\n\t\thandle: RotateCorner,\n\t\tstate: SelectionState,\n\t\ttransform: Mat\n\t): Geometry2d {\n\t\tconst cornerSize = Math.max(state.targetSizeX, state.targetSizeY) * 1.5\n\t\tconst center = this._getRotateHandleLocalCenter(handle, state.width, state.height, cornerSize)\n\t\tconst radius = (state.targetSize * 3) / 2\n\t\treturn new Circle2d({\n\t\t\tx: center.x - radius,\n\t\t\ty: center.y - radius,\n\t\t\tradius,\n\t\t\tisFilled: true,\n\t\t}).transform(transform)\n\t}\n\n\tprivate _getMobileRotateGeometry(state: SelectionState, transform: Mat): Geometry2d {\n\t\tconst bgRadius = Math.max(14 * (1 / state.zoom), 20 / Math.max(1, state.zoom))\n\t\tconst { cx, cy } = this._getMobileRotateCenter(state)\n\t\treturn new Polygon2d({\n\t\t\tpoints: this._localRectToPoints(cx - bgRadius, cy - bgRadius, bgRadius * 2, bgRadius * 2).map(\n\t\t\t\t(p) => Mat.applyToPoint(transform, p)\n\t\t\t),\n\t\t\tisFilled: true,\n\t\t})\n\t}\n\n\t// --- Rendering (all helpers assume ctx is in local selection space) ---\n\n\tprivate _renderSelectionBox(\n\t\tctx: CanvasRenderingContext2D,\n\t\tstate: SelectionState,\n\t\tcolors: SelectionForegroundColors\n\t) {\n\t\tif (!state.shouldDisplayBox) return\n\t\tctx.strokeStyle = colors.strokeColor\n\t\tctx.lineWidth = this.options.lineWidth / state.zoom\n\t\tctx.strokeRect(0, 0, state.width, state.height)\n\t}\n\n\tprivate _renderResizeCorners(\n\t\tctx: CanvasRenderingContext2D,\n\t\tstate: SelectionState,\n\t\tcolors: SelectionForegroundColors\n\t) {\n\t\tif (!state.showResizeHandles) return\n\n\t\tconst { size, width, height, hideAlternateCornerHandles, showOnlyOneHandle, zoom } = state\n\n\t\tctx.fillStyle = colors.bgColor\n\t\tctx.strokeStyle = colors.strokeColor\n\t\tctx.lineWidth = this.options.lineWidth / zoom\n\n\t\tconst drawCorner = (x: number, y: number, hidden: boolean) => {\n\t\t\tif (hidden) return\n\t\t\tctx.fillRect(x - size / 2, y - size / 2, size, size)\n\t\t\tctx.strokeRect(x - size / 2, y - size / 2, size, size)\n\t\t}\n\n\t\tdrawCorner(0, 0, false) // top-left always shown\n\t\tdrawCorner(width, 0, hideAlternateCornerHandles) // top-right\n\t\tdrawCorner(width, height, showOnlyOneHandle) // bottom-right\n\t\tdrawCorner(0, height, hideAlternateCornerHandles) // bottom-left\n\t}\n\n\tprivate _renderCropHandles(\n\t\tctx: CanvasRenderingContext2D,\n\t\tstate: SelectionState,\n\t\tcolors: SelectionForegroundColors\n\t) {\n\t\tif (!state.showCropHandles) return\n\n\t\tconst { size, width, height, hideAlternateCropHandles } = state\n\t\tconst cropStrokeWidth = size / 3\n\t\tconst offset = cropStrokeWidth / 2\n\n\t\tctx.beginPath()\n\t\tctx.strokeStyle = colors.strokeColor\n\t\tctx.lineWidth = cropStrokeWidth\n\t\tctx.lineCap = 'butt'\n\t\tctx.lineJoin = 'miter'\n\n\t\t// top_left corner (always shown)\n\t\tctx.moveTo(-offset, size)\n\t\tctx.lineTo(-offset, -offset)\n\t\tctx.lineTo(size, -offset)\n\n\t\t// bottom_right corner (always shown)\n\t\tctx.moveTo(width + offset, height - size)\n\t\tctx.lineTo(width + offset, height + offset)\n\t\tctx.lineTo(width - size, height + offset)\n\n\t\tif (!hideAlternateCropHandles) {\n\t\t\t// top_right corner\n\t\t\tctx.moveTo(width - size, -offset)\n\t\t\tctx.lineTo(width + offset, -offset)\n\t\t\tctx.lineTo(width + offset, size)\n\n\t\t\t// bottom_left corner\n\t\t\tctx.moveTo(size, height + offset)\n\t\t\tctx.lineTo(-offset, height + offset)\n\t\t\tctx.lineTo(-offset, height - size)\n\n\t\t\t// top edge\n\t\t\tctx.moveTo(width / 2 - size, -offset)\n\t\t\tctx.lineTo(width / 2 + size, -offset)\n\n\t\t\t// right edge\n\t\t\tctx.moveTo(width + offset, height / 2 - size)\n\t\t\tctx.lineTo(width + offset, height / 2 + size)\n\n\t\t\t// bottom edge\n\t\t\tctx.moveTo(width / 2 - size, height + offset)\n\t\t\tctx.lineTo(width / 2 + size, height + offset)\n\n\t\t\t// left edge\n\t\t\tctx.moveTo(-offset, height / 2 - size)\n\t\t\tctx.lineTo(-offset, height / 2 + size)\n\t\t}\n\n\t\tctx.stroke()\n\t}\n\n\tprivate _renderMobileRotateHandle(\n\t\tctx: CanvasRenderingContext2D,\n\t\tstate: SelectionState,\n\t\tcolors: SelectionForegroundColors\n\t) {\n\t\tif (!state.showMobileRotateHandle) return\n\n\t\tconst { cx, cy } = this._getMobileRotateCenter(state)\n\t\tconst fgRadius = state.size / SQUARE_ROOT_PI\n\n\t\tctx.fillStyle = colors.bgColor\n\t\tctx.strokeStyle = colors.strokeColor\n\t\tctx.lineWidth = this.options.lineWidth / state.zoom\n\t\tctx.beginPath()\n\t\tctx.arc(cx, cy, fgRadius, 0, Math.PI * 2)\n\t\tctx.fill()\n\t\tctx.stroke()\n\t}\n\n\tprivate _renderTextResizeHandles(\n\t\tctx: CanvasRenderingContext2D,\n\t\tstate: SelectionState,\n\t\tcolors: SelectionForegroundColors\n\t) {\n\t\tconst {\n\t\t\tshouldDisplayControls,\n\t\t\tisCoarsePointer,\n\t\t\tonlyShape,\n\t\t\tzoom,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tsize,\n\t\t\ttargetSizeY,\n\t\t} = state\n\t\tif (!shouldDisplayControls || !isCoarsePointer || !onlyShape || onlyShape.type !== 'text') {\n\t\t\treturn\n\t\t}\n\n\t\tconst textHandleHeight = Math.min(24 / zoom, height - targetSizeY * 3)\n\t\tif (textHandleHeight * zoom < 4) return\n\n\t\tconst hw = size / 2\n\t\tconst r = size / 4\n\n\t\tctx.fillStyle = colors.strokeColor\n\t\tctx.beginPath()\n\t\tctx.roundRect(0 - hw / 2, height / 2 - textHandleHeight / 2, hw, textHandleHeight, r)\n\t\tctx.fill()\n\t\tctx.beginPath()\n\t\tctx.roundRect(width - hw / 2, height / 2 - textHandleHeight / 2, hw, textHandleHeight, r)\n\t\tctx.fill()\n\t}\n\n\t// --- Shared helpers ---\n\n\t/**\n\t * Single source of truth for the derived state the selection foreground needs.\n\t * Called from `getOverlays()`, `getGeometry()`, and `render()` so their visibility\n\t * predicates can't drift. Returns `null` when no selection UI should appear at all\n\t * (nothing selected, or the only selected shape is hidden).\n\t */\n\tprivate _computeSelectionState(): SelectionState | null {\n\t\tconst editor = this.editor\n\t\tconst bounds = editor.getSelectionRotatedPageBounds()\n\t\tif (!bounds) return null\n\n\t\tconst onlyShape = editor.getOnlySelectedShape()\n\t\tif (onlyShape && editor.isShapeHidden(onlyShape)) return null\n\n\t\tconst onlyShapeUtil = onlyShape ? editor.getShapeUtil(onlyShape) : null\n\t\tconst isLockedShape = !!(onlyShape && editor.isShapeOrAncestorLocked(onlyShape))\n\n\t\tconst expandOutlineBy =\n\t\t\tonlyShape && onlyShapeUtil ? onlyShapeUtil.expandSelectionOutlinePx(onlyShape) : 0\n\t\tconst expandedBounds =\n\t\t\texpandOutlineBy instanceof Box\n\t\t\t\t? bounds.clone().expand(expandOutlineBy).zeroFix()\n\t\t\t\t: bounds.clone().expandBy(expandOutlineBy).zeroFix()\n\n\t\tconst instanceState = editor.getInstanceState()\n\t\tconst isCoarsePointer = instanceState.isCoarsePointer\n\t\tconst isChangingStyle = instanceState.isChangingStyle\n\t\tconst isReadonly = editor.getIsReadonly()\n\t\tconst zoom = editor.getZoomLevel()\n\t\tconst rotation = editor.getSelectionRotation()\n\n\t\tconst width = expandedBounds.width\n\t\tconst height = expandedBounds.height\n\t\tconst size = 8 / zoom\n\t\tconst isTinyX = width < size * 2\n\t\tconst isTinyY = height < size * 2\n\t\tconst isSmallX = width < size * 4\n\t\tconst isSmallY = height < size * 4\n\t\tconst isSmallCropX = width < size * 5\n\t\tconst isSmallCropY = height < size * 5\n\n\t\tconst mobileHandleMultiplier = isCoarsePointer ? 1.75 : 1\n\t\tconst targetSize = (6 / zoom) * mobileHandleMultiplier\n\t\tconst targetSizeX = (isSmallX ? targetSize / 2 : targetSize) * (mobileHandleMultiplier * 0.75)\n\t\tconst targetSizeY = (isSmallY ? targetSize / 2 : targetSize) * (mobileHandleMultiplier * 0.75)\n\n\t\tconst expandDx = expandedBounds.x - bounds.x\n\t\tconst expandDy = expandedBounds.y - bounds.y\n\n\t\tconst shouldDisplayControls =\n\t\t\teditor.isInAny(\n\t\t\t\t'select.idle',\n\t\t\t\t'select.pointing_selection',\n\t\t\t\t'select.pointing_shape',\n\t\t\t\t'select.crop.idle'\n\t\t\t) &&\n\t\t\t!isChangingStyle &&\n\t\t\t!isReadonly\n\n\t\tconst showCropHandles =\n\t\t\teditor.isInAny(\n\t\t\t\t'select.crop.idle',\n\t\t\t\t'select.crop.pointing_crop',\n\t\t\t\t'select.crop.pointing_crop_handle'\n\t\t\t) && !isReadonly\n\n\t\tconst canOnlyShapeResize =\n\t\t\tonlyShape && onlyShapeUtil\n\t\t\t\t? onlyShapeUtil.canResize(onlyShape) && !onlyShapeUtil.hideResizeHandles(onlyShape)\n\t\t\t\t: true\n\t\tconst hideOnlyShapeRotateHandle =\n\t\t\tonlyShape && onlyShapeUtil ? onlyShapeUtil.hideRotateHandle(onlyShape) : false\n\t\tconst hideOnlyShapeSelectionBounds =\n\t\t\tonlyShape && onlyShapeUtil ? onlyShapeUtil.hideSelectionBoundsFg(onlyShape) : false\n\n\t\tconst showResizeHandles =\n\t\t\tshouldDisplayControls && !isLockedShape && !showCropHandles && canOnlyShapeResize\n\n\t\tconst showCornerRotateHandles =\n\t\t\tshouldDisplayControls &&\n\t\t\t!isLockedShape &&\n\t\t\t!isCoarsePointer &&\n\t\t\t!(isTinyX || isTinyY) &&\n\t\t\t!hideOnlyShapeRotateHandle\n\n\t\tconst showMobileRotateHandle =\n\t\t\tshouldDisplayControls &&\n\t\t\t!isLockedShape &&\n\t\t\tisCoarsePointer &&\n\t\t\t(!isSmallX || !isSmallY) &&\n\t\t\t!hideOnlyShapeRotateHandle\n\n\t\tconst hideAlternateCornerHandles = isTinyX || isTinyY\n\t\tconst hideAlternateCropHandles = isSmallCropX || isSmallCropY\n\t\tconst showOnlyOneHandle = isTinyX && isTinyY\n\t\tconst showHandles = showResizeHandles || showCropHandles\n\n\t\tconst showSelectionBounds = !hideOnlyShapeSelectionBounds && !isChangingStyle\n\n\t\tconst shouldDisplayBox =\n\t\t\t(showSelectionBounds &&\n\t\t\t\teditor.isInAny(\n\t\t\t\t\t'select.idle',\n\t\t\t\t\t'select.brushing',\n\t\t\t\t\t'select.scribble_brushing',\n\t\t\t\t\t'select.pointing_canvas',\n\t\t\t\t\t'select.pointing_selection',\n\t\t\t\t\t'select.pointing_shape',\n\t\t\t\t\t'select.crop.idle',\n\t\t\t\t\t'select.crop.pointing_crop',\n\t\t\t\t\t'select.crop.pointing_crop_handle',\n\t\t\t\t\t'select.pointing_resize_handle'\n\t\t\t\t)) ||\n\t\t\t(showSelectionBounds &&\n\t\t\t\teditor.isIn('select.resizing') &&\n\t\t\t\t!!(onlyShape && editor.isShapeOfType(onlyShape, 'text')))\n\n\t\treturn {\n\t\t\tbounds,\n\t\t\tonlyShape,\n\t\t\tisCoarsePointer,\n\t\t\tzoom,\n\t\t\trotation,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tsize,\n\t\t\ttargetSize,\n\t\t\ttargetSizeX,\n\t\t\ttargetSizeY,\n\t\t\texpandDx,\n\t\t\texpandDy,\n\t\t\tisSmallX,\n\t\t\tshouldDisplayControls,\n\t\t\tshouldDisplayBox,\n\t\t\tshowCropHandles,\n\t\t\tshowResizeHandles,\n\t\t\tshowCornerRotateHandles,\n\t\t\tshowMobileRotateHandle,\n\t\t\tshowHandles,\n\t\t\thideAlternateCornerHandles,\n\t\t\thideAlternateCropHandles,\n\t\t\tshowOnlyOneHandle,\n\t\t}\n\t}\n\n\tprivate _getMobileRotateCenter(state: SelectionState): { cx: number; cy: number } {\n\t\tconst { width, height, targetSize, isSmallX, onlyShape, rotation } = state\n\t\tconst editor = this.editor\n\t\tconst isMediaShape =\n\t\t\t!!onlyShape &&\n\t\t\t(editor.isShapeOfType(onlyShape, 'image') || editor.isShapeOfType(onlyShape, 'video'))\n\t\tconst isShapeTooCloseToContextualToolbar = rotation / HALF_PI > 1.6 && rotation / HALF_PI < 2.4\n\n\t\tconst cx = isSmallX ? -targetSize * 1.5 : width / 2\n\t\tconst cy = isSmallX\n\t\t\t? height / 2\n\t\t\t: isMediaShape && !isShapeTooCloseToContextualToolbar\n\t\t\t\t? height + targetSize * 1.5\n\t\t\t\t: -targetSize * 1.5\n\t\treturn { cx, cy }\n\t}\n\n\tprivate _getThemeColors(): SelectionForegroundColors {\n\t\tconst editor = this.editor\n\t\tconst themeColors = editor.getCurrentTheme().colors[editor.getColorMode()]\n\t\treturn {\n\t\t\tstrokeColor: themeColors.selectionStroke,\n\t\t\tbgColor: themeColors.background,\n\t\t}\n\t}\n\n\tprivate _makeOverlay(\n\t\toverlayType: TLSelectionForegroundOverlay['props']['overlayType'],\n\t\thandle: TLSelectionHandle | RotateCorner\n\t): TLSelectionForegroundOverlay {\n\t\treturn {\n\t\t\tid: `selection_fg:${handle}`,\n\t\t\ttype: 'selection_foreground',\n\t\t\tprops: { overlayType, handle },\n\t\t}\n\t}\n\n\tprivate _getEdgeLocalPoints(\n\t\tedge: SelectionEdge,\n\t\twidth: number,\n\t\theight: number\n\t): { start: Vec; end: Vec } {\n\t\tswitch (edge) {\n\t\t\tcase 'top':\n\t\t\t\treturn { start: new Vec(0, 0), end: new Vec(width, 0) }\n\t\t\tcase 'right':\n\t\t\t\treturn { start: new Vec(width, 0), end: new Vec(width, height) }\n\t\t\tcase 'bottom':\n\t\t\t\treturn { start: new Vec(0, height), end: new Vec(width, height) }\n\t\t\tcase 'left':\n\t\t\t\treturn { start: new Vec(0, 0), end: new Vec(0, height) }\n\t\t}\n\t}\n\n\tprivate _getRotateHandleLocalCenter(\n\t\tcorner: RotateCorner,\n\t\twidth: number,\n\t\theight: number,\n\t\tcornerSize: number\n\t): Vec {\n\t\t// Centered on the outside corner of the resize handle square\n\t\t// (the corner furthest from the selection interior)\n\t\tswitch (corner) {\n\t\t\tcase 'top_left_rotate':\n\t\t\t\treturn new Vec(-cornerSize, -cornerSize)\n\t\t\tcase 'top_right_rotate':\n\t\t\t\treturn new Vec(width + cornerSize, -cornerSize)\n\t\t\tcase 'bottom_left_rotate':\n\t\t\t\treturn new Vec(-cornerSize, height + cornerSize)\n\t\t\tcase 'bottom_right_rotate':\n\t\t\t\treturn new Vec(width + cornerSize, height + cornerSize)\n\t\t\tdefault:\n\t\t\t\treturn new Vec(0, 0)\n\t\t}\n\t}\n\n\tprivate _getCornerLocalPoint(corner: SelectionCorner, width: number, height: number): Vec {\n\t\tswitch (corner) {\n\t\t\tcase 'top_left':\n\t\t\t\treturn new Vec(0, 0)\n\t\t\tcase 'top_right':\n\t\t\t\treturn new Vec(width, 0)\n\t\t\tcase 'bottom_right':\n\t\t\t\treturn new Vec(width, height)\n\t\t\tcase 'bottom_left':\n\t\t\t\treturn new Vec(0, height)\n\t\t}\n\t}\n\n\tprivate _localRectToPoints(x: number, y: number, w: number, h: number): Vec[] {\n\t\treturn [new Vec(x, y), new Vec(x + w, y), new Vec(x + w, y + h), new Vec(x, y + h)]\n\t}\n}\n"],
  "mappings": "AAAA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAQA;AAAA,OACM;AAEP,MAAM,iBAAiB,KAAK,KAAK,KAAK,EAAE;AAExC,MAAM,iBAA8D;AAAA,EACnE,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,qBAAqB;AACtB;AAEA,MAAM,iBAAmE;AAAA,EACxE,UAAU;AAAA,EACV,WAAW;AAAA,EACX,cAAc;AAAA,EACd,aAAa;AAAA,EACb,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AACR;AAgDO,MAAM,uCAAuC,YAA0C;AAAA,EAC7F,OAAgB,OAAO;AAAA,EACd,UAAU,EAAE,QAAQ,KAAK,WAAW,IAAI;AAAA,EAExC,WAAoB;AAC5B,QAAI,CAAC,KAAK,OAAO,8BAA8B,EAAG,QAAO;AAEzD,WAAO,KAAK,OAAO;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAAA,EAES,cAA8C;AACtD,UAAM,QAAQ,KAAK,uBAAuB;AAC1C,QAAI,CAAC,MAAO,QAAO,CAAC;AAEpB,UAAM,WAA2C,CAAC;AAClD,SAAK,6BAA6B,OAAO,QAAQ;AACjD,SAAK,2BAA2B,OAAO,QAAQ;AAC/C,SAAK,uBAAuB,OAAO,QAAQ;AAC3C,WAAO;AAAA,EACR;AAAA,EAES,YAAY,SAA0D;AAC9E,UAA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