@microsoft/fast-element 2.10.3 → 3.0.0-rc.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 (351) hide show
  1. package/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md +1 -1
  2. package/ARCHITECTURE_OVERVIEW.md +2 -2
  3. package/CHANGELOG.json +31 -1
  4. package/CHANGELOG.md +10 -2
  5. package/DECLARATIVE_DESIGN.md +806 -0
  6. package/DECLARATIVE_HTML.md +470 -0
  7. package/DECLARATIVE_MIGRATION.md +215 -0
  8. package/DECLARATIVE_RENDERING.md +530 -0
  9. package/DECLARATIVE_RENDERING_LIFECYCLE.md +288 -0
  10. package/DECLARATIVE_SCHEMA_OBSERVER_MAP.md +489 -0
  11. package/DESIGN.md +143 -34
  12. package/MIGRATION.md +387 -0
  13. package/README.md +208 -1
  14. package/SIZES.md +25 -0
  15. package/api-extractor.arrays.json +15 -0
  16. package/api-extractor.context.json +1 -0
  17. package/api-extractor.declarative.json +15 -0
  18. package/api-extractor.di.json +1 -0
  19. package/api-extractor.hydration.json +15 -0
  20. package/api-extractor.styles.json +15 -0
  21. package/dist/arrays/arrays.api.json +2621 -0
  22. package/dist/context/context.api.json +1 -1
  23. package/dist/declarative/declarative.api.json +7844 -0
  24. package/dist/di/di.api.json +2 -2
  25. package/dist/dts/array-observer.d.ts +2 -0
  26. package/dist/dts/arrays.d.ts +2 -0
  27. package/dist/dts/attr.d.ts +1 -0
  28. package/dist/dts/binding/signal.d.ts +6 -6
  29. package/dist/dts/binding/two-way.d.ts +1 -0
  30. package/dist/dts/binding.d.ts +7 -0
  31. package/dist/dts/components/attributes.d.ts +2 -5
  32. package/dist/dts/components/definition-schema-transforms.d.ts +9 -0
  33. package/dist/dts/components/element-controller.d.ts +80 -114
  34. package/dist/dts/components/element-hydration.d.ts +1 -1
  35. package/dist/dts/components/enable-hydration.d.ts +34 -0
  36. package/dist/dts/components/fast-definitions.d.ts +91 -42
  37. package/dist/dts/components/fast-element.d.ts +5 -8
  38. package/dist/dts/components/hydration-tracker.d.ts +40 -0
  39. package/dist/dts/components/hydration.d.ts +18 -53
  40. package/dist/dts/components/schema.d.ts +205 -0
  41. package/dist/dts/context.d.ts +6 -6
  42. package/dist/dts/css.d.ts +3 -0
  43. package/dist/dts/debug.d.ts +5 -1
  44. package/dist/dts/declarative/attribute-map.d.ts +58 -0
  45. package/dist/dts/declarative/debug.d.ts +5 -0
  46. package/dist/dts/declarative/index.d.ts +13 -0
  47. package/dist/dts/declarative/interfaces.d.ts +9 -0
  48. package/dist/dts/declarative/observer-map-utilities.d.ts +58 -0
  49. package/dist/dts/declarative/observer-map.d.ts +89 -0
  50. package/dist/dts/declarative/runtime.d.ts +5 -0
  51. package/dist/dts/declarative/syntax.d.ts +21 -0
  52. package/dist/dts/declarative/template-bridge.d.ts +33 -0
  53. package/dist/dts/declarative/template-parser.d.ts +98 -0
  54. package/dist/dts/declarative/template.d.ts +9 -0
  55. package/dist/dts/declarative/utilities.d.ts +312 -0
  56. package/dist/dts/di/di.d.ts +1 -1
  57. package/dist/dts/directives/children.d.ts +2 -0
  58. package/dist/dts/directives/node-observation.d.ts +2 -0
  59. package/dist/dts/directives/ref.d.ts +2 -0
  60. package/dist/dts/directives/repeat.d.ts +4 -0
  61. package/dist/dts/directives/slotted.d.ts +2 -0
  62. package/dist/dts/directives/when.d.ts +3 -0
  63. package/dist/dts/dom-policy.d.ts +1 -1
  64. package/dist/dts/html.d.ts +5 -0
  65. package/dist/dts/hydration/runtime.d.ts +7 -0
  66. package/dist/dts/hydration/target-builder.d.ts +15 -12
  67. package/dist/dts/hydration.d.ts +14 -0
  68. package/dist/dts/index.d.ts +38 -42
  69. package/dist/dts/index.debug.d.ts +0 -1
  70. package/dist/dts/index.rollup.debug.d.ts +0 -1
  71. package/dist/dts/interfaces.d.ts +1 -49
  72. package/dist/dts/observable.d.ts +3 -6
  73. package/dist/dts/observation/arrays.d.ts +1 -1
  74. package/dist/dts/observation/update-queue.d.ts +1 -1
  75. package/dist/dts/platform.d.ts +25 -4
  76. package/dist/dts/render.d.ts +7 -0
  77. package/dist/dts/schema.d.ts +1 -0
  78. package/dist/dts/state/exports.d.ts +1 -1
  79. package/dist/dts/state/state.d.ts +2 -2
  80. package/dist/dts/styles/css-directive.d.ts +5 -12
  81. package/dist/dts/styles/css.d.ts +5 -7
  82. package/dist/dts/styles/element-styles.d.ts +0 -10
  83. package/dist/dts/styles.d.ts +6 -0
  84. package/dist/dts/templating/children.d.ts +1 -1
  85. package/dist/dts/templating/html-binding-directive.d.ts +10 -0
  86. package/dist/dts/templating/html-directive.d.ts +17 -0
  87. package/dist/dts/templating/hydration-view.d.ts +109 -0
  88. package/dist/dts/templating/ref.d.ts +1 -1
  89. package/dist/dts/templating/render.d.ts +8 -2
  90. package/dist/dts/templating/repeat.d.ts +2 -2
  91. package/dist/dts/templating/slotted.d.ts +1 -1
  92. package/dist/dts/templating/template.d.ts +17 -9
  93. package/dist/dts/templating/view.d.ts +25 -102
  94. package/dist/dts/templating/when.d.ts +1 -1
  95. package/dist/dts/templating.d.ts +10 -0
  96. package/dist/dts/testing/exports.d.ts +2 -2
  97. package/dist/dts/tsdoc-metadata.json +1 -1
  98. package/dist/dts/updates.d.ts +1 -0
  99. package/dist/dts/volatile.d.ts +2 -0
  100. package/dist/esm/array-observer.js +1 -0
  101. package/dist/esm/arrays.js +1 -0
  102. package/dist/esm/attr.js +1 -0
  103. package/dist/esm/binding/normalize.js +1 -1
  104. package/dist/esm/binding/signal.js +4 -4
  105. package/dist/esm/binding/two-way.js +2 -1
  106. package/dist/esm/binding.js +4 -0
  107. package/dist/esm/components/attributes.js +8 -5
  108. package/dist/esm/components/definition-schema-transforms.js +23 -0
  109. package/dist/esm/components/element-controller.js +200 -269
  110. package/dist/esm/components/element-hydration.js +1 -1
  111. package/dist/esm/components/enable-hydration.js +100 -0
  112. package/dist/esm/components/fast-definitions.js +211 -49
  113. package/dist/esm/components/fast-element.js +18 -27
  114. package/dist/esm/components/hydration-tracker.js +93 -0
  115. package/dist/esm/components/hydration.js +62 -144
  116. package/dist/esm/components/schema.js +253 -0
  117. package/dist/esm/context.js +6 -6
  118. package/dist/esm/css.js +3 -0
  119. package/dist/esm/debug.js +26 -26
  120. package/dist/esm/declarative/attribute-map.js +121 -0
  121. package/dist/esm/declarative/debug.js +5 -0
  122. package/dist/esm/declarative/index.js +3 -0
  123. package/dist/esm/declarative/interfaces.js +10 -0
  124. package/dist/esm/declarative/observer-map-utilities.js +562 -0
  125. package/dist/esm/declarative/observer-map.js +216 -0
  126. package/dist/esm/declarative/runtime.js +14 -0
  127. package/dist/esm/declarative/syntax.js +36 -0
  128. package/dist/esm/declarative/template-bridge.js +170 -0
  129. package/dist/esm/declarative/template-parser.js +306 -0
  130. package/dist/esm/declarative/template.js +142 -0
  131. package/dist/esm/declarative/utilities.js +834 -0
  132. package/dist/esm/di/di.js +6 -8
  133. package/dist/esm/directives/children.js +1 -0
  134. package/dist/esm/directives/node-observation.js +1 -0
  135. package/dist/esm/directives/ref.js +1 -0
  136. package/dist/esm/directives/repeat.js +1 -0
  137. package/dist/esm/directives/slotted.js +1 -0
  138. package/dist/esm/directives/when.js +1 -0
  139. package/dist/esm/dom-policy.js +2 -2
  140. package/dist/esm/dom.js +1 -1
  141. package/dist/esm/html.js +2 -0
  142. package/dist/esm/hydration/runtime.js +33 -0
  143. package/dist/esm/hydration/target-builder.js +97 -90
  144. package/dist/esm/hydration.js +4 -0
  145. package/dist/esm/index.debug.js +2 -1
  146. package/dist/esm/index.js +34 -29
  147. package/dist/esm/index.rollup.debug.js +3 -2
  148. package/dist/esm/index.rollup.js +1 -1
  149. package/dist/esm/interfaces.js +1 -45
  150. package/dist/esm/observable.js +1 -4
  151. package/dist/esm/observation/arrays.js +1 -1
  152. package/dist/esm/observation/observable.js +5 -5
  153. package/dist/esm/observation/update-queue.js +47 -58
  154. package/dist/esm/platform.js +31 -30
  155. package/dist/esm/render.js +1 -0
  156. package/dist/esm/schema.js +1 -0
  157. package/dist/esm/state/exports.js +1 -1
  158. package/dist/esm/styles/css-directive.js +1 -2
  159. package/dist/esm/styles/css.js +15 -56
  160. package/dist/esm/styles/element-styles.js +69 -15
  161. package/dist/esm/styles.js +2 -0
  162. package/dist/esm/templating/html-binding-directive.js +24 -10
  163. package/dist/esm/templating/hydration-view.js +235 -0
  164. package/dist/esm/templating/render.js +13 -2
  165. package/dist/esm/templating/repeat.js +36 -34
  166. package/dist/esm/templating/template.js +7 -7
  167. package/dist/esm/templating/view.js +24 -233
  168. package/dist/esm/templating.js +7 -0
  169. package/dist/esm/testing/exports.js +2 -2
  170. package/dist/esm/updates.js +1 -0
  171. package/dist/esm/volatile.js +1 -0
  172. package/dist/fast-element.api.json +9017 -6996
  173. package/dist/fast-element.d.ts +3557 -796
  174. package/dist/fast-element.debug.js +5093 -4419
  175. package/dist/fast-element.debug.min.js +2 -2
  176. package/dist/fast-element.js +5398 -4655
  177. package/dist/fast-element.min.js +2 -2
  178. package/dist/fast-element.untrimmed.d.ts +881 -481
  179. package/dist/hydration/hydration.api.json +5237 -0
  180. package/dist/styles/styles.api.json +2672 -0
  181. package/docs/api-report.api.md +344 -167
  182. package/docs/arrays/api-report.api.md +114 -0
  183. package/docs/declarative/api-report.api.md +397 -0
  184. package/docs/hydration/api-report.api.md +285 -0
  185. package/docs/styles/api-report.api.md +135 -0
  186. package/package.json +149 -40
  187. package/playwright.declarative.config.ts +26 -0
  188. package/playwright.declarative.webui.config.ts +20 -0
  189. package/scripts/declarative/build-fixtures-with-webui.js +135 -0
  190. package/scripts/declarative/build-fixtures.js +49 -0
  191. package/scripts/declarative/build-fixtures.utilities.js +101 -0
  192. package/scripts/measure-sizes.js +219 -0
  193. package/scripts/run-api-extractor.js +39 -20
  194. package/test/declarative/fixtures/README.md +72 -0
  195. package/test/declarative/fixtures/WRITING_FIXTURES.md +330 -0
  196. package/test/declarative/fixtures/bindings/README.md +12 -0
  197. package/test/declarative/fixtures/bindings/attribute/entry.html +13 -0
  198. package/test/declarative/fixtures/bindings/attribute/fast-build.config.json +6 -0
  199. package/test/declarative/fixtures/bindings/attribute/index.html +25 -0
  200. package/test/declarative/fixtures/bindings/attribute/main.ts +41 -0
  201. package/test/declarative/fixtures/bindings/attribute/state.json +8 -0
  202. package/test/declarative/fixtures/bindings/attribute/templates.html +11 -0
  203. package/test/declarative/fixtures/bindings/content/entry.html +12 -0
  204. package/test/declarative/fixtures/bindings/content/fast-build.config.json +6 -0
  205. package/test/declarative/fixtures/bindings/content/index.html +19 -0
  206. package/test/declarative/fixtures/bindings/content/main.ts +27 -0
  207. package/test/declarative/fixtures/bindings/content/state.json +4 -0
  208. package/test/declarative/fixtures/bindings/content/templates.html +6 -0
  209. package/test/declarative/fixtures/bindings/dot-syntax/entry.html +11 -0
  210. package/test/declarative/fixtures/bindings/dot-syntax/fast-build.config.json +6 -0
  211. package/test/declarative/fixtures/bindings/dot-syntax/index.html +47 -0
  212. package/test/declarative/fixtures/bindings/dot-syntax/main.ts +59 -0
  213. package/test/declarative/fixtures/bindings/dot-syntax/state.json +16 -0
  214. package/test/declarative/fixtures/bindings/dot-syntax/templates.html +17 -0
  215. package/test/declarative/fixtures/bindings/event/entry.html +11 -0
  216. package/test/declarative/fixtures/bindings/event/fast-build.config.json +6 -0
  217. package/test/declarative/fixtures/bindings/event/index.html +43 -0
  218. package/test/declarative/fixtures/bindings/event/main.ts +43 -0
  219. package/test/declarative/fixtures/bindings/event/state.json +3 -0
  220. package/test/declarative/fixtures/bindings/event/templates.html +18 -0
  221. package/test/declarative/fixtures/bindings/host/entry.html +40 -0
  222. package/test/declarative/fixtures/bindings/host/fast-build.config.json +6 -0
  223. package/test/declarative/fixtures/bindings/host/index.html +96 -0
  224. package/test/declarative/fixtures/bindings/host/main.ts +222 -0
  225. package/test/declarative/fixtures/bindings/host/state.json +9 -0
  226. package/test/declarative/fixtures/bindings/host/templates.html +55 -0
  227. package/test/declarative/fixtures/directives/README.md +12 -0
  228. package/test/declarative/fixtures/directives/children/entry.html +11 -0
  229. package/test/declarative/fixtures/directives/children/fast-build.config.json +6 -0
  230. package/test/declarative/fixtures/directives/children/index.html +15 -0
  231. package/test/declarative/fixtures/directives/children/main.ts +22 -0
  232. package/test/declarative/fixtures/directives/children/state.json +3 -0
  233. package/test/declarative/fixtures/directives/children/templates.html +3 -0
  234. package/test/declarative/fixtures/directives/ref/entry.html +11 -0
  235. package/test/declarative/fixtures/directives/ref/fast-build.config.json +6 -0
  236. package/test/declarative/fixtures/directives/ref/index.html +15 -0
  237. package/test/declarative/fixtures/directives/ref/main.ts +17 -0
  238. package/test/declarative/fixtures/directives/ref/state.json +1 -0
  239. package/test/declarative/fixtures/directives/ref/templates.html +3 -0
  240. package/test/declarative/fixtures/directives/repeat/entry.html +21 -0
  241. package/test/declarative/fixtures/directives/repeat/fast-build.config.json +6 -0
  242. package/test/declarative/fixtures/directives/repeat/index.html +133 -0
  243. package/test/declarative/fixtures/directives/repeat/main.ts +110 -0
  244. package/test/declarative/fixtures/directives/repeat/sprites.svg +8 -0
  245. package/test/declarative/fixtures/directives/repeat/state.json +10 -0
  246. package/test/declarative/fixtures/directives/repeat/templates.html +75 -0
  247. package/test/declarative/fixtures/directives/slotted/entry.html +17 -0
  248. package/test/declarative/fixtures/directives/slotted/fast-build.config.json +6 -0
  249. package/test/declarative/fixtures/directives/slotted/index.html +27 -0
  250. package/test/declarative/fixtures/directives/slotted/main.ts +29 -0
  251. package/test/declarative/fixtures/directives/slotted/state.json +1 -0
  252. package/test/declarative/fixtures/directives/slotted/templates.html +7 -0
  253. package/test/declarative/fixtures/directives/when/entry.html +51 -0
  254. package/test/declarative/fixtures/directives/when/fast-build.config.json +6 -0
  255. package/test/declarative/fixtures/directives/when/index.html +136 -0
  256. package/test/declarative/fixtures/directives/when/main.ts +172 -0
  257. package/test/declarative/fixtures/directives/when/state.json +12 -0
  258. package/test/declarative/fixtures/directives/when/templates.html +75 -0
  259. package/test/declarative/fixtures/ecosystem/README.md +11 -0
  260. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/entry.html +12 -0
  261. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/fast-build.config.json +6 -0
  262. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/index.html +20 -0
  263. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/main.ts +68 -0
  264. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/state.json +4 -0
  265. package/test/declarative/fixtures/ecosystem/declarative-no-hydration/templates.html +7 -0
  266. package/test/declarative/fixtures/ecosystem/errors/entry.html +12 -0
  267. package/test/declarative/fixtures/ecosystem/errors/fast-build.config.json +6 -0
  268. package/test/declarative/fixtures/ecosystem/errors/index.html +20 -0
  269. package/test/declarative/fixtures/ecosystem/errors/main.ts +17 -0
  270. package/test/declarative/fixtures/ecosystem/errors/state.json +1 -0
  271. package/test/declarative/fixtures/ecosystem/errors/templates.html +7 -0
  272. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/entry.html +17 -0
  273. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/fast-build.config.json +6 -0
  274. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/index.html +56 -0
  275. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/main.ts +134 -0
  276. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/state.json +12 -0
  277. package/test/declarative/fixtures/ecosystem/lifecycle-callbacks/templates.html +34 -0
  278. package/test/declarative/fixtures/ecosystem/performance-metrics/entry.html +25 -0
  279. package/test/declarative/fixtures/ecosystem/performance-metrics/fast-build.config.json +6 -0
  280. package/test/declarative/fixtures/ecosystem/performance-metrics/fast-card.css +10 -0
  281. package/test/declarative/fixtures/ecosystem/performance-metrics/index.html +181 -0
  282. package/test/declarative/fixtures/ecosystem/performance-metrics/main.ts +58 -0
  283. package/test/declarative/fixtures/ecosystem/performance-metrics/state.json +6 -0
  284. package/test/declarative/fixtures/ecosystem/performance-metrics/templates.html +15 -0
  285. package/test/declarative/fixtures/extensions/README.md +15 -0
  286. package/test/declarative/fixtures/extensions/attribute-map/entry.html +14 -0
  287. package/test/declarative/fixtures/extensions/attribute-map/fast-build.config.json +6 -0
  288. package/test/declarative/fixtures/extensions/attribute-map/index.html +31 -0
  289. package/test/declarative/fixtures/extensions/attribute-map/main.ts +40 -0
  290. package/test/declarative/fixtures/extensions/attribute-map/state.json +4 -0
  291. package/test/declarative/fixtures/extensions/attribute-map/templates.html +14 -0
  292. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/entry.html +12 -0
  293. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/fast-build.config.json +7 -0
  294. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/index.html +25 -0
  295. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/main.ts +31 -0
  296. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/state.json +5 -0
  297. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy/templates.html +11 -0
  298. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/entry.html +13 -0
  299. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/fast-build.config.json +7 -0
  300. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/index.html +23 -0
  301. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/main.ts +37 -0
  302. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/state.json +1 -0
  303. package/test/declarative/fixtures/extensions/attribute-map-naming-strategy-camel-case/templates.html +9 -0
  304. package/test/declarative/fixtures/extensions/observer-map/entry.html +15 -0
  305. package/test/declarative/fixtures/extensions/observer-map/fast-build.config.json +6 -0
  306. package/test/declarative/fixtures/extensions/observer-map/index.html +442 -0
  307. package/test/declarative/fixtures/extensions/observer-map/main.ts +482 -0
  308. package/test/declarative/fixtures/extensions/observer-map/state.json +158 -0
  309. package/test/declarative/fixtures/extensions/observer-map/templates.html +172 -0
  310. package/test/declarative/fixtures/extensions/observer-map-config-object/entry.html +16 -0
  311. package/test/declarative/fixtures/extensions/observer-map-config-object/fast-build.config.json +6 -0
  312. package/test/declarative/fixtures/extensions/observer-map-config-object/index.html +27 -0
  313. package/test/declarative/fixtures/extensions/observer-map-config-object/main.ts +53 -0
  314. package/test/declarative/fixtures/extensions/observer-map-config-object/state.json +9 -0
  315. package/test/declarative/fixtures/extensions/observer-map-config-object/templates.html +12 -0
  316. package/test/declarative/fixtures/extensions/observer-map-deep-merge/README.md +98 -0
  317. package/test/declarative/fixtures/extensions/observer-map-deep-merge/entry.html +156 -0
  318. package/test/declarative/fixtures/extensions/observer-map-deep-merge/fast-build.config.json +6 -0
  319. package/test/declarative/fixtures/extensions/observer-map-deep-merge/index.html +376 -0
  320. package/test/declarative/fixtures/extensions/observer-map-deep-merge/main.ts +366 -0
  321. package/test/declarative/fixtures/extensions/observer-map-deep-merge/state.json +69 -0
  322. package/test/declarative/fixtures/extensions/observer-map-deep-merge/templates.html +91 -0
  323. package/test/declarative/fixtures/extensions/observer-map-properties/entry.html +14 -0
  324. package/test/declarative/fixtures/extensions/observer-map-properties/fast-build.config.json +6 -0
  325. package/test/declarative/fixtures/extensions/observer-map-properties/index.html +110 -0
  326. package/test/declarative/fixtures/extensions/observer-map-properties/main.ts +175 -0
  327. package/test/declarative/fixtures/extensions/observer-map-properties/state.json +29 -0
  328. package/test/declarative/fixtures/extensions/observer-map-properties/templates.html +55 -0
  329. package/test/declarative/fixtures/scenarios/README.md +7 -0
  330. package/test/declarative/fixtures/scenarios/nested-elements/entry.html +16 -0
  331. package/test/declarative/fixtures/scenarios/nested-elements/fast-build.config.json +6 -0
  332. package/test/declarative/fixtures/scenarios/nested-elements/index.html +126 -0
  333. package/test/declarative/fixtures/scenarios/nested-elements/main.ts +214 -0
  334. package/test/declarative/fixtures/scenarios/nested-elements/state.json +10 -0
  335. package/test/declarative/fixtures/scenarios/nested-elements/templates.html +54 -0
  336. package/test/declarative/index.html +12 -0
  337. package/test/declarative/vite.config.ts +55 -0
  338. package/test/declarative-main.ts +6 -0
  339. package/test/extension-subpaths-main.ts +9 -0
  340. package/test/main.ts +38 -33
  341. package/test/pure-declarative-main.ts +1 -0
  342. package/dist/dts/components/install-hydration.d.ts +0 -1
  343. package/dist/dts/pending-task.d.ts +0 -32
  344. package/dist/dts/polyfills.d.ts +0 -0
  345. package/dist/dts/styles/css-binding-directive.d.ts +0 -60
  346. package/dist/dts/templating/install-hydratable-view-templates.d.ts +0 -1
  347. package/dist/esm/components/install-hydration.js +0 -3
  348. package/dist/esm/pending-task.js +0 -28
  349. package/dist/esm/polyfills.js +0 -60
  350. package/dist/esm/styles/css-binding-directive.js +0 -76
  351. package/dist/esm/templating/install-hydratable-view-templates.js +0 -23
