@limetech/kompendium 1.1.1

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 (348) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +313 -0
  3. package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +13 -0
  4. package/dist/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
  5. package/dist/cjs/anchor-scroll-BmplAyR0.js +69 -0
  6. package/dist/cjs/anchor-scroll-BmplAyR0.js.map +1 -0
  7. package/dist/cjs/index-DYiJ6dQL.js +1866 -0
  8. package/dist/cjs/index-DYiJ6dQL.js.map +1 -0
  9. package/dist/cjs/index.cjs.js +3 -0
  10. package/dist/cjs/index.cjs.js.map +1 -0
  11. package/dist/cjs/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.cjs.js.map +1 -0
  12. package/dist/cjs/kompendium-app_7.cjs.entry.js +2924 -0
  13. package/dist/cjs/kompendium-code.cjs.entry.js +2724 -0
  14. package/dist/cjs/kompendium-code.entry.cjs.js.map +1 -0
  15. package/dist/cjs/kompendium-component.cjs.entry.js +207 -0
  16. package/dist/cjs/kompendium-component.entry.cjs.js.map +1 -0
  17. package/dist/cjs/kompendium-debug.cjs.entry.js +47 -0
  18. package/dist/cjs/kompendium-debug.entry.cjs.js.map +1 -0
  19. package/dist/cjs/kompendium-example-code.cjs.entry.js +20 -0
  20. package/dist/cjs/kompendium-example-code.entry.cjs.js.map +1 -0
  21. package/dist/cjs/kompendium-example-markdown.cjs.entry.js +165 -0
  22. package/dist/cjs/kompendium-example-markdown.entry.cjs.js.map +1 -0
  23. package/dist/cjs/kompendium-guide.cjs.entry.js +33 -0
  24. package/dist/cjs/kompendium-guide.entry.cjs.js.map +1 -0
  25. package/dist/cjs/kompendium-markdown.cjs.entry.js +48923 -0
  26. package/dist/cjs/kompendium-markdown.entry.cjs.js.map +1 -0
  27. package/dist/cjs/kompendium-playground.cjs.entry.js +89 -0
  28. package/dist/cjs/kompendium-playground.entry.cjs.js.map +1 -0
  29. package/dist/cjs/kompendium-proplist.kompendium-taglist.entry.cjs.js.map +1 -0
  30. package/dist/cjs/kompendium-proplist_2.cjs.entry.js +49 -0
  31. package/dist/cjs/kompendium-type.cjs.entry.js +83 -0
  32. package/dist/cjs/kompendium-type.entry.cjs.js.map +1 -0
  33. package/dist/cjs/kompendium.cjs.js +25 -0
  34. package/dist/cjs/kompendium.cjs.js.map +1 -0
  35. package/dist/cjs/loader.cjs.js +13 -0
  36. package/dist/cjs/loader.cjs.js.map +1 -0
  37. package/dist/cjs/markdown-types-B884tLd-.js +15 -0
  38. package/dist/cjs/markdown-types-B884tLd-.js.map +1 -0
  39. package/dist/cjs/methods-DoA78dOH.js +97 -0
  40. package/dist/cjs/methods-DoA78dOH.js.map +1 -0
  41. package/dist/cjs/types-SjA7Kcy_.js +8 -0
  42. package/dist/cjs/types-SjA7Kcy_.js.map +1 -0
  43. package/dist/collection/assets/favicon.svg +65 -0
  44. package/dist/collection/assets/icons/bookmark-fill.svg +1 -0
  45. package/dist/collection/assets/icons/danger.svg +1 -0
  46. package/dist/collection/assets/icons/debug.svg +1 -0
  47. package/dist/collection/assets/icons/important.svg +1 -0
  48. package/dist/collection/assets/icons/info.svg +1 -0
  49. package/dist/collection/assets/icons/logo.svg +1 -0
  50. package/dist/collection/assets/icons/note.svg +1 -0
  51. package/dist/collection/assets/icons/search.svg +1 -0
  52. package/dist/collection/assets/icons/tip.svg +1 -0
  53. package/dist/collection/assets/icons/warning.svg +1 -0
  54. package/dist/collection/assets/logotype.svg +64 -0
  55. package/dist/collection/collection-manifest.json +35 -0
  56. package/dist/collection/components/anchor-scroll.js +61 -0
  57. package/dist/collection/components/anchor-scroll.js.map +1 -0
  58. package/dist/collection/components/app/app.css +125 -0
  59. package/dist/collection/components/app/app.js +149 -0
  60. package/dist/collection/components/app/app.js.map +1 -0
  61. package/dist/collection/components/code/code.css +250 -0
  62. package/dist/collection/components/code/code.js +82 -0
  63. package/dist/collection/components/code/code.js.map +1 -0
  64. package/dist/collection/components/code/examples/code.js +14 -0
  65. package/dist/collection/components/code/examples/code.js.map +1 -0
  66. package/dist/collection/components/component/component.css +383 -0
  67. package/dist/collection/components/component/component.js +191 -0
  68. package/dist/collection/components/component/component.js.map +1 -0
  69. package/dist/collection/components/component/templates/events.js +32 -0
  70. package/dist/collection/components/component/templates/events.js.map +1 -0
  71. package/dist/collection/components/component/templates/examples.js +17 -0
  72. package/dist/collection/components/component/templates/examples.js.map +1 -0
  73. package/dist/collection/components/component/templates/methods.js +54 -0
  74. package/dist/collection/components/component/templates/methods.js.map +1 -0
  75. package/dist/collection/components/component/templates/props.js +36 -0
  76. package/dist/collection/components/component/templates/props.js.map +1 -0
  77. package/dist/collection/components/component/templates/slots.js +14 -0
  78. package/dist/collection/components/component/templates/slots.js.map +1 -0
  79. package/dist/collection/components/component/templates/style.js +14 -0
  80. package/dist/collection/components/component/templates/style.js.map +1 -0
  81. package/dist/collection/components/darkmode-switch/darkmode-switch.css +141 -0
  82. package/dist/collection/components/darkmode-switch/darkmode-switch.js +90 -0
  83. package/dist/collection/components/darkmode-switch/darkmode-switch.js.map +1 -0
  84. package/dist/collection/components/darkmode-switch/types.js +2 -0
  85. package/dist/collection/components/darkmode-switch/types.js.map +1 -0
  86. package/dist/collection/components/debug/debug.js +146 -0
  87. package/dist/collection/components/debug/debug.js.map +1 -0
  88. package/dist/collection/components/guide/guide.js +61 -0
  89. package/dist/collection/components/guide/guide.js.map +1 -0
  90. package/dist/collection/components/markdown/examples/markdown-example.js +150 -0
  91. package/dist/collection/components/markdown/examples/markdown-example.js.map +1 -0
  92. package/dist/collection/components/markdown/examples/markdown.js +14 -0
  93. package/dist/collection/components/markdown/examples/markdown.js.map +1 -0
  94. package/dist/collection/components/markdown/markdown-types.js +8 -0
  95. package/dist/collection/components/markdown/markdown-types.js.map +1 -0
  96. package/dist/collection/components/markdown/markdown.css +660 -0
  97. package/dist/collection/components/markdown/markdown.js +83 -0
  98. package/dist/collection/components/markdown/markdown.js.map +1 -0
  99. package/dist/collection/components/navigation/navigation.css +403 -0
  100. package/dist/collection/components/navigation/navigation.js +184 -0
  101. package/dist/collection/components/navigation/navigation.js.map +1 -0
  102. package/dist/collection/components/playground/playground.css +198 -0
  103. package/dist/collection/components/playground/playground.js +174 -0
  104. package/dist/collection/components/playground/playground.js.map +1 -0
  105. package/dist/collection/components/playground/playground.types.js +2 -0
  106. package/dist/collection/components/playground/playground.types.js.map +1 -0
  107. package/dist/collection/components/proplist/proplist.css +334 -0
  108. package/dist/collection/components/proplist/proplist.js +53 -0
  109. package/dist/collection/components/proplist/proplist.js.map +1 -0
  110. package/dist/collection/components/search/search.css +183 -0
  111. package/dist/collection/components/search/search.js +76 -0
  112. package/dist/collection/components/search/search.js.map +1 -0
  113. package/dist/collection/components/taglist/taglist.css +58 -0
  114. package/dist/collection/components/taglist/taglist.js +82 -0
  115. package/dist/collection/components/taglist/taglist.js.map +1 -0
  116. package/dist/collection/components/type/templates/alias.js +11 -0
  117. package/dist/collection/components/type/templates/alias.js.map +1 -0
  118. package/dist/collection/components/type/templates/enum.js +25 -0
  119. package/dist/collection/components/type/templates/enum.js.map +1 -0
  120. package/dist/collection/components/type/templates/interface.js +13 -0
  121. package/dist/collection/components/type/templates/interface.js.map +1 -0
  122. package/dist/collection/components/type/type.js +97 -0
  123. package/dist/collection/components/type/type.js.map +1 -0
  124. package/dist/collection/index.js +4 -0
  125. package/dist/collection/index.js.map +1 -0
  126. package/dist/collection/kompendium/config.js +7 -0
  127. package/dist/collection/kompendium/config.js.map +1 -0
  128. package/dist/collection/kompendium/filesystem.js +9 -0
  129. package/dist/collection/kompendium/filesystem.js.map +1 -0
  130. package/dist/collection/kompendium/generator.js +217 -0
  131. package/dist/collection/kompendium/generator.js.map +1 -0
  132. package/dist/collection/kompendium/guides.js +30 -0
  133. package/dist/collection/kompendium/guides.js.map +1 -0
  134. package/dist/collection/kompendium/index.js +2 -0
  135. package/dist/collection/kompendium/index.js.map +1 -0
  136. package/dist/collection/kompendium/markdown-admonitions.js +82 -0
  137. package/dist/collection/kompendium/markdown-admonitions.js.map +1 -0
  138. package/dist/collection/kompendium/markdown-code.js +40 -0
  139. package/dist/collection/kompendium/markdown-code.js.map +1 -0
  140. package/dist/collection/kompendium/markdown-frontmatter.js +12 -0
  141. package/dist/collection/kompendium/markdown-frontmatter.js.map +1 -0
  142. package/dist/collection/kompendium/markdown-nodes.js +10 -0
  143. package/dist/collection/kompendium/markdown-nodes.js.map +1 -0
  144. package/dist/collection/kompendium/markdown-typelinks.js +115 -0
  145. package/dist/collection/kompendium/markdown-typelinks.js.map +1 -0
  146. package/dist/collection/kompendium/markdown.js +35 -0
  147. package/dist/collection/kompendium/markdown.js.map +1 -0
  148. package/dist/collection/kompendium/menu.js +149 -0
  149. package/dist/collection/kompendium/menu.js.map +1 -0
  150. package/dist/collection/kompendium/schema.js +167 -0
  151. package/dist/collection/kompendium/schema.js.map +1 -0
  152. package/dist/collection/kompendium/search.js +144 -0
  153. package/dist/collection/kompendium/search.js.map +1 -0
  154. package/dist/collection/kompendium/source.js +81 -0
  155. package/dist/collection/kompendium/source.js.map +1 -0
  156. package/dist/collection/kompendium/test/fixtures/basic.js +48 -0
  157. package/dist/collection/kompendium/test/fixtures/basic.js.map +1 -0
  158. package/dist/collection/kompendium/test/fixtures/filtering/example-type.js +2 -0
  159. package/dist/collection/kompendium/test/fixtures/filtering/example-type.js.map +1 -0
  160. package/dist/collection/kompendium/test/fixtures/filtering/node-modules-type.js +2 -0
  161. package/dist/collection/kompendium/test/fixtures/filtering/node-modules-type.js.map +1 -0
  162. package/dist/collection/kompendium/test/fixtures/filtering/private-types.js +2 -0
  163. package/dist/collection/kompendium/test/fixtures/filtering/private-types.js.map +1 -0
  164. package/dist/collection/kompendium/test/fixtures/filtering/stencil-component-types.js +2 -0
  165. package/dist/collection/kompendium/test/fixtures/filtering/stencil-component-types.js.map +1 -0
  166. package/dist/collection/kompendium/test/fixtures/filtering/test-helper-type.js +2 -0
  167. package/dist/collection/kompendium/test/fixtures/filtering/test-helper-type.js.map +1 -0
  168. package/dist/collection/kompendium/test/fixtures/filtering/valid-types.js +29 -0
  169. package/dist/collection/kompendium/test/fixtures/filtering/valid-types.js.map +1 -0
  170. package/dist/collection/kompendium/typedoc.js +481 -0
  171. package/dist/collection/kompendium/typedoc.js.map +1 -0
  172. package/dist/collection/kompendium/watch.js +9 -0
  173. package/dist/collection/kompendium/watch.js.map +1 -0
  174. package/dist/collection/types.js +2 -0
  175. package/dist/collection/types.js.map +1 -0
  176. package/dist/config.ts +8 -0
  177. package/dist/esm/_commonjsHelpers-BFTU3MAI.js +10 -0
  178. package/dist/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
  179. package/dist/esm/anchor-scroll-BAGXN2n6.js +65 -0
  180. package/dist/esm/anchor-scroll-BAGXN2n6.js.map +1 -0
  181. package/dist/esm/index-9UrzenzW.js +1857 -0
  182. package/dist/esm/index-9UrzenzW.js.map +1 -0
  183. package/dist/esm/index.js +2 -0
  184. package/dist/esm/index.js.map +1 -0
  185. package/dist/esm/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.js.map +1 -0
  186. package/dist/esm/kompendium-app_7.entry.js +2916 -0
  187. package/dist/esm/kompendium-code.entry.js +2722 -0
  188. package/dist/esm/kompendium-code.entry.js.map +1 -0
  189. package/dist/esm/kompendium-component.entry.js +205 -0
  190. package/dist/esm/kompendium-component.entry.js.map +1 -0
  191. package/dist/esm/kompendium-debug.entry.js +45 -0
  192. package/dist/esm/kompendium-debug.entry.js.map +1 -0
  193. package/dist/esm/kompendium-example-code.entry.js +18 -0
  194. package/dist/esm/kompendium-example-code.entry.js.map +1 -0
  195. package/dist/esm/kompendium-example-markdown.entry.js +163 -0
  196. package/dist/esm/kompendium-example-markdown.entry.js.map +1 -0
  197. package/dist/esm/kompendium-guide.entry.js +31 -0
  198. package/dist/esm/kompendium-guide.entry.js.map +1 -0
  199. package/dist/esm/kompendium-markdown.entry.js +48921 -0
  200. package/dist/esm/kompendium-markdown.entry.js.map +1 -0
  201. package/dist/esm/kompendium-playground.entry.js +87 -0
  202. package/dist/esm/kompendium-playground.entry.js.map +1 -0
  203. package/dist/esm/kompendium-proplist.kompendium-taglist.entry.js.map +1 -0
  204. package/dist/esm/kompendium-proplist_2.entry.js +46 -0
  205. package/dist/esm/kompendium-type.entry.js +81 -0
  206. package/dist/esm/kompendium-type.entry.js.map +1 -0
  207. package/dist/esm/kompendium.js +21 -0
  208. package/dist/esm/kompendium.js.map +1 -0
  209. package/dist/esm/loader.js +11 -0
  210. package/dist/esm/loader.js.map +1 -0
  211. package/dist/esm/markdown-types-Ajsawr_9.js +12 -0
  212. package/dist/esm/markdown-types-Ajsawr_9.js.map +1 -0
  213. package/dist/esm/methods-BAjd6f7g.js +94 -0
  214. package/dist/esm/methods-BAjd6f7g.js.map +1 -0
  215. package/dist/esm/types-BIPLEi1G.js +6 -0
  216. package/dist/esm/types-BIPLEi1G.js.map +1 -0
  217. package/dist/filesystem.ts +9 -0
  218. package/dist/generator.ts +302 -0
  219. package/dist/guides.ts +49 -0
  220. package/dist/index.cjs.js +1 -0
  221. package/dist/index.js +1 -0
  222. package/dist/index.ts +1 -0
  223. package/dist/kompendium/index.esm.js +2 -0
  224. package/dist/kompendium/index.esm.js.map +1 -0
  225. package/dist/kompendium/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.esm.js.map +1 -0
  226. package/dist/kompendium/kompendium-code.entry.esm.js.map +1 -0
  227. package/dist/kompendium/kompendium-component.entry.esm.js.map +1 -0
  228. package/dist/kompendium/kompendium-debug.entry.esm.js.map +1 -0
  229. package/dist/kompendium/kompendium-example-code.entry.esm.js.map +1 -0
  230. package/dist/kompendium/kompendium-example-markdown.entry.esm.js.map +1 -0
  231. package/dist/kompendium/kompendium-guide.entry.esm.js.map +1 -0
  232. package/dist/kompendium/kompendium-markdown.entry.esm.js.map +1 -0
  233. package/dist/kompendium/kompendium-playground.entry.esm.js.map +1 -0
  234. package/dist/kompendium/kompendium-proplist.kompendium-taglist.entry.esm.js.map +1 -0
  235. package/dist/kompendium/kompendium-type.entry.esm.js.map +1 -0
  236. package/dist/kompendium/kompendium.css +47 -0
  237. package/dist/kompendium/kompendium.esm.js +2 -0
  238. package/dist/kompendium/kompendium.esm.js.map +1 -0
  239. package/dist/kompendium/loader.esm.js.map +1 -0
  240. package/dist/kompendium/p-15e4b2c0.entry.js +2 -0
  241. package/dist/kompendium/p-15e4b2c0.entry.js.map +1 -0
  242. package/dist/kompendium/p-1cf0168f.entry.js +2 -0
  243. package/dist/kompendium/p-1cf0168f.entry.js.map +1 -0
  244. package/dist/kompendium/p-29c23c89.entry.js +2 -0
  245. package/dist/kompendium/p-29c23c89.entry.js.map +1 -0
  246. package/dist/kompendium/p-3981d11f.entry.js +2 -0
  247. package/dist/kompendium/p-3981d11f.entry.js.map +1 -0
  248. package/dist/kompendium/p-93f0548d.entry.js +2 -0
  249. package/dist/kompendium/p-93f0548d.entry.js.map +1 -0
  250. package/dist/kompendium/p-97b02575.entry.js +2 -0
  251. package/dist/kompendium/p-97b02575.entry.js.map +1 -0
  252. package/dist/kompendium/p-9UrzenzW.js +3 -0
  253. package/dist/kompendium/p-9UrzenzW.js.map +1 -0
  254. package/dist/kompendium/p-Ajsawr_9.js +2 -0
  255. package/dist/kompendium/p-Ajsawr_9.js.map +1 -0
  256. package/dist/kompendium/p-BAGXN2n6.js +2 -0
  257. package/dist/kompendium/p-BAGXN2n6.js.map +1 -0
  258. package/dist/kompendium/p-BFTU3MAI.js +2 -0
  259. package/dist/kompendium/p-BFTU3MAI.js.map +1 -0
  260. package/dist/kompendium/p-BIPLEi1G.js +2 -0
  261. package/dist/kompendium/p-BIPLEi1G.js.map +1 -0
  262. package/dist/kompendium/p-CnQEA7KO.js +2 -0
  263. package/dist/kompendium/p-CnQEA7KO.js.map +1 -0
  264. package/dist/kompendium/p-b0f95bd6.entry.js +2 -0
  265. package/dist/kompendium/p-b0f95bd6.entry.js.map +1 -0
  266. package/dist/kompendium/p-d9bcc473.entry.js +10 -0
  267. package/dist/kompendium/p-d9bcc473.entry.js.map +1 -0
  268. package/dist/kompendium/p-e36f3f1e.entry.js +2 -0
  269. package/dist/kompendium/p-e36f3f1e.entry.js.map +1 -0
  270. package/dist/kompendium/p-e52a2f57.entry.js +2 -0
  271. package/dist/kompendium/p-e52a2f57.entry.js.map +1 -0
  272. package/dist/kompendium/p-ec5861de.entry.js +2 -0
  273. package/dist/kompendium/p-ec5861de.entry.js.map +1 -0
  274. package/dist/markdown-admonitions.ts +112 -0
  275. package/dist/markdown-code.ts +51 -0
  276. package/dist/markdown-frontmatter.ts +19 -0
  277. package/dist/markdown-nodes.ts +23 -0
  278. package/dist/markdown-typelinks.ts +166 -0
  279. package/dist/markdown.ts +49 -0
  280. package/dist/menu.ts +189 -0
  281. package/dist/schema.ts +233 -0
  282. package/dist/search.ts +197 -0
  283. package/dist/source.ts +129 -0
  284. package/dist/typedoc.ts +665 -0
  285. package/dist/types/components/anchor-scroll.d.ts +36 -0
  286. package/dist/types/components/app/app.d.ts +22 -0
  287. package/dist/types/components/code/code.d.ts +26 -0
  288. package/dist/types/components/code/examples/code.d.ts +3 -0
  289. package/dist/types/components/component/component.d.ts +32 -0
  290. package/dist/types/components/component/templates/events.d.ts +5 -0
  291. package/dist/types/components/component/templates/examples.d.ts +9 -0
  292. package/dist/types/components/component/templates/methods.d.ts +5 -0
  293. package/dist/types/components/component/templates/props.d.ts +5 -0
  294. package/dist/types/components/component/templates/slots.d.ts +5 -0
  295. package/dist/types/components/component/templates/style.d.ts +5 -0
  296. package/dist/types/components/darkmode-switch/darkmode-switch.d.ts +18 -0
  297. package/dist/types/components/darkmode-switch/types.d.ts +2 -0
  298. package/dist/types/components/debug/debug.d.ts +24 -0
  299. package/dist/types/components/guide/guide.d.ts +14 -0
  300. package/dist/types/components/markdown/examples/markdown-example.d.ts +1 -0
  301. package/dist/types/components/markdown/examples/markdown.d.ts +7 -0
  302. package/dist/types/components/markdown/markdown-types.d.ts +2 -0
  303. package/dist/types/components/markdown/markdown.d.ts +20 -0
  304. package/dist/types/components/navigation/navigation.d.ts +35 -0
  305. package/dist/types/components/playground/playground.d.ts +32 -0
  306. package/dist/types/components/playground/playground.types.d.ts +1 -0
  307. package/dist/types/components/proplist/proplist.d.ts +12 -0
  308. package/dist/types/components/search/search.d.ts +15 -0
  309. package/dist/types/components/taglist/taglist.d.ts +16 -0
  310. package/dist/types/components/type/templates/alias.d.ts +4 -0
  311. package/dist/types/components/type/templates/enum.d.ts +4 -0
  312. package/dist/types/components/type/templates/interface.d.ts +4 -0
  313. package/dist/types/components/type/type.d.ts +15 -0
  314. package/dist/types/components.d.ts +517 -0
  315. package/dist/types/index.d.ts +5 -0
  316. package/dist/types/kompendium/config.d.ts +2 -0
  317. package/dist/types/kompendium/filesystem.d.ts +1 -0
  318. package/dist/types/kompendium/generator.d.ts +4 -0
  319. package/dist/types/kompendium/guides.d.ts +9 -0
  320. package/dist/types/kompendium/index.d.ts +1 -0
  321. package/dist/types/kompendium/markdown-admonitions.d.ts +3 -0
  322. package/dist/types/kompendium/markdown-code.d.ts +2 -0
  323. package/dist/types/kompendium/markdown-frontmatter.d.ts +6 -0
  324. package/dist/types/kompendium/markdown-nodes.d.ts +12 -0
  325. package/dist/types/kompendium/markdown-typelinks.d.ts +21 -0
  326. package/dist/types/kompendium/markdown.d.ts +8 -0
  327. package/dist/types/kompendium/menu.d.ts +12 -0
  328. package/dist/types/kompendium/schema.d.ts +9 -0
  329. package/dist/types/kompendium/search.d.ts +3 -0
  330. package/dist/types/kompendium/source.d.ts +10 -0
  331. package/dist/types/kompendium/test/fixtures/basic.d.ts +65 -0
  332. package/dist/types/kompendium/test/fixtures/filtering/example-type.d.ts +8 -0
  333. package/dist/types/kompendium/test/fixtures/filtering/node-modules-type.d.ts +8 -0
  334. package/dist/types/kompendium/test/fixtures/filtering/private-types.d.ts +23 -0
  335. package/dist/types/kompendium/test/fixtures/filtering/stencil-component-types.d.ts +19 -0
  336. package/dist/types/kompendium/test/fixtures/filtering/test-helper-type.d.ts +8 -0
  337. package/dist/types/kompendium/test/fixtures/filtering/valid-types.d.ts +42 -0
  338. package/dist/types/kompendium/typedoc.d.ts +2 -0
  339. package/dist/types/kompendium/watch.d.ts +1 -0
  340. package/dist/types/stencil-public-runtime.d.ts +1746 -0
  341. package/dist/types/types.d.ts +119 -0
  342. package/dist/watch.ts +14 -0
  343. package/loader/cdn.js +1 -0
  344. package/loader/index.cjs.js +1 -0
  345. package/loader/index.d.ts +24 -0
  346. package/loader/index.es2017.js +1 -0
  347. package/loader/index.js +2 -0
  348. package/package.json +116 -0
