monaco-editor-core 0.59.0-dev-20261127 → 0.59.0-dev-20261128

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 (31) hide show
  1. package/esm/nls.messages.cs.js +1 -1
  2. package/esm/nls.messages.de.js +1 -1
  3. package/esm/nls.messages.es.js +1 -1
  4. package/esm/nls.messages.fr.js +1 -1
  5. package/esm/nls.messages.it.js +1 -1
  6. package/esm/nls.messages.ja.js +1 -1
  7. package/esm/nls.messages.ko.js +1 -1
  8. package/esm/nls.messages.pl.js +1 -1
  9. package/esm/nls.messages.pt-br.js +1 -1
  10. package/esm/nls.messages.ru.js +1 -1
  11. package/esm/nls.messages.tr.js +1 -1
  12. package/esm/nls.messages.zh-cn.js +1 -1
  13. package/esm/nls.messages.zh-tw.js +1 -1
  14. package/esm/vs/base/browser/ui/actionbar/actionbar.css +104 -0
  15. package/esm/vs/base/browser/ui/contextview/contextview.js +1 -1
  16. package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
  17. package/esm/vs/base/browser/ui/toolbar/toolbar.js +119 -2
  18. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  19. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +32 -3
  20. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  21. package/esm/vs/editor/contrib/documentSymbols/browser/outlineModel.js +13 -4
  22. package/esm/vs/editor/contrib/documentSymbols/browser/outlineModel.js.map +1 -1
  23. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +5 -3
  24. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  25. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +10 -8
  26. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js.map +1 -1
  27. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +6 -3
  28. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js.map +1 -1
  29. package/esm/vs/platform/actionWidget/browser/actionWidget.js +2 -0
  30. package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
  31. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/contextview/contextview.ts","vs/base/browser/ui/contextview/contextview.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACtG,OAAO,EAA+D,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAClH,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,0BAA0B,EAAkI,MAAM,4BAA4B,CAAC;AACxM,OAAO,mBAAmB,CAAC;AAmB3B,MAAM,UAAU,oBAAoB,CAAC,WAAmC;IACvE,OAAO,WAAW,2CAAmC,IAAI,WAAW,kDAA0C,CAAC;AAChH,CAAC;AAyBD,MAAM,UAAU,QAAQ,CAAC,GAAY;IACpC,MAAM,MAAM,GAAG,GAAkD,CAAC;IAElE,OAAO,CAAC,CAAC,MAAM,IAAI,OAAO,MAAM,CAAC,CAAC,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,CAAC,KAAK,QAAQ,CAAC;AACjF,CAAC;AAkCD,MAAM,UAAU,0BAA0B,CAAC,OAAoB,EAAE,UAAiE;IACjI,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QACzB,OAAO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B;AAC7B,MAAM,iBAAiB,GAAG,SAAS,CAAC;;;;;;;;;;;;;;CAcnC,CAAC;AAEF,MAAM,2BAA2B,GAAG,IAAI,OAAO,EAAc,CAAC;AAE9D,SAAS,uBAAuB,CAAC,KAAkB;IAClD,MAAM,UAAU,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5C,IAAI,UAAU,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QAChE,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACzD,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAC;QACtC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;AACF,CAAC;AAED,MAAM,eAAe,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuC/B,2BAA2B,CAAC,gDAAgD,CAAC;CAC/E,CAAC","file":"contextview.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { getVisibleWCOTitlebarAreaRect } from '../../browser.js';\nimport { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { createStyleSheet } from '../../domStylesheets.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { onUnexpectedError } from '../../../common/errors.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition, IRect, layout2d } from '../../../common/layout.js';\nimport * as platform from '../../../common/platform.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport { avoidWindowControlsOverlay, IWindowControlsOverlayPosition, IWindowControlsOverlaySize, IWindowControlsOverlayTitlebarRect, IWindowControlsOverlayViewport } from './windowControlsOverlay.js';\nimport './contextview.css';\n\nexport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition } from '../../../common/layout.js';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW,\n\t/**\n\t * Hosts the view inside the container (the owner) as a manual popover,\n\t * so focus stays inside the owner while the view renders in the top layer.\n\t */\n\tPOPOVER,\n\t/**\n\t * Like {@link ContextViewDOMPosition.POPOVER}, with the view in a shadow root.\n\t */\n\tPOPOVER_SHADOW\n}\n\nexport function isPopoverDOMPosition(domPosition: ContextViewDOMPosition): boolean {\n\treturn domPosition === ContextViewDOMPosition.POPOVER || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n}\n\nexport interface IContextViewRenderContext {\n\t/**\n\t * Where the view is actually hosted. A popover position can fall back\n\t * to a fixed position when the popover cannot be shown.\n\t */\n\treadonly domPosition: ContextViewDOMPosition;\n}\n\nexport interface IContextViewOptions {\n\t/**\n\t * Returns the container to use when a popover cannot be shown in its owner.\n\t * Defaults to the owner's document body.\n\t */\n\treadonly getFallbackContainer?: (owner: HTMLElement) => HTMLElement;\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement, context?: IContextViewRenderContext): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewCloseAnimation {\n\treadonly className: string;\n\treadonly duration: number;\n\t/** Requirements must match one ancestor; a nested array accepts any listed class. */\n\treadonly requiredAncestorClasses?: readonly (string | readonly string[])[];\n}\n\nexport function hasRequiredAncestorClasses(element: HTMLElement, classNames: IContextViewCloseAnimation['requiredAncestorClasses']): boolean {\n\tif (!classNames?.length) {\n\t\treturn true;\n\t}\n\n\tfor (let candidate: HTMLElement | null = element; candidate;) {\n\t\tconst current: HTMLElement = candidate;\n\t\tif (classNames.every(requirement => typeof requirement === 'string'\n\t\t\t? current.classList.contains(requirement)\n\t\t\t: requirement.some(className => current.classList.contains(className)))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (current.parentElement) {\n\t\t\tcandidate = current.parentElement;\n\t\t} else {\n\t\t\tconst root = current.getRootNode();\n\t\t\tcandidate = root instanceof ShadowRoot && DOM.isHTMLElement(root.host) ? root.host : null;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport const CONTEXT_VIEW_MENU_MOTION_CLASS = 'context-view-menu-motion';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS = 'context-view-menu-motion-closing';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION = 150;\nexport const CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES = [['modern-ui', 'modern-ui-frosted-glass'], 'monaco-enable-motion'] as const;\nexport const CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE = '--vscode-context-view-close-animation-duration';\nexport const CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE = '--vscode-context-view-menu-motion-shadow';\n/** Inherited while an opacity animation isolates descendant menu backdrops. */\nexport const CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-backdrop-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-close-start-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE = '--vscode-context-view-menu-motion-close-start-transform';\n\nexport const CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS = 250;\nexport const CONTEXT_VIEW_MENU_MOTION_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';\n\nexport const contextViewMenuCloseAnimation: IContextViewCloseAnimation = {\n\tclassName: CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS,\n\tduration: CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION,\n\trequiredAncestorClasses: CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES,\n};\n\nfunction getContextViewMenuMotionCss(enabledSelectorPrefix: string): string {\n\treturn /* css */ `\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} {\n\t\tanimation: none;\n\t\tbox-shadow: none;\n\t\toverflow: visible;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-open ${CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS}ms ${CONTEXT_VIEW_MENU_MOTION_EASING} backwards;\n\t\tbox-shadow: var(${CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE});\n\t\ttransform-origin: top left;\n\t\twill-change: opacity;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.right > .monaco-scrollable-element {\n\t\ttransform-origin: top right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top > .monaco-scrollable-element {\n\t\ttransform-origin: bottom left;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top.right > .monaco-scrollable-element {\n\t\ttransform-origin: bottom right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.${CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-close var(${CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE}) ${CONTEXT_VIEW_MENU_MOTION_EASING} both;\n\t\tpointer-events: none;\n\t}\n\n\t@keyframes context-view-menu-motion-open {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.97);\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes context-view-menu-motion-close {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE}, 1);\n\t\t\ttransform: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE}, scale(1));\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.99);\n\t\t}\n\t}`;\n}\n\nlet contextViewMenuMotionStyleSheet: HTMLStyleElement | undefined;\n\nfunction ensureContextViewMenuMotionStyleSheet(): void {\n\tif (!contextViewMenuMotionStyleSheet) {\n\t\tcontextViewMenuMotionStyleSheet = createStyleSheet(undefined, style => {\n\t\t\tstyle.textContent = getContextViewMenuMotionCss('.modern-ui.monaco-enable-motion');\n\t\t});\n\t}\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\n/**\n * Returns how far, in rendered CSS pixels, to move a view on one axis so that it starts on a whole\n * device pixel. Chromium paints the edges of an element at the device pixels nearest to them, so\n * the view rounds the edge that faces its anchor to the nearest device pixel: the end when the view\n * is before the anchor or lines up with the anchor's end, otherwise the start. When the view was laid\n * out to end at the anchor's edge, its end paints at that edge's device pixel even if its rendered\n * size differs from its layout size, so it neither covers the anchor nor leaves a gap.\n *\n * If that would move the view past the viewport, a view that lines up with its anchor instead rounds\n * the other way, and a view beside its anchor, which would move over the anchor, stays unaligned.\n *\n * `start`, `size`, `anchorStart` and `anchorSize` decide the side of the anchor the view was placed\n * on, so they are in the coordinates and layout size the view was placed with. `renderedStart` and\n * `renderedSize` are where the view is rendered, relative to the viewport, which is `viewportSize`.\n */\nfunction getViewDevicePixelAlignmentOffset(start: number, size: number, anchorStart: number, anchorSize: number, renderedStart: number, renderedSize: number, viewportSize: number, devicePixelRatio: number): number {\n\tconst epsilon = 0.01;\n\tconst before = start + size <= anchorStart + epsilon;\n\tconst beside = before || start + epsilon >= anchorStart + anchorSize;\n\tconst endsWithAnchor = Math.abs(start + size - (anchorStart + anchorSize)) <= epsilon && Math.abs(start - anchorStart) > epsilon;\n\tconst roundings: DOM.DevicePixelRounding[] = [before || (!beside && endsWithAnchor) ? 'nearestEnd' : 'nearest'];\n\tif (!beside) {\n\t\troundings.push('start', 'end');\n\t}\n\tconst anchorEdge = before ? anchorStart : anchorStart + anchorSize;\n\tconst anchorEnd = Math.abs(start + size - anchorEdge) <= epsilon ? anchorEdge - start + renderedStart : undefined;\n\tfor (const rounding of roundings) {\n\t\tconst offset = DOM.getDevicePixelAlignmentOffset(renderedStart, devicePixelRatio, rounding, renderedSize, anchorEnd);\n\t\t// Allows for floating-point error when a move lands exactly on the viewport's edge\n\t\tif ((offset >= 0 || renderedStart + offset >= -0.001) && (offset <= 0 || renderedStart + renderedSize + offset <= viewportSize + 0.001)) {\n\t\t\treturn offset;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/**\n * Moves a view's laid-out position so that its border box starts on whole device pixels (see\n * {@link DOM.alignToDevicePixels}), computed from geometry measured before the view moves so that\n * aligning forces no further layout.\n *\n * @param position The laid-out position, where the view is rendered, in the coordinate space of `viewport`.\n * @param layoutSize The size the view was laid out with, which decides the side of the anchor it is on.\n * @param renderedSize The rendered border-box size of the view.\n * @param anchor The rect the view is anchored to, which decides the edge of the view rounded on each axis.\n * @param viewport The visible area of the page, which the aligned view must stay inside.\n * @param devicePixelRatio The device pixel ratio of the window that shows the view.\n * @param titlebarAreaRect The visible window controls overlay, which the aligned view must not\n * cover when the view at `position` does not. Each axis keeps its alignment where it can.\n */\nexport function alignViewToDevicePixels(position: IWindowControlsOverlayPosition, layoutSize: IWindowControlsOverlaySize, renderedSize: IWindowControlsOverlaySize, anchor: IRect, viewport: IWindowControlsOverlayViewport, devicePixelRatio: number, titlebarAreaRect: IWindowControlsOverlayTitlebarRect | undefined): IWindowControlsOverlayPosition {\n\tconst align = (start: number, viewLayoutSize: number, viewRenderedSize: number, anchorStart: number, anchorSize: number, viewportStart: number, viewportSize: number) =>\n\t\tstart + getViewDevicePixelAlignmentOffset(start, viewLayoutSize, anchorStart, anchorSize, start - viewportStart, viewRenderedSize, viewportSize, devicePixelRatio);\n\tconst aligned = {\n\t\ttop: align(position.top, layoutSize.height, renderedSize.height, anchor.top, anchor.height, viewport.top, viewport.height),\n\t\tleft: align(position.left, layoutSize.width, renderedSize.width, anchor.left, anchor.width, viewport.left, viewport.width)\n\t};\n\tconst clearOfWindowControls = (candidate: IWindowControlsOverlayPosition) => avoidWindowControlsOverlay(titlebarAreaRect, viewport, renderedSize, candidate) === candidate;\n\tif (!clearOfWindowControls(position)) {\n\t\treturn aligned;\n\t}\n\tconst candidates = [aligned, { top: position.top, left: aligned.left }, { top: aligned.top, left: position.left }];\n\treturn candidates.find(clearOfWindowControls) ?? position;\n}\n\nexport function getAnchorRect(anchor: HTMLElement | StandardMouseEvent | IAnchor): IRect {\n\t// Get the element's position and size (to anchor the view)\n\tif (DOM.isHTMLElement(anchor)) {\n\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\treturn {\n\t\t\ttop: elementPosition.top,\n\t\t\tleft: elementPosition.left,\n\t\t\twidth: elementPosition.width,\n\t\t\theight: elementPosition.height\n\t\t};\n\t} else if (isAnchor(anchor)) {\n\t\treturn {\n\t\t\ttop: anchor.y,\n\t\t\tleft: anchor.x,\n\t\t\twidth: anchor.width || 1,\n\t\t\theight: anchor.height || 2\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\ttop: anchor.posy,\n\t\t\tleft: anchor.posx,\n\t\t\t// We are about to position the context view where the mouse\n\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\twidth: 2,\n\t\t\theight: 2\n\t\t};\n\t}\n}\n\nfunction getDeepActiveElement(doc: Document): Element | null {\n\tlet result = doc.activeElement;\n\twhile (result?.shadowRoot?.activeElement) {\n\t\tresult = result.shadowRoot.activeElement;\n\t}\n\treturn result;\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\tprivate static readonly ISOLATED_KEY_EVENTS = ['keydown', 'keyup', 'keypress'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate hidingContextView: { readonly disposable: IDisposable; readonly toDispose: IDisposable; readonly className: string } | undefined;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\tprivate domPosition: ContextViewDOMPosition = ContextViewDOMPosition.ABSOLUTE;\n\tprivate readonly toDisposeOnPopoverHide = this._register(new DisposableStore());\n\tprivate focusToRestore: HTMLElement | null = null;\n\tprivate showCount = 0;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition, private readonly options: IContextViewOptions = {}) {\n\t\tsuper();\n\n\t\tensureContextViewMenuMotionStyleSheet();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tconst previousDOMPosition = this.domPosition;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tconst useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n\t\tconst unchanged = container === this.container && usedShadowDOM === useShadowDOM && isPopoverDOMPosition(previousDOMPosition) === isPopoverDOMPosition(domPosition);\n\n\t\t// Tear down the previous popover while its position is still current, so\n\t\t// that its owner tracking is disposed and its top layer entry is closed\n\t\tif (this.container && !unchanged && isPopoverDOMPosition(previousDOMPosition)) {\n\t\t\tthis.hide(undefined, true);\n\t\t\tthis.completeHideAnimation();\n\t\t}\n\n\t\tthis.domPosition = domPosition;\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tthis.useShadowDOM = useShadowDOM;\n\n\t\tif (unchanged) {\n\t\t\treturn; // container is the same and neither shadow DOM nor popover usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tthis.view.removeAttribute('popover');\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\t\t\tconst isPopover = isPopoverDOMPosition(domPosition);\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tObject.assign(this.shadowRootHostElement.style, {\n\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\ttop: '0',\n\t\t\t\t\tleft: '0',\n\t\t\t\t\twidth: '0',\n\t\t\t\t\theight: '0'\n\t\t\t\t});\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.shadowRootHostElement.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\t}\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.view.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tif (isPopover) {\n\t\t\t\t// Keep keys pressed in the view from reaching the owner or\n\t\t\t\t// window-level keybinding listeners while the view is hosted.\n\t\t\t\tconst popoverElement = this.getPopoverElement();\n\t\t\t\tContextView.ISOLATED_KEY_EVENTS.forEach(event => {\n\t\t\t\t\ttoDisposeOnSetContainer.add(DOM.addDisposableListener(popoverElement, event, e => e.stopPropagation()));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tthis.showCount++;\n\t\tthis.completeHideAnimation();\n\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide(undefined, true);\n\t\t}\n\n\t\tconst ownerDocument = this.container?.ownerDocument ?? DOM.getActiveDocument();\n\t\tconst activeElement = getDeepActiveElement(ownerDocument);\n\t\tthis.focusToRestore = DOM.isHTMLElement(activeElement) ? activeElement : null;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.showPopover();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.zIndex = zIndex;\n\t\tif (this.shadowRootHostElement) {\n\t\t\tthis.shadowRootHostElement.style.zIndex = zIndex;\n\t\t}\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view, { domPosition: this.domPosition }) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.trackPopoverOwner();\n\t\t}\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Layout hides the view when its popover owner is hidden or removed,\n\t\t// for example by rendering; do not move focus into a hidden view\n\t\tif (this.delegate !== delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Focus\n\t\tdelegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tprivate getPopoverElement(): HTMLElement {\n\t\treturn this.shadowRootHostElement ?? this.view;\n\t}\n\n\tprivate showPopover(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fall back to a fixed position without the Popover API or a connected\n\t\t// owner; only report a failure to show a popover that should have shown\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (typeof popoverElement.showPopover === 'function' && owner.isConnected) {\n\t\t\ttry {\n\t\t\t\tif (popoverElement.parentElement !== owner) {\n\t\t\t\t\tadoptPopoverResetStyles(owner);\n\t\t\t\t\towner.appendChild(popoverElement);\n\t\t\t\t}\n\t\t\t\tif (!popoverElement.matches(':popover-open')) {\n\t\t\t\t\tpopoverElement.showPopover();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\t\t}\n\n\t\tpopoverElement.remove();\n\t\tconst fallbackContainer = this.options.getFallbackContainer?.(owner) ?? DOM.getWindow(owner).document.body;\n\t\tthis.setContainer(fallbackContainer, this.domPosition === ContextViewDOMPosition.POPOVER_SHADOW ? ContextViewDOMPosition.FIXED_SHADOW : ContextViewDOMPosition.FIXED);\n\t}\n\n\tprivate trackPopoverOwner(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tconst targetWindow = DOM.getWindow(owner);\n\n\t\t// Dismiss on pointer presses outside both the view and its owner, without restoring focus\n\t\tthis.toDisposeOnPopoverHide.add(DOM.addDisposableListener(targetWindow, DOM.EventType.POINTER_DOWN, e => {\n\t\t\tconst path = e.composedPath();\n\t\t\tif (!path.includes(popoverElement) && !path.includes(owner)) {\n\t\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\t}\n\t\t}, true));\n\n\t\tconst ResizeObserverCtor = (targetWindow as Window & typeof globalThis).ResizeObserver;\n\t\tif (typeof ResizeObserverCtor === 'function') {\n\t\t\tconst observer = new ResizeObserverCtor(() => this.checkPopoverOwner());\n\t\t\tobserver.observe(owner);\n\t\t\tthis.toDisposeOnPopoverHide.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\t}\n\n\tprivate isPopoverOwnerLost(): boolean {\n\t\tconst owner = this.container;\n\t\treturn !owner || !owner.isConnected || owner.getClientRects().length === 0;\n\t}\n\n\tprivate checkPopoverOwner(): boolean {\n\t\tif (this.isVisible() && isPopoverDOMPosition(this.domPosition) && this.isPopoverOwnerLost()) {\n\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate hideWithoutRestoringFocus(): void {\n\t\tthis.focusToRestore = null;\n\t\tthis.hide(undefined, true);\n\t}\n\n\tprivate restorePopoverFocus(): void {\n\t\tconst focusToRestore = this.focusToRestore;\n\t\tthis.focusToRestore = null;\n\t\tif (!focusToRestore?.isConnected) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = getDeepActiveElement(focusToRestore.ownerDocument);\n\t\tif (activeElement && (activeElement === focusToRestore.ownerDocument.body || DOM.isAncestor(activeElement, this.view))) {\n\t\t\tfocusToRestore.focus();\n\t\t}\n\t}\n\n\tprivate hidePopover(): void {\n\t\tthis.toDisposeOnPopoverHide.clear();\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (popoverElement.hasAttribute('popover') && popoverElement.matches(':popover-open')) {\n\t\t\tpopoverElement.hidePopover();\n\t\t}\n\n\t\t// Leave nothing behind in the owner, which may be an arbitrary element such as an input's parent\n\t\tpopoverElement.remove();\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.checkPopoverOwner()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = getAnchorRect(this.delegate!.getAnchor());\n\t\tconst containerWindow = this.container ? DOM.getWindow(this.container) : DOM.getActiveWindow();\n\t\tconst viewport = { top: containerWindow.pageYOffset, left: containerWindow.pageXOffset, width: containerWindow.innerWidth, height: containerWindow.innerHeight };\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst positioningOrigin = DOM.getDomNodePagePosition(this.view);\n\t\tconst viewZoom = DOM.getDomNodeZoomLevel(this.view);\n\t\tconst view = { width: DOM.getTotalWidth(this.view) * viewZoom, height: DOM.getTotalHeight(this.view) * viewZoom };\n\t\tconst anchorPosition = this.delegate!.anchorPosition;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment;\n\t\tconst layoutResult = layout2d(viewport, view, anchor, { anchorAlignment, anchorPosition, anchorAxisAlignment });\n\t\tconst titlebarAreaRect = getVisibleWCOTitlebarAreaRect(containerWindow);\n\t\tconst adjusted = avoidWindowControlsOverlay(titlebarAreaRect, viewport, view, layoutResult);\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tif (adjusted === layoutResult) {\n\t\t\tthis.view.classList.add(layoutResult.anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(layoutResult.anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\t} else {\n\t\t\tthis.view.classList.add(adjusted.top >= anchor.top + anchor.height ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(adjusted.left >= anchor.left ? 'left' : 'right');\n\t\t}\n\n\t\t// Aligned from the geometry read above, so aligning forces no further layout\n\t\tconst { top, left } = alignViewToDevicePixels(adjusted, view, { width: positioningOrigin.width, height: positioningOrigin.height }, anchor, viewport, containerWindow.devicePixelRatio, titlebarAreaRect);\n\t\tthis.view.style.top = `${(top - positioningOrigin.top) / viewZoom}px`;\n\t\tthis.view.style.left = `${(left - positioningOrigin.left) / viewZoom}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown, skipAnimation = false): void {\n\t\tif (this.hidingContextView) {\n\t\t\tif (skipAnimation) {\n\t\t\t\tthis.completeHideAnimation();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (!delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toDispose = this.toDisposeOnClean;\n\t\tthis.toDisposeOnClean = Disposable.None;\n\n\t\tdelegate.onHide?.(data);\n\n\t\tconst isPopover = isPopoverDOMPosition(this.domPosition);\n\t\tif (isPopover) {\n\t\t\t// Stop tracking the owner first, then restore focus before the view\n\t\t\t// becomes inert or hidden, so that focus never leaves the owner\n\t\t\tthis.toDisposeOnPopoverHide.clear();\n\t\t\tconst showCount = this.showCount;\n\t\t\tthis.restorePopoverFocus();\n\t\t\tif (this.showCount !== showCount) {\n\t\t\t\t// Restoring focus showed another view, for example an input box\n\t\t\t\t// message; it now owns the view, so only clean up this rendering\n\t\t\t\ttoDispose.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.focusToRestore = null;\n\t\t}\n\n\t\tconst closeAnimation = delegate.closeAnimation;\n\t\tif (!skipAnimation && closeAnimation && closeAnimation.duration > 0 && hasRequiredAncestorClasses(this.view, closeAnimation.requiredAncestorClasses)) {\n\t\t\tthis.view.style.setProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE, `${closeAnimation.duration}ms`);\n\t\t\tthis.prepareMenuCloseAnimation();\n\t\t\tthis.view.inert = true;\n\t\t\tthis.view.classList.add(closeAnimation.className);\n\t\t\tconst timeout = setTimeout(() => this.completeHideAnimation(), closeAnimation.duration);\n\t\t\tthis.hidingContextView = {\n\t\t\t\tdisposable: toDisposable(() => clearTimeout(timeout)),\n\t\t\t\ttoDispose,\n\t\t\t\tclassName: closeAnimation.className\n\t\t\t};\n\t\t\treturn;\n\t\t}\n\n\t\tDOM.hide(this.view);\n\t\tif (isPopover) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\ttoDispose.dispose();\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate completeHideAnimation(): void {\n\t\tconst hidingContextView = this.hidingContextView;\n\t\tif (!hidingContextView) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hidingContextView = undefined;\n\t\thidingContextView.disposable.dispose();\n\t\tthis.view.classList.remove(hidingContextView.className);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE);\n\t\tDOM.hide(this.view);\n\t\tthis.view.inert = false;\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\thidingContextView.toDispose.dispose();\n\t}\n\n\tprivate prepareMenuCloseAnimation(): void {\n\t\tif (!this.view.classList.contains(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst surface = Array.from(this.view.children).find(element => DOM.isHTMLElement(element) && element.classList.contains('monaco-scrollable-element'));\n\t\tif (!DOM.isHTMLElement(surface)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst computedStyle = DOM.getWindow(surface).getComputedStyle(surface);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE, computedStyle.opacity);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE, computedStyle.transform);\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide(undefined, true);\n\t\tthis.completeHideAnimation();\n\n\t\tsuper.dispose();\n\t}\n}\n\n// Mirrors the popover reset in contextview.css, whose rules do not reach an\n// owner inside a shadow root\nconst POPOVER_RESET_CSS = /* css */ `\n\t.context-view[popover],\n\t.shadow-root-host[popover] {\n\t\tposition: fixed;\n\t\tinset: auto;\n\t\twidth: auto;\n\t\theight: auto;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\toverflow: visible;\n\t\tcolor: inherit;\n\t\tbackground: transparent;\n\t}\n`;\n\nconst shadowRootsWithPopoverReset = new WeakSet<ShadowRoot>();\n\nfunction adoptPopoverResetStyles(owner: HTMLElement): void {\n\tconst shadowRoot = DOM.getShadowRoot(owner);\n\tif (shadowRoot && !shadowRootsWithPopoverReset.has(shadowRoot)) {\n\t\tshadowRootsWithPopoverReset.add(shadowRoot);\n\t\tconst style = owner.ownerDocument.createElement('style');\n\t\tstyle.textContent = POPOVER_RESET_CSS;\n\t\tshadowRoot.appendChild(style);\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n\t${getContextViewMenuMotionCss(':host-context(.modern-ui.monaco-enable-motion)')}\n`;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { getVisibleWCOTitlebarAreaRect } from '../../browser.js';\nimport { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { createStyleSheet } from '../../domStylesheets.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { onUnexpectedError } from '../../../common/errors.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition, IRect, layout2d } from '../../../common/layout.js';\nimport * as platform from '../../../common/platform.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport { avoidWindowControlsOverlay, IWindowControlsOverlayPosition, IWindowControlsOverlaySize, IWindowControlsOverlayTitlebarRect, IWindowControlsOverlayViewport } from './windowControlsOverlay.js';\nimport './contextview.css';\n\nexport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition } from '../../../common/layout.js';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW,\n\t/**\n\t * Hosts the view inside the container (the owner) as a manual popover,\n\t * so focus stays inside the owner while the view renders in the top layer.\n\t */\n\tPOPOVER,\n\t/**\n\t * Like {@link ContextViewDOMPosition.POPOVER}, with the view in a shadow root.\n\t */\n\tPOPOVER_SHADOW\n}\n\nexport function isPopoverDOMPosition(domPosition: ContextViewDOMPosition): boolean {\n\treturn domPosition === ContextViewDOMPosition.POPOVER || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n}\n\nexport interface IContextViewRenderContext {\n\t/**\n\t * Where the view is actually hosted. A popover position can fall back\n\t * to a fixed position when the popover cannot be shown.\n\t */\n\treadonly domPosition: ContextViewDOMPosition;\n}\n\nexport interface IContextViewOptions {\n\t/**\n\t * Returns the container to use when a popover cannot be shown in its owner.\n\t * Defaults to the owner's document body.\n\t */\n\treadonly getFallbackContainer?: (owner: HTMLElement) => HTMLElement;\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement, context?: IContextViewRenderContext): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewCloseAnimation {\n\treadonly className: string;\n\treadonly duration: number;\n\t/** Requirements must match one ancestor; a nested array accepts any listed class. */\n\treadonly requiredAncestorClasses?: readonly (string | readonly string[])[];\n}\n\nexport function hasRequiredAncestorClasses(element: HTMLElement, classNames: IContextViewCloseAnimation['requiredAncestorClasses']): boolean {\n\tif (!classNames?.length) {\n\t\treturn true;\n\t}\n\n\tfor (let candidate: HTMLElement | null = element; candidate;) {\n\t\tconst current: HTMLElement = candidate;\n\t\tif (classNames.every(requirement => typeof requirement === 'string'\n\t\t\t? current.classList.contains(requirement)\n\t\t\t: requirement.some(className => current.classList.contains(className)))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (current.parentElement) {\n\t\t\tcandidate = current.parentElement;\n\t\t} else {\n\t\t\tconst root = current.getRootNode();\n\t\t\tcandidate = root instanceof ShadowRoot && DOM.isHTMLElement(root.host) ? root.host : null;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport const CONTEXT_VIEW_MENU_MOTION_CLASS = 'context-view-menu-motion';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS = 'context-view-menu-motion-closing';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION = 150;\nexport const CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES = [['modern-ui', 'modern-ui-frosted-glass'], 'monaco-enable-motion'] as const;\nexport const CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE = '--vscode-context-view-close-animation-duration';\nexport const CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE = '--vscode-context-view-menu-motion-shadow';\n/** Inherited while an opacity animation isolates descendant menu backdrops. */\nexport const CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-backdrop-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-close-start-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE = '--vscode-context-view-menu-motion-close-start-transform';\n\nexport const CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS = 250;\nexport const CONTEXT_VIEW_MENU_MOTION_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';\n\nexport const contextViewMenuCloseAnimation: IContextViewCloseAnimation = {\n\tclassName: CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS,\n\tduration: CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION,\n\trequiredAncestorClasses: CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES,\n};\n\nfunction getContextViewMenuMotionCss(enabledSelectorPrefix: string): string {\n\treturn /* css */ `\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} {\n\t\tanimation: none;\n\t\tbox-shadow: none;\n\t\toverflow: visible;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-open ${CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS}ms ${CONTEXT_VIEW_MENU_MOTION_EASING} backwards;\n\t\tbox-shadow: var(${CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE});\n\t\ttransform-origin: top left;\n\t\twill-change: opacity;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.right > .monaco-scrollable-element {\n\t\ttransform-origin: top right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top > .monaco-scrollable-element {\n\t\ttransform-origin: bottom left;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top.right > .monaco-scrollable-element {\n\t\ttransform-origin: bottom right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.${CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-close var(${CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE}) ${CONTEXT_VIEW_MENU_MOTION_EASING} both;\n\t\tpointer-events: none;\n\t}\n\n\t@keyframes context-view-menu-motion-open {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.97);\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes context-view-menu-motion-close {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE}, 1);\n\t\t\ttransform: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE}, scale(1));\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.99);\n\t\t}\n\t}`;\n}\n\nlet contextViewMenuMotionStyleSheet: HTMLStyleElement | undefined;\n\nfunction ensureContextViewMenuMotionStyleSheet(): void {\n\tif (!contextViewMenuMotionStyleSheet) {\n\t\tcontextViewMenuMotionStyleSheet = createStyleSheet(undefined, style => {\n\t\t\tstyle.textContent = getContextViewMenuMotionCss('.modern-ui.monaco-enable-motion');\n\t\t});\n\t}\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\n/**\n * Returns how far, in rendered CSS pixels, to move a view on one axis so that it starts on a whole\n * device pixel. Chromium paints the edges of an element at the device pixels nearest to them, so\n * the view rounds the edge that faces its anchor to the nearest device pixel: the end when the view\n * is before the anchor or lines up with the anchor's end, otherwise the start. When the view was laid\n * out to end at the anchor's edge, its end paints at that edge's device pixel even if its rendered\n * size differs from its layout size, so it neither covers the anchor nor leaves a gap.\n *\n * If that would move the view past the viewport, a view that lines up with its anchor instead rounds\n * the other way, and a view beside its anchor, which would move over the anchor, stays unaligned.\n *\n * `start`, `size`, `anchorStart` and `anchorSize` decide the side of the anchor the view was placed\n * on, so they are in the coordinates and layout size the view was placed with. `renderedStart` and\n * `renderedSize` are where the view is rendered, relative to the viewport, which is `viewportSize`.\n */\nfunction getViewDevicePixelAlignmentOffset(start: number, size: number, anchorStart: number, anchorSize: number, renderedStart: number, renderedSize: number, viewportSize: number, devicePixelRatio: number): number {\n\tconst epsilon = 0.01;\n\tconst before = start + size <= anchorStart + epsilon;\n\tconst beside = before || start + epsilon >= anchorStart + anchorSize;\n\tconst endsWithAnchor = Math.abs(start + size - (anchorStart + anchorSize)) <= epsilon && Math.abs(start - anchorStart) > epsilon;\n\tconst roundings: DOM.DevicePixelRounding[] = [before || (!beside && endsWithAnchor) ? 'nearestEnd' : 'nearest'];\n\tif (!beside) {\n\t\troundings.push('start', 'end');\n\t}\n\tconst anchorEdge = before ? anchorStart : anchorStart + anchorSize;\n\tconst anchorEnd = Math.abs(start + size - anchorEdge) <= epsilon ? anchorEdge - start + renderedStart : undefined;\n\tfor (const rounding of roundings) {\n\t\tconst offset = DOM.getDevicePixelAlignmentOffset(renderedStart, devicePixelRatio, rounding, renderedSize, anchorEnd);\n\t\t// Allows for floating-point error when a move lands exactly on the viewport's edge\n\t\tif ((offset >= 0 || renderedStart + offset >= -0.001) && (offset <= 0 || renderedStart + renderedSize + offset <= viewportSize + 0.001)) {\n\t\t\treturn offset;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/**\n * Moves a view's laid-out position so that its border box starts on whole device pixels (see\n * {@link DOM.alignToDevicePixels}), computed from geometry measured before the view moves so that\n * aligning forces no further layout.\n *\n * @param position The laid-out position, where the view is rendered, in the coordinate space of `viewport`.\n * @param layoutSize The size the view was laid out with, which decides the side of the anchor it is on.\n * @param renderedSize The rendered border-box size of the view.\n * @param anchor The rect the view is anchored to, which decides the edge of the view rounded on each axis.\n * @param viewport The visible area of the page, which the aligned view must stay inside.\n * @param devicePixelRatio The device pixel ratio of the window that shows the view.\n * @param titlebarAreaRect The visible window controls overlay, which the aligned view must not\n * cover when the view at `position` does not. Each axis keeps its alignment where it can.\n */\nexport function alignViewToDevicePixels(position: IWindowControlsOverlayPosition, layoutSize: IWindowControlsOverlaySize, renderedSize: IWindowControlsOverlaySize, anchor: IRect, viewport: IWindowControlsOverlayViewport, devicePixelRatio: number, titlebarAreaRect: IWindowControlsOverlayTitlebarRect | undefined): IWindowControlsOverlayPosition {\n\tconst align = (start: number, viewLayoutSize: number, viewRenderedSize: number, anchorStart: number, anchorSize: number, viewportStart: number, viewportSize: number) =>\n\t\tstart + getViewDevicePixelAlignmentOffset(start, viewLayoutSize, anchorStart, anchorSize, start - viewportStart, viewRenderedSize, viewportSize, devicePixelRatio);\n\tconst aligned = {\n\t\ttop: align(position.top, layoutSize.height, renderedSize.height, anchor.top, anchor.height, viewport.top, viewport.height),\n\t\tleft: align(position.left, layoutSize.width, renderedSize.width, anchor.left, anchor.width, viewport.left, viewport.width)\n\t};\n\tconst clearOfWindowControls = (candidate: IWindowControlsOverlayPosition) => avoidWindowControlsOverlay(titlebarAreaRect, viewport, renderedSize, candidate) === candidate;\n\tif (!clearOfWindowControls(position)) {\n\t\treturn aligned;\n\t}\n\tconst candidates = [aligned, { top: position.top, left: aligned.left }, { top: aligned.top, left: position.left }];\n\treturn candidates.find(clearOfWindowControls) ?? position;\n}\n\nexport function getAnchorRect(anchor: HTMLElement | StandardMouseEvent | IAnchor): IRect {\n\t// Get the element's position and size (to anchor the view)\n\tif (DOM.isHTMLElement(anchor)) {\n\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\treturn {\n\t\t\ttop: elementPosition.top,\n\t\t\tleft: elementPosition.left,\n\t\t\twidth: elementPosition.width,\n\t\t\theight: elementPosition.height\n\t\t};\n\t} else if (isAnchor(anchor)) {\n\t\treturn {\n\t\t\ttop: anchor.y,\n\t\t\tleft: anchor.x,\n\t\t\twidth: anchor.width || 1,\n\t\t\theight: anchor.height || 2\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\ttop: anchor.posy,\n\t\t\tleft: anchor.posx,\n\t\t\t// We are about to position the context view where the mouse\n\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\twidth: 2,\n\t\t\theight: 2\n\t\t};\n\t}\n}\n\nfunction getDeepActiveElement(doc: Document): Element | null {\n\tlet result = doc.activeElement;\n\twhile (result?.shadowRoot?.activeElement) {\n\t\tresult = result.shadowRoot.activeElement;\n\t}\n\treturn result;\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\tprivate static readonly ISOLATED_KEY_EVENTS = ['keydown', 'keyup', 'keypress'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate hidingContextView: { readonly disposable: IDisposable; readonly toDispose: IDisposable; readonly className: string } | undefined;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\tprivate domPosition: ContextViewDOMPosition = ContextViewDOMPosition.ABSOLUTE;\n\tprivate readonly toDisposeOnPopoverHide = this._register(new DisposableStore());\n\tprivate focusToRestore: HTMLElement | null = null;\n\tprivate showCount = 0;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition, private readonly options: IContextViewOptions = {}) {\n\t\tsuper();\n\n\t\tensureContextViewMenuMotionStyleSheet();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tconst previousDOMPosition = this.domPosition;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tconst useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n\t\tconst unchanged = container === this.container && usedShadowDOM === useShadowDOM && isPopoverDOMPosition(previousDOMPosition) === isPopoverDOMPosition(domPosition);\n\n\t\t// Tear down the previous popover while its position is still current, so\n\t\t// that its owner tracking is disposed and its top layer entry is closed\n\t\tif (this.container && !unchanged && isPopoverDOMPosition(previousDOMPosition)) {\n\t\t\tthis.hide(undefined, true);\n\t\t\tthis.completeHideAnimation();\n\t\t}\n\n\t\tthis.domPosition = domPosition;\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tthis.useShadowDOM = useShadowDOM;\n\n\t\tif (unchanged) {\n\t\t\treturn; // container is the same and neither shadow DOM nor popover usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tthis.view.removeAttribute('popover');\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\t\t\tconst isPopover = isPopoverDOMPosition(domPosition);\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tObject.assign(this.shadowRootHostElement.style, {\n\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\ttop: '0',\n\t\t\t\t\tleft: '0',\n\t\t\t\t\twidth: '0',\n\t\t\t\t\theight: '0'\n\t\t\t\t});\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.shadowRootHostElement.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\t}\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.view.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tif (isPopover) {\n\t\t\t\t// Keep keys pressed in the view from reaching the owner or\n\t\t\t\t// window-level keybinding listeners while the view is hosted.\n\t\t\t\tconst popoverElement = this.getPopoverElement();\n\t\t\t\tContextView.ISOLATED_KEY_EVENTS.forEach(event => {\n\t\t\t\t\ttoDisposeOnSetContainer.add(DOM.addDisposableListener(popoverElement, event, e => e.stopPropagation()));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tthis.showCount++;\n\t\tthis.completeHideAnimation();\n\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide(undefined, true);\n\t\t}\n\n\t\tconst ownerDocument = this.container?.ownerDocument ?? DOM.getActiveDocument();\n\t\tconst activeElement = getDeepActiveElement(ownerDocument);\n\t\tthis.focusToRestore = DOM.isHTMLElement(activeElement) ? activeElement : null;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.showPopover();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.zIndex = zIndex;\n\t\tif (this.shadowRootHostElement) {\n\t\t\tthis.shadowRootHostElement.style.zIndex = zIndex;\n\t\t}\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view, { domPosition: this.domPosition }) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.trackPopoverOwner();\n\t\t}\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Layout hides the view when its popover owner is hidden or removed,\n\t\t// for example by rendering; do not move focus into a hidden view\n\t\tif (this.delegate !== delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Focus\n\t\tdelegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tprivate getPopoverElement(): HTMLElement {\n\t\treturn this.shadowRootHostElement ?? this.view;\n\t}\n\n\tprivate showPopover(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fall back to a fixed position without the Popover API or a connected\n\t\t// owner; only report a failure to show a popover that should have shown\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (typeof popoverElement.showPopover === 'function' && owner.isConnected) {\n\t\t\ttry {\n\t\t\t\tif (popoverElement.parentElement !== owner) {\n\t\t\t\t\tadoptPopoverResetStyles(owner);\n\t\t\t\t\towner.appendChild(popoverElement);\n\t\t\t\t}\n\t\t\t\tif (!popoverElement.matches(':popover-open')) {\n\t\t\t\t\tpopoverElement.showPopover();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\t\t}\n\n\t\tpopoverElement.remove();\n\t\tconst fallbackContainer = this.options.getFallbackContainer?.(owner) ?? DOM.getWindow(owner).document.body;\n\t\tthis.setContainer(fallbackContainer, this.domPosition === ContextViewDOMPosition.POPOVER_SHADOW ? ContextViewDOMPosition.FIXED_SHADOW : ContextViewDOMPosition.FIXED);\n\t}\n\n\tprivate trackPopoverOwner(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tconst targetWindow = DOM.getWindow(owner);\n\n\t\t// Dismiss on pointer presses outside both the view and its owner, without restoring focus\n\t\tthis.toDisposeOnPopoverHide.add(DOM.addDisposableListener(targetWindow, DOM.EventType.POINTER_DOWN, e => {\n\t\t\tconst path = e.composedPath();\n\t\t\tif (!path.includes(popoverElement) && !path.includes(owner)) {\n\t\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\t}\n\t\t}, true));\n\n\t\tconst ResizeObserverCtor = (targetWindow as Window & typeof globalThis).ResizeObserver;\n\t\tif (typeof ResizeObserverCtor === 'function') {\n\t\t\tconst observer = new ResizeObserverCtor(() => this.checkPopoverOwner());\n\t\t\tobserver.observe(owner);\n\t\t\tthis.toDisposeOnPopoverHide.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\t}\n\n\tprivate isPopoverOwnerLost(): boolean {\n\t\tconst owner = this.container;\n\t\treturn !owner || !owner.isConnected || owner.getClientRects().length === 0;\n\t}\n\n\tprivate checkPopoverOwner(): boolean {\n\t\tif (this.isVisible() && isPopoverDOMPosition(this.domPosition) && this.isPopoverOwnerLost()) {\n\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate hideWithoutRestoringFocus(): void {\n\t\tthis.focusToRestore = null;\n\t\tthis.hide(undefined, true);\n\t}\n\n\tprivate restorePopoverFocus(): void {\n\t\tconst focusToRestore = this.focusToRestore;\n\t\tthis.focusToRestore = null;\n\t\tif (!focusToRestore?.isConnected) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = getDeepActiveElement(focusToRestore.ownerDocument);\n\t\tif (activeElement && (activeElement === focusToRestore.ownerDocument.body || DOM.isAncestor(activeElement, this.view))) {\n\t\t\tfocusToRestore.focus();\n\t\t}\n\t}\n\n\tprivate hidePopover(): void {\n\t\tthis.toDisposeOnPopoverHide.clear();\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (popoverElement.hasAttribute('popover') && popoverElement.matches(':popover-open')) {\n\t\t\tpopoverElement.hidePopover();\n\t\t}\n\n\t\t// Leave nothing behind in the owner, which may be an arbitrary element such as an input's parent\n\t\tpopoverElement.remove();\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.checkPopoverOwner()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = getAnchorRect(this.delegate!.getAnchor());\n\t\tconst containerWindow = this.container ? DOM.getWindow(this.container) : DOM.getActiveWindow();\n\t\tconst viewport = { top: containerWindow.pageYOffset, left: containerWindow.pageXOffset, width: containerWindow.innerWidth, height: containerWindow.innerHeight };\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst positioningOrigin = DOM.getDomNodePagePosition(this.view);\n\t\tconst viewZoom = DOM.getDomNodeZoomLevel(this.view);\n\t\tconst view = { width: DOM.getTotalWidth(this.view) * viewZoom, height: DOM.getTotalHeight(this.view) * viewZoom };\n\t\tconst anchorPosition = this.delegate!.anchorPosition;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment;\n\t\tconst layoutResult = layout2d(viewport, view, anchor, { anchorAlignment, anchorPosition, anchorAxisAlignment });\n\t\tconst titlebarAreaRect = getVisibleWCOTitlebarAreaRect(containerWindow);\n\t\tconst adjusted = avoidWindowControlsOverlay(titlebarAreaRect, viewport, view, layoutResult);\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tif (adjusted === layoutResult) {\n\t\t\tthis.view.classList.add(layoutResult.anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(layoutResult.anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\t} else {\n\t\t\tthis.view.classList.add(adjusted.top >= anchor.top + anchor.height ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(adjusted.left >= anchor.left ? 'left' : 'right');\n\t\t}\n\n\t\t// Aligned from the geometry read above, so aligning forces no further layout\n\t\tconst { top, left } = alignViewToDevicePixels(adjusted, view, { width: positioningOrigin.width, height: positioningOrigin.height }, anchor, viewport, containerWindow.devicePixelRatio, titlebarAreaRect);\n\t\tthis.view.style.top = `${(top - positioningOrigin.top) / viewZoom}px`;\n\t\tthis.view.style.left = `${(left - positioningOrigin.left) / viewZoom}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown, skipAnimation = false): void {\n\t\tif (this.hidingContextView) {\n\t\t\tif (skipAnimation) {\n\t\t\t\tthis.completeHideAnimation();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (!delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toDispose = this.toDisposeOnClean;\n\t\tthis.toDisposeOnClean = Disposable.None;\n\n\t\tdelegate.onHide?.(data);\n\n\t\tconst isPopover = isPopoverDOMPosition(this.domPosition);\n\t\tif (isPopover) {\n\t\t\t// Stop tracking the owner first, then restore focus before the view\n\t\t\t// becomes inert or hidden, so that focus never leaves the owner\n\t\t\tthis.toDisposeOnPopoverHide.clear();\n\t\t\tconst showCount = this.showCount;\n\t\t\tthis.restorePopoverFocus();\n\t\t\tif (this.showCount !== showCount) {\n\t\t\t\t// Restoring focus showed another view, for example an input box\n\t\t\t\t// message; it now owns the view, so only clean up this rendering\n\t\t\t\ttoDispose.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.focusToRestore = null;\n\t\t}\n\n\t\tconst closeAnimation = delegate.closeAnimation;\n\t\tif (!skipAnimation && closeAnimation && closeAnimation.duration > 0 && hasRequiredAncestorClasses(this.view, closeAnimation.requiredAncestorClasses)) {\n\t\t\tthis.view.style.setProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE, `${closeAnimation.duration}ms`);\n\t\t\tthis.prepareMenuCloseAnimation();\n\t\t\tthis.view.inert = true;\n\t\t\tthis.view.classList.add(closeAnimation.className);\n\t\t\tconst timeout = setTimeout(() => this.completeHideAnimation(), closeAnimation.duration);\n\t\t\tthis.hidingContextView = {\n\t\t\t\tdisposable: toDisposable(() => clearTimeout(timeout)),\n\t\t\t\ttoDispose,\n\t\t\t\tclassName: closeAnimation.className\n\t\t\t};\n\t\t\treturn;\n\t\t}\n\n\t\tDOM.hide(this.view);\n\t\tif (isPopover) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\ttoDispose.dispose();\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate completeHideAnimation(): void {\n\t\tconst hidingContextView = this.hidingContextView;\n\t\tif (!hidingContextView) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hidingContextView = undefined;\n\t\thidingContextView.disposable.dispose();\n\t\tthis.view.classList.remove(hidingContextView.className);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE);\n\t\tDOM.hide(this.view);\n\t\tthis.view.inert = false;\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\thidingContextView.toDispose.dispose();\n\t}\n\n\tprivate prepareMenuCloseAnimation(): void {\n\t\tif (!this.view.classList.contains(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst surface = Array.from(this.view.children).find(element => DOM.isHTMLElement(element) && element.classList.contains('monaco-scrollable-element'));\n\t\tif (!DOM.isHTMLElement(surface)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst computedStyle = DOM.getWindow(surface).getComputedStyle(surface);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE, computedStyle.opacity);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE, computedStyle.transform);\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide(undefined, true);\n\t\tthis.completeHideAnimation();\n\n\t\tsuper.dispose();\n\t}\n}\n\n// Mirrors the popover reset in contextview.css, whose rules do not reach an\n// owner inside a shadow root\nconst POPOVER_RESET_CSS = /* css */ `\n\t.context-view[popover],\n\t.shadow-root-host[popover] {\n\t\tposition: fixed;\n\t\tinset: auto;\n\t\twidth: auto;\n\t\theight: auto;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\toverflow: visible;\n\t\tcolor: inherit;\n\t\tbackground: transparent;\n\t}\n`;\n\nconst shadowRootsWithPopoverReset = new WeakSet<ShadowRoot>();\n\nfunction adoptPopoverResetStyles(owner: HTMLElement): void {\n\tconst shadowRoot = DOM.getShadowRoot(owner);\n\tif (shadowRoot && !shadowRootsWithPopoverReset.has(shadowRoot)) {\n\t\tshadowRootsWithPopoverReset.add(shadowRoot);\n\t\tconst style = owner.ownerDocument.createElement('style');\n\t\tstyle.textContent = POPOVER_RESET_CSS;\n\t\tshadowRoot.appendChild(style);\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n\t${getContextViewMenuMotionCss(':host-context(.modern-ui.monaco-enable-motion)')}\n`;\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/contextview/contextview.ts","vs/base/browser/ui/cont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AAC,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QAChE,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACzD,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAC;QACtC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;AACF,CAAC;AAED,MAAM,eAAe,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuC/B,2BAA2B,CAAC,gDAAgD,CAAC;CAC/E,CAAC","file":"contextview.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { getVisibleWCOTitlebarAreaRect } from '../../browser.js';\nimport { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { createStyleSheet } from '../../domStylesheets.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { onUnexpectedError } from '../../../common/errors.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition, IRect, layout2d } from '../../../common/layout.js';\nimport * as platform from '../../../common/platform.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport { avoidWindowControlsOverlay, IWindowControlsOverlayPosition, IWindowControlsOverlaySize, IWindowControlsOverlayTitlebarRect, IWindowControlsOverlayViewport } from './windowControlsOverlay.js';\nimport './contextview.css';\n\nexport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition } from '../../../common/layout.js';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW,\n\t/**\n\t * Hosts the view inside the container (the owner) as a manual popover,\n\t * so focus stays inside the owner while the view renders in the top layer.\n\t */\n\tPOPOVER,\n\t/**\n\t * Like {@link ContextViewDOMPosition.POPOVER}, with the view in a shadow root.\n\t */\n\tPOPOVER_SHADOW\n}\n\nexport function isPopoverDOMPosition(domPosition: ContextViewDOMPosition): boolean {\n\treturn domPosition === ContextViewDOMPosition.POPOVER || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n}\n\nexport interface IContextViewRenderContext {\n\t/**\n\t * Where the view is actually hosted. A popover position can fall back\n\t * to a fixed position when the popover cannot be shown.\n\t */\n\treadonly domPosition: ContextViewDOMPosition;\n}\n\nexport interface IContextViewOptions {\n\t/**\n\t * Returns the container to use when a popover cannot be shown in its owner.\n\t * Defaults to the owner's document body.\n\t */\n\treadonly getFallbackContainer?: (owner: HTMLElement) => HTMLElement;\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement, context?: IContextViewRenderContext): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewCloseAnimation {\n\treadonly className: string;\n\treadonly duration: number;\n\t/** Requirements must match one ancestor; a nested array accepts any listed class. */\n\treadonly requiredAncestorClasses?: readonly (string | readonly string[])[];\n}\n\nexport function hasRequiredAncestorClasses(element: HTMLElement, classNames: IContextViewCloseAnimation['requiredAncestorClasses']): boolean {\n\tif (!classNames?.length) {\n\t\treturn true;\n\t}\n\n\tfor (let candidate: HTMLElement | null = element; candidate;) {\n\t\tconst current: HTMLElement = candidate;\n\t\tif (classNames.every(requirement => typeof requirement === 'string'\n\t\t\t? current.classList.contains(requirement)\n\t\t\t: requirement.some(className => current.classList.contains(className)))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (current.parentElement) {\n\t\t\tcandidate = current.parentElement;\n\t\t} else {\n\t\t\tconst root = current.getRootNode();\n\t\t\tcandidate = root instanceof ShadowRoot && DOM.isHTMLElement(root.host) ? root.host : null;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport const CONTEXT_VIEW_MENU_MOTION_CLASS = 'context-view-menu-motion';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS = 'context-view-menu-motion-closing';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION = 150;\nexport const CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES = [['modern-ui', 'modern-ui-frosted-glass'], 'monaco-enable-motion'] as const;\nexport const CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE = '--vscode-context-view-close-animation-duration';\nexport const CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE = '--vscode-context-view-menu-motion-shadow';\n/** Inherited while an opacity animation isolates descendant menu backdrops. */\nexport const CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-backdrop-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-close-start-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE = '--vscode-context-view-menu-motion-close-start-transform';\n\nexport const CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS = 250;\nexport const CONTEXT_VIEW_MENU_MOTION_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';\n\nexport const contextViewMenuCloseAnimation: IContextViewCloseAnimation = {\n\tclassName: CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS,\n\tduration: CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION,\n\trequiredAncestorClasses: CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES,\n};\n\nfunction getContextViewMenuMotionCss(enabledSelectorPrefix: string): string {\n\treturn /* css */ `\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} {\n\t\tanimation: none;\n\t\tbox-shadow: none;\n\t\toverflow: visible;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-open ${CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS}ms ${CONTEXT_VIEW_MENU_MOTION_EASING} backwards;\n\t\tbox-shadow: var(${CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE});\n\t\ttransform-origin: top left;\n\t\twill-change: opacity;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.right > .monaco-scrollable-element {\n\t\ttransform-origin: top right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top > .monaco-scrollable-element {\n\t\ttransform-origin: bottom left;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top.right > .monaco-scrollable-element {\n\t\ttransform-origin: bottom right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.${CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-close var(${CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE}) ${CONTEXT_VIEW_MENU_MOTION_EASING} both;\n\t\tpointer-events: none;\n\t}\n\n\t@keyframes context-view-menu-motion-open {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.97);\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes context-view-menu-motion-close {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE}, 1);\n\t\t\ttransform: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE}, scale(1));\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.99);\n\t\t}\n\t}`;\n}\n\nlet contextViewMenuMotionStyleSheet: HTMLStyleElement | undefined;\n\nfunction ensureContextViewMenuMotionStyleSheet(): void {\n\tif (!contextViewMenuMotionStyleSheet) {\n\t\tcontextViewMenuMotionStyleSheet = createStyleSheet(undefined, style => {\n\t\t\tstyle.textContent = getContextViewMenuMotionCss('.modern-ui.monaco-enable-motion');\n\t\t});\n\t}\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\n/**\n * Returns how far, in rendered CSS pixels, to move a view on one axis so that it starts on a whole\n * device pixel. Chromium paints the edges of an element at the device pixels nearest to them, so\n * the view rounds the edge that faces its anchor to the nearest device pixel: the end when the view\n * is before the anchor or lines up with the anchor's end, otherwise the start. When the view was laid\n * out to end at the anchor's edge, its end paints at that edge's device pixel even if its rendered\n * size differs from its layout size, so it neither covers the anchor nor leaves a gap.\n *\n * If that would move the view past the viewport, a view that lines up with its anchor instead rounds\n * the other way, and a view beside its anchor, which would move over the anchor, stays unaligned.\n *\n * `start`, `size`, `anchorStart` and `anchorSize` decide the side of the anchor the view was placed\n * on, so they are in the coordinates and layout size the view was placed with. `renderedStart` and\n * `renderedSize` are where the view is rendered, relative to the viewport, which is `viewportSize`.\n */\nfunction getViewDevicePixelAlignmentOffset(start: number, size: number, anchorStart: number, anchorSize: number, renderedStart: number, renderedSize: number, viewportSize: number, devicePixelRatio: number): number {\n\tconst epsilon = 0.01;\n\tconst before = start + size <= anchorStart + epsilon;\n\tconst beside = before || start + epsilon >= anchorStart + anchorSize;\n\tconst endsWithAnchor = Math.abs(start + size - (anchorStart + anchorSize)) <= epsilon && Math.abs(start - anchorStart) > epsilon;\n\tconst roundings: DOM.DevicePixelRounding[] = [before || (!beside && endsWithAnchor) ? 'nearestEnd' : 'nearest'];\n\tif (!beside) {\n\t\troundings.push('start', 'end');\n\t}\n\tconst anchorEdge = before ? anchorStart : anchorStart + anchorSize;\n\tconst anchorEnd = Math.abs(start + size - anchorEdge) <= epsilon ? anchorEdge - start + renderedStart : undefined;\n\tfor (const rounding of roundings) {\n\t\tconst offset = DOM.getDevicePixelAlignmentOffset(renderedStart, devicePixelRatio, rounding, renderedSize, anchorEnd);\n\t\t// Allows for floating-point error when a move lands exactly on the viewport's edge\n\t\tif ((offset >= 0 || renderedStart + offset >= -0.001) && (offset <= 0 || renderedStart + renderedSize + offset <= viewportSize + 0.001)) {\n\t\t\treturn offset;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/**\n * Moves a view's laid-out position so that its border box starts on whole device pixels (see\n * {@link DOM.alignToDevicePixels}), computed from geometry measured before the view moves so that\n * aligning forces no further layout.\n *\n * @param position The laid-out position, where the view is rendered, in the coordinate space of `viewport`.\n * @param layoutSize The size the view was laid out with, which decides the side of the anchor it is on.\n * @param renderedSize The rendered border-box size of the view.\n * @param anchor The rect the view is anchored to, which decides the edge of the view rounded on each axis.\n * @param viewport The visible area of the page, which the aligned view must stay inside.\n * @param devicePixelRatio The device pixel ratio of the window that shows the view.\n * @param titlebarAreaRect The visible window controls overlay, which the aligned view must not\n * cover when the view at `position` does not. Each axis keeps its alignment where it can.\n */\nexport function alignViewToDevicePixels(position: IWindowControlsOverlayPosition, layoutSize: IWindowControlsOverlaySize, renderedSize: IWindowControlsOverlaySize, anchor: IRect, viewport: IWindowControlsOverlayViewport, devicePixelRatio: number, titlebarAreaRect: IWindowControlsOverlayTitlebarRect | undefined): IWindowControlsOverlayPosition {\n\tconst align = (start: number, viewLayoutSize: number, viewRenderedSize: number, anchorStart: number, anchorSize: number, viewportStart: number, viewportSize: number) =>\n\t\tstart + getViewDevicePixelAlignmentOffset(start, viewLayoutSize, anchorStart, anchorSize, start - viewportStart, viewRenderedSize, viewportSize, devicePixelRatio);\n\tconst aligned = {\n\t\ttop: align(position.top, layoutSize.height, renderedSize.height, anchor.top, anchor.height, viewport.top, viewport.height),\n\t\tleft: align(position.left, layoutSize.width, renderedSize.width, anchor.left, anchor.width, viewport.left, viewport.width)\n\t};\n\tconst clearOfWindowControls = (candidate: IWindowControlsOverlayPosition) => avoidWindowControlsOverlay(titlebarAreaRect, viewport, renderedSize, candidate) === candidate;\n\tif (!clearOfWindowControls(position)) {\n\t\treturn aligned;\n\t}\n\tconst candidates = [aligned, { top: position.top, left: aligned.left }, { top: aligned.top, left: position.left }];\n\treturn candidates.find(clearOfWindowControls) ?? position;\n}\n\nexport function getAnchorRect(anchor: HTMLElement | StandardMouseEvent | IAnchor): IRect {\n\t// Get the element's position and size (to anchor the view)\n\tif (DOM.isHTMLElement(anchor)) {\n\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\treturn {\n\t\t\ttop: elementPosition.top,\n\t\t\tleft: elementPosition.left,\n\t\t\twidth: elementPosition.width,\n\t\t\theight: elementPosition.height\n\t\t};\n\t} else if (isAnchor(anchor)) {\n\t\treturn {\n\t\t\ttop: anchor.y,\n\t\t\tleft: anchor.x,\n\t\t\twidth: anchor.width || 1,\n\t\t\theight: anchor.height || 2\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\ttop: anchor.posy,\n\t\t\tleft: anchor.posx,\n\t\t\t// We are about to position the context view where the mouse\n\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\twidth: 2,\n\t\t\theight: 2\n\t\t};\n\t}\n}\n\nfunction getDeepActiveElement(doc: Document): Element | null {\n\tlet result = doc.activeElement;\n\twhile (result?.shadowRoot?.activeElement) {\n\t\tresult = result.shadowRoot.activeElement;\n\t}\n\treturn result;\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\tprivate static readonly ISOLATED_KEY_EVENTS = ['keydown', 'keyup', 'keypress'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate hidingContextView: { readonly disposable: IDisposable; readonly toDispose: IDisposable; readonly className: string } | undefined;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\tprivate domPosition: ContextViewDOMPosition = ContextViewDOMPosition.ABSOLUTE;\n\tprivate readonly toDisposeOnPopoverHide = this._register(new DisposableStore());\n\tprivate focusToRestore: HTMLElement | null = null;\n\tprivate showCount = 0;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition, private readonly options: IContextViewOptions = {}) {\n\t\tsuper();\n\n\t\tensureContextViewMenuMotionStyleSheet();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tconst previousDOMPosition = this.domPosition;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tconst useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n\t\tconst unchanged = container === this.container && usedShadowDOM === useShadowDOM && isPopoverDOMPosition(previousDOMPosition) === isPopoverDOMPosition(domPosition);\n\n\t\t// Tear down the previous popover while its position is still current, so\n\t\t// that its owner tracking is disposed and its top layer entry is closed\n\t\tif (this.container && !unchanged && isPopoverDOMPosition(previousDOMPosition)) {\n\t\t\tthis.hide(undefined, true);\n\t\t\tthis.completeHideAnimation();\n\t\t}\n\n\t\tthis.domPosition = domPosition;\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tthis.useShadowDOM = useShadowDOM;\n\n\t\tif (unchanged) {\n\t\t\treturn; // container is the same and neither shadow DOM nor popover usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tthis.view.removeAttribute('popover');\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\t\t\tconst isPopover = isPopoverDOMPosition(domPosition);\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tObject.assign(this.shadowRootHostElement.style, {\n\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\ttop: '0',\n\t\t\t\t\tleft: '0',\n\t\t\t\t\twidth: '0',\n\t\t\t\t\theight: '0'\n\t\t\t\t});\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.shadowRootHostElement.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\t}\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.view.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tif (isPopover) {\n\t\t\t\t// Keep keys pressed in the view from reaching the owner or\n\t\t\t\t// window-level keybinding listeners while the view is hosted.\n\t\t\t\tconst popoverElement = this.getPopoverElement();\n\t\t\t\tContextView.ISOLATED_KEY_EVENTS.forEach(event => {\n\t\t\t\t\ttoDisposeOnSetContainer.add(DOM.addDisposableListener(popoverElement, event, e => e.stopPropagation()));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tthis.showCount++;\n\t\tthis.completeHideAnimation();\n\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide(undefined, true);\n\t\t}\n\n\t\tconst ownerDocument = this.container?.ownerDocument ?? DOM.getActiveDocument();\n\t\tconst activeElement = getDeepActiveElement(ownerDocument);\n\t\tthis.focusToRestore = DOM.isHTMLElement(activeElement) ? activeElement : null;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.showPopover();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.zIndex = zIndex;\n\t\tif (this.shadowRootHostElement) {\n\t\t\tthis.shadowRootHostElement.style.zIndex = zIndex;\n\t\t}\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view, { domPosition: this.domPosition }) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.trackPopoverOwner();\n\t\t}\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Layout hides the view when its popover owner is hidden or removed,\n\t\t// for example by rendering; do not move focus into a hidden view\n\t\tif (this.delegate !== delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Focus\n\t\tdelegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tprivate getPopoverElement(): HTMLElement {\n\t\treturn this.shadowRootHostElement ?? this.view;\n\t}\n\n\tprivate showPopover(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fall back to a fixed position without the Popover API or a connected\n\t\t// owner; only report a failure to show a popover that should have shown\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (typeof popoverElement.showPopover === 'function' && owner.isConnected) {\n\t\t\ttry {\n\t\t\t\tif (popoverElement.parentElement !== owner) {\n\t\t\t\t\tadoptPopoverResetStyles(owner);\n\t\t\t\t\towner.appendChild(popoverElement);\n\t\t\t\t}\n\t\t\t\tif (!popoverElement.matches(':popover-open')) {\n\t\t\t\t\tpopoverElement.showPopover();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\t\t}\n\n\t\tpopoverElement.remove();\n\t\tconst fallbackContainer = this.options.getFallbackContainer?.(owner) ?? DOM.getWindow(owner).document.body;\n\t\tthis.setContainer(fallbackContainer, this.domPosition === ContextViewDOMPosition.POPOVER_SHADOW ? ContextViewDOMPosition.FIXED_SHADOW : ContextViewDOMPosition.FIXED);\n\t}\n\n\tprivate trackPopoverOwner(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tconst targetWindow = DOM.getWindow(owner);\n\n\t\t// Dismiss on pointer presses outside both the view and its owner, without restoring focus\n\t\tthis.toDisposeOnPopoverHide.add(DOM.addDisposableListener(targetWindow, DOM.EventType.POINTER_DOWN, e => {\n\t\t\tconst path = e.composedPath();\n\t\t\tif (!path.includes(popoverElement) && !path.includes(owner)) {\n\t\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\t}\n\t\t}, true));\n\n\t\tconst ResizeObserverCtor = (targetWindow as Window & typeof globalThis).ResizeObserver;\n\t\tif (typeof ResizeObserverCtor === 'function') {\n\t\t\tconst observer = new ResizeObserverCtor(() => this.checkPopoverOwner());\n\t\t\tobserver.observe(owner);\n\t\t\tthis.toDisposeOnPopoverHide.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\t}\n\n\tprivate isPopoverOwnerLost(): boolean {\n\t\tconst owner = this.container;\n\t\treturn !owner || !owner.isConnected || owner.getClientRects().length === 0;\n\t}\n\n\tprivate checkPopoverOwner(): boolean {\n\t\tif (this.isVisible() && isPopoverDOMPosition(this.domPosition) && this.isPopoverOwnerLost()) {\n\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate hideWithoutRestoringFocus(): void {\n\t\tthis.focusToRestore = null;\n\t\tthis.hide(undefined, true);\n\t}\n\n\tprivate restorePopoverFocus(): void {\n\t\tconst focusToRestore = this.focusToRestore;\n\t\tthis.focusToRestore = null;\n\t\tif (!focusToRestore?.isConnected) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = getDeepActiveElement(focusToRestore.ownerDocument);\n\t\tif (activeElement && (activeElement === focusToRestore.ownerDocument.body || DOM.isAncestor(activeElement, this.view))) {\n\t\t\tfocusToRestore.focus();\n\t\t}\n\t}\n\n\tprivate hidePopover(): void {\n\t\tthis.toDisposeOnPopoverHide.clear();\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (popoverElement.hasAttribute('popover') && popoverElement.matches(':popover-open')) {\n\t\t\tpopoverElement.hidePopover();\n\t\t}\n\n\t\t// Leave nothing behind in the owner, which may be an arbitrary element such as an input's parent\n\t\tpopoverElement.remove();\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.checkPopoverOwner()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = getAnchorRect(this.delegate!.getAnchor());\n\t\tconst containerWindow = this.container ? DOM.getWindow(this.container) : DOM.getActiveWindow();\n\t\tconst viewport = { top: containerWindow.pageYOffset, left: containerWindow.pageXOffset, width: containerWindow.innerWidth, height: containerWindow.innerHeight };\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst positioningOrigin = DOM.getDomNodePagePosition(this.view);\n\t\tconst viewZoom = DOM.getDomNodeZoomLevel(this.view);\n\t\tconst view = { width: DOM.getTotalWidth(this.view) * viewZoom, height: DOM.getTotalHeight(this.view) * viewZoom };\n\t\tconst anchorPosition = this.delegate!.anchorPosition;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment;\n\t\tconst layoutResult = layout2d(viewport, view, anchor, { anchorAlignment, anchorPosition, anchorAxisAlignment });\n\t\tconst titlebarAreaRect = getVisibleWCOTitlebarAreaRect(containerWindow);\n\t\tconst adjusted = avoidWindowControlsOverlay(titlebarAreaRect, viewport, view, layoutResult);\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tif (adjusted === layoutResult) {\n\t\t\tthis.view.classList.add(layoutResult.anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(layoutResult.anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\t} else {\n\t\t\tthis.view.classList.add(adjusted.top >= anchor.top + anchor.height ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(adjusted.left >= anchor.left ? 'left' : 'right');\n\t\t}\n\n\t\t// Aligned from the geometry read above, so aligning forces no further layout\n\t\tconst { top, left } = alignViewToDevicePixels(adjusted, view, { width: positioningOrigin.width, height: positioningOrigin.height }, anchor, viewport, containerWindow.devicePixelRatio, titlebarAreaRect);\n\t\tthis.view.style.top = `${(top - positioningOrigin.top) / viewZoom}px`;\n\t\tthis.view.style.left = `${(left - positioningOrigin.left) / viewZoom}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown, skipAnimation = false): void {\n\t\tif (this.hidingContextView) {\n\t\t\tif (skipAnimation) {\n\t\t\t\tthis.completeHideAnimation();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (!delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toDispose = this.toDisposeOnClean;\n\t\tthis.toDisposeOnClean = Disposable.None;\n\n\t\tdelegate.onHide?.(data);\n\n\t\tconst isPopover = isPopoverDOMPosition(this.domPosition);\n\t\tif (isPopover) {\n\t\t\t// Stop tracking the owner first, then restore focus before the view\n\t\t\t// becomes inert or hidden, so that focus never leaves the owner\n\t\t\tthis.toDisposeOnPopoverHide.clear();\n\t\t\tconst showCount = this.showCount;\n\t\t\tthis.restorePopoverFocus();\n\t\t\tif (this.showCount !== showCount) {\n\t\t\t\t// Restoring focus showed another view, for example an input box\n\t\t\t\t// message; it now owns the view, so only clean up this rendering\n\t\t\t\ttoDispose.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.focusToRestore = null;\n\t\t}\n\n\t\tconst closeAnimation = delegate.closeAnimation;\n\t\tif (!skipAnimation && closeAnimation && closeAnimation.duration > 0 && hasRequiredAncestorClasses(this.view, closeAnimation.requiredAncestorClasses)) {\n\t\t\tthis.view.style.setProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE, `${closeAnimation.duration}ms`);\n\t\t\tthis.prepareMenuCloseAnimation();\n\t\t\tthis.view.inert = true;\n\t\t\tthis.view.classList.add(closeAnimation.className);\n\t\t\tconst timeout = setTimeout(() => this.completeHideAnimation(), closeAnimation.duration);\n\t\t\tthis.hidingContextView = {\n\t\t\t\tdisposable: toDisposable(() => clearTimeout(timeout)),\n\t\t\t\ttoDispose,\n\t\t\t\tclassName: closeAnimation.className\n\t\t\t};\n\t\t\treturn;\n\t\t}\n\n\t\tDOM.hide(this.view);\n\t\tif (isPopover) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\ttoDispose.dispose();\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate completeHideAnimation(): void {\n\t\tconst hidingContextView = this.hidingContextView;\n\t\tif (!hidingContextView) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hidingContextView = undefined;\n\t\thidingContextView.disposable.dispose();\n\t\tthis.view.classList.remove(hidingContextView.className);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE);\n\t\tDOM.hide(this.view);\n\t\tthis.view.inert = false;\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\thidingContextView.toDispose.dispose();\n\t}\n\n\tprivate prepareMenuCloseAnimation(): void {\n\t\tif (!this.view.classList.contains(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst surface = Array.from(this.view.children).find(element => DOM.isHTMLElement(element) && element.classList.contains('monaco-scrollable-element'));\n\t\tif (!DOM.isHTMLElement(surface)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst computedStyle = DOM.getWindow(surface).getComputedStyle(surface);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE, computedStyle.opacity);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE, computedStyle.transform);\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide(undefined, true);\n\t\tthis.completeHideAnimation();\n\n\t\tsuper.dispose();\n\t}\n}\n\n// Mirrors the popover reset in contextview.css, whose rules do not reach an\n// owner inside a shadow root\nconst POPOVER_RESET_CSS = /* css */ `\n\t.context-view[popover],\n\t.shadow-root-host[popover] {\n\t\tposition: fixed;\n\t\tinset: auto;\n\t\twidth: auto;\n\t\theight: auto;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\toverflow: visible;\n\t\tcolor: inherit;\n\t\tbackground: transparent;\n\t}\n`;\n\nconst shadowRootsWithPopoverReset = new WeakSet<ShadowRoot>();\n\nfunction adoptPopoverResetStyles(owner: HTMLElement): void {\n\tconst shadowRoot = DOM.getShadowRoot(owner);\n\tif (shadowRoot && !shadowRootsWithPopoverReset.has(shadowRoot)) {\n\t\tshadowRootsWithPopoverReset.add(shadowRoot);\n\t\tconst style = owner.ownerDocument.createElement('style');\n\t\tstyle.textContent = POPOVER_RESET_CSS;\n\t\tshadowRoot.appendChild(style);\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"vscode-digit-full-stop\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n\t${getContextViewMenuMotionCss(':host-context(.modern-ui.monaco-enable-motion)')}\n`;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { getVisibleWCOTitlebarAreaRect } from '../../browser.js';\nimport { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { createStyleSheet } from '../../domStylesheets.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { onUnexpectedError } from '../../../common/errors.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition, IRect, layout2d } from '../../../common/layout.js';\nimport * as platform from '../../../common/platform.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport { avoidWindowControlsOverlay, IWindowControlsOverlayPosition, IWindowControlsOverlaySize, IWindowControlsOverlayTitlebarRect, IWindowControlsOverlayViewport } from './windowControlsOverlay.js';\nimport './contextview.css';\n\nexport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition } from '../../../common/layout.js';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW,\n\t/**\n\t * Hosts the view inside the container (the owner) as a manual popover,\n\t * so focus stays inside the owner while the view renders in the top layer.\n\t */\n\tPOPOVER,\n\t/**\n\t * Like {@link ContextViewDOMPosition.POPOVER}, with the view in a shadow root.\n\t */\n\tPOPOVER_SHADOW\n}\n\nexport function isPopoverDOMPosition(domPosition: ContextViewDOMPosition): boolean {\n\treturn domPosition === ContextViewDOMPosition.POPOVER || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n}\n\nexport interface IContextViewRenderContext {\n\t/**\n\t * Where the view is actually hosted. A popover position can fall back\n\t * to a fixed position when the popover cannot be shown.\n\t */\n\treadonly domPosition: ContextViewDOMPosition;\n}\n\nexport interface IContextViewOptions {\n\t/**\n\t * Returns the container to use when a popover cannot be shown in its owner.\n\t * Defaults to the owner's document body.\n\t */\n\treadonly getFallbackContainer?: (owner: HTMLElement) => HTMLElement;\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement, context?: IContextViewRenderContext): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewCloseAnimation {\n\treadonly className: string;\n\treadonly duration: number;\n\t/** Requirements must match one ancestor; a nested array accepts any listed class. */\n\treadonly requiredAncestorClasses?: readonly (string | readonly string[])[];\n}\n\nexport function hasRequiredAncestorClasses(element: HTMLElement, classNames: IContextViewCloseAnimation['requiredAncestorClasses']): boolean {\n\tif (!classNames?.length) {\n\t\treturn true;\n\t}\n\n\tfor (let candidate: HTMLElement | null = element; candidate;) {\n\t\tconst current: HTMLElement = candidate;\n\t\tif (classNames.every(requirement => typeof requirement === 'string'\n\t\t\t? current.classList.contains(requirement)\n\t\t\t: requirement.some(className => current.classList.contains(className)))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (current.parentElement) {\n\t\t\tcandidate = current.parentElement;\n\t\t} else {\n\t\t\tconst root = current.getRootNode();\n\t\t\tcandidate = root instanceof ShadowRoot && DOM.isHTMLElement(root.host) ? root.host : null;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport const CONTEXT_VIEW_MENU_MOTION_CLASS = 'context-view-menu-motion';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS = 'context-view-menu-motion-closing';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION = 150;\nexport const CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES = [['modern-ui', 'modern-ui-frosted-glass'], 'monaco-enable-motion'] as const;\nexport const CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE = '--vscode-context-view-close-animation-duration';\nexport const CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE = '--vscode-context-view-menu-motion-shadow';\n/** Inherited while an opacity animation isolates descendant menu backdrops. */\nexport const CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-backdrop-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-close-start-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE = '--vscode-context-view-menu-motion-close-start-transform';\n\nexport const CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS = 250;\nexport const CONTEXT_VIEW_MENU_MOTION_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';\n\nexport const contextViewMenuCloseAnimation: IContextViewCloseAnimation = {\n\tclassName: CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS,\n\tduration: CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION,\n\trequiredAncestorClasses: CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES,\n};\n\nfunction getContextViewMenuMotionCss(enabledSelectorPrefix: string): string {\n\treturn /* css */ `\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} {\n\t\tanimation: none;\n\t\tbox-shadow: none;\n\t\toverflow: visible;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-open ${CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS}ms ${CONTEXT_VIEW_MENU_MOTION_EASING} backwards;\n\t\tbox-shadow: var(${CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE});\n\t\ttransform-origin: top left;\n\t\twill-change: opacity;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.right > .monaco-scrollable-element {\n\t\ttransform-origin: top right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top > .monaco-scrollable-element {\n\t\ttransform-origin: bottom left;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top.right > .monaco-scrollable-element {\n\t\ttransform-origin: bottom right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.${CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-close var(${CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE}) ${CONTEXT_VIEW_MENU_MOTION_EASING} both;\n\t\tpointer-events: none;\n\t}\n\n\t@keyframes context-view-menu-motion-open {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.97);\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes context-view-menu-motion-close {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE}, 1);\n\t\t\ttransform: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE}, scale(1));\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.99);\n\t\t}\n\t}`;\n}\n\nlet contextViewMenuMotionStyleSheet: HTMLStyleElement | undefined;\n\nfunction ensureContextViewMenuMotionStyleSheet(): void {\n\tif (!contextViewMenuMotionStyleSheet) {\n\t\tcontextViewMenuMotionStyleSheet = createStyleSheet(undefined, style => {\n\t\t\tstyle.textContent = getContextViewMenuMotionCss('.modern-ui.monaco-enable-motion');\n\t\t});\n\t}\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\n/**\n * Returns how far, in rendered CSS pixels, to move a view on one axis so that it starts on a whole\n * device pixel. Chromium paints the edges of an element at the device pixels nearest to them, so\n * the view rounds the edge that faces its anchor to the nearest device pixel: the end when the view\n * is before the anchor or lines up with the anchor's end, otherwise the start. When the view was laid\n * out to end at the anchor's edge, its end paints at that edge's device pixel even if its rendered\n * size differs from its layout size, so it neither covers the anchor nor leaves a gap.\n *\n * If that would move the view past the viewport, a view that lines up with its anchor instead rounds\n * the other way, and a view beside its anchor, which would move over the anchor, stays unaligned.\n *\n * `start`, `size`, `anchorStart` and `anchorSize` decide the side of the anchor the view was placed\n * on, so they are in the coordinates and layout size the view was placed with. `renderedStart` and\n * `renderedSize` are where the view is rendered, relative to the viewport, which is `viewportSize`.\n */\nfunction getViewDevicePixelAlignmentOffset(start: number, size: number, anchorStart: number, anchorSize: number, renderedStart: number, renderedSize: number, viewportSize: number, devicePixelRatio: number): number {\n\tconst epsilon = 0.01;\n\tconst before = start + size <= anchorStart + epsilon;\n\tconst beside = before || start + epsilon >= anchorStart + anchorSize;\n\tconst endsWithAnchor = Math.abs(start + size - (anchorStart + anchorSize)) <= epsilon && Math.abs(start - anchorStart) > epsilon;\n\tconst roundings: DOM.DevicePixelRounding[] = [before || (!beside && endsWithAnchor) ? 'nearestEnd' : 'nearest'];\n\tif (!beside) {\n\t\troundings.push('start', 'end');\n\t}\n\tconst anchorEdge = before ? anchorStart : anchorStart + anchorSize;\n\tconst anchorEnd = Math.abs(start + size - anchorEdge) <= epsilon ? anchorEdge - start + renderedStart : undefined;\n\tfor (const rounding of roundings) {\n\t\tconst offset = DOM.getDevicePixelAlignmentOffset(renderedStart, devicePixelRatio, rounding, renderedSize, anchorEnd);\n\t\t// Allows for floating-point error when a move lands exactly on the viewport's edge\n\t\tif ((offset >= 0 || renderedStart + offset >= -0.001) && (offset <= 0 || renderedStart + renderedSize + offset <= viewportSize + 0.001)) {\n\t\t\treturn offset;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/**\n * Moves a view's laid-out position so that its border box starts on whole device pixels (see\n * {@link DOM.alignToDevicePixels}), computed from geometry measured before the view moves so that\n * aligning forces no further layout.\n *\n * @param position The laid-out position, where the view is rendered, in the coordinate space of `viewport`.\n * @param layoutSize The size the view was laid out with, which decides the side of the anchor it is on.\n * @param renderedSize The rendered border-box size of the view.\n * @param anchor The rect the view is anchored to, which decides the edge of the view rounded on each axis.\n * @param viewport The visible area of the page, which the aligned view must stay inside.\n * @param devicePixelRatio The device pixel ratio of the window that shows the view.\n * @param titlebarAreaRect The visible window controls overlay, which the aligned view must not\n * cover when the view at `position` does not. Each axis keeps its alignment where it can.\n */\nexport function alignViewToDevicePixels(position: IWindowControlsOverlayPosition, layoutSize: IWindowControlsOverlaySize, renderedSize: IWindowControlsOverlaySize, anchor: IRect, viewport: IWindowControlsOverlayViewport, devicePixelRatio: number, titlebarAreaRect: IWindowControlsOverlayTitlebarRect | undefined): IWindowControlsOverlayPosition {\n\tconst align = (start: number, viewLayoutSize: number, viewRenderedSize: number, anchorStart: number, anchorSize: number, viewportStart: number, viewportSize: number) =>\n\t\tstart + getViewDevicePixelAlignmentOffset(start, viewLayoutSize, anchorStart, anchorSize, start - viewportStart, viewRenderedSize, viewportSize, devicePixelRatio);\n\tconst aligned = {\n\t\ttop: align(position.top, layoutSize.height, renderedSize.height, anchor.top, anchor.height, viewport.top, viewport.height),\n\t\tleft: align(position.left, layoutSize.width, renderedSize.width, anchor.left, anchor.width, viewport.left, viewport.width)\n\t};\n\tconst clearOfWindowControls = (candidate: IWindowControlsOverlayPosition) => avoidWindowControlsOverlay(titlebarAreaRect, viewport, renderedSize, candidate) === candidate;\n\tif (!clearOfWindowControls(position)) {\n\t\treturn aligned;\n\t}\n\tconst candidates = [aligned, { top: position.top, left: aligned.left }, { top: aligned.top, left: position.left }];\n\treturn candidates.find(clearOfWindowControls) ?? position;\n}\n\nexport function getAnchorRect(anchor: HTMLElement | StandardMouseEvent | IAnchor): IRect {\n\t// Get the element's position and size (to anchor the view)\n\tif (DOM.isHTMLElement(anchor)) {\n\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\treturn {\n\t\t\ttop: elementPosition.top,\n\t\t\tleft: elementPosition.left,\n\t\t\twidth: elementPosition.width,\n\t\t\theight: elementPosition.height\n\t\t};\n\t} else if (isAnchor(anchor)) {\n\t\treturn {\n\t\t\ttop: anchor.y,\n\t\t\tleft: anchor.x,\n\t\t\twidth: anchor.width || 1,\n\t\t\theight: anchor.height || 2\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\ttop: anchor.posy,\n\t\t\tleft: anchor.posx,\n\t\t\t// We are about to position the context view where the mouse\n\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\twidth: 2,\n\t\t\theight: 2\n\t\t};\n\t}\n}\n\nfunction getDeepActiveElement(doc: Document): Element | null {\n\tlet result = doc.activeElement;\n\twhile (result?.shadowRoot?.activeElement) {\n\t\tresult = result.shadowRoot.activeElement;\n\t}\n\treturn result;\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\tprivate static readonly ISOLATED_KEY_EVENTS = ['keydown', 'keyup', 'keypress'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate hidingContextView: { readonly disposable: IDisposable; readonly toDispose: IDisposable; readonly className: string } | undefined;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\tprivate domPosition: ContextViewDOMPosition = ContextViewDOMPosition.ABSOLUTE;\n\tprivate readonly toDisposeOnPopoverHide = this._register(new DisposableStore());\n\tprivate focusToRestore: HTMLElement | null = null;\n\tprivate showCount = 0;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition, private readonly options: IContextViewOptions = {}) {\n\t\tsuper();\n\n\t\tensureContextViewMenuMotionStyleSheet();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tconst previousDOMPosition = this.domPosition;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tconst useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n\t\tconst unchanged = container === this.container && usedShadowDOM === useShadowDOM && isPopoverDOMPosition(previousDOMPosition) === isPopoverDOMPosition(domPosition);\n\n\t\t// Tear down the previous popover while its position is still current, so\n\t\t// that its owner tracking is disposed and its top layer entry is closed\n\t\tif (this.container && !unchanged && isPopoverDOMPosition(previousDOMPosition)) {\n\t\t\tthis.hide(undefined, true);\n\t\t\tthis.completeHideAnimation();\n\t\t}\n\n\t\tthis.domPosition = domPosition;\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tthis.useShadowDOM = useShadowDOM;\n\n\t\tif (unchanged) {\n\t\t\treturn; // container is the same and neither shadow DOM nor popover usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tthis.view.removeAttribute('popover');\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\t\t\tconst isPopover = isPopoverDOMPosition(domPosition);\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tObject.assign(this.shadowRootHostElement.style, {\n\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\ttop: '0',\n\t\t\t\t\tleft: '0',\n\t\t\t\t\twidth: '0',\n\t\t\t\t\theight: '0'\n\t\t\t\t});\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.shadowRootHostElement.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\t}\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.view.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tif (isPopover) {\n\t\t\t\t// Keep keys pressed in the view from reaching the owner or\n\t\t\t\t// window-level keybinding listeners while the view is hosted.\n\t\t\t\tconst popoverElement = this.getPopoverElement();\n\t\t\t\tContextView.ISOLATED_KEY_EVENTS.forEach(event => {\n\t\t\t\t\ttoDisposeOnSetContainer.add(DOM.addDisposableListener(popoverElement, event, e => e.stopPropagation()));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tthis.showCount++;\n\t\tthis.completeHideAnimation();\n\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide(undefined, true);\n\t\t}\n\n\t\tconst ownerDocument = this.container?.ownerDocument ?? DOM.getActiveDocument();\n\t\tconst activeElement = getDeepActiveElement(ownerDocument);\n\t\tthis.focusToRestore = DOM.isHTMLElement(activeElement) ? activeElement : null;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.showPopover();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.zIndex = zIndex;\n\t\tif (this.shadowRootHostElement) {\n\t\t\tthis.shadowRootHostElement.style.zIndex = zIndex;\n\t\t}\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view, { domPosition: this.domPosition }) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.trackPopoverOwner();\n\t\t}\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Layout hides the view when its popover owner is hidden or removed,\n\t\t// for example by rendering; do not move focus into a hidden view\n\t\tif (this.delegate !== delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Focus\n\t\tdelegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tprivate getPopoverElement(): HTMLElement {\n\t\treturn this.shadowRootHostElement ?? this.view;\n\t}\n\n\tprivate showPopover(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fall back to a fixed position without the Popover API or a connected\n\t\t// owner; only report a failure to show a popover that should have shown\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (typeof popoverElement.showPopover === 'function' && owner.isConnected) {\n\t\t\ttry {\n\t\t\t\tif (popoverElement.parentElement !== owner) {\n\t\t\t\t\tadoptPopoverResetStyles(owner);\n\t\t\t\t\towner.appendChild(popoverElement);\n\t\t\t\t}\n\t\t\t\tif (!popoverElement.matches(':popover-open')) {\n\t\t\t\t\tpopoverElement.showPopover();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\t\t}\n\n\t\tpopoverElement.remove();\n\t\tconst fallbackContainer = this.options.getFallbackContainer?.(owner) ?? DOM.getWindow(owner).document.body;\n\t\tthis.setContainer(fallbackContainer, this.domPosition === ContextViewDOMPosition.POPOVER_SHADOW ? ContextViewDOMPosition.FIXED_SHADOW : ContextViewDOMPosition.FIXED);\n\t}\n\n\tprivate trackPopoverOwner(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tconst targetWindow = DOM.getWindow(owner);\n\n\t\t// Dismiss on pointer presses outside both the view and its owner, without restoring focus\n\t\tthis.toDisposeOnPopoverHide.add(DOM.addDisposableListener(targetWindow, DOM.EventType.POINTER_DOWN, e => {\n\t\t\tconst path = e.composedPath();\n\t\t\tif (!path.includes(popoverElement) && !path.includes(owner)) {\n\t\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\t}\n\t\t}, true));\n\n\t\tconst ResizeObserverCtor = (targetWindow as Window & typeof globalThis).ResizeObserver;\n\t\tif (typeof ResizeObserverCtor === 'function') {\n\t\t\tconst observer = new ResizeObserverCtor(() => this.checkPopoverOwner());\n\t\t\tobserver.observe(owner);\n\t\t\tthis.toDisposeOnPopoverHide.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\t}\n\n\tprivate isPopoverOwnerLost(): boolean {\n\t\tconst owner = this.container;\n\t\treturn !owner || !owner.isConnected || owner.getClientRects().length === 0;\n\t}\n\n\tprivate checkPopoverOwner(): boolean {\n\t\tif (this.isVisible() && isPopoverDOMPosition(this.domPosition) && this.isPopoverOwnerLost()) {\n\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate hideWithoutRestoringFocus(): void {\n\t\tthis.focusToRestore = null;\n\t\tthis.hide(undefined, true);\n\t}\n\n\tprivate restorePopoverFocus(): void {\n\t\tconst focusToRestore = this.focusToRestore;\n\t\tthis.focusToRestore = null;\n\t\tif (!focusToRestore?.isConnected) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = getDeepActiveElement(focusToRestore.ownerDocument);\n\t\tif (activeElement && (activeElement === focusToRestore.ownerDocument.body || DOM.isAncestor(activeElement, this.view))) {\n\t\t\tfocusToRestore.focus();\n\t\t}\n\t}\n\n\tprivate hidePopover(): void {\n\t\tthis.toDisposeOnPopoverHide.clear();\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (popoverElement.hasAttribute('popover') && popoverElement.matches(':popover-open')) {\n\t\t\tpopoverElement.hidePopover();\n\t\t}\n\n\t\t// Leave nothing behind in the owner, which may be an arbitrary element such as an input's parent\n\t\tpopoverElement.remove();\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.checkPopoverOwner()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = getAnchorRect(this.delegate!.getAnchor());\n\t\tconst containerWindow = this.container ? DOM.getWindow(this.container) : DOM.getActiveWindow();\n\t\tconst viewport = { top: containerWindow.pageYOffset, left: containerWindow.pageXOffset, width: containerWindow.innerWidth, height: containerWindow.innerHeight };\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst positioningOrigin = DOM.getDomNodePagePosition(this.view);\n\t\tconst viewZoom = DOM.getDomNodeZoomLevel(this.view);\n\t\tconst view = { width: DOM.getTotalWidth(this.view) * viewZoom, height: DOM.getTotalHeight(this.view) * viewZoom };\n\t\tconst anchorPosition = this.delegate!.anchorPosition;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment;\n\t\tconst layoutResult = layout2d(viewport, view, anchor, { anchorAlignment, anchorPosition, anchorAxisAlignment });\n\t\tconst titlebarAreaRect = getVisibleWCOTitlebarAreaRect(containerWindow);\n\t\tconst adjusted = avoidWindowControlsOverlay(titlebarAreaRect, viewport, view, layoutResult);\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tif (adjusted === layoutResult) {\n\t\t\tthis.view.classList.add(layoutResult.anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(layoutResult.anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\t} else {\n\t\t\tthis.view.classList.add(adjusted.top >= anchor.top + anchor.height ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(adjusted.left >= anchor.left ? 'left' : 'right');\n\t\t}\n\n\t\t// Aligned from the geometry read above, so aligning forces no further layout\n\t\tconst { top, left } = alignViewToDevicePixels(adjusted, view, { width: positioningOrigin.width, height: positioningOrigin.height }, anchor, viewport, containerWindow.devicePixelRatio, titlebarAreaRect);\n\t\tthis.view.style.top = `${(top - positioningOrigin.top) / viewZoom}px`;\n\t\tthis.view.style.left = `${(left - positioningOrigin.left) / viewZoom}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown, skipAnimation = false): void {\n\t\tif (this.hidingContextView) {\n\t\t\tif (skipAnimation) {\n\t\t\t\tthis.completeHideAnimation();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (!delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toDispose = this.toDisposeOnClean;\n\t\tthis.toDisposeOnClean = Disposable.None;\n\n\t\tdelegate.onHide?.(data);\n\n\t\tconst isPopover = isPopoverDOMPosition(this.domPosition);\n\t\tif (isPopover) {\n\t\t\t// Stop tracking the owner first, then restore focus before the view\n\t\t\t// becomes inert or hidden, so that focus never leaves the owner\n\t\t\tthis.toDisposeOnPopoverHide.clear();\n\t\t\tconst showCount = this.showCount;\n\t\t\tthis.restorePopoverFocus();\n\t\t\tif (this.showCount !== showCount) {\n\t\t\t\t// Restoring focus showed another view, for example an input box\n\t\t\t\t// message; it now owns the view, so only clean up this rendering\n\t\t\t\ttoDispose.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.focusToRestore = null;\n\t\t}\n\n\t\tconst closeAnimation = delegate.closeAnimation;\n\t\tif (!skipAnimation && closeAnimation && closeAnimation.duration > 0 && hasRequiredAncestorClasses(this.view, closeAnimation.requiredAncestorClasses)) {\n\t\t\tthis.view.style.setProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE, `${closeAnimation.duration}ms`);\n\t\t\tthis.prepareMenuCloseAnimation();\n\t\t\tthis.view.inert = true;\n\t\t\tthis.view.classList.add(closeAnimation.className);\n\t\t\tconst timeout = setTimeout(() => this.completeHideAnimation(), closeAnimation.duration);\n\t\t\tthis.hidingContextView = {\n\t\t\t\tdisposable: toDisposable(() => clearTimeout(timeout)),\n\t\t\t\ttoDispose,\n\t\t\t\tclassName: closeAnimation.className\n\t\t\t};\n\t\t\treturn;\n\t\t}\n\n\t\tDOM.hide(this.view);\n\t\tif (isPopover) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\ttoDispose.dispose();\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate completeHideAnimation(): void {\n\t\tconst hidingContextView = this.hidingContextView;\n\t\tif (!hidingContextView) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hidingContextView = undefined;\n\t\thidingContextView.disposable.dispose();\n\t\tthis.view.classList.remove(hidingContextView.className);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE);\n\t\tDOM.hide(this.view);\n\t\tthis.view.inert = false;\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\thidingContextView.toDispose.dispose();\n\t}\n\n\tprivate prepareMenuCloseAnimation(): void {\n\t\tif (!this.view.classList.contains(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst surface = Array.from(this.view.children).find(element => DOM.isHTMLElement(element) && element.classList.contains('monaco-scrollable-element'));\n\t\tif (!DOM.isHTMLElement(surface)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst computedStyle = DOM.getWindow(surface).getComputedStyle(surface);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE, computedStyle.opacity);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE, computedStyle.transform);\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide(undefined, true);\n\t\tthis.completeHideAnimation();\n\n\t\tsuper.dispose();\n\t}\n}\n\n// Mirrors the popover reset in contextview.css, whose rules do not reach an\n// owner inside a shadow root\nconst POPOVER_RESET_CSS = /* css */ `\n\t.context-view[popover],\n\t.shadow-root-host[popover] {\n\t\tposition: fixed;\n\t\tinset: auto;\n\t\twidth: auto;\n\t\theight: auto;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\toverflow: visible;\n\t\tcolor: inherit;\n\t\tbackground: transparent;\n\t}\n`;\n\nconst shadowRootsWithPopoverReset = new WeakSet<ShadowRoot>();\n\nfunction adoptPopoverResetStyles(owner: HTMLElement): void {\n\tconst shadowRoot = DOM.getShadowRoot(owner);\n\tif (shadowRoot && !shadowRootsWithPopoverReset.has(shadowRoot)) {\n\t\tshadowRootsWithPopoverReset.add(shadowRoot);\n\t\tconst style = owner.ownerDocument.createElement('style');\n\t\tstyle.textContent = POPOVER_RESET_CSS;\n\t\tshadowRoot.appendChild(style);\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"vscode-digit-full-stop\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n\t${getContextViewMenuMotionCss(':host-context(.modern-ui.monaco-enable-motion)')}\n`;\n"]}