@@ -1,3 +1,3 @@
1
- void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call ArrayObserver.enable() before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1209:"'${aspectName}' on '${tagName}' is blocked by the current DOMPolicy.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement.",1601:"Invalid attribute marker name: ${name}. Expected format is ${expectedFormat}.",1602:"Invalid compact attribute marker values in ${markerName}. Both index and count must be positive integers.",1604:"Invalid compact attribute marker name: ${name}. Expected format is ${expectedFormat}."},n=/(\$\{\w+?})/g,s=/\$\{(\w+?)}/g,i=Object.freeze({});function r(e,t){return e.split(n).map((e=>{var n;const i=e.replace(s,"$1");return String(null!==(n=t[i])&&void 0!==n?n:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,n=i){var s;const o=null!==(s=t[e])&&void 0!==s?s:"Unknown Warning";console.warn(r(o,n))},error(e,n=i){var s;const o=null!==(s=t[e])&&void 0!==s?s:"Unknown Error";return new Error(r(o,n))}});const a="fast-kernel";try{if(document.currentScript)o=document.currentScript.getAttribute(a);else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute(a)}}catch(e){o="isolate"}let l;switch(o){case"share":l=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":l=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;l=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}var c;!function(e){e[e.needsArrayObservation=1101]="needsArrayObservation",e[e.onlySetDOMPolicyOnce=1201]="onlySetDOMPolicyOnce",e[e.bindingInnerHTMLRequiresTrustedTypes=1202]="bindingInnerHTMLRequiresTrustedTypes",e[e.twoWayBindingRequiresObservables=1203]="twoWayBindingRequiresObservables",e[e.hostBindingWithoutHost=1204]="hostBindingWithoutHost",e[e.unsupportedBindingBehavior=1205]="unsupportedBindingBehavior",e[e.directCallToHTMLTagNotAllowed=1206]="directCallToHTMLTagNotAllowed",e[e.onlySetTemplatePolicyOnce=1207]="onlySetTemplatePolicyOnce",e[e.cannotSetTemplatePolicyAfterCompilation=1208]="cannotSetTemplatePolicyAfterCompilation",e[e.blockedByDOMPolicy=1209]="blockedByDOMPolicy",e[e.missingElementDefinition=1401]="missingElementDefinition",e[e.noRegistrationForContext=1501]="noRegistrationForContext",e[e.noFactoryForResolver=1502]="noFactoryForResolver",e[e.invalidResolverStrategy=1503]="invalidResolverStrategy",e[e.cannotAutoregisterDependency=1504]="cannotAutoregisterDependency",e[e.cannotResolveKey=1505]="cannotResolveKey",e[e.cannotConstructNativeFunction=1506]="cannotConstructNativeFunction",e[e.cannotJITRegisterNonConstructor=1507]="cannotJITRegisterNonConstructor",e[e.cannotJITRegisterIntrinsic=1508]="cannotJITRegisterIntrinsic",e[e.cannotJITRegisterInterface=1509]="cannotJITRegisterInterface",e[e.invalidResolver=1510]="invalidResolver",e[e.invalidKey=1511]="invalidKey",e[e.noDefaultResolver=1512]="noDefaultResolver",e[e.cyclicDependency=1513]="cyclicDependency",e[e.connectUpdateRequiresController=1514]="connectUpdateRequiresController"}(c||(c={}));const d=e=>"function"==typeof e,h=e=>"string"==typeof e,u=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),"requestIdleCallback"in globalThis||(globalThis.requestIdleCallback=function(e,t){const n=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-n>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const p={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},p));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,n){let s=e[t];return void 0===s&&(s=n?e[t]=n():null),s}},p))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const g=Object.freeze([]);function b(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function v(){const e=new WeakMap;return function(t){let n=e.get(t);if(void 0===n){let s=Reflect.getPrototypeOf(t);for(;void 0===n&&null!==s;)n=e.get(s),s=Reflect.getPrototypeOf(s);n=void 0===n?[]:n.slice(0),e.set(t,n)}return n}}function m(e){e.prototype.toJSON=u}const y=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),w=e=>e,C=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:w}):{createHTML:w};let S=Object.freeze({createHTML:e=>C.createHTML(e),protect:(e,t,n,s)=>s});const T=S,O=Object.freeze({get policy(){return S},setPolicy(e){if(S!==T)throw f.error(c.onlySetDOMPolicyOnce);S=e},setAttribute(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)},setBooleanAttribute(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}});function x(e,t,n,s){return(e,t,n,...i)=>{h(n)&&(n=n.replace(/(javascript:|vbscript:|data:)/,"")),s(e,t,n,...i)}}function $(e,t,n,s){throw f.error(c.blockedByDOMPolicy,{aspectName:n,tagName:null!=e?e:"text"})}const B={onabort:$,onauxclick:$,onbeforeinput:$,onbeforematch:$,onblur:$,oncancel:$,oncanplay:$,oncanplaythrough:$,onchange:$,onclick:$,onclose:$,oncontextlost:$,oncontextmenu:$,oncontextrestored:$,oncopy:$,oncuechange:$,oncut:$,ondblclick:$,ondrag:$,ondragend:$,ondragenter:$,ondragleave:$,ondragover:$,ondragstart:$,ondrop:$,ondurationchange:$,onemptied:$,onended:$,onerror:$,onfocus:$,onformdata:$,oninput:$,oninvalid:$,onkeydown:$,onkeypress:$,onkeyup:$,onload:$,onloadeddata:$,onloadedmetadata:$,onloadstart:$,onmousedown:$,onmouseenter:$,onmouseleave:$,onmousemove:$,onmouseout:$,onmouseover:$,onmouseup:$,onpaste:$,onpause:$,onplay:$,onplaying:$,onprogress:$,onratechange:$,onreset:$,onresize:$,onscroll:$,onsecuritypolicyviolation:$,onseeked:$,onseeking:$,onselect:$,onslotchange:$,onstalled:$,onsubmit:$,onsuspend:$,ontimeupdate:$,ontoggle:$,onvolumechange:$,onwaiting:$,onwebkitanimationend:$,onwebkitanimationiteration:$,onwebkitanimationstart:$,onwebkittransitionend:$,onwheel:$},k={elements:{a:{[y.attribute]:{href:x},[y.property]:{href:x}},area:{[y.attribute]:{href:x},[y.property]:{href:x}},button:{[y.attribute]:{formaction:x},[y.property]:{formAction:x}},embed:{[y.attribute]:{src:$},[y.property]:{src:$}},form:{[y.attribute]:{action:x},[y.property]:{action:x}},frame:{[y.attribute]:{src:x},[y.property]:{src:x}},iframe:{[y.attribute]:{src:x},[y.property]:{src:x,srcdoc:$}},input:{[y.attribute]:{formaction:x},[y.property]:{formAction:x}},link:{[y.attribute]:{href:$},[y.property]:{href:$}},object:{[y.attribute]:{codebase:$,data:$},[y.property]:{codeBase:$,data:$}},script:{[y.attribute]:{src:$,text:$},[y.property]:{src:$,text:$,innerText:$,textContent:$}},style:{[y.property]:{innerText:$,textContent:$}}},aspects:{[y.attribute]:Object.assign({},B),[y.property]:Object.assign({innerHTML:$},B),[y.event]:Object.assign({},B)}};function N(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=r;break;default:n[s]=i}}for(const t in e)t in n||(n[t]=e[t]);return Object.freeze(n)}function A(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=N(r,{});break;default:n[s]=N(i,r)}}for(const t in e)t in n||(n[t]=N(e[t],{}));return Object.freeze(n)}function M(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=A(i,{});break;default:n[s]=A(i,r)}}for(const t in e)t in n||(n[t]=A(e[t],{}));return Object.freeze(n)}function E(e,t,n,s,i){const r=e[n];if(r){const e=r[s];if(e)return e(t,n,s,i)}}const I=Object.freeze({create(e={}){var t,n;const s=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),i=(r=null!==(n=e.guards)&&void 0!==n?n:{},o=k,Object.freeze({elements:r.elements?M(r.elements,o.elements):o.elements,aspects:r.aspects?A(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>s.createHTML(e),protect(e,t,n,s){var r;const o=(null!=e?e:"").toLowerCase(),a=i.elements[o];if(a){const i=E(a,e,t,n,s);if(i)return i}return null!==(r=E(i.aspects,e,t,n,s))&&void 0!==r?r:s}})}});class R{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const n=t.indexOf(e);-1!==n&&t.splice(n,1)}}notify(e){const t=this.spillover,n=this.subject;if(void 0===t){const t=this.sub1,s=this.sub2;void 0!==t&&t.handleChange(n,e),void 0!==s&&s.handleChange(n,e)}else for(let s=0,i=t.length;s<i;++s)t[s].handleChange(n,e)}}class j{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,n;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(n=this.subjectSubscribers)||void 0===n||n.notify(e)}subscribe(e,t){var n,s;let i;i=t?null!==(n=this.subscribers[t])&&void 0!==n?n:this.subscribers[t]=new R(this.subject):null!==(s=this.subjectSubscribers)&&void 0!==s?s:this.subjectSubscribers=new R(this.subject),i.subscribe(e)}unsubscribe(e,t){var n,s;t?null===(n=this.subscribers[t])||void 0===n||n.unsubscribe(e):null===(s=this.subjectSubscribers)||void 0===s||s.unsubscribe(e)}}const V=f.getById(l.updateQueue,(()=>{const e=[],t=[],n=globalThis.requestAnimationFrame;let s=!0;function i(){if(t.length)throw t.shift()}function r(n){try{n.call()}catch(n){if(!s)throw e.length=0,n;t.push(n),setTimeout(i,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let n=0,s=e.length-t;n<s;n++)e[n]=e[n+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(s?n(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>s=e})})),_=Object.freeze({unknown:void 0,coupled:1}),D=f.getById(l.observable,(()=>{const e=V.enqueue,t=/(:|&&|\|\||if|\?\.)/,n=new WeakMap;let s,i=e=>{throw f.error(c.needsArrayObservation)};function r(e){var t;let s=null!==(t=e.$fastController)&&void 0!==t?t:n.get(e);return void 0===s&&(Array.isArray(e)?s=i(e):n.set(e,s=new j(e))),s}const o=v();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==s&&s.watch(e,this.name),e[this.field]}setValue(e,t){const n=this.field,s=e[n];if(s!==t){e[n]=t;const i=e[this.callback];d(i)&&i.call(e,s,t),r(e).notify(this.name)}}}class l extends R{constructor(e,t,n=!1){super(e,t),this.expression=e,this.isVolatileBinding=n,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==_.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const n=s;let i;s=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{s=n}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const n=this.last,i=r(e),o=null===n?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=i,i.subscribe(this,t),null!==n){if(!this.needsRefresh){let t;s=void 0,t=n.propertySource[n.propertyName],s=this,e===t&&(this.needsRefresh=!0)}n.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return m(l),Object.freeze({setArrayObserverFactory(e){i=e},getNotifier:r,track(e,t){s&&s.watch(e,t)},trackVolatile(){s&&(s.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){h(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,n=this.isVolatileBinding(e)){return new l(e,t,n)},isVolatileBinding:e=>t.test(e.toString())})}));function L(e,t){D.defineProperty(e,t)}function F(e,t,n){return Object.assign({},n,{get(){return D.trackVolatile(),n.get.apply(this)}})}const H=f.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),P=Object.freeze({default:{index:0,length:0,get event(){return P.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>H.get(),setEvent(e){H.set(e)}});class z{constructor(e,t,n){this.index=e,this.removed=t,this.addedCount=n}adjustTo(e){let t=this.index;const n=e.length;return t>n?t=n-this.addedCount:t<0&&(t=n+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class U{constructor(e){this.sorted=e}}const q=Object.freeze({reset:1,splice:2,optimized:3}),W=new z(0,g,0);W.reset=!0;const Q=[W];var J;function K(e,t,n,s,i,r){let o=0,a=0;const l=Math.min(n-t,r-i);if(0===t&&0===i&&(o=function(e,t,n){for(let s=0;s<n;++s)if(e[s]!==t[s])return s;return n}(e,s,l)),n===e.length&&r===s.length&&(a=function(e,t,n){let s=e.length,i=t.length,r=0;for(;r<n&&e[--s]===t[--i];)r++;return r}(e,s,l-o)),i+=o,r-=a,(n-=a)-(t+=o)==0&&r-i==0)return g;if(t===n){const e=new z(t,[],0);for(;i<r;)e.removed.push(s[i++]);return[e]}if(i===r)return[new z(t,[],n-t)];const c=function(e){let t=e.length-1,n=e[0].length-1,s=e[t][n];const i=[];for(;t>0||n>0;){if(0===t){i.push(J.add),n--;continue}if(0===n){i.push(J.delete),t--;continue}const r=e[t-1][n-1],o=e[t-1][n],a=e[t][n-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===s?i.push(J.leave):(i.push(J.update),s=r),t--,n--):l===o?(i.push(J.delete),t--,s=o):(i.push(J.add),n--,s=a)}return i.reverse()}(function(e,t,n,s,i,r){const o=r-i+1,a=n-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let n=1;n<o;++n)for(let r=1;r<a;++r)e[t+r-1]===s[i+n-1]?l[n][r]=l[n-1][r-1]:(c=l[n-1][r]+1,d=l[n][r-1]+1,l[n][r]=c<d?c:d);return l}(e,t,n,s,i,r)),d=[];let h,u=t,p=i;for(let e=0;e<c.length;++e)switch(c[e]){case J.leave:void 0!==h&&(d.push(h),h=void 0),u++,p++;break;case J.update:void 0===h&&(h=new z(u,[],0)),h.addedCount++,u++,h.removed.push(s[p]),p++;break;case J.add:void 0===h&&(h=new z(u,[],0)),h.addedCount++,u++;break;case J.delete:void 0===h&&(h=new z(u,[],0)),h.removed.push(s[p]),p++}return void 0!==h&&d.push(h),d}function X(e,t){let n=!1,s=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=s,n)continue;const d=(i=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<i?-1:r===o||a===i?0:i<o?r<a?r-o:a-o:a<r?a-i:r-i);if(d>=0){t.splice(l,1),l--,s-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const i=e.removed.length+c.removed.length-d;if(e.addedCount||i){let t=c.removed;if(e.index<c.index){const n=e.removed.slice(0,c.index-e.index);n.push(...t),t=n}if(e.index+e.removed.length>c.index+c.addedCount){const n=e.removed.slice(c.index+c.addedCount-e.index);t.push(...n)}e.removed=t,c.index<e.index&&(e.index=c.index)}else n=!0}else if(e.index<c.index){n=!0,t.splice(l,0,e),l++;const i=e.addedCount-e.removed.length;c.index+=i,s+=i}}var i,r,o,a;n||t.push(e)}!function(e){e[e.leave=0]="leave",e[e.update=1]="update",e[e.add=2]="add",e[e.delete=3]="delete"}(J||(J={}));let G=Object.freeze({support:q.optimized,normalize:(e,t,n)=>void 0===e?void 0===n?g:function(e,t){let n=[];const s=[];for(let e=0,n=t.length;e<n;e++)X(t[e],s);for(let t=0,i=s.length;t<i;++t){const i=s[t];1!==i.addedCount||1!==i.removed.length?n=n.concat(K(e,i.index,i.index+i.addedCount,i.removed,0,i.removed.length)):i.removed[0]!==e[i.index]&&n.push(i)}return n}(t,n):Q,pop(e,t,n,s){const i=e.length>0,r=n.apply(e,s);return i&&t.addSplice(new z(e.length,[r],0)),r},push(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(e.length-s.length,[],s.length).adjustTo(e)),i},reverse(e,t,n,s){const i=n.apply(e,s);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new U(r)),i},shift(e,t,n,s){const i=e.length>0,r=n.apply(e,s);return i&&t.addSplice(new z(0,[r],0)),r},sort(e,t,n,s){const i=new Map;for(let t=0,n=e.length;t<n;++t){const n=i.get(e[t])||[];i.set(e[t],[...n,t])}const r=n.apply(e,s);e.sorted++;const o=[];for(let t=0,n=e.length;t<n;++t){const n=i.get(e[t]);o.push(n[0]),i.set(e[t],n.splice(1))}return t.addSort(new U(o)),r},splice(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(+s[0],i,s.length>2?s.length-2:0).adjustTo(e)),i},unshift(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(0,[],s.length).adjustTo(e)),i}});const Y=Object.freeze({reset:Q,setDefaultStrategy(e){G=e}});function Z(e,t,n,s=!0){Reflect.defineProperty(e,t,{value:n,enumerable:!1,writable:s})}class ee extends R{get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,D.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,D.notify(e,"sorted"))}},this.subscribe(e)}return e}constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,Z(e,"$fastController",this)}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,n=this.sorts,s=this.oldCollection;void 0===t&&void 0===s&&void 0===n||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==n?this.notify(n):this.notify((null!==(e=this._strategy)&&void 0!==e?e:G).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,V.enqueue(this))}}let te=!1;const ne=Object.freeze({sorted:0,enable(){if(te)return;te=!0,D.setArrayObserverFactory((e=>new ee(e)));const e=Array.prototype;e.$fastPatch||(Z(e,"$fastPatch",1),Z(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var n;const s=this.$fastController;return void 0===s?t.apply(this,e):(null!==(n=s.strategy)&&void 0!==n?n:G)[t.name](this,s,t,e)}})))}});function se(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ne.enable(),t=D.getNotifier(e)),D.track(t.lengthObserver,"length"),e.length}function ie(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ne.enable(),t=D.getNotifier(e)),D.track(t.sortObserver,"sorted"),e.sorted}class re{constructor(e,t,n=!1){this.evaluate=e,this.policy=t,this.isVolatile=n}}class oe extends re{createObserver(e){return D.binding(this.evaluate,e,this.isVolatile)}}function ae(e,t,n=D.isVolatileBinding(e)){return new oe(e,t,n)}function le(e,t){const n=new oe(e);return n.options=t,n}class ce extends re{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function de(e,t){return new ce(e,t)}function he(e){return d(e)?ae(e):e instanceof re?e:de((()=>e))}m(ce);const ue=b(),pe=Object.freeze({getForInstance:ue.getForInstance,getByType:ue.getByType,define:e=>(ue.register({type:e}),e)});function fe(){return function(e){pe.define(e)}}function ge(e,t,n){t.source.style.setProperty(e.targetAspect,n.bind(t))}class be{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const n=e.source;if(!n.$cssBindings){n.$cssBindings=new Map;const e=n.setAttribute;n.setAttribute=(t,s)=>{e.call(n,t,s),"style"===t&&n.$cssBindings.forEach(((e,t)=>ge(t,e.controller,e.observer)))}}const s=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);s.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:s})}connectedCallback(e){ge(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){ge(this,t.controller,t)}}let ve;function me(e){return e.map((e=>e instanceof ye?me(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}pe.define(be);class ye{get strategy(){return null===this._strategy&&this.withStrategy(ve),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ye?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(me(this.styles)),this}static setDefaultStrategy(e){ve=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ye(e):e instanceof ye?e:new ye([e])}}ye.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const we=`${Math.random().toString(36).substring(2,8)}`;let Ce=0;const Se=()=>`--v${we}${++Ce}`;function Te(e,t){const n=[];let s="";const i=[],r=e=>{i.push(e)};for(let i=0,o=e.length-1;i<o;++i){s+=e[i];let o=t[i];d(o)?o=new be(ae(o),Se()).createCSS(r):o instanceof re?o=new be(o,Se()).createCSS(r):void 0!==pe.getForInstance(o)&&(o=o.createCSS(r)),o instanceof ye||o instanceof CSSStyleSheet?(""!==s.trim()&&(n.push(s),s=""),n.push(o)):s+=o}return s+=e[e.length-1],""!==s.trim()&&n.push(s),{styles:n,behaviors:i}}const Oe=(e,...t)=>{const{styles:n,behaviors:s}=Te(e,t),i=new ye(n);return s.length?i.withBehaviors(...s):i};class xe{constructor(e,t){this.behaviors=t,this.css="";const n=e.reduce(((e,t)=>(h(t)?this.css+=t:e.push(t),e)),[]);n.length&&(this.styles=new ye(n))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}pe.define(xe),Oe.partial=(e,...t)=>{const{styles:n,behaviors:s}=Te(e,t);return new xe(n,s)};const $e=`fast-${Math.random().toString(36).substring(2,8)}`,Be=`${$e}{`,ke=`}${$e}`,Ne=ke.length;let Ae=0;const Me=()=>`${$e}-${++Ae}`,Ee=Object.freeze({interpolation:e=>`${Be}${e}${ke}`,attribute:e=>`${Me()}="${Be}${e}${ke}"`,comment:e=>`\x3c!--${Be}${e}${ke}--\x3e`}),Ie=Object.freeze({parse(e,t){const n=e.split(Be);if(1===n.length)return null;const s=[];for(let e=0,i=n.length;e<i;++e){const i=n[e],r=i.indexOf(ke);let o;if(-1===r)o=i;else{const e=i.substring(0,r);s.push(t[e]),o=i.substring(r+Ne)}""!==o&&s.push(o)}return s}}),Re=b(),je=Object.freeze({getForInstance:Re.getForInstance,getByType:Re.getByType,define:(e,t)=>((t=t||{}).type=e,Re.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?y.tokenList:y.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=y.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=y.event;break;default:e.targetAspect=t,e.aspectType=y.attribute}else e.aspectType=y.content}});function Ve(e){return function(t){je.define(t,e)}}class _e{constructor(e){this.options=e}createHTML(e){return Ee.attribute(e(this))}createBehavior(){return this}}m(_e);const De=e=>1===e.nodeType,Le=e=>e?t=>1===t.nodeType&&t.matches(e):De;class Fe extends _e{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,g),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}class He extends Fe{constructor(e){super(e),this.observerProperty=Symbol(),e.childList=!0}observe(e){let t=e[this.observerProperty];if(!t){t=new MutationObserver(((t,n)=>{this.updateTarget(this.getSource(e),this.computeNodes(e))})),t.toJSON=u,e[this.observerProperty]=t}t.observe(e,this.options)}disconnect(e){e[this.observerProperty].disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Pe(e){return h(e)&&(e={property:e}),new He(e)}je.define(He);const ze=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,Ue=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,qe=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,We=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Qe=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Je=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Ke(e){return e&&e.nodeType===Node.COMMENT_NODE}const Xe=Object.freeze({attributeMarkerName:"data-fe-b",compactAttributeMarkerName:"data-fe-c",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>ze.test(e),isContentBindingEndMarker:e=>Ue.test(e),isRepeatViewStartMarker:e=>qe.test(e),isRepeatViewEndMarker:e=>We.test(e),isElementBoundaryStartMarker:e=>Ke(e)&&Qe.test(e.data.trim()),isElementBoundaryEndMarker:e=>Ke(e)&&Je.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],n=this.attributeMarkerName.length+1,s=`${this.attributeMarkerName}-`;for(const i of e.getAttributeNames())if(i.startsWith(s)){const e=Number(i.slice(n));if(Number.isNaN(e))throw f.error(1601,{name:i,expectedFormat:`${s}<number>`});t.push(e)}return 0===t.length?null:t},parseCompactAttributeBinding(e){const t=`${this.compactAttributeMarkerName}-`,n=e.getAttributeNames().find((e=>e.startsWith(t)));if(!n)return null;const s=n.slice(t.length).split("-"),i=parseInt(s[0],10),r=parseInt(s[1],10);if(2!==s.length||Number.isNaN(i)||Number.isNaN(r)||i<0||r<1)throw f.error(1604,{name:n,expectedFormat:`${this.compactAttributeMarkerName}-{index}-{count}`});const o=[];for(let e=0;e<r;e++)o.push(i+e);return o},parseContentBindingStartMarker:e=>Ze(ze,e),parseContentBindingEndMarker:e=>Ze(Ue,e),parseRepeatStartMarker:e=>Ge(qe,e),parseRepeatEndMarker:e=>Ge(We,e),parseElementBoundaryStartMarker:e=>Ye(Qe,e.trim()),parseElementBoundaryEndMarker:e=>Ye(Je,e)});function Ge(e,t){const n=e.exec(t);return null===n?n:parseInt(n[1])}function Ye(e,t){const n=e.exec(t);return null===n?n:n[1]}function Ze(e,t){const n=e.exec(t);return null===n?n:[parseInt(n[1]),n[2]]}const et=Symbol.for("fe-hydration");function tt(e){return e[et]===et}const nt="defer-hydration";class st extends Error{constructor(e,t,n){super(e),this.factories=t,this.node=n}}function it(e){return e.nodeType===Node.COMMENT_NODE}function rt(e){return e.nodeType===Node.TEXT_NODE}function ot(e,t){const n=document.createRange();return n.setStart(e,0),n.setEnd(t,it(t)||rt(t)?t.data.length:t.childNodes.length),n}function at(e,t,n,s){var i,r;const o=null!==(r=null!==(i=Xe.parseAttributeBinding(e))&&void 0!==i?i:Xe.parseEnumeratedAttributeBinding(e))&&void 0!==r?r:Xe.parseCompactAttributeBinding(e);if(null!==o){for(const i of o){const r=t[i+s];if(!r)throw new st(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);ct(r,e,n)}e.removeAttribute(Xe.attributeMarkerName)}}function lt(e,t,n,s,i,r){if(Xe.isElementBoundaryStartMarker(e))!function(e,t){const n=Xe.parseElementBoundaryStartMarker(e.data);let s=t.nextSibling();for(;null!==s;){if(it(s)){const e=Xe.parseElementBoundaryEndMarker(s.data);if(e&&e===n)break}s=t.nextSibling()}}(e,t);else if(Xe.isContentBindingStartMarker(e.data)){const o=Xe.parseContentBindingStartMarker(e.data);if(null===o)return;const[a,l]=o,c=n[a+r],d=[];let h=t.nextSibling();e.data="";const u=h;for(;null!==h;){if(it(h)){const e=Xe.parseContentBindingEndMarker(h.data);if(e&&e[1]===l)break}d.push(h),h=t.nextSibling()}if(null===h){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(h.data="",1===d.length&&rt(d[0]))ct(c,d[0],s);else{h!==u&&null!==h.previousSibling&&(i[c.targetNodeId]={first:u,last:h.previousSibling});ct(c,h.parentNode.insertBefore(document.createTextNode(""),h),s)}}}function ct(e,t,n){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");n[e.targetNodeId]=t}var dt;function ht(e,t){const n=e.parentNode;let s,i=e;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);n.removeChild(i),i=s}n.removeChild(t)}class ut{constructor(){this.index=0,this.length=0}get event(){return P.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class pt extends ut{constructor(e,t,n){super(),this.fragment=e,this.factories=t,this.targets=n,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=_.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const n=e.parentNode;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,n.insertBefore(i,e),i=s;n.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let n,s=this.firstChild;for(;s!==t;)n=s.nextSibling,e.appendChild(s),s=n;e.appendChild(t)}dispose(){ht(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t,this.behaviors=n=new Array(this.factories.length);const s=this.factories;for(let e=0,t=s.length;e<t;++e){const t=s[e].createBehavior();t.bind(this),n[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,n=e.length;t<n;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){ht(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,n=e.length;t<n;++t)e[t].unbind()}}}m(pt),D.defineProperty(pt.prototype,"index"),D.defineProperty(pt.prototype,"length");const ft="unhydrated",gt="hydrating",bt="hydrated";class vt extends Error{constructor(e,t,n,s){super(e),this.factory=t,this.fragment=n,this.templateString=s}}dt=et,m(class extends ut{get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}constructor(e,t,n,s){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=n,this.hostBindingTarget=s,this[dt]=et,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=_.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=ft,this._bindingViewBoundaries={},this._targets={},this.factories=n.compile().factories}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const n=e.parentNode;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,n.insertBefore(i,e),i=s;n.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let n,s=this.firstChild;for(;s!==t;){if(n=s.nextSibling,!n)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(s),s=n}e.appendChild(t)}bind(e,t=this){var n;if(this.hydrationStage!==bt&&(this._hydrationStage=gt),this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,n){const s=ot(e,t),i=s.commonAncestorContainer,r=function(e){let t=0;for(let n=0,s=e.length;n<s&&"h"===e[n].targetNodeId;++n)t++;return t}(n),o=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===s.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),a={},l={};let c=o.currentNode=e;for(;null!==c;){switch(c.nodeType){case Node.ELEMENT_NODE:at(c,n,a,r);break;case Node.COMMENT_NODE:lt(c,o,n,a,l,r)}c=o.nextNode()}return s.detach(),{targets:a,boundaries:l}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof st){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&ct(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const s=(null===(n=this.firstChild)||void 0===n?void 0:n.getRootNode()).host,i=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==s?void 0:s.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),i.sourceAspect&&r.push(` - Source aspect: "${i.sourceAspect}"`),void 0!==i.aspectType&&r.push(` - Aspect type: ${i.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new vt(r.join("\n"),t,ot(this.firstChild,this.lastChild).cloneContents(),e)}{const n=t.createBehavior();n.bind(this),s[e]=n}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0,this._hydrationStage=bt}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){ht(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,n=e.length;t<n;++t)e[t].unbind(this);e.length=0}});const mt={[y.attribute]:O.setAttribute,[y.booleanAttribute]:O.setBooleanAttribute,[y.property]:(e,t,n)=>e[t]=n,[y.content]:function(e,t,n,s){if(null==n&&(n=""),function(e){return void 0!==e.create}(n)){e.textContent="";let t=e.$fastView;if(void 0===t)if(tt(s)&&tt(n)&&void 0!==s.bindingViewBoundaries[this.targetNodeId]&&s.hydrationStage!==bt){const e=s.bindingViewBoundaries[this.targetNodeId];t=n.hydrate(e.first,e.last)}else t=n.create();else e.$fastTemplate!==n&&(t.isComposed&&(t.remove(),t.unbind()),t=n.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(s.source,s.context)):(t.isComposed=!0,t.bind(s.source,s.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=n)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=n}},[y.tokenList]:function(e,t,n){var s;const i=`${this.id}-t`,r=null!==(s=e[i])&&void 0!==s?s:e[i]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=n&&n.length){const e=n.split(/\s+/);for(let t=0,n=e.length;t<n;++t){const n=e[t];""!==n&&(o[n]=a,l.add(n))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[y.event]:()=>{}};class yt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=y.content}createHTML(e){return Ee.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=mt[this.aspectType],n=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw f.error(c.unsupportedBindingBehavior);this.data=`${this.id}-d`,this.updateTarget=n.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const n=e.targets[this.targetNodeId],s=tt(e)&&e.hydrationStage&&e.hydrationStage!==bt;switch(this.aspectType){case y.event:n[this.data]=e,n.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case y.content:e.onUnbind(this);default:const i=null!==(t=n[this.data])&&void 0!==t?t:n[this.data]=this.dataBinding.createObserver(this,this);if(i.target=n,i.controller=e,s&&(this.aspectType===y.attribute||this.aspectType===y.booleanAttribute)){i.bind(e);break}this.updateTarget(n,this.targetAspect,i.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){P.setEvent(e);const n=this.dataBinding.evaluate(t.source,t.context);P.setEvent(null),!0!==n&&e.preventDefault()}}handleChange(e,t){const n=t.target,s=t.controller;this.updateTarget(n,this.targetAspect,t.bind(s),s)}}je.define(yt,{aspected:!0});const wt=(e,t)=>`${e}.${t}`,Ct={},St={index:0,node:null};function Tt(e){e.startsWith("fast-")||f.warn(c.hostBindingWithoutHost,{name:e})}const Ot=new Proxy(document.createElement("div"),{get(e,t){Tt(t);const n=Reflect.get(e,t);return d(n)?n.bind(e):n},set:(e,t,n)=>(Tt(t),Reflect.set(e,t,n))});class xt{constructor(e,t,n){this.fragment=e,this.directives=t,this.policy=n,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,n,s,i){var r,o;this.nodeIds.has(n)||(this.nodeIds.add(n),this.addTargetDescriptor(t,n,s)),e.id=null!==(r=e.id)&&void 0!==r?r:Me(),e.targetNodeId=n,e.targetTagName=i,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,n){const s=this.descriptors;if("r"===t||"h"===t||s[t])return;if(!s[e]){const t=e.lastIndexOf("."),n=e.substring(0,t),s=parseInt(e.substring(t+1),10);this.addTargetDescriptor(n,e,s)}let i=Ct[t];if(!i){const s=`_${t}`;Ct[t]=i={get(){var t;return null!==(t=this[s])&&void 0!==t?t:this[s]=this[e].childNodes[n]}}}s[t]=i}createView(e){const t=this.fragment.cloneNode(!0),n=Object.create(this.proto);n.r=t,n.h=null!=e?e:Ot;for(const e of this.nodeIds)Reflect.get(n,e);return new pt(t,this.factories,n)}}function $t(e,t,n,s,i,r=!1){const o=n.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=Ie.parse(h,a);let p=null;null===u?r&&(p=new yt(de((()=>h),e.policy)),je.assignAspect(p,d.name)):p=At.aggregate(u,e.policy),null!==p&&(n.removeAttributeNode(d),l--,c--,e.addFactory(p,t,s,i,n.tagName))}}function Bt(e,t,n){let s=0,i=t.firstChild;for(;i;){const t=kt(e,n,i,s);i=t.node,s=t.index}}function kt(e,t,n,s){const i=wt(t,s);switch(n.nodeType){case 1:$t(e,t,n,i,s),Bt(e,n,i);break;case 3:return function(e,t,n,s,i){const r=Ie.parse(t.textContent,e.directives);if(null===r)return St.node=t.nextSibling,St.index=i+1,St;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(i++,s=wt(n,i),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),h(l)?o.textContent=l:(o.textContent=" ",je.assignAspect(l),e.addFactory(l,n,s,i,null)),a=o}return St.index=i+1,St.node=a.nextSibling,St}(e,n,t,i,s);case 8:{const r=Ie.parse(n.data,e.directives);null!==r&&e.addFactory(At.aggregate(r),t,i,s,null);break}}return St.index=s+1,St.node=n.nextSibling,St}const Nt="TEMPLATE",At={compile(e,t,n=O.policy){let s;if(h(e)){s=document.createElement(Nt),s.innerHTML=n.createHTML(e);const t=s.content.firstElementChild;null!==t&&t.tagName===Nt&&(s=t)}else s=e;s.content.firstChild||s.content.lastChild||s.content.appendChild(document.createComment(""));const i=document.adoptNode(s.content),r=new xt(i,t,n);var o,a;return $t(r,"",s,"h",0,!0),o=i.firstChild,a=t,(o&&8===o.nodeType&&null!==Ie.parse(o.data,a)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Bt(r,i,"r"),St.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=O.policy){if(1===e.length)return e[0];let n,s,i=!1;const r=e.length,o=e.map((e=>h(e)?()=>e:(n=e.sourceAspect||n,i=i||e.dataBinding.isVolatile,s=s||e.dataBinding.policy,e.dataBinding.evaluate))),a=new yt(ae(((e,t)=>{let n="";for(let s=0;s<r;++s)n+=o[s](e,t);return n}),null!=s?s:t,i));return je.assignAspect(a,n),a}};class Mt extends _e{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}je.define(Mt);const Et=e=>new Mt(e);function It(e,t,n,s){return new(n||(n=Promise))((function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Rt="boolean",jt="reflect",Vt=Object.freeze({locate:v()}),_t={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Dt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:_t.fromView(e)};function Lt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Ft={toView(e){const t=Lt(e);return t?t.toString():t},fromView:Lt};class Ht{constructor(e,t,n=t.toLowerCase(),s=jt,i){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=n,this.mode=s,this.converter=i,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,s===Rt&&void 0===i&&(this.converter=_t)}setValue(e,t){const n=e[this.fieldName],s=this.converter;void 0!==s&&(t=s.fromView(t)),n!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](n,t),e.$fastController.notify(this.name))}getValue(e){return D.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,n=this.guards;n.has(e)||"fromView"===t||V.enqueue((()=>{n.add(e);const s=e[this.fieldName];switch(t){case jt:const t=this.converter;O.setAttribute(e,this.attribute,void 0!==t?t.toView(s):s);break;case Rt:O.setBooleanAttribute(e,this.attribute,s)}n.delete(e)}))}static collect(e,...t){const n=[];t.push(Vt.locate(e));for(let s=0,i=t.length;s<i;++s){const i=t[s];if(void 0!==i)for(let t=0,s=i.length;t<s;++t){const s=i[t];h(s)?n.push(new Ht(e,s)):n.push(new Ht(e,s.property,s.attribute,s.mode,s.converter))}}return n}}function Pt(e,t){let n;function s(e,t){arguments.length>1&&(n.property=t),Vt.locate(e.constructor).push(n)}return arguments.length>1?(n={},void s(e,t)):(n=void 0===e?{}:e,s)}var zt;const Ut={mode:"open"},qt={},Wt=new Set,Qt=f.getById(l.elementRegistry,(()=>b())),Jt={deferAndHydrate:"defer-and-hydrate"};class Kt{get isDefined(){return this.platformDefined}constructor(e,t=e.definition){var n;this.platformDefined=!1,h(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(n=t.registry)&&void 0!==n?n:customElements;const s=e.prototype,i=Ht.collect(e,t.attributes),r=new Array(i.length),o={},a={};for(let e=0,t=i.length;e<t;++e){const t=i[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,D.defineProperty(s,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=i,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?Ut:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Ut),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?qt:Object.assign(Object.assign({},qt),t.elementOptions),this.styles=ye.normalize(t.styles),Qt.register(this),D.defineProperty(zt.isRegistered,this.name),zt.isRegistered[this.name]=this.type}define(e=this.registry){var t,n;const s=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,s,this.elementOptions),null===(n=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===n||n.call(t,this.name)),this}static compose(e,t){return Wt.has(e)||Qt.getByType(e)?new zt(class extends e{},t):new zt(e,t)}static registerBaseType(e){Wt.add(e)}static composeAsync(e,t){return new Promise((n=>{(Wt.has(e)||Qt.getByType(e))&&n(new zt(class extends e{},t));const s=new zt(e,t);D.getNotifier(s).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=s.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,s.name),n(s)}},"template")}))}}zt=Kt,Kt.isRegistered={},Kt.getByType=Qt.getByType,Kt.getForInstance=Qt.getForInstance,Kt.registerAsync=e=>It(void 0,void 0,void 0,(function*(){return new Promise((t=>{zt.isRegistered[e]&&t(zt.isRegistered[e]),D.getNotifier(zt.isRegistered).subscribe({handleChange:()=>t(zt.isRegistered[e])},e)}))})),D.defineProperty(Kt.prototype,"template");const Xt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Gt=Object.create(null);class Yt{constructor(e,t=Gt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const n in t)e(t[n]);return this.html}}function Zt(e,t,n,s=je.getForInstance(e)){if(s.aspected){const n=Xt.exec(t);null!==n&&je.assignAspect(e,n[2])}return e.createHTML(n)}Yt.empty=new Yt(""),je.define(Yt);class en{constructor(e,t={},n){this.policy=n,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=At.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Yt(h(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw f.error(c.cannotSetTemplatePolicyAfterCompilation);if(this.policy)throw f.error(c.onlySetTemplatePolicyOnce);return this.policy=e,this}render(e,t,n){const s=this.create(n);return s.bind(e),s.appendTo(t),s}static create(e,t,n){let s="";const i=Object.create(null),r=e=>{var t;const n=null!==(t=e.id)&&void 0!==t?t:e.id=Me();return i[n]=e,n};for(let n=0,i=e.length-1;n<i;++n){const i=e[n];let o,a=t[n];if(s+=i,d(a))a=new yt(ae(a));else if(a instanceof re)a=new yt(a);else if(!(o=je.getForInstance(a))){const e=a;a=new yt(de((()=>e)))}s+=Zt(a,i,r,o)}return new en(s+e[e.length-1],i,n)}}m(en);const tn=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return en.create(e,t);throw f.error(c.directCallToHTMLTagNotAllowed)};tn.partial=e=>new Yt(e);class nn{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),tt(this.template)&&tt(e)&&e.hydrationStage!==bt&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class sn{constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=n}createHTML(e){return Ee.comment(e(this))}createBehavior(){return new nn(this)}}je.define(sn);const rn=new Map,on="default-view",an=tn`
1
+ var e;!function(e){e[e.needsArrayObservation=1101]="needsArrayObservation",e[e.onlySetDOMPolicyOnce=1201]="onlySetDOMPolicyOnce",e[e.bindingInnerHTMLRequiresTrustedTypes=1202]="bindingInnerHTMLRequiresTrustedTypes",e[e.twoWayBindingRequiresObservables=1203]="twoWayBindingRequiresObservables",e[e.hostBindingWithoutHost=1204]="hostBindingWithoutHost",e[e.unsupportedBindingBehavior=1205]="unsupportedBindingBehavior",e[e.directCallToHTMLTagNotAllowed=1206]="directCallToHTMLTagNotAllowed",e[e.onlySetTemplatePolicyOnce=1207]="onlySetTemplatePolicyOnce",e[e.cannotSetTemplatePolicyAfterCompilation=1208]="cannotSetTemplatePolicyAfterCompilation",e[e.blockedByDOMPolicy=1209]="blockedByDOMPolicy",e[e.invalidHydrationAttributeMarker=1210]="invalidHydrationAttributeMarker",e[e.missingElementDefinition=1401]="missingElementDefinition",e[e.noRegistrationForContext=1501]="noRegistrationForContext",e[e.noFactoryForResolver=1502]="noFactoryForResolver",e[e.invalidResolverStrategy=1503]="invalidResolverStrategy",e[e.cannotAutoregisterDependency=1504]="cannotAutoregisterDependency",e[e.cannotResolveKey=1505]="cannotResolveKey",e[e.cannotConstructNativeFunction=1506]="cannotConstructNativeFunction",e[e.cannotJITRegisterNonConstructor=1507]="cannotJITRegisterNonConstructor",e[e.cannotJITRegisterIntrinsic=1508]="cannotJITRegisterIntrinsic",e[e.cannotJITRegisterInterface=1509]="cannotJITRegisterInterface",e[e.invalidResolver=1510]="invalidResolver",e[e.invalidKey=1511]="invalidKey",e[e.noDefaultResolver=1512]="noDefaultResolver",e[e.cyclicDependency=1513]="cyclicDependency",e[e.connectUpdateRequiresController=1514]="connectUpdateRequiresController"}(e||(e={}));const t=e=>"function"==typeof e,n=e=>"string"==typeof e,i=()=>{},s=Object.create(null),r={warn(e,t){},error:(e,t)=>new Error(`Error ${e}`),addMessages(e){Object.assign(s,e)}};function o(){return s}const a=Object.freeze([]);function l(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function c(){const e=new WeakMap;return function(t){let n=e.get(t);if(void 0===n){let i=Reflect.getPrototypeOf(t);for(;void 0===n&&null!==i;)n=e.get(i),i=Reflect.getPrototypeOf(i);n=void 0===n?[]:n.slice(0),e.set(t,n)}return n}}function d(e){e.prototype.toJSON=i}const h={1101:"Must call ArrayObserver.enable() before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1209:"'${aspectName}' on '${tagName}' is blocked by the current DOMPolicy.",1210:"Invalid data-fe attribute value '${value}'. Expected a positive integer.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement.",1601:"Invalid attribute marker name: ${name}. Expected format is ${expectedFormat}.",1602:"Invalid compact attribute marker values in ${markerName}. Both index and count must be positive integers.",1604:"Invalid compact attribute marker name: ${name}. Expected format is ${expectedFormat}."},u=/(\$\{\w+?})/g,p=/\$\{(\w+?)}/g,f=Object.freeze({});function g(e,t){return e.split(u).map(e=>{var n;const i=e.replace(p,"$1");return String(null!==(n=t[i])&&void 0!==n?n:e)}).join("")}function b(){const e=o();Object.assign(e,h),Object.assign(r,{addMessages(t){Object.assign(e,t)},warn(t,n=f){var i;const s=null!==(i=e[t])&&void 0!==i?i:"Unknown Warning";console.warn(g(s,n))},error(t,n=f){var i;const s=null!==(i=e[t])&&void 0!==i?i:"Unknown Error";return new Error(g(s,n))}})}const v=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),m=e=>e,y=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-element",{createHTML:m}):{createHTML:m};let w=Object.freeze({createHTML:e=>y.createHTML(e),protect:(e,t,n,i)=>i});const C=w,S=Object.freeze({get policy(){return w},setPolicy(t){if(w!==C)throw r.error(e.onlySetDOMPolicyOnce);w=t},setAttribute(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)},setBooleanAttribute(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}});function O(e,t,i,s){return(e,t,i,...r)=>{n(i)&&(i=i.replace(/(javascript:|vbscript:|data:)/,"")),s(e,t,i,...r)}}function T(t,n,i,s){throw r.error(e.blockedByDOMPolicy,{aspectName:i,tagName:null!=t?t:"text"})}const x={onabort:T,onauxclick:T,onbeforeinput:T,onbeforematch:T,onblur:T,oncancel:T,oncanplay:T,oncanplaythrough:T,onchange:T,onclick:T,onclose:T,oncontextlost:T,oncontextmenu:T,oncontextrestored:T,oncopy:T,oncuechange:T,oncut:T,ondblclick:T,ondrag:T,ondragend:T,ondragenter:T,ondragleave:T,ondragover:T,ondragstart:T,ondrop:T,ondurationchange:T,onemptied:T,onended:T,onerror:T,onfocus:T,onformdata:T,oninput:T,oninvalid:T,onkeydown:T,onkeypress:T,onkeyup:T,onload:T,onloadeddata:T,onloadedmetadata:T,onloadstart:T,onmousedown:T,onmouseenter:T,onmouseleave:T,onmousemove:T,onmouseout:T,onmouseover:T,onmouseup:T,onpaste:T,onpause:T,onplay:T,onplaying:T,onprogress:T,onratechange:T,onreset:T,onresize:T,onscroll:T,onsecuritypolicyviolation:T,onseeked:T,onseeking:T,onselect:T,onslotchange:T,onstalled:T,onsubmit:T,onsuspend:T,ontimeupdate:T,ontoggle:T,onvolumechange:T,onwaiting:T,onwebkitanimationend:T,onwebkitanimationiteration:T,onwebkitanimationstart:T,onwebkittransitionend:T,onwheel:T},N={elements:{a:{[v.attribute]:{href:O},[v.property]:{href:O}},area:{[v.attribute]:{href:O},[v.property]:{href:O}},button:{[v.attribute]:{formaction:O},[v.property]:{formAction:O}},embed:{[v.attribute]:{src:T},[v.property]:{src:T}},form:{[v.attribute]:{action:O},[v.property]:{action:O}},frame:{[v.attribute]:{src:O},[v.property]:{src:O}},iframe:{[v.attribute]:{src:O},[v.property]:{src:O,srcdoc:T}},input:{[v.attribute]:{formaction:O},[v.property]:{formAction:O}},link:{[v.attribute]:{href:T},[v.property]:{href:T}},object:{[v.attribute]:{codebase:T,data:T},[v.property]:{codeBase:T,data:T}},script:{[v.attribute]:{src:T,text:T},[v.property]:{src:T,text:T,innerText:T,textContent:T}},style:{[v.property]:{innerText:T,textContent:T}}},aspects:{[v.attribute]:Object.assign({},x),[v.property]:Object.assign({innerHTML:T},x),[v.event]:Object.assign({},x)}};function B(e,t){const n={};for(const i in t){const s=e[i],r=t[i];switch(s){case null:break;case void 0:n[i]=r;break;default:n[i]=s}}for(const t in e)t in n||(n[t]=e[t]);return Object.freeze(n)}function k(e,t){const n={};for(const i in t){const s=e[i],r=t[i];switch(s){case null:break;case void 0:n[i]=B(r,{});break;default:n[i]=B(s,r)}}for(const t in e)t in n||(n[t]=B(e[t],{}));return Object.freeze(n)}function A(e,t){const n={};for(const i in t){const s=e[i],r=t[i];switch(s){case null:break;case void 0:n[i]=k(s,{});break;default:n[i]=k(s,r)}}for(const t in e)t in n||(n[t]=k(e[t],{}));return Object.freeze(n)}function j(e,t,n,i,s){const r=e[n];if(r){const e=r[i];if(e)return e(t,n,i,s)}}const M=Object.freeze({create(e={}){var t,n;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-element",{createHTML:e}):{createHTML:e}}(),s=(r=null!==(n=e.guards)&&void 0!==n?n:{},o=N,Object.freeze({elements:r.elements?A(r.elements,o.elements):o.elements,aspects:r.aspects?k(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,n,i){var r;const o=(null!=e?e:"").toLowerCase(),a=s.elements[o];if(a){const s=j(a,e,t,n,i);if(s)return s}return null!==(r=j(s.aspects,e,t,n,i))&&void 0!==r?r:i}})}});class E{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const n=t.indexOf(e);-1!==n&&t.splice(n,1)}}notify(e){const t=this.spillover,n=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(n,e),void 0!==i&&i.handleChange(n,e)}else for(let i=0,s=t.length;i<s;++i)t[i].handleChange(n,e)}}class ${constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,n;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(n=this.subjectSubscribers)||void 0===n||n.notify(e)}subscribe(e,t){var n,i;let s;s=t?null!==(n=this.subscribers[t])&&void 0!==n?n:this.subscribers[t]=new E(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new E(this.subject),s.subscribe(e)}unsubscribe(e,t){var n,i;t?null===(n=this.subscribers[t])||void 0===n||n.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const P=[],R=[],I=globalThis.requestAnimationFrame;let _=!0;function V(){if(R.length)throw R.shift()}function L(e){try{e.call()}catch(e){if(!_)throw P.length=0,e;R.push(e),setTimeout(V,0)}}function D(){let e=0;for(;e<P.length;)if(L(P[e]),e++,e>1024){for(let t=0,n=P.length-e;t<n;t++)P[t]=P[t+e];P.length-=e,e=0}P.length=0}function H(e){P.push(e),P.length<2&&(_?I(D):D())}const z=Object.freeze({enqueue:H,next:()=>new Promise(H),process:D,setMode:e=>_=e}),F=Object.freeze({unknown:void 0,coupled:1}),U=(()=>{const i=z.enqueue,s=/(:|&&|\|\||if|\?\.)/,o=new WeakMap;let a,l=t=>{throw r.error(e.needsArrayObservation)};function h(e){var t;let n=null!==(t=e.$fastController)&&void 0!==t?t:o.get(e);return void 0===n&&(Array.isArray(e)?n=l(e):o.set(e,n=new $(e))),n}const u=c();class p{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==a&&a.watch(e,this.name),e[this.field]}setValue(e,n){const i=this.field,s=e[i];if(s!==n){e[i]=n;const r=e[this.callback];t(r)&&r.call(e,s,n),h(e).notify(this.name)}}}class f extends E{constructor(e,t,n=!1){super(e,t),this.expression=e,this.isVolatileBinding=n,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==F.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const n=a;let i;a=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{a=n}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const n=this.last,i=h(e),s=null===n?this.first:{};if(s.propertySource=e,s.propertyName=t,s.notifier=i,i.subscribe(this,t),null!==n){if(!this.needsRefresh){let t;a=void 0,t=n.propertySource[n.propertyName],a=this,e===t&&(this.needsRefresh=!0)}n.next=s}this.last=s}handleChange(){this.needsQueue?(this.needsQueue=!1,i(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return d(f),Object.freeze({setArrayObserverFactory(e){l=e},getNotifier:h,track(e,t){a&&a.watch(e,t)},trackVolatile(){a&&(a.needsRefresh=!0)},notify(e,t){h(e).notify(t)},defineProperty(e,t){n(t)&&(t=new p(t)),u(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:u,binding(e,t,n=this.isVolatileBinding(e)){return new f(e,t,n)},isVolatileBinding:e=>s.test(e.toString())})})();function W(e,t){U.defineProperty(e,t)}function q(e,t,n){return Object.assign({},n,{get(){return U.trackVolatile(),n.get.apply(this)}})}const Q=(()=>{let e=null;return{get:()=>e,set(t){e=t}}})(),J=Object.freeze({default:{index:0,length:0,get event(){return J.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>Q.get(),setEvent(e){Q.set(e)}}),K="boolean",X="reflect",G=Object.freeze({locate:c()}),Y={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Z={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Y.fromView(e)};function ee(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const te={toView(e){const t=ee(e);return t?t.toString():t},fromView:ee};class ne{constructor(e,t,n=t.toLowerCase(),i=X,s){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=n,this.mode=i,this.converter=s,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===K&&void 0===s&&(this.converter=Y)}setValue(e,t){const n=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),n!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](n,t),e.$fastController.notify(this.name))}getValue(e){return U.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,n=this.guards;n.has(e)||"fromView"===t||z.enqueue(()=>{n.add(e);const i=e[this.fieldName];switch(t){case X:{const t=this.converter;S.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break}case K:S.setBooleanAttribute(e,this.attribute,i)}n.delete(e)})}static collect(e,...t){const i=[];t.push(G.locate(e));for(let s=0,r=t.length;s<r;++s){const r=t[s];if(void 0!==r)for(let t=0,s=r.length;t<s;++t){const s=r[t];n(s)?i.push(new ne(e,s)):i.push(new ne(e,s.property,s.attribute,s.mode,s.converter))}}return i}}function ie(e,t){let n;function i(e,t){arguments.length>1&&(n.property=t),G.locate(e.constructor).push(n)}return arguments.length>1?(n={},void i(e,t)):(n=void 0===e?{}:e,i)}class se{constructor(e,t,n=!1){this.evaluate=e,this.policy=t,this.isVolatile=n}}class re extends se{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function oe(e,t){return new re(e,t)}d(re);class ae extends se{createObserver(e){return U.binding(this.evaluate,e,this.isVolatile)}}function le(e,t,n=U.isVolatileBinding(e)){return new ae(e,t,n)}function ce(e,t){const n=new ae(e);return n.options=t,n}function de(e){return t(e)?le(e):e instanceof se?e:oe(()=>e)}const he=Object.create(null),ue=Object.freeze({subscribe(e,t){const n=he[e];n?n instanceof Set?n.add(t):he[e]=new Set([n,t]):he[e]=t},unsubscribe(e,t){const n=he[e];n&&n instanceof Set?n.delete(t):he[e]=void 0},send(e){const t=he[e];t&&(t instanceof Set?t.forEach(n=>n.handleChange(t,e)):t.handleChange(this,e))}});class pe{constructor(e,t){this.dataBinding=e,this.subscriber=t,this.isNotBound=!0}bind(e){return this.isNotBound&&(ue.subscribe(this.getSignal(e),this),e.onUnbind(this),this.isNotBound=!1),this.dataBinding.evaluate(e.source,e.context)}unbind(e){this.isNotBound=!0,ue.unsubscribe(this.getSignal(e),this)}handleChange(){this.subscriber.handleChange(this.dataBinding.evaluate,this)}getSignal(e){const t=this.dataBinding.options;return n(t)?t:t(e.source,e.context)}}d(pe);class fe extends se{createObserver(e){return new pe(this,e)}}function ge(e,t,n){const i=new fe(e,n);return i.options=t,i}const be={fromView:e=>e};let ve={determineChangeEvent:()=>"change"};const me=Object.freeze({configure(e){ve=e}});class ye{constructor(e,t,n){this.directive=e,this.subscriber=t,this.dataBinding=n,this.isNotBound=!0,this.notifier=U.binding(n.evaluate,this,n.isVolatile)}bind(e){var t;return this.changeEvent||(this.changeEvent=null!==(t=this.dataBinding.options.changeEvent)&&void 0!==t?t:ve.determineChangeEvent(this.directive,this.target)),this.isNotBound&&(this.target.addEventListener(this.changeEvent,this),e.onUnbind(this),this.isNotBound=!1),this.notifier.bind(e)}unbind(e){this.isNotBound=!0,this.target.removeEventListener(this.changeEvent,this)}handleChange(e,t){this.subscriber.handleChange(this.dataBinding.evaluate,this)}handleEvent(t){const n=this.directive,i=t.currentTarget,s=this.notifier.last;if(!s)return void r.warn(e.twoWayBindingRequiresObservables);let o;switch(n.aspectType){case 1:o=i.getAttribute(n.targetAspect);break;case 2:o=i.hasAttribute(n.targetAspect);break;case 4:o=i.innerText;break;default:o=i[n.targetAspect]}s.propertySource[s.propertyName]=this.dataBinding.options.fromView(o)}}d(ye);class we extends se{createObserver(e,t){return new ye(t,e,this)}}function Ce(e,t,i,s=U.isVolatileBinding(e)){n(t)&&(t={changeEvent:t}),t?t.fromView||(t.fromView=be.fromView):t=be;const r=new we(e,i,s);return r.options=t,r}let Se;function Oe(e){return e.reduce((e,t)=>(t instanceof Te?e.push(...Oe(t.styles)):e.push(t),e),[])}class Te{get strategy(){return null===this._strategy&&(Se||Te.setDefaultStrategy(Te.supportsAdoptedStyleSheets?function(){const e=new Map;return class{constructor(t){this.sheets=t.map(t=>{if(t instanceof CSSStyleSheet)return t;let n=e.get(t);return void 0===n&&(n=new CSSStyleSheet,n.replaceSync(t),e.set(t,n)),n})}addStylesTo(e){const t=e;t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=e;t.adoptedStyleSheets=t.adoptedStyleSheets.filter(e=>-1===this.sheets.indexOf(e))}}}():class{constructor(e){this.styles=e,this.styleClass="fast-"+ ++xe}addStylesTo(e){const t=e===document?document.body:e;for(let e=0;e<this.styles.length;e++){const n=document.createElement("style");n.innerHTML=this.styles[e],n.className=this.styleClass,t.append(n)}}removeStylesFrom(e){const t=e===document?document.body:e,n=t.querySelectorAll(`.${this.styleClass}`);for(let e=0,i=n.length;e<i;++e)t.removeChild(n[e])}}),this.withStrategy(Se)),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withStrategy(e){return this._strategy=new e(Oe(this.styles)),this}static setDefaultStrategy(e){Se=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new Te(e):e instanceof Te?e:new Te([e])}}Te.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;let xe=0;function Ne(e,t,n,i){return new(n||(n=Promise))(function(s,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((i=i.apply(e,t||[])).next())})}var Be;"function"==typeof SuppressedError&&SuppressedError;const ke={mode:"open"},Ae={},je=new Set,Me=l(),Ee=new WeakMap,$e=new WeakMap,Pe=new WeakMap,Re=new WeakMap,Ie=new WeakMap,_e=new WeakMap;function Ve(e=customElements){if(e===customElements)return Fe.isRegistered;let t=Re.get(e);return t||(t={},Re.set(e,t)),t}function Le(e,t){var n,i;if($e.delete(e),void 0===e.template&&void 0!==t&&(e.template=t,null===(i=null===(n=e.lifecycleCallbacks)||void 0===n?void 0:n.templateDidUpdate)||void 0===i||i.call(n,e.name)),void 0!==e.template)return Pe.delete(e),Ee.delete(e),e.template}function De(e,t=e.registry,n){if(!(null==n?void 0:n.length))return;const i=e;let s=Ie.get(i);if(!(null==s?void 0:s.has(t))){void 0===s&&(s=new WeakSet,Ie.set(i,s)),s.add(t);for(const t of n)t(e)}}function He(e){var t;return null!==(t=_e.get(e))&&void 0!==t?t:null}function ze(e){if(void 0!==e.template)return Pe.delete(e),e.template;const t=$e.get(e);if(t)return t;const n=Ee.get(e);if(!n)return;let i;Pe.delete(e);try{i=n(e)}catch(t){throw Pe.set(e,t),t}if("function"==typeof(null==(s=i)?void 0:s.then)){const t=Promise.resolve(i).then(t=>Le(e,t)).catch(t=>{throw $e.delete(e),Pe.set(e,t),t});return $e.set(e,t),t}var s;return Le(e,i)}class Fe{get isDefined(){return this.platformDefined}constructor(e,i=e.definition){var s,r;this.platformDefined=!1,n(i)&&(i={name:i}),this.type=e,this.name=i.name,this.registry=null!==(s=i.registry)&&void 0!==s?s:customElements,r=i.template,t(r)?Ee.set(this,i.template):this.template=i.template;const o=e.prototype,a=ne.collect(e,i.attributes),l=new Array(a.length),c={},d={};for(let e=0,t=a.length;e<t;++e){const t=a[e];l[e]=t.attribute,c[t.name]=t,d[t.attribute]=t,U.defineProperty(o,t)}Reflect.defineProperty(e,"observedAttributes",{value:l,enumerable:!0}),this.attributes=a,this.propertyLookup=c,this.attributeLookup=d,this.shadowOptions=void 0===i.shadowOptions?ke:null===i.shadowOptions?void 0:Object.assign(Object.assign({},ke),i.shadowOptions),this.elementOptions=void 0===i.elementOptions?Ae:Object.assign(Object.assign({},Ae),i.elementOptions),this.styles=Te.normalize(i.styles),this.schema=i.schema,Me.register(this);const h=Ve(this.registry);Object.prototype.hasOwnProperty.call(h,this.name)||U.defineProperty(h,this.name),h[this.name]=this.type}define(e=this.registry,t){var n,i;const s=this.type;if(!e.get(this.name)){if(De(this,e,t),void 0===this.template&&Ee.has(this))return Promise.resolve().then(()=>ze(this)).then(t=>{var n,i;void 0===t||e.get(this.name)||(this.platformDefined=!0,e.define(this.name,s,this.elementOptions),null===(i=null===(n=this.lifecycleCallbacks)||void 0===n?void 0:n.elementDidDefine)||void 0===i||i.call(n,this.name))}).catch(e=>{!function(e,t){const n=e;void 0!==t?Pe.set(n,t):Pe.delete(n)}(this,e),U.notify(this,"template")}),this;this.platformDefined=!0,e.define(this.name,s,this.elementOptions),null===(i=null===(n=this.lifecycleCallbacks)||void 0===n?void 0:n.elementDidDefine)||void 0===i||i.call(n,this.name)}return this}static compose(e,t){const n=je.has(e)||Me.getByType(e)?new Be(class extends e{},t):new Be(e,t);return Promise.resolve(n)}static registerBaseType(e){je.add(e)}}Be=Fe,Fe.isRegistered={},Fe.getByType=Me.getByType,Fe.getForInstance=Me.getForInstance,Fe.register=(e,t=customElements)=>Ne(void 0,void 0,void 0,function*(){const n=Ve(t);return Object.prototype.hasOwnProperty.call(n,e)||U.defineProperty(n,e),new Promise(t=>{if(n[e])return void t(n[e]);const i=U.getNotifier(n),s={handleChange:()=>{const r=n[e];r&&(i.unsubscribe(s,e),t(r))}};i.subscribe(s,e)})}),U.defineProperty(Fe.prototype,"template");const Ue={bubbles:!0,composed:!0,cancelable:!0},We="isConnected",qe=new WeakMap,Qe=Symbol("fast-late-attribute-observer");function Je(e){var t,n;return null!==(n=null!==(t=e.shadowRoot)&&void 0!==t?t:qe.get(e))&&void 0!==n?n:null}let Ke;var Xe;!function(e){e[e.connecting=0]="connecting",e[e.connected=1]="connected",e[e.disconnecting=2]="disconnecting",e[e.disconnected=3]="disconnected"}(Xe||(Xe={}));class Ge{get isConnected(){return U.track(this,We),this.stage===Xe.connected}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:J.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&qe.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}constructor(e,t){this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this.isPrerendered=new Promise(e=>{this._resolvePrerendered=e}),this.isHydrated=new Promise(e=>{this._resolveHydrated=e}),this._template=null,this.stage=Xe.disconnected,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this._notifier=new $(e),this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const n=Reflect.getPrototypeOf(e),i=null===n?[]:U.getAccessors(n);if(i.length>0){const t=this.boundObservables=Object.create(null);for(let n=0,s=i.length;n<s;++n){const s=i[n].name,r=e[s];void 0!==r&&(delete e[s],t[s]=r)}0===Object.keys(t).length&&(this.boundObservables=null)}this.captureBoundObservables()}get subject(){return this._notifier.subject}notify(e){this._notifier.notify(e)}subscribe(e,t){this._notifier.subscribe(e,t)}unsubscribe(e,t){this._notifier.unsubscribe(e,t)}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,n;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,s=null!==(n=i.get(e))&&void 0!==n?n:0;0===s?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||this.stage!==Xe.connected&&this.stage!==Xe.connecting||e.connectedCallback(this)):i.set(e,s+1)}removeBehavior(e,t=!1){const n=this.behaviors;if(null===n)return;const i=n.get(e);void 0!==i&&(1===i||t?(n.delete(e),e.disconnectedCallback&&this.stage!==Xe.disconnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):n.set(e,i-1))}addStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=Je(n))&&void 0!==t?t:this.source).append(e)}else e.isAttachedTo(n)||e.addStylesTo(n)}removeStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=Je(n))&&void 0!==t?t:n).removeChild(e)}else e.isAttachedTo(n)&&e.removeStylesFrom(n)}connect(){this.stage===Xe.disconnected&&(this.stage=Xe.connecting,this.captureBoundObservables(),this.syncLateAttributes(),this.observeLateAttributes(),this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=Xe.connected,U.notify(this,We))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,n=Object.keys(t);for(let i=0,s=n.length;i<s;++i){const s=n[i];e[s]=t[s]}this.boundObservables=null}}captureBoundObservables(){const e=this.source,t=Object.getOwnPropertyNames(e),n=t=>{let n=Reflect.getPrototypeOf(e);for(;null!==n;){const e=Reflect.getOwnPropertyDescriptor(n,t);if((null==e?void 0:e.get)||(null==e?void 0:e.set))return!0;n=Reflect.getPrototypeOf(n)}return!1};let i=this.boundObservables;for(let s=0,r=t.length;s<r;++s){const r=t[s],o="_"===r[0]?r.slice(1):r;if(!n(o))continue;const a=e[o],l=r!==o,c=!(null===a||"object"!=typeof a||(null==a?void 0:a.$isProxy)||Array.isArray(a)&&(null==a?void 0:a.$fastController));void 0!==a?l&&!c||(delete e[r],(null!=i?i:i=this.boundObservables=Object.create(null))[o]=a):l||delete e[r]}}syncLateAttributes(){const e=He(this.definition);if(null!==e)for(const t of Object.keys(e))this.source.hasAttribute(t)&&this.onAttributeChangedCallback(t,null,this.source.getAttribute(t))}observeLateAttributes(){if(null===He(this.definition))return;const e=this.source;void 0===e[Qe]&&(e[Qe]=new MutationObserver(t=>{const n=e.$fastController,i=He(n.definition);if(null!==i)for(let s=0,r=t.length;s<r;++s){const r=t[s].attributeName;null!==r&&void 0!==i[r]&&n.onAttributeChangedCallback(r,null,e.getAttribute(r))}}),e[Qe].observe(e,{attributes:!0}))}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){this.stage===Xe.connected&&(this.stage=Xe.disconnecting,U.notify(this,We),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=Xe.disconnected)}onAttributeChangedCallback(e,t,n){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,n)}emit(e,t,n){return this.stage===Xe.connected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},Ue),n)))}renderTemplate(e){var t;const n=this.source,i=null!==(t=Je(n))&&void 0!==t?t:n;if(null!==this.view)this.view.dispose(),this.view=null;else if((!this.needsInitialization||this.hasExistingShadowRoot)&&(!this.hasExistingShadowRoot||!this.needsInitialization))for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e);if(e){const t=this.hasExistingShadowRoot&&this.needsInitialization;let s=!1;t&&Ge.hydrationHook&&(s=Ge.hydrationHook(this,e,n,i)),s||this.renderClientSide(e,n,i),this._resolvePrerendered(t),this._resolveHydrated(s)}else this.needsInitialization&&(this._resolvePrerendered(!1),this._resolveHydrated(!1))}renderClientSide(e,t,n){if(this.hasExistingShadowRoot){for(let e=n.firstChild;null!==e;e=n.firstChild)n.removeChild(e);this.hasExistingShadowRoot=!1}this.view=e.render(t,n,t),this.view.sourceLifetime=F.coupled}static forCustomElement(t,n=!1){const i=t.$fastController;if(void 0!==i&&!n)return i;const s=Fe.getForInstance(t);if(void 0===s)throw r.error(e.missingElementDefinition);return U.getNotifier(s).subscribe({handleChange:()=>{Ge.forCustomElement(t,!0),t.$fastController.connect()}},"template"),U.getNotifier(s).subscribe({handleChange:()=>{Ge.forCustomElement(t,!0),t.$fastController.connect()}},"shadowOptions"),t.$fastController=new Ke(t,s)}static setStrategy(e){Ke=e}static installHydrationHook(e){Ge.hydrationHook=e}}function Ye(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Je(e))&&void 0!==t?t:e.getRootNode()}Ge.hydrationHook=null,d(Ge),Ge.setStrategy(Ge);class Ze{constructor(e){const t=Ze.styleSheetCache;this.sheets=e.map(e=>{if(e instanceof CSSStyleSheet)return e;let n=t.get(e);return void 0===n&&(n=new CSSStyleSheet,n.replaceSync(e),t.set(e,n)),n})}addStylesTo(e){it(Ye(e),this.sheets)}removeStylesFrom(e){st(Ye(e),this.sheets)}}Ze.styleSheetCache=new Map;let et=0;function tt(e){return e===document?document.body:e}class nt{constructor(e){this.styles=e,this.styleClass="fast-"+ ++et}addStylesTo(e){e=tt(Ye(e));const t=this.styles,n=this.styleClass;for(let i=0;i<t.length;i++){const s=document.createElement("style");s.innerHTML=t[i],s.className=n,e.append(s)}}removeStylesFrom(e){const t=(e=tt(Ye(e))).querySelectorAll(`.${this.styleClass}`);for(let n=0,i=t.length;n<i;++n)e.removeChild(t[n])}}let it=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},st=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>-1===t.indexOf(e))};if(Te.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),it=(e,t)=>{e.adoptedStyleSheets.push(...t)},st=(e,t)=>{for(const n of t){const t=e.adoptedStyleSheets.indexOf(n);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}Te.setDefaultStrategy(Ze)}else Te.setDefaultStrategy(nt);function rt(e){const t=class extends e{constructor(){super(),Ge.forCustomElement(this)}$emit(e,t,n){return this.$fastController.emit(e,t,n)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,n){this.$fastController.onAttributeChangedCallback(e,t,n)}};return Fe.registerBaseType(t),t}function ot(e,n,i){Array.isArray(n)&&(i=n,n=void 0);return(t(e)?Fe.compose(e,n):Fe.compose(this,e)).then(e=>{De(e,e.registry,i);const t=ze(e);return"function"==typeof(null==(n=t)?void 0:n.then)?t.then(()=>e.define().type):e.define().type;var n})}const at=Object.assign(rt(HTMLElement),{from:function(e){return rt(e)},define:ot,compose:function(e,n){return t(e)?Fe.compose(e,n):Fe.compose(this,e)}});function lt(e){return function(t){ot(t,e)}}const ct=`fast-${Math.random().toString(36).substring(2,8)}`,dt=`${ct}{`,ht=`}${ct}`,ut=ht.length;let pt=0;const ft=()=>`${ct}-${++pt}`,gt=Object.freeze({interpolation:e=>`${dt}${e}${ht}`,attribute:e=>`${ft()}="${dt}${e}${ht}"`,comment:e=>`\x3c!--${dt}${e}${ht}--\x3e`}),bt=Object.freeze({parse(e,t){const n=e.split(dt);if(1===n.length)return null;const i=[];for(let e=0,s=n.length;e<s;++e){const s=n[e],r=s.indexOf(ht);let o;if(-1===r)o=s;else{const e=s.substring(0,r);i.push(t[e]),o=s.substring(r+ut)}""!==o&&i.push(o)}return i}}),vt=l(),mt=Object.freeze({getForInstance:vt.getForInstance,getByType:vt.getByType,define:(e,t)=>((t=t||{}).type=e,vt.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?v.tokenList:v.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=v.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=v.event;break;default:e.targetAspect=t,e.aspectType=v.attribute}else e.aspectType=v.content}});function yt(e){return function(t){mt.define(t,e)}}class wt{constructor(e){this.options=e}createHTML(e){return gt.attribute(e(this))}createBehavior(){return this}}d(wt);const Ct=e=>1===e.nodeType,St=e=>e?t=>1===t.nodeType&&t.matches(e):Ct;class Ot extends wt{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,a),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}class Tt extends Ot{constructor(e){super(e),this.observerProperty=Symbol(),e.childList=!0}observe(e){let t=e[this.observerProperty];if(!t){t=new MutationObserver((t,n)=>{this.updateTarget(this.getSource(e),this.computeNodes(e))}),t.toJSON=i,e[this.observerProperty]=t}t.observe(e,this.options)}disconnect(e){e[this.observerProperty].disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function xt(e){return n(e)&&(e={property:e}),new Tt(e)}mt.define(Tt);class Nt extends wt{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}mt.define(Nt);const Bt=e=>new Nt(e);function kt(e){return e&&e.nodeType===Node.COMMENT_NODE}const At=Object.freeze({attributeMarkerName:"data-fe",contentBindingStartMarker:()=>"fe:b",contentBindingEndMarker:()=>"fe:/b",repeatStartMarker:()=>"fe:r",repeatEndMarker:()=>"fe:/r",elementBoundaryStartMarker:()=>"fe:e",elementBoundaryEndMarker:()=>"fe:/e",isContentBindingStartMarker:e=>"fe:b"===e,isContentBindingEndMarker:e=>"fe:/b"===e,isRepeatViewStartMarker:e=>"fe:r"===e,isRepeatViewEndMarker:e=>"fe:/r"===e,isElementBoundaryStartMarker:e=>kt(e)&&"fe:e"===e.data,isElementBoundaryEndMarker:e=>kt(e)&&"fe:/e"===e.data,parseAttributeBindingCount(t){const n=t.getAttribute(this.attributeMarkerName);if(null===n)return null;const i=n.trim();if(!/^\d+$/.test(i))throw r.error(e.invalidHydrationAttributeMarker,{value:n});const s=parseInt(i,10);if(s<1)throw r.error(e.invalidHydrationAttributeMarker,{value:n});return s}}),jt=Symbol.for("fe-hydration");function Mt(e){return e[jt]===jt}class Et{constructor(e,t,n){this.index=e,this.removed=t,this.addedCount=n}adjustTo(e){let t=this.index;const n=e.length;return t>n?t=n-this.addedCount:t<0&&(t=n+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class $t{constructor(e){this.sorted=e}}const Pt=Object.freeze({reset:1,splice:2,optimized:3}),Rt=new Et(0,a,0);Rt.reset=!0;const It=[Rt];var _t;function Vt(e,t,n,i){return t<n||i<e?-1:t===n||i===e?0:e<n?t<i?t-n:i-n:i<t?i-e:t-e}function Lt(e,t,n,i,s,r){let o=0,l=0;const c=Math.min(n-t,r-s);if(0===t&&0===s&&(o=function(e,t,n){for(let i=0;i<n;++i)if(e[i]!==t[i])return i;return n}(e,i,c)),n===e.length&&r===i.length&&(l=function(e,t,n){let i=e.length,s=t.length,r=0;for(;r<n&&e[--i]===t[--s];)r++;return r}(e,i,c-o)),s+=o,r-=l,(n-=l)-(t+=o)===0&&r-s===0)return a;if(t===n){const e=new Et(t,[],0);for(;s<r;)e.removed.push(i[s++]);return[e]}if(s===r)return[new Et(t,[],n-t)];const d=function(e){let t=e.length-1,n=e[0].length-1,i=e[t][n];const s=[];for(;t>0||n>0;){if(0===t){s.push(_t.add),n--;continue}if(0===n){s.push(_t.delete),t--;continue}const r=e[t-1][n-1],o=e[t-1][n],a=e[t][n-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?s.push(_t.leave):(s.push(_t.update),i=r),t--,n--):l===o?(s.push(_t.delete),t--,i=o):(s.push(_t.add),n--,i=a)}return s.reverse()}(function(e,t,n,i,s,r){const o=r-s+1,a=n-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let n=1;n<o;++n)for(let r=1;r<a;++r)e[t+r-1]===i[s+n-1]?l[n][r]=l[n-1][r-1]:(c=l[n-1][r]+1,d=l[n][r-1]+1,l[n][r]=c<d?c:d);return l}(e,t,n,i,s,r)),h=[];let u,p=t,f=s;for(let e=0;e<d.length;++e)switch(d[e]){case _t.leave:void 0!==u&&(h.push(u),u=void 0),p++,f++;break;case _t.update:void 0===u&&(u=new Et(p,[],0)),u.addedCount++,p++,u.removed.push(i[f]),f++;break;case _t.add:void 0===u&&(u=new Et(p,[],0)),u.addedCount++,p++;break;case _t.delete:void 0===u&&(u=new Et(p,[],0)),u.removed.push(i[f]),f++}return void 0!==u&&h.push(u),h}function Dt(e,t){let n=!1,i=0;for(let s=0;s<t.length;s++){const r=t[s];if(r.index+=i,n)continue;const o=Vt(e.index,e.index+e.removed.length,r.index,r.index+r.addedCount);if(o>=0){t.splice(s,1),s--,i-=r.addedCount-r.removed.length,e.addedCount+=r.addedCount-o;const a=e.removed.length+r.removed.length-o;if(e.addedCount||a){let t=r.removed;if(e.index<r.index){const n=e.removed.slice(0,r.index-e.index);n.push(...t),t=n}if(e.index+e.removed.length>r.index+r.addedCount){const n=e.removed.slice(r.index+r.addedCount-e.index);t.push(...n)}e.removed=t,r.index<e.index&&(e.index=r.index)}else n=!0}else if(e.index<r.index){n=!0,t.splice(s,0,e),s++;const o=e.addedCount-e.removed.length;r.index+=o,i+=o}}n||t.push(e)}!function(e){e[e.leave=0]="leave",e[e.update=1]="update",e[e.add=2]="add",e[e.delete=3]="delete"}(_t||(_t={}));let Ht=Object.freeze({support:Pt.optimized,normalize:(e,t,n)=>void 0===e?void 0===n?a:function(e,t){let n=[];const i=[];for(let e=0,n=t.length;e<n;e++)Dt(t[e],i);for(let t=0,s=i.length;t<s;++t){const s=i[t];1!==s.addedCount||1!==s.removed.length?n=n.concat(Lt(e,s.index,s.index+s.addedCount,s.removed,0,s.removed.length)):s.removed[0]!==e[s.index]&&n.push(s)}return n}(t,n):It,pop(e,t,n,i){const s=e.length>0,r=n.apply(e,i);return s&&t.addSplice(new Et(e.length,[r],0)),r},push(e,t,n,i){const s=n.apply(e,i);return t.addSplice(new Et(e.length-i.length,[],i.length).adjustTo(e)),s},reverse(e,t,n,i){const s=n.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new $t(r)),s},shift(e,t,n,i){const s=e.length>0,r=n.apply(e,i);return s&&t.addSplice(new Et(0,[r],0)),r},sort(e,t,n,i){const s=new Map;for(let t=0,n=e.length;t<n;++t){const n=s.get(e[t])||[];s.set(e[t],[...n,t])}const r=n.apply(e,i);e.sorted++;const o=[];for(let t=0,n=e.length;t<n;++t){const n=s.get(e[t]);o.push(n[0]),s.set(e[t],n.splice(1))}return t.addSort(new $t(o)),r},splice(e,t,n,i){const s=n.apply(e,i);return t.addSplice(new Et(+i[0],s,i.length>2?i.length-2:0).adjustTo(e)),s},unshift(e,t,n,i){const s=n.apply(e,i);return t.addSplice(new Et(0,[],i.length).adjustTo(e)),s}});const zt=Object.freeze({reset:It,setDefaultStrategy(e){Ht=e}});function Ft(e,t,n,i=!0){Reflect.defineProperty(e,t,{value:n,enumerable:!1,writable:i})}class Ut extends E{get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,U.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,U.notify(e,"sorted"))}},this.subscribe(e)}return e}constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,Ft(e,"$fastController",this)}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,n=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===n||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==n?this.notify(n):this.notify((null!==(e=this._strategy)&&void 0!==e?e:Ht).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,z.enqueue(this))}}let Wt=!1;const qt=Object.freeze({sorted:0,enable(){if(Wt)return;Wt=!0,U.setArrayObserverFactory(e=>new Ut(e));const e=Array.prototype;e.$fastPatch||(Ft(e,"$fastPatch",1),Ft(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach(t=>{e[t.name]=function(...e){var n;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(n=i.strategy)&&void 0!==n?n:Ht)[t.name](this,i,t,e)}}))}});function Qt(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(qt.enable(),t=U.getNotifier(e)),U.track(t.lengthObserver,"length"),e.length}function Jt(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(qt.enable(),t=U.getNotifier(e)),U.track(t.sortObserver,"sorted"),e.sorted}class Kt extends Error{constructor(e,t,n){super(e),this.factories=t,this.node=n}}function Xt(e){return e.nodeType===Node.COMMENT_NODE}function Gt(e){return e.nodeType===Node.TEXT_NODE}function Yt(e,t){const n=document.createRange();return n.setStart(e,0),n.setEnd(t,Xt(t)||Gt(t)?t.data.length:t.childNodes.length),n}function Zt(e,t,n,i,s,r){var o,a,l,c;const d=[];let h=t.nextSibling();if(e.data="",null===h)throw new Kt(`Error hydrating content binding inside "${null!==(a=null===(o=e.getRootNode().host)||void 0===o?void 0:o.nodeName)&&void 0!==a?a:"unknown"}": no sibling found after content binding start marker.`,i,e);const u=h;let p=0;for(;null!==h;){if(Xt(h))if("fe:b"===h.data)p++;else if("fe:/b"===h.data){if(0===p)break;p--}d.push(h),h=t.nextSibling()}if(null===h)throw new Kt(`Error hydrating content binding inside "${null!==(c=null===(l=e.getRootNode().host)||void 0===l?void 0:l.nodeName)&&void 0!==c?c:"unknown"}": missing fe:/b end marker.`,i,e);if(h.data="",1===d.length&&Gt(d[0]))tn(n,d[0],s);else{h!==u&&null!==h.previousSibling&&(r[n.targetNodeId]={first:u,last:h.previousSibling});tn(n,h.parentNode.insertBefore(document.createTextNode(""),h),s)}}function en(e,t,n){var i,s;let r=0,o=e.nextSibling();for(;null!==o;){if(Xt(o))if("fe:e"===o.data)o.data="",r++;else if("fe:/e"===o.data){if(0===r)return void(o.data="");o.data="",r--}o=e.nextSibling()}throw new Kt(`HydrationView could not find the end of an element boundary inside ${null!==(s=null===(i=n.getRootNode().host)||void 0===i?void 0:i.nodeName)&&void 0!==s?s:"unknown"}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,n)}function tn(e,t,n){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");n[e.targetNodeId]=t}function nn(e,t){const n=e.parentNode;let i,s=e;for(;s!==t;){if(i=s.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);n.removeChild(s),s=i}n.removeChild(t)}class sn{constructor(){this.index=0,this.length=0}get event(){return J.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class rn extends sn{constructor(e,t,n){super(),this.fragment=e,this.factories=t,this.targets=n,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=F.unknown,this._skipAttrUpdates=!1,this.isPrerendered=Promise.resolve(!1),this.isHydrated=Promise.resolve(!1),this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const n=e.parentNode;let i,s=this.firstChild;for(;s!==t;)i=s.nextSibling,n.insertBefore(s,e),s=i;n.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,e.appendChild(i),i=n;e.appendChild(t)}dispose(){nn(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t,this.behaviors=n=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),n[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,n=e.length;t<n;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){nn(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,n=e.length;t<n;++t)e[t].unbind()}}}var on;d(rn),U.defineProperty(rn.prototype,"index"),U.defineProperty(rn.prototype,"length");const an="unhydrated",ln="hydrating",cn="hydrated";class dn extends Error{constructor(e,t,n,i){super(e),this.factory=t,this.fragment=n,this.templateString=i}}on=jt,d(class extends sn{get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}constructor(e,t,n,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=n,this.hostBindingTarget=i,this[on]=jt,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=F.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=an,this._bindingViewBoundaries={},this._targets={},this.factories=n.compile().factories}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const n=e.parentNode;let i,s=this.firstChild;for(;s!==t;)i=s.nextSibling,n.insertBefore(s,e),s=i;n.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let n,i=this.firstChild;for(;i!==t;){if(n=i.nextSibling,!n)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=n}e.appendChild(t)}bind(e,t=this){var n;if(this.hydrationStage!==cn&&(this._hydrationStage=ln),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,n){var i,s;const r=Yt(e,t),o=r.commonAncestorContainer,a=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===r.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),l={},c={};let d=function(e){let t=0;for(let n=0,i=e.length;n<i&&"h"===e[n].targetNodeId;++n)t++;return t}(n),h=a.currentNode=e;for(;null!==h;){switch(h.nodeType){case Node.ELEMENT_NODE:{const e=At.parseAttributeBindingCount(h);if(null!==e){for(let t=0;t<e;t++){const e=n[d++];if(!e)throw new Kt(`HydrationView was unable to successfully target factory on ${h.nodeName} inside ${h.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,n,h);tn(e,h,l)}h.removeAttribute(At.attributeMarkerName)}break}case Node.COMMENT_NODE:{const e=h.data;if("fe:e"===e)h.data="",en(a,n,h);else if("fe:b"===e){const e=n[d++];if(!e)throw new Kt(`HydrationView ran out of factories while processing a content binding marker inside ${null!==(s=null===(i=h.getRootNode().host)||void 0===i?void 0:i.nodeName)&&void 0!==s?s:"unknown"}. This likely indicates a template mismatch between SSR rendering and hydration.`,n,h);Zt(h,a,e,n,l,c)}break}}h=a.nextNode()}return r.detach(),{targets:l,boundaries:c}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Kt){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const s=this.factories;for(let e=0,t=s.length;e<t;++e){const t=s[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&tn(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const i=(null===(n=this.firstChild)||void 0===n?void 0:n.getRootNode()).host,s=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==i?void 0:i.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),s.sourceAspect&&r.push(` - Source aspect: "${s.sourceAspect}"`),void 0!==s.aspectType&&r.push(` - Aspect type: ${s.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new dn(r.join("\n"),t,Yt(this.firstChild,this.lastChild).cloneContents(),e)}{const n=t.createBehavior();n.bind(this),i[e]=n}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=i.length;e<t;++e)i[e].bind(this)}this.isBound=!0,this._hydrationStage=cn}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){nn(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,n=e.length;t<n;++t)e[t].unbind(this);e.length=0}});const hn=Object.freeze({positioning:!1,recycle:!0});function un(e,t,n,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[n])}function pn(e,t,n,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=n,e.bind(t[n])}function fn(e){return e.nodeType===Node.COMMENT_NODE}class gn extends Error{constructor(e,t){super(e),this.propertyBag=t}}class bn{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=un,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=pn)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Mt(this.template)&&Mt(e)&&e.hydrationStage!==cn?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=a);const t=this.itemsObserver,n=this.itemsObserver=U.getNotifier(this.items),i=t!==n;i&&null!==t&&t.unsubscribe(this),(i||e)&&n.subscribe(this)}updateSortedViews(e){const t=this.views;for(let n=0,i=e.length;n<i;++n){const i=e[n].sorted.slice(),s=i.slice().sort();for(let e=0,n=i.length;e<n;++e){const n=i.find(t=>i[e]===s[t]);if(n!==e){const i=s.splice(n,1);s.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[n].remove(),t[n].insertBefore(o);const a=t.splice(n,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,n=this.bindView,i=this.items,s=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let p=0,f=h.index;const g=f+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;f<g;++f){const e=t[f],d=e?e.firstChild:this.location;let h;o&&c>0?(p<=v&&b.length>0?(h=b[p],p++):(h=a[l],l++),c--):h=s.create(),t.splice(f,0,h),n(h,i,f,r),h.insertBefore(d)}b[p]&&a.push(...b.slice(p))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,n=t.length;e<n;++e){const i=t[e].context;i.length=n,i.index=e}}refreshAllViews(e=!1){const t=this.items,n=this.template,i=this.location,s=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(rn.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=n.create();s(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new gn(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map(e=>e?"hydrated":"empty"),viewTemplateString:t.serializeToString(n.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}s(i,t,e,r)}else{const o=n.create();s(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,n=e.length;t<n;++t){const n=e[t];if(!n){const n=new XMLSerializer;throw new gn(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map(e=>e?"hydrated":"empty"),rootNodeContent:n.serializeToString(this.location.getRootNode())})}n.unbind()}}hydrateViews(e){if(!this.items)return;const t=this.items.length;this.views=new Array(t);const n=[];let i=this.location.previousSibling;for(;null!==i;){if(!fn(i)||"fe:/r"!==i.data){i=i.previousSibling;continue}i.data="";const e=i.previousSibling;if(!e)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let t=e,s=0;for(;null!==t;){if(fn(t))if("fe:/r"===t.data)s++;else if("fe:r"===t.data){if(0===s){const s=t;s.data="",i=s.previousSibling;const r=s.nextSibling,o=e===s?r:e;n.push({start:r,end:o});break}s--}t=t.previousSibling}if(!t)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": repeat start marker not found.`)}n.reverse();for(let i=0;i<n.length&&i<t;i++){const{start:t,end:s}=n[i],r=e.hydrate(t,s);this.views[i]=r,this.bindView(r,this.items,i,this.controller)}}}class vn{createHTML(e){return gt.comment(e(this))}constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.options=n,qt.enable()}createBehavior(){return new bn(this)}}function mn(e,t,n=hn){const i=de(e),s=de(t);return new vn(i,s,Object.assign(Object.assign({},hn),n))}mt.define(vn);const yn="slotchange";class wn extends Ot{observe(e){e.addEventListener(yn,this)}disconnect(e){e.removeEventListener(yn,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Cn(e){return n(e)&&(e={property:e}),new wn(e)}mt.define(wn);const Sn=()=>null;function On(e){return void 0===e?Sn:t(e)?e:()=>e}function Tn(e,n,i){const s=t(e)?e:()=>e,r=On(n),o=On(i);return(e,t)=>s(e,t)?r(e,t):o(e,t)}const xn="$fast_context",Nn="$fast_parent_contexts",Bn="$defs",kn="$ref",An=new Map;class jn{constructor(e){this.customElementName=e,this.schemaMap=new Map,An.set(e,this.schemaMap)}addPath(e){var t,n,i;const s=this.getSplitPath(e.pathConfig.path);let r=this.schemaMap.get(e.rootPropertyName),o=null;switch(r||(this.addNewSchema(e.rootPropertyName),r=this.schemaMap.get(e.rootPropertyName)),e.childrenMap&&(o=this.getSchemaId(e.childrenMap.customElementName,e.childrenMap.attributeName),1===s.length&&(r.anyOf?r.anyOf.push({[kn]:o}):r.anyOf=[{[kn]:o}])),e.pathConfig.type){case"default":case"access":s.length>1&&(null===e.pathConfig.currentContext?this.addPropertiesToAnObject(r,s.slice(1),e.pathConfig.currentContext,o):((null===(t=r[Bn])||void 0===t?void 0:t[s[0]])||(r[Bn]=Object.assign(Object.assign({},r[Bn]),{[s[0]]:{}})),this.addPropertiesToAContext(r[Bn][s[0]],s.slice(1),e.pathConfig.currentContext,o)));break;case"repeat":if(this.addContext(r,s[s.length-1],e.pathConfig.currentContext,e.pathConfig.parentContext),s.length>2){let t=r;const i=!!e.pathConfig.parentContext;i&&(t=this.addPropertiesToAnObject(null===(n=r[Bn])||void 0===n?void 0:n[e.pathConfig.parentContext],s.slice(1,-1),e.pathConfig.parentContext,o)),this.addPropertiesToAnObject(t,i?s.slice(2):s.slice(1),e.pathConfig.currentContext,o,"array")}else if(s.length>1){let t;e.pathConfig.parentContext&&(t=null===(i=null==r?void 0:r[Bn])||void 0===i?void 0:i[e.pathConfig.parentContext]),this.addPropertiesToAnObject(null!=t?t:r,s.slice(1),e.pathConfig.currentContext,o,"array")}else r.type="array",r[kn]=this.getDefsPath(e.pathConfig.currentContext)}}getSchema(e){var t;return null!==(t=this.schemaMap.get(e))&&void 0!==t?t:null}getRootProperties(){return this.schemaMap.keys()}getSplitPath(e){return e.split(".")}getDefsPath(e){return`#/${Bn}/${e}`}getSchemaId(e,t){return`https://fast.design/schemas/${e}/${t}.json`}addNewSchema(e){this.schemaMap.set(e,{$schema:"https://json-schema.org/draft/2019-09/schema",$id:this.getSchemaId(this.customElementName,e),[Bn]:{}})}addPropertiesToAContext(e,t,n,i){e.type="object",e.properties&&!e.properties[t[0]]?e.properties[t[0]]={}:e.properties||(e.properties={[t[0]]:{}}),t.length>1?this.addPropertiesToAnObject(e.properties[t[0]],t.slice(1),n,i):i&&(e.properties[t[0]].anyOf?e.properties[t[0]].anyOf.push({[kn]:i}):e.properties[t[0]].anyOf=[{[kn]:i}])}addPropertiesToAnObject(e,t,n,i,s="object"){return e.type="object",e.properties&&!e.properties[t[0]]?e.properties[t[0]]={}:e.properties||(e.properties={[t[0]]:{}}),"object"===s&&t.length>1?this.addPropertiesToAnObject(e.properties[t[0]],t.slice(1),n,i,s):"array"===s?t.length>1?this.addPropertiesToAnObject(e.properties[t[0]],t.slice(1),n,i,s):this.addArrayToAnObject(e.properties[t[0]],n):(e.properties[t[0]].anyOf&&i?e.properties[t[0]].anyOf.push({[kn]:i}):i&&(e.properties[t[0]].anyOf=[{[kn]:i}]),e.properties[t[0]])}addArrayToAnObject(e,t){return e.type="array",e.items={[kn]:this.getDefsPath(t)},e.items}addContext(e,t,n,i){e[Bn][n]||(e[Bn][n]={[xn]:t,[Nn]:this.getParentContexts(e,i)})}getParentContexts(e,t,n=[]){var i;if(null===t)return[null,...n];const s=null===(i=null==e?void 0:e[Bn])||void 0===i?void 0:i[t][Nn];return this.getParentContexts(e,s[s.length-1],[t,...n])}}function Mn(e,t,n,i,s){if(function(e,t){return null!=e&&"object"==typeof e&&!t.has(e)}(e,s))if(s.add(e),Array.isArray(e)){n.visitArray(e,i);for(const r of e)Mn(r,t,n,i,s)}else{n.visitObject(e,i);for(const r in e){const o=e[r];n.visitProperty(e,r,o,i),t&&Mn(o,t,n,i,s)}}}const En=new WeakSet,$n={visitObject:i,visitArray:i,visitProperty(e,t,n){Reflect.defineProperty(e,t,{enumerable:!0,get:()=>(U.track(e,t),n),set(i){n!==i&&(n=i,U.notify(e,t))}})}};function Pn(e,t=!1){return Mn(e,t,$n,void 0,En),e}const Rn={deep:!1};function In(e,t=Rn){var i;n(t)&&(t={deep:!1,name:t});const s=Pn({value:e},t.deep),r=()=>s.value;return Object.defineProperty(r,"current",{get:()=>s.value,set:e=>s.value=e}),Object.defineProperty(r,"name",{value:null!==(i=t.name)&&void 0!==i?i:"SharedState"}),r.set=e=>s.value=e,r.asReadonly=()=>{const e=()=>s.value;return Object.defineProperty(e,"current",{get:()=>s.value}),Object.defineProperty(e,"name",{value:`${r.name} (Readonly)`}),Object.freeze(e)},r}function _n(e,i=Rn){var s;if(n(i)&&(i={deep:!1,name:i}),!t(e)){const t=e;e=()=>t}const r=new WeakMap,o=t=>{let n=r.get(t);return void 0===n&&(n=Pn({value:e()},i.deep),r.set(t,n)),n},a=e=>o(e).value;return Object.defineProperty(a,"name",{value:null!==(s=i.name)&&void 0!==s?s:"OwnedState"}),a.set=(e,t)=>o(e).value=t,a.asReadonly=()=>{const e=e=>o(e).value;return Object.defineProperty(e,"name",{value:`${a.name} (Readonly)`}),Object.freeze(e)},a}function Vn(e,t="ComputedState"){let n=null;const i=e({on:{setup(e){n=e}}}),s=Pn({value:null},!1),r=()=>s.value;let o;Object.defineProperty(r,"current",{get:()=>s.value}),Object.defineProperty(r,"name",{value:t});const a={handleChange(){s.value=o.observe(null)}};let l,c;if(o=U.binding(i,a),o.setMode(!1),n){const e={handleChange(){l&&l(),l=c.observe(null),s.value=i()}};c=U.binding(n,e),c.setMode(!1),l=c.observe(null)}return s.value=o.observe(null),r.dispose=()=>{l&&l(),c&&c.dispose(),o.dispose()},r.subscribe=e=>{o.subscribe(e)},r.unsubscribe=e=>{o.unsubscribe(e)},r}function Ln(e,t){const n=U.getNotifier(e);n.subscribe(t.subscriber),t.notifiers.push(n)}const Dn={visitProperty:i,visitObject:Ln,visitArray:Ln};function Hn(e,n){const i={notifiers:[],subscriber:t(n)?{handleChange:n}:n};return qt.enable(),Mn(e,!0,Dn,i,new Set),{dispose(){for(const e of i.notifiers)e.unsubscribe(i.subscriber)}}}const zn=l(),Fn=Object.freeze({getForInstance:zn.getForInstance,getByType:zn.getByType,define:e=>(zn.register({type:e}),e)});function Un(){return function(e){Fn.define(e)}}function Wn(e,t){const n=[];let i="";for(let s=0,r=e.length-1;s<r;++s){i+=e[s];let r=t[s];void 0!==Fn.getForInstance(r)&&(r=r.createCSS()),r instanceof Te||r instanceof CSSStyleSheet?(""!==i.trim()&&(n.push(i),i=""),n.push(r)):i+=r}return i+=e[e.length-1],""!==i.trim()&&n.push(i),n}const qn=(e,...t)=>new Te(Wn(e,t));class Qn{constructor(e){this.value=0===e.length?"":1===e.length?e[0]:new Te(e)}createCSS(){return this.value}}Fn.define(Qn),qn.partial=(e,...t)=>new Qn(Wn(e,t));const Jn={[v.attribute]:S.setAttribute,[v.booleanAttribute]:S.setBooleanAttribute,[v.property]:(e,t,n)=>e[t]=n,[v.content]:function(e,t,n,i){if(null==n&&(n=""),function(e){return void 0!==e.create}(n)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Mt(i)&&Mt(n)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==cn){const e=i.bindingViewBoundaries[this.targetNodeId];t=n.hydrate(e.first,e.last)}else t=n.create();else e.$fastTemplate!==n&&(t.isComposed&&(t.remove(),t.unbind()),t=n.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=n)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=n}},[v.tokenList]:function(e,t,n){var i;const s=`${this.id}-t`,r=null!==(i=e[s])&&void 0!==i?i:e[s]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=n&&n.length){const e=n.split(/\s+/);for(let t=0,n=e.length;t<n;++t){const n=e[t];""!==n&&(o[n]=a,l.add(n))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[v.event]:()=>{}};class Kn{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=v.content}createHTML(e){return gt.interpolation(e(this))}createBehavior(){var t;if(null===this.updateTarget){const n=Jn[this.aspectType],i=null!==(t=this.dataBinding.policy)&&void 0!==t?t:this.policy;if(!n)throw r.error(e.unsupportedBindingBehavior);this.data=`${this.id}-d`,this.updateTarget=i.protect(this.targetTagName,this.aspectType,this.targetAspect,n)}return this}bind(e){var t;const n=e.targets[this.targetNodeId];switch(this.aspectType){case v.event:n[this.data]=e,n.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case v.content:e.onUnbind(this);default:{const i=null!==(t=n[this.data])&&void 0!==t?t:n[this.data]=this.dataBinding.createObserver(this,this);i.target=n,i.controller=e;const s=i.bind(e);if(e._skipAttrUpdates&&(this.aspectType===v.attribute||this.aspectType===v.booleanAttribute))break;this.updateTarget(n,this.targetAspect,s,e);break}}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){J.setEvent(e);const n=this.dataBinding.evaluate(t.source,t.context);J.setEvent(null),!0!==n&&e.preventDefault()}}handleChange(e,t){const n=t.controller;if(!n.isBound)return;const i=t.target;this.updateTarget(i,this.targetAspect,t.bind(n),n)}}mt.define(Kn,{aspected:!0});const Xn=(e,t)=>`${e}.${t}`,Gn={},Yn={index:0,node:null};function Zn(t){t.startsWith("fast-")||r.warn(e.hostBindingWithoutHost,{name:t})}const ei=new Proxy(document.createElement("div"),{get(e,n){Zn(n);const i=Reflect.get(e,n);return t(i)?i.bind(e):i},set:(e,t,n)=>(Zn(t),Reflect.set(e,t,n))});class ti{constructor(e,t,n){this.fragment=e,this.directives=t,this.policy=n,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,n,i,s){var r,o;this.nodeIds.has(n)||(this.nodeIds.add(n),this.addTargetDescriptor(t,n,i)),e.id=null!==(r=e.id)&&void 0!==r?r:ft(),e.targetNodeId=n,e.targetTagName=s,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,n){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),n=e.substring(0,t),i=parseInt(e.substring(t+1),10);this.addTargetDescriptor(n,e,i)}let s=Gn[t];if(!s){const i=`_${t}`;Gn[t]=s={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[n]}}}i[t]=s}createView(e){const t=this.fragment.cloneNode(!0),n=Object.create(this.proto);n.r=t,n.h=null!=e?e:ei;for(const e of this.nodeIds)Reflect.get(n,e);return new rn(t,this.factories,n)}}function ni(e,t,n,i,s,r=!1){const o=n.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=bt.parse(h,a);let p=null;null===u?r&&(p=new Kn(oe(()=>h,e.policy)),mt.assignAspect(p,d.name)):p=oi.aggregate(u,e.policy),null!==p&&(n.removeAttributeNode(d),l--,c--,e.addFactory(p,t,i,s,n.tagName))}}function ii(e,t,n){let i=0,s=t.firstChild;for(;s;){const t=si(e,n,s,i);s=t.node,i=t.index}}function si(e,t,i,s){const r=Xn(t,s);switch(i.nodeType){case 1:ni(e,t,i,r,s),ii(e,i,r);break;case 3:return function(e,t,i,s,r){const o=bt.parse(t.textContent,e.directives);if(null===o)return Yn.node=t.nextSibling,Yn.index=r+1,Yn;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,s=Xn(i,r),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),n(c)?a.textContent=c:(a.textContent=" ",mt.assignAspect(c),e.addFactory(c,i,s,r,null)),l=a}return Yn.index=r+1,Yn.node=l.nextSibling,Yn}(e,i,t,r,s);case 8:{const n=bt.parse(i.data,e.directives);null!==n&&e.addFactory(oi.aggregate(n),t,r,s,null);break}}return Yn.index=s+1,Yn.node=i.nextSibling,Yn}const ri="TEMPLATE",oi={compile(e,t,i=S.policy){let s;if(n(e)){s=document.createElement(ri),s.innerHTML=i.createHTML(e);const t=s.content.firstElementChild;null!==t&&t.tagName===ri&&(s=t)}else s=e;s.content.firstChild||s.content.lastChild||s.content.appendChild(document.createComment(""));const r=document.adoptNode(s.content),o=new ti(r,t,i);var a,l;return ni(o,"",s,"h",0,!0),a=r.firstChild,l=t,(a&&8===a.nodeType&&null!==bt.parse(a.data,l)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),ii(o,r,"r"),Yn.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=S.policy){if(1===e.length)return e[0];let i,s,r=!1;const o=e.length,a=e.map(e=>n(e)?()=>e:(i=e.sourceAspect||i,r=r||e.dataBinding.isVolatile,s=s||e.dataBinding.policy,e.dataBinding.evaluate)),l=new Kn(le((e,t)=>{let n="";for(let i=0;i<o;++i)n+=a[i](e,t);return n},null!=s?s:t,r));return mt.assignAspect(l,i),l}},ai=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,li=Object.create(null);class ci{constructor(e,t=li){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const n in t)e(t[n]);return this.html}}function di(e,t,n,i=mt.getForInstance(e)){if(i.aspected){const n=ai.exec(t);null!==n&&mt.assignAspect(e,n[2])}return e.createHTML(n)}ci.empty=new ci(""),mt.define(ci);class hi{constructor(e,t={},n){this.policy=n,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=oi.compile(this.html,this.factories,this.policy)),this.result}inline(){return new ci(n(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(t){if(this.result)throw r.error(e.cannotSetTemplatePolicyAfterCompilation);if(this.policy)throw r.error(e.onlySetTemplatePolicyOnce);return this.policy=t,this}render(e,t,n){const i=this.create(n);return i.bind(e),i.appendTo(t),i}create(e){return this.compile().createView(e)}static create(e,n,i){let s="";const r=Object.create(null),o=e=>{var t;const n=null!==(t=e.id)&&void 0!==t?t:e.id=ft();return r[n]=e,n};for(let i=0,r=e.length-1;i<r;++i){const r=e[i];let a,l=n[i];if(s+=r,t(l))l=new Kn(le(l));else if(l instanceof se)l=new Kn(l);else if(!(a=mt.getForInstance(l))){const e=l;l=new Kn(oe(()=>e))}s+=di(l,r,o,a)}return new hi(s+e[e.length-1],r,i)}}d(hi);const ui=(t,...n)=>{if(Array.isArray(t)&&Array.isArray(t.raw))return hi.create(t,n);throw r.error(e.directCallToHTMLTagNotAllowed)};ui.partial=e=>new ci(e);class pi{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Mt(this.template)&&Mt(e)&&e.hydrationStage!==cn&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){this.controller.isBound&&(t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView())}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class fi{constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=n}createHTML(e){return gt.comment(e(this))}createBehavior(){return new pi(this)}}mt.define(fi);const gi=new Map,bi=ui`
2
2
  &nbsp;
3
- `;function ln(e){return void 0===e?an:e.template}function cn(e,t){if(e)return function(e,t){const n=rn.get(e);if(void 0!==n)return n[null!=t?t:on]}(e.constructor,t)}class dn{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function hn(e,t){let n,s;n=void 0===e?de((e=>e)):he(e);let i=!1;if(void 0===t)i=!0,s=de(((e,t)=>{var s;const i=n.evaluate(e,t);return i instanceof Node?null!==(s=i.$fastTemplate)&&void 0!==s?s:new dn(i):ln(cn(i))}));else if(d(t))s=ae(((e,s)=>{var i;let r=t(e,s);return h(r)?r=ln(cn(n.evaluate(e,s),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new dn(r)),r}),void 0,!0);else if(h(t))i=!0,s=de(((e,s)=>{var i;const r=n.evaluate(e,s);return r instanceof Node?null!==(i=r.$fastTemplate)&&void 0!==i?i:new dn(r):ln(cn(r,t))}));else if(t instanceof re){const e=t.evaluate;t.evaluate=(t,s)=>{var i;let r=e(t,s);return h(r)?r=ln(cn(n.evaluate(t,s),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new dn(r)),r},s=t}else s=de(((e,n)=>t));return new sn(n,s,i)}const un=Object.freeze({positioning:!1,recycle:!0});function pn(e,t,n,s){e.context.parent=s.source,e.context.parentContext=s.context,e.bind(t[n])}function fn(e,t,n,s){e.context.parent=s.source,e.context.parentContext=s.context,e.context.length=t.length,e.context.index=n,e.bind(t[n])}function gn(e){return e.nodeType===Node.COMMENT_NODE}class bn extends Error{constructor(e,t){super(e),this.propertyBag=t}}class vn{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=pn,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=fn)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),tt(this.template)&&tt(e)&&e.hydrationStage!==bt?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=g);const t=this.itemsObserver,n=this.itemsObserver=D.getNotifier(this.items),s=t!==n;s&&null!==t&&t.unsubscribe(this),(s||e)&&n.subscribe(this)}updateSortedViews(e){const t=this.views;for(let n=0,s=e.length;n<s;++n){const s=e[n].sorted.slice(),i=s.slice().sort();for(let e=0,n=s.length;e<n;++e){const n=s.find((t=>s[e]===i[t]));if(n!==e){const s=i.splice(n,1);i.splice(e,0,...s);const r=t[e],o=r?r.firstChild:this.location;t[n].remove(),t[n].insertBefore(o);const a=t.splice(n,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,n=this.bindView,s=this.items,i=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let p=0,f=h.index;const g=f+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;f<g;++f){const e=t[f],d=e?e.firstChild:this.location;let h;o&&c>0?(p<=v&&b.length>0?(h=b[p],p++):(h=a[l],l++),c--):h=i.create(),t.splice(f,0,h),n(h,s,f,r),h.insertBefore(d)}b[p]&&a.push(...b.slice(p))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,n=t.length;e<n;++e){const s=t[e].context;s.length=n,s.index=e}}refreshAllViews(e=!1){const t=this.items,n=this.template,s=this.location,i=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(pt.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=n.create();i(o,t,e,r),a[e]=o,o.insertBefore(s)}}else{let e=0;for(;e<o;++e)if(e<l){const s=a[e];if(!s){const t=new XMLSerializer;throw new bn(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(n.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}i(s,t,e,r)}else{const o=n.create();i(o,t,e,r),a.push(o),o.insertBefore(s)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,n=e.length;t<n;++t){const n=e[t];if(!n){const n=new XMLSerializer;throw new bn(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:n.serializeToString(this.location.getRootNode())})}n.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!gn(t)){t=t.previousSibling;continue}const n=Xe.parseRepeatEndMarker(t.data);if(null===n){t=t.previousSibling;continue}t.data="";const s=t.previousSibling;if(!s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let i=s,r=0;for(;null!==i;){if(gn(i))if(Xe.isRepeatViewEndMarker(i.data))r++;else if(Xe.isRepeatViewStartMarker(i.data)){if(!r){if(Xe.parseRepeatStartMarker(i.data)!==n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);i.data="",t=i.previousSibling,i=i.nextSibling;const r=e.hydrate(i,s);this.views[n]=r,this.bindView(r,this.items,n,this.controller);break}r--}i=i.previousSibling}if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class mn{createHTML(e){return Ee.comment(e(this))}constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.options=n,ne.enable()}createBehavior(){return new vn(this)}}function yn(e,t,n=un){const s=he(e),i=he(t);return new mn(s,i,Object.assign(Object.assign({},un),n))}je.define(mn);const wn="slotchange";class Cn extends Fe{observe(e){e.addEventListener(wn,this)}disconnect(e){e.removeEventListener(wn,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Sn(e){return h(e)&&(e={property:e}),new Cn(e)}je.define(Cn);const Tn=()=>null;function On(e){return void 0===e?Tn:d(e)?e:()=>e}function xn(e,t,n){const s=d(e)?e:()=>e,i=On(t),r=On(n);return(e,t)=>s(e,t)?i(e,t):r(e,t)}class $n extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}const Bn={bubbles:!0,composed:!0,cancelable:!0},kn="isConnected",Nn=new WeakMap;function An(e){var t,n;return null!==(n=null!==(t=e.shadowRoot)&&void 0!==t?t:Nn.get(e))&&void 0!==n?n:null}let Mn;var En;!function(e){e[e.connecting=0]="connecting",e[e.connected=1]="connected",e[e.disconnecting=2]="disconnecting",e[e.disconnected=3]="disconnected"}(En||(En={}));class In extends j{get isConnected(){return D.track(this,kn),this.stage===En.connected}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:P.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&Nn.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=En.disconnected,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const n=D.getAccessors(e);if(n.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,i=n.length;s<i;++s){const i=n[s].name,r=e[i];void 0!==r&&(delete e[i],t[i]=r)}}}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,n;const s=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,i=null!==(n=s.get(e))&&void 0!==n?n:0;0===i?(s.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||this.stage!==En.connected&&this.stage!==En.connecting||e.connectedCallback(this)):s.set(e,i+1)}removeBehavior(e,t=!1){const n=this.behaviors;if(null===n)return;const s=n.get(e);void 0!==s&&(1===s||t?(n.delete(e),e.disconnectedCallback&&this.stage!==En.disconnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):n.set(e,s-1))}addStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=An(n))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(n)){const t=e.behaviors;if(e.addStylesTo(n),null!==t)for(let e=0,n=t.length;e<n;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=An(n))&&void 0!==t?t:n).removeChild(e)}else if(e.isAttachedTo(n)){const t=e.behaviors;if(e.removeStylesFrom(n),null!==t)for(let e=0,n=t.length;e<n;++e)this.removeBehavior(t[e])}}connect(){this.stage===En.disconnected&&(this.stage=En.connecting,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=En.connected,D.notify(this,kn))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,n=Object.keys(t);for(let s=0,i=n.length;s<i;++s){const i=n[s];e[i]=t[i]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){this.stage===En.connected&&(this.stage=En.disconnecting,D.notify(this,kn),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=En.disconnected)}onAttributeChangedCallback(e,t,n){const s=this.definition.attributeLookup[e];void 0!==s&&s.onAttributeChangedCallback(this.source,n)}emit(e,t,n){return this.stage===En.connected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},Bn),n)))}renderTemplate(e){var t;const n=this.source,s=null!==(t=An(n))&&void 0!==t?t:n;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=s.firstChild;null!==e;e=s.firstChild)s.removeChild(e)}e&&(this.view=e.render(n,s,n),this.view.sourceLifetime=_.coupled)}static forCustomElement(e,t=!1){const n=e.$fastController;if(void 0!==n&&!t)return n;const s=Kt.getForInstance(e);if(void 0===s)throw f.error(c.missingElementDefinition);return D.getNotifier(s).subscribe({handleChange:()=>{In.forCustomElement(e,!0),e.$fastController.connect()}},"template"),D.getNotifier(s).subscribe({handleChange:()=>{In.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new Mn(e,s)}static setStrategy(e){Mn=e}}function Rn(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=An(e))&&void 0!==t?t:e.getRootNode()}m(In),In.setStrategy(In);class jn{constructor(e){const t=jn.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let n=t.get(e);return void 0===n&&(n=new CSSStyleSheet,n.replaceSync(e),t.set(e,n)),n}))}addStylesTo(e){Ln(Rn(e),this.sheets)}removeStylesFrom(e){Fn(Rn(e),this.sheets)}}jn.styleSheetCache=new Map;let Vn=0;function _n(e){return e===document?document.body:e}class Dn{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Vn}addStylesTo(e){e=_n(Rn(e));const t=this.styles,n=this.styleClass;for(let s=0;s<t.length;s++){const i=document.createElement("style");i.innerHTML=t[s],i.className=n,e.append(i)}}removeStylesFrom(e){const t=(e=_n(Rn(e))).querySelectorAll(`.${this.styleClass}`);for(let n=0,s=t.length;n<s;++n)e.removeChild(t[n])}}let Ln=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Fn=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ye.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Ln=(e,t)=>{e.adoptedStyleSheets.push(...t)},Fn=(e,t)=>{for(const n of t){const t=e.adoptedStyleSheets.indexOf(n);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ye.setDefaultStrategy(jn)}else ye.setDefaultStrategy(Dn);const Hn="needs-hydration";class Pn extends In{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===Jt.deferAndHydrate&&(this.source.toggleAttribute(nt,!0),this.source.toggleAttribute(Hn,!0))}addHydratingInstance(){if(!Pn.hydratingInstances)return;const e=this.definition.name;let t=Pn.hydratingInstances.get(e);t||(t=new Set,Pn.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return Pn.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(nt)||(Pn.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,n,s;if(e.didTimeout)Pn.idleCallbackId=requestIdleCallback(Pn.checkHydrationComplete,{timeout:50});else if(0===(null===(t=Pn.hydratingInstances)||void 0===t?void 0:t.size)){try{null===(s=(n=Pn.lifecycleCallbacks).hydrationComplete)||void 0===s||s.call(n)}catch(e){}In.setStrategy(In)}}connect(){var e,t,n,s,i,r,o;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Hn),this.needsHydration&&this.addHydratingInstance(),this.source.hasAttribute(nt))return this.addHydratingInstance(),void Pn.hydrationObserver.observe(this.source,{attributeFilter:[nt]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(this.stage===En.disconnected){if(!Pn.hydrationStarted){Pn.hydrationStarted=!0;try{null===(n=(t=Pn.lifecycleCallbacks).hydrationStarted)||void 0===n||n.call(t)}catch(e){}}try{null===(i=(s=Pn.lifecycleCallbacks).elementWillHydrate)||void 0===i||i.call(s,this.source)}catch(e){}if(this.stage=En.connecting,this.bindObservables(),this.connectBehaviors(),this.template)if(tt(this.template)){const e=this.source,t=null!==(r=An(e))&&void 0!==r?r:e;let n=t.firstChild,s=t.lastChild;null===e.shadowRoot&&(Xe.isElementBoundaryStartMarker(n)&&(n.data="",n=n.nextSibling),Xe.isElementBoundaryEndMarker(s)&&(s.data="",s=s.previousSibling)),this.view=this.template.hydrate(n,s,e),null===(o=this.view)||void 0===o||o.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=En.connected,this.source.removeAttribute(Hn),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),D.notify(this,kn)}}removeHydratingInstance(){var e,t;if(!Pn.hydratingInstances)return;try{null===(t=(e=Pn.lifecycleCallbacks).elementDidHydrate)||void 0===t||t.call(e,this.source)}catch(e){}const n=this.definition.name,s=Pn.hydratingInstances.get(n);s&&(s.delete(this.source),s.size||Pn.hydratingInstances.delete(n),Pn.idleCallbackId&&cancelIdleCallback(Pn.idleCallbackId),Pn.idleCallbackId=requestIdleCallback(Pn.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),Pn.hydrationObserver.unobserve(this.source)}static install(){In.setStrategy(Pn)}}function zn(e){const t=class extends e{constructor(){super(),In.forCustomElement(this)}$emit(e,t,n){return this.$fastController.emit(e,t,n)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,n){this.$fastController.onAttributeChangedCallback(e,t,n)}};return Kt.registerBaseType(t),t}function Un(e,t){return d(e)?Kt.compose(e,t).define().type:Kt.compose(this,e).define().type}Pn.hydrationObserver=new $n(Pn.hydrationObserverHandler),Pn.lifecycleCallbacks={},Pn.hydrationStarted=!1,Pn.idleCallbackId=null,Pn.hydratingInstances=new Map;const qn=Object.assign(zn(HTMLElement),{from:function(e){return zn(e)},define:Un,compose:function(e,t){return d(e)?Kt.compose(e,t):Kt.compose(this,e)},defineAsync:function(e,t){return d(e)?new Promise((n=>{Kt.composeAsync(e,t).then((e=>{n(e)}))})).then((e=>e.define().type)):new Promise((t=>{Kt.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Wn(e){return function(t){Un(t,e)}}O.setPolicy(I.create());export{ne as ArrayObserver,Vt as AttributeConfiguration,Ht as AttributeDefinition,re as Binding,be as CSSBindingDirective,pe as CSSDirective,He as ChildrenDirective,At as Compiler,O as DOM,y as DOMAspect,In as ElementController,ye as ElementStyles,P as ExecutionContext,f as FAST,qn as FASTElement,Kt as FASTElementDefinition,yt as HTMLBindingDirective,je as HTMLDirective,pt as HTMLView,Pn as HydratableElementController,vt as HydrationBindingError,Yt as InlineTemplateDirective,Ee as Markup,Fe as NodeObservationDirective,D as Observable,Ie as Parser,j as PropertyChangeNotifier,Mt as RefDirective,nn as RenderBehavior,sn as RenderDirective,vn as RepeatBehavior,mn as RepeatDirective,Cn as SlottedDirective,U as Sort,_ as SourceLifetime,z as Splice,Y as SpliceStrategy,q as SpliceStrategySupport,En as Stages,_e as StatelessAttachedAttributeDirective,R as SubscriberSet,Jt as TemplateOptions,V as Updates,en as ViewTemplate,Pt as attr,_t as booleanConverter,Pe as children,Oe as css,fe as cssDirective,Wn as customElement,nt as deferHydrationAttribute,Le as elements,g as emptyArray,Qt as fastElementRegistry,tn as html,Ve as htmlDirective,tt as isHydratable,se as lengthOf,le as listener,Hn as needsHydrationAttribute,he as normalizeBinding,Dt as nullableBooleanConverter,Ft as nullableNumberConverter,L as observable,de as oneTime,ae as oneWay,Et as ref,hn as render,yn as repeat,Sn as slotted,ie as sortedCount,F as volatile,xn as when};
3
+ `;function vi(e){return void 0===e?bi:e.template}function mi(e,t){if(e)return function(e,t){const n=gi.get(e);if(void 0!==n)return n[null!=t?t:"default-view"]}(e.constructor,t)}class yi{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function wi(e,i){let s,r;s=void 0===e?oe(e=>e):de(e);let o=!1;if(void 0===i)o=!0,r=oe((e,t)=>{var n;const i=s.evaluate(e,t);return i instanceof Node?null!==(n=i.$fastTemplate)&&void 0!==n?n:new yi(i):vi(mi(i))});else if(t(i))r=le((e,t)=>{var r;let o=i(e,t);return n(o)?o=vi(mi(s.evaluate(e,t),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new yi(o)),o},void 0,!0);else if(n(i))o=!0,r=oe((e,t)=>{var n;const r=s.evaluate(e,t);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new yi(r):vi(mi(r,i))});else if(i instanceof se){const e=i.evaluate;i.evaluate=(t,i)=>{var r;let o=e(t,i);return n(o)?o=vi(mi(s.evaluate(t,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new yi(o)),o},r=i}else r=oe((e,t)=>i);return new fi(s,r,o)}function Ci(e){const t=e.parentElement;if(t)return t;{const t=e.getRootNode();if(t.host instanceof HTMLElement)return t.host}return null}function Si(e,t){let n=t;for(;null!==n;){if(n===e)return!0;n=Ci(n)}return!1}class Oi extends MutationObserver{constructor(e){super(function(e){this.callback.call(null,e.filter(e=>this.observedNodes.has(e.target)))}),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}const Ti=Object.freeze({create(e){const t=[],n={};let i=null,s=!1;return{source:e,context:J.default,targets:n,get isBound(){return s},addBehaviorFactory(e,t){var n,i,s,r;const o=e;o.id=null!==(n=o.id)&&void 0!==n?n:ft(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:ft(),o.targetTagName=null!==(s=t.tagName)&&void 0!==s?s:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:S.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){n[e]=t},addBehavior(e){t.push(e),s&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){s||(s=!0,t.forEach(e=>e.bind(this)))},disconnectedCallback(e){s&&(s=!1,null!==i&&i.forEach(e=>e.unbind(this)))}}}});b(),S.setPolicy(M.create());export{qt as ArrayObserver,G as AttributeConfiguration,ne as AttributeDefinition,se as Binding,Fn as CSSDirective,Tt as ChildrenDirective,oi as Compiler,S as DOM,v as DOMAspect,M as DOMPolicy,sn as DefaultExecutionContext,Ge as ElementController,Te as ElementStyles,J as ExecutionContext,r as FAST,at as FASTElement,Fe as FASTElementDefinition,Kn as HTMLBindingDirective,mt as HTMLDirective,rn as HTMLView,ci as InlineTemplateDirective,gt as Markup,Ot as NodeObservationDirective,U as Observable,bt as Parser,$ as PropertyChangeNotifier,Nt as RefDirective,pi as RenderBehavior,fi as RenderDirective,bn as RepeatBehavior,vn as RepeatDirective,jn as Schema,ue as Signal,wn as SlottedDirective,$t as Sort,F as SourceLifetime,Et as Splice,zt as SpliceStrategy,Pt as SpliceStrategySupport,Xe as Stages,wt as StatelessAttachedAttributeDirective,E as SubscriberSet,me as TwoWaySettings,Oi as UnobservableMutationObserver,z as Updates,Ti as ViewBehaviorOrchestrator,hi as ViewTemplate,ie as attr,Y as booleanConverter,xt as children,Si as composedContains,Ci as composedParent,Vn as computedState,qn as css,Un as cssDirective,lt as customElement,St as elements,a as emptyArray,b as enableDebug,Me as fastElementRegistry,ui as html,yt as htmlDirective,Qt as lengthOf,ce as listener,de as normalizeBinding,Z as nullableBooleanConverter,te as nullableNumberConverter,W as observable,oe as oneTime,le as oneWay,_n as ownedState,Pn as reactive,Bt as ref,wi as render,mn as repeat,An as schemaRegistry,ge as signal,Cn as slotted,Jt as sortedCount,In as state,Ce as twoWay,q as volatile,Hn as watch,Tn as when};