@@ -0,0 +1,2916 @@
1
+ import { r as registerInstance, h, a as getElement } from './index-9UrzenzW.js';
2
+ import { s as setTypes } from './markdown-types-Ajsawr_9.js';
3
+ import { T as THEME_EVENT_NAME } from './types-BIPLEi1G.js';
4
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-BFTU3MAI.js';
5
+
6
+ /**
7
+ * Fuse.js v6.4.6 - Lightweight fuzzy-search (http://fusejs.io)
8
+ *
9
+ * Copyright (c) 2021 Kiro Risk (http://kiro.me)
10
+ * All Rights Reserved. Apache Software License 2.0
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ */
14
+
15
+ function isArray(value) {
16
+ return !Array.isArray
17
+ ? getTag(value) === '[object Array]'
18
+ : Array.isArray(value)
19
+ }
20
+ function baseToString(value) {
21
+ // Exit early for strings to avoid a performance hit in some environments.
22
+ if (typeof value == 'string') {
23
+ return value
24
+ }
25
+ let result = value + '';
26
+ return result == '0' && 1 / value == -Infinity ? '-0' : result
27
+ }
28
+
29
+ function toString(value) {
30
+ return value == null ? '' : baseToString(value)
31
+ }
32
+
33
+ function isString(value) {
34
+ return typeof value === 'string'
35
+ }
36
+
37
+ function isNumber(value) {
38
+ return typeof value === 'number'
39
+ }
40
+
41
+ // Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
42
+ function isBoolean(value) {
43
+ return (
44
+ value === true ||
45
+ value === false ||
46
+ (isObjectLike(value) && getTag(value) == '[object Boolean]')
47
+ )
48
+ }
49
+
50
+ function isObject(value) {
51
+ return typeof value === 'object'
52
+ }
53
+
54
+ // Checks if `value` is object-like.
55
+ function isObjectLike(value) {
56
+ return isObject(value) && value !== null
57
+ }
58
+
59
+ function isDefined(value) {
60
+ return value !== undefined && value !== null
61
+ }
62
+
63
+ function isBlank(value) {
64
+ return !value.trim().length
65
+ }
66
+
67
+ // Gets the `toStringTag` of `value`.
68
+ // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js
69
+ function getTag(value) {
70
+ return value == null
71
+ ? value === undefined
72
+ ? '[object Undefined]'
73
+ : '[object Null]'
74
+ : Object.prototype.toString.call(value)
75
+ }
76
+
77
+ const INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
78
+
79
+ const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) =>
80
+ `Invalid value for key ${key}`;
81
+
82
+ const PATTERN_LENGTH_TOO_LARGE = (max) =>
83
+ `Pattern length exceeds max of ${max}.`;
84
+
85
+ const MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;
86
+
87
+ const INVALID_KEY_WEIGHT_VALUE = (key) =>
88
+ `Property 'weight' in key '${key}' must be a positive integer`;
89
+
90
+ const hasOwn = Object.prototype.hasOwnProperty;
91
+
92
+ class KeyStore {
93
+ constructor(keys) {
94
+ this._keys = [];
95
+ this._keyMap = {};
96
+
97
+ let totalWeight = 0;
98
+
99
+ keys.forEach((key) => {
100
+ let obj = createKey(key);
101
+
102
+ totalWeight += obj.weight;
103
+
104
+ this._keys.push(obj);
105
+ this._keyMap[obj.id] = obj;
106
+
107
+ totalWeight += obj.weight;
108
+ });
109
+
110
+ // Normalize weights so that their sum is equal to 1
111
+ this._keys.forEach((key) => {
112
+ key.weight /= totalWeight;
113
+ });
114
+ }
115
+ get(keyId) {
116
+ return this._keyMap[keyId]
117
+ }
118
+ keys() {
119
+ return this._keys
120
+ }
121
+ toJSON() {
122
+ return JSON.stringify(this._keys)
123
+ }
124
+ }
125
+
126
+ function createKey(key) {
127
+ let path = null;
128
+ let id = null;
129
+ let src = null;
130
+ let weight = 1;
131
+
132
+ if (isString(key) || isArray(key)) {
133
+ src = key;
134
+ path = createKeyPath(key);
135
+ id = createKeyId(key);
136
+ } else {
137
+ if (!hasOwn.call(key, 'name')) {
138
+ throw new Error(MISSING_KEY_PROPERTY('name'))
139
+ }
140
+
141
+ const name = key.name;
142
+ src = name;
143
+
144
+ if (hasOwn.call(key, 'weight')) {
145
+ weight = key.weight;
146
+
147
+ if (weight <= 0) {
148
+ throw new Error(INVALID_KEY_WEIGHT_VALUE(name))
149
+ }
150
+ }
151
+
152
+ path = createKeyPath(name);
153
+ id = createKeyId(name);
154
+ }
155
+
156
+ return { path, id, weight, src }
157
+ }
158
+
159
+ function createKeyPath(key) {
160
+ return isArray(key) ? key : key.split('.')
161
+ }
162
+
163
+ function createKeyId(key) {
164
+ return isArray(key) ? key.join('.') : key
165
+ }
166
+
167
+ function get(obj, path) {
168
+ let list = [];
169
+ let arr = false;
170
+
171
+ const deepGet = (obj, path, index) => {
172
+ if (!isDefined(obj)) {
173
+ return
174
+ }
175
+ if (!path[index]) {
176
+ // If there's no path left, we've arrived at the object we care about.
177
+ list.push(obj);
178
+ } else {
179
+ let key = path[index];
180
+
181
+ const value = obj[key];
182
+
183
+ if (!isDefined(value)) {
184
+ return
185
+ }
186
+
187
+ // If we're at the last value in the path, and if it's a string/number/bool,
188
+ // add it to the list
189
+ if (
190
+ index === path.length - 1 &&
191
+ (isString(value) || isNumber(value) || isBoolean(value))
192
+ ) {
193
+ list.push(toString(value));
194
+ } else if (isArray(value)) {
195
+ arr = true;
196
+ // Search each item in the array.
197
+ for (let i = 0, len = value.length; i < len; i += 1) {
198
+ deepGet(value[i], path, index + 1);
199
+ }
200
+ } else if (path.length) {
201
+ // An object. Recurse further.
202
+ deepGet(value, path, index + 1);
203
+ }
204
+ }
205
+ };
206
+
207
+ // Backwards compatibility (since path used to be a string)
208
+ deepGet(obj, isString(path) ? path.split('.') : path, 0);
209
+
210
+ return arr ? list : list[0]
211
+ }
212
+
213
+ const MatchOptions = {
214
+ // Whether the matches should be included in the result set. When `true`, each record in the result
215
+ // set will include the indices of the matched characters.
216
+ // These can consequently be used for highlighting purposes.
217
+ includeMatches: false,
218
+ // When `true`, the matching function will continue to the end of a search pattern even if
219
+ // a perfect match has already been located in the string.
220
+ findAllMatches: false,
221
+ // Minimum number of characters that must be matched before a result is considered a match
222
+ minMatchCharLength: 1
223
+ };
224
+
225
+ const BasicOptions = {
226
+ // When `true`, the algorithm continues searching to the end of the input even if a perfect
227
+ // match is found before the end of the same input.
228
+ isCaseSensitive: false,
229
+ // When true, the matching function will continue to the end of a search pattern even if
230
+ includeScore: false,
231
+ // List of properties that will be searched. This also supports nested properties.
232
+ keys: [],
233
+ // Whether to sort the result list, by score
234
+ shouldSort: true,
235
+ // Default sort function: sort by ascending score, ascending index
236
+ sortFn: (a, b) =>
237
+ a.score === b.score ? (a.idx < b.idx ? -1 : 1) : a.score < b.score ? -1 : 1
238
+ };
239
+
240
+ const FuzzyOptions = {
241
+ // Approximately where in the text is the pattern expected to be found?
242
+ location: 0,
243
+ // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
244
+ // (of both letters and location), a threshold of '1.0' would match anything.
245
+ threshold: 0.6,
246
+ // Determines how close the match must be to the fuzzy location (specified above).
247
+ // An exact letter match which is 'distance' characters away from the fuzzy location
248
+ // would score as a complete mismatch. A distance of '0' requires the match be at
249
+ // the exact location specified, a threshold of '1000' would require a perfect match
250
+ // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
251
+ distance: 100
252
+ };
253
+
254
+ const AdvancedOptions = {
255
+ // When `true`, it enables the use of unix-like search commands
256
+ useExtendedSearch: false,
257
+ // The get function to use when fetching an object's properties.
258
+ // The default will search nested paths *ie foo.bar.baz*
259
+ getFn: get,
260
+ // When `true`, search will ignore `location` and `distance`, so it won't matter
261
+ // where in the string the pattern appears.
262
+ // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
263
+ ignoreLocation: false,
264
+ // When `true`, the calculation for the relevance score (used for sorting) will
265
+ // ignore the field-length norm.
266
+ // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
267
+ ignoreFieldNorm: false
268
+ };
269
+
270
+ var Config = {
271
+ ...BasicOptions,
272
+ ...MatchOptions,
273
+ ...FuzzyOptions,
274
+ ...AdvancedOptions
275
+ };
276
+
277
+ const SPACE = /[^ ]+/g;
278
+
279
+ // Field-length norm: the shorter the field, the higher the weight.
280
+ // Set to 3 decimals to reduce index size.
281
+ function norm(mantissa = 3) {
282
+ const cache = new Map();
283
+ const m = Math.pow(10, mantissa);
284
+
285
+ return {
286
+ get(value) {
287
+ const numTokens = value.match(SPACE).length;
288
+
289
+ if (cache.has(numTokens)) {
290
+ return cache.get(numTokens)
291
+ }
292
+
293
+ const norm = 1 / Math.sqrt(numTokens);
294
+
295
+ // In place of `toFixed(mantissa)`, for faster computation
296
+ const n = parseFloat(Math.round(norm * m) / m);
297
+
298
+ cache.set(numTokens, n);
299
+
300
+ return n
301
+ },
302
+ clear() {
303
+ cache.clear();
304
+ }
305
+ }
306
+ }
307
+
308
+ class FuseIndex {
309
+ constructor({ getFn = Config.getFn } = {}) {
310
+ this.norm = norm(3);
311
+ this.getFn = getFn;
312
+ this.isCreated = false;
313
+
314
+ this.setIndexRecords();
315
+ }
316
+ setSources(docs = []) {
317
+ this.docs = docs;
318
+ }
319
+ setIndexRecords(records = []) {
320
+ this.records = records;
321
+ }
322
+ setKeys(keys = []) {
323
+ this.keys = keys;
324
+ this._keysMap = {};
325
+ keys.forEach((key, idx) => {
326
+ this._keysMap[key.id] = idx;
327
+ });
328
+ }
329
+ create() {
330
+ if (this.isCreated || !this.docs.length) {
331
+ return
332
+ }
333
+
334
+ this.isCreated = true;
335
+
336
+ // List is Array<String>
337
+ if (isString(this.docs[0])) {
338
+ this.docs.forEach((doc, docIndex) => {
339
+ this._addString(doc, docIndex);
340
+ });
341
+ } else {
342
+ // List is Array<Object>
343
+ this.docs.forEach((doc, docIndex) => {
344
+ this._addObject(doc, docIndex);
345
+ });
346
+ }
347
+
348
+ this.norm.clear();
349
+ }
350
+ // Adds a doc to the end of the index
351
+ add(doc) {
352
+ const idx = this.size();
353
+
354
+ if (isString(doc)) {
355
+ this._addString(doc, idx);
356
+ } else {
357
+ this._addObject(doc, idx);
358
+ }
359
+ }
360
+ // Removes the doc at the specified index of the index
361
+ removeAt(idx) {
362
+ this.records.splice(idx, 1);
363
+
364
+ // Change ref index of every subsquent doc
365
+ for (let i = idx, len = this.size(); i < len; i += 1) {
366
+ this.records[i].i -= 1;
367
+ }
368
+ }
369
+ getValueForItemAtKeyId(item, keyId) {
370
+ return item[this._keysMap[keyId]]
371
+ }
372
+ size() {
373
+ return this.records.length
374
+ }
375
+ _addString(doc, docIndex) {
376
+ if (!isDefined(doc) || isBlank(doc)) {
377
+ return
378
+ }
379
+
380
+ let record = {
381
+ v: doc,
382
+ i: docIndex,
383
+ n: this.norm.get(doc)
384
+ };
385
+
386
+ this.records.push(record);
387
+ }
388
+ _addObject(doc, docIndex) {
389
+ let record = { i: docIndex, $: {} };
390
+
391
+ // Iterate over every key (i.e, path), and fetch the value at that key
392
+ this.keys.forEach((key, keyIndex) => {
393
+ // console.log(key)
394
+ let value = this.getFn(doc, key.path);
395
+
396
+ if (!isDefined(value)) {
397
+ return
398
+ }
399
+
400
+ if (isArray(value)) {
401
+ let subRecords = [];
402
+ const stack = [{ nestedArrIndex: -1, value }];
403
+
404
+ while (stack.length) {
405
+ const { nestedArrIndex, value } = stack.pop();
406
+
407
+ if (!isDefined(value)) {
408
+ continue
409
+ }
410
+
411
+ if (isString(value) && !isBlank(value)) {
412
+ let subRecord = {
413
+ v: value,
414
+ i: nestedArrIndex,
415
+ n: this.norm.get(value)
416
+ };
417
+
418
+ subRecords.push(subRecord);
419
+ } else if (isArray(value)) {
420
+ value.forEach((item, k) => {
421
+ stack.push({
422
+ nestedArrIndex: k,
423
+ value: item
424
+ });
425
+ });
426
+ }
427
+ }
428
+ record.$[keyIndex] = subRecords;
429
+ } else if (!isBlank(value)) {
430
+ let subRecord = {
431
+ v: value,
432
+ n: this.norm.get(value)
433
+ };
434
+
435
+ record.$[keyIndex] = subRecord;
436
+ }
437
+ });
438
+
439
+ this.records.push(record);
440
+ }
441
+ toJSON() {
442
+ return {
443
+ keys: this.keys,
444
+ records: this.records
445
+ }
446
+ }
447
+ }
448
+
449
+ function createIndex(keys, docs, { getFn = Config.getFn } = {}) {
450
+ const myIndex = new FuseIndex({ getFn });
451
+ myIndex.setKeys(keys.map(createKey));
452
+ myIndex.setSources(docs);
453
+ myIndex.create();
454
+ return myIndex
455
+ }
456
+
457
+ function parseIndex(data, { getFn = Config.getFn } = {}) {
458
+ const { keys, records } = data;
459
+ const myIndex = new FuseIndex({ getFn });
460
+ myIndex.setKeys(keys);
461
+ myIndex.setIndexRecords(records);
462
+ return myIndex
463
+ }
464
+
465
+ function computeScore(
466
+ pattern,
467
+ {
468
+ errors = 0,
469
+ currentLocation = 0,
470
+ expectedLocation = 0,
471
+ distance = Config.distance,
472
+ ignoreLocation = Config.ignoreLocation
473
+ } = {}
474
+ ) {
475
+ const accuracy = errors / pattern.length;
476
+
477
+ if (ignoreLocation) {
478
+ return accuracy
479
+ }
480
+
481
+ const proximity = Math.abs(expectedLocation - currentLocation);
482
+
483
+ if (!distance) {
484
+ // Dodge divide by zero error.
485
+ return proximity ? 1.0 : accuracy
486
+ }
487
+
488
+ return accuracy + proximity / distance
489
+ }
490
+
491
+ function convertMaskToIndices(
492
+ matchmask = [],
493
+ minMatchCharLength = Config.minMatchCharLength
494
+ ) {
495
+ let indices = [];
496
+ let start = -1;
497
+ let end = -1;
498
+ let i = 0;
499
+
500
+ for (let len = matchmask.length; i < len; i += 1) {
501
+ let match = matchmask[i];
502
+ if (match && start === -1) {
503
+ start = i;
504
+ } else if (!match && start !== -1) {
505
+ end = i - 1;
506
+ if (end - start + 1 >= minMatchCharLength) {
507
+ indices.push([start, end]);
508
+ }
509
+ start = -1;
510
+ }
511
+ }
512
+
513
+ // (i-1 - start) + 1 => i - start
514
+ if (matchmask[i - 1] && i - start >= minMatchCharLength) {
515
+ indices.push([start, i - 1]);
516
+ }
517
+
518
+ return indices
519
+ }
520
+
521
+ // Machine word size
522
+ const MAX_BITS = 32;
523
+
524
+ function search(
525
+ text,
526
+ pattern,
527
+ patternAlphabet,
528
+ {
529
+ location = Config.location,
530
+ distance = Config.distance,
531
+ threshold = Config.threshold,
532
+ findAllMatches = Config.findAllMatches,
533
+ minMatchCharLength = Config.minMatchCharLength,
534
+ includeMatches = Config.includeMatches,
535
+ ignoreLocation = Config.ignoreLocation
536
+ } = {}
537
+ ) {
538
+ if (pattern.length > MAX_BITS) {
539
+ throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS))
540
+ }
541
+
542
+ const patternLen = pattern.length;
543
+ // Set starting location at beginning text and initialize the alphabet.
544
+ const textLen = text.length;
545
+ // Handle the case when location > text.length
546
+ const expectedLocation = Math.max(0, Math.min(location, textLen));
547
+ // Highest score beyond which we give up.
548
+ let currentThreshold = threshold;
549
+ // Is there a nearby exact match? (speedup)
550
+ let bestLocation = expectedLocation;
551
+
552
+ // Performance: only computer matches when the minMatchCharLength > 1
553
+ // OR if `includeMatches` is true.
554
+ const computeMatches = minMatchCharLength > 1 || includeMatches;
555
+ // A mask of the matches, used for building the indices
556
+ const matchMask = computeMatches ? Array(textLen) : [];
557
+
558
+ let index;
559
+
560
+ // Get all exact matches, here for speed up
561
+ while ((index = text.indexOf(pattern, bestLocation)) > -1) {
562
+ let score = computeScore(pattern, {
563
+ currentLocation: index,
564
+ expectedLocation,
565
+ distance,
566
+ ignoreLocation
567
+ });
568
+
569
+ currentThreshold = Math.min(score, currentThreshold);
570
+ bestLocation = index + patternLen;
571
+
572
+ if (computeMatches) {
573
+ let i = 0;
574
+ while (i < patternLen) {
575
+ matchMask[index + i] = 1;
576
+ i += 1;
577
+ }
578
+ }
579
+ }
580
+
581
+ // Reset the best location
582
+ bestLocation = -1;
583
+
584
+ let lastBitArr = [];
585
+ let finalScore = 1;
586
+ let binMax = patternLen + textLen;
587
+
588
+ const mask = 1 << (patternLen - 1);
589
+
590
+ for (let i = 0; i < patternLen; i += 1) {
591
+ // Scan for the best match; each iteration allows for one more error.
592
+ // Run a binary search to determine how far from the match location we can stray
593
+ // at this error level.
594
+ let binMin = 0;
595
+ let binMid = binMax;
596
+
597
+ while (binMin < binMid) {
598
+ const score = computeScore(pattern, {
599
+ errors: i,
600
+ currentLocation: expectedLocation + binMid,
601
+ expectedLocation,
602
+ distance,
603
+ ignoreLocation
604
+ });
605
+
606
+ if (score <= currentThreshold) {
607
+ binMin = binMid;
608
+ } else {
609
+ binMax = binMid;
610
+ }
611
+
612
+ binMid = Math.floor((binMax - binMin) / 2 + binMin);
613
+ }
614
+
615
+ // Use the result from this iteration as the maximum for the next.
616
+ binMax = binMid;
617
+
618
+ let start = Math.max(1, expectedLocation - binMid + 1);
619
+ let finish = findAllMatches
620
+ ? textLen
621
+ : Math.min(expectedLocation + binMid, textLen) + patternLen;
622
+
623
+ // Initialize the bit array
624
+ let bitArr = Array(finish + 2);
625
+
626
+ bitArr[finish + 1] = (1 << i) - 1;
627
+
628
+ for (let j = finish; j >= start; j -= 1) {
629
+ let currentLocation = j - 1;
630
+ let charMatch = patternAlphabet[text.charAt(currentLocation)];
631
+
632
+ if (computeMatches) {
633
+ // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)
634
+ matchMask[currentLocation] = +!!charMatch;
635
+ }
636
+
637
+ // First pass: exact match
638
+ bitArr[j] = ((bitArr[j + 1] << 1) | 1) & charMatch;
639
+
640
+ // Subsequent passes: fuzzy match
641
+ if (i) {
642
+ bitArr[j] |=
643
+ ((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1 | lastBitArr[j + 1];
644
+ }
645
+
646
+ if (bitArr[j] & mask) {
647
+ finalScore = computeScore(pattern, {
648
+ errors: i,
649
+ currentLocation,
650
+ expectedLocation,
651
+ distance,
652
+ ignoreLocation
653
+ });
654
+
655
+ // This match will almost certainly be better than any existing match.
656
+ // But check anyway.
657
+ if (finalScore <= currentThreshold) {
658
+ // Indeed it is
659
+ currentThreshold = finalScore;
660
+ bestLocation = currentLocation;
661
+
662
+ // Already passed `loc`, downhill from here on in.
663
+ if (bestLocation <= expectedLocation) {
664
+ break
665
+ }
666
+
667
+ // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.
668
+ start = Math.max(1, 2 * expectedLocation - bestLocation);
669
+ }
670
+ }
671
+ }
672
+
673
+ // No hope for a (better) match at greater error levels.
674
+ const score = computeScore(pattern, {
675
+ errors: i + 1,
676
+ currentLocation: expectedLocation,
677
+ expectedLocation,
678
+ distance,
679
+ ignoreLocation
680
+ });
681
+
682
+ if (score > currentThreshold) {
683
+ break
684
+ }
685
+
686
+ lastBitArr = bitArr;
687
+ }
688
+
689
+ const result = {
690
+ isMatch: bestLocation >= 0,
691
+ // Count exact matches (those with a score of 0) to be "almost" exact
692
+ score: Math.max(0.001, finalScore)
693
+ };
694
+
695
+ if (computeMatches) {
696
+ const indices = convertMaskToIndices(matchMask, minMatchCharLength);
697
+ if (!indices.length) {
698
+ result.isMatch = false;
699
+ } else if (includeMatches) {
700
+ result.indices = indices;
701
+ }
702
+ }
703
+
704
+ return result
705
+ }
706
+
707
+ function createPatternAlphabet(pattern) {
708
+ let mask = {};
709
+
710
+ for (let i = 0, len = pattern.length; i < len; i += 1) {
711
+ const char = pattern.charAt(i);
712
+ mask[char] = (mask[char] || 0) | (1 << (len - i - 1));
713
+ }
714
+
715
+ return mask
716
+ }
717
+
718
+ class BitapSearch {
719
+ constructor(
720
+ pattern,
721
+ {
722
+ location = Config.location,
723
+ threshold = Config.threshold,
724
+ distance = Config.distance,
725
+ includeMatches = Config.includeMatches,
726
+ findAllMatches = Config.findAllMatches,
727
+ minMatchCharLength = Config.minMatchCharLength,
728
+ isCaseSensitive = Config.isCaseSensitive,
729
+ ignoreLocation = Config.ignoreLocation
730
+ } = {}
731
+ ) {
732
+ this.options = {
733
+ location,
734
+ threshold,
735
+ distance,
736
+ includeMatches,
737
+ findAllMatches,
738
+ minMatchCharLength,
739
+ isCaseSensitive,
740
+ ignoreLocation
741
+ };
742
+
743
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
744
+
745
+ this.chunks = [];
746
+
747
+ if (!this.pattern.length) {
748
+ return
749
+ }
750
+
751
+ const addChunk = (pattern, startIndex) => {
752
+ this.chunks.push({
753
+ pattern,
754
+ alphabet: createPatternAlphabet(pattern),
755
+ startIndex
756
+ });
757
+ };
758
+
759
+ const len = this.pattern.length;
760
+
761
+ if (len > MAX_BITS) {
762
+ let i = 0;
763
+ const remainder = len % MAX_BITS;
764
+ const end = len - remainder;
765
+
766
+ while (i < end) {
767
+ addChunk(this.pattern.substr(i, MAX_BITS), i);
768
+ i += MAX_BITS;
769
+ }
770
+
771
+ if (remainder) {
772
+ const startIndex = len - MAX_BITS;
773
+ addChunk(this.pattern.substr(startIndex), startIndex);
774
+ }
775
+ } else {
776
+ addChunk(this.pattern, 0);
777
+ }
778
+ }
779
+
780
+ searchIn(text) {
781
+ const { isCaseSensitive, includeMatches } = this.options;
782
+
783
+ if (!isCaseSensitive) {
784
+ text = text.toLowerCase();
785
+ }
786
+
787
+ // Exact match
788
+ if (this.pattern === text) {
789
+ let result = {
790
+ isMatch: true,
791
+ score: 0
792
+ };
793
+
794
+ if (includeMatches) {
795
+ result.indices = [[0, text.length - 1]];
796
+ }
797
+
798
+ return result
799
+ }
800
+
801
+ // Otherwise, use Bitap algorithm
802
+ const {
803
+ location,
804
+ distance,
805
+ threshold,
806
+ findAllMatches,
807
+ minMatchCharLength,
808
+ ignoreLocation
809
+ } = this.options;
810
+
811
+ let allIndices = [];
812
+ let totalScore = 0;
813
+ let hasMatches = false;
814
+
815
+ this.chunks.forEach(({ pattern, alphabet, startIndex }) => {
816
+ const { isMatch, score, indices } = search(text, pattern, alphabet, {
817
+ location: location + startIndex,
818
+ distance,
819
+ threshold,
820
+ findAllMatches,
821
+ minMatchCharLength,
822
+ includeMatches,
823
+ ignoreLocation
824
+ });
825
+
826
+ if (isMatch) {
827
+ hasMatches = true;
828
+ }
829
+
830
+ totalScore += score;
831
+
832
+ if (isMatch && indices) {
833
+ allIndices = [...allIndices, ...indices];
834
+ }
835
+ });
836
+
837
+ let result = {
838
+ isMatch: hasMatches,
839
+ score: hasMatches ? totalScore / this.chunks.length : 1
840
+ };
841
+
842
+ if (hasMatches && includeMatches) {
843
+ result.indices = allIndices;
844
+ }
845
+
846
+ return result
847
+ }
848
+ }
849
+
850
+ class BaseMatch {
851
+ constructor(pattern) {
852
+ this.pattern = pattern;
853
+ }
854
+ static isMultiMatch(pattern) {
855
+ return getMatch(pattern, this.multiRegex)
856
+ }
857
+ static isSingleMatch(pattern) {
858
+ return getMatch(pattern, this.singleRegex)
859
+ }
860
+ search(/*text*/) {}
861
+ }
862
+
863
+ function getMatch(pattern, exp) {
864
+ const matches = pattern.match(exp);
865
+ return matches ? matches[1] : null
866
+ }
867
+
868
+ // Token: 'file
869
+
870
+ class ExactMatch extends BaseMatch {
871
+ constructor(pattern) {
872
+ super(pattern);
873
+ }
874
+ static get type() {
875
+ return 'exact'
876
+ }
877
+ static get multiRegex() {
878
+ return /^="(.*)"$/
879
+ }
880
+ static get singleRegex() {
881
+ return /^=(.*)$/
882
+ }
883
+ search(text) {
884
+ const isMatch = text === this.pattern;
885
+
886
+ return {
887
+ isMatch,
888
+ score: isMatch ? 0 : 1,
889
+ indices: [0, this.pattern.length - 1]
890
+ }
891
+ }
892
+ }
893
+
894
+ // Token: !fire
895
+
896
+ class InverseExactMatch extends BaseMatch {
897
+ constructor(pattern) {
898
+ super(pattern);
899
+ }
900
+ static get type() {
901
+ return 'inverse-exact'
902
+ }
903
+ static get multiRegex() {
904
+ return /^!"(.*)"$/
905
+ }
906
+ static get singleRegex() {
907
+ return /^!(.*)$/
908
+ }
909
+ search(text) {
910
+ const index = text.indexOf(this.pattern);
911
+ const isMatch = index === -1;
912
+
913
+ return {
914
+ isMatch,
915
+ score: isMatch ? 0 : 1,
916
+ indices: [0, text.length - 1]
917
+ }
918
+ }
919
+ }
920
+
921
+ // Token: ^file
922
+
923
+ class PrefixExactMatch extends BaseMatch {
924
+ constructor(pattern) {
925
+ super(pattern);
926
+ }
927
+ static get type() {
928
+ return 'prefix-exact'
929
+ }
930
+ static get multiRegex() {
931
+ return /^\^"(.*)"$/
932
+ }
933
+ static get singleRegex() {
934
+ return /^\^(.*)$/
935
+ }
936
+ search(text) {
937
+ const isMatch = text.startsWith(this.pattern);
938
+
939
+ return {
940
+ isMatch,
941
+ score: isMatch ? 0 : 1,
942
+ indices: [0, this.pattern.length - 1]
943
+ }
944
+ }
945
+ }
946
+
947
+ // Token: !^fire
948
+
949
+ class InversePrefixExactMatch extends BaseMatch {
950
+ constructor(pattern) {
951
+ super(pattern);
952
+ }
953
+ static get type() {
954
+ return 'inverse-prefix-exact'
955
+ }
956
+ static get multiRegex() {
957
+ return /^!\^"(.*)"$/
958
+ }
959
+ static get singleRegex() {
960
+ return /^!\^(.*)$/
961
+ }
962
+ search(text) {
963
+ const isMatch = !text.startsWith(this.pattern);
964
+
965
+ return {
966
+ isMatch,
967
+ score: isMatch ? 0 : 1,
968
+ indices: [0, text.length - 1]
969
+ }
970
+ }
971
+ }
972
+
973
+ // Token: .file$
974
+
975
+ class SuffixExactMatch extends BaseMatch {
976
+ constructor(pattern) {
977
+ super(pattern);
978
+ }
979
+ static get type() {
980
+ return 'suffix-exact'
981
+ }
982
+ static get multiRegex() {
983
+ return /^"(.*)"\$$/
984
+ }
985
+ static get singleRegex() {
986
+ return /^(.*)\$$/
987
+ }
988
+ search(text) {
989
+ const isMatch = text.endsWith(this.pattern);
990
+
991
+ return {
992
+ isMatch,
993
+ score: isMatch ? 0 : 1,
994
+ indices: [text.length - this.pattern.length, text.length - 1]
995
+ }
996
+ }
997
+ }
998
+
999
+ // Token: !.file$
1000
+
1001
+ class InverseSuffixExactMatch extends BaseMatch {
1002
+ constructor(pattern) {
1003
+ super(pattern);
1004
+ }
1005
+ static get type() {
1006
+ return 'inverse-suffix-exact'
1007
+ }
1008
+ static get multiRegex() {
1009
+ return /^!"(.*)"\$$/
1010
+ }
1011
+ static get singleRegex() {
1012
+ return /^!(.*)\$$/
1013
+ }
1014
+ search(text) {
1015
+ const isMatch = !text.endsWith(this.pattern);
1016
+ return {
1017
+ isMatch,
1018
+ score: isMatch ? 0 : 1,
1019
+ indices: [0, text.length - 1]
1020
+ }
1021
+ }
1022
+ }
1023
+
1024
+ class FuzzyMatch extends BaseMatch {
1025
+ constructor(
1026
+ pattern,
1027
+ {
1028
+ location = Config.location,
1029
+ threshold = Config.threshold,
1030
+ distance = Config.distance,
1031
+ includeMatches = Config.includeMatches,
1032
+ findAllMatches = Config.findAllMatches,
1033
+ minMatchCharLength = Config.minMatchCharLength,
1034
+ isCaseSensitive = Config.isCaseSensitive,
1035
+ ignoreLocation = Config.ignoreLocation
1036
+ } = {}
1037
+ ) {
1038
+ super(pattern);
1039
+ this._bitapSearch = new BitapSearch(pattern, {
1040
+ location,
1041
+ threshold,
1042
+ distance,
1043
+ includeMatches,
1044
+ findAllMatches,
1045
+ minMatchCharLength,
1046
+ isCaseSensitive,
1047
+ ignoreLocation
1048
+ });
1049
+ }
1050
+ static get type() {
1051
+ return 'fuzzy'
1052
+ }
1053
+ static get multiRegex() {
1054
+ return /^"(.*)"$/
1055
+ }
1056
+ static get singleRegex() {
1057
+ return /^(.*)$/
1058
+ }
1059
+ search(text) {
1060
+ return this._bitapSearch.searchIn(text)
1061
+ }
1062
+ }
1063
+
1064
+ // Token: 'file
1065
+
1066
+ class IncludeMatch extends BaseMatch {
1067
+ constructor(pattern) {
1068
+ super(pattern);
1069
+ }
1070
+ static get type() {
1071
+ return 'include'
1072
+ }
1073
+ static get multiRegex() {
1074
+ return /^'"(.*)"$/
1075
+ }
1076
+ static get singleRegex() {
1077
+ return /^'(.*)$/
1078
+ }
1079
+ search(text) {
1080
+ let location = 0;
1081
+ let index;
1082
+
1083
+ const indices = [];
1084
+ const patternLen = this.pattern.length;
1085
+
1086
+ // Get all exact matches
1087
+ while ((index = text.indexOf(this.pattern, location)) > -1) {
1088
+ location = index + patternLen;
1089
+ indices.push([index, location - 1]);
1090
+ }
1091
+
1092
+ const isMatch = !!indices.length;
1093
+
1094
+ return {
1095
+ isMatch,
1096
+ score: isMatch ? 0 : 1,
1097
+ indices
1098
+ }
1099
+ }
1100
+ }
1101
+
1102
+ // ❗Order is important. DO NOT CHANGE.
1103
+ const searchers = [
1104
+ ExactMatch,
1105
+ IncludeMatch,
1106
+ PrefixExactMatch,
1107
+ InversePrefixExactMatch,
1108
+ InverseSuffixExactMatch,
1109
+ SuffixExactMatch,
1110
+ InverseExactMatch,
1111
+ FuzzyMatch
1112
+ ];
1113
+
1114
+ const searchersLen = searchers.length;
1115
+
1116
+ // Regex to split by spaces, but keep anything in quotes together
1117
+ const SPACE_RE = / +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;
1118
+ const OR_TOKEN = '|';
1119
+
1120
+ // Return a 2D array representation of the query, for simpler parsing.
1121
+ // Example:
1122
+ // "^core go$ | rb$ | py$ xy$" => [["^core", "go$"], ["rb$"], ["py$", "xy$"]]
1123
+ function parseQuery(pattern, options = {}) {
1124
+ return pattern.split(OR_TOKEN).map((item) => {
1125
+ let query = item
1126
+ .trim()
1127
+ .split(SPACE_RE)
1128
+ .filter((item) => item && !!item.trim());
1129
+
1130
+ let results = [];
1131
+ for (let i = 0, len = query.length; i < len; i += 1) {
1132
+ const queryItem = query[i];
1133
+
1134
+ // 1. Handle multiple query match (i.e, once that are quoted, like `"hello world"`)
1135
+ let found = false;
1136
+ let idx = -1;
1137
+ while (!found && ++idx < searchersLen) {
1138
+ const searcher = searchers[idx];
1139
+ let token = searcher.isMultiMatch(queryItem);
1140
+ if (token) {
1141
+ results.push(new searcher(token, options));
1142
+ found = true;
1143
+ }
1144
+ }
1145
+
1146
+ if (found) {
1147
+ continue
1148
+ }
1149
+
1150
+ // 2. Handle single query matches (i.e, once that are *not* quoted)
1151
+ idx = -1;
1152
+ while (++idx < searchersLen) {
1153
+ const searcher = searchers[idx];
1154
+ let token = searcher.isSingleMatch(queryItem);
1155
+ if (token) {
1156
+ results.push(new searcher(token, options));
1157
+ break
1158
+ }
1159
+ }
1160
+ }
1161
+
1162
+ return results
1163
+ })
1164
+ }
1165
+
1166
+ // These extended matchers can return an array of matches, as opposed
1167
+ // to a singl match
1168
+ const MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);
1169
+
1170
+ /**
1171
+ * Command-like searching
1172
+ * ======================
1173
+ *
1174
+ * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,
1175
+ * search in a given text.
1176
+ *
1177
+ * Search syntax:
1178
+ *
1179
+ * | Token | Match type | Description |
1180
+ * | ----------- | -------------------------- | -------------------------------------- |
1181
+ * | `jscript` | fuzzy-match | Items that fuzzy match `jscript` |
1182
+ * | `=scheme` | exact-match | Items that are `scheme` |
1183
+ * | `'python` | include-match | Items that include `python` |
1184
+ * | `!ruby` | inverse-exact-match | Items that do not include `ruby` |
1185
+ * | `^java` | prefix-exact-match | Items that start with `java` |
1186
+ * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |
1187
+ * | `.js$` | suffix-exact-match | Items that end with `.js` |
1188
+ * | `!.go$` | inverse-suffix-exact-match | Items that do not end with `.go` |
1189
+ *
1190
+ * A single pipe character acts as an OR operator. For example, the following
1191
+ * query matches entries that start with `core` and end with either`go`, `rb`,
1192
+ * or`py`.
1193
+ *
1194
+ * ```
1195
+ * ^core go$ | rb$ | py$
1196
+ * ```
1197
+ */
1198
+ class ExtendedSearch {
1199
+ constructor(
1200
+ pattern,
1201
+ {
1202
+ isCaseSensitive = Config.isCaseSensitive,
1203
+ includeMatches = Config.includeMatches,
1204
+ minMatchCharLength = Config.minMatchCharLength,
1205
+ ignoreLocation = Config.ignoreLocation,
1206
+ findAllMatches = Config.findAllMatches,
1207
+ location = Config.location,
1208
+ threshold = Config.threshold,
1209
+ distance = Config.distance
1210
+ } = {}
1211
+ ) {
1212
+ this.query = null;
1213
+ this.options = {
1214
+ isCaseSensitive,
1215
+ includeMatches,
1216
+ minMatchCharLength,
1217
+ findAllMatches,
1218
+ ignoreLocation,
1219
+ location,
1220
+ threshold,
1221
+ distance
1222
+ };
1223
+
1224
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
1225
+ this.query = parseQuery(this.pattern, this.options);
1226
+ }
1227
+
1228
+ static condition(_, options) {
1229
+ return options.useExtendedSearch
1230
+ }
1231
+
1232
+ searchIn(text) {
1233
+ const query = this.query;
1234
+
1235
+ if (!query) {
1236
+ return {
1237
+ isMatch: false,
1238
+ score: 1
1239
+ }
1240
+ }
1241
+
1242
+ const { includeMatches, isCaseSensitive } = this.options;
1243
+
1244
+ text = isCaseSensitive ? text : text.toLowerCase();
1245
+
1246
+ let numMatches = 0;
1247
+ let allIndices = [];
1248
+ let totalScore = 0;
1249
+
1250
+ // ORs
1251
+ for (let i = 0, qLen = query.length; i < qLen; i += 1) {
1252
+ const searchers = query[i];
1253
+
1254
+ // Reset indices
1255
+ allIndices.length = 0;
1256
+ numMatches = 0;
1257
+
1258
+ // ANDs
1259
+ for (let j = 0, pLen = searchers.length; j < pLen; j += 1) {
1260
+ const searcher = searchers[j];
1261
+ const { isMatch, indices, score } = searcher.search(text);
1262
+
1263
+ if (isMatch) {
1264
+ numMatches += 1;
1265
+ totalScore += score;
1266
+ if (includeMatches) {
1267
+ const type = searcher.constructor.type;
1268
+ if (MultiMatchSet.has(type)) {
1269
+ allIndices = [...allIndices, ...indices];
1270
+ } else {
1271
+ allIndices.push(indices);
1272
+ }
1273
+ }
1274
+ } else {
1275
+ totalScore = 0;
1276
+ numMatches = 0;
1277
+ allIndices.length = 0;
1278
+ break
1279
+ }
1280
+ }
1281
+
1282
+ // OR condition, so if TRUE, return
1283
+ if (numMatches) {
1284
+ let result = {
1285
+ isMatch: true,
1286
+ score: totalScore / numMatches
1287
+ };
1288
+
1289
+ if (includeMatches) {
1290
+ result.indices = allIndices;
1291
+ }
1292
+
1293
+ return result
1294
+ }
1295
+ }
1296
+
1297
+ // Nothing was matched
1298
+ return {
1299
+ isMatch: false,
1300
+ score: 1
1301
+ }
1302
+ }
1303
+ }
1304
+
1305
+ const registeredSearchers = [];
1306
+
1307
+ function register(...args) {
1308
+ registeredSearchers.push(...args);
1309
+ }
1310
+
1311
+ function createSearcher(pattern, options) {
1312
+ for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {
1313
+ let searcherClass = registeredSearchers[i];
1314
+ if (searcherClass.condition(pattern, options)) {
1315
+ return new searcherClass(pattern, options)
1316
+ }
1317
+ }
1318
+
1319
+ return new BitapSearch(pattern, options)
1320
+ }
1321
+
1322
+ const LogicalOperator = {
1323
+ AND: '$and',
1324
+ OR: '$or'
1325
+ };
1326
+
1327
+ const KeyType = {
1328
+ PATH: '$path',
1329
+ PATTERN: '$val'
1330
+ };
1331
+
1332
+ const isExpression = (query) =>
1333
+ !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
1334
+
1335
+ const isPath = (query) => !!query[KeyType.PATH];
1336
+
1337
+ const isLeaf = (query) =>
1338
+ !isArray(query) && isObject(query) && !isExpression(query);
1339
+
1340
+ const convertToExplicit = (query) => ({
1341
+ [LogicalOperator.AND]: Object.keys(query).map((key) => ({
1342
+ [key]: query[key]
1343
+ }))
1344
+ });
1345
+
1346
+ // When `auto` is `true`, the parse function will infer and initialize and add
1347
+ // the appropriate `Searcher` instance
1348
+ function parse(query, options, { auto = true } = {}) {
1349
+ const next = (query) => {
1350
+ let keys = Object.keys(query);
1351
+
1352
+ const isQueryPath = isPath(query);
1353
+
1354
+ if (!isQueryPath && keys.length > 1 && !isExpression(query)) {
1355
+ return next(convertToExplicit(query))
1356
+ }
1357
+
1358
+ if (isLeaf(query)) {
1359
+ const key = isQueryPath ? query[KeyType.PATH] : keys[0];
1360
+
1361
+ const pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];
1362
+
1363
+ if (!isString(pattern)) {
1364
+ throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key))
1365
+ }
1366
+
1367
+ const obj = {
1368
+ keyId: createKeyId(key),
1369
+ pattern
1370
+ };
1371
+
1372
+ if (auto) {
1373
+ obj.searcher = createSearcher(pattern, options);
1374
+ }
1375
+
1376
+ return obj
1377
+ }
1378
+
1379
+ let node = {
1380
+ children: [],
1381
+ operator: keys[0]
1382
+ };
1383
+
1384
+ keys.forEach((key) => {
1385
+ const value = query[key];
1386
+
1387
+ if (isArray(value)) {
1388
+ value.forEach((item) => {
1389
+ node.children.push(next(item));
1390
+ });
1391
+ }
1392
+ });
1393
+
1394
+ return node
1395
+ };
1396
+
1397
+ if (!isExpression(query)) {
1398
+ query = convertToExplicit(query);
1399
+ }
1400
+
1401
+ return next(query)
1402
+ }
1403
+
1404
+ // Practical scoring function
1405
+ function computeScore$1(
1406
+ results,
1407
+ { ignoreFieldNorm = Config.ignoreFieldNorm }
1408
+ ) {
1409
+ results.forEach((result) => {
1410
+ let totalScore = 1;
1411
+
1412
+ result.matches.forEach(({ key, norm, score }) => {
1413
+ const weight = key ? key.weight : null;
1414
+
1415
+ totalScore *= Math.pow(
1416
+ score === 0 && weight ? Number.EPSILON : score,
1417
+ (weight || 1) * (ignoreFieldNorm ? 1 : norm)
1418
+ );
1419
+ });
1420
+
1421
+ result.score = totalScore;
1422
+ });
1423
+ }
1424
+
1425
+ function transformMatches(result, data) {
1426
+ const matches = result.matches;
1427
+ data.matches = [];
1428
+
1429
+ if (!isDefined(matches)) {
1430
+ return
1431
+ }
1432
+
1433
+ matches.forEach((match) => {
1434
+ if (!isDefined(match.indices) || !match.indices.length) {
1435
+ return
1436
+ }
1437
+
1438
+ const { indices, value } = match;
1439
+
1440
+ let obj = {
1441
+ indices,
1442
+ value
1443
+ };
1444
+
1445
+ if (match.key) {
1446
+ obj.key = match.key.src;
1447
+ }
1448
+
1449
+ if (match.idx > -1) {
1450
+ obj.refIndex = match.idx;
1451
+ }
1452
+
1453
+ data.matches.push(obj);
1454
+ });
1455
+ }
1456
+
1457
+ function transformScore(result, data) {
1458
+ data.score = result.score;
1459
+ }
1460
+
1461
+ function format(
1462
+ results,
1463
+ docs,
1464
+ {
1465
+ includeMatches = Config.includeMatches,
1466
+ includeScore = Config.includeScore
1467
+ } = {}
1468
+ ) {
1469
+ const transformers = [];
1470
+
1471
+ if (includeMatches) transformers.push(transformMatches);
1472
+ if (includeScore) transformers.push(transformScore);
1473
+
1474
+ return results.map((result) => {
1475
+ const { idx } = result;
1476
+
1477
+ const data = {
1478
+ item: docs[idx],
1479
+ refIndex: idx
1480
+ };
1481
+
1482
+ if (transformers.length) {
1483
+ transformers.forEach((transformer) => {
1484
+ transformer(result, data);
1485
+ });
1486
+ }
1487
+
1488
+ return data
1489
+ })
1490
+ }
1491
+
1492
+ class Fuse {
1493
+ constructor(docs, options = {}, index) {
1494
+ this.options = { ...Config, ...options };
1495
+
1496
+ this._keyStore = new KeyStore(this.options.keys);
1497
+
1498
+ this.setCollection(docs, index);
1499
+ }
1500
+
1501
+ setCollection(docs, index) {
1502
+ this._docs = docs;
1503
+
1504
+ if (index && !(index instanceof FuseIndex)) {
1505
+ throw new Error(INCORRECT_INDEX_TYPE)
1506
+ }
1507
+
1508
+ this._myIndex =
1509
+ index ||
1510
+ createIndex(this.options.keys, this._docs, {
1511
+ getFn: this.options.getFn
1512
+ });
1513
+ }
1514
+
1515
+ add(doc) {
1516
+ if (!isDefined(doc)) {
1517
+ return
1518
+ }
1519
+
1520
+ this._docs.push(doc);
1521
+ this._myIndex.add(doc);
1522
+ }
1523
+
1524
+ remove(predicate = (/* doc, idx */) => false) {
1525
+ const results = [];
1526
+
1527
+ for (let i = 0, len = this._docs.length; i < len; i += 1) {
1528
+ const doc = this._docs[i];
1529
+ if (predicate(doc, i)) {
1530
+ this.removeAt(i);
1531
+ i -= 1;
1532
+ len -= 1;
1533
+
1534
+ results.push(doc);
1535
+ }
1536
+ }
1537
+
1538
+ return results
1539
+ }
1540
+
1541
+ removeAt(idx) {
1542
+ this._docs.splice(idx, 1);
1543
+ this._myIndex.removeAt(idx);
1544
+ }
1545
+
1546
+ getIndex() {
1547
+ return this._myIndex
1548
+ }
1549
+
1550
+ search(query, { limit = -1 } = {}) {
1551
+ const {
1552
+ includeMatches,
1553
+ includeScore,
1554
+ shouldSort,
1555
+ sortFn,
1556
+ ignoreFieldNorm
1557
+ } = this.options;
1558
+
1559
+ let results = isString(query)
1560
+ ? isString(this._docs[0])
1561
+ ? this._searchStringList(query)
1562
+ : this._searchObjectList(query)
1563
+ : this._searchLogical(query);
1564
+
1565
+ computeScore$1(results, { ignoreFieldNorm });
1566
+
1567
+ if (shouldSort) {
1568
+ results.sort(sortFn);
1569
+ }
1570
+
1571
+ if (isNumber(limit) && limit > -1) {
1572
+ results = results.slice(0, limit);
1573
+ }
1574
+
1575
+ return format(results, this._docs, {
1576
+ includeMatches,
1577
+ includeScore
1578
+ })
1579
+ }
1580
+
1581
+ _searchStringList(query) {
1582
+ const searcher = createSearcher(query, this.options);
1583
+ const { records } = this._myIndex;
1584
+ const results = [];
1585
+
1586
+ // Iterate over every string in the index
1587
+ records.forEach(({ v: text, i: idx, n: norm }) => {
1588
+ if (!isDefined(text)) {
1589
+ return
1590
+ }
1591
+
1592
+ const { isMatch, score, indices } = searcher.searchIn(text);
1593
+
1594
+ if (isMatch) {
1595
+ results.push({
1596
+ item: text,
1597
+ idx,
1598
+ matches: [{ score, value: text, norm, indices }]
1599
+ });
1600
+ }
1601
+ });
1602
+
1603
+ return results
1604
+ }
1605
+
1606
+ _searchLogical(query) {
1607
+
1608
+ const expression = parse(query, this.options);
1609
+
1610
+ const evaluate = (node, item, idx) => {
1611
+ if (!node.children) {
1612
+ const { keyId, searcher } = node;
1613
+
1614
+ const matches = this._findMatches({
1615
+ key: this._keyStore.get(keyId),
1616
+ value: this._myIndex.getValueForItemAtKeyId(item, keyId),
1617
+ searcher
1618
+ });
1619
+
1620
+ if (matches && matches.length) {
1621
+ return [
1622
+ {
1623
+ idx,
1624
+ item,
1625
+ matches
1626
+ }
1627
+ ]
1628
+ }
1629
+
1630
+ return []
1631
+ }
1632
+
1633
+ /*eslint indent: [2, 2, {"SwitchCase": 1}]*/
1634
+ switch (node.operator) {
1635
+ case LogicalOperator.AND: {
1636
+ const res = [];
1637
+ for (let i = 0, len = node.children.length; i < len; i += 1) {
1638
+ const child = node.children[i];
1639
+ const result = evaluate(child, item, idx);
1640
+ if (result.length) {
1641
+ res.push(...result);
1642
+ } else {
1643
+ return []
1644
+ }
1645
+ }
1646
+ return res
1647
+ }
1648
+ case LogicalOperator.OR: {
1649
+ const res = [];
1650
+ for (let i = 0, len = node.children.length; i < len; i += 1) {
1651
+ const child = node.children[i];
1652
+ const result = evaluate(child, item, idx);
1653
+ if (result.length) {
1654
+ res.push(...result);
1655
+ break
1656
+ }
1657
+ }
1658
+ return res
1659
+ }
1660
+ }
1661
+ };
1662
+
1663
+ const records = this._myIndex.records;
1664
+ const resultMap = {};
1665
+ const results = [];
1666
+
1667
+ records.forEach(({ $: item, i: idx }) => {
1668
+ if (isDefined(item)) {
1669
+ let expResults = evaluate(expression, item, idx);
1670
+
1671
+ if (expResults.length) {
1672
+ // Dedupe when adding
1673
+ if (!resultMap[idx]) {
1674
+ resultMap[idx] = { idx, item, matches: [] };
1675
+ results.push(resultMap[idx]);
1676
+ }
1677
+ expResults.forEach(({ matches }) => {
1678
+ resultMap[idx].matches.push(...matches);
1679
+ });
1680
+ }
1681
+ }
1682
+ });
1683
+
1684
+ return results
1685
+ }
1686
+
1687
+ _searchObjectList(query) {
1688
+ const searcher = createSearcher(query, this.options);
1689
+ const { keys, records } = this._myIndex;
1690
+ const results = [];
1691
+
1692
+ // List is Array<Object>
1693
+ records.forEach(({ $: item, i: idx }) => {
1694
+ if (!isDefined(item)) {
1695
+ return
1696
+ }
1697
+
1698
+ let matches = [];
1699
+
1700
+ // Iterate over every key (i.e, path), and fetch the value at that key
1701
+ keys.forEach((key, keyIndex) => {
1702
+ matches.push(
1703
+ ...this._findMatches({
1704
+ key,
1705
+ value: item[keyIndex],
1706
+ searcher
1707
+ })
1708
+ );
1709
+ });
1710
+
1711
+ if (matches.length) {
1712
+ results.push({
1713
+ idx,
1714
+ item,
1715
+ matches
1716
+ });
1717
+ }
1718
+ });
1719
+
1720
+ return results
1721
+ }
1722
+ _findMatches({ key, value, searcher }) {
1723
+ if (!isDefined(value)) {
1724
+ return []
1725
+ }
1726
+
1727
+ let matches = [];
1728
+
1729
+ if (isArray(value)) {
1730
+ value.forEach(({ v: text, i: idx, n: norm }) => {
1731
+ if (!isDefined(text)) {
1732
+ return
1733
+ }
1734
+
1735
+ const { isMatch, score, indices } = searcher.searchIn(text);
1736
+
1737
+ if (isMatch) {
1738
+ matches.push({
1739
+ score,
1740
+ key,
1741
+ value: text,
1742
+ idx,
1743
+ norm,
1744
+ indices
1745
+ });
1746
+ }
1747
+ });
1748
+ } else {
1749
+ const { v: text, n: norm } = value;
1750
+
1751
+ const { isMatch, score, indices } = searcher.searchIn(text);
1752
+
1753
+ if (isMatch) {
1754
+ matches.push({ score, key, value: text, norm, indices });
1755
+ }
1756
+ }
1757
+
1758
+ return matches
1759
+ }
1760
+ }
1761
+
1762
+ Fuse.version = '6.4.6';
1763
+ Fuse.createIndex = createIndex;
1764
+ Fuse.parseIndex = parseIndex;
1765
+ Fuse.config = Config;
1766
+
1767
+ {
1768
+ Fuse.parseQuery = parse;
1769
+ }
1770
+
1771
+ {
1772
+ register(ExtendedSearch);
1773
+ }
1774
+
1775
+ const appCss = "*,*::before,*::after{box-sizing:border-box}ul[class],ol[class]{padding:0}body,h1,h2,h3,h4,p,ul[class],ol[class],li,figure,figcaption,blockquote,dl,dd{margin:0}ul[class],ol[class]{list-style:none}a:not([class]){text-decoration-skip-ink:auto}img{max-width:100%}input,button,textarea,select{font:inherit}@media (prefers-reduced-motion: reduce){*{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:root{--width-nav-panel:16rem}@keyframes spin{to{transform:rotate(360deg)}}.loading-screen{display:flex;flex-direction:row;align-items:center;justify-content:center;position:absolute;top:0;right:0;bottom:0;left:0}.loading-screen-icon{animation:spin 0.35s linear infinite;border-radius:50%;border-style:solid;border-width:0.125rem;border-color:rgb(var(--kompendium-color-blue-default));border-top-color:transparent;display:inline-block;height:1.25rem;width:1.25rem}.loading-screen-text{padding-left:0.75rem;color:rgb(var(--kompendium-contrast-1100))}:host{display:block;margin:0;padding:0}main{padding:1.25rem 2rem;margin-left:var(--width-nav-panel)}main kompendium-guide{display:block;width:100%;max-width:60rem}@media (max-width: 1000px){main{padding-top:2.625rem;margin-left:0}}";
1776
+
1777
+ const App = class {
1778
+ constructor(hostRef) {
1779
+ registerInstance(this, hostRef);
1780
+ /**
1781
+ * Path to `kompendium.json`
1782
+ */
1783
+ this.path = '/kompendium.json';
1784
+ this.onMessage = this.onMessage.bind(this);
1785
+ }
1786
+ componentWillLoad() {
1787
+ this.createWebSocket();
1788
+ this.fetchData();
1789
+ }
1790
+ watchData() {
1791
+ const options = {
1792
+ includeScore: true,
1793
+ includeMatches: true,
1794
+ ignoreLocation: true,
1795
+ threshold: 0.4,
1796
+ };
1797
+ const index = Fuse.parseIndex(this.data.index.data);
1798
+ this.index = new Fuse(this.data.index.documents, options, index);
1799
+ }
1800
+ createWebSocket() {
1801
+ if (this.socket) {
1802
+ return;
1803
+ }
1804
+ const url = getSocketUrl(location);
1805
+ this.socket = new WebSocket(url);
1806
+ this.socket.addEventListener('message', this.onMessage);
1807
+ }
1808
+ onMessage(event) {
1809
+ var _a;
1810
+ try {
1811
+ const data = JSON.parse(event.data);
1812
+ if (((_a = data.buildLog) === null || _a === void 0 ? void 0 : _a.progress) === 1) {
1813
+ this.fetchData();
1814
+ }
1815
+ }
1816
+ catch (e) {
1817
+ // eslint-disable-next-line no-console
1818
+ console.error(e);
1819
+ }
1820
+ }
1821
+ async fetchData() {
1822
+ const data = await fetch(this.path);
1823
+ this.data = await data.json();
1824
+ const typeNames = this.data.types.map((type) => type.name);
1825
+ setTypes(typeNames);
1826
+ }
1827
+ render() {
1828
+ if (!this.data) {
1829
+ return (h("div", { class: "loading-screen" }, h("div", { class: "loading-screen-icon" }), h("div", { class: "loading-screen-text" }, "Loading...")));
1830
+ }
1831
+ return (h("div", { class: "kompendium-body" }, h("kompendium-navigation", { menu: this.data.menu, header: this.data.title, logo: this.data.logo, index: this.index }), h("main", { role: "main" }, h("stencil-router", null, h("stencil-route-switch", { scrollTopOffset: 0 }, h("stencil-route", { url: "/", component: "kompendium-markdown", componentProps: {
1832
+ text: this.data.readme,
1833
+ } }), h("stencil-route", { url: "/component/:name/:section?", component: "kompendium-component", componentProps: {
1834
+ docs: this.data.docs,
1835
+ schemas: this.data.schemas,
1836
+ examplePropsFactory: this.examplePropsFactory,
1837
+ } }), h("stencil-route", { url: "/type/:name", component: "kompendium-type", componentProps: {
1838
+ types: this.data.types,
1839
+ } }), h("stencil-route", { url: "/debug/:name", component: "kompendium-debug", componentProps: {
1840
+ docs: this.data.docs,
1841
+ schemas: this.data.schemas,
1842
+ examplePropsFactory: this.examplePropsFactory,
1843
+ } }), h("stencil-route", { component: "kompendium-guide", componentProps: {
1844
+ data: this.data,
1845
+ } }))))));
1846
+ }
1847
+ static get watchers() { return {
1848
+ "data": ["watchData"]
1849
+ }; }
1850
+ };
1851
+ function getSocketUrl(location) {
1852
+ const protocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
1853
+ return `${protocol}//${location.hostname}:${location.port}/`;
1854
+ }
1855
+ App.style = appCss;
1856
+
1857
+ const darkmodeSwitchCss = ":host{--toggle-size:1.25rem}:host *{box-sizing:border-box}.mode-toggle{margin:0.75rem;position:relative;width:var(--toggle-size);height:var(--toggle-size);transition:opacity 0.3s ease;opacity:0.7}.mode-toggle:hover{opacity:1}.mode-visualization{pointer-events:none;position:absolute;width:var(--toggle-size);height:var(--toggle-size)}.circle{transition:background-color 0.6s ease;border-radius:50%;width:var(--toggle-size);height:var(--toggle-size);overflow:hidden;display:flex;align-items:center;justify-content:center;transform:translate3d(0, 0, 0)}.circle:after{transition:transform 0.7s ease, background-color 0.4s ease;content:\"\";display:block;border-radius:50%;width:calc(var(--toggle-size) - 0.25rem);height:calc(var(--toggle-size) - 0.25rem)}.ray{transition:opacity 0.6s ease, transform 0.6s cubic-bezier(0.37, -0.03, 0.4, 1.18);position:absolute;top:0;left:0;width:var(--toggle-size);height:var(--toggle-size)}.ray:before,.ray:after{content:\"\";display:block;height:0.375rem;width:0.125rem;border-radius:var(--toggle-size);background-color:rgba(var(--kompendium-color-orange-light), 1);position:absolute;left:0;right:0;margin:auto}.ray:before{top:-0.5rem}.ray:after{bottom:-0.5rem}.ray.three:before,.ray.three:after,.ray.four:before,.ray.four:after{height:0.25rem}input[type=checkbox]{-webkit-appearance:none;position:absolute;width:100%;height:100%;margin:0;cursor:pointer;border-radius:0.125rem}input[type=checkbox]:focus{outline:none}input[type=checkbox]:focus-visible{outline:none;box-shadow:var(--kompendium-shadow-depth-8-focused)}input[type=checkbox]:not(:checked)+.mode-visualization .circle{background-color:rgba(var(--kompendium-color-orange-default), 1);box-shadow:0 0 0.5rem 0.125rem rgba(var(--kompendium-color-orange-light), 0.8), 0 0 0.25rem 0.1875rem rgb(var(--kompendium-color-white))}input[type=checkbox]:not(:checked)+.mode-visualization .circle:after{background-color:rgba(var(--kompendium-color-orange-default), 1);transform:translate3d(1rem, -1rem, 0)}input[type=checkbox]:not(:checked)+.mode-visualization .ray{opacity:0.6}input[type=checkbox]:not(:checked)+.mode-visualization .ray.three,input[type=checkbox]:not(:checked)+.mode-visualization .ray.four{opacity:0.4}input[type=checkbox]:not(:checked)+.mode-visualization .ray.one{transform:rotate(0deg) scale(1)}input[type=checkbox]:not(:checked)+.mode-visualization .ray.two{transform:rotate(90deg) scale(1)}input[type=checkbox]:not(:checked)+.mode-visualization .ray.three{transform:rotate(45deg) scale(1)}input[type=checkbox]:not(:checked)+.mode-visualization .ray.four{transform:rotate(-45deg) scale(1)}input[type=checkbox]:checked+.mode-visualization .circle{background-color:rgba(var(--kompendium-contrast-1700), 0.7);box-shadow:0 0 0.5rem 0.125rem rgba(var(--kompendium-color-white), 0.4), 0 0 0.25rem 0.125rem rgb(var(--kompendium-color-black))}input[type=checkbox]:checked+.mode-visualization .circle:after{transform:translate3d(0.25rem, -0.25rem, 0);background-color:rgb(var(--kompendium-contrast-400))}input[type=checkbox]:checked+.mode-visualization .ray{opacity:0}input[type=checkbox]:checked+.mode-visualization .ray.one{transform:rotate(60deg) scale(0.5)}input[type=checkbox]:checked+.mode-visualization .ray.two{transform:rotate(150deg) scale(0.5)}input[type=checkbox]:checked+.mode-visualization .ray.three{transform:rotate(105deg) scale(0.5)}input[type=checkbox]:checked+.mode-visualization .ray.four{transform:rotate(15deg) scale(0.5)}";
1858
+
1859
+ const DEFAULT = 'system-default';
1860
+ const LIGHT = 'force-light';
1861
+ const DARK = 'force-dark';
1862
+ const CHECKBOX_LIGHT = false;
1863
+ const CHECKBOX_DARK = true;
1864
+ const LOCALSTORAGE_KEY = 'kompendium-theme';
1865
+ const DarkmodeSwitch = class {
1866
+ constructor(hostRef) {
1867
+ registerInstance(this, hostRef);
1868
+ this.theme = 'system-default';
1869
+ this.getSelectRef = (element) => {
1870
+ this.checkbox = element;
1871
+ };
1872
+ this.handleSystemThemeChange = (e) => {
1873
+ this.systemSettingIsDark = !!e.matches;
1874
+ if (this.theme === DEFAULT) {
1875
+ this.checkbox.checked = !this.checkbox.checked;
1876
+ }
1877
+ };
1878
+ this.handleThemeChange = () => {
1879
+ const checkboxValue = !!this.checkbox.checked;
1880
+ let newTheme = DEFAULT;
1881
+ if (this.systemSettingIsDark) {
1882
+ if (checkboxValue === CHECKBOX_LIGHT) {
1883
+ newTheme = LIGHT;
1884
+ }
1885
+ }
1886
+ else {
1887
+ if (checkboxValue === CHECKBOX_DARK) {
1888
+ newTheme = DARK;
1889
+ }
1890
+ }
1891
+ this.setTheme(newTheme);
1892
+ document.dispatchEvent(new CustomEvent(THEME_EVENT_NAME, { detail: newTheme }));
1893
+ };
1894
+ this.setTheme = (value) => {
1895
+ this.theme = value;
1896
+ document.querySelector('html').dataset.theme = value;
1897
+ localStorage.setItem(LOCALSTORAGE_KEY, value);
1898
+ };
1899
+ const colorSchemeMediaQueryFallback = {
1900
+ addEventListener: () => { },
1901
+ matches: false,
1902
+ };
1903
+ this.colorSchemeMediaQuery =
1904
+ (window.matchMedia &&
1905
+ window.matchMedia('(prefers-color-scheme: dark)')) ||
1906
+ colorSchemeMediaQueryFallback;
1907
+ }
1908
+ connectedCallback() {
1909
+ this.colorSchemeMediaQuery.addEventListener('change', this.handleSystemThemeChange);
1910
+ }
1911
+ disconnectedCallback() {
1912
+ this.colorSchemeMediaQuery.removeEventListener('change', this.handleSystemThemeChange);
1913
+ }
1914
+ componentWillLoad() {
1915
+ this.systemSettingIsDark = this.colorSchemeMediaQuery.matches;
1916
+ this.setTheme((localStorage.getItem(LOCALSTORAGE_KEY) || DEFAULT));
1917
+ }
1918
+ render() {
1919
+ const props = {
1920
+ checked: this.theme === DARK ||
1921
+ (this.theme === DEFAULT && this.systemSettingIsDark),
1922
+ };
1923
+ return (h("div", { key: '72bb10f37127840f1e310943a35a6f653bd3859d', class: "mode-toggle" }, h("input", { key: '5869df8eadeb50a5e6c7fe41e0ec6f7dfe8be233', type: "checkbox", onChange: this.handleThemeChange, ref: this.getSelectRef, ...props }), h("div", { key: '4ca3d61f92b73c9239820eadf411fbb9f4eaab7f', class: "mode-visualization" }, h("div", { key: 'e4d99bd1a90298a2a6c634cd2d3cb859c3bbd1bc', class: "circle" }), h("div", { key: '4a7e9b0d7d5bfc4c85db8cd50e6200899d81a6fb', class: "ray one" }), h("div", { key: 'c489f612cabd963e3ebae26996dd7a71f242e0de', class: "ray two" }), h("div", { key: '83288239cf2c67c0ad314728c6c65ffee67f9c1e', class: "ray three" }), h("div", { key: '013b3c4c16e8f49d396a7a3e903108304ad17dfe', class: "ray four" }))));
1924
+ }
1925
+ };
1926
+ DarkmodeSwitch.style = darkmodeSwitchCss;
1927
+
1928
+ const navigationCss = "*,*::before,*::after{box-sizing:border-box}ul[class],ol[class]{padding:0}body,h1,h2,h3,h4,p,ul[class],ol[class],li,figure,figcaption,blockquote,dl,dd{margin:0}ul[class],ol[class]{list-style:none}a:not([class]){text-decoration-skip-ink:auto}img{max-width:100%}input,button,textarea,select{font:inherit}@media (prefers-reduced-motion: reduce){*{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:root{--width-nav-panel:16rem}:host{display:block;font-family:var(--kompendium-font-primary);--size-show-nav-panel-button:2.25rem}header a{text-decoration:none;color:unset}.nav-panel-scrim{display:none;z-index:99;position:fixed;top:0;right:0;bottom:0;left:0}.nav-panel{transition:transform 0.44s cubic-bezier(1, 0.12, 0.2, 0.88), background-color 0.3s ease;width:var(--width-nav-panel);height:100vh;position:fixed;background-color:rgb(var(--kompendium-contrast-400));display:flex;flex-direction:column}.nav-panel .panel-header{transition:border 0.3s ease;flex-direction:row;padding:1rem;border-bottom:1px solid rgb(var(--kompendium-contrast-600));margin-bottom:0.5rem}.nav-panel .panel-list{overflow-y:auto;list-style:none}.nav-panel .panel-list:not(.chapters){padding:0 0.75rem 2rem 0.75rem}.nav-panel .panel-list li{margin-left:0}.nav-panel .panel-list li::before{content:none;display:none}.nav-panel.display-nav-panel{z-index:100}.branding-and-mode{display:flex;align-items:center;margin-bottom:0.75rem}.branding-and-mode h1{all:unset;font-size:1rem;font-weight:normal;color:rgb(var(--kompendium-contrast-900));flex-grow:1;line-height:1}.branding-and-mode a{border-radius:0.125rem}.branding-and-mode a:focus{outline:none}.branding-and-mode a:focus-visible{outline:none;box-shadow:var(--kompendium-shadow-depth-8-focused)}.branding-and-mode kompendium-darkmode-switch{position:relative;flex-shrink:0;margin-left:0.75rem;padding-left:0.5rem}.branding-and-mode kompendium-darkmode-switch:before{transition:background-color 0.3s ease;content:\"\";position:absolute;background-color:rgb(var(--kompendium-contrast-600));border-radius:0.5rem;height:1.25rem;width:0.125rem;left:0.0625rem;top:0;bottom:0;margin:auto}.powered-by{position:absolute;bottom:0;left:0;font-size:0.75rem;padding:0.5rem 0.75rem;background-color:rgba(var(--kompendium-contrast-100), 0.4);backdrop-filter:blur(0.25rem);width:100%}.powered-by p{padding-left:1.75rem;font-size:0.75rem;background-image:url('data:image/svg+xml;utf8,<svg viewBox=\"0 0 148 80\" xmlns=\"http://www.w3.org/2000/svg\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" stroke-linejoin=\"round\" stroke-miterlimit=\"2\"><path fill=\"none\" d=\"M-.003 0h148v80h-148z\"/><path d=\"M148.008 20c0-11.038-8.96-20-19.999-20H19.977c-11.038 0-20 8.962-20 20v40c0 11.038 8.962 20 20 20H128.01c11.038 0 20-8.962 20-20V20z\" fill=\"rgb(36,71,88)\"/><path d=\"M26.564 43.651v14.604H19.26V43.65h7.304zm0-7.302H19.26V21.745h7.304V36.35z\" fill=\"rgb(255,160,0)\"/><path d=\"M106.82 58.254v-7.303h7.304V43.65h7.304v-7.301h-7.304v-7.303h-7.304v-7.302h7.304v7.302h7.304v7.303h7.293v7.301h-7.293v7.302h-7.304v7.303h-7.304zm-43.812 0v-7.303h7.304V43.65h7.304v-7.301h7.303v-7.303h7.293v-7.302h7.304v7.302h-7.304v7.303H84.92v7.301h-7.303v7.302h-7.304v7.303h-7.304zm-14.597 0v-7.303h-7.304V43.65h-7.304v-7.301h7.304v-7.303h7.304v-7.302h7.293v7.302H48.41v7.303h-7.304v7.301h7.304v7.302h7.293v7.303H48.41z\" fill=\"rgb(0,200,82)\"/></svg>');background-position:left center;background-repeat:no-repeat;background-size:1.5rem}.powered-by a{transition:color 0.2s ease;color:rgb(var(--kompendium-color-blue-default));text-decoration:none;font-size:0.75rem}.powered-by a:hover{color:rgb(var(--kompendium-color-blue-light))}.nav-panel__responsive-menu{transition:background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;box-shadow:var(--kompendium-button-shadow-normal)}.nav-panel__responsive-menu:hover{box-shadow:var(--kompendium-button-shadow-hovered)}.nav-panel__responsive-menu:active{box-shadow:var(--kompendium-button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.nav-panel__responsive-menu:focus{outline:none}.nav-panel__responsive-menu:focus-visible{outline:none;box-shadow:var(--kompendium-shadow-depth-8-focused)}.nav-panel__responsive-menu{transition:all 0.2s ease;display:none;cursor:pointer;position:absolute;top:0.75rem;right:calc(var(--size-show-nav-panel-button) * -1 - 1rem);width:var(--size-show-nav-panel-button);height:var(--size-show-nav-panel-button);margin:0.25rem;border-radius:50%;text-align:center;font-weight:bold;background-color:rgba(var(--kompendium-contrast-200), 0.7);backdrop-filter:blur(0.25rem);color:rgb(var(--kompendium-contrast-900))}.nav-panel__responsive-menu span{transition:background-color 0.2s ease, transform 0.2s ease 0.3s, opacity 0.15s ease 0.3s;display:block;position:absolute;left:0;right:0;margin:auto;height:0.125rem;width:1rem;border-radius:0.25rem;background-color:rgb(var(--kompendium-contrast-900))}.nav-panel__responsive-menu span:nth-child(1){top:0.75rem}.nav-panel__responsive-menu span:nth-child(2),.nav-panel__responsive-menu span:nth-child(3){top:0;bottom:0}.nav-panel__responsive-menu span:nth-child(4){bottom:0.75rem}.nav-panel__responsive-menu:hover span{background-color:rgb(var(--kompendium-contrast-1200))}@media (max-width: 1000px){.nav-panel-scrim.display-nav-panel{display:block}.nav-panel{transform:translate3d(calc(var(--width-nav-panel) * -1), 0, 0)}.nav-panel.display-nav-panel{transform:translate3d(0, 0, 0);box-shadow:0 0.09375rem 0.225rem 0 rgba(0, 0, 0, 0.232), 0 0.01875rem 0.05625rem 0 rgba(0, 0, 0, 0.208)}.nav-panel.display-nav-panel .nav-panel__responsive-menu{right:calc(var(--size-show-nav-panel-button) * -1 - 0.3125rem);border-radius:0 0.5rem 0.5rem 0}.nav-panel.display-nav-panel .nav-panel__responsive-menu span:nth-child(1),.nav-panel.display-nav-panel .nav-panel__responsive-menu span:nth-child(4){transform:scaleX(0);opacity:0}.nav-panel.display-nav-panel .nav-panel__responsive-menu span:nth-child(2){transform:rotate(45deg)}.nav-panel.display-nav-panel .nav-panel__responsive-menu span:nth-child(3){transform:rotate(-45deg)}.nav-panel__responsive-menu{display:block}}.panel-item{transition:opacity 0.2s ease;width:100%;border-radius:0.375rem}.panel-item.active{background-color:rgb(var(--kompendium-contrast-100), 0.5)}.panel-link{display:grid;grid-auto-flow:column;grid-template-columns:1fr 1.75rem;line-height:1.75rem;color:rgb(var(--kompendium-contrast-900));text-decoration:none;border-radius:0.375rem}.panel-link:hover,.panel-link.active{color:rgb(var(--kompendium-color-blue-default))}.panel-link.active svg{transform:scale(0.64) rotate(-90deg)}.panel-link:focus{outline:none}.panel-link:focus-visible{outline:none;box-shadow:var(--kompendium-shadow-depth-8-focused)}.panel-link svg{visibility:hidden;transition:transform 0.2s ease;transform:scale(0.64) rotate(90deg);height:2rem}.panel-link.has-children svg{visibility:visible}.link-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:100%;padding-left:0.5rem}.chapters{height:0}.chapters>.panel-item{padding:0 0.5rem}.chapters:not(.active){visibility:hidden}.chapters.active{transition:height 0.2s ease;height:100%}.chapters.active .panel-item{opacity:1;transition-delay:0.2s}.chapters.active .panel-item:nth-child(1){transition-delay:0s}.chapters.active .panel-item:nth-child(2){transition-delay:0.04s}.chapters.active .panel-item:nth-child(3){transition-delay:0.06s}.chapters.active .panel-item:nth-child(4){transition-delay:0.08s}.chapters.active .panel-item:nth-child(5){transition-delay:0.1s}.chapters.active .panel-item:nth-child(6){transition-delay:0.12s}.chapters.active .panel-item:nth-child(7){transition-delay:0.14s}.chapters.active .panel-item:nth-child(8){transition-delay:0.15s}.chapters.active .panel-item:nth-child(9){transition-delay:0.16s}.chapters.active .panel-item:nth-child(10){transition-delay:0.17s}.chapters.active .panel-item:nth-child(11){transition-delay:0.18s}.chapters.active .panel-item:nth-child(12){transition-delay:0.19s}.chapters.active .panel-item:last-child{margin-bottom:0.5rem}.chapters .panel-link.has-children svg{visibility:hidden}.chapters .panel-item{opacity:0}.chapters .panel-item .chapters{font-size:0.8125rem;padding-left:0.5rem}.chapters .panel-item .chapters:first-child{margin-top:0.25rem}";
1929
+
1930
+ const Navigation = class {
1931
+ constructor(hostRef) {
1932
+ registerInstance(this, hostRef);
1933
+ this.route = '';
1934
+ this.displayNavPanel = false;
1935
+ this.toggleMenu = () => {
1936
+ this.displayNavPanel = !this.displayNavPanel;
1937
+ };
1938
+ this.stopPropagationOfNavClick = (event) => {
1939
+ event.stopPropagation();
1940
+ };
1941
+ this.setRoute = this.setRoute.bind(this);
1942
+ this.renderMenuItem = this.renderMenuItem.bind(this);
1943
+ }
1944
+ connectedCallback() {
1945
+ window.addEventListener('hashchange', this.setRoute);
1946
+ this.setRoute();
1947
+ }
1948
+ disconnectedCallback() {
1949
+ window.removeEventListener('hashchange', this.setRoute);
1950
+ }
1951
+ setRoute() {
1952
+ this.route = location.hash.substr(1);
1953
+ }
1954
+ render() {
1955
+ return [
1956
+ h("div", { key: '0abf57dba46d2c55f777e6b0a62756f1531b716a', class: {
1957
+ 'nav-panel-scrim': true,
1958
+ 'display-nav-panel': this.displayNavPanel,
1959
+ }, onClick: this.toggleMenu }),
1960
+ h("nav", { key: '47f1e62abae92f0ee5a90a980f79b5cec0508364', class: {
1961
+ 'nav-panel': true,
1962
+ 'display-nav-panel': this.displayNavPanel,
1963
+ }, onClick: this.stopPropagationOfNavClick }, h("a", { key: '25fd2d738007fc596447cf4ac0a2bbbcf92df332', class: "nav-panel__responsive-menu", onClick: this.toggleMenu }, h("span", { key: '2b4056f7793e879a86bd0ed40ce45366d891cf5a' }), h("span", { key: 'c2174de261be61fa807e8b6dadcf6b7119bbec30' }), h("span", { key: 'd755597e3c961b057f7ed4cb042aa45c8ca336c1' }), h("span", { key: 'a3442946e847e5b870afc0dcce8baf47cc4fb03a' })), h("header", { key: '46a15de390a19d9cb9b0bd8973e82b4c33bb6d62', class: "panel-header" }, h("div", { key: '3c280f8409cef9848c3e58c6ac907a4e6ae53a8e', class: "branding-and-mode" }, h("h1", { key: 'c38675cafe5bdf1a119a3e06cdca78f5d5ad5b25' }, this.renderHeader()), h("kompendium-darkmode-switch", { key: 'ec6564ee68633fffabc3deecf34a09d431d7634a' })), h("kompendium-search", { key: '8aa459ff257cc6a1adb726ca4b6b4cdf397ccb57', index: this.index })), this.renderChapters(this.menu)),
1964
+ ];
1965
+ }
1966
+ renderHeader() {
1967
+ let content = this.header;
1968
+ if (this.logo) {
1969
+ content = h("img", { alt: this.header, src: this.logo });
1970
+ }
1971
+ return h("a", { href: "#" }, content);
1972
+ }
1973
+ renderChapters(menu) {
1974
+ if (!menu || !menu.length) {
1975
+ return;
1976
+ }
1977
+ return (h("ul", { class: "panel-list" }, menu.map(this.renderMenuItem), h("div", { class: "powered-by" }, h("p", null, "Powered by\u00A0", h("a", { href: "https://github.com/jgroth/kompendium" }, "Kompendium")))));
1978
+ }
1979
+ renderMenuItem(item) {
1980
+ const itemClassList = {
1981
+ active: this.isRouteActive(item.path),
1982
+ 'panel-item': true,
1983
+ };
1984
+ const chapterClassList = {
1985
+ active: this.isRouteActive(item.path),
1986
+ chapters: true,
1987
+ 'panel-list': true,
1988
+ };
1989
+ const chapters = item.children || [];
1990
+ const anchorClassList = {
1991
+ 'panel-link': true,
1992
+ active: this.isRouteActive(item.path),
1993
+ 'has-children': !!chapters.length,
1994
+ };
1995
+ const anchorAdditionalProps = {};
1996
+ if (!chapters.length) {
1997
+ anchorAdditionalProps.onClick = this.toggleMenu;
1998
+ }
1999
+ return (h("li", { class: itemClassList }, h("a", { class: anchorClassList, href: '#' + item.path, ...anchorAdditionalProps }, h("span", { class: "link-text" }, item.title), h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24", height: "24" }, h("path", { fill: "none", d: "M0 0h24v24H0z" }), h("path", { id: "arrow", d: "M13.172 12l-4.95-4.95 1.414-1.414L16 12l-6.364 6.364-1.414-1.414z", fill: "currentColor" }))), h("ul", { class: chapterClassList }, chapters.map(this.renderMenuItem))));
2000
+ }
2001
+ isRouteActive(route) {
2002
+ return this.route.startsWith(route);
2003
+ }
2004
+ };
2005
+ Navigation.style = navigationCss;
2006
+
2007
+ /**
2008
+ * Checks if `value` is the
2009
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
2010
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
2011
+ *
2012
+ * @static
2013
+ * @memberOf _
2014
+ * @since 0.1.0
2015
+ * @category Lang
2016
+ * @param {*} value The value to check.
2017
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
2018
+ * @example
2019
+ *
2020
+ * _.isObject({});
2021
+ * // => true
2022
+ *
2023
+ * _.isObject([1, 2, 3]);
2024
+ * // => true
2025
+ *
2026
+ * _.isObject(_.noop);
2027
+ * // => true
2028
+ *
2029
+ * _.isObject(null);
2030
+ * // => false
2031
+ */
2032
+
2033
+ var isObject_1;
2034
+ var hasRequiredIsObject;
2035
+
2036
+ function requireIsObject () {
2037
+ if (hasRequiredIsObject) return isObject_1;
2038
+ hasRequiredIsObject = 1;
2039
+ function isObject(value) {
2040
+ var type = typeof value;
2041
+ return value != null && (type == 'object' || type == 'function');
2042
+ }
2043
+
2044
+ isObject_1 = isObject;
2045
+ return isObject_1;
2046
+ }
2047
+
2048
+ /** Detect free variable `global` from Node.js. */
2049
+
2050
+ var _freeGlobal;
2051
+ var hasRequired_freeGlobal;
2052
+
2053
+ function require_freeGlobal () {
2054
+ if (hasRequired_freeGlobal) return _freeGlobal;
2055
+ hasRequired_freeGlobal = 1;
2056
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
2057
+
2058
+ _freeGlobal = freeGlobal;
2059
+ return _freeGlobal;
2060
+ }
2061
+
2062
+ var _root;
2063
+ var hasRequired_root;
2064
+
2065
+ function require_root () {
2066
+ if (hasRequired_root) return _root;
2067
+ hasRequired_root = 1;
2068
+ var freeGlobal = require_freeGlobal();
2069
+
2070
+ /** Detect free variable `self`. */
2071
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
2072
+
2073
+ /** Used as a reference to the global object. */
2074
+ var root = freeGlobal || freeSelf || Function('return this')();
2075
+
2076
+ _root = root;
2077
+ return _root;
2078
+ }
2079
+
2080
+ var now_1;
2081
+ var hasRequiredNow;
2082
+
2083
+ function requireNow () {
2084
+ if (hasRequiredNow) return now_1;
2085
+ hasRequiredNow = 1;
2086
+ var root = require_root();
2087
+
2088
+ /**
2089
+ * Gets the timestamp of the number of milliseconds that have elapsed since
2090
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
2091
+ *
2092
+ * @static
2093
+ * @memberOf _
2094
+ * @since 2.4.0
2095
+ * @category Date
2096
+ * @returns {number} Returns the timestamp.
2097
+ * @example
2098
+ *
2099
+ * _.defer(function(stamp) {
2100
+ * console.log(_.now() - stamp);
2101
+ * }, _.now());
2102
+ * // => Logs the number of milliseconds it took for the deferred invocation.
2103
+ */
2104
+ var now = function() {
2105
+ return root.Date.now();
2106
+ };
2107
+
2108
+ now_1 = now;
2109
+ return now_1;
2110
+ }
2111
+
2112
+ /** Used to match a single whitespace character. */
2113
+
2114
+ var _trimmedEndIndex;
2115
+ var hasRequired_trimmedEndIndex;
2116
+
2117
+ function require_trimmedEndIndex () {
2118
+ if (hasRequired_trimmedEndIndex) return _trimmedEndIndex;
2119
+ hasRequired_trimmedEndIndex = 1;
2120
+ var reWhitespace = /\s/;
2121
+
2122
+ /**
2123
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
2124
+ * character of `string`.
2125
+ *
2126
+ * @private
2127
+ * @param {string} string The string to inspect.
2128
+ * @returns {number} Returns the index of the last non-whitespace character.
2129
+ */
2130
+ function trimmedEndIndex(string) {
2131
+ var index = string.length;
2132
+
2133
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
2134
+ return index;
2135
+ }
2136
+
2137
+ _trimmedEndIndex = trimmedEndIndex;
2138
+ return _trimmedEndIndex;
2139
+ }
2140
+
2141
+ var _baseTrim;
2142
+ var hasRequired_baseTrim;
2143
+
2144
+ function require_baseTrim () {
2145
+ if (hasRequired_baseTrim) return _baseTrim;
2146
+ hasRequired_baseTrim = 1;
2147
+ var trimmedEndIndex = require_trimmedEndIndex();
2148
+
2149
+ /** Used to match leading whitespace. */
2150
+ var reTrimStart = /^\s+/;
2151
+
2152
+ /**
2153
+ * The base implementation of `_.trim`.
2154
+ *
2155
+ * @private
2156
+ * @param {string} string The string to trim.
2157
+ * @returns {string} Returns the trimmed string.
2158
+ */
2159
+ function baseTrim(string) {
2160
+ return string
2161
+ ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
2162
+ : string;
2163
+ }
2164
+
2165
+ _baseTrim = baseTrim;
2166
+ return _baseTrim;
2167
+ }
2168
+
2169
+ var _Symbol;
2170
+ var hasRequired_Symbol;
2171
+
2172
+ function require_Symbol () {
2173
+ if (hasRequired_Symbol) return _Symbol;
2174
+ hasRequired_Symbol = 1;
2175
+ var root = require_root();
2176
+
2177
+ /** Built-in value references. */
2178
+ var Symbol = root.Symbol;
2179
+
2180
+ _Symbol = Symbol;
2181
+ return _Symbol;
2182
+ }
2183
+
2184
+ var _getRawTag;
2185
+ var hasRequired_getRawTag;
2186
+
2187
+ function require_getRawTag () {
2188
+ if (hasRequired_getRawTag) return _getRawTag;
2189
+ hasRequired_getRawTag = 1;
2190
+ var Symbol = require_Symbol();
2191
+
2192
+ /** Used for built-in method references. */
2193
+ var objectProto = Object.prototype;
2194
+
2195
+ /** Used to check objects for own properties. */
2196
+ var hasOwnProperty = objectProto.hasOwnProperty;
2197
+
2198
+ /**
2199
+ * Used to resolve the
2200
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2201
+ * of values.
2202
+ */
2203
+ var nativeObjectToString = objectProto.toString;
2204
+
2205
+ /** Built-in value references. */
2206
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
2207
+
2208
+ /**
2209
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
2210
+ *
2211
+ * @private
2212
+ * @param {*} value The value to query.
2213
+ * @returns {string} Returns the raw `toStringTag`.
2214
+ */
2215
+ function getRawTag(value) {
2216
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
2217
+ tag = value[symToStringTag];
2218
+
2219
+ try {
2220
+ value[symToStringTag] = undefined;
2221
+ var unmasked = true;
2222
+ } catch (e) {}
2223
+
2224
+ var result = nativeObjectToString.call(value);
2225
+ if (unmasked) {
2226
+ if (isOwn) {
2227
+ value[symToStringTag] = tag;
2228
+ } else {
2229
+ delete value[symToStringTag];
2230
+ }
2231
+ }
2232
+ return result;
2233
+ }
2234
+
2235
+ _getRawTag = getRawTag;
2236
+ return _getRawTag;
2237
+ }
2238
+
2239
+ /** Used for built-in method references. */
2240
+
2241
+ var _objectToString;
2242
+ var hasRequired_objectToString;
2243
+
2244
+ function require_objectToString () {
2245
+ if (hasRequired_objectToString) return _objectToString;
2246
+ hasRequired_objectToString = 1;
2247
+ var objectProto = Object.prototype;
2248
+
2249
+ /**
2250
+ * Used to resolve the
2251
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2252
+ * of values.
2253
+ */
2254
+ var nativeObjectToString = objectProto.toString;
2255
+
2256
+ /**
2257
+ * Converts `value` to a string using `Object.prototype.toString`.
2258
+ *
2259
+ * @private
2260
+ * @param {*} value The value to convert.
2261
+ * @returns {string} Returns the converted string.
2262
+ */
2263
+ function objectToString(value) {
2264
+ return nativeObjectToString.call(value);
2265
+ }
2266
+
2267
+ _objectToString = objectToString;
2268
+ return _objectToString;
2269
+ }
2270
+
2271
+ var _baseGetTag;
2272
+ var hasRequired_baseGetTag;
2273
+
2274
+ function require_baseGetTag () {
2275
+ if (hasRequired_baseGetTag) return _baseGetTag;
2276
+ hasRequired_baseGetTag = 1;
2277
+ var Symbol = require_Symbol(),
2278
+ getRawTag = require_getRawTag(),
2279
+ objectToString = require_objectToString();
2280
+
2281
+ /** `Object#toString` result references. */
2282
+ var nullTag = '[object Null]',
2283
+ undefinedTag = '[object Undefined]';
2284
+
2285
+ /** Built-in value references. */
2286
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
2287
+
2288
+ /**
2289
+ * The base implementation of `getTag` without fallbacks for buggy environments.
2290
+ *
2291
+ * @private
2292
+ * @param {*} value The value to query.
2293
+ * @returns {string} Returns the `toStringTag`.
2294
+ */
2295
+ function baseGetTag(value) {
2296
+ if (value == null) {
2297
+ return value === undefined ? undefinedTag : nullTag;
2298
+ }
2299
+ return (symToStringTag && symToStringTag in Object(value))
2300
+ ? getRawTag(value)
2301
+ : objectToString(value);
2302
+ }
2303
+
2304
+ _baseGetTag = baseGetTag;
2305
+ return _baseGetTag;
2306
+ }
2307
+
2308
+ /**
2309
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
2310
+ * and has a `typeof` result of "object".
2311
+ *
2312
+ * @static
2313
+ * @memberOf _
2314
+ * @since 4.0.0
2315
+ * @category Lang
2316
+ * @param {*} value The value to check.
2317
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2318
+ * @example
2319
+ *
2320
+ * _.isObjectLike({});
2321
+ * // => true
2322
+ *
2323
+ * _.isObjectLike([1, 2, 3]);
2324
+ * // => true
2325
+ *
2326
+ * _.isObjectLike(_.noop);
2327
+ * // => false
2328
+ *
2329
+ * _.isObjectLike(null);
2330
+ * // => false
2331
+ */
2332
+
2333
+ var isObjectLike_1;
2334
+ var hasRequiredIsObjectLike;
2335
+
2336
+ function requireIsObjectLike () {
2337
+ if (hasRequiredIsObjectLike) return isObjectLike_1;
2338
+ hasRequiredIsObjectLike = 1;
2339
+ function isObjectLike(value) {
2340
+ return value != null && typeof value == 'object';
2341
+ }
2342
+
2343
+ isObjectLike_1 = isObjectLike;
2344
+ return isObjectLike_1;
2345
+ }
2346
+
2347
+ var isSymbol_1;
2348
+ var hasRequiredIsSymbol;
2349
+
2350
+ function requireIsSymbol () {
2351
+ if (hasRequiredIsSymbol) return isSymbol_1;
2352
+ hasRequiredIsSymbol = 1;
2353
+ var baseGetTag = require_baseGetTag(),
2354
+ isObjectLike = requireIsObjectLike();
2355
+
2356
+ /** `Object#toString` result references. */
2357
+ var symbolTag = '[object Symbol]';
2358
+
2359
+ /**
2360
+ * Checks if `value` is classified as a `Symbol` primitive or object.
2361
+ *
2362
+ * @static
2363
+ * @memberOf _
2364
+ * @since 4.0.0
2365
+ * @category Lang
2366
+ * @param {*} value The value to check.
2367
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
2368
+ * @example
2369
+ *
2370
+ * _.isSymbol(Symbol.iterator);
2371
+ * // => true
2372
+ *
2373
+ * _.isSymbol('abc');
2374
+ * // => false
2375
+ */
2376
+ function isSymbol(value) {
2377
+ return typeof value == 'symbol' ||
2378
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
2379
+ }
2380
+
2381
+ isSymbol_1 = isSymbol;
2382
+ return isSymbol_1;
2383
+ }
2384
+
2385
+ var toNumber_1;
2386
+ var hasRequiredToNumber;
2387
+
2388
+ function requireToNumber () {
2389
+ if (hasRequiredToNumber) return toNumber_1;
2390
+ hasRequiredToNumber = 1;
2391
+ var baseTrim = require_baseTrim(),
2392
+ isObject = requireIsObject(),
2393
+ isSymbol = requireIsSymbol();
2394
+
2395
+ /** Used as references for various `Number` constants. */
2396
+ var NAN = 0 / 0;
2397
+
2398
+ /** Used to detect bad signed hexadecimal string values. */
2399
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
2400
+
2401
+ /** Used to detect binary string values. */
2402
+ var reIsBinary = /^0b[01]+$/i;
2403
+
2404
+ /** Used to detect octal string values. */
2405
+ var reIsOctal = /^0o[0-7]+$/i;
2406
+
2407
+ /** Built-in method references without a dependency on `root`. */
2408
+ var freeParseInt = parseInt;
2409
+
2410
+ /**
2411
+ * Converts `value` to a number.
2412
+ *
2413
+ * @static
2414
+ * @memberOf _
2415
+ * @since 4.0.0
2416
+ * @category Lang
2417
+ * @param {*} value The value to process.
2418
+ * @returns {number} Returns the number.
2419
+ * @example
2420
+ *
2421
+ * _.toNumber(3.2);
2422
+ * // => 3.2
2423
+ *
2424
+ * _.toNumber(Number.MIN_VALUE);
2425
+ * // => 5e-324
2426
+ *
2427
+ * _.toNumber(Infinity);
2428
+ * // => Infinity
2429
+ *
2430
+ * _.toNumber('3.2');
2431
+ * // => 3.2
2432
+ */
2433
+ function toNumber(value) {
2434
+ if (typeof value == 'number') {
2435
+ return value;
2436
+ }
2437
+ if (isSymbol(value)) {
2438
+ return NAN;
2439
+ }
2440
+ if (isObject(value)) {
2441
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
2442
+ value = isObject(other) ? (other + '') : other;
2443
+ }
2444
+ if (typeof value != 'string') {
2445
+ return value === 0 ? value : +value;
2446
+ }
2447
+ value = baseTrim(value);
2448
+ var isBinary = reIsBinary.test(value);
2449
+ return (isBinary || reIsOctal.test(value))
2450
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
2451
+ : (reIsBadHex.test(value) ? NAN : +value);
2452
+ }
2453
+
2454
+ toNumber_1 = toNumber;
2455
+ return toNumber_1;
2456
+ }
2457
+
2458
+ var debounce_1;
2459
+ var hasRequiredDebounce;
2460
+
2461
+ function requireDebounce () {
2462
+ if (hasRequiredDebounce) return debounce_1;
2463
+ hasRequiredDebounce = 1;
2464
+ var isObject = requireIsObject(),
2465
+ now = requireNow(),
2466
+ toNumber = requireToNumber();
2467
+
2468
+ /** Error message constants. */
2469
+ var FUNC_ERROR_TEXT = 'Expected a function';
2470
+
2471
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2472
+ var nativeMax = Math.max,
2473
+ nativeMin = Math.min;
2474
+
2475
+ /**
2476
+ * Creates a debounced function that delays invoking `func` until after `wait`
2477
+ * milliseconds have elapsed since the last time the debounced function was
2478
+ * invoked. The debounced function comes with a `cancel` method to cancel
2479
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
2480
+ * Provide `options` to indicate whether `func` should be invoked on the
2481
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
2482
+ * with the last arguments provided to the debounced function. Subsequent
2483
+ * calls to the debounced function return the result of the last `func`
2484
+ * invocation.
2485
+ *
2486
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
2487
+ * invoked on the trailing edge of the timeout only if the debounced function
2488
+ * is invoked more than once during the `wait` timeout.
2489
+ *
2490
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
2491
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
2492
+ *
2493
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
2494
+ * for details over the differences between `_.debounce` and `_.throttle`.
2495
+ *
2496
+ * @static
2497
+ * @memberOf _
2498
+ * @since 0.1.0
2499
+ * @category Function
2500
+ * @param {Function} func The function to debounce.
2501
+ * @param {number} [wait=0] The number of milliseconds to delay.
2502
+ * @param {Object} [options={}] The options object.
2503
+ * @param {boolean} [options.leading=false]
2504
+ * Specify invoking on the leading edge of the timeout.
2505
+ * @param {number} [options.maxWait]
2506
+ * The maximum time `func` is allowed to be delayed before it's invoked.
2507
+ * @param {boolean} [options.trailing=true]
2508
+ * Specify invoking on the trailing edge of the timeout.
2509
+ * @returns {Function} Returns the new debounced function.
2510
+ * @example
2511
+ *
2512
+ * // Avoid costly calculations while the window size is in flux.
2513
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
2514
+ *
2515
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
2516
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
2517
+ * 'leading': true,
2518
+ * 'trailing': false
2519
+ * }));
2520
+ *
2521
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
2522
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
2523
+ * var source = new EventSource('/stream');
2524
+ * jQuery(source).on('message', debounced);
2525
+ *
2526
+ * // Cancel the trailing debounced invocation.
2527
+ * jQuery(window).on('popstate', debounced.cancel);
2528
+ */
2529
+ function debounce(func, wait, options) {
2530
+ var lastArgs,
2531
+ lastThis,
2532
+ maxWait,
2533
+ result,
2534
+ timerId,
2535
+ lastCallTime,
2536
+ lastInvokeTime = 0,
2537
+ leading = false,
2538
+ maxing = false,
2539
+ trailing = true;
2540
+
2541
+ if (typeof func != 'function') {
2542
+ throw new TypeError(FUNC_ERROR_TEXT);
2543
+ }
2544
+ wait = toNumber(wait) || 0;
2545
+ if (isObject(options)) {
2546
+ leading = !!options.leading;
2547
+ maxing = 'maxWait' in options;
2548
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
2549
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
2550
+ }
2551
+
2552
+ function invokeFunc(time) {
2553
+ var args = lastArgs,
2554
+ thisArg = lastThis;
2555
+
2556
+ lastArgs = lastThis = undefined;
2557
+ lastInvokeTime = time;
2558
+ result = func.apply(thisArg, args);
2559
+ return result;
2560
+ }
2561
+
2562
+ function leadingEdge(time) {
2563
+ // Reset any `maxWait` timer.
2564
+ lastInvokeTime = time;
2565
+ // Start the timer for the trailing edge.
2566
+ timerId = setTimeout(timerExpired, wait);
2567
+ // Invoke the leading edge.
2568
+ return leading ? invokeFunc(time) : result;
2569
+ }
2570
+
2571
+ function remainingWait(time) {
2572
+ var timeSinceLastCall = time - lastCallTime,
2573
+ timeSinceLastInvoke = time - lastInvokeTime,
2574
+ timeWaiting = wait - timeSinceLastCall;
2575
+
2576
+ return maxing
2577
+ ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
2578
+ : timeWaiting;
2579
+ }
2580
+
2581
+ function shouldInvoke(time) {
2582
+ var timeSinceLastCall = time - lastCallTime,
2583
+ timeSinceLastInvoke = time - lastInvokeTime;
2584
+
2585
+ // Either this is the first call, activity has stopped and we're at the
2586
+ // trailing edge, the system time has gone backwards and we're treating
2587
+ // it as the trailing edge, or we've hit the `maxWait` limit.
2588
+ return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
2589
+ (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
2590
+ }
2591
+
2592
+ function timerExpired() {
2593
+ var time = now();
2594
+ if (shouldInvoke(time)) {
2595
+ return trailingEdge(time);
2596
+ }
2597
+ // Restart the timer.
2598
+ timerId = setTimeout(timerExpired, remainingWait(time));
2599
+ }
2600
+
2601
+ function trailingEdge(time) {
2602
+ timerId = undefined;
2603
+
2604
+ // Only invoke if we have `lastArgs` which means `func` has been
2605
+ // debounced at least once.
2606
+ if (trailing && lastArgs) {
2607
+ return invokeFunc(time);
2608
+ }
2609
+ lastArgs = lastThis = undefined;
2610
+ return result;
2611
+ }
2612
+
2613
+ function cancel() {
2614
+ if (timerId !== undefined) {
2615
+ clearTimeout(timerId);
2616
+ }
2617
+ lastInvokeTime = 0;
2618
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
2619
+ }
2620
+
2621
+ function flush() {
2622
+ return timerId === undefined ? result : trailingEdge(now());
2623
+ }
2624
+
2625
+ function debounced() {
2626
+ var time = now(),
2627
+ isInvoking = shouldInvoke(time);
2628
+
2629
+ lastArgs = arguments;
2630
+ lastThis = this;
2631
+ lastCallTime = time;
2632
+
2633
+ if (isInvoking) {
2634
+ if (timerId === undefined) {
2635
+ return leadingEdge(lastCallTime);
2636
+ }
2637
+ if (maxing) {
2638
+ // Handle invocations in a tight loop.
2639
+ clearTimeout(timerId);
2640
+ timerId = setTimeout(timerExpired, wait);
2641
+ return invokeFunc(lastCallTime);
2642
+ }
2643
+ }
2644
+ if (timerId === undefined) {
2645
+ timerId = setTimeout(timerExpired, wait);
2646
+ }
2647
+ return result;
2648
+ }
2649
+ debounced.cancel = cancel;
2650
+ debounced.flush = flush;
2651
+ return debounced;
2652
+ }
2653
+
2654
+ debounce_1 = debounce;
2655
+ return debounce_1;
2656
+ }
2657
+
2658
+ var debounceExports = requireDebounce();
2659
+ var debounce = /*@__PURE__*/getDefaultExportFromCjs(debounceExports);
2660
+
2661
+ const searchCss = "*,*::before,*::after{box-sizing:border-box}ul[class],ol[class]{padding:0}body,h1,h2,h3,h4,p,ul[class],ol[class],li,figure,figcaption,blockquote,dl,dd{margin:0}ul[class],ol[class]{list-style:none}a:not([class]){text-decoration-skip-ink:auto}img{max-width:100%}input,button,textarea,select{font:inherit}@media (prefers-reduced-motion: reduce){*{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:block}:host(:focus) .result.has-results,:host(:focus-within) .result.has-results{display:block}@keyframes display-search-results{0%{opacity:0;transform:translate3d(0, -1.25rem, -1rem) rotateX(10deg)}50%{opacity:1}100%{transform:translate3d(0, 0, 0) rotateX(0)}}.search-box{z-index:1;display:flex;flex-direction:column;position:relative;perspective:60rem}.search-box .result.has-results{animation:display-search-results 0.28s ease-out forwards;position:absolute;background:rgb(var(--kompendium-contrast-200));padding:0.5rem;margin-top:2rem;width:100%;border-radius:5px;box-shadow:var(--kompendium-shadow-depth-16);display:none;max-height:calc(100vh - 6rem);overflow-y:auto}.search-box .result.has-results li a{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;transition:background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out}.search-box .result.has-results li a:hover{box-shadow:var(--kompendium-button-shadow-hovered)}.search-box .result.has-results li a:active{box-shadow:var(--kompendium-button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.search-box .result.has-results li a:focus{outline:none}.search-box .result.has-results li a:focus-visible{outline:none;box-shadow:var(--kompendium-shadow-depth-8-focused)}.search-box .result.has-results li a{display:block;width:100%;padding:0.5rem 0.75rem;border-radius:0.25rem}.search-box .result.has-results li:hover a{background:rgb(var(--kompendium-contrast-100))}input{transition:background-color 0.2s ease;border:0;border-radius:0.25rem;padding:0 0.25rem 0 2.25rem;color:rgb(var(--kompendium-contrast-1200));height:2rem;line-height:2rem;-webkit-appearance:textfield;background-color:rgb(var(--kompendium-contrast-300));background-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" fill-rule=\"evenodd\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"1.5\" clip-rule=\"evenodd\" viewBox=\"0 0 400 400\"><defs/><path fill=\"none\" d=\"M0 0h400v400H0z\"/><path d=\"M275.621 258.31l-16.962 16.979 50.965 50.964.008.009c4.637 4.637 12.268 4.637 16.905 0l.032-.033c4.687-4.687 4.642-12.33.025-16.946l-50.964-50.965-.009-.008z\" fill=\"rgb(48,48,66)\"/><circle cx=\"200\" cy=\"200\" r=\"99.5\" fill=\"rgb(33,150,243)\" fill-opacity=\".3\" stroke=\"rgb(48,48,66)\" stroke-width=\"13.27\" transform=\"translate(19.096 19.096) scale(.90452)\"/><ellipse cx=\"163.443\" cy=\"186.777\" rx=\"32.324\" ry=\"22.133\" fill=\"rgb(255,255,255)\" fill-opacity=\".3\" transform=\"rotate(-45 128.405 173.5)\"/></svg>');background-repeat:no-repeat;background-position:left center}input::placeholder{color:rgb(var(--kompendium-contrast-800))}input:active,input:focus,input:hover{background-color:rgb(var(--kompendium-contrast-200))}input:focus{outline:none}input::-webkit-search-cancel-button{-webkit-appearance:none;transition:background-color 0.2s ease;height:1.25rem;width:1.25rem;border-radius:50%;cursor:pointer;background-color:rgb(var(--kompendium-contrast-800));background-repeat:no-repeat;background-position:center;background-size:0.75rem;background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs/><path fill='rgb(255,255,255)' d='M7.219 5.781L5.78 7.22 14.563 16 5.78 24.781 7.22 26.22 16 17.437l8.781 8.782 1.438-1.438L17.437 16l8.782-8.781L24.78 5.78 16 14.563z'/></svg>\")}input::-webkit-search-cancel-button:hover{background-color:rgb(var(--kompendium-contrast-1000))}a{text-decoration:none;color:unset}a:hover,a.active{color:rgb(var(--kompendium-color-blue-default))}";
2662
+
2663
+ const Search = class {
2664
+ constructor(hostRef) {
2665
+ registerInstance(this, hostRef);
2666
+ this.documents = [];
2667
+ this.renderDocument = (document) => {
2668
+ return (h("li", null, h("a", { href: '#' + document.path, onClick: this.handleLinkClick }, h("span", { class: "link-text" }, document.title))));
2669
+ };
2670
+ this.handleChangeInput = (event) => {
2671
+ const query = event.target.value;
2672
+ this.search(query);
2673
+ };
2674
+ this.handleLinkClick = () => {
2675
+ var _a;
2676
+ (_a = this.host.shadowRoot.activeElement) === null || _a === void 0 ? void 0 : _a.blur();
2677
+ };
2678
+ this.search = debounce(this.search, 300);
2679
+ }
2680
+ componentDidLoad() {
2681
+ this.host.shadowRoot.querySelector('input').focus();
2682
+ }
2683
+ render() {
2684
+ const classList = {
2685
+ result: true,
2686
+ 'has-results': this.documents.length > 0,
2687
+ };
2688
+ return (h("div", { key: '8085f45b0d1f5e7b50d20de0df3aa95068598fa2', class: "search-box" }, h("input", { key: 'cc001b093b727306c6ea4e8ac078a4f408a0a6c9', type: "search", autoFocus: true, placeholder: "Search", onInput: this.handleChangeInput }), h("ul", { key: '7b293d633cd2493c85db58d84f8308e98061ab42', class: classList }, this.documents.map(this.renderDocument))));
2689
+ }
2690
+ search(query) {
2691
+ const index = this.index;
2692
+ const result = index.search(query);
2693
+ this.documents = result.map((doc) => doc.item).slice(0, 10);
2694
+ }
2695
+ get host() { return getElement(this); }
2696
+ };
2697
+ Search.style = searchCss;
2698
+
2699
+ /**
2700
+ * Cache for parsed route patterns to avoid redundant regex compilation
2701
+ */
2702
+ const routeCache = new Map();
2703
+ /**
2704
+ * Parse route URL pattern into regex and parameter names
2705
+ * @param {string} pattern - Route pattern with optional parameters (e.g., "/component/:name")
2706
+ * @returns {{regex: RegExp, params: string[]}} Regex and parameter names
2707
+ */
2708
+ function parseRoute(pattern) {
2709
+ const params = [];
2710
+ // First, collect all parameters in order they appear
2711
+ // Match both required (:param) and optional (:param?) parameters
2712
+ const paramMatches = pattern.match(/:(\w+)\??/g) || [];
2713
+ paramMatches.forEach((match) => {
2714
+ const paramName = match.replace(/^:|[?]/g, '');
2715
+ params.push(paramName);
2716
+ });
2717
+ // Then build the regex pattern
2718
+ // Process optional params with their slashes first (before escaping slashes)
2719
+ // This makes both the slash AND the parameter value optional
2720
+ const regexPattern = pattern
2721
+ .replace(/\/:(\w+)\?/g, '___OPTIONAL_PARAM_$1___') // Mark optional params with slash
2722
+ .replace(/\//g, '\\/') // Escape remaining slashes
2723
+ .replace(/___OPTIONAL_PARAM_(\w+)___/g, '(?:\\/([^/]*))?') // Optional slash + param
2724
+ .replace(/:(\w+)/g, '([^/]+)'); // Required param
2725
+ const regex = new RegExp(`^${regexPattern}\\/?$`);
2726
+ return { regex: regex, params: params };
2727
+ }
2728
+ /**
2729
+ * Match a path against a route pattern
2730
+ * @param {string} path - Current path to match
2731
+ * @param {string} pattern - Route pattern to match against
2732
+ * @returns {MatchResults | null} Match results with parameters or null if no match
2733
+ */
2734
+ function matchRoute(path, pattern) {
2735
+ if (!pattern) {
2736
+ return { params: {} };
2737
+ }
2738
+ // Check cache first, or parse and cache if not found
2739
+ let parsed = routeCache.get(pattern);
2740
+ if (!parsed) {
2741
+ parsed = parseRoute(pattern);
2742
+ routeCache.set(pattern, parsed);
2743
+ }
2744
+ const { regex, params } = parsed;
2745
+ const match = path.match(regex);
2746
+ if (!match) {
2747
+ return null;
2748
+ }
2749
+ const matchParams = {};
2750
+ params.forEach((param, index) => {
2751
+ matchParams[param] = match[index + 1] || '';
2752
+ });
2753
+ return { params: matchParams };
2754
+ }
2755
+ /**
2756
+ * Get current hash path
2757
+ * @returns {string} Current hash path from URL
2758
+ */
2759
+ function getHashPath() {
2760
+ return location.hash.substring(1) || '/';
2761
+ }
2762
+
2763
+ /**
2764
+ * Type guard to check if an element is a route element
2765
+ * @param {Element} element - The element to check
2766
+ * @returns {boolean} True if the element is a stencil-route
2767
+ */
2768
+ function isRouteElement(element) {
2769
+ return element.tagName.toLowerCase() === 'stencil-route';
2770
+ }
2771
+ /**
2772
+ * Check if any previous sibling route matches the current path
2773
+ * Used by route-switch to implement first-match-wins behavior
2774
+ * @param {HTMLElement} currentElement - The current route element
2775
+ * @param {string} currentPath - The current path to match
2776
+ * @returns {boolean} True if a previous sibling route matches
2777
+ */
2778
+ function hasPreviousMatchingSibling(currentElement, currentPath) {
2779
+ const parent = currentElement.parentElement;
2780
+ if ((parent === null || parent === void 0 ? void 0 : parent.tagName.toLowerCase()) !== 'stencil-route-switch') {
2781
+ return false;
2782
+ }
2783
+ const siblings = Array.from(parent.children);
2784
+ const myIndex = siblings.indexOf(currentElement);
2785
+ // Check all previous siblings
2786
+ for (let i = 0; i < myIndex; i++) {
2787
+ const sibling = siblings[i];
2788
+ // Use type guard to ensure element has expected route properties
2789
+ if (!isRouteElement(sibling)) {
2790
+ continue;
2791
+ }
2792
+ // Access sibling's URL property with type safety
2793
+ const siblingUrl = sibling.url;
2794
+ // Check if sibling matches current path
2795
+ let siblingMatch;
2796
+ if (siblingUrl) {
2797
+ siblingMatch = matchRoute(currentPath, siblingUrl);
2798
+ }
2799
+ else {
2800
+ siblingMatch = { params: {} }; // Routes without URL are catch-all
2801
+ }
2802
+ if (siblingMatch) {
2803
+ return true;
2804
+ }
2805
+ }
2806
+ return false;
2807
+ }
2808
+
2809
+ /**
2810
+ * Generate a stable key from route parameters for component recreation
2811
+ * Keys are deterministic - same params always produce same key
2812
+ * Used to force Stencil component recreation when route params change
2813
+ * @param {Record<string, string>} params - Route parameters
2814
+ * @returns {string} A stable, deterministic key
2815
+ */
2816
+ function generateComponentKey(params) {
2817
+ return Object.keys(params)
2818
+ .sort()
2819
+ .map((k) => `${k}=${params[k]}`)
2820
+ .join('&');
2821
+ }
2822
+
2823
+ const StencilRoute = class {
2824
+ constructor(hostRef) {
2825
+ registerInstance(this, hostRef);
2826
+ this.currentPath = '/';
2827
+ this.handleHashChange = this.handleHashChange.bind(this);
2828
+ }
2829
+ connectedCallback() {
2830
+ window.addEventListener('hashchange', this.handleHashChange);
2831
+ this.handleHashChange();
2832
+ }
2833
+ disconnectedCallback() {
2834
+ window.removeEventListener('hashchange', this.handleHashChange);
2835
+ }
2836
+ handleHashChange() {
2837
+ this.currentPath = getHashPath();
2838
+ }
2839
+ render() {
2840
+ // Element should always be available in render, but guard defensively
2841
+ if (!this.el) {
2842
+ return null;
2843
+ }
2844
+ // Check if a previous sibling route matches (first-match wins)
2845
+ if (hasPreviousMatchingSibling(this.el, this.currentPath)) {
2846
+ return null;
2847
+ }
2848
+ // Check if this route matches
2849
+ let match;
2850
+ if (this.url) {
2851
+ match = matchRoute(this.currentPath, this.url);
2852
+ }
2853
+ else {
2854
+ match = { params: {} }; // Catch-all route
2855
+ }
2856
+ if (!match) {
2857
+ return null;
2858
+ }
2859
+ // Render the matched route
2860
+ if (this.routeRender) {
2861
+ return this.routeRender({ match: match });
2862
+ }
2863
+ if (this.component) {
2864
+ const props = Object.assign(Object.assign({}, this.componentProps), { match: match });
2865
+ // Create element dynamically using h() with string tag name
2866
+ // Use match params as key to force recreation when params change
2867
+ const key = generateComponentKey(match.params);
2868
+ return h(this.component, Object.assign({ key: key }, props));
2869
+ }
2870
+ return h("slot", null);
2871
+ }
2872
+ get el() { return getElement(this); }
2873
+ };
2874
+
2875
+ const StencilRouteSwitch = class {
2876
+ constructor(hostRef) {
2877
+ registerInstance(this, hostRef);
2878
+ this.scrollTopOffset = 0;
2879
+ this.currentPath = '/';
2880
+ this.handleHashChange = this.handleHashChange.bind(this);
2881
+ }
2882
+ connectedCallback() {
2883
+ window.addEventListener('hashchange', this.handleHashChange);
2884
+ this.handleHashChange();
2885
+ }
2886
+ disconnectedCallback() {
2887
+ window.removeEventListener('hashchange', this.handleHashChange);
2888
+ }
2889
+ handleHashChange() {
2890
+ const newPath = getHashPath();
2891
+ if (newPath !== this.currentPath) {
2892
+ this.currentPath = newPath;
2893
+ if (this.scrollTopOffset !== undefined) {
2894
+ window.scrollTo(0, this.scrollTopOffset);
2895
+ }
2896
+ }
2897
+ }
2898
+ render() {
2899
+ // Simply render child routes
2900
+ // The @State currentPath will trigger re-render when hash changes
2901
+ // Each route component will re-render and check if it matches
2902
+ return h("slot", { key: '140c65d5b8e395cebfe132763f26a304d217863e' });
2903
+ }
2904
+ };
2905
+
2906
+ const StencilRouter = class {
2907
+ constructor(hostRef) {
2908
+ registerInstance(this, hostRef);
2909
+ }
2910
+ render() {
2911
+ return h("slot", { key: '6e145f4a847376de82972e4b1420d28cb86f4f8c' });
2912
+ }
2913
+ };
2914
+
2915
+ export { App as kompendium_app, DarkmodeSwitch as kompendium_darkmode_switch, Navigation as kompendium_navigation, Search as kompendium_search, StencilRoute as stencil_route, StencilRouteSwitch as stencil_route_switch, StencilRouter as stencil_router };
2916
+ //# sourceMappingURL=kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.js.map