ember-source 7.1.0-alpha.4 → 7.1.0-alpha.5

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 (481) hide show
  1. package/build-metadata.json +3 -3
  2. package/dist/dev/packages/@ember/-internals/container/index.js +4 -401
  3. package/dist/dev/packages/@ember/-internals/deprecations/index.js +1 -1
  4. package/dist/dev/packages/@ember/-internals/environment/index.js +3 -161
  5. package/dist/dev/packages/@ember/-internals/glimmer/index.js +14 -15
  6. package/dist/dev/packages/@ember/-internals/meta/lib/meta.js +0 -1
  7. package/dist/dev/packages/@ember/-internals/metal/index.js +18 -9
  8. package/dist/dev/packages/@ember/-internals/routing/index.js +1 -10
  9. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +10 -12
  10. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -10
  11. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -10
  12. package/dist/dev/packages/@ember/-internals/string/index.js +0 -1
  13. package/dist/dev/packages/@ember/-internals/utils/index.js +8 -3
  14. package/dist/dev/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +0 -1
  15. package/dist/dev/packages/@ember/-internals/views/lib/mixins/action_support.js +3 -12
  16. package/dist/dev/packages/@ember/-internals/views/lib/system/event_dispatcher.js +2 -11
  17. package/dist/dev/packages/@ember/-internals/views/lib/system/utils.js +1 -1
  18. package/dist/dev/packages/@ember/-internals/views/lib/views/core_view.js +1 -18
  19. package/dist/dev/packages/@ember/-internals/views/lib/views/states.js +1 -1
  20. package/dist/dev/packages/@ember/application/index.js +5 -28
  21. package/dist/dev/packages/@ember/application/instance.js +3 -22
  22. package/dist/dev/packages/@ember/application/namespace.js +4 -11
  23. package/dist/dev/packages/@ember/array/index.js +7 -15
  24. package/dist/dev/packages/@ember/array/proxy.js +10 -14
  25. package/dist/dev/packages/@ember/canary-features/index.js +1 -1
  26. package/dist/dev/packages/@ember/component/helper.js +1 -14
  27. package/dist/dev/packages/@ember/component/index.js +1355 -16
  28. package/dist/dev/packages/@ember/component/template-only.js +1 -9
  29. package/dist/dev/packages/@ember/controller/index.js +3 -19
  30. package/dist/dev/packages/@ember/debug/container-debug-adapter.js +0 -19
  31. package/dist/dev/packages/@ember/debug/data-adapter.js +4 -11
  32. package/dist/dev/packages/@ember/debug/index.js +1 -1
  33. package/dist/dev/packages/@ember/debug/lib/deprecate.js +1 -1
  34. package/dist/dev/packages/@ember/engine/index.js +3 -29
  35. package/dist/dev/packages/@ember/engine/instance.js +3 -8
  36. package/dist/dev/packages/@ember/helper/index.js +169 -21
  37. package/dist/dev/packages/@ember/instrumentation/index.js +1 -1
  38. package/dist/dev/packages/@ember/modifier/index.js +2 -16
  39. package/dist/dev/packages/@ember/modifier/on.js +1 -9
  40. package/dist/dev/packages/@ember/object/-internals.js +3 -11
  41. package/dist/dev/packages/@ember/object/compat.js +3 -10
  42. package/dist/dev/packages/@ember/object/computed.js +2 -12
  43. package/dist/dev/packages/@ember/object/core.js +10 -18
  44. package/dist/dev/packages/@ember/object/evented.js +2 -12
  45. package/dist/dev/packages/@ember/object/events.js +1 -11
  46. package/dist/dev/packages/@ember/object/index.js +10 -14
  47. package/dist/dev/packages/@ember/object/internals.js +1 -1
  48. package/dist/dev/packages/@ember/object/lib/computed/computed_macros.js +6 -23
  49. package/dist/dev/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -12
  50. package/dist/dev/packages/@ember/object/mixin.js +7 -10
  51. package/dist/dev/packages/@ember/object/observable.js +8 -12
  52. package/dist/dev/packages/@ember/object/observers.js +1 -11
  53. package/dist/dev/packages/@ember/object/promise-proxy-mixin.js +3 -13
  54. package/dist/dev/packages/@ember/object/proxy.js +0 -7
  55. package/dist/dev/packages/@ember/reactive/collections.js +589 -1
  56. package/dist/dev/packages/@ember/renderer/index.js +1 -14
  57. package/dist/dev/packages/@ember/routing/-internals.js +1 -10
  58. package/dist/dev/packages/@ember/routing/index.js +614 -14
  59. package/dist/dev/packages/@ember/routing/lib/generate_controller.js +2 -11
  60. package/dist/dev/packages/@ember/routing/lib/routing-service.js +7 -17
  61. package/dist/dev/packages/@ember/routing/lib/utils.js +2 -11
  62. package/dist/dev/packages/@ember/routing/route.js +12 -23
  63. package/dist/dev/packages/@ember/routing/router-service.js +8 -17
  64. package/dist/dev/packages/@ember/routing/router.js +5 -21
  65. package/dist/dev/packages/@ember/runloop/index.js +1 -10
  66. package/dist/dev/packages/@ember/service/index.js +1 -11
  67. package/dist/dev/packages/@ember/template/index.js +1 -14
  68. package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +12 -15
  69. package/dist/dev/packages/@ember/template-compiler/lib/dasherize-component-name.js +0 -1
  70. package/dist/dev/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +13 -60
  71. package/dist/dev/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
  72. package/dist/dev/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +1 -3
  73. package/dist/dev/packages/@ember/template-compiler/lib/template.js +2 -10
  74. package/dist/dev/packages/@ember/template-factory/index.js +1 -8
  75. package/dist/dev/packages/@ember/utils/lib/compare.js +0 -7
  76. package/dist/dev/packages/@ember/utils/lib/is_empty.js +1 -12
  77. package/dist/dev/packages/@glimmer/manager/index.js +4 -314
  78. package/dist/dev/packages/@glimmer/node/index.js +3 -11
  79. package/dist/dev/packages/@glimmer/opcode-compiler/index.js +5 -7
  80. package/dist/dev/packages/@glimmer/program/index.js +194 -3
  81. package/dist/dev/packages/@glimmer/reference/index.js +4 -5
  82. package/dist/dev/packages/@glimmer/runtime/index.js +17 -10
  83. package/dist/dev/packages/@glimmer/tracking/index.js +2 -11
  84. package/dist/dev/packages/@glimmer/tracking/primitives/cache/index.js +1 -11
  85. package/dist/dev/packages/@glimmer/util/index.js +1 -2
  86. package/dist/dev/packages/@glimmer/validator/index.js +4 -1253
  87. package/dist/dev/packages/@glimmer/vm/index.js +1 -1
  88. package/dist/dev/packages/@glimmer/wire-format/index.js +3 -65
  89. package/dist/dev/packages/ember/version.js +1 -1
  90. package/dist/dev/packages/ember-template-compiler/index.js +7 -7
  91. package/dist/dev/packages/shared-chunks/{alias-CSC0WIbj.js → alias-ZcMQckQV.js} +8 -4
  92. package/dist/dev/packages/shared-chunks/api-AYt3zE12.js +310 -0
  93. package/dist/dev/packages/shared-chunks/{api-BQMslHhq.js → api-WvJPuo9z.js} +4 -5
  94. package/dist/dev/packages/shared-chunks/{args-proxy-DgXMc9b5.js → args-proxy-BNLuRFlO.js} +2 -4
  95. package/dist/dev/packages/shared-chunks/{array-D8PfjQHi.js → array-Bh_kUjzy.js} +2 -1
  96. package/dist/dev/packages/shared-chunks/cache-B7dqAS38.js +596 -0
  97. package/dist/dev/packages/shared-chunks/{capabilities-O_xc7Yqk.js → capabilities-CZkuOqqC.js} +0 -5
  98. package/dist/dev/packages/shared-chunks/chain-tags-D6tuFUj_.js +190 -0
  99. package/dist/dev/packages/shared-chunks/{collections-D_nY_0UJ.js → collections-DPkjqeA3.js} +0 -1
  100. package/dist/dev/packages/shared-chunks/{compiler-D1leQ3Gl.js → compiler-CXB_8GdR.js} +7043 -234
  101. package/dist/dev/packages/shared-chunks/computed-CJnghmXC.js +980 -0
  102. package/dist/dev/packages/shared-chunks/container-BzzHmCNj.js +404 -0
  103. package/dist/dev/packages/shared-chunks/curly-CvC8E_4-.js +617 -0
  104. package/dist/dev/packages/shared-chunks/{fragment-Cc5k9Oy4.js → curried-BVwSNqpf.js} +5 -288
  105. package/dist/dev/packages/shared-chunks/decorator-B5Uh5NFI.js +135 -0
  106. package/dist/dev/packages/shared-chunks/element-C-QcIABg.js +109 -0
  107. package/dist/dev/packages/shared-chunks/element-builder-kHVx0F__.js +812 -0
  108. package/dist/dev/packages/shared-chunks/env-g-kaAFLN.js +161 -0
  109. package/dist/dev/packages/shared-chunks/events-6aFVjD4k.js +180 -0
  110. package/dist/dev/packages/shared-chunks/get-CpJjYeJO.js +138 -0
  111. package/dist/dev/packages/shared-chunks/get-debug-name-CSniHBsn.js +45 -0
  112. package/dist/dev/packages/shared-chunks/get_properties-CIm8IAtP.js +55 -0
  113. package/dist/dev/packages/shared-chunks/guid-Cbq2sNV_.js +123 -0
  114. package/dist/dev/packages/shared-chunks/hash-D3BENmhU.js +192 -0
  115. package/dist/dev/packages/shared-chunks/helper-DlC4YesW.js +314 -0
  116. package/dist/dev/packages/shared-chunks/index-CTxkmV78.js +2500 -0
  117. package/dist/dev/packages/shared-chunks/index-D-xTBV4B.js +220 -0
  118. package/dist/dev/packages/shared-chunks/{index-BUPd6pkm.js → index-DmGmwWPJ.js} +29 -29
  119. package/dist/dev/packages/shared-chunks/injected_property-B4T-FzZZ.js +70 -0
  120. package/dist/dev/packages/shared-chunks/intern-zquhAEIg.js +51 -0
  121. package/dist/dev/packages/shared-chunks/internal-CbQSKXEm.js +140 -0
  122. package/dist/dev/packages/shared-chunks/internal-helper-Dsl9_7H_.js +7 -0
  123. package/dist/dev/packages/shared-chunks/{neq-DujMPv1k.js → invoke-B6j6DdDz.js} +4 -32
  124. package/dist/{prod/packages/shared-chunks/is_proxy-Cr1qlMv_.js → dev/packages/shared-chunks/is_proxy-Bzg0d4m4.js} +1 -1
  125. package/dist/dev/packages/shared-chunks/libraries-CHBwbR72.js +79 -0
  126. package/dist/dev/packages/shared-chunks/mandatory-setter-BpbAMTzV.js +107 -0
  127. package/dist/dev/packages/shared-chunks/meta-BmRXesrk.js +46 -0
  128. package/dist/{prod/packages/shared-chunks/name-C68GLLO3.js → dev/packages/shared-chunks/name-Clp4Vsod.js} +1 -1
  129. package/dist/dev/packages/shared-chunks/{namespace_search-uT8odThF.js → namespace_search-BfvzEQzN.js} +1 -2
  130. package/dist/dev/packages/shared-chunks/normalize-CKySQVU7.js +84 -0
  131. package/dist/dev/packages/shared-chunks/observers-C2DurkLG.js +199 -0
  132. package/dist/dev/packages/shared-chunks/on-D8QwT-eN.js +253 -0
  133. package/dist/dev/packages/shared-chunks/opcode-metadata-9iSW5JGP.js +285 -0
  134. package/dist/dev/packages/shared-chunks/opcodes-CplRyHl_.js +50 -0
  135. package/dist/dev/packages/shared-chunks/or-DBU9Ge4r.js +118 -0
  136. package/dist/{prod/packages/shared-chunks/program-B7SJZ5NF.js → dev/packages/shared-chunks/program-DzAfcWFj.js} +1 -1
  137. package/dist/{prod/packages/shared-chunks/program-context-DFiwaPMR.js → dev/packages/shared-chunks/program-context-CqcQMsfa.js} +3 -3
  138. package/dist/dev/packages/shared-chunks/property_get-CIBS9umw.js +139 -0
  139. package/dist/dev/packages/shared-chunks/{property_set-DaoZXGM5.js → property_set-D3PKyisF.js} +4 -2
  140. package/dist/dev/packages/shared-chunks/props-fiqxqhAH.js +85 -0
  141. package/dist/dev/packages/shared-chunks/{reference-C3TKDRnP.js → reference-BoPB2LfI.js} +3 -4
  142. package/dist/dev/packages/shared-chunks/{registers-ylirb0dq.js → registers-DoamZwaG.js} +1 -1
  143. package/dist/{prod/packages/shared-chunks/rehydrate-builder-D3t52iGR.js → dev/packages/shared-chunks/rehydrate-builder-DdzXTaJk.js} +7 -4
  144. package/dist/dev/packages/shared-chunks/{render-DCchifOK.js → render-DDdabL30.js} +510 -15
  145. package/dist/{prod/packages/shared-chunks/serialize-builder-iXiRs1Pg.js → dev/packages/shared-chunks/serialize-builder-B3u9Wr3n.js} +2 -7
  146. package/dist/dev/packages/shared-chunks/set_properties-BghuuGJx.js +48 -0
  147. package/dist/dev/packages/shared-chunks/{setup-registry-DxchCIL2.js → setup-registry-XxD0xvgf.js} +34 -14
  148. package/dist/dev/packages/shared-chunks/spec-BXl1reqK.js +16 -0
  149. package/dist/dev/packages/shared-chunks/super-BBBjgF69.js +91 -0
  150. package/dist/dev/packages/shared-chunks/template-BRrQR6KS.js +16 -0
  151. package/dist/dev/packages/shared-chunks/template-only-Yluyu0DY.js +78 -0
  152. package/dist/dev/packages/shared-chunks/textarea-C0Us0PNJ.js +468 -0
  153. package/dist/dev/packages/shared-chunks/tracked-CKE4wnE6.js +148 -0
  154. package/dist/dev/packages/shared-chunks/tracked-data-CGnA4ytZ.js +31 -0
  155. package/dist/dev/packages/shared-chunks/transform-resolutions-h1ik8gqW.js +645 -0
  156. package/dist/dev/packages/shared-chunks/unique-id-A83bjEE-.js +32 -0
  157. package/dist/{prod/packages/shared-chunks/on-CersD7PL.js → dev/packages/shared-chunks/untouchable-this-cH6_N2LJ.js} +215 -1397
  158. package/dist/dev/packages/shared-chunks/well-known-_EVO9RaV.js +17 -0
  159. package/dist/prod/packages/@ember/-internals/container/index.js +5 -315
  160. package/dist/prod/packages/@ember/-internals/deprecations/index.js +1 -1
  161. package/dist/prod/packages/@ember/-internals/environment/index.js +3 -158
  162. package/dist/prod/packages/@ember/-internals/glimmer/index.js +14 -13
  163. package/dist/prod/packages/@ember/-internals/meta/lib/meta.js +1 -2
  164. package/dist/prod/packages/@ember/-internals/metal/index.js +19 -13
  165. package/dist/prod/packages/@ember/-internals/routing/index.js +2 -6
  166. package/dist/prod/packages/@ember/-internals/runtime/lib/ext/rsvp.js +1 -1
  167. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +10 -10
  168. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +2 -6
  169. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js +1 -1
  170. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -6
  171. package/dist/prod/packages/@ember/-internals/string/index.js +0 -2
  172. package/dist/prod/packages/@ember/-internals/utils/index.js +33 -30
  173. package/dist/prod/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +0 -2
  174. package/dist/prod/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -6
  175. package/dist/prod/packages/@ember/-internals/views/lib/system/event_dispatcher.js +3 -7
  176. package/dist/prod/packages/@ember/-internals/views/lib/system/utils.js +2 -2
  177. package/dist/prod/packages/@ember/-internals/views/lib/views/core_view.js +1 -14
  178. package/dist/prod/packages/@ember/-internals/views/lib/views/states.js +1 -2
  179. package/dist/prod/packages/@ember/application/index.js +5 -24
  180. package/dist/prod/packages/@ember/application/instance.js +6 -18
  181. package/dist/prod/packages/@ember/application/namespace.js +5 -8
  182. package/dist/prod/packages/@ember/array/index.js +8 -12
  183. package/dist/prod/packages/@ember/array/proxy.js +10 -10
  184. package/dist/prod/packages/@ember/canary-features/index.js +1 -1
  185. package/dist/prod/packages/@ember/component/helper.js +1 -12
  186. package/dist/prod/packages/@ember/component/index.js +1292 -15
  187. package/dist/prod/packages/@ember/component/template-only.js +1 -6
  188. package/dist/prod/packages/@ember/controller/index.js +3 -16
  189. package/dist/prod/packages/@ember/debug/container-debug-adapter.js +1 -15
  190. package/dist/prod/packages/@ember/debug/data-adapter.js +5 -7
  191. package/dist/prod/packages/@ember/debug/index.js +1 -1
  192. package/dist/prod/packages/@ember/debug/lib/deprecate.js +1 -1
  193. package/dist/prod/packages/@ember/engine/index.js +4 -25
  194. package/dist/prod/packages/@ember/engine/instance.js +4 -9
  195. package/dist/prod/packages/@ember/helper/index.js +169 -19
  196. package/dist/prod/packages/@ember/instrumentation/index.js +1 -1
  197. package/dist/prod/packages/@ember/modifier/index.js +2 -14
  198. package/dist/prod/packages/@ember/modifier/on.js +1 -6
  199. package/dist/prod/packages/@ember/object/-internals.js +3 -6
  200. package/dist/prod/packages/@ember/object/compat.js +4 -7
  201. package/dist/prod/packages/@ember/object/computed.js +2 -8
  202. package/dist/prod/packages/@ember/object/core.js +9 -15
  203. package/dist/prod/packages/@ember/object/evented.js +2 -7
  204. package/dist/prod/packages/@ember/object/events.js +1 -6
  205. package/dist/prod/packages/@ember/object/index.js +10 -12
  206. package/dist/prod/packages/@ember/object/internals.js +3 -6
  207. package/dist/prod/packages/@ember/object/lib/computed/computed_macros.js +6 -20
  208. package/dist/prod/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -9
  209. package/dist/prod/packages/@ember/object/mixin.js +7 -9
  210. package/dist/prod/packages/@ember/object/observable.js +8 -9
  211. package/dist/prod/packages/@ember/object/observers.js +1 -6
  212. package/dist/prod/packages/@ember/object/promise-proxy-mixin.js +3 -9
  213. package/dist/prod/packages/@ember/object/proxy.js +0 -7
  214. package/dist/prod/packages/@ember/reactive/collections.js +589 -1
  215. package/dist/prod/packages/@ember/renderer/index.js +1 -12
  216. package/dist/prod/packages/@ember/routing/history-location.js +1 -1
  217. package/dist/prod/packages/@ember/routing/index.js +581 -12
  218. package/dist/prod/packages/@ember/routing/lib/dsl.js +1 -1
  219. package/dist/prod/packages/@ember/routing/lib/generate_controller.js +2 -6
  220. package/dist/prod/packages/@ember/routing/lib/routing-service.js +5 -14
  221. package/dist/prod/packages/@ember/routing/lib/utils.js +2 -6
  222. package/dist/prod/packages/@ember/routing/none-location.js +1 -1
  223. package/dist/prod/packages/@ember/routing/route.js +12 -21
  224. package/dist/prod/packages/@ember/routing/router-service.js +6 -14
  225. package/dist/prod/packages/@ember/routing/router.js +5 -17
  226. package/dist/prod/packages/@ember/runloop/index.js +2 -6
  227. package/dist/prod/packages/@ember/service/index.js +1 -7
  228. package/dist/prod/packages/@ember/template/index.js +1 -12
  229. package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +13 -14
  230. package/dist/prod/packages/@ember/template-compiler/lib/dasherize-component-name.js +0 -2
  231. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-against-attrs.js +1 -1
  232. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-against-named-outlets.js +1 -1
  233. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.js +1 -1
  234. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.js +1 -1
  235. package/dist/prod/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +13 -60
  236. package/dist/prod/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
  237. package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-each-track-array.js +1 -1
  238. package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-in-element.js +1 -1
  239. package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +127 -4
  240. package/dist/prod/packages/@ember/template-compiler/lib/template.js +2 -7
  241. package/dist/prod/packages/@ember/template-factory/index.js +1 -5
  242. package/dist/prod/packages/@ember/utils/lib/compare.js +1 -8
  243. package/dist/prod/packages/@ember/utils/lib/is_empty.js +1 -7
  244. package/dist/prod/packages/@glimmer/manager/index.js +4 -292
  245. package/dist/prod/packages/@glimmer/node/index.js +3 -8
  246. package/dist/prod/packages/@glimmer/opcode-compiler/index.js +5 -5
  247. package/dist/prod/packages/@glimmer/program/index.js +194 -3
  248. package/dist/prod/packages/@glimmer/reference/index.js +4 -4
  249. package/dist/prod/packages/@glimmer/runtime/index.js +16 -8
  250. package/dist/prod/packages/@glimmer/tracking/index.js +2 -7
  251. package/dist/prod/packages/@glimmer/tracking/primitives/cache/index.js +1 -6
  252. package/dist/prod/packages/@glimmer/util/index.js +2 -2
  253. package/dist/prod/packages/@glimmer/validator/index.js +5 -1016
  254. package/dist/prod/packages/@glimmer/vm/index.js +1 -1
  255. package/dist/prod/packages/@glimmer/wire-format/index.js +3 -65
  256. package/dist/prod/packages/ember/version.js +1 -1
  257. package/dist/prod/packages/ember-template-compiler/index.js +5 -7
  258. package/dist/prod/packages/shared-chunks/{alias-BLBQkche.js → alias-CLuFeKoV.js} +8 -6
  259. package/dist/prod/packages/shared-chunks/api-CM1trl_4.js +289 -0
  260. package/dist/prod/packages/shared-chunks/{api-B5UrgITK.js → api-zh_k31vb.js} +4 -5
  261. package/dist/prod/packages/shared-chunks/{args-proxy-Dl0A0YWI.js → args-proxy-BDXbXCF9.js} +2 -2
  262. package/dist/prod/packages/shared-chunks/{array-kVQfzrQn.js → array-DHdr4__s.js} +3 -3
  263. package/dist/prod/packages/shared-chunks/assert-CUCJBR2C.js +19 -0
  264. package/dist/prod/packages/shared-chunks/cache-BIlOoPA7.js +371 -0
  265. package/dist/prod/packages/shared-chunks/{capabilities-DXA-L0iT.js → capabilities-_5e35539.js} +0 -3
  266. package/dist/prod/packages/shared-chunks/chain-tags-BJqcuCM1.js +179 -0
  267. package/dist/prod/packages/shared-chunks/{compiler-Bbki2GT_.js → compiler-DjQtTQGk.js} +7045 -193
  268. package/dist/prod/packages/shared-chunks/{namespace_search-Dcdalhj6.js → computed-2Udcmflw.js} +109 -239
  269. package/dist/prod/packages/shared-chunks/container-D5NwW5Fd.js +316 -0
  270. package/dist/prod/packages/shared-chunks/curly-BsqvV8G0.js +546 -0
  271. package/dist/prod/packages/shared-chunks/{fragment-D7nBU9ae.js → curried-BVwSNqpf.js} +6 -303
  272. package/dist/prod/packages/shared-chunks/debug-render-tree-BLtnOSbb.js +2049 -0
  273. package/dist/prod/packages/shared-chunks/{decorator-BdDDBUd2.js → decorator-DBCISop4.js} +1 -1
  274. package/dist/prod/packages/shared-chunks/element-BjFr0tO0.js +101 -0
  275. package/dist/prod/packages/shared-chunks/{element-builder-CzXb9l1W.js → element-builder-BPjq0rxK.js} +109 -88
  276. package/dist/prod/packages/shared-chunks/env-DXxsTFkM.js +158 -0
  277. package/dist/prod/packages/shared-chunks/events-970OxD6Q.js +175 -0
  278. package/dist/prod/packages/shared-chunks/get-D5wxdTkY.js +138 -0
  279. package/dist/prod/packages/shared-chunks/get_properties-BcAC5sGx.js +55 -0
  280. package/dist/prod/packages/shared-chunks/guid-Cbq2sNV_.js +123 -0
  281. package/dist/prod/packages/shared-chunks/hash-DcUe-meU.js +192 -0
  282. package/dist/prod/packages/shared-chunks/helper-Da672z4a.js +299 -0
  283. package/dist/prod/packages/shared-chunks/{index-CjaDF9kC.js → index--2U-v2nf.js} +18 -10
  284. package/dist/prod/packages/shared-chunks/index-D-xTBV4B.js +220 -0
  285. package/dist/prod/packages/shared-chunks/index-D87qoERP.js +2322 -0
  286. package/dist/prod/packages/shared-chunks/{injected_property-CTVs5FPh.js → injected_property-D9B-fPiH.js} +3 -3
  287. package/dist/prod/packages/shared-chunks/intern-zquhAEIg.js +51 -0
  288. package/dist/prod/packages/shared-chunks/internal-DidurjJB.js +137 -0
  289. package/dist/prod/packages/shared-chunks/internal-helper-DIbr1RgC.js +7 -0
  290. package/dist/prod/packages/shared-chunks/{neq-BqdovTuC.js → invoke-Dr_CRwA_.js} +4 -24
  291. package/dist/{dev/packages/shared-chunks/is_proxy-B0smdQy8.js → prod/packages/shared-chunks/is_proxy-Bzg0d4m4.js} +1 -1
  292. package/dist/prod/packages/shared-chunks/libraries-DaXpIDYN.js +60 -0
  293. package/dist/prod/packages/shared-chunks/meta-B9mldqPL.js +36 -0
  294. package/dist/{dev/packages/shared-chunks/name-Z7dpqvzn.js → prod/packages/shared-chunks/name-Clp4Vsod.js} +1 -1
  295. package/dist/prod/packages/shared-chunks/namespace_search-BfvzEQzN.js +134 -0
  296. package/dist/prod/packages/shared-chunks/normalize-D9jDJVGg.js +84 -0
  297. package/dist/prod/packages/shared-chunks/observers-Co4JALkS.js +199 -0
  298. package/dist/prod/packages/shared-chunks/on-C3ZQiUUD.js +228 -0
  299. package/dist/prod/packages/shared-chunks/opcode-metadata-9iSW5JGP.js +285 -0
  300. package/dist/prod/packages/shared-chunks/opcodes-CplRyHl_.js +50 -0
  301. package/dist/prod/packages/shared-chunks/or-oTVMuHc8.js +91 -0
  302. package/dist/{dev/packages/shared-chunks/program-DfV0v8aa.js → prod/packages/shared-chunks/program-B7CWdS8W.js} +1 -2
  303. package/dist/{dev/packages/shared-chunks/program-context-sJz0oHOA.js → prod/packages/shared-chunks/program-context-CGMN-aQM.js} +3 -3
  304. package/dist/prod/packages/shared-chunks/property_get-hWJ0nGhW.js +122 -0
  305. package/dist/prod/packages/shared-chunks/{property_set-B2sZxeCw.js → property_set-Dj5-ScWk.js} +4 -5
  306. package/dist/prod/packages/shared-chunks/props-fiqxqhAH.js +85 -0
  307. package/dist/prod/packages/shared-chunks/{reference-BNqcwZWH.js → reference-BshxG6wn.js} +3 -3
  308. package/dist/prod/packages/shared-chunks/{registers-ylirb0dq.js → registers-DoamZwaG.js} +1 -1
  309. package/dist/{dev/packages/shared-chunks/rehydrate-builder-BRH0p0wA.js → prod/packages/shared-chunks/rehydrate-builder-BKg2X6Lo.js} +7 -7
  310. package/dist/prod/packages/shared-chunks/{render-D78XHdek.js → render-nx5-PsDW.js} +487 -12
  311. package/dist/{dev/packages/shared-chunks/serialize-builder-DiO7Ak9_.js → prod/packages/shared-chunks/serialize-builder-BGbC30SN.js} +2 -10
  312. package/dist/prod/packages/shared-chunks/set_properties-oPyURk67.js +48 -0
  313. package/dist/prod/packages/shared-chunks/{setup-registry-Cs-7NIJU.js → setup-registry-TiaKLj5k.js} +35 -13
  314. package/dist/prod/packages/shared-chunks/spec-BXl1reqK.js +16 -0
  315. package/dist/prod/packages/shared-chunks/super-BBBjgF69.js +91 -0
  316. package/dist/prod/packages/shared-chunks/template-BRrQR6KS.js +16 -0
  317. package/dist/prod/packages/shared-chunks/template-only-BtLl0uH0.js +78 -0
  318. package/dist/prod/packages/shared-chunks/textarea-CPKZ1c_O.js +455 -0
  319. package/dist/prod/packages/shared-chunks/{tracked-Cl5l4v8b.js → tracked-CffAABMz.js} +6 -4
  320. package/dist/prod/packages/shared-chunks/tracked-data-C83f5V5S.js +31 -0
  321. package/dist/prod/packages/shared-chunks/unique-id-CfHImDRV.js +32 -0
  322. package/dist/prod/packages/shared-chunks/well-known-_EVO9RaV.js +17 -0
  323. package/docs/data.json +1263 -1029
  324. package/package.json +1 -1
  325. package/types/stable/@ember/-internals/container/lib/registry.d.ts +1 -1
  326. package/types/stable/@ember/-internals/deprecations/index.d.ts +1 -1
  327. package/types/stable/@ember/-internals/glimmer/index.d.ts +1 -1
  328. package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +1 -1
  329. package/types/stable/@ember/-internals/glimmer/lib/component-managers/mount.d.ts +1 -1
  330. package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +1 -1
  331. package/types/stable/@ember/-internals/glimmer/lib/component-managers/route-template.d.ts +2 -2
  332. package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +9 -7
  333. package/types/stable/@ember/-internals/glimmer/lib/components/abstract-input.d.ts +1 -1
  334. package/types/stable/@ember/-internals/glimmer/lib/dom.d.ts +6 -2
  335. package/types/stable/@ember/-internals/glimmer/lib/environment.d.ts +1 -1
  336. package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +1 -1
  337. package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +3 -3
  338. package/types/stable/@ember/-internals/glimmer/lib/setup-registry.d.ts +1 -1
  339. package/types/stable/@ember/-internals/glimmer/lib/utils/bindings.d.ts +1 -1
  340. package/types/stable/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.d.ts +3 -2
  341. package/types/stable/@ember/-internals/glimmer/lib/utils/iterator.d.ts +1 -1
  342. package/types/stable/@ember/-internals/glimmer/lib/utils/managers.d.ts +2 -1
  343. package/types/stable/@ember/-internals/glimmer/lib/utils/serialization-first-node-helpers.d.ts +1 -1
  344. package/types/stable/@ember/-internals/glimmer/lib/utils/string.d.ts +1 -1
  345. package/types/stable/@ember/-internals/meta/lib/meta.d.ts +3 -2
  346. package/types/stable/@ember/-internals/metal/lib/cache.d.ts +1 -1
  347. package/types/stable/@ember/-internals/metal/lib/chain-tags.d.ts +3 -2
  348. package/types/stable/@ember/-internals/metal/lib/computed.d.ts +1 -1
  349. package/types/stable/@ember/-internals/metal/lib/decorator.d.ts +1 -1
  350. package/types/stable/@ember/-internals/metal/lib/deprecate_property.d.ts +1 -1
  351. package/types/stable/@ember/-internals/metal/lib/events.d.ts +1 -1
  352. package/types/stable/@ember/-internals/metal/lib/observer.d.ts +1 -1
  353. package/types/stable/@ember/-internals/metal/lib/properties.d.ts +1 -1
  354. package/types/stable/@ember/-internals/metal/lib/property_events.d.ts +1 -1
  355. package/types/stable/@ember/-internals/metal/lib/tags.d.ts +2 -1
  356. package/types/stable/@ember/-internals/runtime/lib/mixins/container_proxy.d.ts +1 -1
  357. package/types/stable/@ember/-internals/runtime/lib/mixins/registry_proxy.d.ts +1 -1
  358. package/types/stable/@ember/-internals/utils/lib/is_proxy.d.ts +1 -1
  359. package/types/stable/@ember/-internals/utils/lib/mandatory-setter.d.ts +1 -1
  360. package/types/stable/@ember/-internals/views/lib/system/utils.d.ts +1 -1
  361. package/types/stable/@ember/-internals/views/lib/views/core_view.d.ts +2 -2
  362. package/types/stable/@ember/-internals/views/lib/views/states.d.ts +1 -1
  363. package/types/stable/@ember/application/index.d.ts +5 -4
  364. package/types/stable/@ember/application/instance.d.ts +4 -3
  365. package/types/stable/@ember/application/namespace.d.ts +1 -1
  366. package/types/stable/@ember/array/proxy.d.ts +4 -3
  367. package/types/stable/@ember/component/helper.d.ts +1 -1
  368. package/types/stable/@ember/component/index.d.ts +6 -3
  369. package/types/stable/@ember/controller/index.d.ts +2 -2
  370. package/types/stable/@ember/debug/container-debug-adapter.d.ts +1 -1
  371. package/types/stable/@ember/engine/index.d.ts +3 -3
  372. package/types/stable/@ember/engine/instance.d.ts +4 -3
  373. package/types/stable/@ember/helper/index.d.ts +177 -5
  374. package/types/stable/@ember/modifier/index.d.ts +1 -1
  375. package/types/stable/@ember/object/-internals.d.ts +2 -2
  376. package/types/stable/@ember/object/compat.d.ts +2 -2
  377. package/types/stable/@ember/object/computed.d.ts +3 -1
  378. package/types/stable/@ember/object/evented.d.ts +1 -1
  379. package/types/stable/@ember/object/events.d.ts +1 -1
  380. package/types/stable/@ember/object/index.d.ts +8 -2
  381. package/types/stable/@ember/object/lib/computed/computed_macros.d.ts +1 -1
  382. package/types/stable/@ember/object/mixin.d.ts +1 -1
  383. package/types/stable/@ember/object/observers.d.ts +1 -1
  384. package/types/stable/@ember/object/proxy.d.ts +1 -1
  385. package/types/stable/@ember/reactive/collections.d.ts +6 -6
  386. package/types/stable/@ember/renderer/index.d.ts +2 -2
  387. package/types/stable/@ember/routing/index.d.ts +1 -1
  388. package/types/stable/@ember/routing/lib/controller_for.d.ts +2 -2
  389. package/types/stable/@ember/routing/route.d.ts +2 -2
  390. package/types/stable/@ember/routing/router.d.ts +2 -2
  391. package/types/stable/@ember/service/index.d.ts +1 -1
  392. package/types/stable/@ember/template/index.d.ts +1 -1
  393. package/types/stable/@ember/template-compiler/lib/dasherize-component-name.d.ts +1 -1
  394. package/types/stable/@ember/template-compiler/lib/plugins/assert-against-attrs.d.ts +1 -1
  395. package/types/stable/@ember/template-compiler/lib/plugins/assert-against-named-outlets.d.ts +1 -1
  396. package/types/stable/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.d.ts +1 -1
  397. package/types/stable/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.d.ts +1 -1
  398. package/types/stable/@ember/template-compiler/lib/plugins/auto-import-builtins.d.ts +1 -4
  399. package/types/stable/@ember/template-compiler/lib/plugins/transform-action-syntax.d.ts +1 -1
  400. package/types/stable/@ember/template-compiler/lib/plugins/transform-each-in-into-each.d.ts +1 -1
  401. package/types/stable/@ember/template-compiler/lib/plugins/transform-each-track-array.d.ts +1 -1
  402. package/types/stable/@ember/template-compiler/lib/plugins/transform-in-element.d.ts +1 -1
  403. package/types/stable/@ember/template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.d.ts +1 -1
  404. package/types/stable/@ember/template-compiler/lib/plugins/transform-resolutions.d.ts +1 -1
  405. package/types/stable/@ember/template-compiler/lib/plugins/transform-wrap-mount-and-outlet.d.ts +1 -1
  406. package/types/stable/@ember/template-compiler/lib/plugins/utils.d.ts +1 -1
  407. package/types/stable/@ember/template-compiler/lib/system/calculate-location-display.d.ts +1 -1
  408. package/types/stable/@ember/template-compiler/lib/types.d.ts +2 -1
  409. package/types/stable/@ember/template-factory/index.d.ts +1 -1
  410. package/types/stable/@glimmer/compiler/lib/builder/builder-interface.d.ts +2 -2
  411. package/types/stable/@glimmer/compiler/lib/builder/builder.d.ts +2 -2
  412. package/types/stable/@glimmer/compiler/lib/compiler.d.ts +1 -1
  413. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/context.d.ts +2 -1
  414. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/index.d.ts +2 -1
  415. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/impl.d.ts +2 -1
  416. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/curry.d.ts +1 -1
  417. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/dynamic-vars.d.ts +1 -1
  418. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/has-block.d.ts +2 -1
  419. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/if-unless.d.ts +1 -1
  420. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/log.d.ts +1 -1
  421. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/classified.d.ts +1 -1
  422. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/component.d.ts +1 -1
  423. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/simple-element.d.ts +2 -1
  424. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/expressions.d.ts +1 -1
  425. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/statements.d.ts +1 -1
  426. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/strict-mode.d.ts +1 -1
  427. package/types/stable/@glimmer/compiler/lib/passes/2-encoding/expressions.d.ts +1 -1
  428. package/types/stable/@glimmer/compiler/lib/passes/2-encoding/mir.d.ts +3 -1
  429. package/types/stable/@glimmer/compiler/lib/shared/result.d.ts +1 -1
  430. package/types/stable/@glimmer/manager/lib/public/component.d.ts +1 -1
  431. package/types/stable/@glimmer/manager/lib/util/args-proxy.d.ts +1 -1
  432. package/types/stable/@glimmer/manager/lib/util/capabilities.d.ts +1 -1
  433. package/types/stable/@glimmer/node/lib/node-dom-helper.d.ts +1 -1
  434. package/types/stable/@glimmer/opcode-compiler/lib/opcode-builder/helpers/components.d.ts +1 -1
  435. package/types/stable/@glimmer/runtime/index.d.ts +7 -4
  436. package/types/stable/@glimmer/runtime/lib/compiled/expressions/concat.d.ts +1 -1
  437. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/-debug-strip.d.ts +4 -3
  438. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/component.d.ts +1 -1
  439. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/dom.d.ts +2 -2
  440. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/vm.d.ts +2 -2
  441. package/types/stable/@glimmer/runtime/lib/component/template-only.d.ts +1 -1
  442. package/types/stable/@glimmer/runtime/lib/curried-value.d.ts +1 -1
  443. package/types/stable/@glimmer/runtime/lib/helpers/and.d.ts +3 -0
  444. package/types/stable/@glimmer/runtime/lib/helpers/gt.d.ts +8 -0
  445. package/types/stable/@glimmer/runtime/lib/helpers/gte.d.ts +8 -0
  446. package/types/stable/@glimmer/runtime/lib/helpers/invoke.d.ts +1 -1
  447. package/types/stable/@glimmer/runtime/lib/helpers/lt.d.ts +8 -0
  448. package/types/stable/@glimmer/runtime/lib/helpers/lte.d.ts +8 -0
  449. package/types/stable/@glimmer/runtime/lib/helpers/not.d.ts +3 -0
  450. package/types/stable/@glimmer/runtime/lib/helpers/or.d.ts +3 -0
  451. package/types/stable/@glimmer/runtime/lib/opcodes.d.ts +2 -2
  452. package/types/stable/@glimmer/runtime/lib/references/class-list.d.ts +1 -1
  453. package/types/stable/@glimmer/runtime/lib/references/curry-value.d.ts +1 -1
  454. package/types/stable/@glimmer/runtime/lib/render.d.ts +1 -1
  455. package/types/stable/@glimmer/runtime/lib/scope.d.ts +1 -1
  456. package/types/stable/@glimmer/runtime/lib/vm/append.d.ts +3 -2
  457. package/types/stable/@glimmer/runtime/lib/vm/arguments.d.ts +2 -2
  458. package/types/stable/@glimmer/runtime/lib/vm/content/text.d.ts +1 -1
  459. package/types/stable/@glimmer/runtime/lib/vm/element-builder.d.ts +1 -1
  460. package/types/stable/@glimmer/runtime/lib/vm/low-level.d.ts +2 -1
  461. package/types/stable/@glimmer/runtime/lib/vm/rehydrate-builder.d.ts +1 -1
  462. package/types/stable/@glimmer/runtime/lib/vm/update.d.ts +2 -1
  463. package/types/stable/@glimmer/syntax/lib/keywords.d.ts +2 -2
  464. package/types/stable/@glimmer/tracking/index.d.ts +2 -1
  465. package/types/stable/@glimmer/tracking/primitives/cache.d.ts +1 -1
  466. package/types/stable/index.d.ts +7 -0
  467. package/dist/dev/packages/shared-chunks/constants-BbdWMvgs.js +0 -213
  468. package/dist/dev/packages/shared-chunks/dynamic-CgX8M02_.js +0 -3823
  469. package/dist/dev/packages/shared-chunks/element-builder-BpJIoi99.js +0 -404
  470. package/dist/dev/packages/shared-chunks/index-RzG0Jvjx.js +0 -6306
  471. package/dist/dev/packages/shared-chunks/mandatory-setter-DHZe7-kW.js +0 -425
  472. package/dist/dev/packages/shared-chunks/observers-Bj9qLVau.js +0 -2062
  473. package/dist/dev/packages/shared-chunks/set_properties-kVGzZL_a.js +0 -100
  474. package/dist/dev/packages/shared-chunks/transform-resolutions-D-YtZ0_g.js +0 -7458
  475. package/dist/prod/packages/shared-chunks/constants-DThhT5fu.js +0 -210
  476. package/dist/prod/packages/shared-chunks/index-r-Dz_hzt.js +0 -5931
  477. package/dist/prod/packages/shared-chunks/observers-tZ2aOzr4.js +0 -714
  478. package/dist/prod/packages/shared-chunks/set_properties-C1T46IiN.js +0 -101
  479. package/dist/prod/packages/shared-chunks/super-Cm_a_cLQ.js +0 -275
  480. package/dist/prod/packages/shared-chunks/transform-resolutions-DR4GLmR2.js +0 -6936
  481. package/dist/prod/packages/shared-chunks/{collections-GpG8lT2g.js → collections-C3Y8z_9v.js} +9 -9
