@mxtommy/kip 3.9.0-beta.2 → 3.9.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/.github/copilot-instructions.md +1 -1
  2. package/.github/instructions/angular.instructions.md +46 -0
  3. package/README.md +49 -12
  4. package/package.json +2 -4
  5. package/public/3rdpartylicenses.txt +77 -77
  6. package/public/app-help.component.css.map +7 -0
  7. package/public/app.component.css.map +7 -0
  8. package/public/assets/help-docs/configuration.md +4 -4
  9. package/public/assets/help-docs/dashboards.md +4 -2
  10. package/public/assets/svg/icons.svg +1 -1
  11. package/public/boolean-control-config.component.css.map +7 -0
  12. package/public/boolean-multicontrol-options.component.css.map +7 -0
  13. package/public/chunk-3EWIS24B.js +5237 -0
  14. package/public/chunk-3EWIS24B.js.map +1 -0
  15. package/public/chunk-3VR3EA35.js +1022 -0
  16. package/public/chunk-3VR3EA35.js.map +1 -0
  17. package/public/chunk-63ILPRXC.js +2091 -0
  18. package/public/chunk-63ILPRXC.js.map +1 -0
  19. package/public/chunk-65ZWQBS6.js +3102 -0
  20. package/public/chunk-65ZWQBS6.js.map +1 -0
  21. package/public/chunk-B3LKEWZP.js +4950 -0
  22. package/public/chunk-B3LKEWZP.js.map +1 -0
  23. package/public/chunk-BIBIW64D.js +16773 -0
  24. package/public/chunk-BIBIW64D.js.map +1 -0
  25. package/public/chunk-BM53SC5N.js +77 -0
  26. package/public/chunk-BM53SC5N.js.map +7 -0
  27. package/public/chunk-D7ILNFDM.js +3059 -0
  28. package/public/chunk-D7ILNFDM.js.map +1 -0
  29. package/public/chunk-E24UNLSJ.js +2228 -0
  30. package/public/chunk-E24UNLSJ.js.map +1 -0
  31. package/public/chunk-J42S2ELC.js +5927 -0
  32. package/public/chunk-J42S2ELC.js.map +1 -0
  33. package/public/chunk-KC22A6VH.js +17 -0
  34. package/public/chunk-KC22A6VH.js.map +7 -0
  35. package/public/chunk-MCEJWZB2.js +116 -0
  36. package/public/chunk-MCEJWZB2.js.map +1 -0
  37. package/public/chunk-NBF6SE6O.js +89 -0
  38. package/public/chunk-NBF6SE6O.js.map +7 -0
  39. package/public/chunk-QC7VGVAR.js +343 -0
  40. package/public/chunk-QC7VGVAR.js.map +7 -0
  41. package/public/chunk-SDOP6T56.js +42377 -0
  42. package/public/chunk-SDOP6T56.js.map +1 -0
  43. package/public/chunk-U2DCSTRY.js +159 -0
  44. package/public/chunk-U2DCSTRY.js.map +7 -0
  45. package/public/chunk-UHVNAEXC.js +4752 -0
  46. package/public/chunk-UHVNAEXC.js.map +1 -0
  47. package/public/chunk-UQYTD5AC.js +2723 -0
  48. package/public/chunk-UQYTD5AC.js.map +1 -0
  49. package/public/chunk-XSABJ5NZ.js +272 -0
  50. package/public/chunk-XSABJ5NZ.js.map +7 -0
  51. package/public/chunk-Y6N6O2IP.js +19852 -0
  52. package/public/chunk-Y6N6O2IP.js.map +1 -0
  53. package/public/chunk-YGJLBLOX.js +2708 -0
  54. package/public/chunk-YGJLBLOX.js.map +1 -0
  55. package/public/chunk-YT33DHC3.js +591 -0
  56. package/public/chunk-YT33DHC3.js.map +7 -0
  57. package/public/chunk-YZXYVP72.js +4934 -0
  58. package/public/chunk-YZXYVP72.js.map +1 -0
  59. package/public/chunk-ZEHRDSTB.js +13727 -0
  60. package/public/chunk-ZEHRDSTB.js.map +1 -0
  61. package/public/config.component.css.map +7 -0
  62. package/public/dashboard-scroller.component.css.map +7 -0
  63. package/public/dashboard.component.css.map +7 -0
  64. package/public/dashboards-editor.component.css.map +7 -0
  65. package/public/data-inspector-row.component.css.map +7 -0
  66. package/public/data-inspector.component.css.map +7 -0
  67. package/public/dataset-chart-options.component.css.map +7 -0
  68. package/public/datasets.component.css.map +7 -0
  69. package/public/dialog-confirmation.component.css.map +7 -0
  70. package/public/dialog-dashboard-page-editor.component.css.map +7 -0
  71. package/public/dialog-frame.component.css.map +7 -0
  72. package/public/dialog-name.component.css.map +7 -0
  73. package/public/display-chart-options.component.css.map +7 -0
  74. package/public/display.component.css.map +7 -0
  75. package/public/gauge-steel.component.css.map +7 -0
  76. package/public/home.component.css.map +7 -0
  77. package/public/index.html +19 -17
  78. package/public/main.js +36423 -0
  79. package/public/main.js.map +1 -0
  80. package/public/menu-actions.component.css.map +7 -0
  81. package/public/menu-notifications.component.css.map +7 -0
  82. package/public/minichart.component.css.map +7 -0
  83. package/public/modal-user-credential.component.css.map +7 -0
  84. package/public/modal-widget-config.component.css.map +7 -0
  85. package/public/notification-badge.component.css.map +7 -0
  86. package/public/page-header.component.css.map +7 -0
  87. package/public/path-control-config.component.css.map +7 -0
  88. package/public/paths-options.component.css.map +7 -0
  89. package/public/polyfills.js +4422 -0
  90. package/public/polyfills.js.map +1 -0
  91. package/public/select-autopilot.component.css.map +7 -0
  92. package/public/select-icon.component.css.map +7 -0
  93. package/public/settings.component.css.map +7 -0
  94. package/public/signalk.component.css.map +7 -0
  95. package/public/styles.css +1651 -0
  96. package/public/styles.css.map +7 -0
  97. package/public/svg-autopilot.component.css.map +7 -0
  98. package/public/svg-racesteer.component.css.map +7 -0
  99. package/public/svg-simple-linear-gauge.component.css.map +7 -0
  100. package/public/svg-windsteer.component.css.map +7 -0
  101. package/public/tile-large-icon.component.css.map +7 -0
  102. package/public/units.component.css.map +7 -0
  103. package/public/upgrade-config.component.css.map +7 -0
  104. package/public/widget-autopilot.component.css.map +7 -0
  105. package/public/widget-boolean-switch.component.css.map +7 -0
  106. package/public/widget-datetime.component.css.map +7 -0
  107. package/public/widget-freeboardsk.component.css.map +7 -0
  108. package/public/widget-gauge-ng-compass.component.css.map +7 -0
  109. package/public/widget-gauge-ng-linear.component.css.map +7 -0
  110. package/public/widget-gauge-ng-radial.component.css.map +7 -0
  111. package/public/widget-gauge-steel.component.css.map +7 -0
  112. package/public/widget-horizon.component.css.map +7 -0
  113. package/public/widget-host.component.css.map +7 -0
  114. package/public/widget-iframe.component.css.map +7 -0
  115. package/public/widget-label.component.css.map +7 -0
  116. package/public/widget-list-card.component.css.map +7 -0
  117. package/public/widget-numeric.component.css.map +7 -0
  118. package/public/widget-position.component.css.map +7 -0
  119. package/public/widget-race-timer.component.css.map +7 -0
  120. package/public/widget-racer-line.component.css.map +7 -0
  121. package/public/widget-racer-timer.component.css.map +7 -0
  122. package/public/widget-simple-linear.component.css.map +7 -0
  123. package/public/widget-slider.component.css.map +7 -0
  124. package/public/widget-text.component.css.map +7 -0
  125. package/public/widget-title.component.css.map +7 -0
  126. package/public/widget-tutorial.component.css.map +7 -0
  127. package/public/widgets-list.component.css.map +7 -0
  128. package/public/assets/hammer.min.js +0 -7
  129. package/public/chunk-2YVW3TBK.js +0 -2
  130. package/public/chunk-35L7BBBD.js +0 -15
  131. package/public/chunk-3LEMFOCV.js +0 -3
  132. package/public/chunk-3LJAKLLW.js +0 -1
  133. package/public/chunk-4JJLPUET.js +0 -60
  134. package/public/chunk-CBUY7NMR.js +0 -2
  135. package/public/chunk-CQXWGD3T.js +0 -2
  136. package/public/chunk-EUFDL4TJ.js +0 -6
  137. package/public/chunk-FBFTGVZ6.js +0 -1
  138. package/public/chunk-HCXH72CD.js +0 -5
  139. package/public/chunk-JY3WVS7C.js +0 -2
  140. package/public/chunk-KTDDP73O.js +0 -2
  141. package/public/chunk-NMEZOCU2.js +0 -1
  142. package/public/chunk-NS2FPVWM.js +0 -4
  143. package/public/chunk-OSYHJB4F.js +0 -11
  144. package/public/chunk-PKNLASTF.js +0 -4
  145. package/public/chunk-Q2Y75POI.js +0 -1
  146. package/public/chunk-RRTCHHRC.js +0 -3
  147. package/public/chunk-TA4GACKT.js +0 -4
  148. package/public/chunk-TXPLRBW5.js +0 -2
  149. package/public/chunk-VHFBF47T.js +0 -1
  150. package/public/chunk-VYUMZVH2.js +0 -2
  151. package/public/chunk-XRGAX4LS.js +0 -2
  152. package/public/chunk-YNJRIFUM.js +0 -1
  153. package/public/chunk-ZBCOJLI4.js +0 -6
  154. package/public/main-XM5EHMUE.js +0 -50
  155. package/public/polyfills-KH22MU6U.js +0 -2
  156. package/public/styles-RECKN66R.css +0 -1
  157. /package/public/media/{KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP-ILKS6RVC.woff2 → KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2} +0 -0
  158. /package/public/media/{KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ-MJ3CERJ6.woff2 → KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2} +0 -0
  159. /package/public/media/{KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP-UW3XWY7P.woff2 → KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2} +0 -0
  160. /package/public/media/{KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP-U3JTBV4H.woff2 → KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP.woff2} +0 -0
  161. /package/public/media/{KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP-36ULTGLY.woff2 → KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP.woff2} +0 -0
  162. /package/public/media/{KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP-5NJLO2HW.woff2 → KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2} +0 -0
  163. /package/public/media/{KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP-2EL65J2O.woff2 → KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2} +0 -0
  164. /package/public/media/{KFOlCnqEu92Fr1MmSU5fABc4AMP6lbBP-XWLWMQVU.woff2 → KFOlCnqEu92Fr1MmSU5fABc4AMP6lbBP.woff2} +0 -0
  165. /package/public/media/{KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ-PWGJWDFE.woff2 → KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2} +0 -0
  166. /package/public/media/{KFOlCnqEu92Fr1MmSU5fBxc4AMP6lbBP-ITB7NUJC.woff2 → KFOlCnqEu92Fr1MmSU5fBxc4AMP6lbBP.woff2} +0 -0
  167. /package/public/media/{KFOlCnqEu92Fr1MmSU5fCBc4AMP6lbBP-32PLHKPQ.woff2 → KFOlCnqEu92Fr1MmSU5fCBc4AMP6lbBP.woff2} +0 -0
  168. /package/public/media/{KFOlCnqEu92Fr1MmSU5fCRc4AMP6lbBP-QPSNQEDD.woff2 → KFOlCnqEu92Fr1MmSU5fCRc4AMP6lbBP.woff2} +0 -0
  169. /package/public/media/{KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP-JKBSJZY3.woff2 → KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2} +0 -0
  170. /package/public/media/{KFOlCnqEu92Fr1MmSU5fCxc4AMP6lbBP-OG5AHRIX.woff2 → KFOlCnqEu92Fr1MmSU5fCxc4AMP6lbBP.woff2} +0 -0
  171. /package/public/media/{KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz-PPTELUJT.woff2 → KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2} +0 -0
  172. /package/public/media/{KFOmCnqEu92Fr1Mu4mxKKTU1Kg-SNGEW7FX.woff2 → KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2} +0 -0
  173. /package/public/media/{KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz-DRL4U32S.woff2 → KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2} +0 -0
  174. /package/public/media/{KFOmCnqEu92Fr1Mu72xKKTU1Kvnz-PRJ7OQMU.woff2 → KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2} +0 -0
  175. /package/public/media/{KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz-HW6RMPJ3.woff2 → KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2} +0 -0
  176. /package/public/media/{KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz-KZD6JQRT.woff2 → KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2} +0 -0
  177. /package/public/media/{KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz-Z72STTMG.woff2 → KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2} +0 -0
  178. /package/public/media/{flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ-CN2J7AYH.woff2 → flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2} +0 -0
