-
Notifications
You must be signed in to change notification settings - Fork 1
/
13-es5.7d9f0d882350ad63b59c.js.map
1 lines (1 loc) · 27.9 KB
/
13-es5.7d9f0d882350ad63b59c.js.map
1
{"version":3,"sources":["webpack:///./node_modules/rxjs/_esm5/internal/observable/SubscribeOnObservable.js.pre-build-optimizer.js","webpack:///./node_modules/rxjs/_esm5/internal/operators/subscribeOn.js.pre-build-optimizer.js","webpack:///./src/app/custom-elements/toc/toc.component.ts","webpack:///./src/app/custom-elements/toc/toc.component.ts.pre-build-optimizer.js","webpack:///./src/app/custom-elements/toc/toc.module.ts","webpack:///./src/app/custom-elements/toc/toc.component.ngfactory.js.pre-build-optimizer.js","webpack:///./src/app/custom-elements/toc/toc.component.html","webpack:///./src/app/custom-elements/toc/toc.module.ngfactory.js.pre-build-optimizer.js"],"names":["SubscribeOnObservable_SubscribeOnObservable","_super","SubscribeOnObservable","source","delayTime","scheduler","asap","_this","call","this","Object","isNumeric","schedule","tslib_es6","create","delay","dispatch","arg","add","subscribe","subscriber","prototype","_subscribe","Observable","subscribeOn_SubscribeOnOperator","SubscribeOnOperator","toc_component_TocComponent","TocComponent","scrollService","elementRef","tocService","activeIndex","type","isCollapsed","isEmbedded","onDestroy","Subject","primaryMax","nativeElement","className","indexOf","ngOnInit","tocList","pipe","takeUntil","fn","itemCount","item","level","reduce","result","ngAfterViewInit","combineLatest","activeItemIndex","lift","items","changes","startWith","_a","index","length","e","toArray","p","offsetParent","eRect","getBoundingClientRect","pRect","top","bottom","scrollTop","clientHeight","ngOnDestroy","next","toggle","canScroll","toTop","scrollToTop","toc_module_TocModule","customElementComponent","RenderType_TocComponent","core","encapsulation","styles","data","View_TocComponent_2","_l","View_TocComponent_3","_v","en","$event","ad","component","index_ngfactory","icon_es5","svgIcon","_ck","_co","inline","color","View_TocComponent_5","parent","context","$implicit","title","href","content","View_TocComponent_4","common","ngIf","View_TocComponent_6","View_TocComponent_1","ngForOf","View_TocComponent_0","View_TocComponent_Host_0","scroll_service","toc_service","TocComponentNgFactory","__webpack_require__","d","__webpack_exports__","TocModuleNgFactory","bidi_es5","core_es5","platform_browser"],"mappings":"uMAKIA,EAAuC,SAAUC,GAEjD,SAASC,EAAsBC,EAAQC,EAAWC,QAC5B,IAAdD,IACAA,EAAY,QAEE,IAAdC,IACAA,EAAYC,EAAA,GAEhB,IAAIC,EAAQN,EAAOO,KAAKC,OAASA,KAUjC,OATAF,EAAMJ,OAASA,EACfI,EAAMH,UAAYA,EAClBG,EAAMF,UAAYA,IACbK,OAAAC,EAAA,EAAAD,CAAUN,IAAcA,EAAY,KACrCG,EAAMH,UAAY,GAEjBC,GAA2C,mBAAvBA,EAAUO,WAC/BL,EAAMF,UAAYC,EAAA,GAEfC,EAuBX,OAzCAM,EAAA,EAAkBX,EAAuBD,GAoBzCC,EAAsBY,OAAS,SAAUX,EAAQY,EAAOV,GAOpD,YANc,IAAVU,IACAA,EAAQ,QAEM,IAAdV,IACAA,EAAYC,EAAA,GAET,IAAIJ,EAAsBC,EAAQY,EAAOV,IAEpDH,EAAsBc,SAAW,SAAUC,GAEvC,OAAOR,KAAKS,IADCD,EAAId,OACMgB,UADeF,EAAIG,cAG9ClB,EAAsBmB,UAAUC,WAAa,SAAUF,GAInD,OADgBX,KAAKJ,UACJO,SAASV,EAAsBc,SAHpCP,KAAKL,UAGgD,CAC7DD,OAHSM,KAAKN,OAGEiB,WAAYA,KAG7BlB,EA1C+B,CA2CxCqB,EAAA,GCtCEC,EAAqC,WACrC,SAASC,EAAoBpB,EAAWU,GACpCN,KAAKJ,UAAYA,EACjBI,KAAKM,MAAQA,EAKjB,OAHAU,EAAoBJ,UAAUb,KAAO,SAAUY,EAAYjB,GACvD,OAAO,IAAIH,EAAsBG,EAAQM,KAAKM,MAAON,KAAKJ,WAAWc,UAAUC,IAE5EK,EAR6B,eCDxCC,EAAA,WAgBE,SAAAC,EACUC,EACRC,EACQC,GAFArB,KAAAmB,gBAEAnB,KAAAqB,aAZVrB,KAAAsB,YAA6B,KAC7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,GAAQ,EAAG,EAAEK,MAAQL,EAAA,GAAQ,EAAG,EAAG,KAAM,KAAM,EAAG,UAAW,GAAI,KAAM,KAAM,KAAMgC,EAAqBjC,IAA2BC,EAAA,GAAQ,EAAG,QAAS,KAAM,EAAGvD,EAAiB,CAACyF,EAAA,EAAkBlC,EAAA,EAAemC,EAAA,GAAgB,KAAM,OAAQ,SAAUpB,EAAKR,GAAMQ,EAAIR,EAAI,EAAG,IAAO,MAC9U,IAAI6B,EAAwBpC,EAAA,GAAQ,UAAWvD,EAAiBwF,EAA0B,GAAI,GAAI,wCE9BlGI,EAAAC,EAAAC,EAAA,uCAAAC,IAcA,IAAIA,EAAqBxC,EAAA,GAAQH,EAAc,GAAI,SAAUQ,GAAM,OAAOL,EAAA,GAAQ,CAACA,EAAA,GAAQ,IAAKA,EAAA,EAA6BA,EAAA,GAAqC,CAAC,CAAC,EAAG,CAACoC,IAA4B,CAAC,EAAGpC,EAAA,GAA8BA,EAAA,IAAkBA,EAAA,GAAQ,KAAM2B,EAAA,EAAmBA,EAAA,EAAyB,CAAC3B,EAAA,EAAc,CAAC,EAAG2B,EAAA,KAAyC3B,EAAA,GAAQ,WAAY2B,EAAA,EAAiBA,EAAA,EAAiB,IAAK3B,EAAA,GAAQ,WAAYyC,EAAA,EAAeA,EAAA,EAAe,IAAKzC,EAAA,GAAQ,WAAY0C,EAAA,EAAoBA,EAAA,EAAoB,CAAC,CAAC,EAAGA,EAAA,GAA4B,CAAC,EAAGC,EAAA,KAAqB3C,EAAA,GAAQ,WAAYa,EAAA,EAAkBA,EAAA,EAAkB,IAAKb,EAAA,GAAQ,WAAYH,EAAcA,EAAc","file":"13-es5.7d9f0d882350ad63b59c.js","sourcesContent":["/** PURE_IMPORTS_START tslib,_Observable,_scheduler_asap,_util_isNumeric PURE_IMPORTS_END */\nimport * as tslib_1 from \"tslib\";\nimport { Observable } from '../Observable';\nimport { asap } from '../scheduler/asap';\nimport { isNumeric } from '../util/isNumeric';\nvar SubscribeOnObservable = /*@__PURE__*/ (function (_super) {\n tslib_1.__extends(SubscribeOnObservable, _super);\n function SubscribeOnObservable(source, delayTime, scheduler) {\n if (delayTime === void 0) {\n delayTime = 0;\n }\n if (scheduler === void 0) {\n scheduler = asap;\n }\n var _this = _super.call(this) || this;\n _this.source = source;\n _this.delayTime = delayTime;\n _this.scheduler = scheduler;\n if (!isNumeric(delayTime) || delayTime < 0) {\n _this.delayTime = 0;\n }\n if (!scheduler || typeof scheduler.schedule !== 'function') {\n _this.scheduler = asap;\n }\n return _this;\n }\n SubscribeOnObservable.create = function (source, delay, scheduler) {\n if (delay === void 0) {\n delay = 0;\n }\n if (scheduler === void 0) {\n scheduler = asap;\n }\n return new SubscribeOnObservable(source, delay, scheduler);\n };\n SubscribeOnObservable.dispatch = function (arg) {\n var source = arg.source, subscriber = arg.subscriber;\n return this.add(source.subscribe(subscriber));\n };\n SubscribeOnObservable.prototype._subscribe = function (subscriber) {\n var delay = this.delayTime;\n var source = this.source;\n var scheduler = this.scheduler;\n return scheduler.schedule(SubscribeOnObservable.dispatch, delay, {\n source: source, subscriber: subscriber\n });\n };\n return SubscribeOnObservable;\n}(Observable));\nexport { SubscribeOnObservable };\n//# sourceMappingURL=SubscribeOnObservable.js.map\n","/** PURE_IMPORTS_START _observable_SubscribeOnObservable PURE_IMPORTS_END */\nimport { SubscribeOnObservable } from '../observable/SubscribeOnObservable';\nexport function subscribeOn(scheduler, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return function subscribeOnOperatorFunction(source) {\n return source.lift(new SubscribeOnOperator(scheduler, delay));\n };\n}\nvar SubscribeOnOperator = /*@__PURE__*/ (function () {\n function SubscribeOnOperator(scheduler, delay) {\n this.scheduler = scheduler;\n this.delay = delay;\n }\n SubscribeOnOperator.prototype.call = function (subscriber, source) {\n return new SubscribeOnObservable(source, this.delay, this.scheduler).subscribe(subscriber);\n };\n return SubscribeOnOperator;\n}());\n//# sourceMappingURL=subscribeOn.js.map\n","import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core';\nimport { asapScheduler, combineLatest, Subject } from 'rxjs';\nimport { startWith, subscribeOn, takeUntil } from 'rxjs/operators';\n\nimport { ScrollService } from 'app/shared/scroll.service';\nimport { TocItem, TocService } from 'app/shared/toc.service';\n\ntype TocType = 'None' | 'Floating' | 'EmbeddedSimple' | 'EmbeddedExpandable';\n\n@Component({\n selector: 'aio-toc',\n templateUrl: 'toc.component.html',\n styles: []\n})\nexport class TocComponent implements OnInit, AfterViewInit, OnDestroy {\n\n activeIndex: number | null = null;\n type: TocType = 'None';\n isCollapsed = true;\n isEmbedded = false;\n @ViewChildren('tocItem') private items: QueryList<ElementRef>;\n private onDestroy = new Subject();\n private primaryMax = 4;\n tocList: TocItem[];\n\n constructor(\n private scrollService: ScrollService,\n elementRef: ElementRef,\n private tocService: TocService) {\n this.isEmbedded = elementRef.nativeElement.className.indexOf('embedded') !== -1;\n }\n\n ngOnInit() {\n this.tocService.tocList\n .pipe(takeUntil(this.onDestroy))\n .subscribe(tocList => {\n this.tocList = tocList;\n const itemCount = count(this.tocList, item => item.level !== 'h1');\n\n this.type = (itemCount > 0) ?\n this.isEmbedded ?\n (itemCount > this.primaryMax) ?\n 'EmbeddedExpandable' :\n 'EmbeddedSimple' :\n 'Floating' :\n 'None';\n });\n }\n\n ngAfterViewInit() {\n if (!this.isEmbedded) {\n // We use the `asap` scheduler because updates to `activeItemIndex` are triggered by DOM changes,\n // which, in turn, are caused by the rendering that happened due to a ChangeDetection.\n // Without asap, we would be updating the model while still in a ChangeDetection handler, which is disallowed by Angular.\n combineLatest(this.tocService.activeItemIndex.pipe(subscribeOn(asapScheduler)), this.items.changes.pipe(startWith(this.items)))\n .pipe(takeUntil(this.onDestroy))\n .subscribe(([index, items]) => {\n this.activeIndex = index;\n if (index === null || index >= items.length) {\n return;\n }\n\n const e = items.toArray()[index].nativeElement;\n const p = e.offsetParent;\n\n const eRect = e.getBoundingClientRect();\n const pRect = p.getBoundingClientRect();\n\n const isInViewport = (eRect.top >= pRect.top) && (eRect.bottom <= pRect.bottom);\n\n if (!isInViewport) {\n p.scrollTop += (eRect.top - pRect.top) - (p.clientHeight / 2);\n }\n });\n }\n }\n\n ngOnDestroy() {\n this.onDestroy.next();\n }\n\n toggle(canScroll = true) {\n this.isCollapsed = !this.isCollapsed;\n if (canScroll && this.isCollapsed) { this.toTop(); }\n }\n\n toTop() {\n this.scrollService.scrollToTop();\n }\n}\n\nfunction count<T>(array: T[], fn: (item: T) => boolean) {\n return array.reduce((result, item) => fn(item) ? result + 1 : result, 0);\n}\n","import { AfterViewInit, ElementRef, OnDestroy, OnInit, QueryList } from '@angular/core';\nimport { asapScheduler, combineLatest, Subject } from 'rxjs';\nimport { startWith, subscribeOn, takeUntil } from 'rxjs/operators';\nimport { ScrollService } from 'app/shared/scroll.service';\nimport { TocService } from 'app/shared/toc.service';\nvar TocComponent = /** @class */ (function () {\n function TocComponent(scrollService, elementRef, tocService) {\n this.scrollService = scrollService;\n this.tocService = tocService;\n this.activeIndex = null;\n this.type = 'None';\n this.isCollapsed = true;\n this.isEmbedded = false;\n this.onDestroy = new Subject();\n this.primaryMax = 4;\n this.isEmbedded = elementRef.nativeElement.className.indexOf('embedded') !== -1;\n }\n TocComponent.prototype.ngOnInit = function () {\n var _this = this;\n this.tocService.tocList\n .pipe(takeUntil(this.onDestroy))\n .subscribe(function (tocList) {\n _this.tocList = tocList;\n var itemCount = count(_this.tocList, function (item) { return item.level !== 'h1'; });\n _this.type = (itemCount > 0) ?\n _this.isEmbedded ?\n (itemCount > _this.primaryMax) ?\n 'EmbeddedExpandable' :\n 'EmbeddedSimple' :\n 'Floating' :\n 'None';\n });\n };\n TocComponent.prototype.ngAfterViewInit = function () {\n var _this = this;\n if (!this.isEmbedded) {\n // We use the `asap` scheduler because updates to `activeItemIndex` are triggered by DOM changes,\n // which, in turn, are caused by the rendering that happened due to a ChangeDetection.\n // Without asap, we would be updating the model while still in a ChangeDetection handler, which is disallowed by Angular.\n combineLatest(this.tocService.activeItemIndex.pipe(subscribeOn(asapScheduler)), this.items.changes.pipe(startWith(this.items)))\n .pipe(takeUntil(this.onDestroy))\n .subscribe(function (_a) {\n var index = _a[0], items = _a[1];\n _this.activeIndex = index;\n if (index === null || index >= items.length) {\n return;\n }\n var e = items.toArray()[index].nativeElement;\n var p = e.offsetParent;\n var eRect = e.getBoundingClientRect();\n var pRect = p.getBoundingClientRect();\n var isInViewport = (eRect.top >= pRect.top) && (eRect.bottom <= pRect.bottom);\n if (!isInViewport) {\n p.scrollTop += (eRect.top - pRect.top) - (p.clientHeight / 2);\n }\n });\n }\n };\n TocComponent.prototype.ngOnDestroy = function () {\n this.onDestroy.next();\n };\n TocComponent.prototype.toggle = function (canScroll) {\n if (canScroll === void 0) { canScroll = true; }\n this.isCollapsed = !this.isCollapsed;\n if (canScroll && this.isCollapsed) {\n this.toTop();\n }\n };\n TocComponent.prototype.toTop = function () {\n this.scrollService.scrollToTop();\n };\n return TocComponent;\n}());\nexport { TocComponent };\nfunction count(array, fn) {\n return array.reduce(function (result, item) { return fn(item) ? result + 1 : result; }, 0);\n}\n","import { NgModule, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { WithCustomElementComponent } from '../element-registry';\nimport { TocComponent } from './toc.component';\n\n@NgModule({\n imports: [ CommonModule, MatIconModule ],\n declarations: [ TocComponent ],\n entryComponents: [ TocComponent ],\n})\nexport class TocModule implements WithCustomElementComponent {\n customElementComponent: Type<any> = TocComponent;\n}\n","/**\n * @fileoverview This file was generated by the Angular template compiler. Do not edit.\n *\n * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}\n * tslint:disable\n */ \nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"../../../../node_modules/@angular/material/icon/typings/index.ngfactory\";\nimport * as i2 from \"@angular/material/icon\";\nimport * as i3 from \"@angular/common\";\nimport * as i4 from \"./toc.component\";\nimport * as i5 from \"../../shared/scroll.service\";\nimport * as i6 from \"../../shared/toc.service\";\nvar styles_TocComponent = [];\nvar RenderType_TocComponent = i0.ɵcrt({ encapsulation: 2, styles: styles_TocComponent, data: {} });\nexport { RenderType_TocComponent as RenderType_TocComponent };\nfunction View_TocComponent_2(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, \"div\", [[\"class\", \"toc-heading embedded\"]], null, null, null, null, null)), (_l()(), i0.ɵted(-1, null, [\" \\u76EE\\u5F55 \"]))], null, null); }\nfunction View_TocComponent_3(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 3, \"button\", [[\"aria-label\", \"Expand/collapse contents\"], [\"class\", \"toc-heading embedded secondary\"], [\"title\", \"Expand/collapse contents\"], [\"type\", \"button\"]], [[1, \"aria-pressed\", 0]], [[null, \"click\"]], function (_v, en, $event) { var ad = true; var _co = _v.component; if ((\"click\" === en)) {\n var pd_0 = (_co.toggle(false) !== false);\n ad = (pd_0 && ad);\n } return ad; }, null, null)), (_l()(), i0.ɵted(-1, null, [\" \\u76EE\\u5F55 \"])), (_l()(), i0.ɵeld(2, 0, null, null, 1, \"mat-icon\", [[\"class\", \"rotating-icon mat-icon notranslate\"], [\"role\", \"img\"], [\"svgIcon\", \"keyboard_arrow_right\"]], [[2, \"collapsed\", null], [2, \"mat-icon-inline\", null], [2, \"mat-icon-no-color\", null]], null, null, i1.View_MatIcon_0, i1.RenderType_MatIcon)), i0.ɵdid(3, 9158656, null, 0, i2.MatIcon, [i0.ElementRef, i2.MatIconRegistry, [8, null], [2, i2.MAT_ICON_LOCATION]], { svgIcon: [0, \"svgIcon\"] }, null)], function (_ck, _v) { var currVal_4 = \"keyboard_arrow_right\"; _ck(_v, 3, 0, currVal_4); }, function (_ck, _v) { var _co = _v.component; var currVal_0 = !_co.isCollapsed; _ck(_v, 0, 0, currVal_0); var currVal_1 = _co.isCollapsed; var currVal_2 = i0.ɵnov(_v, 3).inline; var currVal_3 = (((i0.ɵnov(_v, 3).color !== \"primary\") && (i0.ɵnov(_v, 3).color !== \"accent\")) && (i0.ɵnov(_v, 3).color !== \"warn\")); _ck(_v, 2, 0, currVal_1, currVal_2, currVal_3); }); }\nfunction View_TocComponent_5(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, [[1, 0], [\"tocItem\", 1]], null, 1, \"li\", [], [[8, \"title\", 0], [8, \"className\", 0], [2, \"secondary\", null], [2, \"active\", null]], null, null, null, null)), (_l()(), i0.ɵeld(1, 0, null, null, 0, \"a\", [], [[8, \"href\", 4], [8, \"innerHTML\", 1]], null, null, null, null))], null, function (_ck, _v) { var _co = _v.component; var currVal_0 = i0.ɵinlineInterpolate(1, \"\", _v.parent.context.$implicit.title, \"\"); var currVal_1 = i0.ɵinlineInterpolate(1, \"\", _v.parent.context.$implicit.level, \"\"); var currVal_2 = ((_co.type === \"EmbeddedExpandable\") && (_v.parent.context.index >= _co.primaryMax)); var currVal_3 = (_v.parent.context.index === _co.activeIndex); _ck(_v, 0, 0, currVal_0, currVal_1, currVal_2, currVal_3); var currVal_4 = _v.parent.context.$implicit.href; var currVal_5 = _v.parent.context.$implicit.content; _ck(_v, 1, 0, currVal_4, currVal_5); }); }\nfunction View_TocComponent_4(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 2, null, null, null, null, null, null, null)), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_TocComponent_5)), i0.ɵdid(2, 16384, null, 0, i3.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, \"ngIf\"] }, null), (_l()(), i0.ɵand(0, null, null, 0))], function (_ck, _v) { var _co = _v.component; var currVal_0 = ((_co.type === \"Floating\") || (_v.context.$implicit.level !== \"h1\")); _ck(_v, 2, 0, currVal_0); }, null); }\nfunction View_TocComponent_6(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 0, \"button\", [[\"aria-label\", \"Expand/collapse contents\"], [\"class\", \"toc-more-items embedded material-icons\"], [\"title\", \"Expand/collapse contents\"], [\"type\", \"button\"]], [[2, \"collapsed\", null], [1, \"aria-pressed\", 0]], [[null, \"click\"]], function (_v, en, $event) { var ad = true; var _co = _v.component; if ((\"click\" === en)) {\n var pd_0 = (_co.toggle() !== false);\n ad = (pd_0 && ad);\n } return ad; }, null, null))], null, function (_ck, _v) { var _co = _v.component; var currVal_0 = _co.isCollapsed; var currVal_1 = !_co.isCollapsed; _ck(_v, 0, 0, currVal_0, currVal_1); }); }\nfunction View_TocComponent_1(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 9, \"div\", [[\"class\", \"toc-inner no-print\"]], [[2, \"collapsed\", null]], null, null, null, null)), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_TocComponent_2)), i0.ɵdid(2, 16384, null, 0, i3.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, \"ngIf\"] }, null), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_TocComponent_3)), i0.ɵdid(4, 16384, null, 0, i3.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, \"ngIf\"] }, null), (_l()(), i0.ɵeld(5, 0, null, null, 2, \"ul\", [[\"class\", \"toc-list\"]], [[2, \"embedded\", null]], null, null, null, null)), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_TocComponent_4)), i0.ɵdid(7, 278528, null, 0, i3.NgForOf, [i0.ViewContainerRef, i0.TemplateRef, i0.IterableDiffers], { ngForOf: [0, \"ngForOf\"] }, null), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_TocComponent_6)), i0.ɵdid(9, 16384, null, 0, i3.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, \"ngIf\"] }, null)], function (_ck, _v) { var _co = _v.component; var currVal_1 = (_co.type === \"EmbeddedSimple\"); _ck(_v, 2, 0, currVal_1); var currVal_2 = (_co.type === \"EmbeddedExpandable\"); _ck(_v, 4, 0, currVal_2); var currVal_4 = _co.tocList; _ck(_v, 7, 0, currVal_4); var currVal_5 = (_co.type === \"EmbeddedExpandable\"); _ck(_v, 9, 0, currVal_5); }, function (_ck, _v) { var _co = _v.component; var currVal_0 = _co.isCollapsed; _ck(_v, 0, 0, currVal_0); var currVal_3 = (_co.type !== \"Floating\"); _ck(_v, 5, 0, currVal_3); }); }\nexport function View_TocComponent_0(_l) { return i0.ɵvid(0, [i0.ɵqud(671088640, 1, { items: 1 }), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_TocComponent_1)), i0.ɵdid(2, 16384, null, 0, i3.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, \"ngIf\"] }, null)], function (_ck, _v) { var _co = _v.component; var currVal_0 = (_co.type !== \"None\"); _ck(_v, 2, 0, currVal_0); }, null); }\nexport function View_TocComponent_Host_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, \"aio-toc\", [], null, null, null, View_TocComponent_0, RenderType_TocComponent)), i0.ɵdid(1, 4440064, null, 0, i4.TocComponent, [i5.ScrollService, i0.ElementRef, i6.TocService], null, null)], function (_ck, _v) { _ck(_v, 1, 0); }, null); }\nvar TocComponentNgFactory = i0.ɵccf(\"aio-toc\", i4.TocComponent, View_TocComponent_Host_0, {}, {}, []);\nexport { TocComponentNgFactory as TocComponentNgFactory };\n","<div *ngIf=\"type !== 'None'\" class=\"toc-inner no-print\" [class.collapsed]=\"isCollapsed\">\n\n <div *ngIf=\"type === 'EmbeddedSimple'\" class=\"toc-heading embedded\">\n 目录\n </div>\n\n <button *ngIf=\"type === 'EmbeddedExpandable'\" type=\"button\" (click)=\"toggle(false)\"\n class=\"toc-heading embedded secondary\"\n title=\"Expand/collapse contents\"\n aria-label=\"Expand/collapse contents\"\n [attr.aria-pressed]=\"!isCollapsed\">\n 目录\n <mat-icon class=\"rotating-icon\" svgIcon=\"keyboard_arrow_right\" [class.collapsed]=\"isCollapsed\"></mat-icon>\n </button>\n\n <ul class=\"toc-list\" [class.embedded]=\"type !== 'Floating'\">\n <ng-container *ngFor=\"let toc of tocList; let i = index\">\n <li #tocItem title=\"{{toc.title}}\" *ngIf=\"type === 'Floating' || toc.level !== 'h1'\"\n class=\"{{toc.level}}\" [class.secondary]=\"type === 'EmbeddedExpandable' && i >= primaryMax\" [class.active]=\"i === activeIndex\">\n <a [href]=\"toc.href\" [innerHTML]=\"toc.content\"></a>\n </li>\n </ng-container>\n </ul>\n\n <button *ngIf=\"type === 'EmbeddedExpandable'\" type=\"button\" (click)=\"toggle()\"\n class=\"toc-more-items embedded material-icons\" [class.collapsed]=\"isCollapsed\"\n title=\"Expand/collapse contents\"\n aria-label=\"Expand/collapse contents\"\n [attr.aria-pressed]=\"!isCollapsed\">\n </button>\n</div>\n","/**\n * @fileoverview This file was generated by the Angular template compiler. Do not edit.\n *\n * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}\n * tslint:disable\n */ \nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"./toc.module\";\nimport * as i2 from \"./toc.component.ngfactory\";\nimport * as i3 from \"@angular/common\";\nimport * as i4 from \"@angular/cdk/bidi\";\nimport * as i5 from \"@angular/material/core\";\nimport * as i6 from \"@angular/platform-browser\";\nimport * as i7 from \"@angular/material/icon\";\nvar TocModuleNgFactory = i0.ɵcmf(i1.TocModule, [], function (_l) { return i0.ɵmod([i0.ɵmpd(512, i0.ComponentFactoryResolver, i0.ɵCodegenComponentFactoryResolver, [[8, [i2.TocComponentNgFactory]], [3, i0.ComponentFactoryResolver], i0.NgModuleRef]), i0.ɵmpd(4608, i3.NgLocalization, i3.NgLocaleLocalization, [i0.LOCALE_ID, [2, i3.ɵangular_packages_common_common_a]]), i0.ɵmpd(1073742336, i3.CommonModule, i3.CommonModule, []), i0.ɵmpd(1073742336, i4.BidiModule, i4.BidiModule, []), i0.ɵmpd(1073742336, i5.MatCommonModule, i5.MatCommonModule, [[2, i5.MATERIAL_SANITY_CHECKS], [2, i6.HAMMER_LOADER]]), i0.ɵmpd(1073742336, i7.MatIconModule, i7.MatIconModule, []), i0.ɵmpd(1073742336, i1.TocModule, i1.TocModule, [])]); });\nexport { TocModuleNgFactory as TocModuleNgFactory };\n"],"sourceRoot":""}