@@ -0,0 +1,2322 @@
1
+ import { privatize } from '../@ember/-internals/container/index.js';
2
+ import { E as ENV } from './env-DXxsTFkM.js';
3
+ import { isFactory, getOwner } from '../@ember/-internals/owner/index.js';
4
+ import { g as guidFor } from './guid-Cbq2sNV_.js';
5
+ import { getViewId, getViewElement } from '../@ember/-internals/views/lib/system/utils.js';
6
+ import { h as hasDOM } from './has-dom-DdQORPzI.js';
7
+ import { assert } from '../@ember/debug/lib/assert.js';
8
+ import { schedule, _backburner, _getCurrentRunLoop } from '../@ember/runloop/index.js';
9
+ import { associateDestroyableChild, isDestroyed, destroy, registerDestructor, isDestroying } from '../@glimmer/destroyable/index.js';
10
+ import { artifacts } from '../@glimmer/program/index.js';
11
+ import { R as RuntimeOpImpl } from './program-B7CWdS8W.js';
12
+ import { v as valueForRef, U as UNDEFINED_REFERENCE, a as createComputeRef, c as createConstRef, j as createInvokableRef, k as createReadOnlyRef, l as createUnboundRef, g as childRefFromParts, u as updateRef } from './reference-BshxG6wn.js';
13
+ import { c as clientBuilder } from './element-builder-BPjq0rxK.js';
14
+ import { E as EMPTY_ARGS, c as createCapturedArgs, b as EMPTY_POSITIONAL, d as curry } from './debug-render-tree-BLtnOSbb.js';
15
+ import { g as runtimeOptions, i as inTransaction, r as renderComponent$1, d as renderMain } from './render-nx5-PsDW.js';
16
+ import { d as dict } from './collections-C3Y8z_9v.js';
17
+ import { u as unwrapTemplate, a as CurlyComponentManager, i as initialRenderInstrumentDetails, b as ComponentStateBucket, D as DIRTY_TAG, c as isCurlyManager, B as BOUNDS } from './curly-BsqvV8G0.js';
18
+ import { C as CONSTANT_TAG, a as consumeTag, x as isTracking, D as DIRTY_TAG$1, p as createTag, d as valueForTag, i as CURRENT_TAG, v as validateTag } from './cache-BIlOoPA7.js';
19
+ import { a as RSVP } from './rsvp-CnCSY930.js';
20
+ import '../@ember/engine/instance.js';
21
+ import { _instrumentStart } from '../@ember/instrumentation/index.js';
22
+ import { c as capabilityFlagsFrom } from './capabilities-_5e35539.js';
23
+ import { t as templateFactory } from './index--2U-v2nf.js';
24
+ import { g as getFactoryFor } from './container-D5NwW5Fd.js';
25
+ import { g as get, a as _getProp } from './property_get-hWJ0nGhW.js';
26
+ import { _ as _setProp, s as set } from './property_set-Dj5-ScWk.js';
27
+ import setGlobalContext from '../@glimmer/global-context/index.js';
28
+ import { t as tagForObject, o as objectAt, a as tagForProperty } from './chain-tags-BJqcuCM1.js';
29
+ import { isEmberArray } from '../@ember/array/-internals.js';
30
+ import { i as isObject } from './spec-BXl1reqK.js';
31
+ import { t as tagFor } from './meta-B9mldqPL.js';
32
+ import { contentFor } from '../@ember/-internals/runtime/lib/mixins/-proxy.js';
33
+ import { i as isProxy } from './is_proxy-Bzg0d4m4.js';
34
+ import { i as internalHelper } from './internal-helper-DIbr1RgC.js';
35
+ import { i as isHTMLSafe } from './index-D-xTBV4B.js';
36
+ import { isArray } from '../@ember/array/index.js';
37
+ import { g as getComponentTemplate } from './template-Dc_cBOoX.js';
38
+ import { c as hasInternalComponentManager, j as setInternalHelperManager, g as getInternalComponentManager } from './api-zh_k31vb.js';
39
+ import { h as hash, f as fn, a as array } from './hash-DcUe-meU.js';
40
+ import { g as get$1, c as concat } from './get-D5wxdTkY.js';
41
+ import { o as on } from './on-C3ZQiUUD.js';
42
+ import { T as TEMPLATE_ONLY_COMPONENT_MANAGER, t as templateOnlyComponent } from './template-only-BtLl0uH0.js';
43
+ import { i as isClassicHelper, C as CLASSIC_HELPER_MANAGER } from './helper-Da672z4a.js';
44
+ import { dasherize } from '../@ember/-internals/string/index.js';
45
+ import { a as uniqueId } from './unique-id-CfHImDRV.js';
46
+ import '../route-recognizer/index.js';
47
+ import './unrecognized-url-error-DDBwfzdm.js';
48
+ import '../@ember/routing/lib/routing-service.js';
49
+ import { generateControllerFactory } from '../@ember/routing/lib/generate_controller.js';
50
+ import { E as EvaluationContextImpl } from './program-context-CGMN-aQM.js';
51
+
52
+ function instrumentationPayload$1(def) {
53
+ // "main" used to be the outlet name, keeping it around for compatibility
54
+ return {
55
+ object: `${def.name}:main`
56
+ };
57
+ }
58
+ const CAPABILITIES$2 = {
59
+ dynamicLayout: false,
60
+ dynamicTag: false,
61
+ prepareArgs: false,
62
+ createArgs: false,
63
+ attributeHook: false,
64
+ elementHook: false,
65
+ createCaller: false,
66
+ dynamicScope: true,
67
+ updateHook: false,
68
+ createInstance: true,
69
+ wrapped: false,
70
+ willDestroy: false,
71
+ hasSubOwner: false
72
+ };
73
+ const CAPABILITIES_MASK$1 = capabilityFlagsFrom(CAPABILITIES$2);
74
+ class OutletComponentManager {
75
+ create(_owner, definition, _args, env, dynamicScope) {
76
+ let parentStateRef = dynamicScope.get('outletState');
77
+ let currentStateRef = definition.ref;
78
+
79
+ // This is the actual primary responsibility of the outlet component –
80
+ // it represents the switching from one route component/template into
81
+ // the next. The rest only exists to support the debug render tree and
82
+ // the old-school (and unreliable) instrumentation.
83
+ dynamicScope.set('outletState', currentStateRef);
84
+ let state = {
85
+ finalize: _instrumentStart('render.outlet', instrumentationPayload$1, definition)
86
+ };
87
+ if (env.debugRenderTree !== undefined) {
88
+ let parentState = valueForRef(parentStateRef);
89
+ let parentOwner = parentState?.render?.owner;
90
+ let currentState = valueForRef(currentStateRef);
91
+ let currentOwner = currentState?.render?.owner;
92
+ if (parentOwner && parentOwner !== currentOwner) {
93
+ let {
94
+ mountPoint
95
+ } = currentOwner;
96
+ if (mountPoint) {
97
+ state.engine = {
98
+ mountPoint,
99
+ instance: currentOwner
100
+ };
101
+ }
102
+ }
103
+ }
104
+ return state;
105
+ }
106
+ getDebugName({
107
+ name
108
+ }) {
109
+ return `{{outlet}} for ${name}`;
110
+ }
111
+ getDebugCustomRenderTree(_definition, state) {
112
+ let nodes = [];
113
+ nodes.push({
114
+ bucket: state,
115
+ type: 'outlet',
116
+ // "main" used to be the outlet name, keeping it around for compatibility
117
+ name: 'main',
118
+ args: EMPTY_ARGS,
119
+ instance: undefined
120
+ });
121
+ if (state.engine) {
122
+ nodes.push({
123
+ bucket: state.engine,
124
+ type: 'engine',
125
+ name: state.engine.mountPoint,
126
+ args: EMPTY_ARGS,
127
+ instance: state.engine.instance
128
+ });
129
+ }
130
+ return nodes;
131
+ }
132
+ getCapabilities() {
133
+ return CAPABILITIES$2;
134
+ }
135
+ getSelf() {
136
+ return UNDEFINED_REFERENCE;
137
+ }
138
+ didCreate() {}
139
+ didUpdate() {}
140
+ didRenderLayout(state) {
141
+ state.finalize();
142
+ }
143
+ didUpdateLayout() {}
144
+ getDestroyable() {
145
+ return null;
146
+ }
147
+ }
148
+ const OUTLET_MANAGER = new OutletComponentManager();
149
+ const OUTLET_COMPONENT_TEMPLATE = templateFactory(
150
+ /*
151
+ <@Component @controller={{@controller}} @model={{@model}} />
152
+ */
153
+ {
154
+ "id": null,
155
+ "block": "[[[8,[30,1],null,[[\"@controller\",\"@model\"],[[30,2],[30,3]]],null]],[\"@Component\",\"@controller\",\"@model\"],[]]",
156
+ "moduleName": "(unknown template module)",
157
+ "isStrictMode": true
158
+ });
159
+ class OutletComponent {
160
+ // handle is not used by this custom definition
161
+ handle = -1;
162
+ resolvedName = null;
163
+ manager = OUTLET_MANAGER;
164
+ capabilities = CAPABILITIES_MASK$1;
165
+ compilable;
166
+ constructor(owner, state) {
167
+ this.state = state;
168
+ this.compilable = unwrapTemplate(OUTLET_COMPONENT_TEMPLATE(owner)).asLayout();
169
+ }
170
+ }
171
+ function createRootOutlet(outletView) {
172
+ return new OutletComponent(outletView.owner, outletView.state);
173
+ }
174
+
175
+ class RootComponentManager extends CurlyComponentManager {
176
+ component;
177
+ constructor(component) {
178
+ super();
179
+ this.component = component;
180
+ }
181
+ create(_owner, _state, _args, {
182
+ isInteractive
183
+ }, dynamicScope) {
184
+ let component = this.component;
185
+ let finalizer = _instrumentStart('render.component', initialRenderInstrumentDetails, component);
186
+ dynamicScope.view = component;
187
+ let hasWrappedElement = component.tagName !== '';
188
+
189
+ // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components
190
+ if (!hasWrappedElement) {
191
+ if (isInteractive) {
192
+ component.trigger('willRender');
193
+ }
194
+ component._transitionTo('hasElement');
195
+ if (isInteractive) {
196
+ component.trigger('willInsertElement');
197
+ }
198
+ }
199
+ let bucket = new ComponentStateBucket(component, null, CONSTANT_TAG, finalizer, hasWrappedElement, isInteractive);
200
+ consumeTag(component[DIRTY_TAG]);
201
+ return bucket;
202
+ }
203
+ }
204
+
205
+ // ROOT is the top-level template it has nothing but one yield.
206
+ // it is supposed to have a dummy element
207
+ const ROOT_CAPABILITIES = {
208
+ dynamicLayout: true,
209
+ dynamicTag: true,
210
+ prepareArgs: false,
211
+ createArgs: false,
212
+ attributeHook: true,
213
+ elementHook: true,
214
+ createCaller: true,
215
+ dynamicScope: true,
216
+ updateHook: true,
217
+ createInstance: true,
218
+ wrapped: true,
219
+ willDestroy: false,
220
+ hasSubOwner: false
221
+ };
222
+ class RootComponentDefinition {
223
+ // handle is not used by this custom definition
224
+ handle = -1;
225
+ resolvedName = '-top-level';
226
+ state;
227
+ manager;
228
+ capabilities = capabilityFlagsFrom(ROOT_CAPABILITIES);
229
+ compilable = null;
230
+ constructor(component) {
231
+ this.manager = new RootComponentManager(component);
232
+ let factory = getFactoryFor(component);
233
+ this.state = factory;
234
+ }
235
+ }
236
+
237
+ /**
238
+ @module ember
239
+ */
240
+
241
+ /**
242
+ The `{{#each}}` helper loops over elements in a collection. It is an extension
243
+ of the base Handlebars `{{#each}}` helper.
244
+
245
+ The default behavior of `{{#each}}` is to yield its inner block once for every
246
+ item in an array passing the item as the first block parameter.
247
+
248
+ Assuming the `@developers` argument contains this array:
249
+
250
+ ```javascript
251
+ [{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
252
+ ```
253
+
254
+ ```handlebars
255
+ <ul>
256
+ {{#each @developers as |person|}}
257
+ <li>Hello, {{person.name}}!</li>
258
+ {{/each}}
259
+ </ul>
260
+ ```
261
+
262
+ The same rules apply to arrays of primitives.
263
+
264
+ ```javascript
265
+ ['Yehuda', 'Tom', 'Paul']
266
+ ```
267
+
268
+ ```handlebars
269
+ <ul>
270
+ {{#each @developerNames as |name|}}
271
+ <li>Hello, {{name}}!</li>
272
+ {{/each}}
273
+ </ul>
274
+ ```
275
+
276
+ During iteration, the index of each item in the array is provided as a second block
277
+ parameter.
278
+
279
+ ```handlebars
280
+ <ul>
281
+ {{#each @developers as |person index|}}
282
+ <li>Hello, {{person.name}}! You're number {{index}} in line</li>
283
+ {{/each}}
284
+ </ul>
285
+ ```
286
+
287
+ ### Specifying Keys
288
+
289
+ In order to improve rendering speed, Ember will try to reuse the DOM elements
290
+ where possible. Specifically, if the same item is present in the array both
291
+ before and after the change, its DOM output will be reused.
292
+
293
+ The `key` option is used to tell Ember how to determine if the items in the
294
+ array being iterated over with `{{#each}}` has changed between renders. By
295
+ default the item's object identity is used.
296
+
297
+ This is usually sufficient, so in most cases, the `key` option is simply not
298
+ needed. However, in some rare cases, the objects' identities may change even
299
+ though they represent the same underlying data.
300
+
301
+ For example:
302
+
303
+ ```javascript
304
+ people.map(person => {
305
+ return { ...person, type: 'developer' };
306
+ });
307
+ ```
308
+
309
+ In this case, each time the `people` array is `map`-ed over, it will produce
310
+ an new array with completely different objects between renders. In these cases,
311
+ you can help Ember determine how these objects related to each other with the
312
+ `key` option:
313
+
314
+ ```handlebars
315
+ <ul>
316
+ {{#each @developers key="name" as |person|}}
317
+ <li>Hello, {{person.name}}!</li>
318
+ {{/each}}
319
+ </ul>
320
+ ```
321
+
322
+ By doing so, Ember will use the value of the property specified (`person.name`
323
+ in the example) to find a "match" from the previous render. That is, if Ember
324
+ has previously seen an object from the `@developers` array with a matching
325
+ name, its DOM elements will be re-used.
326
+
327
+ There are two special values for `key`:
328
+
329
+ * `@index` - The index of the item in the array.
330
+ * `@identity` - The item in the array itself.
331
+
332
+ ### {{else}} condition
333
+
334
+ `{{#each}}` can have a matching `{{else}}`. The contents of this block will render
335
+ if the collection is empty.
336
+
337
+ ```handlebars
338
+ <ul>
339
+ {{#each @developers as |person|}}
340
+ <li>{{person.name}} is available!</li>
341
+ {{else}}
342
+ <li>Sorry, nobody is available for this task.</li>
343
+ {{/each}}
344
+ </ul>
345
+ ```
346
+
347
+ @method each
348
+ @for Ember.Templates.helpers
349
+ @public
350
+ */
351
+
352
+ /**
353
+ The `{{each-in}}` helper loops over properties on an object.
354
+
355
+ For example, given this component definition:
356
+
357
+ ```app/components/developer-details.js
358
+ import Component from '@glimmer/component';
359
+ import { tracked } from '@glimmer/tracking';
360
+
361
+ export default class extends Component {
362
+ @tracked developer = {
363
+ "name": "Shelly Sails",
364
+ "age": 42
365
+ };
366
+ }
367
+ ```
368
+
369
+ This template would display all properties on the `developer`
370
+ object in a list:
371
+
372
+ ```app/components/developer-details.hbs
373
+ <ul>
374
+ {{#each-in this.developer as |key value|}}
375
+ <li>{{key}}: {{value}}</li>
376
+ {{/each-in}}
377
+ </ul>
378
+ ```
379
+
380
+ Outputting their name and age:
381
+
382
+ ```html
383
+ <ul>
384
+ <li>name: Shelly Sails</li>
385
+ <li>age: 42</li>
386
+ </ul>
387
+ ```
388
+
389
+ @method each-in
390
+ @for Ember.Templates.helpers
391
+ @public
392
+ @since 2.1.0
393
+ */
394
+ class EachInWrapper {
395
+ constructor(inner) {
396
+ this.inner = inner;
397
+ }
398
+ }
399
+ const eachIn = internalHelper(({
400
+ positional
401
+ }) => {
402
+ const inner = positional[0];
403
+ return createComputeRef(() => {
404
+ let iterable = valueForRef(inner);
405
+ consumeTag(tagForObject(iterable));
406
+ if (isProxy(iterable)) {
407
+ // this is because the each-in doesn't actually get(proxy, 'key') but bypasses it
408
+ // and the proxy's tag is lazy updated on access
409
+ iterable = contentFor(iterable);
410
+ }
411
+ return new EachInWrapper(iterable);
412
+ });
413
+ });
414
+
415
+ function toIterator(iterable) {
416
+ if (iterable instanceof EachInWrapper) {
417
+ return toEachInIterator(iterable.inner);
418
+ } else {
419
+ return toEachIterator(iterable);
420
+ }
421
+ }
422
+ function toEachInIterator(iterable) {
423
+ if (!isIndexable(iterable)) {
424
+ return null;
425
+ }
426
+ if (Array.isArray(iterable) || isEmberArray(iterable)) {
427
+ return ObjectIterator.fromIndexable(iterable);
428
+ } else if (isNativeIterable(iterable)) {
429
+ return MapLikeNativeIterator.from(iterable);
430
+ } else if (hasForEach(iterable)) {
431
+ return ObjectIterator.fromForEachable(iterable);
432
+ } else {
433
+ return ObjectIterator.fromIndexable(iterable);
434
+ }
435
+ }
436
+ function toEachIterator(iterable) {
437
+ if (!isObject(iterable)) {
438
+ return null;
439
+ }
440
+ if (Array.isArray(iterable)) {
441
+ return ArrayIterator.from(iterable);
442
+ } else if (isEmberArray(iterable)) {
443
+ return EmberArrayIterator.from(iterable);
444
+ } else if (isNativeIterable(iterable)) {
445
+ return ArrayLikeNativeIterator.from(iterable);
446
+ } else if (hasForEach(iterable)) {
447
+ return ArrayIterator.fromForEachable(iterable);
448
+ } else {
449
+ return null;
450
+ }
451
+ }
452
+ class BoundedIterator {
453
+ position = 0;
454
+ constructor(length) {
455
+ this.length = length;
456
+ }
457
+ isEmpty() {
458
+ return false;
459
+ }
460
+ memoFor(position) {
461
+ return position;
462
+ }
463
+ next() {
464
+ let {
465
+ length,
466
+ position
467
+ } = this;
468
+ if (position >= length) {
469
+ return null;
470
+ }
471
+ let value = this.valueFor(position);
472
+ let memo = this.memoFor(position);
473
+ this.position++;
474
+ return {
475
+ value,
476
+ memo
477
+ };
478
+ }
479
+ }
480
+ class ArrayIterator extends BoundedIterator {
481
+ static from(iterable) {
482
+ return iterable.length > 0 ? new this(iterable) : null;
483
+ }
484
+ static fromForEachable(object) {
485
+ let array = [];
486
+ object.forEach(item => array.push(item));
487
+ return this.from(array);
488
+ }
489
+ constructor(array) {
490
+ super(array.length);
491
+ this.array = array;
492
+ }
493
+ valueFor(position) {
494
+ return this.array[position];
495
+ }
496
+ }
497
+ class EmberArrayIterator extends BoundedIterator {
498
+ static from(iterable) {
499
+ return iterable.length > 0 ? new this(iterable) : null;
500
+ }
501
+ constructor(array) {
502
+ super(array.length);
503
+ this.array = array;
504
+ }
505
+ valueFor(position) {
506
+ return objectAt(this.array, position);
507
+ }
508
+ }
509
+ class ObjectIterator extends BoundedIterator {
510
+ static fromIndexable(obj) {
511
+ let keys = Object.keys(obj);
512
+ if (keys.length === 0) {
513
+ return null;
514
+ } else {
515
+ let values = [];
516
+ for (let key of keys) {
517
+ let value;
518
+ value = obj[key];
519
+
520
+ // Add the tag of the returned value if it is an array, since arrays
521
+ // should always cause updates if they are consumed and then changed
522
+ if (isTracking()) {
523
+ consumeTag(tagFor(obj, key));
524
+ if (Array.isArray(value)) {
525
+ consumeTag(tagFor(value, '[]'));
526
+ }
527
+ }
528
+ values.push(value);
529
+ }
530
+ return new this(keys, values);
531
+ }
532
+ }
533
+ static fromForEachable(obj) {
534
+ let keys = [];
535
+ let values = [];
536
+ let length = 0;
537
+ let isMapLike = false;
538
+
539
+ // Not using an arrow function here so we can get an accurate `arguments`
540
+ obj.forEach(function (value, key) {
541
+ isMapLike = isMapLike || arguments.length >= 2;
542
+ if (isMapLike) {
543
+ keys.push(key);
544
+ }
545
+ values.push(value);
546
+ length++;
547
+ });
548
+ if (length === 0) {
549
+ return null;
550
+ } else if (isMapLike) {
551
+ return new this(keys, values);
552
+ } else {
553
+ return new ArrayIterator(values);
554
+ }
555
+ }
556
+ constructor(keys, values) {
557
+ super(values.length);
558
+ this.keys = keys;
559
+ this.values = values;
560
+ }
561
+ valueFor(position) {
562
+ return this.values[position];
563
+ }
564
+ memoFor(position) {
565
+ return this.keys[position];
566
+ }
567
+ }
568
+ class NativeIterator {
569
+ static from(iterable) {
570
+ let iterator = iterable[Symbol.iterator]();
571
+ let result = iterator.next();
572
+ let {
573
+ done
574
+ } = result;
575
+ if (done) {
576
+ return null;
577
+ } else {
578
+ return new this(iterator, result);
579
+ }
580
+ }
581
+ position = 0;
582
+ constructor(iterable, result) {
583
+ this.iterable = iterable;
584
+ this.result = result;
585
+ }
586
+ isEmpty() {
587
+ return false;
588
+ }
589
+ next() {
590
+ let {
591
+ iterable,
592
+ result,
593
+ position
594
+ } = this;
595
+ if (result.done) {
596
+ return null;
597
+ }
598
+ let value = this.valueFor(result, position);
599
+ let memo = this.memoFor(result, position);
600
+ this.position++;
601
+ this.result = iterable.next();
602
+ return {
603
+ value,
604
+ memo
605
+ };
606
+ }
607
+ }
608
+ class ArrayLikeNativeIterator extends NativeIterator {
609
+ valueFor(result) {
610
+ return result.value;
611
+ }
612
+ memoFor(_result, position) {
613
+ return position;
614
+ }
615
+ }
616
+ class MapLikeNativeIterator extends NativeIterator {
617
+ valueFor(result) {
618
+ return result.value[1];
619
+ }
620
+ memoFor(result) {
621
+ return result.value[0];
622
+ }
623
+ }
624
+ function hasForEach(value) {
625
+ return value != null && typeof value['forEach'] === 'function';
626
+ }
627
+ function isNativeIterable(value) {
628
+ return value != null && typeof value[Symbol.iterator] === 'function';
629
+ }
630
+ function isIndexable(value) {
631
+ return value !== null && (typeof value === 'object' || typeof value === 'function');
632
+ }
633
+
634
+ function toBool(predicate) {
635
+ if (isProxy(predicate)) {
636
+ consumeTag(tagForProperty(predicate, 'content'));
637
+ return Boolean(get(predicate, 'isTruthy'));
638
+ } else if (isArray(predicate)) {
639
+ consumeTag(tagForProperty(predicate, '[]'));
640
+ return predicate.length !== 0;
641
+ } else if (isHTMLSafe(predicate)) {
642
+ return Boolean(predicate.toString());
643
+ } else {
644
+ return Boolean(predicate);
645
+ }
646
+ }
647
+
648
+ ///////////
649
+
650
+ // Setup global context
651
+
652
+ setGlobalContext({
653
+ scheduleRevalidate() {
654
+ _backburner.ensureInstance();
655
+ },
656
+ toBool,
657
+ toIterator,
658
+ getProp: _getProp,
659
+ setProp: _setProp,
660
+ getPath: get,
661
+ setPath: set,
662
+ scheduleDestroy(destroyable, destructor) {
663
+ schedule('actions', null, destructor, destroyable);
664
+ },
665
+ scheduleDestroyed(finalizeDestructor) {
666
+ schedule('destroy', null, finalizeDestructor);
667
+ },
668
+ warnIfStyleNotTrusted(value) {
669
+ },
670
+ assert(test, msg, options) {
671
+ },
672
+ deprecate(msg, test, options) {
673
+ }
674
+ });
675
+
676
+ ///////////
677
+
678
+ // Define environment delegate
679
+
680
+ class EmberEnvironmentDelegate {
681
+ enableDebugTooling = ENV._DEBUG_RENDER_TREE;
682
+ constructor(owner, isInteractive) {
683
+ this.owner = owner;
684
+ this.isInteractive = isInteractive;
685
+ }
686
+ onTransactionCommit() {}
687
+ }
688
+
689
+ /**
690
+ @module ember
691
+ */
692
+ const disallowDynamicResolution = internalHelper(({
693
+ positional,
694
+ named
695
+ }) => {
696
+ const nameOrValueRef = positional[0];
697
+ let typeRef = named['type'];
698
+ let locRef = named['loc'];
699
+ let originalRef = named['original'];
700
+ // assert('[BUG] expecting a string literal for the `type` argument', isConstRef(typeRef));
701
+ // assert('[BUG] expecting a string literal for the `loc` argument', isConstRef(locRef));
702
+ // assert('[BUG] expecting a string literal for the `original` argument', isConstRef(originalRef));
703
+ valueForRef(typeRef);
704
+ valueForRef(locRef);
705
+ valueForRef(originalRef);
706
+ return createComputeRef(() => {
707
+ let nameOrValue = valueForRef(nameOrValueRef);
708
+ return nameOrValue;
709
+ });
710
+ });
711
+
712
+ let helper;
713
+ {
714
+ helper = args => {
715
+ let arg = args.positional[0];
716
+ return arg;
717
+ };
718
+ }
719
+ const inElementNullCheckHelper = internalHelper(helper);
720
+
721
+ const normalizeClassHelper = internalHelper(({
722
+ positional
723
+ }) => {
724
+ return createComputeRef(() => {
725
+ let classNameArg = positional[0];
726
+ let valueArg = positional[1];
727
+ let classNameParts = valueForRef(classNameArg).split('.');
728
+ let className = classNameParts[classNameParts.length - 1];
729
+ let value = valueForRef(valueArg);
730
+ if (value === true) {
731
+ return dasherize(className);
732
+ } else if (!value && value !== 0) {
733
+ return '';
734
+ } else {
735
+ return String(value);
736
+ }
737
+ });
738
+ });
739
+
740
+ /**
741
+ @module ember
742
+ */
743
+
744
+ const resolve = internalHelper(({
745
+ positional
746
+ }, owner) => {
747
+ let fullNameRef = positional[0];
748
+ let fullName = valueForRef(fullNameRef);
749
+ return createConstRef(owner.factoryFor(fullName)?.class);
750
+ });
751
+
752
+ /**
753
+ @module ember
754
+ */
755
+
756
+ /**
757
+ This reference is used to get the `[]` tag of iterables, so we can trigger
758
+ updates to `{{each}}` when it changes. It is put into place by a template
759
+ transform at build time, similar to the (-each-in) helper
760
+ */
761
+ const trackArray = internalHelper(({
762
+ positional
763
+ }) => {
764
+ const inner = positional[0];
765
+ return createComputeRef(() => {
766
+ let iterable = valueForRef(inner);
767
+ if (isObject(iterable)) {
768
+ consumeTag(tagForProperty(iterable, '[]'));
769
+ }
770
+ return iterable;
771
+ });
772
+ });
773
+
774
+ /**
775
+ @module ember
776
+ */
777
+
778
+ /**
779
+ The `mut` helper lets you __clearly specify__ that a child `Component` can update the
780
+ (mutable) value passed to it, which will __change the value of the parent component__.
781
+
782
+ To specify that a parameter is mutable, when invoking the child `Component`:
783
+
784
+ ```handlebars
785
+ <MyChild @childClickCount={{fn (mut totalClicks)}} />
786
+ ```
787
+
788
+ or
789
+
790
+ ```handlebars
791
+ {{my-child childClickCount=(mut totalClicks)}}
792
+ ```
793
+
794
+ The child `Component` can then modify the parent's value just by modifying its own
795
+ property:
796
+
797
+ ```javascript
798
+ // my-child.js
799
+ export default class MyChild extends Component {
800
+ click() {
801
+ this.incrementProperty('childClickCount');
802
+ }
803
+ }
804
+ ```
805
+
806
+ Note that for curly components (`{{my-component}}`) the bindings are already mutable,
807
+ making the `mut` unnecessary.
808
+
809
+ Additionally, the `mut` helper can be combined with the `fn` helper to
810
+ mutate a value. For example:
811
+
812
+ ```handlebars
813
+ <MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
814
+ ```
815
+
816
+ or
817
+
818
+ ```handlebars
819
+ {{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
820
+ ```
821
+
822
+ The child `Component` would invoke the function with the new click value:
823
+
824
+ ```javascript
825
+ // my-child.js
826
+ export default class MyChild extends Component {
827
+ click() {
828
+ this.get('click-count-change')(this.get('childClickCount') + 1);
829
+ }
830
+ }
831
+ ```
832
+
833
+ The `mut` helper changes the `totalClicks` value to what was provided as the `fn` argument.
834
+
835
+ The `mut` helper, when used with `fn`, will return a function that
836
+ sets the value passed to `mut` to its first argument. As an example, we can create a
837
+ button that increments a value passing the value directly to the `fn`:
838
+
839
+ ```handlebars
840
+ {{! inc helper is not provided by Ember }}
841
+ <button onclick={{fn (mut count) (inc count)}}>
842
+ Increment count
843
+ </button>
844
+ ```
845
+
846
+ @method mut
847
+ @param {Object} [attr] the "two-way" attribute that can be modified.
848
+ @for Ember.Templates.helpers
849
+ @public
850
+ */
851
+
852
+ const mut = internalHelper(({
853
+ positional
854
+ }) => {
855
+ let ref = positional[0];
856
+ return createInvokableRef(ref);
857
+ });
858
+
859
+ /**
860
+ @module ember
861
+ */
862
+
863
+
864
+ /**
865
+ The `readonly` helper let's you specify that a binding is one-way only,
866
+ instead of two-way.
867
+ When you pass a `readonly` binding from an outer context (e.g. parent component),
868
+ to to an inner context (e.g. child component), you are saying that changing that
869
+ property in the inner context does not change the value in the outer context.
870
+
871
+ To specify that a binding is read-only, when invoking the child `Component`:
872
+
873
+ ```app/components/my-parent.js
874
+ export default class MyParent extends Component {
875
+ totalClicks = 3;
876
+ }
877
+ ```
878
+
879
+ ```app/templates/components/my-parent.hbs
880
+ {{log totalClicks}} // -> 3
881
+ <MyChild @childClickCount={{readonly totalClicks}} />
882
+ ```
883
+ ```
884
+ {{my-child childClickCount=(readonly totalClicks)}}
885
+ ```
886
+
887
+ Now, when you update `childClickCount`:
888
+
889
+ ```app/components/my-child.js
890
+ export default class MyChild extends Component {
891
+ click() {
892
+ this.incrementProperty('childClickCount');
893
+ }
894
+ }
895
+ ```
896
+
897
+ The value updates in the child component, but not the parent component:
898
+
899
+ ```app/templates/components/my-child.hbs
900
+ {{log childClickCount}} //-> 4
901
+ ```
902
+
903
+ ```app/templates/components/my-parent.hbs
904
+ {{log totalClicks}} //-> 3
905
+ <MyChild @childClickCount={{readonly totalClicks}} />
906
+ ```
907
+ or
908
+ ```app/templates/components/my-parent.hbs
909
+ {{log totalClicks}} //-> 3
910
+ {{my-child childClickCount=(readonly totalClicks)}}
911
+ ```
912
+
913
+ ### Objects and Arrays
914
+
915
+ When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),
916
+ only the reference to the object is protected using the readonly helper.
917
+ This means that you can change properties of the object both on the parent component, as well as the child component.
918
+ The `readonly` binding behaves similar to the `const` keyword in JavaScript.
919
+
920
+ Let's look at an example:
921
+
922
+ First let's set up the parent component:
923
+
924
+ ```app/components/my-parent.js
925
+ import Component from '@ember/component';
926
+
927
+ export default class MyParent extends Component {
928
+ clicks: null,
929
+
930
+ init() {
931
+ this._super(...arguments);
932
+ this.set('clicks', { total: 3 });
933
+ }
934
+ }
935
+ ```
936
+
937
+ ```app/templates/components/my-parent.hbs
938
+ {{log clicks.total}} //-> 3
939
+ <MyChild @childClicks={{readonly clicks}} />
940
+ ```
941
+ ```app/templates/components/my-parent.hbs
942
+ {{log clicks.total}} //-> 3
943
+ {{my-child childClicks=(readonly clicks)}}
944
+ ```
945
+
946
+ Now, if you update the `total` property of `childClicks`:
947
+
948
+ ```app/components/my-child.js
949
+ import Component from '@ember/component';
950
+
951
+ export default class MyChild extends Component {
952
+ click() {
953
+ this.get('clicks').incrementProperty('total');
954
+ }
955
+ }
956
+ ```
957
+
958
+ You will see the following happen:
959
+
960
+ ```app/templates/components/my-parent.hbs
961
+ {{log clicks.total}} //-> 4
962
+ <MyChild @childClicks={{readonly clicks}} />
963
+ ```
964
+ or
965
+ ```app/templates/components/my-parent.hbs
966
+ {{log clicks.total}} //-> 4
967
+ {{my-child childClicks=(readonly clicks)}}
968
+ ```
969
+
970
+ ```app/templates/components/my-child.hbs
971
+ {{log childClicks.total}} //-> 4
972
+ ```
973
+
974
+ @method readonly
975
+ @param {Object} [attr] the read-only attribute.
976
+ @for Ember.Templates.helpers
977
+ @private
978
+ */
979
+ const readonly = internalHelper(({
980
+ positional
981
+ }) => {
982
+ let firstArg = positional[0];
983
+ return createReadOnlyRef(firstArg);
984
+ });
985
+
986
+ /**
987
+ @module ember
988
+ */
989
+
990
+
991
+ /**
992
+ The `{{unbound}}` helper disconnects the one-way binding of a property,
993
+ essentially freezing its value at the moment of rendering. For example,
994
+ in this example the display of the variable `name` will not change even
995
+ if it is set with a new value:
996
+
997
+ ```handlebars
998
+ {{unbound this.name}}
999
+ ```
1000
+
1001
+ Like any helper, the `unbound` helper can accept a nested helper expression.
1002
+ This allows for custom helpers to be rendered unbound:
1003
+
1004
+ ```handlebars
1005
+ {{unbound (some-custom-helper)}}
1006
+ {{unbound (capitalize this.name)}}
1007
+ {{! You can use any helper, including unbound, in a nested expression }}
1008
+ {{capitalize (unbound this.name)}}
1009
+ ```
1010
+
1011
+ The `unbound` helper only accepts a single argument, and it return an
1012
+ unbound value.
1013
+
1014
+ @method unbound
1015
+ @for Ember.Templates.helpers
1016
+ @public
1017
+ */
1018
+
1019
+ const unbound = internalHelper(({
1020
+ positional,
1021
+ named
1022
+ }) => {
1023
+ return createUnboundRef(valueForRef(positional[0]));
1024
+ });
1025
+
1026
+ const CAPABILITIES$1 = {
1027
+ dynamicLayout: true,
1028
+ dynamicTag: false,
1029
+ prepareArgs: false,
1030
+ createArgs: true,
1031
+ attributeHook: false,
1032
+ elementHook: false,
1033
+ createCaller: true,
1034
+ dynamicScope: true,
1035
+ updateHook: true,
1036
+ createInstance: true,
1037
+ wrapped: false,
1038
+ willDestroy: false,
1039
+ hasSubOwner: true
1040
+ };
1041
+ class MountManager {
1042
+ getDynamicLayout(state) {
1043
+ let templateFactory = state.engine.lookup('template:application');
1044
+ return unwrapTemplate(templateFactory(state.engine)).asLayout();
1045
+ }
1046
+ getCapabilities() {
1047
+ return CAPABILITIES$1;
1048
+ }
1049
+ getOwner(state) {
1050
+ return state.engine;
1051
+ }
1052
+ create(owner, {
1053
+ name
1054
+ }, args, env) {
1055
+ let engine = owner.buildChildEngineInstance(name);
1056
+ engine.boot();
1057
+ let applicationFactory = engine.factoryFor(`controller:application`);
1058
+ let controllerFactory = applicationFactory || generateControllerFactory(engine, 'application');
1059
+ let controller;
1060
+ let self;
1061
+ let bucket;
1062
+ let modelRef;
1063
+ if (args.named.has('model')) {
1064
+ modelRef = args.named.get('model');
1065
+ }
1066
+ if (modelRef === undefined) {
1067
+ controller = controllerFactory.create();
1068
+ self = createConstRef(controller);
1069
+ bucket = {
1070
+ engine,
1071
+ controller,
1072
+ self,
1073
+ modelRef
1074
+ };
1075
+ } else {
1076
+ let model = valueForRef(modelRef);
1077
+ controller = controllerFactory.create({
1078
+ model
1079
+ });
1080
+ self = createConstRef(controller);
1081
+ bucket = {
1082
+ engine,
1083
+ controller,
1084
+ self,
1085
+ modelRef
1086
+ };
1087
+ }
1088
+ if (env.debugRenderTree) {
1089
+ associateDestroyableChild(engine, controller);
1090
+ }
1091
+ return bucket;
1092
+ }
1093
+ getDebugName({
1094
+ name
1095
+ }) {
1096
+ return name;
1097
+ }
1098
+ getDebugCustomRenderTree(definition, state, args) {
1099
+ return [{
1100
+ bucket: state.engine,
1101
+ instance: state.engine,
1102
+ type: 'engine',
1103
+ name: definition.name,
1104
+ args
1105
+ }, {
1106
+ bucket: state.controller,
1107
+ instance: state.controller,
1108
+ type: 'route-template',
1109
+ name: 'application',
1110
+ args
1111
+ }];
1112
+ }
1113
+ getSelf({
1114
+ self
1115
+ }) {
1116
+ return self;
1117
+ }
1118
+ getDestroyable(bucket) {
1119
+ return bucket.engine;
1120
+ }
1121
+ didCreate() {}
1122
+ didUpdate() {}
1123
+ didRenderLayout() {}
1124
+ didUpdateLayout() {}
1125
+ update(bucket) {
1126
+ let {
1127
+ controller,
1128
+ modelRef
1129
+ } = bucket;
1130
+ if (modelRef !== undefined) {
1131
+ controller.set('model', valueForRef(modelRef));
1132
+ }
1133
+ }
1134
+ }
1135
+ const MOUNT_MANAGER = new MountManager();
1136
+ class MountDefinition {
1137
+ // handle is not used by this custom definition
1138
+ handle = -1;
1139
+ state;
1140
+ manager = MOUNT_MANAGER;
1141
+ compilable = null;
1142
+ capabilities = capabilityFlagsFrom(CAPABILITIES$1);
1143
+ constructor(resolvedName) {
1144
+ this.resolvedName = resolvedName;
1145
+ this.state = {
1146
+ name: resolvedName
1147
+ };
1148
+ }
1149
+ }
1150
+
1151
+ /**
1152
+ @module ember
1153
+ */
1154
+
1155
+
1156
+ /**
1157
+ The `{{mount}}` helper lets you embed a routeless engine in a template.
1158
+ Mounting an engine will cause an instance to be booted and its `application`
1159
+ template to be rendered.
1160
+
1161
+ For example, the following template mounts the `ember-chat` engine:
1162
+
1163
+ ```handlebars
1164
+ {{! application.hbs }}
1165
+ {{mount "ember-chat"}}
1166
+ ```
1167
+
1168
+ Additionally, you can also pass in a `model` argument that will be
1169
+ set as the engines model. This can be an existing object:
1170
+
1171
+ ```
1172
+ <div>
1173
+ {{mount 'admin' model=userSettings}}
1174
+ </div>
1175
+ ```
1176
+
1177
+ Or an inline `hash`, and you can even pass components:
1178
+
1179
+ ```
1180
+ <div>
1181
+ <h1>Application template!</h1>
1182
+ {{mount 'admin' model=(hash
1183
+ title='Secret Admin'
1184
+ signInButton=(component 'sign-in-button')
1185
+ )}}
1186
+ </div>
1187
+ ```
1188
+
1189
+ @method mount
1190
+ @param {String} name Name of the engine to mount.
1191
+ @param {Object} [model] Object that will be set as
1192
+ the model of the engine.
1193
+ @for Ember.Templates.helpers
1194
+ @public
1195
+ */
1196
+ const mountHelper = internalHelper((args, owner) => {
1197
+ let nameRef = args.positional[0];
1198
+ let captured;
1199
+ captured = createCapturedArgs(args.named, EMPTY_POSITIONAL);
1200
+ let lastName, lastDef;
1201
+ return createComputeRef(() => {
1202
+ let name = valueForRef(nameRef);
1203
+ if (typeof name === 'string') {
1204
+ if (lastName === name) {
1205
+ return lastDef;
1206
+ }
1207
+ lastName = name;
1208
+ lastDef = curry(0, new MountDefinition(name), owner, captured, true);
1209
+ return lastDef;
1210
+ } else {
1211
+ lastDef = null;
1212
+ lastName = null;
1213
+ return null;
1214
+ }
1215
+ });
1216
+ });
1217
+
1218
+ const CAPABILITIES = {
1219
+ dynamicLayout: false,
1220
+ dynamicTag: false,
1221
+ prepareArgs: false,
1222
+ createArgs: true,
1223
+ attributeHook: false,
1224
+ elementHook: false,
1225
+ createCaller: false,
1226
+ dynamicScope: false,
1227
+ updateHook: false,
1228
+ createInstance: true,
1229
+ wrapped: false,
1230
+ willDestroy: false,
1231
+ hasSubOwner: false
1232
+ };
1233
+ const CAPABILITIES_MASK = capabilityFlagsFrom(CAPABILITIES);
1234
+ class RouteTemplateManager {
1235
+ create(_owner, _definition, args) {
1236
+ let self = args.named.get('controller');
1237
+ let controller = valueForRef(self);
1238
+ return {
1239
+ self,
1240
+ controller
1241
+ };
1242
+ }
1243
+ getSelf({
1244
+ self
1245
+ }) {
1246
+ return self;
1247
+ }
1248
+ getDebugName({
1249
+ name
1250
+ }) {
1251
+ return `route-template (${name})`;
1252
+ }
1253
+ getDebugCustomRenderTree({
1254
+ name
1255
+ }, state, args) {
1256
+ return [{
1257
+ bucket: state,
1258
+ type: 'route-template',
1259
+ name,
1260
+ args,
1261
+ instance: state.controller
1262
+ }];
1263
+ }
1264
+ getCapabilities() {
1265
+ return CAPABILITIES;
1266
+ }
1267
+ didRenderLayout() {}
1268
+ didUpdateLayout() {}
1269
+ didCreate() {}
1270
+ didUpdate() {}
1271
+ getDestroyable() {
1272
+ return null;
1273
+ }
1274
+ }
1275
+ const ROUTE_TEMPLATE_MANAGER = new RouteTemplateManager();
1276
+
1277
+ /**
1278
+ * This "upgrades" a route template into a invocable component. Conceptually
1279
+ * it can be 1:1 for each unique `Template`, but it's also cheap to construct,
1280
+ * so unless the stability is desirable for other reasons, it's probably not
1281
+ * worth caching this.
1282
+ */
1283
+ class RouteTemplate {
1284
+ // handle is not used by this custom definition
1285
+ handle = -1;
1286
+ resolvedName;
1287
+ state;
1288
+ manager = ROUTE_TEMPLATE_MANAGER;
1289
+ capabilities = CAPABILITIES_MASK;
1290
+ compilable;
1291
+ constructor(name, template) {
1292
+ let unwrapped = unwrapTemplate(template);
1293
+ // TODO This actually seems inaccurate – it ultimately came from the
1294
+ // outlet's name. Also, setting this overrides `getDebugName()` in that
1295
+ // message. Is that desirable?
1296
+ this.resolvedName = name;
1297
+ this.state = {
1298
+ name
1299
+ };
1300
+ this.compilable = unwrapped.asLayout();
1301
+ }
1302
+ }
1303
+
1304
+ // TODO a lot these fields are copied from the adjacent existing components
1305
+ // implementation, haven't looked into who cares about `ComponentDefinition`
1306
+ // and if it is appropriate here. It seems like this version is intended to
1307
+ // be used with `curry` which probably isn't necessary here. It could be the
1308
+ // case that we just want to do something more similar to `InternalComponent`
1309
+ // (the one we used to implement `Input` and `LinkTo`). For now it follows
1310
+ // the same pattern to get things going.
1311
+ function makeRouteTemplate(owner, name, template) {
1312
+ let routeTemplate = new RouteTemplate(name, template);
1313
+ return curry(0, routeTemplate, owner, null, true);
1314
+ }
1315
+
1316
+ /**
1317
+ The `{{outlet}}` helper lets you specify where a child route will render in
1318
+ your template. An important use of the `{{outlet}}` helper is in your
1319
+ application's `application.hbs` file:
1320
+
1321
+ ```app/templates/application.hbs
1322
+ <MyHeader />
1323
+
1324
+ <div class="my-dynamic-content">
1325
+ <!-- this content will change based on the current route, which depends on the current URL -->
1326
+ {{outlet}}
1327
+ </div>
1328
+
1329
+ <MyFooter />
1330
+ ```
1331
+
1332
+ See the [routing guide](https://guides.emberjs.com/release/routing/rendering-a-template/) for more
1333
+ information on how your `route` interacts with the `{{outlet}}` helper.
1334
+ Note: Your content __will not render__ if there isn't an `{{outlet}}` for it.
1335
+
1336
+ @method outlet
1337
+ @for Ember.Templates.helpers
1338
+ @public
1339
+ */
1340
+ const outletHelper = internalHelper((_args, owner, scope) => {
1341
+ let outletRef = createComputeRef(() => {
1342
+ let state = valueForRef(scope.get('outletState'));
1343
+ return state?.outlets?.main;
1344
+ });
1345
+ let lastState = null;
1346
+ let outlet = null;
1347
+ return createComputeRef(() => {
1348
+ let outletState = valueForRef(outletRef);
1349
+ let state = stateFor(outletRef, outletState);
1350
+
1351
+ // This code is deliberately using the behavior in glimmer-vm where in
1352
+ // <@Component />, the component is considered stabled via `===`, and
1353
+ // will continue to re-render in-place as long as the `===` holds, but
1354
+ // when it changes to a different object, it teardown the old component
1355
+ // (running destructors, etc), and render the component in its place (or
1356
+ // nothing if the new value is nullish. Here we are carefully exploiting
1357
+ // that fact, and returns the same stable object so long as it is the
1358
+ // same route, but return a different one when the route changes. On the
1359
+ // other hand, changing the model only intentionally do not teardown the
1360
+ // component and instead re-render in-place.
1361
+ if (!isStable(state, lastState)) {
1362
+ lastState = state;
1363
+ if (state !== null) {
1364
+ // If we are crossing an engine mount point, this is how the owner
1365
+ // gets switched.
1366
+ let outletOwner = outletState?.render?.owner ?? owner;
1367
+ let named = dict();
1368
+
1369
+ // Here we either have a raw template that needs to be normalized,
1370
+ // or a component that we can render as-is. `RouteTemplate` upgrades
1371
+ // the template into a component so we can have a unified code path.
1372
+ // We still store the original `template` value, because we rely on
1373
+ // its identity for the stability check, and the `RouteTemplate`
1374
+ // wrapper doesn't dedup for us.
1375
+ let template = state.template;
1376
+ let component;
1377
+ if (hasInternalComponentManager(template)) {
1378
+ component = template;
1379
+ } else {
1380
+ component = makeRouteTemplate(outletOwner, state.name, template);
1381
+ }
1382
+
1383
+ // Component is stable for the lifetime of the outlet
1384
+ named['Component'] = createConstRef(component);
1385
+
1386
+ // Controller is stable for the lifetime of the outlet
1387
+ named['controller'] = createConstRef(state.controller);
1388
+
1389
+ // Create a ref for the model
1390
+ let modelRef = childRefFromParts(outletRef, ['render', 'model']);
1391
+
1392
+ // Store the value of the model
1393
+ let model = valueForRef(modelRef);
1394
+
1395
+ // Create a compute ref which we pass in as the `{{@model}}` reference
1396
+ // for the outlet. This ref will update and return the value of the
1397
+ // model _until_ the outlet itself changes. Once the outlet changes,
1398
+ // dynamic scope also changes, and so the original model ref would not
1399
+ // provide the correct updated value. So we stop updating and return
1400
+ // the _last_ model value for that outlet.
1401
+ named['model'] = createComputeRef(() => {
1402
+ if (lastState === state) {
1403
+ model = valueForRef(modelRef);
1404
+ }
1405
+ return model;
1406
+ });
1407
+ let args = createCapturedArgs(named, EMPTY_POSITIONAL);
1408
+
1409
+ // Package up everything
1410
+ outlet = curry(0, new OutletComponent(owner, state), outletOwner, args, true);
1411
+ } else {
1412
+ outlet = null;
1413
+ }
1414
+ }
1415
+ return outlet;
1416
+ });
1417
+ });
1418
+ function stateFor(ref, outlet) {
1419
+ if (outlet === undefined) return null;
1420
+ let render = outlet.render;
1421
+ if (render === undefined) return null;
1422
+ let template = render.template;
1423
+ // The type doesn't actually allow for `null`, but if we make it past this
1424
+ // point it is really important that we have _something_ to render. We could
1425
+ // assert, but that is probably overly strict for very little to gain.
1426
+ if (template === undefined || template === null) return null;
1427
+ return {
1428
+ ref,
1429
+ name: render.name,
1430
+ template,
1431
+ controller: render.controller
1432
+ };
1433
+ }
1434
+ function isStable(state, lastState) {
1435
+ if (state === null || lastState === null) {
1436
+ return false;
1437
+ }
1438
+ return state.template === lastState.template && state.controller === lastState.controller;
1439
+ }
1440
+
1441
+ function instrumentationPayload(name) {
1442
+ return {
1443
+ object: `component:${name}`
1444
+ };
1445
+ }
1446
+ function componentFor(name, owner) {
1447
+ let fullName = `component:${name}`;
1448
+ return owner.factoryFor(fullName) || null;
1449
+ }
1450
+ function lookupComponentPair(owner, name) {
1451
+ let component = componentFor(name, owner);
1452
+ if (isFactory(component) && component.class) {
1453
+ let layout = getComponentTemplate(component.class);
1454
+ if (layout !== undefined) {
1455
+ return {
1456
+ component,
1457
+ layout
1458
+ };
1459
+ }
1460
+ }
1461
+ if (component === null) {
1462
+ return null;
1463
+ } else {
1464
+ return {
1465
+ component,
1466
+ layout: null
1467
+ };
1468
+ }
1469
+ }
1470
+ const BUILTIN_KEYWORD_HELPERS = {
1471
+ mut,
1472
+ readonly,
1473
+ unbound,
1474
+ '-hash': hash,
1475
+ '-each-in': eachIn,
1476
+ '-normalize-class': normalizeClassHelper,
1477
+ '-resolve': resolve,
1478
+ '-track-array': trackArray,
1479
+ '-mount': mountHelper,
1480
+ '-outlet': outletHelper,
1481
+ '-in-el-null': inElementNullCheckHelper
1482
+ };
1483
+ const BUILTIN_HELPERS = {
1484
+ ...BUILTIN_KEYWORD_HELPERS,
1485
+ array,
1486
+ concat,
1487
+ fn,
1488
+ get: get$1,
1489
+ hash,
1490
+ 'unique-id': uniqueId
1491
+ };
1492
+ {
1493
+ // Bug: this may be a quirk of our test setup?
1494
+ // In prod builds, this is a no-op helper and is unused in practice. We shouldn't need
1495
+ // to add it at all, but the current test build doesn't produce a "prod compiler", so
1496
+ // we ended up running the debug-build for the template compliler in prod tests. Once
1497
+ // that is fixed, this can be removed. For now, this allows the test to work and does
1498
+ // not really harm anything, since it's just a no-op pass-through helper and the bytes
1499
+ // has to be included anyway. In the future, perhaps we can avoid the latter by using
1500
+ // `import(...)`?
1501
+ BUILTIN_HELPERS['-disallow-dynamic-resolution'] = disallowDynamicResolution;
1502
+ }
1503
+
1504
+ // With the implementation of RFC #1006(https://rfcs.emberjs.com/id/1006-deprecate-action-template-helper), the `action` modifer was removed. It was the
1505
+ // only built-in keyword modifier, so this object is currently empty.
1506
+ const BUILTIN_KEYWORD_MODIFIERS = {};
1507
+ const BUILTIN_MODIFIERS = {
1508
+ ...BUILTIN_KEYWORD_MODIFIERS,
1509
+ on
1510
+ };
1511
+ class ResolverImpl {
1512
+ componentDefinitionCache = new Map();
1513
+ lookupPartial() {
1514
+ return null;
1515
+ }
1516
+ lookupHelper(name, owner) {
1517
+ let helper = BUILTIN_HELPERS[name];
1518
+ if (helper !== undefined) {
1519
+ return helper;
1520
+ }
1521
+ let factory = owner.factoryFor(`helper:${name}`);
1522
+ if (factory === undefined) {
1523
+ return null;
1524
+ }
1525
+ let definition = factory.class;
1526
+ if (definition === undefined) {
1527
+ return null;
1528
+ }
1529
+ if (typeof definition === 'function' && isClassicHelper(definition)) {
1530
+ // For classic class based helpers, we need to pass the factoryFor result itself rather
1531
+ // than the raw value (`factoryFor(...).class`). This is because injections are already
1532
+ // bound in the factoryFor result, including type-based injections
1533
+
1534
+ {
1535
+ setInternalHelperManager(CLASSIC_HELPER_MANAGER, factory);
1536
+ }
1537
+ return factory;
1538
+ }
1539
+ return definition;
1540
+ }
1541
+ lookupBuiltInHelper(name) {
1542
+ return BUILTIN_KEYWORD_HELPERS[name] ?? null;
1543
+ }
1544
+ lookupModifier(name, owner) {
1545
+ let builtin = BUILTIN_MODIFIERS[name];
1546
+ if (builtin !== undefined) {
1547
+ return builtin;
1548
+ }
1549
+ let modifier = owner.factoryFor(`modifier:${name}`);
1550
+ if (modifier === undefined) {
1551
+ return null;
1552
+ }
1553
+ return modifier.class || null;
1554
+ }
1555
+ lookupBuiltInModifier(name) {
1556
+ return BUILTIN_KEYWORD_MODIFIERS[name] ?? null;
1557
+ }
1558
+ lookupComponent(name, owner) {
1559
+ let pair = lookupComponentPair(owner, name);
1560
+ if (pair === null) {
1561
+ return null;
1562
+ }
1563
+ let template = null;
1564
+ let key;
1565
+ if (pair.component === null) {
1566
+ key = template = pair.layout(owner);
1567
+ } else {
1568
+ key = pair.component;
1569
+ }
1570
+ let cachedComponentDefinition = this.componentDefinitionCache.get(key);
1571
+ if (cachedComponentDefinition !== undefined) {
1572
+ return cachedComponentDefinition;
1573
+ }
1574
+ if (template === null && pair.layout !== null) {
1575
+ template = pair.layout(owner);
1576
+ }
1577
+ let finalizer = _instrumentStart('render.getComponentDefinition', instrumentationPayload, name);
1578
+ let definition = null;
1579
+ if (pair.component === null) {
1580
+ definition = {
1581
+ state: templateOnlyComponent(undefined, name),
1582
+ manager: TEMPLATE_ONLY_COMPONENT_MANAGER,
1583
+ template
1584
+ };
1585
+ } else {
1586
+ let factory = pair.component;
1587
+ let ComponentClass = factory.class;
1588
+ let manager = getInternalComponentManager(ComponentClass);
1589
+ definition = {
1590
+ state: isCurlyManager(manager) ? factory : ComponentClass,
1591
+ manager,
1592
+ template
1593
+ };
1594
+ }
1595
+ finalizer();
1596
+ this.componentDefinitionCache.set(key, definition);
1597
+ return definition;
1598
+ }
1599
+ }
1600
+
1601
+ // We use the `InternalOwner` notion here because we actually need all of its
1602
+ // API for using with renderers (normally, it will be `EngineInstance`).
1603
+ // We use `getOwner` from our internal home for it rather than the narrower
1604
+ // public API for the same reason.
1605
+ const TOP_LEVEL_NAME = '-top-level';
1606
+ class OutletView {
1607
+ static extend(injections) {
1608
+ return class extends OutletView {
1609
+ static create(options) {
1610
+ if (options) {
1611
+ return super.create(Object.assign({}, injections, options));
1612
+ } else {
1613
+ return super.create(injections);
1614
+ }
1615
+ }
1616
+ };
1617
+ }
1618
+ static reopenClass(injections) {
1619
+ Object.assign(this, injections);
1620
+ }
1621
+ static create(options) {
1622
+ let {
1623
+ environment: _environment,
1624
+ application: namespace,
1625
+ template: templateFactory
1626
+ } = options;
1627
+ let owner = getOwner(options);
1628
+ let template = templateFactory(owner);
1629
+ return new OutletView(_environment, owner, template, namespace);
1630
+ }
1631
+ ref;
1632
+ state;
1633
+ constructor(_environment, owner, template, namespace) {
1634
+ this._environment = _environment;
1635
+ this.owner = owner;
1636
+ this.template = template;
1637
+ this.namespace = namespace;
1638
+ let outletStateTag = createTag();
1639
+ let outletState = {
1640
+ outlets: {
1641
+ main: undefined
1642
+ },
1643
+ render: {
1644
+ owner: owner,
1645
+ name: TOP_LEVEL_NAME,
1646
+ controller: undefined,
1647
+ model: undefined,
1648
+ template
1649
+ }
1650
+ };
1651
+ let ref = this.ref = createComputeRef(() => {
1652
+ consumeTag(outletStateTag);
1653
+ return outletState;
1654
+ }, state => {
1655
+ DIRTY_TAG$1(outletStateTag);
1656
+ outletState.outlets['main'] = state;
1657
+ });
1658
+ this.state = {
1659
+ ref,
1660
+ name: TOP_LEVEL_NAME,
1661
+ template,
1662
+ controller: undefined
1663
+ };
1664
+ }
1665
+ appendTo(selector) {
1666
+ let target;
1667
+ if (this._environment.hasDOM) {
1668
+ target = typeof selector === 'string' ? document.querySelector(selector) : selector;
1669
+ } else {
1670
+ target = selector;
1671
+ }
1672
+ let renderer = this.owner.lookup('renderer:-dom');
1673
+
1674
+ // SAFETY: It's not clear that this cast is safe.
1675
+ // The types for appendOutletView may be incorrect or this is a potential bug.
1676
+ schedule('render', renderer, 'appendOutletView', this, target);
1677
+ }
1678
+ rerender() {
1679
+ /**/
1680
+ }
1681
+ setOutletState(state) {
1682
+ updateRef(this.ref, state);
1683
+ }
1684
+ destroy() {
1685
+ /**/
1686
+ }
1687
+ }
1688
+
1689
+ class DynamicScope {
1690
+ constructor(view, outletState) {
1691
+ this.view = view;
1692
+ this.outletState = outletState;
1693
+ }
1694
+ child() {
1695
+ return new DynamicScope(this.view, this.outletState);
1696
+ }
1697
+ get(key) {
1698
+ return this.outletState;
1699
+ }
1700
+ set(key, value) {
1701
+ this.outletState = value;
1702
+ return value;
1703
+ }
1704
+ }
1705
+ const NO_OP = () => {};
1706
+
1707
+ // This wrapper logic prevents us from rerendering in case of a hard failure
1708
+ // during render. This prevents infinite revalidation type loops from occuring,
1709
+ // and ensures that errors are not swallowed by subsequent follow on failures.
1710
+ function errorLoopTransaction(fn) {
1711
+ {
1712
+ return fn;
1713
+ }
1714
+ }
1715
+ class ComponentRootState {
1716
+ type = 'component';
1717
+ #result;
1718
+ #render;
1719
+ constructor(state, definition, options) {
1720
+ this.#render = errorLoopTransaction(() => {
1721
+ let iterator = renderComponent$1(state.context, state.builder(state.env, options.into), state.owner, definition, options?.args);
1722
+ let result = this.#result = iterator.sync();
1723
+ associateDestroyableChild(this, this.#result);
1724
+ this.#render = errorLoopTransaction(() => {
1725
+ if (isDestroying(result) || isDestroyed(result)) return;
1726
+ return result.rerender({
1727
+ alwaysRevalidate: false
1728
+ });
1729
+ });
1730
+ });
1731
+ }
1732
+ isFor(_component) {
1733
+ return false;
1734
+ }
1735
+ render() {
1736
+ this.#render();
1737
+ }
1738
+ destroy() {
1739
+ destroy(this);
1740
+ }
1741
+ get destroyed() {
1742
+ return isDestroyed(this);
1743
+ }
1744
+ get result() {
1745
+ return this.#result;
1746
+ }
1747
+ }
1748
+ class ClassicRootState {
1749
+ type = 'classic';
1750
+ id;
1751
+ result;
1752
+ destroyed;
1753
+ render;
1754
+ env;
1755
+ constructor(root, context, owner, template, self, parentElement, dynamicScope, builder) {
1756
+ this.root = root;
1757
+ this.id = root instanceof OutletView ? guidFor(root) : getViewId(root);
1758
+ this.result = undefined;
1759
+ this.destroyed = false;
1760
+ this.env = context.env;
1761
+ this.render = errorLoopTransaction(() => {
1762
+ let layout = unwrapTemplate(template).asLayout();
1763
+ let iterator = renderMain(context, owner, self, builder(context.env, {
1764
+ element: parentElement,
1765
+ nextSibling: null
1766
+ }), layout, dynamicScope);
1767
+ let result = this.result = iterator.sync();
1768
+ associateDestroyableChild(this, result);
1769
+ this.render = errorLoopTransaction(() => {
1770
+ if (isDestroying(result) || isDestroyed(result)) return;
1771
+ return result.rerender({
1772
+ alwaysRevalidate: false
1773
+ });
1774
+ });
1775
+ });
1776
+ }
1777
+ isFor(possibleRoot) {
1778
+ return this.root === possibleRoot;
1779
+ }
1780
+ destroy() {
1781
+ let {
1782
+ result,
1783
+ env
1784
+ } = this;
1785
+ this.destroyed = true;
1786
+ this.root = null;
1787
+ this.result = undefined;
1788
+ this.render = undefined;
1789
+ if (result !== undefined) {
1790
+ /*
1791
+ Handles these scenarios:
1792
+ * When roots are removed during standard rendering process, a transaction exists already
1793
+ `.begin()` / `.commit()` are not needed.
1794
+ * When roots are being destroyed manually (`component.append(); component.destroy() case), no
1795
+ transaction exists already.
1796
+ * When roots are being destroyed during `Renderer#destroy`, no transaction exists
1797
+ */
1798
+
1799
+ inTransaction(env, () => destroy(result));
1800
+ }
1801
+ }
1802
+ }
1803
+ const renderers = [];
1804
+ function _resetRenderers() {
1805
+ renderers.length = 0;
1806
+ }
1807
+ function register(renderer) {
1808
+ renderers.push(renderer);
1809
+ }
1810
+ function deregister(renderer) {
1811
+ let index = renderers.indexOf(renderer);
1812
+ renderers.splice(index, 1);
1813
+ }
1814
+ function loopBegin() {
1815
+ for (let renderer of renderers) {
1816
+ renderer.rerender();
1817
+ }
1818
+ }
1819
+ let renderSettledDeferred = null;
1820
+ /*
1821
+ Returns a promise which will resolve when rendering has settled. Settled in
1822
+ this context is defined as when all of the tags in use are "current" (e.g.
1823
+ `renderers.every(r => r._isValid())`). When this is checked at the _end_ of
1824
+ the run loop, this essentially guarantees that all rendering is completed.
1825
+
1826
+ @method renderSettled
1827
+ @returns {Promise<void>} a promise which fulfills when rendering has settled
1828
+ */
1829
+ function renderSettled() {
1830
+ if (renderSettledDeferred === null) {
1831
+ renderSettledDeferred = RSVP.defer();
1832
+ // if there is no current runloop, the promise created above will not have
1833
+ // a chance to resolve (because its resolved in backburner's "end" event)
1834
+ if (!_getCurrentRunLoop()) {
1835
+ // ensure a runloop has been kicked off
1836
+ _backburner.schedule('actions', null, NO_OP);
1837
+ }
1838
+ }
1839
+ return renderSettledDeferred.promise;
1840
+ }
1841
+ function resolveRenderPromise() {
1842
+ if (renderSettledDeferred !== null) {
1843
+ let resolve = renderSettledDeferred.resolve;
1844
+ renderSettledDeferred = null;
1845
+ _backburner.join(null, resolve);
1846
+ }
1847
+ }
1848
+ let loops = 0;
1849
+ function loopEnd() {
1850
+ for (let renderer of renderers) {
1851
+ if (!renderer.isValid()) {
1852
+ if (loops > ENV._RERENDER_LOOP_LIMIT) {
1853
+ loops = 0;
1854
+ // TODO: do something better
1855
+ renderer.destroy();
1856
+ throw new Error('infinite rendering invalidation detected');
1857
+ }
1858
+ loops++;
1859
+ return _backburner.join(null, NO_OP);
1860
+ }
1861
+ }
1862
+ loops = 0;
1863
+ resolveRenderPromise();
1864
+ }
1865
+ _backburner.on('begin', loopBegin);
1866
+ _backburner.on('end', loopEnd);
1867
+ class RendererState {
1868
+ static create(data, renderer) {
1869
+ const state = new RendererState(data, renderer);
1870
+ associateDestroyableChild(renderer, state);
1871
+ return state;
1872
+ }
1873
+ #data;
1874
+ #lastRevision = -1;
1875
+ #inRenderTransaction = false;
1876
+ #destroyed = false;
1877
+ #roots = [];
1878
+ #removedRoots = [];
1879
+ constructor(data, renderer) {
1880
+ this.#data = data;
1881
+ registerDestructor(this, () => {
1882
+ this.clearAllRoots(renderer);
1883
+ });
1884
+ }
1885
+ get debug() {
1886
+ return {
1887
+ roots: this.#roots,
1888
+ inRenderTransaction: this.#inRenderTransaction,
1889
+ isInteractive: this.isInteractive
1890
+ };
1891
+ }
1892
+ get roots() {
1893
+ return this.#roots;
1894
+ }
1895
+ get owner() {
1896
+ return this.#data.owner;
1897
+ }
1898
+ get builder() {
1899
+ return this.#data.builder;
1900
+ }
1901
+ get context() {
1902
+ return this.#data.context;
1903
+ }
1904
+ get env() {
1905
+ return this.context.env;
1906
+ }
1907
+ get isInteractive() {
1908
+ return this.#data.context.env.isInteractive;
1909
+ }
1910
+ renderRoot(root, renderer) {
1911
+ let roots = this.#roots;
1912
+ roots.push(root);
1913
+ associateDestroyableChild(this, root);
1914
+ if (roots.length === 1) {
1915
+ register(renderer);
1916
+ }
1917
+ this.#renderRootsTransaction(renderer);
1918
+ return root;
1919
+ }
1920
+ #renderRootsTransaction(renderer) {
1921
+ if (this.#inRenderTransaction) {
1922
+ // currently rendering roots, a new root was added and will
1923
+ // be processed by the existing _renderRoots invocation
1924
+ return;
1925
+ }
1926
+
1927
+ // used to prevent calling _renderRoots again (see above)
1928
+ // while we are actively rendering roots
1929
+ this.#inRenderTransaction = true;
1930
+ let completedWithoutError = false;
1931
+ try {
1932
+ this.renderRoots(renderer);
1933
+ completedWithoutError = true;
1934
+ } finally {
1935
+ if (!completedWithoutError) {
1936
+ this.#lastRevision = valueForTag(CURRENT_TAG);
1937
+ }
1938
+ this.#inRenderTransaction = false;
1939
+ }
1940
+ }
1941
+ renderRoots(renderer) {
1942
+ let roots = this.#roots;
1943
+ let removedRoots = this.#removedRoots;
1944
+ let initialRootsLength;
1945
+ do {
1946
+ initialRootsLength = roots.length;
1947
+ inTransaction(this.context.env, () => {
1948
+ // ensure that for the first iteration of the loop
1949
+ // each root is processed
1950
+ for (let i = 0; i < roots.length; i++) {
1951
+ let root = roots[i];
1952
+ (false && !(root) && assert('has root', root));
1953
+ if (root.destroyed) {
1954
+ // add to the list of roots to be removed
1955
+ // they will be removed from `this._roots` later
1956
+ removedRoots.push(root);
1957
+
1958
+ // skip over roots that have been marked as destroyed
1959
+ continue;
1960
+ }
1961
+
1962
+ // when processing non-initial reflush loops,
1963
+ // do not process more roots than needed
1964
+ if (i >= initialRootsLength) {
1965
+ continue;
1966
+ }
1967
+ root.render();
1968
+ }
1969
+ this.#lastRevision = valueForTag(CURRENT_TAG);
1970
+ });
1971
+ } while (roots.length > initialRootsLength);
1972
+
1973
+ // remove any roots that were destroyed during this transaction
1974
+ while (removedRoots.length) {
1975
+ let root = removedRoots.pop();
1976
+ let rootIndex = roots.indexOf(root);
1977
+ roots.splice(rootIndex, 1);
1978
+ }
1979
+ if (this.#roots.length === 0) {
1980
+ deregister(renderer);
1981
+ }
1982
+ }
1983
+ scheduleRevalidate(renderer) {
1984
+ _backburner.scheduleOnce('render', this, this.revalidate, renderer);
1985
+ }
1986
+ isValid() {
1987
+ return this.#destroyed || this.#roots.length === 0 || validateTag(CURRENT_TAG, this.#lastRevision);
1988
+ }
1989
+ revalidate(renderer) {
1990
+ if (this.isValid()) {
1991
+ return;
1992
+ }
1993
+ this.#renderRootsTransaction(renderer);
1994
+ }
1995
+ clearAllRoots(renderer) {
1996
+ let roots = this.#roots;
1997
+ for (let root of roots) {
1998
+ destroy(root);
1999
+ }
2000
+ this.#removedRoots.length = 0;
2001
+ this.#roots = [];
2002
+
2003
+ // if roots were present before destroying
2004
+ // deregister this renderer instance
2005
+ if (roots.length) {
2006
+ deregister(renderer);
2007
+ }
2008
+ }
2009
+ }
2010
+
2011
+ /**
2012
+ * The returned object from `renderComponent`
2013
+ * @public
2014
+ * @module @ember/renderer
2015
+ */
2016
+
2017
+ function intoTarget(into) {
2018
+ if ('element' in into) {
2019
+ return into;
2020
+ } else {
2021
+ return {
2022
+ element: into,
2023
+ nextSibling: null
2024
+ };
2025
+ }
2026
+ }
2027
+
2028
+ /**
2029
+ * Render a component into a DOM element.
2030
+ *
2031
+ * @method renderComponent
2032
+ * @static
2033
+ * @for @ember/renderer
2034
+ * @param {Object} component The component to render.
2035
+ * @param {Object} options
2036
+ * @param {Element} options.into Where to render the component in to.
2037
+ * @param {Object} [options.owner] Optionally specify the owner to use. This will be used for injections, and overall cleanup.
2038
+ * @param {Object} [options.env] Optional renderer configuration
2039
+ * @param {Object} [options.args] Optionally pass args in to the component. These may be reactive as long as it is an object or object-like
2040
+ * @public
2041
+ */
2042
+ function renderComponent(
2043
+ /**
2044
+ * The component definition to render.
2045
+ *
2046
+ * Any component that has had its manager registered is valid.
2047
+ * For the component-types that ship with ember, manager registration
2048
+ * does not need to be worried about.
2049
+ */
2050
+ component, {
2051
+ owner = {},
2052
+ env,
2053
+ into,
2054
+ args
2055
+ }) {
2056
+ /**
2057
+ * SAFETY: we should figure out what we need out of a `document` and narrow the API.
2058
+ * this exercise should also end up beginning to define what we need for CLI rendering (or to other outputs)
2059
+ */
2060
+ let document = env && 'document' in env ? env?.['document'] : globalThis.document;
2061
+
2062
+ // Reuse renderer per owner to avoid creating multiple EvaluationContexts
2063
+ // which can cause tracking frame conflicts
2064
+ let renderer = RENDERER_CACHE.get(owner);
2065
+ if (!renderer) {
2066
+ renderer = BaseRenderer.strict(owner, document, {
2067
+ ...env,
2068
+ isInteractive: env?.isInteractive ?? true,
2069
+ hasDOM: env && 'hasDOM' in env ? Boolean(env?.['hasDOM']) : true
2070
+ });
2071
+ RENDERER_CACHE.set(owner, renderer);
2072
+ }
2073
+
2074
+ /**
2075
+ * Replace all contents, if we've rendered multiple times.
2076
+ *
2077
+ * https://github.com/emberjs/rfcs/pull/1099/files#diff-2b962105b9083ca84579cdc957f27f49407440f3c5078083fa369ec18cc46da8R365
2078
+ *
2079
+ * We could later add an option to not do this behavior
2080
+ *
2081
+ * NOTE: destruction is async
2082
+ */
2083
+ let existing = RENDER_CACHE.get(into);
2084
+ existing?.result.destroy();
2085
+ /**
2086
+ * We can only replace the inner HTML the first time.
2087
+ * Because destruction is async, it won't be safe to
2088
+ * do this again, and we'll have to rely on the above destroy.
2089
+ */
2090
+ if (!existing && into instanceof Element) {
2091
+ into.innerHTML = '';
2092
+ }
2093
+
2094
+ /**
2095
+ * If there's an existing render result with valid bounds, use its
2096
+ * firstNode as the nextSibling so that new content is inserted at
2097
+ * the same DOM position. This ensures stable ordering when multiple
2098
+ * renderComponent calls target the same element and one is re-invoked
2099
+ * (e.g., due to tracked dependency changes).
2100
+ *
2101
+ * The old content's DOM nodes are still present (destruction is async),
2102
+ * so firstNode() is a valid position reference. The new content is placed
2103
+ * BEFORE the old content. When the old content is eventually destroyed
2104
+ * (async clear of bounds), the new content remains in the correct position.
2105
+ */
2106
+ let renderTarget = into;
2107
+ if (existing?.glimmerResult) {
2108
+ let parentElement = into instanceof Element ? into : into.element;
2109
+ let firstNode = existing.glimmerResult.firstNode();
2110
+ renderTarget = {
2111
+ element: parentElement,
2112
+ nextSibling: firstNode
2113
+ };
2114
+ }
2115
+ let innerResult = renderer.render(component, {
2116
+ into: renderTarget,
2117
+ args
2118
+ }).result;
2119
+ if (innerResult) {
2120
+ associateDestroyableChild(owner, innerResult);
2121
+ }
2122
+ let result = {
2123
+ destroy() {
2124
+ if (innerResult) {
2125
+ destroy(innerResult);
2126
+ }
2127
+ }
2128
+ };
2129
+ RENDER_CACHE.set(into, {
2130
+ result,
2131
+ glimmerResult: innerResult
2132
+ });
2133
+ return result;
2134
+ }
2135
+ const RENDER_CACHE = new WeakMap();
2136
+ const RENDERER_CACHE = new WeakMap();
2137
+ class BaseRenderer {
2138
+ static strict(owner, document, options) {
2139
+ return new BaseRenderer(owner, {
2140
+ hasDOM: hasDOM,
2141
+ ...options
2142
+ }, document, new ResolverImpl(), clientBuilder);
2143
+ }
2144
+ state;
2145
+ constructor(owner, envOptions, document, resolver, builder) {
2146
+ let sharedArtifacts = artifacts();
2147
+
2148
+ /**
2149
+ * SAFETY: are there consequences for being looser with *this* owner?
2150
+ * the public API for `owner` is kinda `Partial<InternalOwner>`
2151
+ * aka: implement only what you need.
2152
+ * But for actual ember apps, you *need* to implement everything
2153
+ * an app needs (which will actually change and become less over time)
2154
+ */
2155
+ let env = new EmberEnvironmentDelegate(owner, envOptions.isInteractive);
2156
+ let options = runtimeOptions({
2157
+ document
2158
+ }, env, sharedArtifacts, resolver);
2159
+ let context = new EvaluationContextImpl(sharedArtifacts, heap => new RuntimeOpImpl(heap), options);
2160
+ this.state = RendererState.create({
2161
+ owner,
2162
+ context,
2163
+ builder
2164
+ }, this);
2165
+ }
2166
+ get debugRenderTree() {
2167
+ let {
2168
+ debugRenderTree
2169
+ } = this.state.env;
2170
+ return debugRenderTree;
2171
+ }
2172
+ isValid() {
2173
+ return this.state.isValid();
2174
+ }
2175
+ destroy() {
2176
+ destroy(this);
2177
+ }
2178
+ render(component, options) {
2179
+ const root = new ComponentRootState(this.state, component, {
2180
+ args: options.args,
2181
+ into: intoTarget(options.into)
2182
+ });
2183
+ return this.state.renderRoot(root, this);
2184
+ }
2185
+ rerender() {
2186
+ this.state.scheduleRevalidate(this);
2187
+ }
2188
+
2189
+ // render(component: Component, options: { into: Cursor; args?: Record<string, unknown> }): void {
2190
+ // this.state.renderRoot(component);
2191
+ // }
2192
+ }
2193
+ class Renderer extends BaseRenderer {
2194
+ static strict(owner, document, options) {
2195
+ return new BaseRenderer(owner, {
2196
+ hasDOM: hasDOM,
2197
+ ...options
2198
+ }, document, new ResolverImpl(), clientBuilder);
2199
+ }
2200
+ _rootTemplate;
2201
+ _viewRegistry;
2202
+ static create(props) {
2203
+ let {
2204
+ _viewRegistry
2205
+ } = props;
2206
+ let owner = getOwner(props);
2207
+ let document = owner.lookup('service:-document');
2208
+ let env = owner.lookup('-environment:main');
2209
+ let rootTemplate = owner.lookup(privatize`template:-root`);
2210
+ let builder = owner.lookup('service:-dom-builder');
2211
+ return new this(owner, document, env, rootTemplate, _viewRegistry, builder);
2212
+ }
2213
+ constructor(owner, document, env, rootTemplate, viewRegistry, builder = clientBuilder, resolver = new ResolverImpl()) {
2214
+ super(owner, env, document, resolver, builder);
2215
+ this._rootTemplate = rootTemplate(owner);
2216
+ this._viewRegistry = viewRegistry || owner.lookup('-view-registry:main');
2217
+ }
2218
+
2219
+ // renderer HOOKS
2220
+
2221
+ appendOutletView(view, target) {
2222
+ // TODO: This bypasses the {{outlet}} syntax so logically duplicates
2223
+ // some of the set up code. Since this is all internal (or is it?),
2224
+ // we can refactor this to do something more direct/less convoluted
2225
+ // and with less setup, but get it working first
2226
+ let outlet = createRootOutlet(view);
2227
+ let {
2228
+ name,
2229
+ /* controller, */template
2230
+ } = view.state;
2231
+ let named = dict();
2232
+ named['Component'] = createConstRef(makeRouteTemplate(view.owner, name, template));
2233
+
2234
+ // TODO: is this guaranteed to be undefined? It seems to be the
2235
+ // case in the `OutletView` class. Investigate how much that class
2236
+ // exists as an internal implementation detail only, or if it was
2237
+ // used outside of core. As far as I can tell, test-helpers uses
2238
+ // it but only for `setOutletState`.
2239
+ // named['controller'] = createConstRef(controller, '@controller');
2240
+ // Update: at least according to the debug render tree tests, we
2241
+ // appear to always expect this to be undefined. Not a definitive
2242
+ // source by any means, but is useful evidence
2243
+ named['controller'] = UNDEFINED_REFERENCE;
2244
+ named['model'] = UNDEFINED_REFERENCE;
2245
+ let args = createCapturedArgs(named, EMPTY_POSITIONAL);
2246
+ this._appendDefinition(view, curry(0, outlet, view.owner, args, true), target);
2247
+ }
2248
+ appendTo(view, target) {
2249
+ let definition = new RootComponentDefinition(view);
2250
+ this._appendDefinition(view, curry(0, definition, this.state.owner, null, true), target);
2251
+ }
2252
+ _appendDefinition(root, definition, target) {
2253
+ let self = createConstRef(definition);
2254
+ let dynamicScope = new DynamicScope(null, UNDEFINED_REFERENCE);
2255
+ let rootState = new ClassicRootState(root, this.state.context, this.state.owner, this._rootTemplate, self, target, dynamicScope, this.state.builder);
2256
+ this.state.renderRoot(rootState, this);
2257
+ }
2258
+ cleanupRootFor(component) {
2259
+ // no need to cleanup roots if we have already been destroyed
2260
+ if (isDestroyed(this)) {
2261
+ return;
2262
+ }
2263
+ let roots = this.state.roots;
2264
+
2265
+ // traverse in reverse so we can remove items
2266
+ // without mucking up the index
2267
+ let i = roots.length;
2268
+ while (i--) {
2269
+ let root = roots[i];
2270
+ if (root.type === 'classic' && root.isFor(component)) {
2271
+ root.destroy();
2272
+ roots.splice(i, 1);
2273
+ }
2274
+ }
2275
+ }
2276
+ remove(view) {
2277
+ view._transitionTo('destroying');
2278
+ this.cleanupRootFor(view);
2279
+ if (this.state.isInteractive) {
2280
+ view.trigger('didDestroyElement');
2281
+ }
2282
+ }
2283
+ get _roots() {
2284
+ return this.state.debug.roots;
2285
+ }
2286
+ get _inRenderTransaction() {
2287
+ return this.state.debug.inRenderTransaction;
2288
+ }
2289
+ get _isInteractive() {
2290
+ return this.state.debug.isInteractive;
2291
+ }
2292
+ get _context() {
2293
+ return this.state.context;
2294
+ }
2295
+ register(view) {
2296
+ let id = getViewId(view);
2297
+ this._viewRegistry[id] = view;
2298
+ }
2299
+ unregister(view) {
2300
+ delete this._viewRegistry[getViewId(view)];
2301
+ }
2302
+ getElement(component) {
2303
+ if (this._isInteractive) {
2304
+ return getViewElement(component);
2305
+ } else {
2306
+ throw new Error('Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).');
2307
+ }
2308
+ }
2309
+ getBounds(component) {
2310
+ let bounds = component[BOUNDS];
2311
+ let parentElement = bounds.parentElement();
2312
+ let firstNode = bounds.firstNode();
2313
+ let lastNode = bounds.lastNode();
2314
+ return {
2315
+ parentElement,
2316
+ firstNode,
2317
+ lastNode
2318
+ };
2319
+ }
2320
+ }
2321
+
2322
+ export { OutletView as O, Renderer as R, _resetRenderers as _, renderComponent as a, outletHelper as o, renderSettled as r };