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AAI,SAAAJ,GAAA,WAAAA,GAAwFolB,EAAe,EADvHA,EAEYN,UAhvCkF7jB,MAAE,CAAAoL,KAgvCS+Y,IAFzGA,EAWYL,UAzvCkF9jB,MAAE,CAAAgkB,QAAA,CAyvCoCC,MAC9Hw5B,GAAqBx5B,MAAYw5B,MAZvCt5B,CAAe","names":["JumpbarService","constructor","this","resumeKeys","resumeScroll","getResumeKey","key","hasOwnProperty","getResumePosition","saveResumeKey","value","saveScrollOffset","generateJumpBar","jumpBarKeys","currentSize","length","jumpBarKeysToRender","targetNumberOfKeys","parseInt","Math","floor","removeCount","removalTimes","ceil","midPoint","push","_removeFirstPartOfJumpBar","_removeSecondPartOfJumpBar","numberOfRemovals","removedIndexes","removal","min","minIndex","i","size","includes","getJumpKeys","data","keySelector","keys","forEach","obj","ch","charAt","test","Object","map","k","title","toUpperCase","sort","a","b","t","_angular_core__WEBPACK_IMPORTED_MODULE_0__","Yz7","factory","ɵfac","providedIn","SortFieldPipe","translocoService","transform","SortField","SortName","translate","Created","LastModified","LastChapterAdded","TimeToRead","ReleaseYear","i0","i1","core","Yjl","pure","standalone","FilterFieldPipe","FilterField","AgeRating","Characters","CollectionTags","Colorist","CoverArtist","Editor","Formats","Genres","Inker","Languages","Libraries","Letterer","PublicationStatus","Penciller","Publisher","ReadProgress","ReadTime","SeriesName","Summary","Tags","Translators","UserRating","Writers","Path","FilePath","Error","FilterComparisonPipe","FilterComparison","BeginsWith","Contains","Equal","GreaterThan","GreaterThanEqual","LessThan","LessThanEqual","Matches","NotContains","NotEqual","EndsWith","IsBefore","IsAfter","IsInLast","IsNotInLast","MustContains","scrollBehaviorSupported","supportsScrollBehavior","BlockScrollStrategy","_viewportRuler","document","_previousHTMLStyles","top","left","_isEnabled","_document","attach","enable","_canBeEnabled","root","documentElement","_previousScrollPosition","getViewportScrollPosition","style","coerceCssPixelValue","classList","add","disable","html","htmlStyle","bodyStyle","body","previousHtmlScrollBehavior","scrollBehavior","previousBodyScrollBehavior","remove","window","scroll","contains","viewport","getViewportSize","scrollHeight","height","scrollWidth","width","CloseScrollStrategy","_scrollDispatcher","_ngZone","_config","_scrollSubscription","_detach","_overlayRef","hasAttached","run","detach","overlayRef","stream","scrolled","pipe","filter","scrollable","overlayElement","getElementRef","nativeElement","threshold","_initialScrollPosition","subscribe","scrollPosition","abs","updatePosition","unsubscribe","NoopScrollStrategy","isElementScrolledOutsideView","element","scrollContainers","some","containerBounds","bottom","right","isElementClippedByScrolling","scrollContainerRect","RepositionScrollStrategy","scrollThrottle","autoClose","overlayRect","getBoundingClientRect","ScrollStrategyOptions","noop","close","config","block","reposition","DOCUMENT","ɵprov","token","OverlayConfig","scrollStrategy","panelClass","hasBackdrop","backdropClass","disposeOnNavigation","configKeys","undefined","ConnectedOverlayPositionChange","connectionPair","scrollableViewProperties","BaseOverlayDispatcher","_attachedOverlays","ngOnDestroy","index","indexOf","splice","OverlayKeyboardDispatcher","super","_keydownListener","event","overlays","_keydownEvents","observers","keydownEvents","next","_isAttached","runOutsideAngular","addEventListener","removeEventListener","OverlayOutsideClickDispatcher","_platform","_cursorStyleIsSet","_pointerDownListener","_pointerDownEventTarget","_getEventTarget","_clickListener","target","origin","type","slice","_outsidePointerEvents","outsidePointerEvents","_addEventListeners","IOS","_cursorOriginalValue","cursor","i1$1","OverlayContainer","_containerElement","getContainerElement","_createContainer","containerClass","isBrowser","_isTestEnvironment","oppositePlatformContainers","querySelectorAll","container","createElement","setAttribute","appendChild","OverlayRef","_portalOutlet","_host","_pane","_keyboardDispatcher","_location","_outsideClickDispatcher","_animationsDisabled","_backdropElement","_backdropClick","Subject","_attachments","_detachments","_locationChanges","Subscription","EMPTY","_backdropClickHandler","_backdropTransitionendHandler","_disposeBackdrop","_scrollStrategy","_positionStrategy","positionStrategy","backdropElement","hostElement","portal","parentElement","_previousHostParent","attachResult","_updateStackingOrder","_updateElementSize","_updateElementDirection","onStable","take","_togglePointerEvents","_attachBackdrop","_toggleClasses","dispose","onDestroy","Promise","resolve","then","detachBackdrop","detachmentResult","_detachContentWhenStable","isAttached","_disposeScrollStrategy","complete","backdropClick","attachments","detachments","getConfig","apply","updatePositionStrategy","strategy","updateSize","sizeConfig","setDirection","dir","direction","addPanelClass","classes","removePanelClass","getDirection","updateScrollStrategy","minWidth","minHeight","maxWidth","maxHeight","enablePointer","pointerEvents","showingClass","insertBefore","requestAnimationFrame","nextSibling","parentNode","backdropToDetach","_backdropTimeout","setTimeout","cssClasses","isAdd","coerceArray","c","subscription","takeUntil","merge","children","backdrop","clearTimeout","boundingBoxClass","cssUnitPattern","FlexibleConnectedPositionStrategy","positions","_preferredPositions","connectedTo","_overlayContainer","_lastBoundingBoxSize","_isPushed","_canPush","_growAfterOpen","_hasFlexibleDimensions","_positionLocked","_viewportMargin","_scrollables","_positionChanges","_resizeSubscription","_offsetX","_offsetY","_appliedPanelClasses","positionChanges","setOrigin","_validatePositions","_boundingBox","_isDisposed","_isInitialRender","_lastPosition","change","reapplyLastPosition","_clearPanelClasses","_resetOverlayElementStyles","_resetBoundingBoxStyles","_viewportRect","_getNarrowedViewportRect","_originRect","_getOriginRect","_overlayRect","_containerRect","originRect","viewportRect","containerRect","flexibleFits","fallback","pos","originPoint","_getOriginPoint","overlayPoint","_getOverlayPoint","overlayFit","_getOverlayFit","isCompletelyWithinViewport","_applyPosition","_canFitWithFlexibleDimensions","position","boundingBoxRect","_calculateBoundingBoxRect","visibleArea","bestFit","bestScore","fit","score","weight","_previousPushAmount","extendStyles","alignItems","justifyContent","lastPosition","withScrollableContainers","scrollables","withPositions","withViewportMargin","margin","withFlexibleDimensions","flexibleDimensions","withGrowAfterOpen","growAfterOpen","withPush","canPush","withLockedPosition","isLocked","_origin","withDefaultOffsetX","offset","withDefaultOffsetY","withTransformOriginOn","selector","_transformOriginSelector","x","y","originX","startX","_isRtl","endX","originY","overlayStartX","overlayStartY","overlayX","overlayY","point","rawOverlayRect","overlay","getRoundedBoundingClientRect","offsetX","_getOffset","offsetY","topOverflow","bottomOverflow","visibleWidth","_subtractOverflows","visibleHeight","fitsInViewportVertically","fitsInViewportHorizontally","availableHeight","availableWidth","getPixelValue","horizontalFit","_pushOverlayOnScreen","start","overflowRight","max","overflowBottom","overflowTop","overflowLeft","pushX","pushY","_setTransformOrigin","_setOverlayElementStyles","_setBoundingBoxStyles","_addPanelClasses","_getScrollVisibility","changeEvent","elements","xOrigin","yOrigin","transformOrigin","isRtl","smallestDistanceToViewportEdge","previousHeight","previousWidth","styles","_hasExactPosition","hasExactPosition","hasFlexibleDimensions","_getExactOverlayY","_getExactOverlayX","transformString","trim","clientHeight","horizontalStyleProperty","clientWidth","originBounds","overlayBounds","scrollContainerBounds","isOriginClipped","isOriginOutsideView","isOverlayClipped","isOverlayOutsideView","overflows","reduce","currentValue","currentOverflow","axis","cssClass","ElementRef","Element","destination","source","input","units","split","parseFloat","clientRect","wrapperClass","GlobalPositionStrategy","_cssPosition","_topOffset","_bottomOffset","_alignItems","_xPosition","_xOffset","_width","_height","end","centerHorizontally","centerVertically","parentStyles","shouldBeFlushHorizontally","shouldBeFlushVertically","xPosition","xOffset","marginLeft","marginRight","marginTop","marginBottom","parent","OverlayPositionBuilder","global","flexibleConnectedTo","nextUniqueId","Overlay","scrollStrategies","_componentFactoryResolver","_positionBuilder","_injector","_directionality","_animationsModuleType","create","host","_createHostElement","pane","_createPaneElement","portalOutlet","_createPortalOutlet","overlayConfig","id","_appRef","get","ApplicationRef","DomPortalOutlet","i5","i6","ANIMATION_MODULE_TYPE","defaultPositionList","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY","InjectionToken","CdkOverlayOrigin","elementRef","ɵdir","selectors","exportAs","CdkConnectedOverlay","_position","_updatePositionStrategy","_hasBackdrop","coerceBooleanProperty","lockPosition","_lockPosition","_flexibleDimensions","_push","_overlay","templateRef","viewContainerRef","scrollStrategyFactory","_dir","_backdropSubscription","_attachSubscription","_detachSubscription","_positionSubscription","viewportMargin","open","disableClose","EventEmitter","positionChange","overlayKeydown","overlayOutsideClick","_templatePortal","TemplatePortal","_scrollStrategyFactory","ngOnChanges","changes","_attachOverlay","_detachOverlay","_createOverlay","_buildConfig","emit","keyCode","ESCAPE","hasModifierKey","preventDefault","_createPositionStrategy","currentPosition","_getFlexibleConnectedPositionStrategyOrigin","transformOriginSelector","takeWhile","inputs","outputs","features","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER","provide","deps","useFactory","CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY","OverlayModule","ɵmod","ɵinj","providers","imports","BidiModule","PortalModule","ScrollingModule","resolveContainerElement","scrollWindow","defaultElement","fromRoot","hasWindow","findElement","customRoot","querySelector","inputPropChanged","prop","firstChange","VerticalProps","offsetHeight","pageYOffset","offsetTop","scrollTop","HorizontalProps","AxisResolver","vertical","propsMap","clientHeightKey","offsetHeightKey","scrollHeightKey","pageYOffsetKey","offsetTopKey","scrollTopKey","topKey","isElementWindow","windowElement","prototype","toString","call","getDocumentElement","isContainerWindow","calculatePoints","resolver","extractHeightForElement","isWindow","extractHeightPropKeys","getElementHeight","calculatePointsForWindow","getElementPageYOffset","nativeElementHeight","totalToScroll","getElementOffsetTop","elem","calculatePointsForElement","isNaN","docElem","ownerDocument","defaultView","shouldFireScrollEvent","distance","down","up","scrollingDown","remaining","containerBreakpoint","scrolledUntilNow","ScrollState","lastScrollPosition","lastTotalToScroll","triggered","updateScrollPosition","updateTotalToScroll","updateScroll","updateTriggeredFlag","isScrollingDown","isTriggeredScroll","InfiniteScrollActions","DOWN","UP","toInfiniteScrollAction","response","scrollDown","stats","currentScrollPosition","payload","InfiniteScrollDirective","zone","scrolledUp","infiniteScrollDistance","infiniteScrollUpDistance","infiniteScrollThrottle","infiniteScrollDisabled","infiniteScrollContainer","immediateCheck","horizontal","alwaysCallback","ngAfterViewInit","setup","containerChanged","disabledChanged","distanceChanged","shouldSetup","destroyScroller","hasWindowDefined","disposeScroller","createScroller","scrollContainer","createResolver","createResolverWithContainer","scrollState","upDistance","downDistance","attachScrollEvent","options","obs","fromEvent","throttle","throttleTime","leading","trailing","mergeMap","of","positionStats","toInfiniteScrollParams","fire","getScrollStats","isScrollingDownwards","tap","shouldTriggerEvents","isTriggeredCurrentTotal","handleOnScroll","emitter","hasObservers","observed","InfiniteScrollModule","_c0","_c1","_c2","_c3","_c4","Select2_span_2_Template","rf","ctx","Select2_span_8_span_1_Template","Select2_span_8_ng_container_2_span_1_Template","ctx_r13","select2Option","label","Select2_span_8_ng_container_2_ng_template_2_ng_container_0_Template","Select2_span_8_ng_container_2_ng_template_2_Template","ctx_r15","getTemplate","Select2_span_8_ng_container_2_Template","_r14","ctx_r12","hasTemplate","noLabelTemplate","Select2_span_8_Template","ctx_r3","option","placeholder","Select2_span_9_Template","_r18","$event","ctx_r17","reset","Select2_span_10_Template","Select2_ul_11_span_1_Template","ctx_r19","select2Options","Select2_ul_11_li_2_span_1_Template","_r29","op_r22","$implicit","ctx_r27","removeSelection","Select2_ul_11_li_2_span_2_Template","Select2_ul_11_li_2_ng_template_3_ng_container_0_Template","Select2_ul_11_li_2_ng_template_3_Template","ctx_r26","Select2_ul_11_li_2_Template","_r34","ctx_r33","_r25","ctx_r20","disabled","readonly","Select2_ul_11_li_3_Template","_r36","ctx_r35","stopEvent","ctx_r37","ctx_r38","toggleOpenAndClose","ctx_r39","keyDown","ctx_r40","searchUpdate","ctx_r41","prevChange","ctx_r21","Select2_ul_11_Template","ctx_r6","autoCreate","trackBy","Select2_ng_container_12_ng_container_1_Template","Select2_ng_container_12_Template","_r9","Select2_ng_template_15_ng_container_0_Template","Select2_ng_template_15_Template","Select2_ng_template_16_ng_container_9_li_1_strong_1_Template","groupOrOption_r50","Select2_ng_template_16_ng_container_9_li_1_ng_template_2_ng_container_0_Template","Select2_ng_template_16_ng_container_9_li_1_ng_template_2_Template","ctx_r56","Select2_ng_template_16_ng_container_9_li_1_li_5_div_2_Template","option_r61","Select2_ng_template_16_ng_container_9_li_1_li_5_ng_template_3_ng_container_0_Template","Select2_ng_template_16_ng_container_9_li_1_li_5_ng_template_3_Template","ctx_r66","Select2_ng_template_16_ng_container_9_li_1_li_5_Template","_r71","ctx_r70","mouseenter","ctx_r72","click","j_r62","_r65","i_r51","ctx_r57","getOptionStyle","isSelected","isDisabled","Select2_ng_template_16_ng_container_9_li_1_Template","_r55","ctx_r52","Select2_ng_template_16_ng_container_9_li_2_div_2_Template","Select2_ng_template_16_ng_container_9_li_2_ng_template_3_ng_container_0_Template","Select2_ng_template_16_ng_container_9_li_2_ng_template_3_Template","ctx_r78","Select2_ng_template_16_ng_container_9_li_2_Template","_r84","ctx_r82","ctx_r85","_r77","ctx_r87","ctx_r53","Select2_ng_template_16_ng_container_9_Template","Select2_ng_template_16_li_10_Template","ctx_r48","noResultMessage","Select2_ng_template_16_li_11_Template","ctx_r49","maxResultsMessage","Select2_ng_template_16_Template","_r89","ctx_r88","ctx_r90","ctx_r91","ctx_r92","onScroll","ctx_r93","ctx_r94","_r46","ctx_r10","isOpen","listPosition","select2above","hideSearch","searchText","tabIndex","resultMaxHeight","infiniteScroll","filteredData","maxResultsExceeded","_c5","_c6","unicodePatterns","l","s","protectRegexp","RegExp","Select2Utils","static","Array","isArray","groupOrOption","multiple","values","result","v","getOptionByValue","isNullOrUndefined","hoveringValue","findIt","j","hide","maxResults","counter","group","item","editPattern","containSearchText","filteredOptions","selectedOptions","minCountForSearch","getOptionsCount","op","count","formatSansUnicode","match","formatPattern","str","replace","unicodePattern","protectPattern","displaySearchStatusList","Select2","_data","updateFilteredData","_multiple","ngOnInit","_minCountForSearch","updateSearchBox","_id","_uid","_control","_disabled","_value","testValueChange","writeValue","_tabIndex","innerSearchText","text","ariaInvalid","_isErrorState","classMaterial","styleMode","classNostyle","_isAbobeOverlay","_positions","resultsElement","resultContainer","_changeDetectorRef","_parentForm","_parentFormGroup","minCharForSearch","limitSelection","customSearchEnabled","required","hideSelectedItems","resettable","update","focus","blur","search","removeOption","focused","_stateChanges","_onTouched","_onChange","valueAccessor","clickDetection","e","ifParentContainsClass","ifParentContainsId","clickExit","triggerRect","getOptionsByValue","cdkConnectedOverlay","posChange","_overlayPosition","detectChanges","selectionElement","selection","ngDoCheck","_dirtyCheckNativeValue","_triggerRect","overlayWidth","_dropdownRect","overlayHeight","hidden","isSearchboxHiddex","isSearchboxHidden","displaySearchStatus","testSelection","select","resetSelectedValue","stopPropagation","_focus","changeEmit","_focusSearchboxOrResultsElement","updateScrollFromOption","markForCheck","defaut","templates","TemplateRef","templateId","dropdown","value1","value2","e1","getFilteredSelectedData","getFilteredData","getReduceData","valueIsNotInFilteredData","getFirstAvailableOption","getParentElementByClass","getParentElementById","containClasses","focusin","focusout","findIndex","component","_testKey","createAndAdd","moveDown","moveUp","selectByEnter","openKey","_index","removedOption","_setSelectionByValue","registerOnChange","fn","registerOnTouched","setDisabledState","way","isInvalid","invalid","isTouched","touched","submitted","addItem","getPreviousOption","getNextOption","domElement","results","find","r","innerText","listClientRect","optionClientRect","refs","_isKey","_getKey","code","keyIdentifier","viewToModelUpdate","newValue","_previousNativeValue","searchInput","state","i2","ɵcmp","viewQuery","_t","first","hostVars","hostBindings","numberAttribute","booleanAttribute","ngContentSelectors","decls","vars","consts","template","_r2","dependencies","i3","i4","Select2Module","CommonModule","FormsModule","ReactiveFormsModule","field_r3","comparison_r4","multipleAllowed_r15","MetadataFilterRowComponent_ng_container_10_ng_container_4_ng_container_1_ng_container_1_Template","MetadataFilterRowComponent_ng_container_10_ng_container_4_ng_container_1_ng_template_2_Template","_r12","opts_r10","ctx_r9","MultipleDropdownAllowed","MetadataFilterRowComponent_ng_container_10_ng_container_4_ng_container_1_Template","ctx_r8","dropdownOptions$","MetadataFilterRowComponent_ng_container_10_ng_container_2_Template","MetadataFilterRowComponent_ng_container_10_ng_container_3_Template","MetadataFilterRowComponent_ng_container_10_ng_container_4_Template","predicateType_r5","ctx_r2","PredicateType","Text","Number","Dropdown","StringFields","NumberFields","DropdownFields","DropdownFieldsWithoutMustContains","DropdownFieldsThatIncludeNumberComparisons","NumberFieldsThatIncludeDateComparisons","StringComparisons","DateComparisons","NumberComparisons","DropdownComparisons","MetadataFilterRowComponent","comp","formGroup","metadataService","libraryService","collectionTagService","availableFields","allFields","filterStatement","cdRef","inject","ChangeDetectorRef","destroyRef","DestroyRef","FormGroup","comparison","FormControl","filterValue","validComparisons$","BehaviorSubject","predicateType$","loaded","addControl","valueChanges","distinctUntilChanged","takeUntilDestroyed","val","handleFieldChange","populateFromPreset","startWith","preset","inputVal","switchMap","_","getDropdownObservable","stmt","field","patchValue","d","getAllPublicationStatus","pubs","pub","getAllAgeRatings","ratings","rating","getAllGenres","genres","genre","getAllLanguages","statuses","status","isoCode","mangaFormatFilters","getLibraries","libs","lib","name","getAllTags","allTags","getPersonOptions","PersonRole","Character","Translator","Writer","role","getAllPeopleByRole","people","person","comps","Xpm","MetadataFilterRowComponent_option_4_Template","MetadataFilterRowComponent_option_7_Template","MetadataFilterRowComponent_ng_container_10_Template","AsyncPipe","NgSwitch","NgSwitchCase","NgForOf","NgIf","NgTemplateOutlet","changeDetection","opt_r8","_r15","i_r10","removeFilter","t_r1","_r19","ctx_r18","updateFilter","MetadataBuilderComponent_ng_container_0_ng_container_1_ng_container_2_div_11_button_4_Template","filterStmt_r9","ctx_r7","availableFilterFields","statements","MetadataBuilderComponent_ng_container_0_ng_container_1_ng_container_2_option_5_Template","_r21","addFilter","MetadataBuilderComponent_ng_container_0_ng_container_1_ng_container_2_div_11_Template","groupOptions","statementLimit","opt_r25","_r32","i_r27","ctx_r30","_r35","ctx_r34","MetadataBuilderComponent_ng_container_0_ng_container_1_ng_template_3_div_10_button_4_Template","filterStmt_r26","ctx_r24","MetadataBuilderComponent_ng_container_0_ng_container_1_ng_template_3_option_4_Template","_r37","ctx_r36","MetadataBuilderComponent_ng_container_0_ng_container_1_ng_template_3_div_10_Template","ctx_r5","MetadataBuilderComponent_ng_container_0_ng_container_1_ng_container_2_Template","MetadataBuilderComponent_ng_container_0_ng_container_1_ng_template_3_Template","utilityService","getActiveBreakpoint","Breakpoint","Desktop","_r4","MetadataBuilderComponent_ng_container_0_ng_container_1_Template","ctx_r0","MetadataBuilderComponent","MetadataService","UtilityService","filterUtilityService","FilterUtilitiesService","FilterCombination","Or","And","combination","createDefaultFilterStatement","concat","filterStmt","MetadataBuilderComponent_ng_container_0_Template","NgbTooltip","TranslocoDirective","ctx_r11","setToggle","isOpen_r7","_r3","_r16","toggleService","set","MetadataFilterComponent_ng_container_0_ng_container_1_div_1_Template","MetadataFilterComponent_ng_container_0_ng_container_1_div_2_Template","Tablet","field_r28","_r5","_r30","ctx_r29","handleFilters","ctx_r31","updateSortOrder","MetadataFilterComponent_ng_container_0_ng_template_3_div_0_i_14_Template","MetadataFilterComponent_ng_container_0_ng_template_3_div_0_ng_template_15_Template","MetadataFilterComponent_ng_container_0_ng_template_3_div_0_option_18_Template","MetadataFilterComponent_ng_container_0_ng_template_3_div_0_ng_container_19_Template","MetadataFilterComponent_ng_container_0_ng_template_3_div_0_div_20_Template","filterV2","allFilterFields","filterSettings","sortGroup","sortDisabled","isAscendingSort","allSortFields","MetadataFilterComponent_ng_container_0_ng_template_3_div_0_Template","ctx_r4","fullyLoaded","clear","MetadataFilterComponent_ng_container_0_ng_container_1_Template","MetadataFilterComponent_ng_container_0_ng_template_3_Template","MetadataFilterComponent_ng_container_0_ng_template_5_Template","toggleState$","MetadataFilterComponent","filterOpen","filteringDisabled","applyFilter","filteringCollapsed","libraries","updateApplied","FilterSettings","openState","loadFromPresetsAndSetup","deepClone","clonedObj","presetsV2","sortField","sortOptions","limitTo","isAscending","isFirst","Mobile","toggleSelected","toggle","contentQueries","dirIndex","MetadataFilterComponent_ng_container_0_Template","NgbCollapse","DrawerComponent","TranslocoModule","ctx_r14","performAction","actions","header","ctx_r16","pagination","totalItems","CardDetailLayoutComponent_ng_container_0_div_1_span_4_span_2_Template","CardDetailLayoutComponent_ng_container_0_div_1_span_3_Template","CardDetailLayoutComponent_ng_container_0_div_1_span_4_Template","noDataTemplate","item_r18","tryToSaveJumpKey","i_r19","itemTemplate","viewPortInfo","startIndexWithBuffer","_r10","item_r26","ctx_r28","ctx_r25","CardDetailLayoutComponent_ng_container_0_ng_template_13_div_4_Template","CardDetailLayoutComponent_ng_container_0_ng_template_13_div_5_Template","items","_r22","viewPortItems","trackByIdentity","isLoading","jumpKey_r31","scrollTo","_c7","hasCustomSort","CardDetailLayoutComponent_ng_container_0_ng_template_16_ng_container_1_Template","CardDetailLayoutComponent_ng_container_0_div_1_Template","applyMetadataFilter","CardDetailLayoutComponent_ng_container_0_p_6_Template","CardDetailLayoutComponent_ng_container_0_div_11_Template","CardDetailLayoutComponent_ng_container_0_ng_container_12_Template","CardDetailLayoutComponent_ng_container_0_ng_template_13_Template","CardDetailLayoutComponent_ng_container_0_ng_template_16_Template","_c8","parentScroll","maxScrollPosition","CardDetailLayoutComponent","jumpbarService","router","scrollService","itemClicked","createSeriesV2Filter","hasResumedJumpKey","resizeJumpBar","libraryId","currentPage","itemsPerPage","totalPages","refresh","virtualScroller","resumeKey","url","action","callback","jumpKey","targetIndex","scrollToIndex","VirtualScrollerComponent","CardDetailLayoutComponent_ng_container_0_Template","LoadingComponent","VirtualScrollerModule","CardActionablesComponent","_r6","DrawerComponent_ng_container_0_div_10_Template","topOffset","DrawerOptions","drawerClosed","isOpenChange","DrawerComponent_ng_container_0_Template","animationFrameProvider","schedule","request","cancel","cancelAnimationFrame","delegate","handle","timestamp","args","animationFrameScheduler","AnimationFrameScheduler","AsyncScheduler","flush","_active","flushId","_scheduled","error","shift","execute","delay","AnimationFrameAction","AsyncAction","scheduler","work","requestAsyncId","recycleAsyncId","_a","DIR_DOCUMENT","DIR_DOCUMENT_FACTORY","RTL_LOCALE_PATTERN","Directionality","_resolveDirectionality","rawValue","toLowerCase","navigator","language","coerceNumberProperty","fallbackValue","_isNumberValue","coerceElement","elementOrRef","SHIFT","CONTROL","ALT","META","MAC_META","modifiers","modifier","altKey","shiftKey","ctrlKey","metaKey","hasV8BreakIterator","Intl","v8BreakIterator","supportsPassiveEvents","shadowDomIsSupported","Platform","_platformId","isPlatformBrowser","EDGE","userAgent","TRIDENT","BLINK","chrome","CSS","WEBKIT","FIREFOX","ANDROID","SAFARI","PLATFORM_ID","normalizePassiveListenerOptions","supportsPassiveEventListeners","defineProperty","capture","scrollToFunction","_getShadowRoot","_supportsShadowDom","head","createShadowRoot","attachShadow","rootNode","getRootNode","ShadowRoot","composedPath","__karma__","jasmine","jest","Mocha","resolved","nextHandle","activeHandles","findAndClearHandle","Immediate","setImmediate","cb","clearImmediate","immediateProvider","AsapScheduler","AsapAction","bind","ScrollDispatcher","_scrolled","_globalSubscription","_scrolledCount","Map","register","has","elementScrolled","deregister","scrollableReference","delete","auditTimeInMs","Observable","observer","_addGlobalListener","auditTime","_removeGlobalListener","ancestorScrolled","elementOrElementRef","ancestors","getAncestorScrollContainers","scrollingContainers","_subscription","_scrollableContainsElement","_getWindow","scrollableElement","ViewportRuler","ngZone","_change","_changeListener","_viewportSize","_updateViewportSize","output","getViewportRect","documentRect","scrollY","scrollLeft","scrollX","innerWidth","innerHeight","CdkScrollableModule"],"sourceRoot":"webpack:///","sources":["./src/app/_services/jumpbar.service.ts","./src/app/pipe/sort-field.pipe.ts","./src/app/metadata-filter/_pipes/filter-field.pipe.ts","./src/app/metadata-filter/_pipes/filter-comparison.pipe.ts","./node_modules/@angular/cdk/fesm2022/overlay.mjs","./node_modules/ngx-infinite-scroll/fesm2022/ngx-infinite-scroll.mjs","./node_modules/ng-select2-component/fesm2022/ng-select2-component.mjs","./src/app/metadata-filter/_components/metadata-filter-row/metadata-filter-row.component.html","./src/app/metadata-filter/_components/metadata-filter-row/metadata-filter-row.component.ts","./src/app/metadata-filter/_components/metadata-builder/metadata-builder.component.html","./src/app/metadata-filter/_components/metadata-builder/metadata-builder.component.ts","./src/app/metadata-filter/metadata-filter.component.html","./src/app/metadata-filter/metadata-filter.component.ts","./src/app/cards/card-detail-layout/card-detail-layout.component.html","./src/app/cards/card-detail-layout/card-detail-layout.component.ts","./src/app/metadata-filter/filter-settings.ts","./src/app/shared/drawer/drawer.component.html","./src/app/shared/drawer/drawer.component.ts","./node_modules/rxjs/dist/esm/internal/scheduler/animationFrameProvider.js","./node_modules/rxjs/dist/esm/internal/scheduler/animationFrame.js","./node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameScheduler.js","./node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameAction.js","./node_modules/@angular/cdk/fesm2022/bidi.mjs","./node_modules/@angular/cdk/fesm2022/coercion.mjs","./node_modules/@angular/cdk/fesm2022/keycodes.mjs","./node_modules/@angular/cdk/fesm2022/platform.mjs","./node_modules/rxjs/dist/esm/internal/util/Immediate.js","./node_modules/rxjs/dist/esm/internal/scheduler/immediateProvider.js","./node_modules/rxjs/dist/esm/internal/scheduler/asap.js","./node_modules/rxjs/dist/esm/internal/scheduler/AsapScheduler.js","./node_modules/rxjs/dist/esm/internal/scheduler/AsapAction.js","./node_modules/@angular/cdk/fesm2022/scrolling.mjs"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { JumpKey } from '../_models/jumpbar/jump-key';\n\nconst keySize = 25; // Height of the JumpBar button\n\n@Injectable({\n providedIn: 'root'\n})\nexport class JumpbarService {\n\n resumeKeys: {[key: string]: string} = {};\n // Used for custom filtered urls\n resumeScroll: {[key: string]: number} = {};\n\n constructor() { }\n\n\n getResumeKey(key: string) {\n if (this.resumeKeys.hasOwnProperty(key)) return this.resumeKeys[key];\n return '';\n }\n\n getResumePosition(key: string) {\n if (this.resumeScroll.hasOwnProperty(key)) return this.resumeScroll[key];\n return 0;\n }\n\n saveResumeKey(key: string, value: string) {\n this.resumeKeys[key] = value;\n }\n\n saveScrollOffset(key: string, value: number) {\n this.resumeScroll[key] = value;\n }\n\n generateJumpBar(jumpBarKeys: Array, currentSize: number) {\n const fullSize = (jumpBarKeys.length * keySize);\n if (currentSize >= fullSize) {\n return [...jumpBarKeys];\n }\n\n const jumpBarKeysToRender: Array = [];\n const targetNumberOfKeys = parseInt(Math.floor(currentSize / keySize) + '', 10);\n const removeCount = jumpBarKeys.length - targetNumberOfKeys - 3;\n if (removeCount <= 0) return [...jumpBarKeys];\n\n const removalTimes = Math.ceil(removeCount / 2);\n const midPoint = Math.floor(jumpBarKeys.length / 2);\n jumpBarKeysToRender.push(jumpBarKeys[0]);\n this._removeFirstPartOfJumpBar(midPoint, removalTimes, jumpBarKeys, jumpBarKeysToRender);\n jumpBarKeysToRender.push(jumpBarKeys[midPoint]);\n this._removeSecondPartOfJumpBar(midPoint, removalTimes, jumpBarKeys, jumpBarKeysToRender);\n jumpBarKeysToRender.push(jumpBarKeys[jumpBarKeys.length - 1]);\n\n return jumpBarKeysToRender;\n }\n\n _removeSecondPartOfJumpBar(midPoint: number, numberOfRemovals: number = 1, jumpBarKeys: Array, jumpBarKeysToRender: Array) {\n const removedIndexes: Array = [];\n for(let removal = 0; removal < numberOfRemovals; removal++) {\n let min = 100000000;\n let minIndex = -1;\n for(let i = midPoint + 1; i < jumpBarKeys.length - 2; i++) {\n if (jumpBarKeys[i].size < min && !removedIndexes.includes(i)) {\n min = jumpBarKeys[i].size;\n minIndex = i;\n }\n }\n removedIndexes.push(minIndex);\n }\n for(let i = midPoint + 1; i < jumpBarKeys.length - 2; i++) {\n if (!removedIndexes.includes(i)) jumpBarKeysToRender.push(jumpBarKeys[i]);\n }\n }\n\n _removeFirstPartOfJumpBar(midPoint: number, numberOfRemovals: number = 1, jumpBarKeys: Array, jumpBarKeysToRender: Array) {\n const removedIndexes: Array = [];\n for(let removal = 0; removal < numberOfRemovals; removal++) {\n let min = 100000000;\n let minIndex = -1;\n for(let i = 1; i < midPoint; i++) {\n if (jumpBarKeys[i].size < min && !removedIndexes.includes(i)) {\n min = jumpBarKeys[i].size;\n minIndex = i;\n }\n }\n removedIndexes.push(minIndex);\n }\n\n for(let i = 1; i < midPoint; i++) {\n if (!removedIndexes.includes(i)) jumpBarKeysToRender.push(jumpBarKeys[i]);\n }\n }\n\n /**\n * \n * @param data An array of objects\n * @param keySelector A method to fetch a string from the object, which is used to classify the JumpKey\n * @returns \n */\n getJumpKeys(data :Array, keySelector: (data: any) => string) {\n const keys: {[key: string]: number} = {};\n data.forEach(obj => {\n let ch = keySelector(obj).charAt(0);\n if (/\\d|\\#|!|%|@|\\(|\\)|\\^|\\.|_|\\*/g.test(ch)) {\n ch = '#';\n }\n if (!keys.hasOwnProperty(ch)) {\n keys[ch] = 0;\n }\n keys[ch] += 1;\n });\n return Object.keys(keys).map(k => {\n return {\n key: k,\n size: keys[k],\n title: k.toUpperCase()\n }\n }).sort((a, b) => {\n if (a.key < b.key) return -1;\n if (a.key > b.key) return 1;\n return 0;\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport {SortField} from \"../_models/metadata/series-filter\";\nimport {TranslocoService} from \"@ngneat/transloco\";\n\n@Pipe({\n name: 'sortField',\n standalone: true\n})\nexport class SortFieldPipe implements PipeTransform {\n\n constructor(private translocoService: TranslocoService) {\n }\n\n transform(value: SortField): string {\n switch (value) {\n case SortField.SortName:\n return this.translocoService.translate('sort-field-pipe.sort-name')\n case SortField.Created:\n return this.translocoService.translate('sort-field-pipe.created')\n case SortField.LastModified:\n return this.translocoService.translate('sort-field-pipe.last-modified')\n case SortField.LastChapterAdded:\n return this.translocoService.translate('sort-field-pipe.last-chapter-added')\n case SortField.TimeToRead:\n return this.translocoService.translate('sort-field-pipe.time-to-read')\n case SortField.ReleaseYear:\n return this.translocoService.translate('sort-field-pipe.release-year')\n }\n\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { FilterField } from 'src/app/_models/metadata/v2/filter-field';\nimport {translate} from \"@ngneat/transloco\";\n\n@Pipe({\n name: 'filterField',\n standalone: true\n})\nexport class FilterFieldPipe implements PipeTransform {\n\n transform(value: FilterField): string {\n switch (value) {\n case FilterField.AgeRating:\n return translate('filter-field-pipe.age-rating');\n case FilterField.Characters:\n return translate('filter-field-pipe.characters');\n case FilterField.CollectionTags:\n return translate('filter-field-pipe.collection-tags');\n case FilterField.Colorist:\n return translate('filter-field-pipe.colorist');\n case FilterField.CoverArtist:\n return translate('filter-field-pipe.cover-artist');\n case FilterField.Editor:\n return translate('filter-field-pipe.editor');\n case FilterField.Formats:\n return translate('filter-field-pipe.formats');\n case FilterField.Genres:\n return translate('filter-field-pipe.genres');\n case FilterField.Inker:\n return translate('filter-field-pipe.inker');\n case FilterField.Languages:\n return translate('filter-field-pipe.languages');\n case FilterField.Libraries:\n return translate('filter-field-pipe.libraries');\n case FilterField.Letterer:\n return translate('filter-field-pipe.letterer');\n case FilterField.PublicationStatus:\n return translate('filter-field-pipe.publication-status');\n case FilterField.Penciller:\n return translate('filter-field-pipe.penciller');\n case FilterField.Publisher:\n return translate('filter-field-pipe.publisher');\n case FilterField.ReadProgress:\n return translate('filter-field-pipe.read-progress');\n case FilterField.ReadTime:\n return translate('filter-field-pipe.read-time');\n case FilterField.ReleaseYear:\n return translate('filter-field-pipe.release-year');\n case FilterField.SeriesName:\n return translate('filter-field-pipe.series-name');\n case FilterField.Summary:\n return translate('filter-field-pipe.summary');\n case FilterField.Tags:\n return translate('filter-field-pipe.tags');\n case FilterField.Translators:\n return translate('filter-field-pipe.translators');\n case FilterField.UserRating:\n return translate('filter-field-pipe.user-rating');\n case FilterField.Writers:\n return translate('filter-field-pipe.writers');\n case FilterField.Path:\n return translate('filter-field-pipe.path');\n case FilterField.FilePath:\n return translate('filter-field-pipe.file-path');\n default:\n throw new Error(`Invalid FilterField value: ${value}`);\n }\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { FilterComparison } from 'src/app/_models/metadata/v2/filter-comparison';\nimport {translate} from \"@ngneat/transloco\";\n\n@Pipe({\n name: 'filterComparison',\n standalone: true\n})\nexport class FilterComparisonPipe implements PipeTransform {\n\n transform(value: FilterComparison): string {\n switch (value) {\n case FilterComparison.BeginsWith:\n return translate('filter-comparison-pipe.begins-with');\n case FilterComparison.Contains:\n return translate('filter-comparison-pipe.contains');\n case FilterComparison.Equal:\n return translate('filter-comparison-pipe.equal');\n case FilterComparison.GreaterThan:\n return translate('filter-comparison-pipe.greater-than');\n case FilterComparison.GreaterThanEqual:\n return translate('filter-comparison-pipe.greater-than-or-equal');\n case FilterComparison.LessThan:\n return translate('filter-comparison-pipe.less-than');\n case FilterComparison.LessThanEqual:\n return translate('filter-comparison-pipe.less-than-or-equal');\n case FilterComparison.Matches:\n return translate('filter-comparison-pipe.matches');\n case FilterComparison.NotContains:\n return translate('filter-comparison-pipe.does-not-contain');\n case FilterComparison.NotEqual:\n return translate('filter-comparison-pipe.not-equal');\n case FilterComparison.EndsWith:\n return translate('filter-comparison-pipe.ends-with');\n case FilterComparison.IsBefore:\n return translate('filter-comparison-pipe.is-before');\n case FilterComparison.IsAfter:\n return translate('filter-comparison-pipe.is-after');\n case FilterComparison.IsInLast:\n return translate('filter-comparison-pipe.is-in-last');\n case FilterComparison.IsNotInLast:\n return translate('filter-comparison-pipe.is-not-in-last');\n case FilterComparison.MustContains:\n return translate('filter-comparison-pipe.must-contains');\n default:\n throw new Error(`Invalid FilterComparison value: ${value}`);\n }\n }\n\n}\n","import * as i1 from '@angular/cdk/scrolling';\nimport { ScrollingModule } from '@angular/cdk/scrolling';\nexport { CdkScrollable, ScrollDispatcher, ViewportRuler } from '@angular/cdk/scrolling';\nimport * as i6 from '@angular/common';\nimport { DOCUMENT } from '@angular/common';\nimport * as i0 from '@angular/core';\nimport { Injectable, Inject, Optional, ElementRef, ApplicationRef, ANIMATION_MODULE_TYPE, InjectionToken, Directive, EventEmitter, Input, Output, NgModule } from '@angular/core';\nimport { coerceCssPixelValue, coerceArray, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport * as i1$1 from '@angular/cdk/platform';\nimport { supportsScrollBehavior, _getEventTarget, _isTestEnvironment } from '@angular/cdk/platform';\nimport { filter, take, takeUntil, takeWhile } from 'rxjs/operators';\nimport * as i5 from '@angular/cdk/bidi';\nimport { BidiModule } from '@angular/cdk/bidi';\nimport { DomPortalOutlet, TemplatePortal, PortalModule } from '@angular/cdk/portal';\nimport { Subject, Subscription, merge } from 'rxjs';\nimport { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';\n\nconst scrollBehaviorSupported = supportsScrollBehavior();\n/**\n * Strategy that will prevent the user from scrolling while the overlay is visible.\n */\nclass BlockScrollStrategy {\n constructor(_viewportRuler, document) {\n this._viewportRuler = _viewportRuler;\n this._previousHTMLStyles = { top: '', left: '' };\n this._isEnabled = false;\n this._document = document;\n }\n /** Attaches this scroll strategy to an overlay. */\n attach() { }\n /** Blocks page-level scroll while the attached overlay is open. */\n enable() {\n if (this._canBeEnabled()) {\n const root = this._document.documentElement;\n this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();\n // Cache the previous inline styles in case the user had set them.\n this._previousHTMLStyles.left = root.style.left || '';\n this._previousHTMLStyles.top = root.style.top || '';\n // Note: we're using the `html` node, instead of the `body`, because the `body` may\n // have the user agent margin, whereas the `html` is guaranteed not to have one.\n root.style.left = coerceCssPixelValue(-this._previousScrollPosition.left);\n root.style.top = coerceCssPixelValue(-this._previousScrollPosition.top);\n root.classList.add('cdk-global-scrollblock');\n this._isEnabled = true;\n }\n }\n /** Unblocks page-level scroll while the attached overlay is open. */\n disable() {\n if (this._isEnabled) {\n const html = this._document.documentElement;\n const body = this._document.body;\n const htmlStyle = html.style;\n const bodyStyle = body.style;\n const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';\n const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';\n this._isEnabled = false;\n htmlStyle.left = this._previousHTMLStyles.left;\n htmlStyle.top = this._previousHTMLStyles.top;\n html.classList.remove('cdk-global-scrollblock');\n // Disable user-defined smooth scrolling temporarily while we restore the scroll position.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n // Note that we don't mutate the property if the browser doesn't support `scroll-behavior`,\n // because it can throw off feature detections in `supportsScrollBehavior` which\n // checks for `'scrollBehavior' in documentElement.style`.\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';\n }\n window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);\n if (scrollBehaviorSupported) {\n htmlStyle.scrollBehavior = previousHtmlScrollBehavior;\n bodyStyle.scrollBehavior = previousBodyScrollBehavior;\n }\n }\n }\n _canBeEnabled() {\n // Since the scroll strategies can't be singletons, we have to use a global CSS class\n // (`cdk-global-scrollblock`) to make sure that we don't try to disable global\n // scrolling multiple times.\n const html = this._document.documentElement;\n if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {\n return false;\n }\n const body = this._document.body;\n const viewport = this._viewportRuler.getViewportSize();\n return body.scrollHeight > viewport.height || body.scrollWidth > viewport.width;\n }\n}\n\n/**\n * Returns an error to be thrown when attempting to attach an already-attached scroll strategy.\n */\nfunction getMatScrollStrategyAlreadyAttachedError() {\n return Error(`Scroll strategy has already been attached.`);\n}\n\n/**\n * Strategy that will close the overlay as soon as the user starts scrolling.\n */\nclass CloseScrollStrategy {\n constructor(_scrollDispatcher, _ngZone, _viewportRuler, _config) {\n this._scrollDispatcher = _scrollDispatcher;\n this._ngZone = _ngZone;\n this._viewportRuler = _viewportRuler;\n this._config = _config;\n this._scrollSubscription = null;\n /** Detaches the overlay ref and disables the scroll strategy. */\n this._detach = () => {\n this.disable();\n if (this._overlayRef.hasAttached()) {\n this._ngZone.run(() => this._overlayRef.detach());\n }\n };\n }\n /** Attaches this scroll strategy to an overlay. */\n attach(overlayRef) {\n if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatScrollStrategyAlreadyAttachedError();\n }\n this._overlayRef = overlayRef;\n }\n /** Enables the closing of the attached overlay on scroll. */\n enable() {\n if (this._scrollSubscription) {\n return;\n }\n const stream = this._scrollDispatcher.scrolled(0).pipe(filter(scrollable => {\n return (!scrollable ||\n !this._overlayRef.overlayElement.contains(scrollable.getElementRef().nativeElement));\n }));\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n this._scrollSubscription = stream.subscribe(() => {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config.threshold) {\n this._detach();\n }\n else {\n this._overlayRef.updatePosition();\n }\n });\n }\n else {\n this._scrollSubscription = stream.subscribe(this._detach);\n }\n }\n /** Disables the closing the attached overlay on scroll. */\n disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n }\n detach() {\n this.disable();\n this._overlayRef = null;\n }\n}\n\n/** Scroll strategy that doesn't do anything. */\nclass NoopScrollStrategy {\n /** Does nothing, as this scroll strategy is a no-op. */\n enable() { }\n /** Does nothing, as this scroll strategy is a no-op. */\n disable() { }\n /** Does nothing, as this scroll strategy is a no-op. */\n attach() { }\n}\n\n/**\n * Gets whether an element is scrolled outside of view by any of its parent scrolling containers.\n * @param element Dimensions of the element (from getBoundingClientRect)\n * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)\n * @returns Whether the element is scrolled out of view\n * @docs-private\n */\nfunction isElementScrolledOutsideView(element, scrollContainers) {\n return scrollContainers.some(containerBounds => {\n const outsideAbove = element.bottom < containerBounds.top;\n const outsideBelow = element.top > containerBounds.bottom;\n const outsideLeft = element.right < containerBounds.left;\n const outsideRight = element.left > containerBounds.right;\n return outsideAbove || outsideBelow || outsideLeft || outsideRight;\n });\n}\n/**\n * Gets whether an element is clipped by any of its scrolling containers.\n * @param element Dimensions of the element (from getBoundingClientRect)\n * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)\n * @returns Whether the element is clipped\n * @docs-private\n */\nfunction isElementClippedByScrolling(element, scrollContainers) {\n return scrollContainers.some(scrollContainerRect => {\n const clippedAbove = element.top < scrollContainerRect.top;\n const clippedBelow = element.bottom > scrollContainerRect.bottom;\n const clippedLeft = element.left < scrollContainerRect.left;\n const clippedRight = element.right > scrollContainerRect.right;\n return clippedAbove || clippedBelow || clippedLeft || clippedRight;\n });\n}\n\n/**\n * Strategy that will update the element position as the user is scrolling.\n */\nclass RepositionScrollStrategy {\n constructor(_scrollDispatcher, _viewportRuler, _ngZone, _config) {\n this._scrollDispatcher = _scrollDispatcher;\n this._viewportRuler = _viewportRuler;\n this._ngZone = _ngZone;\n this._config = _config;\n this._scrollSubscription = null;\n }\n /** Attaches this scroll strategy to an overlay. */\n attach(overlayRef) {\n if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMatScrollStrategyAlreadyAttachedError();\n }\n this._overlayRef = overlayRef;\n }\n /** Enables repositioning of the attached overlay on scroll. */\n enable() {\n if (!this._scrollSubscription) {\n const throttle = this._config ? this._config.scrollThrottle : 0;\n this._scrollSubscription = this._scrollDispatcher.scrolled(throttle).subscribe(() => {\n this._overlayRef.updatePosition();\n // TODO(crisbeto): make `close` on by default once all components can handle it.\n if (this._config && this._config.autoClose) {\n const overlayRect = this._overlayRef.overlayElement.getBoundingClientRect();\n const { width, height } = this._viewportRuler.getViewportSize();\n // TODO(crisbeto): include all ancestor scroll containers here once\n // we have a way of exposing the trigger element to the scroll strategy.\n const parentRects = [{ width, height, bottom: height, right: width, top: 0, left: 0 }];\n if (isElementScrolledOutsideView(overlayRect, parentRects)) {\n this.disable();\n this._ngZone.run(() => this._overlayRef.detach());\n }\n }\n });\n }\n }\n /** Disables repositioning of the attached overlay on scroll. */\n disable() {\n if (this._scrollSubscription) {\n this._scrollSubscription.unsubscribe();\n this._scrollSubscription = null;\n }\n }\n detach() {\n this.disable();\n this._overlayRef = null;\n }\n}\n\n/**\n * Options for how an overlay will handle scrolling.\n *\n * Users can provide a custom value for `ScrollStrategyOptions` to replace the default\n * behaviors. This class primarily acts as a factory for ScrollStrategy instances.\n */\nclass ScrollStrategyOptions {\n constructor(_scrollDispatcher, _viewportRuler, _ngZone, document) {\n this._scrollDispatcher = _scrollDispatcher;\n this._viewportRuler = _viewportRuler;\n this._ngZone = _ngZone;\n /** Do nothing on scroll. */\n this.noop = () => new NoopScrollStrategy();\n /**\n * Close the overlay as soon as the user scrolls.\n * @param config Configuration to be used inside the scroll strategy.\n */\n this.close = (config) => new CloseScrollStrategy(this._scrollDispatcher, this._ngZone, this._viewportRuler, config);\n /** Block scrolling. */\n this.block = () => new BlockScrollStrategy(this._viewportRuler, this._document);\n /**\n * Update the overlay's position on scroll.\n * @param config Configuration to be used inside the scroll strategy.\n * Allows debouncing the reposition calls.\n */\n this.reposition = (config) => new RepositionScrollStrategy(this._scrollDispatcher, this._viewportRuler, this._ngZone, config);\n this._document = document;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ScrollStrategyOptions, deps: [{ token: i1.ScrollDispatcher }, { token: i1.ViewportRuler }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ScrollStrategyOptions, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ScrollStrategyOptions, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: i1.ScrollDispatcher }, { type: i1.ViewportRuler }, { type: i0.NgZone }, { type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }]; } });\n\n/** Initial configuration used when creating an overlay. */\nclass OverlayConfig {\n constructor(config) {\n /** Strategy to be used when handling scroll events while the overlay is open. */\n this.scrollStrategy = new NoopScrollStrategy();\n /** Custom class to add to the overlay pane. */\n this.panelClass = '';\n /** Whether the overlay has a backdrop. */\n this.hasBackdrop = false;\n /** Custom class to add to the backdrop */\n this.backdropClass = 'cdk-overlay-dark-backdrop';\n /**\n * Whether the overlay should be disposed of when the user goes backwards/forwards in history.\n * Note that this usually doesn't include clicking on links (unless the user is using\n * the `HashLocationStrategy`).\n */\n this.disposeOnNavigation = false;\n if (config) {\n // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3,\n // loses the array generic type in the `for of`. But we *also* have to use `Array` because\n // typescript won't iterate over an `Iterable` unless you compile with `--downlevelIteration`\n const configKeys = Object.keys(config);\n for (const key of configKeys) {\n if (config[key] !== undefined) {\n // TypeScript, as of version 3.5, sees the left-hand-side of this expression\n // as \"I don't know *which* key this is, so the only valid value is the intersection\n // of all the possible values.\" In this case, that happens to be `undefined`. TypeScript\n // is not smart enough to see that the right-hand-side is actually an access of the same\n // exact type with the same exact key, meaning that the value type must be identical.\n // So we use `any` to work around this.\n this[key] = config[key];\n }\n }\n }\n }\n}\n\n/** The points of the origin element and the overlay element to connect. */\nclass ConnectionPositionPair {\n constructor(origin, overlay, \n /** Offset along the X axis. */\n offsetX, \n /** Offset along the Y axis. */\n offsetY, \n /** Class(es) to be applied to the panel while this position is active. */\n panelClass) {\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n this.panelClass = panelClass;\n this.originX = origin.originX;\n this.originY = origin.originY;\n this.overlayX = overlay.overlayX;\n this.overlayY = overlay.overlayY;\n }\n}\n/**\n * Set of properties regarding the position of the origin and overlay relative to the viewport\n * with respect to the containing Scrollable elements.\n *\n * The overlay and origin are clipped if any part of their bounding client rectangle exceeds the\n * bounds of any one of the strategy's Scrollable's bounding client rectangle.\n *\n * The overlay and origin are outside view if there is no overlap between their bounding client\n * rectangle and any one of the strategy's Scrollable's bounding client rectangle.\n *\n * ----------- -----------\n * | outside | | clipped |\n * | view | --------------------------\n * | | | | | |\n * ---------- | ----------- |\n * -------------------------- | |\n * | | | Scrollable |\n * | | | |\n * | | --------------------------\n * | Scrollable |\n * | |\n * --------------------------\n *\n * @docs-private\n */\nclass ScrollingVisibility {\n}\n/** The change event emitted by the strategy when a fallback position is used. */\nclass ConnectedOverlayPositionChange {\n constructor(\n /** The position used as a result of this change. */\n connectionPair, \n /** @docs-private */\n scrollableViewProperties) {\n this.connectionPair = connectionPair;\n this.scrollableViewProperties = scrollableViewProperties;\n }\n}\n/**\n * Validates whether a vertical position property matches the expected values.\n * @param property Name of the property being validated.\n * @param value Value of the property being validated.\n * @docs-private\n */\nfunction validateVerticalPosition(property, value) {\n if (value !== 'top' && value !== 'bottom' && value !== 'center') {\n throw Error(`ConnectedPosition: Invalid ${property} \"${value}\". ` +\n `Expected \"top\", \"bottom\" or \"center\".`);\n }\n}\n/**\n * Validates whether a horizontal position property matches the expected values.\n * @param property Name of the property being validated.\n * @param value Value of the property being validated.\n * @docs-private\n */\nfunction validateHorizontalPosition(property, value) {\n if (value !== 'start' && value !== 'end' && value !== 'center') {\n throw Error(`ConnectedPosition: Invalid ${property} \"${value}\". ` +\n `Expected \"start\", \"end\" or \"center\".`);\n }\n}\n\n/**\n * Service for dispatching events that land on the body to appropriate overlay ref,\n * if any. It maintains a list of attached overlays to determine best suited overlay based\n * on event target and order of overlay opens.\n */\nclass BaseOverlayDispatcher {\n constructor(document) {\n /** Currently attached overlays in the order they were attached. */\n this._attachedOverlays = [];\n this._document = document;\n }\n ngOnDestroy() {\n this.detach();\n }\n /** Add a new overlay to the list of attached overlay refs. */\n add(overlayRef) {\n // Ensure that we don't get the same overlay multiple times.\n this.remove(overlayRef);\n this._attachedOverlays.push(overlayRef);\n }\n /** Remove an overlay from the list of attached overlay refs. */\n remove(overlayRef) {\n const index = this._attachedOverlays.indexOf(overlayRef);\n if (index > -1) {\n this._attachedOverlays.splice(index, 1);\n }\n // Remove the global listener once there are no more overlays.\n if (this._attachedOverlays.length === 0) {\n this.detach();\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: BaseOverlayDispatcher, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: BaseOverlayDispatcher, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: BaseOverlayDispatcher, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }]; } });\n\n/**\n * Service for dispatching keyboard events that land on the body to appropriate overlay ref,\n * if any. It maintains a list of attached overlays to determine best suited overlay based\n * on event target and order of overlay opens.\n */\nclass OverlayKeyboardDispatcher extends BaseOverlayDispatcher {\n constructor(document, \n /** @breaking-change 14.0.0 _ngZone will be required. */\n _ngZone) {\n super(document);\n this._ngZone = _ngZone;\n /** Keyboard event listener that will be attached to the body. */\n this._keydownListener = (event) => {\n const overlays = this._attachedOverlays;\n for (let i = overlays.length - 1; i > -1; i--) {\n // Dispatch the keydown event to the top overlay which has subscribers to its keydown events.\n // We want to target the most recent overlay, rather than trying to match where the event came\n // from, because some components might open an overlay, but keep focus on a trigger element\n // (e.g. for select and autocomplete). We skip overlays without keydown event subscriptions,\n // because we don't want overlays that don't handle keyboard events to block the ones below\n // them that do.\n if (overlays[i]._keydownEvents.observers.length > 0) {\n const keydownEvents = overlays[i]._keydownEvents;\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.run(() => keydownEvents.next(event));\n }\n else {\n keydownEvents.next(event);\n }\n break;\n }\n }\n };\n }\n /** Add a new overlay to the list of attached overlay refs. */\n add(overlayRef) {\n super.add(overlayRef);\n // Lazily start dispatcher once first overlay is added\n if (!this._isAttached) {\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.runOutsideAngular(() => this._document.body.addEventListener('keydown', this._keydownListener));\n }\n else {\n this._document.body.addEventListener('keydown', this._keydownListener);\n }\n this._isAttached = true;\n }\n }\n /** Detaches the global keyboard event listener. */\n detach() {\n if (this._isAttached) {\n this._document.body.removeEventListener('keydown', this._keydownListener);\n this._isAttached = false;\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayKeyboardDispatcher, deps: [{ token: DOCUMENT }, { token: i0.NgZone, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayKeyboardDispatcher, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayKeyboardDispatcher, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }, { type: i0.NgZone, decorators: [{\n type: Optional\n }] }]; } });\n\n/**\n * Service for dispatching mouse click events that land on the body to appropriate overlay ref,\n * if any. It maintains a list of attached overlays to determine best suited overlay based\n * on event target and order of overlay opens.\n */\nclass OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {\n constructor(document, _platform, \n /** @breaking-change 14.0.0 _ngZone will be required. */\n _ngZone) {\n super(document);\n this._platform = _platform;\n this._ngZone = _ngZone;\n this._cursorStyleIsSet = false;\n /** Store pointerdown event target to track origin of click. */\n this._pointerDownListener = (event) => {\n this._pointerDownEventTarget = _getEventTarget(event);\n };\n /** Click event listener that will be attached to the body propagate phase. */\n this._clickListener = (event) => {\n const target = _getEventTarget(event);\n // In case of a click event, we want to check the origin of the click\n // (e.g. in case where a user starts a click inside the overlay and\n // releases the click outside of it).\n // This is done by using the event target of the preceding pointerdown event.\n // Every click event caused by a pointer device has a preceding pointerdown\n // event, unless the click was programmatically triggered (e.g. in a unit test).\n const origin = event.type === 'click' && this._pointerDownEventTarget\n ? this._pointerDownEventTarget\n : target;\n // Reset the stored pointerdown event target, to avoid having it interfere\n // in subsequent events.\n this._pointerDownEventTarget = null;\n // We copy the array because the original may be modified asynchronously if the\n // outsidePointerEvents listener decides to detach overlays resulting in index errors inside\n // the for loop.\n const overlays = this._attachedOverlays.slice();\n // Dispatch the mouse event to the top overlay which has subscribers to its mouse events.\n // We want to target all overlays for which the click could be considered as outside click.\n // As soon as we reach an overlay for which the click is not outside click we break off\n // the loop.\n for (let i = overlays.length - 1; i > -1; i--) {\n const overlayRef = overlays[i];\n if (overlayRef._outsidePointerEvents.observers.length < 1 || !overlayRef.hasAttached()) {\n continue;\n }\n // If it's a click inside the overlay, just break - we should do nothing\n // If it's an outside click (both origin and target of the click) dispatch the mouse event,\n // and proceed with the next overlay\n if (overlayRef.overlayElement.contains(target) ||\n overlayRef.overlayElement.contains(origin)) {\n break;\n }\n const outsidePointerEvents = overlayRef._outsidePointerEvents;\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.run(() => outsidePointerEvents.next(event));\n }\n else {\n outsidePointerEvents.next(event);\n }\n }\n };\n }\n /** Add a new overlay to the list of attached overlay refs. */\n add(overlayRef) {\n super.add(overlayRef);\n // Safari on iOS does not generate click events for non-interactive\n // elements. However, we want to receive a click for any element outside\n // the overlay. We can force a \"clickable\" state by setting\n // `cursor: pointer` on the document body. See:\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Safari_Mobile\n // https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html\n if (!this._isAttached) {\n const body = this._document.body;\n /** @breaking-change 14.0.0 _ngZone will be required. */\n if (this._ngZone) {\n this._ngZone.runOutsideAngular(() => this._addEventListeners(body));\n }\n else {\n this._addEventListeners(body);\n }\n // click event is not fired on iOS. To make element \"clickable\" we are\n // setting the cursor to pointer\n if (this._platform.IOS && !this._cursorStyleIsSet) {\n this._cursorOriginalValue = body.style.cursor;\n body.style.cursor = 'pointer';\n this._cursorStyleIsSet = true;\n }\n this._isAttached = true;\n }\n }\n /** Detaches the global keyboard event listener. */\n detach() {\n if (this._isAttached) {\n const body = this._document.body;\n body.removeEventListener('pointerdown', this._pointerDownListener, true);\n body.removeEventListener('click', this._clickListener, true);\n body.removeEventListener('auxclick', this._clickListener, true);\n body.removeEventListener('contextmenu', this._clickListener, true);\n if (this._platform.IOS && this._cursorStyleIsSet) {\n body.style.cursor = this._cursorOriginalValue;\n this._cursorStyleIsSet = false;\n }\n this._isAttached = false;\n }\n }\n _addEventListeners(body) {\n body.addEventListener('pointerdown', this._pointerDownListener, true);\n body.addEventListener('click', this._clickListener, true);\n body.addEventListener('auxclick', this._clickListener, true);\n body.addEventListener('contextmenu', this._clickListener, true);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayOutsideClickDispatcher, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }, { token: i0.NgZone, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayOutsideClickDispatcher, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayOutsideClickDispatcher, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }, { type: i1$1.Platform }, { type: i0.NgZone, decorators: [{\n type: Optional\n }] }]; } });\n\n/** Container inside which all overlays will render. */\nclass OverlayContainer {\n constructor(document, _platform) {\n this._platform = _platform;\n this._document = document;\n }\n ngOnDestroy() {\n this._containerElement?.remove();\n }\n /**\n * This method returns the overlay container element. It will lazily\n * create the element the first time it is called to facilitate using\n * the container in non-browser environments.\n * @returns the container element\n */\n getContainerElement() {\n if (!this._containerElement) {\n this._createContainer();\n }\n return this._containerElement;\n }\n /**\n * Create the overlay container element, which is simply a div\n * with the 'cdk-overlay-container' class on the document body.\n */\n _createContainer() {\n const containerClass = 'cdk-overlay-container';\n // TODO(crisbeto): remove the testing check once we have an overlay testing\n // module or Angular starts tearing down the testing `NgModule`. See:\n // https://github.com/angular/angular/issues/18831\n if (this._platform.isBrowser || _isTestEnvironment()) {\n const oppositePlatformContainers = this._document.querySelectorAll(`.${containerClass}[platform=\"server\"], ` + `.${containerClass}[platform=\"test\"]`);\n // Remove any old containers from the opposite platform.\n // This can happen when transitioning from the server to the client.\n for (let i = 0; i < oppositePlatformContainers.length; i++) {\n oppositePlatformContainers[i].remove();\n }\n }\n const container = this._document.createElement('div');\n container.classList.add(containerClass);\n // A long time ago we kept adding new overlay containers whenever a new app was instantiated,\n // but at some point we added logic which clears the duplicate ones in order to avoid leaks.\n // The new logic was a little too aggressive since it was breaking some legitimate use cases.\n // To mitigate the problem we made it so that only containers from a different platform are\n // cleared, but the side-effect was that people started depending on the overly-aggressive\n // logic to clean up their tests for them. Until we can introduce an overlay-specific testing\n // module which does the cleanup, we try to detect that we're in a test environment and we\n // always clear the container. See #17006.\n // TODO(crisbeto): remove the test environment check once we have an overlay testing module.\n if (_isTestEnvironment()) {\n container.setAttribute('platform', 'test');\n }\n else if (!this._platform.isBrowser) {\n container.setAttribute('platform', 'server');\n }\n this._document.body.appendChild(container);\n this._containerElement = container;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayContainer, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayContainer, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }, { type: i1$1.Platform }]; } });\n\n/**\n * Reference to an overlay that has been created with the Overlay service.\n * Used to manipulate or dispose of said overlay.\n */\nclass OverlayRef {\n constructor(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document, _location, _outsideClickDispatcher, _animationsDisabled = false) {\n this._portalOutlet = _portalOutlet;\n this._host = _host;\n this._pane = _pane;\n this._config = _config;\n this._ngZone = _ngZone;\n this._keyboardDispatcher = _keyboardDispatcher;\n this._document = _document;\n this._location = _location;\n this._outsideClickDispatcher = _outsideClickDispatcher;\n this._animationsDisabled = _animationsDisabled;\n this._backdropElement = null;\n this._backdropClick = new Subject();\n this._attachments = new Subject();\n this._detachments = new Subject();\n this._locationChanges = Subscription.EMPTY;\n this._backdropClickHandler = (event) => this._backdropClick.next(event);\n this._backdropTransitionendHandler = (event) => {\n this._disposeBackdrop(event.target);\n };\n /** Stream of keydown events dispatched to this overlay. */\n this._keydownEvents = new Subject();\n /** Stream of mouse outside events dispatched to this overlay. */\n this._outsidePointerEvents = new Subject();\n if (_config.scrollStrategy) {\n this._scrollStrategy = _config.scrollStrategy;\n this._scrollStrategy.attach(this);\n }\n this._positionStrategy = _config.positionStrategy;\n }\n /** The overlay's HTML element */\n get overlayElement() {\n return this._pane;\n }\n /** The overlay's backdrop HTML element. */\n get backdropElement() {\n return this._backdropElement;\n }\n /**\n * Wrapper around the panel element. Can be used for advanced\n * positioning where a wrapper with specific styling is\n * required around the overlay pane.\n */\n get hostElement() {\n return this._host;\n }\n /**\n * Attaches content, given via a Portal, to the overlay.\n * If the overlay is configured to have a backdrop, it will be created.\n *\n * @param portal Portal instance to which to attach the overlay.\n * @returns The portal attachment result.\n */\n attach(portal) {\n // Insert the host into the DOM before attaching the portal, otherwise\n // the animations module will skip animations on repeat attachments.\n if (!this._host.parentElement && this._previousHostParent) {\n this._previousHostParent.appendChild(this._host);\n }\n const attachResult = this._portalOutlet.attach(portal);\n if (this._positionStrategy) {\n this._positionStrategy.attach(this);\n }\n this._updateStackingOrder();\n this._updateElementSize();\n this._updateElementDirection();\n if (this._scrollStrategy) {\n this._scrollStrategy.enable();\n }\n // Update the position once the zone is stable so that the overlay will be fully rendered\n // before attempting to position it, as the position may depend on the size of the rendered\n // content.\n this._ngZone.onStable.pipe(take(1)).subscribe(() => {\n // The overlay could've been detached before the zone has stabilized.\n if (this.hasAttached()) {\n this.updatePosition();\n }\n });\n // Enable pointer events for the overlay pane element.\n this._togglePointerEvents(true);\n if (this._config.hasBackdrop) {\n this._attachBackdrop();\n }\n if (this._config.panelClass) {\n this._toggleClasses(this._pane, this._config.panelClass, true);\n }\n // Only emit the `attachments` event once all other setup is done.\n this._attachments.next();\n // Track this overlay by the keyboard dispatcher\n this._keyboardDispatcher.add(this);\n if (this._config.disposeOnNavigation) {\n this._locationChanges = this._location.subscribe(() => this.dispose());\n }\n this._outsideClickDispatcher.add(this);\n // TODO(crisbeto): the null check is here, because the portal outlet returns `any`.\n // We should be guaranteed for the result to be `ComponentRef | EmbeddedViewRef`, but\n // `instanceof EmbeddedViewRef` doesn't appear to work at the moment.\n if (typeof attachResult?.onDestroy === 'function') {\n // In most cases we control the portal and we know when it is being detached so that\n // we can finish the disposal process. The exception is if the user passes in a custom\n // `ViewContainerRef` that isn't destroyed through the overlay API. Note that we use\n // `detach` here instead of `dispose`, because we don't know if the user intends to\n // reattach the overlay at a later point. It also has the advantage of waiting for animations.\n attachResult.onDestroy(() => {\n if (this.hasAttached()) {\n // We have to delay the `detach` call, because detaching immediately prevents\n // other destroy hooks from running. This is likely a framework bug similar to\n // https://github.com/angular/angular/issues/46119\n this._ngZone.runOutsideAngular(() => Promise.resolve().then(() => this.detach()));\n }\n });\n }\n return attachResult;\n }\n /**\n * Detaches an overlay from a portal.\n * @returns The portal detachment result.\n */\n detach() {\n if (!this.hasAttached()) {\n return;\n }\n this.detachBackdrop();\n // When the overlay is detached, the pane element should disable pointer events.\n // This is necessary because otherwise the pane element will cover the page and disable\n // pointer events therefore. Depends on the position strategy and the applied pane boundaries.\n this._togglePointerEvents(false);\n if (this._positionStrategy && this._positionStrategy.detach) {\n this._positionStrategy.detach();\n }\n if (this._scrollStrategy) {\n this._scrollStrategy.disable();\n }\n const detachmentResult = this._portalOutlet.detach();\n // Only emit after everything is detached.\n this._detachments.next();\n // Remove this overlay from keyboard dispatcher tracking.\n this._keyboardDispatcher.remove(this);\n // Keeping the host element in the DOM can cause scroll jank, because it still gets\n // rendered, even though it's transparent and unclickable which is why we remove it.\n this._detachContentWhenStable();\n this._locationChanges.unsubscribe();\n this._outsideClickDispatcher.remove(this);\n return detachmentResult;\n }\n /** Cleans up the overlay from the DOM. */\n dispose() {\n const isAttached = this.hasAttached();\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n this._disposeScrollStrategy();\n this._disposeBackdrop(this._backdropElement);\n this._locationChanges.unsubscribe();\n this._keyboardDispatcher.remove(this);\n this._portalOutlet.dispose();\n this._attachments.complete();\n this._backdropClick.complete();\n this._keydownEvents.complete();\n this._outsidePointerEvents.complete();\n this._outsideClickDispatcher.remove(this);\n this._host?.remove();\n this._previousHostParent = this._pane = this._host = null;\n if (isAttached) {\n this._detachments.next();\n }\n this._detachments.complete();\n }\n /** Whether the overlay has attached content. */\n hasAttached() {\n return this._portalOutlet.hasAttached();\n }\n /** Gets an observable that emits when the backdrop has been clicked. */\n backdropClick() {\n return this._backdropClick;\n }\n /** Gets an observable that emits when the overlay has been attached. */\n attachments() {\n return this._attachments;\n }\n /** Gets an observable that emits when the overlay has been detached. */\n detachments() {\n return this._detachments;\n }\n /** Gets an observable of keydown events targeted to this overlay. */\n keydownEvents() {\n return this._keydownEvents;\n }\n /** Gets an observable of pointer events targeted outside this overlay. */\n outsidePointerEvents() {\n return this._outsidePointerEvents;\n }\n /** Gets the current overlay configuration, which is immutable. */\n getConfig() {\n return this._config;\n }\n /** Updates the position of the overlay based on the position strategy. */\n updatePosition() {\n if (this._positionStrategy) {\n this._positionStrategy.apply();\n }\n }\n /** Switches to a new position strategy and updates the overlay position. */\n updatePositionStrategy(strategy) {\n if (strategy === this._positionStrategy) {\n return;\n }\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n this._positionStrategy = strategy;\n if (this.hasAttached()) {\n strategy.attach(this);\n this.updatePosition();\n }\n }\n /** Update the size properties of the overlay. */\n updateSize(sizeConfig) {\n this._config = { ...this._config, ...sizeConfig };\n this._updateElementSize();\n }\n /** Sets the LTR/RTL direction for the overlay. */\n setDirection(dir) {\n this._config = { ...this._config, direction: dir };\n this._updateElementDirection();\n }\n /** Add a CSS class or an array of classes to the overlay pane. */\n addPanelClass(classes) {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, true);\n }\n }\n /** Remove a CSS class or an array of classes from the overlay pane. */\n removePanelClass(classes) {\n if (this._pane) {\n this._toggleClasses(this._pane, classes, false);\n }\n }\n /**\n * Returns the layout direction of the overlay panel.\n */\n getDirection() {\n const direction = this._config.direction;\n if (!direction) {\n return 'ltr';\n }\n return typeof direction === 'string' ? direction : direction.value;\n }\n /** Switches to a new scroll strategy. */\n updateScrollStrategy(strategy) {\n if (strategy === this._scrollStrategy) {\n return;\n }\n this._disposeScrollStrategy();\n this._scrollStrategy = strategy;\n if (this.hasAttached()) {\n strategy.attach(this);\n strategy.enable();\n }\n }\n /** Updates the text direction of the overlay panel. */\n _updateElementDirection() {\n this._host.setAttribute('dir', this.getDirection());\n }\n /** Updates the size of the overlay element based on the overlay config. */\n _updateElementSize() {\n if (!this._pane) {\n return;\n }\n const style = this._pane.style;\n style.width = coerceCssPixelValue(this._config.width);\n style.height = coerceCssPixelValue(this._config.height);\n style.minWidth = coerceCssPixelValue(this._config.minWidth);\n style.minHeight = coerceCssPixelValue(this._config.minHeight);\n style.maxWidth = coerceCssPixelValue(this._config.maxWidth);\n style.maxHeight = coerceCssPixelValue(this._config.maxHeight);\n }\n /** Toggles the pointer events for the overlay pane element. */\n _togglePointerEvents(enablePointer) {\n this._pane.style.pointerEvents = enablePointer ? '' : 'none';\n }\n /** Attaches a backdrop for this overlay. */\n _attachBackdrop() {\n const showingClass = 'cdk-overlay-backdrop-showing';\n this._backdropElement = this._document.createElement('div');\n this._backdropElement.classList.add('cdk-overlay-backdrop');\n if (this._animationsDisabled) {\n this._backdropElement.classList.add('cdk-overlay-backdrop-noop-animation');\n }\n if (this._config.backdropClass) {\n this._toggleClasses(this._backdropElement, this._config.backdropClass, true);\n }\n // Insert the backdrop before the pane in the DOM order,\n // in order to handle stacked overlays properly.\n this._host.parentElement.insertBefore(this._backdropElement, this._host);\n // Forward backdrop clicks such that the consumer of the overlay can perform whatever\n // action desired when such a click occurs (usually closing the overlay).\n this._backdropElement.addEventListener('click', this._backdropClickHandler);\n // Add class to fade-in the backdrop after one frame.\n if (!this._animationsDisabled && typeof requestAnimationFrame !== 'undefined') {\n this._ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => {\n if (this._backdropElement) {\n this._backdropElement.classList.add(showingClass);\n }\n });\n });\n }\n else {\n this._backdropElement.classList.add(showingClass);\n }\n }\n /**\n * Updates the stacking order of the element, moving it to the top if necessary.\n * This is required in cases where one overlay was detached, while another one,\n * that should be behind it, was destroyed. The next time both of them are opened,\n * the stacking will be wrong, because the detached element's pane will still be\n * in its original DOM position.\n */\n _updateStackingOrder() {\n if (this._host.nextSibling) {\n this._host.parentNode.appendChild(this._host);\n }\n }\n /** Detaches the backdrop (if any) associated with the overlay. */\n detachBackdrop() {\n const backdropToDetach = this._backdropElement;\n if (!backdropToDetach) {\n return;\n }\n if (this._animationsDisabled) {\n this._disposeBackdrop(backdropToDetach);\n return;\n }\n backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');\n this._ngZone.runOutsideAngular(() => {\n backdropToDetach.addEventListener('transitionend', this._backdropTransitionendHandler);\n });\n // If the backdrop doesn't have a transition, the `transitionend` event won't fire.\n // In this case we make it unclickable and we try to remove it after a delay.\n backdropToDetach.style.pointerEvents = 'none';\n // Run this outside the Angular zone because there's nothing that Angular cares about.\n // If it were to run inside the Angular zone, every test that used Overlay would have to be\n // either async or fakeAsync.\n this._backdropTimeout = this._ngZone.runOutsideAngular(() => setTimeout(() => {\n this._disposeBackdrop(backdropToDetach);\n }, 500));\n }\n /** Toggles a single CSS class or an array of classes on an element. */\n _toggleClasses(element, cssClasses, isAdd) {\n const classes = coerceArray(cssClasses || []).filter(c => !!c);\n if (classes.length) {\n isAdd ? element.classList.add(...classes) : element.classList.remove(...classes);\n }\n }\n /** Detaches the overlay content next time the zone stabilizes. */\n _detachContentWhenStable() {\n // Normally we wouldn't have to explicitly run this outside the `NgZone`, however\n // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will\n // be patched to run inside the zone, which will throw us into an infinite loop.\n this._ngZone.runOutsideAngular(() => {\n // We can't remove the host here immediately, because the overlay pane's content\n // might still be animating. This stream helps us avoid interrupting the animation\n // by waiting for the pane to become empty.\n const subscription = this._ngZone.onStable\n .pipe(takeUntil(merge(this._attachments, this._detachments)))\n .subscribe(() => {\n // Needs a couple of checks for the pane and host, because\n // they may have been removed by the time the zone stabilizes.\n if (!this._pane || !this._host || this._pane.children.length === 0) {\n if (this._pane && this._config.panelClass) {\n this._toggleClasses(this._pane, this._config.panelClass, false);\n }\n if (this._host && this._host.parentElement) {\n this._previousHostParent = this._host.parentElement;\n this._host.remove();\n }\n subscription.unsubscribe();\n }\n });\n });\n }\n /** Disposes of a scroll strategy. */\n _disposeScrollStrategy() {\n const scrollStrategy = this._scrollStrategy;\n if (scrollStrategy) {\n scrollStrategy.disable();\n if (scrollStrategy.detach) {\n scrollStrategy.detach();\n }\n }\n }\n /** Removes a backdrop element from the DOM. */\n _disposeBackdrop(backdrop) {\n if (backdrop) {\n backdrop.removeEventListener('click', this._backdropClickHandler);\n backdrop.removeEventListener('transitionend', this._backdropTransitionendHandler);\n backdrop.remove();\n // It is possible that a new portal has been attached to this overlay since we started\n // removing the backdrop. If that is the case, only clear the backdrop reference if it\n // is still the same instance that we started to remove.\n if (this._backdropElement === backdrop) {\n this._backdropElement = null;\n }\n }\n if (this._backdropTimeout) {\n clearTimeout(this._backdropTimeout);\n this._backdropTimeout = undefined;\n }\n }\n}\n\n// TODO: refactor clipping detection into a separate thing (part of scrolling module)\n// TODO: doesn't handle both flexible width and height when it has to scroll along both axis.\n/** Class to be added to the overlay bounding box. */\nconst boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';\n/** Regex used to split a string on its CSS units. */\nconst cssUnitPattern = /([A-Za-z%]+)$/;\n/**\n * A strategy for positioning overlays. Using this strategy, an overlay is given an\n * implicit position relative some origin element. The relative position is defined in terms of\n * a point on the origin element that is connected to a point on the overlay element. For example,\n * a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner\n * of the overlay.\n */\nclass FlexibleConnectedPositionStrategy {\n /** Ordered list of preferred positions, from most to least desirable. */\n get positions() {\n return this._preferredPositions;\n }\n constructor(connectedTo, _viewportRuler, _document, _platform, _overlayContainer) {\n this._viewportRuler = _viewportRuler;\n this._document = _document;\n this._platform = _platform;\n this._overlayContainer = _overlayContainer;\n /** Last size used for the bounding box. Used to avoid resizing the overlay after open. */\n this._lastBoundingBoxSize = { width: 0, height: 0 };\n /** Whether the overlay was pushed in a previous positioning. */\n this._isPushed = false;\n /** Whether the overlay can be pushed on-screen on the initial open. */\n this._canPush = true;\n /** Whether the overlay can grow via flexible width/height after the initial open. */\n this._growAfterOpen = false;\n /** Whether the overlay's width and height can be constrained to fit within the viewport. */\n this._hasFlexibleDimensions = true;\n /** Whether the overlay position is locked. */\n this._positionLocked = false;\n /** Amount of space that must be maintained between the overlay and the edge of the viewport. */\n this._viewportMargin = 0;\n /** The Scrollable containers used to check scrollable view properties on position change. */\n this._scrollables = [];\n /** Ordered list of preferred positions, from most to least desirable. */\n this._preferredPositions = [];\n /** Subject that emits whenever the position changes. */\n this._positionChanges = new Subject();\n /** Subscription to viewport size changes. */\n this._resizeSubscription = Subscription.EMPTY;\n /** Default offset for the overlay along the x axis. */\n this._offsetX = 0;\n /** Default offset for the overlay along the y axis. */\n this._offsetY = 0;\n /** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */\n this._appliedPanelClasses = [];\n /** Observable sequence of position changes. */\n this.positionChanges = this._positionChanges;\n this.setOrigin(connectedTo);\n }\n /** Attaches this position strategy to an overlay. */\n attach(overlayRef) {\n if (this._overlayRef &&\n overlayRef !== this._overlayRef &&\n (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('This position strategy is already attached to an overlay');\n }\n this._validatePositions();\n overlayRef.hostElement.classList.add(boundingBoxClass);\n this._overlayRef = overlayRef;\n this._boundingBox = overlayRef.hostElement;\n this._pane = overlayRef.overlayElement;\n this._isDisposed = false;\n this._isInitialRender = true;\n this._lastPosition = null;\n this._resizeSubscription.unsubscribe();\n this._resizeSubscription = this._viewportRuler.change().subscribe(() => {\n // When the window is resized, we want to trigger the next reposition as if it\n // was an initial render, in order for the strategy to pick a new optimal position,\n // otherwise position locking will cause it to stay at the old one.\n this._isInitialRender = true;\n this.apply();\n });\n }\n /**\n * Updates the position of the overlay element, using whichever preferred position relative\n * to the origin best fits on-screen.\n *\n * The selection of a position goes as follows:\n * - If any positions fit completely within the viewport as-is,\n * choose the first position that does so.\n * - If flexible dimensions are enabled and at least one satisfies the given minimum width/height,\n * choose the position with the greatest available size modified by the positions' weight.\n * - If pushing is enabled, take the position that went off-screen the least and push it\n * on-screen.\n * - If none of the previous criteria were met, use the position that goes off-screen the least.\n * @docs-private\n */\n apply() {\n // We shouldn't do anything if the strategy was disposed or we're on the server.\n if (this._isDisposed || !this._platform.isBrowser) {\n return;\n }\n // If the position has been applied already (e.g. when the overlay was opened) and the\n // consumer opted into locking in the position, re-use the old position, in order to\n // prevent the overlay from jumping around.\n if (!this._isInitialRender && this._positionLocked && this._lastPosition) {\n this.reapplyLastPosition();\n return;\n }\n this._clearPanelClasses();\n this._resetOverlayElementStyles();\n this._resetBoundingBoxStyles();\n // We need the bounding rects for the origin, the overlay and the container to determine how to position\n // the overlay relative to the origin.\n // We use the viewport rect to determine whether a position would go off-screen.\n this._viewportRect = this._getNarrowedViewportRect();\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();\n const originRect = this._originRect;\n const overlayRect = this._overlayRect;\n const viewportRect = this._viewportRect;\n const containerRect = this._containerRect;\n // Positions where the overlay will fit with flexible dimensions.\n const flexibleFits = [];\n // Fallback if none of the preferred positions fit within the viewport.\n let fallback;\n // Go through each of the preferred positions looking for a good fit.\n // If a good fit is found, it will be applied immediately.\n for (let pos of this._preferredPositions) {\n // Get the exact (x, y) coordinate for the point-of-origin on the origin element.\n let originPoint = this._getOriginPoint(originRect, containerRect, pos);\n // From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the\n // overlay in this position. We use the top-left corner for calculations and later translate\n // this into an appropriate (top, left, bottom, right) style.\n let overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);\n // Calculate how well the overlay would fit into the viewport with this point.\n let overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);\n // If the overlay, without any further work, fits into the viewport, use this position.\n if (overlayFit.isCompletelyWithinViewport) {\n this._isPushed = false;\n this._applyPosition(pos, originPoint);\n return;\n }\n // If the overlay has flexible dimensions, we can use this position\n // so long as there's enough space for the minimum dimensions.\n if (this._canFitWithFlexibleDimensions(overlayFit, overlayPoint, viewportRect)) {\n // Save positions where the overlay will fit with flexible dimensions. We will use these\n // if none of the positions fit *without* flexible dimensions.\n flexibleFits.push({\n position: pos,\n origin: originPoint,\n overlayRect,\n boundingBoxRect: this._calculateBoundingBoxRect(originPoint, pos),\n });\n continue;\n }\n // If the current preferred position does not fit on the screen, remember the position\n // if it has more visible area on-screen than we've seen and move onto the next preferred\n // position.\n if (!fallback || fallback.overlayFit.visibleArea < overlayFit.visibleArea) {\n fallback = { overlayFit, overlayPoint, originPoint, position: pos, overlayRect };\n }\n }\n // If there are any positions where the overlay would fit with flexible dimensions, choose the\n // one that has the greatest area available modified by the position's weight\n if (flexibleFits.length) {\n let bestFit = null;\n let bestScore = -1;\n for (const fit of flexibleFits) {\n const score = fit.boundingBoxRect.width * fit.boundingBoxRect.height * (fit.position.weight || 1);\n if (score > bestScore) {\n bestScore = score;\n bestFit = fit;\n }\n }\n this._isPushed = false;\n this._applyPosition(bestFit.position, bestFit.origin);\n return;\n }\n // When none of the preferred positions fit within the viewport, take the position\n // that went off-screen the least and attempt to push it on-screen.\n if (this._canPush) {\n // TODO(jelbourn): after pushing, the opening \"direction\" of the overlay might not make sense.\n this._isPushed = true;\n this._applyPosition(fallback.position, fallback.originPoint);\n return;\n }\n // All options for getting the overlay within the viewport have been exhausted, so go with the\n // position that went off-screen the least.\n this._applyPosition(fallback.position, fallback.originPoint);\n }\n detach() {\n this._clearPanelClasses();\n this._lastPosition = null;\n this._previousPushAmount = null;\n this._resizeSubscription.unsubscribe();\n }\n /** Cleanup after the element gets destroyed. */\n dispose() {\n if (this._isDisposed) {\n return;\n }\n // We can't use `_resetBoundingBoxStyles` here, because it resets\n // some properties to zero, rather than removing them.\n if (this._boundingBox) {\n extendStyles(this._boundingBox.style, {\n top: '',\n left: '',\n right: '',\n bottom: '',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }\n if (this._pane) {\n this._resetOverlayElementStyles();\n }\n if (this._overlayRef) {\n this._overlayRef.hostElement.classList.remove(boundingBoxClass);\n }\n this.detach();\n this._positionChanges.complete();\n this._overlayRef = this._boundingBox = null;\n this._isDisposed = true;\n }\n /**\n * This re-aligns the overlay element with the trigger in its last calculated position,\n * even if a position higher in the \"preferred positions\" list would now fit. This\n * allows one to re-align the panel without changing the orientation of the panel.\n */\n reapplyLastPosition() {\n if (this._isDisposed || !this._platform.isBrowser) {\n return;\n }\n const lastPosition = this._lastPosition;\n if (lastPosition) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();\n const originPoint = this._getOriginPoint(this._originRect, this._containerRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n }\n else {\n this.apply();\n }\n }\n /**\n * Sets the list of Scrollable containers that host the origin element so that\n * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every\n * Scrollable must be an ancestor element of the strategy's origin element.\n */\n withScrollableContainers(scrollables) {\n this._scrollables = scrollables;\n return this;\n }\n /**\n * Adds new preferred positions.\n * @param positions List of positions options for this overlay.\n */\n withPositions(positions) {\n this._preferredPositions = positions;\n // If the last calculated position object isn't part of the positions anymore, clear\n // it in order to avoid it being picked up if the consumer tries to re-apply.\n if (positions.indexOf(this._lastPosition) === -1) {\n this._lastPosition = null;\n }\n this._validatePositions();\n return this;\n }\n /**\n * Sets a minimum distance the overlay may be positioned to the edge of the viewport.\n * @param margin Required margin between the overlay and the viewport edge in pixels.\n */\n withViewportMargin(margin) {\n this._viewportMargin = margin;\n return this;\n }\n /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */\n withFlexibleDimensions(flexibleDimensions = true) {\n this._hasFlexibleDimensions = flexibleDimensions;\n return this;\n }\n /** Sets whether the overlay can grow after the initial open via flexible width/height. */\n withGrowAfterOpen(growAfterOpen = true) {\n this._growAfterOpen = growAfterOpen;\n return this;\n }\n /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */\n withPush(canPush = true) {\n this._canPush = canPush;\n return this;\n }\n /**\n * Sets whether the overlay's position should be locked in after it is positioned\n * initially. When an overlay is locked in, it won't attempt to reposition itself\n * when the position is re-applied (e.g. when the user scrolls away).\n * @param isLocked Whether the overlay should locked in.\n */\n withLockedPosition(isLocked = true) {\n this._positionLocked = isLocked;\n return this;\n }\n /**\n * Sets the origin, relative to which to position the overlay.\n * Using an element origin is useful for building components that need to be positioned\n * relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be\n * used for cases like contextual menus which open relative to the user's pointer.\n * @param origin Reference to the new origin.\n */\n setOrigin(origin) {\n this._origin = origin;\n return this;\n }\n /**\n * Sets the default offset for the overlay's connection point on the x-axis.\n * @param offset New offset in the X axis.\n */\n withDefaultOffsetX(offset) {\n this._offsetX = offset;\n return this;\n }\n /**\n * Sets the default offset for the overlay's connection point on the y-axis.\n * @param offset New offset in the Y axis.\n */\n withDefaultOffsetY(offset) {\n this._offsetY = offset;\n return this;\n }\n /**\n * Configures that the position strategy should set a `transform-origin` on some elements\n * inside the overlay, depending on the current position that is being applied. This is\n * useful for the cases where the origin of an animation can change depending on the\n * alignment of the overlay.\n * @param selector CSS selector that will be used to find the target\n * elements onto which to set the transform origin.\n */\n withTransformOriginOn(selector) {\n this._transformOriginSelector = selector;\n return this;\n }\n /**\n * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.\n */\n _getOriginPoint(originRect, containerRect, pos) {\n let x;\n if (pos.originX == 'center') {\n // Note: when centering we should always use the `left`\n // offset, otherwise the position will be wrong in RTL.\n x = originRect.left + originRect.width / 2;\n }\n else {\n const startX = this._isRtl() ? originRect.right : originRect.left;\n const endX = this._isRtl() ? originRect.left : originRect.right;\n x = pos.originX == 'start' ? startX : endX;\n }\n // When zooming in Safari the container rectangle contains negative values for the position\n // and we need to re-add them to the calculated coordinates.\n if (containerRect.left < 0) {\n x -= containerRect.left;\n }\n let y;\n if (pos.originY == 'center') {\n y = originRect.top + originRect.height / 2;\n }\n else {\n y = pos.originY == 'top' ? originRect.top : originRect.bottom;\n }\n // Normally the containerRect's top value would be zero, however when the overlay is attached to an input\n // (e.g. in an autocomplete), mobile browsers will shift everything in order to put the input in the middle\n // of the screen and to make space for the virtual keyboard. We need to account for this offset,\n // otherwise our positioning will be thrown off.\n // Additionally, when zooming in Safari this fixes the vertical position.\n if (containerRect.top < 0) {\n y -= containerRect.top;\n }\n return { x, y };\n }\n /**\n * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and\n * origin point to which the overlay should be connected.\n */\n _getOverlayPoint(originPoint, overlayRect, pos) {\n // Calculate the (overlayStartX, overlayStartY), the start of the\n // potential overlay position relative to the origin point.\n let overlayStartX;\n if (pos.overlayX == 'center') {\n overlayStartX = -overlayRect.width / 2;\n }\n else if (pos.overlayX === 'start') {\n overlayStartX = this._isRtl() ? -overlayRect.width : 0;\n }\n else {\n overlayStartX = this._isRtl() ? 0 : -overlayRect.width;\n }\n let overlayStartY;\n if (pos.overlayY == 'center') {\n overlayStartY = -overlayRect.height / 2;\n }\n else {\n overlayStartY = pos.overlayY == 'top' ? 0 : -overlayRect.height;\n }\n // The (x, y) coordinates of the overlay.\n return {\n x: originPoint.x + overlayStartX,\n y: originPoint.y + overlayStartY,\n };\n }\n /** Gets how well an overlay at the given point will fit within the viewport. */\n _getOverlayFit(point, rawOverlayRect, viewport, position) {\n // Round the overlay rect when comparing against the\n // viewport, because the viewport is always rounded.\n const overlay = getRoundedBoundingClientRect(rawOverlayRect);\n let { x, y } = point;\n let offsetX = this._getOffset(position, 'x');\n let offsetY = this._getOffset(position, 'y');\n // Account for the offsets since they could push the overlay out of the viewport.\n if (offsetX) {\n x += offsetX;\n }\n if (offsetY) {\n y += offsetY;\n }\n // How much the overlay would overflow at this position, on each side.\n let leftOverflow = 0 - x;\n let rightOverflow = x + overlay.width - viewport.width;\n let topOverflow = 0 - y;\n let bottomOverflow = y + overlay.height - viewport.height;\n // Visible parts of the element on each axis.\n let visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);\n let visibleHeight = this._subtractOverflows(overlay.height, topOverflow, bottomOverflow);\n let visibleArea = visibleWidth * visibleHeight;\n return {\n visibleArea,\n isCompletelyWithinViewport: overlay.width * overlay.height === visibleArea,\n fitsInViewportVertically: visibleHeight === overlay.height,\n fitsInViewportHorizontally: visibleWidth == overlay.width,\n };\n }\n /**\n * Whether the overlay can fit within the viewport when it may resize either its width or height.\n * @param fit How well the overlay fits in the viewport at some position.\n * @param point The (x, y) coordinates of the overlay at some position.\n * @param viewport The geometry of the viewport.\n */\n _canFitWithFlexibleDimensions(fit, point, viewport) {\n if (this._hasFlexibleDimensions) {\n const availableHeight = viewport.bottom - point.y;\n const availableWidth = viewport.right - point.x;\n const minHeight = getPixelValue(this._overlayRef.getConfig().minHeight);\n const minWidth = getPixelValue(this._overlayRef.getConfig().minWidth);\n const verticalFit = fit.fitsInViewportVertically || (minHeight != null && minHeight <= availableHeight);\n const horizontalFit = fit.fitsInViewportHorizontally || (minWidth != null && minWidth <= availableWidth);\n return verticalFit && horizontalFit;\n }\n return false;\n }\n /**\n * Gets the point at which the overlay can be \"pushed\" on-screen. If the overlay is larger than\n * the viewport, the top-left corner will be pushed on-screen (with overflow occurring on the\n * right and bottom).\n *\n * @param start Starting point from which the overlay is pushed.\n * @param rawOverlayRect Dimensions of the overlay.\n * @param scrollPosition Current viewport scroll position.\n * @returns The point at which to position the overlay after pushing. This is effectively a new\n * originPoint.\n */\n _pushOverlayOnScreen(start, rawOverlayRect, scrollPosition) {\n // If the position is locked and we've pushed the overlay already, reuse the previous push\n // amount, rather than pushing it again. If we were to continue pushing, the element would\n // remain in the viewport, which goes against the expectations when position locking is enabled.\n if (this._previousPushAmount && this._positionLocked) {\n return {\n x: start.x + this._previousPushAmount.x,\n y: start.y + this._previousPushAmount.y,\n };\n }\n // Round the overlay rect when comparing against the\n // viewport, because the viewport is always rounded.\n const overlay = getRoundedBoundingClientRect(rawOverlayRect);\n const viewport = this._viewportRect;\n // Determine how much the overlay goes outside the viewport on each\n // side, which we'll use to decide which direction to push it.\n const overflowRight = Math.max(start.x + overlay.width - viewport.width, 0);\n const overflowBottom = Math.max(start.y + overlay.height - viewport.height, 0);\n const overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);\n const overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);\n // Amount by which to push the overlay in each axis such that it remains on-screen.\n let pushX = 0;\n let pushY = 0;\n // If the overlay fits completely within the bounds of the viewport, push it from whichever\n // direction is goes off-screen. Otherwise, push the top-left corner such that its in the\n // viewport and allow for the trailing end of the overlay to go out of bounds.\n if (overlay.width <= viewport.width) {\n pushX = overflowLeft || -overflowRight;\n }\n else {\n pushX = start.x < this._viewportMargin ? viewport.left - scrollPosition.left - start.x : 0;\n }\n if (overlay.height <= viewport.height) {\n pushY = overflowTop || -overflowBottom;\n }\n else {\n pushY = start.y < this._viewportMargin ? viewport.top - scrollPosition.top - start.y : 0;\n }\n this._previousPushAmount = { x: pushX, y: pushY };\n return {\n x: start.x + pushX,\n y: start.y + pushY,\n };\n }\n /**\n * Applies a computed position to the overlay and emits a position change.\n * @param position The position preference\n * @param originPoint The point on the origin element where the overlay is connected.\n */\n _applyPosition(position, originPoint) {\n this._setTransformOrigin(position);\n this._setOverlayElementStyles(originPoint, position);\n this._setBoundingBoxStyles(originPoint, position);\n if (position.panelClass) {\n this._addPanelClasses(position.panelClass);\n }\n // Save the last connected position in case the position needs to be re-calculated.\n this._lastPosition = position;\n // Notify that the position has been changed along with its change properties.\n // We only emit if we've got any subscriptions, because the scroll visibility\n // calculations can be somewhat expensive.\n if (this._positionChanges.observers.length) {\n const scrollableViewProperties = this._getScrollVisibility();\n const changeEvent = new ConnectedOverlayPositionChange(position, scrollableViewProperties);\n this._positionChanges.next(changeEvent);\n }\n this._isInitialRender = false;\n }\n /** Sets the transform origin based on the configured selector and the passed-in position. */\n _setTransformOrigin(position) {\n if (!this._transformOriginSelector) {\n return;\n }\n const elements = this._boundingBox.querySelectorAll(this._transformOriginSelector);\n let xOrigin;\n let yOrigin = position.overlayY;\n if (position.overlayX === 'center') {\n xOrigin = 'center';\n }\n else if (this._isRtl()) {\n xOrigin = position.overlayX === 'start' ? 'right' : 'left';\n }\n else {\n xOrigin = position.overlayX === 'start' ? 'left' : 'right';\n }\n for (let i = 0; i < elements.length; i++) {\n elements[i].style.transformOrigin = `${xOrigin} ${yOrigin}`;\n }\n }\n /**\n * Gets the position and size of the overlay's sizing container.\n *\n * This method does no measuring and applies no styles so that we can cheaply compute the\n * bounds for all positions and choose the best fit based on these results.\n */\n _calculateBoundingBoxRect(origin, position) {\n const viewport = this._viewportRect;\n const isRtl = this._isRtl();\n let height, top, bottom;\n if (position.overlayY === 'top') {\n // Overlay is opening \"downward\" and thus is bound by the bottom viewport edge.\n top = origin.y;\n height = viewport.height - top + this._viewportMargin;\n }\n else if (position.overlayY === 'bottom') {\n // Overlay is opening \"upward\" and thus is bound by the top viewport edge. We need to add\n // the viewport margin back in, because the viewport rect is narrowed down to remove the\n // margin, whereas the `origin` position is calculated based on its `ClientRect`.\n bottom = viewport.height - origin.y + this._viewportMargin * 2;\n height = viewport.height - bottom + this._viewportMargin;\n }\n else {\n // If neither top nor bottom, it means that the overlay is vertically centered on the\n // origin point. Note that we want the position relative to the viewport, rather than\n // the page, which is why we don't use something like `viewport.bottom - origin.y` and\n // `origin.y - viewport.top`.\n const smallestDistanceToViewportEdge = Math.min(viewport.bottom - origin.y + viewport.top, origin.y);\n const previousHeight = this._lastBoundingBoxSize.height;\n height = smallestDistanceToViewportEdge * 2;\n top = origin.y - smallestDistanceToViewportEdge;\n if (height > previousHeight && !this._isInitialRender && !this._growAfterOpen) {\n top = origin.y - previousHeight / 2;\n }\n }\n // The overlay is opening 'right-ward' (the content flows to the right).\n const isBoundedByRightViewportEdge = (position.overlayX === 'start' && !isRtl) || (position.overlayX === 'end' && isRtl);\n // The overlay is opening 'left-ward' (the content flows to the left).\n const isBoundedByLeftViewportEdge = (position.overlayX === 'end' && !isRtl) || (position.overlayX === 'start' && isRtl);\n let width, left, right;\n if (isBoundedByLeftViewportEdge) {\n right = viewport.width - origin.x + this._viewportMargin;\n width = origin.x - this._viewportMargin;\n }\n else if (isBoundedByRightViewportEdge) {\n left = origin.x;\n width = viewport.right - origin.x;\n }\n else {\n // If neither start nor end, it means that the overlay is horizontally centered on the\n // origin point. Note that we want the position relative to the viewport, rather than\n // the page, which is why we don't use something like `viewport.right - origin.x` and\n // `origin.x - viewport.left`.\n const smallestDistanceToViewportEdge = Math.min(viewport.right - origin.x + viewport.left, origin.x);\n const previousWidth = this._lastBoundingBoxSize.width;\n width = smallestDistanceToViewportEdge * 2;\n left = origin.x - smallestDistanceToViewportEdge;\n if (width > previousWidth && !this._isInitialRender && !this._growAfterOpen) {\n left = origin.x - previousWidth / 2;\n }\n }\n return { top: top, left: left, bottom: bottom, right: right, width, height };\n }\n /**\n * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the\n * origin's connection point and stretches to the bounds of the viewport.\n *\n * @param origin The point on the origin element where the overlay is connected.\n * @param position The position preference\n */\n _setBoundingBoxStyles(origin, position) {\n const boundingBoxRect = this._calculateBoundingBoxRect(origin, position);\n // It's weird if the overlay *grows* while scrolling, so we take the last size into account\n // when applying a new size.\n if (!this._isInitialRender && !this._growAfterOpen) {\n boundingBoxRect.height = Math.min(boundingBoxRect.height, this._lastBoundingBoxSize.height);\n boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);\n }\n const styles = {};\n if (this._hasExactPosition()) {\n styles.top = styles.left = '0';\n styles.bottom = styles.right = styles.maxHeight = styles.maxWidth = '';\n styles.width = styles.height = '100%';\n }\n else {\n const maxHeight = this._overlayRef.getConfig().maxHeight;\n const maxWidth = this._overlayRef.getConfig().maxWidth;\n styles.height = coerceCssPixelValue(boundingBoxRect.height);\n styles.top = coerceCssPixelValue(boundingBoxRect.top);\n styles.bottom = coerceCssPixelValue(boundingBoxRect.bottom);\n styles.width = coerceCssPixelValue(boundingBoxRect.width);\n styles.left = coerceCssPixelValue(boundingBoxRect.left);\n styles.right = coerceCssPixelValue(boundingBoxRect.right);\n // Push the pane content towards the proper direction.\n if (position.overlayX === 'center') {\n styles.alignItems = 'center';\n }\n else {\n styles.alignItems = position.overlayX === 'end' ? 'flex-end' : 'flex-start';\n }\n if (position.overlayY === 'center') {\n styles.justifyContent = 'center';\n }\n else {\n styles.justifyContent = position.overlayY === 'bottom' ? 'flex-end' : 'flex-start';\n }\n if (maxHeight) {\n styles.maxHeight = coerceCssPixelValue(maxHeight);\n }\n if (maxWidth) {\n styles.maxWidth = coerceCssPixelValue(maxWidth);\n }\n }\n this._lastBoundingBoxSize = boundingBoxRect;\n extendStyles(this._boundingBox.style, styles);\n }\n /** Resets the styles for the bounding box so that a new positioning can be computed. */\n _resetBoundingBoxStyles() {\n extendStyles(this._boundingBox.style, {\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }\n /** Resets the styles for the overlay pane so that a new positioning can be computed. */\n _resetOverlayElementStyles() {\n extendStyles(this._pane.style, {\n top: '',\n left: '',\n bottom: '',\n right: '',\n position: '',\n transform: '',\n });\n }\n /** Sets positioning styles to the overlay element. */\n _setOverlayElementStyles(originPoint, position) {\n const styles = {};\n const hasExactPosition = this._hasExactPosition();\n const hasFlexibleDimensions = this._hasFlexibleDimensions;\n const config = this._overlayRef.getConfig();\n if (hasExactPosition) {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n extendStyles(styles, this._getExactOverlayY(position, originPoint, scrollPosition));\n extendStyles(styles, this._getExactOverlayX(position, originPoint, scrollPosition));\n }\n else {\n styles.position = 'static';\n }\n // Use a transform to apply the offsets. We do this because the `center` positions rely on\n // being in the normal flex flow and setting a `top` / `left` at all will completely throw\n // off the position. We also can't use margins, because they won't have an effect in some\n // cases where the element doesn't have anything to \"push off of\". Finally, this works\n // better both with flexible and non-flexible positioning.\n let transformString = '';\n let offsetX = this._getOffset(position, 'x');\n let offsetY = this._getOffset(position, 'y');\n if (offsetX) {\n transformString += `translateX(${offsetX}px) `;\n }\n if (offsetY) {\n transformString += `translateY(${offsetY}px)`;\n }\n styles.transform = transformString.trim();\n // If a maxWidth or maxHeight is specified on the overlay, we remove them. We do this because\n // we need these values to both be set to \"100%\" for the automatic flexible sizing to work.\n // The maxHeight and maxWidth are set on the boundingBox in order to enforce the constraint.\n // Note that this doesn't apply when we have an exact position, in which case we do want to\n // apply them because they'll be cleared from the bounding box.\n if (config.maxHeight) {\n if (hasExactPosition) {\n styles.maxHeight = coerceCssPixelValue(config.maxHeight);\n }\n else if (hasFlexibleDimensions) {\n styles.maxHeight = '';\n }\n }\n if (config.maxWidth) {\n if (hasExactPosition) {\n styles.maxWidth = coerceCssPixelValue(config.maxWidth);\n }\n else if (hasFlexibleDimensions) {\n styles.maxWidth = '';\n }\n }\n extendStyles(this._pane.style, styles);\n }\n /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */\n _getExactOverlayY(position, originPoint, scrollPosition) {\n // Reset any existing styles. This is necessary in case the\n // preferred position has changed since the last `apply`.\n let styles = { top: '', bottom: '' };\n let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);\n if (this._isPushed) {\n overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);\n }\n // We want to set either `top` or `bottom` based on whether the overlay wants to appear\n // above or below the origin and the direction in which the element will expand.\n if (position.overlayY === 'bottom') {\n // When using `bottom`, we adjust the y position such that it is the distance\n // from the bottom of the viewport rather than the top.\n const documentHeight = this._document.documentElement.clientHeight;\n styles.bottom = `${documentHeight - (overlayPoint.y + this._overlayRect.height)}px`;\n }\n else {\n styles.top = coerceCssPixelValue(overlayPoint.y);\n }\n return styles;\n }\n /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */\n _getExactOverlayX(position, originPoint, scrollPosition) {\n // Reset any existing styles. This is necessary in case the preferred position has\n // changed since the last `apply`.\n let styles = { left: '', right: '' };\n let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);\n if (this._isPushed) {\n overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);\n }\n // We want to set either `left` or `right` based on whether the overlay wants to appear \"before\"\n // or \"after\" the origin, which determines the direction in which the element will expand.\n // For the horizontal axis, the meaning of \"before\" and \"after\" change based on whether the\n // page is in RTL or LTR.\n let horizontalStyleProperty;\n if (this._isRtl()) {\n horizontalStyleProperty = position.overlayX === 'end' ? 'left' : 'right';\n }\n else {\n horizontalStyleProperty = position.overlayX === 'end' ? 'right' : 'left';\n }\n // When we're setting `right`, we adjust the x position such that it is the distance\n // from the right edge of the viewport rather than the left edge.\n if (horizontalStyleProperty === 'right') {\n const documentWidth = this._document.documentElement.clientWidth;\n styles.right = `${documentWidth - (overlayPoint.x + this._overlayRect.width)}px`;\n }\n else {\n styles.left = coerceCssPixelValue(overlayPoint.x);\n }\n return styles;\n }\n /**\n * Gets the view properties of the trigger and overlay, including whether they are clipped\n * or completely outside the view of any of the strategy's scrollables.\n */\n _getScrollVisibility() {\n // Note: needs fresh rects since the position could've changed.\n const originBounds = this._getOriginRect();\n const overlayBounds = this._pane.getBoundingClientRect();\n // TODO(jelbourn): instead of needing all of the client rects for these scrolling containers\n // every time, we should be able to use the scrollTop of the containers if the size of those\n // containers hasn't changed.\n const scrollContainerBounds = this._scrollables.map(scrollable => {\n return scrollable.getElementRef().nativeElement.getBoundingClientRect();\n });\n return {\n isOriginClipped: isElementClippedByScrolling(originBounds, scrollContainerBounds),\n isOriginOutsideView: isElementScrolledOutsideView(originBounds, scrollContainerBounds),\n isOverlayClipped: isElementClippedByScrolling(overlayBounds, scrollContainerBounds),\n isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds),\n };\n }\n /** Subtracts the amount that an element is overflowing on an axis from its length. */\n _subtractOverflows(length, ...overflows) {\n return overflows.reduce((currentValue, currentOverflow) => {\n return currentValue - Math.max(currentOverflow, 0);\n }, length);\n }\n /** Narrows the given viewport rect by the current _viewportMargin. */\n _getNarrowedViewportRect() {\n // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,\n // because we want to use the `clientWidth` and `clientHeight` as the base. The difference\n // being that the client properties don't include the scrollbar, as opposed to `innerWidth`\n // and `innerHeight` that do. This is necessary, because the overlay container uses\n // 100% `width` and `height` which don't include the scrollbar either.\n const width = this._document.documentElement.clientWidth;\n const height = this._document.documentElement.clientHeight;\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n return {\n top: scrollPosition.top + this._viewportMargin,\n left: scrollPosition.left + this._viewportMargin,\n right: scrollPosition.left + width - this._viewportMargin,\n bottom: scrollPosition.top + height - this._viewportMargin,\n width: width - 2 * this._viewportMargin,\n height: height - 2 * this._viewportMargin,\n };\n }\n /** Whether the we're dealing with an RTL context */\n _isRtl() {\n return this._overlayRef.getDirection() === 'rtl';\n }\n /** Determines whether the overlay uses exact or flexible positioning. */\n _hasExactPosition() {\n return !this._hasFlexibleDimensions || this._isPushed;\n }\n /** Retrieves the offset of a position along the x or y axis. */\n _getOffset(position, axis) {\n if (axis === 'x') {\n // We don't do something like `position['offset' + axis]` in\n // order to avoid breaking minifiers that rename properties.\n return position.offsetX == null ? this._offsetX : position.offsetX;\n }\n return position.offsetY == null ? this._offsetY : position.offsetY;\n }\n /** Validates that the current position match the expected values. */\n _validatePositions() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._preferredPositions.length) {\n throw Error('FlexibleConnectedPositionStrategy: At least one position is required.');\n }\n // TODO(crisbeto): remove these once Angular's template type\n // checking is advanced enough to catch these cases.\n this._preferredPositions.forEach(pair => {\n validateHorizontalPosition('originX', pair.originX);\n validateVerticalPosition('originY', pair.originY);\n validateHorizontalPosition('overlayX', pair.overlayX);\n validateVerticalPosition('overlayY', pair.overlayY);\n });\n }\n }\n /** Adds a single CSS class or an array of classes on the overlay panel. */\n _addPanelClasses(cssClasses) {\n if (this._pane) {\n coerceArray(cssClasses).forEach(cssClass => {\n if (cssClass !== '' && this._appliedPanelClasses.indexOf(cssClass) === -1) {\n this._appliedPanelClasses.push(cssClass);\n this._pane.classList.add(cssClass);\n }\n });\n }\n }\n /** Clears the classes that the position strategy has applied from the overlay panel. */\n _clearPanelClasses() {\n if (this._pane) {\n this._appliedPanelClasses.forEach(cssClass => {\n this._pane.classList.remove(cssClass);\n });\n this._appliedPanelClasses = [];\n }\n }\n /** Returns the ClientRect of the current origin. */\n _getOriginRect() {\n const origin = this._origin;\n if (origin instanceof ElementRef) {\n return origin.nativeElement.getBoundingClientRect();\n }\n // Check for Element so SVG elements are also supported.\n if (origin instanceof Element) {\n return origin.getBoundingClientRect();\n }\n const width = origin.width || 0;\n const height = origin.height || 0;\n // If the origin is a point, return a client rect as if it was a 0x0 element at the point.\n return {\n top: origin.y,\n bottom: origin.y + height,\n left: origin.x,\n right: origin.x + width,\n height,\n width,\n };\n }\n}\n/** Shallow-extends a stylesheet object with another stylesheet object. */\nfunction extendStyles(destination, source) {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = source[key];\n }\n }\n return destination;\n}\n/**\n * Extracts the pixel value as a number from a value, if it's a number\n * or a CSS pixel string (e.g. `1337px`). Otherwise returns null.\n */\nfunction getPixelValue(input) {\n if (typeof input !== 'number' && input != null) {\n const [value, units] = input.split(cssUnitPattern);\n return !units || units === 'px' ? parseFloat(value) : null;\n }\n return input || null;\n}\n/**\n * Gets a version of an element's bounding `ClientRect` where all the values are rounded down to\n * the nearest pixel. This allows us to account for the cases where there may be sub-pixel\n * deviations in the `ClientRect` returned by the browser (e.g. when zoomed in with a percentage\n * size, see #21350).\n */\nfunction getRoundedBoundingClientRect(clientRect) {\n return {\n top: Math.floor(clientRect.top),\n right: Math.floor(clientRect.right),\n bottom: Math.floor(clientRect.bottom),\n left: Math.floor(clientRect.left),\n width: Math.floor(clientRect.width),\n height: Math.floor(clientRect.height),\n };\n}\nconst STANDARD_DROPDOWN_BELOW_POSITIONS = [\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },\n { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },\n];\nconst STANDARD_DROPDOWN_ADJACENT_POSITIONS = [\n { originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top' },\n { originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom' },\n { originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top' },\n { originX: 'start', originY: 'bottom', overlayX: 'end', overlayY: 'bottom' },\n];\n\n/** Class to be added to the overlay pane wrapper. */\nconst wrapperClass = 'cdk-global-overlay-wrapper';\n/**\n * A strategy for positioning overlays. Using this strategy, an overlay is given an\n * explicit position relative to the browser's viewport. We use flexbox, instead of\n * transforms, in order to avoid issues with subpixel rendering which can cause the\n * element to become blurry.\n */\nclass GlobalPositionStrategy {\n constructor() {\n this._cssPosition = 'static';\n this._topOffset = '';\n this._bottomOffset = '';\n this._alignItems = '';\n this._xPosition = '';\n this._xOffset = '';\n this._width = '';\n this._height = '';\n this._isDisposed = false;\n }\n attach(overlayRef) {\n const config = overlayRef.getConfig();\n this._overlayRef = overlayRef;\n if (this._width && !config.width) {\n overlayRef.updateSize({ width: this._width });\n }\n if (this._height && !config.height) {\n overlayRef.updateSize({ height: this._height });\n }\n overlayRef.hostElement.classList.add(wrapperClass);\n this._isDisposed = false;\n }\n /**\n * Sets the top position of the overlay. Clears any previously set vertical position.\n * @param value New top offset.\n */\n top(value = '') {\n this._bottomOffset = '';\n this._topOffset = value;\n this._alignItems = 'flex-start';\n return this;\n }\n /**\n * Sets the left position of the overlay. Clears any previously set horizontal position.\n * @param value New left offset.\n */\n left(value = '') {\n this._xOffset = value;\n this._xPosition = 'left';\n return this;\n }\n /**\n * Sets the bottom position of the overlay. Clears any previously set vertical position.\n * @param value New bottom offset.\n */\n bottom(value = '') {\n this._topOffset = '';\n this._bottomOffset = value;\n this._alignItems = 'flex-end';\n return this;\n }\n /**\n * Sets the right position of the overlay. Clears any previously set horizontal position.\n * @param value New right offset.\n */\n right(value = '') {\n this._xOffset = value;\n this._xPosition = 'right';\n return this;\n }\n /**\n * Sets the overlay to the start of the viewport, depending on the overlay direction.\n * This will be to the left in LTR layouts and to the right in RTL.\n * @param offset Offset from the edge of the screen.\n */\n start(value = '') {\n this._xOffset = value;\n this._xPosition = 'start';\n return this;\n }\n /**\n * Sets the overlay to the end of the viewport, depending on the overlay direction.\n * This will be to the right in LTR layouts and to the left in RTL.\n * @param offset Offset from the edge of the screen.\n */\n end(value = '') {\n this._xOffset = value;\n this._xPosition = 'end';\n return this;\n }\n /**\n * Sets the overlay width and clears any previously set width.\n * @param value New width for the overlay\n * @deprecated Pass the `width` through the `OverlayConfig`.\n * @breaking-change 8.0.0\n */\n width(value = '') {\n if (this._overlayRef) {\n this._overlayRef.updateSize({ width: value });\n }\n else {\n this._width = value;\n }\n return this;\n }\n /**\n * Sets the overlay height and clears any previously set height.\n * @param value New height for the overlay\n * @deprecated Pass the `height` through the `OverlayConfig`.\n * @breaking-change 8.0.0\n */\n height(value = '') {\n if (this._overlayRef) {\n this._overlayRef.updateSize({ height: value });\n }\n else {\n this._height = value;\n }\n return this;\n }\n /**\n * Centers the overlay horizontally with an optional offset.\n * Clears any previously set horizontal position.\n *\n * @param offset Overlay offset from the horizontal center.\n */\n centerHorizontally(offset = '') {\n this.left(offset);\n this._xPosition = 'center';\n return this;\n }\n /**\n * Centers the overlay vertically with an optional offset.\n * Clears any previously set vertical position.\n *\n * @param offset Overlay offset from the vertical center.\n */\n centerVertically(offset = '') {\n this.top(offset);\n this._alignItems = 'center';\n return this;\n }\n /**\n * Apply the position to the element.\n * @docs-private\n */\n apply() {\n // Since the overlay ref applies the strategy asynchronously, it could\n // have been disposed before it ends up being applied. If that is the\n // case, we shouldn't do anything.\n if (!this._overlayRef || !this._overlayRef.hasAttached()) {\n return;\n }\n const styles = this._overlayRef.overlayElement.style;\n const parentStyles = this._overlayRef.hostElement.style;\n const config = this._overlayRef.getConfig();\n const { width, height, maxWidth, maxHeight } = config;\n const shouldBeFlushHorizontally = (width === '100%' || width === '100vw') &&\n (!maxWidth || maxWidth === '100%' || maxWidth === '100vw');\n const shouldBeFlushVertically = (height === '100%' || height === '100vh') &&\n (!maxHeight || maxHeight === '100%' || maxHeight === '100vh');\n const xPosition = this._xPosition;\n const xOffset = this._xOffset;\n const isRtl = this._overlayRef.getConfig().direction === 'rtl';\n let marginLeft = '';\n let marginRight = '';\n let justifyContent = '';\n if (shouldBeFlushHorizontally) {\n justifyContent = 'flex-start';\n }\n else if (xPosition === 'center') {\n justifyContent = 'center';\n if (isRtl) {\n marginRight = xOffset;\n }\n else {\n marginLeft = xOffset;\n }\n }\n else if (isRtl) {\n if (xPosition === 'left' || xPosition === 'end') {\n justifyContent = 'flex-end';\n marginLeft = xOffset;\n }\n else if (xPosition === 'right' || xPosition === 'start') {\n justifyContent = 'flex-start';\n marginRight = xOffset;\n }\n }\n else if (xPosition === 'left' || xPosition === 'start') {\n justifyContent = 'flex-start';\n marginLeft = xOffset;\n }\n else if (xPosition === 'right' || xPosition === 'end') {\n justifyContent = 'flex-end';\n marginRight = xOffset;\n }\n styles.position = this._cssPosition;\n styles.marginLeft = shouldBeFlushHorizontally ? '0' : marginLeft;\n styles.marginTop = shouldBeFlushVertically ? '0' : this._topOffset;\n styles.marginBottom = this._bottomOffset;\n styles.marginRight = shouldBeFlushHorizontally ? '0' : marginRight;\n parentStyles.justifyContent = justifyContent;\n parentStyles.alignItems = shouldBeFlushVertically ? 'flex-start' : this._alignItems;\n }\n /**\n * Cleans up the DOM changes from the position strategy.\n * @docs-private\n */\n dispose() {\n if (this._isDisposed || !this._overlayRef) {\n return;\n }\n const styles = this._overlayRef.overlayElement.style;\n const parent = this._overlayRef.hostElement;\n const parentStyles = parent.style;\n parent.classList.remove(wrapperClass);\n parentStyles.justifyContent =\n parentStyles.alignItems =\n styles.marginTop =\n styles.marginBottom =\n styles.marginLeft =\n styles.marginRight =\n styles.position =\n '';\n this._overlayRef = null;\n this._isDisposed = true;\n }\n}\n\n/** Builder for overlay position strategy. */\nclass OverlayPositionBuilder {\n constructor(_viewportRuler, _document, _platform, _overlayContainer) {\n this._viewportRuler = _viewportRuler;\n this._document = _document;\n this._platform = _platform;\n this._overlayContainer = _overlayContainer;\n }\n /**\n * Creates a global position strategy.\n */\n global() {\n return new GlobalPositionStrategy();\n }\n /**\n * Creates a flexible position strategy.\n * @param origin Origin relative to which to position the overlay.\n */\n flexibleConnectedTo(origin) {\n return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayPositionBuilder, deps: [{ token: i1.ViewportRuler }, { token: DOCUMENT }, { token: i1$1.Platform }, { token: OverlayContainer }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayPositionBuilder, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayPositionBuilder, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: i1.ViewportRuler }, { type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }, { type: i1$1.Platform }, { type: OverlayContainer }]; } });\n\n/** Next overlay unique ID. */\nlet nextUniqueId = 0;\n// Note that Overlay is *not* scoped to the app root because of the ComponentFactoryResolver\n// which needs to be different depending on where OverlayModule is imported.\n/**\n * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be\n * used as a low-level building block for other components. Dialogs, tooltips, menus,\n * selects, etc. can all be built using overlays. The service should primarily be used by authors\n * of re-usable components rather than developers building end-user applications.\n *\n * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.\n */\nclass Overlay {\n constructor(\n /** Scrolling strategies that can be used when creating an overlay. */\n scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location, _outsideClickDispatcher, _animationsModuleType) {\n this.scrollStrategies = scrollStrategies;\n this._overlayContainer = _overlayContainer;\n this._componentFactoryResolver = _componentFactoryResolver;\n this._positionBuilder = _positionBuilder;\n this._keyboardDispatcher = _keyboardDispatcher;\n this._injector = _injector;\n this._ngZone = _ngZone;\n this._document = _document;\n this._directionality = _directionality;\n this._location = _location;\n this._outsideClickDispatcher = _outsideClickDispatcher;\n this._animationsModuleType = _animationsModuleType;\n }\n /**\n * Creates an overlay.\n * @param config Configuration applied to the overlay.\n * @returns Reference to the created overlay.\n */\n create(config) {\n const host = this._createHostElement();\n const pane = this._createPaneElement(host);\n const portalOutlet = this._createPortalOutlet(pane);\n const overlayConfig = new OverlayConfig(config);\n overlayConfig.direction = overlayConfig.direction || this._directionality.value;\n return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher, this._animationsModuleType === 'NoopAnimations');\n }\n /**\n * Gets a position builder that can be used, via fluent API,\n * to construct and configure a position strategy.\n * @returns An overlay position builder.\n */\n position() {\n return this._positionBuilder;\n }\n /**\n * Creates the DOM element for an overlay and appends it to the overlay container.\n * @returns Newly-created pane element\n */\n _createPaneElement(host) {\n const pane = this._document.createElement('div');\n pane.id = `cdk-overlay-${nextUniqueId++}`;\n pane.classList.add('cdk-overlay-pane');\n host.appendChild(pane);\n return pane;\n }\n /**\n * Creates the host element that wraps around an overlay\n * and can be used for advanced positioning.\n * @returns Newly-create host element.\n */\n _createHostElement() {\n const host = this._document.createElement('div');\n this._overlayContainer.getContainerElement().appendChild(host);\n return host;\n }\n /**\n * Create a DomPortalOutlet into which the overlay content can be loaded.\n * @param pane The DOM element to turn into a portal outlet.\n * @returns A portal outlet for the given DOM element.\n */\n _createPortalOutlet(pane) {\n // We have to resolve the ApplicationRef later in order to allow people\n // to use overlay-based providers during app initialization.\n if (!this._appRef) {\n this._appRef = this._injector.get(ApplicationRef);\n }\n return new DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Overlay, deps: [{ token: ScrollStrategyOptions }, { token: OverlayContainer }, { token: i0.ComponentFactoryResolver }, { token: OverlayPositionBuilder }, { token: OverlayKeyboardDispatcher }, { token: i0.Injector }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i5.Directionality }, { token: i6.Location }, { token: OverlayOutsideClickDispatcher }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Overlay, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Overlay, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: ScrollStrategyOptions }, { type: OverlayContainer }, { type: i0.ComponentFactoryResolver }, { type: OverlayPositionBuilder }, { type: OverlayKeyboardDispatcher }, { type: i0.Injector }, { type: i0.NgZone }, { type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }, { type: i5.Directionality }, { type: i6.Location }, { type: OverlayOutsideClickDispatcher }, { type: undefined, decorators: [{\n type: Inject,\n args: [ANIMATION_MODULE_TYPE]\n }, {\n type: Optional\n }] }]; } });\n\n/** Default set of positions for the overlay. Follows the behavior of a dropdown. */\nconst defaultPositionList = [\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n },\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n },\n];\n/** Injection token that determines the scroll handling while the connected overlay is open. */\nconst CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken('cdk-connected-overlay-scroll-strategy');\n/**\n * Directive applied to an element to make it usable as an origin for an Overlay using a\n * ConnectedPositionStrategy.\n */\nclass CdkOverlayOrigin {\n constructor(\n /** Reference to the element on which the directive is applied. */\n elementRef) {\n this.elementRef = elementRef;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkOverlayOrigin, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.1\", type: CdkOverlayOrigin, isStandalone: true, selector: \"[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]\", exportAs: [\"cdkOverlayOrigin\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkOverlayOrigin, decorators: [{\n type: Directive,\n args: [{\n selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',\n exportAs: 'cdkOverlayOrigin',\n standalone: true,\n }]\n }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });\n/**\n * Directive to facilitate declarative creation of an\n * Overlay using a FlexibleConnectedPositionStrategy.\n */\nclass CdkConnectedOverlay {\n /** The offset in pixels for the overlay connection point on the x-axis */\n get offsetX() {\n return this._offsetX;\n }\n set offsetX(offsetX) {\n this._offsetX = offsetX;\n if (this._position) {\n this._updatePositionStrategy(this._position);\n }\n }\n /** The offset in pixels for the overlay connection point on the y-axis */\n get offsetY() {\n return this._offsetY;\n }\n set offsetY(offsetY) {\n this._offsetY = offsetY;\n if (this._position) {\n this._updatePositionStrategy(this._position);\n }\n }\n /** Whether or not the overlay should attach a backdrop. */\n get hasBackdrop() {\n return this._hasBackdrop;\n }\n set hasBackdrop(value) {\n this._hasBackdrop = coerceBooleanProperty(value);\n }\n /** Whether or not the overlay should be locked when scrolling. */\n get lockPosition() {\n return this._lockPosition;\n }\n set lockPosition(value) {\n this._lockPosition = coerceBooleanProperty(value);\n }\n /** Whether the overlay's width and height can be constrained to fit within the viewport. */\n get flexibleDimensions() {\n return this._flexibleDimensions;\n }\n set flexibleDimensions(value) {\n this._flexibleDimensions = coerceBooleanProperty(value);\n }\n /** Whether the overlay can grow after the initial open when flexible positioning is turned on. */\n get growAfterOpen() {\n return this._growAfterOpen;\n }\n set growAfterOpen(value) {\n this._growAfterOpen = coerceBooleanProperty(value);\n }\n /** Whether the overlay can be pushed on-screen if none of the provided positions fit. */\n get push() {\n return this._push;\n }\n set push(value) {\n this._push = coerceBooleanProperty(value);\n }\n // TODO(jelbourn): inputs for size, scroll behavior, animation, etc.\n constructor(_overlay, templateRef, viewContainerRef, scrollStrategyFactory, _dir) {\n this._overlay = _overlay;\n this._dir = _dir;\n this._hasBackdrop = false;\n this._lockPosition = false;\n this._growAfterOpen = false;\n this._flexibleDimensions = false;\n this._push = false;\n this._backdropSubscription = Subscription.EMPTY;\n this._attachSubscription = Subscription.EMPTY;\n this._detachSubscription = Subscription.EMPTY;\n this._positionSubscription = Subscription.EMPTY;\n /** Margin between the overlay and the viewport edges. */\n this.viewportMargin = 0;\n /** Whether the overlay is open. */\n this.open = false;\n /** Whether the overlay can be closed by user interaction. */\n this.disableClose = false;\n /** Event emitted when the backdrop is clicked. */\n this.backdropClick = new EventEmitter();\n /** Event emitted when the position has changed. */\n this.positionChange = new EventEmitter();\n /** Event emitted when the overlay has been attached. */\n this.attach = new EventEmitter();\n /** Event emitted when the overlay has been detached. */\n this.detach = new EventEmitter();\n /** Emits when there are keyboard events that are targeted at the overlay. */\n this.overlayKeydown = new EventEmitter();\n /** Emits when there are mouse outside click events that are targeted at the overlay. */\n this.overlayOutsideClick = new EventEmitter();\n this._templatePortal = new TemplatePortal(templateRef, viewContainerRef);\n this._scrollStrategyFactory = scrollStrategyFactory;\n this.scrollStrategy = this._scrollStrategyFactory();\n }\n /** The associated overlay reference. */\n get overlayRef() {\n return this._overlayRef;\n }\n /** The element's layout direction. */\n get dir() {\n return this._dir ? this._dir.value : 'ltr';\n }\n ngOnDestroy() {\n this._attachSubscription.unsubscribe();\n this._detachSubscription.unsubscribe();\n this._backdropSubscription.unsubscribe();\n this._positionSubscription.unsubscribe();\n if (this._overlayRef) {\n this._overlayRef.dispose();\n }\n }\n ngOnChanges(changes) {\n if (this._position) {\n this._updatePositionStrategy(this._position);\n this._overlayRef.updateSize({\n width: this.width,\n minWidth: this.minWidth,\n height: this.height,\n minHeight: this.minHeight,\n });\n if (changes['origin'] && this.open) {\n this._position.apply();\n }\n }\n if (changes['open']) {\n this.open ? this._attachOverlay() : this._detachOverlay();\n }\n }\n /** Creates an overlay */\n _createOverlay() {\n if (!this.positions || !this.positions.length) {\n this.positions = defaultPositionList;\n }\n const overlayRef = (this._overlayRef = this._overlay.create(this._buildConfig()));\n this._attachSubscription = overlayRef.attachments().subscribe(() => this.attach.emit());\n this._detachSubscription = overlayRef.detachments().subscribe(() => this.detach.emit());\n overlayRef.keydownEvents().subscribe((event) => {\n this.overlayKeydown.next(event);\n if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) {\n event.preventDefault();\n this._detachOverlay();\n }\n });\n this._overlayRef.outsidePointerEvents().subscribe((event) => {\n this.overlayOutsideClick.next(event);\n });\n }\n /** Builds the overlay config based on the directive's inputs */\n _buildConfig() {\n const positionStrategy = (this._position =\n this.positionStrategy || this._createPositionStrategy());\n const overlayConfig = new OverlayConfig({\n direction: this._dir,\n positionStrategy,\n scrollStrategy: this.scrollStrategy,\n hasBackdrop: this.hasBackdrop,\n });\n if (this.width || this.width === 0) {\n overlayConfig.width = this.width;\n }\n if (this.height || this.height === 0) {\n overlayConfig.height = this.height;\n }\n if (this.minWidth || this.minWidth === 0) {\n overlayConfig.minWidth = this.minWidth;\n }\n if (this.minHeight || this.minHeight === 0) {\n overlayConfig.minHeight = this.minHeight;\n }\n if (this.backdropClass) {\n overlayConfig.backdropClass = this.backdropClass;\n }\n if (this.panelClass) {\n overlayConfig.panelClass = this.panelClass;\n }\n return overlayConfig;\n }\n /** Updates the state of a position strategy, based on the values of the directive inputs. */\n _updatePositionStrategy(positionStrategy) {\n const positions = this.positions.map(currentPosition => ({\n originX: currentPosition.originX,\n originY: currentPosition.originY,\n overlayX: currentPosition.overlayX,\n overlayY: currentPosition.overlayY,\n offsetX: currentPosition.offsetX || this.offsetX,\n offsetY: currentPosition.offsetY || this.offsetY,\n panelClass: currentPosition.panelClass || undefined,\n }));\n return positionStrategy\n .setOrigin(this._getFlexibleConnectedPositionStrategyOrigin())\n .withPositions(positions)\n .withFlexibleDimensions(this.flexibleDimensions)\n .withPush(this.push)\n .withGrowAfterOpen(this.growAfterOpen)\n .withViewportMargin(this.viewportMargin)\n .withLockedPosition(this.lockPosition)\n .withTransformOriginOn(this.transformOriginSelector);\n }\n /** Returns the position strategy of the overlay to be set on the overlay config */\n _createPositionStrategy() {\n const strategy = this._overlay\n .position()\n .flexibleConnectedTo(this._getFlexibleConnectedPositionStrategyOrigin());\n this._updatePositionStrategy(strategy);\n return strategy;\n }\n _getFlexibleConnectedPositionStrategyOrigin() {\n if (this.origin instanceof CdkOverlayOrigin) {\n return this.origin.elementRef;\n }\n else {\n return this.origin;\n }\n }\n /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */\n _attachOverlay() {\n if (!this._overlayRef) {\n this._createOverlay();\n }\n else {\n // Update the overlay size, in case the directive's inputs have changed\n this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;\n }\n if (!this._overlayRef.hasAttached()) {\n this._overlayRef.attach(this._templatePortal);\n }\n if (this.hasBackdrop) {\n this._backdropSubscription = this._overlayRef.backdropClick().subscribe(event => {\n this.backdropClick.emit(event);\n });\n }\n else {\n this._backdropSubscription.unsubscribe();\n }\n this._positionSubscription.unsubscribe();\n // Only subscribe to `positionChanges` if requested, because putting\n // together all the information for it can be expensive.\n if (this.positionChange.observers.length > 0) {\n this._positionSubscription = this._position.positionChanges\n .pipe(takeWhile(() => this.positionChange.observers.length > 0))\n .subscribe(position => {\n this.positionChange.emit(position);\n if (this.positionChange.observers.length === 0) {\n this._positionSubscription.unsubscribe();\n }\n });\n }\n }\n /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */\n _detachOverlay() {\n if (this._overlayRef) {\n this._overlayRef.detach();\n }\n this._backdropSubscription.unsubscribe();\n this._positionSubscription.unsubscribe();\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkConnectedOverlay, deps: [{ token: Overlay }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY }, { token: i5.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.1\", type: CdkConnectedOverlay, isStandalone: true, selector: \"[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]\", inputs: { origin: [\"cdkConnectedOverlayOrigin\", \"origin\"], positions: [\"cdkConnectedOverlayPositions\", \"positions\"], positionStrategy: [\"cdkConnectedOverlayPositionStrategy\", \"positionStrategy\"], offsetX: [\"cdkConnectedOverlayOffsetX\", \"offsetX\"], offsetY: [\"cdkConnectedOverlayOffsetY\", \"offsetY\"], width: [\"cdkConnectedOverlayWidth\", \"width\"], height: [\"cdkConnectedOverlayHeight\", \"height\"], minWidth: [\"cdkConnectedOverlayMinWidth\", \"minWidth\"], minHeight: [\"cdkConnectedOverlayMinHeight\", \"minHeight\"], backdropClass: [\"cdkConnectedOverlayBackdropClass\", \"backdropClass\"], panelClass: [\"cdkConnectedOverlayPanelClass\", \"panelClass\"], viewportMargin: [\"cdkConnectedOverlayViewportMargin\", \"viewportMargin\"], scrollStrategy: [\"cdkConnectedOverlayScrollStrategy\", \"scrollStrategy\"], open: [\"cdkConnectedOverlayOpen\", \"open\"], disableClose: [\"cdkConnectedOverlayDisableClose\", \"disableClose\"], transformOriginSelector: [\"cdkConnectedOverlayTransformOriginOn\", \"transformOriginSelector\"], hasBackdrop: [\"cdkConnectedOverlayHasBackdrop\", \"hasBackdrop\"], lockPosition: [\"cdkConnectedOverlayLockPosition\", \"lockPosition\"], flexibleDimensions: [\"cdkConnectedOverlayFlexibleDimensions\", \"flexibleDimensions\"], growAfterOpen: [\"cdkConnectedOverlayGrowAfterOpen\", \"growAfterOpen\"], push: [\"cdkConnectedOverlayPush\", \"push\"] }, outputs: { backdropClick: \"backdropClick\", positionChange: \"positionChange\", attach: \"attach\", detach: \"detach\", overlayKeydown: \"overlayKeydown\", overlayOutsideClick: \"overlayOutsideClick\" }, exportAs: [\"cdkConnectedOverlay\"], usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkConnectedOverlay, decorators: [{\n type: Directive,\n args: [{\n selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',\n exportAs: 'cdkConnectedOverlay',\n standalone: true,\n }]\n }], ctorParameters: function () { return [{ type: Overlay }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{\n type: Inject,\n args: [CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY]\n }] }, { type: i5.Directionality, decorators: [{\n type: Optional\n }] }]; }, propDecorators: { origin: [{\n type: Input,\n args: ['cdkConnectedOverlayOrigin']\n }], positions: [{\n type: Input,\n args: ['cdkConnectedOverlayPositions']\n }], positionStrategy: [{\n type: Input,\n args: ['cdkConnectedOverlayPositionStrategy']\n }], offsetX: [{\n type: Input,\n args: ['cdkConnectedOverlayOffsetX']\n }], offsetY: [{\n type: Input,\n args: ['cdkConnectedOverlayOffsetY']\n }], width: [{\n type: Input,\n args: ['cdkConnectedOverlayWidth']\n }], height: [{\n type: Input,\n args: ['cdkConnectedOverlayHeight']\n }], minWidth: [{\n type: Input,\n args: ['cdkConnectedOverlayMinWidth']\n }], minHeight: [{\n type: Input,\n args: ['cdkConnectedOverlayMinHeight']\n }], backdropClass: [{\n type: Input,\n args: ['cdkConnectedOverlayBackdropClass']\n }], panelClass: [{\n type: Input,\n args: ['cdkConnectedOverlayPanelClass']\n }], viewportMargin: [{\n type: Input,\n args: ['cdkConnectedOverlayViewportMargin']\n }], scrollStrategy: [{\n type: Input,\n args: ['cdkConnectedOverlayScrollStrategy']\n }], open: [{\n type: Input,\n args: ['cdkConnectedOverlayOpen']\n }], disableClose: [{\n type: Input,\n args: ['cdkConnectedOverlayDisableClose']\n }], transformOriginSelector: [{\n type: Input,\n args: ['cdkConnectedOverlayTransformOriginOn']\n }], hasBackdrop: [{\n type: Input,\n args: ['cdkConnectedOverlayHasBackdrop']\n }], lockPosition: [{\n type: Input,\n args: ['cdkConnectedOverlayLockPosition']\n }], flexibleDimensions: [{\n type: Input,\n args: ['cdkConnectedOverlayFlexibleDimensions']\n }], growAfterOpen: [{\n type: Input,\n args: ['cdkConnectedOverlayGrowAfterOpen']\n }], push: [{\n type: Input,\n args: ['cdkConnectedOverlayPush']\n }], backdropClick: [{\n type: Output\n }], positionChange: [{\n type: Output\n }], attach: [{\n type: Output\n }], detach: [{\n type: Output\n }], overlayKeydown: [{\n type: Output\n }], overlayOutsideClick: [{\n type: Output\n }] } });\n/** @docs-private */\nfunction CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {\n return () => overlay.scrollStrategies.reposition();\n}\n/** @docs-private */\nconst CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {\n provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY,\n};\n\nclass OverlayModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayModule, imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin], exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayModule, providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER], imports: [BidiModule, PortalModule, ScrollingModule, ScrollingModule] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: OverlayModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin],\n exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule],\n providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER],\n }]\n }] });\n\n/**\n * Alternative to OverlayContainer that supports correct displaying of overlay elements in\n * Fullscreen mode\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen\n *\n * Should be provided in the root component.\n */\nclass FullscreenOverlayContainer extends OverlayContainer {\n constructor(_document, platform) {\n super(_document, platform);\n }\n ngOnDestroy() {\n super.ngOnDestroy();\n if (this._fullScreenEventName && this._fullScreenListener) {\n this._document.removeEventListener(this._fullScreenEventName, this._fullScreenListener);\n }\n }\n _createContainer() {\n super._createContainer();\n this._adjustParentForFullscreenChange();\n this._addFullscreenChangeListener(() => this._adjustParentForFullscreenChange());\n }\n _adjustParentForFullscreenChange() {\n if (!this._containerElement) {\n return;\n }\n const fullscreenElement = this.getFullscreenElement();\n const parent = fullscreenElement || this._document.body;\n parent.appendChild(this._containerElement);\n }\n _addFullscreenChangeListener(fn) {\n const eventName = this._getEventName();\n if (eventName) {\n if (this._fullScreenListener) {\n this._document.removeEventListener(eventName, this._fullScreenListener);\n }\n this._document.addEventListener(eventName, fn);\n this._fullScreenListener = fn;\n }\n }\n _getEventName() {\n if (!this._fullScreenEventName) {\n const _document = this._document;\n if (_document.fullscreenEnabled) {\n this._fullScreenEventName = 'fullscreenchange';\n }\n else if (_document.webkitFullscreenEnabled) {\n this._fullScreenEventName = 'webkitfullscreenchange';\n }\n else if (_document.mozFullScreenEnabled) {\n this._fullScreenEventName = 'mozfullscreenchange';\n }\n else if (_document.msFullscreenEnabled) {\n this._fullScreenEventName = 'MSFullscreenChange';\n }\n }\n return this._fullScreenEventName;\n }\n /**\n * When the page is put into fullscreen mode, a specific element is specified.\n * Only that element and its children are visible when in fullscreen mode.\n */\n getFullscreenElement() {\n const _document = this._document;\n return (_document.fullscreenElement ||\n _document.webkitFullscreenElement ||\n _document.mozFullScreenElement ||\n _document.msFullscreenElement ||\n null);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: FullscreenOverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: FullscreenOverlayContainer, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: FullscreenOverlayContainer, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: undefined, decorators: [{\n type: Inject,\n args: [DOCUMENT]\n }] }, { type: i1$1.Platform }]; } });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { BlockScrollStrategy, CdkConnectedOverlay, CdkOverlayOrigin, CloseScrollStrategy, ConnectedOverlayPositionChange, ConnectionPositionPair, FlexibleConnectedPositionStrategy, FullscreenOverlayContainer, GlobalPositionStrategy, NoopScrollStrategy, Overlay, OverlayConfig, OverlayContainer, OverlayKeyboardDispatcher, OverlayModule, OverlayOutsideClickDispatcher, OverlayPositionBuilder, OverlayRef, RepositionScrollStrategy, STANDARD_DROPDOWN_ADJACENT_POSITIONS, STANDARD_DROPDOWN_BELOW_POSITIONS, ScrollStrategyOptions, ScrollingVisibility, validateHorizontalPosition, validateVerticalPosition };\n","import * as i0 from '@angular/core';\nimport { Injectable, EventEmitter, Directive, Output, Input, NgModule } from '@angular/core';\nimport { of, fromEvent } from 'rxjs';\nimport { mergeMap, map, tap, filter, throttleTime } from 'rxjs/operators';\n\nclass NgxInfiniteScrollService {\n constructor() { }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.0.1\", ngImport: i0, type: NgxInfiniteScrollService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.0.1\", ngImport: i0, type: NgxInfiniteScrollService, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.0.1\", ngImport: i0, type: NgxInfiniteScrollService, decorators: [{\n type: Injectable,\n args: [{\n providedIn: 'root'\n }]\n }], ctorParameters: function () { return []; } });\n\nfunction resolveContainerElement(selector, scrollWindow, defaultElement, fromRoot) {\n const hasWindow = window && !!window.document && window.document.documentElement;\n let container = hasWindow && scrollWindow ? window : defaultElement;\n if (selector) {\n const containerIsString = selector && hasWindow && typeof selector === 'string';\n container = containerIsString\n ? findElement(selector, defaultElement.nativeElement, fromRoot)\n : selector;\n if (!container) {\n throw new Error('ngx-infinite-scroll {resolveContainerElement()}: selector for');\n }\n }\n return container;\n}\nfunction findElement(selector, customRoot, fromRoot) {\n const rootEl = fromRoot ? window.document : customRoot;\n return rootEl.querySelector(selector);\n}\nfunction inputPropChanged(prop) {\n return prop && !prop.firstChange;\n}\nfunction hasWindowDefined() {\n return typeof window !== 'undefined';\n}\n\nconst VerticalProps = {\n clientHeight: \"clientHeight\",\n offsetHeight: \"offsetHeight\",\n scrollHeight: \"scrollHeight\",\n pageYOffset: \"pageYOffset\",\n offsetTop: \"offsetTop\",\n scrollTop: \"scrollTop\",\n top: \"top\"\n};\nconst HorizontalProps = {\n clientHeight: \"clientWidth\",\n offsetHeight: \"offsetWidth\",\n scrollHeight: \"scrollWidth\",\n pageYOffset: \"pageXOffset\",\n offsetTop: \"offsetLeft\",\n scrollTop: \"scrollLeft\",\n top: \"left\"\n};\nclass AxisResolver {\n constructor(vertical = true) {\n this.vertical = vertical;\n this.propsMap = vertical ? VerticalProps : HorizontalProps;\n }\n clientHeightKey() {\n return this.propsMap.clientHeight;\n }\n offsetHeightKey() {\n return this.propsMap.offsetHeight;\n }\n scrollHeightKey() {\n return this.propsMap.scrollHeight;\n }\n pageYOffsetKey() {\n return this.propsMap.pageYOffset;\n }\n offsetTopKey() {\n return this.propsMap.offsetTop;\n }\n scrollTopKey() {\n return this.propsMap.scrollTop;\n }\n topKey() {\n return this.propsMap.top;\n }\n}\n\nfunction shouldTriggerEvents(alwaysCallback, shouldFireScrollEvent, isTriggeredCurrentTotal) {\n if (alwaysCallback && shouldFireScrollEvent) {\n return true;\n }\n if (!isTriggeredCurrentTotal && shouldFireScrollEvent) {\n return true;\n }\n return false;\n}\n\nfunction createResolver({ windowElement, axis, }) {\n return createResolverWithContainer({ axis, isWindow: isElementWindow(windowElement) }, windowElement);\n}\nfunction createResolverWithContainer(resolver, windowElement) {\n const container = resolver.isWindow || (windowElement && !windowElement.nativeElement)\n ? windowElement\n : windowElement.nativeElement;\n return { ...resolver, container };\n}\nfunction isElementWindow(windowElement) {\n const isWindow = ['Window', 'global'].some((obj) => Object.prototype.toString.call(windowElement).includes(obj));\n return isWindow;\n}\nfunction getDocumentElement(isContainerWindow, windowElement) {\n return isContainerWindow ? windowElement.document.documentElement : null;\n}\nfunction calculatePoints(element, resolver) {\n const height = extractHeightForElement(resolver);\n return resolver.isWindow\n ? calculatePointsForWindow(height, element, resolver)\n : calculatePointsForElement(height, element, resolver);\n}\nfunction calculatePointsForWindow(height, element, resolver) {\n const { axis, container, isWindow } = resolver;\n const { offsetHeightKey, clientHeightKey } = extractHeightPropKeys(axis);\n // scrolled until now / current y point\n const scrolled = height +\n getElementPageYOffset(getDocumentElement(isWindow, container), axis, isWindow);\n // total height / most bottom y point\n const nativeElementHeight = getElementHeight(element.nativeElement, isWindow, offsetHeightKey, clientHeightKey);\n const totalToScroll = getElementOffsetTop(element.nativeElement, axis, isWindow) +\n nativeElementHeight;\n return { height, scrolled, totalToScroll, isWindow };\n}\nfunction calculatePointsForElement(height, element, resolver) {\n const { axis, container } = resolver;\n // perhaps use container.offsetTop instead of 'scrollTop'\n const scrolled = container[axis.scrollTopKey()];\n const totalToScroll = container[axis.scrollHeightKey()];\n return { height, scrolled, totalToScroll, isWindow: false };\n}\nfunction extractHeightPropKeys(axis) {\n return {\n offsetHeightKey: axis.offsetHeightKey(),\n clientHeightKey: axis.clientHeightKey(),\n };\n}\nfunction extractHeightForElement({ container, isWindow, axis, }) {\n const { offsetHeightKey, clientHeightKey } = extractHeightPropKeys(axis);\n return getElementHeight(container, isWindow, offsetHeightKey, clientHeightKey);\n}\nfunction getElementHeight(elem, isWindow, offsetHeightKey, clientHeightKey) {\n if (isNaN(elem[offsetHeightKey])) {\n const docElem = getDocumentElement(isWindow, elem);\n return docElem ? docElem[clientHeightKey] : 0;\n }\n else {\n return elem[offsetHeightKey];\n }\n}\nfunction getElementOffsetTop(elem, axis, isWindow) {\n const topKey = axis.topKey();\n // elem = elem.nativeElement;\n if (!elem.getBoundingClientRect) {\n // || elem.css('none')) {\n return;\n }\n return (elem.getBoundingClientRect()[topKey] +\n getElementPageYOffset(elem, axis, isWindow));\n}\nfunction getElementPageYOffset(elem, axis, isWindow) {\n const pageYOffset = axis.pageYOffsetKey();\n const scrollTop = axis.scrollTopKey();\n const offsetTop = axis.offsetTopKey();\n if (isNaN(window.pageYOffset)) {\n return getDocumentElement(isWindow, elem)[scrollTop];\n }\n else if (elem.ownerDocument) {\n return elem.ownerDocument.defaultView[pageYOffset];\n }\n else {\n return elem[offsetTop];\n }\n}\n\nfunction shouldFireScrollEvent(container, distance = { down: 0, up: 0 }, scrollingDown) {\n let remaining;\n let containerBreakpoint;\n if (container.totalToScroll <= 0) {\n return false;\n }\n const scrolledUntilNow = container.isWindow\n ? container.scrolled\n : container.height + container.scrolled;\n if (scrollingDown) {\n remaining =\n (container.totalToScroll - scrolledUntilNow) / container.totalToScroll;\n const distanceDown = distance?.down ? distance.down : 0;\n containerBreakpoint = distanceDown / 10;\n }\n else {\n const totalHiddenContentHeight = container.scrolled + (container.totalToScroll - scrolledUntilNow);\n remaining = container.scrolled / totalHiddenContentHeight;\n const distanceUp = distance?.up ? distance.up : 0;\n containerBreakpoint = distanceUp / 10;\n }\n const shouldFireEvent = remaining <= containerBreakpoint;\n return shouldFireEvent;\n}\nfunction isScrollingDownwards(lastScrollPosition, container) {\n return lastScrollPosition < container.scrolled;\n}\nfunction getScrollStats(lastScrollPosition, container, distance) {\n const scrollDown = isScrollingDownwards(lastScrollPosition, container);\n return {\n fire: shouldFireScrollEvent(container, distance, scrollDown),\n scrollDown,\n };\n}\nfunction updateScrollPosition(position, scrollState) {\n return (scrollState.lastScrollPosition = position);\n}\nfunction updateTotalToScroll(totalToScroll, scrollState) {\n if (scrollState.lastTotalToScroll !== totalToScroll) {\n scrollState.lastTotalToScroll = scrollState.totalToScroll;\n scrollState.totalToScroll = totalToScroll;\n }\n}\nfunction isSameTotalToScroll(scrollState) {\n return scrollState.totalToScroll === scrollState.lastTotalToScroll;\n}\nfunction updateTriggeredFlag(scroll, scrollState, triggered, isScrollingDown) {\n if (isScrollingDown) {\n scrollState.triggered.down = scroll;\n }\n else {\n scrollState.triggered.up = scroll;\n }\n}\nfunction isTriggeredScroll(totalToScroll, scrollState, isScrollingDown) {\n return isScrollingDown\n ? scrollState.triggered.down === totalToScroll\n : scrollState.triggered.up === totalToScroll;\n}\nfunction updateScrollState(scrollState, scrolledUntilNow, totalToScroll) {\n updateScrollPosition(scrolledUntilNow, scrollState);\n updateTotalToScroll(totalToScroll, scrollState);\n // const isSameTotal = isSameTotalToScroll(scrollState);\n // if (!isSameTotal) {\n // updateTriggeredFlag(scrollState, false, isScrollingDown);\n // }\n}\n\nclass ScrollState {\n constructor({ totalToScroll }) {\n this.lastScrollPosition = 0;\n this.lastTotalToScroll = 0;\n this.totalToScroll = 0;\n this.triggered = {\n down: 0,\n up: 0,\n };\n this.totalToScroll = totalToScroll;\n }\n updateScrollPosition(position) {\n return (this.lastScrollPosition = position);\n }\n updateTotalToScroll(totalToScroll) {\n if (this.lastTotalToScroll !== totalToScroll) {\n this.lastTotalToScroll = this.totalToScroll;\n this.totalToScroll = totalToScroll;\n }\n }\n updateScroll(scrolledUntilNow, totalToScroll) {\n this.updateScrollPosition(scrolledUntilNow);\n this.updateTotalToScroll(totalToScroll);\n }\n updateTriggeredFlag(scroll, isScrollingDown) {\n if (isScrollingDown) {\n this.triggered.down = scroll;\n }\n else {\n this.triggered.up = scroll;\n }\n }\n isTriggeredScroll(totalToScroll, isScrollingDown) {\n return isScrollingDown\n ? this.triggered.down === totalToScroll\n : this.triggered.up === totalToScroll;\n }\n}\n\nfunction createScroller(config) {\n const { scrollContainer, scrollWindow, element, fromRoot } = config;\n const resolver = createResolver({\n axis: new AxisResolver(!config.horizontal),\n windowElement: resolveContainerElement(scrollContainer, scrollWindow, element, fromRoot),\n });\n const scrollState = new ScrollState({\n totalToScroll: calculatePoints(element, resolver),\n });\n const options = {\n container: resolver.container,\n throttle: config.throttle,\n };\n const distance = {\n up: config.upDistance,\n down: config.downDistance,\n };\n return attachScrollEvent(options).pipe(mergeMap(() => of(calculatePoints(element, resolver))), map((positionStats) => toInfiniteScrollParams(scrollState.lastScrollPosition, positionStats, distance)), tap(({ stats }) => scrollState.updateScroll(stats.scrolled, stats.totalToScroll)), filter(({ fire, scrollDown, stats: { totalToScroll } }) => shouldTriggerEvents(config.alwaysCallback, fire, scrollState.isTriggeredScroll(totalToScroll, scrollDown))), tap(({ scrollDown, stats: { totalToScroll } }) => {\n scrollState.updateTriggeredFlag(totalToScroll, scrollDown);\n }), map(toInfiniteScrollAction));\n}\nfunction attachScrollEvent(options) {\n let obs = fromEvent(options.container, 'scroll');\n // For an unknown reason calling `sampleTime()` causes trouble for many users, even with `options.throttle = 0`.\n // Let's avoid calling the function unless needed.\n // Replacing with throttleTime seems to solve the problem\n // See https://github.com/orizens/ngx-infinite-scroll/issues/198\n if (options.throttle) {\n obs = obs.pipe(throttleTime(options.throttle, undefined, {\n leading: true,\n trailing: true,\n }));\n }\n return obs;\n}\nfunction toInfiniteScrollParams(lastScrollPosition, stats, distance) {\n const { scrollDown, fire } = getScrollStats(lastScrollPosition, stats, distance);\n return {\n scrollDown,\n fire,\n stats,\n };\n}\nconst InfiniteScrollActions = {\n DOWN: '[NGX_ISE] DOWN',\n UP: '[NGX_ISE] UP',\n};\nfunction toInfiniteScrollAction(response) {\n const { scrollDown, stats: { scrolled: currentScrollPosition }, } = response;\n return {\n type: scrollDown ? InfiniteScrollActions.DOWN : InfiniteScrollActions.UP,\n payload: {\n currentScrollPosition,\n },\n };\n}\n\nclass InfiniteScrollDirective {\n constructor(element, zone) {\n this.element = element;\n this.zone = zone;\n this.scrolled = new EventEmitter();\n this.scrolledUp = new EventEmitter();\n this.infiniteScrollDistance = 2;\n this.infiniteScrollUpDistance = 1.5;\n this.infiniteScrollThrottle = 150;\n this.infiniteScrollDisabled = false;\n this.infiniteScrollContainer = null;\n this.scrollWindow = true;\n this.immediateCheck = false;\n this.horizontal = false;\n this.alwaysCallback = false;\n this.fromRoot = false;\n }\n ngAfterViewInit() {\n if (!this.infiniteScrollDisabled) {\n this.setup();\n }\n }\n ngOnChanges({ infiniteScrollContainer, infiniteScrollDisabled, infiniteScrollDistance, }) {\n const containerChanged = inputPropChanged(infiniteScrollContainer);\n const disabledChanged = inputPropChanged(infiniteScrollDisabled);\n const distanceChanged = inputPropChanged(infiniteScrollDistance);\n const shouldSetup = (!disabledChanged && !this.infiniteScrollDisabled) ||\n (disabledChanged && !infiniteScrollDisabled.currentValue) ||\n distanceChanged;\n if (containerChanged || disabledChanged || distanceChanged) {\n this.destroyScroller();\n if (shouldSetup) {\n this.setup();\n }\n }\n }\n setup() {\n if (hasWindowDefined()) {\n this.zone.runOutsideAngular(() => {\n this.disposeScroller = createScroller({\n fromRoot: this.fromRoot,\n alwaysCallback: this.alwaysCallback,\n disable: this.infiniteScrollDisabled,\n downDistance: this.infiniteScrollDistance,\n element: this.element,\n horizontal: this.horizontal,\n scrollContainer: this.infiniteScrollContainer,\n scrollWindow: this.scrollWindow,\n throttle: this.infiniteScrollThrottle,\n upDistance: this.infiniteScrollUpDistance,\n }).subscribe((payload) => this.handleOnScroll(payload));\n });\n }\n }\n handleOnScroll({ type, payload }) {\n const emitter = type === InfiniteScrollActions.DOWN ? this.scrolled : this.scrolledUp;\n if (hasObservers(emitter)) {\n this.zone.run(() => emitter.emit(payload));\n }\n }\n ngOnDestroy() {\n this.destroyScroller();\n }\n destroyScroller() {\n if (this.disposeScroller) {\n this.disposeScroller.unsubscribe();\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.0.1\", ngImport: i0, type: InfiniteScrollDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.0.1\", type: InfiniteScrollDirective, selector: \"[infiniteScroll], [infinite-scroll], [data-infinite-scroll]\", inputs: { infiniteScrollDistance: \"infiniteScrollDistance\", infiniteScrollUpDistance: \"infiniteScrollUpDistance\", infiniteScrollThrottle: \"infiniteScrollThrottle\", infiniteScrollDisabled: \"infiniteScrollDisabled\", infiniteScrollContainer: \"infiniteScrollContainer\", scrollWindow: \"scrollWindow\", immediateCheck: \"immediateCheck\", horizontal: \"horizontal\", alwaysCallback: \"alwaysCallback\", fromRoot: \"fromRoot\" }, outputs: { scrolled: \"scrolled\", scrolledUp: \"scrolledUp\" }, usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.0.1\", ngImport: i0, type: InfiniteScrollDirective, decorators: [{\n type: Directive,\n args: [{\n selector: '[infiniteScroll], [infinite-scroll], [data-infinite-scroll]',\n }]\n }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { scrolled: [{\n type: Output\n }], scrolledUp: [{\n type: Output\n }], infiniteScrollDistance: [{\n type: Input\n }], infiniteScrollUpDistance: [{\n type: Input\n }], infiniteScrollThrottle: [{\n type: Input\n }], infiniteScrollDisabled: [{\n type: Input\n }], infiniteScrollContainer: [{\n type: Input\n }], scrollWindow: [{\n type: Input\n }], immediateCheck: [{\n type: Input\n }], horizontal: [{\n type: Input\n }], alwaysCallback: [{\n type: Input\n }], fromRoot: [{\n type: Input\n }] } });\nfunction hasObservers(emitter) {\n // Note: The `observed` property is available only in RxJS@7.2.0, which means it's\n // not available for users running the lower version.\n return emitter.observed ?? emitter.observers.length > 0;\n}\n\nclass InfiniteScrollModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.0.1\", ngImport: i0, type: InfiniteScrollModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"16.0.1\", ngImport: i0, type: InfiniteScrollModule, declarations: [InfiniteScrollDirective], exports: [InfiniteScrollDirective] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"16.0.1\", ngImport: i0, type: InfiniteScrollModule }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.0.1\", ngImport: i0, type: InfiniteScrollModule, decorators: [{\n type: NgModule,\n args: [{\n declarations: [InfiniteScrollDirective],\n exports: [InfiniteScrollDirective],\n imports: [],\n providers: [],\n }]\n }] });\n\n/*\n * Public API Surface of ngx-infinite-scroll\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { InfiniteScrollDirective, InfiniteScrollModule, NgxInfiniteScrollService };\n","import * as i4 from '@angular/cdk/overlay';\nimport { CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';\nimport * as i0 from '@angular/core';\nimport { EventEmitter, TemplateRef, numberAttribute, booleanAttribute, Component, Optional, Self, Attribute, Input, HostBinding, Output, ViewChild, ViewChildren, HostListener, Directive, NgModule } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport * as i1 from '@angular/cdk/scrolling';\nimport * as i2 from '@angular/forms';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport * as i3 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport * as i5 from 'ngx-infinite-scroll';\nimport { InfiniteScrollModule } from 'ngx-infinite-scroll';\n\nconst timeout = 200;\nconst unicodePatterns = [\n { l: 'a', s: /[ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ]/gi },\n { l: 'aa', s: /ꜳ/gi },\n { l: 'ae', s: /[æǽǣ]/gi },\n { l: 'ao', s: /ꜵ/gi },\n { l: 'au', s: /ꜷ/gi },\n { l: 'av', s: /[ꜹꜻ]/gi },\n { l: 'ay', s: /ꜽ/gi },\n { l: 'b', s: /[ⓑbḃḅḇƀƃɓ]/gi },\n { l: 'c', s: /[ⓒcćĉċčçḉƈȼꜿↄ]/gi },\n { l: 'd', s: /[ⓓdḋďḍḑḓḏđƌɖɗꝺ]/gi },\n { l: 'dz', s: /[dzdž]/gi },\n { l: 'e', s: /[ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ]/gi },\n { l: 'f', s: /[ⓕfḟƒꝼ]/gi },\n { l: 'g', s: /[ⓖgǵĝḡğġǧģǥɠꞡᵹꝿ]/gi },\n { l: 'h', s: /[ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ]/gi },\n { l: 'hv', s: /ƕ/gi },\n { l: 'i', s: /[ⓘiìíîĩīĭİïḯỉǐȉȋịįḭɨı]/gi },\n { l: 'j', s: /[ⓙjĵǰɉ]/gi },\n { l: 'k', s: /[ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ]/gi },\n { l: 'l', s: /[ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇꝆ]/gi },\n { l: 'lj', s: /lj/gi },\n { l: 'm', s: /[ⓜmḿṁṃɱɯ]/gi },\n { l: 'n', s: /[ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ]/gi },\n { l: 'nj', s: /nj/gi },\n { l: 'o', s: /[ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔƟꝋꝍɵ]/gi },\n { l: 'oi', s: /ƣ/gi },\n { l: 'oe', s: /œ/gi },\n { l: 'oo', s: /ꝏ/gi },\n { l: 'ou', s: /ȣ/gi },\n { l: 'p', s: /[ⓟpṕṗƥᵽꝑꝓꝕ]/gi },\n { l: 'q', s: /[ⓠqɋꝗꝙ]/gi },\n { l: 'r', s: /[ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ]/gi },\n { l: 's', s: /[ⓢsßẞśṥŝṡšṧṣṩșşȿꞩꞅẛ]/gi },\n { l: 't', s: /[ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ]/gi },\n { l: 'tz', s: /ꜩ/gi },\n { l: 'u', s: /[ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ]/gi },\n { l: 'v', s: /[ⓥvṽṿʋꝟʌ]/gi },\n { l: 'vy', s: /ꝡ/gi },\n { l: 'w', s: /[ⓦwẁẃŵẇẅẘẉⱳ]/gi },\n { l: 'x', s: /[ⓧxẋẍ]/gi },\n { l: 'y', s: /[ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ]/gi },\n { l: 'z', s: /[ⓩzźẑżžẓẕƶȥɀⱬꝣ]/gi },\n];\nconst defaultMinCountForSearch = 6;\nconst protectRegexp = new RegExp('[\\\\-\\\\[\\\\]\\\\/\\\\{\\\\}\\\\(\\\\)\\\\*\\\\+\\\\?\\\\.\\\\\\\\\\\\^\\\\$\\\\|]', 'g');\n\nclass Select2Utils {\n static getOptionByValue(data, value) {\n if (Array.isArray(data)) {\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n for (const option of options) {\n if (option.value === value) {\n return option;\n }\n }\n }\n else if (groupOrOption.value === value) {\n return groupOrOption;\n }\n }\n }\n return undefined;\n }\n static getOptionsByValue(data, value, multiple) {\n if (multiple) {\n const values = Array.isArray(value) ? value : [];\n const result = [];\n for (const v of values) {\n const option = Select2Utils.getOptionByValue(data, v);\n if (option) {\n result.push(option);\n }\n }\n return result;\n }\n return Select2Utils.getOptionByValue(data, value);\n }\n static getFirstAvailableOption(data) {\n if (Array.isArray(data)) {\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n for (const option of options) {\n if (!option.disabled) {\n return option.value;\n }\n }\n }\n else {\n const option = groupOrOption;\n if (!option.disabled) {\n return option.value;\n }\n }\n }\n }\n return null;\n }\n static valueIsNotInFilteredData(filteredData, value) {\n if (Select2Utils.isNullOrUndefined(value)) {\n return true;\n }\n for (const groupOrOption of filteredData) {\n const options = groupOrOption.options;\n if (options) {\n for (const option of options) {\n if (option.value === value) {\n return false;\n }\n }\n }\n else if (groupOrOption.value === value) {\n return false;\n }\n }\n return true;\n }\n // eslint-disable-next-line\n static getPreviousOption(filteredData, hoveringValue) {\n let findIt = Select2Utils.isNullOrUndefined(hoveringValue);\n for (let i = filteredData.length - 1; i >= 0; i--) {\n const groupOrOption = filteredData[i];\n const options = groupOrOption.options;\n if (options) {\n for (let j = options.length - 1; j >= 0; j--) {\n const option = options[j];\n if (findIt && !option.disabled && !option.hide) {\n return option;\n }\n if (!findIt) {\n findIt = option.value === hoveringValue;\n }\n }\n }\n else {\n const option = groupOrOption;\n if (findIt && !option.disabled && !option.hide) {\n return option;\n }\n if (!findIt) {\n findIt = option.value === hoveringValue;\n }\n }\n }\n return null;\n }\n // eslint-disable-next-line\n static getNextOption(filteredData, hoveringValue) {\n let findIt = Select2Utils.isNullOrUndefined(hoveringValue);\n for (const groupOrOption of filteredData) {\n const options = groupOrOption.options;\n if (options) {\n for (const option of options) {\n if (findIt) {\n if (!option.disabled && !option.hide) {\n return option;\n }\n }\n else if (!findIt) {\n findIt = option.value === hoveringValue;\n }\n }\n }\n else {\n const option = groupOrOption;\n if (findIt) {\n if (!option.disabled && !option.hide) {\n return option;\n }\n }\n else if (!findIt) {\n findIt = option.value === hoveringValue;\n }\n }\n }\n return null;\n }\n static getReduceData(data, maxResults = 0) {\n if (maxResults > 0) {\n let counter = 0;\n const result = [];\n // debugger;\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n const group = {\n ...groupOrOption,\n options: [],\n };\n result.push(group);\n for (const item of options) {\n group.options.push(item);\n counter++;\n if (counter === maxResults) {\n return { result, reduce: true };\n }\n }\n }\n else {\n result.push(groupOrOption);\n counter++;\n }\n if (counter === maxResults) {\n return { result, reduce: true };\n }\n }\n return { result, reduce: false };\n }\n else {\n return { result: data, reduce: false };\n }\n }\n static getFilteredData(data, searchText, editPattern) {\n if (searchText) {\n const result = [];\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n if (options.some(group => Select2Utils.containSearchText(group.label, searchText, editPattern))) {\n const filteredOptions = options.filter(group => Select2Utils.containSearchText(group.label, searchText, editPattern));\n result.push({\n ...groupOrOption,\n options: filteredOptions,\n });\n }\n }\n else if (Select2Utils.containSearchText(groupOrOption.label, searchText, editPattern)) {\n result.push(groupOrOption);\n }\n }\n return result;\n }\n else {\n return data;\n }\n }\n static getFilteredSelectedData(data, selectedOptions) {\n const result = [];\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n const filteredOptions = options.filter(group => Select2Utils.isSelected(selectedOptions, group, true) === 'false');\n if (filteredOptions.length) {\n result.push({\n ...groupOrOption,\n options: filteredOptions,\n });\n }\n }\n else if (Select2Utils.isSelected(selectedOptions, groupOrOption, true) === 'false') {\n result.push(groupOrOption);\n }\n }\n return result;\n }\n static isSearchboxHiddex(data, minCountForSearch) {\n if (minCountForSearch === '' ||\n minCountForSearch === undefined ||\n minCountForSearch === null ||\n isNaN(+minCountForSearch)) {\n minCountForSearch = defaultMinCountForSearch;\n }\n const optionCount = Select2Utils.getOptionsCount(data);\n return optionCount < +minCountForSearch;\n }\n static isSelected(options, option, multiple) {\n return multiple\n ? options && options.some(op => op.value === option.value)\n ? 'true'\n : 'false'\n : options && option.value === options.value\n ? 'true'\n : 'false';\n }\n static removeSelection(options, option) {\n for (let i = 0; i < options.length; i++) {\n if (options[i].value === option.value) {\n options.splice(i, 1);\n return;\n }\n }\n }\n static getOptionsCount(data) {\n let count = 0;\n if (Array.isArray(data)) {\n for (const groupOrOption of data) {\n const options = groupOrOption.options;\n if (options) {\n count += options.length;\n }\n else {\n count++;\n }\n }\n }\n return count;\n }\n static isNullOrUndefined(value) {\n return value === null || value === undefined;\n }\n static containSearchText(label, searchText, editPattern) {\n return searchText\n ? Select2Utils.formatSansUnicode(label).match(new RegExp(Select2Utils.formatPattern(searchText, editPattern), 'i')) !== null\n : true;\n }\n static protectPattern(str) {\n return str.replace(protectRegexp, '\\\\$&');\n }\n static formatSansUnicode(str) {\n for (const unicodePattern of unicodePatterns) {\n str = str.replace(unicodePattern.s, unicodePattern.l);\n }\n return str;\n }\n static formatPattern(str, editPattern) {\n str = Select2Utils.formatSansUnicode(Select2Utils.protectPattern(str));\n if (editPattern && typeof editPattern === 'function') {\n str = editPattern(str);\n }\n return str;\n }\n}\n\nlet nextUniqueId = 0;\nconst displaySearchStatusList = ['default', 'hidden', 'always'];\nclass Select2 {\n /** data of options & optiongrps */\n set data(data) {\n this._data = data;\n this.updateFilteredData(true);\n }\n get multiple() {\n return this._multiple;\n }\n set multiple(value) {\n this._multiple = value;\n this.ngOnInit();\n }\n /** minimal data of show the search field */\n get minCountForSearch() {\n return this._minCountForSearch;\n }\n set minCountForSearch(value) {\n this._minCountForSearch = value;\n this.updateSearchBox();\n }\n /** Unique id of the element. */\n get id() {\n return this._id;\n }\n set id(value) {\n this._id = value || this._uid;\n }\n /** Whether selected items should be hidden. */\n get disabled() {\n return this._control ? this._control.disabled : this._disabled;\n }\n set disabled(value) {\n this._disabled = value;\n }\n /** The input element's value. */\n get value() {\n return this._value;\n }\n set value(value) {\n if (this.testValueChange(this._value, value)) {\n setTimeout(() => {\n this._value = value;\n this.writeValue(value);\n }, 10);\n }\n }\n /** Tab index for the select2 element. */\n get tabIndex() {\n return this.disabled ? -1 : this._tabIndex;\n }\n set tabIndex(value) {\n this._tabIndex = value;\n }\n get select2Options() {\n return this.multiple ? this.option : null;\n }\n get select2Option() {\n return this.multiple ? null : this.option;\n }\n get searchText() {\n return this.innerSearchText;\n }\n set searchText(text) {\n this.innerSearchText = text;\n }\n get ariaInvalid() {\n return this._isErrorState();\n }\n get classMaterial() {\n return this.styleMode === 'material';\n }\n get classNostyle() {\n return this.styleMode === 'noStyle';\n }\n get select2above() {\n return !this.overlay ? this.listPosition === 'above' : this._isAbobeOverlay();\n }\n get _positions() {\n return this.listPosition === 'auto' ? undefined : null;\n }\n get resultsElement() {\n return this.resultContainer?.nativeElement;\n }\n constructor(_viewportRuler, _changeDetectorRef, _parentForm, _parentFormGroup, _control, tabIndex) {\n this._viewportRuler = _viewportRuler;\n this._changeDetectorRef = _changeDetectorRef;\n this._parentForm = _parentForm;\n this._parentFormGroup = _parentFormGroup;\n this._control = _control;\n this.minCharForSearch = 0;\n this.limitSelection = 0;\n this.listPosition = 'below';\n /** use the material style */\n this.overlay = false;\n /** use the material style */\n this.styleMode = 'default';\n /** maximum results limit (0 = no limit) */\n this.maxResults = 0;\n /** message when maximum results */\n this.maxResultsMessage = 'Too many results…';\n /** infinite scroll distance */\n this.infiniteScrollDistance = 1.5;\n /** infinite scroll distance */\n this.infiniteScrollThrottle = 150;\n /** infinite scroll activated */\n this.infiniteScroll = false;\n /** auto create if not existe */\n this.autoCreate = false;\n /** no template for label selection */\n this.noLabelTemplate = false;\n /** the max height of the results container when opening the select */\n this.resultMaxHeight = '200px';\n /** Active Search event */\n this.customSearchEnabled = false;\n /** Whether the element is required. */\n this.required = false;\n /** Whether items are hidden when has. */\n this.hideSelectedItems = false;\n /** Whether the element is readonly. */\n this.readonly = false;\n /** reset with no selected value */\n this.resettable = false;\n this.update = new EventEmitter();\n this.open = new EventEmitter();\n this.close = new EventEmitter();\n this.focus = new EventEmitter();\n this.blur = new EventEmitter();\n this.search = new EventEmitter();\n this.scroll = new EventEmitter();\n this.removeOption = new EventEmitter();\n this.option = null;\n this.isOpen = false;\n /** Whether the element is focused or not. */\n this.focused = false;\n this.hoveringValue = null;\n this.innerSearchText = '';\n this._stateChanges = new Subject();\n this._disabled = false;\n this._multiple = false;\n this._uid = `select2-${nextUniqueId++}`;\n /** View -> model callback called when select has been touched */\n this._onTouched = () => {\n // do nothing\n };\n /** View -> model callback called when value changes */\n this._onChange = () => {\n // do nothing\n };\n // eslint-disable-next-line no-self-assign\n this.id = this.id;\n this._tabIndex = parseInt(tabIndex, 10) || 0;\n if (this._control) {\n this._control.valueAccessor = this;\n }\n }\n clickDetection(e) {\n if (this.isOpen && focus) {\n const target = e.target;\n if (!this.ifParentContainsClass(target, 'selection')) {\n if (!this.ifParentContainsClass(target, 'select2-dropdown')) {\n this.toggleOpenAndClose();\n }\n if (!this.ifParentContainsId(target, this._id)) {\n this.clickExit();\n }\n }\n else if (!this.ifParentContainsId(target, this._id)) {\n this.toggleOpenAndClose();\n this.clickExit();\n }\n }\n }\n ngOnInit() {\n this._viewportRuler.change(100).subscribe(() => {\n if (this.isOpen) {\n this.triggerRect();\n }\n });\n const option = Select2Utils.getOptionsByValue(this._data, this._control ? this._control.value : this.value, this.multiple);\n if (option !== null) {\n this.option = option;\n }\n if (!Array.isArray(option)) {\n this.hoveringValue = this.value;\n }\n this.updateSearchBox();\n }\n ngAfterViewInit() {\n this.cdkConnectedOverlay.positionChange.subscribe((posChange) => {\n if (this.listPosition === 'auto' &&\n posChange.connectionPair?.originY &&\n this._overlayPosition !== posChange.connectionPair.originY) {\n this.triggerRect();\n this._overlayPosition = posChange.connectionPair.originY;\n this._changeDetectorRef.detectChanges();\n }\n });\n this.selectionElement = this.selection.nativeElement;\n this.triggerRect();\n }\n ngDoCheck() {\n this.updateSearchBox();\n this._dirtyCheckNativeValue();\n if (this._triggerRect) {\n if (this.overlayWidth !== this._triggerRect.width) {\n this.overlayWidth = this._triggerRect.width;\n }\n if (this._dropdownRect?.height > 0 && this.overlayHeight !== this._dropdownRect.height) {\n this.overlayHeight = this.listPosition === 'auto' ? this._dropdownRect.height : 0;\n }\n }\n }\n updateSearchBox() {\n const hidden = this.customSearchEnabled\n ? false\n : Select2Utils.isSearchboxHiddex(this._data, this._minCountForSearch);\n if (this.isSearchboxHidden !== hidden) {\n this.isSearchboxHidden = hidden;\n }\n }\n hideSearch() {\n const displaySearchStatus = displaySearchStatusList.indexOf(this.displaySearchStatus) > -1 ? this.displaySearchStatus : 'default';\n return (displaySearchStatus === 'default' && this.isSearchboxHidden) || displaySearchStatus === 'hidden';\n }\n getOptionStyle(option) {\n return ('select2-results__option ' +\n (option.hide ? 'select2-results__option--hide ' : '') +\n (option.value === this.hoveringValue ? 'select2-results__option--highlighted ' : '') +\n (option.classes || ''));\n }\n mouseenter(option) {\n if (!option.disabled) {\n this.hoveringValue = option.value;\n }\n }\n click(option) {\n if (this.testSelection(option)) {\n this.select(option);\n }\n }\n reset(event) {\n // const test = Select2Utils.getOptionByValue(this._data, this.resetSelectedValue);\n // debugger;\n this.select(this.resetSelectedValue !== undefined\n ? Select2Utils.getOptionByValue(this._data, this.resetSelectedValue) ?? null\n : null);\n this.stopEvent(event);\n }\n prevChange(event) {\n event.stopPropagation();\n }\n stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n }\n toggleOpenAndClose(focus = true, open, event) {\n if (this.disabled) {\n return;\n }\n this._focus(focus);\n const changeEmit = this.isOpen !== (open ?? !this.isOpen);\n this.isOpen = open ?? !this.isOpen;\n if (this.isOpen) {\n if (!this.isSearchboxHidden) {\n this.innerSearchText = '';\n this.updateFilteredData();\n this._focusSearchboxOrResultsElement(focus);\n }\n if (this.isSearchboxHidden && !changeEmit && event) {\n this.keyDown(event);\n }\n else {\n setTimeout(() => {\n if (this.option) {\n const option = Array.isArray(this.option) ? this.option[0] : this.option;\n this.updateScrollFromOption(option);\n }\n else if (this.resultsElement) {\n this.resultsElement.scrollTop = 0;\n }\n setTimeout(() => {\n this.triggerRect();\n this.cdkConnectedOverlay?.overlayRef?.updatePosition();\n }, 100);\n });\n }\n if (changeEmit) {\n this.open.emit(this);\n }\n }\n else if (changeEmit) {\n this.close.emit(this);\n }\n this._changeDetectorRef.markForCheck();\n }\n hasTemplate(option, defaut) {\n return (this.templates instanceof TemplateRef ||\n this.templates?.[option.templateId] instanceof TemplateRef ||\n this.templates?.[defaut] instanceof TemplateRef);\n }\n getTemplate(option, defaut) {\n return this.hasTemplate(option, defaut)\n ? this.templates[option.templateId] || this.templates[defaut] || this.templates\n : undefined;\n }\n triggerRect() {\n this._triggerRect = this.selectionElement.getBoundingClientRect();\n this._dropdownRect = this.dropdown?.nativeElement\n ? this.dropdown.nativeElement.getBoundingClientRect()\n : undefined;\n }\n testSelection(option) {\n if (option.disabled) {\n return false;\n }\n return (!this.multiple ||\n !this.limitSelection ||\n (Array.isArray(this._value) && this._value.length < this.limitSelection));\n }\n testValueChange(value1, value2) {\n if (((value1 === null || value1 === undefined) && (value2 === null || value2 === undefined)) ||\n value1 === value2) {\n return false;\n }\n if (this.multiple &&\n value1?.length &&\n value2?.length &&\n value1.length === value2.length) {\n for (const e1 of value1) {\n const test = value2.indexOf(e1) > -1;\n if (!test) {\n return true;\n }\n }\n return false;\n }\n return true;\n }\n updateFilteredData(writeValue = false) {\n setTimeout(() => {\n let result = this._data;\n if (this.multiple && this.hideSelectedItems) {\n result = Select2Utils.getFilteredSelectedData(result, this.option);\n }\n if (!this.customSearchEnabled && this.searchText && this.searchText.length >= +this.minCharForSearch) {\n result = Select2Utils.getFilteredData(result, this.searchText, this.editPattern);\n }\n if (this.maxResults > 0) {\n const data = Select2Utils.getReduceData(result, +this.maxResults);\n result = data.result;\n this.maxResultsExceeded = data.reduce;\n }\n else {\n this.maxResultsExceeded = false;\n }\n if (Select2Utils.valueIsNotInFilteredData(result, this.hoveringValue)) {\n this.hoveringValue = Select2Utils.getFirstAvailableOption(result);\n }\n if (writeValue) {\n // refresh current selected value\n this.writeValue(this._control ? this._control.value : this.value);\n }\n this.filteredData = result;\n this._changeDetectorRef.markForCheck();\n });\n }\n clickExit() {\n this._focus(false);\n }\n ifParentContainsClass(element, cssClass) {\n return this.getParentElementByClass(element, cssClass) !== null;\n }\n ifParentContainsId(element, id) {\n return this.getParentElementById(element, id) !== null;\n }\n getParentElementByClass(element, cssClass) {\n return this.containClasses(element, cssClass.trim().split(/\\s+/))\n ? element\n : element.parentElement\n ? this.getParentElementByClass(element.parentElement, cssClass)\n : null;\n }\n getParentElementById(element, id) {\n return element.id === id\n ? element\n : element.parentElement\n ? this.getParentElementById(element.parentElement, id)\n : null;\n }\n containClasses(element, cssClasses) {\n if (!element.classList) {\n return false;\n }\n for (const cssClass of cssClasses) {\n if (!element.classList.contains(cssClass)) {\n return false;\n }\n }\n return true;\n }\n focusin() {\n if (!this.disabled) {\n this._focus(true);\n }\n }\n focusout() {\n if (this.selectionElement && !this.selectionElement.classList.contains('select2-focused')) {\n this._focus(false);\n this._onTouched();\n }\n }\n select(option) {\n let value;\n if (option !== null && option !== undefined) {\n if (this.multiple) {\n const options = this.option;\n const index = options.findIndex(op => op.value === option.value);\n if (index === -1) {\n options.push(option);\n }\n else {\n options.splice(index, 1);\n }\n value = this.option.map(op => op.value);\n }\n else {\n this.option = option;\n if (this.isOpen) {\n this.isOpen = false;\n this.close.emit(this);\n this.selectionElement?.focus();\n }\n value = this.option.value;\n }\n }\n else {\n this.option = null;\n }\n if (this.multiple && this.hideSelectedItems) {\n this.updateFilteredData();\n }\n if (this._control) {\n this._onChange(value);\n }\n else {\n this._value = value;\n }\n this.update.emit({\n component: this,\n value: value,\n options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null,\n });\n }\n keyDown(event, create = false) {\n if (create && this._testKey(event, ['Enter', 13])) {\n this.createAndAdd(event);\n }\n else if (this._testKey(event, ['ArrowDown', 40])) {\n this.moveDown();\n event.preventDefault();\n }\n else if (this._testKey(event, ['ArrowUp', 38])) {\n this.moveUp();\n event.preventDefault();\n }\n else if (this._testKey(event, ['Enter', 13])) {\n this.selectByEnter();\n event.preventDefault();\n }\n else if (this._testKey(event, ['Escape', 'Tab', 9, 27]) && this.isOpen) {\n this.toggleOpenAndClose();\n this._focus(false);\n }\n }\n openKey(event, create = false) {\n if (create && this._testKey(event, ['Enter', 13])) {\n this.createAndAdd(event);\n }\n else if (this._testKey(event, ['ArrowDown', 'ArrowUp', 'Enter', 40, 38, 13])) {\n this.toggleOpenAndClose(true, true, event);\n event.preventDefault();\n }\n else if (this._testKey(event, ['Escape', 'Tab', 9, 27])) {\n this.toggleOpenAndClose(false);\n if (this.isOpen) {\n event.preventDefault();\n }\n this._onTouched();\n }\n }\n searchUpdate(e) {\n this.searchText = e.target.value;\n if (!this.customSearchEnabled) {\n this.updateFilteredData();\n }\n else {\n this.search.emit({\n component: this,\n value: this._value,\n search: this.searchText,\n data: this._data,\n filteredData: (data) => {\n this.filteredData = data;\n this._changeDetectorRef.markForCheck();\n },\n });\n }\n }\n trackBy(_index, item) {\n return item.value;\n }\n isSelected(option) {\n return Select2Utils.isSelected(this.option, option, this.multiple);\n }\n isDisabled(option) {\n return option.disabled ? 'true' : 'false';\n }\n removeSelection(e, option) {\n Select2Utils.removeSelection(this.option, option);\n if (this.multiple && this.hideSelectedItems) {\n this.updateFilteredData();\n }\n const value = this.option.map(op => op.value);\n if (this._control) {\n this._onChange(value);\n }\n else {\n this._value = value;\n }\n this.update.emit({\n component: this,\n value: value,\n options: Array.isArray(this.option) ? this.option : this.option ? [this.option] : null,\n });\n this.removeOption.emit({\n component: this,\n value: value,\n removedOption: option,\n });\n e.preventDefault();\n e.stopPropagation();\n if (this.isOpen) {\n this._focusSearchboxOrResultsElement();\n }\n }\n /**\n * Sets the model value. Implemented as part of ControlValueAccessor.\n * @param value\n */\n writeValue(value) {\n this._setSelectionByValue(value);\n }\n /**\n * Saves a callback function to be invoked when the select's value\n * changes from user input. Part of the ControlValueAccessor interface\n * required to integrate with Angular's core forms API.\n *\n * @param fn Callback to be triggered when the value changes.\n */\n registerOnChange(fn) {\n this._onChange = fn;\n }\n /**\n * Saves a callback function to be invoked when the select is blurred\n * by the user. Part of the ControlValueAccessor interface required\n * to integrate with Angular's core forms API.\n *\n * @param fn Callback to be triggered when the component has been touched.\n */\n registerOnTouched(fn) {\n this._onTouched = fn;\n }\n /**\n * Sets whether the component should be disabled.\n * Implemented as part of ControlValueAccessor.\n * @param isDisabled\n */\n setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }\n onScroll(way) {\n this.scroll.emit({\n component: this,\n way,\n search: this.innerSearchText,\n data: this._data,\n });\n }\n _isErrorState() {\n const isInvalid = this._control?.invalid;\n const isTouched = this._control?.touched;\n const isSubmitted = this._parentFormGroup?.submitted || this._parentForm?.submitted;\n return !!(isInvalid && (isTouched || isSubmitted));\n }\n addItem(value) {\n let item = Select2Utils.getOptionByValue(this._data, value);\n if (!item) {\n item = {\n value,\n label: value,\n };\n this._data.push(item);\n }\n return item;\n }\n createAndAdd(e) {\n const value = e.target.value;\n if (value.trim()) {\n const item = this.addItem(value.trim());\n this.click(item);\n e.target.value = '';\n }\n this.stopEvent(e);\n }\n moveUp() {\n this.updateScrollFromOption(Select2Utils.getPreviousOption(this.filteredData, this.hoveringValue));\n }\n moveDown() {\n this.updateScrollFromOption(Select2Utils.getNextOption(this.filteredData, this.hoveringValue));\n }\n updateScrollFromOption(option) {\n if (option) {\n this.hoveringValue = option.value;\n const domElement = this.results.find(r => r.nativeElement.innerText.trim() === option.label);\n if (domElement && this.resultsElement) {\n this.resultsElement.scrollTop = 0;\n const listClientRect = this.resultsElement.getBoundingClientRect();\n const optionClientRect = domElement.nativeElement.getBoundingClientRect();\n this.resultsElement.scrollTop = optionClientRect.top - listClientRect.top;\n }\n }\n }\n selectByEnter() {\n if (this.hoveringValue) {\n const option = Select2Utils.getOptionByValue(this._data, this.hoveringValue);\n this.select(option);\n }\n }\n _testKey(event, refs = []) {\n return this._isKey(this._getKey(event), refs);\n }\n _getKey(event) {\n let code;\n if (event.key !== undefined) {\n code = event.key;\n }\n else if (event['keyIdentifier'] !== undefined) {\n code = event['keyIdentifier'];\n }\n else if (event['keyCode'] !== undefined) {\n code = event['keyCode'];\n }\n else {\n event.preventDefault();\n }\n return code;\n }\n _isKey(code, refs = []) {\n return refs && refs.length > 0 ? refs.indexOf(code) !== -1 : false;\n }\n /**\n * Sets the selected option based on a value. If no option can be\n * found with the designated value, the select trigger is cleared.\n */\n _setSelectionByValue(value) {\n if (this.option || (value !== undefined && value !== null)) {\n const isArray = Array.isArray(value);\n if (this.multiple && value && !isArray) {\n throw new Error('Non array value.');\n }\n else if (this._data) {\n if (this.multiple) {\n this.option = []; // if value is null, then empty option and return\n if (isArray) {\n // value is not null. Preselect value\n const selectedValues = Select2Utils.getOptionsByValue(this._data, value, this.multiple);\n selectedValues.map(item => this.select(item));\n }\n }\n else {\n this.select(Select2Utils.getOptionByValue(this._data, value));\n }\n }\n else if (this._control) {\n this._control.viewToModelUpdate(value);\n }\n this._changeDetectorRef.markForCheck();\n }\n }\n /** Does some manual dirty checking on the native input `value` property. */\n _dirtyCheckNativeValue() {\n const newValue = this.value;\n if (this._previousNativeValue !== newValue) {\n this._previousNativeValue = newValue;\n this._stateChanges.next();\n }\n }\n _focusSearchboxOrResultsElement(focus = true) {\n if (!this.isSearchboxHidden) {\n setTimeout(() => {\n if (this.searchInput && this.searchInput.nativeElement && focus) {\n this.searchInput.nativeElement.focus();\n }\n });\n if (this.resultsElement && focus) {\n this.resultsElement.focus();\n }\n }\n }\n _focus(state) {\n if (!state && this.focused) {\n this.focused = state;\n this.blur.emit(this);\n }\n else if (state && !this.focused) {\n this.focused = state;\n this.focus.emit(this);\n }\n }\n _isAbobeOverlay() {\n return this.overlay && this._overlayPosition && this.listPosition === 'auto'\n ? this._overlayPosition === 'top'\n : this.listPosition === 'above';\n }\n /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.6\", ngImport: i0, type: Select2, deps: [{ token: i1.ViewportRuler }, { token: i0.ChangeDetectorRef }, { token: i2.NgForm, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: i2.NgControl, optional: true, self: true }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component }); }\n /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"16.1.6\", type: Select2, selector: \"select2\", inputs: { data: \"data\", minCharForSearch: [\"minCharForSearch\", \"minCharForSearch\", numberAttribute], displaySearchStatus: \"displaySearchStatus\", placeholder: \"placeholder\", limitSelection: [\"limitSelection\", \"limitSelection\", numberAttribute], listPosition: \"listPosition\", multiple: [\"multiple\", \"multiple\", booleanAttribute], overlay: [\"overlay\", \"overlay\", booleanAttribute], styleMode: \"styleMode\", noResultMessage: \"noResultMessage\", maxResults: [\"maxResults\", \"maxResults\", numberAttribute], maxResultsMessage: \"maxResultsMessage\", infiniteScrollDistance: [\"infiniteScrollDistance\", \"infiniteScrollDistance\", numberAttribute], infiniteScrollThrottle: [\"infiniteScrollThrottle\", \"infiniteScrollThrottle\", numberAttribute], infiniteScroll: [\"infiniteScroll\", \"infiniteScroll\", booleanAttribute], autoCreate: [\"autoCreate\", \"autoCreate\", booleanAttribute], noLabelTemplate: [\"noLabelTemplate\", \"noLabelTemplate\", booleanAttribute], editPattern: \"editPattern\", templates: \"templates\", resultMaxHeight: \"resultMaxHeight\", customSearchEnabled: [\"customSearchEnabled\", \"customSearchEnabled\", booleanAttribute], minCountForSearch: [\"minCountForSearch\", \"minCountForSearch\", numberAttribute], id: \"id\", required: [\"required\", \"required\", booleanAttribute], disabled: [\"disabled\", \"disabled\", booleanAttribute], hideSelectedItems: [\"hideSelectedItems\", \"hideSelectedItems\", booleanAttribute], readonly: [\"readonly\", \"readonly\", booleanAttribute], value: \"value\", tabIndex: [\"tabIndex\", \"tabIndex\", numberAttribute], resettable: [\"resettable\", \"resettable\", booleanAttribute], resetSelectedValue: \"resetSelectedValue\" }, outputs: { update: \"update\", open: \"open\", close: \"close\", focus: \"focus\", blur: \"blur\", search: \"search\", scroll: \"scroll\", removeOption: \"removeOption\" }, host: { listeners: { \"document:click\": \"clickDetection($event)\" }, properties: { \"id\": \"this.id\", \"attr.aria-invalid\": \"this.ariaInvalid\", \"class.material\": \"this.classMaterial\", \"class.nostyle\": \"this.classNostyle\", \"class.select2-above\": \"this.select2above\" } }, viewQueries: [{ propertyName: \"cdkConnectedOverlay\", first: true, predicate: CdkConnectedOverlay, descendants: true }, { propertyName: \"selection\", first: true, predicate: [\"selection\"], descendants: true, static: true }, { propertyName: \"resultContainer\", first: true, predicate: [\"results\"], descendants: true }, { propertyName: \"searchInput\", first: true, predicate: [\"searchInput\"], descendants: true }, { propertyName: \"dropdown\", first: true, predicate: [\"dropdown\"], descendants: true }, { propertyName: \"results\", predicate: [\"result\"], descendants: true }], ngImport: i0, template: \"
\\n \\n \\n
\\n\\n \\n \\n \\n  \\n \\n \\n \\n \\n \\n \\n \\n {{\\n placeholder\\n }}\\n \\n \\u00D7\\n \\n
    \\n 0\\\"\\n class=\\\"select2-selection__placeholder\\\"\\n >{{ placeholder }}\\n \\n \\u00D7\\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n \\n \\n \\n \\n\\n
\\n \\n
\\n\\n\\n\\n \\n\\n\\n\\n \\n \\n \\n
\\n \\n \\n
  • \\n \\n \\n \\n \\n \\n\\n
      \\n \\n
  • \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
    \\n\", styles: [\".select2-label{color:var(--select2-label-text-color, #000)}.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;width:100%}.select2-container .select2-container-dropdown{position:absolute;width:0px;opacity:0}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:var(--select2-single-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding:var(--select2-selection-padding, 0 0 0 8px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:var(--select2-multiple-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-flex;overflow:hidden;padding-left:8px;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;flex-wrap:wrap;gap:var(--select2-selection-multiple-gap, 2px 5px)}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-selection__auto-create{flex:1 1 150px;min-width:150px;display:flex}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field{width:100%;border:0}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field:focus{border:0;outline:0}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background:var(--select2-dropdown-background, white);border:1px solid var(--select2-dropdown-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);box-sizing:border-box;display:block;position:absolute;width:100%;z-index:1051;height:0;overflow:hidden}.select2-dropdown .select2-label-content{display:contents}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:var(--select2-option-padding, 6px);-webkit-user-select:none;user-select:none;color:var(--select2-option-text-color, #000)}.select2-results__option[aria-selected]{cursor:pointer}.select2-container.select2-container-dropdown.select2-container--open{width:100%;opacity:1}.select2-container--open .select2-dropdown{overflow:auto;height:auto}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:27px;display:flex;flex-direction:column-reverse}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99}.select2-required:before{content:\\\"*\\\";color:var(--select2-required-color, red)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--default .select2-selection--single{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);display:flex}.select2-container--default .select2-selection--single .select2-selection__rendered{color:var(--select2-selection-text-color, #111);line-height:var(--select2-selection-line-height, 28px)}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:var(--select2-placeholder-color, #999)}.select2-container--default .select2-selection--single .select2-selection__placeholder span{overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--single .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--single .select2-selection__reset,.select2-container--default .select2-selection--single .select2-selection__arrow{display:flex;width:20px;align-items:center;justify-content:center}.select2-container--default .select2-selection--single .select2-selection__arrow:before{content:\\\" \\\";border-color:var(--select2-arrow-color, #888) transparent;border-style:solid;border-width:5px 4px 0;height:0;width:0}.select2-container--default .select2-selection--single .select2-selection__reset{color:var(--select2-reset-color, #999)}.select2-container--default.select2-container--disabled .select2-selection--single{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow:before{border-color:transparent transparent var(--select2-arrow-color, #888);border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:text;display:flex}.select2-container--default .select2-selection--multiple .select2-selection__rendered{flex:1 1 auto;box-sizing:border-box;list-style:none;margin:0;padding:var(--select2-selection-multiple-padding, 2px 5px);width:100%;min-height:1em;align-items:center}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none;line-height:var(--select2-selection-choice-line-height, 20px)}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;width:100%;color:var(--select2-placeholder-color, #999);margin-top:5px;float:left;overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--multiple .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{color:var(--select2-selection-choice-text-color, #000);background:var(--select2-selection-choice-background, #e4e4e4);border:1px solid var(--select2-selection-choice-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:default;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:var(--select2-selection-choice-close-color, #999);cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:var(--select2-selection-choice-hover-close-color, #333)}.select2-container--default.select2-container--focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default.select2-container--disabled .select2-selection--multiple{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid var(--select2-search-border-color, #aaa);background:1px solid var(--select2-search-background, #fff);border-radius:var(--select2-search-border-radius, 0px)}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:none;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:var(--select2-option-disabled-text-color, #999);background:var(--select2-option-disabled-background, transparent)}.select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-option-selected-text-color, #000);background:var(--select2-option-selected-background, #ddd)}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-option-highlighted-background, #5897fb);color:var(--select2-option-highlighted-text-color, #fff)}.select2-container--default .select2-results__option--hide{display:none}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px;color:var(--select2-option-group-text-color, gray);background:var(--select2-option-group-background, transparent)}.select2-no-result{color:var(--select2-no-result-color, #888);font-style:var(--select2-no-result-font-style, italic)}.select2-too-much-result{color:var(--select2-too-much-result-color, #888);font-style:var(--select2-too-much-font-style, italic)}:host.nostyle .select2-dropdown{border-color:transparent}:host.nostyle .select2-selection--single,:host.nostyle .select2-selection--multiple{background:transparent;border-color:transparent}:host.nostyle .select2-container--default .select2-focused .select2-selection--single,:host.nostyle .select2-container--default .select2-focused .select2-selection--multiple,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{background:transparent;border-color:transparent}:host.material{display:inline-block;width:300px}:host.material>.select2-container{padding-bottom:1.29688em;vertical-align:inherit}:host.material>.select2-container .selection{padding:.4375em 0;border-top:.84375em solid transparent;display:inline-flex;align-items:baseline;width:100%;height:auto}:host.material .select2-container--default .select2-selection--single,:host.material .select2-container--default .select2-selection--multiple{width:100%;border:0;border-radius:0;height:24px;box-sizing:border-box}:host.material .select2-container--default .select2-selection--single:before,:host.material .select2-container--default .select2-selection--multiple:before{content:\\\" \\\";display:block;position:absolute;bottom:1.65em;background:var(--select2-material-underline, #ddd);height:1px;width:100%}:host.material .select2-container--default .select2-selection--single:after,:host.material .select2-container--default .select2-selection--multiple:after{content:\\\" \\\";display:block;position:absolute;bottom:1.63em;background:var(--select2-material-underline-active, #5a419e);height:2px;width:0%;left:50%;transition:none}:host.material .select2-container--default .select2-selection--single .select2-selection__rendered,:host.material .select2-container--default .select2-selection--multiple .select2-selection__rendered{padding-left:1px;line-height:inherit}:host.material .select2-container--default .select2-selection--single .select2-selection__placeholder,:host.material .select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;color:var(--select2-material-placeholder-color, rgba(0, 0, 0, .38));transition:transform .3s;position:absolute;transform-origin:0 21px;left:0;top:20px}:host.material .select2-container--default .select2-container--open{left:0;bottom:1.6em}:host.material .select2-container--default .select2-selection__placeholder__option{transform:translateY(-1.5em) scale(.75) perspective(100px) translateZ(.001px);width:133.33333%}:host.material .select2-container--default .select2-selection__arrow{top:20px}:host.material .select2-container--default.select2-container--open .select2-selection--single:after,:host.material .select2-container--default.select2-container--open .select2-selection--multiple:after,:host.material .select2-container--default .select2-focused .select2-selection--single:after,:host.material .select2-container--default .select2-focused .select2-selection--multiple:after{transition:width .3s cubic-bezier(.12,1,.77,1),left .3s cubic-bezier(.12,1,.77,1);width:100%;left:0%}:host.material .select2-container--default .select2-dropdown{border-radius:0;border:0;box-shadow:0 5px 5px #00000080}:host.material .select2-container--default .select2-results__option[aria-selected=true],:host.material .select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-material-option-selected-background, rgba(0, 0, 0, .04));color:var(--select2-material-option-highlighted-text-color, #000)}:host.material .select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-material-option-selected-text-color, #ff5722)}:host.material .select2-container--default.select2-container--disabled .select2-selection--single,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple{background:transparent}:host.material .select2-container--default.select2-container--disabled .select2-selection--single:before,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple:before{background:var(--select2-material-underline-disabled, linear-gradient(to right, rgba(0, 0, 0, .26) 0, rgba(0, 0, 0, .26) 33%, transparent 0));background-size:4px 1px;background-repeat:repeat-x;background-position:0 bottom}:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:after,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:after{background:var(--select2-material-underline-invalid, red)}:host.material:not(.select2-container--open) .select2-focused .select2-selection--single,:host.material:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:0}:host.material .select2-subscript-wrapper{position:absolute;top:calc(100% - 1.72917em);font-size:75%;color:var(--select2-hint-text-color, #888)}::ng-deep .select2-overlay-backdrop{background:var(--select2-overlay-backdrop, transparent)}::ng-deep .cdk-overlay-container .select2-container .select2-dropdown.select2-dropdown--above{bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown{margin-bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown.select2-dropdown--above{bottom:0;margin-bottom:0;margin-top:28px}@supports (-moz-appearance: none){select2.material .select2-container--default .select2-selection--single,select2.material .select2-container--default .select2-selection--multiple{height:26px}}\\n\"], dependencies: [{ kind: \"directive\", type: i3.NgForOf, selector: \"[ngFor][ngForOf]\", inputs: [\"ngForOf\", \"ngForTrackBy\", \"ngForTemplate\"] }, { kind: \"directive\", type: i3.NgIf, selector: \"[ngIf]\", inputs: [\"ngIf\", \"ngIfThen\", \"ngIfElse\"] }, { kind: \"directive\", type: i3.NgTemplateOutlet, selector: \"[ngTemplateOutlet]\", inputs: [\"ngTemplateOutletContext\", \"ngTemplateOutlet\", \"ngTemplateOutletInjector\"] }, { kind: \"directive\", type: i4.CdkConnectedOverlay, selector: \"[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]\", inputs: [\"cdkConnectedOverlayOrigin\", \"cdkConnectedOverlayPositions\", \"cdkConnectedOverlayPositionStrategy\", \"cdkConnectedOverlayOffsetX\", \"cdkConnectedOverlayOffsetY\", \"cdkConnectedOverlayWidth\", \"cdkConnectedOverlayHeight\", \"cdkConnectedOverlayMinWidth\", \"cdkConnectedOverlayMinHeight\", \"cdkConnectedOverlayBackdropClass\", \"cdkConnectedOverlayPanelClass\", \"cdkConnectedOverlayViewportMargin\", \"cdkConnectedOverlayScrollStrategy\", \"cdkConnectedOverlayOpen\", \"cdkConnectedOverlayDisableClose\", \"cdkConnectedOverlayTransformOriginOn\", \"cdkConnectedOverlayHasBackdrop\", \"cdkConnectedOverlayLockPosition\", \"cdkConnectedOverlayFlexibleDimensions\", \"cdkConnectedOverlayGrowAfterOpen\", \"cdkConnectedOverlayPush\"], outputs: [\"backdropClick\", \"positionChange\", \"attach\", \"detach\", \"overlayKeydown\", \"overlayOutsideClick\"], exportAs: [\"cdkConnectedOverlay\"] }, { kind: \"directive\", type: i4.CdkOverlayOrigin, selector: \"[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]\", exportAs: [\"cdkOverlayOrigin\"] }, { kind: \"directive\", type: i5.InfiniteScrollDirective, selector: \"[infiniteScroll], [infinite-scroll], [data-infinite-scroll]\", inputs: [\"infiniteScrollDistance\", \"infiniteScrollUpDistance\", \"infiniteScrollThrottle\", \"infiniteScrollDisabled\", \"infiniteScrollContainer\", \"scrollWindow\", \"immediateCheck\", \"horizontal\", \"alwaysCallback\", \"fromRoot\"], outputs: [\"scrolled\", \"scrolledUp\"] }] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.6\", ngImport: i0, type: Select2, decorators: [{\n type: Component,\n args: [{ selector: 'select2', template: \"
    \\n \\n \\n
    \\n\\n \\n \\n \\n  \\n \\n \\n \\n \\n \\n \\n \\n {{\\n placeholder\\n }}\\n \\n \\u00D7\\n \\n
      \\n 0\\\"\\n class=\\\"select2-selection__placeholder\\\"\\n >{{ placeholder }}\\n \\n \\u00D7\\n \\n \\n \\n \\n \\n \\n \\n \\n
    \\n \\n \\n \\n \\n \\n\\n
    \\n \\n
    \\n\\n\\n\\n \\n\\n\\n\\n \\n \\n \\n
    \\n \\n \\n
  • \\n \\n \\n \\n \\n \\n\\n
      \\n \\n
  • \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
    \\n\", styles: [\".select2-label{color:var(--select2-label-text-color, #000)}.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;width:100%}.select2-container .select2-container-dropdown{position:absolute;width:0px;opacity:0}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:var(--select2-single-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding:var(--select2-selection-padding, 0 0 0 8px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:var(--select2-multiple-height, 28px);-webkit-user-select:none;user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-flex;overflow:hidden;padding-left:8px;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;flex-wrap:wrap;gap:var(--select2-selection-multiple-gap, 2px 5px)}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-selection__auto-create{flex:1 1 150px;min-width:150px;display:flex}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field{width:100%;border:0}.select2-container .select2-selection--multiple .select2-selection__rendered .select2-create__field:focus{border:0;outline:0}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background:var(--select2-dropdown-background, white);border:1px solid var(--select2-dropdown-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);box-sizing:border-box;display:block;position:absolute;width:100%;z-index:1051;height:0;overflow:hidden}.select2-dropdown .select2-label-content{display:contents}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:var(--select2-option-padding, 6px);-webkit-user-select:none;user-select:none;color:var(--select2-option-text-color, #000)}.select2-results__option[aria-selected]{cursor:pointer}.select2-container.select2-container-dropdown.select2-container--open{width:100%;opacity:1}.select2-container--open .select2-dropdown{overflow:auto;height:auto}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:27px;display:flex;flex-direction:column-reverse}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99}.select2-required:before{content:\\\"*\\\";color:var(--select2-required-color, red)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--default .select2-selection--single{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);display:flex}.select2-container--default .select2-selection--single .select2-selection__rendered{color:var(--select2-selection-text-color, #111);line-height:var(--select2-selection-line-height, 28px)}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:var(--select2-placeholder-color, #999)}.select2-container--default .select2-selection--single .select2-selection__placeholder span{overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--single .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--single .select2-selection__reset,.select2-container--default .select2-selection--single .select2-selection__arrow{display:flex;width:20px;align-items:center;justify-content:center}.select2-container--default .select2-selection--single .select2-selection__arrow:before{content:\\\" \\\";border-color:var(--select2-arrow-color, #888) transparent;border-style:solid;border-width:5px 4px 0;height:0;width:0}.select2-container--default .select2-selection--single .select2-selection__reset{color:var(--select2-reset-color, #999)}.select2-container--default.select2-container--disabled .select2-selection--single{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow:before{border-color:transparent transparent var(--select2-arrow-color, #888);border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background:var(--select2-selection-background, #fff);border:1px solid var(--select2-selection-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:text;display:flex}.select2-container--default .select2-selection--multiple .select2-selection__rendered{flex:1 1 auto;box-sizing:border-box;list-style:none;margin:0;padding:var(--select2-selection-multiple-padding, 2px 5px);width:100%;min-height:1em;align-items:center}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none;line-height:var(--select2-selection-choice-line-height, 20px)}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;width:100%;color:var(--select2-placeholder-color, #999);margin-top:5px;float:left;overflow:hidden;white-space:nowrap;text-overflow:var(--select2-placeholder-overflow, ellipsis)}.select2-container--default .select2-selection--multiple .select2-selection__placeholder__option{display:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{color:var(--select2-selection-choice-text-color, #000);background:var(--select2-selection-choice-background, #e4e4e4);border:1px solid var(--select2-selection-choice-border-color, #aaa);border-radius:var(--select2-selection-border-radius, 4px);cursor:default;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:var(--select2-selection-choice-close-color, #999);cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:var(--select2-selection-choice-hover-close-color, #333)}.select2-container--default.select2-container--focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,.select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:solid var(--select2-selection-focus-border-color, #000) 1px;outline:none}.select2-container--default.select2-container--disabled .select2-selection--multiple{background:var(--select2-selection-disabled-background, #eee);cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid var(--select2-search-border-color, #aaa);background:1px solid var(--select2-search-background, #fff);border-radius:var(--select2-search-border-radius, 0px)}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:none;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:var(--select2-option-disabled-text-color, #999);background:var(--select2-option-disabled-background, transparent)}.select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-option-selected-text-color, #000);background:var(--select2-option-selected-background, #ddd)}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-option-highlighted-background, #5897fb);color:var(--select2-option-highlighted-text-color, #fff)}.select2-container--default .select2-results__option--hide{display:none}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px;color:var(--select2-option-group-text-color, gray);background:var(--select2-option-group-background, transparent)}.select2-no-result{color:var(--select2-no-result-color, #888);font-style:var(--select2-no-result-font-style, italic)}.select2-too-much-result{color:var(--select2-too-much-result-color, #888);font-style:var(--select2-too-much-font-style, italic)}:host.nostyle .select2-dropdown{border-color:transparent}:host.nostyle .select2-selection--single,:host.nostyle .select2-selection--multiple{background:transparent;border-color:transparent}:host.nostyle .select2-container--default .select2-focused .select2-selection--single,:host.nostyle .select2-container--default .select2-focused .select2-selection--multiple,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--single,:host.nostyle .select2-container--default:not(.select2-container--open) .select2-focused .select2-selection--multiple{background:transparent;border-color:transparent}:host.material{display:inline-block;width:300px}:host.material>.select2-container{padding-bottom:1.29688em;vertical-align:inherit}:host.material>.select2-container .selection{padding:.4375em 0;border-top:.84375em solid transparent;display:inline-flex;align-items:baseline;width:100%;height:auto}:host.material .select2-container--default .select2-selection--single,:host.material .select2-container--default .select2-selection--multiple{width:100%;border:0;border-radius:0;height:24px;box-sizing:border-box}:host.material .select2-container--default .select2-selection--single:before,:host.material .select2-container--default .select2-selection--multiple:before{content:\\\" \\\";display:block;position:absolute;bottom:1.65em;background:var(--select2-material-underline, #ddd);height:1px;width:100%}:host.material .select2-container--default .select2-selection--single:after,:host.material .select2-container--default .select2-selection--multiple:after{content:\\\" \\\";display:block;position:absolute;bottom:1.63em;background:var(--select2-material-underline-active, #5a419e);height:2px;width:0%;left:50%;transition:none}:host.material .select2-container--default .select2-selection--single .select2-selection__rendered,:host.material .select2-container--default .select2-selection--multiple .select2-selection__rendered{padding-left:1px;line-height:inherit}:host.material .select2-container--default .select2-selection--single .select2-selection__placeholder,:host.material .select2-container--default .select2-selection--multiple .select2-selection__placeholder{display:block;color:var(--select2-material-placeholder-color, rgba(0, 0, 0, .38));transition:transform .3s;position:absolute;transform-origin:0 21px;left:0;top:20px}:host.material .select2-container--default .select2-container--open{left:0;bottom:1.6em}:host.material .select2-container--default .select2-selection__placeholder__option{transform:translateY(-1.5em) scale(.75) perspective(100px) translateZ(.001px);width:133.33333%}:host.material .select2-container--default .select2-selection__arrow{top:20px}:host.material .select2-container--default.select2-container--open .select2-selection--single:after,:host.material .select2-container--default.select2-container--open .select2-selection--multiple:after,:host.material .select2-container--default .select2-focused .select2-selection--single:after,:host.material .select2-container--default .select2-focused .select2-selection--multiple:after{transition:width .3s cubic-bezier(.12,1,.77,1),left .3s cubic-bezier(.12,1,.77,1);width:100%;left:0%}:host.material .select2-container--default .select2-dropdown{border-radius:0;border:0;box-shadow:0 5px 5px #00000080}:host.material .select2-container--default .select2-results__option[aria-selected=true],:host.material .select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--select2-material-option-selected-background, rgba(0, 0, 0, .04));color:var(--select2-material-option-highlighted-text-color, #000)}:host.material .select2-container--default .select2-results__option[aria-selected=true]{color:var(--select2-material-option-selected-text-color, #ff5722)}:host.material .select2-container--default.select2-container--disabled .select2-selection--single,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple{background:transparent}:host.material .select2-container--default.select2-container--disabled .select2-selection--single:before,:host.material .select2-container--default.select2-container--disabled .select2-selection--multiple:before{background:var(--select2-material-underline-disabled, linear-gradient(to right, rgba(0, 0, 0, .26) 0, rgba(0, 0, 0, .26) 33%, transparent 0));background-size:4px 1px;background-repeat:repeat-x;background-position:0 bottom}:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--single:after,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:before,:host.material.ng-invalid.ng-touched .select2-container--default .select2-selection--multiple:after{background:var(--select2-material-underline-invalid, red)}:host.material:not(.select2-container--open) .select2-focused .select2-selection--single,:host.material:not(.select2-container--open) .select2-focused .select2-selection--multiple{border:0}:host.material .select2-subscript-wrapper{position:absolute;top:calc(100% - 1.72917em);font-size:75%;color:var(--select2-hint-text-color, #888)}::ng-deep .select2-overlay-backdrop{background:var(--select2-overlay-backdrop, transparent)}::ng-deep .cdk-overlay-container .select2-container .select2-dropdown.select2-dropdown--above{bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown{margin-bottom:28px}::ng-deep .cdk-overlay-container .select2-container--open.select2-position-auto .select2-dropdown.select2-dropdown--above{bottom:0;margin-bottom:0;margin-top:28px}@supports (-moz-appearance: none){select2.material .select2-container--default .select2-selection--single,select2.material .select2-container--default .select2-selection--multiple{height:26px}}\\n\"] }]\n }], ctorParameters: function () { return [{ type: i1.ViewportRuler }, { type: i0.ChangeDetectorRef }, { type: i2.NgForm, decorators: [{\n type: Optional\n }] }, { type: i2.FormGroupDirective, decorators: [{\n type: Optional\n }] }, { type: i2.NgControl, decorators: [{\n type: Self\n }, {\n type: Optional\n }] }, { type: undefined, decorators: [{\n type: Attribute,\n args: ['tabindex']\n }] }]; }, propDecorators: { data: [{\n type: Input,\n args: [{ required: true }]\n }], minCharForSearch: [{\n type: Input,\n args: [{ transform: numberAttribute }]\n }], displaySearchStatus: [{\n type: Input\n }], placeholder: [{\n type: Input\n }], limitSelection: [{\n type: Input,\n args: [{ transform: numberAttribute }]\n }], listPosition: [{\n type: Input\n }], multiple: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], overlay: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], styleMode: [{\n type: Input\n }], noResultMessage: [{\n type: Input\n }], maxResults: [{\n type: Input,\n args: [{ transform: numberAttribute }]\n }], maxResultsMessage: [{\n type: Input\n }], infiniteScrollDistance: [{\n type: Input,\n args: [{ transform: numberAttribute }]\n }], infiniteScrollThrottle: [{\n type: Input,\n args: [{ transform: numberAttribute }]\n }], infiniteScroll: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], autoCreate: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], noLabelTemplate: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], editPattern: [{\n type: Input\n }], templates: [{\n type: Input\n }], resultMaxHeight: [{\n type: Input\n }], customSearchEnabled: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], minCountForSearch: [{\n type: Input,\n args: [{ transform: numberAttribute }]\n }], id: [{\n type: Input\n }, {\n type: HostBinding,\n args: ['id']\n }], required: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], disabled: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], hideSelectedItems: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], readonly: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], value: [{\n type: Input\n }], tabIndex: [{\n type: Input,\n args: [{ transform: numberAttribute }]\n }], resettable: [{\n type: Input,\n args: [{ transform: booleanAttribute }]\n }], resetSelectedValue: [{\n type: Input\n }], update: [{\n type: Output\n }], open: [{\n type: Output\n }], close: [{\n type: Output\n }], focus: [{\n type: Output\n }], blur: [{\n type: Output\n }], search: [{\n type: Output\n }], scroll: [{\n type: Output\n }], removeOption: [{\n type: Output\n }], ariaInvalid: [{\n type: HostBinding,\n args: ['attr.aria-invalid']\n }], classMaterial: [{\n type: HostBinding,\n args: ['class.material']\n }], classNostyle: [{\n type: HostBinding,\n args: ['class.nostyle']\n }], select2above: [{\n type: HostBinding,\n args: ['class.select2-above']\n }], cdkConnectedOverlay: [{\n type: ViewChild,\n args: [CdkConnectedOverlay]\n }], selection: [{\n type: ViewChild,\n args: ['selection', { static: true }]\n }], resultContainer: [{\n type: ViewChild,\n args: ['results']\n }], results: [{\n type: ViewChildren,\n args: ['result']\n }], searchInput: [{\n type: ViewChild,\n args: ['searchInput']\n }], dropdown: [{\n type: ViewChild,\n args: ['dropdown']\n }], clickDetection: [{\n type: HostListener,\n args: ['document:click', ['$event']]\n }] } });\n\nclass Select2Hint {\n /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.6\", ngImport: i0, type: Select2Hint, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.6\", type: Select2Hint, selector: \"select2-hint\", ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.6\", ngImport: i0, type: Select2Hint, decorators: [{\n type: Directive,\n args: [{ selector: 'select2-hint' }]\n }] });\n\nclass Select2Label {\n /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.6\", ngImport: i0, type: Select2Label, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.6\", type: Select2Label, selector: \"select2-label\", ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.6\", ngImport: i0, type: Select2Label, decorators: [{\n type: Directive,\n args: [{ selector: 'select2-label' }]\n }] });\n\nclass Select2Module {\n /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.6\", ngImport: i0, type: Select2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"16.1.6\", ngImport: i0, type: Select2Module, declarations: [Select2Hint, Select2Label, Select2], imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule], exports: [FormsModule, ReactiveFormsModule, Select2Hint, Select2Label, Select2] }); }\n /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"16.1.6\", ngImport: i0, type: Select2Module, imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule, FormsModule, ReactiveFormsModule] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.6\", ngImport: i0, type: Select2Module, decorators: [{\n type: NgModule,\n args: [{\n imports: [CommonModule, FormsModule, OverlayModule, ReactiveFormsModule, InfiniteScrollModule],\n declarations: [Select2Hint, Select2Label, Select2],\n exports: [FormsModule, ReactiveFormsModule, Select2Hint, Select2Label, Select2],\n }]\n }] });\n\n/*\n * Public API Surface of ng-select2-component\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { Select2, Select2Hint, Select2Label, Select2Module, Select2Utils, defaultMinCountForSearch, protectRegexp, timeout, unicodePatterns };\n","\n
    \n
    \n
    \n \n
    \n\n
    \n \n
    \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n\n \n
    \n
    \n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n EventEmitter,\n inject,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\nimport {FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms';\nimport {FilterStatement} from '../../../_models/metadata/v2/filter-statement';\nimport {BehaviorSubject, distinctUntilChanged, filter, map, Observable, of, startWith, switchMap, tap} from 'rxjs';\nimport {MetadataService} from 'src/app/_services/metadata.service';\nimport {mangaFormatFilters} from 'src/app/_models/metadata/series-filter';\nimport {PersonRole} from 'src/app/_models/metadata/person';\nimport {LibraryService} from 'src/app/_services/library.service';\nimport {CollectionTagService} from 'src/app/_services/collection-tag.service';\nimport {FilterComparison} from 'src/app/_models/metadata/v2/filter-comparison';\nimport {allFields, FilterField} from 'src/app/_models/metadata/v2/filter-field';\nimport {AsyncPipe, NgForOf, NgIf, NgSwitch, NgSwitchCase, NgTemplateOutlet} from \"@angular/common\";\nimport {FilterFieldPipe} from \"../../_pipes/filter-field.pipe\";\nimport {FilterComparisonPipe} from \"../../_pipes/filter-comparison.pipe\";\nimport {takeUntilDestroyed} from \"@angular/core/rxjs-interop\";\nimport {Select2Module, Select2Option} from \"ng-select2-component\";\nimport {TagBadgeComponent} from \"../../../shared/tag-badge/tag-badge.component\";\n\nenum PredicateType {\n Text = 1,\n Number = 2,\n Dropdown = 3,\n}\n\nconst StringFields = [FilterField.SeriesName, FilterField.Summary, FilterField.Path, FilterField.FilePath];\nconst NumberFields = [FilterField.ReadTime, FilterField.ReleaseYear, FilterField.ReadProgress, FilterField.UserRating];\nconst DropdownFields = [FilterField.PublicationStatus, FilterField.Languages, FilterField.AgeRating,\n FilterField.Translators, FilterField.Characters, FilterField.Publisher,\n FilterField.Editor, FilterField.CoverArtist, FilterField.Letterer,\n FilterField.Colorist, FilterField.Inker, FilterField.Penciller,\n FilterField.Writers, FilterField.Genres, FilterField.Libraries,\n FilterField.Formats, FilterField.CollectionTags, FilterField.Tags\n];\n\nconst DropdownFieldsWithoutMustContains = [\n FilterField.Libraries, FilterField.Formats, FilterField.AgeRating, FilterField.PublicationStatus\n];\nconst DropdownFieldsThatIncludeNumberComparisons = [\n FilterField.AgeRating\n];\nconst NumberFieldsThatIncludeDateComparisons = [\n FilterField.ReleaseYear\n];\n\nconst StringComparisons = [FilterComparison.Equal,\n FilterComparison.NotEqual,\n FilterComparison.BeginsWith,\n FilterComparison.EndsWith,\n FilterComparison.Matches];\nconst DateComparisons = [FilterComparison.IsBefore, FilterComparison.IsAfter, FilterComparison.IsInLast, FilterComparison.IsNotInLast];\nconst NumberComparisons = [FilterComparison.Equal,\n FilterComparison.NotEqual,\n FilterComparison.LessThan,\n FilterComparison.LessThanEqual,\n FilterComparison.GreaterThan,\n FilterComparison.GreaterThanEqual];\nconst DropdownComparisons = [FilterComparison.Equal,\n FilterComparison.NotEqual,\n FilterComparison.Contains,\n FilterComparison.NotContains,\n FilterComparison.MustContains];\n\n@Component({\n selector: 'app-metadata-row-filter',\n templateUrl: './metadata-filter-row.component.html',\n styleUrls: ['./metadata-filter-row.component.scss'],\n standalone: true,\n imports: [\n ReactiveFormsModule,\n AsyncPipe,\n FilterFieldPipe,\n FilterComparisonPipe,\n NgSwitch,\n NgSwitchCase,\n NgForOf,\n NgIf,\n Select2Module,\n NgTemplateOutlet,\n TagBadgeComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MetadataFilterRowComponent implements OnInit {\n\n @Input() index: number = 0; // This is only for debugging\n /**\n * Slightly misleading as this is the initial state and will be updated on the filterStatement event emitter\n */\n @Input() preset!: FilterStatement;\n @Input() availableFields: Array = allFields;\n @Output() filterStatement = new EventEmitter();\n\n private readonly cdRef = inject(ChangeDetectorRef);\n private readonly destroyRef = inject(DestroyRef);\n\n formGroup: FormGroup = new FormGroup({\n 'comparison': new FormControl(FilterComparison.Equal, []),\n 'filterValue': new FormControl('', []),\n });\n validComparisons$: BehaviorSubject = new BehaviorSubject([FilterComparison.Equal] as FilterComparison[]);\n predicateType$: BehaviorSubject = new BehaviorSubject(PredicateType.Text as PredicateType);\n dropdownOptions$ = of([]);\n\n loaded: boolean = false;\n protected readonly PredicateType = PredicateType;\n\n get MultipleDropdownAllowed() {\n const comp = parseInt(this.formGroup.get('comparison')?.value, 10) as FilterComparison;\n return comp === FilterComparison.Contains || comp === FilterComparison.NotContains || comp === FilterComparison.MustContains;\n }\n\n constructor(private readonly metadataService: MetadataService, private readonly libraryService: LibraryService,\n private readonly collectionTagService: CollectionTagService) {}\n\n ngOnInit() {\n this.formGroup.addControl('input', new FormControl(FilterField.SeriesName, []));\n\n this.formGroup.get('input')?.valueChanges.pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef)).subscribe((val: string) => this.handleFieldChange(val));\n this.populateFromPreset();\n\n this.formGroup.get('filterValue')?.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe();\n\n // Dropdown dynamic option selection\n this.dropdownOptions$ = this.formGroup.get('input')!.valueChanges.pipe(\n startWith(this.preset.value),\n distinctUntilChanged(),\n filter(() => {\n const inputVal = parseInt(this.formGroup.get('input')?.value, 10) as FilterField;\n return DropdownFields.includes(inputVal);\n }),\n switchMap((_) => this.getDropdownObservable()),\n takeUntilDestroyed(this.destroyRef)\n );\n\n\n this.formGroup!.valueChanges.pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef)).subscribe(_ => {\n const stmt = {\n comparison: parseInt(this.formGroup.get('comparison')?.value, 10) as FilterComparison,\n field: parseInt(this.formGroup.get('input')?.value, 10) as FilterField,\n value: this.formGroup.get('filterValue')?.value!\n };\n\n // Some ids can get through and be numbers, convert them to strings for the backend\n if (typeof stmt.value === 'number' && !Number.isNaN(stmt.value)) {\n stmt.value = stmt.value + '';\n }\n\n if (!stmt.value && stmt.field !== FilterField.SeriesName) return;\n this.filterStatement.emit(stmt);\n });\n\n this.loaded = true;\n this.cdRef.markForCheck();\n }\n\n\n\n populateFromPreset() {\n const val = this.preset.value === \"undefined\" || !this.preset.value ? '' : this.preset.value;\n this.formGroup.get('comparison')?.patchValue(this.preset.comparison);\n this.formGroup.get('input')?.patchValue(this.preset.field);\n\n if (StringFields.includes(this.preset.field)) {\n this.formGroup.get('filterValue')?.patchValue(val);\n } else if (DropdownFields.includes(this.preset.field)) {\n if (this.MultipleDropdownAllowed || val.includes(',')) {\n this.formGroup.get('filterValue')?.patchValue(val.split(',').map(d => parseInt(d, 10)));\n } else {\n if (this.preset.field === FilterField.Languages) {\n this.formGroup.get('filterValue')?.patchValue(val);\n } else {\n this.formGroup.get('filterValue')?.patchValue(parseInt(val, 10));\n }\n }\n } else {\n this.formGroup.get('filterValue')?.patchValue(parseInt(val, 10));\n }\n\n\n this.cdRef.markForCheck();\n }\n\n getDropdownObservable(): Observable {\n const filterField = parseInt(this.formGroup.get('input')?.value, 10) as FilterField;\n switch (filterField) {\n case FilterField.PublicationStatus:\n return this.metadataService.getAllPublicationStatus().pipe(map(pubs => pubs.map(pub => {\n return {value: pub.value, label: pub.title}\n })));\n case FilterField.AgeRating:\n return this.metadataService.getAllAgeRatings().pipe(map(ratings => ratings.map(rating => {\n return {value: rating.value, label: rating.title}\n })));\n case FilterField.Genres:\n return this.metadataService.getAllGenres().pipe(map(genres => genres.map(genre => {\n return {value: genre.id, label: genre.title}\n })));\n case FilterField.Languages:\n return this.metadataService.getAllLanguages().pipe(map(statuses => statuses.map(status => {\n return {value: status.isoCode, label: status.title + ` (${status.isoCode})`}\n })));\n case FilterField.Formats:\n return of(mangaFormatFilters).pipe(map(statuses => statuses.map(status => {\n return {value: status.value, label: status.title}\n })));\n case FilterField.Libraries:\n return this.libraryService.getLibraries().pipe(map(libs => libs.map(lib => {\n return {value: lib.id, label: lib.name}\n })));\n case FilterField.Tags:\n return this.metadataService.getAllTags().pipe(map(statuses => statuses.map(status => {\n return {value: status.id, label: status.title}\n })));\n case FilterField.CollectionTags:\n return this.collectionTagService.allTags().pipe(map(statuses => statuses.map(status => {\n return {value: status.id, label: status.title}\n })));\n case FilterField.Characters: return this.getPersonOptions(PersonRole.Character);\n case FilterField.Colorist: return this.getPersonOptions(PersonRole.Colorist);\n case FilterField.CoverArtist: return this.getPersonOptions(PersonRole.CoverArtist);\n case FilterField.Editor: return this.getPersonOptions(PersonRole.Editor);\n case FilterField.Inker: return this.getPersonOptions(PersonRole.Inker);\n case FilterField.Letterer: return this.getPersonOptions(PersonRole.Letterer);\n case FilterField.Penciller: return this.getPersonOptions(PersonRole.Penciller);\n case FilterField.Publisher: return this.getPersonOptions(PersonRole.Publisher);\n case FilterField.Translators: return this.getPersonOptions(PersonRole.Translator);\n case FilterField.Writers: return this.getPersonOptions(PersonRole.Writer);\n }\n return of([]);\n }\n\n getPersonOptions(role: PersonRole) {\n return this.metadataService.getAllPeopleByRole(role).pipe(map(people => people.map(person => {\n return {value: person.id, label: person.name}\n })));\n }\n\n\n handleFieldChange(val: string) {\n const inputVal = parseInt(val, 10) as FilterField;\n\n if (StringFields.includes(inputVal)) {\n this.validComparisons$.next(StringComparisons);\n this.predicateType$.next(PredicateType.Text);\n\n if (this.loaded) {\n this.formGroup.get('filterValue')?.patchValue('');\n }\n return;\n }\n\n if (NumberFields.includes(inputVal)) {\n const comps = [...NumberComparisons];\n if (NumberFieldsThatIncludeDateComparisons.includes(inputVal)) {\n comps.push(...DateComparisons);\n }\n this.validComparisons$.next(comps);\n this.predicateType$.next(PredicateType.Number);\n if (this.loaded) this.formGroup.get('filterValue')?.patchValue(0);\n return;\n }\n\n if (DropdownFields.includes(inputVal)) {\n let comps = [...DropdownComparisons];\n if (DropdownFieldsThatIncludeNumberComparisons.includes(inputVal)) {\n comps.push(...NumberComparisons);\n }\n if (DropdownFieldsWithoutMustContains.includes(inputVal)) {\n comps = comps.filter(c => c !== FilterComparison.MustContains);\n }\n this.validComparisons$.next(comps);\n this.predicateType$.next(PredicateType.Dropdown);\n if (this.loaded) this.formGroup.get('filterValue')?.patchValue(0);\n return;\n }\n }\n\n}\n","\n \n
    \n \n
    \n
    \n
    \n \n
    \n\n
    \n \n
    \n
    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \n\n
    \n
    \n
    \n\n \n
    \n
    \n
    \n \n
    \n\n
    \n \n
    \n
    \n
    \n
    \n \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n\n
    \n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component, DestroyRef,\n EventEmitter,\n inject,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport {MetadataService} from 'src/app/_services/metadata.service';\nimport {Breakpoint, UtilityService} from 'src/app/shared/_services/utility.service';\nimport {SeriesFilterV2} from 'src/app/_models/metadata/v2/series-filter-v2';\nimport {NgForOf, NgIf, UpperCasePipe} from \"@angular/common\";\nimport {MetadataFilterRowComponent} from \"../metadata-filter-row/metadata-filter-row.component\";\nimport {FilterStatement} from \"../../../_models/metadata/v2/filter-statement\";\nimport {CardActionablesComponent} from \"../../../_single-module/card-actionables/card-actionables.component\";\nimport {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from \"@angular/forms\";\nimport {NgbTooltip} from \"@ng-bootstrap/ng-bootstrap\";\nimport {FilterCombination} from \"../../../_models/metadata/v2/filter-combination\";\nimport {FilterUtilitiesService} from \"../../../shared/_services/filter-utilities.service\";\nimport {allFields} from \"../../../_models/metadata/v2/filter-field\";\nimport {takeUntilDestroyed} from \"@angular/core/rxjs-interop\";\nimport {distinctUntilChanged, tap} from \"rxjs/operators\";\nimport {translate, TranslocoDirective} from \"@ngneat/transloco\";\n\n@Component({\n selector: 'app-metadata-builder',\n templateUrl: './metadata-builder.component.html',\n styleUrls: ['./metadata-builder.component.scss'],\n standalone: true,\n imports: [\n NgIf,\n MetadataFilterRowComponent,\n NgForOf,\n CardActionablesComponent,\n FormsModule,\n NgbTooltip,\n UpperCasePipe,\n ReactiveFormsModule,\n TranslocoDirective\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MetadataBuilderComponent implements OnInit {\n\n @Input({required: true}) filter!: SeriesFilterV2;\n /**\n * The number of statements that can be. 0 means unlimited. -1 means none.\n */\n @Input() statementLimit = 0;\n @Input() availableFilterFields = allFields;\n @Output() update: EventEmitter = new EventEmitter();\n @Output() apply: EventEmitter = new EventEmitter();\n\n private readonly cdRef = inject(ChangeDetectorRef);\n private readonly metadataService = inject(MetadataService);\n protected readonly utilityService = inject(UtilityService);\n protected readonly filterUtilityService = inject(FilterUtilitiesService);\n private readonly destroyRef = inject(DestroyRef);\n protected readonly Breakpoint = Breakpoint;\n\n formGroup: FormGroup = new FormGroup({});\n\n groupOptions: Array<{value: FilterCombination, title: string}> = [\n {value: FilterCombination.Or, title: translate('metadata-builder.or')},\n {value: FilterCombination.And, title: translate('metadata-builder.and')},\n ];\n\n ngOnInit() {\n this.formGroup.addControl('comparison', new FormControl(this.filter?.combination || FilterCombination.Or, []));\n this.formGroup.valueChanges.pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef), tap(values => {\n this.filter.combination = parseInt(this.formGroup.get('comparison')?.value, 10) as FilterCombination;\n this.update.emit(this.filter);\n })).subscribe();\n }\n\n addFilter() {\n this.filter.statements = [this.metadataService.createDefaultFilterStatement(), ...this.filter.statements];\n this.cdRef.markForCheck();\n }\n\n removeFilter(index: number) {\n this.filter.statements = this.filter.statements.slice(0, index).concat(this.filter.statements.slice(index + 1))\n this.cdRef.markForCheck();\n }\n\n updateFilter(index: number, filterStmt: FilterStatement) {\n this.metadataService.updateFilter(this.filter.statements, index, filterStmt);\n this.update.emit(this.filter);\n }\n\n}\n","\n \n
    Breakpoint.Tablet\">\n
    \n \n
    \n
    \n\n
    \n \n
    \n {{t('filter-title')}}\n
    \n
    \n \n \n
    \n
    \n
    \n
    \n\n \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n \n \n \n
    \n Breakpoint.Tablet\" [ngTemplateOutlet]=\"buttons\">\n
    \n
    \n \n
    \n
    \n
    \n
    \n \n \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n\n\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n DestroyRef,\n EventEmitter,\n inject,\n Input,\n OnInit,\n Output\n} from '@angular/core';\nimport {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {NgbCollapse, NgbRating, NgbTooltip} from '@ng-bootstrap/ng-bootstrap';\nimport {FilterUtilitiesService} from '../shared/_services/filter-utilities.service';\nimport {Breakpoint, UtilityService} from '../shared/_services/utility.service';\nimport {Library} from '../_models/library';\nimport {allSortFields, FilterEvent, FilterItem, SortField} from '../_models/metadata/series-filter';\nimport {ToggleService} from '../_services/toggle.service';\nimport {FilterSettings} from './filter-settings';\nimport {SeriesFilterV2} from '../_models/metadata/v2/series-filter-v2';\nimport {takeUntilDestroyed} from \"@angular/core/rxjs-interop\";\nimport {TypeaheadComponent} from '../typeahead/_components/typeahead.component';\nimport {DrawerComponent} from '../shared/drawer/drawer.component';\nimport {AsyncPipe, NgForOf, NgIf, NgTemplateOutlet} from '@angular/common';\nimport {TranslocoModule} from \"@ngneat/transloco\";\nimport {SortFieldPipe} from \"../pipe/sort-field.pipe\";\nimport {MetadataBuilderComponent} from \"./_components/metadata-builder/metadata-builder.component\";\nimport {allFields} from \"../_models/metadata/v2/filter-field\";\n\n@Component({\n selector: 'app-metadata-filter',\n templateUrl: './metadata-filter.component.html',\n styleUrls: ['./metadata-filter.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [NgIf, NgbCollapse, NgTemplateOutlet, DrawerComponent, NgbTooltip, TypeaheadComponent,\n ReactiveFormsModule, FormsModule, NgbRating, AsyncPipe, TranslocoModule, SortFieldPipe, MetadataBuilderComponent, NgForOf]\n})\nexport class MetadataFilterComponent implements OnInit {\n\n /**\n * This toggles the opening/collapsing of the metadata filter code\n */\n @Input() filterOpen: EventEmitter = new EventEmitter();\n\n /**\n * Should filtering be shown on the page\n */\n @Input() filteringDisabled: boolean = false;\n\n @Input({required: true}) filterSettings!: FilterSettings;\n\n @Output() applyFilter: EventEmitter = new EventEmitter();\n\n @ContentChild('[ngbCollapse]') collapse!: NgbCollapse;\n private readonly destroyRef = inject(DestroyRef);\n public readonly utilityService = inject(UtilityService);\n\n\n /**\n * Controls the visibility of extended controls that sit below the main header.\n */\n filteringCollapsed: boolean = true;\n\n libraries: Array> = [];\n\n sortGroup!: FormGroup;\n isAscendingSort: boolean = true;\n\n updateApplied: number = 0;\n\n fullyLoaded: boolean = false;\n filterV2: SeriesFilterV2 | undefined;\n allSortFields = allSortFields;\n allFilterFields = allFields;\n\n handleFilters(filter: SeriesFilterV2) {\n this.filterV2 = filter;\n }\n\n\n private readonly cdRef = inject(ChangeDetectorRef);\n\n\n constructor(public toggleService: ToggleService) {}\n\n ngOnInit(): void {\n if (this.filterSettings === undefined) {\n this.filterSettings = new FilterSettings();\n this.cdRef.markForCheck();\n }\n\n if (this.filterOpen) {\n this.filterOpen.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(openState => {\n this.filteringCollapsed = !openState;\n this.toggleService.set(!this.filteringCollapsed);\n this.cdRef.markForCheck();\n });\n }\n\n this.loadFromPresetsAndSetup();\n }\n\n close() {\n this.filterOpen.emit(false);\n this.filteringCollapsed = true;\n this.toggleService.set(!this.filteringCollapsed);\n this.cdRef.markForCheck();\n }\n\n deepClone(obj: any): any {\n if (obj === null || typeof obj !== 'object') {\n return obj;\n }\n\n if (obj instanceof Array) {\n return obj.map(item => this.deepClone(item));\n }\n\n const clonedObj: any = {};\n\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n if (typeof obj[key] === 'object' && obj[key] !== null) {\n clonedObj[key] = this.deepClone(obj[key]);\n } else {\n clonedObj[key] = obj[key];\n }\n }\n }\n\n return clonedObj;\n }\n\n\n loadFromPresetsAndSetup() {\n this.fullyLoaded = false;\n\n this.filterV2 = this.deepClone(this.filterSettings.presetsV2);\n\n this.sortGroup = new FormGroup({\n sortField: new FormControl({value: this.filterV2?.sortOptions?.sortField || SortField.SortName, disabled: this.filterSettings.sortDisabled}, []),\n limitTo: new FormControl(this.filterV2?.limitTo || 0, [])\n });\n\n this.sortGroup.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n if (this.filterV2?.sortOptions === null) {\n this.filterV2.sortOptions = {\n isAscending: this.isAscendingSort,\n sortField: parseInt(this.sortGroup.get('sortField')?.value, 10)\n };\n }\n this.filterV2!.sortOptions!.sortField = parseInt(this.sortGroup.get('sortField')?.value, 10);\n this.filterV2!.limitTo = Math.max(parseInt(this.sortGroup.get('limitTo')?.value || '0', 10), 0);\n this.cdRef.markForCheck();\n });\n\n this.fullyLoaded = true;\n this.apply();\n }\n\n\n updateSortOrder() {\n if (this.filterSettings.sortDisabled) return;\n this.isAscendingSort = !this.isAscendingSort;\n if (this.filterV2?.sortOptions === null) {\n this.filterV2.sortOptions = {\n isAscending: this.isAscendingSort,\n sortField: SortField.SortName\n }\n }\n\n this.filterV2!.sortOptions!.isAscending = this.isAscendingSort;\n }\n\n clear() {\n // Apply any presets which will trigger the \"apply\"\n this.loadFromPresetsAndSetup();\n }\n\n apply() {\n this.applyFilter.emit({isFirst: this.updateApplied === 0, filterV2: this.filterV2!});\n\n if (this.utilityService.getActiveBreakpoint() === Breakpoint.Mobile && this.updateApplied !== 0) {\n this.toggleSelected();\n }\n\n this.updateApplied++;\n this.cdRef.markForCheck();\n }\n\n toggleSelected() {\n this.toggleService.toggle();\n this.cdRef.markForCheck();\n }\n\n setToggle(event: any) {\n this.toggleService.set(!this.filteringCollapsed);\n }\n\n protected readonly Breakpoint = Breakpoint;\n}\n","\n\n
    0\">\n
    \n

    \n 0\" class=\"\">\n  \n \n 0\">\n {{header}} \n {{pagination.totalItems}}\n \n

    \n
    \n
    \n \n
    \n
    \n
    \n

    \n \n

    \n \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n\n = 4 && items.length > 0 && scroll.viewPortInfo.maxScrollPosition > 0\" [ngTemplateOutlet]=\"jumpBar\" [ngTemplateOutletContext]=\"{ id: 'jumpbar' }\">\n
    \n \n \n
    \n
    \n \n
    \n
    \n
    \n\n
    \n

    \n \n

    \n
    \n
    \n\n \n\n \n
    \n \n \n \n
    \n
    \n
    \n","import {CdkVirtualScrollViewport} from '@angular/cdk/scrolling';\nimport {CommonModule, DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n HostListener,\n inject,\n Inject,\n Input,\n OnChanges,\n OnInit,\n Output,\n TemplateRef,\n TrackByFunction,\n ViewChild\n} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {VirtualScrollerComponent, VirtualScrollerModule} from '@iharbeck/ngx-virtual-scroller';\nimport {FilterSettings} from 'src/app/metadata-filter/filter-settings';\nimport {FilterUtilitiesService} from 'src/app/shared/_services/filter-utilities.service';\nimport {Breakpoint, UtilityService} from 'src/app/shared/_services/utility.service';\nimport {JumpKey} from 'src/app/_models/jumpbar/jump-key';\nimport {Library} from 'src/app/_models/library';\nimport {Pagination} from 'src/app/_models/pagination';\nimport {FilterEvent, FilterItem, SortField} from 'src/app/_models/metadata/series-filter';\nimport {ActionItem} from 'src/app/_services/action-factory.service';\nimport {JumpbarService} from 'src/app/_services/jumpbar.service';\nimport {ScrollService} from 'src/app/_services/scroll.service';\nimport {LoadingComponent} from \"../../shared/loading/loading.component\";\n\n\nimport {NgbTooltip} from \"@ng-bootstrap/ng-bootstrap\";\nimport {MetadataFilterComponent} from \"../../metadata-filter/metadata-filter.component\";\nimport {TranslocoDirective} from \"@ngneat/transloco\";\nimport {CardActionablesComponent} from \"../../_single-module/card-actionables/card-actionables.component\";\nimport {SeriesFilterV2} from \"../../_models/metadata/v2/series-filter-v2\";\n\n@Component({\n selector: 'app-card-detail-layout',\n standalone: true,\n imports: [CommonModule, LoadingComponent, VirtualScrollerModule, CardActionablesComponent, NgbTooltip, MetadataFilterComponent, TranslocoDirective],\n templateUrl: './card-detail-layout.component.html',\n styleUrls: ['./card-detail-layout.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CardDetailLayoutComponent implements OnInit, OnChanges {\n\n @Input() header: string = '';\n @Input() isLoading: boolean = false;\n @Input() items: any[] = [];\n @Input() pagination!: Pagination;\n /**\n * Parent scroll for virtualize pagination\n */\n @Input() parentScroll!: Element | Window;\n\n // Filter Code\n @Input() filterOpen!: EventEmitter;\n /**\n * Should filtering be shown on the page\n */\n @Input() filteringDisabled: boolean = false;\n /**\n * Any actions to exist on the header for the parent collection (library, collection)\n */\n @Input() actions: ActionItem[] = [];\n /**\n * A trackBy to help with rendering. This is required as without it there are issues when scrolling\n */\n @Input({required: true}) trackByIdentity!: TrackByFunction;\n @Input() filterSettings!: FilterSettings;\n @Input() refresh!: EventEmitter;\n\n\n @Input() jumpBarKeys: Array = []; // This is approx 784 pixels tall, original keys\n jumpBarKeysToRender: Array = []; // What is rendered on screen\n\n @Output() itemClicked: EventEmitter = new EventEmitter();\n @Output() applyFilter: EventEmitter = new EventEmitter();\n\n @ContentChild('cardItem') itemTemplate!: TemplateRef;\n @ContentChild('noData') noDataTemplate!: TemplateRef;\n @ViewChild('.jump-bar') jumpBar!: ElementRef;\n @ViewChild('scroller') scroller!: CdkVirtualScrollViewport;\n\n @ViewChild(VirtualScrollerComponent) private virtualScroller!: VirtualScrollerComponent;\n\n private readonly filterUtilityService = inject(FilterUtilitiesService);\n filter: SeriesFilterV2 = this.filterUtilityService.createSeriesV2Filter();\n libraries: Array> = [];\n\n updateApplied: number = 0;\n hasResumedJumpKey: boolean = false;\n\n\n get Breakpoint() {\n return Breakpoint;\n }\n\n constructor(public utilityService: UtilityService,\n @Inject(DOCUMENT) private document: Document, private cdRef: ChangeDetectorRef,\n private jumpbarService: JumpbarService, private router: Router, private scrollService: ScrollService) {\n }\n\n @HostListener('window:resize', ['$event'])\n @HostListener('window:orientationchange', ['$event'])\n resizeJumpBar() {\n const currentSize = (this.document.querySelector('.viewport-container')?.getBoundingClientRect().height || 10) - 30;\n this.jumpBarKeysToRender = this.jumpbarService.generateJumpBar(this.jumpBarKeys, currentSize);\n this.cdRef.markForCheck();\n }\n\n ngOnInit(): void {\n if (this.trackByIdentity === undefined) {\n this.trackByIdentity = (_: number, item: any) => `${this.header}_${this.updateApplied}_${item?.libraryId}`;\n }\n\n if (this.filterSettings === undefined) {\n this.filterSettings = new FilterSettings();\n this.cdRef.markForCheck();\n }\n\n if (this.pagination === undefined) {\n this.pagination = {currentPage: 1, itemsPerPage: this.items.length, totalItems: this.items.length, totalPages: 1};\n this.cdRef.markForCheck();\n }\n\n if (this.refresh) {\n this.refresh.subscribe(() => {\n this.cdRef.markForCheck();\n this.virtualScroller.refresh();\n });\n }\n }\n\n\n ngOnChanges(): void {\n this.jumpBarKeysToRender = [...this.jumpBarKeys];\n this.resizeJumpBar();\n\n // Don't resume jump key when there is a custom sort order, as it won't work\n if (!this.hasCustomSort()) {\n if (!this.hasResumedJumpKey && this.jumpBarKeysToRender.length > 0) {\n const resumeKey = this.jumpbarService.getResumeKey(this.router.url);\n if (resumeKey === '') return;\n const keys = this.jumpBarKeysToRender.filter(k => k.key === resumeKey);\n if (keys.length < 1) return;\n\n this.hasResumedJumpKey = true;\n setTimeout(() => this.scrollTo(keys[0]), 100);\n }\n } else {\n // I will come back and refactor this to work\n // const scrollPosition = this.jumpbarService.getResumePosition(this.router.url);\n // console.log('scroll position: ', scrollPosition);\n // if (scrollPosition > 0) {\n // setTimeout(() => this.virtualScroller.scrollToIndex(scrollPosition, true, 0, 1000), 100);\n // }\n }\n }\n\n hasCustomSort() {\n return this.filter?.sortOptions?.sortField != SortField.SortName || !this.filter?.sortOptions.isAscending\n || this.filterSettings?.presetsV2?.sortOptions?.sortField != SortField.SortName || !this.filterSettings?.presetsV2?.sortOptions?.isAscending;\n }\n\n performAction(action: ActionItem) {\n if (typeof action.callback === 'function') {\n action.callback(action, undefined);\n }\n }\n\n applyMetadataFilter(event: FilterEvent) {\n this.applyFilter.emit(event);\n this.updateApplied++;\n this.filter = event.filterV2;\n this.cdRef.markForCheck();\n }\n\n\n scrollTo(jumpKey: JumpKey) {\n if (this.hasCustomSort()) return;\n\n let targetIndex = 0;\n for(let i = 0; i < this.jumpBarKeys.length; i++) {\n if (this.jumpBarKeys[i].key === jumpKey.key) break;\n targetIndex += this.jumpBarKeys[i].size;\n }\n\n this.virtualScroller.scrollToIndex(targetIndex, true, 0, 1000);\n this.jumpbarService.saveResumeKey(this.router.url, jumpKey.key);\n // TODO: This doesn't work, we need the offset from virtual scroller\n this.jumpbarService.saveScrollOffset(this.router.url, this.scrollService.scrollPosition);\n this.cdRef.markForCheck();\n }\n\n tryToSaveJumpKey(item: any) {\n let name = '';\n if (item.hasOwnProperty('name')) {\n name = item.name;\n } else if (item.hasOwnProperty('title')) {\n name = item.title;\n }\n this.jumpbarService.saveResumeKey(this.router.url, name.charAt(0));\n }\n}\n","import { SeriesFilterV2 } from \"../_models/metadata/v2/series-filter-v2\";\n\nexport class FilterSettings {\n sortDisabled = false;\n presetsV2: SeriesFilterV2 | undefined;\n /**\n * The number of statements that can be on the filter. Set to 1 to disable adding more.\n */\n statementLimit: number = 0;\n }\n","\n
    \n
    \n
    \n \n
    \n \n
    \n
    \n \n
    \n\n
    \n \n
    \n
    \n \n
    \n
    \n","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';\nimport {CommonModule} from \"@angular/common\";\nimport {TranslocoDirective} from \"@ngneat/transloco\";\n\nexport class DrawerOptions {\n /**\n * Pixels to offset from the top of the screen. Only applies to postion left/right\n */\n topOffset: number = 0;\n}\n\n@Component({\n selector: 'app-drawer',\n standalone: true,\n imports: [CommonModule, TranslocoDirective],\n templateUrl: './drawer.component.html',\n styleUrls: ['./drawer.component.scss'],\n exportAs: \"drawer\",\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DrawerComponent {\n @Input() isOpen = false;\n @Input() width: number = 400;\n /**\n * Side of the screen the drawer should animate from\n */\n @Input() position: 'start' | 'end' | 'bottom' | 'top' = 'start';\n @Input() options: Partial = new DrawerOptions();\n @Output() drawerClosed = new EventEmitter();\n @Output() isOpenChange: EventEmitter = new EventEmitter();\n\n constructor(private readonly cdRef: ChangeDetectorRef) {}\n\n close() {\n this.isOpen = false;\n this.isOpenChange.emit(false);\n this.drawerClosed.emit(false);\n this.cdRef.markForCheck();\n }\n}\n","import { Subscription } from '../Subscription';\nexport const animationFrameProvider = {\n schedule(callback) {\n let request = requestAnimationFrame;\n let cancel = cancelAnimationFrame;\n const { delegate } = animationFrameProvider;\n if (delegate) {\n request = delegate.requestAnimationFrame;\n cancel = delegate.cancelAnimationFrame;\n }\n const handle = request((timestamp) => {\n cancel = undefined;\n callback(timestamp);\n });\n return new Subscription(() => cancel === null || cancel === void 0 ? void 0 : cancel(handle));\n },\n requestAnimationFrame(...args) {\n const { delegate } = animationFrameProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.requestAnimationFrame) || requestAnimationFrame)(...args);\n },\n cancelAnimationFrame(...args) {\n const { delegate } = animationFrameProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.cancelAnimationFrame) || cancelAnimationFrame)(...args);\n },\n delegate: undefined,\n};\n","import { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nexport const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);\nexport const animationFrame = animationFrameScheduler;\n","import { AsyncScheduler } from './AsyncScheduler';\nexport class AnimationFrameScheduler extends AsyncScheduler {\n flush(action) {\n this._active = true;\n const flushId = this._scheduled;\n this._scheduled = undefined;\n const { actions } = this;\n let error;\n action = action || actions.shift();\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions[0]) && action.id === flushId && actions.shift());\n this._active = false;\n if (error) {\n while ((action = actions[0]) && action.id === flushId && actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AsyncAction } from './AsyncAction';\nimport { animationFrameProvider } from './animationFrameProvider';\nexport class AnimationFrameAction extends AsyncAction {\n constructor(scheduler, work) {\n super(scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n }\n requestAsyncId(scheduler, id, delay = 0) {\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider.requestAnimationFrame(() => scheduler.flush(undefined)));\n }\n recycleAsyncId(scheduler, id, delay = 0) {\n var _a;\n if (delay != null ? delay > 0 : this.delay > 0) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n const { actions } = scheduler;\n if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {\n animationFrameProvider.cancelAnimationFrame(id);\n scheduler._scheduled = undefined;\n }\n return undefined;\n }\n}\n","import * as i0 from '@angular/core';\nimport { InjectionToken, inject, EventEmitter, Injectable, Optional, Inject, Directive, Output, Input, NgModule } from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\n\n/**\n * Injection token used to inject the document into Directionality.\n * This is used so that the value can be faked in tests.\n *\n * We can't use the real document in tests because changing the real `dir` causes geometry-based\n * tests in Safari to fail.\n *\n * We also can't re-provide the DOCUMENT token from platform-browser because the unit tests\n * themselves use things like `querySelector` in test code.\n *\n * This token is defined in a separate file from Directionality as a workaround for\n * https://github.com/angular/angular/issues/22559\n *\n * @docs-private\n */\nconst DIR_DOCUMENT = new InjectionToken('cdk-dir-doc', {\n providedIn: 'root',\n factory: DIR_DOCUMENT_FACTORY,\n});\n/** @docs-private */\nfunction DIR_DOCUMENT_FACTORY() {\n return inject(DOCUMENT);\n}\n\n/** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */\nconst RTL_LOCALE_PATTERN = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;\n/** Resolves a string value to a specific direction. */\nfunction _resolveDirectionality(rawValue) {\n const value = rawValue?.toLowerCase() || '';\n if (value === 'auto' && typeof navigator !== 'undefined' && navigator?.language) {\n return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr';\n }\n return value === 'rtl' ? 'rtl' : 'ltr';\n}\n/**\n * The directionality (LTR / RTL) context for the application (or a subtree of it).\n * Exposes the current direction and a stream of direction changes.\n */\nclass Directionality {\n constructor(_document) {\n /** The current 'ltr' or 'rtl' value. */\n this.value = 'ltr';\n /** Stream that emits whenever the 'ltr' / 'rtl' state changes. */\n this.change = new EventEmitter();\n if (_document) {\n const bodyDir = _document.body ? _document.body.dir : null;\n const htmlDir = _document.documentElement ? _document.documentElement.dir : null;\n this.value = _resolveDirectionality(bodyDir || htmlDir || 'ltr');\n }\n }\n ngOnDestroy() {\n this.change.complete();\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Directionality, deps: [{ token: DIR_DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Directionality, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Directionality, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [DIR_DOCUMENT]\n }] }]; } });\n\n/**\n * Directive to listen for changes of direction of part of the DOM.\n *\n * Provides itself as Directionality such that descendant directives only need to ever inject\n * Directionality to get the closest direction.\n */\nclass Dir {\n constructor() {\n /** Normalized direction that accounts for invalid/unsupported values. */\n this._dir = 'ltr';\n /** Whether the `value` has been set to its initial value. */\n this._isInitialized = false;\n /** Event emitted when the direction changes. */\n this.change = new EventEmitter();\n }\n /** @docs-private */\n get dir() {\n return this._dir;\n }\n set dir(value) {\n const previousValue = this._dir;\n // Note: `_resolveDirectionality` resolves the language based on the browser's language,\n // whereas the browser does it based on the content of the element. Since doing so based\n // on the content can be expensive, for now we're doing the simpler matching.\n this._dir = _resolveDirectionality(value);\n this._rawDir = value;\n if (previousValue !== this._dir && this._isInitialized) {\n this.change.emit(this._dir);\n }\n }\n /** Current layout direction of the element. */\n get value() {\n return this.dir;\n }\n /** Initialize once default value has been set. */\n ngAfterContentInit() {\n this._isInitialized = true;\n }\n ngOnDestroy() {\n this.change.complete();\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Dir, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.1\", type: Dir, selector: \"[dir]\", inputs: { dir: \"dir\" }, outputs: { change: \"dirChange\" }, host: { properties: { \"attr.dir\": \"_rawDir\" } }, providers: [{ provide: Directionality, useExisting: Dir }], exportAs: [\"dir\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Dir, decorators: [{\n type: Directive,\n args: [{\n selector: '[dir]',\n providers: [{ provide: Directionality, useExisting: Dir }],\n host: { '[attr.dir]': '_rawDir' },\n exportAs: 'dir',\n }]\n }], propDecorators: { change: [{\n type: Output,\n args: ['dirChange']\n }], dir: [{\n type: Input\n }] } });\n\nclass BidiModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: BidiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"16.1.1\", ngImport: i0, type: BidiModule, declarations: [Dir], exports: [Dir] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: BidiModule }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: BidiModule, decorators: [{\n type: NgModule,\n args: [{\n exports: [Dir],\n declarations: [Dir],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { BidiModule, DIR_DOCUMENT, Dir, Directionality };\n","import { ElementRef } from '@angular/core';\n\n/** Coerces a data-bound value (typically a string) to a boolean. */\nfunction coerceBooleanProperty(value) {\n return value != null && `${value}` !== 'false';\n}\n\nfunction coerceNumberProperty(value, fallbackValue = 0) {\n return _isNumberValue(value) ? Number(value) : fallbackValue;\n}\n/**\n * Whether the provided value is considered a number.\n * @docs-private\n */\nfunction _isNumberValue(value) {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value)) && !isNaN(Number(value));\n}\n\nfunction coerceArray(value) {\n return Array.isArray(value) ? value : [value];\n}\n\n/** Coerces a value to a CSS pixel value. */\nfunction coerceCssPixelValue(value) {\n if (value == null) {\n return '';\n }\n return typeof value === 'string' ? value : `${value}px`;\n}\n\n/**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\nfunction coerceElement(elementOrRef) {\n return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n}\n\n/**\n * Coerces a value to an array of trimmed non-empty strings.\n * Any input that is not an array, `null` or `undefined` will be turned into a string\n * via `toString()` and subsequently split with the given separator.\n * `null` and `undefined` will result in an empty array.\n * This results in the following outcomes:\n * - `null` -> `[]`\n * - `[null]` -> `[\"null\"]`\n * - `[\"a\", \"b \", \" \"]` -> `[\"a\", \"b\"]`\n * - `[1, [2, 3]]` -> `[\"1\", \"2,3\"]`\n * - `[{ a: 0 }]` -> `[\"[object Object]\"]`\n * - `{ a: 0 }` -> `[\"[object\", \"Object]\"]`\n *\n * Useful for defining CSS classes or table columns.\n * @param value the value to coerce into an array of strings\n * @param separator split-separator if value isn't an array\n */\nfunction coerceStringArray(value, separator = /\\s+/) {\n const result = [];\n if (value != null) {\n const sourceValues = Array.isArray(value) ? value : `${value}`.split(separator);\n for (const sourceValue of sourceValues) {\n const trimmedString = `${sourceValue}`.trim();\n if (trimmedString) {\n result.push(trimmedString);\n }\n }\n }\n return result;\n}\n\nexport { _isNumberValue, coerceArray, coerceBooleanProperty, coerceCssPixelValue, coerceElement, coerceNumberProperty, coerceStringArray };\n","const MAC_ENTER = 3;\nconst BACKSPACE = 8;\nconst TAB = 9;\nconst NUM_CENTER = 12;\nconst ENTER = 13;\nconst SHIFT = 16;\nconst CONTROL = 17;\nconst ALT = 18;\nconst PAUSE = 19;\nconst CAPS_LOCK = 20;\nconst ESCAPE = 27;\nconst SPACE = 32;\nconst PAGE_UP = 33;\nconst PAGE_DOWN = 34;\nconst END = 35;\nconst HOME = 36;\nconst LEFT_ARROW = 37;\nconst UP_ARROW = 38;\nconst RIGHT_ARROW = 39;\nconst DOWN_ARROW = 40;\nconst PLUS_SIGN = 43;\nconst PRINT_SCREEN = 44;\nconst INSERT = 45;\nconst DELETE = 46;\nconst ZERO = 48;\nconst ONE = 49;\nconst TWO = 50;\nconst THREE = 51;\nconst FOUR = 52;\nconst FIVE = 53;\nconst SIX = 54;\nconst SEVEN = 55;\nconst EIGHT = 56;\nconst NINE = 57;\nconst FF_SEMICOLON = 59; // Firefox (Gecko) fires this for semicolon instead of 186\nconst FF_EQUALS = 61; // Firefox (Gecko) fires this for equals instead of 187\nconst QUESTION_MARK = 63;\nconst AT_SIGN = 64;\nconst A = 65;\nconst B = 66;\nconst C = 67;\nconst D = 68;\nconst E = 69;\nconst F = 70;\nconst G = 71;\nconst H = 72;\nconst I = 73;\nconst J = 74;\nconst K = 75;\nconst L = 76;\nconst M = 77;\nconst N = 78;\nconst O = 79;\nconst P = 80;\nconst Q = 81;\nconst R = 82;\nconst S = 83;\nconst T = 84;\nconst U = 85;\nconst V = 86;\nconst W = 87;\nconst X = 88;\nconst Y = 89;\nconst Z = 90;\nconst META = 91; // WIN_KEY_LEFT\nconst MAC_WK_CMD_LEFT = 91;\nconst MAC_WK_CMD_RIGHT = 93;\nconst CONTEXT_MENU = 93;\nconst NUMPAD_ZERO = 96;\nconst NUMPAD_ONE = 97;\nconst NUMPAD_TWO = 98;\nconst NUMPAD_THREE = 99;\nconst NUMPAD_FOUR = 100;\nconst NUMPAD_FIVE = 101;\nconst NUMPAD_SIX = 102;\nconst NUMPAD_SEVEN = 103;\nconst NUMPAD_EIGHT = 104;\nconst NUMPAD_NINE = 105;\nconst NUMPAD_MULTIPLY = 106;\nconst NUMPAD_PLUS = 107;\nconst NUMPAD_MINUS = 109;\nconst NUMPAD_PERIOD = 110;\nconst NUMPAD_DIVIDE = 111;\nconst F1 = 112;\nconst F2 = 113;\nconst F3 = 114;\nconst F4 = 115;\nconst F5 = 116;\nconst F6 = 117;\nconst F7 = 118;\nconst F8 = 119;\nconst F9 = 120;\nconst F10 = 121;\nconst F11 = 122;\nconst F12 = 123;\nconst NUM_LOCK = 144;\nconst SCROLL_LOCK = 145;\nconst FIRST_MEDIA = 166;\nconst FF_MINUS = 173;\nconst MUTE = 173; // Firefox (Gecko) fires 181 for MUTE\nconst VOLUME_DOWN = 174; // Firefox (Gecko) fires 182 for VOLUME_DOWN\nconst VOLUME_UP = 175; // Firefox (Gecko) fires 183 for VOLUME_UP\nconst FF_MUTE = 181;\nconst FF_VOLUME_DOWN = 182;\nconst LAST_MEDIA = 183;\nconst FF_VOLUME_UP = 183;\nconst SEMICOLON = 186; // Firefox (Gecko) fires 59 for SEMICOLON\nconst EQUALS = 187; // Firefox (Gecko) fires 61 for EQUALS\nconst COMMA = 188;\nconst DASH = 189; // Firefox (Gecko) fires 173 for DASH/MINUS\nconst PERIOD = 190;\nconst SLASH = 191;\nconst APOSTROPHE = 192;\nconst TILDE = 192;\nconst OPEN_SQUARE_BRACKET = 219;\nconst BACKSLASH = 220;\nconst CLOSE_SQUARE_BRACKET = 221;\nconst SINGLE_QUOTE = 222;\nconst MAC_META = 224;\n\n/**\n * Checks whether a modifier key is pressed.\n * @param event Event to be checked.\n */\nfunction hasModifierKey(event, ...modifiers) {\n if (modifiers.length) {\n return modifiers.some(modifier => event[modifier]);\n }\n return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey;\n}\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { A, ALT, APOSTROPHE, AT_SIGN, B, BACKSLASH, BACKSPACE, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, D, DASH, DELETE, DOWN_ARROW, E, EIGHT, END, ENTER, EQUALS, ESCAPE, F, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, FF_EQUALS, FF_MINUS, FF_MUTE, FF_SEMICOLON, FF_VOLUME_DOWN, FF_VOLUME_UP, FIRST_MEDIA, FIVE, FOUR, G, H, HOME, I, INSERT, J, K, L, LAST_MEDIA, LEFT_ARROW, M, MAC_ENTER, MAC_META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, META, MUTE, N, NINE, NUMPAD_DIVIDE, NUMPAD_EIGHT, NUMPAD_FIVE, NUMPAD_FOUR, NUMPAD_MINUS, NUMPAD_MULTIPLY, NUMPAD_NINE, NUMPAD_ONE, NUMPAD_PERIOD, NUMPAD_PLUS, NUMPAD_SEVEN, NUMPAD_SIX, NUMPAD_THREE, NUMPAD_TWO, NUMPAD_ZERO, NUM_CENTER, NUM_LOCK, O, ONE, OPEN_SQUARE_BRACKET, P, PAGE_DOWN, PAGE_UP, PAUSE, PERIOD, PLUS_SIGN, PRINT_SCREEN, Q, QUESTION_MARK, R, RIGHT_ARROW, S, SCROLL_LOCK, SEMICOLON, SEVEN, SHIFT, SINGLE_QUOTE, SIX, SLASH, SPACE, T, TAB, THREE, TILDE, TWO, U, UP_ARROW, V, VOLUME_DOWN, VOLUME_UP, W, X, Y, Z, ZERO, hasModifierKey };\n","import * as i0 from '@angular/core';\nimport { PLATFORM_ID, Injectable, Inject, NgModule } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator;\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n hasV8BreakIterator = typeof Intl !== 'undefined' && Intl.v8BreakIterator;\n}\ncatch {\n hasV8BreakIterator = false;\n}\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\nclass Platform {\n constructor(_platformId) {\n this._platformId = _platformId;\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n this.isBrowser = this._platformId\n ? isPlatformBrowser(this._platformId)\n : typeof document === 'object' && !!document;\n /** Whether the current browser is Microsoft Edge. */\n this.EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n /** Whether the current rendering engine is Microsoft Trident. */\n this.TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n this.BLINK = this.isBrowser &&\n !!(window.chrome || hasV8BreakIterator) &&\n typeof CSS !== 'undefined' &&\n !this.EDGE &&\n !this.TRIDENT;\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n this.WEBKIT = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) &&\n !this.BLINK &&\n !this.EDGE &&\n !this.TRIDENT;\n /** Whether the current platform is Apple iOS. */\n this.IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n this.FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n this.ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n this.SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Platform, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Platform, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: Platform, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: Object, decorators: [{\n type: Inject,\n args: [PLATFORM_ID]\n }] }]; } });\n\nclass PlatformModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: PlatformModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"16.1.1\", ngImport: i0, type: PlatformModule }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: PlatformModule }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: PlatformModule, decorators: [{\n type: NgModule,\n args: [{}]\n }] });\n\n/** Cached result Set of input types support by the current browser. */\nlet supportedInputTypes;\n/** Types of `` that *might* be supported. */\nconst candidateInputTypes = [\n // `color` must come first. Chrome 56 shows a warning if we change the type to `color` after\n // first changing it to something else:\n // The specified value \"\" does not conform to the required format.\n // The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.\n 'color',\n 'button',\n 'checkbox',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n];\n/** @returns The input types supported by this browser. */\nfunction getSupportedInputTypes() {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\n // We can't check if an input type is not supported until we're on the browser, so say that\n // everything is supported when not on the browser. We don't use `Platform` here since it's\n // just a helper function and can't inject it.\n if (typeof document !== 'object' || !document) {\n supportedInputTypes = new Set(candidateInputTypes);\n return supportedInputTypes;\n }\n let featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n return supportedInputTypes;\n}\n\n/** Cached result of whether the user's browser supports passive event listeners. */\nlet supportsPassiveEvents;\n/**\n * Checks whether the user's browser supports passive event listeners.\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\nfunction supportsPassiveEventListeners() {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener('test', null, Object.defineProperty({}, 'passive', {\n get: () => (supportsPassiveEvents = true),\n }));\n }\n finally {\n supportsPassiveEvents = supportsPassiveEvents || false;\n }\n }\n return supportsPassiveEvents;\n}\n/**\n * Normalizes an `AddEventListener` object to something that can be passed\n * to `addEventListener` on any browser, no matter whether it supports the\n * `options` parameter.\n * @param options Object to be normalized.\n */\nfunction normalizePassiveListenerOptions(options) {\n return supportsPassiveEventListeners() ? options : !!options.capture;\n}\n\n/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */\nlet rtlScrollAxisType;\n/** Cached result of the check that indicates whether the browser supports scroll behaviors. */\nlet scrollBehaviorSupported;\n/** Check whether the browser supports scroll behaviors. */\nfunction supportsScrollBehavior() {\n if (scrollBehaviorSupported == null) {\n // If we're not in the browser, it can't be supported. Also check for `Element`, because\n // some projects stub out the global `document` during SSR which can throw us off.\n if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) {\n scrollBehaviorSupported = false;\n return scrollBehaviorSupported;\n }\n // If the element can have a `scrollBehavior` style, we can be sure that it's supported.\n if ('scrollBehavior' in document.documentElement.style) {\n scrollBehaviorSupported = true;\n }\n else {\n // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's\n // supported but it doesn't handle scroll behavior, or it has been polyfilled.\n const scrollToFunction = Element.prototype.scrollTo;\n if (scrollToFunction) {\n // We can detect if the function has been polyfilled by calling `toString` on it. Native\n // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get\n // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider\n // polyfilled functions as supporting scroll behavior.\n scrollBehaviorSupported = !/\\{\\s*\\[native code\\]\\s*\\}/.test(scrollToFunction.toString());\n }\n else {\n scrollBehaviorSupported = false;\n }\n }\n }\n return scrollBehaviorSupported;\n}\n/**\n * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,\n * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.\n */\nfunction getRtlScrollAxisType() {\n // We can't check unless we're on the browser. Just assume 'normal' if we're not.\n if (typeof document !== 'object' || !document) {\n return 0 /* RtlScrollAxisType.NORMAL */;\n }\n if (rtlScrollAxisType == null) {\n // Create a 1px wide scrolling container and a 2px wide content element.\n const scrollContainer = document.createElement('div');\n const containerStyle = scrollContainer.style;\n scrollContainer.dir = 'rtl';\n containerStyle.width = '1px';\n containerStyle.overflow = 'auto';\n containerStyle.visibility = 'hidden';\n containerStyle.pointerEvents = 'none';\n containerStyle.position = 'absolute';\n const content = document.createElement('div');\n const contentStyle = content.style;\n contentStyle.width = '2px';\n contentStyle.height = '1px';\n scrollContainer.appendChild(content);\n document.body.appendChild(scrollContainer);\n rtlScrollAxisType = 0 /* RtlScrollAxisType.NORMAL */;\n // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL\n // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're\n // dealing with one of the other two types of browsers.\n if (scrollContainer.scrollLeft === 0) {\n // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an\n // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by\n // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will\n // return 0 when we read it again.\n scrollContainer.scrollLeft = 1;\n rtlScrollAxisType =\n scrollContainer.scrollLeft === 0 ? 1 /* RtlScrollAxisType.NEGATED */ : 2 /* RtlScrollAxisType.INVERTED */;\n }\n scrollContainer.remove();\n }\n return rtlScrollAxisType;\n}\n\nlet shadowDomIsSupported;\n/** Checks whether the user's browser support Shadow DOM. */\nfunction _supportsShadowDom() {\n if (shadowDomIsSupported == null) {\n const head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && (head.createShadowRoot || head.attachShadow));\n }\n return shadowDomIsSupported;\n}\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nfunction _getShadowRoot(element) {\n if (_supportsShadowDom()) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n // Note that this should be caught by `_supportsShadowDom`, but some\n // teams have been able to hit this code path on unsupported browsers.\n if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n return null;\n}\n/**\n * Gets the currently-focused element on the page while\n * also piercing through Shadow DOM boundaries.\n */\nfunction _getFocusedElementPierceShadowDom() {\n let activeElement = typeof document !== 'undefined' && document\n ? document.activeElement\n : null;\n while (activeElement && activeElement.shadowRoot) {\n const newActiveElement = activeElement.shadowRoot.activeElement;\n if (newActiveElement === activeElement) {\n break;\n }\n else {\n activeElement = newActiveElement;\n }\n }\n return activeElement;\n}\n/** Gets the target of an event while accounting for Shadow DOM. */\nfunction _getEventTarget(event) {\n // If an event is bound outside the Shadow DOM, the `event.target` will\n // point to the shadow root so we have to use `composedPath` instead.\n return (event.composedPath ? event.composedPath()[0] : event.target);\n}\n\n/** Gets whether the code is currently running in a test environment. */\nfunction _isTestEnvironment() {\n // We can't use `declare const` because it causes conflicts inside Google with the real typings\n // for these symbols and we can't read them off the global object, because they don't appear to\n // be attached there for some runners like Jest.\n // (see: https://github.com/angular/components/issues/23365#issuecomment-938146643)\n return (\n // @ts-ignore\n (typeof __karma__ !== 'undefined' && !!__karma__) ||\n // @ts-ignore\n (typeof jasmine !== 'undefined' && !!jasmine) ||\n // @ts-ignore\n (typeof jest !== 'undefined' && !!jest) ||\n // @ts-ignore\n (typeof Mocha !== 'undefined' && !!Mocha));\n}\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { Platform, PlatformModule, _getEventTarget, _getFocusedElementPierceShadowDom, _getShadowRoot, _isTestEnvironment, _supportsShadowDom, getRtlScrollAxisType, getSupportedInputTypes, normalizePassiveListenerOptions, supportsPassiveEventListeners, supportsScrollBehavior };\n","let nextHandle = 1;\nlet resolved;\nconst activeHandles = {};\nfunction findAndClearHandle(handle) {\n if (handle in activeHandles) {\n delete activeHandles[handle];\n return true;\n }\n return false;\n}\nexport const Immediate = {\n setImmediate(cb) {\n const handle = nextHandle++;\n activeHandles[handle] = true;\n if (!resolved) {\n resolved = Promise.resolve();\n }\n resolved.then(() => findAndClearHandle(handle) && cb());\n return handle;\n },\n clearImmediate(handle) {\n findAndClearHandle(handle);\n },\n};\nexport const TestTools = {\n pending() {\n return Object.keys(activeHandles).length;\n }\n};\n","import { Immediate } from '../util/Immediate';\nconst { setImmediate, clearImmediate } = Immediate;\nexport const immediateProvider = {\n setImmediate(...args) {\n const { delegate } = immediateProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.setImmediate) || setImmediate)(...args);\n },\n clearImmediate(handle) {\n const { delegate } = immediateProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearImmediate) || clearImmediate)(handle);\n },\n delegate: undefined,\n};\n","import { AsapAction } from './AsapAction';\nimport { AsapScheduler } from './AsapScheduler';\nexport const asapScheduler = new AsapScheduler(AsapAction);\nexport const asap = asapScheduler;\n","import { AsyncScheduler } from './AsyncScheduler';\nexport class AsapScheduler extends AsyncScheduler {\n flush(action) {\n this._active = true;\n const flushId = this._scheduled;\n this._scheduled = undefined;\n const { actions } = this;\n let error;\n action = action || actions.shift();\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions[0]) && action.id === flushId && actions.shift());\n this._active = false;\n if (error) {\n while ((action = actions[0]) && action.id === flushId && actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n","import { AsyncAction } from './AsyncAction';\nimport { immediateProvider } from './immediateProvider';\nexport class AsapAction extends AsyncAction {\n constructor(scheduler, work) {\n super(scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n }\n requestAsyncId(scheduler, id, delay = 0) {\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n scheduler.actions.push(this);\n return scheduler._scheduled || (scheduler._scheduled = immediateProvider.setImmediate(scheduler.flush.bind(scheduler, undefined)));\n }\n recycleAsyncId(scheduler, id, delay = 0) {\n var _a;\n if (delay != null ? delay > 0 : this.delay > 0) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n const { actions } = scheduler;\n if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {\n immediateProvider.clearImmediate(id);\n if (scheduler._scheduled === id) {\n scheduler._scheduled = undefined;\n }\n }\n return undefined;\n }\n}\n","import { coerceNumberProperty, coerceElement, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport * as i0 from '@angular/core';\nimport { InjectionToken, forwardRef, Directive, Input, Injectable, Optional, Inject, inject, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, ViewChild, SkipSelf, ElementRef, NgModule } from '@angular/core';\nimport { Subject, of, Observable, fromEvent, animationFrameScheduler, asapScheduler, Subscription, isObservable } from 'rxjs';\nimport { distinctUntilChanged, auditTime, filter, takeUntil, startWith, pairwise, switchMap, shareReplay } from 'rxjs/operators';\nimport * as i1 from '@angular/cdk/platform';\nimport { getRtlScrollAxisType, supportsScrollBehavior, Platform } from '@angular/cdk/platform';\nimport { DOCUMENT } from '@angular/common';\nimport * as i2 from '@angular/cdk/bidi';\nimport { BidiModule } from '@angular/cdk/bidi';\nimport * as i2$1 from '@angular/cdk/collections';\nimport { isDataSource, ArrayDataSource, _VIEW_REPEATER_STRATEGY, _RecycleViewRepeaterStrategy } from '@angular/cdk/collections';\n\n/** The injection token used to specify the virtual scrolling strategy. */\nconst VIRTUAL_SCROLL_STRATEGY = new InjectionToken('VIRTUAL_SCROLL_STRATEGY');\n\n/** Virtual scrolling strategy for lists with items of known fixed size. */\nclass FixedSizeVirtualScrollStrategy {\n /**\n * @param itemSize The size of the items in the virtually scrolling list.\n * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more\n * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.\n */\n constructor(itemSize, minBufferPx, maxBufferPx) {\n this._scrolledIndexChange = new Subject();\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n this.scrolledIndexChange = this._scrolledIndexChange.pipe(distinctUntilChanged());\n /** The attached viewport. */\n this._viewport = null;\n this._itemSize = itemSize;\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n }\n /**\n * Attaches this scroll strategy to a viewport.\n * @param viewport The viewport to attach this strategy to.\n */\n attach(viewport) {\n this._viewport = viewport;\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n /** Detaches this scroll strategy from the currently attached viewport. */\n detach() {\n this._scrolledIndexChange.complete();\n this._viewport = null;\n }\n /**\n * Update the item size and buffer size.\n * @param itemSize The size of the items in the virtually scrolling list.\n * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more\n * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.\n */\n updateItemAndBufferSize(itemSize, minBufferPx, maxBufferPx) {\n if (maxBufferPx < minBufferPx && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx');\n }\n this._itemSize = itemSize;\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentScrolled() {\n this._updateRenderedRange();\n }\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onDataLengthChanged() {\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentRendered() {\n /* no-op */\n }\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onRenderedOffsetChanged() {\n /* no-op */\n }\n /**\n * Scroll to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling.\n */\n scrollToIndex(index, behavior) {\n if (this._viewport) {\n this._viewport.scrollToOffset(index * this._itemSize, behavior);\n }\n }\n /** Update the viewport's total content size. */\n _updateTotalContentSize() {\n if (!this._viewport) {\n return;\n }\n this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);\n }\n /** Update the viewport's rendered range. */\n _updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }\n}\n/**\n * Provider factory for `FixedSizeVirtualScrollStrategy` that simply extracts the already created\n * `FixedSizeVirtualScrollStrategy` from the given directive.\n * @param fixedSizeDir The instance of `CdkFixedSizeVirtualScroll` to extract the\n * `FixedSizeVirtualScrollStrategy` from.\n */\nfunction _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir) {\n return fixedSizeDir._scrollStrategy;\n}\n/** A virtual scroll strategy that supports fixed-size items. */\nclass CdkFixedSizeVirtualScroll {\n constructor() {\n this._itemSize = 20;\n this._minBufferPx = 100;\n this._maxBufferPx = 200;\n /** The scroll strategy used by this directive. */\n this._scrollStrategy = new FixedSizeVirtualScrollStrategy(this.itemSize, this.minBufferPx, this.maxBufferPx);\n }\n /** The size of the items in the list (in pixels). */\n get itemSize() {\n return this._itemSize;\n }\n set itemSize(value) {\n this._itemSize = coerceNumberProperty(value);\n }\n /**\n * The minimum amount of buffer rendered beyond the viewport (in pixels).\n * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.\n */\n get minBufferPx() {\n return this._minBufferPx;\n }\n set minBufferPx(value) {\n this._minBufferPx = coerceNumberProperty(value);\n }\n /**\n * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px.\n */\n get maxBufferPx() {\n return this._maxBufferPx;\n }\n set maxBufferPx(value) {\n this._maxBufferPx = coerceNumberProperty(value);\n }\n ngOnChanges() {\n this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx);\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkFixedSizeVirtualScroll, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.1\", type: CdkFixedSizeVirtualScroll, isStandalone: true, selector: \"cdk-virtual-scroll-viewport[itemSize]\", inputs: { itemSize: \"itemSize\", minBufferPx: \"minBufferPx\", maxBufferPx: \"maxBufferPx\" }, providers: [\n {\n provide: VIRTUAL_SCROLL_STRATEGY,\n useFactory: _fixedSizeVirtualScrollStrategyFactory,\n deps: [forwardRef(() => CdkFixedSizeVirtualScroll)],\n },\n ], usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkFixedSizeVirtualScroll, decorators: [{\n type: Directive,\n args: [{\n selector: 'cdk-virtual-scroll-viewport[itemSize]',\n standalone: true,\n providers: [\n {\n provide: VIRTUAL_SCROLL_STRATEGY,\n useFactory: _fixedSizeVirtualScrollStrategyFactory,\n deps: [forwardRef(() => CdkFixedSizeVirtualScroll)],\n },\n ],\n }]\n }], propDecorators: { itemSize: [{\n type: Input\n }], minBufferPx: [{\n type: Input\n }], maxBufferPx: [{\n type: Input\n }] } });\n\n/** Time in ms to throttle the scrolling events by default. */\nconst DEFAULT_SCROLL_TIME = 20;\n/**\n * Service contained all registered Scrollable references and emits an event when any one of the\n * Scrollable references emit a scrolled event.\n */\nclass ScrollDispatcher {\n constructor(_ngZone, _platform, document) {\n this._ngZone = _ngZone;\n this._platform = _platform;\n /** Subject for notifying that a registered scrollable reference element has been scrolled. */\n this._scrolled = new Subject();\n /** Keeps track of the global `scroll` and `resize` subscriptions. */\n this._globalSubscription = null;\n /** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */\n this._scrolledCount = 0;\n /**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n */\n this.scrollContainers = new Map();\n this._document = document;\n }\n /**\n * Registers a scrollable instance with the service and listens for its scrolled events. When the\n * scrollable is scrolled, the service emits the event to its scrolled observable.\n * @param scrollable Scrollable instance to be registered.\n */\n register(scrollable) {\n if (!this.scrollContainers.has(scrollable)) {\n this.scrollContainers.set(scrollable, scrollable.elementScrolled().subscribe(() => this._scrolled.next(scrollable)));\n }\n }\n /**\n * De-registers a Scrollable reference and unsubscribes from its scroll event observable.\n * @param scrollable Scrollable instance to be deregistered.\n */\n deregister(scrollable) {\n const scrollableReference = this.scrollContainers.get(scrollable);\n if (scrollableReference) {\n scrollableReference.unsubscribe();\n this.scrollContainers.delete(scrollable);\n }\n }\n /**\n * Returns an observable that emits an event whenever any of the registered Scrollable\n * references (or window, document, or body) fire a scrolled event. Can provide a time in ms\n * to override the default \"throttle\" time.\n *\n * **Note:** in order to avoid hitting change detection for every scroll event,\n * all of the events emitted from this stream will be run outside the Angular zone.\n * If you need to update any data bindings as a result of a scroll event, you have\n * to run the callback using `NgZone.run`.\n */\n scrolled(auditTimeInMs = DEFAULT_SCROLL_TIME) {\n if (!this._platform.isBrowser) {\n return of();\n }\n return new Observable((observer) => {\n if (!this._globalSubscription) {\n this._addGlobalListener();\n }\n // In the case of a 0ms delay, use an observable without auditTime\n // since it does add a perceptible delay in processing overhead.\n const subscription = auditTimeInMs > 0\n ? this._scrolled.pipe(auditTime(auditTimeInMs)).subscribe(observer)\n : this._scrolled.subscribe(observer);\n this._scrolledCount++;\n return () => {\n subscription.unsubscribe();\n this._scrolledCount--;\n if (!this._scrolledCount) {\n this._removeGlobalListener();\n }\n };\n });\n }\n ngOnDestroy() {\n this._removeGlobalListener();\n this.scrollContainers.forEach((_, container) => this.deregister(container));\n this._scrolled.complete();\n }\n /**\n * Returns an observable that emits whenever any of the\n * scrollable ancestors of an element are scrolled.\n * @param elementOrElementRef Element whose ancestors to listen for.\n * @param auditTimeInMs Time to throttle the scroll events.\n */\n ancestorScrolled(elementOrElementRef, auditTimeInMs) {\n const ancestors = this.getAncestorScrollContainers(elementOrElementRef);\n return this.scrolled(auditTimeInMs).pipe(filter(target => {\n return !target || ancestors.indexOf(target) > -1;\n }));\n }\n /** Returns all registered Scrollables that contain the provided element. */\n getAncestorScrollContainers(elementOrElementRef) {\n const scrollingContainers = [];\n this.scrollContainers.forEach((_subscription, scrollable) => {\n if (this._scrollableContainsElement(scrollable, elementOrElementRef)) {\n scrollingContainers.push(scrollable);\n }\n });\n return scrollingContainers;\n }\n /** Use defaultView of injected document if available or fallback to global window reference */\n _getWindow() {\n return this._document.defaultView || window;\n }\n /** Returns true if the element is contained within the provided Scrollable. */\n _scrollableContainsElement(scrollable, elementOrElementRef) {\n let element = coerceElement(elementOrElementRef);\n let scrollableElement = scrollable.getElementRef().nativeElement;\n // Traverse through the element parents until we reach null, checking if any of the elements\n // are the scrollable's element.\n do {\n if (element == scrollableElement) {\n return true;\n }\n } while ((element = element.parentElement));\n return false;\n }\n /** Sets up the global scroll listeners. */\n _addGlobalListener() {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n const window = this._getWindow();\n return fromEvent(window.document, 'scroll').subscribe(() => this._scrolled.next());\n });\n }\n /** Cleans up the global scroll listener. */\n _removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ScrollDispatcher, deps: [{ token: i0.NgZone }, { token: i1.Platform }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ScrollDispatcher, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ScrollDispatcher, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1.Platform }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [DOCUMENT]\n }] }]; } });\n\n/**\n * Sends an event when the directive's element is scrolled. Registers itself with the\n * ScrollDispatcher service to include itself as part of its collection of scrolling events that it\n * can be listened to through the service.\n */\nclass CdkScrollable {\n constructor(elementRef, scrollDispatcher, ngZone, dir) {\n this.elementRef = elementRef;\n this.scrollDispatcher = scrollDispatcher;\n this.ngZone = ngZone;\n this.dir = dir;\n this._destroyed = new Subject();\n this._elementScrolled = new Observable((observer) => this.ngZone.runOutsideAngular(() => fromEvent(this.elementRef.nativeElement, 'scroll')\n .pipe(takeUntil(this._destroyed))\n .subscribe(observer)));\n }\n ngOnInit() {\n this.scrollDispatcher.register(this);\n }\n ngOnDestroy() {\n this.scrollDispatcher.deregister(this);\n this._destroyed.next();\n this._destroyed.complete();\n }\n /** Returns observable that emits when a scroll event is fired on the host element. */\n elementScrolled() {\n return this._elementScrolled;\n }\n /** Gets the ElementRef for the viewport. */\n getElementRef() {\n return this.elementRef;\n }\n /**\n * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo\n * method, since browsers are not consistent about what scrollLeft means in RTL. For this method\n * left and right always refer to the left and right side of the scrolling container irrespective\n * of the layout direction. start and end refer to left and right in an LTR context and vice-versa\n * in an RTL context.\n * @param options specified the offsets to scroll to.\n */\n scrollTo(options) {\n const el = this.elementRef.nativeElement;\n const isRtl = this.dir && this.dir.value == 'rtl';\n // Rewrite start & end offsets as right or left offsets.\n if (options.left == null) {\n options.left = isRtl ? options.end : options.start;\n }\n if (options.right == null) {\n options.right = isRtl ? options.start : options.end;\n }\n // Rewrite the bottom offset as a top offset.\n if (options.bottom != null) {\n options.top =\n el.scrollHeight - el.clientHeight - options.bottom;\n }\n // Rewrite the right offset as a left offset.\n if (isRtl && getRtlScrollAxisType() != 0 /* RtlScrollAxisType.NORMAL */) {\n if (options.left != null) {\n options.right =\n el.scrollWidth - el.clientWidth - options.left;\n }\n if (getRtlScrollAxisType() == 2 /* RtlScrollAxisType.INVERTED */) {\n options.left = options.right;\n }\n else if (getRtlScrollAxisType() == 1 /* RtlScrollAxisType.NEGATED */) {\n options.left = options.right ? -options.right : options.right;\n }\n }\n else {\n if (options.right != null) {\n options.left =\n el.scrollWidth - el.clientWidth - options.right;\n }\n }\n this._applyScrollToOptions(options);\n }\n _applyScrollToOptions(options) {\n const el = this.elementRef.nativeElement;\n if (supportsScrollBehavior()) {\n el.scrollTo(options);\n }\n else {\n if (options.top != null) {\n el.scrollTop = options.top;\n }\n if (options.left != null) {\n el.scrollLeft = options.left;\n }\n }\n }\n /**\n * Measures the scroll offset relative to the specified edge of the viewport. This method can be\n * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent\n * about what scrollLeft means in RTL. The values returned by this method are normalized such that\n * left and right always refer to the left and right side of the scrolling container irrespective\n * of the layout direction. start and end refer to left and right in an LTR context and vice-versa\n * in an RTL context.\n * @param from The edge to measure from.\n */\n measureScrollOffset(from) {\n const LEFT = 'left';\n const RIGHT = 'right';\n const el = this.elementRef.nativeElement;\n if (from == 'top') {\n return el.scrollTop;\n }\n if (from == 'bottom') {\n return el.scrollHeight - el.clientHeight - el.scrollTop;\n }\n // Rewrite start & end as left or right offsets.\n const isRtl = this.dir && this.dir.value == 'rtl';\n if (from == 'start') {\n from = isRtl ? RIGHT : LEFT;\n }\n else if (from == 'end') {\n from = isRtl ? LEFT : RIGHT;\n }\n if (isRtl && getRtlScrollAxisType() == 2 /* RtlScrollAxisType.INVERTED */) {\n // For INVERTED, scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and\n // 0 when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollWidth - el.clientWidth - el.scrollLeft;\n }\n else {\n return el.scrollLeft;\n }\n }\n else if (isRtl && getRtlScrollAxisType() == 1 /* RtlScrollAxisType.NEGATED */) {\n // For NEGATED, scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and\n // 0 when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollLeft + el.scrollWidth - el.clientWidth;\n }\n else {\n return -el.scrollLeft;\n }\n }\n else {\n // For NORMAL, as well as non-RTL contexts, scrollLeft is 0 when scrolled all the way left and\n // (scrollWidth - clientWidth) when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollLeft;\n }\n else {\n return el.scrollWidth - el.clientWidth - el.scrollLeft;\n }\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkScrollable, deps: [{ token: i0.ElementRef }, { token: ScrollDispatcher }, { token: i0.NgZone }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.1\", type: CdkScrollable, isStandalone: true, selector: \"[cdk-scrollable], [cdkScrollable]\", ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkScrollable, decorators: [{\n type: Directive,\n args: [{\n selector: '[cdk-scrollable], [cdkScrollable]',\n standalone: true,\n }]\n }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ScrollDispatcher }, { type: i0.NgZone }, { type: i2.Directionality, decorators: [{\n type: Optional\n }] }]; } });\n\n/** Time in ms to throttle the resize events by default. */\nconst DEFAULT_RESIZE_TIME = 20;\n/**\n * Simple utility for getting the bounds of the browser viewport.\n * @docs-private\n */\nclass ViewportRuler {\n constructor(_platform, ngZone, document) {\n this._platform = _platform;\n /** Stream of viewport change events. */\n this._change = new Subject();\n /** Event listener that will be used to handle the viewport change events. */\n this._changeListener = (event) => {\n this._change.next(event);\n };\n this._document = document;\n ngZone.runOutsideAngular(() => {\n if (_platform.isBrowser) {\n const window = this._getWindow();\n // Note that bind the events ourselves, rather than going through something like RxJS's\n // `fromEvent` so that we can ensure that they're bound outside of the NgZone.\n window.addEventListener('resize', this._changeListener);\n window.addEventListener('orientationchange', this._changeListener);\n }\n // Clear the cached position so that the viewport is re-measured next time it is required.\n // We don't need to keep track of the subscription, because it is completed on destroy.\n this.change().subscribe(() => (this._viewportSize = null));\n });\n }\n ngOnDestroy() {\n if (this._platform.isBrowser) {\n const window = this._getWindow();\n window.removeEventListener('resize', this._changeListener);\n window.removeEventListener('orientationchange', this._changeListener);\n }\n this._change.complete();\n }\n /** Returns the viewport's width and height. */\n getViewportSize() {\n if (!this._viewportSize) {\n this._updateViewportSize();\n }\n const output = { width: this._viewportSize.width, height: this._viewportSize.height };\n // If we're not on a browser, don't cache the size since it'll be mocked out anyway.\n if (!this._platform.isBrowser) {\n this._viewportSize = null;\n }\n return output;\n }\n /** Gets a ClientRect for the viewport's bounds. */\n getViewportRect() {\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n const scrollPosition = this.getViewportScrollPosition();\n const { width, height } = this.getViewportSize();\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height,\n width,\n };\n }\n /** Gets the (top, left) scroll position of the viewport. */\n getViewportScrollPosition() {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return { top: 0, left: 0 };\n }\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const document = this._document;\n const window = this._getWindow();\n const documentElement = document.documentElement;\n const documentRect = documentElement.getBoundingClientRect();\n const top = -documentRect.top ||\n document.body.scrollTop ||\n window.scrollY ||\n documentElement.scrollTop ||\n 0;\n const left = -documentRect.left ||\n document.body.scrollLeft ||\n window.scrollX ||\n documentElement.scrollLeft ||\n 0;\n return { top, left };\n }\n /**\n * Returns a stream that emits whenever the size of the viewport changes.\n * This stream emits outside of the Angular zone.\n * @param throttleTime Time in milliseconds to throttle the stream.\n */\n change(throttleTime = DEFAULT_RESIZE_TIME) {\n return throttleTime > 0 ? this._change.pipe(auditTime(throttleTime)) : this._change;\n }\n /** Use defaultView of injected document if available or fallback to global window reference */\n _getWindow() {\n return this._document.defaultView || window;\n }\n /** Updates the cached viewport size. */\n _updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser\n ? { width: window.innerWidth, height: window.innerHeight }\n : { width: 0, height: 0 };\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ViewportRuler, deps: [{ token: i1.Platform }, { token: i0.NgZone }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ViewportRuler, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ViewportRuler, decorators: [{\n type: Injectable,\n args: [{ providedIn: 'root' }]\n }], ctorParameters: function () { return [{ type: i1.Platform }, { type: i0.NgZone }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [DOCUMENT]\n }] }]; } });\n\nconst VIRTUAL_SCROLLABLE = new InjectionToken('VIRTUAL_SCROLLABLE');\n/**\n * Extending the {@link CdkScrollable} to be used as scrolling container for virtual scrolling.\n */\nclass CdkVirtualScrollable extends CdkScrollable {\n constructor(elementRef, scrollDispatcher, ngZone, dir) {\n super(elementRef, scrollDispatcher, ngZone, dir);\n }\n /**\n * Measure the viewport size for the provided orientation.\n *\n * @param orientation The orientation to measure the size from.\n */\n measureViewportSize(orientation) {\n const viewportEl = this.elementRef.nativeElement;\n return orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight;\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkVirtualScrollable, deps: [{ token: i0.ElementRef }, { token: ScrollDispatcher }, { token: i0.NgZone }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.1\", type: CdkVirtualScrollable, usesInheritance: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkVirtualScrollable, decorators: [{\n type: Directive\n }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ScrollDispatcher }, { type: i0.NgZone }, { type: i2.Directionality, decorators: [{\n type: Optional\n }] }]; } });\n\n/** Checks if the given ranges are equal. */\nfunction rangesEqual(r1, r2) {\n return r1.start == r2.start && r1.end == r2.end;\n}\n/**\n * Scheduler to be used for scroll events. Needs to fall back to\n * something that doesn't rely on requestAnimationFrame on environments\n * that don't support it (e.g. server-side rendering).\n */\nconst SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;\n/** A viewport that virtualizes its scrolling with the help of `CdkVirtualForOf`. */\nclass CdkVirtualScrollViewport extends CdkVirtualScrollable {\n /** The direction the viewport scrolls. */\n get orientation() {\n return this._orientation;\n }\n set orientation(orientation) {\n if (this._orientation !== orientation) {\n this._orientation = orientation;\n this._calculateSpacerSize();\n }\n }\n /**\n * Whether rendered items should persist in the DOM after scrolling out of view. By default, items\n * will be removed.\n */\n get appendOnly() {\n return this._appendOnly;\n }\n set appendOnly(value) {\n this._appendOnly = coerceBooleanProperty(value);\n }\n constructor(elementRef, _changeDetectorRef, ngZone, _scrollStrategy, dir, scrollDispatcher, viewportRuler, scrollable) {\n super(elementRef, scrollDispatcher, ngZone, dir);\n this.elementRef = elementRef;\n this._changeDetectorRef = _changeDetectorRef;\n this._scrollStrategy = _scrollStrategy;\n this.scrollable = scrollable;\n this._platform = inject(Platform);\n /** Emits when the viewport is detached from a CdkVirtualForOf. */\n this._detachedSubject = new Subject();\n /** Emits when the rendered range changes. */\n this._renderedRangeSubject = new Subject();\n this._orientation = 'vertical';\n this._appendOnly = false;\n // Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll\n // strategy lazily (i.e. only if the user is actually listening to the events). We do this because\n // depending on how the strategy calculates the scrolled index, it may come at a cost to\n // performance.\n /** Emits when the index of the first element visible in the viewport changes. */\n this.scrolledIndexChange = new Observable((observer) => this._scrollStrategy.scrolledIndexChange.subscribe(index => Promise.resolve().then(() => this.ngZone.run(() => observer.next(index)))));\n /** A stream that emits whenever the rendered range changes. */\n this.renderedRangeStream = this._renderedRangeSubject;\n /**\n * The total size of all content (in pixels), including content that is not currently rendered.\n */\n this._totalContentSize = 0;\n /** A string representing the `style.width` property value to be used for the spacer element. */\n this._totalContentWidth = '';\n /** A string representing the `style.height` property value to be used for the spacer element. */\n this._totalContentHeight = '';\n /** The currently rendered range of indices. */\n this._renderedRange = { start: 0, end: 0 };\n /** The length of the data bound to this viewport (in number of items). */\n this._dataLength = 0;\n /** The size of the viewport (in pixels). */\n this._viewportSize = 0;\n /** The last rendered content offset that was set. */\n this._renderedContentOffset = 0;\n /**\n * Whether the last rendered content offset was to the end of the content (and therefore needs to\n * be rewritten as an offset to the start of the content).\n */\n this._renderedContentOffsetNeedsRewrite = false;\n /** Whether there is a pending change detection cycle. */\n this._isChangeDetectionPending = false;\n /** A list of functions to run after the next change detection cycle. */\n this._runAfterChangeDetection = [];\n /** Subscription to changes in the viewport size. */\n this._viewportChanges = Subscription.EMPTY;\n if (!_scrollStrategy && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Error: cdk-virtual-scroll-viewport requires the \"itemSize\" property to be set.');\n }\n this._viewportChanges = viewportRuler.change().subscribe(() => {\n this.checkViewportSize();\n });\n if (!this.scrollable) {\n // No scrollable is provided, so the virtual-scroll-viewport needs to become a scrollable\n this.elementRef.nativeElement.classList.add('cdk-virtual-scrollable');\n this.scrollable = this;\n }\n }\n ngOnInit() {\n // Scrolling depends on the element dimensions which we can't get during SSR.\n if (!this._platform.isBrowser) {\n return;\n }\n if (this.scrollable === this) {\n super.ngOnInit();\n }\n // It's still too early to measure the viewport at this point. Deferring with a promise allows\n // the Viewport to be rendered with the correct size before we measure. We run this outside the\n // zone to avoid causing more change detection cycles. We handle the change detection loop\n // ourselves instead.\n this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {\n this._measureViewportSize();\n this._scrollStrategy.attach(this);\n this.scrollable\n .elementScrolled()\n .pipe(\n // Start off with a fake scroll event so we properly detect our initial position.\n startWith(null), \n // Collect multiple events into one until the next animation frame. This way if\n // there are multiple scroll events in the same frame we only need to recheck\n // our layout once.\n auditTime(0, SCROLL_SCHEDULER))\n .subscribe(() => this._scrollStrategy.onContentScrolled());\n this._markChangeDetectionNeeded();\n }));\n }\n ngOnDestroy() {\n this.detach();\n this._scrollStrategy.detach();\n // Complete all subjects\n this._renderedRangeSubject.complete();\n this._detachedSubject.complete();\n this._viewportChanges.unsubscribe();\n super.ngOnDestroy();\n }\n /** Attaches a `CdkVirtualScrollRepeater` to this viewport. */\n attach(forOf) {\n if (this._forOf && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('CdkVirtualScrollViewport is already attached.');\n }\n // Subscribe to the data stream of the CdkVirtualForOf to keep track of when the data length\n // changes. Run outside the zone to avoid triggering change detection, since we're managing the\n // change detection loop ourselves.\n this.ngZone.runOutsideAngular(() => {\n this._forOf = forOf;\n this._forOf.dataStream.pipe(takeUntil(this._detachedSubject)).subscribe(data => {\n const newLength = data.length;\n if (newLength !== this._dataLength) {\n this._dataLength = newLength;\n this._scrollStrategy.onDataLengthChanged();\n }\n this._doChangeDetection();\n });\n });\n }\n /** Detaches the current `CdkVirtualForOf`. */\n detach() {\n this._forOf = null;\n this._detachedSubject.next();\n }\n /** Gets the length of the data bound to this viewport (in number of items). */\n getDataLength() {\n return this._dataLength;\n }\n /** Gets the size of the viewport (in pixels). */\n getViewportSize() {\n return this._viewportSize;\n }\n // TODO(mmalerba): This is technically out of sync with what's really rendered until a render\n // cycle happens. I'm being careful to only call it after the render cycle is complete and before\n // setting it to something else, but its error prone and should probably be split into\n // `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.\n /** Get the current rendered range of items. */\n getRenderedRange() {\n return this._renderedRange;\n }\n measureBoundingClientRectWithScrollOffset(from) {\n return this.getElementRef().nativeElement.getBoundingClientRect()[from];\n }\n /**\n * Sets the total size of all content (in pixels), including content that is not currently\n * rendered.\n */\n setTotalContentSize(size) {\n if (this._totalContentSize !== size) {\n this._totalContentSize = size;\n this._calculateSpacerSize();\n this._markChangeDetectionNeeded();\n }\n }\n /** Sets the currently rendered range of indices. */\n setRenderedRange(range) {\n if (!rangesEqual(this._renderedRange, range)) {\n if (this.appendOnly) {\n range = { start: 0, end: Math.max(this._renderedRange.end, range.end) };\n }\n this._renderedRangeSubject.next((this._renderedRange = range));\n this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered());\n }\n }\n /**\n * Gets the offset from the start of the viewport to the start of the rendered data (in pixels).\n */\n getOffsetToRenderedContentStart() {\n return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset;\n }\n /**\n * Sets the offset from the start of the viewport to either the start or end of the rendered data\n * (in pixels).\n */\n setRenderedContentOffset(offset, to = 'to-start') {\n // In appendOnly, we always start from the top\n offset = this.appendOnly && to === 'to-start' ? 0 : offset;\n // For a horizontal viewport in a right-to-left language we need to translate along the x-axis\n // in the negative direction.\n const isRtl = this.dir && this.dir.value == 'rtl';\n const isHorizontal = this.orientation == 'horizontal';\n const axis = isHorizontal ? 'X' : 'Y';\n const axisDirection = isHorizontal && isRtl ? -1 : 1;\n let transform = `translate${axis}(${Number(axisDirection * offset)}px)`;\n this._renderedContentOffset = offset;\n if (to === 'to-end') {\n transform += ` translate${axis}(-100%)`;\n // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise\n // elements will appear to expand in the wrong direction (e.g. `mat-expansion-panel` would\n // expand upward).\n this._renderedContentOffsetNeedsRewrite = true;\n }\n if (this._renderedContentTransform != transform) {\n // We know this value is safe because we parse `offset` with `Number()` before passing it\n // into the string.\n this._renderedContentTransform = transform;\n this._markChangeDetectionNeeded(() => {\n if (this._renderedContentOffsetNeedsRewrite) {\n this._renderedContentOffset -= this.measureRenderedContentSize();\n this._renderedContentOffsetNeedsRewrite = false;\n this.setRenderedContentOffset(this._renderedContentOffset);\n }\n else {\n this._scrollStrategy.onRenderedOffsetChanged();\n }\n });\n }\n }\n /**\n * Scrolls to the given offset from the start of the viewport. Please note that this is not always\n * the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left\n * direction, this would be the equivalent of setting a fictional `scrollRight` property.\n * @param offset The offset to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.\n */\n scrollToOffset(offset, behavior = 'auto') {\n const options = { behavior };\n if (this.orientation === 'horizontal') {\n options.start = offset;\n }\n else {\n options.top = offset;\n }\n this.scrollable.scrollTo(options);\n }\n /**\n * Scrolls to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.\n */\n scrollToIndex(index, behavior = 'auto') {\n this._scrollStrategy.scrollToIndex(index, behavior);\n }\n /**\n * Gets the current scroll offset from the start of the scrollable (in pixels).\n * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'\n * in horizontal mode.\n */\n measureScrollOffset(from) {\n // This is to break the call cycle\n let measureScrollOffset;\n if (this.scrollable == this) {\n measureScrollOffset = (_from) => super.measureScrollOffset(_from);\n }\n else {\n measureScrollOffset = (_from) => this.scrollable.measureScrollOffset(_from);\n }\n return Math.max(0, measureScrollOffset(from ?? (this.orientation === 'horizontal' ? 'start' : 'top')) -\n this.measureViewportOffset());\n }\n /**\n * Measures the offset of the viewport from the scrolling container\n * @param from The edge to measure from.\n */\n measureViewportOffset(from) {\n let fromRect;\n const LEFT = 'left';\n const RIGHT = 'right';\n const isRtl = this.dir?.value == 'rtl';\n if (from == 'start') {\n fromRect = isRtl ? RIGHT : LEFT;\n }\n else if (from == 'end') {\n fromRect = isRtl ? LEFT : RIGHT;\n }\n else if (from) {\n fromRect = from;\n }\n else {\n fromRect = this.orientation === 'horizontal' ? 'left' : 'top';\n }\n const scrollerClientRect = this.scrollable.measureBoundingClientRectWithScrollOffset(fromRect);\n const viewportClientRect = this.elementRef.nativeElement.getBoundingClientRect()[fromRect];\n return viewportClientRect - scrollerClientRect;\n }\n /** Measure the combined size of all of the rendered items. */\n measureRenderedContentSize() {\n const contentEl = this._contentWrapper.nativeElement;\n return this.orientation === 'horizontal' ? contentEl.offsetWidth : contentEl.offsetHeight;\n }\n /**\n * Measure the total combined size of the given range. Throws if the range includes items that are\n * not rendered.\n */\n measureRangeSize(range) {\n if (!this._forOf) {\n return 0;\n }\n return this._forOf.measureRangeSize(range, this.orientation);\n }\n /** Update the viewport dimensions and re-render. */\n checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n }\n /** Measure the viewport size. */\n _measureViewportSize() {\n this._viewportSize = this.scrollable.measureViewportSize(this.orientation);\n }\n /** Queue up change detection to run. */\n _markChangeDetectionNeeded(runAfter) {\n if (runAfter) {\n this._runAfterChangeDetection.push(runAfter);\n }\n // Use a Promise to batch together calls to `_doChangeDetection`. This way if we set a bunch of\n // properties sequentially we only have to run `_doChangeDetection` once at the end.\n if (!this._isChangeDetectionPending) {\n this._isChangeDetectionPending = true;\n this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {\n this._doChangeDetection();\n }));\n }\n }\n /** Run change detection. */\n _doChangeDetection() {\n this._isChangeDetectionPending = false;\n // Apply the content transform. The transform can't be set via an Angular binding because\n // bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of\n // string literals, a variable that can only be 'X' or 'Y', and user input that is run through\n // the `Number` function first to coerce it to a numeric value.\n this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform;\n // Apply changes to Angular bindings. Note: We must call `markForCheck` to run change detection\n // from the root, since the repeated items are content projected in. Calling `detectChanges`\n // instead does not properly check the projected content.\n this.ngZone.run(() => this._changeDetectorRef.markForCheck());\n const runAfterChangeDetection = this._runAfterChangeDetection;\n this._runAfterChangeDetection = [];\n for (const fn of runAfterChangeDetection) {\n fn();\n }\n }\n /** Calculates the `style.width` and `style.height` for the spacer element. */\n _calculateSpacerSize() {\n this._totalContentHeight =\n this.orientation === 'horizontal' ? '' : `${this._totalContentSize}px`;\n this._totalContentWidth =\n this.orientation === 'horizontal' ? `${this._totalContentSize}px` : '';\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkVirtualScrollViewport, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: VIRTUAL_SCROLL_STRATEGY, optional: true }, { token: i2.Directionality, optional: true }, { token: ScrollDispatcher }, { token: ViewportRuler }, { token: VIRTUAL_SCROLLABLE, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }\n static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"16.1.1\", type: CdkVirtualScrollViewport, isStandalone: true, selector: \"cdk-virtual-scroll-viewport\", inputs: { orientation: \"orientation\", appendOnly: \"appendOnly\" }, outputs: { scrolledIndexChange: \"scrolledIndexChange\" }, host: { properties: { \"class.cdk-virtual-scroll-orientation-horizontal\": \"orientation === \\\"horizontal\\\"\", \"class.cdk-virtual-scroll-orientation-vertical\": \"orientation !== \\\"horizontal\\\"\" }, classAttribute: \"cdk-virtual-scroll-viewport\" }, providers: [\n {\n provide: CdkScrollable,\n useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,\n deps: [[new Optional(), new Inject(VIRTUAL_SCROLLABLE)], CdkVirtualScrollViewport],\n },\n ], viewQueries: [{ propertyName: \"_contentWrapper\", first: true, predicate: [\"contentWrapper\"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: \"\\n
    \\n \\n
    \\n\\n
    \\n\", styles: [\"cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}\"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkVirtualScrollViewport, decorators: [{\n type: Component,\n args: [{ selector: 'cdk-virtual-scroll-viewport', host: {\n 'class': 'cdk-virtual-scroll-viewport',\n '[class.cdk-virtual-scroll-orientation-horizontal]': 'orientation === \"horizontal\"',\n '[class.cdk-virtual-scroll-orientation-vertical]': 'orientation !== \"horizontal\"',\n }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, providers: [\n {\n provide: CdkScrollable,\n useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,\n deps: [[new Optional(), new Inject(VIRTUAL_SCROLLABLE)], CdkVirtualScrollViewport],\n },\n ], template: \"\\n
    \\n \\n
    \\n\\n
    \\n\", styles: [\"cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}\"] }]\n }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [VIRTUAL_SCROLL_STRATEGY]\n }] }, { type: i2.Directionality, decorators: [{\n type: Optional\n }] }, { type: ScrollDispatcher }, { type: ViewportRuler }, { type: CdkVirtualScrollable, decorators: [{\n type: Optional\n }, {\n type: Inject,\n args: [VIRTUAL_SCROLLABLE]\n }] }]; }, propDecorators: { orientation: [{\n type: Input\n }], appendOnly: [{\n type: Input\n }], scrolledIndexChange: [{\n type: Output\n }], _contentWrapper: [{\n type: ViewChild,\n args: ['contentWrapper', { static: true }]\n }] } });\n\n/** Helper to extract the offset of a DOM Node in a certain direction. */\nfunction getOffset(orientation, direction, node) {\n const el = node;\n if (!el.getBoundingClientRect) {\n return 0;\n }\n const rect = el.getBoundingClientRect();\n if (orientation === 'horizontal') {\n return direction === 'start' ? rect.left : rect.right;\n }\n return direction === 'start' ? rect.top : rect.bottom;\n}\n/**\n * A directive similar to `ngForOf` to be used for rendering data inside a virtual scrolling\n * container.\n */\nclass CdkVirtualForOf {\n /** The DataSource to display. */\n get cdkVirtualForOf() {\n return this._cdkVirtualForOf;\n }\n set cdkVirtualForOf(value) {\n this._cdkVirtualForOf = value;\n if (isDataSource(value)) {\n this._dataSourceChanges.next(value);\n }\n else {\n // If value is an an NgIterable, convert it to an array.\n this._dataSourceChanges.next(new ArrayDataSource(isObservable(value) ? value : Array.from(value || [])));\n }\n }\n /**\n * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and\n * the item and produces a value to be used as the item's identity when tracking changes.\n */\n get cdkVirtualForTrackBy() {\n return this._cdkVirtualForTrackBy;\n }\n set cdkVirtualForTrackBy(fn) {\n this._needsUpdate = true;\n this._cdkVirtualForTrackBy = fn\n ? (index, item) => fn(index + (this._renderedRange ? this._renderedRange.start : 0), item)\n : undefined;\n }\n /** The template used to stamp out new elements. */\n set cdkVirtualForTemplate(value) {\n if (value) {\n this._needsUpdate = true;\n this._template = value;\n }\n }\n /**\n * The size of the cache used to store templates that are not being used for re-use later.\n * Setting the cache size to `0` will disable caching. Defaults to 20 templates.\n */\n get cdkVirtualForTemplateCacheSize() {\n return this._viewRepeater.viewCacheSize;\n }\n set cdkVirtualForTemplateCacheSize(size) {\n this._viewRepeater.viewCacheSize = coerceNumberProperty(size);\n }\n constructor(\n /** The view container to add items to. */\n _viewContainerRef, \n /** The template to use when stamping out new items. */\n _template, \n /** The set of available differs. */\n _differs, \n /** The strategy used to render items in the virtual scroll viewport. */\n _viewRepeater, \n /** The virtual scrolling viewport that these items are being rendered in. */\n _viewport, ngZone) {\n this._viewContainerRef = _viewContainerRef;\n this._template = _template;\n this._differs = _differs;\n this._viewRepeater = _viewRepeater;\n this._viewport = _viewport;\n /** Emits when the rendered view of the data changes. */\n this.viewChange = new Subject();\n /** Subject that emits when a new DataSource instance is given. */\n this._dataSourceChanges = new Subject();\n /** Emits whenever the data in the current DataSource changes. */\n this.dataStream = this._dataSourceChanges.pipe(\n // Start off with null `DataSource`.\n startWith(null), \n // Bundle up the previous and current data sources so we can work with both.\n pairwise(), \n // Use `_changeDataSource` to disconnect from the previous data source and connect to the\n // new one, passing back a stream of data changes which we run through `switchMap` to give\n // us a data stream that emits the latest data from whatever the current `DataSource` is.\n switchMap(([prev, cur]) => this._changeDataSource(prev, cur)), \n // Replay the last emitted data when someone subscribes.\n shareReplay(1));\n /** The differ used to calculate changes to the data. */\n this._differ = null;\n /** Whether the rendered data should be updated during the next ngDoCheck cycle. */\n this._needsUpdate = false;\n this._destroyed = new Subject();\n this.dataStream.subscribe(data => {\n this._data = data;\n this._onRenderedDataChange();\n });\n this._viewport.renderedRangeStream.pipe(takeUntil(this._destroyed)).subscribe(range => {\n this._renderedRange = range;\n if (this.viewChange.observers.length) {\n ngZone.run(() => this.viewChange.next(this._renderedRange));\n }\n this._onRenderedDataChange();\n });\n this._viewport.attach(this);\n }\n /**\n * Measures the combined size (width for horizontal orientation, height for vertical) of all items\n * in the specified range. Throws an error if the range includes items that are not currently\n * rendered.\n */\n measureRangeSize(range, orientation) {\n if (range.start >= range.end) {\n return 0;\n }\n if ((range.start < this._renderedRange.start || range.end > this._renderedRange.end) &&\n (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(`Error: attempted to measure an item that isn't rendered.`);\n }\n // The index into the list of rendered views for the first item in the range.\n const renderedStartIndex = range.start - this._renderedRange.start;\n // The length of the range we're measuring.\n const rangeLen = range.end - range.start;\n // Loop over all the views, find the first and land node and compute the size by subtracting\n // the top of the first node from the bottom of the last one.\n let firstNode;\n let lastNode;\n // Find the first node by starting from the beginning and going forwards.\n for (let i = 0; i < rangeLen; i++) {\n const view = this._viewContainerRef.get(i + renderedStartIndex);\n if (view && view.rootNodes.length) {\n firstNode = lastNode = view.rootNodes[0];\n break;\n }\n }\n // Find the last node by starting from the end and going backwards.\n for (let i = rangeLen - 1; i > -1; i--) {\n const view = this._viewContainerRef.get(i + renderedStartIndex);\n if (view && view.rootNodes.length) {\n lastNode = view.rootNodes[view.rootNodes.length - 1];\n break;\n }\n }\n return firstNode && lastNode\n ? getOffset(orientation, 'end', lastNode) - getOffset(orientation, 'start', firstNode)\n : 0;\n }\n ngDoCheck() {\n if (this._differ && this._needsUpdate) {\n // TODO(mmalerba): We should differentiate needs update due to scrolling and a new portion of\n // this list being rendered (can use simpler algorithm) vs needs update due to data actually\n // changing (need to do this diff).\n const changes = this._differ.diff(this._renderedItems);\n if (!changes) {\n this._updateContext();\n }\n else {\n this._applyChanges(changes);\n }\n this._needsUpdate = false;\n }\n }\n ngOnDestroy() {\n this._viewport.detach();\n this._dataSourceChanges.next(undefined);\n this._dataSourceChanges.complete();\n this.viewChange.complete();\n this._destroyed.next();\n this._destroyed.complete();\n this._viewRepeater.detach();\n }\n /** React to scroll state changes in the viewport. */\n _onRenderedDataChange() {\n if (!this._renderedRange) {\n return;\n }\n this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end);\n if (!this._differ) {\n // Use a wrapper function for the `trackBy` so any new values are\n // picked up automatically without having to recreate the differ.\n this._differ = this._differs.find(this._renderedItems).create((index, item) => {\n return this.cdkVirtualForTrackBy ? this.cdkVirtualForTrackBy(index, item) : item;\n });\n }\n this._needsUpdate = true;\n }\n /** Swap out one `DataSource` for another. */\n _changeDataSource(oldDs, newDs) {\n if (oldDs) {\n oldDs.disconnect(this);\n }\n this._needsUpdate = true;\n return newDs ? newDs.connect(this) : of();\n }\n /** Update the `CdkVirtualForOfContext` for all views. */\n _updateContext() {\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n const view = this._viewContainerRef.get(i);\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n view.detectChanges();\n }\n }\n /** Apply changes to the DOM. */\n _applyChanges(changes) {\n this._viewRepeater.applyChanges(changes, this._viewContainerRef, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record, currentIndex), record => record.item);\n // Update $implicit for any items that had an identity change.\n changes.forEachIdentityChange((record) => {\n const view = this._viewContainerRef.get(record.currentIndex);\n view.context.$implicit = record.item;\n });\n // Update the context variables on all items.\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n const view = this._viewContainerRef.get(i);\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n }\n }\n /** Update the computed properties on the `CdkVirtualForOfContext`. */\n _updateComputedContextProperties(context) {\n context.first = context.index === 0;\n context.last = context.index === context.count - 1;\n context.even = context.index % 2 === 0;\n context.odd = !context.even;\n }\n _getEmbeddedViewArgs(record, index) {\n // Note that it's important that we insert the item directly at the proper index,\n // rather than inserting it and the moving it in place, because if there's a directive\n // on the same node that injects the `ViewContainerRef`, Angular will insert another\n // comment node which can throw off the move when it's being repeated for all items.\n return {\n templateRef: this._template,\n context: {\n $implicit: record.item,\n // It's guaranteed that the iterable is not \"undefined\" or \"null\" because we only\n // generate views for elements if the \"cdkVirtualForOf\" iterable has elements.\n cdkVirtualForOf: this._cdkVirtualForOf,\n index: -1,\n count: -1,\n first: false,\n last: false,\n odd: false,\n even: false,\n },\n index,\n };\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkVirtualForOf, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.IterableDiffers }, { token: _VIEW_REPEATER_STRATEGY }, { token: CdkVirtualScrollViewport, skipSelf: true }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.1\", type: CdkVirtualForOf, isStandalone: true, selector: \"[cdkVirtualFor][cdkVirtualForOf]\", inputs: { cdkVirtualForOf: \"cdkVirtualForOf\", cdkVirtualForTrackBy: \"cdkVirtualForTrackBy\", cdkVirtualForTemplate: \"cdkVirtualForTemplate\", cdkVirtualForTemplateCacheSize: \"cdkVirtualForTemplateCacheSize\" }, providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkVirtualForOf, decorators: [{\n type: Directive,\n args: [{\n selector: '[cdkVirtualFor][cdkVirtualForOf]',\n providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }],\n standalone: true,\n }]\n }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }, { type: i0.IterableDiffers }, { type: i2$1._RecycleViewRepeaterStrategy, decorators: [{\n type: Inject,\n args: [_VIEW_REPEATER_STRATEGY]\n }] }, { type: CdkVirtualScrollViewport, decorators: [{\n type: SkipSelf\n }] }, { type: i0.NgZone }]; }, propDecorators: { cdkVirtualForOf: [{\n type: Input\n }], cdkVirtualForTrackBy: [{\n type: Input\n }], cdkVirtualForTemplate: [{\n type: Input\n }], cdkVirtualForTemplateCacheSize: [{\n type: Input\n }] } });\n\n/**\n * Provides a virtual scrollable for the element it is attached to.\n */\nclass CdkVirtualScrollableElement extends CdkVirtualScrollable {\n constructor(elementRef, scrollDispatcher, ngZone, dir) {\n super(elementRef, scrollDispatcher, ngZone, dir);\n }\n measureBoundingClientRectWithScrollOffset(from) {\n return (this.getElementRef().nativeElement.getBoundingClientRect()[from] -\n this.measureScrollOffset(from));\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkVirtualScrollableElement, deps: [{ token: i0.ElementRef }, { token: ScrollDispatcher }, { token: i0.NgZone }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.1\", type: CdkVirtualScrollableElement, isStandalone: true, selector: \"[cdkVirtualScrollingElement]\", host: { classAttribute: \"cdk-virtual-scrollable\" }, providers: [{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableElement }], usesInheritance: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkVirtualScrollableElement, decorators: [{\n type: Directive,\n args: [{\n selector: '[cdkVirtualScrollingElement]',\n providers: [{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableElement }],\n standalone: true,\n host: {\n 'class': 'cdk-virtual-scrollable',\n },\n }]\n }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ScrollDispatcher }, { type: i0.NgZone }, { type: i2.Directionality, decorators: [{\n type: Optional\n }] }]; } });\n\n/**\n * Provides as virtual scrollable for the global / window scrollbar.\n */\nclass CdkVirtualScrollableWindow extends CdkVirtualScrollable {\n constructor(scrollDispatcher, ngZone, dir) {\n super(new ElementRef(document.documentElement), scrollDispatcher, ngZone, dir);\n this._elementScrolled = new Observable((observer) => this.ngZone.runOutsideAngular(() => fromEvent(document, 'scroll').pipe(takeUntil(this._destroyed)).subscribe(observer)));\n }\n measureBoundingClientRectWithScrollOffset(from) {\n return this.getElementRef().nativeElement.getBoundingClientRect()[from];\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkVirtualScrollableWindow, deps: [{ token: ScrollDispatcher }, { token: i0.NgZone }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"16.1.1\", type: CdkVirtualScrollableWindow, isStandalone: true, selector: \"cdk-virtual-scroll-viewport[scrollWindow]\", providers: [{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableWindow }], usesInheritance: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkVirtualScrollableWindow, decorators: [{\n type: Directive,\n args: [{\n selector: 'cdk-virtual-scroll-viewport[scrollWindow]',\n providers: [{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableWindow }],\n standalone: true,\n }]\n }], ctorParameters: function () { return [{ type: ScrollDispatcher }, { type: i0.NgZone }, { type: i2.Directionality, decorators: [{\n type: Optional\n }] }]; } });\n\nclass CdkScrollableModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkScrollableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkScrollableModule, imports: [CdkScrollable], exports: [CdkScrollable] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkScrollableModule }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: CdkScrollableModule, decorators: [{\n type: NgModule,\n args: [{\n exports: [CdkScrollable],\n imports: [CdkScrollable],\n }]\n }] });\n/**\n * @docs-primary-export\n */\nclass ScrollingModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ScrollingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"16.1.1\", ngImport: i0, type: ScrollingModule, imports: [BidiModule, CdkScrollableModule, CdkVirtualScrollViewport,\n CdkFixedSizeVirtualScroll,\n CdkVirtualForOf,\n CdkVirtualScrollableWindow,\n CdkVirtualScrollableElement], exports: [BidiModule, CdkScrollableModule, CdkFixedSizeVirtualScroll,\n CdkVirtualForOf,\n CdkVirtualScrollViewport,\n CdkVirtualScrollableWindow,\n CdkVirtualScrollableElement] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ScrollingModule, imports: [BidiModule,\n CdkScrollableModule, BidiModule, CdkScrollableModule] }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"16.1.1\", ngImport: i0, type: ScrollingModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [\n BidiModule,\n CdkScrollableModule,\n CdkVirtualScrollViewport,\n CdkFixedSizeVirtualScroll,\n CdkVirtualForOf,\n CdkVirtualScrollableWindow,\n CdkVirtualScrollableElement,\n ],\n exports: [\n BidiModule,\n CdkScrollableModule,\n CdkFixedSizeVirtualScroll,\n CdkVirtualForOf,\n CdkVirtualScrollViewport,\n CdkVirtualScrollableWindow,\n CdkVirtualScrollableElement,\n ],\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { CdkFixedSizeVirtualScroll, CdkScrollable, CdkScrollableModule, CdkVirtualForOf, CdkVirtualScrollViewport, CdkVirtualScrollable, CdkVirtualScrollableElement, CdkVirtualScrollableWindow, DEFAULT_RESIZE_TIME, DEFAULT_SCROLL_TIME, FixedSizeVirtualScrollStrategy, ScrollDispatcher, ScrollingModule, VIRTUAL_SCROLLABLE, VIRTUAL_SCROLL_STRATEGY, ViewportRuler, _fixedSizeVirtualScrollStrategyFactory };\n"],"x_google_ignoreList":[4,5,6,18,19,20,21,22,23,24,25,26,27,28,29,30,31]}