@@ -0,0 +1,4934 @@
1
+ import {
2
+ DomSanitizer
3
+ } from "./chunk-UQYTD5AC.js";
4
+ import {
5
+ ApplicationRef,
6
+ CdkScrollableModule,
7
+ ChangeDetectionStrategy,
8
+ ChangeDetectorRef,
9
+ Component,
10
+ ContentChild,
11
+ ContentChildren,
12
+ DOCUMENT,
13
+ DOWN_ARROW,
14
+ Directionality,
15
+ Directive,
16
+ DomPortalOutlet,
17
+ ENTER,
18
+ ESCAPE,
19
+ ElementRef,
20
+ EventEmitter,
21
+ FocusKeyManager,
22
+ FocusMonitor,
23
+ HttpClient,
24
+ Inject,
25
+ Injectable,
26
+ InjectionToken,
27
+ Injector,
28
+ Input,
29
+ LEFT_ARROW,
30
+ MatCommonModule,
31
+ MatRipple,
32
+ MatRippleModule,
33
+ NgModule,
34
+ NgZone,
35
+ Optional,
36
+ Output,
37
+ OverlayConfig,
38
+ OverlayModule,
39
+ PLATFORM_ID,
40
+ Pipe,
41
+ QueryList,
42
+ RIGHT_ARROW,
43
+ Renderer2,
44
+ SPACE,
45
+ ScrollDispatcher,
46
+ SecurityContext,
47
+ Subject,
48
+ Subscription,
49
+ TemplatePortal,
50
+ TemplateRef,
51
+ UP_ARROW,
52
+ ViewChild,
53
+ ViewContainerRef,
54
+ ViewEncapsulation,
55
+ ViewportRuler,
56
+ _CdkPrivateStyleLoader,
57
+ _IdGenerator,
58
+ _StructuralStylesLoader,
59
+ __async,
60
+ __spreadProps,
61
+ __spreadValues,
62
+ _animationsDisabled,
63
+ _getEventTarget,
64
+ _getShadowRoot,
65
+ afterNextRender,
66
+ booleanAttribute,
67
+ computed,
68
+ createFlexibleConnectedPositionStrategy,
69
+ createOverlayRef,
70
+ createRepositionScrollStrategy,
71
+ distinctUntilChanged,
72
+ filter,
73
+ first,
74
+ hasModifierKey,
75
+ inject,
76
+ isFakeMousedownFromScreenReader,
77
+ isFakeTouchstartFromScreenReader,
78
+ isPlatformBrowser,
79
+ map,
80
+ mapTo,
81
+ merge,
82
+ of,
83
+ setClassMetadata,
84
+ shareReplay,
85
+ skipWhile,
86
+ startWith,
87
+ switchMap,
88
+ take,
89
+ takeUntil,
90
+ timer,
91
+ toSignal,
92
+ ɵɵInheritDefinitionFeature,
93
+ ɵɵNgOnChangesFeature,
94
+ ɵɵProvidersFeature,
95
+ ɵɵadvance,
96
+ ɵɵattribute,
97
+ ɵɵclassMap,
98
+ ɵɵclassProp,
99
+ ɵɵconditional,
100
+ ɵɵconditionalCreate,
101
+ ɵɵcontentQuery,
102
+ ɵɵdefineComponent,
103
+ ɵɵdefineDirective,
104
+ ɵɵdefineInjectable,
105
+ ɵɵdefineInjector,
106
+ ɵɵdefineNgModule,
107
+ ɵɵdefinePipe,
108
+ ɵɵdirectiveInject,
109
+ ɵɵdomElementEnd,
110
+ ɵɵdomElementStart,
111
+ ɵɵdomListener,
112
+ ɵɵdomProperty,
113
+ ɵɵdomTemplate,
114
+ ɵɵelement,
115
+ ɵɵelementEnd,
116
+ ɵɵelementStart,
117
+ ɵɵgetCurrentView,
118
+ ɵɵinject,
119
+ ɵɵinvalidFactory,
120
+ ɵɵlistener,
121
+ ɵɵloadQuery,
122
+ ɵɵnamespaceSVG,
123
+ ɵɵnextContext,
124
+ ɵɵprojection,
125
+ ɵɵprojectionDef,
126
+ ɵɵproperty,
127
+ ɵɵqueryRefresh,
128
+ ɵɵresetView,
129
+ ɵɵrestoreView,
130
+ ɵɵtext,
131
+ ɵɵtextInterpolate,
132
+ ɵɵviewQuery
133
+ } from "./chunk-SDOP6T56.js";
134
+
135
+ // node_modules/marked/lib/marked.esm.js
136
+ function _getDefaults() {
137
+ return {
138
+ async: false,
139
+ breaks: false,
140
+ extensions: null,
141
+ gfm: true,
142
+ hooks: null,
143
+ pedantic: false,
144
+ renderer: null,
145
+ silent: false,
146
+ tokenizer: null,
147
+ walkTokens: null
148
+ };
149
+ }
150
+ var _defaults = _getDefaults();
151
+ function changeDefaults(newDefaults) {
152
+ _defaults = newDefaults;
153
+ }
154
+ var noopTest = { exec: () => null };
155
+ function edit(regex, opt = "") {
156
+ let source = typeof regex === "string" ? regex : regex.source;
157
+ const obj = {
158
+ replace: (name, val) => {
159
+ let valSource = typeof val === "string" ? val : val.source;
160
+ valSource = valSource.replace(other.caret, "$1");
161
+ source = source.replace(name, valSource);
162
+ return obj;
163
+ },
164
+ getRegex: () => {
165
+ return new RegExp(source, opt);
166
+ }
167
+ };
168
+ return obj;
169
+ }
170
+ var other = {
171
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
172
+ outputLinkReplace: /\\([\[\]])/g,
173
+ indentCodeCompensation: /^(\s+)(?:```)/,
174
+ beginningSpace: /^\s+/,
175
+ endingHash: /#$/,
176
+ startingSpaceChar: /^ /,
177
+ endingSpaceChar: / $/,
178
+ nonSpaceChar: /[^ ]/,
179
+ newLineCharGlobal: /\n/g,
180
+ tabCharGlobal: /\t/g,
181
+ multipleSpaceGlobal: /\s+/g,
182
+ blankLine: /^[ \t]*$/,
183
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
184
+ blockquoteStart: /^ {0,3}>/,
185
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
186
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
187
+ listReplaceTabs: /^\t+/,
188
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
189
+ listIsTask: /^\[[ xX]\] /,
190
+ listReplaceTask: /^\[[ xX]\] +/,
191
+ anyLine: /\n.*\n/,
192
+ hrefBrackets: /^<(.*)>$/,
193
+ tableDelimiter: /[:|]/,
194
+ tableAlignChars: /^\||\| *$/g,
195
+ tableRowBlankLine: /\n[ \t]*$/,
196
+ tableAlignRight: /^ *-+: *$/,
197
+ tableAlignCenter: /^ *:-+: *$/,
198
+ tableAlignLeft: /^ *:-+ *$/,
199
+ startATag: /^<a /i,
200
+ endATag: /^<\/a>/i,
201
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
202
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
203
+ startAngleBracket: /^</,
204
+ endAngleBracket: />$/,
205
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
206
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
207
+ escapeTest: /[&<>"']/,
208
+ escapeReplace: /[&<>"']/g,
209
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
210
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
211
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,
212
+ caret: /(^|[^\[])\^/g,
213
+ percentDecode: /%25/g,
214
+ findPipe: /\|/g,
215
+ splitPipe: / \|/,
216
+ slashPipe: /\\\|/g,
217
+ carriageReturn: /\r\n|\r/g,
218
+ spaceLine: /^ +$/gm,
219
+ notSpaceStart: /^\S*/,
220
+ endingNewline: /\n$/,
221
+ listItemRegex: (bull) => new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`),
222
+ nextBulletRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
223
+ hrRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
224
+ fencesBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`),
225
+ headingBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`),
226
+ htmlBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, "i")
227
+ };
228
+ var newline = /^(?:[ \t]*(?:\n|$))+/;
229
+ var blockCode = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
230
+ var fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
231
+ var hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
232
+ var heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
233
+ var bullet = /(?:[*+-]|\d{1,9}[.)])/;
234
+ var lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
235
+ var lheading = edit(lheadingCore).replace(/bull/g, bullet).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
236
+ var lheadingGfm = edit(lheadingCore).replace(/bull/g, bullet).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
237
+ var _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
238
+ var blockText = /^[^\n]+/;
239
+ var _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
240
+ var def = edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
241
+ var list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex();
242
+ var _tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
243
+ var _comment = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
244
+ var html = edit(
245
+ "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
246
+ "i"
247
+ ).replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
248
+ var paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
249
+ var blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex();
250
+ var blockNormal = {
251
+ blockquote,
252
+ code: blockCode,
253
+ def,
254
+ fences,
255
+ heading,
256
+ hr,
257
+ html,
258
+ lheading,
259
+ list,
260
+ newline,
261
+ paragraph,
262
+ table: noopTest,
263
+ text: blockText
264
+ };
265
+ var gfmTable = edit(
266
+ "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
267
+ ).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
268
+ var blockGfm = __spreadProps(__spreadValues({}, blockNormal), {
269
+ lheading: lheadingGfm,
270
+ table: gfmTable,
271
+ paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex()
272
+ });
273
+ var blockPedantic = __spreadProps(__spreadValues({}, blockNormal), {
274
+ html: edit(
275
+ `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
276
+ ).replace("comment", _comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
277
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
278
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
279
+ fences: noopTest,
280
+ // fences not supported
281
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
282
+ paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
283
+ });
284
+ var escape = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
285
+ var inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
286
+ var br = /^( {2,}|\\)\n(?!\s*$)/;
287
+ var inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
288
+ var _punctuation = /[\p{P}\p{S}]/u;
289
+ var _punctuationOrSpace = /[\s\p{P}\p{S}]/u;
290
+ var _notPunctuationOrSpace = /[^\s\p{P}\p{S}]/u;
291
+ var punctuation = edit(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, _punctuationOrSpace).getRegex();
292
+ var _punctuationGfmStrongEm = /(?!~)[\p{P}\p{S}]/u;
293
+ var _punctuationOrSpaceGfmStrongEm = /(?!~)[\s\p{P}\p{S}]/u;
294
+ var _notPunctuationOrSpaceGfmStrongEm = /(?:[^\s\p{P}\p{S}]|~)/u;
295
+ var blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
296
+ var emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
297
+ var emStrongLDelim = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuation).getRegex();
298
+ var emStrongLDelimGfm = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuationGfmStrongEm).getRegex();
299
+ var emStrongRDelimAstCore = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
300
+ var emStrongRDelimAst = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
301
+ var emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm).replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm).replace(/punct/g, _punctuationGfmStrongEm).getRegex();
302
+ var emStrongRDelimUnd = edit(
303
+ "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
304
+ "gu"
305
+ ).replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
306
+ var anyPunctuation = edit(/\\(punct)/, "gu").replace(/punct/g, _punctuation).getRegex();
307
+ var autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
308
+ var _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex();
309
+ var tag = edit(
310
+ "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
311
+ ).replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
312
+ var _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
313
+ var link = edit(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
314
+ var reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex();
315
+ var nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex();
316
+ var reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex();
317
+ var inlineNormal = {
318
+ _backpedal: noopTest,
319
+ // only used for GFM url
320
+ anyPunctuation,
321
+ autolink,
322
+ blockSkip,
323
+ br,
324
+ code: inlineCode,
325
+ del: noopTest,
326
+ emStrongLDelim,
327
+ emStrongRDelimAst,
328
+ emStrongRDelimUnd,
329
+ escape,
330
+ link,
331
+ nolink,
332
+ punctuation,
333
+ reflink,
334
+ reflinkSearch,
335
+ tag,
336
+ text: inlineText,
337
+ url: noopTest
338
+ };
339
+ var inlinePedantic = __spreadProps(__spreadValues({}, inlineNormal), {
340
+ link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(),
341
+ reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex()
342
+ });
343
+ var inlineGfm = __spreadProps(__spreadValues({}, inlineNormal), {
344
+ emStrongRDelimAst: emStrongRDelimAstGfm,
345
+ emStrongLDelim: emStrongLDelimGfm,
346
+ url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
347
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
348
+ del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
349
+ text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
350
+ });
351
+ var inlineBreaks = __spreadProps(__spreadValues({}, inlineGfm), {
352
+ br: edit(br).replace("{2,}", "*").getRegex(),
353
+ text: edit(inlineGfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
354
+ });
355
+ var block = {
356
+ normal: blockNormal,
357
+ gfm: blockGfm,
358
+ pedantic: blockPedantic
359
+ };
360
+ var inline = {
361
+ normal: inlineNormal,
362
+ gfm: inlineGfm,
363
+ breaks: inlineBreaks,
364
+ pedantic: inlinePedantic
365
+ };
366
+ var escapeReplacements = {
367
+ "&": "&amp;",
368
+ "<": "&lt;",
369
+ ">": "&gt;",
370
+ '"': "&quot;",
371
+ "'": "&#39;"
372
+ };
373
+ var getEscapeReplacement = (ch) => escapeReplacements[ch];
374
+ function escape2(html2, encode) {
375
+ if (encode) {
376
+ if (other.escapeTest.test(html2)) {
377
+ return html2.replace(other.escapeReplace, getEscapeReplacement);
378
+ }
379
+ } else {
380
+ if (other.escapeTestNoEncode.test(html2)) {
381
+ return html2.replace(other.escapeReplaceNoEncode, getEscapeReplacement);
382
+ }
383
+ }
384
+ return html2;
385
+ }
386
+ function cleanUrl(href) {
387
+ try {
388
+ href = encodeURI(href).replace(other.percentDecode, "%");
389
+ } catch {
390
+ return null;
391
+ }
392
+ return href;
393
+ }
394
+ function splitCells(tableRow, count) {
395
+ const row = tableRow.replace(other.findPipe, (match, offset, str) => {
396
+ let escaped = false;
397
+ let curr = offset;
398
+ while (--curr >= 0 && str[curr] === "\\") escaped = !escaped;
399
+ if (escaped) {
400
+ return "|";
401
+ } else {
402
+ return " |";
403
+ }
404
+ }), cells = row.split(other.splitPipe);
405
+ let i = 0;
406
+ if (!cells[0].trim()) {
407
+ cells.shift();
408
+ }
409
+ if (cells.length > 0 && !cells.at(-1)?.trim()) {
410
+ cells.pop();
411
+ }
412
+ if (count) {
413
+ if (cells.length > count) {
414
+ cells.splice(count);
415
+ } else {
416
+ while (cells.length < count) cells.push("");
417
+ }
418
+ }
419
+ for (; i < cells.length; i++) {
420
+ cells[i] = cells[i].trim().replace(other.slashPipe, "|");
421
+ }
422
+ return cells;
423
+ }
424
+ function rtrim(str, c, invert) {
425
+ const l = str.length;
426
+ if (l === 0) {
427
+ return "";
428
+ }
429
+ let suffLen = 0;
430
+ while (suffLen < l) {
431
+ const currChar = str.charAt(l - suffLen - 1);
432
+ if (currChar === c && !invert) {
433
+ suffLen++;
434
+ } else if (currChar !== c && invert) {
435
+ suffLen++;
436
+ } else {
437
+ break;
438
+ }
439
+ }
440
+ return str.slice(0, l - suffLen);
441
+ }
442
+ function findClosingBracket(str, b) {
443
+ if (str.indexOf(b[1]) === -1) {
444
+ return -1;
445
+ }
446
+ let level = 0;
447
+ for (let i = 0; i < str.length; i++) {
448
+ if (str[i] === "\\") {
449
+ i++;
450
+ } else if (str[i] === b[0]) {
451
+ level++;
452
+ } else if (str[i] === b[1]) {
453
+ level--;
454
+ if (level < 0) {
455
+ return i;
456
+ }
457
+ }
458
+ }
459
+ if (level > 0) {
460
+ return -2;
461
+ }
462
+ return -1;
463
+ }
464
+ function outputLink(cap, link2, raw, lexer2, rules) {
465
+ const href = link2.href;
466
+ const title = link2.title || null;
467
+ const text = cap[1].replace(rules.other.outputLinkReplace, "$1");
468
+ lexer2.state.inLink = true;
469
+ const token = {
470
+ type: cap[0].charAt(0) === "!" ? "image" : "link",
471
+ raw,
472
+ href,
473
+ title,
474
+ text,
475
+ tokens: lexer2.inlineTokens(text)
476
+ };
477
+ lexer2.state.inLink = false;
478
+ return token;
479
+ }
480
+ function indentCodeCompensation(raw, text, rules) {
481
+ const matchIndentToCode = raw.match(rules.other.indentCodeCompensation);
482
+ if (matchIndentToCode === null) {
483
+ return text;
484
+ }
485
+ const indentToCode = matchIndentToCode[1];
486
+ return text.split("\n").map((node) => {
487
+ const matchIndentInNode = node.match(rules.other.beginningSpace);
488
+ if (matchIndentInNode === null) {
489
+ return node;
490
+ }
491
+ const [indentInNode] = matchIndentInNode;
492
+ if (indentInNode.length >= indentToCode.length) {
493
+ return node.slice(indentToCode.length);
494
+ }
495
+ return node;
496
+ }).join("\n");
497
+ }
498
+ var _Tokenizer = class {
499
+ options;
500
+ rules;
501
+ // set by the lexer
502
+ lexer;
503
+ // set by the lexer
504
+ constructor(options2) {
505
+ this.options = options2 || _defaults;
506
+ }
507
+ space(src) {
508
+ const cap = this.rules.block.newline.exec(src);
509
+ if (cap && cap[0].length > 0) {
510
+ return {
511
+ type: "space",
512
+ raw: cap[0]
513
+ };
514
+ }
515
+ }
516
+ code(src) {
517
+ const cap = this.rules.block.code.exec(src);
518
+ if (cap) {
519
+ const text = cap[0].replace(this.rules.other.codeRemoveIndent, "");
520
+ return {
521
+ type: "code",
522
+ raw: cap[0],
523
+ codeBlockStyle: "indented",
524
+ text: !this.options.pedantic ? rtrim(text, "\n") : text
525
+ };
526
+ }
527
+ }
528
+ fences(src) {
529
+ const cap = this.rules.block.fences.exec(src);
530
+ if (cap) {
531
+ const raw = cap[0];
532
+ const text = indentCodeCompensation(raw, cap[3] || "", this.rules);
533
+ return {
534
+ type: "code",
535
+ raw,
536
+ lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : cap[2],
537
+ text
538
+ };
539
+ }
540
+ }
541
+ heading(src) {
542
+ const cap = this.rules.block.heading.exec(src);
543
+ if (cap) {
544
+ let text = cap[2].trim();
545
+ if (this.rules.other.endingHash.test(text)) {
546
+ const trimmed = rtrim(text, "#");
547
+ if (this.options.pedantic) {
548
+ text = trimmed.trim();
549
+ } else if (!trimmed || this.rules.other.endingSpaceChar.test(trimmed)) {
550
+ text = trimmed.trim();
551
+ }
552
+ }
553
+ return {
554
+ type: "heading",
555
+ raw: cap[0],
556
+ depth: cap[1].length,
557
+ text,
558
+ tokens: this.lexer.inline(text)
559
+ };
560
+ }
561
+ }
562
+ hr(src) {
563
+ const cap = this.rules.block.hr.exec(src);
564
+ if (cap) {
565
+ return {
566
+ type: "hr",
567
+ raw: rtrim(cap[0], "\n")
568
+ };
569
+ }
570
+ }
571
+ blockquote(src) {
572
+ const cap = this.rules.block.blockquote.exec(src);
573
+ if (cap) {
574
+ let lines = rtrim(cap[0], "\n").split("\n");
575
+ let raw = "";
576
+ let text = "";
577
+ const tokens = [];
578
+ while (lines.length > 0) {
579
+ let inBlockquote = false;
580
+ const currentLines = [];
581
+ let i;
582
+ for (i = 0; i < lines.length; i++) {
583
+ if (this.rules.other.blockquoteStart.test(lines[i])) {
584
+ currentLines.push(lines[i]);
585
+ inBlockquote = true;
586
+ } else if (!inBlockquote) {
587
+ currentLines.push(lines[i]);
588
+ } else {
589
+ break;
590
+ }
591
+ }
592
+ lines = lines.slice(i);
593
+ const currentRaw = currentLines.join("\n");
594
+ const currentText = currentRaw.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
595
+ raw = raw ? `${raw}
596
+ ${currentRaw}` : currentRaw;
597
+ text = text ? `${text}
598
+ ${currentText}` : currentText;
599
+ const top = this.lexer.state.top;
600
+ this.lexer.state.top = true;
601
+ this.lexer.blockTokens(currentText, tokens, true);
602
+ this.lexer.state.top = top;
603
+ if (lines.length === 0) {
604
+ break;
605
+ }
606
+ const lastToken = tokens.at(-1);
607
+ if (lastToken?.type === "code") {
608
+ break;
609
+ } else if (lastToken?.type === "blockquote") {
610
+ const oldToken = lastToken;
611
+ const newText = oldToken.raw + "\n" + lines.join("\n");
612
+ const newToken = this.blockquote(newText);
613
+ tokens[tokens.length - 1] = newToken;
614
+ raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw;
615
+ text = text.substring(0, text.length - oldToken.text.length) + newToken.text;
616
+ break;
617
+ } else if (lastToken?.type === "list") {
618
+ const oldToken = lastToken;
619
+ const newText = oldToken.raw + "\n" + lines.join("\n");
620
+ const newToken = this.list(newText);
621
+ tokens[tokens.length - 1] = newToken;
622
+ raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw;
623
+ text = text.substring(0, text.length - oldToken.raw.length) + newToken.raw;
624
+ lines = newText.substring(tokens.at(-1).raw.length).split("\n");
625
+ continue;
626
+ }
627
+ }
628
+ return {
629
+ type: "blockquote",
630
+ raw,
631
+ tokens,
632
+ text
633
+ };
634
+ }
635
+ }
636
+ list(src) {
637
+ let cap = this.rules.block.list.exec(src);
638
+ if (cap) {
639
+ let bull = cap[1].trim();
640
+ const isordered = bull.length > 1;
641
+ const list2 = {
642
+ type: "list",
643
+ raw: "",
644
+ ordered: isordered,
645
+ start: isordered ? +bull.slice(0, -1) : "",
646
+ loose: false,
647
+ items: []
648
+ };
649
+ bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
650
+ if (this.options.pedantic) {
651
+ bull = isordered ? bull : "[*+-]";
652
+ }
653
+ const itemRegex = this.rules.other.listItemRegex(bull);
654
+ let endsWithBlankLine = false;
655
+ while (src) {
656
+ let endEarly = false;
657
+ let raw = "";
658
+ let itemContents = "";
659
+ if (!(cap = itemRegex.exec(src))) {
660
+ break;
661
+ }
662
+ if (this.rules.block.hr.test(src)) {
663
+ break;
664
+ }
665
+ raw = cap[0];
666
+ src = src.substring(raw.length);
667
+ let line = cap[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (t) => " ".repeat(3 * t.length));
668
+ let nextLine = src.split("\n", 1)[0];
669
+ let blankLine = !line.trim();
670
+ let indent = 0;
671
+ if (this.options.pedantic) {
672
+ indent = 2;
673
+ itemContents = line.trimStart();
674
+ } else if (blankLine) {
675
+ indent = cap[1].length + 1;
676
+ } else {
677
+ indent = cap[2].search(this.rules.other.nonSpaceChar);
678
+ indent = indent > 4 ? 1 : indent;
679
+ itemContents = line.slice(indent);
680
+ indent += cap[1].length;
681
+ }
682
+ if (blankLine && this.rules.other.blankLine.test(nextLine)) {
683
+ raw += nextLine + "\n";
684
+ src = src.substring(nextLine.length + 1);
685
+ endEarly = true;
686
+ }
687
+ if (!endEarly) {
688
+ const nextBulletRegex = this.rules.other.nextBulletRegex(indent);
689
+ const hrRegex = this.rules.other.hrRegex(indent);
690
+ const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent);
691
+ const headingBeginRegex = this.rules.other.headingBeginRegex(indent);
692
+ const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent);
693
+ while (src) {
694
+ const rawLine = src.split("\n", 1)[0];
695
+ let nextLineWithoutTabs;
696
+ nextLine = rawLine;
697
+ if (this.options.pedantic) {
698
+ nextLine = nextLine.replace(this.rules.other.listReplaceNesting, " ");
699
+ nextLineWithoutTabs = nextLine;
700
+ } else {
701
+ nextLineWithoutTabs = nextLine.replace(this.rules.other.tabCharGlobal, " ");
702
+ }
703
+ if (fencesBeginRegex.test(nextLine)) {
704
+ break;
705
+ }
706
+ if (headingBeginRegex.test(nextLine)) {
707
+ break;
708
+ }
709
+ if (htmlBeginRegex.test(nextLine)) {
710
+ break;
711
+ }
712
+ if (nextBulletRegex.test(nextLine)) {
713
+ break;
714
+ }
715
+ if (hrRegex.test(nextLine)) {
716
+ break;
717
+ }
718
+ if (nextLineWithoutTabs.search(this.rules.other.nonSpaceChar) >= indent || !nextLine.trim()) {
719
+ itemContents += "\n" + nextLineWithoutTabs.slice(indent);
720
+ } else {
721
+ if (blankLine) {
722
+ break;
723
+ }
724
+ if (line.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4) {
725
+ break;
726
+ }
727
+ if (fencesBeginRegex.test(line)) {
728
+ break;
729
+ }
730
+ if (headingBeginRegex.test(line)) {
731
+ break;
732
+ }
733
+ if (hrRegex.test(line)) {
734
+ break;
735
+ }
736
+ itemContents += "\n" + nextLine;
737
+ }
738
+ if (!blankLine && !nextLine.trim()) {
739
+ blankLine = true;
740
+ }
741
+ raw += rawLine + "\n";
742
+ src = src.substring(rawLine.length + 1);
743
+ line = nextLineWithoutTabs.slice(indent);
744
+ }
745
+ }
746
+ if (!list2.loose) {
747
+ if (endsWithBlankLine) {
748
+ list2.loose = true;
749
+ } else if (this.rules.other.doubleBlankLine.test(raw)) {
750
+ endsWithBlankLine = true;
751
+ }
752
+ }
753
+ let istask = null;
754
+ let ischecked;
755
+ if (this.options.gfm) {
756
+ istask = this.rules.other.listIsTask.exec(itemContents);
757
+ if (istask) {
758
+ ischecked = istask[0] !== "[ ] ";
759
+ itemContents = itemContents.replace(this.rules.other.listReplaceTask, "");
760
+ }
761
+ }
762
+ list2.items.push({
763
+ type: "list_item",
764
+ raw,
765
+ task: !!istask,
766
+ checked: ischecked,
767
+ loose: false,
768
+ text: itemContents,
769
+ tokens: []
770
+ });
771
+ list2.raw += raw;
772
+ }
773
+ const lastItem = list2.items.at(-1);
774
+ if (lastItem) {
775
+ lastItem.raw = lastItem.raw.trimEnd();
776
+ lastItem.text = lastItem.text.trimEnd();
777
+ } else {
778
+ return;
779
+ }
780
+ list2.raw = list2.raw.trimEnd();
781
+ for (let i = 0; i < list2.items.length; i++) {
782
+ this.lexer.state.top = false;
783
+ list2.items[i].tokens = this.lexer.blockTokens(list2.items[i].text, []);
784
+ if (!list2.loose) {
785
+ const spacers = list2.items[i].tokens.filter((t) => t.type === "space");
786
+ const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t) => this.rules.other.anyLine.test(t.raw));
787
+ list2.loose = hasMultipleLineBreaks;
788
+ }
789
+ }
790
+ if (list2.loose) {
791
+ for (let i = 0; i < list2.items.length; i++) {
792
+ list2.items[i].loose = true;
793
+ }
794
+ }
795
+ return list2;
796
+ }
797
+ }
798
+ html(src) {
799
+ const cap = this.rules.block.html.exec(src);
800
+ if (cap) {
801
+ const token = {
802
+ type: "html",
803
+ block: true,
804
+ raw: cap[0],
805
+ pre: cap[1] === "pre" || cap[1] === "script" || cap[1] === "style",
806
+ text: cap[0]
807
+ };
808
+ return token;
809
+ }
810
+ }
811
+ def(src) {
812
+ const cap = this.rules.block.def.exec(src);
813
+ if (cap) {
814
+ const tag2 = cap[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " ");
815
+ const href = cap[2] ? cap[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "";
816
+ const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : cap[3];
817
+ return {
818
+ type: "def",
819
+ tag: tag2,
820
+ raw: cap[0],
821
+ href,
822
+ title
823
+ };
824
+ }
825
+ }
826
+ table(src) {
827
+ const cap = this.rules.block.table.exec(src);
828
+ if (!cap) {
829
+ return;
830
+ }
831
+ if (!this.rules.other.tableDelimiter.test(cap[2])) {
832
+ return;
833
+ }
834
+ const headers = splitCells(cap[1]);
835
+ const aligns = cap[2].replace(this.rules.other.tableAlignChars, "").split("|");
836
+ const rows = cap[3]?.trim() ? cap[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [];
837
+ const item = {
838
+ type: "table",
839
+ raw: cap[0],
840
+ header: [],
841
+ align: [],
842
+ rows: []
843
+ };
844
+ if (headers.length !== aligns.length) {
845
+ return;
846
+ }
847
+ for (const align of aligns) {
848
+ if (this.rules.other.tableAlignRight.test(align)) {
849
+ item.align.push("right");
850
+ } else if (this.rules.other.tableAlignCenter.test(align)) {
851
+ item.align.push("center");
852
+ } else if (this.rules.other.tableAlignLeft.test(align)) {
853
+ item.align.push("left");
854
+ } else {
855
+ item.align.push(null);
856
+ }
857
+ }
858
+ for (let i = 0; i < headers.length; i++) {
859
+ item.header.push({
860
+ text: headers[i],
861
+ tokens: this.lexer.inline(headers[i]),
862
+ header: true,
863
+ align: item.align[i]
864
+ });
865
+ }
866
+ for (const row of rows) {
867
+ item.rows.push(splitCells(row, item.header.length).map((cell, i) => {
868
+ return {
869
+ text: cell,
870
+ tokens: this.lexer.inline(cell),
871
+ header: false,
872
+ align: item.align[i]
873
+ };
874
+ }));
875
+ }
876
+ return item;
877
+ }
878
+ lheading(src) {
879
+ const cap = this.rules.block.lheading.exec(src);
880
+ if (cap) {
881
+ return {
882
+ type: "heading",
883
+ raw: cap[0],
884
+ depth: cap[2].charAt(0) === "=" ? 1 : 2,
885
+ text: cap[1],
886
+ tokens: this.lexer.inline(cap[1])
887
+ };
888
+ }
889
+ }
890
+ paragraph(src) {
891
+ const cap = this.rules.block.paragraph.exec(src);
892
+ if (cap) {
893
+ const text = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
894
+ return {
895
+ type: "paragraph",
896
+ raw: cap[0],
897
+ text,
898
+ tokens: this.lexer.inline(text)
899
+ };
900
+ }
901
+ }
902
+ text(src) {
903
+ const cap = this.rules.block.text.exec(src);
904
+ if (cap) {
905
+ return {
906
+ type: "text",
907
+ raw: cap[0],
908
+ text: cap[0],
909
+ tokens: this.lexer.inline(cap[0])
910
+ };
911
+ }
912
+ }
913
+ escape(src) {
914
+ const cap = this.rules.inline.escape.exec(src);
915
+ if (cap) {
916
+ return {
917
+ type: "escape",
918
+ raw: cap[0],
919
+ text: cap[1]
920
+ };
921
+ }
922
+ }
923
+ tag(src) {
924
+ const cap = this.rules.inline.tag.exec(src);
925
+ if (cap) {
926
+ if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {
927
+ this.lexer.state.inLink = true;
928
+ } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {
929
+ this.lexer.state.inLink = false;
930
+ }
931
+ if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {
932
+ this.lexer.state.inRawBlock = true;
933
+ } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {
934
+ this.lexer.state.inRawBlock = false;
935
+ }
936
+ return {
937
+ type: "html",
938
+ raw: cap[0],
939
+ inLink: this.lexer.state.inLink,
940
+ inRawBlock: this.lexer.state.inRawBlock,
941
+ block: false,
942
+ text: cap[0]
943
+ };
944
+ }
945
+ }
946
+ link(src) {
947
+ const cap = this.rules.inline.link.exec(src);
948
+ if (cap) {
949
+ const trimmedUrl = cap[2].trim();
950
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {
951
+ if (!this.rules.other.endAngleBracket.test(trimmedUrl)) {
952
+ return;
953
+ }
954
+ const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
955
+ if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
956
+ return;
957
+ }
958
+ } else {
959
+ const lastParenIndex = findClosingBracket(cap[2], "()");
960
+ if (lastParenIndex === -2) {
961
+ return;
962
+ }
963
+ if (lastParenIndex > -1) {
964
+ const start = cap[0].indexOf("!") === 0 ? 5 : 4;
965
+ const linkLen = start + cap[1].length + lastParenIndex;
966
+ cap[2] = cap[2].substring(0, lastParenIndex);
967
+ cap[0] = cap[0].substring(0, linkLen).trim();
968
+ cap[3] = "";
969
+ }
970
+ }
971
+ let href = cap[2];
972
+ let title = "";
973
+ if (this.options.pedantic) {
974
+ const link2 = this.rules.other.pedanticHrefTitle.exec(href);
975
+ if (link2) {
976
+ href = link2[1];
977
+ title = link2[3];
978
+ }
979
+ } else {
980
+ title = cap[3] ? cap[3].slice(1, -1) : "";
981
+ }
982
+ href = href.trim();
983
+ if (this.rules.other.startAngleBracket.test(href)) {
984
+ if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) {
985
+ href = href.slice(1);
986
+ } else {
987
+ href = href.slice(1, -1);
988
+ }
989
+ }
990
+ return outputLink(cap, {
991
+ href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
992
+ title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title
993
+ }, cap[0], this.lexer, this.rules);
994
+ }
995
+ }
996
+ reflink(src, links) {
997
+ let cap;
998
+ if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
999
+ const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
1000
+ const link2 = links[linkString.toLowerCase()];
1001
+ if (!link2) {
1002
+ const text = cap[0].charAt(0);
1003
+ return {
1004
+ type: "text",
1005
+ raw: text,
1006
+ text
1007
+ };
1008
+ }
1009
+ return outputLink(cap, link2, cap[0], this.lexer, this.rules);
1010
+ }
1011
+ }
1012
+ emStrong(src, maskedSrc, prevChar = "") {
1013
+ let match = this.rules.inline.emStrongLDelim.exec(src);
1014
+ if (!match) return;
1015
+ if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;
1016
+ const nextChar = match[1] || match[2] || "";
1017
+ if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
1018
+ const lLength = [...match[0]].length - 1;
1019
+ let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
1020
+ const endReg = match[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1021
+ endReg.lastIndex = 0;
1022
+ maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
1023
+ while ((match = endReg.exec(maskedSrc)) != null) {
1024
+ rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
1025
+ if (!rDelim) continue;
1026
+ rLength = [...rDelim].length;
1027
+ if (match[3] || match[4]) {
1028
+ delimTotal += rLength;
1029
+ continue;
1030
+ } else if (match[5] || match[6]) {
1031
+ if (lLength % 3 && !((lLength + rLength) % 3)) {
1032
+ midDelimTotal += rLength;
1033
+ continue;
1034
+ }
1035
+ }
1036
+ delimTotal -= rLength;
1037
+ if (delimTotal > 0) continue;
1038
+ rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
1039
+ const lastCharLength = [...match[0]][0].length;
1040
+ const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
1041
+ if (Math.min(lLength, rLength) % 2) {
1042
+ const text2 = raw.slice(1, -1);
1043
+ return {
1044
+ type: "em",
1045
+ raw,
1046
+ text: text2,
1047
+ tokens: this.lexer.inlineTokens(text2)
1048
+ };
1049
+ }
1050
+ const text = raw.slice(2, -2);
1051
+ return {
1052
+ type: "strong",
1053
+ raw,
1054
+ text,
1055
+ tokens: this.lexer.inlineTokens(text)
1056
+ };
1057
+ }
1058
+ }
1059
+ }
1060
+ codespan(src) {
1061
+ const cap = this.rules.inline.code.exec(src);
1062
+ if (cap) {
1063
+ let text = cap[2].replace(this.rules.other.newLineCharGlobal, " ");
1064
+ const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);
1065
+ const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);
1066
+ if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
1067
+ text = text.substring(1, text.length - 1);
1068
+ }
1069
+ return {
1070
+ type: "codespan",
1071
+ raw: cap[0],
1072
+ text
1073
+ };
1074
+ }
1075
+ }
1076
+ br(src) {
1077
+ const cap = this.rules.inline.br.exec(src);
1078
+ if (cap) {
1079
+ return {
1080
+ type: "br",
1081
+ raw: cap[0]
1082
+ };
1083
+ }
1084
+ }
1085
+ del(src) {
1086
+ const cap = this.rules.inline.del.exec(src);
1087
+ if (cap) {
1088
+ return {
1089
+ type: "del",
1090
+ raw: cap[0],
1091
+ text: cap[2],
1092
+ tokens: this.lexer.inlineTokens(cap[2])
1093
+ };
1094
+ }
1095
+ }
1096
+ autolink(src) {
1097
+ const cap = this.rules.inline.autolink.exec(src);
1098
+ if (cap) {
1099
+ let text, href;
1100
+ if (cap[2] === "@") {
1101
+ text = cap[1];
1102
+ href = "mailto:" + text;
1103
+ } else {
1104
+ text = cap[1];
1105
+ href = text;
1106
+ }
1107
+ return {
1108
+ type: "link",
1109
+ raw: cap[0],
1110
+ text,
1111
+ href,
1112
+ tokens: [
1113
+ {
1114
+ type: "text",
1115
+ raw: text,
1116
+ text
1117
+ }
1118
+ ]
1119
+ };
1120
+ }
1121
+ }
1122
+ url(src) {
1123
+ let cap;
1124
+ if (cap = this.rules.inline.url.exec(src)) {
1125
+ let text, href;
1126
+ if (cap[2] === "@") {
1127
+ text = cap[0];
1128
+ href = "mailto:" + text;
1129
+ } else {
1130
+ let prevCapZero;
1131
+ do {
1132
+ prevCapZero = cap[0];
1133
+ cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
1134
+ } while (prevCapZero !== cap[0]);
1135
+ text = cap[0];
1136
+ if (cap[1] === "www.") {
1137
+ href = "http://" + cap[0];
1138
+ } else {
1139
+ href = cap[0];
1140
+ }
1141
+ }
1142
+ return {
1143
+ type: "link",
1144
+ raw: cap[0],
1145
+ text,
1146
+ href,
1147
+ tokens: [
1148
+ {
1149
+ type: "text",
1150
+ raw: text,
1151
+ text
1152
+ }
1153
+ ]
1154
+ };
1155
+ }
1156
+ }
1157
+ inlineText(src) {
1158
+ const cap = this.rules.inline.text.exec(src);
1159
+ if (cap) {
1160
+ const escaped = this.lexer.state.inRawBlock;
1161
+ return {
1162
+ type: "text",
1163
+ raw: cap[0],
1164
+ text: cap[0],
1165
+ escaped
1166
+ };
1167
+ }
1168
+ }
1169
+ };
1170
+ var _Lexer = class __Lexer {
1171
+ tokens;
1172
+ options;
1173
+ state;
1174
+ tokenizer;
1175
+ inlineQueue;
1176
+ constructor(options2) {
1177
+ this.tokens = [];
1178
+ this.tokens.links = /* @__PURE__ */ Object.create(null);
1179
+ this.options = options2 || _defaults;
1180
+ this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
1181
+ this.tokenizer = this.options.tokenizer;
1182
+ this.tokenizer.options = this.options;
1183
+ this.tokenizer.lexer = this;
1184
+ this.inlineQueue = [];
1185
+ this.state = {
1186
+ inLink: false,
1187
+ inRawBlock: false,
1188
+ top: true
1189
+ };
1190
+ const rules = {
1191
+ other,
1192
+ block: block.normal,
1193
+ inline: inline.normal
1194
+ };
1195
+ if (this.options.pedantic) {
1196
+ rules.block = block.pedantic;
1197
+ rules.inline = inline.pedantic;
1198
+ } else if (this.options.gfm) {
1199
+ rules.block = block.gfm;
1200
+ if (this.options.breaks) {
1201
+ rules.inline = inline.breaks;
1202
+ } else {
1203
+ rules.inline = inline.gfm;
1204
+ }
1205
+ }
1206
+ this.tokenizer.rules = rules;
1207
+ }
1208
+ /**
1209
+ * Expose Rules
1210
+ */
1211
+ static get rules() {
1212
+ return {
1213
+ block,
1214
+ inline
1215
+ };
1216
+ }
1217
+ /**
1218
+ * Static Lex Method
1219
+ */
1220
+ static lex(src, options2) {
1221
+ const lexer2 = new __Lexer(options2);
1222
+ return lexer2.lex(src);
1223
+ }
1224
+ /**
1225
+ * Static Lex Inline Method
1226
+ */
1227
+ static lexInline(src, options2) {
1228
+ const lexer2 = new __Lexer(options2);
1229
+ return lexer2.inlineTokens(src);
1230
+ }
1231
+ /**
1232
+ * Preprocessing
1233
+ */
1234
+ lex(src) {
1235
+ src = src.replace(other.carriageReturn, "\n");
1236
+ this.blockTokens(src, this.tokens);
1237
+ for (let i = 0; i < this.inlineQueue.length; i++) {
1238
+ const next = this.inlineQueue[i];
1239
+ this.inlineTokens(next.src, next.tokens);
1240
+ }
1241
+ this.inlineQueue = [];
1242
+ return this.tokens;
1243
+ }
1244
+ blockTokens(src, tokens = [], lastParagraphClipped = false) {
1245
+ if (this.options.pedantic) {
1246
+ src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
1247
+ }
1248
+ while (src) {
1249
+ let token;
1250
+ if (this.options.extensions?.block?.some((extTokenizer) => {
1251
+ if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
1252
+ src = src.substring(token.raw.length);
1253
+ tokens.push(token);
1254
+ return true;
1255
+ }
1256
+ return false;
1257
+ })) {
1258
+ continue;
1259
+ }
1260
+ if (token = this.tokenizer.space(src)) {
1261
+ src = src.substring(token.raw.length);
1262
+ const lastToken = tokens.at(-1);
1263
+ if (token.raw.length === 1 && lastToken !== void 0) {
1264
+ lastToken.raw += "\n";
1265
+ } else {
1266
+ tokens.push(token);
1267
+ }
1268
+ continue;
1269
+ }
1270
+ if (token = this.tokenizer.code(src)) {
1271
+ src = src.substring(token.raw.length);
1272
+ const lastToken = tokens.at(-1);
1273
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
1274
+ lastToken.raw += "\n" + token.raw;
1275
+ lastToken.text += "\n" + token.text;
1276
+ this.inlineQueue.at(-1).src = lastToken.text;
1277
+ } else {
1278
+ tokens.push(token);
1279
+ }
1280
+ continue;
1281
+ }
1282
+ if (token = this.tokenizer.fences(src)) {
1283
+ src = src.substring(token.raw.length);
1284
+ tokens.push(token);
1285
+ continue;
1286
+ }
1287
+ if (token = this.tokenizer.heading(src)) {
1288
+ src = src.substring(token.raw.length);
1289
+ tokens.push(token);
1290
+ continue;
1291
+ }
1292
+ if (token = this.tokenizer.hr(src)) {
1293
+ src = src.substring(token.raw.length);
1294
+ tokens.push(token);
1295
+ continue;
1296
+ }
1297
+ if (token = this.tokenizer.blockquote(src)) {
1298
+ src = src.substring(token.raw.length);
1299
+ tokens.push(token);
1300
+ continue;
1301
+ }
1302
+ if (token = this.tokenizer.list(src)) {
1303
+ src = src.substring(token.raw.length);
1304
+ tokens.push(token);
1305
+ continue;
1306
+ }
1307
+ if (token = this.tokenizer.html(src)) {
1308
+ src = src.substring(token.raw.length);
1309
+ tokens.push(token);
1310
+ continue;
1311
+ }
1312
+ if (token = this.tokenizer.def(src)) {
1313
+ src = src.substring(token.raw.length);
1314
+ const lastToken = tokens.at(-1);
1315
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
1316
+ lastToken.raw += "\n" + token.raw;
1317
+ lastToken.text += "\n" + token.raw;
1318
+ this.inlineQueue.at(-1).src = lastToken.text;
1319
+ } else if (!this.tokens.links[token.tag]) {
1320
+ this.tokens.links[token.tag] = {
1321
+ href: token.href,
1322
+ title: token.title
1323
+ };
1324
+ }
1325
+ continue;
1326
+ }
1327
+ if (token = this.tokenizer.table(src)) {
1328
+ src = src.substring(token.raw.length);
1329
+ tokens.push(token);
1330
+ continue;
1331
+ }
1332
+ if (token = this.tokenizer.lheading(src)) {
1333
+ src = src.substring(token.raw.length);
1334
+ tokens.push(token);
1335
+ continue;
1336
+ }
1337
+ let cutSrc = src;
1338
+ if (this.options.extensions?.startBlock) {
1339
+ let startIndex = Infinity;
1340
+ const tempSrc = src.slice(1);
1341
+ let tempStart;
1342
+ this.options.extensions.startBlock.forEach((getStartIndex) => {
1343
+ tempStart = getStartIndex.call({ lexer: this }, tempSrc);
1344
+ if (typeof tempStart === "number" && tempStart >= 0) {
1345
+ startIndex = Math.min(startIndex, tempStart);
1346
+ }
1347
+ });
1348
+ if (startIndex < Infinity && startIndex >= 0) {
1349
+ cutSrc = src.substring(0, startIndex + 1);
1350
+ }
1351
+ }
1352
+ if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
1353
+ const lastToken = tokens.at(-1);
1354
+ if (lastParagraphClipped && lastToken?.type === "paragraph") {
1355
+ lastToken.raw += "\n" + token.raw;
1356
+ lastToken.text += "\n" + token.text;
1357
+ this.inlineQueue.pop();
1358
+ this.inlineQueue.at(-1).src = lastToken.text;
1359
+ } else {
1360
+ tokens.push(token);
1361
+ }
1362
+ lastParagraphClipped = cutSrc.length !== src.length;
1363
+ src = src.substring(token.raw.length);
1364
+ continue;
1365
+ }
1366
+ if (token = this.tokenizer.text(src)) {
1367
+ src = src.substring(token.raw.length);
1368
+ const lastToken = tokens.at(-1);
1369
+ if (lastToken?.type === "text") {
1370
+ lastToken.raw += "\n" + token.raw;
1371
+ lastToken.text += "\n" + token.text;
1372
+ this.inlineQueue.pop();
1373
+ this.inlineQueue.at(-1).src = lastToken.text;
1374
+ } else {
1375
+ tokens.push(token);
1376
+ }
1377
+ continue;
1378
+ }
1379
+ if (src) {
1380
+ const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
1381
+ if (this.options.silent) {
1382
+ console.error(errMsg);
1383
+ break;
1384
+ } else {
1385
+ throw new Error(errMsg);
1386
+ }
1387
+ }
1388
+ }
1389
+ this.state.top = true;
1390
+ return tokens;
1391
+ }
1392
+ inline(src, tokens = []) {
1393
+ this.inlineQueue.push({ src, tokens });
1394
+ return tokens;
1395
+ }
1396
+ /**
1397
+ * Lexing/Compiling
1398
+ */
1399
+ inlineTokens(src, tokens = []) {
1400
+ let maskedSrc = src;
1401
+ let match = null;
1402
+ if (this.tokens.links) {
1403
+ const links = Object.keys(this.tokens.links);
1404
+ if (links.length > 0) {
1405
+ while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
1406
+ if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
1407
+ maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
1408
+ }
1409
+ }
1410
+ }
1411
+ }
1412
+ while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
1413
+ maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1414
+ }
1415
+ while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
1416
+ maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1417
+ }
1418
+ let keepPrevChar = false;
1419
+ let prevChar = "";
1420
+ while (src) {
1421
+ if (!keepPrevChar) {
1422
+ prevChar = "";
1423
+ }
1424
+ keepPrevChar = false;
1425
+ let token;
1426
+ if (this.options.extensions?.inline?.some((extTokenizer) => {
1427
+ if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
1428
+ src = src.substring(token.raw.length);
1429
+ tokens.push(token);
1430
+ return true;
1431
+ }
1432
+ return false;
1433
+ })) {
1434
+ continue;
1435
+ }
1436
+ if (token = this.tokenizer.escape(src)) {
1437
+ src = src.substring(token.raw.length);
1438
+ tokens.push(token);
1439
+ continue;
1440
+ }
1441
+ if (token = this.tokenizer.tag(src)) {
1442
+ src = src.substring(token.raw.length);
1443
+ tokens.push(token);
1444
+ continue;
1445
+ }
1446
+ if (token = this.tokenizer.link(src)) {
1447
+ src = src.substring(token.raw.length);
1448
+ tokens.push(token);
1449
+ continue;
1450
+ }
1451
+ if (token = this.tokenizer.reflink(src, this.tokens.links)) {
1452
+ src = src.substring(token.raw.length);
1453
+ const lastToken = tokens.at(-1);
1454
+ if (token.type === "text" && lastToken?.type === "text") {
1455
+ lastToken.raw += token.raw;
1456
+ lastToken.text += token.text;
1457
+ } else {
1458
+ tokens.push(token);
1459
+ }
1460
+ continue;
1461
+ }
1462
+ if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
1463
+ src = src.substring(token.raw.length);
1464
+ tokens.push(token);
1465
+ continue;
1466
+ }
1467
+ if (token = this.tokenizer.codespan(src)) {
1468
+ src = src.substring(token.raw.length);
1469
+ tokens.push(token);
1470
+ continue;
1471
+ }
1472
+ if (token = this.tokenizer.br(src)) {
1473
+ src = src.substring(token.raw.length);
1474
+ tokens.push(token);
1475
+ continue;
1476
+ }
1477
+ if (token = this.tokenizer.del(src)) {
1478
+ src = src.substring(token.raw.length);
1479
+ tokens.push(token);
1480
+ continue;
1481
+ }
1482
+ if (token = this.tokenizer.autolink(src)) {
1483
+ src = src.substring(token.raw.length);
1484
+ tokens.push(token);
1485
+ continue;
1486
+ }
1487
+ if (!this.state.inLink && (token = this.tokenizer.url(src))) {
1488
+ src = src.substring(token.raw.length);
1489
+ tokens.push(token);
1490
+ continue;
1491
+ }
1492
+ let cutSrc = src;
1493
+ if (this.options.extensions?.startInline) {
1494
+ let startIndex = Infinity;
1495
+ const tempSrc = src.slice(1);
1496
+ let tempStart;
1497
+ this.options.extensions.startInline.forEach((getStartIndex) => {
1498
+ tempStart = getStartIndex.call({ lexer: this }, tempSrc);
1499
+ if (typeof tempStart === "number" && tempStart >= 0) {
1500
+ startIndex = Math.min(startIndex, tempStart);
1501
+ }
1502
+ });
1503
+ if (startIndex < Infinity && startIndex >= 0) {
1504
+ cutSrc = src.substring(0, startIndex + 1);
1505
+ }
1506
+ }
1507
+ if (token = this.tokenizer.inlineText(cutSrc)) {
1508
+ src = src.substring(token.raw.length);
1509
+ if (token.raw.slice(-1) !== "_") {
1510
+ prevChar = token.raw.slice(-1);
1511
+ }
1512
+ keepPrevChar = true;
1513
+ const lastToken = tokens.at(-1);
1514
+ if (lastToken?.type === "text") {
1515
+ lastToken.raw += token.raw;
1516
+ lastToken.text += token.text;
1517
+ } else {
1518
+ tokens.push(token);
1519
+ }
1520
+ continue;
1521
+ }
1522
+ if (src) {
1523
+ const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
1524
+ if (this.options.silent) {
1525
+ console.error(errMsg);
1526
+ break;
1527
+ } else {
1528
+ throw new Error(errMsg);
1529
+ }
1530
+ }
1531
+ }
1532
+ return tokens;
1533
+ }
1534
+ };
1535
+ var _Renderer = class {
1536
+ options;
1537
+ parser;
1538
+ // set by the parser
1539
+ constructor(options2) {
1540
+ this.options = options2 || _defaults;
1541
+ }
1542
+ space(token) {
1543
+ return "";
1544
+ }
1545
+ code({ text, lang, escaped }) {
1546
+ const langString = (lang || "").match(other.notSpaceStart)?.[0];
1547
+ const code = text.replace(other.endingNewline, "") + "\n";
1548
+ if (!langString) {
1549
+ return "<pre><code>" + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
1550
+ }
1551
+ return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
1552
+ }
1553
+ blockquote({ tokens }) {
1554
+ const body = this.parser.parse(tokens);
1555
+ return `<blockquote>
1556
+ ${body}</blockquote>
1557
+ `;
1558
+ }
1559
+ html({ text }) {
1560
+ return text;
1561
+ }
1562
+ heading({ tokens, depth }) {
1563
+ return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>
1564
+ `;
1565
+ }
1566
+ hr(token) {
1567
+ return "<hr>\n";
1568
+ }
1569
+ list(token) {
1570
+ const ordered = token.ordered;
1571
+ const start = token.start;
1572
+ let body = "";
1573
+ for (let j = 0; j < token.items.length; j++) {
1574
+ const item = token.items[j];
1575
+ body += this.listitem(item);
1576
+ }
1577
+ const type = ordered ? "ol" : "ul";
1578
+ const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : "";
1579
+ return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n";
1580
+ }
1581
+ listitem(item) {
1582
+ let itemBody = "";
1583
+ if (item.task) {
1584
+ const checkbox = this.checkbox({ checked: !!item.checked });
1585
+ if (item.loose) {
1586
+ if (item.tokens[0]?.type === "paragraph") {
1587
+ item.tokens[0].text = checkbox + " " + item.tokens[0].text;
1588
+ if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
1589
+ item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text);
1590
+ item.tokens[0].tokens[0].escaped = true;
1591
+ }
1592
+ } else {
1593
+ item.tokens.unshift({
1594
+ type: "text",
1595
+ raw: checkbox + " ",
1596
+ text: checkbox + " ",
1597
+ escaped: true
1598
+ });
1599
+ }
1600
+ } else {
1601
+ itemBody += checkbox + " ";
1602
+ }
1603
+ }
1604
+ itemBody += this.parser.parse(item.tokens, !!item.loose);
1605
+ return `<li>${itemBody}</li>
1606
+ `;
1607
+ }
1608
+ checkbox({ checked }) {
1609
+ return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
1610
+ }
1611
+ paragraph({ tokens }) {
1612
+ return `<p>${this.parser.parseInline(tokens)}</p>
1613
+ `;
1614
+ }
1615
+ table(token) {
1616
+ let header = "";
1617
+ let cell = "";
1618
+ for (let j = 0; j < token.header.length; j++) {
1619
+ cell += this.tablecell(token.header[j]);
1620
+ }
1621
+ header += this.tablerow({ text: cell });
1622
+ let body = "";
1623
+ for (let j = 0; j < token.rows.length; j++) {
1624
+ const row = token.rows[j];
1625
+ cell = "";
1626
+ for (let k = 0; k < row.length; k++) {
1627
+ cell += this.tablecell(row[k]);
1628
+ }
1629
+ body += this.tablerow({ text: cell });
1630
+ }
1631
+ if (body) body = `<tbody>${body}</tbody>`;
1632
+ return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
1633
+ }
1634
+ tablerow({ text }) {
1635
+ return `<tr>
1636
+ ${text}</tr>
1637
+ `;
1638
+ }
1639
+ tablecell(token) {
1640
+ const content = this.parser.parseInline(token.tokens);
1641
+ const type = token.header ? "th" : "td";
1642
+ const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`;
1643
+ return tag2 + content + `</${type}>
1644
+ `;
1645
+ }
1646
+ /**
1647
+ * span level renderer
1648
+ */
1649
+ strong({ tokens }) {
1650
+ return `<strong>${this.parser.parseInline(tokens)}</strong>`;
1651
+ }
1652
+ em({ tokens }) {
1653
+ return `<em>${this.parser.parseInline(tokens)}</em>`;
1654
+ }
1655
+ codespan({ text }) {
1656
+ return `<code>${escape2(text, true)}</code>`;
1657
+ }
1658
+ br(token) {
1659
+ return "<br>";
1660
+ }
1661
+ del({ tokens }) {
1662
+ return `<del>${this.parser.parseInline(tokens)}</del>`;
1663
+ }
1664
+ link({ href, title, tokens }) {
1665
+ const text = this.parser.parseInline(tokens);
1666
+ const cleanHref = cleanUrl(href);
1667
+ if (cleanHref === null) {
1668
+ return text;
1669
+ }
1670
+ href = cleanHref;
1671
+ let out = '<a href="' + href + '"';
1672
+ if (title) {
1673
+ out += ' title="' + escape2(title) + '"';
1674
+ }
1675
+ out += ">" + text + "</a>";
1676
+ return out;
1677
+ }
1678
+ image({ href, title, text, tokens }) {
1679
+ if (tokens) {
1680
+ text = this.parser.parseInline(tokens, this.parser.textRenderer);
1681
+ }
1682
+ const cleanHref = cleanUrl(href);
1683
+ if (cleanHref === null) {
1684
+ return escape2(text);
1685
+ }
1686
+ href = cleanHref;
1687
+ let out = `<img src="${href}" alt="${text}"`;
1688
+ if (title) {
1689
+ out += ` title="${escape2(title)}"`;
1690
+ }
1691
+ out += ">";
1692
+ return out;
1693
+ }
1694
+ text(token) {
1695
+ return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text);
1696
+ }
1697
+ };
1698
+ var _TextRenderer = class {
1699
+ // no need for block level renderers
1700
+ strong({ text }) {
1701
+ return text;
1702
+ }
1703
+ em({ text }) {
1704
+ return text;
1705
+ }
1706
+ codespan({ text }) {
1707
+ return text;
1708
+ }
1709
+ del({ text }) {
1710
+ return text;
1711
+ }
1712
+ html({ text }) {
1713
+ return text;
1714
+ }
1715
+ text({ text }) {
1716
+ return text;
1717
+ }
1718
+ link({ text }) {
1719
+ return "" + text;
1720
+ }
1721
+ image({ text }) {
1722
+ return "" + text;
1723
+ }
1724
+ br() {
1725
+ return "";
1726
+ }
1727
+ };
1728
+ var _Parser = class __Parser {
1729
+ options;
1730
+ renderer;
1731
+ textRenderer;
1732
+ constructor(options2) {
1733
+ this.options = options2 || _defaults;
1734
+ this.options.renderer = this.options.renderer || new _Renderer();
1735
+ this.renderer = this.options.renderer;
1736
+ this.renderer.options = this.options;
1737
+ this.renderer.parser = this;
1738
+ this.textRenderer = new _TextRenderer();
1739
+ }
1740
+ /**
1741
+ * Static Parse Method
1742
+ */
1743
+ static parse(tokens, options2) {
1744
+ const parser2 = new __Parser(options2);
1745
+ return parser2.parse(tokens);
1746
+ }
1747
+ /**
1748
+ * Static Parse Inline Method
1749
+ */
1750
+ static parseInline(tokens, options2) {
1751
+ const parser2 = new __Parser(options2);
1752
+ return parser2.parseInline(tokens);
1753
+ }
1754
+ /**
1755
+ * Parse Loop
1756
+ */
1757
+ parse(tokens, top = true) {
1758
+ let out = "";
1759
+ for (let i = 0; i < tokens.length; i++) {
1760
+ const anyToken = tokens[i];
1761
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
1762
+ const genericToken = anyToken;
1763
+ const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
1764
+ if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
1765
+ out += ret || "";
1766
+ continue;
1767
+ }
1768
+ }
1769
+ const token = anyToken;
1770
+ switch (token.type) {
1771
+ case "space": {
1772
+ out += this.renderer.space(token);
1773
+ continue;
1774
+ }
1775
+ case "hr": {
1776
+ out += this.renderer.hr(token);
1777
+ continue;
1778
+ }
1779
+ case "heading": {
1780
+ out += this.renderer.heading(token);
1781
+ continue;
1782
+ }
1783
+ case "code": {
1784
+ out += this.renderer.code(token);
1785
+ continue;
1786
+ }
1787
+ case "table": {
1788
+ out += this.renderer.table(token);
1789
+ continue;
1790
+ }
1791
+ case "blockquote": {
1792
+ out += this.renderer.blockquote(token);
1793
+ continue;
1794
+ }
1795
+ case "list": {
1796
+ out += this.renderer.list(token);
1797
+ continue;
1798
+ }
1799
+ case "html": {
1800
+ out += this.renderer.html(token);
1801
+ continue;
1802
+ }
1803
+ case "paragraph": {
1804
+ out += this.renderer.paragraph(token);
1805
+ continue;
1806
+ }
1807
+ case "text": {
1808
+ let textToken = token;
1809
+ let body = this.renderer.text(textToken);
1810
+ while (i + 1 < tokens.length && tokens[i + 1].type === "text") {
1811
+ textToken = tokens[++i];
1812
+ body += "\n" + this.renderer.text(textToken);
1813
+ }
1814
+ if (top) {
1815
+ out += this.renderer.paragraph({
1816
+ type: "paragraph",
1817
+ raw: body,
1818
+ text: body,
1819
+ tokens: [{ type: "text", raw: body, text: body, escaped: true }]
1820
+ });
1821
+ } else {
1822
+ out += body;
1823
+ }
1824
+ continue;
1825
+ }
1826
+ default: {
1827
+ const errMsg = 'Token with "' + token.type + '" type was not found.';
1828
+ if (this.options.silent) {
1829
+ console.error(errMsg);
1830
+ return "";
1831
+ } else {
1832
+ throw new Error(errMsg);
1833
+ }
1834
+ }
1835
+ }
1836
+ }
1837
+ return out;
1838
+ }
1839
+ /**
1840
+ * Parse Inline Tokens
1841
+ */
1842
+ parseInline(tokens, renderer = this.renderer) {
1843
+ let out = "";
1844
+ for (let i = 0; i < tokens.length; i++) {
1845
+ const anyToken = tokens[i];
1846
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
1847
+ const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);
1848
+ if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
1849
+ out += ret || "";
1850
+ continue;
1851
+ }
1852
+ }
1853
+ const token = anyToken;
1854
+ switch (token.type) {
1855
+ case "escape": {
1856
+ out += renderer.text(token);
1857
+ break;
1858
+ }
1859
+ case "html": {
1860
+ out += renderer.html(token);
1861
+ break;
1862
+ }
1863
+ case "link": {
1864
+ out += renderer.link(token);
1865
+ break;
1866
+ }
1867
+ case "image": {
1868
+ out += renderer.image(token);
1869
+ break;
1870
+ }
1871
+ case "strong": {
1872
+ out += renderer.strong(token);
1873
+ break;
1874
+ }
1875
+ case "em": {
1876
+ out += renderer.em(token);
1877
+ break;
1878
+ }
1879
+ case "codespan": {
1880
+ out += renderer.codespan(token);
1881
+ break;
1882
+ }
1883
+ case "br": {
1884
+ out += renderer.br(token);
1885
+ break;
1886
+ }
1887
+ case "del": {
1888
+ out += renderer.del(token);
1889
+ break;
1890
+ }
1891
+ case "text": {
1892
+ out += renderer.text(token);
1893
+ break;
1894
+ }
1895
+ default: {
1896
+ const errMsg = 'Token with "' + token.type + '" type was not found.';
1897
+ if (this.options.silent) {
1898
+ console.error(errMsg);
1899
+ return "";
1900
+ } else {
1901
+ throw new Error(errMsg);
1902
+ }
1903
+ }
1904
+ }
1905
+ }
1906
+ return out;
1907
+ }
1908
+ };
1909
+ var _Hooks = class {
1910
+ options;
1911
+ block;
1912
+ constructor(options2) {
1913
+ this.options = options2 || _defaults;
1914
+ }
1915
+ static passThroughHooks = /* @__PURE__ */ new Set([
1916
+ "preprocess",
1917
+ "postprocess",
1918
+ "processAllTokens"
1919
+ ]);
1920
+ /**
1921
+ * Process markdown before marked
1922
+ */
1923
+ preprocess(markdown) {
1924
+ return markdown;
1925
+ }
1926
+ /**
1927
+ * Process HTML after marked is finished
1928
+ */
1929
+ postprocess(html2) {
1930
+ return html2;
1931
+ }
1932
+ /**
1933
+ * Process all tokens before walk tokens
1934
+ */
1935
+ processAllTokens(tokens) {
1936
+ return tokens;
1937
+ }
1938
+ /**
1939
+ * Provide function to tokenize markdown
1940
+ */
1941
+ provideLexer() {
1942
+ return this.block ? _Lexer.lex : _Lexer.lexInline;
1943
+ }
1944
+ /**
1945
+ * Provide function to parse tokens
1946
+ */
1947
+ provideParser() {
1948
+ return this.block ? _Parser.parse : _Parser.parseInline;
1949
+ }
1950
+ };
1951
+ var Marked = class {
1952
+ defaults = _getDefaults();
1953
+ options = this.setOptions;
1954
+ parse = this.parseMarkdown(true);
1955
+ parseInline = this.parseMarkdown(false);
1956
+ Parser = _Parser;
1957
+ Renderer = _Renderer;
1958
+ TextRenderer = _TextRenderer;
1959
+ Lexer = _Lexer;
1960
+ Tokenizer = _Tokenizer;
1961
+ Hooks = _Hooks;
1962
+ constructor(...args) {
1963
+ this.use(...args);
1964
+ }
1965
+ /**
1966
+ * Run callback for every token
1967
+ */
1968
+ walkTokens(tokens, callback) {
1969
+ let values = [];
1970
+ for (const token of tokens) {
1971
+ values = values.concat(callback.call(this, token));
1972
+ switch (token.type) {
1973
+ case "table": {
1974
+ const tableToken = token;
1975
+ for (const cell of tableToken.header) {
1976
+ values = values.concat(this.walkTokens(cell.tokens, callback));
1977
+ }
1978
+ for (const row of tableToken.rows) {
1979
+ for (const cell of row) {
1980
+ values = values.concat(this.walkTokens(cell.tokens, callback));
1981
+ }
1982
+ }
1983
+ break;
1984
+ }
1985
+ case "list": {
1986
+ const listToken = token;
1987
+ values = values.concat(this.walkTokens(listToken.items, callback));
1988
+ break;
1989
+ }
1990
+ default: {
1991
+ const genericToken = token;
1992
+ if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
1993
+ this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
1994
+ const tokens2 = genericToken[childTokens].flat(Infinity);
1995
+ values = values.concat(this.walkTokens(tokens2, callback));
1996
+ });
1997
+ } else if (genericToken.tokens) {
1998
+ values = values.concat(this.walkTokens(genericToken.tokens, callback));
1999
+ }
2000
+ }
2001
+ }
2002
+ }
2003
+ return values;
2004
+ }
2005
+ use(...args) {
2006
+ const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
2007
+ args.forEach((pack) => {
2008
+ const opts = __spreadValues({}, pack);
2009
+ opts.async = this.defaults.async || opts.async || false;
2010
+ if (pack.extensions) {
2011
+ pack.extensions.forEach((ext) => {
2012
+ if (!ext.name) {
2013
+ throw new Error("extension name required");
2014
+ }
2015
+ if ("renderer" in ext) {
2016
+ const prevRenderer = extensions.renderers[ext.name];
2017
+ if (prevRenderer) {
2018
+ extensions.renderers[ext.name] = function(...args2) {
2019
+ let ret = ext.renderer.apply(this, args2);
2020
+ if (ret === false) {
2021
+ ret = prevRenderer.apply(this, args2);
2022
+ }
2023
+ return ret;
2024
+ };
2025
+ } else {
2026
+ extensions.renderers[ext.name] = ext.renderer;
2027
+ }
2028
+ }
2029
+ if ("tokenizer" in ext) {
2030
+ if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
2031
+ throw new Error("extension level must be 'block' or 'inline'");
2032
+ }
2033
+ const extLevel = extensions[ext.level];
2034
+ if (extLevel) {
2035
+ extLevel.unshift(ext.tokenizer);
2036
+ } else {
2037
+ extensions[ext.level] = [ext.tokenizer];
2038
+ }
2039
+ if (ext.start) {
2040
+ if (ext.level === "block") {
2041
+ if (extensions.startBlock) {
2042
+ extensions.startBlock.push(ext.start);
2043
+ } else {
2044
+ extensions.startBlock = [ext.start];
2045
+ }
2046
+ } else if (ext.level === "inline") {
2047
+ if (extensions.startInline) {
2048
+ extensions.startInline.push(ext.start);
2049
+ } else {
2050
+ extensions.startInline = [ext.start];
2051
+ }
2052
+ }
2053
+ }
2054
+ }
2055
+ if ("childTokens" in ext && ext.childTokens) {
2056
+ extensions.childTokens[ext.name] = ext.childTokens;
2057
+ }
2058
+ });
2059
+ opts.extensions = extensions;
2060
+ }
2061
+ if (pack.renderer) {
2062
+ const renderer = this.defaults.renderer || new _Renderer(this.defaults);
2063
+ for (const prop in pack.renderer) {
2064
+ if (!(prop in renderer)) {
2065
+ throw new Error(`renderer '${prop}' does not exist`);
2066
+ }
2067
+ if (["options", "parser"].includes(prop)) {
2068
+ continue;
2069
+ }
2070
+ const rendererProp = prop;
2071
+ const rendererFunc = pack.renderer[rendererProp];
2072
+ const prevRenderer = renderer[rendererProp];
2073
+ renderer[rendererProp] = (...args2) => {
2074
+ let ret = rendererFunc.apply(renderer, args2);
2075
+ if (ret === false) {
2076
+ ret = prevRenderer.apply(renderer, args2);
2077
+ }
2078
+ return ret || "";
2079
+ };
2080
+ }
2081
+ opts.renderer = renderer;
2082
+ }
2083
+ if (pack.tokenizer) {
2084
+ const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
2085
+ for (const prop in pack.tokenizer) {
2086
+ if (!(prop in tokenizer)) {
2087
+ throw new Error(`tokenizer '${prop}' does not exist`);
2088
+ }
2089
+ if (["options", "rules", "lexer"].includes(prop)) {
2090
+ continue;
2091
+ }
2092
+ const tokenizerProp = prop;
2093
+ const tokenizerFunc = pack.tokenizer[tokenizerProp];
2094
+ const prevTokenizer = tokenizer[tokenizerProp];
2095
+ tokenizer[tokenizerProp] = (...args2) => {
2096
+ let ret = tokenizerFunc.apply(tokenizer, args2);
2097
+ if (ret === false) {
2098
+ ret = prevTokenizer.apply(tokenizer, args2);
2099
+ }
2100
+ return ret;
2101
+ };
2102
+ }
2103
+ opts.tokenizer = tokenizer;
2104
+ }
2105
+ if (pack.hooks) {
2106
+ const hooks = this.defaults.hooks || new _Hooks();
2107
+ for (const prop in pack.hooks) {
2108
+ if (!(prop in hooks)) {
2109
+ throw new Error(`hook '${prop}' does not exist`);
2110
+ }
2111
+ if (["options", "block"].includes(prop)) {
2112
+ continue;
2113
+ }
2114
+ const hooksProp = prop;
2115
+ const hooksFunc = pack.hooks[hooksProp];
2116
+ const prevHook = hooks[hooksProp];
2117
+ if (_Hooks.passThroughHooks.has(prop)) {
2118
+ hooks[hooksProp] = (arg) => {
2119
+ if (this.defaults.async) {
2120
+ return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
2121
+ return prevHook.call(hooks, ret2);
2122
+ });
2123
+ }
2124
+ const ret = hooksFunc.call(hooks, arg);
2125
+ return prevHook.call(hooks, ret);
2126
+ };
2127
+ } else {
2128
+ hooks[hooksProp] = (...args2) => {
2129
+ let ret = hooksFunc.apply(hooks, args2);
2130
+ if (ret === false) {
2131
+ ret = prevHook.apply(hooks, args2);
2132
+ }
2133
+ return ret;
2134
+ };
2135
+ }
2136
+ }
2137
+ opts.hooks = hooks;
2138
+ }
2139
+ if (pack.walkTokens) {
2140
+ const walkTokens2 = this.defaults.walkTokens;
2141
+ const packWalktokens = pack.walkTokens;
2142
+ opts.walkTokens = function(token) {
2143
+ let values = [];
2144
+ values.push(packWalktokens.call(this, token));
2145
+ if (walkTokens2) {
2146
+ values = values.concat(walkTokens2.call(this, token));
2147
+ }
2148
+ return values;
2149
+ };
2150
+ }
2151
+ this.defaults = __spreadValues(__spreadValues({}, this.defaults), opts);
2152
+ });
2153
+ return this;
2154
+ }
2155
+ setOptions(opt) {
2156
+ this.defaults = __spreadValues(__spreadValues({}, this.defaults), opt);
2157
+ return this;
2158
+ }
2159
+ lexer(src, options2) {
2160
+ return _Lexer.lex(src, options2 ?? this.defaults);
2161
+ }
2162
+ parser(tokens, options2) {
2163
+ return _Parser.parse(tokens, options2 ?? this.defaults);
2164
+ }
2165
+ parseMarkdown(blockType) {
2166
+ const parse2 = (src, options2) => {
2167
+ const origOpt = __spreadValues({}, options2);
2168
+ const opt = __spreadValues(__spreadValues({}, this.defaults), origOpt);
2169
+ const throwError = this.onError(!!opt.silent, !!opt.async);
2170
+ if (this.defaults.async === true && origOpt.async === false) {
2171
+ return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2172
+ }
2173
+ if (typeof src === "undefined" || src === null) {
2174
+ return throwError(new Error("marked(): input parameter is undefined or null"));
2175
+ }
2176
+ if (typeof src !== "string") {
2177
+ return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
2178
+ }
2179
+ if (opt.hooks) {
2180
+ opt.hooks.options = opt;
2181
+ opt.hooks.block = blockType;
2182
+ }
2183
+ const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
2184
+ const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
2185
+ if (opt.async) {
2186
+ return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
2187
+ }
2188
+ try {
2189
+ if (opt.hooks) {
2190
+ src = opt.hooks.preprocess(src);
2191
+ }
2192
+ let tokens = lexer2(src, opt);
2193
+ if (opt.hooks) {
2194
+ tokens = opt.hooks.processAllTokens(tokens);
2195
+ }
2196
+ if (opt.walkTokens) {
2197
+ this.walkTokens(tokens, opt.walkTokens);
2198
+ }
2199
+ let html2 = parser2(tokens, opt);
2200
+ if (opt.hooks) {
2201
+ html2 = opt.hooks.postprocess(html2);
2202
+ }
2203
+ return html2;
2204
+ } catch (e) {
2205
+ return throwError(e);
2206
+ }
2207
+ };
2208
+ return parse2;
2209
+ }
2210
+ onError(silent, async) {
2211
+ return (e) => {
2212
+ e.message += "\nPlease report this to https://github.com/markedjs/marked.";
2213
+ if (silent) {
2214
+ const msg = "<p>An error occurred:</p><pre>" + escape2(e.message + "", true) + "</pre>";
2215
+ if (async) {
2216
+ return Promise.resolve(msg);
2217
+ }
2218
+ return msg;
2219
+ }
2220
+ if (async) {
2221
+ return Promise.reject(e);
2222
+ }
2223
+ throw e;
2224
+ };
2225
+ }
2226
+ };
2227
+ var markedInstance = new Marked();
2228
+ function marked(src, opt) {
2229
+ return markedInstance.parse(src, opt);
2230
+ }
2231
+ marked.options = marked.setOptions = function(options2) {
2232
+ markedInstance.setOptions(options2);
2233
+ marked.defaults = markedInstance.defaults;
2234
+ changeDefaults(marked.defaults);
2235
+ return marked;
2236
+ };
2237
+ marked.getDefaults = _getDefaults;
2238
+ marked.defaults = _defaults;
2239
+ marked.use = function(...args) {
2240
+ markedInstance.use(...args);
2241
+ marked.defaults = markedInstance.defaults;
2242
+ changeDefaults(marked.defaults);
2243
+ return marked;
2244
+ };
2245
+ marked.walkTokens = function(tokens, callback) {
2246
+ return markedInstance.walkTokens(tokens, callback);
2247
+ };
2248
+ marked.parseInline = markedInstance.parseInline;
2249
+ marked.Parser = _Parser;
2250
+ marked.parser = _Parser.parse;
2251
+ marked.Renderer = _Renderer;
2252
+ marked.TextRenderer = _TextRenderer;
2253
+ marked.Lexer = _Lexer;
2254
+ marked.lexer = _Lexer.lex;
2255
+ marked.Tokenizer = _Tokenizer;
2256
+ marked.Hooks = _Hooks;
2257
+ marked.parse = marked;
2258
+ var options = marked.options;
2259
+ var setOptions = marked.setOptions;
2260
+ var use = marked.use;
2261
+ var walkTokens = marked.walkTokens;
2262
+ var parseInline = marked.parseInline;
2263
+ var parser = _Parser.parse;
2264
+ var lexer = _Lexer.lex;
2265
+
2266
+ // node_modules/ngx-markdown/fesm2022/ngx-markdown.mjs
2267
+ var _c0 = ["*"];
2268
+ var BUTTON_TEXT_COPY = "Copy";
2269
+ var BUTTON_TEXT_COPIED = "Copied";
2270
+ var _ClipboardButtonComponent = class _ClipboardButtonComponent {
2271
+ constructor() {
2272
+ this._buttonClick$ = new Subject();
2273
+ this.copied = toSignal(this._buttonClick$.pipe(switchMap(() => merge(of(true), timer(3e3).pipe(mapTo(false)))), distinctUntilChanged(), shareReplay(1)));
2274
+ this.copiedText = computed(() => this.copied() ? BUTTON_TEXT_COPIED : BUTTON_TEXT_COPY);
2275
+ }
2276
+ onCopyToClipboardClick() {
2277
+ this._buttonClick$.next();
2278
+ }
2279
+ };
2280
+ _ClipboardButtonComponent.\u0275fac = function ClipboardButtonComponent_Factory(__ngFactoryType__) {
2281
+ return new (__ngFactoryType__ || _ClipboardButtonComponent)();
2282
+ };
2283
+ _ClipboardButtonComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
2284
+ type: _ClipboardButtonComponent,
2285
+ selectors: [["markdown-clipboard"]],
2286
+ decls: 2,
2287
+ vars: 3,
2288
+ consts: [[1, "markdown-clipboard-button", 3, "click"]],
2289
+ template: function ClipboardButtonComponent_Template(rf, ctx) {
2290
+ if (rf & 1) {
2291
+ \u0275\u0275domElementStart(0, "button", 0);
2292
+ \u0275\u0275domListener("click", function ClipboardButtonComponent_Template_button_click_0_listener() {
2293
+ return ctx.onCopyToClipboardClick();
2294
+ });
2295
+ \u0275\u0275text(1);
2296
+ \u0275\u0275domElementEnd();
2297
+ }
2298
+ if (rf & 2) {
2299
+ \u0275\u0275classProp("copied", ctx.copied());
2300
+ \u0275\u0275advance();
2301
+ \u0275\u0275textInterpolate(ctx.copiedText());
2302
+ }
2303
+ },
2304
+ encapsulation: 2,
2305
+ changeDetection: 0
2306
+ });
2307
+ var ClipboardButtonComponent = _ClipboardButtonComponent;
2308
+ (() => {
2309
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ClipboardButtonComponent, [{
2310
+ type: Component,
2311
+ args: [{
2312
+ selector: "markdown-clipboard",
2313
+ template: `
2314
+ <button
2315
+ class="markdown-clipboard-button"
2316
+ [class.copied]="copied()"
2317
+ (click)="onCopyToClipboardClick()"
2318
+ >{{ copiedText() }}</button>
2319
+ `,
2320
+ changeDetection: ChangeDetectionStrategy.OnPush
2321
+ }]
2322
+ }], null, null);
2323
+ })();
2324
+ var CLIPBOARD_OPTIONS = new InjectionToken("CLIPBOARD_OPTIONS");
2325
+ var _LanguagePipe = class _LanguagePipe {
2326
+ transform(value, language) {
2327
+ if (value == null) {
2328
+ value = "";
2329
+ }
2330
+ if (language == null) {
2331
+ language = "";
2332
+ }
2333
+ if (typeof value !== "string") {
2334
+ console.error(`LanguagePipe has been invoked with an invalid value type [${typeof value}]`);
2335
+ return value;
2336
+ }
2337
+ if (typeof language !== "string") {
2338
+ console.error(`LanguagePipe has been invoked with an invalid parameter [${typeof language}]`);
2339
+ return value;
2340
+ }
2341
+ return "```" + language + "\n" + value + "\n```";
2342
+ }
2343
+ };
2344
+ _LanguagePipe.\u0275fac = function LanguagePipe_Factory(__ngFactoryType__) {
2345
+ return new (__ngFactoryType__ || _LanguagePipe)();
2346
+ };
2347
+ _LanguagePipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
2348
+ name: "language",
2349
+ type: _LanguagePipe,
2350
+ pure: true
2351
+ });
2352
+ var LanguagePipe = _LanguagePipe;
2353
+ (() => {
2354
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LanguagePipe, [{
2355
+ type: Pipe,
2356
+ args: [{
2357
+ name: "language"
2358
+ }]
2359
+ }], null, null);
2360
+ })();
2361
+ var PrismPlugin;
2362
+ (function(PrismPlugin2) {
2363
+ PrismPlugin2["CommandLine"] = "command-line";
2364
+ PrismPlugin2["LineHighlight"] = "line-highlight";
2365
+ PrismPlugin2["LineNumbers"] = "line-numbers";
2366
+ })(PrismPlugin || (PrismPlugin = {}));
2367
+ var MARKED_EXTENSIONS = new InjectionToken("MARKED_EXTENSIONS");
2368
+ var MARKED_OPTIONS = new InjectionToken("MARKED_OPTIONS");
2369
+ var MERMAID_OPTIONS = new InjectionToken("MERMAID_OPTIONS");
2370
+ var errorJoyPixelsNotLoaded = "[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information";
2371
+ var errorKatexNotLoaded = "[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information";
2372
+ var errorMermaidNotLoaded = "[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information";
2373
+ var errorClipboardNotLoaded = "[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information";
2374
+ var errorClipboardViewContainerRequired = "[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function";
2375
+ var errorSrcWithoutHttpClient = "[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information";
2376
+ var SECURITY_CONTEXT = new InjectionToken("SECURITY_CONTEXT");
2377
+ var _MarkdownService = class _MarkdownService {
2378
+ get options() {
2379
+ return this._options;
2380
+ }
2381
+ set options(value) {
2382
+ this._options = __spreadValues(__spreadValues({}, this.DEFAULT_MARKED_OPTIONS), value);
2383
+ }
2384
+ get renderer() {
2385
+ return this.options.renderer;
2386
+ }
2387
+ set renderer(value) {
2388
+ this.options.renderer = value;
2389
+ }
2390
+ constructor(clipboardOptions, extensions, options2, mermaidOptions, platform, securityContext, http, sanitizer) {
2391
+ this.clipboardOptions = clipboardOptions;
2392
+ this.extensions = extensions;
2393
+ this.mermaidOptions = mermaidOptions;
2394
+ this.platform = platform;
2395
+ this.securityContext = securityContext;
2396
+ this.http = http;
2397
+ this.sanitizer = sanitizer;
2398
+ this.DEFAULT_MARKED_OPTIONS = {
2399
+ renderer: new _Renderer()
2400
+ };
2401
+ this.DEFAULT_KATEX_OPTIONS = {
2402
+ delimiters: [{
2403
+ left: "$$",
2404
+ right: "$$",
2405
+ display: true
2406
+ }, {
2407
+ left: "$",
2408
+ right: "$",
2409
+ display: false
2410
+ }, {
2411
+ left: "\\(",
2412
+ right: "\\)",
2413
+ display: false
2414
+ }, {
2415
+ left: "\\begin{equation}",
2416
+ right: "\\end{equation}",
2417
+ display: true
2418
+ }, {
2419
+ left: "\\begin{align}",
2420
+ right: "\\end{align}",
2421
+ display: true
2422
+ }, {
2423
+ left: "\\begin{alignat}",
2424
+ right: "\\end{alignat}",
2425
+ display: true
2426
+ }, {
2427
+ left: "\\begin{gather}",
2428
+ right: "\\end{gather}",
2429
+ display: true
2430
+ }, {
2431
+ left: "\\begin{CD}",
2432
+ right: "\\end{CD}",
2433
+ display: true
2434
+ }, {
2435
+ left: "\\[",
2436
+ right: "\\]",
2437
+ display: true
2438
+ }]
2439
+ };
2440
+ this.DEFAULT_MERMAID_OPTIONS = {
2441
+ startOnLoad: false
2442
+ };
2443
+ this.DEFAULT_CLIPBOARD_OPTIONS = {
2444
+ buttonComponent: void 0
2445
+ };
2446
+ this.DEFAULT_PARSE_OPTIONS = {
2447
+ decodeHtml: false,
2448
+ inline: false,
2449
+ emoji: false,
2450
+ mermaid: false,
2451
+ markedOptions: void 0,
2452
+ disableSanitizer: false
2453
+ };
2454
+ this.DEFAULT_RENDER_OPTIONS = {
2455
+ clipboard: false,
2456
+ clipboardOptions: void 0,
2457
+ katex: false,
2458
+ katexOptions: void 0,
2459
+ mermaid: false,
2460
+ mermaidOptions: void 0
2461
+ };
2462
+ this._reload$ = new Subject();
2463
+ this.reload$ = this._reload$.asObservable();
2464
+ this.options = options2;
2465
+ }
2466
+ parse(markdown, parseOptions = this.DEFAULT_PARSE_OPTIONS) {
2467
+ const {
2468
+ decodeHtml,
2469
+ inline: inline2,
2470
+ emoji,
2471
+ mermaid: mermaid2,
2472
+ disableSanitizer
2473
+ } = parseOptions;
2474
+ const markedOptions = __spreadValues(__spreadValues({}, this.options), parseOptions.markedOptions);
2475
+ const renderer = markedOptions.renderer || this.renderer || new _Renderer();
2476
+ if (this.extensions) {
2477
+ this.renderer = this.extendsRendererForExtensions(renderer);
2478
+ }
2479
+ if (mermaid2) {
2480
+ this.renderer = this.extendsRendererForMermaid(renderer);
2481
+ }
2482
+ const trimmed = this.trimIndentation(markdown);
2483
+ const decoded = decodeHtml ? this.decodeHtml(trimmed) : trimmed;
2484
+ const emojified = emoji ? this.parseEmoji(decoded) : decoded;
2485
+ const marked2 = this.parseMarked(emojified, markedOptions, inline2);
2486
+ const sanitized = disableSanitizer ? marked2 : this.sanitizer.sanitize(this.securityContext, marked2);
2487
+ return sanitized || "";
2488
+ }
2489
+ render(element, options2 = this.DEFAULT_RENDER_OPTIONS, viewContainerRef) {
2490
+ const {
2491
+ clipboard,
2492
+ clipboardOptions,
2493
+ katex: katex2,
2494
+ katexOptions,
2495
+ mermaid: mermaid2,
2496
+ mermaidOptions
2497
+ } = options2;
2498
+ if (katex2) {
2499
+ this.renderKatex(element, __spreadValues(__spreadValues({}, this.DEFAULT_KATEX_OPTIONS), katexOptions));
2500
+ }
2501
+ if (mermaid2) {
2502
+ this.renderMermaid(element, __spreadValues(__spreadValues(__spreadValues({}, this.DEFAULT_MERMAID_OPTIONS), this.mermaidOptions), mermaidOptions));
2503
+ }
2504
+ if (clipboard) {
2505
+ this.renderClipboard(element, viewContainerRef, __spreadValues(__spreadValues(__spreadValues({}, this.DEFAULT_CLIPBOARD_OPTIONS), this.clipboardOptions), clipboardOptions));
2506
+ }
2507
+ this.highlight(element);
2508
+ }
2509
+ reload() {
2510
+ this._reload$.next();
2511
+ }
2512
+ getSource(src) {
2513
+ if (!this.http) {
2514
+ throw new Error(errorSrcWithoutHttpClient);
2515
+ }
2516
+ return this.http.get(src, {
2517
+ responseType: "text"
2518
+ }).pipe(map((markdown) => this.handleExtension(src, markdown)));
2519
+ }
2520
+ highlight(element) {
2521
+ if (!isPlatformBrowser(this.platform)) {
2522
+ return;
2523
+ }
2524
+ if (typeof Prism === "undefined" || typeof Prism.highlightAllUnder === "undefined") {
2525
+ return;
2526
+ }
2527
+ if (!element) {
2528
+ element = document;
2529
+ }
2530
+ const noLanguageElements = element.querySelectorAll('pre code:not([class*="language-"])');
2531
+ Array.prototype.forEach.call(noLanguageElements, (x) => x.classList.add("language-none"));
2532
+ Prism.highlightAllUnder(element);
2533
+ }
2534
+ decodeHtml(html2) {
2535
+ if (!isPlatformBrowser(this.platform)) {
2536
+ return html2;
2537
+ }
2538
+ const textarea = document.createElement("textarea");
2539
+ textarea.innerHTML = html2;
2540
+ return textarea.value;
2541
+ }
2542
+ extendsRendererForExtensions(renderer) {
2543
+ const extendedRenderer = renderer;
2544
+ if (extendedRenderer.\u0275NgxMarkdownRendererExtendedForExtensions === true) {
2545
+ return renderer;
2546
+ }
2547
+ if (this.extensions?.length > 0) {
2548
+ marked.use(...this.extensions);
2549
+ }
2550
+ extendedRenderer.\u0275NgxMarkdownRendererExtendedForExtensions = true;
2551
+ return renderer;
2552
+ }
2553
+ extendsRendererForMermaid(renderer) {
2554
+ const extendedRenderer = renderer;
2555
+ if (extendedRenderer.\u0275NgxMarkdownRendererExtendedForMermaid === true) {
2556
+ return renderer;
2557
+ }
2558
+ const defaultCode = renderer.code;
2559
+ renderer.code = (token) => {
2560
+ return token.lang === "mermaid" ? `<div class="mermaid">${token.text}</div>` : defaultCode(token);
2561
+ };
2562
+ extendedRenderer.\u0275NgxMarkdownRendererExtendedForMermaid = true;
2563
+ return renderer;
2564
+ }
2565
+ handleExtension(src, markdown) {
2566
+ const urlProtocolIndex = src.lastIndexOf("://");
2567
+ const urlWithoutProtocol = urlProtocolIndex > -1 ? src.substring(urlProtocolIndex + 4) : src;
2568
+ const lastSlashIndex = urlWithoutProtocol.lastIndexOf("/");
2569
+ const lastUrlSegment = lastSlashIndex > -1 ? urlWithoutProtocol.substring(lastSlashIndex + 1).split("?")[0] : "";
2570
+ const lastDotIndex = lastUrlSegment.lastIndexOf(".");
2571
+ const extension = lastDotIndex > -1 ? lastUrlSegment.substring(lastDotIndex + 1) : "";
2572
+ return !!extension && extension !== "md" ? "```" + extension + "\n" + markdown + "\n```" : markdown;
2573
+ }
2574
+ parseMarked(html2, markedOptions, inline2 = false) {
2575
+ if (markedOptions.renderer) {
2576
+ const renderer = __spreadValues({}, markedOptions.renderer);
2577
+ delete renderer.\u0275NgxMarkdownRendererExtendedForExtensions;
2578
+ delete renderer.\u0275NgxMarkdownRendererExtendedForMermaid;
2579
+ delete markedOptions.renderer;
2580
+ marked.use({
2581
+ renderer
2582
+ });
2583
+ }
2584
+ return inline2 ? marked.parseInline(html2, markedOptions) : marked.parse(html2, markedOptions);
2585
+ }
2586
+ parseEmoji(html2) {
2587
+ if (!isPlatformBrowser(this.platform)) {
2588
+ return html2;
2589
+ }
2590
+ if (typeof joypixels === "undefined" || typeof joypixels.shortnameToUnicode === "undefined") {
2591
+ throw new Error(errorJoyPixelsNotLoaded);
2592
+ }
2593
+ return joypixels.shortnameToUnicode(html2);
2594
+ }
2595
+ renderKatex(element, options2) {
2596
+ if (!isPlatformBrowser(this.platform)) {
2597
+ return;
2598
+ }
2599
+ if (typeof katex === "undefined" || typeof renderMathInElement === "undefined") {
2600
+ throw new Error(errorKatexNotLoaded);
2601
+ }
2602
+ renderMathInElement(element, options2);
2603
+ }
2604
+ renderClipboard(element, viewContainerRef, options2) {
2605
+ if (!isPlatformBrowser(this.platform)) {
2606
+ return;
2607
+ }
2608
+ if (typeof ClipboardJS === "undefined") {
2609
+ throw new Error(errorClipboardNotLoaded);
2610
+ }
2611
+ if (!viewContainerRef) {
2612
+ throw new Error(errorClipboardViewContainerRequired);
2613
+ }
2614
+ const {
2615
+ buttonComponent,
2616
+ buttonTemplate
2617
+ } = options2;
2618
+ const preElements = element.querySelectorAll("pre");
2619
+ for (let i = 0; i < preElements.length; i++) {
2620
+ const preElement = preElements.item(i);
2621
+ const preWrapperElement = document.createElement("div");
2622
+ preWrapperElement.style.position = "relative";
2623
+ preElement.parentNode.insertBefore(preWrapperElement, preElement);
2624
+ preWrapperElement.appendChild(preElement);
2625
+ const toolbarWrapperElement = document.createElement("div");
2626
+ toolbarWrapperElement.classList.add("markdown-clipboard-toolbar");
2627
+ toolbarWrapperElement.style.position = "absolute";
2628
+ toolbarWrapperElement.style.top = ".5em";
2629
+ toolbarWrapperElement.style.right = ".5em";
2630
+ toolbarWrapperElement.style.zIndex = "1";
2631
+ preWrapperElement.insertAdjacentElement("beforeend", toolbarWrapperElement);
2632
+ preWrapperElement.onmouseenter = () => toolbarWrapperElement.classList.add("hover");
2633
+ preWrapperElement.onmouseleave = () => toolbarWrapperElement.classList.remove("hover");
2634
+ let embeddedViewRef;
2635
+ if (buttonComponent) {
2636
+ const componentRef = viewContainerRef.createComponent(buttonComponent);
2637
+ embeddedViewRef = componentRef.hostView;
2638
+ componentRef.changeDetectorRef.markForCheck();
2639
+ } else if (buttonTemplate) {
2640
+ embeddedViewRef = viewContainerRef.createEmbeddedView(buttonTemplate);
2641
+ } else {
2642
+ const componentRef = viewContainerRef.createComponent(ClipboardButtonComponent);
2643
+ embeddedViewRef = componentRef.hostView;
2644
+ componentRef.changeDetectorRef.markForCheck();
2645
+ }
2646
+ let clipboardInstance;
2647
+ embeddedViewRef.rootNodes.forEach((node) => {
2648
+ toolbarWrapperElement.appendChild(node);
2649
+ clipboardInstance = new ClipboardJS(node, {
2650
+ text: () => preElement.innerText
2651
+ });
2652
+ });
2653
+ embeddedViewRef.onDestroy(() => clipboardInstance.destroy());
2654
+ }
2655
+ }
2656
+ renderMermaid(element, options2 = this.DEFAULT_MERMAID_OPTIONS) {
2657
+ if (!isPlatformBrowser(this.platform)) {
2658
+ return;
2659
+ }
2660
+ if (typeof mermaid === "undefined" || typeof mermaid.initialize === "undefined") {
2661
+ throw new Error(errorMermaidNotLoaded);
2662
+ }
2663
+ const mermaidElements = element.querySelectorAll(".mermaid");
2664
+ if (mermaidElements.length === 0) {
2665
+ return;
2666
+ }
2667
+ mermaid.initialize(options2);
2668
+ mermaid.run({
2669
+ nodes: mermaidElements
2670
+ });
2671
+ }
2672
+ trimIndentation(markdown) {
2673
+ if (!markdown) {
2674
+ return "";
2675
+ }
2676
+ let indentStart;
2677
+ return markdown.split("\n").map((line) => {
2678
+ let lineIdentStart = indentStart;
2679
+ if (line.length > 0) {
2680
+ lineIdentStart = isNaN(lineIdentStart) ? line.search(/\S|$/) : Math.min(line.search(/\S|$/), lineIdentStart);
2681
+ }
2682
+ if (isNaN(indentStart)) {
2683
+ indentStart = lineIdentStart;
2684
+ }
2685
+ return lineIdentStart ? line.substring(lineIdentStart) : line;
2686
+ }).join("\n");
2687
+ }
2688
+ };
2689
+ _MarkdownService.\u0275fac = function MarkdownService_Factory(__ngFactoryType__) {
2690
+ return new (__ngFactoryType__ || _MarkdownService)(\u0275\u0275inject(CLIPBOARD_OPTIONS, 8), \u0275\u0275inject(MARKED_EXTENSIONS, 8), \u0275\u0275inject(MARKED_OPTIONS, 8), \u0275\u0275inject(MERMAID_OPTIONS, 8), \u0275\u0275inject(PLATFORM_ID), \u0275\u0275inject(SECURITY_CONTEXT), \u0275\u0275inject(HttpClient, 8), \u0275\u0275inject(DomSanitizer));
2691
+ };
2692
+ _MarkdownService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({
2693
+ token: _MarkdownService,
2694
+ factory: _MarkdownService.\u0275fac
2695
+ });
2696
+ var MarkdownService = _MarkdownService;
2697
+ (() => {
2698
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MarkdownService, [{
2699
+ type: Injectable
2700
+ }], () => [{
2701
+ type: void 0,
2702
+ decorators: [{
2703
+ type: Inject,
2704
+ args: [CLIPBOARD_OPTIONS]
2705
+ }, {
2706
+ type: Optional
2707
+ }]
2708
+ }, {
2709
+ type: void 0,
2710
+ decorators: [{
2711
+ type: Inject,
2712
+ args: [MARKED_EXTENSIONS]
2713
+ }, {
2714
+ type: Optional
2715
+ }]
2716
+ }, {
2717
+ type: void 0,
2718
+ decorators: [{
2719
+ type: Inject,
2720
+ args: [MARKED_OPTIONS]
2721
+ }, {
2722
+ type: Optional
2723
+ }]
2724
+ }, {
2725
+ type: void 0,
2726
+ decorators: [{
2727
+ type: Inject,
2728
+ args: [MERMAID_OPTIONS]
2729
+ }, {
2730
+ type: Optional
2731
+ }]
2732
+ }, {
2733
+ type: Object,
2734
+ decorators: [{
2735
+ type: Inject,
2736
+ args: [PLATFORM_ID]
2737
+ }]
2738
+ }, {
2739
+ type: SecurityContext,
2740
+ decorators: [{
2741
+ type: Inject,
2742
+ args: [SECURITY_CONTEXT]
2743
+ }]
2744
+ }, {
2745
+ type: HttpClient,
2746
+ decorators: [{
2747
+ type: Optional
2748
+ }]
2749
+ }, {
2750
+ type: DomSanitizer
2751
+ }], null);
2752
+ })();
2753
+ var _MarkdownComponent = class _MarkdownComponent {
2754
+ get disableSanitizer() {
2755
+ return this._disableSanitizer;
2756
+ }
2757
+ set disableSanitizer(value) {
2758
+ this._disableSanitizer = this.coerceBooleanProperty(value);
2759
+ }
2760
+ get inline() {
2761
+ return this._inline;
2762
+ }
2763
+ set inline(value) {
2764
+ this._inline = this.coerceBooleanProperty(value);
2765
+ }
2766
+ // Plugin - clipboard
2767
+ get clipboard() {
2768
+ return this._clipboard;
2769
+ }
2770
+ set clipboard(value) {
2771
+ this._clipboard = this.coerceBooleanProperty(value);
2772
+ }
2773
+ // Plugin - emoji
2774
+ get emoji() {
2775
+ return this._emoji;
2776
+ }
2777
+ set emoji(value) {
2778
+ this._emoji = this.coerceBooleanProperty(value);
2779
+ }
2780
+ // Plugin - katex
2781
+ get katex() {
2782
+ return this._katex;
2783
+ }
2784
+ set katex(value) {
2785
+ this._katex = this.coerceBooleanProperty(value);
2786
+ }
2787
+ // Plugin - mermaid
2788
+ get mermaid() {
2789
+ return this._mermaid;
2790
+ }
2791
+ set mermaid(value) {
2792
+ this._mermaid = this.coerceBooleanProperty(value);
2793
+ }
2794
+ // Plugin - lineHighlight
2795
+ get lineHighlight() {
2796
+ return this._lineHighlight;
2797
+ }
2798
+ set lineHighlight(value) {
2799
+ this._lineHighlight = this.coerceBooleanProperty(value);
2800
+ }
2801
+ // Plugin - lineNumbers
2802
+ get lineNumbers() {
2803
+ return this._lineNumbers;
2804
+ }
2805
+ set lineNumbers(value) {
2806
+ this._lineNumbers = this.coerceBooleanProperty(value);
2807
+ }
2808
+ // Plugin - commandLine
2809
+ get commandLine() {
2810
+ return this._commandLine;
2811
+ }
2812
+ set commandLine(value) {
2813
+ this._commandLine = this.coerceBooleanProperty(value);
2814
+ }
2815
+ constructor(element, markdownService, viewContainerRef) {
2816
+ this.element = element;
2817
+ this.markdownService = markdownService;
2818
+ this.viewContainerRef = viewContainerRef;
2819
+ this.error = new EventEmitter();
2820
+ this.load = new EventEmitter();
2821
+ this.ready = new EventEmitter();
2822
+ this._clipboard = false;
2823
+ this._commandLine = false;
2824
+ this._disableSanitizer = false;
2825
+ this._emoji = false;
2826
+ this._inline = false;
2827
+ this._katex = false;
2828
+ this._lineHighlight = false;
2829
+ this._lineNumbers = false;
2830
+ this._mermaid = false;
2831
+ this.destroyed$ = new Subject();
2832
+ }
2833
+ ngOnChanges() {
2834
+ this.loadContent();
2835
+ }
2836
+ loadContent() {
2837
+ if (this.data != null) {
2838
+ this.handleData();
2839
+ return;
2840
+ }
2841
+ if (this.src != null) {
2842
+ this.handleSrc();
2843
+ return;
2844
+ }
2845
+ }
2846
+ ngAfterViewInit() {
2847
+ if (!this.data && !this.src) {
2848
+ this.handleTransclusion();
2849
+ }
2850
+ this.markdownService.reload$.pipe(takeUntil(this.destroyed$)).subscribe(() => this.loadContent());
2851
+ }
2852
+ ngOnDestroy() {
2853
+ this.destroyed$.next();
2854
+ this.destroyed$.complete();
2855
+ }
2856
+ render(markdown, decodeHtml = false) {
2857
+ return __async(this, null, function* () {
2858
+ const parsedOptions = {
2859
+ decodeHtml,
2860
+ inline: this.inline,
2861
+ emoji: this.emoji,
2862
+ mermaid: this.mermaid,
2863
+ disableSanitizer: this.disableSanitizer
2864
+ };
2865
+ const renderOptions = {
2866
+ clipboard: this.clipboard,
2867
+ clipboardOptions: this.getClipboardOptions(),
2868
+ katex: this.katex,
2869
+ katexOptions: this.katexOptions,
2870
+ mermaid: this.mermaid,
2871
+ mermaidOptions: this.mermaidOptions
2872
+ };
2873
+ const parsed = yield this.markdownService.parse(markdown, parsedOptions);
2874
+ this.element.nativeElement.innerHTML = parsed;
2875
+ this.handlePlugins();
2876
+ this.markdownService.render(this.element.nativeElement, renderOptions, this.viewContainerRef);
2877
+ this.ready.emit();
2878
+ });
2879
+ }
2880
+ coerceBooleanProperty(value) {
2881
+ return value != null && `${String(value)}` !== "false";
2882
+ }
2883
+ getClipboardOptions() {
2884
+ if (this.clipboardButtonComponent || this.clipboardButtonTemplate) {
2885
+ return {
2886
+ buttonComponent: this.clipboardButtonComponent,
2887
+ buttonTemplate: this.clipboardButtonTemplate
2888
+ };
2889
+ }
2890
+ return void 0;
2891
+ }
2892
+ handleData() {
2893
+ this.render(this.data);
2894
+ }
2895
+ handleSrc() {
2896
+ this.markdownService.getSource(this.src).subscribe({
2897
+ next: (markdown) => {
2898
+ this.render(markdown).then(() => {
2899
+ this.load.emit(markdown);
2900
+ });
2901
+ },
2902
+ error: (error) => this.error.emit(error)
2903
+ });
2904
+ }
2905
+ handleTransclusion() {
2906
+ this.render(this.element.nativeElement.innerHTML, true);
2907
+ }
2908
+ handlePlugins() {
2909
+ if (this.commandLine) {
2910
+ this.setPluginClass(this.element.nativeElement, PrismPlugin.CommandLine);
2911
+ this.setPluginOptions(this.element.nativeElement, {
2912
+ dataFilterOutput: this.filterOutput,
2913
+ dataHost: this.host,
2914
+ dataPrompt: this.prompt,
2915
+ dataOutput: this.output,
2916
+ dataUser: this.user
2917
+ });
2918
+ }
2919
+ if (this.lineHighlight) {
2920
+ this.setPluginOptions(this.element.nativeElement, {
2921
+ dataLine: this.line,
2922
+ dataLineOffset: this.lineOffset
2923
+ });
2924
+ }
2925
+ if (this.lineNumbers) {
2926
+ this.setPluginClass(this.element.nativeElement, PrismPlugin.LineNumbers);
2927
+ this.setPluginOptions(this.element.nativeElement, {
2928
+ dataStart: this.start
2929
+ });
2930
+ }
2931
+ }
2932
+ setPluginClass(element, plugin) {
2933
+ const preElements = element.querySelectorAll("pre");
2934
+ for (let i = 0; i < preElements.length; i++) {
2935
+ const classes = plugin instanceof Array ? plugin : [plugin];
2936
+ preElements.item(i).classList.add(...classes);
2937
+ }
2938
+ }
2939
+ setPluginOptions(element, options2) {
2940
+ const preElements = element.querySelectorAll("pre");
2941
+ for (let i = 0; i < preElements.length; i++) {
2942
+ Object.keys(options2).forEach((option) => {
2943
+ const attributeValue = options2[option];
2944
+ if (attributeValue) {
2945
+ const attributeName = this.toLispCase(option);
2946
+ preElements.item(i).setAttribute(attributeName, attributeValue.toString());
2947
+ }
2948
+ });
2949
+ }
2950
+ }
2951
+ toLispCase(value) {
2952
+ const upperChars = value.match(/([A-Z])/g);
2953
+ if (!upperChars) {
2954
+ return value;
2955
+ }
2956
+ let str = value.toString();
2957
+ for (let i = 0, n = upperChars.length; i < n; i++) {
2958
+ str = str.replace(new RegExp(upperChars[i]), "-" + upperChars[i].toLowerCase());
2959
+ }
2960
+ if (str.slice(0, 1) === "-") {
2961
+ str = str.slice(1);
2962
+ }
2963
+ return str;
2964
+ }
2965
+ };
2966
+ _MarkdownComponent.\u0275fac = function MarkdownComponent_Factory(__ngFactoryType__) {
2967
+ return new (__ngFactoryType__ || _MarkdownComponent)(\u0275\u0275directiveInject(ElementRef), \u0275\u0275directiveInject(MarkdownService), \u0275\u0275directiveInject(ViewContainerRef));
2968
+ };
2969
+ _MarkdownComponent.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
2970
+ type: _MarkdownComponent,
2971
+ selectors: [["markdown"], ["", "markdown", ""]],
2972
+ inputs: {
2973
+ data: "data",
2974
+ src: "src",
2975
+ disableSanitizer: "disableSanitizer",
2976
+ inline: "inline",
2977
+ clipboard: "clipboard",
2978
+ clipboardButtonComponent: "clipboardButtonComponent",
2979
+ clipboardButtonTemplate: "clipboardButtonTemplate",
2980
+ emoji: "emoji",
2981
+ katex: "katex",
2982
+ katexOptions: "katexOptions",
2983
+ mermaid: "mermaid",
2984
+ mermaidOptions: "mermaidOptions",
2985
+ lineHighlight: "lineHighlight",
2986
+ line: "line",
2987
+ lineOffset: "lineOffset",
2988
+ lineNumbers: "lineNumbers",
2989
+ start: "start",
2990
+ commandLine: "commandLine",
2991
+ filterOutput: "filterOutput",
2992
+ host: "host",
2993
+ prompt: "prompt",
2994
+ output: "output",
2995
+ user: "user"
2996
+ },
2997
+ outputs: {
2998
+ error: "error",
2999
+ load: "load",
3000
+ ready: "ready"
3001
+ },
3002
+ features: [\u0275\u0275NgOnChangesFeature],
3003
+ ngContentSelectors: _c0,
3004
+ decls: 1,
3005
+ vars: 0,
3006
+ template: function MarkdownComponent_Template(rf, ctx) {
3007
+ if (rf & 1) {
3008
+ \u0275\u0275projectionDef();
3009
+ \u0275\u0275projection(0);
3010
+ }
3011
+ },
3012
+ encapsulation: 2
3013
+ });
3014
+ var MarkdownComponent = _MarkdownComponent;
3015
+ (() => {
3016
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MarkdownComponent, [{
3017
+ type: Component,
3018
+ args: [{
3019
+ // eslint-disable-next-line @angular-eslint/component-selector
3020
+ selector: "markdown, [markdown]",
3021
+ template: "<ng-content></ng-content>"
3022
+ }]
3023
+ }], () => [{
3024
+ type: ElementRef
3025
+ }, {
3026
+ type: MarkdownService
3027
+ }, {
3028
+ type: ViewContainerRef
3029
+ }], {
3030
+ data: [{
3031
+ type: Input
3032
+ }],
3033
+ src: [{
3034
+ type: Input
3035
+ }],
3036
+ disableSanitizer: [{
3037
+ type: Input
3038
+ }],
3039
+ inline: [{
3040
+ type: Input
3041
+ }],
3042
+ clipboard: [{
3043
+ type: Input
3044
+ }],
3045
+ clipboardButtonComponent: [{
3046
+ type: Input
3047
+ }],
3048
+ clipboardButtonTemplate: [{
3049
+ type: Input
3050
+ }],
3051
+ emoji: [{
3052
+ type: Input
3053
+ }],
3054
+ katex: [{
3055
+ type: Input
3056
+ }],
3057
+ katexOptions: [{
3058
+ type: Input
3059
+ }],
3060
+ mermaid: [{
3061
+ type: Input
3062
+ }],
3063
+ mermaidOptions: [{
3064
+ type: Input
3065
+ }],
3066
+ lineHighlight: [{
3067
+ type: Input
3068
+ }],
3069
+ line: [{
3070
+ type: Input
3071
+ }],
3072
+ lineOffset: [{
3073
+ type: Input
3074
+ }],
3075
+ lineNumbers: [{
3076
+ type: Input
3077
+ }],
3078
+ start: [{
3079
+ type: Input
3080
+ }],
3081
+ commandLine: [{
3082
+ type: Input
3083
+ }],
3084
+ filterOutput: [{
3085
+ type: Input
3086
+ }],
3087
+ host: [{
3088
+ type: Input
3089
+ }],
3090
+ prompt: [{
3091
+ type: Input
3092
+ }],
3093
+ output: [{
3094
+ type: Input
3095
+ }],
3096
+ user: [{
3097
+ type: Input
3098
+ }],
3099
+ error: [{
3100
+ type: Output
3101
+ }],
3102
+ load: [{
3103
+ type: Output
3104
+ }],
3105
+ ready: [{
3106
+ type: Output
3107
+ }]
3108
+ });
3109
+ })();
3110
+ var _MarkdownPipe = class _MarkdownPipe {
3111
+ constructor(domSanitizer, elementRef, markdownService, viewContainerRef, zone) {
3112
+ this.domSanitizer = domSanitizer;
3113
+ this.elementRef = elementRef;
3114
+ this.markdownService = markdownService;
3115
+ this.viewContainerRef = viewContainerRef;
3116
+ this.zone = zone;
3117
+ }
3118
+ transform(value, options2) {
3119
+ return __async(this, null, function* () {
3120
+ if (value == null) {
3121
+ return "";
3122
+ }
3123
+ if (typeof value !== "string") {
3124
+ console.error(`MarkdownPipe has been invoked with an invalid value type [${typeof value}]`);
3125
+ return value;
3126
+ }
3127
+ const markdown = yield this.markdownService.parse(value, options2);
3128
+ this.zone.onStable.pipe(first()).subscribe(() => this.markdownService.render(this.elementRef.nativeElement, options2, this.viewContainerRef));
3129
+ return this.domSanitizer.bypassSecurityTrustHtml(markdown);
3130
+ });
3131
+ }
3132
+ };
3133
+ _MarkdownPipe.\u0275fac = function MarkdownPipe_Factory(__ngFactoryType__) {
3134
+ return new (__ngFactoryType__ || _MarkdownPipe)(\u0275\u0275directiveInject(DomSanitizer, 16), \u0275\u0275directiveInject(ElementRef, 16), \u0275\u0275directiveInject(MarkdownService, 16), \u0275\u0275directiveInject(ViewContainerRef, 16), \u0275\u0275directiveInject(NgZone, 16));
3135
+ };
3136
+ _MarkdownPipe.\u0275pipe = /* @__PURE__ */ \u0275\u0275definePipe({
3137
+ name: "markdown",
3138
+ type: _MarkdownPipe,
3139
+ pure: true
3140
+ });
3141
+ var MarkdownPipe = _MarkdownPipe;
3142
+ (() => {
3143
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MarkdownPipe, [{
3144
+ type: Pipe,
3145
+ args: [{
3146
+ name: "markdown"
3147
+ }]
3148
+ }], () => [{
3149
+ type: DomSanitizer
3150
+ }, {
3151
+ type: ElementRef
3152
+ }, {
3153
+ type: MarkdownService
3154
+ }, {
3155
+ type: ViewContainerRef
3156
+ }, {
3157
+ type: NgZone
3158
+ }], null);
3159
+ })();
3160
+ function provideMarkdown(markdownModuleConfig) {
3161
+ return [MarkdownService, markdownModuleConfig?.loader ?? [], markdownModuleConfig?.clipboardOptions ?? [], markdownModuleConfig?.markedOptions ?? [], markdownModuleConfig?.mermaidOptions ?? [], markdownModuleConfig?.markedExtensions ?? [], {
3162
+ provide: SECURITY_CONTEXT,
3163
+ useValue: markdownModuleConfig?.sanitize ?? SecurityContext.HTML
3164
+ }];
3165
+ }
3166
+ var sharedDeclarations = [ClipboardButtonComponent, LanguagePipe, MarkdownComponent, MarkdownPipe];
3167
+ var _MarkdownModule = class _MarkdownModule {
3168
+ static forRoot(markdownModuleConfig) {
3169
+ return {
3170
+ ngModule: _MarkdownModule,
3171
+ providers: [provideMarkdown(markdownModuleConfig)]
3172
+ };
3173
+ }
3174
+ static forChild() {
3175
+ return {
3176
+ ngModule: _MarkdownModule
3177
+ };
3178
+ }
3179
+ };
3180
+ _MarkdownModule.\u0275fac = function MarkdownModule_Factory(__ngFactoryType__) {
3181
+ return new (__ngFactoryType__ || _MarkdownModule)();
3182
+ };
3183
+ _MarkdownModule.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
3184
+ type: _MarkdownModule,
3185
+ imports: [ClipboardButtonComponent, LanguagePipe, MarkdownComponent, MarkdownPipe],
3186
+ exports: [ClipboardButtonComponent, LanguagePipe, MarkdownComponent, MarkdownPipe]
3187
+ });
3188
+ _MarkdownModule.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({});
3189
+ var MarkdownModule = _MarkdownModule;
3190
+ (() => {
3191
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MarkdownModule, [{
3192
+ type: NgModule,
3193
+ args: [{
3194
+ imports: sharedDeclarations,
3195
+ exports: sharedDeclarations
3196
+ }]
3197
+ }], null, null);
3198
+ })();
3199
+
3200
+ // node_modules/@angular/material/fesm2022/menu.mjs
3201
+ var _c02 = ["mat-menu-item", ""];
3202
+ var _c1 = [[["mat-icon"], ["", "matMenuItemIcon", ""]], "*"];
3203
+ var _c2 = ["mat-icon, [matMenuItemIcon]", "*"];
3204
+ function MatMenuItem_Conditional_4_Template(rf, ctx) {
3205
+ if (rf & 1) {
3206
+ \u0275\u0275namespaceSVG();
3207
+ \u0275\u0275elementStart(0, "svg", 2);
3208
+ \u0275\u0275element(1, "polygon", 3);
3209
+ \u0275\u0275elementEnd();
3210
+ }
3211
+ }
3212
+ var _c3 = ["*"];
3213
+ function MatMenu_ng_template_0_Template(rf, ctx) {
3214
+ if (rf & 1) {
3215
+ const _r1 = \u0275\u0275getCurrentView();
3216
+ \u0275\u0275domElementStart(0, "div", 0);
3217
+ \u0275\u0275domListener("click", function MatMenu_ng_template_0_Template_div_click_0_listener() {
3218
+ \u0275\u0275restoreView(_r1);
3219
+ const ctx_r1 = \u0275\u0275nextContext();
3220
+ return \u0275\u0275resetView(ctx_r1.closed.emit("click"));
3221
+ })("animationstart", function MatMenu_ng_template_0_Template_div_animationstart_0_listener($event) {
3222
+ \u0275\u0275restoreView(_r1);
3223
+ const ctx_r1 = \u0275\u0275nextContext();
3224
+ return \u0275\u0275resetView(ctx_r1._onAnimationStart($event.animationName));
3225
+ })("animationend", function MatMenu_ng_template_0_Template_div_animationend_0_listener($event) {
3226
+ \u0275\u0275restoreView(_r1);
3227
+ const ctx_r1 = \u0275\u0275nextContext();
3228
+ return \u0275\u0275resetView(ctx_r1._onAnimationDone($event.animationName));
3229
+ })("animationcancel", function MatMenu_ng_template_0_Template_div_animationcancel_0_listener($event) {
3230
+ \u0275\u0275restoreView(_r1);
3231
+ const ctx_r1 = \u0275\u0275nextContext();
3232
+ return \u0275\u0275resetView(ctx_r1._onAnimationDone($event.animationName));
3233
+ });
3234
+ \u0275\u0275domElementStart(1, "div", 1);
3235
+ \u0275\u0275projection(2);
3236
+ \u0275\u0275domElementEnd()();
3237
+ }
3238
+ if (rf & 2) {
3239
+ const ctx_r1 = \u0275\u0275nextContext();
3240
+ \u0275\u0275classMap(ctx_r1._classList);
3241
+ \u0275\u0275classProp("mat-menu-panel-animations-disabled", ctx_r1._animationsDisabled)("mat-menu-panel-exit-animation", ctx_r1._panelAnimationState === "void")("mat-menu-panel-animating", ctx_r1._isAnimating);
3242
+ \u0275\u0275domProperty("id", ctx_r1.panelId);
3243
+ \u0275\u0275attribute("aria-label", ctx_r1.ariaLabel || null)("aria-labelledby", ctx_r1.ariaLabelledby || null)("aria-describedby", ctx_r1.ariaDescribedby || null);
3244
+ }
3245
+ }
3246
+ var MAT_MENU_PANEL = new InjectionToken("MAT_MENU_PANEL");
3247
+ var MatMenuItem = class _MatMenuItem {
3248
+ _elementRef = inject(ElementRef);
3249
+ _document = inject(DOCUMENT);
3250
+ _focusMonitor = inject(FocusMonitor);
3251
+ _parentMenu = inject(MAT_MENU_PANEL, {
3252
+ optional: true
3253
+ });
3254
+ _changeDetectorRef = inject(ChangeDetectorRef);
3255
+ /** ARIA role for the menu item. */
3256
+ role = "menuitem";
3257
+ /** Whether the menu item is disabled. */
3258
+ disabled = false;
3259
+ /** Whether ripples are disabled on the menu item. */
3260
+ disableRipple = false;
3261
+ /** Stream that emits when the menu item is hovered. */
3262
+ _hovered = new Subject();
3263
+ /** Stream that emits when the menu item is focused. */
3264
+ _focused = new Subject();
3265
+ /** Whether the menu item is highlighted. */
3266
+ _highlighted = false;
3267
+ /** Whether the menu item acts as a trigger for a sub-menu. */
3268
+ _triggersSubmenu = false;
3269
+ constructor() {
3270
+ inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
3271
+ this._parentMenu?.addItem?.(this);
3272
+ }
3273
+ /** Focuses the menu item. */
3274
+ focus(origin, options2) {
3275
+ if (this._focusMonitor && origin) {
3276
+ this._focusMonitor.focusVia(this._getHostElement(), origin, options2);
3277
+ } else {
3278
+ this._getHostElement().focus(options2);
3279
+ }
3280
+ this._focused.next(this);
3281
+ }
3282
+ ngAfterViewInit() {
3283
+ if (this._focusMonitor) {
3284
+ this._focusMonitor.monitor(this._elementRef, false);
3285
+ }
3286
+ }
3287
+ ngOnDestroy() {
3288
+ if (this._focusMonitor) {
3289
+ this._focusMonitor.stopMonitoring(this._elementRef);
3290
+ }
3291
+ if (this._parentMenu && this._parentMenu.removeItem) {
3292
+ this._parentMenu.removeItem(this);
3293
+ }
3294
+ this._hovered.complete();
3295
+ this._focused.complete();
3296
+ }
3297
+ /** Used to set the `tabindex`. */
3298
+ _getTabIndex() {
3299
+ return this.disabled ? "-1" : "0";
3300
+ }
3301
+ /** Returns the host DOM element. */
3302
+ _getHostElement() {
3303
+ return this._elementRef.nativeElement;
3304
+ }
3305
+ /** Prevents the default element actions if it is disabled. */
3306
+ _checkDisabled(event) {
3307
+ if (this.disabled) {
3308
+ event.preventDefault();
3309
+ event.stopPropagation();
3310
+ }
3311
+ }
3312
+ /** Emits to the hover stream. */
3313
+ _handleMouseEnter() {
3314
+ this._hovered.next(this);
3315
+ }
3316
+ /** Gets the label to be used when determining whether the option should be focused. */
3317
+ getLabel() {
3318
+ const clone = this._elementRef.nativeElement.cloneNode(true);
3319
+ const icons = clone.querySelectorAll("mat-icon, .material-icons");
3320
+ for (let i = 0; i < icons.length; i++) {
3321
+ icons[i].remove();
3322
+ }
3323
+ return clone.textContent?.trim() || "";
3324
+ }
3325
+ _setHighlighted(isHighlighted) {
3326
+ this._highlighted = isHighlighted;
3327
+ this._changeDetectorRef.markForCheck();
3328
+ }
3329
+ _setTriggersSubmenu(triggersSubmenu) {
3330
+ this._triggersSubmenu = triggersSubmenu;
3331
+ this._changeDetectorRef.markForCheck();
3332
+ }
3333
+ _hasFocus() {
3334
+ return this._document && this._document.activeElement === this._getHostElement();
3335
+ }
3336
+ static \u0275fac = function MatMenuItem_Factory(__ngFactoryType__) {
3337
+ return new (__ngFactoryType__ || _MatMenuItem)();
3338
+ };
3339
+ static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
3340
+ type: _MatMenuItem,
3341
+ selectors: [["", "mat-menu-item", ""]],
3342
+ hostAttrs: [1, "mat-mdc-menu-item", "mat-focus-indicator"],
3343
+ hostVars: 8,
3344
+ hostBindings: function MatMenuItem_HostBindings(rf, ctx) {
3345
+ if (rf & 1) {
3346
+ \u0275\u0275listener("click", function MatMenuItem_click_HostBindingHandler($event) {
3347
+ return ctx._checkDisabled($event);
3348
+ })("mouseenter", function MatMenuItem_mouseenter_HostBindingHandler() {
3349
+ return ctx._handleMouseEnter();
3350
+ });
3351
+ }
3352
+ if (rf & 2) {
3353
+ \u0275\u0275attribute("role", ctx.role)("tabindex", ctx._getTabIndex())("aria-disabled", ctx.disabled)("disabled", ctx.disabled || null);
3354
+ \u0275\u0275classProp("mat-mdc-menu-item-highlighted", ctx._highlighted)("mat-mdc-menu-item-submenu-trigger", ctx._triggersSubmenu);
3355
+ }
3356
+ },
3357
+ inputs: {
3358
+ role: "role",
3359
+ disabled: [2, "disabled", "disabled", booleanAttribute],
3360
+ disableRipple: [2, "disableRipple", "disableRipple", booleanAttribute]
3361
+ },
3362
+ exportAs: ["matMenuItem"],
3363
+ attrs: _c02,
3364
+ ngContentSelectors: _c2,
3365
+ decls: 5,
3366
+ vars: 3,
3367
+ consts: [[1, "mat-mdc-menu-item-text"], ["matRipple", "", 1, "mat-mdc-menu-ripple", 3, "matRippleDisabled", "matRippleTrigger"], ["viewBox", "0 0 5 10", "focusable", "false", "aria-hidden", "true", 1, "mat-mdc-menu-submenu-icon"], ["points", "0,0 5,5 0,10"]],
3368
+ template: function MatMenuItem_Template(rf, ctx) {
3369
+ if (rf & 1) {
3370
+ \u0275\u0275projectionDef(_c1);
3371
+ \u0275\u0275projection(0);
3372
+ \u0275\u0275elementStart(1, "span", 0);
3373
+ \u0275\u0275projection(2, 1);
3374
+ \u0275\u0275elementEnd();
3375
+ \u0275\u0275element(3, "div", 1);
3376
+ \u0275\u0275conditionalCreate(4, MatMenuItem_Conditional_4_Template, 2, 0, ":svg:svg", 2);
3377
+ }
3378
+ if (rf & 2) {
3379
+ \u0275\u0275advance(3);
3380
+ \u0275\u0275property("matRippleDisabled", ctx.disableRipple || ctx.disabled)("matRippleTrigger", ctx._getHostElement());
3381
+ \u0275\u0275advance();
3382
+ \u0275\u0275conditional(ctx._triggersSubmenu ? 4 : -1);
3383
+ }
3384
+ },
3385
+ dependencies: [MatRipple],
3386
+ encapsulation: 2,
3387
+ changeDetection: 0
3388
+ });
3389
+ };
3390
+ (() => {
3391
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatMenuItem, [{
3392
+ type: Component,
3393
+ args: [{
3394
+ selector: "[mat-menu-item]",
3395
+ exportAs: "matMenuItem",
3396
+ host: {
3397
+ "[attr.role]": "role",
3398
+ "class": "mat-mdc-menu-item mat-focus-indicator",
3399
+ "[class.mat-mdc-menu-item-highlighted]": "_highlighted",
3400
+ "[class.mat-mdc-menu-item-submenu-trigger]": "_triggersSubmenu",
3401
+ "[attr.tabindex]": "_getTabIndex()",
3402
+ "[attr.aria-disabled]": "disabled",
3403
+ "[attr.disabled]": "disabled || null",
3404
+ "(click)": "_checkDisabled($event)",
3405
+ "(mouseenter)": "_handleMouseEnter()"
3406
+ },
3407
+ changeDetection: ChangeDetectionStrategy.OnPush,
3408
+ encapsulation: ViewEncapsulation.None,
3409
+ imports: [MatRipple],
3410
+ template: '<ng-content select="mat-icon, [matMenuItemIcon]"></ng-content>\n<span class="mat-mdc-menu-item-text"><ng-content></ng-content></span>\n<div class="mat-mdc-menu-ripple" matRipple\n [matRippleDisabled]="disableRipple || disabled"\n [matRippleTrigger]="_getHostElement()">\n</div>\n\n@if (_triggersSubmenu) {\n <svg\n class="mat-mdc-menu-submenu-icon"\n viewBox="0 0 5 10"\n focusable="false"\n aria-hidden="true"><polygon points="0,0 5,5 0,10"/></svg>\n}\n'
3411
+ }]
3412
+ }], () => [], {
3413
+ role: [{
3414
+ type: Input
3415
+ }],
3416
+ disabled: [{
3417
+ type: Input,
3418
+ args: [{
3419
+ transform: booleanAttribute
3420
+ }]
3421
+ }],
3422
+ disableRipple: [{
3423
+ type: Input,
3424
+ args: [{
3425
+ transform: booleanAttribute
3426
+ }]
3427
+ }]
3428
+ });
3429
+ })();
3430
+ function throwMatMenuInvalidPositionX() {
3431
+ throw Error(`xPosition value must be either 'before' or after'.
3432
+ Example: <mat-menu xPosition="before" #menu="matMenu"></mat-menu>`);
3433
+ }
3434
+ function throwMatMenuInvalidPositionY() {
3435
+ throw Error(`yPosition value must be either 'above' or below'.
3436
+ Example: <mat-menu yPosition="above" #menu="matMenu"></mat-menu>`);
3437
+ }
3438
+ function throwMatMenuRecursiveError() {
3439
+ throw Error(`matMenuTriggerFor: menu cannot contain its own trigger. Assign a menu that is not a parent of the trigger or move the trigger outside of the menu.`);
3440
+ }
3441
+ var MAT_MENU_CONTENT = new InjectionToken("MatMenuContent");
3442
+ var MatMenuContent = class _MatMenuContent {
3443
+ _template = inject(TemplateRef);
3444
+ _appRef = inject(ApplicationRef);
3445
+ _injector = inject(Injector);
3446
+ _viewContainerRef = inject(ViewContainerRef);
3447
+ _document = inject(DOCUMENT);
3448
+ _changeDetectorRef = inject(ChangeDetectorRef);
3449
+ _portal;
3450
+ _outlet;
3451
+ /** Emits when the menu content has been attached. */
3452
+ _attached = new Subject();
3453
+ constructor() {
3454
+ }
3455
+ /**
3456
+ * Attaches the content with a particular context.
3457
+ * @docs-private
3458
+ */
3459
+ attach(context = {}) {
3460
+ if (!this._portal) {
3461
+ this._portal = new TemplatePortal(this._template, this._viewContainerRef);
3462
+ }
3463
+ this.detach();
3464
+ if (!this._outlet) {
3465
+ this._outlet = new DomPortalOutlet(this._document.createElement("div"), this._appRef, this._injector);
3466
+ }
3467
+ const element = this._template.elementRef.nativeElement;
3468
+ element.parentNode.insertBefore(this._outlet.outletElement, element);
3469
+ this._changeDetectorRef.markForCheck();
3470
+ this._portal.attach(this._outlet, context);
3471
+ this._attached.next();
3472
+ }
3473
+ /**
3474
+ * Detaches the content.
3475
+ * @docs-private
3476
+ */
3477
+ detach() {
3478
+ if (this._portal?.isAttached) {
3479
+ this._portal.detach();
3480
+ }
3481
+ }
3482
+ ngOnDestroy() {
3483
+ this.detach();
3484
+ this._outlet?.dispose();
3485
+ }
3486
+ static \u0275fac = function MatMenuContent_Factory(__ngFactoryType__) {
3487
+ return new (__ngFactoryType__ || _MatMenuContent)();
3488
+ };
3489
+ static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
3490
+ type: _MatMenuContent,
3491
+ selectors: [["ng-template", "matMenuContent", ""]],
3492
+ features: [\u0275\u0275ProvidersFeature([{
3493
+ provide: MAT_MENU_CONTENT,
3494
+ useExisting: _MatMenuContent
3495
+ }])]
3496
+ });
3497
+ };
3498
+ (() => {
3499
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatMenuContent, [{
3500
+ type: Directive,
3501
+ args: [{
3502
+ selector: "ng-template[matMenuContent]",
3503
+ providers: [{
3504
+ provide: MAT_MENU_CONTENT,
3505
+ useExisting: MatMenuContent
3506
+ }]
3507
+ }]
3508
+ }], () => [], null);
3509
+ })();
3510
+ var MAT_MENU_DEFAULT_OPTIONS = new InjectionToken("mat-menu-default-options", {
3511
+ providedIn: "root",
3512
+ factory: MAT_MENU_DEFAULT_OPTIONS_FACTORY
3513
+ });
3514
+ function MAT_MENU_DEFAULT_OPTIONS_FACTORY() {
3515
+ return {
3516
+ overlapTrigger: false,
3517
+ xPosition: "after",
3518
+ yPosition: "below",
3519
+ backdropClass: "cdk-overlay-transparent-backdrop"
3520
+ };
3521
+ }
3522
+ var ENTER_ANIMATION = "_mat-menu-enter";
3523
+ var EXIT_ANIMATION = "_mat-menu-exit";
3524
+ var MatMenu = class _MatMenu {
3525
+ _elementRef = inject(ElementRef);
3526
+ _changeDetectorRef = inject(ChangeDetectorRef);
3527
+ _injector = inject(Injector);
3528
+ _keyManager;
3529
+ _xPosition;
3530
+ _yPosition;
3531
+ _firstItemFocusRef;
3532
+ _exitFallbackTimeout;
3533
+ /** Whether animations are currently disabled. */
3534
+ _animationsDisabled = _animationsDisabled();
3535
+ /** All items inside the menu. Includes items nested inside another menu. */
3536
+ _allItems;
3537
+ /** Only the direct descendant menu items. */
3538
+ _directDescendantItems = new QueryList();
3539
+ /** Classes to be applied to the menu panel. */
3540
+ _classList = {};
3541
+ /** Current state of the panel animation. */
3542
+ _panelAnimationState = "void";
3543
+ /** Emits whenever an animation on the menu completes. */
3544
+ _animationDone = new Subject();
3545
+ /** Whether the menu is animating. */
3546
+ _isAnimating = false;
3547
+ /** Parent menu of the current menu panel. */
3548
+ parentMenu;
3549
+ /** Layout direction of the menu. */
3550
+ direction;
3551
+ /** Class or list of classes to be added to the overlay panel. */
3552
+ overlayPanelClass;
3553
+ /** Class to be added to the backdrop element. */
3554
+ backdropClass;
3555
+ /** aria-label for the menu panel. */
3556
+ ariaLabel;
3557
+ /** aria-labelledby for the menu panel. */
3558
+ ariaLabelledby;
3559
+ /** aria-describedby for the menu panel. */
3560
+ ariaDescribedby;
3561
+ /** Position of the menu in the X axis. */
3562
+ get xPosition() {
3563
+ return this._xPosition;
3564
+ }
3565
+ set xPosition(value) {
3566
+ if (value !== "before" && value !== "after" && (typeof ngDevMode === "undefined" || ngDevMode)) {
3567
+ throwMatMenuInvalidPositionX();
3568
+ }
3569
+ this._xPosition = value;
3570
+ this.setPositionClasses();
3571
+ }
3572
+ /** Position of the menu in the Y axis. */
3573
+ get yPosition() {
3574
+ return this._yPosition;
3575
+ }
3576
+ set yPosition(value) {
3577
+ if (value !== "above" && value !== "below" && (typeof ngDevMode === "undefined" || ngDevMode)) {
3578
+ throwMatMenuInvalidPositionY();
3579
+ }
3580
+ this._yPosition = value;
3581
+ this.setPositionClasses();
3582
+ }
3583
+ /** @docs-private */
3584
+ templateRef;
3585
+ /**
3586
+ * List of the items inside of a menu.
3587
+ * @deprecated
3588
+ * @breaking-change 8.0.0
3589
+ */
3590
+ items;
3591
+ /**
3592
+ * Menu content that will be rendered lazily.
3593
+ * @docs-private
3594
+ */
3595
+ lazyContent;
3596
+ /** Whether the menu should overlap its trigger. */
3597
+ overlapTrigger;
3598
+ /** Whether the menu has a backdrop. */
3599
+ hasBackdrop;
3600
+ /**
3601
+ * This method takes classes set on the host mat-menu element and applies them on the
3602
+ * menu template that displays in the overlay container. Otherwise, it's difficult
3603
+ * to style the containing menu from outside the component.
3604
+ * @param classes list of class names
3605
+ */
3606
+ set panelClass(classes) {
3607
+ const previousPanelClass = this._previousPanelClass;
3608
+ const newClassList = __spreadValues({}, this._classList);
3609
+ if (previousPanelClass && previousPanelClass.length) {
3610
+ previousPanelClass.split(" ").forEach((className) => {
3611
+ newClassList[className] = false;
3612
+ });
3613
+ }
3614
+ this._previousPanelClass = classes;
3615
+ if (classes && classes.length) {
3616
+ classes.split(" ").forEach((className) => {
3617
+ newClassList[className] = true;
3618
+ });
3619
+ this._elementRef.nativeElement.className = "";
3620
+ }
3621
+ this._classList = newClassList;
3622
+ }
3623
+ _previousPanelClass;
3624
+ /**
3625
+ * This method takes classes set on the host mat-menu element and applies them on the
3626
+ * menu template that displays in the overlay container. Otherwise, it's difficult
3627
+ * to style the containing menu from outside the component.
3628
+ * @deprecated Use `panelClass` instead.
3629
+ * @breaking-change 8.0.0
3630
+ */
3631
+ get classList() {
3632
+ return this.panelClass;
3633
+ }
3634
+ set classList(classes) {
3635
+ this.panelClass = classes;
3636
+ }
3637
+ /** Event emitted when the menu is closed. */
3638
+ closed = new EventEmitter();
3639
+ /**
3640
+ * Event emitted when the menu is closed.
3641
+ * @deprecated Switch to `closed` instead
3642
+ * @breaking-change 8.0.0
3643
+ */
3644
+ close = this.closed;
3645
+ panelId = inject(_IdGenerator).getId("mat-menu-panel-");
3646
+ constructor() {
3647
+ const defaultOptions = inject(MAT_MENU_DEFAULT_OPTIONS);
3648
+ this.overlayPanelClass = defaultOptions.overlayPanelClass || "";
3649
+ this._xPosition = defaultOptions.xPosition;
3650
+ this._yPosition = defaultOptions.yPosition;
3651
+ this.backdropClass = defaultOptions.backdropClass;
3652
+ this.overlapTrigger = defaultOptions.overlapTrigger;
3653
+ this.hasBackdrop = defaultOptions.hasBackdrop;
3654
+ }
3655
+ ngOnInit() {
3656
+ this.setPositionClasses();
3657
+ }
3658
+ ngAfterContentInit() {
3659
+ this._updateDirectDescendants();
3660
+ this._keyManager = new FocusKeyManager(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd();
3661
+ this._keyManager.tabOut.subscribe(() => this.closed.emit("tab"));
3662
+ this._directDescendantItems.changes.pipe(startWith(this._directDescendantItems), switchMap((items) => merge(...items.map((item) => item._focused)))).subscribe((focusedItem) => this._keyManager.updateActiveItem(focusedItem));
3663
+ this._directDescendantItems.changes.subscribe((itemsList) => {
3664
+ const manager = this._keyManager;
3665
+ if (this._panelAnimationState === "enter" && manager.activeItem?._hasFocus()) {
3666
+ const items = itemsList.toArray();
3667
+ const index = Math.max(0, Math.min(items.length - 1, manager.activeItemIndex || 0));
3668
+ if (items[index] && !items[index].disabled) {
3669
+ manager.setActiveItem(index);
3670
+ } else {
3671
+ manager.setNextItemActive();
3672
+ }
3673
+ }
3674
+ });
3675
+ }
3676
+ ngOnDestroy() {
3677
+ this._keyManager?.destroy();
3678
+ this._directDescendantItems.destroy();
3679
+ this.closed.complete();
3680
+ this._firstItemFocusRef?.destroy();
3681
+ clearTimeout(this._exitFallbackTimeout);
3682
+ }
3683
+ /** Stream that emits whenever the hovered menu item changes. */
3684
+ _hovered() {
3685
+ const itemChanges = this._directDescendantItems.changes;
3686
+ return itemChanges.pipe(startWith(this._directDescendantItems), switchMap((items) => merge(...items.map((item) => item._hovered))));
3687
+ }
3688
+ /*
3689
+ * Registers a menu item with the menu.
3690
+ * @docs-private
3691
+ * @deprecated No longer being used. To be removed.
3692
+ * @breaking-change 9.0.0
3693
+ */
3694
+ addItem(_item) {
3695
+ }
3696
+ /**
3697
+ * Removes an item from the menu.
3698
+ * @docs-private
3699
+ * @deprecated No longer being used. To be removed.
3700
+ * @breaking-change 9.0.0
3701
+ */
3702
+ removeItem(_item) {
3703
+ }
3704
+ /** Handle a keyboard event from the menu, delegating to the appropriate action. */
3705
+ _handleKeydown(event) {
3706
+ const keyCode = event.keyCode;
3707
+ const manager = this._keyManager;
3708
+ switch (keyCode) {
3709
+ case ESCAPE:
3710
+ if (!hasModifierKey(event)) {
3711
+ event.preventDefault();
3712
+ this.closed.emit("keydown");
3713
+ }
3714
+ break;
3715
+ case LEFT_ARROW:
3716
+ if (this.parentMenu && this.direction === "ltr") {
3717
+ this.closed.emit("keydown");
3718
+ }
3719
+ break;
3720
+ case RIGHT_ARROW:
3721
+ if (this.parentMenu && this.direction === "rtl") {
3722
+ this.closed.emit("keydown");
3723
+ }
3724
+ break;
3725
+ default:
3726
+ if (keyCode === UP_ARROW || keyCode === DOWN_ARROW) {
3727
+ manager.setFocusOrigin("keyboard");
3728
+ }
3729
+ manager.onKeydown(event);
3730
+ return;
3731
+ }
3732
+ }
3733
+ /**
3734
+ * Focus the first item in the menu.
3735
+ * @param origin Action from which the focus originated. Used to set the correct styling.
3736
+ */
3737
+ focusFirstItem(origin = "program") {
3738
+ this._firstItemFocusRef?.destroy();
3739
+ this._firstItemFocusRef = afterNextRender(() => {
3740
+ const menuPanel = this._resolvePanel();
3741
+ if (!menuPanel || !menuPanel.contains(document.activeElement)) {
3742
+ const manager = this._keyManager;
3743
+ manager.setFocusOrigin(origin).setFirstItemActive();
3744
+ if (!manager.activeItem && menuPanel) {
3745
+ menuPanel.focus();
3746
+ }
3747
+ }
3748
+ }, {
3749
+ injector: this._injector
3750
+ });
3751
+ }
3752
+ /**
3753
+ * Resets the active item in the menu. This is used when the menu is opened, allowing
3754
+ * the user to start from the first option when pressing the down arrow.
3755
+ */
3756
+ resetActiveItem() {
3757
+ this._keyManager.setActiveItem(-1);
3758
+ }
3759
+ /**
3760
+ * @deprecated No longer used and will be removed.
3761
+ * @breaking-change 21.0.0
3762
+ */
3763
+ setElevation(_depth) {
3764
+ }
3765
+ /**
3766
+ * Adds classes to the menu panel based on its position. Can be used by
3767
+ * consumers to add specific styling based on the position.
3768
+ * @param posX Position of the menu along the x axis.
3769
+ * @param posY Position of the menu along the y axis.
3770
+ * @docs-private
3771
+ */
3772
+ setPositionClasses(posX = this.xPosition, posY = this.yPosition) {
3773
+ this._classList = __spreadProps(__spreadValues({}, this._classList), {
3774
+ ["mat-menu-before"]: posX === "before",
3775
+ ["mat-menu-after"]: posX === "after",
3776
+ ["mat-menu-above"]: posY === "above",
3777
+ ["mat-menu-below"]: posY === "below"
3778
+ });
3779
+ this._changeDetectorRef.markForCheck();
3780
+ }
3781
+ /** Callback that is invoked when the panel animation completes. */
3782
+ _onAnimationDone(state) {
3783
+ const isExit = state === EXIT_ANIMATION;
3784
+ if (isExit || state === ENTER_ANIMATION) {
3785
+ if (isExit) {
3786
+ clearTimeout(this._exitFallbackTimeout);
3787
+ this._exitFallbackTimeout = void 0;
3788
+ }
3789
+ this._animationDone.next(isExit ? "void" : "enter");
3790
+ this._isAnimating = false;
3791
+ }
3792
+ }
3793
+ _onAnimationStart(state) {
3794
+ if (state === ENTER_ANIMATION || state === EXIT_ANIMATION) {
3795
+ this._isAnimating = true;
3796
+ }
3797
+ }
3798
+ _setIsOpen(isOpen) {
3799
+ this._panelAnimationState = isOpen ? "enter" : "void";
3800
+ if (isOpen) {
3801
+ if (this._keyManager.activeItemIndex === 0) {
3802
+ const menuPanel = this._resolvePanel();
3803
+ if (menuPanel) {
3804
+ menuPanel.scrollTop = 0;
3805
+ }
3806
+ }
3807
+ } else if (!this._animationsDisabled) {
3808
+ this._exitFallbackTimeout = setTimeout(() => this._onAnimationDone(EXIT_ANIMATION), 200);
3809
+ }
3810
+ if (this._animationsDisabled) {
3811
+ setTimeout(() => {
3812
+ this._onAnimationDone(isOpen ? ENTER_ANIMATION : EXIT_ANIMATION);
3813
+ });
3814
+ }
3815
+ this._changeDetectorRef.markForCheck();
3816
+ }
3817
+ /**
3818
+ * Sets up a stream that will keep track of any newly-added menu items and will update the list
3819
+ * of direct descendants. We collect the descendants this way, because `_allItems` can include
3820
+ * items that are part of child menus, and using a custom way of registering items is unreliable
3821
+ * when it comes to maintaining the item order.
3822
+ */
3823
+ _updateDirectDescendants() {
3824
+ this._allItems.changes.pipe(startWith(this._allItems)).subscribe((items) => {
3825
+ this._directDescendantItems.reset(items.filter((item) => item._parentMenu === this));
3826
+ this._directDescendantItems.notifyOnChanges();
3827
+ });
3828
+ }
3829
+ /** Gets the menu panel DOM node. */
3830
+ _resolvePanel() {
3831
+ let menuPanel = null;
3832
+ if (this._directDescendantItems.length) {
3833
+ menuPanel = this._directDescendantItems.first._getHostElement().closest('[role="menu"]');
3834
+ }
3835
+ return menuPanel;
3836
+ }
3837
+ static \u0275fac = function MatMenu_Factory(__ngFactoryType__) {
3838
+ return new (__ngFactoryType__ || _MatMenu)();
3839
+ };
3840
+ static \u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({
3841
+ type: _MatMenu,
3842
+ selectors: [["mat-menu"]],
3843
+ contentQueries: function MatMenu_ContentQueries(rf, ctx, dirIndex) {
3844
+ if (rf & 1) {
3845
+ \u0275\u0275contentQuery(dirIndex, MAT_MENU_CONTENT, 5);
3846
+ \u0275\u0275contentQuery(dirIndex, MatMenuItem, 5);
3847
+ \u0275\u0275contentQuery(dirIndex, MatMenuItem, 4);
3848
+ }
3849
+ if (rf & 2) {
3850
+ let _t;
3851
+ \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.lazyContent = _t.first);
3852
+ \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx._allItems = _t);
3853
+ \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.items = _t);
3854
+ }
3855
+ },
3856
+ viewQuery: function MatMenu_Query(rf, ctx) {
3857
+ if (rf & 1) {
3858
+ \u0275\u0275viewQuery(TemplateRef, 5);
3859
+ }
3860
+ if (rf & 2) {
3861
+ let _t;
3862
+ \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.templateRef = _t.first);
3863
+ }
3864
+ },
3865
+ hostVars: 3,
3866
+ hostBindings: function MatMenu_HostBindings(rf, ctx) {
3867
+ if (rf & 2) {
3868
+ \u0275\u0275attribute("aria-label", null)("aria-labelledby", null)("aria-describedby", null);
3869
+ }
3870
+ },
3871
+ inputs: {
3872
+ backdropClass: "backdropClass",
3873
+ ariaLabel: [0, "aria-label", "ariaLabel"],
3874
+ ariaLabelledby: [0, "aria-labelledby", "ariaLabelledby"],
3875
+ ariaDescribedby: [0, "aria-describedby", "ariaDescribedby"],
3876
+ xPosition: "xPosition",
3877
+ yPosition: "yPosition",
3878
+ overlapTrigger: [2, "overlapTrigger", "overlapTrigger", booleanAttribute],
3879
+ hasBackdrop: [2, "hasBackdrop", "hasBackdrop", (value) => value == null ? null : booleanAttribute(value)],
3880
+ panelClass: [0, "class", "panelClass"],
3881
+ classList: "classList"
3882
+ },
3883
+ outputs: {
3884
+ closed: "closed",
3885
+ close: "close"
3886
+ },
3887
+ exportAs: ["matMenu"],
3888
+ features: [\u0275\u0275ProvidersFeature([{
3889
+ provide: MAT_MENU_PANEL,
3890
+ useExisting: _MatMenu
3891
+ }])],
3892
+ ngContentSelectors: _c3,
3893
+ decls: 1,
3894
+ vars: 0,
3895
+ consts: [["tabindex", "-1", "role", "menu", 1, "mat-mdc-menu-panel", 3, "click", "animationstart", "animationend", "animationcancel", "id"], [1, "mat-mdc-menu-content"]],
3896
+ template: function MatMenu_Template(rf, ctx) {
3897
+ if (rf & 1) {
3898
+ \u0275\u0275projectionDef();
3899
+ \u0275\u0275domTemplate(0, MatMenu_ng_template_0_Template, 3, 12, "ng-template");
3900
+ }
3901
+ },
3902
+ styles: ['mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}\n'],
3903
+ encapsulation: 2,
3904
+ changeDetection: 0
3905
+ });
3906
+ };
3907
+ (() => {
3908
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatMenu, [{
3909
+ type: Component,
3910
+ args: [{
3911
+ selector: "mat-menu",
3912
+ changeDetection: ChangeDetectionStrategy.OnPush,
3913
+ encapsulation: ViewEncapsulation.None,
3914
+ exportAs: "matMenu",
3915
+ host: {
3916
+ "[attr.aria-label]": "null",
3917
+ "[attr.aria-labelledby]": "null",
3918
+ "[attr.aria-describedby]": "null"
3919
+ },
3920
+ providers: [{
3921
+ provide: MAT_MENU_PANEL,
3922
+ useExisting: MatMenu
3923
+ }],
3924
+ template: `<ng-template>
3925
+ <div
3926
+ class="mat-mdc-menu-panel"
3927
+ [id]="panelId"
3928
+ [class]="_classList"
3929
+ [class.mat-menu-panel-animations-disabled]="_animationsDisabled"
3930
+ [class.mat-menu-panel-exit-animation]="_panelAnimationState === 'void'"
3931
+ [class.mat-menu-panel-animating]="_isAnimating"
3932
+ (click)="closed.emit('click')"
3933
+ tabindex="-1"
3934
+ role="menu"
3935
+ (animationstart)="_onAnimationStart($event.animationName)"
3936
+ (animationend)="_onAnimationDone($event.animationName)"
3937
+ (animationcancel)="_onAnimationDone($event.animationName)"
3938
+ [attr.aria-label]="ariaLabel || null"
3939
+ [attr.aria-labelledby]="ariaLabelledby || null"
3940
+ [attr.aria-describedby]="ariaDescribedby || null">
3941
+ <div class="mat-mdc-menu-content">
3942
+ <ng-content></ng-content>
3943
+ </div>
3944
+ </div>
3945
+ </ng-template>
3946
+ `,
3947
+ styles: ['mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}\n']
3948
+ }]
3949
+ }], () => [], {
3950
+ _allItems: [{
3951
+ type: ContentChildren,
3952
+ args: [MatMenuItem, {
3953
+ descendants: true
3954
+ }]
3955
+ }],
3956
+ backdropClass: [{
3957
+ type: Input
3958
+ }],
3959
+ ariaLabel: [{
3960
+ type: Input,
3961
+ args: ["aria-label"]
3962
+ }],
3963
+ ariaLabelledby: [{
3964
+ type: Input,
3965
+ args: ["aria-labelledby"]
3966
+ }],
3967
+ ariaDescribedby: [{
3968
+ type: Input,
3969
+ args: ["aria-describedby"]
3970
+ }],
3971
+ xPosition: [{
3972
+ type: Input
3973
+ }],
3974
+ yPosition: [{
3975
+ type: Input
3976
+ }],
3977
+ templateRef: [{
3978
+ type: ViewChild,
3979
+ args: [TemplateRef]
3980
+ }],
3981
+ items: [{
3982
+ type: ContentChildren,
3983
+ args: [MatMenuItem, {
3984
+ descendants: false
3985
+ }]
3986
+ }],
3987
+ lazyContent: [{
3988
+ type: ContentChild,
3989
+ args: [MAT_MENU_CONTENT]
3990
+ }],
3991
+ overlapTrigger: [{
3992
+ type: Input,
3993
+ args: [{
3994
+ transform: booleanAttribute
3995
+ }]
3996
+ }],
3997
+ hasBackdrop: [{
3998
+ type: Input,
3999
+ args: [{
4000
+ transform: (value) => value == null ? null : booleanAttribute(value)
4001
+ }]
4002
+ }],
4003
+ panelClass: [{
4004
+ type: Input,
4005
+ args: ["class"]
4006
+ }],
4007
+ classList: [{
4008
+ type: Input
4009
+ }],
4010
+ closed: [{
4011
+ type: Output
4012
+ }],
4013
+ close: [{
4014
+ type: Output
4015
+ }]
4016
+ });
4017
+ })();
4018
+ var MAT_MENU_SCROLL_STRATEGY = new InjectionToken("mat-menu-scroll-strategy", {
4019
+ providedIn: "root",
4020
+ factory: () => {
4021
+ const injector = inject(Injector);
4022
+ return () => createRepositionScrollStrategy(injector);
4023
+ }
4024
+ });
4025
+ function MAT_MENU_SCROLL_STRATEGY_FACTORY(_overlay) {
4026
+ const injector = inject(Injector);
4027
+ return () => createRepositionScrollStrategy(injector);
4028
+ }
4029
+ var MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER = {
4030
+ provide: MAT_MENU_SCROLL_STRATEGY,
4031
+ deps: [],
4032
+ useFactory: MAT_MENU_SCROLL_STRATEGY_FACTORY
4033
+ };
4034
+ var PANELS_TO_TRIGGERS = /* @__PURE__ */ new WeakMap();
4035
+ var MatMenuTriggerBase = class _MatMenuTriggerBase {
4036
+ _canHaveBackdrop;
4037
+ _element = inject(ElementRef);
4038
+ _viewContainerRef = inject(ViewContainerRef);
4039
+ _menuItemInstance = inject(MatMenuItem, {
4040
+ optional: true,
4041
+ self: true
4042
+ });
4043
+ _dir = inject(Directionality, {
4044
+ optional: true
4045
+ });
4046
+ _focusMonitor = inject(FocusMonitor);
4047
+ _ngZone = inject(NgZone);
4048
+ _injector = inject(Injector);
4049
+ _scrollStrategy = inject(MAT_MENU_SCROLL_STRATEGY);
4050
+ _changeDetectorRef = inject(ChangeDetectorRef);
4051
+ _animationsDisabled = _animationsDisabled();
4052
+ _portal;
4053
+ _overlayRef = null;
4054
+ _menuOpen = false;
4055
+ _closingActionsSubscription = Subscription.EMPTY;
4056
+ _menuCloseSubscription = Subscription.EMPTY;
4057
+ _pendingRemoval;
4058
+ /**
4059
+ * We're specifically looking for a `MatMenu` here since the generic `MatMenuPanel`
4060
+ * interface lacks some functionality around nested menus and animations.
4061
+ */
4062
+ _parentMaterialMenu;
4063
+ /**
4064
+ * Cached value of the padding of the parent menu panel.
4065
+ * Used to offset sub-menus to compensate for the padding.
4066
+ */
4067
+ _parentInnerPadding;
4068
+ // Tracking input type is necessary so it's possible to only auto-focus
4069
+ // the first item of the list when the menu is opened via the keyboard
4070
+ _openedBy = void 0;
4071
+ /** Menu currently assigned to the trigger. */
4072
+ get _menu() {
4073
+ return this._menuInternal;
4074
+ }
4075
+ set _menu(menu) {
4076
+ if (menu === this._menuInternal) {
4077
+ return;
4078
+ }
4079
+ this._menuInternal = menu;
4080
+ this._menuCloseSubscription.unsubscribe();
4081
+ if (menu) {
4082
+ if (menu === this._parentMaterialMenu && (typeof ngDevMode === "undefined" || ngDevMode)) {
4083
+ throwMatMenuRecursiveError();
4084
+ }
4085
+ this._menuCloseSubscription = menu.close.subscribe((reason) => {
4086
+ this._destroyMenu(reason);
4087
+ if ((reason === "click" || reason === "tab") && this._parentMaterialMenu) {
4088
+ this._parentMaterialMenu.closed.emit(reason);
4089
+ }
4090
+ });
4091
+ }
4092
+ this._menuItemInstance?._setTriggersSubmenu(this._triggersSubmenu());
4093
+ }
4094
+ _menuInternal;
4095
+ constructor(_canHaveBackdrop) {
4096
+ this._canHaveBackdrop = _canHaveBackdrop;
4097
+ const parentMenu = inject(MAT_MENU_PANEL, {
4098
+ optional: true
4099
+ });
4100
+ this._parentMaterialMenu = parentMenu instanceof MatMenu ? parentMenu : void 0;
4101
+ }
4102
+ ngOnDestroy() {
4103
+ if (this._menu && this._ownsMenu(this._menu)) {
4104
+ PANELS_TO_TRIGGERS.delete(this._menu);
4105
+ }
4106
+ this._pendingRemoval?.unsubscribe();
4107
+ this._menuCloseSubscription.unsubscribe();
4108
+ this._closingActionsSubscription.unsubscribe();
4109
+ if (this._overlayRef) {
4110
+ this._overlayRef.dispose();
4111
+ this._overlayRef = null;
4112
+ }
4113
+ }
4114
+ /** Whether the menu is open. */
4115
+ get menuOpen() {
4116
+ return this._menuOpen;
4117
+ }
4118
+ /** The text direction of the containing app. */
4119
+ get dir() {
4120
+ return this._dir && this._dir.value === "rtl" ? "rtl" : "ltr";
4121
+ }
4122
+ /** Whether the menu triggers a sub-menu or a top-level one. */
4123
+ _triggersSubmenu() {
4124
+ return !!(this._menuItemInstance && this._parentMaterialMenu && this._menu);
4125
+ }
4126
+ _closeMenu() {
4127
+ this._menu?.close.emit();
4128
+ }
4129
+ /** Internal method to open menu providing option to auto focus on first item. */
4130
+ _openMenu(autoFocus) {
4131
+ const menu = this._menu;
4132
+ if (this._menuOpen || !menu) {
4133
+ return;
4134
+ }
4135
+ this._pendingRemoval?.unsubscribe();
4136
+ const previousTrigger = PANELS_TO_TRIGGERS.get(menu);
4137
+ PANELS_TO_TRIGGERS.set(menu, this);
4138
+ if (previousTrigger && previousTrigger !== this) {
4139
+ previousTrigger._closeMenu();
4140
+ }
4141
+ const overlayRef = this._createOverlay(menu);
4142
+ const overlayConfig = overlayRef.getConfig();
4143
+ const positionStrategy = overlayConfig.positionStrategy;
4144
+ this._setPosition(menu, positionStrategy);
4145
+ if (this._canHaveBackdrop) {
4146
+ overlayConfig.hasBackdrop = menu.hasBackdrop == null ? !this._triggersSubmenu() : menu.hasBackdrop;
4147
+ } else {
4148
+ overlayConfig.hasBackdrop = false;
4149
+ }
4150
+ if (!overlayRef.hasAttached()) {
4151
+ overlayRef.attach(this._getPortal(menu));
4152
+ menu.lazyContent?.attach(this.menuData);
4153
+ }
4154
+ this._closingActionsSubscription = this._menuClosingActions().subscribe(() => this._closeMenu());
4155
+ menu.parentMenu = this._triggersSubmenu() ? this._parentMaterialMenu : void 0;
4156
+ menu.direction = this.dir;
4157
+ if (autoFocus) {
4158
+ menu.focusFirstItem(this._openedBy || "program");
4159
+ }
4160
+ this._setIsMenuOpen(true);
4161
+ if (menu instanceof MatMenu) {
4162
+ menu._setIsOpen(true);
4163
+ menu._directDescendantItems.changes.pipe(takeUntil(menu.close)).subscribe(() => {
4164
+ positionStrategy.withLockedPosition(false).reapplyLastPosition();
4165
+ positionStrategy.withLockedPosition(true);
4166
+ });
4167
+ }
4168
+ }
4169
+ /**
4170
+ * Focuses the menu trigger.
4171
+ * @param origin Source of the menu trigger's focus.
4172
+ */
4173
+ focus(origin, options2) {
4174
+ if (this._focusMonitor && origin) {
4175
+ this._focusMonitor.focusVia(this._element, origin, options2);
4176
+ } else {
4177
+ this._element.nativeElement.focus(options2);
4178
+ }
4179
+ }
4180
+ /** Closes the menu and does the necessary cleanup. */
4181
+ _destroyMenu(reason) {
4182
+ const overlayRef = this._overlayRef;
4183
+ const menu = this._menu;
4184
+ if (!overlayRef || !this.menuOpen) {
4185
+ return;
4186
+ }
4187
+ this._closingActionsSubscription.unsubscribe();
4188
+ this._pendingRemoval?.unsubscribe();
4189
+ if (menu instanceof MatMenu && this._ownsMenu(menu)) {
4190
+ this._pendingRemoval = menu._animationDone.pipe(take(1)).subscribe(() => {
4191
+ overlayRef.detach();
4192
+ menu.lazyContent?.detach();
4193
+ });
4194
+ menu._setIsOpen(false);
4195
+ } else {
4196
+ overlayRef.detach();
4197
+ menu?.lazyContent?.detach();
4198
+ }
4199
+ if (menu && this._ownsMenu(menu)) {
4200
+ PANELS_TO_TRIGGERS.delete(menu);
4201
+ }
4202
+ if (this.restoreFocus && (reason === "keydown" || !this._openedBy || !this._triggersSubmenu())) {
4203
+ this.focus(this._openedBy);
4204
+ }
4205
+ this._openedBy = void 0;
4206
+ this._setIsMenuOpen(false);
4207
+ }
4208
+ // set state rather than toggle to support triggers sharing a menu
4209
+ _setIsMenuOpen(isOpen) {
4210
+ if (isOpen !== this._menuOpen) {
4211
+ this._menuOpen = isOpen;
4212
+ this._menuOpen ? this.menuOpened.emit() : this.menuClosed.emit();
4213
+ if (this._triggersSubmenu()) {
4214
+ this._menuItemInstance._setHighlighted(isOpen);
4215
+ }
4216
+ this._changeDetectorRef.markForCheck();
4217
+ }
4218
+ }
4219
+ /**
4220
+ * This method creates the overlay from the provided menu's template and saves its
4221
+ * OverlayRef so that it can be attached to the DOM when openMenu is called.
4222
+ */
4223
+ _createOverlay(menu) {
4224
+ if (!this._overlayRef) {
4225
+ const config = this._getOverlayConfig(menu);
4226
+ this._subscribeToPositions(menu, config.positionStrategy);
4227
+ this._overlayRef = createOverlayRef(this._injector, config);
4228
+ this._overlayRef.keydownEvents().subscribe((event) => {
4229
+ if (this._menu instanceof MatMenu) {
4230
+ this._menu._handleKeydown(event);
4231
+ }
4232
+ });
4233
+ }
4234
+ return this._overlayRef;
4235
+ }
4236
+ /**
4237
+ * This method builds the configuration object needed to create the overlay, the OverlayState.
4238
+ * @returns OverlayConfig
4239
+ */
4240
+ _getOverlayConfig(menu) {
4241
+ return new OverlayConfig({
4242
+ positionStrategy: createFlexibleConnectedPositionStrategy(this._injector, this._getOverlayOrigin()).withLockedPosition().withGrowAfterOpen().withTransformOriginOn(".mat-menu-panel, .mat-mdc-menu-panel"),
4243
+ backdropClass: menu.backdropClass || "cdk-overlay-transparent-backdrop",
4244
+ panelClass: menu.overlayPanelClass,
4245
+ scrollStrategy: this._scrollStrategy(),
4246
+ direction: this._dir || "ltr",
4247
+ disableAnimations: this._animationsDisabled
4248
+ });
4249
+ }
4250
+ /**
4251
+ * Listens to changes in the position of the overlay and sets the correct classes
4252
+ * on the menu based on the new position. This ensures the animation origin is always
4253
+ * correct, even if a fallback position is used for the overlay.
4254
+ */
4255
+ _subscribeToPositions(menu, position) {
4256
+ if (menu.setPositionClasses) {
4257
+ position.positionChanges.subscribe((change) => {
4258
+ this._ngZone.run(() => {
4259
+ const posX = change.connectionPair.overlayX === "start" ? "after" : "before";
4260
+ const posY = change.connectionPair.overlayY === "top" ? "below" : "above";
4261
+ menu.setPositionClasses(posX, posY);
4262
+ });
4263
+ });
4264
+ }
4265
+ }
4266
+ /**
4267
+ * Sets the appropriate positions on a position strategy
4268
+ * so the overlay connects with the trigger correctly.
4269
+ * @param positionStrategy Strategy whose position to update.
4270
+ */
4271
+ _setPosition(menu, positionStrategy) {
4272
+ let [originX, originFallbackX] = menu.xPosition === "before" ? ["end", "start"] : ["start", "end"];
4273
+ let [overlayY, overlayFallbackY] = menu.yPosition === "above" ? ["bottom", "top"] : ["top", "bottom"];
4274
+ let [originY, originFallbackY] = [overlayY, overlayFallbackY];
4275
+ let [overlayX, overlayFallbackX] = [originX, originFallbackX];
4276
+ let offsetY = 0;
4277
+ if (this._triggersSubmenu()) {
4278
+ overlayFallbackX = originX = menu.xPosition === "before" ? "start" : "end";
4279
+ originFallbackX = overlayX = originX === "end" ? "start" : "end";
4280
+ if (this._parentMaterialMenu) {
4281
+ if (this._parentInnerPadding == null) {
4282
+ const firstItem = this._parentMaterialMenu.items.first;
4283
+ this._parentInnerPadding = firstItem ? firstItem._getHostElement().offsetTop : 0;
4284
+ }
4285
+ offsetY = overlayY === "bottom" ? this._parentInnerPadding : -this._parentInnerPadding;
4286
+ }
4287
+ } else if (!menu.overlapTrigger) {
4288
+ originY = overlayY === "top" ? "bottom" : "top";
4289
+ originFallbackY = overlayFallbackY === "top" ? "bottom" : "top";
4290
+ }
4291
+ positionStrategy.withPositions([{
4292
+ originX,
4293
+ originY,
4294
+ overlayX,
4295
+ overlayY,
4296
+ offsetY
4297
+ }, {
4298
+ originX: originFallbackX,
4299
+ originY,
4300
+ overlayX: overlayFallbackX,
4301
+ overlayY,
4302
+ offsetY
4303
+ }, {
4304
+ originX,
4305
+ originY: originFallbackY,
4306
+ overlayX,
4307
+ overlayY: overlayFallbackY,
4308
+ offsetY: -offsetY
4309
+ }, {
4310
+ originX: originFallbackX,
4311
+ originY: originFallbackY,
4312
+ overlayX: overlayFallbackX,
4313
+ overlayY: overlayFallbackY,
4314
+ offsetY: -offsetY
4315
+ }]);
4316
+ }
4317
+ /** Returns a stream that emits whenever an action that should close the menu occurs. */
4318
+ _menuClosingActions() {
4319
+ const outsideClicks = this._getOutsideClickStream(this._overlayRef);
4320
+ const detachments = this._overlayRef.detachments();
4321
+ const parentClose = this._parentMaterialMenu ? this._parentMaterialMenu.closed : of();
4322
+ const hover = this._parentMaterialMenu ? this._parentMaterialMenu._hovered().pipe(filter((active) => this._menuOpen && active !== this._menuItemInstance)) : of();
4323
+ return merge(outsideClicks, parentClose, hover, detachments);
4324
+ }
4325
+ /** Gets the portal that should be attached to the overlay. */
4326
+ _getPortal(menu) {
4327
+ if (!this._portal || this._portal.templateRef !== menu.templateRef) {
4328
+ this._portal = new TemplatePortal(menu.templateRef, this._viewContainerRef);
4329
+ }
4330
+ return this._portal;
4331
+ }
4332
+ /**
4333
+ * Determines whether the trigger owns a specific menu panel, at the current point in time.
4334
+ * This allows us to distinguish the case where the same panel is passed into multiple triggers
4335
+ * and multiple are open at a time.
4336
+ */
4337
+ _ownsMenu(menu) {
4338
+ return PANELS_TO_TRIGGERS.get(menu) === this;
4339
+ }
4340
+ static \u0275fac = function MatMenuTriggerBase_Factory(__ngFactoryType__) {
4341
+ \u0275\u0275invalidFactory();
4342
+ };
4343
+ static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
4344
+ type: _MatMenuTriggerBase
4345
+ });
4346
+ };
4347
+ (() => {
4348
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatMenuTriggerBase, [{
4349
+ type: Directive
4350
+ }], () => [{
4351
+ type: void 0
4352
+ }], null);
4353
+ })();
4354
+ var MatMenuTrigger = class _MatMenuTrigger extends MatMenuTriggerBase {
4355
+ _cleanupTouchstart;
4356
+ _hoverSubscription = Subscription.EMPTY;
4357
+ /**
4358
+ * @deprecated
4359
+ * @breaking-change 8.0.0
4360
+ */
4361
+ get _deprecatedMatMenuTriggerFor() {
4362
+ return this.menu;
4363
+ }
4364
+ set _deprecatedMatMenuTriggerFor(v) {
4365
+ this.menu = v;
4366
+ }
4367
+ /** References the menu instance that the trigger is associated with. */
4368
+ get menu() {
4369
+ return this._menu;
4370
+ }
4371
+ set menu(menu) {
4372
+ this._menu = menu;
4373
+ }
4374
+ /** Data to be passed along to any lazily-rendered content. */
4375
+ menuData;
4376
+ /**
4377
+ * Whether focus should be restored when the menu is closed.
4378
+ * Note that disabling this option can have accessibility implications
4379
+ * and it's up to you to manage focus, if you decide to turn it off.
4380
+ */
4381
+ restoreFocus = true;
4382
+ /** Event emitted when the associated menu is opened. */
4383
+ menuOpened = new EventEmitter();
4384
+ /**
4385
+ * Event emitted when the associated menu is opened.
4386
+ * @deprecated Switch to `menuOpened` instead
4387
+ * @breaking-change 8.0.0
4388
+ */
4389
+ // tslint:disable-next-line:no-output-on-prefix
4390
+ onMenuOpen = this.menuOpened;
4391
+ /** Event emitted when the associated menu is closed. */
4392
+ menuClosed = new EventEmitter();
4393
+ /**
4394
+ * Event emitted when the associated menu is closed.
4395
+ * @deprecated Switch to `menuClosed` instead
4396
+ * @breaking-change 8.0.0
4397
+ */
4398
+ // tslint:disable-next-line:no-output-on-prefix
4399
+ onMenuClose = this.menuClosed;
4400
+ constructor() {
4401
+ super(true);
4402
+ const renderer = inject(Renderer2);
4403
+ this._cleanupTouchstart = renderer.listen(this._element.nativeElement, "touchstart", (event) => {
4404
+ if (!isFakeTouchstartFromScreenReader(event)) {
4405
+ this._openedBy = "touch";
4406
+ }
4407
+ }, {
4408
+ passive: true
4409
+ });
4410
+ }
4411
+ /** Whether the menu triggers a sub-menu or a top-level one. */
4412
+ triggersSubmenu() {
4413
+ return super._triggersSubmenu();
4414
+ }
4415
+ /** Toggles the menu between the open and closed states. */
4416
+ toggleMenu() {
4417
+ return this.menuOpen ? this.closeMenu() : this.openMenu();
4418
+ }
4419
+ /** Opens the menu. */
4420
+ openMenu() {
4421
+ this._openMenu(true);
4422
+ }
4423
+ /** Closes the menu. */
4424
+ closeMenu() {
4425
+ this._closeMenu();
4426
+ }
4427
+ /**
4428
+ * Updates the position of the menu to ensure that it fits all options within the viewport.
4429
+ */
4430
+ updatePosition() {
4431
+ this._overlayRef?.updatePosition();
4432
+ }
4433
+ ngAfterContentInit() {
4434
+ this._handleHover();
4435
+ }
4436
+ ngOnDestroy() {
4437
+ super.ngOnDestroy();
4438
+ this._cleanupTouchstart();
4439
+ this._hoverSubscription.unsubscribe();
4440
+ }
4441
+ _getOverlayOrigin() {
4442
+ return this._element;
4443
+ }
4444
+ _getOutsideClickStream(overlayRef) {
4445
+ return overlayRef.backdropClick();
4446
+ }
4447
+ /** Handles mouse presses on the trigger. */
4448
+ _handleMousedown(event) {
4449
+ if (!isFakeMousedownFromScreenReader(event)) {
4450
+ this._openedBy = event.button === 0 ? "mouse" : void 0;
4451
+ if (this.triggersSubmenu()) {
4452
+ event.preventDefault();
4453
+ }
4454
+ }
4455
+ }
4456
+ /** Handles key presses on the trigger. */
4457
+ _handleKeydown(event) {
4458
+ const keyCode = event.keyCode;
4459
+ if (keyCode === ENTER || keyCode === SPACE) {
4460
+ this._openedBy = "keyboard";
4461
+ }
4462
+ if (this.triggersSubmenu() && (keyCode === RIGHT_ARROW && this.dir === "ltr" || keyCode === LEFT_ARROW && this.dir === "rtl")) {
4463
+ this._openedBy = "keyboard";
4464
+ this.openMenu();
4465
+ }
4466
+ }
4467
+ /** Handles click events on the trigger. */
4468
+ _handleClick(event) {
4469
+ if (this.triggersSubmenu()) {
4470
+ event.stopPropagation();
4471
+ this.openMenu();
4472
+ } else {
4473
+ this.toggleMenu();
4474
+ }
4475
+ }
4476
+ /** Handles the cases where the user hovers over the trigger. */
4477
+ _handleHover() {
4478
+ if (this.triggersSubmenu() && this._parentMaterialMenu) {
4479
+ this._hoverSubscription = this._parentMaterialMenu._hovered().subscribe((active) => {
4480
+ if (active === this._menuItemInstance && !active.disabled) {
4481
+ this._openedBy = "mouse";
4482
+ this._openMenu(false);
4483
+ }
4484
+ });
4485
+ }
4486
+ }
4487
+ static \u0275fac = function MatMenuTrigger_Factory(__ngFactoryType__) {
4488
+ return new (__ngFactoryType__ || _MatMenuTrigger)();
4489
+ };
4490
+ static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
4491
+ type: _MatMenuTrigger,
4492
+ selectors: [["", "mat-menu-trigger-for", ""], ["", "matMenuTriggerFor", ""]],
4493
+ hostAttrs: [1, "mat-mdc-menu-trigger"],
4494
+ hostVars: 3,
4495
+ hostBindings: function MatMenuTrigger_HostBindings(rf, ctx) {
4496
+ if (rf & 1) {
4497
+ \u0275\u0275listener("click", function MatMenuTrigger_click_HostBindingHandler($event) {
4498
+ return ctx._handleClick($event);
4499
+ })("mousedown", function MatMenuTrigger_mousedown_HostBindingHandler($event) {
4500
+ return ctx._handleMousedown($event);
4501
+ })("keydown", function MatMenuTrigger_keydown_HostBindingHandler($event) {
4502
+ return ctx._handleKeydown($event);
4503
+ });
4504
+ }
4505
+ if (rf & 2) {
4506
+ \u0275\u0275attribute("aria-haspopup", ctx.menu ? "menu" : null)("aria-expanded", ctx.menuOpen)("aria-controls", ctx.menuOpen ? ctx.menu == null ? null : ctx.menu.panelId : null);
4507
+ }
4508
+ },
4509
+ inputs: {
4510
+ _deprecatedMatMenuTriggerFor: [0, "mat-menu-trigger-for", "_deprecatedMatMenuTriggerFor"],
4511
+ menu: [0, "matMenuTriggerFor", "menu"],
4512
+ menuData: [0, "matMenuTriggerData", "menuData"],
4513
+ restoreFocus: [0, "matMenuTriggerRestoreFocus", "restoreFocus"]
4514
+ },
4515
+ outputs: {
4516
+ menuOpened: "menuOpened",
4517
+ onMenuOpen: "onMenuOpen",
4518
+ menuClosed: "menuClosed",
4519
+ onMenuClose: "onMenuClose"
4520
+ },
4521
+ exportAs: ["matMenuTrigger"],
4522
+ features: [\u0275\u0275InheritDefinitionFeature]
4523
+ });
4524
+ };
4525
+ (() => {
4526
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatMenuTrigger, [{
4527
+ type: Directive,
4528
+ args: [{
4529
+ selector: "[mat-menu-trigger-for], [matMenuTriggerFor]",
4530
+ host: {
4531
+ "class": "mat-mdc-menu-trigger",
4532
+ "[attr.aria-haspopup]": 'menu ? "menu" : null',
4533
+ "[attr.aria-expanded]": "menuOpen",
4534
+ "[attr.aria-controls]": "menuOpen ? menu?.panelId : null",
4535
+ "(click)": "_handleClick($event)",
4536
+ "(mousedown)": "_handleMousedown($event)",
4537
+ "(keydown)": "_handleKeydown($event)"
4538
+ },
4539
+ exportAs: "matMenuTrigger"
4540
+ }]
4541
+ }], () => [], {
4542
+ _deprecatedMatMenuTriggerFor: [{
4543
+ type: Input,
4544
+ args: ["mat-menu-trigger-for"]
4545
+ }],
4546
+ menu: [{
4547
+ type: Input,
4548
+ args: ["matMenuTriggerFor"]
4549
+ }],
4550
+ menuData: [{
4551
+ type: Input,
4552
+ args: ["matMenuTriggerData"]
4553
+ }],
4554
+ restoreFocus: [{
4555
+ type: Input,
4556
+ args: ["matMenuTriggerRestoreFocus"]
4557
+ }],
4558
+ menuOpened: [{
4559
+ type: Output
4560
+ }],
4561
+ onMenuOpen: [{
4562
+ type: Output
4563
+ }],
4564
+ menuClosed: [{
4565
+ type: Output
4566
+ }],
4567
+ onMenuClose: [{
4568
+ type: Output
4569
+ }]
4570
+ });
4571
+ })();
4572
+ var MatContextMenuTrigger = class _MatContextMenuTrigger extends MatMenuTriggerBase {
4573
+ _point = {
4574
+ x: 0,
4575
+ y: 0,
4576
+ initialX: 0,
4577
+ initialY: 0,
4578
+ initialScrollX: 0,
4579
+ initialScrollY: 0
4580
+ };
4581
+ _triggerPressedControl = false;
4582
+ _rootNode;
4583
+ _document = inject(DOCUMENT);
4584
+ _viewportRuler = inject(ViewportRuler);
4585
+ _scrollDispatcher = inject(ScrollDispatcher);
4586
+ _scrollSubscription;
4587
+ /** References the menu instance that the trigger is associated with. */
4588
+ get menu() {
4589
+ return this._menu;
4590
+ }
4591
+ set menu(menu) {
4592
+ this._menu = menu;
4593
+ }
4594
+ /** Data to be passed along to any lazily-rendered content. */
4595
+ menuData;
4596
+ /**
4597
+ * Whether focus should be restored when the menu is closed.
4598
+ * Note that disabling this option can have accessibility implications
4599
+ * and it's up to you to manage focus, if you decide to turn it off.
4600
+ */
4601
+ restoreFocus = true;
4602
+ /** Whether the context menu is disabled. */
4603
+ disabled = false;
4604
+ /** Event emitted when the associated menu is opened. */
4605
+ menuOpened = new EventEmitter();
4606
+ /** Event emitted when the associated menu is closed. */
4607
+ menuClosed = new EventEmitter();
4608
+ constructor() {
4609
+ super(false);
4610
+ }
4611
+ ngOnDestroy() {
4612
+ super.ngOnDestroy();
4613
+ this._scrollSubscription?.unsubscribe();
4614
+ }
4615
+ /** Handler for `contextmenu` events. */
4616
+ _handleContextMenuEvent(event) {
4617
+ if (!this.disabled) {
4618
+ event.preventDefault();
4619
+ if (this.menuOpen) {
4620
+ this._initializePoint(event.clientX, event.clientY);
4621
+ this._updatePosition();
4622
+ } else {
4623
+ this._openContextMenu(event);
4624
+ }
4625
+ }
4626
+ }
4627
+ _destroyMenu(reason) {
4628
+ super._destroyMenu(reason);
4629
+ this._scrollSubscription?.unsubscribe();
4630
+ }
4631
+ _getOverlayOrigin() {
4632
+ return this._point;
4633
+ }
4634
+ _getOutsideClickStream(overlayRef) {
4635
+ return overlayRef.outsidePointerEvents().pipe(skipWhile((event, index) => {
4636
+ if (event.type === "contextmenu") {
4637
+ return this._isWithinMenuOrTrigger(_getEventTarget(event));
4638
+ } else if (event.type === "auxclick") {
4639
+ if (index === 0) {
4640
+ return true;
4641
+ }
4642
+ this._rootNode ??= _getShadowRoot(this._element.nativeElement) || this._document;
4643
+ return this._isWithinMenuOrTrigger(this._rootNode.elementFromPoint(event.clientX, event.clientY));
4644
+ }
4645
+ return this._triggerPressedControl && index === 0 && event.ctrlKey;
4646
+ }));
4647
+ }
4648
+ /** Checks whether an element is within the trigger or the opened overlay. */
4649
+ _isWithinMenuOrTrigger(target) {
4650
+ if (!target) {
4651
+ return false;
4652
+ }
4653
+ const element = this._element.nativeElement;
4654
+ if (target === element || element.contains(target)) {
4655
+ return true;
4656
+ }
4657
+ const overlay = this._overlayRef?.hostElement;
4658
+ return overlay === target || !!overlay?.contains(target);
4659
+ }
4660
+ /** Opens the context menu. */
4661
+ _openContextMenu(event) {
4662
+ if (event.button === 2) {
4663
+ this._openedBy = "mouse";
4664
+ } else {
4665
+ this._openedBy = event.button === 0 ? "keyboard" : void 0;
4666
+ }
4667
+ this._initializePoint(event.clientX, event.clientY);
4668
+ this._triggerPressedControl = event.ctrlKey;
4669
+ super._openMenu(true);
4670
+ this._scrollSubscription?.unsubscribe();
4671
+ this._scrollSubscription = this._scrollDispatcher.scrolled(0).subscribe(() => {
4672
+ const position = this._viewportRuler.getViewportScrollPosition();
4673
+ const point = this._point;
4674
+ point.y = point.initialY + (point.initialScrollY - position.top);
4675
+ point.x = point.initialX + (point.initialScrollX - position.left);
4676
+ this._updatePosition();
4677
+ });
4678
+ }
4679
+ /** Initializes the point representing the origin relative to which the menu will be rendered. */
4680
+ _initializePoint(x, y) {
4681
+ const scrollPosition = this._viewportRuler.getViewportScrollPosition();
4682
+ const point = this._point;
4683
+ point.x = point.initialX = x;
4684
+ point.y = point.initialY = y;
4685
+ point.initialScrollX = scrollPosition.left;
4686
+ point.initialScrollY = scrollPosition.top;
4687
+ }
4688
+ /** Refreshes the position of the overlay. */
4689
+ _updatePosition() {
4690
+ const overlayRef = this._overlayRef;
4691
+ if (overlayRef) {
4692
+ const positionStrategy = overlayRef.getConfig().positionStrategy;
4693
+ positionStrategy.setOrigin(this._point);
4694
+ overlayRef.updatePosition();
4695
+ }
4696
+ }
4697
+ static \u0275fac = function MatContextMenuTrigger_Factory(__ngFactoryType__) {
4698
+ return new (__ngFactoryType__ || _MatContextMenuTrigger)();
4699
+ };
4700
+ static \u0275dir = /* @__PURE__ */ \u0275\u0275defineDirective({
4701
+ type: _MatContextMenuTrigger,
4702
+ selectors: [["", "matContextMenuTriggerFor", ""]],
4703
+ hostAttrs: [1, "mat-context-menu-trigger"],
4704
+ hostVars: 3,
4705
+ hostBindings: function MatContextMenuTrigger_HostBindings(rf, ctx) {
4706
+ if (rf & 1) {
4707
+ \u0275\u0275listener("contextmenu", function MatContextMenuTrigger_contextmenu_HostBindingHandler($event) {
4708
+ return ctx._handleContextMenuEvent($event);
4709
+ });
4710
+ }
4711
+ if (rf & 2) {
4712
+ \u0275\u0275attribute("aria-controls", ctx.menuOpen ? ctx.menu == null ? null : ctx.menu.panelId : null);
4713
+ \u0275\u0275classProp("mat-context-menu-trigger-disabled", ctx.disabled);
4714
+ }
4715
+ },
4716
+ inputs: {
4717
+ menu: [0, "matContextMenuTriggerFor", "menu"],
4718
+ menuData: [0, "matContextMenuTriggerData", "menuData"],
4719
+ restoreFocus: [0, "matContextMenuTriggerRestoreFocus", "restoreFocus"],
4720
+ disabled: [2, "matContextMenuTriggerDisabled", "disabled", booleanAttribute]
4721
+ },
4722
+ outputs: {
4723
+ menuOpened: "menuOpened",
4724
+ menuClosed: "menuClosed"
4725
+ },
4726
+ exportAs: ["matContextMenuTrigger"],
4727
+ features: [\u0275\u0275InheritDefinitionFeature]
4728
+ });
4729
+ };
4730
+ (() => {
4731
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatContextMenuTrigger, [{
4732
+ type: Directive,
4733
+ args: [{
4734
+ selector: "[matContextMenuTriggerFor]",
4735
+ host: {
4736
+ "class": "mat-context-menu-trigger",
4737
+ "[class.mat-context-menu-trigger-disabled]": "disabled",
4738
+ "[attr.aria-controls]": "menuOpen ? menu?.panelId : null",
4739
+ "(contextmenu)": "_handleContextMenuEvent($event)"
4740
+ },
4741
+ exportAs: "matContextMenuTrigger"
4742
+ }]
4743
+ }], () => [], {
4744
+ menu: [{
4745
+ type: Input,
4746
+ args: [{
4747
+ alias: "matContextMenuTriggerFor",
4748
+ required: true
4749
+ }]
4750
+ }],
4751
+ menuData: [{
4752
+ type: Input,
4753
+ args: ["matContextMenuTriggerData"]
4754
+ }],
4755
+ restoreFocus: [{
4756
+ type: Input,
4757
+ args: ["matContextMenuTriggerRestoreFocus"]
4758
+ }],
4759
+ disabled: [{
4760
+ type: Input,
4761
+ args: [{
4762
+ alias: "matContextMenuTriggerDisabled",
4763
+ transform: booleanAttribute
4764
+ }]
4765
+ }],
4766
+ menuOpened: [{
4767
+ type: Output
4768
+ }],
4769
+ menuClosed: [{
4770
+ type: Output
4771
+ }]
4772
+ });
4773
+ })();
4774
+ var MatMenuModule = class _MatMenuModule {
4775
+ static \u0275fac = function MatMenuModule_Factory(__ngFactoryType__) {
4776
+ return new (__ngFactoryType__ || _MatMenuModule)();
4777
+ };
4778
+ static \u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({
4779
+ type: _MatMenuModule,
4780
+ imports: [MatRippleModule, MatCommonModule, OverlayModule, MatMenu, MatMenuItem, MatMenuContent, MatMenuTrigger, MatContextMenuTrigger],
4781
+ exports: [CdkScrollableModule, MatMenu, MatCommonModule, MatMenuItem, MatMenuContent, MatMenuTrigger, MatContextMenuTrigger]
4782
+ });
4783
+ static \u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({
4784
+ providers: [MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER],
4785
+ imports: [MatRippleModule, MatCommonModule, OverlayModule, CdkScrollableModule, MatCommonModule]
4786
+ });
4787
+ };
4788
+ (() => {
4789
+ (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MatMenuModule, [{
4790
+ type: NgModule,
4791
+ args: [{
4792
+ imports: [MatRippleModule, MatCommonModule, OverlayModule, MatMenu, MatMenuItem, MatMenuContent, MatMenuTrigger, MatContextMenuTrigger],
4793
+ exports: [CdkScrollableModule, MatMenu, MatCommonModule, MatMenuItem, MatMenuContent, MatMenuTrigger, MatContextMenuTrigger],
4794
+ providers: [MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER]
4795
+ }]
4796
+ }], null, null);
4797
+ })();
4798
+ var matMenuAnimations = {
4799
+ // Represents:
4800
+ // trigger('transformMenu', [
4801
+ // state(
4802
+ // 'void',
4803
+ // style({
4804
+ // opacity: 0,
4805
+ // transform: 'scale(0.8)',
4806
+ // }),
4807
+ // ),
4808
+ // transition(
4809
+ // 'void => enter',
4810
+ // animate(
4811
+ // '120ms cubic-bezier(0, 0, 0.2, 1)',
4812
+ // style({
4813
+ // opacity: 1,
4814
+ // transform: 'scale(1)',
4815
+ // }),
4816
+ // ),
4817
+ // ),
4818
+ // transition('* => void', animate('100ms 25ms linear', style({opacity: 0}))),
4819
+ // ])
4820
+ /**
4821
+ * This animation controls the menu panel's entry and exit from the page.
4822
+ *
4823
+ * When the menu panel is added to the DOM, it scales in and fades in its border.
4824
+ *
4825
+ * When the menu panel is removed from the DOM, it simply fades out after a brief
4826
+ * delay to display the ripple.
4827
+ */
4828
+ transformMenu: {
4829
+ type: 7,
4830
+ name: "transformMenu",
4831
+ definitions: [{
4832
+ type: 0,
4833
+ name: "void",
4834
+ styles: {
4835
+ type: 6,
4836
+ styles: {
4837
+ opacity: 0,
4838
+ transform: "scale(0.8)"
4839
+ },
4840
+ offset: null
4841
+ }
4842
+ }, {
4843
+ type: 1,
4844
+ expr: "void => enter",
4845
+ animation: {
4846
+ type: 4,
4847
+ styles: {
4848
+ type: 6,
4849
+ styles: {
4850
+ opacity: 1,
4851
+ transform: "scale(1)"
4852
+ },
4853
+ offset: null
4854
+ },
4855
+ timings: "120ms cubic-bezier(0, 0, 0.2, 1)"
4856
+ },
4857
+ options: null
4858
+ }, {
4859
+ type: 1,
4860
+ expr: "* => void",
4861
+ animation: {
4862
+ type: 4,
4863
+ styles: {
4864
+ type: 6,
4865
+ styles: {
4866
+ opacity: 0
4867
+ },
4868
+ offset: null
4869
+ },
4870
+ timings: "100ms 25ms linear"
4871
+ },
4872
+ options: null
4873
+ }],
4874
+ options: {}
4875
+ },
4876
+ // Represents:
4877
+ // trigger('fadeInItems', [
4878
+ // // TODO(crisbeto): this is inside the `transformMenu`
4879
+ // // now. Remove next time we do breaking changes.
4880
+ // state('showing', style({opacity: 1})),
4881
+ // transition('void => *', [
4882
+ // style({opacity: 0}),
4883
+ // animate('400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)'),
4884
+ // ]),
4885
+ // ])
4886
+ /**
4887
+ * This animation fades in the background color and content of the menu panel
4888
+ * after its containing element is scaled in.
4889
+ */
4890
+ fadeInItems: {
4891
+ type: 7,
4892
+ name: "fadeInItems",
4893
+ definitions: [{
4894
+ type: 0,
4895
+ name: "showing",
4896
+ styles: {
4897
+ type: 6,
4898
+ styles: {
4899
+ opacity: 1
4900
+ },
4901
+ offset: null
4902
+ }
4903
+ }, {
4904
+ type: 1,
4905
+ expr: "void => *",
4906
+ animation: [{
4907
+ type: 6,
4908
+ styles: {
4909
+ opacity: 0
4910
+ },
4911
+ offset: null
4912
+ }, {
4913
+ type: 4,
4914
+ styles: null,
4915
+ timings: "400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"
4916
+ }],
4917
+ options: null
4918
+ }],
4919
+ options: {}
4920
+ }
4921
+ };
4922
+ var fadeInItems = matMenuAnimations.fadeInItems;
4923
+ var transformMenu = matMenuAnimations.transformMenu;
4924
+
4925
+ export {
4926
+ MarkdownComponent,
4927
+ provideMarkdown,
4928
+ MatMenuItem,
4929
+ MatMenuContent,
4930
+ MatMenu,
4931
+ MatMenuTrigger,
4932
+ MatMenuModule
4933
+ };
4934
+ //# sourceMappingURL=chunk-YZXYVP72.js.map