source: trip-planner-front/node_modules/@angular/material/esm2015/menu/menu-trigger.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 69.1 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { FocusMonitor, isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader, } from '@angular/cdk/a11y';
9import { Directionality } from '@angular/cdk/bidi';
10import { ENTER, LEFT_ARROW, RIGHT_ARROW, SPACE } from '@angular/cdk/keycodes';
11import { Overlay, OverlayConfig, } from '@angular/cdk/overlay';
12import { TemplatePortal } from '@angular/cdk/portal';
13import { Directive, ElementRef, EventEmitter, HostBinding, HostListener, Inject, InjectionToken, Input, Optional, Output, Self, ViewContainerRef, } from '@angular/core';
14import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
15import { asapScheduler, merge, of as observableOf, Subscription } from 'rxjs';
16import { delay, filter, take, takeUntil } from 'rxjs/operators';
17import { _MatMenuBase } from './menu';
18import { throwMatMenuMissingError, throwMatMenuRecursiveError } from './menu-errors';
19import { MatMenuItem } from './menu-item';
20import { MAT_MENU_PANEL } from './menu-panel';
21/** Injection token that determines the scroll handling while the menu is open. */
22export const MAT_MENU_SCROLL_STRATEGY = new InjectionToken('mat-menu-scroll-strategy');
23/** @docs-private */
24export function MAT_MENU_SCROLL_STRATEGY_FACTORY(overlay) {
25 return () => overlay.scrollStrategies.reposition();
26}
27/** @docs-private */
28export const MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER = {
29 provide: MAT_MENU_SCROLL_STRATEGY,
30 deps: [Overlay],
31 useFactory: MAT_MENU_SCROLL_STRATEGY_FACTORY,
32};
33/** Default top padding of the menu panel. */
34export const MENU_PANEL_TOP_PADDING = 8;
35/** Options for binding a passive event listener. */
36const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });
37// TODO(andrewseguin): Remove the kebab versions in favor of camelCased attribute selectors
38export class _MatMenuTriggerBase {
39 constructor(_overlay, _element, _viewContainerRef, scrollStrategy, parentMenu,
40 // `MatMenuTrigger` is commonly used in combination with a `MatMenuItem`.
41 // tslint:disable-next-line: lightweight-tokens
42 _menuItemInstance, _dir,
43 // TODO(crisbeto): make the _focusMonitor required when doing breaking changes.
44 // @breaking-change 8.0.0
45 _focusMonitor) {
46 this._overlay = _overlay;
47 this._element = _element;
48 this._viewContainerRef = _viewContainerRef;
49 this._menuItemInstance = _menuItemInstance;
50 this._dir = _dir;
51 this._focusMonitor = _focusMonitor;
52 this._overlayRef = null;
53 this._menuOpen = false;
54 this._closingActionsSubscription = Subscription.EMPTY;
55 this._hoverSubscription = Subscription.EMPTY;
56 this._menuCloseSubscription = Subscription.EMPTY;
57 /**
58 * Handles touch start events on the trigger.
59 * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.
60 */
61 this._handleTouchStart = (event) => {
62 if (!isFakeTouchstartFromScreenReader(event)) {
63 this._openedBy = 'touch';
64 }
65 };
66 // Tracking input type is necessary so it's possible to only auto-focus
67 // the first item of the list when the menu is opened via the keyboard
68 this._openedBy = undefined;
69 this._ariaHaspopup = true;
70 /**
71 * Whether focus should be restored when the menu is closed.
72 * Note that disabling this option can have accessibility implications
73 * and it's up to you to manage focus, if you decide to turn it off.
74 */
75 this.restoreFocus = true;
76 /** Event emitted when the associated menu is opened. */
77 this.menuOpened = new EventEmitter();
78 /**
79 * Event emitted when the associated menu is opened.
80 * @deprecated Switch to `menuOpened` instead
81 * @breaking-change 8.0.0
82 */
83 // tslint:disable-next-line:no-output-on-prefix
84 this.onMenuOpen = this.menuOpened;
85 /** Event emitted when the associated menu is closed. */
86 this.menuClosed = new EventEmitter();
87 /**
88 * Event emitted when the associated menu is closed.
89 * @deprecated Switch to `menuClosed` instead
90 * @breaking-change 8.0.0
91 */
92 // tslint:disable-next-line:no-output-on-prefix
93 this.onMenuClose = this.menuClosed;
94 this._scrollStrategy = scrollStrategy;
95 this._parentMaterialMenu = parentMenu instanceof _MatMenuBase ? parentMenu : undefined;
96 _element.nativeElement.addEventListener('touchstart', this._handleTouchStart, passiveEventListenerOptions);
97 if (_menuItemInstance) {
98 _menuItemInstance._triggersSubmenu = this.triggersSubmenu();
99 }
100 }
101 get _ariaExpanded() {
102 return this.menuOpen || null;
103 }
104 get _ariaControl() {
105 return this.menuOpen ? this.menu.panelId : null;
106 }
107 /**
108 * @deprecated
109 * @breaking-change 8.0.0
110 */
111 get _deprecatedMatMenuTriggerFor() { return this.menu; }
112 set _deprecatedMatMenuTriggerFor(v) {
113 this.menu = v;
114 }
115 /** References the menu instance that the trigger is associated with. */
116 get menu() { return this._menu; }
117 set menu(menu) {
118 if (menu === this._menu) {
119 return;
120 }
121 this._menu = menu;
122 this._menuCloseSubscription.unsubscribe();
123 if (menu) {
124 if (menu === this._parentMaterialMenu && (typeof ngDevMode === 'undefined' || ngDevMode)) {
125 throwMatMenuRecursiveError();
126 }
127 this._menuCloseSubscription = menu.close.subscribe((reason) => {
128 this._destroyMenu(reason);
129 // If a click closed the menu, we should close the entire chain of nested menus.
130 if ((reason === 'click' || reason === 'tab') && this._parentMaterialMenu) {
131 this._parentMaterialMenu.closed.emit(reason);
132 }
133 });
134 }
135 }
136 ngAfterContentInit() {
137 this._checkMenu();
138 this._handleHover();
139 }
140 ngOnDestroy() {
141 if (this._overlayRef) {
142 this._overlayRef.dispose();
143 this._overlayRef = null;
144 }
145 this._element.nativeElement.removeEventListener('touchstart', this._handleTouchStart, passiveEventListenerOptions);
146 this._menuCloseSubscription.unsubscribe();
147 this._closingActionsSubscription.unsubscribe();
148 this._hoverSubscription.unsubscribe();
149 }
150 /** Whether the menu is open. */
151 get menuOpen() {
152 return this._menuOpen;
153 }
154 /** The text direction of the containing app. */
155 get dir() {
156 return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
157 }
158 /** Whether the menu triggers a sub-menu or a top-level one. */
159 triggersSubmenu() {
160 return !!(this._menuItemInstance && this._parentMaterialMenu);
161 }
162 /** Toggles the menu between the open and closed states. */
163 toggleMenu() {
164 return this._menuOpen ? this.closeMenu() : this.openMenu();
165 }
166 /** Opens the menu. */
167 openMenu() {
168 if (this._menuOpen) {
169 return;
170 }
171 this._checkMenu();
172 const overlayRef = this._createOverlay();
173 const overlayConfig = overlayRef.getConfig();
174 this._setPosition(overlayConfig.positionStrategy);
175 overlayConfig.hasBackdrop = this.menu.hasBackdrop == null ? !this.triggersSubmenu() :
176 this.menu.hasBackdrop;
177 overlayRef.attach(this._getPortal());
178 if (this.menu.lazyContent) {
179 this.menu.lazyContent.attach(this.menuData);
180 }
181 this._closingActionsSubscription = this._menuClosingActions().subscribe(() => this.closeMenu());
182 this._initMenu();
183 if (this.menu instanceof _MatMenuBase) {
184 this.menu._startAnimation();
185 }
186 }
187 /** Closes the menu. */
188 closeMenu() {
189 this.menu.close.emit();
190 }
191 /**
192 * Focuses the menu trigger.
193 * @param origin Source of the menu trigger's focus.
194 */
195 focus(origin, options) {
196 if (this._focusMonitor && origin) {
197 this._focusMonitor.focusVia(this._element, origin, options);
198 }
199 else {
200 this._element.nativeElement.focus(options);
201 }
202 }
203 /**
204 * Updates the position of the menu to ensure that it fits all options within the viewport.
205 */
206 updatePosition() {
207 var _a;
208 (_a = this._overlayRef) === null || _a === void 0 ? void 0 : _a.updatePosition();
209 }
210 /** Closes the menu and does the necessary cleanup. */
211 _destroyMenu(reason) {
212 if (!this._overlayRef || !this.menuOpen) {
213 return;
214 }
215 const menu = this.menu;
216 this._closingActionsSubscription.unsubscribe();
217 this._overlayRef.detach();
218 // Always restore focus if the user is navigating using the keyboard or the menu was opened
219 // programmatically. We don't restore for non-root triggers, because it can prevent focus
220 // from making it back to the root trigger when closing a long chain of menus by clicking
221 // on the backdrop.
222 if (this.restoreFocus && (reason === 'keydown' || !this._openedBy || !this.triggersSubmenu())) {
223 this.focus(this._openedBy);
224 }
225 this._openedBy = undefined;
226 if (menu instanceof _MatMenuBase) {
227 menu._resetAnimation();
228 if (menu.lazyContent) {
229 // Wait for the exit animation to finish before detaching the content.
230 menu._animationDone
231 .pipe(filter(event => event.toState === 'void'), take(1),
232 // Interrupt if the content got re-attached.
233 takeUntil(menu.lazyContent._attached))
234 .subscribe({
235 next: () => menu.lazyContent.detach(),
236 // No matter whether the content got re-attached, reset the menu.
237 complete: () => this._setIsMenuOpen(false)
238 });
239 }
240 else {
241 this._setIsMenuOpen(false);
242 }
243 }
244 else {
245 this._setIsMenuOpen(false);
246 if (menu.lazyContent) {
247 menu.lazyContent.detach();
248 }
249 }
250 }
251 /**
252 * This method sets the menu state to open and focuses the first item if
253 * the menu was opened via the keyboard.
254 */
255 _initMenu() {
256 this.menu.parentMenu = this.triggersSubmenu() ? this._parentMaterialMenu : undefined;
257 this.menu.direction = this.dir;
258 this._setMenuElevation();
259 this.menu.focusFirstItem(this._openedBy || 'program');
260 this._setIsMenuOpen(true);
261 }
262 /** Updates the menu elevation based on the amount of parent menus that it has. */
263 _setMenuElevation() {
264 if (this.menu.setElevation) {
265 let depth = 0;
266 let parentMenu = this.menu.parentMenu;
267 while (parentMenu) {
268 depth++;
269 parentMenu = parentMenu.parentMenu;
270 }
271 this.menu.setElevation(depth);
272 }
273 }
274 // set state rather than toggle to support triggers sharing a menu
275 _setIsMenuOpen(isOpen) {
276 this._menuOpen = isOpen;
277 this._menuOpen ? this.menuOpened.emit() : this.menuClosed.emit();
278 if (this.triggersSubmenu()) {
279 this._menuItemInstance._setHighlighted(isOpen);
280 }
281 }
282 /**
283 * This method checks that a valid instance of MatMenu has been passed into
284 * matMenuTriggerFor. If not, an exception is thrown.
285 */
286 _checkMenu() {
287 if (!this.menu && (typeof ngDevMode === 'undefined' || ngDevMode)) {
288 throwMatMenuMissingError();
289 }
290 }
291 /**
292 * This method creates the overlay from the provided menu's template and saves its
293 * OverlayRef so that it can be attached to the DOM when openMenu is called.
294 */
295 _createOverlay() {
296 if (!this._overlayRef) {
297 const config = this._getOverlayConfig();
298 this._subscribeToPositions(config.positionStrategy);
299 this._overlayRef = this._overlay.create(config);
300 // Consume the `keydownEvents` in order to prevent them from going to another overlay.
301 // Ideally we'd also have our keyboard event logic in here, however doing so will
302 // break anybody that may have implemented the `MatMenuPanel` themselves.
303 this._overlayRef.keydownEvents().subscribe();
304 }
305 return this._overlayRef;
306 }
307 /**
308 * This method builds the configuration object needed to create the overlay, the OverlayState.
309 * @returns OverlayConfig
310 */
311 _getOverlayConfig() {
312 return new OverlayConfig({
313 positionStrategy: this._overlay.position()
314 .flexibleConnectedTo(this._element)
315 .withLockedPosition()
316 .withGrowAfterOpen()
317 .withTransformOriginOn('.mat-menu-panel, .mat-mdc-menu-panel'),
318 backdropClass: this.menu.backdropClass || 'cdk-overlay-transparent-backdrop',
319 panelClass: this.menu.overlayPanelClass,
320 scrollStrategy: this._scrollStrategy(),
321 direction: this._dir
322 });
323 }
324 /**
325 * Listens to changes in the position of the overlay and sets the correct classes
326 * on the menu based on the new position. This ensures the animation origin is always
327 * correct, even if a fallback position is used for the overlay.
328 */
329 _subscribeToPositions(position) {
330 if (this.menu.setPositionClasses) {
331 position.positionChanges.subscribe(change => {
332 const posX = change.connectionPair.overlayX === 'start' ? 'after' : 'before';
333 const posY = change.connectionPair.overlayY === 'top' ? 'below' : 'above';
334 this.menu.setPositionClasses(posX, posY);
335 });
336 }
337 }
338 /**
339 * Sets the appropriate positions on a position strategy
340 * so the overlay connects with the trigger correctly.
341 * @param positionStrategy Strategy whose position to update.
342 */
343 _setPosition(positionStrategy) {
344 let [originX, originFallbackX] = this.menu.xPosition === 'before' ? ['end', 'start'] : ['start', 'end'];
345 let [overlayY, overlayFallbackY] = this.menu.yPosition === 'above' ? ['bottom', 'top'] : ['top', 'bottom'];
346 let [originY, originFallbackY] = [overlayY, overlayFallbackY];
347 let [overlayX, overlayFallbackX] = [originX, originFallbackX];
348 let offsetY = 0;
349 if (this.triggersSubmenu()) {
350 // When the menu is a sub-menu, it should always align itself
351 // to the edges of the trigger, instead of overlapping it.
352 overlayFallbackX = originX = this.menu.xPosition === 'before' ? 'start' : 'end';
353 originFallbackX = overlayX = originX === 'end' ? 'start' : 'end';
354 offsetY = overlayY === 'bottom' ? MENU_PANEL_TOP_PADDING : -MENU_PANEL_TOP_PADDING;
355 }
356 else if (!this.menu.overlapTrigger) {
357 originY = overlayY === 'top' ? 'bottom' : 'top';
358 originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';
359 }
360 positionStrategy.withPositions([
361 { originX, originY, overlayX, overlayY, offsetY },
362 { originX: originFallbackX, originY, overlayX: overlayFallbackX, overlayY, offsetY },
363 {
364 originX,
365 originY: originFallbackY,
366 overlayX,
367 overlayY: overlayFallbackY,
368 offsetY: -offsetY
369 },
370 {
371 originX: originFallbackX,
372 originY: originFallbackY,
373 overlayX: overlayFallbackX,
374 overlayY: overlayFallbackY,
375 offsetY: -offsetY
376 }
377 ]);
378 }
379 /** Returns a stream that emits whenever an action that should close the menu occurs. */
380 _menuClosingActions() {
381 const backdrop = this._overlayRef.backdropClick();
382 const detachments = this._overlayRef.detachments();
383 const parentClose = this._parentMaterialMenu ? this._parentMaterialMenu.closed : observableOf();
384 const hover = this._parentMaterialMenu ? this._parentMaterialMenu._hovered().pipe(filter(active => active !== this._menuItemInstance), filter(() => this._menuOpen)) : observableOf();
385 return merge(backdrop, parentClose, hover, detachments);
386 }
387 /** Handles mouse presses on the trigger. */
388 _handleMousedown(event) {
389 if (!isFakeMousedownFromScreenReader(event)) {
390 // Since right or middle button clicks won't trigger the `click` event,
391 // we shouldn't consider the menu as opened by mouse in those cases.
392 this._openedBy = event.button === 0 ? 'mouse' : undefined;
393 // Since clicking on the trigger won't close the menu if it opens a sub-menu,
394 // we should prevent focus from moving onto it via click to avoid the
395 // highlight from lingering on the menu item.
396 if (this.triggersSubmenu()) {
397 event.preventDefault();
398 }
399 }
400 }
401 /** Handles key presses on the trigger. */
402 _handleKeydown(event) {
403 const keyCode = event.keyCode;
404 // Pressing enter on the trigger will trigger the click handler later.
405 if (keyCode === ENTER || keyCode === SPACE) {
406 this._openedBy = 'keyboard';
407 }
408 if (this.triggersSubmenu() && ((keyCode === RIGHT_ARROW && this.dir === 'ltr') ||
409 (keyCode === LEFT_ARROW && this.dir === 'rtl'))) {
410 this._openedBy = 'keyboard';
411 this.openMenu();
412 }
413 }
414 /** Handles click events on the trigger. */
415 _handleClick(event) {
416 if (this.triggersSubmenu()) {
417 // Stop event propagation to avoid closing the parent menu.
418 event.stopPropagation();
419 this.openMenu();
420 }
421 else {
422 this.toggleMenu();
423 }
424 }
425 /** Handles the cases where the user hovers over the trigger. */
426 _handleHover() {
427 // Subscribe to changes in the hovered item in order to toggle the panel.
428 if (!this.triggersSubmenu() || !this._parentMaterialMenu) {
429 return;
430 }
431 this._hoverSubscription = this._parentMaterialMenu._hovered()
432 // Since we might have multiple competing triggers for the same menu (e.g. a sub-menu
433 // with different data and triggers), we have to delay it by a tick to ensure that
434 // it won't be closed immediately after it is opened.
435 .pipe(filter(active => active === this._menuItemInstance && !active.disabled), delay(0, asapScheduler))
436 .subscribe(() => {
437 this._openedBy = 'mouse';
438 // If the same menu is used between multiple triggers, it might still be animating
439 // while the new trigger tries to re-open it. Wait for the animation to finish
440 // before doing so. Also interrupt if the user moves to another item.
441 if (this.menu instanceof _MatMenuBase && this.menu._isAnimating) {
442 // We need the `delay(0)` here in order to avoid
443 // 'changed after checked' errors in some cases. See #12194.
444 this.menu._animationDone
445 .pipe(take(1), delay(0, asapScheduler), takeUntil(this._parentMaterialMenu._hovered()))
446 .subscribe(() => this.openMenu());
447 }
448 else {
449 this.openMenu();
450 }
451 });
452 }
453 /** Gets the portal that should be attached to the overlay. */
454 _getPortal() {
455 // Note that we can avoid this check by keeping the portal on the menu panel.
456 // While it would be cleaner, we'd have to introduce another required method on
457 // `MatMenuPanel`, making it harder to consume.
458 if (!this._portal || this._portal.templateRef !== this.menu.templateRef) {
459 this._portal = new TemplatePortal(this.menu.templateRef, this._viewContainerRef);
460 }
461 return this._portal;
462 }
463}
464_MatMenuTriggerBase.decorators = [
465 { type: Directive }
466];
467_MatMenuTriggerBase.ctorParameters = () => [
468 { type: Overlay },
469 { type: ElementRef },
470 { type: ViewContainerRef },
471 { type: undefined, decorators: [{ type: Inject, args: [MAT_MENU_SCROLL_STRATEGY,] }] },
472 { type: undefined, decorators: [{ type: Inject, args: [MAT_MENU_PANEL,] }, { type: Optional }] },
473 { type: MatMenuItem, decorators: [{ type: Optional }, { type: Self }] },
474 { type: Directionality, decorators: [{ type: Optional }] },
475 { type: FocusMonitor }
476];
477_MatMenuTriggerBase.propDecorators = {
478 _ariaExpanded: [{ type: HostBinding, args: ['attr.aria-expanded',] }],
479 _ariaControl: [{ type: HostBinding, args: ['attr.aria-controls',] }],
480 _ariaHaspopup: [{ type: HostBinding, args: ['attr.aria-haspopup',] }],
481 _deprecatedMatMenuTriggerFor: [{ type: Input, args: ['mat-menu-trigger-for',] }],
482 menu: [{ type: Input, args: ['matMenuTriggerFor',] }],
483 menuData: [{ type: Input, args: ['matMenuTriggerData',] }],
484 restoreFocus: [{ type: Input, args: ['matMenuTriggerRestoreFocus',] }],
485 menuOpened: [{ type: Output }],
486 onMenuOpen: [{ type: Output }],
487 menuClosed: [{ type: Output }],
488 onMenuClose: [{ type: Output }],
489 _handleMousedown: [{ type: HostListener, args: ['mousedown', ['$event'],] }],
490 _handleKeydown: [{ type: HostListener, args: ['keydown', ['$event'],] }],
491 _handleClick: [{ type: HostListener, args: ['click', ['$event'],] }]
492};
493/** Directive applied to an element that should trigger a `mat-menu`. */
494export class MatMenuTrigger extends _MatMenuTriggerBase {
495}
496MatMenuTrigger.decorators = [
497 { type: Directive, args: [{
498 selector: `[mat-menu-trigger-for], [matMenuTriggerFor]`,
499 host: {
500 'class': 'mat-menu-trigger',
501 },
502 exportAs: 'matMenuTrigger'
503 },] }
504];
505//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS10cmlnZ2V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W5pbWF0aW9uRG9uZVxuICAgICAgICAgIC5waXBlKFxuICAgICAgICAgICAgZmlsdGVyKGV2ZW50ID0+IGV2ZW50LnRvU3RhdGUgPT09ICd2b2lkJyksXG4gICAgICAgICAgICB0YWtlKDEpLFxuICAgICAgICAgICAgLy8gSW50ZXJydXB0IGlmIHRoZSBjb250ZW50IGdvdCByZS1hdHRhY2hlZC5cbiAgICAgICAgICAgIHRha2VVbnRpbChtZW51LmxhenlDb250ZW50Ll9hdHRhY2hlZClcbiAgICAgICAgICApXG4gICAgICAgICAgLnN1YnNjcmliZSh7XG4gICAgICAgICAgICBuZXh0OiAoKSA9PiBtZW51LmxhenlDb250ZW50IS5kZXRhY2goKSxcbiAgICAgICAgICAgIC8vIE5vIG1hdHRlciB3aGV0aGVyIHRoZSBjb250ZW50IGdvdCByZS1hdHRhY2hlZCwgcmVzZXQgdGhlIG1lbnUuXG4gICAgICAgICAgICBjb21wbGV0ZTogKCkgPT4gdGhpcy5fc2V0SXNNZW51T3BlbihmYWxzZSlcbiAgICAgICAgICB9KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHRoaXMuX3NldElzTWVudU9wZW4oZmFsc2UpO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICB0aGlzLl9zZXRJc01lbnVPcGVuKGZhbHNlKTtcblxuICAgICAgaWYgKG1lbnUubGF6eUNvbnRlbnQpIHtcbiAgICAgICAgbWVudS5sYXp5Q29udGVudC5kZXRhY2goKTtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAvKipcbiAgICogVGhpcyBtZXRob2Qgc2V0cyB0aGUgbWVudSBzdGF0ZSB0byBvcGVuIGFuZCBmb2N1c2VzIHRoZSBmaXJzdCBpdGVtIGlmXG4gICAqIHRoZSBtZW51IHdhcyBvcGVuZWQgdmlhIHRoZSBrZXlib2FyZC5cbiAgICovXG4gIHByaXZhdGUgX2luaXRNZW51KCk6IHZvaWQge1xuICAgIHRoaXMubWVudS5wYXJlbnRN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